zhouhao hace 2 años
padre
commit
36f68a1b4c

+ 11 - 3
src/components/SalesDialog/SalesDialog.vue

@@ -30,7 +30,8 @@ export default {
   mixins: [import_mixin],
   props: {
     dialogVisible: false,
-    func: Function
+    func: Function,
+    customerNumber:String
   },
   data() {
     return {
@@ -65,7 +66,8 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: true,
+        selectable:this.selectable
       },
       // 表格事件
       tableEvents: {
@@ -146,8 +148,14 @@ export default {
         this.$errorMsg('请选择产品')
       }
       // this.$parent.dialogVisible = false
-    }
+    },
+    selectable(row,index){
+      if (row.customerNumber == this.customerNumber){
+          return false
+      }
+      return  true
 
+    }
     // 批量删除
     // dels() {
     //   if (this.recordSelected.length) {

+ 14 - 0
src/views/sales/sales_management/components/customer_sales_form.vue

@@ -140,6 +140,13 @@ export default {
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
+      if (!this.dataList.length){
+        this.$nextTick(()=>{
+          this.$refs.header.screenForm = { }
+          this.customerNumber = ''
+        })
+
+      }
     },
     delChange() {
       this.dataList.forEach((k, i) => {
@@ -150,6 +157,13 @@ export default {
           }
         })
       })
+      if (!this.dataList.length){
+        this.$nextTick(()=>{
+          this.$refs.header.screenForm = { }
+          this.customerNumber = ''
+        })
+
+      }
     },
     handleSelection(data) {
       this.selection = data

+ 14 - 0
src/views/sales/sales_management/components/return_sales_form.vue

@@ -129,6 +129,7 @@ export default {
       })
     }
   },
+
   methods: {
     getDialogList(p) {
       return getFrontOrderList(...p)
@@ -140,6 +141,7 @@ export default {
       console.log(this.dataList,selected,this.$refs.header)
       this.details = this.dataList[0]
       this.details.id = this.dataList[0].id
+      this.customerNumber=this.dataList[0].customerNumber
        // this.$refs.header.details.customerName = this.dataList[0].customerName
        // this.$refs.header.details.customerNumber = this.dataList[0].customerNumber
        // this.$refs.header.details.customerNumber = this.dataList[0].pickTime
@@ -151,6 +153,12 @@ export default {
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
+      if (!this.dataList.length){
+        this.$nextTick(()=>{
+          this.details = {}
+          this.customerNumber = ''
+        })
+      }
     },
     delChange() {
       this.dataList.forEach((k, i) => {
@@ -161,6 +169,12 @@ export default {
           }
         })
       })
+      if (!this.dataList.length){
+        this.$nextTick(()=>{
+          this.details = {}
+          this.customerNumber = ''
+        })
+      }
     },
     handleSelection(data) {
       this.selection = data