Browse Source

2022.8.19 18:12

Tartarus 2 năm trước cách đây
mục cha
commit
8a248dccbc

+ 7 - 7
src/api/contracts.js

xqd
@@ -44,18 +44,18 @@ export function contractsManageApi(data) {
     data
   })
 }
-export function drawerSearchApi(data) {
+export function drawerSearchApi(params) {
   return request({
     url: '/api/Drawer/search',
-    method: 'post',
-    data
+    method: 'get',
+    params
   })
 }
-export function acceptorSearchApi(data) {
+export function acceptorSearchApi(params) {
   return request({
-    url: '/api/Acceptor/search',
-    method: 'post',
-    data
+    url: '/api/SupplierAcceptor',
+    method: 'get',
+    params
   })
 }
 export function contractSubmitApi(data) {

+ 3 - 2
src/components/AcceptorSelect/AcceptorSelect.vue

xqd xqd xqd
@@ -12,7 +12,7 @@
     <el-option
       v-for="item in options"
       :key="item.id"
-      :label="item.name"
+      :label="item.acceptorName"
       :value="item.id"
     />
   </el-select>
@@ -31,7 +31,7 @@ export default {
   data() {
     return {
       filter: {
-        status:5, // 已删除的承兑人不展示
+        status:1, // 已删除的承兑人不展示
         pageIndex: 1,
         pageSize: 100
       },
@@ -53,6 +53,7 @@ export default {
         const result = res.data.result
         this.options = result
         this.loading = false
+				console.log(res)
       }).catch(err => {
         console.log(err)
         this.loading = false

+ 36 - 5
src/router/index.js

xqd xqd xqd xqd
@@ -1,10 +1,42 @@
 import Vue from 'vue'
 import Router from 'vue-router'
-import { getToken } from '@/utils/auth';
+// import { getToken } from '@/utils/auth';
+import {
+  getToken,
+  setToken,
+  removeToken,
+  getCookies,
+  setCookies,
+  removeCookies
+} from '@/utils/auth'
 
 
+
+		
 Vue.use(Router)
 import Layout from '@/layout'
+
+// 根据角色不同,路由显示不同title
+const userInfoKey = 'userInfo'
+const rolesKey = 'roles'
+const getDefaultState = () => {
+	       return {
+	         token: getToken(),
+	         name: '',
+	         avatar: '',
+	         checked: '',
+	         userInfo: getCookies(userInfoKey) ? JSON.parse(getCookies(userInfoKey)) : {},
+	         roles: getCookies(rolesKey) ? JSON.parse(getCookies(rolesKey)) : []
+	       }
+	     }
+		 var state = getDefaultState()
+		 var setName=""
+		if(state.userInfo.roleId===999){
+					 setName = '我的承兑人'
+		}else{
+					 setName = '供应商承兑人'
+		}
+
 export const constantRouterMap = [{
 	path: '/',
 	component: Layout,
@@ -12,6 +44,7 @@ export const constantRouterMap = [{
 		name: 'login'
 	}
 },
+
 {
 	path: '/login',
 	name: 'login',
@@ -207,15 +240,14 @@ export const asyncRouterMap = [{
 		name: 'supplierAcceptor'
 	},
 	meta: {
-		title: '我的承兑人管理',
-		roles: ['admin', 'salesman','supplier']
+		title:setName,
 	},
 	children: [{
 		path: 'index',
 		name: 'supplierAcceptor',
 		component: () => import('@/views/supplierAcceptor/index'),
 		meta: {
-			title: '我的承兑人管理',
+			title: setName,
 			icon: 'el-icon-copy-document',
 			roles: ['admin', 'salesman','supplier'],
 		}
@@ -444,7 +476,6 @@ export const asyncRouterMap = [{
 
 
 
-
 const createRouter = () => new Router({
 	// mode: 'history', // require service support
 	scrollBehavior: () => ({

+ 2 - 0
src/store/modules/user.js

xqd xqd
@@ -171,6 +171,7 @@ const actions = {
         removeToken() // must remove  token  first
         resetRouter()
         commit('RESET_STATE')
+		commit('SET_ROLES', [])
         resolve()
       }).catch(error => {
         reject(error)
@@ -185,6 +186,7 @@ const actions = {
     return new Promise(resolve => {
       removeToken() // must remove  token  first
       commit('RESET_STATE')
+	  commit('SET_ROLES', [])
       resolve()
     })
   }

+ 8 - 8
src/views/management/index.vue

xqd xqd xqd
@@ -25,8 +25,8 @@
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item command="全部">全部</el-dropdown-item>
             <el-dropdown-item command="待审核">待审核</el-dropdown-item>
-            <el-dropdown-item command="通过">通过</el-dropdown-item>
-            <el-dropdown-item command="未通过">未通过</el-dropdown-item>
+            <el-dropdown-item command="已认证">已认证</el-dropdown-item>
+            <el-dropdown-item command="未认证">未认证</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
       </div>
@@ -53,10 +53,10 @@
         class="grid-content bg-purple"
         style="display: flex; justify-content: flex-end; margin-left: 10px"
       >
-        <el-button type="success" @click="success">审核通过</el-button>
-        <el-button type="danger" @click="failed">审核不通过</el-button>
-        <el-button type="primary" @click="recover">恢复</el-button>
-        <el-button type="warning" @click="deleted">删除</el-button>
+        <el-button type="primary" @click="success">认证成功</el-button>
+        <el-button type="primary" @click="failed">认证失败</el-button>
+        <el-button type="success" @click="recover">恢复</el-button>
+        <el-button type="danger" @click="deleted">删除</el-button>
         <el-button type="primary" @click="batchExports">导出</el-button>
       </div>
     </el-row>
@@ -559,10 +559,10 @@
       if (command === "待审核") {
         this.formData.status = 1;
       }
-      if (command === "通过") {
+      if (command === "已认证") {
         this.formData.status = 2;
       }
-      if (command === "未通过") {
+      if (command === "未认证") {
         this.formData.status = 3;
       }
       this.currentPage = 1;

+ 14 - 405
src/views/supplierAcceptor/index.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -27,8 +27,8 @@
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item command="全部">全部</el-dropdown-item>
             <el-dropdown-item command="待审核">待审核</el-dropdown-item>
-            <el-dropdown-item command="通过">通过</el-dropdown-item>
-            <el-dropdown-item command="不通过">不通过</el-dropdown-item>
+            <el-dropdown-item command="成功">成功</el-dropdown-item>
+            <el-dropdown-item command="失败">失败</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
       </div>
@@ -170,26 +170,29 @@
       >
         <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">
+		</el-table-column>
       <el-table-column align="center" label="操作" width="300">
         <template slot-scope="scope">
           <el-tag
             type="primary"
             style="cursor: pointer; margin-right: 15px"
+			v-if="scope.row.status != 1"
             @click="success(scope.row.id)"
             v-permission="['admin', 'salesman']"
-            v-if="scope.row.status != 1"
-            >审核通过
+            >审核成功
           </el-tag>
           <el-tag
             type="primary"
             style="cursor: pointer; margin-right: 15px"
+			v-if="scope.row.status != 2"
             @click="fail(scope.row.id)"
             v-permission="['admin', 'salesman']"
-            v-if="scope.row.status != 2"
-            >审核不通过
+            
+            >审核失败
           </el-tag>
           <el-tag
             type="primary"
@@ -243,398 +246,6 @@
 
 
 <script>
-<<<<<<< HEAD
-	import {
-		dataConversionUtil
-	} from "../../utils/Excel.js";
-	import {
-		getSupplierAcceptor
-	} from "@/api/supplierAcceptor";
-	import {
-		getAcceptorSearch
-	} from "@/api/acceptor";
-	export default {
-		filters: {
-			statusFilter(status) {
-				const statusMap = {
-					published: "success",
-					draft: "gray",
-					deleted: "danger",
-				};
-				return statusMap[status];
-			},
-		},
-		data() {
-			return {
-				// 角色ID
-				roleId: '',
-				// 弹窗显示 1修改信息 2新增
-				dialogVisible1: false,
-				dialogVisible2: false,
-				// 表单数据
-				formData: {
-					pageIndex:'',
-					pageSize:'',
-					startTime: "",
-					endTime: "",
-					status: "", // 审核状态
-					supplierId: "", //供应商ID
-					supplierName:'', //供应商名称
-					acceptorName:'',
-				},
-				//承兑人列表
-				acceptorList: '',
-				// 新增承兑人数据
-				form: {
-					supplierId: '',
-					acceptorIds: [],
-				},
-				/* 当前页数 */
-				currentPage: 1,
-				/* 每页显示个数 */
-				pagesize: 10,
-				/* 总条数 */
-				total: 20,
-				srcList: [],
-				list: [],
-				listLoading: false,
-				status: "",
-				search: "",
-				temporaryList: [],
-				multipleSelection: [],
-				hpstatus: "",
-				checked: false,
-				pickerOptions: {
-					shortcuts: [{
-							text: "最近一周",
-							onClick(picker) {
-								const end = new Date();
-								const start = new Date();
-								start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-								picker.$emit("pick", [start, end]);
-							},
-						},
-						{
-							text: "最近一个月",
-							onClick(picker) {
-								const end = new Date();
-								const start = new Date();
-								start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-								picker.$emit("pick", [start, end]);
-							},
-						},
-						{
-							text: "最近三个月",
-							onClick(picker) {
-								const end = new Date();
-								const start = new Date();
-								start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-								picker.$emit("pick", [start, end]);
-							},
-						},
-					],
-				},
-				value1: "",
-				value2: "",
-				exportExcelData1: [], //列表缓存数据
-				exportExcelData2: [],
-			};
-		},
-		mounted() {
-			this.roleId = this.$store.state.user.userInfo.roleId;
-			this.checked = this.$store.state.user.checked;
-			// 获取供应商列表传递的供应商id
-			this.formData.supplierId = this.$route.params.id
-			// 获取供应商id
-			this.form.supplierId = this.$store.state.user.userInfo.id
-
-			if (this.formData.supplierId == "") {
-				this.getAllList()
-			} else {
-				this.searchForm = {
-					...this.formData,
-				};
-				this.getAllList(this.searchForm);
-			}
-		},
-		methods: {
-			/* 获取列表数据 */
-			getAllList(searchForm = {}) {
-				const params = {
-					pageIndex: this.currentPage,
-					pageSize: this.pagesize,
-				};
-				getSupplierAcceptor({
-					...params,
-					...searchForm,
-				}).then((res) => {
-					const {
-						data
-					} = res;
-					console.log(res, "res");
-					this.temporaryList = data.result;
-					this.srcList = data.result;
-					this.total = res.data.total;
-				});
-			},
-
-			// 获取承兑人列表
-			getAcceptor(searchForm = {}) {
-				this.dialogVisible2 = true
-				const params = {
-			  pageIndex: '',
-			  pageSize: -1
-				};
-				getAcceptorSearch({
-			  ...params,
-					...searchForm,
-				}).then((res) => {
-					this.acceptorList = res.data.result
-				});
-			},
-			/* 输入供应商名称查询 */
-			Search() {
-				let name=this.srcList.filter((item)=>item.supplierName===this.formData.supplierName)
-				this.form.supplierId=name[0].supplierId
-				this.currentPage = 1;
-				this.searchForm = {
-				...this.formData,
-				};
-				console.log(this.searchForm)
-				this.getAllList(this.searchForm);
-			},
-			// 添加承兑人
-			addAcceptor() {
-				this.$request({
-					url: '/api/SupplierAcceptor',
-					method: 'post',
-					data: this.form
-				}).then(res => {
-					if (res.code === 200) {
-						this.$message({
-							type: 'success',
-							message: "添加成功!"
-						})
-						this.getAllList()
-					}
-				})
-				this.dialogVisible2 = false
-			},
-
-
-			// 重新提交
-			Resubmit(supplierId, acceptorId) {
-				this.$request({
-					url: '/api/SupplierAcceptor',
-					method: 'post',
-					data: {
-						supplierId: supplierId,
-						acceptorIds: [acceptorId]
-					}
-				}).then(res => {
-					if (res.code === 200) {
-						console.log(res)
-						this.$message({
-							type: 'success',
-							message: "提交成功!"
-						})
-						this.getAllList()
-					}
-				})
-			},
-
-			// 批量审核成功
-			successes() {
-				let ids = Array.from(this.multipleSelection, ({
-					id
-				}) => id)
-				let status = Array.from(this.multipleSelection, ({
-					status
-				}) => status)
-				if (status.includes(1)) {
-					this.$message({
-						type: 'error',
-						message: '不能审核通过已是通过状态的账号'
-					})
-				} else if (ids == "") {
-					this.$message({
-						type: 'error',
-						message: '请选择数据'
-					})
-				} else {
-					this.$request({
-						url: "/api/SupplierAcceptor/update",
-						method: "post",
-						data: {
-							ids: ids,
-							status: 1,
-						},
-					}).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();
-						}
-					});
-				}
-
-			},
-
-			// 单个审核通过
-			success(id) {
-				this.$request({
-					url: '/api/SupplierAcceptor/update',
-					method: "post",
-					data: {
-						ids: [id],
-						status: 1,
-					},
-				}).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();
-					}
-				})
-			},
-
-			// 批量审核不通过
-			failed() {
-				let ids = Array.from(this.multipleSelection, ({
-					id
-				}) => id)
-				let status = Array.from(this.multipleSelection, ({
-					status
-				}) => status)
-				if (status.includes(2)) {
-					this.$message({
-						type: 'error',
-						message: '不能审核不通过已是不通过状态的账号'
-					})
-				} else if (ids == "") {
-					this.$message({
-						type: 'error',
-						message: '请选择数据'
-					})
-				} else {
-					this.$request({
-						url: "/api/SupplierAcceptor/update",
-						method: "post",
-						data: {
-							ids: ids,
-							status: 2,
-						},
-					}).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();
-						}
-					});
-				}
-			},
-			// 单个审核不通过
-			fail(id) {
-				this.$request({
-					url: '/api/SupplierAcceptor/update',
-					method: "post",
-					data: {
-						ids: [id],
-						status: 2,
-					},
-				}).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();
-					}
-				})
-			},
-
-			// 批量删除
-			deleteStatuses() {
-				let ids = Array.from(this.multipleSelection, ({
-					id
-				}) => id)
-				if (ids == "") {
-					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: '已取消删除'
-						});
-					})
-=======
 import { dataConversionUtil } from "../../utils/Excel.js";
 import { getSupplierAcceptor } from "@/api/supplierAcceptor";
 import { getAcceptorSearch } from "@/api/acceptor";
@@ -760,10 +371,10 @@ export default {
             type: "success",
             message: "添加成功!",
           });
+		  this.getAllList();
         }
       });
       this.dialogVisible2 = false;
-      this.getAllList();
     },
 
     // 重新提交
@@ -777,14 +388,13 @@ export default {
         },
       }).then((res) => {
         if (res.code === 200) {
-          console.log(res);
           this.$message({
             type: "success",
             message: "提交成功!",
           });
+		this.getAllList();
         }
       });
-      this.getAllList();
     },
 
     // 批量审核成功
@@ -1013,10 +623,10 @@ export default {
       if (command === "待审核") {
         this.formData.status = 0;
       }
-      if (command === "通过") {
+      if (command === "成功") {
         this.formData.status = 1;
       }
-      if (command === "不通过") {
+      if (command === "失败") {
         this.formData.status = 2;
       }
       if (command === "全部") {
@@ -1152,7 +762,6 @@ export default {
     },
   },
 };
->>>>>>> 8d3c049c352701eacdc0059c004d3702069c33b3
 
 </script>
 <style lang="scss" scoped>

+ 10 - 8
src/views/table/index.vue

xqd xqd xqd
@@ -17,9 +17,9 @@
       <div class="grid-content bg-purple">
         <el-dropdown @command="handleCommand">
           <div class="pulldown">
-            <span class="el-dropdown-link" v-if="!status"> 承兑人状态 </span>
-            <span class="el-dropdown-link" v-if="status">
-              {{ status }}
+            <span class="el-dropdown-link" v-if="!Status"> 承兑人状态 </span>
+            <span class="el-dropdown-link" v-if="Status">
+              {{ Status }}
             </span>
             <i class="el-icon-arrow-down el-icon--right"></i>
           </div>
@@ -280,12 +280,13 @@ export default {
       // 弹窗显示 1修改信息 2新增
       dialogVisible1: false,
       dialogVisible2: false,
+	  Status:'',
       // 表单数据
       formData: {
         startTime: "",
         endTime: "",
         name: "", // 承兑人名称
-        Status: "", // 承兑人状态
+        Status:"", // 承兑人状态
       },
       // 新增承兑人数据
       form: {
@@ -611,21 +612,22 @@ export default {
 
     /* 输入承兑人状态查询 */
     handleCommand(command) {
-      this.status = command;
+      this.Status = command;
       if (command === "正常") {
-        this.formData.status = 5;
+        this.formData.Status = 0;
       }
       if (command === "删除") {
-        this.formData.status = 4;
+        this.formData.Status = 1;
       }
       if (command === "全部") {
-        this.formData.status = "";
+        this.formData.Status = "";
       }
 
       this.currentPage = 1;
       this.searchForm = {
         ...this.formData,
       };
+	  console.log(this.searchForm)
       this.getAllList(this.searchForm);
     },
     /* 输入承兑人名称查询 */