孤鹤 2 years ago
parent
commit
3b506b1350

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

@@ -765,7 +765,7 @@ export default {
                         this.$set(this.optionForm, 'disabled', true)
                         this.$set(this.optionContactsBack, 'disabled', true)
                         this.isEdit = true
-                        this.$message.success("保存成功");
+                        this.$message.success("入库完成");
                         loading.close();
                     }).finally(() => {
                         loading.close();

+ 2 - 2
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -461,7 +461,7 @@ export default {
             ...this.form,
             bizTypeName: "FHGD"
           }).then(res => {
-            this.$message.success("保存成功");
+            this.$message.success("出库完成");
             this.refresh(res.data.data.id)
             
             loading.close();
@@ -516,7 +516,7 @@ export default {
       })
       getDetails({ id: id }).then(res => {
         if (res.data.data.statusName == '已出库') {
-          // this.$set(this.optionForm, 'disabled', true)
+          this.$set(this.optionForm, 'disabled', true)
           this.isAddDisabled = true
           this.optionContacts.column.forEach(item => {
             if (item.prop == 'sendNum') {

+ 29 - 68
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -14,7 +14,7 @@
                     :disabled="isSaveBtn" @click="editCustomer">保 存
                 </el-button>
                 <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
-                    :disabled="isDisabledTask || form.status !== '待确认'" @click="generateOutbound">
+                    :disabled="isDisabledTask || form.status !== '待确认' && form.status !== '待发货'" @click="generateOutbound">
                     {{ buttonText }}
                 </el-button>
                 <el-dropdown style="padding: 0 6px;line-height: 0">
@@ -702,6 +702,7 @@ export default {
         detailData: Object
     },
     async created() {
+        this.findObject(this.optionContactsBack.column, "goodsId").click = ({ value, column }) => {}
         // console.log(this.$route);
         //         if(this.$route.query.check.actId){
 
@@ -968,6 +969,7 @@ export default {
             }
             if (this.form.status == '待发货') {
                 this.isAddBtn = true
+                this.isDisabledTask = false
             }
             this.optionContactsBack.column.forEach(its => {
                 if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
@@ -1091,7 +1093,7 @@ export default {
                     // this.$set(this.optionContactsBack, 'disabled', false)
                     this.$set(this.optionForm, 'disabled', false)
                     this.$set(this.optionContactsBack, 'disabled', false)
-                   
+
                     this.isContacts = false
                     //删除按钮
                     this.isDisabled = false
@@ -1126,28 +1128,28 @@ export default {
                     // })
                     loading.close()
                 }
+                console.log(this.form.status);
                 if (this.form.status == '待发货') {
                     this.isSaveBtn = false;
                     this.isDisabledTask = false;
                     this.viewDisabled = false;
                 }
-                // this.$set(this.form, 'shipType', '物流')
-                // this.$set(this.form, 'receivableType', '现金')
-                // this.optionContactsBack.column.forEach(item => {
-                //     this.$set(item, 'disabled', false)
-                // })
-                // this.optionContactsBack.column.forEach(item => {
-                //     if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
-                //         item.disabled = true;
-                //     }
-                // })
-                // this['optionContacts'] = this['optionContactsBack'];
-                // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
+                console.log(this.form.outboundRecordsList);
                 this.form.outboundRecordsList.forEach(item => {
                     if (item.statusName == '待出库') {
                         this.isDisabledTask = true
                     }
                 })
+                if(this.form.checkStatus == '审核完成'){
+                    console.log('审核完成');
+                    this.$set(this.optionForm, 'disabled', true)
+                    this.$set(this.optionContactsBack, 'disabled', true)
+                    this.isContacts = true
+                    this.isDisabled = true
+                    //添加删除按钮禁用
+                    this.isAdd = true
+                    this.isAddBtn = true
+                }
                 loading.close()
             }
             // this.$set(this.form.orderItemsList,'goodsNum',66)
@@ -1435,72 +1437,31 @@ export default {
                         items.subTotalMoney = items.goodsNum * items.price
                         items.grossProfit = items.subTotalMoney - items.costprie
                     }
-                    // let brandName = items.brandId
-                    // items.brandId = items.brandName
-                    // items.brandName = brandName
-
-                    // let goodsName = items.goodsId
-                    // items.goodsId = items.goodsName
-                    // items.goodsName = goodsName
-
                 })
+                if (res.data.data.checkStatus == '审核完成') {
+                    console.log('审核完成');
+                    this.$set(this.optionForm, 'disabled', true)
+                    this.$set(this.optionContactsBack, 'disabled', true)
+                    this.isContacts = true
+                    this.isDisabled = true
+                    //添加删除按钮禁用
+                    this.isAdd = true
+                }
                 loading.close();
-
-                // if (this.form.businessSource == "外部销售") {
-                //     console.log('外部销售');
-                //     this.optionForm.column.forEach(its => {
-                //         if (its.prop == 'customerId') {
-                //             this.$set(its, 'disabled', true)
-                //         }
-                //     })
-                //     //不能录入不能删除
-                //     this.$set(this.optionContactsBack, "addBtn", false)
-                //     this.isDisabled = true
-                //     this.$set(this.form, 'shipType', '物流')
-                //     this.$set(this.form, 'receivableType', '网络支付')
-                //     this.optionContactsBack.column.forEach(item => {
-                //         this.$set(item, 'disabled', true)
-                //         if (item.label == '批次号' || item.label == '备注') {
-                //             item.disabled = false
-                //         }
-                //     })
-                //     this['optionContacts'] = this['optionContactsBack'];
-                //     this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
-                //     this.optionContactsBack.column.forEach(item => {
-                //         if (item.prop == 'dot') {
-                //             this.$set(item, disabled, false)
-                //         } else {
-                //             this.$set(item, disabled, true)
-                //         }
-                //     })
-
-                // } else {
-                //     this.$set(this.form, 'shipType', '物流')
-                //     this.$set(this.form, 'receivableType', '现金')
-                //     this.optionContactsBack.column.forEach(item => {
-                //         this.$set(item, 'disabled', false)
-                //     })
-                //     this.optionContactsBack.column.forEach(item => {
-                //         if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述') {
-                //             item.disabled = true;
-                //         }
-                //     })
-                //     console.log(324324);
-                //     this['optionContacts'] = this['optionContactsBack'];
-                //     this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
-                // }
-                // // this.$set(this.form.orderItemsList,'goodsNum',66)
-
             }).catch(() => {
                 loading.close();
             })
         },
+        operationType() {
+        },
         //请核关闭
         choceScheduleFun() {
             this.checkScheduleDialog = false
         },
         //关闭审核
         choceCheckFun() {
+            this.refresh(this.onLoad.id)
+            // this.isDisabledTask = false
             this.isExamineBtn = !this.isExamineBtn
             this.checkDialog = false;
         },

+ 1 - 1
src/views/tirePartsMall/salesManagement/purchaseOrder/index.vue

@@ -82,7 +82,7 @@ export default {
               label: 'cname',
               value: 'id'
             },
-            dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}&enableOrNot=0"
+            dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll"
           }, {
             label: '数量',
             prop: 'goodsNum',

+ 74 - 28
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -363,7 +363,7 @@ export default {
                     label: '结算金额',
                     prop: "paymentAmountTl",
                     disabled: true
-                },{
+                }, {
                     label: '备注',
                     prop: "remarks",
                     type: 'textarea',
@@ -1143,29 +1143,16 @@ export default {
                     if (this.form.orderItemsList.length <= 0) {
                         this.$message.error('请录入明细');
                     } else {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
                         this.$set(this.optionForm, 'disabled', true)
                         this.$set(this.optionContactsBack, 'disabled', true)
                         this.$refs["form"].validate((valid, done) => {
                             if (valid) {
-                                // this.form.orderItemsList.forEach((items) => {
-                                //     let brandName = items.brandId
-                                //     items.brandId = items.brandName
-                                //     items.brandName = brandName
-
-                                //     let goodsName = items.goodsId
-                                //     items.goodsId = items.goodsName
-                                //     items.goodsName = goodsName
-
-                                // })
-                                this.$refs["form"].validate((valid, done) => {
-                                    done();
-                                    if (valid) {
-                                        const loading = this.$loading({
-                                            lock: true,
-                                            text: '加载中',
-                                            spinner: 'el-icon-loading',
-                                            background: 'rgba(255,255,255,0.7)'
-                                        });
                                         submit({
                                             bsType: "XS",
                                             ...this.form
@@ -1179,7 +1166,7 @@ export default {
                                                 this.buttonText = '撤销任务';
                                                 // 将按钮颜色更改为对应的颜色
                                                 this.buttonColor = 'warning'; // 比如改为warning
-                                                this.refresh(res.data.data.id, true)
+                                                this.refreshs(res.data.data.id, true)
                                                 this.isContacts = true
                                                 this.$message.success("生成出库任务成功");
                                                 this.isApplySettlement = false
@@ -1189,14 +1176,9 @@ export default {
                                             }).finally(() => {
                                                 loading.close();
                                             });
-                                        }).finally(() => {
+                                        }).catch(() => {
                                             loading.close();
                                         });
-                                    } else {
-                                        return false;
-                                    }
-                                });
-
                                 done();
                             } else {
                                 this.$message.error('请选择仓库')
@@ -1360,7 +1342,7 @@ export default {
                 this.form = res.data.data
                 let ordForm = { srcBillNo: this.form.ordNo }
                 let _this = this
-                
+
                 this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
                 // getList(1, 50, ordForm).then((res) => {
                 //     this.dataList = res.data.data.records ? res.data.data.records : [];
@@ -1487,6 +1469,70 @@ export default {
                 loading.close();
             })
         },
+        refreshs(id, type) {
+            getDetails({ id: id }).then(res => {
+                this.form = res.data.data
+                let ordForm = { srcBillNo: this.form.ordNo }
+                let _this = this
+
+                this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
+                if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
+                    console.log(1);
+                    this.isApplySettlement = false;
+                }
+                if (
+                    this.form.status === '已退款' ||
+                    this.form.status === '已收货' ||
+                    this.form.status === '已发货' ||
+                    this.form.status === '已取消'
+                ) {
+                    // 禁用编辑按钮
+                    console.log('按钮全部禁用');
+                    this.isEditButton = true;
+                    this.isSaveBtn = true;
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+                }
+                if (this.form.status === '已发货') {
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+                    this.isEditButton = false;
+                }
+                if (this.form.status == '退款中') {
+                    this.isConfirmRefundBtn = false;
+                }
+                if (this.form.status == '已取消') {
+                    this.isConfirmRefundBtn = true;
+                }
+
+                if (this.form.generateTask == '已生成') {
+                    this.buttonText = '撤销任务';
+                    // this.isDisabledTask = false;
+                    this.buttonColor = 'warning'
+                }
+                if (this.form.status == '退款请核' || this.form.status == '退款中') {
+                    this.isRevocationRequest = false;
+                }
+                if (this.form.status == '待发货') {
+                    this.isApplySettlement = false
+                }
+                //成本、毛利对销售角色隐藏
+                this.optionForm.column.forEach(its => {
+                    if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
+                        if (its.prop == 'cost' || its.prop == 'grossProfit') {
+                            this.$set(its, 'display', false)
+                        }
+                    }
+                })
+                this.form.orderItemsList.forEach((items) => {
+                    if (!items.subTotalMoney) {
+                        items.subTotalMoney = items.goodsNum * items.price
+                        items.grossProfit = items.subTotalMoney - items.costprie
+                    }
+                })
+            }).catch(() => {
+            })
+        },
         //请核关闭
         choceScheduleFun() {
             this.checkScheduleDialog = false