lilei 3 weeks ago
parent
commit
26ec6158e7

+ 8 - 22
src/views/salesManagement/salesQueryNew/detail.vue

@@ -893,32 +893,18 @@ export default {
     },
     // 价格低于成本校验提示,继续审核
     vaildPriceOk (type) {
-      console.log(type, this.isSupAudit)
-      if (type == 'confirm') {
-        this.auditOrder('AUDIT_PASS')
+      // 审核通过或不通过
+      if (type == 'AUDIT_PASS' || type == 'AUDIT_REJECT') {
+        this.auditOrder(type)
         return
       }
-      // 不通过,调用
-      if (type == 'AUDIT_REJECT') { // 价格低于成本审核不通过
-        this.auditOrder(type)
-      } else if (type == 'AUDIT_UP_REJECT') { // 待上级审核不通过
-        this.spinning = true
-        salesWriteUpAuditReject({
-          salesBillSn: this.bizSn || this.$route.params.sn
-        }).then(res => {
-          if (res.status == 200) {
-            this.$message.success(res.message)
-            this.closeVaildPrice()
-            this.handleBack()
-          }
-          this.$refs.vaildPriceModal.spinning = false
-          this.spinning = false
-        })
-      } else { // 通过审核,业务状态变更 待上级审核
+      // 上级审核,不通过或通过
+      if (type == 'AUDIT_UP_PASS' || type == 'AUDIT_UP_REJECT') {
+        const upFun = type == 'AUDIT_UP_PASS' ? salesWriteUpAuditPass : salesWriteUpAuditReject
         this.spinning = true
-        salesWriteUpAuditPass({
+        upFun({
           salesBillSn: this.bizSn || this.$route.params.sn,
-          billStatus: type
+          billStatus: type == 'AUDIT_UP_PASS' ? 'AUDIT_PASS' : undefined
         }).then(res => {
           if (res.status == 200) {
             this.$message.success(res.message)

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

@@ -30,7 +30,7 @@
         </div>
         <div style="margin-top:36px;text-align:center;" v-if="modalType == 'price_less_cost'">
           <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-          <a-button type="primary" class="button-info" @click="handleSubmit('confirm')" id="chooseCustom-btn-Pass">确定</a-button>
+          <a-button type="primary" class="button-info" @click="handleSubmit('AUDIT_UP_PASS')" id="chooseCustom-btn-Pass">确定</a-button>
         </div>
         <div style="margin-top:36px;text-align:center;" v-if="modalType == 'price_less_0'">
           <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">关闭</a-button>