Jelajahi Sumber

Merge branch 'master' of http://git.9026.com/Tartarus/alhj-admin

Sunny Feng 2 tahun lalu
induk
melakukan
f1fdce9ec6
36 mengubah file dengan 3600 tambahan dan 2965 penghapusan
  1. 32 0
      src/api/report.js
  2. 1 1
      src/components/Hamburger/index.vue
  3. 1 1
      src/components/SvgIcon/index.vue
  4. 1 1
      src/components/TableWrapper/TableWrapper.vue
  5. 1 1
      src/components/upload/FileUpload.vue
  6. 1 1
      src/components/upload/upload.vue
  7. 6 11
      src/layout/components/Sidebar/SidebarItem.vue
  8. 86 54
      src/router/index.js
  9. 2 2
      src/utils/request.js
  10. 1 1
      src/views/contracts/addcontract.vue
  11. 1 1
      src/views/contracts/addnewbill_bak.vue
  12. 1 2
      src/views/contracts/billDetail.vue
  13. 24 26
      src/views/contracts/detail.vue
  14. 1 1
      src/views/contracts/editcontract_bak.vue
  15. 211 147
      src/views/contracts/index.vue
  16. 1 1
      src/views/contracts/new_file copy.vue
  17. 113 103
      src/views/databackup/index.vue
  18. 7 5
      src/views/delivery/edit.vue
  19. 672 632
      src/views/delivery/index.vue
  20. 1 1
      src/views/form/addTicketdrawer.vue
  21. 1 1
      src/views/form/detail.vue
  22. 458 371
      src/views/form/index.vue
  23. 1 22
      src/views/login/index.vue
  24. 620 541
      src/views/management/index.vue
  25. 137 157
      src/views/mine/index.vue
  26. 788 665
      src/views/register/index.vue
  27. 19 23
      src/views/shipments/index.vue
  28. 25 26
      src/views/shipments/shipments1.vue
  29. 19 16
      src/views/shipments/shipments2.vue
  30. 14 18
      src/views/shipments/shipments3.vue
  31. 83 23
      src/views/sucuirtyaudit/annexList.vue
  32. 1 1
      src/views/sucuirtyaudit/attachment-detail.vue
  33. 80 23
      src/views/sucuirtyaudit/detail.vue
  34. 20 26
      src/views/sucuirtyaudit/index.vue
  35. 1 1
      src/views/table/addAcceptor.vue
  36. 169 59
      src/views/table/index.vue

+ 32 - 0
src/api/report.js

xqd
@@ -37,5 +37,37 @@ export function getReportSupplierReport(params) {
   })
 }
 
+/* 导出承兑人分类报表 */
+export function getExportAcceptor(params) {
+  return request({
+    url:'/api/Report/export/acceptorClassification',
+    method: 'get',
+    params
+  })
+}
+/* 导出出票人分类报表 */
+export function getExportDrawer(params) {
+  return request({
+    url:'/api/Report/export/drawerClassification',
+    method: 'get',
+    params
+  })
+}
+/* 导出合同统计报表 */
+export function getExportContract(params) {
+  return request({
+    url:'/api/Report/export/contractReport',
+    method: 'get',
+    params
+  })
+}
+/* 导出供应商统计报表 */
+export function getExportSupplier(params) {
+  return request({
+    url:'/api/Report/export/supplierReport',
+    method: 'get',
+    params
+  })
+}
 
 

+ 1 - 1
src/components/Hamburger/index.vue

