From 56cf799cfbee6a7e77dd507683b328096969ee44 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 1 Mar 2023 16:42:36 +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/components/autocomplete/index.vue | 3 ++- .../companyManagement/index.vue | 3 ++- src/views/product/components/add.vue | 7 ++++++- src/views/product/components/adjust.vue | 18 ++++++++++++++++-- src/views/product/components/record.vue | 4 ++-- src/views/product/index.vue | 6 +++--- src/views/refineryAccount/components/add.vue | 7 ++++++- 7 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/components/autocomplete/index.vue b/src/components/autocomplete/index.vue index b6cb1c7..dcb7e64 100644 --- a/src/components/autocomplete/index.vue +++ b/src/components/autocomplete/index.vue @@ -66,7 +66,8 @@ export default { handler(nval, oval) { this.list = []; // this.isDisabled = !!this.config.isDisabled; - if (nval) { + let type = this.$utils.typeJudgment(this.config.echoName); + if (nval && ["String"].includes(type)) { let resultName = this.config.echoName.replace(/\s*/g, ""); if (!resultName) return; this.remoteMethod(resultName); diff --git a/src/views/customerManagement/companyManagement/index.vue b/src/views/customerManagement/companyManagement/index.vue index a8b0eeb..0b83595 100644 --- a/src/views/customerManagement/companyManagement/index.vue +++ b/src/views/customerManagement/companyManagement/index.vue @@ -501,7 +501,8 @@ export default { querykey: "companyName", }, configAutocompleteHead: { - serveTarget: commonServe.getCompanyNames, + serveTarget: commonServe.getRefineryCompanyList, + autocompleteKey: "name", labelKey: "name", valueKey: "name", placeholder: "总公司名称", diff --git a/src/views/product/components/add.vue b/src/views/product/components/add.vue index b3f6ba3..816b2f5 100644 --- a/src/views/product/components/add.vue +++ b/src/views/product/components/add.vue @@ -36,7 +36,11 @@ placeholder="请选择炼厂" > --> - + { + this.$refs.autocomplete.list = []; this.$refs.form.clearValidate(); this.controlWindows.add = false; }); diff --git a/src/views/product/components/adjust.vue b/src/views/product/components/adjust.vue index 31d384e..0379c4f 100644 --- a/src/views/product/components/adjust.vue +++ b/src/views/product/components/adjust.vue @@ -41,14 +41,28 @@ export default { controlWindows: Object, }, data() { + let validatorFloorPrice = (rule, value, callback) => { + if (!value || !+value) return callback("成本价价不能为0或空"); + callback(); + }; + let validatorSalePrice2company = (rule, value, callback) => { + if (!value || !+value) return callback("企业销售价不能为0或空"); + if (value < this.form.floorPrice) + return callback("企业销售价不能低于成本价"); + callback(); + }; return { form: {}, rules: { floorPrice: [ - { required: true, message: "请输入成本价", trigger: "blur" }, + { required: true, validator: validatorFloorPrice, trigger: "change" }, ], salePrice2company: [ - { required: true, message: "请输入企业销售价", trigger: "blur" }, + { + required: true, + validator: validatorSalePrice2company, + trigger: "change", + }, ], }, }; diff --git a/src/views/product/components/record.vue b/src/views/product/components/record.vue index 34f3d33..8e404e8 100644 --- a/src/views/product/components/record.vue +++ b/src/views/product/components/record.vue @@ -66,7 +66,7 @@

- + - + - + - + diff --git a/src/views/refineryAccount/components/add.vue b/src/views/refineryAccount/components/add.vue index 1bae97d..7e5a9cb 100644 --- a/src/views/refineryAccount/components/add.vue +++ b/src/views/refineryAccount/components/add.vue @@ -27,7 +27,11 @@
- + @@ -104,6 +108,7 @@ export default { this.form = {}; this.controlWindows.addInfo = {}; this.$nextTick(() => { + this.$refs.autocomplete.list = []; this.$refs.form.clearValidate(); this.controlWindows.add = false; });