lilei il y a 4 ans
Parent
commit
68ce9401e6

+ 13 - 7
src/views/salesManagement/waitDispatch/edit.vue

@@ -99,6 +99,7 @@
           type="primary"
           class="button-primary"
           @click="handleSubmit()"
+          :loading="loading"
           id="productInfoList-handleSubmit">下推</a-button>
       </div>
     </a-affix>
@@ -120,7 +121,8 @@ export default {
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
-      delLoading: false,
+      delLoading: false, // 是否正在移除产品
+      loading: false, // 是否下推中
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
       productForm: {
@@ -215,7 +217,7 @@ export default {
       }
       const obj = []
       _this.selectedRows.map(item => {
-        obj.push(item.productSn)
+        obj.push(item.salesBillDetailSn)
       })
 
       this.$confirm({
@@ -245,7 +247,7 @@ export default {
     deleteFun (row, type) {
       const _this = this
       _this.delLoading = true
-      deleteBatch({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
+      deleteBatch(type == 0 ? [row.salesBillDetailSn] : row).then(res => {
         if (res.status == 200) {
           _this.resetSearchForm(true)
           _this.$message.success(res.message)
@@ -265,9 +267,7 @@ export default {
     saveNewProduct (list) {
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
-      insertBatchOfWaitDispatch({
-        list: list
-      }).then(res => {
+      insertBatchOfWaitDispatch(list).then(res => {
         if (res.status == 200) {
           this.resetSearchForm()
           this.$refs.partQuery.resetCurForm()
@@ -303,11 +303,17 @@ export default {
     },
     // 提交下推
     handleSubmit () {
-      pushDown({ salesBillSn: this.salesBillSn }).then(res => {
+      this.delLoading = true
+      this.isInster = true
+      this.loading = true
+      pushDown({ salesBillSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
         }
+        this.delLoading = false
+        this.isInster = false
+        this.loading = false
       })
     }
   },

+ 10 - 1
src/views/salesManagement/waitDispatch/queryPart.vue

@@ -270,7 +270,16 @@ export default {
     },
     // 一键下推
     handleOneDispatch () {
-      this.$emit('oneDispatch')
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定后,所有有货的产品将自动添加到待下推列表,确定要进行有货一键下推吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.$emit('oneDispatch')
+        }
+      })
     },
     //  产品分类  change
     changeProductType (val, opt) {