From 33a5b7481c54b5f402959d5d9151307d3756b183 Mon Sep 17 00:00:00 2001 From: duan Date: Tue, 2 Aug 2022 18:45:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(reagent):=20=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=85=B1=E6=9C=89=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96reagentform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ReagentForm/index.vue | 26 ++++++---------- src/components/Scannner/index.vue | 3 ++ src/views/reagent/mixin/getClients.js | 15 +++++++++ .../reagent/report/reagentinfo/index.vue | 11 ++++++- src/views/reagent/report/record/index.vue | 11 ++++++- .../reagent/report/usefrequency/index.vue | 11 ++++++- src/views/reagent/warehousing/index.vue | 31 +++++++++++-------- 7 files changed, 76 insertions(+), 32 deletions(-) create mode 100644 src/views/reagent/mixin/getClients.js diff --git a/src/components/ReagentForm/index.vue b/src/components/ReagentForm/index.vue index 1dc10ec..6b17eef 100644 --- a/src/components/ReagentForm/index.vue +++ b/src/components/ReagentForm/index.vue @@ -130,22 +130,7 @@ export default { data() { return { - formData: { - name: this.propsformdata.name, - english_name: this.propsformdata.english_name, - cas_number: this.propsformdata.cas_number, - purity: this.propsformdata.purity, - num: 1, - production_date: this.propsformdata.production_date, - expiration_date: this.propsformdata.expiration_date, - manufacturer: this.propsformdata.manufacturer, - distributor: this.propsformdata.distributor, - speci: this.propsformdata.speci, - // field118: undefined, - shelf_life: 0, - net_weight_unit: this.propsformdata.net_weight_unit, - total: this.propsformdata.total - }, + formData: {}, rules: { name: [{ required: true, @@ -183,6 +168,15 @@ export default { } } }, + watch: { + propsformdata: { + handler(newValue, oldValue) { + this.formData = { ...newValue } + }, + deep: true, + immediate: true + } + }, methods: { handleConfirm() { this.$refs['elForm'].validate(valid => { diff --git a/src/components/Scannner/index.vue b/src/components/Scannner/index.vue index b89f564..5e5ac98 100644 --- a/src/components/Scannner/index.vue +++ b/src/components/Scannner/index.vue @@ -1,3 +1,6 @@ +