소스 검색

提交 销售价小于等于0 校验

chenrui 6 달 전
부모
커밋
f6e208444e

+ 7 - 1
src/views/salesManagement/salesQueryNew/detail.vue

@@ -223,7 +223,13 @@
     <!-- 改单时价格变更提示 -->
     <tipModal ref="tipModal" :openModal="openTipModal" :dataList="sourceData" @close="closeTipModal" @ok="openTipModalOk"></tipModal>
     <!-- 审核时校验销售价低于成本价提示 -->
-    <vaildPriceModal ref="vaildPriceModal" :openModal="openVaildPriceModal" :dataObj="tempData" @close="openVaildPriceModal=false" @ok="vaildPriceOk"></vaildPriceModal>
+    <vaildPriceModal
+      ref="vaildPriceModal"
+      modalType="0"
+      :openModal="openVaildPriceModal"
+      :dataObj="tempData"
+      @close="openVaildPriceModal=false"
+      @ok="vaildPriceOk"></vaildPriceModal>
   </div>
 </template>
 

+ 22 - 2
src/views/salesManagement/salesQueryNew/edit.vue

@@ -151,6 +151,14 @@
     ></newPromoModal>
     <!-- 特价活动排序 -->
     <discountSortModal :show="showDiscountSortModal" :activeList="discountActiveList" @ok="showDiscountSortOk"></discountSortModal>
+    <!-- 提交时校验销售价低于成本价提示 -->
+    <vaildPriceModal
+      ref="vaildPriceModal"
+      modalType="1"
+      :openModal="openVaildPriceModal"
+      :dataObj="tempData"
+      @close="openVaildPriceModal=false"
+      @ok="vaildPriceOk"></vaildPriceModal>
   </div>
 </template>
 
@@ -205,7 +213,9 @@ export default {
       showNewActiveModal: false, // 新活动弹框
       salesPromoSnSet: [], // 当前勾选的活动sn
       showDiscountSortModal: false, // 特价活动排序弹框
-      discountActiveList: [] // 可叠加的特价活动列表
+      discountActiveList: [], // 可叠加的特价活动列表
+      openVaildPriceModal: false, // 销售价低于成本价提示弹窗
+      tempData: null// 销售价低于成本价 弹窗列表数据
     }
   },
   computed: {
@@ -421,6 +431,7 @@ export default {
       const vaildActive = await salesPromoValidaSubmit({ salesBillSn: this.salesBillSn }).then(res => res.data)
       const a = vaildActive.filter(item => item.type == 1) // 不可提交
       const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
+      const d = vaildActive.filter(item => item.type == 'audit') // 售价是否低于参考成本价
       // 弹出不符合规则弹框,不可提交
       if (a.length) {
         this.$info({
@@ -459,12 +470,21 @@ export default {
               _this.submitOrder(data)
             }
           })
-          this.spinning = false
+          _this.spinning = false
+        } else if (d.length) {
+          _this.spinning = false
+          _this.tempData = d
+          _this.openVaildPriceModal = true
         } else {
           _this.submitOrder(data)
         }
       }
     },
+    // 校验销售价低于成本价提示成功,关闭弹窗
+    vaildPriceOk () {
+      this.tempData = null
+      this.openVaildPriceModal = false
+    },
     // 提交销售单
     async submitOrder (data) {
       this.spinning = true

+ 8 - 1
src/views/salesManagement/salesQueryNew/vaildPriceModal.vue

@@ -24,11 +24,14 @@
         <div style="padding: 20px;text-align: center;" v-if="dataObj&&dataObj.message">
           {{ dataObj.message }}
         </div>
-        <div style="margin-top:36px;text-align:center;">
+        <div style="margin-top:36px;text-align:center;" v-if="modalType==='0'">
           <!-- <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">关闭</a-button> -->
           <a-button type="primary" style="margin-right: 15px" @click="handleSubmit('AUDIT_REJECT')" id="chooseCustom-btn-noPasss">审核不通过</a-button>
           <a-button type="primary" class="button-info" @click="handleSubmit('AUDIT_PASS')" id="chooseCustom-btn-Pass">审核通过</a-button>
         </div>
+        <div style="margin-top:36px;text-align:center;" v-else>
+          <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">关闭</a-button>
+        </div>
       </div>
     </a-spin>
   </a-modal>
@@ -49,6 +52,10 @@ export default {
       default: () => {
         return null
       }
+    },
+    modalType: {// 0  来源审核页面  1来源提交页面
+      type: String,
+      default: '0'
     }
   },
   data () {