xqd
@@ -30,7 +30,7 @@ export default {
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 .hamburger {
   display: inline-block;
   vertical-align: middle;

+ 1 - 1
src/components/SvgIcon/index.vue

xqd
@@ -45,7 +45,7 @@ export default {
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 .svg-icon {
   width: 1em;
   height: 1em;

+ 1 - 1
src/components/TableWrapper/TableWrapper.vue

xqd
@@ -103,7 +103,7 @@ export default {
   }
 }
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 
 	.pagesip {
 		width: 100%;

+ 1 - 1
src/components/upload/FileUpload.vue

xqd
@@ -235,7 +235,7 @@ export default {
 }
 </script>
 
-<style>
+<style lang="scss" scoped>
 .hideUpload .el-upload--picture-card {
   display: none;
 }

+ 1 - 1
src/components/upload/upload.vue

xqd
@@ -201,7 +201,7 @@ export default {
   }
 }
 </script>
-<style scoped>
+<style lang="scss" scoped>
 .text-center {
   text-align: center;
 }

+ 6 - 11
src/layout/components/Sidebar/SidebarItem.vue

xqd
@@ -95,19 +95,14 @@ export default {
   }
 }
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .svg-icon{
-  margin-left: 4px;
+  width: 1.8em !important;
+  margin-left: -3px;
+  margin-right: 10px !important;
 }
-.el-tooltip{
-  position: absolute !important;
-  left: 0px !important;
-  top: 0px;
-  height: 100%;
-  width: 100%;
-  display: inline-block;
-  box-sizing: border-box;
-  padding: 0px -20px;
+::v-deep .el-menu-item.is-active > .el-tooltip i{
+      color: rgb(216, 171, 90) !important;
 }
 
 </style>

+ 86 - 54
src/router/index.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,5 +1,7 @@
 import Vue from 'vue'
 import Router from 'vue-router'
+import { getToken } from '@/utils/auth';
+
 
 Vue.use(Router)
 import Layout from '@/layout'
@@ -151,14 +153,14 @@ export const asyncRouterMap = [{
 		]
 	},
 
-	{
-    path: '/form',
-		component: Layout,
-		redirect: '/form',
-		meta: {
-			title: '出票人列表',
-			icon: 'form',
-			roles: ['admin', 'salesman']
+	{
+    path: '/form',
+		component: Layout,
+		redirect: '/form',
+		meta: {
+			title: '出票人列表',
+			icon: 'form',
+			roles: ['admin', 'salesman']
 		},
 		children: [{
 				path: 'index',
@@ -191,15 +193,15 @@ export const asyncRouterMap = [{
 				hidden: true
 			}
 		]
-	},
+	},
 
 	{
 		path: '/delivery',
-		component: Layout,
-		redirect: '/delivery',
-		meta: {
-			title: '供应商账号',
-			roles: ['admin', 'salesman']
+		component: Layout,
+		redirect: '/delivery',
+		meta: {
+			title: '供应商账号',
+			roles: ['admin', 'salesman']
 		},
 		children: [{
 				path: 'index',
@@ -222,15 +224,15 @@ export const asyncRouterMap = [{
 				hidden: true
 			}
 		]
-	},
+	},
 
-	{
-    path: '/shipments',
-		component: Layout,
-		redirect: '/shipments',
-		meta: {
-			title: '报表统计',
-			roles: ['admin', 'salesman']
+	{
+    path: '/shipments',
+		component: Layout,
+		redirect: '/shipments',
+		meta: {
+			title: '报表统计',
+			roles: ['admin', 'salesman']
 		},
 		children: [{
 				path: 'index',
@@ -274,15 +276,15 @@ export const asyncRouterMap = [{
 			}
 
 		]
-	},
+	},
 
-	{
-    path: '/management',
-		component: Layout,
-		redirect: '/management',
-		meta: {
-			title: '业务管理员',
-			roles: ['admin']
+	{
+    path: '/management',
+		component: Layout,
+		redirect: '/management',
+		meta: {
+			title: '业务管理员',
+			roles: ['admin']
 		},
 		children: [{
 				path: 'index',
@@ -295,15 +297,15 @@ export const asyncRouterMap = [{
 				}
 			},
 		]
-	},
+	},
 
-	{
-    path: '/sucuirtyaudit',
-		component: Layout,
-		redirect: '/sucuirtyaudit',
-		meta: {
-			title: '安全审计',
-			roles: ['admin']
+	{
+    path: '/sucuirtyaudit',
+		component: Layout,
+		redirect: '/sucuirtyaudit',
+		meta: {
+			title: '安全审计',
+			roles: ['admin']
 		},
 		children: [{
 				path: 'index',
@@ -348,15 +350,15 @@ export const asyncRouterMap = [{
 			}
 
 		]
-	},
+	},
 
-	{
-    path: '/databackup',
-		component: Layout,
-		redirect: '/databackup',
-		meta: {
-			title: '数据备份',
-			roles: ['admin']
+	{
+    path: '/databackup',
+		component: Layout,
+		redirect: '/databackup',
+		meta: {
+			title: '数据备份',
+			roles: ['admin']
 		},
 		children: [{
 			path: 'index',
@@ -368,15 +370,15 @@ export const asyncRouterMap = [{
 				roles: ['admin']
 			}
 		}]
-	},
+	},
 
-	{
-    path: '/mine',
-		component: Layout,
-		redirect: '/mine',
-		meta: {
-			title: '个人资料',
-			roles: ['admin', 'salesman', 'supplier']
+	{
+    path: '/mine',
+		component: Layout,
+		redirect: '/mine',
+		meta: {
+			title: '个人资料',
+			roles: ['admin', 'salesman', 'supplier']
 		},
 		children: [{
 			path: 'index',
@@ -397,6 +399,11 @@ export const asyncRouterMap = [{
 	}
 ]
 
+
+
+
+
+
 const createRouter = () => new Router({
 	// mode: 'history', // require service support
 	scrollBehavior: () => ({
@@ -407,6 +414,31 @@ const createRouter = () => new Router({
 
 const router = createRouter()
 
+// //路由全局前置守卫
+// router.beforeEach((to, from, next) => {
+// 	/* 
+// 	  to from 路由信息对象
+// 	  to 到哪儿去
+// 	  from 从哪儿来
+// 	  next 放行方法
+// 	*/
+// 	const token = getToken('vue_admin_template_token');
+// 	//如果有token就跳转
+// 	if (token) {
+// 	  next()
+// 	} else {
+// 	  //如果没有token  1去登录直接放行 
+// 	  if (to.path === '/login') {
+// 		next()
+// 	  } else {
+// 		// 2不去登录跳到登录 
+// 		next('/login')
+// 	  }
+// 	}
+
+// })
+
+
 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
 export function resetRouter() {
 	const newRouter = createRouter()

+ 2 - 2
src/utils/request.js

xqd xqd
@@ -10,7 +10,7 @@ import {
 
 // create an axios instance
 const service = axios.create({
-  baseURL: 'https://ht.9026.com/', // url = base url + request url
+  baseURL: 'https://api.xrongm.com/', // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests
   timeout: 10 * 10000, // request timeout
   method: 'post',
@@ -101,7 +101,7 @@ service.interceptors.response.use(
     //   return res
     // }
 		if(res.type==="application/x-zip-compressed" ||
-       res.type==="application/vnd.ms-excel"){
+       res.type==="application/vnd.ms-excel"||res.type === 'application/json'){
 			return response
 		}else if(res.code != 200){
 			Message({

+ 1 - 1
src/views/contracts/addcontract.vue

xqd
@@ -406,7 +406,7 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.line {
 		text-align: center;
 	}

+ 1 - 1
src/views/contracts/addnewbill_bak.vue

xqd
@@ -516,7 +516,7 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .contract {
   display: flex;
   justify-content: space-between;

+ 1 - 2
src/views/contracts/billDetail.vue

xqd
@@ -204,10 +204,9 @@ export default {
 };
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .btn {
   display: flex;
-  // justify-content: space-around;
 }
 .bill-detail{
   padding: 20px;

+ 24 - 26
src/views/contracts/detail.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -128,6 +128,7 @@
 
     <el-card class="box-card">
       <el-table
+       :row-key="getRowKey"
         v-loading="listLoading"
         :data="temporaryList"
         element-loading-text="Loading"
@@ -137,7 +138,7 @@
         @select="handleSelectionChange"
         @select-all="handleAll"
       >
-        <el-table-column align="center" label="" width="55" type="selection" />
+        <el-table-column align="center" label="" width="55" type="selection" :reserve-selection="true" />
         <el-table-column label="汇票名称" align="center" prop="name" />
         <el-table-column label="汇票编号" align="center" prop="draftNo" />
         <el-table-column label="承兑人" align="center" prop="acceptorName" />
@@ -246,19 +247,13 @@
           @click="deletedContractDraft"
           >删除</el-button
         >
-        <el-button
-          type="primary"
-          style="float: right; margin-left: 10px"
-          @click="Exports"
-          >全部导出
-        </el-button>
         <el-button
           type="primary"
           style="float: right; margin-left: 10px"
           @click="ExportsContractDraft"
-          >批量导出
+          >导出
         </el-button>
-         
+
         <el-button
           type="primary"
           size="small"
@@ -313,7 +308,7 @@ export default {
       contract: {},
       currentPage: 1,
       multipleSelection: [],
-      pagesize: 11,
+      pagesize: 9999,
       form: "",
       invoicePicList: [],
       picList: [],
@@ -327,7 +322,7 @@ export default {
         approveStatus: "",
       },
       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
 
@@ -448,22 +443,21 @@ export default {
       this.temporaryList = this.srcList;
     },
 
+     getRowKey(row) {
+      return row.id;
+    },
+
     /* 批量导出 */
     handleAll(data) {
-       this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection=data
     },
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
+			this.multipleSelection=data
     },
     /* 批量导出 */
     ExportsContractDraft() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports()
       } else {
         var tableHeader = [
           [
@@ -494,9 +488,9 @@ export default {
         this.$message.success("导出成功!");
       }
     },
-/* 全部导出 */
+    /* 全部导出 */
     Exports() {
-      this.multipleSelection = this.temporaryList
+      this.multipleSelection = this.temporaryList;
       setTimeout(() => {
         var tableHeader = [
           [
@@ -513,7 +507,7 @@ export default {
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
           dataList.push([
-           index + 1,
+            index + 1,
             item.name,
             item.draftNo,
             item.acceptorName,
@@ -525,7 +519,6 @@ export default {
         });
         dataConversionUtil.dataToExcel("汇票列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
 
@@ -742,7 +735,7 @@ export default {
 };
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .box-card {
   width: 98%;
   margin: 0 auto;
@@ -786,8 +779,6 @@ export default {
   padding-bottom: 10px;
 }
 
-
-
 .grid-content {
   margin: 15px 20px;
 }
@@ -827,5 +818,12 @@ export default {
   border-radius: 0 26px 26px 0;
   line-height: 40px;
   text-align: center;
+}
+.el-button--danger{
+  margin-left: 10px;
+}
+::v-deep .el-textarea__inner{
+height: 150px !important;
+
 }
 </style>

+ 1 - 1
src/views/contracts/editcontract_bak.vue

xqd
@@ -667,7 +667,7 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .contract {
   display: flex;
   justify-content: space-between;

+ 211 - 147
src/views/contracts/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -25,24 +25,27 @@
           <i slot="prefix" class="el-input__icon el-icon-search" />
         </el-input>
       </div>
-      <!-- 合同状态 -->
+       <!-- 合同审核状态 -->
       <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommand">
+        <el-dropdown @command="handleCommandAuditstatus">
           <div class="pulldown">
-            <span v-if="!status" class="el-dropdown-link"> 合同状态 </span>
-            <span v-if="status" class="el-dropdown-link">
-              {{ status }}
+            <span v-if="!Auditstatus" class="el-dropdown-link">
+              合同审核状态
+            </span>
+            <span v-if="Auditstatus" class="el-dropdown-link">
+              {{ Auditstatus }}
             </span>
             <i class="el-icon-arrow-down el-icon--right" />
           </div>
           <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>
-
+      
       <!-- 汇票状态 -->
       <div class="grid-content bg-purple">
         <el-dropdown @command="handlehpCommand">
@@ -62,27 +65,27 @@
         </el-dropdown>
       </div>
 
-      <!-- 合同审核状态 -->
+      <!-- 合同状态 -->
       <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommandAuditstatus">
+        <el-dropdown @command="handleCommand">
           <div class="pulldown">
-            <span v-if="!Auditstatus" class="el-dropdown-link">
-              合同审核状态
-            </span>
-            <span v-if="Auditstatus" class="el-dropdown-link">
-              {{ Auditstatus }}
+            <span v-if="!status" class="el-dropdown-link"> 合同状态 </span>
+            <span v-if="status" class="el-dropdown-link">
+              {{ status }}
             </span>
             <i class="el-icon-arrow-down el-icon--right" />
           </div>
           <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>
 
+     
+
+
       <!-- 日期查询 -->
       <div class="grid-content bg-purple">
         <div class="block">
@@ -103,16 +106,24 @@
     </el-row>
 
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="temporaryList"
       element-loading-text="Loading"
       border
       fit
+			ref="multipleTable"
       highlight-current-row
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection" />
+      <el-table-column
+        align="center"
+        label=""
+        width="55"
+        type="selection"
+        :reserve-selection="true"
+      />
       <el-table-column label="合同名称" align="center" prop="name" />
       <el-table-column
         label="合同编号"
@@ -124,33 +135,33 @@
         label="供应商名称"
         align="center"
         prop="supplierName"
-        width="100"
       />
 
       <el-table-column
         label="承兑人名称"
         align="center"
         prop="acceptorName"
-        width="100"
       />
       <el-table-column
         label="出票人名称"
         align="center"
         prop="drawersName"
-        width="100"
-      />
-      <el-table-column label="汇票状态" align="center" prop="draftStatusText" />
-      <el-table-column
-        label="合同状态"
-        align="center"
-        prop="contractStatusText"
+
       />
+      <!-- 合同审核状态 -->
       <el-table-column
         class-name="status-col"
         label="合同审核状态"
         align="center"
         prop="statusText"
-        width="120"
+      />
+      <!-- 汇票状态 -->
+      <el-table-column label="汇票状态" align="center" prop="draftStatusText" />
+       <!-- 合同状态 -->
+      <el-table-column
+        label="合同状态"
+        align="center"
+        prop="contractStatusText"
       />
       <el-table-column
         align="center"
@@ -220,9 +231,7 @@
             @click="failed"
             >审核失败</el-button
           >
-
-          <el-button type="primary" @click="Exports">全部导出</el-button>
-          <el-button type="primary" @click="batchExports">批量导出</el-button>
+          <el-button type="primary" @click="batchExports">导出</el-button>
           <el-button type="success" @click="recover">恢复</el-button>
           <el-button type="danger" @click="deleted">删除</el-button>
         </div>
@@ -310,7 +319,6 @@ export default {
       status: "",
       hpstatus: "",
       Auditstatus: "",
-      exportExcel: [], //导出数据
       search: "",
       /* 当前页数 */
       currentPage: 1,
@@ -349,8 +357,7 @@ export default {
         ],
       },
       value2: "",
-      exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      multipleSelection:[]
     };
   },
   mounted() {
@@ -395,30 +402,44 @@ export default {
       });
     },
     successed() {
-      // let successed = this.list.filter(item => item.id === id)
       const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Contract/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 3,
-        },
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getData();
-        }
-      });
+			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/Contract/manage",
+				  method: "post",
+				  data: {
+				    ids: ids,
+				    operateType: 3,
+				  },
+				}).then((res) => {
+				  if (res.code === 200) {
+				    this.$message({
+				      type: "success",
+				      message: res.msg,
+				    });
+						this.$refs.multipleTable.clearSelection();
+				    this.getData();
+				  } else {
+				    this.$message({
+				      type: "danger",
+				      message: res.msg,
+				    });
+				    this.getData();
+				  }
+				});
+			}
+      
     },
     Ssuccessed(id) {
       this.$request({
@@ -446,28 +467,43 @@ export default {
     },
     failed() {
       const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Contract/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 4,
-        },
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getData();
-        }
-      });
+			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/Contract/manage",
+				  method: "post",
+				  data: {
+				    ids: ids,
+				    operateType: 4,
+				  },
+				}).then((res) => {
+				  if (res.code === 200) {
+				    this.$message({
+				      type: "success",
+				      message: res.msg,
+				    });
+					this.$refs.multipleTable.clearSelection();
+				    this.getData();
+				  } else {
+				    this.$message({
+				      type: "danger",
+				      message: res.msg,
+				    });
+				    this.getData();
+				  }
+				});
+			}
+      
     },
     Sfailed(id) {
       this.$request({
@@ -493,55 +529,85 @@ export default {
         }
       });
     },
-    recover(id) {
+    recover() {
       const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Contract/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 2,
-        },
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getData();
-        }
-      });
+	  let status=Array.from(this.multipleSelection,({contractStatus})=>contractStatus)
+	  if(status.includes(0)){
+	  	this.$message({
+	  		type: 'error',
+	  		message: '不能恢复已是正常状态的账号'
+	  	})
+	  }else if(ids==""){
+			  this.$message({
+			  	type: 'error',
+			  	message: '请选择数据'
+			  })
+		  }else{
+		  this.$request({
+		    url: "/api/Contract/manage",
+		    method: "post",
+		    data: {
+		      ids: ids,
+		      operateType: 2,
+		    },
+		  }).then((res) => {
+		    if (res.code === 200) {
+		      this.$message({
+		        type: "success",
+		        message: res.msg,
+		      });
+			  this.$refs.multipleTable.clearSelection();
+		      this.getData();
+		    } else {
+		      this.$message({
+		        type: "danger",
+		        message: res.msg,
+		      });
+		      this.getData();
+		    }
+		  });
+	  }
+      
     },
     deleted() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Contract/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 1,
-        },
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getData();
-        }
-      });
+			const ids = Array.from(this.multipleSelection, ({ id }) => id);
+			let status=Array.from(this.multipleSelection,({contractStatus})=>contractStatus)
+			if(status.includes(1)){
+				this.$message({
+					type: 'error',
+					message: '不能删除已是删除状态的账号'
+				})
+			}else if(ids==""){
+				this.$message({
+					type: 'error',
+					message: '请选择数据'
+				})
+			}else{
+				this.$request({
+				  url: "/api/Contract/manage",
+				  method: "post",
+				  data: {
+				    ids: ids,
+				    operateType: 1,
+				  },
+				}).then((res) => {
+				  if (res.code === 200) {
+				    this.$message({
+				      type: "success",
+				      message: res.msg,
+				    });
+						this.$refs.multipleTable.clearSelection();
+				    this.getData();
+				  } else {
+				    this.$message({
+				      type: "danger",
+				      message: res.msg,
+				    });
+				    this.getData();
+				  }
+				});
+			}
+     
     },
     // 合同状态查询
     handleCommand(command) {
@@ -664,27 +730,27 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
+    getRowKey(row) {
+      return row.id;
+    },
+
     /* 批量导出数据 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data;
+      console.log(this.multipleSelection);
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data;
     },
 
-    /* 批量导出合同列表 */
+    /* 导出 */
     batchExports() {
-      this.exportExcel = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
-      if (this.exportExcel == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+      if (this.multipleSelection == "") {
+        this.Exports();
       } else {
         var tableHeader = [
           [
-            "序号",
+             "序号",
             "合同名称",
             "合同编号",
             "承兑人",
@@ -696,7 +762,7 @@ export default {
           ],
         ];
         var dataList = [];
-        this.exportExcel.forEach((item, index) => {
+        this.multipleSelection.forEach((item, index) => {
           dataList.push([
             index + 1,
             item.name,
@@ -709,12 +775,12 @@ export default {
             item.createdAt,
           ]);
         });
-        dataConversionUtil.dataToExcel("合同列表", tableHeader, dataList);
+        dataConversionUtil.dataToExcel("承兑人列表", tableHeader, dataList);
         this.$message.success("导出成功!");
       }
     },
 
-    /* 全部导出合同列表数据 */
+    /* 全部导出承兑人列表数据 */
     getContacts() {
       const data = {
         pageIndex: "",
@@ -727,19 +793,18 @@ export default {
         draftStatus: "",
         supplierId: "",
       };
-      contractsPageApi({ data }).then((res) => {
+      contractsPageApi({ ...data }).then((res) => {
         const { result } = res.data;
-        this.exportExcel = result;
+        this.multipleSelection = result;
       });
     },
-
     /* 全部导出 */
     Exports() {
       this.getContacts();
       setTimeout(() => {
         var tableHeader = [
           [
-            "序号",
+             "序号",
             "合同名称",
             "合同编号",
             "承兑人",
@@ -751,7 +816,7 @@ export default {
           ],
         ];
         var dataList = [];
-        this.exportExcel.forEach((item, index) => {
+        this.multipleSelection.forEach((item, index) => {
           dataList.push([
             index + 1,
             item.name,
@@ -766,13 +831,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("合同列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-        this.exportExcel = [];
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 1 - 1
src/views/contracts/new_file copy.vue

xqd
@@ -696,7 +696,7 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .contract {
   display: flex;
   justify-content: space-between;

+ 113 - 103
src/views/databackup/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -49,13 +49,13 @@
         class="grid-content bg-purple"
         style="display: flex; justify-content: flex-end"
       >
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExports">批量导出</el-button>
-        <el-button type="primary">下载</el-button>
+        <el-button type="primary" @click="batchExports">导出</el-button>
+        <el-button type="primary" @click="downLoadSql">下载</el-button>
         <el-button type="danger" @click="moreDelete">删除</el-button>
       </div>
     </el-row>
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="srcList"
       element-loading-text="Loading"
@@ -65,7 +65,13 @@
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column
+        align="center"
+        label=""
+        width="55"
+        type="selection"
+        :reserve-selection="true"
+      >
       </el-table-column>
       <el-table-column
         label="文件名称"
@@ -138,15 +144,20 @@
       </el-button>
     </div>
 
-    <!--修改出票人弹窗 -->
-    <el-dialog title="修改出票人" :visible.sync="dialogVisible" width="500px">
-      <el-form ref="form"  label-width="80px">
-        <el-form-item label="备注" >
-          <el-input  style="width: 100%"></el-input>
+    <!--修改备注弹窗 -->
+    <el-dialog title="修改备注" :visible.sync="dialogVisible" width="500px">
+      <el-form ref="form" :model="tableData" label-width="80px">
+        <el-form-item label="文件名称" >
+          <el-input v-model="tableData.fileName" disabled style="width: 100%" ></el-input>
+        </el-form-item>
+        <el-form-item label="备注">
+          <el-input v-model="tableData.remark" style="width: 100%"></el-input>
         </el-form-item>
         <el-form-item>
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" >提交修改</el-button>
+          <el-button type="primary" @click="submitDelete(tableData.fileName)"
+            >提交修改</el-button
+          >
         </el-form-item>
       </el-form>
     </el-dialog>
@@ -155,7 +166,7 @@
 
 <script>
 import { dataConversionUtil } from "../../utils/Excel.js";
-import { getDatabase,deletDatabase } from "@/api/database";
+import { getDatabase, deletDatabase } from "@/api/database";
 export default {
   filters: {
     statusFilter(status) {
@@ -171,7 +182,7 @@ export default {
     return {
       // 弹窗显示
       dialogVisible: false,
-      tableData:{},
+      tableData: {},
       // 表单数据
       formData: {
         startTime: "",
@@ -226,8 +237,8 @@ export default {
       },
       value1: "",
       value2: "",
-      exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      multipleSelection: [], //下载sql文件数据
+      fileNameArray:[],//存放所有的文件名
     };
   },
 
@@ -243,10 +254,12 @@ export default {
       };
       getDatabase({ ...params, ...searchForm }).then((res) => {
         const { data } = res;
-        console.log(data);
         this.temporaryList = data.result;
         this.srcList = data.result;
         this.total = res.data.total;
+        this.fileNameArray = this.temporaryList.map(item=>{
+          return item.fileName
+        })
       });
     },
 
@@ -309,70 +322,84 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
-
     /* 下载数据备份 */
     download(fileName) {
-      window.open(
-        "https://ht.9026.com/api/Database/export?fileName=" + fileName
-      );
-      // this.$request({
-      // 	url:'/api/Database/export',
-      // 	method:'post',
-      // 	data:{
-      // 		fileName:fileName
-      // 	}
-      // }).then((res)=>{
-      // 	console.log(res)
-      // })
+      this.$request({
+        url: "/api/Database/download",
+        method: "post",
+        data: {
+          fileNameList: [fileName],
+        },
+      }).then((res) => {
+        window.open(res.data);
+      });
+    },
+
+    /* 下载多条数据备份 */
+    downLoadSql() {
+      let fileNameList = this.multipleSelection.map((item, value) => {
+        return item.fileName;
+      });
+
+      if (fileNameList == "") {
+        this.$request({
+          url: "/api/Database/download",
+          method: "post",
+          data: {
+            fileNameList:this.fileNameArray
+          },
+        }).then((res) => {
+          window.open(res.data);
+        });
+      } else {
+        this.$request({
+          url: "/api/Database/download",
+          method: "post",
+          data: {
+            fileNameList,
+          },
+        }).then((res) => {
+          window.open(res.data);
+        });
+      }
     },
-    // recover(fileName) {
-    //   this.$request({
-    //     url: "/api/Database/restore",
-    //     method: "post",
-    //     headers: {
-    //       "Content-Type": "application/json",
-    //     },
-    //     data: {
-    //       fileName: fileName,
-    //     },
-    //   }).then((res) => {
-    //     console.log(res);
-    //     if (res.code == 200) {
-    //       this.$message({
-    //         type: "success",
-    //         message: "恢复成功",
-    //       });
-    //     } else {
-    //       this.$message({
-    //         type: "danger",
-    //         message: "恢复失败",
-    //       });
-    //     }
-    //   });
-    // },
 
     /* 修改备注 */
-    modifyRemarks(fileName){
-      console.log(fileName);
-      // this.dialogVisible = true;
-      // let params ={
-      //   fileNameList:fileName
-      // }
-      // deletDatabase({...params}).then(res=>{
-      //   console.log(res);
-      // })
+    modifyRemarks(fileName) {
+      this.dialogVisible = true;
+      this.$request({
+        url: "/api/Database/backups",
+        method: "post",
+        data: {
+          fileName,
+        },
+      }).then((res) => {
+        this.tableData = res.data.result[0];
+      });
+    },
+
+    /* 提交修改 */
+    submitDelete() {
+      this.$request({
+        url: "/api/Database/update",
+        method: "post",
+        data: this.tableData,
+      }).then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: "修改成功",
+          });
+          this.getAllList();
+          this.dialogVisible = false;
+        } else {
+          this.$message({
+            type: "danger",
+            message: "修改失败",
+          });
+        }
+      });
     },
-    // // 修改信息弹窗
-    // modify(id) {
-     
-    //   this.$request({
-    //     url: "/api/Drawer/" + id,
-    //     method: "get",
-    //   }).then((res) => {
-    //     this.tableData = res.data;
-    //     this.talbeData = this.$route.query.id;
-    //   });
-    // },
 
     deleted(fileName) {
       this.$request({
@@ -421,33 +448,23 @@ export default {
       });
     },
 
+    getRowKey(row) {
+      return row.id;
+    },
     /* 批量导出 */
     handleSelectionChange(data) {
-       this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data;
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data;
     },
     /* 批量导出数据 */
     batchExports() {
-       this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports();
       } else {
         var tableHeader = [
-          [
-            "序号",
-            '文件名称',
-            '存储对象',
-            '文件大小',
-            '时间',
-            '备注'
-
-          ],
+          ["序号", "文件名称", "存储对象", "文件大小", "时间", "备注"],
         ];
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
@@ -457,7 +474,7 @@ export default {
             item.storeType,
             item.fileSize,
             item.backupTime,
-            item.remark
+            item.remark,
           ]);
         });
         dataConversionUtil.dataToExcel("数据备份列表", tableHeader, dataList);
@@ -473,24 +490,18 @@ export default {
         startTime: "",
         endTime: "",
         fileName: "",
-        
       };
-      getDatabase({ data }).then((res) => {
+      getDatabase({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });
     },
-     /* 全部导出 */
+    /* 全部导出 */
     Exports() {
       this.getContacts();
       setTimeout(() => {
         var tableHeader = [
-          [ "序号",
-            '文件名称',
-            '存储对象',
-            '文件大小',
-            '时间',
-            '备注'],
+          ["序号", "文件名称", "存储对象", "文件大小", "时间", "备注"],
         ];
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
@@ -500,18 +511,17 @@ export default {
             item.storeType,
             item.fileSize,
             item.backupTime,
-            item.remark
+            item.remark,
           ]);
         });
         dataConversionUtil.dataToExcel("数据备份列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .app-container {
   position: relative;
 }

+ 7 - 5
src/views/delivery/edit.vue

xqd xqd
@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-descriptions title="供应商详情" :column="3" :size="size" border style="margin: 20px;">
+		<el-descriptions title="供应商详情" :column="3"  border style="margin: 20px;">
 			<el-descriptions-item label="供应商名称">{{ list.name }}</el-descriptions-item>
 			<el-descriptions-item label="id">{{ list.id }}</el-descriptions-item>
 			<el-descriptions-item label="统一社会信用代码">{{ list.socialCode }}</el-descriptions-item>
@@ -11,12 +11,14 @@
 			<el-descriptions-item label="联系电话">{{ list.contactsMobile }}</el-descriptions-item>
 			<el-descriptions-item label="认证状态">{{ list.statusText }}</el-descriptions-item>
 			<el-descriptions-item label="认证照片">
-				<el-image v-for="(item,index) in list.identifyPicList" :key="index" style="width: 100px; height: 100px"
-					:src="item" />
+				<!-- <el-image v-for="(item,index) in list.identifyPicList" :key="index" style="width: 100px; height: 100px"
+					:src="item" /> -->
+					<FileShow :files="list.identifyPicList" />
 			</el-descriptions-item>
 			<el-descriptions-item label="授权委托书">
-				<el-image v-for="(item,index) in list.proxyFileList" :key="index" style="width: 100px; height: 100px"
-					:src="item" />
+				<!-- <el-image v-for="(item,index) in list.proxyFileList" :key="index" style="width: 100px; height: 100px"
+					:src="item" /> -->
+					<FileShow :files="list.proxyFileList" />
 			</el-descriptions-item>
 		</el-descriptions>
 		<el-dialog title="修改供应商" :visible.sync="dialogVisible" width="40%">

+ 672 - 632
src/views/delivery/index.vue

xqd xqd xqd xqd
@@ -12,44 +12,43 @@
           <i slot="prefix" class="el-input__icon el-icon-search"></i>
         </el-input>
       </div>
-      <!-- 审核状态 -->
+       <!-- 审核状态 -->
       <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommand">
+        <el-dropdown @command="AhandleCommand">
           <div class="pulldown">
-            <span v-if="!providerStatus" class="el-dropdown-link">
-              供应商状态
-            </span>
-            <span v-if="providerStatus" class="el-dropdown-link">
-              {{ providerStatus }}
+            <span v-if="!Auditstatus" class="el-dropdown-link"> 审核状态 </span>
+            <span v-if="Auditstatus" class="el-dropdown-link">
+              {{ Auditstatus }}
             </span>
             <i class="el-icon-arrow-down el-icon--right" />
           </div>
           <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-menu>
         </el-dropdown>
       </div>
       <!-- 供应商状态 -->
       <div class="grid-content bg-purple">
-        <el-dropdown @command="AhandleCommand">
+        <el-dropdown @command="handleCommand">
           <div class="pulldown">
-            <span v-if="!Auditstatus" class="el-dropdown-link">
-              审核状态
+            <span v-if="!providerStatus" class="el-dropdown-link">
+              供应商状态
             </span>
-            <span v-if="Auditstatus" class="el-dropdown-link">
-              {{ Auditstatus }}
+            <span v-if="providerStatus" class="el-dropdown-link">
+              {{ providerStatus }}
             </span>
             <i class="el-icon-arrow-down el-icon--right" />
           </div>
           <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-menu>
         </el-dropdown>
       </div>
+     
       <!-- 日期查询 -->
       <div class="grid-content bg-purple">
         <div class="block">
@@ -69,6 +68,7 @@
       </div>
     </el-row>
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="temporaryList"
       element-loading-text="Loading"
@@ -78,7 +78,7 @@
       @selection-change="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column type="selection"> </el-table-column>
+      <el-table-column type="selection" :reserve-selection="true"> </el-table-column>
       <el-table-column
         label="供应商名称"
         align="center"
@@ -110,649 +110,689 @@
       >
       </el-table-column>
 
-      <el-table-column
-        label="联系电话"
-        width="180"
-        align="center"
-        prop="contactsMobile"
-      >
-      </el-table-column>
-      <el-table-column
-        label="审核状态"
-        align="center"
-        prop="statusText"
-      >
-      </el-table-column>
-      <el-table-column label="供应商状态" align="center" prop="isDeletedText"  width="120">
-      </el-table-column>
-      <el-table-column align="center" prop="createdAt" label="时间" width="180">
-      </el-table-column>
-      <el-table-column
-        align="center"
-        prop="created_at"
-        label="操作"
-        width="250"
-      >
-        <template slot-scope="scope">
-          <el-tag
-            type="primary"
-            style="cursor: pointer; margin-right: 15px"
-            @click="toedit(scope.row.id)"
-            >详情
-          </el-tag>
-          <el-tag
-            type="success"
-            style="margin-right: 15px; cursor: pointer"
-            @click="Srecover(scope.row.id)"
-            v-if="scope.row.isDeleted == 1"
-            >恢复</el-tag
-          >
-          <el-tag
-            type="danger"
-            style="margin-right: 15px; cursor: pointer"
-            @click="Sdeleted(scope.row.id)"
-            v-if="scope.row.isDeleted == 0"
-            >禁用</el-tag
-          >
-          <el-tag
-            type="primary"
-            style="margin-right: 15px; cursor: pointer"
-            @click="reset(scope.row.id)"
-            v-permission="['admin']"
-            >重置密码</el-tag
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-		
+			<el-table-column label="联系电话" width="180" align="center" prop="contactsMobile">
+			</el-table-column>
+			<el-table-column label="审核状态" align="center" prop="statusText">
+			</el-table-column>
+			<el-table-column label="供应商状态" align="center" prop="isDeletedText" width="120">
+			</el-table-column>
+			<el-table-column align="center" prop="createdAt" label="时间" width="180">
+			</el-table-column>
+			<el-table-column align="center" prop="created_at" label="操作" width="250">
+				<template slot-scope="scope">
+					<el-tag type="primary" style="cursor: pointer; margin-right: 15px" @click="toedit(scope.row.id)">详情
+					</el-tag>
+					<el-tag type="success" style="margin-right: 15px; cursor: pointer" @click="Srecover(scope.row.id)"
+						v-if="scope.row.isDeleted == 1">恢复</el-tag>
+					<el-tag type="danger" style="margin-right: 15px; cursor: pointer" @click="Sdeleted(scope.row.id)"
+						v-if="scope.row.isDeleted == 0">删除</el-tag>
+					<el-tag type="primary" style="margin-right: 15px; cursor: pointer" @click="reset(scope.row.id)"
+						v-permission="['admin']">重置密码</el-tag>
+				</template>
+			</el-table-column>
+		</el-table>
+
 		<!-- 重置密码弹窗 -->
 		<el-dialog title="重置密码" :visible.sync="dialogVisible" width="30%">
-		<el-form ref="form" :model="password" label-width="80px">
-			<el-form-item label="登录密码" prop="password.newpassword">
-				<el-input v-model="password.newpassword" style="width: 300px;" show-password></el-input>
-			</el-form-item>
-			<el-form-item label="确认密码" prop="password.ConfirmnewPassword">
-				<el-input v-model="password.ConfirmnewPassword" style="width: 300px;" show-password></el-input>
-			</el-form-item>
-			<el-form-item >
-				<el-button @click="dialogVisible = false">取 消</el-button>
-				<el-button type="primary" @click="onSubmit">提交修改</el-button>
-			</el-form-item>
-		</el-form>
+			<el-form ref="form" :model="password" label-width="80px">
+				<el-form-item label="登录密码" prop="password.newpassword">
+					<el-input v-model="password.newpassword" style="width: 300px" show-password></el-input>
+				</el-form-item>
+				<el-form-item label="确认密码" prop="password.ConfirmnewPassword">
+					<el-input v-model="password.ConfirmnewPassword" style="width: 300px" show-password></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button @click="dialogVisible = false">取 消</el-button>
+					<el-button type="primary" @click="onSubmit">提交修改</el-button>
+				</el-form-item>
+			</el-form>
 		</el-dialog>
-		
-    <div style="display: flex; justify-content: space-between">
-      <el-row type="flex" justify="end">
-        <div class="btn" style="display: flex; justify-content: flex-end">
-          <el-button type="primary" @click="failed">认证失败</el-button>
-          <el-button type="primary" @click="success">认证成功</el-button>
-          <el-button type="primary" @click="Exports">全部导出</el-button>
-          <el-button type="primary" @click="batchExports">批量导出</el-button>
-          <el-button type="success" @click="recover">恢复</el-button>
-          <el-button type="danger" @click="deleted">禁用</el-button>
-        </div>
-      </el-row>
-      <div class="pagesip">
-        <el-button
-          type="primary"
-          size="small"
-          style="
+
+		<div style="display: flex; justify-content: space-between">
+			<el-row type="flex" justify="end">
+				<div class="btn" style="display: flex; justify-content: flex-end">
+					<el-button type="primary" @click="failed">认证失败</el-button>
+					<el-button type="primary" @click="success">认证成功</el-button>
+					<el-button type="primary" @click="batchExports">导出</el-button>
+					<el-button type="success" @click="recover">恢复</el-button>
+					<el-button type="danger" @click="deleted">删除</el-button>
+				</div>
+			</el-row>
+			<div class="pagesip">
+				<el-button type="primary" size="small" style="
             background-color: #d8ab5a;
             border-color: #d8ab5a;
             margin: 0 20px;
-          "
-          @click="jumpFirstPage"
-          >首页
-        </el-button>
-        <el-pagination
-          background
-          @current-change="handleCurrentChange"
-          layout="total,prev, pager, next"
-          :total="total"
-          :page-size="pagesize"
-          :current-page="currentPage"
-          prev-text="上一页"
-          next-text="下一页"
-          :hide-on-single-page="false"
-          ref="pagination"
-        >
-        </el-pagination>
-        <el-button
-          type="primary"
-          size="small"
-          style="
+          " @click="jumpFirstPage">首页
+				</el-button>
+				<el-pagination background @current-change="handleCurrentChange" layout="total,prev, pager, next"
+					:total="total" :page-size="pagesize" :current-page="currentPage" prev-text="上一页" next-text="下一页"
+					:hide-on-single-page="false" ref="pagination">
+				</el-pagination>
+				<el-button type="primary" size="small" style="
             background-color: #d8ab5a;
             border-color: #d8ab5a;
             margin: 0 20px;
-          "
-          @click="jumpLastPage"
-          >尾页
-        </el-button>
-      </div>
-    </div>
-  </div>
+          " @click="jumpLastPage">尾页
+				</el-button>
+			</div>
+		</div>
+	</div>
 </template>
 
 <script>
-import { dataConversionUtil } from "../../utils/Excel.js";
-import { getSupplierSearch } from "@/api/supplier";
+	import {
+		dataConversionUtil
+	} from "../../utils/Excel.js";
+	import {
+		getSupplierSearch
+	} from "@/api/supplier";
 
-export default {
-  filters: {
-    statusFilter(status) {
-      const statusMap = {
-        published: "success",
-        draft: "gray",
-        deleted: "danger",
-      };
-      return statusMap[status];
-    },
-  },
-  data() {
-    return {
-	  //重置密码
-	  password:{
-		  newpassword:'',
-		  ConfirmnewPassword:'',
-		  supplierId:'',
-	  },
-	  // 控制弹窗
-	  dialogVisible:false,
-      // 表单数据
-      formData: {
-        startTime: "",
-        endTime: "",
-        name: "",
-        status: "",
-        socialCode: "",
-        legalPerson: "",
-        isDeleted: "",
-      },
-      /* 当前页数 */
-      currentPage: 1,
-      /* 每页显示个数 */
-      pagesize: 10,
-      /* 总条数 */
-      total: 20,
-      srcList: [],
-      list: [],
-      temporaryList: [],
-      listLoading: false,
-      providerStatus: "",
-      search: "",
-      Auditstatus: "",
-      multipleSelection: [],
-      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.checked = this.$store.state.user.checked;
-    this.getAllList();
-  },
-  methods: {
-    /* 获取列表数据 */
-    getAllList(searchForm = {}) {
-      const params = {
-        pageIndex: this.currentPage,
-        pageSize: this.pagesize,
-      };
-      getSupplierSearch({ ...params, ...searchForm }).then((res) => {
-        const { data } = res;
-        this.temporaryList = data.result;
-        this.srcList = data.result;
-        this.total = res.data.total;
-      });
-    },
-    
+	export default {
+		filters: {
+			statusFilter(status) {
+				const statusMap = {
+					published: "success",
+					draft: "gray",
+					deleted: "danger",
+				};
+				return statusMap[status];
+			},
+		},
+		data() {
+			return {
+				//重置密码
+				password: {
+					newpassword: "",
+					ConfirmnewPassword: "",
+					supplierId: "",
+				},
+				// 控制弹窗
+				dialogVisible: false,
+				// 表单数据
+				formData: {
+					startTime: "",
+					endTime: "",
+					name: "",
+					status: "",
+					socialCode: "",
+					legalPerson: "",
+					isDeleted: "",
+				},
+				/* 当前页数 */
+				currentPage: 1,
+				/* 每页显示个数 */
+				pagesize: 10,
+				/* 总条数 */
+				total: 20,
+				srcList: [],
+				list: [],
+				temporaryList: [],
+				listLoading: false,
+				providerStatus: "",
+				search: "",
+				Auditstatus: "",
+				multipleSelection: [],
+				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.checked = this.$store.state.user.checked;
+			this.getAllList();
+		},
+		methods: {
+			/* 获取列表数据 */
+			getAllList(searchForm = {}) {
+				const params = {
+					pageIndex: this.currentPage,
+					pageSize: this.pagesize,
+				};
+				getSupplierSearch({
+					...params,
+					...searchForm
+				}).then((res) => {
+					const {
+						data
+					} = res;
+					this.temporaryList = data.result;
+					this.srcList = data.result;
+					this.total = res.data.total;
+				});
+			},
 
-    toedit(id) {
-      this.$router.push({
-        path: "/edit",
-        query: {
-          id: id,
-        },
-      });
-    },
+			toedit(id) {
+				this.$router.push({
+					path: "/edit",
+					query: {
+						id: id,
+					},
+				});
+			},
 
-    // 日期审核状态查询
-    startEndTime(item) {
-      if (item == null) {
-        item = [];
-        this.formData.startTime ='';
-        this.formData.endTime = '';
-        this.currentPage = 1;
-        this.searchForm = { ...this.formData };
-        this.getAllList(this.searchForm);
-      } else {
-        this.formData.startTime = this.value2[0];
-        this.formData.endTime = this.value2[1];
-        this.currentPage = 1;
-        this.searchForm = { ...this.formData };
-        this.getAllList(this.searchForm);
-      }
-     
-    },
-    /* 审核状态查询 */
-    handleCommand(command) {
-      this.providerStatus = command;
-      if (command === "全部") {
-        this.formData.isDeleted = "";
-      }
-      if (command === "正常") {
-        this.formData.isDeleted = 0;
-      }
-      if (command === "删除") {
-        this.formData.isDeleted = 1;
-      }
-      this.currentPage = 1;
-      this.searchForm = { ...this.formData };
-      this.getAllList(this.searchForm);
-    },
+			// 日期审核状态查询
+			startEndTime(item) {
+				if (item == null) {
+					item = [];
+					this.formData.startTime = "";
+					this.formData.endTime = "";
+					this.currentPage = 1;
+					this.searchForm = {
+						...this.formData
+					};
+					this.getAllList(this.searchForm);
+				} else {
+					this.formData.startTime = this.value2[0];
+					this.formData.endTime = this.value2[1];
+					this.currentPage = 1;
+					this.searchForm = {
+						...this.formData
+					};
+					this.getAllList(this.searchForm);
+				}
+			},
+			/* 审核状态查询 */
+			handleCommand(command) {
+				this.providerStatus = command;
+				if (command === "全部") {
+					this.formData.isDeleted = "";
+				}
+				if (command === "正常") {
+					this.formData.isDeleted = 0;
+				}
+				if (command === "删除") {
+					this.formData.isDeleted = 1;
+				}
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData
+				};
+				this.getAllList(this.searchForm);
+			},
 
-    // 输入供应商状态查询
-    AhandleCommand(command) {
-      this.Auditstatus = command;
-      if (command === "全部") {
-        this.formData.status = "";
-      }
-      if (command === "已认证") {
-        this.formData.status = 2;
-      }
-      if (command === "未认证") {
-        this.formData.status = 1;
-      }
-      this.currentPage = 1;
-      this.searchForm = { ...this.formData };
-      this.getAllList(this.searchForm);
-    },
+			// 输入供应商状态查询
+			AhandleCommand(command) {
+				this.Auditstatus = command;
+				if (command === "全部") {
+					this.formData.status = "";
+				}
+				if (command === "已认证") {
+					this.formData.status = 2;
+				}
+				if (command === "未认证") {
+					this.formData.status = 1;
+				}
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData
+				};
+				this.getAllList(this.searchForm);
+			},
 
-  
+			/* 输入出票人名称查询 */
+			Search() {
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData,
+				};
+				this.getAllList(this.searchForm);
+			},
 
-    /* 输入出票人名称查询 */
-    Search() {
-      this.currentPage = 1;
-      this.searchForm = {
-        ...this.formData,
-      };
-      this.getAllList(this.searchForm);
-    },
+			/* 分页功能,改变当前页 */
+			handleCurrentChange(val) {
+				this.currentPage = val;
+				this.getAllList(this.searchForm);
+			},
 
-    /* 分页功能,改变当前页 */
-    handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getAllList(this.searchForm);
-    },
+			/* 分页功能去首页 */
+			jumpFirstPage() {
+				this.$refs.pagination.handleCurrentChange(1);
+				this.$emit("handleCurrentChange", 1);
+			},
+			/* 分页功能:去尾页 */
+			jumpLastPage() {
+				let font = this.$refs.pagination;
+				let cpage = Math.ceil(font.total / font.pageSize);
+				font.handleCurrentChange(cpage);
+			},
 
-    /* 分页功能去首页 */
-    jumpFirstPage() {
-      this.$refs.pagination.handleCurrentChange(1);
-      this.$emit("handleCurrentChange", 1);
-    },
-    /* 分页功能:去尾页 */
-    jumpLastPage() {
-      let font = this.$refs.pagination;
-      let cpage = Math.ceil(font.total / font.pageSize);
-      font.handleCurrentChange(cpage);
-    },
+			getRowKey(row) {
+				return row.id;
+			},
 
+			/* 批量导出数据 */
+			handleSelectionChange(data) {
+				this.multipleSelection = data
+				console.log(this.multipleSelection)
+			},
+			handleAll(data) {
+				this.multipleSelection = data
+			},
+			/* 批量导出数据 */
+			batchExports() {
+				if (this.multipleSelection == "") {
+					this.Exports()
+				} else {
+					var tableHeader = [
+						[
+							"序号",
+							"供应商名称",
+							"社会统一信用码",
+							"账号",
+							"法人名称",
+							"联系人",
+							"电话",
+							"审核状态",
+							"时间",
+						],
+					];
+					var dataList = [];
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([
+							index + 1,
+							item.name,
+							item.socialCode,
+							item.account,
+							item.legalPerson,
+							item.contacts,
+							item.contactsMobile,
+							item.statusText,
+							item.createdAt,
+						]);
+					});
+					dataConversionUtil.dataToExcel("供应商列表", tableHeader, dataList);
+					this.$message.success("导出成功!");
+				}
+			},
 
-    /* 批量导出数据 */
-    handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
-    },
-    handleAll(data) {
-      this.exportExcelData1.push(data);
-    },
-    /* 批量导出数据 */
-    batchExports() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
-      if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
-      } else {
-        var tableHeader = [
-          [
-            "序号",
-            "供应商名称",
-            "社会统一信用码",
-            "账号",
-            "法人名称",
-            "联系人",
-            "电话",
-            "审核状态",
-            "时间",
-          ],
-        ];
-        var dataList = [];
-        this.multipleSelection.forEach((item, index) => {
-          dataList.push([
-            index + 1,
-            item.name,
-            item.socialCode,
-            item.account,
-            item.legalPerson,
-            item.contacts,
-            item.contactsMobile,
-            item.statusText,
-            item.createdAt,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("供应商列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
-      }
-    },
+			/* 全部导出承兑人列表数据 */
+			getContacts() {
+				const data = {
+					pageIndex: "",
+					pageSize: -1,
+					startTime: "",
+					endTime: "",
+					name: "",
+					status: "",
+					socialCode: "",
+					legalPerson: "",
+					isDeleted: "",
+				};
+				getSupplierSearch({
+					...data
+				}).then((res) => {
+					const {
+						result
+					} = res.data;
+					this.multipleSelection = result;
+				});
+			},
+			/* 全部导出 */
+			Exports() {
+				this.getContacts();
+				setTimeout(() => {
+					var tableHeader = [
+						[
+							"序号",
+							"供应商名称",
+							"社会统一信用码",
+							"账号",
+							"法人名称",
+							"联系人",
+							"电话",
+							"审核状态",
+							"时间",
+						],
+					];
+					var dataList = [];
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([
+							index + 1,
+							item.name,
+							item.socialCode,
+							item.account,
+							item.legalPerson,
+							item.contacts,
+							item.contactsMobile,
+							item.statusText,
+							item.createdAt,
+						]);
+					});
+					dataConversionUtil.dataToExcel("供应商列表", tableHeader, dataList);
+					this.$message.success("导出成功!");
+				}, 1000);
+			},
 
-    /* 全部导出承兑人列表数据 */
-    getContacts() {
-      const data = {
-        pageIndex: "",
-        pageSize: -1,
-        startTime: "",
-        endTime: "",
-        name: "",
-        status: "",
-        socialCode:'',
-        legalPerson:'',
-        isDeleted:'',
-      };
-      getSupplierSearch({ data }).then((res) => {
-        const { result } = res.data;
-        this.multipleSelection = result;
-      });
-    },
-     /* 全部导出 */
-    Exports() {
-      this.getContacts();
-      setTimeout(() => {
-        var tableHeader = [
-          ["序号",
-            "供应商名称",
-            "社会统一信用码",
-            "账号",
-            "法人名称",
-            "联系人",
-            "电话",
-            "审核状态",
-            "时间",],
-        ];
-        var dataList = [];
-        this.multipleSelection.forEach((item, index) => {
-          dataList.push([
-            index + 1,
-            item.name,
-            item.socialCode,
-            item.account,
-            item.legalPerson,
-            item.contacts,
-            item.contactsMobile,
-            item.statusText,
-            item.createdAt,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("供应商列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
-        this.multipleSelection=[]
-      }, 1000);
-    },
+			success() {
+				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/Supplier/manage",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 3,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: res.msg,
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "danger",
+								message: res.msg,
+							});
+							this.getAllList();
+						}
+					});
+				}
+				
+			},
+			failed() {
+				let ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id);
+				let status = Array.from(this.multipleSelection, ({
+					status
+				}) => status)
+				if (status.includes(0)) {
+					this.$message({
+						type: 'error',
+						message: '未认证的选项不能在此认证失败'
+					})
+				}else if(ids == ""){
+					this.$message({
+						type: 'error',
+						message: '请选择数据'
+					})
+				} else {
+					this.$request({
+						url: "/api/Supplier/manage",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 4,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+				  	this.$message({
+								type: "success",
+								message: res.msg,
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+				 			type: "danger",
+								message: res.msg,
+							});
+							this.getAllList();
+						}
+					});
+				}
 
-   
+			},
+			recover() {
+				let ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id);
+				let status = Array.from(this.multipleSelection, ({
+					isDeleted
+				}) => isDeleted)
+				if (status.includes(0)) {
+					this.$message({
+						type: 'error',
+						message: '不能恢复已是正常状态的账号'
+					})
+		}	else if (ids == "") {
+					this.$message({
+						type: 'error',
+						message: '请选择数据'
+					})
+				} else {
+					this.$request({
+						url: "/api/Supplier/manage",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 2,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: res.msg,
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "danger",
+								message: res.msg,
+							});
+							this.getAllList();
+						}
+					});
+				}
 
-    success() {
-      let ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Supplier/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 3,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    failed() {
-      let ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Supplier/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 4,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    recover() {
-      let ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Supplier/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 2,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    Srecover(id) {
-      this.$request({
-        url: "/api/Supplier/manage",
-        method: "post",
-        data: {
-          ids: [id],
-          operateType: 2,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    deleted() {
-      let ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Supplier/manage",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 1,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    Sdeleted(id) {
-      this.$request({
-        url: "/api/Supplier/manage",
-        method: "post",
-        data: {
-          ids: [id],
-          operateType: 1,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    reset(id) {
-		this.dialogVisible=true
-		this.password.supplierId=id
-    },
-	// 提交修改密码
-	onSubmit(){
-		if(this.password.newpassword!==this.password.ConfirmnewPassword){
-			this.$message({
-				type:'error',
-				message:'密码与确认密码不一致'
-			})
-		}else if(this.password.newpassword.length<6||this.password.ConfirmnewPassword<6){
-			this.$message({
-				type:'error',
-				message:'密码与确认密码至少6位'
-			})
-		}else{
-			this.$request({
-			        url: "/api/Account/password/resetSupplier",
-			        method: "post",
-			        data: {
-			          password: this.password.newpassword,
-			          supplierId: this.password.supplierId,
-			        },
-			      }).then((res) => {
-			        console.log(res);
-			        if (res.code === 200) {
-			          this.$message({
-			            type: "success",
-			            message: "重置成功",
-			          });
-					  this.dialogVisible=false
-			        }
-			      });
-		}
-	}
-  },
-};
+			},
+			Srecover(id) {
+				this.$request({
+					url: "/api/Supplier/manage",
+					method: "post",
+					data: {
+						ids: [id],
+						operateType: 2,
+					},
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: "success",
+							message: res.msg,
+						});
+						this.getAllList();
+					} else {
+						this.$message({
+							type: "danger",
+							message: res.msg,
+						});
+						this.getAllList();
+					}
+				});
+			},
+			deleted() {
+				let ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id);
+				let status = Array.from(this.multipleSelection, ({
+					isDeleted
+				}) => isDeleted)
+				if (status.includes(1)) {
+					this.$message({
+						type: 'error',
+						message: '不能删除已是删除状态的账号'
+					})
+				} else if (ids == "") {
+					this.$message({
+						type: 'error',
+						message: '请选择数据'
+					})
+				} else {
+					this.$request({
+						url: "/api/Supplier/manage",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 1,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: res.msg,
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "danger",
+								message: res.msg,
+							});
+							this.getAllList();
+						}
+					});
+				}
+
+			},
+			Sdeleted(id) {
+				this.$request({
+					url: "/api/Supplier/manage",
+					method: "post",
+					data: {
+						ids: [id],
+						operateType: 1,
+					},
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: "success",
+							message: res.msg,
+						});
+						this.getAllList();
+					} else {
+						this.$message({
+							type: "danger",
+							message: res.msg,
+						});
+						this.getAllList();
+					}
+				});
+			},
+			reset(id) {
+				this.dialogVisible = true;
+				this.password.supplierId = id;
+			},
+			// 提交修改密码
+			onSubmit() {
+				if (this.password.newpassword !== this.password.ConfirmnewPassword) {
+					this.$message({
+						type: "error",
+						message: "密码与确认密码不一致",
+					});
+				} else if (
+					this.password.newpassword.length < 6 ||
+					this.password.ConfirmnewPassword < 6
+				) {
+					this.$message({
+						type: "error",
+						message: "密码与确认密码至少6位",
+					});
+				} else {
+					this.$request({
+						url: "/api/Account/password/resetSupplier",
+						method: "post",
+						data: {
+							password: this.password.newpassword,
+							supplierId: this.password.supplierId,
+						},
+					}).then((res) => {
+						console.log(res);
+						if (res.code === 200) {
+							this.$message({
+								type: "success",
+								message: "重置成功",
+							});
+							this.dialogVisible = false;
+						}
+					});
+				}
+			},
+		},
+	};
 </script>
-<style lang="scss">
-.pulldown {
-  width: 185px;
-  height: 40px;
-  border: 1px solid #e8e8e8;
-  border-radius: 10px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  justify-content: space-between;
-  padding: 0 20px;
-  color: #999999;
-}
+<style lang="scss" scoped>
+	.pulldown {
+		width: 185px;
+		height: 40px;
+		border: 1px solid #e8e8e8;
+		border-radius: 10px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		justify-content: space-between;
+		padding: 0 20px;
+		color: #999999;
+	}
 
-.pagesip {
-  width: 100%;
-  margin: 20px auto;
-  display: flex;
-  // align-items: center;
-  justify-content: flex-end;
-}
+	.pagesip {
+		width: 100%;
+		margin: 20px auto;
+		display: flex;
+		// align-items: center;
+		justify-content: flex-end;
+	}
 
-.el-pagination.is-background .el-pager li:not(.disabled).active {
-  background-color: #d8ab5a;
-}
+	.el-pagination.is-background .el-pager li:not(.disabled).active {
+		background-color: #d8ab5a;
+	}
 
-.el-col {
-  margin-bottom: 20px;
-}
+	.el-col {
+		margin-bottom: 20px;
+	}
 
-.btn {
-  padding: 20px;
-}
+	.btn {
+		padding: 20px;
+	}
 </style>

+ 1 - 1
src/views/form/addTicketdrawer.vue

xqd
@@ -54,7 +54,7 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.form {
 		margin-top: 100px;
 		display: flex;

+ 1 - 1
src/views/form/detail.vue

xqd
@@ -88,7 +88,7 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.form {
 		display: flex;
 		flex-direction: column;

+ 458 - 371
src/views/form/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,4 +1,5 @@
 <template>
+
   <div class="app-container">
     <el-row type="flex" justify="space-between" style="margin-bottom: 20px">
       <div class="grid-content bg-purple">
@@ -35,11 +36,12 @@
         class="grid-content bg-purple"
         style="display: flex; justify-content: flex-end"
       >
+        <el-button type="success" @click="recovers">恢复</el-button>
+        <el-button type="danger" @click="deletestatuses">删除</el-button>
         <el-button type="primary" @click="dialogVisible2 = true"
           >新增出票人</el-button
         >
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExports">批量导出</el-button>
+        <el-button type="primary" @click="batchExports">导出</el-button>
       </div>
     </el-row>
 
@@ -49,7 +51,7 @@
         <el-form-item label="姓名" prop="tableData.name">
           <el-input v-model="tableData.name" style="width: 100%"></el-input>
         </el-form-item>
-        <el-form-item label="银行账" prop="tableData.bankAccount">
+        <el-form-item label="银行账" prop="tableData.bankAccount">
           <el-input
             v-model="tableData.bankAccount"
             style="width: 100%"
@@ -70,7 +72,7 @@
         <el-form-item label="出票人名称" style="width: 100%" prop="name">
           <el-input v-model="form.name"></el-input>
         </el-form-item>
-        <el-form-item label="账号" style="width: 100%" prop="bankAccount">
+        <el-form-item label="银行账号" style="width: 100%" prop="bankAccount">
           <el-input v-model="form.bankAccount"></el-input>
         </el-form-item>
         <el-form-item label="开户行名称" style="width: 100%" prop="bankName">
@@ -85,270 +87,323 @@
       </el-form>
     </el-dialog>
 
-    <el-table
-      v-loading="listLoading"
-      :data="temporaryList"
-      element-loading-text="Loading"
-      border
-      fit
-      highlight-current-row
-      @select="handleSelectionChange"
-      @select-all="handleAll"
-    >
-      <el-table-column align="center" type="selection"> </el-table-column>
-      <el-table-column label="出票人名称" align="center" prop="name">
-      </el-table-column>
-      <el-table-column label="账号" align="center" prop="bankAccount">
-      </el-table-column>
-      <el-table-column align="center" prop="bankName" label="开户行名称">
-      </el-table-column>
-      <el-table-column align="center" prop="statusText" label="出票人状态">
-      </el-table-column>
-      <el-table-column align="center" prop="createdAt" label="时间">
-      </el-table-column>
-      <el-table-column
-        align="center"
-        prop="created_at"
-        label="操作"
-        width="250"
-      >
-        <template slot-scope="scope">
-          <el-tag
-            type="primary"
-            style="cursor: pointer; margin-right: 15px"
-            @click="modify(scope.row.id)"
-            >修改
-          </el-tag>
-          <el-tag
-            type="success"
-            style="cursor: pointer; margin-right: 15px"
-            @click="recover(scope.row.id)"
-            v-if="scope.row.status == 1"
-            >恢复
-          </el-tag>
-          <el-tag
-            type="danger"
-            style="cursor: pointer; margin-right: 15px"
-            @click="deletestatus(scope.row.id)"
-            v-if="scope.row.status == 0"
-            >删除</el-tag
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagesip">
-      <el-button
-        type="primary"
-        size="small"
-        style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-        @click="jumpFirstPage"
-        >首页
-      </el-button>
-      <el-pagination
-        background
-        @current-change="handleCurrentChange"
-        layout="total,prev, pager, next"
-        :total="total"
-        :page-size="pagesize"
-        :current-page="currentPage"
-        prev-text="上一页"
-        next-text="下一页"
-        :hide-on-single-page="false"
-        ref="pagination"
-      >
-      </el-pagination>
-      <el-button
-        type="primary"
-        size="small"
-        style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-        @click="jumpLastPage"
-        >尾页
-      </el-button>
-    </div>
-  </div>
+		<el-table :row-key="getRowKey" v-loading="listLoading" :data="temporaryList" element-loading-text="Loading"
+			border fit highlight-current-row @select="handleSelectionChange" @select-all="handleAll" ref="multipleTable">
+			<el-table-column align="center" type="selection" :reserve-selection="true">
+			</el-table-column>
+			<el-table-column label="出票人名称" align="center" prop="name">
+			</el-table-column>
+			<el-table-column label="账号" align="center" prop="bankAccount">
+			</el-table-column>
+			<el-table-column align="center" prop="bankName" label="开户行名称">
+			</el-table-column>
+			<el-table-column align="center" prop="statusText" label="出票人状态">
+			</el-table-column>
+			<el-table-column align="center" prop="createdAt" label="时间">
+			</el-table-column>
+			<el-table-column align="center" prop="created_at" label="操作" width="250">
+				<template slot-scope="scope">
+					<el-tag type="primary" style="cursor: pointer; margin-right: 15px" @click="modify(scope.row.id)">修改
+					</el-tag>
+					<el-tag type="success" style="cursor: pointer; margin-right: 15px" @click="recover(scope.row.id)"
+						v-if="scope.row.status == 1">恢复
+					</el-tag>
+					<el-tag type="danger" style="cursor: pointer; margin-right: 15px"
+						@click="deletestatus(scope.row.id)" v-if="scope.row.status == 0">删除</el-tag>
+				</template>
+			</el-table-column>
+		</el-table>
+		<div class="pagesip">
+			<el-button type="primary" size="small"
+				style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpFirstPage">首页
+			</el-button>
+			<el-pagination background @current-change="handleCurrentChange" layout="total,prev, pager, next"
+				:total="total" :page-size="pagesize" :current-page="currentPage" prev-text="上一页" next-text="下一页"
+				:hide-on-single-page="false" ref="pagination">
+			</el-pagination>
+			<el-button type="primary" size="small"
+				style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpLastPage">尾页
+			</el-button>
+		</div>
+	</div>
 </template>
 
 <script>
-import { getList } from "@/api/table";
-import { dataConversionUtil } from "../../utils/Excel.js";
-import { getDrawerSearch } from "@/api/drawer";
-export default {
-  filters: {
-    statusFilter(status) {
-      const statusMap = {
-        published: "success",
-        draft: "gray",
-        deleted: "danger",
-      };
-      return statusMap[status];
-    },
-  },
-  data() {
-    return {
-      // 弹窗显示
-      dialogVisible1: false,
-      dialogVisible2: false,
-      // 表单数据
-      formData: {
-        startTime: "",
-        endTime: "",
-        name: "", // 出票人
-        status: "", // 出票人状态
-      },
-      // 新增出票人数据
-      form: {
-        name: "",
-        bankAccount: "",
-        bankName: "",
-      },
-      // 修改出票人数据
-      tableData: {
-        name: "",
-        bankAccount: "",
-        bankName: "",
-        id: "",
-        createdAt: "",
-        status: "",
-        statusText: "",
-      },
-      /* 当前页数 */
-      currentPage: 1,
-      /* 每页显示个数 */
-      pagesize: 10,
-      /* 总条数 */
-      total: 20,
-      multipleSelection: [],
-      srcList: [],
-      list: [],
-      temporaryList: [],
-      listLoading: false,
-      status: "",
-      hpstatus: "",
-      search: "",
-      checked: "",
-      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:[]
-    };
-  },
+	import {
+		dataConversionUtil
+	} from "../../utils/Excel.js";
+	import {
+		getDrawerSearch
+	} from "@/api/drawer";
+	export default {
+		filters: {
+			statusFilter(status) {
+				const statusMap = {
+					published: "success",
+					draft: "gray",
+					deleted: "danger",
+				};
+				return statusMap[status];
+			},
+		},
+		data() {
+			return {
+				// 弹窗显示
+				dialogVisible1: false,
+				dialogVisible2: false,
+				// 表单数据
+				formData: {
+					startTime: "",
+					endTime: "",
+					name: "", // 出票人
+					status: "", // 出票人状态
+				},
+				// 新增出票人数据
+				form: {
+					name: "",
+					bankAccount: "",
+					bankName: "",
+				},
+				oldTableData: "",
+				// 修改出票人数据
+				tableData: {
+					name: "",
+					bankAccount: "",
+					bankName: "",
+					id: "",
+					createdAt: "",
+					status: "",
+					statusText: "",
+				},
+				/* 当前页数 */
+				currentPage: 1,
+				/* 每页显示个数 */
+				pagesize: 10,
+				/* 总条数 */
+				total: 20,
+				multipleSelection: [],
+				srcList: [],
+				list: [],
+				temporaryList: [],
+				listLoading: false,
+				status: "",
+				hpstatus: "",
+				search: "",
+				checked: "",
+				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.checked = this.$store.state.user.checked;
-    this.getAllList();
-  },
-  methods: {
-    /* 获取列表数据 */
-    getAllList(searchForm = {}) {
-      const params = {
-        pageIndex: this.currentPage,
-        pageSize: this.pagesize,
-      };
-      getDrawerSearch({
-        ...params,
-        ...searchForm,
-      }).then((res) => {
-        const { data } = res;
-        this.temporaryList = data.result;
-        this.srcList = data.result;
-        this.total = res.data.total;
-      });
-    },
+	mounted() {
+			this.checked = this.$store.state.user.checked;
+			this.getAllList();
+		},
+		methods: {
+			/* 获取列表数据 */
+			getAllList(searchForm = {}) {
+				const params = {
+					pageIndex: this.currentPage,
+					pageSize: this.pagesize,
+				};
+				getDrawerSearch({
+					...params,
+					...searchForm,
+				}).then((res) => {
+					const {
+						data
+					} = res;
+					this.temporaryList = data.result;
+					this.srcList = data.result;
+					this.total = res.data.total;
+				});
+			},
 
-    addTicketdrawer() {
-      this.$router.push({
-        path: "/form/addTicketdrawer",
-      });
-    },
-    todetail(id) {
-      console.log(id);
-      this.$router.push({
-        path: "/form/detail",
-        query: {
-          id: id,
-        },
-      });
-    },
-    recover(id) {
-      this.$request({
-        url: "/api/Drawer/manager",
-        method: "post",
-        data: {
-          ids: [id],
-          operateType: 2,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "恢复成功",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: "恢复失败",
-          });
-          this.getAllList();
-        }
-      });
-    },
-    deletestatus(id) {
-      this.$request({
-        url: "/api/Drawer/manager",
-        method: "post",
-        data: {
-          ids: [id],
-          operateType: 1,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "删除成功",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: "删除失败",
-          });
-          this.getAllList();
-        }
-      });
-    },
+			addTicketdrawer() {
+				this.$router.push({
+					path: "/form/addTicketdrawer",
+				});
+			},
+			todetail(id) {
+				console.log(id);
+				this.$router.push({
+					path: "/form/detail",
+					query: {
+						id: id,
+					},
+				});
+			},
+			// 批量恢复
+			recovers() {
+				let ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id)
+				let status = Array.from(this.multipleSelection, ({
+					status
+				}) => status)
+				if (status.includes(0)) {
+					this.$message({
+						type: 'error',
+						message: '不能恢复已是正常状态的账号'
+					})
+				} else if(ids==""){
+					this.$message({
+						type: 'error',
+						message: '请选择数据'
+					})
+				} else{
+					this.$request({
+						url: "/api/Drawer/manager",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 2,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: "恢复成功",
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "danger",
+								message: "恢复失败",
+							});
+							this.getAllList();
+						}
+					});
+				}
+
+			},
+			recover(id) {
+				this.$request({
+					url: "/api/Drawer/manager",
+					method: "post",
+					data: {
+						ids: [id],
+						operateType: 2,
+					},
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: "success",
+							message: "恢复成功",
+						});
+						this.getAllList();
+					} else {
+						this.$message({
+							type: "danger",
+							message: "恢复失败",
+						});
+						this.getAllList();
+					}
+				});
+			},
+			deletestatuses() {
+				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/Drawer/manager",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 1,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: "删除成功",
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "danger",
+								message: "删除失败",
+							});
+							this.getAllList();
+						}
+					});
+				}
 
+			},
+			deletestatus(id) {
+				this.$request({
+					url: "/api/Drawer/manager",
+					method: "post",
+					data: {
+						ids: [id],
+						operateType: 1,
+					},
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: "success",
+							message: "删除成功",
+						});
+						this.getAllList();
+					} else {
+						this.$message({
+							type: "danger",
+							message: "删除失败",
+						});
+						this.getAllList();
+					}
+				});
+			},
+
+	
     // 修改信息弹窗
     modify(id) {
       this.dialogVisible1 = true;
@@ -357,46 +412,72 @@ export default {
         method: "get",
       }).then((res) => {
         this.tableData = res.data;
-        this.talbeData = this.$route.query.id;
+        this.oldTableData = {
+          ...this.tableData,
+        };
       });
     },
     // 修改信息弹窗提交
     onSubmit() {
-      this.$request({
-        url: "/api/Drawer/update",
-        method: "post",
-        data: this.tableData,
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "修改成功!",
-          });
-          this.getAllList();
-          this.dialogVisible1 = false;
-        } else {
-          this.$message({
-            type: "danger",
-            message: "修改失败!",
-          });
-        }
-      });
+      if (
+        JSON.stringify(this.oldTableData) === JSON.stringify(this.tableData)
+      ) {
+        this.$message({
+          type: "error",
+          message: "数据没有改变!",
+        });
+      } else if (
+        this.tableData.bankAccount.length < 5 ||
+        this.tableData.bankAccount > 20
+      ) {
+        this.$message({
+          type: "error",
+          message: "银行账号必须为5~20位!",
+        });
+      } else {
+        this.$request({
+          url: "/api/Drawer/update",
+          method: "post",
+          data: this.tableData,
+        }).then((res) => {
+          if (res.code == 200) {
+            this.$message({
+              type: "success",
+              message: "修改成功!",
+            });
+            this.getAllList();
+            this.dialogVisible1 = false;
+          } else {
+            this.$message({
+              type: "danger",
+              message: "修改失败!",
+            });
+          }
+        });
+      }
     },
     // 新增出票人弹窗
     addTicketdrawer() {
-      this.$request({
-        url: "/api/Drawer",
-        method: "post",
-        data: this.form,
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message("添加成功!");
-          this.getAllList();
-          this.dialogVisible2 = false;
-        } else {
-          this.$message("提交失败");
-        }
-      });
+      if (this.form.bankAccount.length < 5 || this.form.bankAccount > 20) {
+        this.$message({
+          type: "error",
+          message: "银行账号必须为5~20位!",
+        });
+      } else {
+        this.$request({
+          url: "/api/Drawer",
+          method: "post",
+          data: this.form,
+        }).then((res) => {
+          if (res.code === 200) {
+            this.$message("添加成功!");
+            this.getAllList();
+            this.dialogVisible2 = false;
+          } else {
+            this.$message("提交失败");
+          }
+        });
+      }
     },
 
     /* 输入出票人状态查询 */
@@ -426,7 +507,7 @@ export default {
       this.getAllList(this.searchForm);
     },
 
-    /* 分页功能,改变当前页 */
+	/* 分页功能,改变当前页 */
     handleCurrentChange(val) {
       this.currentPage = val;
       this.getAllList(this.searchForm);
@@ -444,86 +525,92 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
-    /* 批量导出数据 */
-    handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
-    },
-    handleAll(data) {
-      this.exportExcelData1.push(data);
-    },
+	getRowKey(row) {
+				return row.id;
+			},
+			/* 批量导出数据 */
+	handleSelectionChange(data) {
+				this.multipleSelection = data;
+			},
+	handleAll(data) {
+				this.multipleSelection = data;
+			},
 
-    /* 批量导出 */
-    batchExports() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
 
-      if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
-      } else {
-        var tableHeader = [
-          ["序号", "出票人名称", "账号", "开户行名称", "状态", "时间"],
-        ];
-        var dataList = [];
-        this.multipleSelection.forEach((item, index) => {
-          dataList.push([
-            index + 1,
-            item.name,
-            item.bankAccount,
-            item.bankName,
-            item.statusText,
-            item.createdAt,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("出票人列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
-      }
-    },
-    /* 全部导出承兑人列表数据 */
-    getContacts() {
-      const data = {
-        pageIndex: "",
-        pageSize: -1,
-        startTime: "",
-        endTime: "",
-        name: "",
-        status: "",
-      };
-      getDrawerSearch({ data }).then((res) => {
-        const { result } = res.data;
-        this.multipleSelection = result;
-      });
-    },
+			/* 批量导出 */
+	batchExports() {
+				if (this.multipleSelection == "") {
+					this.Exports();
+				} else {
+					var tableHeader = [
+						["序号", "出票人名称", "账号", "开户行名称", "状态", "时间"],
+					];
+					var dataList = [];
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([
+							index + 1,
+							item.name,
+							item.bankAccount,
+							item.bankName,
+							item.statusText,
+							item.createdAt,
+						]);
+					});
+					dataConversionUtil.dataToExcel("出票人列表", tableHeader, dataList);
+					this.$message.success("导出成功!");
+				}
+			},
+			/* 全部导出承兑人列表数据 */
+	getContacts() {
+				const data = {
+					pageIndex: "",
+					pageSize: -1,
+					startTime: "",
+					endTime: "",
+					name: "",
+					status: "",
+				};
+				getDrawerSearch({
+					...data
+				}).then((res) => {
+					const {
+						result
+					} = res.data;
+					this.multipleSelection = result;
+				});
+			},
 
-    /* 全部导出 */
-    Exports() {
-      this.getContacts();
-      setTimeout(() => {
-        var tableHeader = [
-          ["序号", "出票人名称", "账号", "开户行名称", "状态", "时间"],
-        ];
-        var dataList = [];
-        this.multipleSelection.forEach((item, index) => {
-          dataList.push([
-            index + 1,
-            item.name,
-            item.bankAccount,
-            item.bankName,
-            item.statusText,
-            item.createdAt,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("出票人列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
-        this.multipleSelection=[]
-      }, 1000);
-    },
-  },
+			/* 全部导出 */
+	Exports() {
+				this.getContacts();
+				setTimeout(() => {
+					var tableHeader = [
+						["序号", "出票人名称", "账号", "开户行名称", "状态", "时间"],
+					];
+					var dataList = [];
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([
+							index + 1,
+							item.name,
+							item.bankAccount,
+							item.bankName,
+							item.statusText,
+							item.createdAt,
+						]);
+					});
+					dataConversionUtil.dataToExcel("出票人列表", tableHeader, dataList);
+					this.$message.success("导出成功!");
+				}, 1000);
+			},
+		}
+	
+    
+  
 };
 </script>
-<style lang="scss">
+
+
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 1 - 22
src/views/login/index.vue

xqd
@@ -217,32 +217,11 @@ export default {
         this.$store.commit("user/getAdmin", this.checked);
       });
     },
-    //  handleLogin() {
-    //   that.loginForm.loginType = that.checked + 1
-    //   console.log(this.loginForm, 88)
-    //   this.$refs.loginForm.validate(valid => {
-    //     if (valid) {
-    //       this.loading = true
-    //       this.$store.dispatch('user/login', that.loginForm).then((res) => {
-    //         // console.log(res.data)
-    //         this.$router.push({
-    //           path: '/'
-    //         })
-    //         this.loading = false
-    //         this.$store.commit('user/getAdmin', that.checked)
-    //       }).catch(() => {
-    //         this.loading = false
-    //       })
-    //     } else {
-    //       console.log('error submit!!')
-    //       return false
-    //     }
-    //   })
   },
 };
 </script>
 
-<style lang="scss" >
+<style lang="scss"  >
 /* 修复input 背景不协调 和光标变色 */
 /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
 

+ 620 - 541
src/views/management/index.vue

xqd xqd xqd xqd
@@ -1,4 +1,5 @@
 <template>
+
   <div class="app-container">
     <el-row type="flex" justify="space-between" style="margin-bottom: 20px">
       <div class="grid-content bg-purple">
@@ -11,41 +12,43 @@
           <i slot="prefix" class="el-input__icon el-icon-search" />
         </el-input>
       </div>
+      
       <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommand">
+        <el-dropdown @command="handlehpCommand">
           <div class="pulldown">
-            <span v-if="!status" class="el-dropdown-link">
-              业务管理员状态
-            </span>
-            <span v-if="status" class="el-dropdown-link">
-              {{ status }}
+            <span v-if="!Auditstatus" class="el-dropdown-link"> 审核状态 </span>
+            <span v-if="Auditstatus" class="el-dropdown-link">
+              {{ Auditstatus }}
             </span>
             <i class="el-icon-arrow-down el-icon--right" />
           </div>
           <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>
       <div class="grid-content bg-purple">
-        <el-dropdown @command="handlehpCommand">
+        <el-dropdown @command="handleCommand">
           <div class="pulldown">
-            <span v-if="!Auditstatus" class="el-dropdown-link"> 审核状态 </span>
-            <span v-if="Auditstatus" class="el-dropdown-link">
-              {{ Auditstatus }}
+            <span v-if="!status" class="el-dropdown-link">
+              业务管理员状态
+            </span>
+            <span v-if="status" class="el-dropdown-link">
+              {{ status }}
             </span>
             <i class="el-icon-arrow-down el-icon--right" />
           </div>
           <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>
+
       <div
         class="grid-content bg-purple"
         style="display: flex; justify-content: flex-end; margin-left: 10px"
@@ -54,11 +57,11 @@
         <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="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExports">批量导出</el-button>
+        <el-button type="primary" @click="batchExports">导出</el-button>
       </div>
     </el-row>
     <el-table
+    :row-key="getRowKey"
       v-loading="listLoading"
       :data="temporaryList"
       element-loading-text="Loading"
@@ -68,565 +71,641 @@
       @selection-change="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection" />
-      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column align="center" label="" width="55" type="selection"  :reserve-selection="true" />
+
       <el-table-column
         label="业务管理员名称"
         align="center"
-        width="180"
         prop="realName"
       />
       <el-table-column label="账号" align="center" prop="account" />
       <el-table-column
         label="联系电话"
-        width="180"
         align="center"
         prop="mobile"
       />
-      <el-table-column
-        label="业务管理员状态"
-        align="center"
-        prop="statusText"
-        width="180"
-      />
       <el-table-column
         label="审核状态"
         align="center"
         prop="approveStatusText"
       />
       <el-table-column
-        label="时间"
-        width="180"
-        align="center"
-        prop="createdAt"
-      />
-      <el-table-column
+        label="业务管理员状态"
         align="center"
-        prop="created_at"
-        label="操作"
-        width="300"
-      >
-        <template slot-scope="scope">
-          <el-tag
-            type="success"
-            style="cursor: pointer; margin: 0 5px"
-            @click="Srecover(scope.row.id)"
-            v-if="scope.row.status == 1"
-            >恢复</el-tag
-          >
-          <el-tag
-            type="danger"
-            style="cursor: pointer; margin: 0 5px"
-            @click="Sdeleted(scope.row.id)"
-            v-if="scope.row.status == 0"
-            >删除</el-tag
-          >
-          <el-tag
-            type="primary"
-            v-permission="['admin']"
-            style="cursor: pointer; margin: 0 5px"
-            @click="reset(scope.row.id)"
-            >重置密码
-          </el-tag>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagesip">
-      <el-button
-        type="primary"
-        size="small"
-        style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-        @click="jumpFirstPage"
-        >首页
-      </el-button>
-      <el-pagination
-        ref="pagination"
-        background
-        layout="total,prev, pager, next"
-        :total="total"
-        :page-size="pagesize"
-        :current-page="currentPage"
-        prev-text="上一页"
-        next-text="下一页"
-        @current-change="handleCurrentChange"
+        prop="statusText"
       />
-      <el-button
-        type="primary"
-        size="small"
-        style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-        @click="jumpLastPage"
-        >尾页
-      </el-button>
-    </div>
-  </div>
+
+			<el-table-column label="时间" width="180" align="center" prop="createdAt" />
+			<el-table-column align="center" prop="created_at" label="操作" width="300">
+				<template slot-scope="scope">
+					<el-tag type="success" style="cursor: pointer; margin: 0 5px" @click="Srecover(scope.row.id)"
+						v-if="scope.row.status == 1">恢复</el-tag>
+					<el-tag type="danger" style="cursor: pointer; margin: 0 5px" @click="Sdeleted(scope.row.id)"
+						v-if="scope.row.status == 0">删除</el-tag>
+					<el-tag type="primary" v-permission="['admin']" style="cursor: pointer; margin: 0 5px"
+						@click="reset(scope.row.id)">重置密码
+					</el-tag>
+				</template>
+			</el-table-column>
+		</el-table>
+		<!-- 重置密码弹窗 -->
+		<el-dialog title="重置密码" :visible.sync="dialogVisible" width="30%">
+			<el-form ref="form" :model="password" label-width="80px">
+				<el-form-item label="登录密码" prop="password.newpassword">
+					<el-input v-model="password.newpassword" style="width: 300px" show-password></el-input>
+				</el-form-item>
+				<el-form-item label="确认密码" prop="password.ConfirmnewPassword">
+					<el-input v-model="password.ConfirmnewPassword" style="width: 300px" show-password></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button @click="dialogVisible = false">取 消</el-button>
+					<el-button type="primary" @click="onSubmit">提交修改</el-button>
+				</el-form-item>
+			</el-form>
+		</el-dialog>
+
+		<div class="pagesip">
+			<el-button type="primary" size="small"
+				style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpFirstPage">首页
+			</el-button>
+			<el-pagination ref="pagination" background layout="total,prev, pager, next" :total="total"
+				:page-size="pagesize" :current-page="currentPage" prev-text="上一页" next-text="下一页"
+				@current-change="handleCurrentChange" />
+			<el-button type="primary" size="small"
+				style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpLastPage">尾页
+			</el-button>
+		</div>
+	</div>
 </template>
 
 <script>
-import { dataConversionUtil } from "../../utils/Excel.js";
-import { getAccountSearch } from "@/api/account";
-export default {
-  filters: {
-    statusFilter(status) {
-      const statusMap = {
-        published: "success",
-        draft: "gray",
-        deleted: "danger",
-      };
-      return statusMap[status];
-    },
-  },
-  data() {
-    return {
-      // 表单数据
-      formData: {
-        startTime: "",
-        endTime: "",
-        name: "",
-        status: "", //审核状态
-        isDeleted: "", //删除状态
-      },
-      /* 当前页数 */
-      currentPage: 1,
-      /* 每页显示个数 */
-      pagesize: 10,
-      /* 总条数 */
-      total: 20,
-      temporaryList: [],
-      srcList: [],
-      list: [],
-      listLoading: false,
-      status: "",
-      Auditstatus: "",
-      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:[],//导出列表缓存数据单选
-    };
-  },
+	import {
+		dataConversionUtil
+	} from "../../utils/Excel.js";
+	import {
+		getAccountSearch
+	} from "@/api/account";
+	export default {
+		filters: {
+			statusFilter(status) {
+				const statusMap = {
+					published: "success",
+					draft: "gray",
+					deleted: "danger",
+				};
+				return statusMap[status];
+			},
+		},
+		data() {
+			return {
+				dialogVisible: false,
+				// 表单数据
+				formData: {
+					startTime: "",
+					endTime: "",
+					name: "",
+					status: "", //审核状态
+					isDeleted: "", //删除状态
+				},
+				// 重置密码
+				password: {
+					newpassword: "",
+					ConfirmnewPassword: "",
+					userId: "",
+				},
+				/* 当前页数 */
+				currentPage: 1,
+				/* 每页显示个数 */
+				pagesize: 10,
+				/* 总条数 */
+				total: 20,
+				temporaryList: [],
+				srcList: [],
+				list: [],
+				multipleSelection: [],
+				listLoading: false,
+				status: "",
+				Auditstatus: "",
+				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.getAllList();
+		},
+		methods: {
+			/* 获取列表数据 */
+			getAllList(searchForm = {}) {
+				const params = {
+					pageIndex: this.currentPage,
+					pageSize: this.pagesize,
+				};
+				getAccountSearch({
+					...params,
+					...searchForm,
+				}).then((res) => {
+					const {
+						data
+					} = res;
+					this.temporaryList = data.result;
+					this.srcList = data.result;
+					this.total = res.data.total;
+				});
+			},
+
+			success() {
+				let ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id);
+				let status = Array.from(this.multipleSelection, ({
+					approveStatus
+				}) => approveStatus)
+				console.log(status)
+				if (status.includes(1)) {
+					this.$message({
+						type: 'error',
+						message: '不能审核成功已通过项'
+					})
+				} else if (ids == "") {
+					this.$message({
+						type: 'error',
+						message: '请选择数据!'
+					})
+				} else {
+					this.$request({
+						url: "/api/Account/manager",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 3,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: res.msg,
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "error",
+								message: res.msg,
+							});
+							this.getAllList();
+						}
+					});
+				}
 
-  mounted() {
-    this.getAllList();
-  },
-  methods: {
-    /* 获取列表数据 */
-    getAllList(searchForm = {}) {
-      const params = {
-        pageIndex: this.currentPage,
-        pageSize: this.pagesize,
-      };
-      getAccountSearch({ ...params, ...searchForm }).then((res) => {
-        const { data } = res;
-        this.temporaryList = data.result;
-        this.srcList = data.result;
-        this.total = res.data.total;
-      });
-    },
+			},
+			failed() {
+				const ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id);
+				let status = Array.from(this.multipleSelection, ({
+					approveStatus
+				}) => approveStatus)
+				if(status.includes(2)){
+					this.$message({
+						type: 'error',
+						message: '不能审核失败未通过项'
+					})
+				}else if(ids==""){
+					this.$message({
+						type: 'error',
+						message: '请选择数据!'
+					})
+				}else{
+					this.$request({
+						url: "/api/Account/manager",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 4,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: res.msg,
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "error",
+								message: res.msg,
+							});
+							this.getAllList();
+						}
+					});
+				}
+				
+			},
+			recover() {
+				let ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id);
+				let status = Array.from(this.multipleSelection, ({
+					status
+				}) => status)
+				if (status.includes(0)) {
+					this.$message({
+						type: 'error',
+						message: '不能恢复已是正常状态的账号'
+					})
+				} else if (ids == "") {
+					this.$message({
+						type: 'error',
+						message: '请选择数据'
+					})
+				} else {
+					this.$request({
+						url: "/api/Account/manager",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 2,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: "恢复成功",
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "error",
+								message: "恢复失败",
+							});
+							this.getAllList();
+						}
+					});
+				}
 
-    success() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Account/manager",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 3,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "error",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    failed() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Account/manager",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 4,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "error",
-            message: res.msg,
-          });
-          this.getAllList();
-        }
-      });
-    },
-    recover() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Account/manager",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 2,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "恢复成功",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "error",
-            message: "恢复失败",
-          });
-          this.getAllList();
-        }
-      });
-    },
-    deleted() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
-      this.$request({
-        url: "/api/Account/manager",
-        method: "post",
-        data: {
-          ids: ids,
-          operateType: 1,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "删除成功",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "error",
-            message: "删除失败",
-          });
-          this.getAllList();
-        }
-      });
-    },
-    Srecover(id) {
-      this.$request({
-        url: "/api/Account/manager",
-        method: "post",
-        data: {
-          ids: [id],
-          operateType: 2,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "恢复成功",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "error",
-            message: "恢复失败",
-          });
-          this.getAllList();
-        }
-      });
-    },
-    Sdeleted(id) {
-      this.$request({
-        url: "/api/Account/manager",
-        method: "post",
-        data: {
-          ids: [id],
-          operateType: 1,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "删除成功",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "error",
-            message: "删除失败",
-          });
-          this.getAllList();
-        }
-      });
-    },
+			},
+			deleted() {
+				const 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/Account/manager",
+						method: "post",
+						data: {
+							ids: ids,
+							operateType: 1,
+						},
+					}).then((res) => {
+						if (res.code == 200) {
+							this.$message({
+								type: "success",
+								message: "删除成功",
+							});
+							this.$refs.multipleTable.clearSelection();
+							this.getAllList();
+						} else {
+							this.$message({
+								type: "error",
+								message: "删除失败",
+							});
+							this.getAllList();
+						}
+					});
+				}
 
