jgdh2 2 роки тому
батько
коміт
ec0fdb465a

+ 1 - 0
src/components/AcceptorSelect/AcceptorSelect.vue

xqd
@@ -52,6 +52,7 @@ export default {
       acceptorSearchApi(params).then(res => {
         const result = res.data.result
         this.options = result
+        console.log(this.options,"options")
         this.loading = false
 				console.log(res)
       }).catch(err => {

+ 0 - 1
src/components/BillForm/BillForm.vue

xqd
@@ -318,7 +318,6 @@ export default {
     changeAcceptorName(value, exist, index) {
       if (exist) {
         const { acceptorId, interest, serviceRate,acceptorName } = exist
-        console.log(exist,"exist")
         this.contractDrafts[index].acceptorName=acceptorName
         this.contractDrafts[index].acceptorId = acceptorId
         this.contractDrafts[index].interestRate = interest

+ 64 - 31
src/views/contracts/detail.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -238,7 +238,7 @@
           >审核失败</el-button
         >
         <el-button
-          v-if="contract.status !== 0 && role === 2"
+          v-if="contract.status !== 0 && roleId === 999"
           type="primary"
           @click="addNewBill('')"
         >
@@ -315,7 +315,7 @@
 		data() {
 			return {
 				dialogVisible: false,
-				role: "",
+				roleId: "",
 				srcList: [],
 				temporaryList: [],
 				list: [],
@@ -449,7 +449,7 @@
 					this.list = res.data.contractDraft.result;
 					this.tradePicList = this.contract.tradePicList;
 					this.getPageData();
-					console.log(this.list)
+					console.log(this.contract,"合同")
 				});
 			},
 			isPDF(url) {
@@ -663,28 +663,61 @@
 			},
 			deletedContract() {
 				const id = this.$route.query.id;
-				this.$request({
-					url: "/api/Contract/manage",
-					method: "post",
-					data: {
-						ids: [id],
-						operateType: 1,
-					},
-				}).then((res) => {
-					if (res.code === 200) {
-						this.$message({
-							type: "success",
-							message: res.msg,
-						});
-						this.getData();
-					} else {
-						this.$message({
-							type: "error",
-							message: "提交失败",
-						});
-						this.getData();
-					}
-				});
+        if(this.roleId===999){
+          if(this.contract.status===1){
+            this.$message({
+              type:'error',
+              message:'供应商不能删除审核结果成功的合同'
+            })
+          }else{
+            this.$request({
+            	url: "/api/Contract/manage",
+            	method: "post",
+            	data: {
+            		ids: [id],
+            		operateType: 1,
+            	},
+            }).then((res) => {
+            	if (res.code === 200) {
+            		this.$message({
+            			type: "success",
+            			message: res.msg,
+            		});
+            		this.getData();
+            	} else {
+            		this.$message({
+            			type: "error",
+            			message: "提交失败",
+            		});
+            		this.getData();
+            	}
+            });
+          }
+        }else{
+          this.$request({
+          	url: "/api/Contract/manage",
+          	method: "post",
+          	data: {
+          		ids: [id],
+          		operateType: 1,
+          	},
+          }).then((res) => {
+          	if (res.code === 200) {
+          		this.$message({
+          			type: "success",
+          			message: res.msg,
+          		});
+          		this.getData();
+          	} else {
+          		this.$message({
+          			type: "error",
+          			message: "提交失败",
+          		});
+          		this.getData();
+          	}
+          });
+        }
+
 			},
 			recoverContractDraft() {
 				const ids = Array.from(this.multipleSelection, ({
@@ -727,7 +760,7 @@
 						}
 					});
 				}
-				
+
 			},
 			deletedContractDraft() {
 				const ids = Array.from(this.multipleSelection, ({
@@ -815,8 +848,8 @@
 						});
 					}
 				}
-				
-				
+
+
 			},
 			recover(id) {
 				this.$request({
@@ -896,10 +929,10 @@
 								this.getData();
 							}
 						});
-					
+
 				}
-				
-				
+
+
 			},
 			back() {
 				this.$router.go(-1);

+ 101 - 49
src/views/supplierAcceptor/index.vue

xqd xqd xqd xqd xqd xqd
@@ -170,7 +170,7 @@
       >
         <template slot-scope="scope"> {{ scope.row.interest }}% </template>
       </el-table-column>
-	  
+
       <el-table-column align="center" label="审核状态" prop="statusText">
       </el-table-column>
 		<el-table-column align="center" label="时间" prop="createdAt" width="200">
@@ -191,15 +191,14 @@
 			v-if="scope.row.status != 2"
             @click="fail(scope.row.id)"
             v-permission="['admin', 'salesman']"
-            
+
             >审核失败
           </el-tag>
           <el-tag
             type="primary"
             style="cursor: pointer; margin-right: 15px"
             @click="Resubmit(scope.row.supplierId, scope.row.acceptorId)"
-            v-permission="['supplier']"
-            v-if="scope.row.status === 2"
+            v-if="scope.row.status === 2&&roleId===999"
             >重新提交
           </el-tag>
           <el-tag
@@ -539,12 +538,101 @@ export default {
     // 批量删除
     deleteStatuses() {
       let ids = Array.from(this.multipleSelection, ({ id }) => id);
-      if (ids == "") {
-        this.$message({
-          type: "error",
-          message: "请选择数据",
-        });
-      } else {
+      let status=Array.from(this.multipleSelection,({status})=>status)
+      console.log(status)
+      if(this.roleId===999){
+        if (ids == "") {
+          this.$message({
+            type: "error",
+            message: "请选择数据",
+          });
+        } else if(status.includes(1)){
+          this.$message({
+            type: "error",
+            message: "供应商不能删除审核状态为成功的承兑人",
+          });
+        }else {
+          this.$confirm("您确定要删除吗?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+            .then(() => {
+              this.$request({
+                url: "/api/SupplierAcceptor/delete",
+                method: "post",
+                data: ids,
+              }).then((res) => {
+                if (res.code == 200) {
+                  this.$message({
+                    type: "success",
+                    message: "删除成功",
+                  });
+                  this.$refs.multipleTable.clearSelection();
+                  this.multipleSelection = "";
+                  this.getAllList();
+                } else {
+                  this.$message({
+                    type: "danger",
+                    message: "删除失败",
+                  });
+                  this.getAllList();
+                }
+              });
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "已取消删除",
+              });
+            });
+        }
+      }
+
+    },
+    // 单个删除
+    deleteStatus(id,status) {
+      if(this.roleId===999){
+        if(status===1){
+          this.$message({
+            type: "error",
+            message: "供应商不能删除审核状态为成功的承兑人",
+          });
+        }else{
+          this.$confirm("您确定要删除吗?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+            .then(() => {
+              this.$request({
+                url: "/api/SupplierAcceptor/delete",
+                method: "post",
+                data: [id],
+              }).then((res) => {
+                if (res.code == 200) {
+                  this.$message({
+                    type: "success",
+                    message: "删除成功",
+                  });
+                  this.getAllList();
+                } else {
+                  this.$message({
+                    type: "danger",
+                    message: "删除失败",
+                  });
+                  this.getAllList();
+                }
+              });
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "已取消删除",
+              });
+            });
+        }
+      }else{
         this.$confirm("您确定要删除吗?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -554,15 +642,13 @@ export default {
             this.$request({
               url: "/api/SupplierAcceptor/delete",
               method: "post",
-              data: ids,
+              data: [id],
             }).then((res) => {
               if (res.code == 200) {
                 this.$message({
                   type: "success",
                   message: "删除成功",
                 });
-                this.$refs.multipleTable.clearSelection();
-                this.multipleSelection = "";
                 this.getAllList();
               } else {
                 this.$message({
@@ -580,41 +666,7 @@ export default {
             });
           });
       }
-    },
-    // 单个删除
-    deleteStatus(id) {
-      this.$confirm("您确定要删除吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.$request({
-            url: "/api/SupplierAcceptor/delete",
-            method: "post",
-            data: [id],
-          }).then((res) => {
-            if (res.code == 200) {
-              this.$message({
-                type: "success",
-                message: "删除成功",
-              });
-              this.getAllList();
-            } else {
-              this.$message({
-                type: "danger",
-                message: "删除失败",
-              });
-              this.getAllList();
-            }
-          });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "已取消删除",
-          });
-        });
+      
     },
     /* 输入承兑人状态查询 */
     handleCommand(command) {
@@ -756,7 +808,7 @@ export default {
             item.statusText,
           ]);
         });
-        dataConversionUtil.dataToExcel("承兑人列表", tableHeader, dataList);
+        dataConversionUtil.dataToExcel("供应商承兑人列表", tableHeader, dataList);
         this.$message.success("导出成功!");
       });
     },