戴艳蓉 пре 3 година
родитељ
комит
d7d518de55

+ 1 - 6
src/components/globalComponents/goodClass/main.vue

@@ -96,12 +96,7 @@ export default {
       if (e && e.length > 0) {
         let index = this.options.findIndex((v) => v.code === e[0]);
         if (index !== -1) {
-          let model = {
-            id: this.options[index].id,
-            code: this.options[index].code,
-            label: this.options[index].name,
-          };
-          this.$emit("searchChange", model);
+          this.$emit("searchChange", this.options[index]);
         } else {
           this.$emit("searchChange", {});
         }

+ 37 - 40
src/components/globalComponents/search-metal-kind/main.vue

@@ -1,25 +1,24 @@
 <template>
+  <!-- multiple
+    filterable
+    remote
+    :multiple-limit="1" :remote-method="remoteMethod" -->
   <el-select
     v-model="value"
-    multiple
     filterable
-    remote
-    :multiple-limit="1"
     reserve-keyword
     :size="size || 'medium'"
     style="width: 100%"
     :placeholder="placeholder || ''"
     :disabled="disabled"
-    :remote-method="remoteMethod"
     :loading="selectLoading"
     @change="selectChange"
   >
     <el-option
       v-for="(item, index) in options"
-      :key="item.id + index"
-      :label="item.name"
-      :value="item.wsm_code"
-      :disabled="item.status === '0'"
+      :key="item.type + index + 'spec'"
+      :label="item.type_cn"
+      :value="item.type"
     >
     </el-option>
   </el-select>
@@ -58,11 +57,16 @@ export default {
       options: [],
       selectLoading: false,
       searchName: "",
-      formValue: {},
+      formValue: {
+        start: "",
+        end: "",
+        creater: "",
+        status: "",
+        type_cn: "",
+      },
     };
   },
-  // watch: {
-   
+  watch: {
     //  names: function (val, old) {
     //   // console.log(val, old);
     //   this.searchName = val;
@@ -70,48 +74,41 @@ export default {
     //     this.remoteMethod(this.searchName);
     //   }
     // },
-  // },
+  },
   mounted() {
     this.options = [];
     this.selectLoading = false;
+    this.remoteMethod();
   },
   methods: {
     async selectChange(e) {
-      if (e && e.length > 0) {
-        let index = this.options.findIndex((v) => v.wsm_code === e[0]);
-        if (index !== -1) {
-          let model = {
-            id: this.options[index].id,
-            code: this.options[index].type,
-            label: this.options[index].type_cn,
-          };
-          this.$emit("searchChange", model);
-        } else {
-          this.$emit("searchChange", {});
-        }
+      let index = this.options.findIndex((v) => v.type === e);
+      if (index !== -1) {
+        let model = {
+          id: this.options[index].type,
+          code: this.options[index].type,
+          label: this.options[index].type_cn,
+        };
+        this.$emit("searchChange", model);
       } else {
         this.$emit("searchChange", {});
       }
     },
-    async remoteMethod(query) {
+    //query
+    async remoteMethod() {
       this.selectLoading = true;
-      if (query !== "") {
-        this.options = [];
-        let res = {};
-      this.formValue.supplierNo = query;
-          res = await asyncRequest.list(this.formValue);
-
-        if (res && res.code === 0 && res.data) {
-            const { list } = res.data;
-            this.options = list;
-        } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(res.message);
-        }
+      this.options = [];
+      const { code, data, message } = await asyncRequest.list(this.formValue);
+      if (code === 0) {
+        this.options = data;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
       } else {
-        this.options = [];
+        this.$message.warning(message);
       }
+      // } else {
+      //   this.options = [];
+      // }
       this.selectLoading = false;
     },
   },

+ 2 - 2
src/components/globalComponents/search-unit/main.vue

@@ -17,8 +17,8 @@
     <el-option
       v-for="(item, index) in options"
       :key="item.id + index"
-      :label="item.name"
-      :value="item.wsm_code"
+      :label="item.unit"
+      :value="item.id"
       :disabled="item.status === '0'"
     >
     </el-option>

+ 3 - 13
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -43,7 +43,7 @@
 
           <el-col :span="8">
             <el-form-item label="业务公司" prop="company_id">
-              <search-supplier
+              <search-work-company
                 :value="ruleForm.company_id"
                 :placeholder="'业务公司'"
                 :disabled="false"
@@ -494,7 +494,6 @@ export default {
         ],
         noble_metal: [
           {
-            type: "array",
             required: true,
             message: "请选择贵金属种类",
             trigger: "change",
@@ -666,19 +665,10 @@ export default {
     },
     //贵金属种类选择
     noble_metalsearchChange(e) {
+      console.log(e);
       const { id, code, label } = e;
       if (id) {
-        this.ruleForm.noble_metal = code;
-      } else {
-        this.ruleForm.noble_metal = "";
-      }
-      this.$refs.ruleForm.validateField("noble_metal");
-    },
-    //税点选择
-    noble_metalsearchChange(e) {
-      const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.noble_metal = code;
+        this.ruleForm.noble_metal = id;
       } else {
         this.ruleForm.noble_metal = "";
       }