增加lodash库 使用防抖函数 防止导入等操作重复提交

This commit is contained in:
BianLzhaoMin 2025-02-19 18:41:00 +08:00
parent ff99fea893
commit 6d47a2e616
8 changed files with 1151 additions and 874 deletions

View File

@ -57,6 +57,7 @@
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"lodash": "^4.17.21",
"nprogress": "0.2.0",
"pinyin": "^4.0.0-alpha.2",
"qrcode": "^1.5.3",

View File

@ -208,19 +208,24 @@ export default {
//
styleByType() {
return (item, index) => {
if (this.items[index].status == '审核通过') return 'highlight'
if (this.items[index].status == '审核驳回') return 'rejectHighlight'
if (item.isActive != 1) return 'normal'
if (item.isActive == 1) return 'currentLight'
// if (this.items[index].status == '') return 'highlight'
// if (this.items[index].status == '') return 'rejectHighlight'
// if (item.isActive != 1) return 'normal'
// if (item.isActive == 1) return 'currentLight'
if (item.auditStatus == 1 || item.auditStatus == 3) return 'highlight'
if (item.auditStatus == 2) return 'rejectHighlight'
if (item.auditStatus == null) return 'normal'
if (item.auditStatus == 4) return 'currentLight'
}
},
//
iconByType() {
return (item, index) => {
if (this.items[index].status == '审核通过') return '√'
if (this.items[index].status == '审核驳回') return 'X'
if (this.items[index].status == '撤回' || (this.items[index].status == '' && item.isActive != 1)) return ''
if (this.items[index].status == '' && item.isActive == 1) return '?'
if (item.auditStatus == 1 || item.auditStatus == 3) return '√'
if (item.auditStatus == 2) return 'X'
if (item.auditStatus == null) return ''
if (item.auditStatus == 4) return '?'
}
},
},

View File

