Selaa lähdekoodia

审核不通过弹框重写

chenrui 3 vuotta sitten
vanhempi
commit
8d0bac5486
2 muutettua tiedostoa jossa 124 lisäystä ja 23 poistoa
  1. 91 0
      src/views/common/auditModal.vue
  2. 33 23
      src/views/salesManagement/salesQuery/list.vue

+ 91 - 0
src/views/common/auditModal.vue

@@ -0,0 +1,91 @@
+<template>
+  <a-modal
+    centered
+    class="audit-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="416">
+    <div class="audit-main">
+      <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
+      <div class="audit-cont">
+        <p class="audit-tit">提示</p>
+        <p class="audit-txt">请点击下方按钮确认操作?</p>
+      </div>
+    </div>
+    <div class="btn-box">
+      <a-button type="primary" class="button-error" @click="handleAuditFail">审核不通过</a-button>
+      <a-button type="primary" class="button-info" @click="handleAuditOk">审核通过</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  name: 'AuditModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal //  是否打开弹框
+    }
+  },
+  methods: {
+    // 审核通过
+    handleAuditOk () {
+      this.$emit('ok')
+    },
+    // 审核不通过
+    handleAuditFail () {
+      this.$emit('fail')
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .audit-modal{
+    .ant-modal-body{
+      padding: 32px 32px 24px;
+    }
+    .audit-main{
+      display: flex;
+      .audit-cont{
+        .audit-tit{
+          color: rgba(0, 0, 0, 0.85);
+          font-weight: 500;
+          font-size: 16px;
+          line-height: 1.4;
+          margin: 0;
+        }
+        .audit-txt{
+          margin: 8px 0 0;
+          color: rgba(0, 0, 0, 0.65);
+          font-size: 14px;
+          line-height: 1.5;
+        }
+      }
+    }
+    .btn-box{
+      text-align: right;
+      margin-top: 24px;
+    }
+  }
+</style>

+ 33 - 23
src/views/salesManagement/salesQuery/list.vue

@@ -171,19 +171,22 @@
     </s-table>
     </s-table>
     <!-- 选择客户弹框 -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
+    <!-- 审核 -->
+    <auditModal :openModal="visibleAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_OUT_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
+import auditModal from '@/views/common/auditModal.vue'
 import { custAllList } from '@/api/customer'
 import { custAllList } from '@/api/customer'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
 import { settleStyleQueryAll } from '@/api/settleStyle'
 import { settleStyleQueryAll } from '@/api/settleStyle'
 import rangeDate from '@/views/common/rangeDate.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 export default {
 export default {
   name: 'TableList',
   name: 'TableList',
-  components: { STable, VSelect, chooseCustomModal, rangeDate },
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal },
   data () {
   data () {
     return {
     return {
       tableHeight: 0,
       tableHeight: 0,
@@ -247,7 +250,9 @@ export default {
           this.disabled = false
           this.disabled = false
           return data
           return data
         })
         })
-      }
+      },
+      visibleAudit: false,
+      auditInfo: null
     }
     }
   },
   },
   methods: {
   methods: {
@@ -266,33 +271,38 @@ export default {
     },
     },
     //  审核
     //  审核
     handleEexamine (row) {
     handleEexamine (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '请点击下方按钮确认操作?',
-        centered: true,
-        closable: true,
-        okText: '审核通过',
-        cancelText: '审核不通过',
-        onOk () {
-          _this.auditOrder(row.id, 'WAIT_OUT_WAREHOUSE')
-        },
-        onCancel (e) {
-          if (!e.triggerCancel) {
-            _this.auditOrder(row.id, 'AUDIT_REJECT')
-          }
-          _this.$destroyAll()
-        }
-      })
+      // const _this = this
+      // this.$confirm({
+      //   title: '提示',
+      //   content: '请点击下方按钮确认操作?',
+      //   centered: true,
+      //   closable: true,
+      //   okText: '审核通过',
+      //   cancelText: '审核不通过',
+      //   onOk () {
+      //     _this.auditOrder(row.id, 'WAIT_OUT_WAREHOUSE')
+      //   },
+      //   onCancel (e) {
+      //     if (!e.triggerCancel) {
+      //       _this.auditOrder(row.id, 'AUDIT_REJECT')
+      //     }
+      //     _this.$destroyAll()
+      //   }
+      // })
+      this.auditInfo = row
+      this.visibleAudit = true
     },
     },
-    auditOrder (id, billStatus) {
+    auditOrder (billStatus) {
       salesWriteAudit({
       salesWriteAudit({
-        id,
-        billStatus
+        id: this.auditInfo.id,
+        billStatus: billStatus
       }).then(res => {
       }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
+          this.visibleAudit = false
           this.$message.success(res.message)
           this.$message.success(res.message)
           this.$refs.table.refresh()
           this.$refs.table.refresh()
+        } else {
+          this.visibleAudit = false
         }
         }
       })
       })
     },
     },