update 原料使用预计和连接配置

This commit is contained in:
lb 2023-04-27 14:17:57 +08:00
parent 343aadc6d9
commit 7fd75beeed
5 changed files with 237 additions and 4 deletions

View File

@ -39,8 +39,8 @@
<script> <script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am'; // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/pms-am'; // xv // window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/pms-am'; // xv
</script> </script>
<% } %> <% } %>

View File

@ -141,7 +141,7 @@ export default {
dialogVisible: false, dialogVisible: false,
carPayloadDialogVisible: false, carPayloadDialogVisible: false,
topBtnConfig: null, topBtnConfig: null,
totalPage: 100, totalPage: 0,
page: 1, page: 1,
size: 20, // 20 size: 20, // 20
dataList: [], dataList: [],
@ -555,7 +555,7 @@ export default {
Object.assign(this.cachedSearchCondition, payload); Object.assign(this.cachedSearchCondition, payload);
if ("timerange" in payload) { if ("timerange" in payload) {
if (!!payload.timerange) { if (!!payload.timerange) {
const [startTime, endTime] = params["timerange"]; const [startTime, endTime] = payload["timerange"];
this.cachedSearchCondition.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); this.cachedSearchCondition.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
this.cachedSearchCondition.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss"); this.cachedSearchCondition.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
} else { } else {

View File

@ -0,0 +1,167 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
import request from "@/utils/request";
import { dictFilter } from '@/utils/filters'
import { timeFilter } from '@/utils/filters'
const kgFilter = val => {
if (val !== undefined && val !== null) return +val + ' kg'
else return '-'
}
export default function () {
const tableProps = [
{ type: 'index', label: '序号' },
{ prop: "matCode", label: "原料编码" },
{ prop: "matDesc", label: "原料描述" },
{ prop: "sum", label: "计算用量", filter: kgFilter },
{ prop: "store", label: "料仓存量", filter: kgFilter },
// {
// prop: "operations",
// name: "操作",
// fixed: "right",
// width: 90,
// subcomponent: TableOperaionComponent,
// options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" }],
// },
];
const headFormFields = [
// {
// prop: 'name',
// label: "料仓名称",
// input: true,
// default: { value: "" },
// bind: {
// // placeholder: '请输入产线名称或编码'
// placeholder: '请输入料仓名称'
// }
// },
{
timerange: true,
prop: 'timerange',
label: "时间段",
bind: {
placeholder: '请选择时间段',
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
}
},
{
button: {
type: "primary",
name: "查询",
},
},
// {
// button: {
// type: "primary",
// name: "新增",
// permission: ""
// },
// bind: {
// plain: true,
// }
// },
];
const dialogJustFormConfigs = {
form: {
rows: [
[
{
input: true,
label: "料仓名称",
prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓名称" },
},
],
[
{
input: true,
label: "料仓编码",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓编码" },
},
],
[
{
select: true,
label: "料仓类型",
prop: "typeDictValue",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
options: [
// TODO: 或许映射可以全权交给数据字典
{ label: '中间仓', value: '0' },
{ label: '日料仓', value: '1' },
],
rules: { required: true, message: "必填项不能为空", trigger: "change" },
elparams: { placeholder: "请选择料仓类型" },
},
// {
// select: true,
// label: "物料",
// prop: "materialId",
// fetchData: () => this.$http.get("/pms/material/page", { params: { key: '', limit: 999, page: 1 } }),
// options: [],
// rules: { required: true, message: "必填项不能为空", trigger: "change" },
// elparams: { placeholder: "请选择物料" },
// },
// {
// input: true,
// label: "加料下限",
// prop: "dosLow",
// rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) },
// ],
// elparams: { placeholder: "请输入加料下限" },
// },
// {
// input: true,
// label: "加料上限",
// prop: "dosHigh",
// rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) },
// ],
// elparams: { placeholder: "请输入加料上限" },
// },
],
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:materialStorage:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:materialStorage:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
],
},
};
// 备注:弹窗弹出的时间和网速有关......
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
// base: "/pms/materialStorage",
page: "/pms/order/matCal",
pageIsPostApi: true
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

View File

@ -0,0 +1,37 @@
<template>
<ListViewWithHead
:init-data-when-load="false"
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:listQueryExtra="['']" />
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "MaterialUsageEstimate",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,29 @@
<template>
<div class="list-view-with-head" ref="pointer-loading-ref">
d
</div>
</template>
<script>
export default {
name: "opcAndBatchConfig",
props: {},
data() {
return {};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped>
.list-view-with-head {
background: white;
/* height: 100%; */
min-height: inherit;
border-radius: 6px;
padding: 16px;
box-shadow: 0 0 1.125px 0.125px rgba(0, 0, 0, 0.125);
}
</style>