diff --git a/src/views/modules/pms/blenderBatch/config.js b/src/views/modules/pms/blenderBatch/config.js index 1df9eef..9de6e21 100644 --- a/src/views/modules/pms/blenderBatch/config.js +++ b/src/views/modules/pms/blenderBatch/config.js @@ -62,13 +62,13 @@ export default function () { form: { rows: [ [ - { - input: true, - label: "批次编码", - prop: "batchNo", - rules: { required: true, message: "必填项不能为空", trigger: "blur" }, - elparams: { placeholder: "请输入批次编码" }, - }, + // { + // input: true, + // label: "批次编码", + // prop: "batchNo", + // rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + // elparams: { placeholder: "请输入批次编码" }, + // }, { input: true, label: "批次重量", diff --git a/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue b/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue index a2e3079..c590362 100644 --- a/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue +++ b/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue @@ -3,36 +3,17 @@
- + - + - - + +
@@ -97,9 +78,9 @@ export default { const params = queryParams ? { ...queryParams, page: this.page, limit: this.size } : { - page: this.page, - limit: this.size, - }; + page: this.page, + limit: this.size, + }; if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { this.listQueryExtra.map((nameOrObj) => { @@ -119,11 +100,11 @@ export default { this.urls.page, this.urls.pageIsPostApi ? { - ...params, - } + ...params, + } : { - params, - } + params, + } ) .then(({ data: res }) => { console.log("[http response] res is: ", res); @@ -200,7 +181,7 @@ export default { } }); }) - .catch((err) => {}); + .catch((err) => { }); } case "edit": { this.openDialog(data); /** data is ==> id */ @@ -220,26 +201,37 @@ export default { }); break; } - case "detach": { - return this.$http - .post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } }) - .then(({ data: res }) => { - if (res.code === 0) { - this.$message({ - message: "下发成功", - type: "success", - duration: 1500, - onClose: () => { - this.getList(); - }, + case "detach": + case "pause-blender": + case "start-blender": { + // 下发订单 + this.$confirm(`确定${(type === 'detach') ? '下发' : (type === 'pause-blender') ? '暂停' : '开始'}该订单吗?`, "提示", { + confirmButtonText: "确认", + cancelButtonText: "我再想想", + type: "warning", + }) + .then(() => { + const realUrl = type === 'detach' ? this.urls.detach : type === 'pause-blender' ? this.urls.pauseBlender : this.urls.startBlender + return this.$http + .post(realUrl, data /* { id: data } */, { headers: { "Content-Type": "application/json" } }) + .then(({ data: res }) => { + if (res.code === 0) { + this.$message({ + message: `${(type === 'detach') ? '下发' : (type === 'pause-blender') ? '暂停' : '开始'}成功`, + type: "success", + duration: 1500, + onClose: () => { + this.getList(); + }, + }); + } else { + this.$message({ + message: `${res.code}: ${res.msg}`, + type: "error", + duration: 1500, + }); + } }); - } else { - this.$message({ - message: `${res.code}: ${res.msg}`, - type: "error", - duration: 1500, - }); - } }); } } diff --git a/src/views/modules/pms/blenderOrder/config.js b/src/views/modules/pms/blenderOrder/config.js index e9c400a..5242bf6 100644 --- a/src/views/modules/pms/blenderOrder/config.js +++ b/src/views/modules/pms/blenderOrder/config.js @@ -33,14 +33,21 @@ export default function () { prop: "operations", name: "操作", fixed: "right", - width: 120, + width: 180, subcomponent: TableOperaionComponent, options: [ - { name: "edit", label: "编辑", emitFull: true, icon: 'edit-outline' }, + { + name: "edit", label: "编辑", emitFull: true, icon: 'edit-outline', enable: injectData => { + const v = injectData.statusDictValue + if (v && +v === 1) return true + return false + } + }, { name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: 'pms-blenderBatch', icon: 'document-copy' }, // 路由跳转至 pms-blenderBatch + { name: "pause-blender", label: "暂停", color: "#f10000", icon: 'video-pause' }, + { name: "start-blender", label: "开始", color: "#0b58ff", icon: 'video-play' }, { name: "detach", label: "下发", color: "#099", icon: 'bottom-right' }, - ], // , url: '/pms/trans/pressDeli' }] - // options: ["copy", { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStep:delete" }], + ], }, ]; @@ -271,6 +278,8 @@ export default function () { // base: "/pms/equipmentTech", page: "/pms/blenderOrder/pageView", detach: "/pms/trans/blenderDeli", + pauseBlender: "/pms/trans/blenderPause", + startBlender: "/pms/trans/blenderStart", pageIsPostApi: true, // 使用post接口来获取page数据,极少用,目前基本上只有工艺管理模块里在用 changeBlender: '/pms/order/changeBlender' // subase: "/pms/equipmentTechParam", diff --git a/src/views/modules/pms/finishedOrder/config.js b/src/views/modules/pms/finishedOrder/config.js new file mode 100644 index 0000000..3d9ac1b --- /dev/null +++ b/src/views/modules/pms/finishedOrder/config.js @@ -0,0 +1,166 @@ +import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; +import request from "@/utils/request"; +import { timeFilter, dictFilter } from "@/utils/filters"; +import { getDictDataList } from '@/utils'; + + +// import StateSelect from '@/components/StateSelect.vue'; + +export default function () { + const tableProps = [ + { type: "index", label: "序号" }, + { prop: "code", label: "流水号" }, + { prop: "carCode", label: "窑车号" }, + { prop: "orderCode", label: "订单号" }, + { prop: "realQty", label: "数量" }, + { prop: "typeDictValue", label: "类型", filter: dictFilter('pallet_type') }, + { prop: "stifling", label: "熏蒸", }, + { prop: "printTime", label: "打印时间", filter: timeFilter }, + { prop: "createTime", label: "添加时间", filter: timeFilter }, + { + prop: "operations", + name: "操作", + fixed: "right", + width: 90, + subcomponent: TableOperaionComponent, + options: [ + { name: "print", label: "打印", icon: "printer" }, + { name: "view-car-record", label: "窑车记录", emitField: 'hisId', icon: "shopping-cart-1" }, + ], + }, + ]; + + const headFormFields = [ + { + prop: "carId", + label: "窑车号", + select: [], + fn: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }), + bind: { + placeholder: "请选择窑车号", + filterable: true + }, + }, + { + prop: "orderId", + label: "订单号", + fieldOptionLabel: 'code', + // fieldOptionValue: 'id', + select: [], + fn: () => this.$http.post("/pms/order/pageView", { page: 1, limit: 999 }), + bind: { + placeholder: "请选择订单号", + filterable: true + }, + }, + { + button: { + type: "primary", + name: "查询", + }, + }, + ]; + + const dialogJustFormConfigs = { + form: { + rows: [ + [ + { + select: true, + label: "窑车号", + prop: "carId", + options: [], + fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { + disabled: true, + } + }, + { + select: true, + label: "状态", + prop: "stateDictValue", + options: getDictDataList('car_state').map(i => ({ label: i.dictLabel, value: i.dictValue })), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { + fliterable: true + } + }, + ], + [ + { + // select: true, + input: true, + label: "位置", + prop: "pos", + // options: getDictDataList(), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { + // fliterable: true + + } + }, + { + label: "查看载砖详情", + button: true, + onClick: function (id) { // 必须用 function 形式 + console.log(`查看载砖详情`, id) + this.$emit('emit-data', { type: 'to-car-payload', data: id }) + } + }, + ], + ], + operations: [ + // { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false }, + // { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true }, + // { name: "reset", label: "重置", type: "warning", showAlways: true }, + ], + }, + }; + + const carPayloadDialogConfigs = { + dialogWidth: '70%', + carPayloadDialog: true, + clickModalToClose: true, + tableConfig: { + table: null, + column: [ + // 窑车的 装载详情 + // tableProps + { width: 56, type: "index", label: "序号" }, + { prop: "orderCode", label: "订单号" }, + { width: 80, prop: "orderCate", label: "订单子号" }, + { prop: "bomCode", label: "配方" }, + { prop: "shapeCode", label: "砖型" }, + { width: 80, prop: "qty", label: "订单数量" }, + { width: 72, prop: "goodqty", label: "合格数" }, + { width: 72, prop: "badqty", label: "废砖数" }, + // { prop: "startTime", label: "开始时间" }, + // { prop: "endTime", label: "结束时间" }, + // { prop: "remark", label: "备注" }, + ], + }, + }; + + + + return { + carPayloadDialogConfigs, + dialogConfigs: dialogJustFormConfigs, + tableConfig: { + table: null, // 此处可省略,el-table 上的配置项 + column: tableProps, // el-column-item 上的配置项 + }, + headFormConfigs: { + rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 + fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 + }, + urls: { + base: '/pms/carHistory', + payload: '/pms/carHandle', // hisId 查询 载砖详情 + page: "/pms/pallet/pageView", + pageIsPostApi: true, + printLog: '/pms/pallet/print', // post + }, + }; +} diff --git a/src/views/modules/pms/finishedOrder/index.vue b/src/views/modules/pms/finishedOrder/index.vue new file mode 100644 index 0000000..ac9e422 --- /dev/null +++ b/src/views/modules/pms/finishedOrder/index.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index cd5cadb..29c0845 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -43,7 +43,7 @@ export default function () { { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" }, ], finished: [ - { name: 'view-ongoing', label: '查看详情', emitFull: true }, + { name: 'view-ongoing', label: '查看详情', icon: 'view', emitFull: true }, // { name: 'view', label: '查看详情' } // { name: 'end-order', label: '结束订单', icon: 'error', showText: true }, ],