Sunny Feng 2 lat temu
rodzic
commit
9b30728bb5
2 zmienionych plików z 91 dodań i 8 usunięć
  1. 12 5
      src/views/contracts/billDetail.vue
  2. 79 3
      src/views/contracts/detail.vue

+ 12 - 5
src/views/contracts/billDetail.vue

xqd xqd
@@ -66,7 +66,10 @@
       </el-descriptions-item>
     </el-descriptions>
 
-    <el-row v-permission="['admin']" style="margin:20px">
+    <el-row
+      v-permission="['salesman', 'admin']"
+      v-if="list[0].status === 0"
+      style="margin:20px">
       <el-col>
         <div class="titlesa" style="padding:10px">
           <span>审核反馈</span>
@@ -95,13 +98,17 @@
 
     <div class="btn">
       <el-button
-      v-permission="['admin']"
-      type="success" @click="success"
+      v-permission="['salesman', 'admin']"
+      v-if="list[0].status === 0"
+      type="success"
+      @click="success"
         >审核成功</el-button
       >
       <el-button
-      v-permission="['admin']"
-      type="danger" @click="failed"
+      v-permission="['salesman', 'admin']"
+      v-if="list[0].status === 0"
+      type="danger"
+      @click="failed"
         >审核失败</el-button
       >
       <el-button type="primary" @click="back">返回</el-button>

+ 79 - 3
src/views/contracts/detail.vue

xqd xqd xqd xqd
@@ -107,15 +107,16 @@
               @click="recoverContract"
             >恢复
             </el-button>
+
             <el-button
-              v-if="role === 1"
+              v-permission="['salesman', 'admin']"
               type="warning"
               style="float: right"
               @click="failed"
             >审核失败
             </el-button>
             <el-button
-              v-if="role === 1"
+              v-permission="['salesman', 'admin']"
               type="success"
               style="float: right"
               @click="success"
@@ -169,12 +170,21 @@
         >
           <template slot-scope="scope">
             <el-tag
+              v-permission="['salesman', 'admin']"
+              v-show="contract.status !== 0"
               type="primary"
               style="cursor: pointer; margin-right: 15px"
               @click="tapDetail(scope.row.id)"
             >查看详情</el-tag>
             <el-tag
-              v-if="scope.row.status == 2"
+              v-permission="['supplier']"
+              type="primary"
+              style="cursor: pointer; margin-right: 15px"
+              @click="tapDetail(scope.row.id)"
+            >查看详情</el-tag>
+            <el-tag
+              v-permission="['supplier']"
+              v-show="scope.row.status == 2"
               type="success"
               style="cursor: pointer; margin-right: 15px"
               @click="addNewBill(scope.row.id)"
@@ -196,6 +206,20 @@
       </el-table>
 
       <div class="pagesip">
+        <el-button
+          v-permission="['salesman', 'admin']"
+          v-show="contract.status !== 0"
+          type="primary"
+          @click="batSuccessed"
+          >审核成功</el-button
+        >
+        <el-button
+          v-permission="['salesman', 'admin']"
+          v-show="contract.status !== 0"
+          type="primary"
+          @click="batFailed"
+          >审核失败</el-button
+        >
         <el-button v-if="role === 2" type="primary" @click="addNewBill('')">
           新增汇票</el-button>
         <el-button
@@ -277,6 +301,58 @@ export default {
     this.getData()
   },
   methods: {
+    // 批量审核汇票 成功
+    batSuccessed() {
+      const ids = Array.from(this.multipleSelection, ({ id }) => id);
+      this.$request({
+        url: "/api/Contract/contractDraft/manager",
+        method: "post",
+        data: {
+          ids: ids,
+          operateType: 3,
+        },
+      }).then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: res.msg,
+          });
+        } else {
+          this.$message({
+            type: "danger",
+            message: res.msg,
+          });
+        }
+
+        this.getData();
+      });
+    },
+    // 批量审核汇票失败
+    batFailed() {
+      const ids = Array.from(this.multipleSelection, ({ id }) => id);
+      this.$request({
+        url: "/api/Contract/contractDraft/manager",
+        method: "post",
+        data: {
+          ids: ids,
+          operateType: 4,
+        },
+      }).then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: res.msg,
+          });
+        } else {
+          this.$message({
+            type: "danger",
+            message: res.msg,
+          });
+        }
+
+        this.getData();
+      });
+    },
     getData() {
       const id = this.$route.query.id
       this.$request({