Browse Source

8.5 11:56

Tartarus 3 years ago
parent
commit
65b0e7603b

+ 1 - 1
src/utils/request.js

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',

+ 587 - 543
src/views/form/index.vue

xqd
@@ -1,568 +1,612 @@
 <template>
-  <div class="app-container">
-    <el-row type="flex" justify="space-between" style="margin-bottom: 20px">
-      <div class="grid-content bg-purple">
-        <div class="grid-content bg-purple" style="margin-left: 30px">
-          <el-input
-            placeholder="请输入出票人名称"
-            v-model="formData.name"
-            @change="Search"
-            clearable
-            style="width: 100%"
-          >
-            <i slot="prefix" class="el-input__icon el-icon-search"></i>
-          </el-input>
-        </div>
-      </div>
-      <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommand">
-          <div class="pulldown">
-            <span class="el-dropdown-link" v-if="!status"> 出票人状态 </span>
-            <span class="el-dropdown-link" v-if="status">
-              {{ status }}
-            </span>
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </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-menu>
-        </el-dropdown>
-      </div>
+	<div class="app-container">
+		<el-row type="flex" justify="space-between" style="margin-bottom: 20px">
+			<div class="grid-content bg-purple">
+				<div class="grid-content bg-purple" style="margin-left: 30px">
+					<el-input placeholder="请输入出票人名称" v-model="formData.name" @change="Search" clearable
+						style="width: 100%">
+						<i slot="prefix" class="el-input__icon el-icon-search"></i>
+					</el-input>
+				</div>
+			</div>
+			<div class="grid-content bg-purple">
+				<el-dropdown @command="handleCommand">
+					<div class="pulldown">
+						<span class="el-dropdown-link" v-if="!status"> 出票人状态 </span>
+						<span class="el-dropdown-link" v-if="status">
+							{{ status }}
+						</span>
+						<i class="el-icon-arrow-down el-icon--right"></i>
+					</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-menu>
+				</el-dropdown>
+			</div>
 
-      <div
-        class="grid-content bg-purple"
-        style="display: flex; justify-content: flex-end"
-      >
-        <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>
-      </div>
-    </el-row>
+			<div 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>
+			</div>
+		</el-row>
 
-    <!--修改出票人弹窗 -->
-    <el-dialog title="修改出票人" :visible.sync="dialogVisible1" width="500px">
-      <el-form ref="form" :model="tableData" label-width="80px">
-        <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-input
-            v-model="tableData.bankAccount"
-            style="width: 100%"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="银行名称" prop="tableData.bankName">
-          <el-input v-model="tableData.bankName" style="width: 100%"></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="dialogVisible1 = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">提交修改</el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
+		<!--修改出票人弹窗 -->
+		<el-dialog title="修改出票人" :visible.sync="dialogVisible1" width="500px">
+			<el-form ref="form" :model="tableData" label-width="80px">
+				<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-input v-model="tableData.bankAccount" style="width: 100%"></el-input>
+				</el-form-item>
+				<el-form-item label="银行名称" prop="tableData.bankName">
+					<el-input v-model="tableData.bankName" style="width: 100%"></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button @click="dialogVisible1 = false">取 消</el-button>
+					<el-button type="primary" @click="onSubmit">提交修改</el-button>
+				</el-form-item>
+			</el-form>
+		</el-dialog>
 
