diff --git a/src/components/DialogWithMenu.vue b/src/components/DialogWithMenu.vue index 24111bf..0e85167 100644 --- a/src/components/DialogWithMenu.vue +++ b/src/components/DialogWithMenu.vue @@ -61,6 +61,9 @@ +
+ {{ dataForm[col.prop] || "-" }} +
item.key === menu.key)?.name; } }); @@ -881,4 +884,8 @@ ul.file-list > li:hover { /* .image-preview-dialog { } */ + +.force-disabled { + margin-top: 42px; +} diff --git a/src/components/SmallDialog.vue b/src/components/SmallDialog.vue index c05ca88..16327dc 100644 --- a/src/components/SmallDialog.vue +++ b/src/components/SmallDialog.vue @@ -210,4 +210,8 @@ export default { border-radius: 8px; box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.2); } + +.a-small-dialog >>> .el-select { + width: 100%; +} diff --git a/src/components/noTemplateComponents/operationComponent.js b/src/components/noTemplateComponents/operationComponent.js index 54e20e9..397cb4c 100644 --- a/src/components/noTemplateComponents/operationComponent.js +++ b/src/components/noTemplateComponents/operationComponent.js @@ -31,6 +31,7 @@ export default { // viewAttr: i18n.t('viewattr'), // preview: i18n.t('preview'), // design: i18n.t('design'), + copy: '复制', edit: '编辑', detail: '详情', delete: '删除', diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index 5c078f0..cafe07a 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -216,15 +216,45 @@ export default { } else { this.$message({ message: `${res.code}: ${res.msg}`, - type: 'error', - duration: 1500 - }) + type: "error", + duration: 1500, + }); } }); break; } case "view-attachment": { this.openDialog(data, false, { key: "attachment" }); + break; + } + case "view-recipe": { + this.openDialog(data, false, { key: "attr" }); + break; + } + case "copy": { + return this.$http + .post(this.urls.copyUrl, data, { + headers: { + "Content-Type": "application/json", + }, + }) + .then(({ data: res }) => { + if (res.code === 0) { + this.$message({ + message: "复制成功!", + type: "success", + duration: 1500, + }); + this.getList(); + } + }) + .catch((errMsg) => { + this.$message({ + message: errMsg, + type: "error", + duration: 1500, + }); + }); } } }, @@ -237,17 +267,24 @@ export default { break; case "查询": { const params = {}; - this.listQueryExtra?.map(cond => { + this.listQueryExtra?.map((cond) => { if (!!payload[cond]) { - params[cond] = payload[cond] + params[cond] = payload[cond]; } else { - params[cond] = '' + params[cond] = ""; } }); console.log("查询", params); this.getList(params); break; } + case "同步": + this.$http.post(this.urls.syncUrl).then(({ data: res }) => { + if (res.code === 0) { + this.getList(); + } + }); + break; } }, diff --git a/src/views/modules/pms/bom/config.js b/src/views/modules/pms/bom/config.js index d935e30..58be7ae 100644 --- a/src/views/modules/pms/bom/config.js +++ b/src/views/modules/pms/bom/config.js @@ -1,7 +1,7 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import TableTextComponent from "@/components/noTemplateComponents/detailComponent"; import { timeFilter, dictFilter } from "@/utils/filters"; -import switchBtn from "@/components/noTemplateComponents/switchBtn"; +// import switchBtn from "@/components/noTemplateComponents/switchBtn"; export default function () { const tableProps = [ @@ -13,8 +13,8 @@ export default function () { // { prop: "specifications", label: "程序号" }, // { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") }, // { prop: "unitDictValue", label: "物料号", filter: dictFilter("unit") }, - { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent - { prop: "sumqty", label: "配方总重量" }, + // { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent + { prop: "sumqty", label: "配方总重量[kg]", filter: val => !!val ? val + ' kg' : '-' }, { prop: "sync", label: "同步状态" }, { prop: "remark", label: "备注" }, { prop: "description", label: "详情", subcomponent: TableTextComponent, buttonContent: "查看配方详情", actionName: 'view-recipe' }, @@ -22,9 +22,9 @@ export default function () { prop: "operations", name: "操作", fixed: "right", - width: 120, + width: 160, subcomponent: TableOperaionComponent, - options: ["edit", { name: "delete", emitFull: true, permission: "pms:bom:delete" }], + options: ["copy", "edit", { name: "delete", emitFull: true, permission: "pms:bom:delete" }], }, ]; @@ -49,6 +49,13 @@ export default function () { permission: "pms:bom:save", }, }, + { + button: { + // type: "plain", + name: "同步", + type: 'primary' + }, + }, ]; const dictList = JSON.parse(localStorage.getItem("dictList") || {}); @@ -106,9 +113,11 @@ export default function () { elparams: { placeholder: "请输入版本号" }, }, { - input: true, + // input: true, + forceDisabled: true, label: "同步状态", prop: "sync", + key: 'sync', // rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请输入同步状态" }, }, @@ -129,9 +138,9 @@ export default function () { { type: "index", label: "序号" }, { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "material", label: "物料", isEditField: true }, - { prop: "qty", label: "配方物料重量", isEditField: true }, - { prop: "sumqty", label: "配方总重量", isEditField: true }, - { prop: "percent", label: "配比", isEditField: true }, + { prop: "qty", label: "配方物料重量[kg]", filter: val => !!val ? val + ' kg' : '-', isEditField: true }, + { prop: "sumqty", label: "配方总重量[kg]", filter: val => !!val ? val + ' kg' : '-', isEditField: true }, + { prop: "percent", label: "配比[%]", filter: val => !!val ? val + ' %' : '-', isEditField: true }, { prop: "remark", label: "备注", isEditField: true }, { prop: "operations", @@ -186,7 +195,7 @@ export default function () { }, { input: true, - label: "物料重量", + label: "物料重量[kg]", prop: "qty", rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请输入物料重量" }, @@ -214,6 +223,8 @@ export default function () { urls: { base: "/pms/bom", page: "/pms/bom/page", + syncUrl: "/pms/bom/sync", + copyUrl: "/pms/bom/copy", subase: "/pms/bomMaterial", subpage: "/pms/bomMaterial/page", },