Qukatie 11 mēneši atpakaļ
vecāks
revīzija
f1b85019f0

+ 26 - 0
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -278,4 +278,30 @@ export const revokeRedeem = (data) => {
     method: 'POST',
     data: data
   })
+}
+
+// 是否存在融资
+export const whetherExistenceFinancing = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/whetherExistenceFinancing',
+    method: 'POST',
+    data: data
+  })
+}
+
+// 出库任务审批
+export const checkOrderRW = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/checkOrderRW',
+    method: 'POST',
+    data: data
+  })
+}
+// 撤销出库任务审批
+export const revokeCheckOrderRW = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/revokeCheckOrderRW',
+    method: 'POST',
+    data: data
+  })
 }

+ 7 - 6
src/api/tirePartsMall/salesService/saleOrder.js

@@ -87,11 +87,11 @@ export const revokeCheckOrder = (data) => {
   })
 }
 
-export const goodsListXs = (customId,stock) => {
+export const goodsListXs = (customId, stock) => {
   return request({
     url: '/api/blade-sales-part/goodsDesc/goodsListXs',
     method: 'get',
-    params:{
+    params: {
       customId,
       stock
     }
@@ -102,7 +102,7 @@ export const goodsPageXs = (params) => {
   return request({
     url: '/api/blade-sales-part/goodsDesc/goodsPageXs',
     method: 'get',
-    params:params
+    params: params
   })
 }
 
@@ -174,7 +174,7 @@ export const corpsDescListAll = (data) => {
   return request({
     url: '/api/blade-sales-part/corpsDesc/listAll',
     method: 'get',
-    params:data
+    params: data
   })
 }
 //收款账户下拉
@@ -203,7 +203,7 @@ export const goodsPageDB = (params) => {
   return request({
     url: '/api/blade-sales-part/goodsDesc/goodsPageDB',
     method: 'get',
-    params:params
+    params: params
   })
 }
 // 一件入库
@@ -245,4 +245,5 @@ export const generateReturns = (params) => {
     method: 'get',
     params: params
   })
-}
+}
+

+ 1 - 1
src/views/tirePartsMall/purchasingManagement/financingProcurement/detailsPage.vue

@@ -457,7 +457,7 @@ export default {
             },
             templateUrl: '/api/blade-sales-part/ship/export-item', // 模板url
             form: {
-                whetherFinancing: 0,
+                whetherFinancing: 1,
                 orderItemsList: [],
                 paymentRecordsList: [],
                 outboundRecordsList: []

+ 106 - 27
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -15,10 +15,13 @@
                 </el-button>
 
                 <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
-                    :disabled="isDisabledTask" @click="generateOutbound">
+                    :disabled="isDisabledTask" @click="generateOutbound" v-if="form.taskWhetherAdopt != '审核提交'">
                     {{ buttonText }}
                 </el-button>
-
+                <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
+                    v-if="form.taskWhetherAdopt == '审核提交'" @click="revokeTask">
+                    撤销出库任务审批
+                </el-button>
                 <el-button class="el-button--small-yh" style="margin-left: 6px;" type="info" size="small"
                     :disabled="form.status != '已发货' || form.returnsNumber == form.goodsTotalNum || editButton"
                     @click="getReturns">
@@ -313,7 +316,10 @@ import {
     revokeCheckOrder,
     goodsListXs,
     revokeGenerateShipTask, goodsPageXs,
-    generateReturns
+    generateReturns,
+    whetherExistenceFinancing,
+    checkOrderRW,
+    revokeCheckOrderRW
 } from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
 import reportDialog from "@/components/report-dialog/main";
@@ -1942,34 +1948,83 @@ export default {
                         this.$refs["form"].validate((valid, done) => {
                             done();
                             if (valid) {
-                                submit({
+                                console.log(111)
+                                whetherExistenceFinancing({
                                     bsType: "XS",
                                     ...this.form
                                 }).then(res => {
-                                    // this.refresh(res.data.data.id)
-                                    this.isDisabledTask = false
-                                    generateShipTask(this.form).then(res => {
-                                        this.$message.success("生成出库任务成功");
-                                        // 将按钮文本更改为"撤销任务"
-                                        this.buttonText = '撤销任务';
-                                        // 将按钮颜色更改为对应的颜色
-                                        this.buttonColor = 'warning'; // 比如改为warning
-                                        this.refresh(res.data.data.id)
-                                        this.refreshs(res.data.data.id, true)
-                                        this.isContacts = true
-                                        this.isApplySettlement = false
-                                        this.isAdd = true
-                                        this.isDisabled = true
-                                        this.isAddBtn = true
-                                        this.isDisabledTask = true
-                                        // this.editButton = true // 把编辑按钮显示出来
-                                        loading.close();
-                                    }).catch(() => {
-                                        loading.close();
-                                    });
-                                }).catch(() => {
+                                    if (res.data.data == true) {
+                                        const loading = this.$loading({
+                                            lock: true,
+                                            text: '加载中',
+                                            spinner: 'el-icon-loading',
+                                            background: 'rgba(255,255,255,0.7)'
+                                        });
+                                        submit({
+                                            bsType: "XS",
+                                            ...this.form
+                                        }).then(res => {
+                                            // this.refresh(res.data.data.id)
+                                            this.isDisabledTask = false
+                                            generateShipTask(this.form).then(res => {
+                                                this.$message.success("生成出库任务成功");
+                                                // 将按钮文本更改为"撤销任务"
+                                                this.buttonText = '撤销任务';
+                                                // 将按钮颜色更改为对应的颜色
+                                                this.buttonColor = 'warning'; // 比如改为warning
+                                                this.refresh(res.data.data.id)
+                                                this.refreshs(res.data.data.id, true)
+                                                this.isContacts = true
+                                                this.isApplySettlement = false
+                                                this.isAdd = true
+                                                this.isDisabled = true
+                                                this.isAddBtn = true
+                                                this.isDisabledTask = true
+                                                // this.editButton = true // 把编辑按钮显示出来
+                                            }).finally(() => {
+                                                loading.close();
+                                            })
+                                        }).finally(() => {
+                                            loading.close();
+                                        })
+                                    } else {
+                                        this.$confirm(res.data.data, '提示', {
+                                            confirmButtonText: '确定',
+                                            cancelButtonText: '取消',
+                                            type: 'warning'
+                                        }).then(() => {
+                                            const loading = this.$loading({
+                                                lock: true,
+                                                text: '加载中',
+                                                spinner: 'el-icon-loading',
+                                                background: 'rgba(255,255,255,0.7)'
+                                            });
+                                            checkOrderRW({
+                                                bsType: "XS",
+                                                ...this.form
+                                            }).then(res => {
+                                                this.$message.success("提交成功");
+                                                // 将按钮文本更改为"撤销任务"
+                                                this.buttonText = '撤销任务';
+                                                // 将按钮颜色更改为对应的颜色
+                                                this.buttonColor = 'warning'; // 比如改为warning
+                                                this.refresh(res.data.data.id)
+                                                this.refreshs(res.data.data.id, true)
+                                                this.isContacts = true
+                                                this.isApplySettlement = false
+                                                this.isAdd = true
+                                                this.isDisabled = true
+                                                this.isAddBtn = true
+                                                this.isDisabledTask = true
+                                            }).finally(() => {
+                                                loading.close();
+                                            })
+                                        })
+                                    }
+                                }).finally(() => {
                                     loading.close();
-                                });
+                                })
+
                                 done();
                             } else {
                                 this.$message.error('请选择仓库')
@@ -2037,6 +2092,30 @@ export default {
 
             }
         },
+        revokeTask() {
+            this.$confirm('是否撤销出库任务审批?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                revokeCheckOrderRW(this.form).then(res => {
+                    this.buttonText = '生成任务';
+                    // 将按钮颜色还原为success
+                    this.buttonColor = 'success';
+                    this.$message.success("撤销出库成功");
+                    this.refresh(res.data.data.id)
+                    this.isApplySettlement = false
+                    this.isContacts = true
+                    this.isDisabled = true
+                    this.isDisabledTask = false
+                    this.$set(this.optionForm, 'disabled', false) // form 表单的禁用放开
+                    this.$set(this.optionContactsBack, 'disabled', false) // table 表格的禁用放开
+                    // this.editButton = true // 把编辑按钮显示出来
+                    //添加删除按钮禁用
+                    this.isAdd = true
+                })
+            })
+        },
         //联系人change
         contactsChange(e) {
             // 假设this.contactsOption是你的数组对象