-    <el-dialog title="新增出票人" :visible.sync="dialogVisible2" width="500px">
-      <el-form ref="form" :model="form" label-width="100px">
-        <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-input v-model="form.bankAccount"></el-input>
-        </el-form-item>
-        <el-form-item label="开户行名称" style="width: 100%" prop="bankName">
-          <el-input v-model="form.bankName"></el-input>
-        </el-form-item>
-        <el-form-item style="display: flex">
-          <el-button @click="dialogVisible2 = false">取 消</el-button>
-          <el-button type="primary" @click="addTicketdrawer"
-            >确认添加</el-button
-          >
-        </el-form-item>
-      </el-form>
-    </el-dialog>
+		<el-dialog title="新增出票人" :visible.sync="dialogVisible2" width="500px">
+			<el-form ref="form" :model="form" label-width="100px">
+				<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-input v-model="form.bankAccount"></el-input>
+				</el-form-item>
+				<el-form-item label="开户行名称" style="width: 100%" prop="bankName">
+					<el-input v-model="form.bankName"></el-input>
+				</el-form-item>
+				<el-form-item style="display: flex">
+					<el-button @click="dialogVisible2 = false">取 消</el-button>
+					<el-button type="primary" @click="addTicketdrawer">确认添加</el-button>
+				</el-form-item>
+			</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 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>
 </template>
 
 <script>
-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: [],
-    };
-  },
+	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)
+				console.log(status.includes('0'),"ss")
+				if(!status.includes('0')){
+					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.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)
+				console.log(status)
+				if(!status.includes('0')){
+					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.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;
-      this.$request({
-        url: "/api/Drawer/" + id,
-        method: "get",
-      }).then((res) => {
-        this.tableData = res.data;
-		this.oldTableData={...this.tableData}
+			// 修改信息弹窗
+			modify(id) {
+				this.dialogVisible1 = true;
+				this.$request({
+					url: "/api/Drawer/" + id,
+					method: "get",
+				}).then((res) => {
+					this.tableData = res.data;
+					this.oldTableData = {
+						...this.tableData
+					}
 
-      });
-    },
-    // 修改信息弹窗提交
-    onSubmit() {
-		if(JSON.stringify(this.oldTableData)===JSON.stringify(this.tableData)){
-			this.$message({
-				type:'error',
-				message:'数据没有改变!'
-			})
-		}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("提交失败");
-        }
-      });
-    },
+				});
+			},
+			// 修改信息弹窗提交
+			onSubmit() {
+				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: "修改失败!",
+							});
+						}
+					});
+				}
 
-    /* 输入出票人状态查询 */
-    handleCommand(command) {
-      this.status = command;
-      if (command === "正常") {
-        this.formData.status = 5;
-      }
-      if (command === "删除") {
-        this.formData.status = 4;
-      }
-      if (command === "全部") {
-        this.formData.status = "";
-      }
-      this.currentPage = 1;
-      this.searchForm = {
-        ...this.formData,
-      };
-      this.getAllList(this.searchForm);
-    },
-    /* 输入出票人名称查询 */
-    Search() {
-      this.currentPage = 1;
-      this.searchForm = {
-        ...this.formData,
-      };
-      this.getAllList(this.searchForm);
-    },
+			},
+			// 新增出票人弹窗
+			addTicketdrawer() {
+				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("提交失败");
+						}
+					});
+				}
 
-    /* 分页功能,改变当前页 */
-    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);
-    },
+			/* 输入出票人状态查询 */
+			handleCommand(command) {
+				this.status = command;
+				if (command === "正常") {
+					this.formData.status = 5;
+				}
+				if (command === "删除") {
+					this.formData.status = 4;
+				}
+				if (command === "全部") {
+					this.formData.status = "";
+				}
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData,
+				};
+				this.getAllList(this.searchForm);
+			},
+			/* 输入出票人名称查询 */
+			Search() {
+				this.currentPage = 1;
+				this.searchForm = {
+					...this.formData,
+				};
+				this.getAllList(this.searchForm);
+			},
 
-    /* 批量导出数据 */
-    handleSelectionChange(data) {
-      this.exportExcelData1.push(data);
-      this.exportExcelData2 = [
-        ...new Set(this.exportExcelData1.flat(Infinity)),
-      ];
-    },
-    handleAll(data) {
-      this.exportExcelData1.push(data);
-    },
+			/* 分页功能,改变当前页 */
+			handleCurrentChange(val) {
+				this.currentPage = val;
+				this.getAllList(this.searchForm);
+			},
 
