chenrui 1 anno fa
parent
commit
e2f733a168

+ 9 - 4
src/views/productManagement/productPricing/auditModal.vue

@@ -51,8 +51,8 @@
           <a-descriptions-item label="变更原因">{{ detailsData && detailsData.changeReason || '--' }}</a-descriptions-item>
         </a-descriptions>
         <div class="btn-cont">
-          <a-button type="primary" id="productPricingAudit-back" @click="isShow = false" style="margin-right: 15px;">审核不通过</a-button>
-          <a-button type="primary" class="button-info" id="productPricingAudit-save" @click="handleAudit">审核通过</a-button>
+          <a-button type="primary" id="productPricingAudit-back" @click="handleAudit('AUDIT_REJECT')" style="margin-right: 15px;">审核不通过</a-button>
+          <a-button type="primary" class="button-info" id="productPricingAudit-save" @click="handleAudit('PRICED')">审核通过</a-button>
         </div>
       </div>
     </a-spin>
@@ -94,9 +94,14 @@ export default {
       })
     },
     // 审核
-    handleAudit () {
+    handleAudit (type) {
+      const ajaxData = {
+        id: this.detailsData.id,
+        productSn: this.detailsData.productSn,
+        auditState: type
+      }
       this.spinning = true
-      productPricingAudit(this.detailsData).then(res => {
+      productPricingAudit(ajaxData).then(res => {
         if (res.status == 200) {
           this.isShow = false
           this.$emit('ok')

+ 20 - 21
src/views/productManagement/productPricing/list.vue

@@ -67,7 +67,7 @@
             id="productPricingList-add"
             @click="openGuideModal=true"
             type="primary"
-            >定价导入</a-button>
+          >定价导入</a-button>
           <a-button
             id="productPricingList-batchAudit"
             type="primary"
@@ -144,7 +144,7 @@
           <a-icon type="question-circle" :style="{fontSize:'23px',color:'#faad14'}"/>
           <div style="margin-left:10px;">
             <p style="font-size:16px;font-wight:bold;">提示</p>
-            <p>确认要审核通过吗?</p>
+            <p>确认要审核吗?</p>
           </div>
         </div>
         <!-- 按钮 -->
@@ -152,14 +152,13 @@
           <a-button
             id="auditModal-cancel"
             type="primary"
-            @click="closeAuditModal"
+            @click="handleAuditModal('AUDIT_REJECT')"
             style="margin-right: 15px;">审核不通过</a-button>
           <a-button
             type="primary"
             id="auditModal-save"
-             class="button-info"
-            :loading="loadingAudit"
-            @click="handleAuditModal"
+            class="button-info"
+            @click="handleAuditModal('PRICED')"
           >审核通过</a-button>
         </div>
       </a-modal>
@@ -224,7 +223,7 @@ export default {
       total: 0, // 合计
       openModal: false, //  编辑  弹框
       openAuditModal: false, //  审核  弹框
-      openPriceAuditModal:false,
+      openPriceAuditModal: false,
       itemSn: '', //  当前产品sn
       rowSelectionInfo: null
     }
@@ -305,11 +304,7 @@ export default {
         _this.$message.warning('请先选择产品!')
         return
       }
-      const obj = []
-      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-        obj.push(item.productSn)
-      })
-      _this.openAuditModal=true
+      _this.openAuditModal = true
     },
     // 导入产品
     hanldeOk (obj) {
@@ -359,21 +354,25 @@ export default {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240
     },
-    // 批量审核----->审核不通过
-    closeAuditModal(){
-      
-    },
-    //批量审核----->审核通过
-    handleAuditModal(){
-      let _this=this
+    // 批量审核
+    handleAuditModal (type) {
+      const _this = this
+      const productSnList = []
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        productSnList.push(item.productSn)
+      })
+      const ajaxData = {
+        productSnList: productSnList,
+        auditState: type
+      }
       _this.spinning = true
-      batchAuditPrice(obj).then(res => {
+      batchAuditPrice(ajaxData).then(res => {
         if (res.status == 200) {
           _this.$refs.table.clearSelected() // 清空表格选中项
           _this.$message.success(res.message)
           _this.$refs.table.refresh()
           _this.spinning = false
-          _this.openAuditModal=false
+          _this.openAuditModal = false
         } else {
           _this.spinning = false
         }