|
@@ -0,0 +1,536 @@
|
|
|
+<template>
|
|
|
+ <div class="system-user">
|
|
|
+ <!-- 头部细节部分 -->
|
|
|
+ <div class="title">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <div class="top">
|
|
|
+ <el-input placeholder="经办人姓名" class="input-demo" v-model="operatorName"></el-input>
|
|
|
+ <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
|
|
|
+ <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <!-- 头部细节部分结束 -->
|
|
|
+ <!-- 表格部分 -->
|
|
|
+ <template>
|
|
|
+ <el-table
|
|
|
+ class="table"
|
|
|
+ v-loading="loading"
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="customerCompanytable"
|
|
|
+ :height="heightt"
|
|
|
+ border
|
|
|
+ tooltip-effect="dark">
|
|
|
+ <el-table-column
|
|
|
+ label="企业名称"
|
|
|
+ prop="companyName"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="经办人姓名"
|
|
|
+ prop="operatorName"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="经办人手机号"
|
|
|
+ prop="operatorMobile"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="经办人身份证"
|
|
|
+ prop="identificationId"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="经办人附件名称"
|
|
|
+ prop="contractFileName"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="证明附件名称"
|
|
|
+ prop="operatorEvidenceContractFileName"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="状态"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.status == 1" style="color:green">变更经办人成功</span>
|
|
|
+ <span v-else-if="scope.row.status == 2" style="color: red">待输入验证码</span>
|
|
|
+ <span v-else-if="scope.row.status == 3" style="color: blue">开票经办人上传成功</span>
|
|
|
+ <span v-else-if="scope.row.status == 4" style="color: cyan">证明附件上传成功</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="280">
|
|
|
+ <template slot-scope="scope" show-overflow-tooltip>
|
|
|
+ <el-link style="cursor:pointer;color: blue;" @click="sendCode(scope.row)">发送开票验证码</el-link>
|
|
|
+ <el-link style="cursor:pointer;color: blue;" @click="openChange(scope.row)">修改经办人</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="block">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="current"
|
|
|
+ :page-sizes="[6, 8, 10, 20, 50 ,100]"
|
|
|
+ :page-size="pagesize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 新增企业开票经办人 -->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="updateOperatorList"
|
|
|
+ style="font-size: 0px;">
|
|
|
+ <div class="tou">企业开票经办人--修改</div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <el-form
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
+ :model="formOperatorList">
|
|
|
+ <el-form-item label="经办人姓名" prop="operatorName">
|
|
|
+ <el-input v-model="formOperatorList.operatorName" auto-complete="off" placeholder="请输入经办人姓名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="经办人手机号" prop="operatorMobile">
|
|
|
+ <el-input v-model="formOperatorList.operatorMobile" auto-complete="off" placeholder="请输入经办人手机号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="经办人身份证" prop="identificationId">
|
|
|
+ <el-input v-model="formOperatorList.identificationId" auto-complete="off" placeholder="请输入经办人身份证"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="onclose" type="info">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="updateData('ruleForm')">修 改</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 验证码输入 -->
|
|
|
+ <el-dialog
|
|
|
+ @close="this.vilidateForm.validCode = ''"
|
|
|
+ :visible.sync="vlidateCodeClose"
|
|
|
+ style="font-size: 0px;">
|
|
|
+ <div class="tou">验证码输入</div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <el-form
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ :rules="rules1"
|
|
|
+ ref="ruleForm1"
|
|
|
+ :model="vilidateForm">
|
|
|
+ <el-form-item label="验证码" prop="validCode">
|
|
|
+ <el-input v-model="vilidateForm.validCode" auto-complete="off" placeholder="请输入验证码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="confirmUpdate('ruleForm1')">确 认</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 验证码输入 -->
|
|
|
+ <el-dialog
|
|
|
+ @close="this.carVilidateForm.validCode = ''"
|
|
|
+ :visible.sync="carVilidateCodeClose"
|
|
|
+ style="font-size: 0px;">
|
|
|
+ <div class="tou">验证码输入</div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <el-form
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ :rules="rules1"
|
|
|
+ ref="ruleForm2"
|
|
|
+ :model="carVilidateForm">
|
|
|
+ <el-form-item label="验证码" prop="validCode">
|
|
|
+ <el-input v-model="carVilidateForm.validCode" auto-complete="off" placeholder="请输入验证码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="confirmVilidate('ruleForm2')">确 认</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+import axios from 'axios'
|
|
|
+import FileSaver from 'file-saver'
|
|
|
+import XLSX from 'xlsx'
|
|
|
+export default{
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: true,
|
|
|
+ rules: {
|
|
|
+ operatorName: [
|
|
|
+ { required: true, message: `请输入经办人姓名`, trigger: `blur` },
|
|
|
+ { min: 2, max: 15, message: `长度在 2 到 15 个字符`, trigger: `blur` }
|
|
|
+ ],
|
|
|
+ operatorMobile: [
|
|
|
+ { required: true, message: `请输入经办人手机号`, trigger: `blur` },
|
|
|
+ { min: 11, max: 11, message: `长度在 11 个字符`, trigger: `blur` }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rules1: {
|
|
|
+ validCode: [
|
|
|
+ { required: true, message: `请输入验证码`, trigger: `blur` }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ companyNum: ``,
|
|
|
+ operatorName: ``,
|
|
|
+ custId: '',
|
|
|
+ hightt: `0px`,
|
|
|
+ formOperatorList: {
|
|
|
+ 'companyNum': ``,
|
|
|
+ 'operatorName': ``,
|
|
|
+ 'operatorMobile': ``,
|
|
|
+ 'identificationId': ``
|
|
|
+ },
|
|
|
+ vilidateForm: {
|
|
|
+ 'companyNum': '',
|
|
|
+ 'targetOperatorMobile': '',
|
|
|
+ 'validCode': ''
|
|
|
+ },
|
|
|
+ carVilidateForm: {
|
|
|
+ 'validCode': '',
|
|
|
+ 'buyerCode': ''
|
|
|
+ },
|
|
|
+ orgRow: {},
|
|
|
+ current: 1,
|
|
|
+ pagesize: 8,
|
|
|
+ // 总共有多少条数据
|
|
|
+ total: 0,
|
|
|
+ updateOperatorList: false,
|
|
|
+ vlidateCodeClose: false,
|
|
|
+ carVilidateCodeClose: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.heightt = tableHeight // eslint-disable-line
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ firstLoadData() {
|
|
|
+ this.current = 1
|
|
|
+ this.pagesize = 8
|
|
|
+ this.queryLook()
|
|
|
+ },
|
|
|
+ // 列表展示
|
|
|
+ async loadData() {
|
|
|
+ const formData = new FormData()
|
|
|
+ this.custId = sessionStorage.getItem(`userName`)
|
|
|
+ formData.append(`current`, this.current)
|
|
|
+ formData.append(`size`, this.pagesize)
|
|
|
+ formData.append(`custId`, this.custId)
|
|
|
+ const response = await this.$http.post(`customerCompany/page`, formData)
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ this.loading = false
|
|
|
+ this.customerCompanytable = response.data.data.records
|
|
|
+ this.total = response.data.data.total
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询
|
|
|
+ async queryLook() {
|
|
|
+ const formData = new FormData()
|
|
|
+ formData.append(`current`, this.current)
|
|
|
+ formData.append(`size`, this.pagesize)
|
|
|
+ formData.append(`custId`, this.custId)
|
|
|
+ formData.append(`operatorName`, this.operatorName)
|
|
|
+ const response = await this.$http.post(`customerCompany/page`, formData)
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ this.loading = false
|
|
|
+ this.customerCompanytable = response.data.data.records
|
|
|
+ this.total = response.data.data.total
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //确认修改
|
|
|
+ confirmUpdate(formName){
|
|
|
+ this.$refs[formName].validate(async(valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '修改中,请稍后...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ const response = await this.$http.post(`customerCompany/updateNoCarCompanyMangerConfirm`, this.vilidateForm)
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ loading.close();
|
|
|
+ this.vlidateCodeClose = false;
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '修改成功'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log(111)
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: `error`,
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(`请查看是否有选项未填写或填错项`)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 新增用户
|
|
|
+ updateData(formName) {
|
|
|
+ this.$refs[formName].validate(async(valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '修改中中,请稍后...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ const param = {
|
|
|
+ companyNum: this.formOperatorList['companyNum'],
|
|
|
+ sourceOperatorMobile: this.orgRow['operatorMobile'],
|
|
|
+ targetOperatorName: this.formOperatorList['operatorName'],
|
|
|
+ targetIdentificationId: this.formOperatorList['identificationId'],
|
|
|
+ targetOperatorMobile: this.formOperatorList['operatorMobile']
|
|
|
+ };
|
|
|
+ const response = await this.$http.post(`customerCompany/updateNoCarCompanyManger`, param)
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ loading.close();
|
|
|
+ this.updateOperatorList = false;
|
|
|
+ this.vilidateForm.companyNum = this.formOperatorList['companyNum']
|
|
|
+ this.vilidateForm.targetOperatorMobile = this.formOperatorList['operatorMobile']
|
|
|
+ this.vlidateCodeClose = true;
|
|
|
+ } else {
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: `error`,
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(`请查看是否有选项未填写或填错项`)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 开始变更
|
|
|
+ async openChange(recoder) {
|
|
|
+ this.updateOperatorList = true;
|
|
|
+ this.formOperatorList = this.clone(recoder);
|
|
|
+ this.orgRow = recoder;
|
|
|
+ },
|
|
|
+ async sendCode(recoder){
|
|
|
+ const sendParam = {
|
|
|
+ buyerCode: recoder['companyNum']
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '验证码发送中,请稍后...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ const response = await this.$http.post(`customerCompany/sendCode`, sendParam)
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ loading.close();
|
|
|
+ this.carVilidateCodeClose = true;
|
|
|
+ this.carVilidateForm['buyerCode'] = recoder['companyNum'];
|
|
|
+ } else {
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: `error`,
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmVilidate(formName){
|
|
|
+ this.$refs[formName].validate(async(valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '确认中,请稍后...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ const response = await this.$http.post(`customerCompany/confirmCode`, this.carVilidateForm)
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ loading.close();
|
|
|
+ this.carVilidateCodeClose = false;
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '发送成功'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log(111)
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: `error`,
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(`请查看是否有选项未填写或填错项`)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onclose(){
|
|
|
+ this.updateOperatorList = false;
|
|
|
+ this.handleEditDialogClose();
|
|
|
+ },
|
|
|
+ // 清空表单数据
|
|
|
+ handleEditDialogClose() {
|
|
|
+ for (var key in this.formOperatorList) {
|
|
|
+ this.formOperatorList[key] = ``
|
|
|
+ };
|
|
|
+ this.operatorEvidence = false;
|
|
|
+ this.current = 1
|
|
|
+ this.pagesize = 8
|
|
|
+ },
|
|
|
+ clone(obj) {
|
|
|
+ var o;
|
|
|
+ if (typeof obj == 'object') {
|
|
|
+ if (obj === null) {
|
|
|
+ o = null;
|
|
|
+ } else {
|
|
|
+ if (obj instanceof Array) {
|
|
|
+ o = [];
|
|
|
+ for (var i = 0, len = obj.length; i < len; i++) {
|
|
|
+ o.push(this.clone(obj[i]));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ o = {};
|
|
|
+ for (var j in obj) {
|
|
|
+ o[j] = this.clone(obj[j]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ o = obj;
|
|
|
+ }
|
|
|
+ return o;
|
|
|
+ },
|
|
|
+ // 分页方法
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pagesize = val
|
|
|
+ if (this.companyNum != `` || this.operatorName != ``) {
|
|
|
+ this.queryLook()
|
|
|
+ } else {
|
|
|
+ this.loadData()
|
|
|
+ };
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.current = val
|
|
|
+ if (this.companyNum != `` || this.operatorName != ``) {
|
|
|
+ this.queryLook()
|
|
|
+ } else {
|
|
|
+ this.loadData()
|
|
|
+ };
|
|
|
+ },
|
|
|
+ // 导出表格所用
|
|
|
+ async exportExcel() {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: `系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...`,
|
|
|
+ spinner: `el-icon-loading`,
|
|
|
+ background: `rgba(0, 0, 0, 0.7)`
|
|
|
+ })
|
|
|
+ let curr = this.current
|
|
|
+ let pagesize1 = this.pagesize
|
|
|
+ this.current = 1
|
|
|
+ this.pagesize = this.total
|
|
|
+ await this.loadData()
|
|
|
+ // 设置当前日期
|
|
|
+ let time = new Date()
|
|
|
+ let year = time.getFullYear()
|
|
|
+ let month = time.getMonth() + 1
|
|
|
+ let day = time.getDate()
|
|
|
+ let name = `企业经办人信息列表_` + year + `` + month + `` + day
|
|
|
+ /* generate workbook object from table */
|
|
|
+ // .table要导出的是哪一个表格
|
|
|
+ var wb = XLSX.utils.table_to_book(document.querySelector(`.table`), { raw: true })
|
|
|
+ /* get binary string as output */
|
|
|
+ var wbout = XLSX.write(wb, {
|
|
|
+ bookType: `xlsx`,
|
|
|
+ bookSST: true,
|
|
|
+ type: `array`
|
|
|
+ })
|
|
|
+ try {
|
|
|
+ // name+'.xlsx'表示导出的excel表格名字
|
|
|
+ FileSaver.saveAs(
|
|
|
+ new Blob([wbout], { type: `application/octet-stream` }),
|
|
|
+ name + `.xlsx`
|
|
|
+ )
|
|
|
+ } catch (e) {
|
|
|
+ }
|
|
|
+ this.current = curr
|
|
|
+ this.pagesize = pagesize1
|
|
|
+ this.loadData()
|
|
|
+ loading.close()
|
|
|
+ return wbout
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.system-user {
|
|
|
+ border: 1px solid #d9d9d9;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+.system-user .title {
|
|
|
+ font-size: 5px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+.system-user .top {
|
|
|
+ padding-top: 20px;
|
|
|
+ padding-left: 20px;
|
|
|
+}
|
|
|
+.system-user .text {
|
|
|
+ display: inline-block;
|
|
|
+ color: #000;
|
|
|
+ font-size: 16px ;
|
|
|
+ margin-left: 1%;
|
|
|
+}
|
|
|
+.system-user .input-demo {
|
|
|
+ display: inline-block;
|
|
|
+ width: 20%;
|
|
|
+ margin-left: 1%;
|
|
|
+}
|
|
|
+.system-user .block {
|
|
|
+ font-size: 5px;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 25px;
|
|
|
+ margin-bottom: 25px;
|
|
|
+}
|
|
|
+.system-user .el-dialog {
|
|
|
+ width: 60%;
|
|
|
+}
|
|
|
+.system-user .el-dialog__header, .el-dialog__body {
|
|
|
+ padding: 0 20px;
|
|
|
+}
|
|
|
+.system-user .tou {
|
|
|
+ font-size: 20px;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ padding-top: 15px;
|
|
|
+}
|
|
|
+.system-user .line {
|
|
|
+ margin-top: 15px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ width: 100%;
|
|
|
+ height: 2px;
|
|
|
+ background-color: #d9d9d9;
|
|
|
+}
|
|
|
+.system-user .xinxi {
|
|
|
+ text-align: center;
|
|
|
+ margin: 15px auto;
|
|
|
+ font-size: 18px;
|
|
|
+}
|
|
|
+</style>
|