Parcourir la source

轮胎销售弹窗判断

caojunjie il y a 1 an
Parent
commit
6d8f1503ba

+ 5 - 0
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -1818,6 +1818,11 @@ export default {
                             }else {
                             }
                         }
+
+                        if (this.form.orderItemsList[i].goodsNum <= 0) {
+                            this.$message.warning(`采购明细序号${Number(i)+1}的数量不能为零`);
+                            picihao = true
+                        }
                     }
                     this.mingxibaocun = true
                     if (picihao) {

+ 37 - 7
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -10,9 +10,10 @@
                 <el-button class="el-button&#45;&#45;small-yh" :disabled="isEditButton" style="margin-left: 6px;"
                     type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
                 </el-button>
-                <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
+                <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
                     :disabled="isSaveBtn" @click="editCustomer">保 存
                 </el-button>
+
                 <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
                     :disabled="isDisabledTask" @click="generateOutbound">
                     {{ buttonText }}
@@ -559,11 +560,12 @@ export default {
                   {
                     label: '成本',
                     prop: "cost",
-                    display: true,
+                    display: false,
                     disabled: true
                 }, {
                     label: '毛利',
                     prop: "grossProfit",
+                        display: false,
                     disabled: true
                 }, {
                     label: '销售金额',
@@ -1060,6 +1062,19 @@ export default {
             // this.batchNo = this.detailData.check.batchNo
         }
 
+        //成本、毛利对业务员隐藏
+        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)
+                }
+            }else {
+                if (its.prop == 'cost' || its.prop == 'grossProfit') {
+                    this.$set(its, 'display', true)
+                }
+            }
+        })
+
         if (this.detailData.id) {
             this.getDetailsfun()
         }
@@ -1369,6 +1384,7 @@ export default {
         },
         //表头编辑
         confirmEditing() {
+            this.editButton = false
             goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
                 this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
             })
@@ -1723,7 +1739,6 @@ export default {
                 let picihao = false
                 if (valid) {
                     for(let i in this.form.orderItemsList) {
-                        console.log(this.form.orderItemsList[i],1800)
                         this.form.orderItemsList[i].subTotalMoney = this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price
                         if (this.form.orderItemsList[i].pid) {
                         }else {
@@ -1736,6 +1751,11 @@ export default {
                             }else {
                             }
                         }
+
+                        if (this.form.orderItemsList[i].goodsNum <= 0) {
+                            this.$message.warning(`销售明细序号${Number(i)+1}的数量不能为零`);
+                            picihao = true
+                        }
                     }
                     this.mingxibaocun = true
                     if (picihao) {
@@ -1892,12 +1912,16 @@ export default {
                     this.isApplySettlement = false
                     this.isDisabled = true
                 }
-                //成本、毛利对销售角色隐藏
+                //成本、毛利对业务员隐藏
                 this.optionForm.column.forEach(its => {
-                    if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
+                    if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
                         if (its.prop == 'cost' || its.prop == 'grossProfit') {
                             this.$set(its, 'display', false)
                         }
+                    }else {
+                        if (its.prop == 'cost' || its.prop == 'grossProfit') {
+                            this.$set(its, 'display', true)
+                        }
                     }
                 })
                 this.form.orderItemsList.forEach((items) => {
@@ -2013,14 +2037,20 @@ export default {
                 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 (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
                         if (its.prop == 'cost' || its.prop == 'grossProfit') {
                             this.$set(its, 'display', false)
                         }
+                    }else {
+                        if (its.prop == 'cost' || its.prop == 'grossProfit') {
+                            this.$set(its, 'display', true)
+                        }
                     }
                 })
+
                 this.form.orderItemsList.forEach((items) => {
                     if (!items.subTotalMoney) {
                         items.subTotalMoney = items.goodsNum * items.price