From 704f3f56d99933039240c9b3e094fa1c4eac6877 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Mon, 3 Apr 2023 16:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/components/create.vue | 42 ++++++++++++++----------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/views/product/components/create.vue b/src/views/product/components/create.vue index a7dcd56..1425241 100644 --- a/src/views/product/components/create.vue +++ b/src/views/product/components/create.vue @@ -158,7 +158,10 @@ export default { productRowData: {}, configAutocomplete: { serveTarget: refineryInfoServe.findByEntity, - autocompleteKey: "refineryName", + autocompleteKey: { + key: "refineryName", + enableMark: "ENABLE", + }, labelKey: "refineryName", valueKey: "id", placeholder: "炼厂名称", @@ -188,6 +191,23 @@ export default { }; }, methods: { + openDrawer() { + this.form = {}; + let { id } = this.controlWindows.addInfo; + if (id) { + //回显 + this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); + this.configAutocomplete.echoId = id; + this.configAutocomplete.echoName = this.form.refineryName; + this.form.salePrice = this.form.salePrice2company; + this.form.productId = this.form.id; + // delete this.form.id; + this.rowCreate = true; + this.productChange(); + } else { + this.rowCreate = false; + } + }, productDataList(e) { this.productRowData = this.productNameList.filter((item) => item.id == e); this.form.salePrice = this.productRowData[0].salePrice2company; @@ -221,23 +241,7 @@ export default { }); } }, - openDrawer() { - this.form = {}; - let { id } = this.controlWindows.addInfo; - if (id) { - //回显 - this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); - this.configAutocomplete.echoId = id; - this.configAutocomplete.echoName = this.form.refineryName; - this.form.salePrice = this.form.salePrice2company; - this.form.productId = this.form.id; - delete this.form.id; - this.rowCreate = true; - this.productChange(); - } else { - this.rowCreate = false; - } - }, + submit() { this.$refs["form"].validate((valid) => { if (valid) { @@ -262,7 +266,7 @@ export default { this.form = {}; this.customList = []; this.controlWindows.addInfo = {}; - this.configAutocomplete = {}; + // this.configAutocomplete = {}; this.productNameList = []; this.$refs.form.clearValidate(); this.controlWindows.create = false;