diff --git a/src/components/DialogJustForm.vue b/src/components/DialogJustForm.vue index 6fc9d7a..9c92757 100644 --- a/src/components/DialogJustForm.vue +++ b/src/components/DialogJustForm.vue @@ -277,14 +277,14 @@ export default { typeCode: file.typeCode, url: file.fileUrl, })); - } else { - this.$message({ - message: `${res.code}: ${res.msg}`, - type: "error", - duration: 1500, - }); } // console.log("[DialogJustForm] init():", this.dataForm); + } else { + this.$message({ + message: `${res.code}: ${res.msg}`, + type: "error", + duration: 1500, + }); } this.loadingStatus = false; }) diff --git a/src/views/modules/pms/order/components/ListViewWithHead.vue b/src/views/modules/pms/order/components/ListViewWithHead.vue index 8e3d303..fcedf91 100644 --- a/src/views/modules/pms/order/components/ListViewWithHead.vue +++ b/src/views/modules/pms/order/components/ListViewWithHead.vue @@ -211,12 +211,46 @@ export default { }, inject: ["urls"], mounted() { - this.initDataWhenLoad && this.getList(); + this.getConfirmedList() }, activated() { this.refreshLayoutKey = this.layoutTable(); }, methods: { + // get confirmed list + getConfirmedList(){ + this.$http.post(this.urls.confirmedOrder, { + bomId: "0", + cate: "1", + code: "39999", + startTime: '2022-02-05T22:00:00', + endTime: '2022-02-06T22:00:00', + id: "0", + limit: 10, + page: 1, + shapeId: "1", + techId: "0", + types: 1 // 0 等待 , 1 确认 , 2 生产, 3 暂停, 4 结束, 5 接受, 6 拒绝 + }).then(({data: res}) => { + if (res.code === 0) { + console.log('[get confirmed list]', res) + } else { + this.$message({ + message: `${res.code}: ${res.msg}`, + type: 'error', + duration: 1500 + }) + } + }) + }, + // get unconfirmed list + getUnConfirmedList(){}, + // get ended list + getEndedList(){ + // 只有查看详情 + }, + + handleLoadSub({ tree, treeNode, resolve }) { // console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve); this.$http.get(`${this.urls.tree}?rootId=${tree.id}`).then(({ data: res }) => { diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index 9377b82..e9bdaec 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -86,31 +86,156 @@ export default function () { }, ]; - const headFormFields = [ - { - label: "原料名称/编码", - prop: "key", - input: true, - default: { value: "" }, - bind: { placeholder: "请输入原料名称或编码" }, - }, - { - button: { - type: "primary", - name: "查询", + + const genHeadFormFields = type => ({ + 'ongoing': [ + { + label: '订单号', + prop: 'code', + input: true, + bind: { placeholder: '请输入订单号' } }, - }, - { - button: { - type: "primary", - name: "新增", - permission: "", + { + // 时间段 + timerange: true, + prop: 'timerange', + label: "时间段", + bind: { + placeholder: "选择日期时间", + type: "datetimerange", + "start-placeholder": "开始时间", + "end-placeholder": "结束时间", + }, }, - bind: { - plain: true, + { + // 查询 + button: { + type: "primary", + name: "查询", + }, }, - }, - ]; + ], + 'pending': [ + { + label: '订单号', + prop: 'code', + input: true, + bind: { placeholder: '请输入订单号' } + }, + { + // 查询 + button: { + type: "primary", + name: "查询", + }, + }, + { + // 新增订单 + button: { + type: "primary", + name: "新增", + permission: "", + }, + bind: { + plain: true, + }, + }, + { + // 导入订单 - TODO: 需完善具体接口和功能 + button: { + type: "success", + name: "导入订单", + }, + bind: { + plain: true + } + }, + + ], + 'finished': [ + { + // 查询 + button: { + type: "primary", + name: "查询", + }, + }, + { + label: '订单号', + prop: 'code', + input: true, + bind: { placeholder: '请输入订单号' } + }, + ] + })[type] + + + // const headFormFields = [ + // { + // label: '订单号', + // prop: 'code', + // input: true, + // bind: { placeholder: '请输入订单号' } + // }, + // // { + // // label: '子订单号', + // // prop: 'cate', + // // input: true, + // // bind: { placeholder: '请输入子订单号', rules: [{ type: 'number', message: '请输入整数', trigger: 'blur', transform: val => Number(val) }] } + // // }, + // // { + // // label: "配方", + // // prop: "bomId", + // // select: [], + // // fn: () => this.$http.get('/pms/bom/page', { params: { key: '', limit: 999, page: 1 } }), + // // bind: { placeholder: "请选择配方" }, + // // }, + // // { + // // label: '砖型', + // // prop: 'shapeId', + // // select: [], + // // fn: () => this.$http.get('/pms/shape/page', { params: { key: '', limit: 999, page: 1 } }), + // // bind: { placeholder: "请选择砖型" }, + // // }, + // // { + // // label: '工艺', + // // prop: 'techId', + // // select: [], + // // fn: () => this.$http.post('/pms/equipmentTech/pageView', { key: '', shape: '', wsId: 0, limit: 999, page: 1 }), + // // bind: { placeholder: "请选择砖型" }, + // // }, + // // { + // // label: '订单状态', + // // prop: 'types', // 0等待, 1确认, 2生产,3暂停, 4结束, 5接受, 6拒绝 + // // select: [ + // // {label: '等待', value: 0}, + // // {label: '确认', value: 1}, + // // {label: '生产', value: 2}, + // // {label: '暂停', value: 3}, + // // {label: '结束', value: 4}, + // // {label: '接受', value: 5}, + // // {label: '拒绝', value: 6}, + // // ], + // // // fn: () => this.$http.post('/pms/equipmentTech/pageView', { key: '', shape: '', wsId: 0, limit: 999, page: 1 }), + // // bind: { placeholder: "请选择订单状态" }, + // // }, + // { + // button: { + // type: "primary", + // name: "查询", + // }, + // }, + // { + // button: { + // type: "primary", + // name: "新增", + // permission: "", + // }, + // bind: { + // plain: true, + // }, + // }, + // ]; /** * dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件 @@ -275,8 +400,9 @@ export default function () { finishedTable: genTableProps('finished'), }, headFormConfigs: { - rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 - fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 + ongoingTableSearch: genHeadFormFields('ongoing'), + pendingTableSearch: genHeadFormFields('pending'), + finishedTableSearch: genHeadFormFields('finished') }, urls: { confirmedOrder: '/pms/order/pageCom', diff --git a/src/views/modules/pms/order/index.vue b/src/views/modules/pms/order/index.vue index dab8fae..e624d7a 100644 --- a/src/views/modules/pms/order/index.vue +++ b/src/views/modules/pms/order/index.vue @@ -1,6 +1,6 @@