diff --git a/src/views/modules/pms/blenderBatch/components/ListViewWithHead.vue b/src/views/modules/pms/blenderBatch/components/ListViewWithHead.vue index 5051f9f..9738d20 100644 --- a/src/views/modules/pms/blenderBatch/components/ListViewWithHead.vue +++ b/src/views/modules/pms/blenderBatch/components/ListViewWithHead.vue @@ -26,13 +26,7 @@ :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> - + @@ -41,6 +35,7 @@ import BaseListTable from "@/components/BaseListTable.vue"; import BaseSearchForm from "@/components/BaseSearchForm.vue"; import DialogJustForm from "./DialogJustForm.vue"; +import edit from "./edit.vue"; import Overlay from "@/components/Overlay.vue"; import moment from "moment"; @@ -50,6 +45,7 @@ export default { BaseSearchForm, BaseListTable, DialogJustForm, + edit, Overlay, }, props: { @@ -97,6 +93,11 @@ export default { dialogType() { return this.dialogConfigs.menu ? DIALOG_WITH_MENU : DIALOG_JUST_FORM; }, + blenderOrderId() { + const item = this.listQueryExtra.find((item) => item.blenderOrderId); + console.log("Find blenderOrderId", item); + return item ? item.blenderOrderId : null; + }, }, activated() { this.refreshLayoutKey = this.layoutTable(); @@ -119,6 +120,7 @@ export default { }, data() { return { + editVisible: false, dialogVisible: false, topBtnConfig: null, totalPage: 0, @@ -142,6 +144,19 @@ export default { this.initDataWhenLoad && this.getList(); }, methods: { + handleDestroy(type, refresh) { + switch (type) { + case "edit": + this.dialogVisible = false; + if (refresh) { + this.getList(); + } + break; + case "detail": + this.dialogVisible = false; + break; + } + }, /** 获取 列表数据 */ getList(queryParams) { this.tableLoading = true; @@ -281,7 +296,6 @@ export default { .catch((err) => {}); } case "edit": { - console.log("[edit] ", data); this.openDialog(data); /** data is ==> id */ break; } @@ -303,7 +317,6 @@ export default { }, handleBtnClick({ btnName, payload }) { - console.log("[search] form handleBtnClick", btnName, payload); switch (btnName) { case "批量同步": this.overlayVisible = true; @@ -354,7 +367,6 @@ export default { }); } }); - console.log("查询", this.cachedSearchCondition); this.getList(this.cachedSearchCondition); break; } @@ -396,18 +408,10 @@ export default { }, /** 打开对话框 */ - openDialog(row_id, detail_mode, tag_info) { + openDialog(row_id, detail_mode) { this.dialogVisible = true; - let extraParams = null; - if (this.attachListQueryExtra && this.listQueryExtra.length) { - this.listQueryExtra.forEach((item) => { - let found = item[this.attachListQueryExtra]; - if (found !== null && found !== undefined) extraParams = item; - }); - } this.$nextTick(() => { - console.log(`[edit-dialog] extraParams: ${extraParams}`); - this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams); + this.$refs["edit"].init(row_id, detail_mode); }); }, }, diff --git a/src/views/modules/pms/blenderBatch/components/edit.vue b/src/views/modules/pms/blenderBatch/components/edit.vue new file mode 100644 index 0000000..2397f4b --- /dev/null +++ b/src/views/modules/pms/blenderBatch/components/edit.vue @@ -0,0 +1,225 @@ + + + + + + + {{ dataForm.id ? "编辑" : "新增" }} + + + + + + + + + + + + + + + + + + + + + + {{ bom.label }} + + + + + + + + + + + + + + 保存 + + 更新 + 取消 + + + + + + + diff --git a/src/views/modules/pms/blenderBatch/config.js b/src/views/modules/pms/blenderBatch/config.js index 720c5ac..fa45b42 100644 --- a/src/views/modules/pms/blenderBatch/config.js +++ b/src/views/modules/pms/blenderBatch/config.js @@ -24,8 +24,8 @@ export default function () { // { prop: "remark", label: "备注" }, // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent { prop: "description", label: "详情", subcomponent: TableTextComponent, actionName: "view-blender-batch-details" }, - { prop: 'bomName', label: '牌号' }, - { prop: 'bomVersion', label: '版本号' }, + { prop: "bomName", label: "牌号" }, + { prop: "bomVersion", label: "版本号" }, // { width: 160, prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "operations", @@ -93,6 +93,8 @@ export default function () { rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请输入批次重量" }, }, + ], + [ { input: true, label: "牌号", @@ -100,6 +102,8 @@ export default function () { rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请输入批次重量" }, }, + ], + [ { select: [], label: "版本号", diff --git a/src/views/modules/pms/blenderBatch/index.vue b/src/views/modules/pms/blenderBatch/index.vue index 8bb825f..f674c2e 100644 --- a/src/views/modules/pms/blenderBatch/index.vue +++ b/src/views/modules/pms/blenderBatch/index.vue @@ -4,7 +4,6 @@ :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :list-query-extra="[{ blenderOrderId: id }]" - attach-list-query-extra="blenderOrderId" :trigger-update="triggerUpdateKey" /> @@ -24,7 +23,7 @@ export default { computed: { // 混料订单id id() { - console.log("computed id"); + console.log("computed id", this.$route.query.id || ""); return this.$route.query.id || ""; }, refreshPage() {