-    /* 输入出票人名称查询 */
-    Search() {
-      this.currentPage = 1;
-      this.searchForm = { ...this.formData };
-      this.getAllList(this.searchForm);
-    },
-    /* 业务员状态筛选 */
-    handleCommand(command) {
-      this.status = command;
-      if (command === "全部") {
-        this.formData.isDeleted = "";
-      }
-      if (command === "正常") {
-        this.formData.isDeleted = 0;
-      }
-      if (command === "删除") {
-        this.formData.isDeleted = 1;
-      }
-      this.currentPage = 1;
-      this.searchForm = { ...this.formData };
-      this.getAllList(this.searchForm);
-    },
+			},
+			Srecover(id) {
+				this.$request({
+					url: "/api/Account/manager",
+					method: "post",
+					data: {
+						ids: [id],
+						operateType: 2,
+					},
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: "success",
+							message: "恢复成功",
+						});
+						this.getAllList();
+					} else {
+						this.$message({
+							type: "error",
+							message: "恢复失败",
+						});
+						this.getAllList();
+					}
+				});
+			},
+			Sdeleted(id) {
+				this.$request({
+					url: "/api/Account/manager",
+					method: "post",
+					data: {
+						ids: [id],
+						operateType: 1,
+					},
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: "success",
+							message: "删除成功",
+						});
+						this.getAllList();
+					} else {
+						this.$message({
+							type: "error",
+							message: "删除失败",
+						});
+						this.getAllList();
+					}
+				});
+			},
 
