Browse Source

销售退货bug修复

chenrui 3 năm trước cách đây
mục cha
commit
42ade57a15
1 tập tin đã thay đổi với 26 bổ sung20 xóa
  1. 26 20
      src/views/salesManagement/salesReturn/chooseCustomModal.vue

+ 26 - 20
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -224,27 +224,32 @@ export default {
     // 客户 change
     custChange (obj) {
       const _this = this
-      const cust = obj.row
-      this.form.buyerSn = cust.customerSn
-      // 编辑
-      if (this.isEdit) {
-        this.$confirm({
-          title: '提示',
-          content: '更换客户后信息需要重新完善,确认要更换吗?',
-          centered: true,
-          onOk () {
-            _this.custId = cust.id
-            _this.form.buyerName = cust.customerName
-            _this.getDetail()
-          },
-          onCancel () {
-            _this.form.buyerSn = _this.buyerSnBak
-          }
-        })
+      if (obj && obj.key) {
+        const cust = obj.row
+        this.form.buyerSn = cust.customerSn
+        // 编辑
+        if (this.isEdit) {
+          this.$confirm({
+            title: '提示',
+            content: '更换客户后信息需要重新完善,确认要更换吗?',
+            centered: true,
+            onOk () {
+              _this.custId = cust.id
+              _this.form.buyerName = cust.customerName
+              _this.getDetail()
+            },
+            onCancel () {
+              _this.form.buyerSn = _this.buyerSnBak
+            }
+          })
+        } else {
+          _this.custId = cust.id
+          _this.form.buyerName = cust.customerName
+          _this.getDetail()
+        }
       } else {
-        _this.custId = cust.id
-        _this.form.buyerName = cust.customerName
-        _this.getDetail()
+        this.$refs.ruleForm.resetFields()
+        this.$refs.custList.resetForm()
       }
     },
     // 编辑客户信息
@@ -349,6 +354,7 @@ export default {
     cancel () {
       this.opened = false
       this.$refs.ruleForm.resetFields()
+      this.$refs.custList.resetForm()
       this.$emit('cancel')
     },
     // 获取城市列表