-    /* 批量导出 */
-    batchExports() {
-      this.multipleSelection =
-        [...new Set(this.exportExcelData1.flat(Infinity))] ||
-        this.exportExcelData2;
+			/* 分页功能去首页 */
+			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);
+			},
 
-      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;
-      });
-    },
+			/* 批量导出数据 */
+			handleSelectionChange(data) {
+				this.multipleSelection = data
+				this.exportExcelData1.push(data);
+				this.exportExcelData2 = [
+					...new Set(this.exportExcelData1.flat(Infinity)),
+				];
+			},
+			handleAll(data) {
+				this.multipleSelection = data
+				this.exportExcelData1.push(data);
+			},
 
-    /* 全部导出 */
-    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);
-    },
-  },
-};
+			/* 批量导出 */
+			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;
+				});
+			},
+
+			/* 全部导出 */
+			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);
+			},
+		},
+	};
 </script>
 <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;
-}
+	.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>

+ 6 - 2
src/views/mine/index.vue

xqd xqd
@@ -20,7 +20,7 @@
 							<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" />
@@ -292,12 +292,16 @@
 			},
 			// 修改个人信息
 			update() {
-				console.log(JSON.stringify(this.startform)==JSON.stringify(this.form))
 				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',

+ 33 - 14
src/views/register/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -26,7 +26,7 @@
               />
             </el-form-item>
             <el-form-item prop="username">
-              <span class="svg-container"> 登录账 </span>
+              <span class="svg-container"> 登录账 </span>
               <el-input
                 ref="username"
                 v-model="loginForm.account"
@@ -71,7 +71,6 @@
                 placeholder="请输入业务员联系电话"
                 name="mobile"
                 tabindex="5"
-                auto-complete="on"
                 onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
               />
             </el-form-item>
@@ -224,7 +223,7 @@
                 </span>
                 <div class="boximg">
                   <el-upload
-                    action="https://ht.9026.com/api/File"
+                    action="https://api.xrongm.com/api/File"
                     list-type="picture-card"
                     :on-success="handleAvatarSuccess"
                   >
@@ -262,8 +261,8 @@
                   点击获取授权委托书
                 </span>
                 <div class="boximg">
-                 <!-- <el-upload
-                    action="https://ht.9026.com/api/File"
+                 <el-upload
+                    action="https://api.xrongm.com/api/File"
                     list-type="picture-card"
                     :on-success="handleSuccess"
                   >
@@ -271,11 +270,11 @@
                   </el-upload>
                   <el-dialog :visible.sync="dialogVisible">
                     <img width="100%" :src="providerForm.proxyFile" alt="" />
-                  </el-dialog> -->
-				  <FileUpload
+                  </el-dialog>
+				 <!-- <FileUpload
 				  v-model="providerForm.proxyFile"
 				  accept=".jpg, .jpeg, .png, .pdf"
-				  />
+				  /> -->
                 </div>
                 <p class="usa">*注意上传法人签署的授权委托书</p>
               </el-form-item>
@@ -457,16 +456,26 @@ export default {
     /* 供应商注册发送请求 */
     handleLogin(form) {
 		if(form==this.loginForm){
-			if(this.loginForm.password !== this.loginForm.surepsd){
+			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: "密码和确认密码不一致",
+				       message: "密码至少六位!",
 				});
-			}else if(this.loginForm.password.length<6){
+			}else if(this.loginForm.password !== this.loginForm.surepsd){
 				this.$message({
 				       type: "error",
-				       message: "密码至少六位!",
+				       message: "密码和确认密码不一致",
 				});
+			}else if(this.loginForm.mobile.length!==11){
+					this.$message({
+						type:'error',
+						message:'电话号码必须11位'
+					})
 			}else{
 				this.$request({
 				         url: "/api/Account/register",
@@ -485,7 +494,12 @@ export default {
 				       });
 			}
 		}else{
-			if(this.providerForm.password !== this.providerForm.surepsd){
+			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: "密码和确认密码不一致",
@@ -495,6 +509,11 @@ export default {
 				       type: "error",
 				       message: "密码至少六位!",
 				});
+			}else if(this.providerForm.contactsMobile.length!==11){
+				this.$message({
+					type:'error',
+					message:'电话号码必须11位'
+				})
 			}else{
 				this.$request({
 				         url: "/api/Supplier/register",
@@ -531,7 +550,7 @@ export default {
 };
 </script>
 
-<style lang="scss">
+<style lang="scss" >
 $bg: #f6f6f6;
 $light_gray: #bebdbb;
 $cursor: #bebdbb;

+ 58 - 20
src/views/sucuirtyaudit/detail.vue

xqd xqd xqd
@@ -2,39 +2,48 @@
 
 	<div>
 		<el-descriptions title="详情信息" :column="2" border style="margin: 20px;">
-
 			<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>
 		<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-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="3" border style="margin: 20px;">
+				  <!-- <el-descriptions-item  v-for="item in afterobj.columns" :label="getColumnName(item)">{{item.value}}</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 +58,9 @@
 				afterobj: {},
 				beforeobj:{},
 				tableData: {},
+				columnName:'',
+				hanhua:['供应商id','姓名','合同编号','发票附件','合同附件','贸易附件','状态','反馈','反馈截图','合同id','创建时间','更新时间','删除时间','删除状态'],
+				title:'',
 			}
 		},
 		mounted() {
@@ -58,15 +70,41 @@
 				method: 'get',
 			}).then((res) => {
 				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)
+				console.log(columnName)
+				this.columnName=this.getnewarr(columnName,this.hanhua)
+				console.log(this.columnName)
+				// 更新内容设置标题
+				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(item){
+			// 	for(let i in this.columnName){
+			// 		if(item.columnName==i){
+			// 			return i
+			// 		}
+			// 		return this.columnName[i]
+			// 	}
+			// 	return this.columnName[i]
+			// }
 		}
 	}
 </script>

+ 94 - 23
src/views/table/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -34,6 +34,8 @@
         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
         >
@@ -49,7 +51,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 +106,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">
@@ -374,25 +376,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({
@@ -402,6 +412,32 @@ export default {
         },
       });
     },
+	// 批量恢复
+	recovers(){
+		let ids=Array.from(this.multipleSelection,({id})=>id)
+		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.getAllList();
+		  } else {
+		    this.$message({
+		      type: "danger",
+		      message: "恢复失败",
+		    });
+		    this.getAllList();
+		  }
+		});
+	},
     recover(id) {
       this.$request({
         url: "/api/Acceptor/manager",
@@ -426,6 +462,32 @@ export default {
         }
       });
     },
+	// 批量删除
+	deleteStatuses(){
+		let ids=Array.from(this.multipleSelection,({id})=>id)
+		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.getAllList();
+		  } else {
+		    this.$message({
+		      type: "danger",
+		      message: "删除失败",
+		    });
+		    this.getAllList();
+		  }
+		});
+	},
     deleteStatus(id) {
       this.$request({
         url: "/api/Acceptor/manager",
@@ -472,7 +534,12 @@ export default {
 			  type:'error',
 			  message:'数据没有改变!'
 		  })
-	  }else{
+	  }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",
@@ -543,12 +610,16 @@ export default {
 
     /* 批量导出数据 */
     handleSelectionChange(data) {
+	  this.multipleSelection=data
+	  console.log(this.multipleSelection)
       this.exportExcelData1.push(data);
       this.exportExcelData2 = [
         ...new Set(this.exportExcelData1.flat(Infinity)),
       ];
     },
     handleAll(data) {
+	  this.multipleSelection=data
+	  console.log(this.multipleSelection)
       this.exportExcelData1.push(data);
     },
     /* 导出 */