-    /* 审核状态筛选 */
-    handlehpCommand(command) {
-      this.Auditstatus = command;
-      if (command === "全部") {
-        this.formData.status = "";
-      }
-      if (command === "待审核") {
-        this.formData.status = 1;
-      }
-      if (command === "通过") {
-        this.formData.status = 2;
-      }
-      if (command === "未通过") {
-        this.formData.status = 3;
-      }
-      this.currentPage = 1;
-      this.searchForm = { ...this.formData };
-      this.getAllList(this.searchForm);
-    },
+			/* 输入出票人名称查询 */
+			Search() {
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData,
+				};
+				this.getAllList(this.searchForm);
+			},
+			/* 业务员状态筛选 */
+			handleCommand(command) {
+				this.status = command;
+				if (command === "全部") {
+					this.formData.isDeleted = "";
+				}
+				if (command === "正常") {
+					this.formData.isDeleted = 0;
+				}
+				if (command === "删除") {
+					this.formData.isDeleted = 1;
+				}
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData,
+				};
+				this.getAllList(this.searchForm);
+			},
 
-    /* 分页功能,改变当前页 */
-    handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getAllList(this.searchForm);
-    },
+			/* 审核状态筛选 */
+			handlehpCommand(command) {
+				this.Auditstatus = command;
+				if (command === "全部") {
+					this.formData.status = "";
+				}
+				if (command === "待审核") {
+					this.formData.status = 1;
+				}
+				if (command === "通过") {
+					this.formData.status = 2;
+				}
+				if (command === "未通过") {
+					this.formData.status = 3;
+				}
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData,
+				};
+				this.getAllList(this.searchForm);
+			},
 