@ -5,7 +5,8 @@
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable v-no-whitespace
clearable
v-no-whitespace
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -18,7 +19,8 @@
<el-input
v-model="queryParams.createUserName"
placeholder="请输入创建人"
clearable v-no-whitespace
clearable
v-no-whitespace
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -207,9 +209,20 @@
</div>
</div>
<div class="step2" style="margin-bottom: 30px;">
<div v-if="active === 2"
style="height: 620px;overflow-x: auto;overflow-y: auto;display: flex;flex-direction: column;padding: 20px;margin-left: 7%;margin-top: 20px;margin-right: 7%;"
<div class="step2" style="margin-bottom: 30px">
<div
v-if="active === 2"
style="
height: 620px;
overflow-x: auto;
overflow-y: auto;
display: flex;
flex-direction: column;
padding: 20px;
margin-left: 7%;
margin-top: 20px;
margin-right: 7%;
"
>
<div
v-if="errorLine.length > 0 || errorCorrectAnswers.length > 0"
@ -308,9 +321,7 @@
关闭
</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
@ -322,6 +333,7 @@ import { downloadFile, getTemplateLink } from '@/api/tool/select'
import { importPersonData, importQuestionData } from '@/api/importData/importData'
import XLSX from '@/utils/xlsx.full.min'
import { StrUtil } from '@/utils/StrUtil'
import debounce from 'lodash/debounce'
export default {
components: { NewTestItem },
@ -357,7 +369,7 @@ export default {
],
//
tableData: [],
loading:false,
loading: false,
//
dialogTitle: '新建题库',
//
@ -476,7 +488,8 @@ export default {
console.log('下载模板', this.templateLink)
downloadFile(this.templateLink, '题目文件.xlsx')
},
importExcel() {
importExcel: debounce(function () {
this.loading = true
let data = []
for (let i = 1; i < this.uploadData.length; i++) {
@ -504,7 +517,8 @@ export default {
}
}
})
},
}, 500),
beforePersonUpload(file) {
const isExcel = /\.(xlsx|xls)$/.test(file.name)
if (!isExcel) {
@ -532,7 +546,7 @@ export default {
} else {
const reader = new FileReader()
reader.onload = (e) => {
reader.onload = e => {
this.loading = true
if (e.target && e.target.result) {
try {
@ -625,7 +639,7 @@ export default {
}
this.loading = false
}
reader.onerror = (error) => {
reader.onerror = error => {
this.loading = false
console.error('文件读取错误:', error)
}
@ -649,7 +663,7 @@ export default {
getTemplateLink() {
const params = {
dictType: 'sys_template_link',
dictValue: '3'
dictValue: '3',
}
getTemplateLink(params).then(response => {
this.templateLink = response.msg

View File

@ -41,22 +41,22 @@
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:100%;">
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px">记住密码</el-checkbox>
<el-form-item style="width: 100%">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right;" v-if="register">
<div style="float: right" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
@ -69,42 +69,48 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt'
export default {
name: "Login",
name: 'Login',
data() {
return {
codeUrl: "",
codeUrl: '',
loginForm: {
username: "",
password: "",
username: '',
password: '',
rememberMe: false,
code: "",
uuid: ""
code: '',
uuid: '',
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" },
{ validator: (rule, value, callback) => {
{ required: true, trigger: 'blur', message: '请输入您的账号' },
{
validator: (rule, value, callback) => {
if (/\s/.test(value)) {
callback(new Error("账号中不允许包含空格"));
callback(new Error('账号中不允许包含空格'))
} else {
callback();
callback()
}
}, trigger: "blur" }
},
trigger: 'blur',
},
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" },
{ validator: (rule, value, callback) => {
{ required: true, trigger: 'blur', message: '请输入您的密码' },
{
validator: (rule, value, callback) => {
if (/\s/.test(value)) {
callback(new Error("密码中不允许包含空格"));
callback(new Error('密码中不允许包含空格'))
} else {
callback();
callback()
}
}, trigger: "blur" }
},
trigger: 'blur',
},
],
// code: [{ required: true, trigger: "change", message: "" },
// { validator: (rule, value, callback) => {
@ -120,67 +126,70 @@ export default {
captchaEnabled: true,
//
register: false,
redirect: undefined
};
redirect: undefined,
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect;
handler: function (route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
immediate: true,
},
},
created() {
this.getCode();
this.getCookie();
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid
}
});
})
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const username = Cookies.get('username')
const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
});
this.$store
.dispatch('Login', this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || '/' }).catch(() => {})
})
.catch(() => {
this.loading = false
if (this.captchaEnabled) {
this.getCode()
}
})
}
});
}
}
};
})
},
},
}
</script>
<style rel="stylesheet/scss" lang="scss">
@ -189,7 +198,7 @@ export default {
justify-content: center;
align-items: center;
height: 100%;
background-image: url("../assets/images/login-background.jpg");
background-image: url('../assets/images/login-background.jpg');
background-size: cover;
}
.title {

View File

@ -14,12 +14,7 @@
</el-form-item>
<el-form-item label="审批状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择审批状态" clearable>
<el-option
v-for="dict in statusDict"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-option v-for="dict in statusDict" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
@ -37,13 +32,13 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:addPersonnel:query']"
>新增
>
新增
</el-button>
<el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handlePersonImport">
基础数据上传
</el-button>
<el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handleFileImport">文件上传
</el-button>
<el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handleFileImport">文件上传</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -62,22 +57,22 @@
<el-table-column label="特殊工种种类" width="150" align="center" prop="workType" />
<el-table-column label="体检文件" width="100" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="handleShow(scope.row,1)">查看</el-button>
<el-button size="mini" @click="handleShow(scope.row, 1)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="保险文件" width="100" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="handleShow(scope.row,2)">查看</el-button>
<el-button size="mini" @click="handleShow(scope.row, 2)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="特殊工种文件" width="100" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="handleShow(scope.row,3)">查看</el-button>
<el-button size="mini" @click="handleShow(scope.row, 3)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="其他文件" width="100" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="handleShow(scope.row,4)">查看</el-button>
<el-button size="mini" @click="handleShow(scope.row, 4)">查看</el-button>
</template>
</el-table-column>
@ -104,9 +99,17 @@
<el-table-column label="人脸照片" align="center" prop="faceUrl">
<template slot-scope="scope">
<el-popover placement="right" title="" trigger="hover">
<img :src="`${scope.row.facePath ? lookFaceFile+scope.row.facePath : ''}`" :min-width="300" :height="300" alt="照片" />
<img slot="reference" :src="`${scope.row.facePath ? lookFaceFile+scope.row.facePath : ''}`" style="max-height: 50px; max-width: 50px"
:alt="`${scope.row.facePath ? lookFaceFile+scope.row.facePath : ''}`"
<img
:src="`${scope.row.facePath ? lookFaceFile + scope.row.facePath : ''}`"
:min-width="300"
:height="300"
alt="照片"
/>
<img
slot="reference"
:src="`${scope.row.facePath ? lookFaceFile + scope.row.facePath : ''}`"
style="max-height: 50px; max-width: 50px"
:alt="`${scope.row.facePath ? lookFaceFile + scope.row.facePath : ''}`"
/>
</el-popover>
</template>
@ -114,55 +117,63 @@
<el-table-column label="审批状态" align="center" prop="intoStatus">
<template slot-scope="scope">
<!-- 检查是否存在身份证号 -->
<span v-if="scope.row.intoStatus">{{ updateStatus(scope.row.intoStatus)
}}</span>
<span v-if="scope.row.intoStatus">{{ updateStatus(scope.row.intoStatus) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.intoStatus == '0'"
size="mini"
type="text"
@click="handleSubmit(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>提交审核
<el-button
v-if="scope.row.intoStatus == '0'"
size="mini"
type="text"
@click="handleSubmit(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>
提交审核
</el-button>
<el-button v-if="scope.row.intoStatus == '3' || scope.row.intoStatus == '2'"
size="mini"
type="text"
@click="handleView(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>查看
<el-button
v-if="scope.row.intoStatus == '3' || scope.row.intoStatus == '2'"
size="mini"
type="text"
@click="handleView(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>
查看
</el-button>
<el-button v-if="scope.row.intoStatus == '0' ||scope.row.intoStatus == '4' || scope.row.intoStatus == '5'"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>编辑
<el-button
v-if="scope.row.intoStatus == '0' || scope.row.intoStatus == '4' || scope.row.intoStatus == '5'"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>
编辑
</el-button>
<el-button v-if="scope.row.intoStatus == '1'"
size="mini"
type="text"
@click="retractApproval(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>撤回
<el-button
v-if="scope.row.intoStatus == '1'"
size="mini"
type="text"
@click="retractApproval(scope.row)"
v-hasPermi="['system:addPersonnel:query']"
>
撤回
</el-button>
<el-button
size="mini"
type="text"
@click="auditRecord(scope.row)"
:style="{color: '#f59a24'}"
:style="{ color: '#f59a24' }"
v-hasPermi="['system:audit:query']"
>审核记录
>
审核记录
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -171,79 +182,87 @@
<el-dialog :title="upload.title" :visible.sync="upload.open" width="25%">
<el-form label-width="80px" label-position="left" :model="formFile" ref="form" :rules="ruleFile">
<el-form-item label="文件上传" prop="fileList">
<el-upload ref="upload" :limit="1" accept=".zip"
:show-file-list="true"
class="upload-demo"
action="#"
:file-list="formFile.fileList"
:on-change="fileChange"
:on-remove="handleRemove"
:before-upload="beforeUpload"
:auto-upload="false" drag
<el-upload
ref="upload"
:limit="1"
accept=".zip"
:show-file-list="true"
class="upload-demo"
action="#"
:file-list="formFile.fileList"
:on-change="fileChange"
:on-remove="handleRemove"
:before-upload="beforeUpload"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
<div
class="el-upload__tip"
slot="tip"
>
</div>
<div
class="el-upload__tip"
style="color:red"
slot="tip"
>提示仅允许导入zip格式文件
</div>
<div class="el-upload__tip" slot="tip"></div>
<div class="el-upload__tip" style="color: red" slot="tip">提示仅允许导入zip格式文件</div>
</el-upload>
</el-form-item>
</el-form>
<div
slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="submitFileForm"
v-preventReClick="5000"
>
</el-button>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm" v-preventReClick="5000"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<el-dialog :title="`人员基础数据导入`" :visible.sync="personBasicOpen" width="60%" style="height: 1000px">
<div style="padding: 15px;width: 100%;height: 750px">
<div style="padding: 15px; width: 100%; height: 750px">
<el-steps :active="active" :finish-status="statusUpload" align-center>
<el-step title="选择文件"></el-step>
<el-step title="数据预览"></el-step>
<el-step title="异常数据"></el-step>
<el-step title="导入完成"></el-step>
</el-steps>
<div class="step1" style="margin-bottom: 30px;">
<div class="step1" style="margin-bottom: 30px">
<div
style="display: flex;flex-direction: column;padding: 20px;margin-left: 7%;margin-top: 20px;border: 1px solid #ababab;border-radius: 5px;margin-right: 7%;"
style="
display: flex;
flex-direction: column;
padding: 20px;
margin-left: 7%;
margin-top: 20px;
border: 1px solid #ababab;
border-radius: 5px;
margin-right: 7%;
"
v-if="active === 1"
>
<span style="font-size: 18px;font-weight: bold">模板下载</span>
<span style="font-size: 16px;margin-top: 10px;"
>请按照数据模板的格式准备导入数据模板中的表头名称不可更改表头行不能删除</span>
<el-button type="text" style="float:left;margin-top: 10px;width: 60px;" @click="downloadTemplate">下载模板
<span style="font-size: 18px; font-weight: bold">模板下载</span>
<span style="font-size: 16px; margin-top: 10px">
请按照数据模板的格式准备导入数据模板中的表头名称不可更改表头行不能删除
</span>
<el-button type="text" style="float: left; margin-top: 10px; width: 60px" @click="downloadTemplate">
下载模板
</el-button>
<!-- <span style="font-size: 16px;color: #8a8a8a;margin-top: 10px;cursor: pointer" @click="downloadTemplate"-->
<!-- >下载模板</span>-->
</div>
<div
style="display: flex;flex-direction: column;padding: 20px;margin-left: 7%;margin-top: 20px;border: 1px solid #ababab;border-radius: 5px;margin-right: 7%;"
style="
display: flex;
flex-direction: column;
padding: 20px;
margin-left: 7%;
margin-top: 20px;
border: 1px solid #ababab;
border-radius: 5px;
margin-right: 7%;
"
v-if="active === 1"
>
<span style="font-size: 18px;font-weight: bold">上传文件</span>
<span style="font-size: 16px;margin-top: 10px;"
>文件后缀名必须为xls或xlsx(即Excel格式),文件大小不得大于10Mb,最多支持1000行数据</span>
<input type="file" id="excel-file" style="display: none;">
<el-form ref="form" :model="formPerson" style="margin-top: 10px;" :rules="rulesPerson">
<span style="font-size: 18px; font-weight: bold">上传文件</span>
<span style="font-size: 16px; margin-top: 10px">
文件后缀名必须为xls或xlsx(即Excel格式),文件大小不得大于10Mb,最多支持1000行数据
</span>
<input type="file" id="excel-file" style="display: none" />
<el-form ref="form" :model="formPerson" style="margin-top: 10px" :rules="rulesPerson">
<el-form-item prop="fileList">
<el-upload
multiple
@ -261,42 +280,55 @@
ref="upload"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
<div class="el-upload__text">只能上传 xls/xlsx 文件且不超过10MB</div>
</el-upload>
</el-form-item>
</el-form>
<div style="display: flex;flex-direction: column;">
<div style="margin-top: 10px;font-weight: 600;font-size: 16px;">特别提示</div>
<div style="margin-top: 10px;font-weight: 400;font-size: 12px;">1. 人员手机号唯一不可重复</div>
<div style="margin-top: 10px;font-weight: 400;font-size: 12px;">2.
导入过程中如发现相同手机号数据则停止导入
<div style="display: flex; flex-direction: column">
<div style="margin-top: 10px; font-weight: 600; font-size: 16px">特别提示</div>
<div style="margin-top: 10px; font-weight: 400; font-size: 12px">1. 人员手机号唯一不可重复</div>
<div style="margin-top: 10px; font-weight: 400; font-size: 12px">
2. 导入过程中如发现相同手机号数据则停止导入
</div>
</div>
</div>
</div>
<div class="step2" style="margin-bottom: 30px;">
<div v-if="active === 2"
style="height: 680px;overflow-x: auto;overflow-y: auto;display: flex;flex-direction: column;padding: 20px;margin-left: 7%;margin-top: 20px;margin-right: 7%;"
<div class="step2" style="margin-bottom: 30px">
<div
v-if="active === 2"
style="
height: 680px;
overflow-x: auto;
overflow-y: auto;
display: flex;
flex-direction: column;
padding: 20px;
margin-left: 7%;
margin-top: 20px;
margin-right: 7%;
"
>
<div v-if="errorLine.length > 0 || errorPhone.length > 0"
style="background: #ebebeb;padding: 10px;"
>
<div style="font-size: 16px;font-weight: 600;margin-bottom: 10px;color: red;">异常数据</div>
<div v-if="errorLine.length > 0" style="width: 100%;">行数{{ errorLine.join(',') }}
<div v-if="errorLine.length > 0 || errorPhone.length > 0" style="background: #ebebeb; padding: 10px">
<div style="font-size: 16px; font-weight: 600; margin-bottom: 10px; color: red">异常数据</div>
<div v-if="errorLine.length > 0" style="width: 100%">
行数{{ errorLine.join(',') }}
有空数据或者错误数据
</div>
<div v-if="errorPhone.length > 0" style="width: 100%">
表格中手机号存在重复请先删除重复的数据项
</div>
<div v-if="errorPhone.length > 0"
style="margin-top: 10px;font-weight: 400;font-size: 16px;width: 100%;"
>重复的手机号:{{ errorPhone }}
<div v-if="errorPhone.length > 0" style="width: 100%">表格中手机号存在重复请先删除重复的数据项</div>
<div
v-if="errorPhone.length > 0"
style="margin-top: 10px; font-weight: 400; font-size: 16px; width: 100%"
>
重复的手机号:{{ errorPhone }}
</div>
</div>
<!-- 这里展示excel数据的表格 -->
<el-table :data="excelData" style="width: 100%;height: 700px;overflow-x: auto;overflow-y: auto">
<el-table :data="excelData" style="width: 100%; height: 700px; overflow-x: auto; overflow-y: auto">
<!-- 表格列定义 -->
<el-table-column prop="arg0" width="55" align="center" />
<el-table-column prop="arg1" width="120" align="center" />
@ -314,27 +346,45 @@
</div>
</div>
<div class="step3" style="margin-bottom: 30px;">
<div class="step3" style="margin-bottom: 30px">
<div v-if="active === 3">
<div
style="display: flex;flex-direction: column;padding: 20px;margin-left: 7%;margin-top: 20px;margin-right: 7%;margin-bottom: 30px;"
style="
display: flex;
flex-direction: column;
padding: 20px;
margin-left: 7%;
margin-top: 20px;
margin-right: 7%;
margin-bottom: 30px;
"
>
<span style="font-size: 16px;margin-top: 10px;"
>以下是已经在库的手机号人员已经录入请先根据手机号删除相应行内容然后再进行导入</span>
<span style="margin-top: 10px;width: 100%"
>{{ errorCode.substring(1, errorCode.length - 1) }}</span>
<span style="font-size: 16px; margin-top: 10px">
以下是已经在库的手机号人员已经录入请先根据手机号删除相应行内容然后再进行导入
</span>
<span style="margin-top: 10px; width: 100%">{{ errorCode.substring(1, errorCode.length - 1) }}</span>
</div>
</div>
</div>
<div class="step4" style="margin-bottom: 30px;">
<div class="step4" style="margin-bottom: 30px">
<div v-if="active === 4">
<div
style="display: flex;flex-direction: column;padding: 20px;margin-left: 7%;margin-top: 100px;margin-right: 7%;align-items: center;justify-content: center"
style="
display: flex;
flex-direction: column;
padding: 20px;
margin-left: 7%;
margin-top: 100px;
margin-right: 7%;
align-items: center;
justify-content: center;
"
>
<img src="@/assets/file/import_success_blue.png" alt="导入成功">
<span style="margin-top: 20px;font-size: 18px"
>数据导入成功请在列表中查看提交审核之前请先上传相关人员的文件</span>
<img src="@/assets/file/import_success_blue.png" alt="导入成功" />
<span style="margin-top: 20px; font-size: 18px">
数据导入成功请在列表中查看提交审核之前请先上传相关人员的文件
</span>
</div>
</div>
</div>
@ -342,34 +392,34 @@
已导入{{ importedCount }} / 1000
<el-progress :percentage="importProgress"></el-progress>
</div>
<div class="el-footer" style="position: absolute;top: 90%;left: 76%;margin-top: 10px;">
<el-button type="primary" style="margin-top: 12px;" @click="before"
v-if="active === 2 || active === 3"
>上一步
<div class="el-footer" style="position: absolute; top: 90%; left: 76%; margin-top: 10px">
<el-button type="primary" style="margin-top: 12px" @click="before" v-if="active === 2 || active === 3">
上一步
</el-button>
<el-button type="primary" style="margin-top: 12px;" @click="next"
v-if="active === 0 || active === 1"
>下一步
<el-button type="primary" style="margin-top: 12px" @click="next" v-if="active === 0 || active === 1">
下一步
</el-button>
<el-button type="primary" style="margin-top: 12px;" @click="importExcel"
v-if="active === 2 && errorLine.length === 0 && errorPhone.length === 0 "
>导入
<el-button
type="primary"
style="margin-top: 12px"
@click="importExcel"
v-if="active === 2 && errorLine.length === 0 && errorPhone.length === 0"
>
导入
</el-button>
<el-button type="primary" plain style="margin-top: 12px;margin-bottom: 10px;" @click="personClose">
<el-button type="primary" plain style="margin-top: 12px; margin-bottom: 10px" @click="personClose">
关闭
</el-button>
</div>
</div>
</el-dialog>
<el-dialog title="文件查看" :visible.sync="document" width="80%" top="5vh" append-to-body>
<div style="width: 100%;height:720px">
<div style="width: 100%; height: 720px">
<bns-file-list-tabs :items="fileList" />
</div>
</el-dialog>
<el-dialog title="文件查看" :visible.sync="documentPreview" width="80%" top="5vh" append-to-body>
<div style="width: 100%;height:720px">
<div style="width: 100%; height: 720px">
<bns-kkFile-preview :items="filePreview"></bns-kkFile-preview>
</div>
</el-dialog>
@ -378,13 +428,8 @@
<script>
import { getParams, hideSensitiveInfo, indexContinuous, lookFaceFile } from '@/utils/bonus'
import {
dictTableOption, downloadFile, getTemplateLink, selectFile
} from '@/api/tool/select'
import {
listAdmissionRequest,
submitApproval
} from '@/api/pro/admissionRequest'
import { dictTableOption, downloadFile, getTemplateLink, selectFile } from '@/api/tool/select'
import { listAdmissionRequest, submitApproval } from '@/api/pro/admissionRequest'
import store from '../../../store'
import { delDeviceInformation, retractApproval } from '@/api/terminalEquipment/deviceInformation'
@ -394,6 +439,7 @@ import { StrUtil } from '@/utils/StrUtil'
import * as XLSX from 'xlsx'
import BnsFileListTabs from '@/components/pro-tabs/bns-file-list-tabs.vue'
import bnsKkFilePreview from '@/components/pro-tabs/bns-kkFile-preview.vue'
import debounce from 'lodash/debounce'
export default {
name: 'Post',
@ -423,13 +469,13 @@ export default {
title: '',
//
open: false,
document:false,
document: false,
documentPreview: false,
fileList: [],
filePreview: {
filePreviewUrl: '',
fileName: '',
showDownloadButton: false
showDownloadButton: false,
},
//
deviceOptions: [],
@ -453,17 +499,17 @@ export default {
subUuid: this.$store.state.user.thisIds.subUuid,
userType: this.$store.state.user.thisIds.userType,
consName: undefined,
status: undefined
status: undefined,
},
//
form: {},
statusDict: [],
auditStatusDict: {
'1': '待审批',
'2': '审批中',
'3': '已通过',
'4': '已驳回',
'5': '已撤销'
1: '待审批',
2: '审批中',
3: '已通过',
4: '已驳回',
5: '已撤销',
},
lookFaceFile: '',
active: 1,
@ -478,29 +524,25 @@ export default {
formPerson: {
fileList: [],
proId: undefined,
uploadType: undefined
uploadType: undefined,
},
rulesPerson: {
fileList: [
{ required: true, message: '请先选择需要导入的excel文件', trigger: 'blur' }
]
fileList: [{ required: true, message: '请先选择需要导入的excel文件', trigger: 'blur' }],
},
personBasicOpen: false,
upload: {
//
open: false,
//
title: '上传压缩文件'
title: '上传压缩文件',
},
formFile: {
fileList: []
fileList: [],
},
ruleFile: {
fileList: [
{ required: true, message: '请上传文件', trigger: 'blur' }
]
fileList: [{ required: true, message: '请上传文件', trigger: 'blur' }],
},
templateLink:'',
templateLink: '',
}
},
created() {
@ -517,37 +559,39 @@ export default {
return store
},
/** 文件查看按钮操作 */
handleShow(row,informationType) {
handleShow(row, informationType) {
this.loading = true
const arr = {
1: '体检文件',
2: '保险文件',
3: '特殊工种文件',
4: '其他文件'
4: '其他文件',
}
selectFile({classification:9, uuid: row.uuid,informationType: informationType,fromType:2 }).then(response => {
console.log(response)
if (response.data.length === 0){
this.fileList = []
this.$message.warning(arr[informationType] + '暂无')
}else if(response.data.length === 1) {
this.filePreview = {
filePreviewUrl: response.data[0].filePath,
fileName: response.data[0].fileName,
showDownloadButton: false
selectFile({ classification: 9, uuid: row.uuid, informationType: informationType, fromType: 2 }).then(
response => {
console.log(response)
if (response.data.length === 0) {
this.fileList = []
this.$message.warning(arr[informationType] + '暂无')
} else if (response.data.length === 1) {
this.filePreview = {
filePreviewUrl: response.data[0].filePath,
fileName: response.data[0].fileName,
showDownloadButton: false,
}
this.documentPreview = true
} else {
this.fileList = response.data
this.document = true
}
this.documentPreview = true
}else{
this.fileList = response.data
this.document = true
this.loading = false
}
this.loading = false
})
)
},
getTemplateLink(){
getTemplateLink() {
const params = {
dictType: 'sys_template_link',
dictValue: '2'
dictValue: '2',
}
getTemplateLink(params).then(response => {
this.templateLink = response.msg
@ -573,7 +617,7 @@ export default {
getStatus() {
const params = {
dictType: 'sys_approval_state',
dictValue: ''
dictValue: '',
}
dictTableOption(params).then(response => {
this.statusDict = response.data
@ -598,37 +642,51 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/project/admission-request-auth/addPersonnel/' + encryptCBC(JSON.stringify({
type: 'add',
uuid: 0,
consUserId: 0
})))
this.$router.push(
'/project/admission-request-auth/addPersonnel/' +
encryptCBC(
JSON.stringify({
type: 'add',
uuid: 0,
consUserId: 0,
})
)
)
this.getList()
},
/** 查看按钮操作 */
handleView(row) {
const uuid = row.uuid
const consUserId = row.consUserId
console.log(uuid)
this.$router.push('/project/admission-request-auth/addPersonnel/' + encryptCBC(JSON.stringify({
type: 'view',
uuid: uuid,
consUserId: consUserId,
taskId: row.taskId
})))
this.$router.push(
'/project/admission-request-auth/addPersonnel/' +
encryptCBC(
JSON.stringify({
type: 'view',
uuid: uuid,
consUserId: consUserId,
taskId: row.taskId,
})
)
)
},
/** 修改按钮操作 */
handleUpdate(row) {
const uuid = row.uuid
const consUserId = row.consUserId
console.log(uuid)
this.$router.push('/project/admission-request-auth/addPersonnel/' + encryptCBC(JSON.stringify({
type: 'edit',
uuid: uuid,
consUserId: consUserId,
taskId: row.taskId
})))
this.$router.push(
'/project/admission-request-auth/addPersonnel/' +
encryptCBC(
JSON.stringify({
type: 'edit',
uuid: uuid,
consUserId: consUserId,
taskId: row.taskId,
})
)
)
},
/** 提交审批**/
handleSubmit(row) {
@ -643,33 +701,36 @@ export default {
...this.getParams(),
taskId: taskId,
taskType: this.$store.state.user.userType === '02' ? '5' : '10',
uuid: row.uuid
uuid: row.uuid,
}
console.log('param=' + JSON.stringify(param))
submitApproval(param).then(response => {
console.log('response=' + JSON.stringify(response))
if (response.code === 200) {
this.$message.success(response.msg)
this.getList()
} else {
this.$message.error(response.msg)
}
}).catch((error) => {
console.log('error=' + JSON.stringify(error))
})
submitApproval(param)
.then(response => {
console.log('response=' + JSON.stringify(response))
if (response.code === 200) {
this.$message.success(response.msg)
this.getList()
} else {
this.$message.error(response.msg)
}
})
.catch(error => {
console.log('error=' + JSON.stringify(error))
})
},
/** 删除按钮操作 */
handleDelete(row) {
const addressIds = row.deviceId || this.ids
this.$modal.confirm('是否确认删除工程编号为"' + addressIds + '"的数据项?').then(function() {
return delDeviceInformation(addressIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
this.$modal
.confirm('是否确认删除工程编号为"' + addressIds + '"的数据项?')
.then(function () {
return delDeviceInformation(addressIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
retractApproval(row) {
@ -678,28 +739,36 @@ export default {
taskId: taskId,
uuid: row.uuid,
procInstId: row.procInsId,
taskType: this.$store.state.user.userType === '02' ? '5' : '10'
taskType: this.$store.state.user.userType === '02' ? '5' : '10',
}
console.log('param=' + JSON.stringify(param))
this.$modal.confirm('是否撤回此人员审核申请?').then(function() {
return retractApproval(param)
}).then(() => {
this.getList()
this.$modal.msgSuccess('流程撤回成功!')
}).catch(() => {
})
this.$modal
.confirm('是否撤回此人员审核申请?')
.then(function () {
return retractApproval(param)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('流程撤回成功!')
})
.catch(() => {})
},
auditRecord(row) {
this.$router.push('/flow/auditRecord/' + encryptCBC(JSON.stringify({
taskId: row.taskId,
checkType: '2'
})))
this.$router.push(
'/flow/auditRecord/' +
encryptCBC(
JSON.stringify({
taskId: row.taskId,
checkType: '2',
})
)
)
},
/**
* 人员基础数据上传
*/
handlePersonImport() {
this.getTemplateLink();
this.getTemplateLink()
this.personBasicOpen = true
this.formPerson.fileList = []
},
@ -730,7 +799,8 @@ export default {
downloadTemplate() {
downloadFile(this.templateLink, '施工人员.zip')
},
importExcel() {
importExcel: debounce(function () {
this.loading = true
let data = []
for (let i = 1; i < this.excelData.length; i++) {
@ -743,7 +813,7 @@ export default {
supUuid: this.$store.state.user.thisIds.supUuid,
uuid: this.$store.state.user.thisIds.uuid,
userType: this.$store.state.user.userType,
importArgList: data
importArgList: data,
}
importPersonData(param).then(response => {
if (response.code === 200) {
@ -761,7 +831,8 @@ export default {
}
}
})
},
}, 500),
beforePersonUpload(file) {
const isExcel = /\.(xlsx|xls)$/.test(file.name)
if (!isExcel) {
@ -781,13 +852,14 @@ export default {
return false
}
//
if (file.size > 1024 * 1024 * 10) { // 10MB
if (file.size > 1024 * 1024 * 10) {
// 10MB
this.$message.warning('文件大小不能超过10MB')
fileList = fileList.filter(item => item.uid !== file.uid)
} else {
const reader = new FileReader()
reader.onload = (e) => {
reader.onload = e => {
if (e.target && e.target.result) {
try {
const data = new Uint8Array(e.target.result)
@ -812,9 +884,18 @@ export default {
this.errorLine = []
let uuid = StrUtil.generateSimpleUUID()
for (let i = 0; i < jsonData.length; i++) {
if (StrUtil.isBlank(jsonData[i][1]) || StrUtil.isBlank(jsonData[i][2]) || StrUtil.isBlank(jsonData[i][3]) || StrUtil.isBlank(jsonData[i][4])
|| StrUtil.isBlank(jsonData[i][5]) || StrUtil.isBlank(jsonData[i][6]) || StrUtil.isBlank(jsonData[i][7]) || StrUtil.isBlank(jsonData[i][8])
|| StrUtil.isBlank(jsonData[i][9]) || StrUtil.isBlank(jsonData[i][10])) {
if (
StrUtil.isBlank(jsonData[i][1]) ||
StrUtil.isBlank(jsonData[i][2]) ||
StrUtil.isBlank(jsonData[i][3]) ||
StrUtil.isBlank(jsonData[i][4]) ||
StrUtil.isBlank(jsonData[i][5]) ||
StrUtil.isBlank(jsonData[i][6]) ||
StrUtil.isBlank(jsonData[i][7]) ||
StrUtil.isBlank(jsonData[i][8]) ||
StrUtil.isBlank(jsonData[i][9]) ||
StrUtil.isBlank(jsonData[i][10])
) {
this.errorLine.push(jsonData[i][0])
} else {
if (jsonData[i][10] === '特殊工种' && StrUtil.isBlank(jsonData[i][11])) {
@ -835,8 +916,8 @@ export default {
arg10: jsonData[i][10],
arg11: jsonData[i][11],
uuid: uuid,
personType: jsonData[i][10] === '特殊工种' ? '1' : (jsonData[i][10] === '普通职工' ? '2' : '0'),
sex: jsonData[i][2] === '男' ? '0' : '1'
personType: jsonData[i][10] === '特殊工种' ? '1' : jsonData[i][10] === '普通职工' ? '2' : '0',
sex: jsonData[i][2] === '男' ? '0' : '1',
}
const isDuplicate = this.excelData.some(item => item.arg4 === rowData.arg4)
if (isDuplicate) {
@ -854,7 +935,7 @@ export default {
console.error('文件读取结果无效:', e.target)
}
}
reader.onerror = (error) => {
reader.onerror = error => {
console.error('文件读取错误:', error)
}
@ -868,8 +949,7 @@ export default {
// fileList
this.formPerson.fileList = fileList
}
,
},
//
handlePersonRemove(file) {
this.formPerson.fileList.splice(this.formPerson.fileList.indexOf(file), 1)
@ -905,7 +985,8 @@ export default {
/** 获取文件数据 */
fileChange(file, fileList) {
//
if (file.size > 1024 * 1024 * 200) { // 10MB
if (file.size > 1024 * 1024 * 200) {
// 10MB
this.$message.warning('文件大小不能超过200MB')
fileList = fileList.filter(item => item.uid !== file.uid)
}
@ -932,9 +1013,7 @@ export default {
reqData.append('uuid', this.$store.state.user.thisIds.uuid)
reqData.append('userType', this.$store.state.user.userType)
Promise.all([
this.getFileData(this.formFile.fileList)
]).then(([fileList]) => {
Promise.all([this.getFileData(this.formFile.fileList)]).then(([fileList]) => {
fileList.forEach(item => reqData.append('fileList', item))
importPersonZip(reqData).then(response => {
if (response.code === 200) {
@ -948,16 +1027,16 @@ export default {
if (response.result.split('&&').length === 1) {
content = '<span>' + response.result.split('&&')[0] + '</span>'
} else {
content = '<span>' + response.result.split('&&')[0] + '<br/>' + response.result.split('&&')[1] + '</span>'
content =
'<span>' + response.result.split('&&')[0] + '<br/>' + response.result.split('&&')[1] + '</span>'
}
this.$confirm(content, '文件导入提示', {
cancelButtonText: '关闭',
type: 'warning',
dangerouslyUseHTMLString: true
dangerouslyUseHTMLString: true,
}).catch(() => {
//
})
.catch(() => {
//
})
}
this.upload.open = false
this.getSubPersonList()
@ -969,8 +1048,7 @@ export default {
return false
}
})
}
}
},
},
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -659,7 +659,12 @@ import bnsFileListTabs from '@/components/pro-tabs/bns-file-list-tabs.vue'
import { addSupervisoryApply, addSupervisoryPersonApply } from '@/api/pro/supervisory'
import { dictTableOption, getTemplateLink, selectFile, downloadFile } from '@/api/tool/select'
import { listSupervisorPersonById, listSupervisor, listSupervisorPerson ,delPersonByIdCardAndPhone } from '@/api/pro/outsourcingPro'
import {
listSupervisorPersonById,
listSupervisor,
listSupervisorPerson,
delPersonByIdCardAndPhone,
} from '@/api/pro/outsourcingPro'
import numberUtils from '@/utils/validate'
import bnsKkFilePreview from '@/components/pro-tabs/bns-kkFile-preview.vue'
@ -669,6 +674,7 @@ import { importPersonZip, importPersonData } from '@/api/importData/importData'
import XLSX from '@/utils/xlsx.full.min'
import { StrUtil } from '@/utils/StrUtil'
import { approvalHistory } from '@/api/terminalEquipment/deviceInformation'
import debounce from 'lodash/debounce'
export default {
components: {
@ -1019,11 +1025,11 @@ export default {
this.getFileData(this.formData.implementationRulesFiles),
]).then(
([
enterpriseQualificationFiles,
securityAgreementFiles,
supervisionPlanningFiles,
implementationRulesFiles,
]) => {
enterpriseQualificationFiles,
securityAgreementFiles,
supervisionPlanningFiles,
implementationRulesFiles,
]) => {
if (!enterpriseQualificationFiles || enterpriseQualificationFiles.length === 0) {
reqData.append('enterpriseQualificationFiles', new Blob())
} else {
@ -1233,10 +1239,10 @@ export default {
}).then(() => {
const params = {
supUuid: row.supUuid,
proId: row.proId
proId: row.proId,
}
delPersonByIdCardAndPhone(params).then(response => {
if (response.code === 200){
if (response.code === 200) {
this.$modal.msgSuccess('删除成功')
this.getSupervisorPersonList()
}
@ -1300,7 +1306,7 @@ export default {
downloadTemplate() {
downloadFile(this.templateLink, '监理人员模板.zip')
},
importExcel() {
importExcel: debounce(function () {
this.loading = true
let data = []
for (let i = 1; i < this.excelData.length; i++) {
@ -1331,7 +1337,7 @@ export default {
}
}
})
},
}, 500),
beforePersonUpload(file) {
const isExcel = /\.(xlsx|xls)$/.test(file.name)
if (!isExcel) {
@ -1485,7 +1491,7 @@ export default {
this.formFile.fileList.splice(this.formFile.fileList.indexOf(file), 1)
this.$emit('input', this.listToString(this.formFile.fileList))
},
submitFileForm() {
submitFileForm: debounce(function () {
this.$refs['form'].validate(valid => {
if (valid) {
if (!this.formFile.fileList[0].name.toLowerCase().endsWith('.zip')) {
@ -1536,7 +1542,7 @@ export default {
return false
}
})
},
}, 500),
},
}
</script>

View File

@ -38,10 +38,10 @@ module.exports = {
// target: `http://localhost:18080`,
// target: 'http://192.168.0.176:18080',
// target: 'http://192.168.0.58:19090', // 杰
target: 'http://192.168.0.14:1999/nxdt-api', // 测试环境
// target: 'http://192.168.0.14:1999/nxdt-api', // 测试环境
// target: 'http://218.21.27.6:1999/prod-api', // 生产环境
// target: 'http://192.168.0.38:18080', // 郝志权
// target: 'http://192.168.2.125:18080', // 梁超
target: 'http://192.168.2.125:18080', // 梁超
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '',