Browse Source

开发宝审核页面

lk 5 years ago
parent
commit
228f3457cb
2 changed files with 138 additions and 19 deletions
  1. 129 13
      pages/main/index/invoice_audit.vue
  2. 9 6
      pages/main/index/kaifabao.vue

+ 129 - 13
pages/main/index/invoice_audit.vue

@@ -4,7 +4,7 @@
       <span>验证发票</span>
     </div>
     <div class="t-title">
-      <span>发票图片</span>
+      <span>发票图片</span> <span>  <el-link type="primary">下载发票附件</el-link></span>
     </div>
     <div>
       <el-image
@@ -28,11 +28,12 @@
         <span v-else>--</span>
       </div>
       <div>
-        <el-button type="primary">验证通过</el-button>
-        <el-button type="danger" @click="onOneNo">验证不通过</el-button>
+        <el-button type="primary" @click="onPictureAudit(true)" v-if="invoiceRow.picture_verify_status === '0'">验证通过
+        </el-button>
+        <el-button type="danger" @click="onAudit('picture')">验证不通过</el-button>
       </div>
     </div>
-    <div>
+    <div v-if="invoiceRow.picture_verify_status == 1">
       <div class="t-title">
         <span>纸质发票审核 </span>
         <span v-if="invoiceRow.paper_verify_status === '0'"> [待审核]</span>
@@ -41,17 +42,62 @@
         <span v-else>--</span>
       </div>
       <div>
-        <el-button type="primary">验证通过</el-button>
-        <el-button type="danger">验证不通过</el-button>
+        <el-button type="primary" @click="onPaperAudit(true)" v-if="invoiceRow.paper_verify_status === '0'">验证通过</el-button>
+        <el-button type="danger" @click="onAudit('paper')">验证不通过</el-button>
       </div>
     </div>
     <div>
       <div class="t-title">
         <span>审核记录 </span>
       </div>
+      <div style="margin-top:5px" v-for="item in auditData">
+        <el-card shadow="never">
+          <el-row>
+            <el-col :span="12">
+              <div style="font-weight: 700">{{item.status_name}}--{{item.is_auto?'系统自动审核':'人工审核'}}</div>
+            </el-col>
+            <el-col :span="10" :offset="2">
+              <div>{{item.nickname}} {{item.audit_date}}</div>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 10px" v-if="item.status == '3'">
+            <el-col :span="12">
+              <div style="font-weight: 700">拒绝理由:</div>
+              <div style="padding: 5px">
+                &nbsp;&nbsp;{{item.audit_data.reason || ''}}
+              </div>
+            </el-col>
+          </el-row>
+        </el-card>
+      </div>
     </div>
 