-    /* 分页功能去首页 */
-    jumpFirstPage() {
-      this.$refs.pagination.handleCurrentChange(1);
-      this.$emit("handleCurrentChange", 1);
-    },
-    /* 分页功能:去尾页 */
-    jumpLastPage() {
-      let font = this.$refs.pagination;
-      let cpage = Math.ceil(font.total / font.pageSize);
-      font.handleCurrentChange(cpage);
-    },
+			/* 分页功能,改变当前页 */
+			handleCurrentChange(val) {
+				this.currentPage = val;
+				this.getAllList(this.searchForm);
+			},
 
-    /* 批量导出数据 */
-    handleSelectionChange(data) {
-       this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
-    },
-    handleAll(data) {
-      this.exportExcelData1.push(data);
-    },
+			/* 分页功能去首页 */
+			jumpFirstPage() {
+				this.$refs.pagination.handleCurrentChange(1);
+				this.$emit("handleCurrentChange", 1);
+			},
+			/* 分页功能:去尾页 */
+			jumpLastPage() {
+				let font = this.$refs.pagination;
+				let cpage = Math.ceil(font.total / font.pageSize);
+				font.handleCurrentChange(cpage);
+			},
 
-    /* 批量导出 */
-    batchExports() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
+			getRowKey(row) {
+				return row.id;
+			},
+			/* 批量导出数据 */
+			handleSelectionChange(data) {
+				this.multipleSelection = data;
+				console.log(this.multipleSelection)
+			},
+			handleAll(data) {
+				this.multipleSelection = data;
+			},
 
-      if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
-      } else {
-        var tableHeader = [
-          [
-            "序号",
-            "业务管理员姓名",
-            "账号",
-            "联系电话",
-            "业务管理员状态",
-            "审核状态",
-            "时间",
-          ],
-        ];
-        var dataList = [];
-        this.multipleSelection.forEach((item, index) => {
-          dataList.push([
-            index + 1,
-            item.realName,
-            item.account,
-            item.mobile,
-            item.statusText,
-            item.approveStatusText,
-            item.createdAt,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("业务管理员列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
-      }
-    },
-     /* 全部导出合同列表数据 */
-    getContacts() {
-      const data = {
-        pageIndex: '',
-        pageSize: -1,
-        startTime: "",
-        endTime: "",
-        isDeleted:'',
-        status:''
-      };
-      getAccountSearch({ data }).then((res) => {
-        const { result } = res.data;
-        this.multipleSelection = result;
-      });
-    },
+			/* 批量导出 */
+			batchExports() {
+				if (this.multipleSelection == "") {
+					this.Exports()
+				} else {
+					var tableHeader = [
+						[
+							"序号",
+							"业务管理员姓名",
+							"账号",
+							"联系电话",
+							"业务管理员状态",
+							"审核状态",
+							"时间",
+						],
+					];
+					var dataList = [];
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([
+							index + 1,
+							item.realName,
+							item.account,
+							item.mobile,
+							item.statusText,
+							item.approveStatusText,
+							item.createdAt,
+						]);
+					});
+					dataConversionUtil.dataToExcel("业务管理员列表", tableHeader, dataList);
+					this.$message.success("导出成功!");
+				}
+			},
+			/* 全部导出合同列表数据 */
+			getContacts() {
+				const data = {
+					pageIndex: "",
+					pageSize: -1,
+					startTime: "",
+					endTime: "",
+					isDeleted: "",
+					status: "",
+				};
+				getAccountSearch({
+					...data
+				}).then((res) => {
+					const {
+						result
+					} = res.data;
+					this.multipleSelection = result;
+				});
+			},
 
-    /* 全部导出 */
-    Exports() {
-      this.getContacts();
-      setTimeout(() => {
-        var tableHeader = [
-          [
-             "序号",
-            "业务管理员姓名",
-            "账号",
-            "联系电话",
-            "业务管理员状态",
-            "审核状态",
-            "时间",
-          ],
-        ];
-        var dataList = [];
-        this.multipleSelection.forEach((item, index) => {
-          dataList.push([
-            index + 1,
-            item.realName,
-            item.account,
-            item.mobile,
-            item.statusText,
-            item.approveStatusText,
-            item.createdAt,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("业务管理员列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
-         this.multipleSelection=[]
-      }, 1000);
-    },
+			/* 全部导出 */
+			Exports() {
+				this.getContacts();
+				setTimeout(() => {
+					var tableHeader = [
+						[
+							"序号",
+							"业务管理员姓名",
+							"账号",
+							"联系电话",
+							"业务管理员状态",
+							"审核状态",
+							"时间",
+						],
+					];
+					var dataList = [];
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([
+							index + 1,
+							item.realName,
+							item.account,
+							item.mobile,
+							item.statusText,
+							item.approveStatusText,
+							item.createdAt,
+						]);
+					});
+					dataConversionUtil.dataToExcel("业务管理员列表", tableHeader, dataList);
+					this.$message.success("导出成功!");
+				}, 1000);
+			},
 
-    // 重置业务员密码
-    reset(id) {
-      this.$prompt("请输入密码", "重置密码", {
-        confirmButtonText: "确定",
-        cancleButtonText: "取消",
-      })
-        .then(({ value }) => {
-          if (value.length < 6) {
-            this.$message({
-              type: "error",
-              message: "密码至少六位",
-            });
-          } else {
-            this.$request({
-              url: "/api/Account/password/resetUser",
-              method: "post",
-              data: {
-                password: value,
-                userId: id,
-              },
-            }).then((res) => {
-              console.log(res);
-              if (res.code === 200) {
-                this.$message({
-                  type: "success",
-                  message: "重置成功",
-                });
-              }
-            });
-          }
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "取消重置密码",
-          });
-        });
-    },
-  },
-};
+			// 重置业务员密码
+			reset(id) {
+				this.dialogVisible = true;
+				this.password.userId = id;
+			},
+			// 提交修改密码
+			onSubmit() {
+				if (this.password.newpassword !== this.password.ConfirmnewPassword) {
+					this.$message({
+						type: "error",
+						message: "密码与确认密码不一致",
+					});
+				} else if (
+					this.password.newpassword.length < 6 ||
+					this.password.ConfirmnewPassword < 6
+				) {
+					this.$message({
+						type: "error",
+						message: "密码与确认密码至少6位",
+					});
+				} else {
+					this.$request({
+						url: "/api/Account/password/resetUser",
+						method: "post",
+						data: {
+							password: this.password.newpassword,
+							userId: this.password.userId,
+						},
+					}).then((res) => {
+						console.log(res);
+						if (res.code === 200) {
+							this.$message({
+								type: "success",
+								message: "重置成功",
+							});
+							this.dialogVisible = false;
+						}
+					});
+				}
+			},
+		},
+	};
 </script>
-<style lang="scss">
-.pulldown {
-  width: 185px;
-  height: 40px;
-  border: 1px solid #e8e8e8;
-  border-radius: 10px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  justify-content: space-between;
-  padding: 0 20px;
-  color: #999999;
-}
+<style lang="scss" scoped>
+	.pulldown {
+		width: 185px;
+		height: 40px;
+		border: 1px solid #e8e8e8;
+		border-radius: 10px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		justify-content: space-between;
+		padding: 0 20px;
+		color: #999999;
+	}
 
-.pagesip {
-  width: 100%;
-  margin: 20px auto;
-  display: flex;
-  // align-items: center;
-  justify-content: flex-end;
-}
+	.pagesip {
+		width: 100%;
+		margin: 20px auto;
+		display: flex;
+		// align-items: center;
+		justify-content: flex-end;
+	}
 
-.el-pagination.is-background .el-pager li:not(.disabled).active {
-  background-color: #d8ab5a;
-}
+	.el-pagination.is-background .el-pager li:not(.disabled).active {
+		background-color: #d8ab5a;
+	}
 
-.el-col {
-  margin-bottom: 20px;
-}
+	.el-col {
+		margin-bottom: 20px;
+	}
 </style>

+ 137 - 157
src/views/mine/index.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -11,41 +11,42 @@
 							</span>
 						</el-form-item>
 						<el-form-item label="供应商名称" :rules="[{  message: '姓名不能为空不能为空'}]">
-							<el-input v-model="form.name" class="ipwidth"  />
+							<el-input v-model="form.name" class="ipwidth" />
 						</el-form-item>
 						<el-form-item label="供应商账号">
-							<el-input v-model="form.account" class="ipwidth" disabled/>
+							<el-input v-model="form.account" class="ipwidth" disabled />
 						</el-form-item>
 						<el-form-item label="供应商联系人" :rules="[{  message: '身份证不能为空'}]">
 							<el-input v-model="form.contacts" class="ipwidth" />
 						</el-form-item>
 						<el-form-item label="供应商联系电话">
-							<el-input v-model="form.contactsMobile" class="ipwidth" />
+							<el-input v-model="form.contactsMobile" class="ipwidth"  onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"/>
 						</el-form-item>
 						<el-form-item label="法人姓名" :rules="[{  message: '身份证不能为空'}]">
 							<el-input v-model="form.legalPerson" class="ipwidth" />
 						</el-form-item>
 						<el-form-item label="社会信用代码" :rules="[{ message: '电话号码不能为空'}]">
-							<el-input v-model="form.socialCode" class="ipwidth" disabled/>
+							<el-input v-model="form.socialCode" class="ipwidth" disabled />
 						</el-form-item>
-						<el-form-item >
+						<el-form-item>
 							<el-button type="primary" @click="update">保存修改</el-button>
 						</el-form-item>
 					</el-form>
 				</el-col>
 				<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-left: 30px;" v-if="role===2">
 					<el-form ref="form" :model="form" label-width="120px">
-						<el-form-item label="" >
+						<el-form-item label="">
 							<span slot="label">
 								<span style="visibility: hidden;">其他信息</span>
 							</span>
 						</el-form-item>
-						
-						<el-form-item label="供应商认证照片" >
+
+						<el-form-item label="供应商认证照片">
 							<div style="display: flex;">
 								<div>
-									<el-image style="width: 100px; height: 100px" v-for="(item,index) in form.identifyPics" :key="index" :src="item"
-									:preview-src-list="form.identifyPics">
+									<el-image style="width: 100px; height: 100px"
+										v-for="(item,index) in form.identifyPics" :key="index" :src="item"
+										:preview-src-list="form.identifyPics">
 									</el-image>
 								</div>
 								<div class="boximg">
@@ -58,118 +59,73 @@
 									</el-dialog>
 								</div>
 							</div>
-							
-							
+
+
 						</el-form-item>
-						<el-form-item label="授权委托书" >
+						<el-form-item label="授权委托书">
 							<div style="display: flex;">
 								<div>
-									<el-image style="width: 100px; height: 100px" v-for="(item,index) in form.proxyFile" :key="index" :src="item"
-									:preview-src-list="form.proxyFile"	>
+									<el-image style="width: 100px; height: 100px" v-for="(item,index) in form.proxyFile"
+										:key="index" :src="item" :preview-src-list="form.proxyFile">
 									</el-image>
 								</div>
 								<div>
 									<el-dialog :visible.sync="dialogVisibleimg">
 										<img width="100%" :src="form.proxyFile" alt="" />
 									</el-dialog>
-									
+
 									<el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
 										:on-success="handleSuccess">
 										<i class="el-icon-plus" />
 									</el-upload>
 								</div>
 							</div>
-							
+
 						</el-form-item>
 						<el-form-item label="修改密码">
-						<el-collapse v-model="activeNames"  style="width: 80%;">
-							<!-- <el-collapse-item title="供应商认证照片" name="3">
-								<div class="boximg">
-									<el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
-										:on-success="handleAvatarSuccess">
-										<i class="el-icon-plus" />
-									</el-upload>
-									<el-dialog :visible.sync="dialogVisibleimg">
-										<img width="100%" :src="form.identifyPics" alt="" />
-									</el-dialog>
-								</div>
-								<div>
-									<el-image style="width: 100px; height: 100px" v-for="(item,index) in form.identifyPics" :key="index" :src="item"
-									:preview-src-list="form.identifyPics">
-									</el-image>
-								</div>
-							</el-collapse-item> -->
-							<!-- <el-collapse-item title="授权委托书" name="4">
-								<div class="boximg">
-									<el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
-										:on-success="handleSuccess">
-										<i class="el-icon-plus" />
-									</el-upload>
-									<el-dialog :visible.sync="dialogVisibleimg">
-										<img width="100%" :src="form.proxyFile" alt="" />
-									</el-dialog>
-								</div>
-								<div>
-									<el-image style="width: 100px; height: 100px" v-for="(item,index) in form.proxyFile" :key="index" :src="item"
-									:preview-src-list="form.proxyFile"	>
-									</el-image>
-								</div>
-							</el-collapse-item> -->
-							<el-collapse-item  name="1">
-								<el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password" show-password></el-input>
-								<el-input v-model="password.newPassword" placeholder="请输入新密码" type="password" show-password></el-input>
-								<el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password" show-password ></el-input>
-								<el-button type="primary" @click="onSubmit">确认修改</el-button>
-							</el-collapse-item>
-						</el-collapse>
-						</el-form-item>
-					</el-form>
-					
-					
-					<!-- 修改密码弹窗 -->
-					<!-- <el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%">
-					<el-form ref="form" :model="password" label-width="80px">
-						<el-form-item label="旧密码" prop="password.oldPassword">
-							<el-input v-model="password.oldPassword" style="width: 300px;"></el-input>
-						</el-form-item>
-						<el-form-item label="新密码" prop="password.newPassword">
-							<el-input v-model="password.newPassword" style="width: 300px;"></el-input>
-						</el-form-item>
-						<el-form-item label="确认新密码" prop="password.newPassword">
-							<el-input v-model="password.newPassword" style="width: 300px;"></el-input>
-						</el-form-item>
-						<el-form-item >
-							<el-button @click="dialogVisible = false">取 消</el-button>
-							<el-button type="primary" @click="onSubmit">提交修改</el-button>
+							<el-collapse v-model="activeNames" style="width: 80%;">
+								<el-collapse-item name="1">
+									<el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password"
+										show-password></el-input>
+									<el-input v-model="password.newPassword" placeholder="请输入新密码" type="password"
+										show-password></el-input>
+									<el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password"
+										show-password></el-input>
+									<el-button type="primary" @click="onSubmit">确认修改</el-button>
+								</el-collapse-item>
+							</el-collapse>
 						</el-form-item>
 					</el-form>
-					</el-dialog> -->
-					
+
+
 				</el-col>
-				
-				
+
+
 				<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-right: 10px;" v-if="role===1">
-					<el-form ref="form" :model="form" label-width="140px">
+					<el-form ref="form" :model="salesmanform" label-width="140px">
 						<el-form-item label="" style="border-bottom:1px solid #F4F4F4">
 							<span slot="label">
 								<span style="color:#262626;">业务管理员个人信息</span>
 							</span>
 						</el-form-item>
-						<el-form-item label="姓名" :rules="[{  message: '姓名不能为空不能为空'}]">
-							<el-input v-model="form.realName" class="ipwidth" />
+						<el-form-item label="姓名" >
+							<el-input v-model="salesmanform.realName" class="ipwidth" />
 						</el-form-item>
-						<el-form-item label="账号" :rules="[{ message: '账号不能为空'}]">
-							<el-input v-model="form.account" class="ipwidth" />
+						<el-form-item label="账号" >
+							<el-input v-model="salesmanform.account" class="ipwidth" />
 						</el-form-item>
-						<el-form-item label="联系电话" :rules="[{  message: '联系电话不能为空'}]">
-							<el-input v-model="form.mobile" class="ipwidth" />
+						<el-form-item label="联系电话" >
+							<el-input v-model="salesmanform.mobile" class="ipwidth"  onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"/>
 						</el-form-item>
 					</el-form>
-					<el-collapse v-model="password"  style="width: 90%;float: right;">
+					<el-collapse v-model="password" style="width: 90%;float: right;">
 						<el-collapse-item title="修改密码" name="1">
-							<el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password" show-password></el-input>
-							<el-input v-model="password.newPassword" placeholder="请输入新密码" type="password" show-password></el-input>
-							<el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password" show-password></el-input>
+							<el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password" show-password>
+							</el-input>
+							<el-input v-model="password.newPassword" placeholder="请输入新密码" type="password" show-password>
+							</el-input>
+							<el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password"
+								show-password></el-input>
 							<el-button type="primary" @click="onSubmit">确认修改</el-button>
 						</el-collapse-item>
 						<el-collapse-item title="忘记密码">
@@ -178,7 +134,7 @@
 					</el-collapse>
 				</el-col>
 			</el-col>
-			
+
 		</el-row>
 	</div>
 </template>
