diff --git a/src/components/DialogJustForm.vue b/src/components/DialogJustForm.vue index 5f3ea98..f0b1351 100644 --- a/src/components/DialogJustForm.vue +++ b/src/components/DialogJustForm.vue @@ -324,7 +324,7 @@ export default { handleClose() { this.resetForm(); - this.$emit('update:dialogVisible', false); + this.$emit("update:dialogVisible", false); }, }, }; diff --git a/src/components/noTemplateComponents/operationComponent.js b/src/components/noTemplateComponents/operationComponent.js index 58c0b8e..f8ca39c 100644 --- a/src/components/noTemplateComponents/operationComponent.js +++ b/src/components/noTemplateComponents/operationComponent.js @@ -38,7 +38,8 @@ export default { preview: '预览', view: '查看', design: '设计', - 'view-trend': '查看趋势' + 'view-trend': '查看趋势', + 'add-sub': '添加子类' // add more... } } diff --git a/src/views/modules/pms/material/components/DialogJustForm.vue b/src/views/modules/pms/material/components/DialogJustForm.vue new file mode 100644 index 0000000..cf8fa1a --- /dev/null +++ b/src/views/modules/pms/material/components/DialogJustForm.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/src/views/modules/pms/material/components/ListViewWithHead.vue b/src/views/modules/pms/material/components/ListViewWithHead.vue index c8b2250..c577647 100644 --- a/src/views/modules/pms/material/components/ListViewWithHead.vue +++ b/src/views/modules/pms/material/components/ListViewWithHead.vue @@ -38,11 +38,11 @@ :configs="dialogConfigs" @refreshDataList="handleRefreshDatalist" /> + @@ -52,7 +52,7 @@ import BaseListTable from "./BaseListTable.vue"; import BaseSearchForm from "@/components/BaseSearchForm.vue"; import DialogWithMenu from "@/components/DialogWithMenu.vue"; -import DialogJustForm from "@/components/DialogJustForm.vue"; +import DialogJustForm from "./DialogJustForm.vue"; const DIALOG_WITH_MENU = "DialogWithMenu"; const DIALOG_JUST_FORM = "DialogJustForm"; @@ -100,6 +100,40 @@ export default { size: 20, // 默认20 dataList: [], tableLoading: false, + subdialogVisible: false, + subdialogConfigs: { + form: { + rows: [ + [ + { + input: true, + label: "物料名称", + prop: "name", + rules: { required: true, message: "not empty", trigger: "blur" }, + elparams: { placeholder: "请输入物料名称" }, + }, + ], + [ + { + input: true, + label: "物料编码", + prop: "code", + rules: { required: true, message: "not empty", trigger: "blur" }, + elparams: { placeholder: "请输入物料编码" }, + }, + ], + [{ input: true, label: "规格", prop: "description", elparams: { placeholder: "规格" } }], + [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], + [{ input: true, prop: "parentId", elparams: { type: "hidden" }, hidden: true }], + ], + operations: [ + { name: "add", label: "保存", type: "primary", permission: "pms:material:save", showOnEdit: false }, + { name: "update", label: "更新", type: "primary", permission: "pms:material:save", showOnEdit: true }, + // { name: "reset", label: "重置", type: "warning", showAlways: true }, + // { name: 'cancel', label: '取消', showAlways: true }, + ], + }, + }, }; }, inject: ["urls"], @@ -108,7 +142,7 @@ export default { }, methods: { handleLoadSub({ tree, treeNode, resolve }) { - console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve); + // console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve); this.$http.get(`${this.urls.tree}?rootId=${tree.id}`).then(({ data: res }) => { if (res.code === 0 && res.data) { resolve( @@ -229,11 +263,19 @@ export default { }); break; } + case "add-sub": { + // 添加子类 + const parentId = data; + this.subdialogVisible = true; + this.$nextTick(() => { + this.$refs["add-sub-dialog"].init(parentId); + }); + } } }, handleRefreshDatalist() { - location.reload() + location.reload(); }, handleBtnClick({ btnName, payload }) { diff --git a/src/views/modules/pms/material/config.js b/src/views/modules/pms/material/config.js index 19fafd7..cc302dd 100644 --- a/src/views/modules/pms/material/config.js +++ b/src/views/modules/pms/material/config.js @@ -5,7 +5,7 @@ import { timeFilter, dictFilter } from "@/utils/filters"; export default function () { const tableProps = [ - { type: 'index', label: '序号' }, + // { type: 'index', label: '序号' }, // { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "name", label: "物料名称" }, { prop: "code", label: "物料编码" }, @@ -20,9 +20,9 @@ export default function () { prop: "operations", name: "操作", fixed: "right", - width: 120, + width: 180, subcomponent: TableOperaionComponent, - options: ["edit", { name: "delete", permission: "pms:material:save" }], + options: [{ name: "add-sub", permission: "pms:material:save" }, "edit", { name: "delete", permission: "pms:material:save" },], }, ];