-
+    <el-dialog
+      title="请输入发票图片审核不通过的原因"
+      :visible.sync="pictureAuditModel"
+      width="30%"
+    >
+      <div>
+        <el-input v-model="pictureReason"></el-input>
+      </div>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="pictureAuditModel = false">取 消</el-button>
+          <el-button type="primary" @click="onPictureAudit(false)">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="请输入纸质发票审核不通过的原因"
+      :visible.sync="PaperAuditModel"
+      width="30%"
+    >
+      <div>
+        <el-input v-model="PaperReason"></el-input>
+      </div>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="PaperAuditModel = false">取 消</el-button>
+          <el-button type="primary" @click="onPaperAudit(false)">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -62,7 +108,12 @@
       return {
         ids: 0,
         srcList: [],
-        invoiceRow: {}
+        invoiceRow: {},
+        paperReason: '',
+        pictureReason: '',
+        paperAuditModel: false,
+        pictureAuditModel: false,
+        auditData: []
       };
     },
     mounted() {
@@ -71,20 +122,85 @@
     methods: {
       async getInvoiceDetail() {
         let id = this.ids;
-        debugger;
         if (id === 0) {
           this.$message.error('id不存在');
           return false;
         }
         let res = await this.$post("/api/admin/kaifabao/getInvoiceAuditInfo", {id: id});
         if (res && res.status === 1) {
-          this.invoiceRow = res.data;
-          this.srcList = [res.data.invoice_url];
-          debugger;
+          this.invoiceRow = res.data.invoice;
+          this.srcList = [res.data.invoice.invoice_url];
+          this.auditData = res.data.auditData || [];
         }
       },
-      onOneNo() {
+      onAudit(action) {
+        //图片发票  纸质发票
+        if (action === 'picture') {
+          this.pictureAuditModel = true;
+        } else if (action === 'paper') {
 
+          this.PaperAuditModel = true;
+        }
+      },
+      //图片
+      async onPictureAudit(isTrue) {
+        let data = {};
+        //图片审核
+        if (isTrue) {
+          data = {
+            invoiceId: this.ids,
+            action: 'approve'
+          };
+        } else {
+          if (!this.pictureReason) {
+            this.$message.error('原因不能为空');
+            return false;
+          }
+          data = {
+            invoiceId: this.ids,
+            action: 'reject',
+            reason: this.pictureReason
+          };
+        }
+        let res = await this.$post("/api/admin/kaifabao/auditInvoiceWithdrawalPicture", data);
+        if (res && res.status === 1) {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.pictureAuditModel = false;
+          this.getInvoiceDetail();
+        }
+      },
+      //纸质
+      async onPaperAudit(isTrue) {
+        let data = {};
+        //纸质发票审核
+        if (isTrue) {
+          data = {
+            invoiceId: this.ids,
+            action: 'approve'
+          };
+        } else {
+          if (!this.paperReason) {
+            this.$message.error('原因不能为空');
+            return false;
+          }
+          data = {
+            invoiceId: this.ids,
+            action: 'reject',
+            reason: this.paperReason
+          };
+        }
+        let res = await this.$post("/api/admin/kaifabao/auditInvoiceWithdrawalPaper", data);
+        if (res && res.status === 1) {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.paperAuditModel = false;
+          this.getInvoiceDetail();
+        }
       },
       getUrlParam(name) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象

+ 9 - 6
pages/main/index/kaifabao.vue

@@ -3,7 +3,7 @@
     <div>
       <el-radio-group v-model="tab" size="small" @change="getList">
         <el-radio-button label="service">开发宝服务配置</el-radio-button>
-        <el-radio-button label="salary">开发宝薪订单</el-radio-button>
+        <el-radio-button label="salary">开发宝薪订单</el-radio-button>
         <el-radio-button label="withdrawal">开发宝提现订单</el-radio-button>
         <el-radio-button label="verify">发票审核</el-radio-button>
       </el-radio-group>
@@ -81,14 +81,14 @@
             prop="original_rate"
             label="服务商原始费率">
             <template slot-scope="scope">
-              <span>{{scope.row.original_rate}}</span>
+              <span>{{scope.row.original_rate}}%</span>
             </template>
           </el-table-column>
           <el-table-column
             prop="kaifabao_rate"
             label="开发宝费率">
             <template slot-scope="scope">
-              <span>{{scope.row.kaifabao_rate}}</span>
+              <span>{{scope.row.kaifabao_rate}}%</span>
             </template>
           </el-table-column>
           <el-table-column label="操作">
@@ -224,19 +224,22 @@
           <el-table-column
             prop="order_type_name"
             label="支付方式">
+            <template slot-scope="scope">
+              <span>{{scope.row.order_type_name}}</span>
+            </template>
           </el-table-column>
           <el-table-column
             prop="original_rate"
             label="服务商税率">
             <template slot-scope="scope">
-              <span>{{scope.row.original_rate}}</span>
+              <span>{{scope.row.original_rate}}%</span>
             </template>
           </el-table-column>
           <el-table-column
             prop="kaifabao_rate"
             label="开发宝费率">
             <template slot-scope="scope">
-              <span>{{scope.row.kaifabao_rate}}</span>
+              <span>{{scope.row.kaifabao_rate}}%</span>
             </template>
           </el-table-column>
           <el-table-column prop="origin_amount" label="税前金额" width="70"></el-table-column>
@@ -574,7 +577,7 @@
       },
       // 重新支付
       async rePay(i) {
-        const res = await this.$post("/api/admin/payment/redoSalaryDraw", {
+        const res = await this.$post("/api/admin/kaifabao/redoSalaryDraw", {
           id: i.id
         });
         if (res) {