@@ -189,72 +145,79 @@
 		data() {
 			return {
 				// 弹窗
-				dialogVisible:false,
-				dialogVisibleimg:false,
+				dialogVisible: false,
+				dialogVisibleimg: false,
 				role: '',
 				id: '',
 				resource: '',
 				radio: '1',
-				activeNames:'',
-				proxyFileArray:[],
-				identifyPicsArray:[],
+				activeNames: '',
+				proxyFileArray: [],
+				identifyPicsArray: [],
+				startform: '',
 				form: {
-					name:'',
+					name: '',
+					account: '',
+					contacts: '',
+					contactsMobile: '',
+					id: '',
+					socialCode: '',
+					legalPerson: '',
+					identifyPics: [],
+					proxyFile: [],
+				},
+				salesmanform:{
+					realName:'',
 					account:'',
-					contacts:'',
-					contactsMobile:'',
-					id:'',
-					socialCode:'',
-					legalPerson:'',
-					identifyPics:[],
-					proxyFile:[],
+					mobile:'',
 				},
-				password:{
+				password: {
 					oldPassword: '',
 					newPassword: '',
-					ConfirmnewPassword:'',
+					ConfirmnewPassword: '',
 				},
-				
 			}
 		},
 		mounted() {
 			this.role = this.$store.state.user.userInfo.type
 			console.log(this.$store.state.user.userInfo)
-			this.id=this.$store.state.user.userInfo.id
+			this.id = this.$store.state.user.userInfo.id
 			if (this.role === 2) {
 				this.$request({
-					url: '/api/Supplier/'+this.id,
+					url: '/api/Supplier/' + this.id,
 					method: 'get'
 				}).then((res) => {
-					this.form=res.data
-					console.log(res)
-					this.form.identifyPics=res.data.identifyPicList
-					this.form.proxyFile=res.data.proxyFileList
+					this.form = res.data
+					this.form.identifyPics = res.data.identifyPicList
+					this.form.proxyFile = res.data.proxyFileList
+					this.startform = {
+						...this.form
+					}
 				})
 			} else if (this.role === 1) {
 				this.$request({
 					url: '/api/Account',
 					method: 'get'
 				}).then((res) => {
-					this.form = res.data
+					console.log(res)
+					this.salesmanform = res.data
 				})
 			}
 		},
 		methods: {
 			onSubmit() {
-				if(this.password.ConfirmnewPassword!==this.password.newPassword){
+				if (this.password.ConfirmnewPassword !== this.password.newPassword) {
 					this.$message({
-						type:"error",
-						message:'密码和确认密码不一致'
+						type: "error",
+						message: '密码和确认密码不一致'
 					})
-				}else if(this.password.ConfirmnewPassword.length<6||this.password.newPassword.length<6){
+				} else if (this.password.ConfirmnewPassword.length < 6 || this.password.newPassword.length < 6) {
 					this.$message({
-						type:'error',
-						message:'密码至少六位'
+						type: 'error',
+						message: '密码至少六位'
 					})
-				}
-				else{
-					if(this.role===2){
+				} else {
+					if (this.role === 2) {
 						this.$request({
 							url: '/api/Supplier/password',
 							method: 'post',
@@ -263,7 +226,7 @@
 								newPassword: this.password.newPassword
 							}
 						}).then((res) => {
-							if(res.code===200){
+							if (res.code === 200) {
 								this.$message({
 									type: 'success',
 									message: '修改密码成功'
@@ -272,16 +235,16 @@
 						}).catch((err) => {
 							console.log(err)
 						})
-					}else if(this.role===1){
+					} else if (this.role === 1) {
 						this.$request({
-							url:'/api/Account/password',
-							method:'post',
-							data:{
+							url: '/api/Account/password',
+							method: 'post',
+							data: {
 								oldPassword: this.password.oldPassword,
 								newPassword: this.password.newPassword
 							}
-						}).then((res)=>{
-							if(res.code===200){
+						}).then((res) => {
+							if (res.code === 200) {
 								this.$message({
 									type: 'success',
 									message: '修改密码成功'
@@ -298,44 +261,61 @@
 				})
 			},
 			handleAvatarSuccess(res) {
-			  //解构
-			  let { file } = res.data;
-			  this.identifyPicsArray.push(file);
-			  this.form.identifyPics = this.identifyPicsArray;
+				//解构
+			 let {
+					file
+				} = res.data;
+				this.identifyPicsArray.push(file);
+				this.form.identifyPics = this.identifyPicsArray;
 			},
 			/* 供应商上传委托书图片上传成功  */
 			handleSuccess(res) {
 				//解构
-				let {file} = res.data;
+				let {
+					file
+				} = res.data;
 				this.proxyFileArray.push(file);
 				this.form.proxyFile = this.proxyFileArray;
 			},
+			// 修改个人信息
 			update() {
-				console.log(this.form)
-				this.$request({
-					url:'/api/Supplier/update',
-					method:'post',
-					data:this.form
-				}).then((res)=>{
-					console.log(res)
-					if(res.code===200){
-						this.$message({
-							type:'success',
-							message:'修改成功!'
-						})
-					}else{
-						this.$message({
-							type:'error',
-							message:'修改失败!'
-						})
-					}
-				})
+				if(JSON.stringify(this.startform)===JSON.stringify(this.form)){
+					this.$message({
+						type:'error',
+						message:'数据没有改变'
+					})
+				}else if(this.form.contactsMobile.length!==11){
+					this.$message({
+						type:'error',
+						message:'联系电话必须11位'
+					})
+				}else{
+					this.$request({
+						url: '/api/Supplier/update',
+						method: 'post',
+						data: this.form
+					}).then((res) => {
+						if (res.code === 200) {
+							this.$message({
+								type: 'success',
+								message: '修改成功!'
+							})
+							this.startform={...this.form}
+						} else {
+							this.$message({
+								type: 'error',
+								message: '修改失败!'
+							})
+						}
+					})
+				}
+				
 			},
-		}
+		},
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.line {
 		text-align: center;
 	}

+ 788 - 665
src/views/register/index.vue

xqd
@@ -1,686 +1,809 @@
 <template>
-	<div class="login-container">
-		<el-row>
-			<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="flex1">
-				<div v-if="checked == 0" class="overcicle">
-					<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"
-						auto-complete="on" label-position="left">
-						<div class="title-container">
-							<p class="title">业务管理员注册</p>
-						</div>
-						<el-form-item prop="name">
-							<span class="svg-container"> 姓名 </span>
-							<el-input ref="name" v-model="loginForm.realName" placeholder="输入业务员真实姓名" name="name"
-								type="text" tabindex="1" />
-						</el-form-item>
-						<el-form-item prop="username">
-							<span class="svg-container"> 登录账户 </span>
-							<el-input ref="username" v-model="loginForm.account" placeholder="输入账户名称" name="username"
-								type="text" tabindex="2" />
-						</el-form-item>
-						<el-form-item prop="password">
-							<span class="svg-container"> 登录密码 </span>
-							<el-input ref="password" v-model="loginForm.password" placeholder="至少6位数的字母数字组合"
-								name="password" :type="passwordType" tabindex="2" show-password />
-						</el-form-item>
-						<el-form-item prop="surepsd">
-							<span class="svg-container"> 确认密码 </span>
-							<el-input :key="passwordType" ref="password" v-model="loginForm.surepsd"
-								:type="passwordType" placeholder="至少6位数的字母数字组合" name="password" auto-complete="on"
-								show-password tabindex="3" />
-						</el-form-item>
-						<el-form-item prop="mobile">
-							<span class="svg-container"> 联系电话 </span>
-							<el-input ref="mobile" v-model="loginForm.mobile" type="text" placeholder="请输入业务员联系电话"
-								name="mobile" tabindex="5" auto-complete="on"
-								onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" />
-						</el-form-item>
-
-						<el-button :loading="loading" type="primary" class="loginbtn"
-							@click.native.prevent="handleLogin(loginForm)">注册账号
-						</el-button>
-						<div class="registerbtn flex3">
-							<div class="forgect">
-								<p class="asp">已有账号?</p>
-							</div>
-							<div class="forgect" @click="backLogin()">
-								<p class="nes">马上登录</p>
-							</div>
-						</div>
-					</el-form>
-				</div>
-
-				<!-- <div v-if="checked == 1 && showNext" class="overcicle">
-					<div class="title-container">
-						<p class="title">供货商注册</p>
-					</div>
-					<el-form ref="providerForm" :model="providerForm" :rules="loginRules" class="login-form"
-						auto-complete="on" label-position="left">
-						<el-form-item prop="username">
-							<span class="svg-container"> 账户 </span>
-							<el-input ref="username" v-model="providerForm.username" placeholder="输入账户名称"
-								name="username" type="text" tabindex="2" />
-						</el-form-item>
-						<el-form-item prop="username">
-							<span class="svg-container"> 密码 </span>
-							<el-input ref="password" v-model="providerForm.password" placeholder="至少6位数的字母数字组合"
-								name="password" type="passwordType" tabindex="3" />
-						</el-form-item>
-						<el-form-item prop="password">
-							<span class="svg-container"> 确认密码 </span>
-							<el-input :key="passwordType" ref="password" v-model="providerForm.surepsd"
-								:type="passwordType" placeholder="至少6位数的字母数字组合" name="password" tabindex="4"
-								auto-complete="on" @keyup.enter.native="handleLogin" />
-						</el-form-item>
-						<el-form-item prop="mobile">
-							<span class="svg-container"> 联系电话 </span>
-							<el-input ref="mobile" v-model="providerForm.mobile" type="text" placeholder="请输入业务员联系电话"
-								name="mobile" tabindex="5" auto-complete="on" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" />
-						</el-form-item>
-
-						<el-button :loading="loading" type="primary" class="loginbtn"
-							@click.native.prevent="handleLogin">注册账号
-						</el-button>
-						<div class="registerbtn flex3">
-							<div class="forgect">
-								<p class="asp">已有账号?</p>
-							</div>
-							<div class="forgect" @click="backLogin()">
-								<p class="nes">马上登录</p>
-							</div>
-						</div>
-					</el-form>
-				</div> -->
-
-				<!-- 供货商注册 -->
-				<div v-if="checked == 1 && !showNext" style="margin-top: 670px" class="overcicle">
-					<el-form ref="providerForm" :model="providerForm" :rules="loginRules" class="login-form"
-						auto-complete="on" label-position="left">
-						<div class="title-container">
-							<p class="title">供货商注册</p>
-						</div>
-						<el-form-item prop="name">
-							<span class="svg-container"> 供货商 </span>
-							<el-input ref="name" v-model="providerForm.name" placeholder="输入供货商名称" name="name"
-								type="text" tabindex="1" />
-						</el-form-item>
-						<el-form-item prop="username">
-							<span class="svg-container"> 统一社会信用代码 </span>
-							<el-input ref="username" v-model="providerForm.socialCode" placeholder="输入统一社会信用代码"
-								name="username" type="text" tabindex="2" />
-						</el-form-item>
-						<el-form-item prop="username">
-							<span class="svg-container"> 法人姓名 </span>
-							<el-input ref="password" v-model="providerForm.legalPerson" placeholder="输入法人的真实姓名"
-								name="password" type="passwordType" tabindex="3" />
-						</el-form-item>
-						<el-form-item prop="username">
-							<span class="svg-container"> 联系人 </span>
-							<el-input ref="password" v-model="providerForm.contacts" placeholder="输入联系人的真实姓名"
-								name="password" type="passwordType" tabindex="3" />
-						</el-form-item>
-						<el-form-item prop="mobile">
-							<span class="svg-container"> 联系电话 </span>
-							<el-input ref="mobile" v-model="providerForm.contactsMobile" type="text"
-								placeholder="请输入业务员联系电话" name="mobile" tabindex="5"
-								onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" />
-						</el-form-item>
-						<el-form-item prop="username">
-							<span class="svg-container"> 登录账号 </span>
-							<el-input ref="username" v-model="providerForm.account" placeholder="输入账号名称" name="username"
-								type="text" tabindex="2" />
-						</el-form-item>
-						<el-form-item prop="password">
-							<span class="svg-container"> 登录密码 </span>
-							<el-input :key="passwordType" ref="password" v-model="providerForm.password"
-								:type="passwordType" placeholder="至少6位数的字母数字组合" name="password" tabindex="4"
-								auto-complete="on" show-password />
-						</el-form-item>
-						<el-form-item prop="surepsd">
-							<span class="svg-container"> 确认密码 </span>
-							<el-input :key="passwordType" ref="password" v-model="providerForm.surepsd"
-								:type="passwordType" placeholder="至少6位数的字母数字组合" name="password" auto-complete="on"
-								show-password tabindex="3" />
-						</el-form-item>
-						<!-- 供应商上传身份证图片 -->
-						<div class="choosepic">
-							<el-form-item style="background-color: transparent; margin: 0; padding: 0">
-								<span class="svg-container" style="
+  <div class="login-container">
+    <el-row>
+      <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="flex1">
+        <div v-if="checked == 0" class="overcicle">
+          <el-form
+            ref="loginForm"
+            :model="loginForm"
+            :rules="loginRules"
+            class="login-form"
+            auto-complete="on"
+            label-position="left"
+          >
+            <div class="title-container">
+              <p class="title">业务管理员注册</p>
+            </div>
+            <el-form-item prop="name">
+              <span class="svg-container"> 姓名 </span>
+              <el-input
+                ref="name"
+                v-model="loginForm.realName"
+                placeholder="输入业务员真实姓名"
+                name="name"
+                type="text"
+                tabindex="1"
+              />
+            </el-form-item>
+            <el-form-item prop="username">
+              <span class="svg-container"> 登录账号 </span>
+              <el-input
+                ref="username"
+                v-model="loginForm.account"
+                placeholder="输入账户名称"
+                name="username"
+                type="text"
+                tabindex="2"
+              />
+            </el-form-item>
+            <el-form-item prop="password">
+              <span class="svg-container"> 登录密码 </span>
+              <el-input
+                ref="password"
+                v-model="loginForm.password"
+                placeholder="至少6位数的字母数字组合"
+                name="password"
+                :type="passwordType"
+                tabindex="2"
+                show-password
+              />
+            </el-form-item>
+            <el-form-item prop="surepsd">
+              <span class="svg-container"> 确认密码 </span>
+              <el-input
+                :key="passwordType"
+                ref="password"
+                v-model="loginForm.surepsd"
+                :type="passwordType"
+                placeholder="至少6位数的字母数字组合"
+                name="password"
+                auto-complete="on"
+                show-password
+                tabindex="3"
+              />
+            </el-form-item>
+            <el-form-item prop="mobile">
+              <span class="svg-container"> 联系电话 </span>
+              <el-input
+                ref="mobile"
+                v-model="loginForm.mobile"
+                type="text"
+                placeholder="请输入业务员联系电话"
+                name="mobile"
+                tabindex="5"
+                onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
+              />
+            </el-form-item>
+
+            <el-button
+              :loading="loading"
+              type="primary"
+              class="loginbtn"
+              @click.native.prevent="handleLogin(loginForm)"
+              >注册账号
+            </el-button>
+            <div class="registerbtn flex3">
+              <div class="forgect">
+                <p class="asp">已有账号?</p>
+              </div>
+              <div class="forgect" @click="backLogin()">
+                <p class="nes">马上登录</p>
+              </div>
+            </div>
+          </el-form>
+        </div>
+
+        <!-- 供货商注册 -->
+        <div
+          v-if="checked == 1 && !showNext"
+          style="margin-top: 670px"
+          class="overcicle"
+        >
+          <el-form
+            ref="providerForm"
+            :model="providerForm"
+            :rules="loginRules"
+            class="login-form"
+            auto-complete="on"
+            label-position="left"
+          >
+            <div class="title-container">
+              <p class="title">供货商注册</p>
+            </div>
+            <el-form-item prop="name">
+              <span class="svg-container"> 供货商 </span>
+              <el-input
+                ref="name"
+                v-model="providerForm.name"
+                placeholder="输入供货商名称"
+                name="name"
+                type="text"
+                tabindex="1"
+              />
+            </el-form-item>
+            <el-form-item prop="username">
+              <span class="svg-container"> 统一社会信用代码 </span>
+              <el-input
+                ref="username"
+                v-model="providerForm.socialCode"
+                placeholder="输入统一社会信用代码"
+                name="username"
+                type="text"
+                tabindex="2"
+              />
+            </el-form-item>
+            <el-form-item prop="username">
+              <span class="svg-container"> 法人姓名 </span>
+              <el-input
+                ref="password"
+                v-model="providerForm.legalPerson"
+                placeholder="输入法人的真实姓名"
+                name="password"
+                type="passwordType"
+                tabindex="3"
+              />
+            </el-form-item>
+            <el-form-item prop="username">
+              <span class="svg-container"> 联系人 </span>
+              <el-input
+                ref="password"
+                v-model="providerForm.contacts"
+                placeholder="输入联系人的真实姓名"
+                name="password"
+                type="passwordType"
+                tabindex="3"
+              />
+            </el-form-item>
+            <el-form-item prop="mobile">
+              <span class="svg-container"> 联系电话 </span>
+              <el-input
+                ref="mobile"
+                v-model="providerForm.contactsMobile"
+                type="text"
+                placeholder="请输入业务员联系电话"
+                name="mobile"
+                tabindex="5"
+                onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
+              />
+            </el-form-item>
+            <el-form-item prop="username">
+              <span class="svg-container"> 登录账号 </span>
+              <el-input
+                ref="username"
+                v-model="providerForm.account"
+                placeholder="输入账号名称"
+                name="username"
+                type="text"
+                tabindex="2"
+              />
+            </el-form-item>
+            <el-form-item prop="password">
+              <span class="svg-container"> 登录密码 </span>
+              <el-input
+                :key="passwordType"
+                ref="password"
+                v-model="providerForm.password"
+                :type="passwordType"
+                placeholder="至少6位数的字母数字组合"
+                name="password"
+                tabindex="4"
+                auto-complete="on"
+                show-password
+              />
+            </el-form-item>
+            <el-form-item prop="surepsd">
+              <span class="svg-container"> 确认密码 </span>
+              <el-input
+                :key="passwordType"
+                ref="password"
+                v-model="providerForm.surepsd"
+                :type="passwordType"
+                placeholder="至少6位数的字母数字组合"
+                name="password"
+                auto-complete="on"
+                show-password
+                tabindex="3"
+              />
+            </el-form-item>
+            <!-- 供应商上传身份证图片 -->
+            <div class="choosepic">
+              <el-form-item
+                style="background-color: transparent; margin: 0; padding: 0"
+              >
+                <span
+                  class="svg-container"
+                  style="
                     background-color: transparent;
                     margin: 0;
                     padding: 0;
                     margin-top: 5px;
-                  ">
-									认证照片
-								</span>
-								<div class="boximg">
-									<el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
-										:on-success="handleAvatarSuccess" >
-										<i class="el-icon-plus" />
-									</el-upload>
-
-									<el-dialog :visible.sync="dialogVisible">
-										<img width="100%" :src="providerForm.identifyPics" alt="" />
-									</el-dialog>
-								</div>
-								<p class="usa">*注意上传法人手持身份证半身照</p>
-							</el-form-item>
-						</div>
-
-						<!-- 供应商上传委托书图片 -->
-						<div class="choosepic">
-							<el-form-item style="background-color: transparent; margin: 0; padding: 0">
-								<span class="svg-container"
-									style="background-color: transparent; margin: 0; padding: 0">
-									授权委托书
-								</span>
-								<span class="svg-container" style="float: right;" @click="download">
-									点击获取授权委托书
-								</span>
-								<div class="boximg">
-									<el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
-										:on-success="handleSuccess">
-										<i class="el-icon-plus" />
-									</el-upload>
-									<el-dialog :visible.sync="dialogVisible">
-										<img width="100%" :src="providerForm.proxyFile" alt="" />
-									</el-dialog>
-								</div>
-								<p class="usa">*注意上传法人签署的授权委托书</p>
-							</el-form-item>
-						</div>
-						<el-button :loading="loading" type="primary" class="loginbtn"
-							@click.native.prevent="handleLogin(providerForm)">注册账号
-						</el-button>
-						<div class="registerbtn flex3">
-							<div class="forgect">
-								<p class="asp">已有账号?</p>
-							</div>
-							<div class="forgect" @click="backLogin()">
-								<p class="nes">马上登录</p>
-							</div>
-						</div>
-					</el-form>
-				</div>
-			</el-col>
-		</el-row>
-	</div>
+                  "
+                >
+                  认证照片
+                </span>
+                <div class="boximg">
+                  <el-upload
+                    action="https://api.xrongm.com/api/File"
+                    list-type="picture-card"
+                    :on-success="handleAvatarSuccess"
+                  >
+                    <i class="el-icon-plus" />
+                  </el-upload>
+
+                  <el-dialog :visible.sync="dialogVisible">
+                    <img width="100%" :src="providerForm.identifyPics" alt="" />
+                  </el-dialog>
+				  <!-- <FileUpload
+				  v-model="providerForm.identifyPics"
+				  accept=".jpg, .jpeg, .png, .pdf"
+				  /> -->
+                </div>
+                <p class="usa">*注意上传法人手持身份证半身照</p>
+              </el-form-item>
+            </div>
+
+            <!-- 供应商上传委托书图片 -->
+            <div class="choosepic">
+              <el-form-item
+                style="background-color: transparent; margin: 0; padding: 0"
+              >
+                <span
+                  class="svg-container"
+                  style="background-color: transparent; margin: 0; padding: 0"
+                >
+                  授权委托书
+                </span>
+                <span
+                  class="svg-container"
+                  style="float: right"
+                  @click="download"
+                >
+                  点击获取授权委托书
+                </span>
+                <div class="boximg">
+                 <el-upload
+                    action="https://api.xrongm.com/api/File"
+                    list-type="picture-card"
+                    :on-success="handleSuccess"
+                  >
+                    <i class="el-icon-plus" />
+                  </el-upload>
+                  <el-dialog :visible.sync="dialogVisible">
+                    <img width="100%" :src="providerForm.proxyFile" alt="" />
+                  </el-dialog>
+				 <!-- <FileUpload
+				  v-model="providerForm.proxyFile"
+				  accept=".jpg, .jpeg, .png, .pdf"
+				  /> -->
+                </div>
+                <p class="usa">*注意上传法人签署的授权委托书</p>
+              </el-form-item>
+            </div>
+            <el-button
+              :loading="loading"
+              type="primary"
+              class="loginbtn"
+              @click.native.prevent="handleLogin(providerForm)"
+              >注册账号
+            </el-button>
+            <div class="registerbtn flex3">
+              <div class="forgect">
+                <p class="asp">已有账号?</p>
+              </div>
+              <div class="forgect" @click="backLogin()">
+                <p class="nes">马上登录</p>
+              </div>
+            </div>
+          </el-form>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
 </template>
 
 <script>
-	let that;
-	import {
-		validUsername
-	} from "@/utils/validate";
-	import logo from "/src/assets/img/logo.png";
-	import upself from "/src/assets/img/upuer.png";
-	import upweituo from "/src/assets/img/upattor.png";
-	import request from "@/utils/request";
-	export default {
-		name: "Login",
-		data() {
-			const validatename = (rule, value, callback) => {
-				if (value.length == 0) {
-					callback(new Error("请输入业务员真实姓名"));
-				} else {
-					callback();
-				}
-			};
-			const validateUsername = (rule, value, callback) => {
-				if (!validUsername(value)) {
-					callback(new Error("请输入账户名称"));
-				} else {
-					callback();
-				}
-			};
-			const validatePassword = (rule, value, callback) => {
-				if (value.length < 6) {
-					callback(new Error("请输入大于6位数密码"));
-				} else {
-					callback();
-				}
-			};
-			const validatemobile = (rule, value, callback) => {
-				if (value.length == 0) {
-					callback(new Error("请输入电话号码"));
-				} else {
-					callback();
-				}
-			};
-			return {
-				dialogVisible: false,
-				disabled: false,
-				upself: upself,
-				upweituo: upweituo,
-				fit: "cover",
-				imageUrl: "",
-				// 业务管理员数据
-				loginForm: {
-					realName: "",
-					account: "",
-					password: "",
-					surepsd: "",
-					mobile: "",
-				},
-				/* 供应商数据 */
-				providerForm: {
-					account: "",
-					password: "",
-					surepsd:'',
-					name: "",
-					socialCode: "",
-					legalPerson: "",
-					contacts: "",
-					contactsMobile: "",
-					identifyPics: [],
-					proxyFile: [],
-				},
-
-				/* 供应商上传身份证图片用数组保存 */
-				identifyPicsArray: [],
-				/* 供应商上传委托书图片用数组保存 */
-				proxyFileArray: [],
-
-				loginRules: {
-					realName: [{
-						required: true,
-						trigger: "blur",
-						validator: validatename,
-					}, ],
-					account: [{
-						required: true,
-						trigger: "blur",
-						validator: validateUsername,
-					}, ],
-					password: [{
-						required: true,
-						trigger: "blur",
-						validator: validatePassword,
-					}, ],
-					mobile: [{
-						required: true,
-						trigger: "blur",
-						validator: validatemobile,
-					}, ],
-				},
-				loading: false,
-				passwordType: "password",
-				redirect: undefined,
-				src: logo,
-				checked: 0,
-				showNext: false,
-			};
-		},
-		watch: {
-			$route: {
-				handler: function(route) {
-					this.redirect = route.query && route.query.redirect;
-				},
-				immediate: true,
-			},
-		},
-		mounted() {
-			that = this;
-			this.checked = this.$route.query.checked;
-		},
-		methods: {
-			nextStep() {
-				this.showNext = true;
-			},
-			/* 供应商上传身份证图片上传成功 */
-			handleAvatarSuccess(res) {
-				//解构
-				let {
-					file
-				} = res.data;
-				this.identifyPicsArray.push(file);
-				this.providerForm.identifyPics = this.identifyPicsArray;
-			},
-
-			/* 供应商上传委托书图片上传成功  */
-			handleSuccess(res) {
-				//解构
-				let {
-					file
-				} = res.data;
-				this.proxyFileArray.push(file);
-				this.providerForm.proxyFile = this.proxyFileArray;
-			},
-			handlePictureCardPreview(file) {
-				console.log(file, 88);
-				this.imageUrl = file.url;
-			},
-			showPwd() {
-				if (this.passwordType === "password") {
-					this.passwordType = "";
-				} else {
-					this.passwordType = "password";
-				}
-				this.$nextTick(() => {
-					this.$refs.password.focus();
+let that;
+import { validUsername } from "@/utils/validate";
+import logo from "/src/assets/img/logo.png";
+import upself from "/src/assets/img/upuer.png";
+import upweituo from "/src/assets/img/upattor.png";
+import request from "@/utils/request";
+export default {
+  name: "Login",
+  data() {
+    const validatename = (rule, value, callback) => {
+      if (value.length == 0) {
+        callback(new Error("请输入业务员真实姓名"));
+      } else {
+        callback();
+      }
+    };
+    const validateUsername = (rule, value, callback) => {
+      if (!validUsername(value)) {
+        callback(new Error("请输入账户名称"));
+      } else {
+        callback();
+      }
+    };
+    const validatePassword = (rule, value, callback) => {
+      if (value.length < 6) {
+        callback(new Error("请输入大于6位数密码"));
+      } else {
+        callback();
+      }
+    };
+    const validatemobile = (rule, value, callback) => {
+      if (value.length == 0) {
+        callback(new Error("请输入电话号码"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      dialogVisible: false,
+      disabled: false,
+      upself: upself,
+      upweituo: upweituo,
+      fit: "cover",
+      imageUrl: "",
+      // 业务管理员数据
+      loginForm: {
+        realName: "",
+        account: "",
+        password: "",
+        surepsd: "",
+        mobile: "",
+      },
+      /* 供应商数据 */
+      providerForm: {
+        account: "",
+        password: "",
+        surepsd: "",
+        name: "",
+        socialCode: "",
+        legalPerson: "",
+        contacts: "",
+        contactsMobile: "",
+        identifyPics: [],
+        proxyFile: [],
+      },
+
+      /* 供应商上传身份证图片用数组保存 */
+      identifyPicsArray: [],
+      /* 供应商上传委托书图片用数组保存 */
+      proxyFileArray: [],
+
+      loginRules: {
+        realName: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validatename,
+          },
+        ],
+        account: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validateUsername,
+          },
+        ],
+        password: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validatePassword,
+          },
+        ],
+        mobile: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validatemobile,
+          },
+        ],
+      },
+      loading: false,
+      passwordType: "password",
+      redirect: undefined,
+      src: logo,
+      checked: 0,
+      showNext: false,
+    };
+  },
+  watch: {
+    $route: {
+      handler: function (route) {
+        this.redirect = route.query && route.query.redirect;
+      },
+      immediate: true,
+    },
+  },
+  mounted() {
+    that = this;
+    this.checked = this.$route.query.checked;
+  },
+  methods: {
+    nextStep() {
+      this.showNext = true;
+    },
+    /* 供应商上传身份证图片上传成功 */
+    handleAvatarSuccess(res) {
+      //解构
+      let { file } = res.data;
+      this.identifyPicsArray.push(file);
+      this.providerForm.identifyPics = this.identifyPicsArray;
+    },
+
+    /* 供应商上传委托书图片上传成功  */
+    handleSuccess(res) {
+      //解构
+      let { file } = res.data;
+      this.proxyFileArray.push(file);
+      this.providerForm.proxyFile = this.proxyFileArray;
+    },
+    handlePictureCardPreview(file) {
+      console.log(file, 88);
+      this.imageUrl = file.url;
+    },
+    backLogin() {
+      this.$router.replace({
+        path: "/login",
+        query: {},
+      });
+    },
+
+    /* 供应商注册发送请求 */
+    handleLogin(form) {
+		if(form==this.loginForm){
+			if(this.loginForm.account.length<5||this.loginForm.account.length>20){
+					this.$message({
+						type:'error',
+						message:'账号必须5~20位'
+					})
+			}else if(this.loginForm.password.length<6){
+				this.$message({
+				       type: "error",
+				       message: "密码至少六位!",
 				});
-			},
-			backLogin() {
-				this.$router.replace({
-					path: "/login",
-					query: {},
+			}else if(this.loginForm.password !== this.loginForm.surepsd){
+				this.$message({
+				       type: "error",
+				       message: "密码和确认密码不一致",
 				});
-			},
-
-			/* 供应商注册发送请求 */
-			handleLogin(form) {
-				if (this.loginForm.password !== this.loginForm.surepsd||this.providerForm.password!==this.providerForm.surepsd) {
+			}else if(this.loginForm.mobile.length!==11){
 					this.$message({
-						type: 'error',
-						message: '密码和确认密码不一致'
+						type:'error',
+						message:'电话号码必须11位'
 					})
-				} else {
-					if (form == this.loginForm) {
-						this.$request({
-							url: "/api/Account/register",
-							method: "post",
-							data: form,
-						}).then(res => {
-							if (res.code === 200) {
-								this.$message({
-									type: 'success',
-									message: "注册成功"
-								});
-								this.$router.push({
-									path: "/login",
-								});
-							}
-						});
-					} else {
-						this.$request({
-							url: "/api/Supplier/register",
-							method: "post",
-							data: form,
-						}).then((res) => {
-							if (res.code === 200) {
-								this.$message({
-									type: 'success',
-									message: "注册成功"
-								});
-								this.$router.push({
-									path: "/login",
-								});
-							}
-						});
-					}
-				}
-
-			},
-			// 下载委托书模板
-			download(){
+			}else{
 				this.$request({
-					url:'/api/Setting/attorney',
-					method:'get'
-				}).then(res=>{
-					console.log(res)
-					if(res.code===200){
-						let url=res.data
-						window.open(url)
-					}
-				})
+				         url: "/api/Account/register",
+				         method: "post",
+				         data: form,
+				       }).then((res) => {
+				         if (res.code === 200) {
+				           this.$message({
+				             type: "success",
+				             message: "业务员注册成功",
+				           });
+				           this.$router.push({
+				             path: "/login",
+				           });
+				         }
+				       });
 			}
-		},
-	};
-</script>
-
-<style lang="scss">
-	$bg: #f6f6f6;
-	$light_gray: #bebdbb;
-	$cursor: #bebdbb;
-
-	@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
-		.login-container .el-input input {
-			color: $cursor;
-		}
-	}
-
-	/* reset element-ui css */
-	.login-container {
-		overflow: auto;
-		background: url("../../assets/img/registerbg.png") no-repeat;
-		background-size: 100%;
-
-		.el-input {
-			display: inline-block;
-			height: 47px;
-			width: 70%;
-			background-color: #f6f6f6;
-
-			input {
-				background: #f6f6f6;
-				border: 0px;
-				-webkit-appearance: none;
-				border-radius: 0px;
-				padding: 12px 5px 12px 15px;
-				color: $light_gray;
-				height: 47px;
-				caret-color: $cursor;
-
-				&:-webkit-autofill {
-					box-shadow: 0 0 0px 1000px $bg inset !important;
-					-webkit-text-fill-color: $cursor !important;
-				}
+		}else{
+			if(this.providerForm.account.length<5||this.providerForm.account.length>20){
+				this.$message({
+					type:'error',
+					message:'账号必须5~20位'
+				})
+			}else if(this.providerForm.password !== this.providerForm.surepsd){
+				this.$message({
+				       type: "error",
+				       message: "密码和确认密码不一致",
+				});
+			}else if(this.providerForm.password.length<6){
+				this.$message({
+				       type: "error",
+				       message: "密码至少六位!",
+				});
+			}else if(this.providerForm.contactsMobile.length!==11){
+				this.$message({
+					type:'error',
+					message:'电话号码必须11位'
+				})
+			}else{
+				this.$request({
+				         url: "/api/Supplier/register",
+				         method: "post",
+				         data: form,
+				       }).then((res) => {
+				         if (res.code === 200) {
+				           this.$message({
+				             type: "success",
+				             message: "供应商注册成功",
+				           });
+				           this.$router.push({
+				             path: "/login",
+				           });
+				         }
+				       });
 			}
 		}
+    },
+    // 下载委托书模板
+    download() {
+      this.$request({
+        url: "/api/Setting/attorney",
+        method: "get",
+      }).then((res) => {
+        console.log(res);
+        if (res.code === 200) {
+          let url = res.data;
+          window.open(url);
+        }
+      });
+    },
+  },
+};
+</script>
 
-		.el-input .el-input__inner {
-			color: #030303;
-		}
-
-		.el-form-item {
-			border: 1px solid rgba(255, 255, 255, 0.1);
-			background: #f6f6f6;
-			border-radius: 5px;
-			color: #454545;
-		}
-	}
+<style lang="scss" >
+$bg: #f6f6f6;
+$light_gray: #bebdbb;
+$cursor: #bebdbb;
+
+@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
+  .login-container .el-input input {
+    color: $cursor;
+  }
+}
+
+/* reset element-ui css */
+.login-container {
+  overflow: auto;
+  background: url("../../assets/img/registerbg.png") no-repeat;
+  background-size: 100%;
+
+  .el-input {
+    display: inline-block;
+    height: 47px;
+    width: 70%;
+    background-color: #f6f6f6;
+
+    input {
+      background: #f6f6f6;
+      border: 0px;
+      -webkit-appearance: none;
+      border-radius: 0px;
+      padding: 12px 5px 12px 15px;
+      color: $light_gray;
+      height: 47px;
+      caret-color: $cursor;
+
+      &:-webkit-autofill {
+        box-shadow: 0 0 0px 1000px $bg inset !important;
+        -webkit-text-fill-color: $cursor !important;
+      }
+    }
+  }
+
+  .el-input .el-input__inner {
+    color: #030303;
+  }
+
+  .el-form-item {
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    background: #f6f6f6;
+    border-radius: 5px;
+    color: #454545;
+  }
+}
 </style>
 
 <style lang="scss" scoped>
-	$bg: #2d3a4b;
-	$dark_gray: #f6f6f6;
-	$light_gray: #eee;
-
-	.login-container {
-		height: 100%;
-		width: 100%;
-		// background-color: $bg;
-		// overflow: hidden;
-
-		.login-form {
-			position: relative;
-			width: 470px;
-			max-width: 100%;
-			padding: 0 35px 0;
-			margin: 0 auto;
-			// overflow: hidden;
-		}
-
-		.tips {
-			font-size: 14px;
-			color: #fff;
-			margin-bottom: 10px;
-
-			span {
-				&:first-of-type {
-					margin-right: 16px;
-				}
-			}
-		}
-
-		.svg-container {
-			padding: 6px 5px 6px 15px;
-			color: #1f242a;
-			vertical-align: middle;
-			// width: 30px;
-			display: inline-block;
-		}
-
-		.title-container {
-			position: relative;
-
-			.title {
-				font-size: 48px;
-				color: #1f242a;
-				margin: 0px auto 40px auto;
-				text-align: center;
-				font-weight: bold;
-			}
-		}
-
-		.show-pwd {
-			position: absolute;
-			right: 10px;
-			top: 7px;
-			font-size: 16px;
-			color: $dark_gray;
-			cursor: pointer;
-			user-select: none;
-		}
-	}
-
-	.el-row {
-		height: 100%;
-	}
-
-	.el-col {
-		height: 100%;
-	}
-
-	.business {
-		width: 305px;
-		height: 90px;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		text-align: center;
-		// background-color: #D8AB5A;
-		border-raotherdius: 20rpx;
-		color: #ffffff;
-		margin-top: 57rpx;
-	}
-
-	.business {
-		width: 305rpx;
-		height: 90rpx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		text-align: center;
-		// background-color: #D8AB5A;
-		border-raotherdius: 20rpx;
-		color: #ffffff;
-		margin-top: 57rpx;
-		// line-height: 110rpx;
-	}
-
-	.bnesper {
-		background-size: 100%;
-		background-image: url("../../assets/img/loginbtn4.png");
-		background-repeat: no-repeat;
-		padding-top: 10rpx;
-		color: #fff1d8;
-
-		.asp {
-			padding-bottom: 5px;
-		}
-	}
-
-	.applyper {
-		background-image: url("../../assets/img/loginbt1.png");
-		background-repeat: no-repeat;
-		background-size: 100%;
-		padding-top: 10rpx;
-		color: #fff1d8;
-
-		.asp {
-			padding-bottom: 5px;
-		}
-	}
-
-	.actapp {
-		background-image: url("../../assets/img/loginbtn3.png");
-		background-repeat: no-repeat;
-		background-size: 100%;
-		color: #d05c39;
-		margin-bottom: 80rpx;
-
-		.as {
-			padding-bottom: 20px;
-		}
-
-		// line-height: 180rpx;
-	}
-
-	.actbnes {
-		background-image: url("../../assets/img/loginbt2.png");
-		background-repeat: no-repeat;
-		background-size: 100%;
-		color: #d05c39;
-
-		.asp {
-			padding-bottom: 20px;
-		}
-	}
-
-	.loginbtn {
-		width: 100%;
-		margin-top: 30px;
-		background: linear-gradient(to right, #ffe1ad, #d07539);
-		border: none;
-		height: 56px;
-		border-radius: 10px;
-		font-size: 18px;
-	}
-
-	.registerbtn {
-		margin-top: 0px;
-		margin-bottom: 30px;
-		font-size: 16px;
-
-		.forgect {
-			cursor: pointer;
-		}
-
-		.nes {
-			color: #d05c39;
-		}
-	}
-
-	.boximg {
-		width: 100%;
-		height: 240px;
-		border-radius: 10px;
-		background-color: #f6f6f6;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-
-		image {
-			width: 290px;
-			height: 150px;
-		}
-	}
-
-	.choosepic {
-		.el-form-item__content {}
-	}
-
-	.usa {
-		color: #d05c39;
-		text-align: center;
-		padding: 0 !important;
-		margin: 0;
-	}
-
-	.overcicle {
-		border: 1px solid #ffe2ae;
-		padding-top: 50px;
-		box-sizing: border-box;
-	}
+$bg: #2d3a4b;
+$dark_gray: #f6f6f6;
+$light_gray: #eee;
+
+.login-container {
+  height: 100%;
+  width: 100%;
+  // background-color: $bg;
+  // overflow: hidden;
+
+  .login-form {
+    position: relative;
+    width: 470px;
+    max-width: 100%;
+    padding: 0 35px 0;
+    margin: 0 auto;
+    // overflow: hidden;
+  }
+
+  .tips {
+    font-size: 14px;
+    color: #fff;
+    margin-bottom: 10px;
+
+    span {
+      &:first-of-type {
+        margin-right: 16px;
+      }
+    }
+  }
+
+  .svg-container {
+    padding: 6px 5px 6px 15px;
+    color: #1f242a;
+    vertical-align: middle;
+    // width: 30px;
+    display: inline-block;
+  }
+
+  .title-container {
+    position: relative;
+
+    .title {
+      font-size: 48px;
+      color: #1f242a;
+      margin: 0px auto 40px auto;
+      text-align: center;
+      font-weight: bold;
+    }
+  }
+
+  .show-pwd {
+    position: absolute;
+    right: 10px;
+    top: 7px;
+    font-size: 16px;
+    color: $dark_gray;
+    cursor: pointer;
+    user-select: none;
+  }
+}
+
+.el-row {
+  height: 100%;
+}
+
+.el-col {
+  height: 100%;
+}
+
+.business {
+  width: 305px;
+  height: 90px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  // background-color: #D8AB5A;
+  border-raotherdius: 20rpx;
+  color: #ffffff;
+  margin-top: 57rpx;
+}
+
+.business {
+  width: 305rpx;
+  height: 90rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  // background-color: #D8AB5A;
+  border-raotherdius: 20rpx;
+  color: #ffffff;
+  margin-top: 57rpx;
+  // line-height: 110rpx;
+}
+
+.bnesper {
+  background-size: 100%;
+  background-image: url("../../assets/img/loginbtn4.png");
+  background-repeat: no-repeat;
+  padding-top: 10rpx;
+  color: #fff1d8;
+
+  .asp {
+    padding-bottom: 5px;
+  }
+}
+
+.applyper {
+  background-image: url("../../assets/img/loginbt1.png");
+  background-repeat: no-repeat;
+  background-size: 100%;
+  padding-top: 10rpx;
+  color: #fff1d8;
+
+  .asp {
+    padding-bottom: 5px;
+  }
+}
+
+.actapp {
+  background-image: url("../../assets/img/loginbtn3.png");
+  background-repeat: no-repeat;
+  background-size: 100%;
+  color: #d05c39;
+  margin-bottom: 80rpx;
+
+  .as {
+    padding-bottom: 20px;
+  }
+
+  // line-height: 180rpx;
+}
+
+.actbnes {
+  background-image: url("../../assets/img/loginbt2.png");
+  background-repeat: no-repeat;
+  background-size: 100%;
+  color: #d05c39;
+
+  .asp {
+    padding-bottom: 20px;
+  }
+}
+
+.loginbtn {
+  width: 100%;
+  margin-top: 30px;
+  background: linear-gradient(to right, #ffe1ad, #d07539);
+  border: none;
+  height: 56px;
+  border-radius: 10px;
+  font-size: 18px;
+}
+
+.registerbtn {
+  margin-top: 0px;
+  margin-bottom: 30px;
+  font-size: 16px;
+
+  .forgect {
+    cursor: pointer;
+  }
+
+  .nes {
+    color: #d05c39;
+  }
+}
+
+.boximg {
+  width: 100%;
+  height: 100%;
+  border-radius: 10px;
+  background-color: #f6f6f6;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+
+  image {
+    width: 290px;
+    height: 150px;
+  }
+}
+
+.choosepic {
+  .el-form-item__content {
+  }
+}
+
+.usa {
+  color: #d05c39;
+  text-align: center;
+  padding: 0 !important;
+  margin: 0;
+}
+
+.overcicle {
+  border: 1px solid #ffe2ae;
+  padding-top: 50px;
+  box-sizing: border-box;
+}
 </style>

+ 19 - 23
src/views/shipments/index.vue

xqd xqd xqd xqd xqd xqd
@@ -40,11 +40,11 @@
         <el-button type="primary" @click="shipments1">出票人分类报表</el-button>
         <el-button type="primary" @click="shipments2">合同统计列表</el-button>
         <el-button type="primary" @click="shipments3">供应商统计列表</el-button>
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExport">批量导出</el-button>
+        <el-button type="primary" @click="batchExport">导出</el-button>
       </div>
     </el-row>
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="srcList"
       element-loading-text="Loading"
@@ -54,7 +54,7 @@
       highlight-current-row
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column align="center" label="" width="55" type="selection" :reserve-selection="true">
       </el-table-column>
       <el-table-column label="承兑人名称" align="center" prop="acceptorName">
       </el-table-column>
@@ -176,7 +176,7 @@ export default {
       value1: "",
       value2: "",
       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
   mounted() {
@@ -289,24 +289,21 @@ export default {
       });
     },
 
+    getRowKey(row) {
+      return row.id;
+    },
 
     /* 批量导出数据 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data
     },
     handleAll(data) {
-     this.exportExcelData1.push(data);
+      this.multipleSelection = data
     },
     /* 导出 */
     batchExport() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
-
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports();
       } else {
         var tableHeader = [
           [
@@ -333,41 +330,41 @@ export default {
         });
         dataConversionUtil.dataToExcel("承兑人分类报表", tableHeader, dataList);
         this.$message.success("导出成功!");
-       
       }
     },
     /* 全部导出承兑人列表数据 */
     getContacts(number) {
       const params = {
         pageIndex: "",
-        pageSize: "",
+        pageSize: -1,
         startTime: "",
         endTime: "",
-        frequency:number||1
+        frequency: number || 1,
       };
       getReportSearch({ ...params }).then((res) => {
         const { data } = res;
         this.multipleSelection = data.result;
       });
-
     },
-     /* 全部导出 */
+    /* 全部导出 */
     Exports() {
       this.getContacts(this.formData.frequency);
       setTimeout(() => {
         var tableHeader = [
-          ["序号",
+          [
+            "序号",
             "承兑人姓名",
             "统计周期(按照承兑日)",
             "汇票笔数",
             "汇票金额",
             "服务费",
-            "利息",],
+            "利息",
+          ],
         ];
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
           dataList.push([
-             index + 1,
+            index + 1,
             item.acceptorName,
             item.period,
             item.count,
@@ -378,13 +375,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("承兑人分类报表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 25 - 26
src/views/shipments/shipments1.vue

xqd xqd xqd xqd xqd xqd
@@ -40,11 +40,11 @@
         <el-button type="primary" disabled>出票人分类报表</el-button>
         <el-button type="primary" @click="shipments2">合同统计列表</el-button>
         <el-button type="primary" @click="shipments3">供应商统计列表</el-button>
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExport">批量导出</el-button>
+        <el-button type="primary" @click="batchExport">导出</el-button>
       </div>
     </el-row>
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="srcList"
       element-loading-text="Loading"
@@ -55,7 +55,13 @@
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column
+        align="center"
+        label=""
+        width="55"
+        type="selection"
+        :reserve-selection="true"
+      >
       </el-table-column>
       <el-table-column label="出票人名称" align="center" prop="drawerName">
       </el-table-column>
@@ -178,7 +184,7 @@ export default {
       value1: "",
       value2: "",
       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
   created() {},
@@ -289,24 +295,20 @@ export default {
       const cpage = Math.ceil(font.total / font.pageSize);
       font.handleCurrentChange(cpage);
     },
-
+    getRowKey(row) {
+      return row.id;
+    },
     /* 批量导出数据 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data
     },
     /* 批量导出数据 */
     batchExport() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
-
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports();
       } else {
         var tableHeader = [
           [
@@ -340,34 +342,35 @@ export default {
     getContacts(number) {
       const params = {
         pageIndex: "",
-        pageSize: "",
+        pageSize: -1,
         startTime: "",
         endTime: "",
-        frequency:number||1
+        frequency: number || 1,
       };
       getReportDrawerClassification({ ...params }).then((res) => {
         const { data } = res;
         this.multipleSelection = data.result;
       });
-
     },
-     /* 全部导出 */
+    /* 全部导出 */
     Exports() {
       this.getContacts(this.formData.frequency);
       setTimeout(() => {
         var tableHeader = [
-          [ "序号",
+          [
+            "序号",
             "出票人",
             "统计周期(按照出票日)",
             "汇票笔数",
             "汇票金额",
             "服务费",
-            "利息",],
+            "利息",
+          ],
         ];
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
           dataList.push([
-              index + 1,
+            index + 1,
             item.drawerName,
             item.period,
             item.count,
@@ -378,16 +381,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("出票人分类报表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
-
-
-
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 19 - 16
src/views/shipments/shipments2.vue

xqd xqd xqd xqd xqd xqd
@@ -37,11 +37,11 @@
         <el-button type="primary" @click="shipments1">出票人分类报表</el-button>
         <el-button type="primary" disabled>合同统计列表</el-button>
         <el-button type="primary" @click="shipments3">供应商统计列表</el-button>
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExport">批量导出</el-button>
+        <el-button type="primary" @click="batchExport">导出</el-button>
       </div>
     </el-row>
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="srcList"
       element-loading-text="Loading"
@@ -51,7 +51,13 @@
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column
+        align="center"
+        label=""
+        width="55"
+        type="selection"
+        :reserve-selection="true"
+      >
       </el-table-column>
       <el-table-column label="合同名称" align="center" prop="contractName">
       </el-table-column>
@@ -172,7 +178,7 @@ export default {
       value1: "",
       value2: "",
       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
 
@@ -276,23 +282,20 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
+    getRowKey(row) {
+      return row.id;
+    },
     /* 批量导出数据 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data;
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data;
     },
     /* 批量导出 */
     batchExport() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
-
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports();
       } else {
         var tableHeader = [
           [
@@ -329,7 +332,8 @@ export default {
         pageIndex: "",
         pageSize: "",
         startTime: "",
-        contractName:'',
+        contractName: "",
+        pageSize: -1,
       };
       getReportContractReport({ ...params }).then((res) => {
         const { data } = res;
@@ -367,13 +371,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("合同统计列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 14 - 18
src/views/shipments/shipments3.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -39,11 +39,11 @@
         <el-button type="primary" @click="shipments1">出票人分类报表</el-button>
         <el-button type="primary" @click="shipments2">合同统计列表</el-button>
         <el-button type="primary" disabled>供应商统计列表</el-button>
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExport">批量导出</el-button>
+        <el-button type="primary" @click="batchExport">导出</el-button>
       </div>
     </el-row>
     <el-table
+    :row-key="getRowKey"
       v-loading="listLoading"
       :data="srcList"
       element-loading-text="Loading"
@@ -53,7 +53,7 @@
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column align="center" label="" width="55" type="selection" :reserve-selection="true">
       </el-table-column>
       <el-table-column label="供应商名称" align="center" prop="supplierName">
       </el-table-column>
@@ -173,7 +173,7 @@ export default {
       },
       value2: "",
       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
 
@@ -196,7 +196,7 @@ export default {
         this.total = data.total;
       });
     },
-    
+
     index() {
       this.$router.push({
         path: "/shipments/index",
@@ -276,23 +276,20 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
+     getRowKey(row) {
+      return row.id;
+    },
     /* 批量导出数据 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data
     },
     /* 导出 */
     batchExport() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
-
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports()
       } else {
         var tableHeader = [
           [
@@ -327,9 +324,9 @@ export default {
     getContacts() {
       const params = {
         pageIndex: "",
-        pageSize: "",
+        pageSize: -1,
         startTime: "",
-        supplierName:'',
+        supplierName: "",
       };
       getReportSupplierReport({ ...params }).then((res) => {
         const { data } = res;
@@ -367,13 +364,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("供应商统计列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 83 - 23
src/views/sucuirtyaudit/annexList.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -48,12 +48,12 @@
       >
         <el-button type="primary" @click="toindex">操作日志</el-button>
         <el-button type="primary" disabled>附件列表</el-button>
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExports">批量导出</el-button>
-        <el-button type="primary">批量下载</el-button>
+        <el-button type="primary" @click="batchExports">导出</el-button>
+        <el-button type="primary" @click="downloadAppendix">下载</el-button>
       </div>
     </el-row>
     <el-table
+      :row-key="getRowKey"
       v-loading="listLoading"
       :data="temporaryList"
       element-loading-text="Loading"
@@ -63,7 +63,13 @@
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column
+        align="center"
+        label=""
+        width="55"
+        type="selection"
+        :reserve-selection="true"
+      >
       </el-table-column>
       <el-table-column align="center" label="合同名称" width="210" prop="name">
       </el-table-column>
@@ -89,13 +95,14 @@
         prop="picUrls"
       >
         <template slot-scope="scope">
-          <img
+          <!-- <img
             width="100"
             height="100"
             v-for="item in scope.row.picUrls"
             :key="item.id"
             :src="item"
-          />
+          /> -->
+          <FileShow :files="scope.row.picUrls" />
         </template>
       </el-table-column>
       <!-- 发票附件 -->
@@ -106,13 +113,14 @@
         prop="invoicePics"
       >
         <template slot-scope="scope">
-          <img
+          <!-- <img
             width="100"
             height="100"
             v-for="item in scope.row.invoicePics"
             :key="item.id"
             :src="item"
-          />
+          /> -->
+          <FileShow :files="scope.row.invoicePics" />
         </template>
       </el-table-column>
       <!-- 贸易合同 -->
@@ -123,13 +131,14 @@
         prop="tradePics"
       >
         <template slot-scope="scope">
-          <img
+          <!-- <img
             width="100"
             height="100"
             v-for="item in scope.row.tradePics"
             :key="item.id"
             :src="item"
-          />
+          /> -->
+          <FileShow :files="scope.row.tradePics" />
         </template>
       </el-table-column>
 
@@ -258,8 +267,7 @@ export default {
       value1: "",
       value2: "",
       multipleSelection: [], //导出数据
-      exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      idsArray: [], //存放所有合同的id名
     };
   },
   mounted() {
@@ -280,6 +288,9 @@ export default {
         this.temporaryList = data.result;
         this.srcList = data.result;
         this.total = res.data.total;
+        this.idsArray = this.temporaryList.map((item) => {
+          return item.id;
+        });
       });
     },
 
@@ -390,22 +401,72 @@ export default {
       return decodeURI(filename);
     },
 
+    /* 批量下载附件 */
+    downloadAppendix() {
+      let ids = this.multipleSelection.map((item) => {
+        return item.id;
+      });
+
+      if (ids == "") {
+        let that = this;
+        this.$request({
+          url: "/api/AuditLog/attachments/download",
+          method: "post",
+          data: {
+            contractIds: this.idsArray,
+          },
+          responseType: "blob",
+        }).then((res) => {
+          let filename = this.getFileName(res.headers["content-disposition"]);
+          let fileData = res.data;
+          let blob = new Blob([fileData], { type: "application/zip" });
+          let url = URL.createObjectURL(blob);
+          const link = document.createElement("a");
+          link.href = url;
+          link.download = filename;
+          link.click();
+          // 释放内存
+          URL.revokeObjectURL(url);
+        });
+      } else {
+        let that = this;
+        this.$request({
+          url: "/api/AuditLog/attachments/download",
+          method: "post",
+          data: {
+            contractIds: ids,
+          },
+          responseType: "blob",
+        }).then((res) => {
+          let filename = this.getFileName(res.headers["content-disposition"]);
+          let fileData = res.data;
+          let blob = new Blob([fileData], { type: "application/zip" });
+          let url = URL.createObjectURL(blob);
+          const link = document.createElement("a");
+          link.href = url;
+          link.download = filename;
+          link.click();
+          // 释放内存
+          URL.revokeObjectURL(url);
+        });
+      }
+    },
+
+    getRowKey(row) {
+      return row.id;
+    },
+
     /* 批量导出 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data;
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data;
     },
     /* 批量导出数据 */
     batchExports() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports();
       } else {
         var tableHeader = [
           [
@@ -444,7 +505,7 @@ export default {
         operateUser: "",
         content: "",
       };
-      getAuditLogAttachmentsSearch({ data }).then((res) => {
+      getAuditLogAttachmentsSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });
@@ -478,13 +539,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("附件列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-        this.multipleSelection = [];
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;

+ 1 - 1
src/views/sucuirtyaudit/attachment-detail.vue

xqd
@@ -43,7 +43,7 @@ export default {
 };
 </script>
 
-<style lang="scss" >
+<style lang="scss" scoped >
 .attachment-detail {
   padding: 20px;
 }

+ 80 - 23
src/views/sucuirtyaudit/detail.vue

xqd xqd xqd
@@ -2,39 +2,52 @@
 
 	<div>
 		<el-descriptions title="详情信息" :column="2" border style="margin: 20px;">
-
-			<el-descriptions-item label="姓名">{{tableData.userName}}</el-descriptions-item>
+			<el-descriptions-item label="操作人员">{{tableData.userName}}</el-descriptions-item>
 			<el-descriptions-item label="状态">{{tableData.status}}</el-descriptions-item>
 			<el-descriptions-item label="id">{{tableData.recordId}}</el-descriptions-item>
-			<el-descriptions-item label="事件名称">{{tableData.event}}</el-descriptions-item>
+			<el-descriptions-item label="操作事件">{{tableData.event}}</el-descriptions-item>
 		</el-descriptions>
-		<el-collapse  @change="handleChange" v-model="activeNames">
-			<el-collapse-item title="更新前" name="1" style=" margin-left:20px">
-			  <el-table :data="beforeobj.columns"  border>
+		<el-collapse   v-model="activeNames">
+			<el-collapse-item  name="1" style=" margin-left:20px">
+				<!-- <el-descriptions title="更新前" :column="3" border style="margin: 20px;">
+					<el-descriptions-item label="姓名">{{beforeobj.columns.name}}</el-descriptions-item>
+					<el-descriptions-item label="银行账号">{{beforeobj.columns.bank_account}}</el-descriptions-item>
+					<el-descriptions-item label="银行名称">{{beforeobj.columns.bank_name}}</el-descriptions-item>
+					<el-descriptions-item label="id">{{beforeobj.columns.id}}</el-descriptions-item>
+					<el-descriptions-item label="创建时间">{{beforeobj.columns.created_at}}</el-descriptions-item>
+					<el-descriptions-item label="更新时间">{{beforeobj.columns.updated_at}}</el-descriptions-item>
+					<el-descriptions-item label="删除时间">{{beforeobj.columns.deleted_at}}</el-descriptions-item>
+					<el-descriptions-item label="状态">{{beforeobj.columns.is_deleted}}</el-descriptions-item>
+				</el-descriptions> -->
+			  <!-- <el-table :data="beforeobj.columns"  border>
 			  	<el-table-column label="列表名" prop="columnName">
 			  	</el-table-column>
-			  	<el-table-column prop="columnDescription" label="描述" >
-			  	</el-table-column>
-			  	<el-table-column prop="isPrimaryKey" label="主键" >
-			  	</el-table-column>
 			  	<el-table-column prop="value" label="值" >
-						<!-- <template slot-scope="scope">
-							<img width='100' height="100" v-for="item in scope.row.value" :src="item">
-						</template> -->
 			  	</el-table-column>
-			  </el-table>
+			  </el-table> -->
 			</el-collapse-item>
 		  <el-collapse-item title="更新后" name="2" style=" margin-left:20px">
-		    <el-table :data="afterobj.columns"  border>
+			  <el-descriptions :title="title" :column="2" border style="margin: 20px;">
+				  <el-descriptions-item  v-for="item in afterobj.columns" :label="getColumnName(item.columnName)">
+					  <template >
+						  {{item.value}}
+					  </template>
+				  </el-descriptions-item>
+			  	<!-- <el-descriptions-item label="姓名">{{afterobj.columns.name}}</el-descriptions-item>
+			  	<el-descriptions-item label="银行账号">{{afterobj.columns.bank_account}}</el-descriptions-item>
+			  	<el-descriptions-item label="银行名称">{{afterobj.columns.bank_name}}</el-descriptions-item>
+			  	<el-descriptions-item label="id">{{afterobj.columns.id}}</el-descriptions-item>
+			  	<el-descriptions-item label="创建时间">{{afterobj.columns.created_at}}</el-descriptions-item>
+			  	<el-descriptions-item label="更新时间">{{afterobj.columns.updated_at}}</el-descriptions-item>
+			  	<el-descriptions-item label="删除时间">{{afterobj.columns.deleted_at}}</el-descriptions-item>
+			  	<el-descriptions-item label="状态">{{afterobj.columns.is_deleted}}</el-descriptions-item> -->
+			  </el-descriptions>
+		    <!-- <el-table :data="afterobj.columns"  border>
 		    	<el-table-column label="列表名" prop="columnName">
 		    	</el-table-column>
-		    	<el-table-column prop="columnDescription" label="描述" >
-		    	</el-table-column>
-		    	<el-table-column prop="isPrimaryKey" label="主键" >
-		    	</el-table-column>
 		    	<el-table-column prop="value" label="值" >
 		    	</el-table-column>
-		    </el-table>
+		    </el-table> -->
 		  </el-collapse-item>
 		</el-collapse>
 	</div>
@@ -49,6 +62,10 @@
 				afterobj: {},
 				beforeobj:{},
 				tableData: {},
+				columnName:'',
+				hanhua:['供应商id','姓名','合同编号','发票附件','合同附件','贸易附件','状态','反馈','反馈截图','合同id','创建时间','更新时间','删除时间','删除状态'],
+				title:'',
+				afterArray:[],//存放更新后的数据
 			}
 		},
 		mounted() {
@@ -57,21 +74,61 @@
 				url: '/api/AuditLog/detail/' + id,
 				method: 'get',
 			}).then((res) => {
+				// this.tableData = res.data
+				// console.log(this.tableData,"tableData")
+				// this.afterobj = JSON.parse(res.data.after)
+				// // this.beforeobj=JSON.parse(res.data.before)
+				// console.log(this.afterobj, "更新后")
+				// let columnName=Array.from(this.afterobj.columns,({columnName})=>columnName)
+				// console.log(columnName)
+				// this.columnName=this.getnewarr(columnName,this.hanhua)
+				// console.log(this.columnName)
+				// // 更新内容设置标题
+				// if(this.afterobj.tableName=='contract'){
+				// 	this.title='合同'
+				// }else{
+				// 	this.title='汇票'
+				// }
 				this.tableData = res.data
-				console.log(this.tableData)
+				console.log(this.tableData,"tableData")
 				this.afterobj = JSON.parse(res.data.after)
-				this.beforeobj=JSON.parse(res.data.before)
+				// this.beforeobj=JSON.parse(res.data.before)
 				console.log(this.afterobj, "更新后")
+				let columnName=Array.from(this.afterobj.columns,({columnName})=>columnName)
+				this.columnName=this.getnewarr(columnName,this.hanhua)
+				console.log(this.columnName,"this.columnName")
+				console.log(this.afterobj.columns,"afterobj.columns")
+				// 更新内容设置标题
+				if(this.afterobj.tableName=='contract'){
+					this.title='合同'
+				}else{
+					this.title='汇票'
+				}
 			})
 		},
 		methods:{
 			handleChange(){
+			},			
+			getnewarr(keyArr,valueArr) {
+				var obj = {};
+				keyArr.map( (v,i) => {
+				obj[keyArr[i]] = valueArr[i];
+				})
+			   return obj;
+			},
+			getColumnName(val){
+				for(var key in this.columnName){
+					console.log(key)
+					if(val==key){
+						return this.columnName[key]
+					}
+				}
 			}
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .sucuirtyaudit-deatil{
 	padding: 20px;
 }

+ 20 - 26
src/views/sucuirtyaudit/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -48,11 +48,11 @@
       >
         <el-button type="primary" disabled>操作日志</el-button>
         <el-button type="primary" @click="toannexList">附件列表</el-button>
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExports">批量导出</el-button>
+        <el-button type="primary" @click="batchExports">导出</el-button>
       </div>
     </el-row>
     <el-table
+    :row-key="getRowKey"
       v-loading="listLoading"
       :data="temporaryList"
       element-loading-text="Loading"
@@ -62,7 +62,7 @@
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column align="center" label="" width="55" type="selection" :reserve-selection="true">
       </el-table-column>
       <el-table-column
         align="center"
@@ -216,8 +216,8 @@ export default {
       },
       value1: "",
       value2: "",
-       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData1: [], //导出列表缓存数据整页
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
   mounted() {
@@ -238,7 +238,7 @@ export default {
         this.total = res.data.total;
       });
     },
-
+    /* 汇票附件查询 */
     todetail(id) {
       this.$router.push({ path: "/logdetail", query: { id: id } });
     },
@@ -300,21 +300,19 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
+    getRowKey(row) {
+      return row.id;
+    },
     /* 批量导出 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data
     },
     batchExports() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports()
       } else {
         var tableHeader = [
           ["序号", "操作日", "事件", "操作人员", "操作状态", "操作说明"],
@@ -334,17 +332,17 @@ export default {
         this.$message.success("导出成功!");
       }
     },
-     /* 全部导出合同列表数据 */
+    /* 全部导出合同列表数据 */
     getContacts() {
       const data = {
-        pageIndex: '',
+        pageIndex: "",
         pageSize: -1,
         startTime: "",
         endTime: "",
-        operateUser:'',
-        content:'',
+        operateUser: "",
+        content: "",
       };
-      getAuditLogSearch({ data }).then((res) => {
+      getAuditLogSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });
@@ -355,14 +353,12 @@ export default {
       this.getContacts();
       setTimeout(() => {
         var tableHeader = [
-          [
-            "序号", "操作日", "事件", "操作人员", "操作状态", "操作说明"
-          ],
+          ["序号", "操作日", "事件", "操作人员", "操作状态", "操作说明"],
         ];
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
           dataList.push([
-             index + 1,
+            index + 1,
             item.createdAt,
             item.event,
             item.userName,
@@ -372,13 +368,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("安全审计列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-         this.multipleSelection=[]
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;
@@ -403,5 +398,4 @@ export default {
 .el-pagination.is-background .el-pager li:not(.disabled).active {
   background-color: #d8ab5a;
 }
-
 </style>

+ 1 - 1
src/views/table/addAcceptor.vue

xqd
@@ -66,7 +66,7 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.form {
 		margin-top: 100px;
 		display: flex;

+ 169 - 59
src/views/table/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -34,11 +34,12 @@
         class="grid-content bg-purple"
         style="display: flex; justify-content: flex-end"
       >
+			<el-button type="success" @click="recovers">恢复</el-button>
+			<el-button type="danger" @click="deleteStatuses">删除</el-button>
         <el-button type="primary" @click="dialogVisible2 = true"
           >新增承兑人</el-button
         >
-        <el-button type="primary" @click="Exports">全部导出</el-button>
-        <el-button type="primary" @click="batchExports">批量导出</el-button>
+        <el-button type="primary" @click="batchExports">导出</el-button>
       </div>
     </el-row>
 
@@ -49,7 +50,7 @@
           <el-input v-model="tableData.name" style="width: 100%"></el-input>
         </el-form-item>
 
-        <el-form-item label="银行账" prop="tableData.bankAccount">
+        <el-form-item label="银行账" prop="tableData.bankAccount">
           <el-input
             v-model="tableData.bankAccount"
             style="width: 100%"
@@ -104,11 +105,11 @@
             placeholder="请输入承兑人名称"
           ></el-input>
         </el-form-item>
-        <el-form-item label="账号" prop="bankAccount">
+        <el-form-item label="银行账号" prop="bankAccount">
           <el-input
             v-model="form.bankAccount"
             style="width: 100%"
-            placeholder="请输入账号"
+            placeholder="请输入银行账号"
           ></el-input>
         </el-form-item>
         <el-form-item label="开户行名称" prop="bankName">
@@ -158,16 +159,19 @@
     </el-dialog>
 
     <el-table
+      :row-key="getRowKey"
+      
       v-loading="listLoading"
       :data="temporaryList"
       element-loading-text="Loading"
       border
       fit
+	  ref="multipleTable"
       highlight-current-row
       @select="handleSelectionChange"
       @select-all="handleAll"
     >
-      <el-table-column align="center" label="" width="55" type="selection">
+      <el-table-column align="center" label="" width="55" type="selection" :reserve-selection="true">
       </el-table-column>
       <el-table-column label="承兑人名称" align="center" prop="name">
       </el-table-column>
@@ -297,6 +301,7 @@ export default {
         bankName: "",
         id: "",
       },
+      oldTableData: "",
       /* 当前页数 */
       currentPage: 1,
       /* 每页显示个数 */
@@ -345,8 +350,8 @@ export default {
       },
       value1: "",
       value2: "",
-      exportExcelData1:[],//列表缓存数据
-      exportExcelData2:[]
+      exportExcelData1: [], //列表缓存数据
+      exportExcelData2: [],
     };
   },
   mounted() {
@@ -373,25 +378,33 @@ export default {
     },
 
     addAcceptor() {
-      this.$request({
-        url: "/api/Acceptor",
-        method: "post",
-        data: this.form,
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: "success",
-            message: "添加成功",
-          });
-          this.getAllList();
-          this.dialogVisible2 = false;
-        } else {
-          this.$message({
-            type: "error",
-            message: res.msg,
-          });
-        }
-      });
+		if(this.form.bankAccount.length<5||this.form.bankAccount>20){
+			this.$message({
+			  type: "error",
+			  message: "银行账号必须为5~20位!",
+			});
+		}else{
+			this.$request({
+			  url: "/api/Acceptor",
+			  method: "post",
+			  data: this.form,
+			}).then((res) => {
+			  if (res.code === 200) {
+			    this.$message({
+			      type: "success",
+			      message: "添加成功",
+			    });
+			    this.getAllList();
+			    this.dialogVisible2 = false;
+			  } else {
+			    this.$message({
+			      type: "error",
+			      message: res.msg,
+			    });
+			  }
+			});
+		}
+     
     },
     toDetail(id) {
       this.$router.push({
@@ -401,6 +414,47 @@ export default {
         },
       });
     },
+	// 批量恢复
+	recovers(){
+		let ids=Array.from(this.multipleSelection,({id})=>id)
+		let status=Array.from(this.multipleSelection,({status})=>status)
+		if(status.includes(0)){
+			this.$message({
+				type: 'error',
+				message: '不能恢复已是正常状态的账号'
+			})
+		}else if(ids==""){
+			this.$message({
+				type: 'error',
+				message: '请选择数据'
+			})
+		}else{
+			this.$request({
+			  url: "/api/Acceptor/manager",
+			  method: "post",
+			  data: {
+			    ids:ids,
+			    operateType: 2,
+			  },
+			}).then((res) => {
+			  if (res.code == 200) {
+			    this.$message({
+			      type: "success",
+			      message: "恢复成功",
+			    });
+				this.$refs.multipleTable.clearSelection();
+			    this.getAllList();
+			  } else {
+			    this.$message({
+			      type: "danger",
+			      message: "恢复失败",
+			    });
+			    this.getAllList();
+			  }
+			});
+		}
+		
+	},
     recover(id) {
       this.$request({
         url: "/api/Acceptor/manager",
@@ -425,6 +479,47 @@ export default {
         }
       });
     },
+	// 批量删除
+	deleteStatuses(){
+		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/Acceptor/manager",
+			  method: "post",
+			  data: {
+			    ids: ids,
+			    operateType: 1,
+			  },
+			}).then((res) => {
+			  if (res.code == 200) {
+			    this.$message({
+			      type: "success",
+			      message: "删除成功",
+			    });
+				this.$refs.multipleTable.clearSelection();
+			    this.getAllList();
+			  } else {
+			    this.$message({
+			      type: "danger",
+			      message: "删除失败",
+			    });
+			    this.getAllList();
+			  }
+			});
+		}
+		
+	},
     deleteStatus(id) {
       this.$request({
         url: "/api/Acceptor/manager",
@@ -460,30 +555,45 @@ export default {
         console.log(res);
         this.tableData = res.data;
         this.tableData.id = id;
+        this.oldTableData = { ...this.tableData };
       });
       this.dialogVisible1 = true;
     },
     // 弹窗修改
     onSubmit() {
-      this.$request({
-        url: "/api/Acceptor/update",
-        method: "post",
-        data: this.tableData,
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: "success",
-            message: "修改成功!",
-          });
-          this.getAllList();
-        } else {
-          this.$message({
-            type: "danger",
-            message: "修改失败!",
-          });
-        }
-      });
-      this.dialogVisible1 = false;
+
+	  if(JSON.stringify(this.oldTableData)===JSON.stringify(this.tableData)){
+		  this.$message({
+			  type:'error',
+			  message:'数据没有改变!'
+		  })
+	  }else if(this.tableData.bankAccount.length<5||this.tableData.bankAccount.length>20){
+			this.$message({
+			  type:'error',
+			  message:'银行账号必须为5~20位!'
+			})
+		}else{
+		  this.$request({
+		    url: "/api/Acceptor/update",
+		    method: "post",
+		    data: this.tableData,
+		  }).then((res) => {
+		    if (res.code == 200) {
+		      this.$message({
+		        type: "success",
+		        message: "修改成功!",
+		      });
+		      this.getAllList();
+		    } else {
+		      this.$message({
+		        type: "danger",
+		        message: "修改失败!",
+		      });
+		    }
+		  });
+		  this.dialogVisible1 = false;
+	  }
+
     },
 
     /* 输入承兑人状态查询 */
@@ -532,22 +642,22 @@ export default {
       font.handleCurrentChange(cpage);
     },
 
+    getRowKey(row) {
+      return row.id;
+    },
+
     /* 批量导出数据 */
     handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = new Set( this.exportExcelData1.flat(Infinity));
+      this.multipleSelection = data
+			console.log(this.multipleSelection)
     },
     handleAll(data) {
-      this.exportExcelData1.push(data);
+      this.multipleSelection = data
     },
     /* 导出 */
     batchExports() {
-      this.multipleSelection = new Set(this.exportExcelData1.flat(Infinity))||this.exportExcelData2;
       if (this.multipleSelection == "") {
-        this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+        this.Exports();
       } else {
         var tableHeader = [
           [
@@ -583,7 +693,7 @@ export default {
     /* 全部导出承兑人列表数据 */
     getContacts() {
       const data = {
-        pageIndex: '',
+        pageIndex: "",
         pageSize: -1,
         startTime: "",
         endTime: "",
@@ -593,7 +703,7 @@ export default {
         draftStatus: "",
         supplierId: "",
       };
-      getAcceptorSearch({ data }).then((res) => {
+      getAcceptorSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });
@@ -619,7 +729,7 @@ export default {
         var dataList = [];
         this.multipleSelection.forEach((item, index) => {
           dataList.push([
-           index + 1,
+            index + 1,
             item.name,
             item.bankAccount,
             item.bankName,
@@ -632,13 +742,12 @@ export default {
         });
         dataConversionUtil.dataToExcel("承兑人列表", tableHeader, dataList);
         this.$message.success("导出成功!");
-        this.multipleSelection=[]
       }, 1000);
     },
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .pulldown {
   width: 185px;
   height: 40px;
@@ -656,6 +765,7 @@ export default {
   width: 100%;
   display: flex;
   justify-content: flex-end;
+  margin-top: 20px;
 }
 
 .el-pagination.is-background .el-pager li:not(.disabled).active {