瀏覽代碼

Merge branch 'dev' into 'purchaseDev'

Dev20231227

See merge request new-business/drp-web!631
李园 1 年之前
父節點
當前提交
5c9d08b6f4

+ 18 - 5
src/components/popover-select/index.vue

@@ -125,6 +125,19 @@ export default {
       },
       immediate: true,
     },
+    innerValue: {
+      handler: function (newValue) {
+        if (!newValue) {
+          const {
+            $props: { source, dataMapping },
+          } = this;
+          for (let key in dataMapping) {
+            source[key] = undefined;
+          }
+          this.$emit("update:source", source);
+        }
+      },
+    },
   },
   methods: {
     //
@@ -256,11 +269,11 @@ export default {
     handleClear() {
       const { source, multiple, dataMapping } = this.$props;
       if (!multiple) {
-        // this.innerValue = "";
-        for (let key in dataMapping) {
-          source[key] = "";
-        }
-        this.$emit("update:source", source);
+        this.innerValue = "";
+        // for (let key in dataMapping) {
+        //   source[key] = "";
+        // }
+        // this.$emit("update:source", source);
       }
     },
     async useAutocomplete(prop, cb) {

+ 5 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -826,10 +826,14 @@ export default {
             (params["stordocId"] = this.params.warehouse);
           let { code, rows } = await orderApi.REFER(params);
           if (code == 200) {
-            !rows.length &&
+            if (!rows.length) {
               this.$notify.warning({
                 message: "粘贴数据检索为空,请检查是否符合要求!",
               });
+              for (const key in dataMapping) {
+                source[key] = "";
+              }
+            }
             rows = rows.map((item) => {
               let obj = {};
               for (const key in dataMapping) {

+ 9 - 1
src/views/purchase/purchase-order/edit/index.vue

@@ -779,10 +779,18 @@ export default {
             (params["stordocId"] = this.params.warehouse);
           let { code, rows } = await orderApi.REFER(params);
           if (code == 200) {
-            !rows.length &&
+            // !rows.length &&
+            //   this.$notify.warning({
+            //     message: "粘贴数据检索为空,请检查是否符合要求!",
+            //   });
+            if (!rows.length) {
               this.$notify.warning({
                 message: "粘贴数据检索为空,请检查是否符合要求!",
               });
+              for (const key in dataMapping) {
+                source[key] = "";
+              }
+            }
             rows = rows.map((item) => {
               let obj = {};
               for (const key in dataMapping) {