证件领用申请
This commit is contained in:
parent
116daf6993
commit
b4f8232a14
|
|
@ -291,7 +291,7 @@ export function getCertificateExamListPageApi(data) {
|
|||
params:data
|
||||
})
|
||||
}
|
||||
// 证件领用申请删除
|
||||
// 证件领用审核-审核
|
||||
export function checkCertificateApplyApi(data) {
|
||||
return request({
|
||||
url: '/certificate/certificate_check/certificateCheck/check',
|
||||
|
|
|
|||
|
|
@ -43,14 +43,6 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增申请</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
size="mini"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
|
@ -75,23 +67,33 @@
|
|||
<el-table-column label="详细说明" align="center" width="120" prop="applyDetail" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计划出国时间" align="center" prop="startTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计划返回时间" align="center" prop="endTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="申请状态" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">
|
||||
<span v-if="scope.row.state==0" style="color: #FF7322;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==1" style="color: #FEE838;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==2" style="color: #03DF6D;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==3" style="color: #FEE838;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==4" style="color: #FF7322;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
</template> -->
|
||||
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>查看</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请状态" align="center" prop="applyState" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.applyState==-1" style="color: #FF7322;font-size: 15px;">待提交</span>
|
||||
<span v-if="scope.row.applyState==0" style="color: #FF7322;font-size: 15px;">待审核</span>
|
||||
<span v-if="scope.row.applyState==1" style="color: #FEE838;font-size: 15px;">审核中</span>
|
||||
<span v-if="scope.row.applyState==2" style="color: #03DF6D;font-size: 15px;">已审核</span>
|
||||
<span v-if="scope.row.applyState==3" style="color: #FEE838;font-size: 15px;">已退回</span>
|
||||
<span v-if="scope.row.applyState==4" style="color: #FF7322;font-size: 15px;">已执行</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.state==0||scope.row.state==4"
|
||||
size="mini"
|
||||
<el-button
|
||||
size="mini" v-if="scope.row.applyState==0||scope.row.applyState==1"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>审批</el-button>
|
||||
>审核</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -105,39 +107,35 @@
|
|||
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title+''" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="120px">
|
||||
<el-dialog :title="title+''" :visible.sync="open" width="900px" append-to-body>
|
||||
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="120px" style="height: 650px;overflow-y: auto;">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="baseForm.name" placeholder="请输入" maxlength="30" clearable/>
|
||||
<el-form-item label="申请人" prop="name">
|
||||
<el-input v-model="baseForm.name" placeholder="点击选择申请人" maxlength="30" readonly/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="baseForm.deptId !== 0">
|
||||
<el-form-item label="单位" prop="deptId" style="width: 100%;">
|
||||
<treeselect
|
||||
v-model="baseForm.deptId"
|
||||
:options="deptOptions"
|
||||
:normalizer="normalizer"
|
||||
placeholder="选择单位"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" prop="postId">
|
||||
<el-select
|
||||
v-model="baseForm.postId"
|
||||
style="width: 100%;"
|
||||
placeholder="请选择岗位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in postOptions"
|
||||
:key="item.postId+''"
|
||||
:label="item.postName"
|
||||
:value="item.postId+''"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="baseForm.phone" placeholder="请输入" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idNumber">
|
||||
<el-input v-model="baseForm.idNumber" placeholder="请输入" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="证件编号" prop="certificateNo">
|
||||
<el-input v-model="baseForm.certificateNo" :readonly="isReadOnly" placeholder="请输入" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="证件类型" prop="certificateType">
|
||||
<el-select v-model="baseForm.certificateType" placeholder="证件类型" clearable style="width: 100%;">
|
||||
|
|
@ -151,8 +149,8 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="领用原因" prop="requestReason">
|
||||
<el-select v-model="baseForm.requestReason" placeholder="请选择领用原因" clearable style="width: 100%;">
|
||||
<el-form-item label="领用原因" prop="applyReason">
|
||||
<el-select v-model="baseForm.applyReason" placeholder="请选择领用原因" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="dict in dict.type.issue_type"
|
||||
:key="dict.value"
|
||||
|
|
@ -163,20 +161,21 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细说明" prop="remark">
|
||||
<el-input v-model="baseForm.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
<el-form-item label="详细说明" prop="applyDetail">
|
||||
<el-input v-model="baseForm.applyDetail" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="预计使用时间">
|
||||
<el-form-item label="预计使用时间" prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
v-model="baseForm.dateRange"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd" style="width: 100%">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
|
@ -191,8 +190,11 @@
|
|||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:file-list="fileList"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
:on-remove="handleRemove"
|
||||
:on-preview="handlePreviewDownloadFile"
|
||||
:auto-upload="true"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
|
|
@ -200,10 +202,18 @@
|
|||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div style="font-size: 18px;font-weight: 600;margin-bottom: 4px;">注意事项</div>
|
||||
<div style="font-size: 16px;margin-bottom: 4px;">1.因公出国需提供单位出具的出差证明</div>
|
||||
<div style="font-size: 16px;margin-bottom: 4px;">2.因私出国需提供相关证明材料(如邀请函等)</div>
|
||||
<div style="font-size: 16px;margin-bottom: 4px;">3.证件领取后请妥善保管,如有遗失需立即报告</div>
|
||||
<div style="font-size: 16px;margin-bottom: 4px;">4.使用完毕后请及时归还证件</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="success" @click="submitForm(1)" v-if="!isView">同 意</el-button>
|
||||
<el-button type="danger" @click="submitForm(2)" v-if="!isView">拒 绝</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -211,10 +221,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listDept
|
||||
} from '@/api/system/dept'
|
||||
import { getCertificateExamListPageApi,addCertificateInfoApi,updateCertificateInfoApi,checkCertificateApplyApi } from "@/api/certificateManage/index";
|
||||
import { getUser } from '@/api/system/user'
|
||||
import { getCertificateExamListPageApi,checkCertificateApplyApi,getSysUserListApi,addCertificateCheckApi } from "@/api/certificateManage/index";
|
||||
import base64 from 'base-64';
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { downloadFileByUrl } from '@/utils/download'
|
||||
|
|
@ -261,114 +269,79 @@
|
|||
pageSize: 10,
|
||||
idNumber:null,//身份证号
|
||||
name:null,//姓名
|
||||
certificateNo:null,//证件编号
|
||||
},
|
||||
activeName:"baseSetting",
|
||||
deviceData:{},
|
||||
// 岗位选项
|
||||
postOptions: [],
|
||||
// 表单参数
|
||||
baseForm: {
|
||||
deptId:null,
|
||||
name:"",
|
||||
idNumber:"",
|
||||
birthday:"",
|
||||
birthAddr:"",
|
||||
certificateType:"",
|
||||
certificateTypeName:"",
|
||||
certificateNo:"",
|
||||
issueAddr:"",
|
||||
issueDay:"",
|
||||
createTime:"",
|
||||
userId:"",
|
||||
postId:"",
|
||||
phone:"",
|
||||
userId:"",
|
||||
isEle:""
|
||||
},
|
||||
baseForm2: {
|
||||
userId:"",
|
||||
phone:""
|
||||
certificateType:"",
|
||||
applyReason:"",
|
||||
applyDetail:"",
|
||||
startTime:"",
|
||||
startTime:"",
|
||||
endTime:"",
|
||||
dateRange:[]
|
||||
},
|
||||
isView:false,
|
||||
// 表单校验
|
||||
baseFormRules: {
|
||||
deptId: [
|
||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||
{ required: true, message: "申请人不能为空", trigger: "change" }
|
||||
],
|
||||
idNumber: [
|
||||
{ required: true, message: "身份证不能为空", trigger: "blur" },
|
||||
{ validator: this.validateIDCard, trigger: 'blur' }
|
||||
userId: [
|
||||
{ required: true, message: "申请人不能为空", trigger: "change" }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
|
||||
{ required: true, message: "手机号码不能为空", trigger: "change" },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'change' }
|
||||
],
|
||||
postId: [
|
||||
{ required: true, message: "岗位不能为空", trigger: "change" },
|
||||
],
|
||||
certificateType: [
|
||||
{ required: true, message: "证件类型不能为空", trigger: "blur" }
|
||||
{ required: true, message: "证件类型不能为空", trigger: "change" }
|
||||
],
|
||||
requestReason: [
|
||||
applyReason: [
|
||||
{ required: true, message: "领用原因不能为空", trigger: "change" }
|
||||
],
|
||||
certificateNo: [
|
||||
{ required: true, message: "证件编号不能为空", trigger: "blur" }
|
||||
applyDetail: [
|
||||
{ required: true, message: "详细说明不能为空", trigger: "blur" }
|
||||
],
|
||||
issueDay: [
|
||||
{ required: true, message: "签发日期不能为空", trigger: "blur" }
|
||||
dateRange: [
|
||||
{ required: true, message: "预计使用时间不能为空", trigger: "change" }
|
||||
],
|
||||
|
||||
},
|
||||
dateRange:[],
|
||||
logTableData:[],//异常弹窗
|
||||
// 总条数
|
||||
dialogTotal: 0,
|
||||
//当前菜谱
|
||||
openMenu:false,
|
||||
//导入参数
|
||||
//导入参数
|
||||
upload: {
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/certificate/certificate_manage/certificateInfo/import',
|
||||
},
|
||||
//远程校验弹窗
|
||||
openTask: false,
|
||||
// 表单参数
|
||||
taskForm: {
|
||||
processDate:""
|
||||
},
|
||||
// 表单校验
|
||||
taskRules: {
|
||||
processDate: [
|
||||
{
|
||||
required: true,
|
||||
message: '核验截止日期不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
url: process.env.VUE_APP_BASE_API + '/file/upload?type=face',
|
||||
},
|
||||
fileList:[],
|
||||
fileUrls:[],
|
||||
fileNames:[]
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
this.getList();
|
||||
this.getPostList();
|
||||
this.getList();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
validateIDCard(rule, value, callback) {
|
||||
// 15位身份证正则表达式
|
||||
const reg15 = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/;
|
||||
// 18位身份证正则表达式
|
||||
const reg18 = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|X|x)$/;
|
||||
if (reg15.test(value) || reg18.test(value)) {
|
||||
callback(); // 验证通过,无错误信息提示
|
||||
} else {
|
||||
callback(new Error('请输入有效的身份证号')); // 验证失败,显示错误信息提示
|
||||
}
|
||||
getPostList(){
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
|
@ -391,7 +364,6 @@
|
|||
"certificateType":this.queryParams.certificateType,
|
||||
// "certificateNo":this.queryParams.certificateNo
|
||||
}
|
||||
console.log("param",param)
|
||||
getCertificateExamListPageApi(param).then(response => {
|
||||
this.tableListData = response.rows;
|
||||
this.total = Number(response.total);
|
||||
|
|
@ -400,18 +372,20 @@
|
|||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.fileList=[]
|
||||
this.fileUrls=[]
|
||||
this.fileNames = []
|
||||
this.baseForm = {
|
||||
deptId:null,
|
||||
name:"",
|
||||
idNumber:"",
|
||||
birthday:"",
|
||||
birthAddr:"",
|
||||
userId:"",
|
||||
postId:"",
|
||||
phone:"",
|
||||
certificateType:"",
|
||||
certificateTypeName:"",
|
||||
certificateNo:"",
|
||||
issueAddr:"",
|
||||
issueDay:"",
|
||||
isEle:"0",isCreate:"0"
|
||||
applyReason:"",
|
||||
applyDetail:"",
|
||||
startTime:"",
|
||||
startTime:"",
|
||||
endTime:"",
|
||||
dateRange:[]
|
||||
};
|
||||
this.resetForm("baseForm");
|
||||
},
|
||||
|
|
@ -421,54 +395,70 @@
|
|||
this.open = true;
|
||||
this.isReadOnly=false;
|
||||
this.title = "新增";
|
||||
listDept().then((response) => {
|
||||
this.deptOptions = this.handleTree(response.data, 'deptId')
|
||||
})
|
||||
console.log("this.baseForm",this.baseForm);
|
||||
},
|
||||
/** 电子标签*/
|
||||
handleCheckedOne(value, type) {
|
||||
console.log(type,value)
|
||||
},
|
||||
handleCheckedTwo(value, type) {
|
||||
console.log(type,value)
|
||||
},
|
||||
/** 转换部门数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.deptId,
|
||||
label: node.deptName,
|
||||
children: node.children,
|
||||
}
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.isReadOnly=true;
|
||||
this.isReadOnly=false;
|
||||
this.baseForm = Object.assign({}, row)
|
||||
listDept().then((response) => {
|
||||
this.deptOptions = this.handleTree(response.data, 'deptId')
|
||||
})
|
||||
this.baseForm.dateRange = [row.startTime,row.endTime]
|
||||
if(row.fileUrl&&row.fileUrl!=''){
|
||||
let arr = row.fileUrl.split(",");
|
||||
let arr2 = row.fileName.split(",");
|
||||
arr.forEach((item,index)=>{
|
||||
this.fileList.push({url:item,name:arr2[index]})
|
||||
this.fileUrls.push(item)
|
||||
this.fileNames.push(arr2[index])
|
||||
})
|
||||
}else{
|
||||
this.fileList=[]
|
||||
this.fileUrls=[]
|
||||
this.fileNames = []
|
||||
}
|
||||
this.upload.isUploading = true
|
||||
this.isView = false
|
||||
this.title = "修改";
|
||||
},
|
||||
handleTabClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
handleView(row) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.isReadOnly=true;
|
||||
this.baseForm = Object.assign({}, row)
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
})
|
||||
this.baseForm.dateRange = [row.startTime,row.endTime]
|
||||
if(row.fileUrl&&row.fileUrl!=''){
|
||||
let arr = row.fileUrl.split(",");
|
||||
let arr2 = row.fileName.split(",");
|
||||
arr.forEach((item,index)=>{
|
||||
this.fileList.push({url:item,name:arr2[index]})
|
||||
this.fileUrls.push(item)
|
||||
this.fileNames.push(arr2[index])
|
||||
})
|
||||
}else{
|
||||
this.fileList=[]
|
||||
this.fileUrls=[]
|
||||
this.fileNames = []
|
||||
}
|
||||
this.upload.isUploading = true
|
||||
this.isView = true
|
||||
this.title = "查看";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
submitForm: function(type) {
|
||||
//checkState 1同意 2拒绝 checkId
|
||||
console.log("this.baseForm",this.baseForm);
|
||||
this.$refs["baseForm"].validate(valid => {
|
||||
if (valid) {
|
||||
checkCertificateApplyApi(this.baseForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
let param = {
|
||||
checkId:this.baseForm.checkId,
|
||||
checkState:type
|
||||
}
|
||||
checkCertificateApplyApi(this.baseForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
|
|
@ -476,62 +466,79 @@
|
|||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
handleSelect(){
|
||||
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
// var certificateNoRow="";
|
||||
// if(row!=undefined &&row.certificateNo!=null&&row.certificateNo!=undefined){
|
||||
// certificateNoRow=row.certificateNo.split(" ");
|
||||
// }
|
||||
// const certificateNos = certificateNoRow || this.certificateNos;
|
||||
// console.log("certificateNos",certificateNos);
|
||||
// this.$modal.confirm('是否确认删除数据项?').then(() => {
|
||||
// deleteCertificateInfoApi({certificateNos:certificateNos}).then(response => {
|
||||
// console.log("deleteCertificateInfoApi",response);
|
||||
// this.getList();
|
||||
// this.$modal.msgSuccess("删除成功");
|
||||
// return;
|
||||
// });
|
||||
// }).catch(() => {});
|
||||
},
|
||||
formatDate(date) {
|
||||
// 格式化为 YYYY-MM-DD
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
console.log(response)
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.upload.isUploading = false;
|
||||
if(response.code==200){
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList();
|
||||
this.fileUrls.push(response.data.url)
|
||||
this.fileNames.push(response.data.name)
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
}else{
|
||||
this.$modal.msgError(response.msg);
|
||||
this.$modal.msgError(response.msg);
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
let sum = 0
|
||||
this.fileNames.forEach((item, index) => {
|
||||
if (item == file.name) {
|
||||
sum = index
|
||||
}
|
||||
})
|
||||
this.fileUrls.splice(sum, 1)
|
||||
this.fileNames.splice(sum, 1)
|
||||
},
|
||||
async handlePreviewDownloadFile(file) {
|
||||
if (file.url != null && file.url !== '') {
|
||||
let downloadUrl = file.url;
|
||||
try {
|
||||
const response = await fetch(downloadUrl); // 获取文件内容
|
||||
if (!response.ok) {
|
||||
throw new Error('文件下载失败');
|
||||
}
|
||||
const blob = await response.blob(); // 将文件内容转换为 Blob 对象
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob); // 创建一个 URL 对象
|
||||
link.download = file.name; // 指定下载的文件名
|
||||
document.body.appendChild(link); // 将链接添加到 DOM 中
|
||||
link.click(); // 触发下载
|
||||
document.body.removeChild(link); // 下载后移除 <a> 元素
|
||||
} catch (error) {
|
||||
message.warning("文件下载失败!");
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
if (file.raw != null && file.raw !== '') {
|
||||
const blob = file.raw; // 将文件内容转换为 Blob 对象
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob); // 创建一个 URL 对象
|
||||
link.download = file.name; // 指定下载的文件名
|
||||
document.body.appendChild(link); // 将链接添加到 DOM 中
|
||||
link.click(); // 触发下载
|
||||
document.body.removeChild(link); // 下载后移除 <a> 元素
|
||||
}
|
||||
},
|
||||
/** 批量删除 */
|
||||
handleBatchDel(){
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.certificateNos = selection.map(item => item.certificateNo)
|
||||
this.userIds=selection.map(item => item.userId)
|
||||
// 更新单选和多选状态
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
// this.certificateNos = selection.map(item => item.certificateNo)
|
||||
// this.userIds=selection.map(item => item.userId)
|
||||
// // 更新单选和多选状态
|
||||
// this.single = selection.length !== 1
|
||||
// this.multiple = !selection.length
|
||||
},
|
||||
formatDate(date) {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@
|
|||
@click="handleAdd"
|
||||
>新增申请</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
size="mini"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="tableListData" @selection-change="handleSelectionChange" height="800">
|
||||
|
|
@ -75,26 +75,36 @@
|
|||
<el-table-column label="详细说明" align="center" width="120" prop="applyDetail" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计划出国时间" align="center" prop="startTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计划返回时间" align="center" prop="endTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="申请状态" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">
|
||||
<span v-if="scope.row.state==0" style="color: #FF7322;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==1" style="color: #FEE838;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==2" style="color: #03DF6D;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==3" style="color: #FEE838;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
<span v-if="scope.row.state==4" style="color: #FF7322;font-size: 15px;">{{scope.row.stateName}}</span>
|
||||
</template> -->
|
||||
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>查看</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请状态" align="center" prop="applyState" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.applyState==-1" style="color: #FF7322;font-size: 15px;">待提交</span>
|
||||
<span v-if="scope.row.applyState==0" style="color: #FF7322;font-size: 15px;">待审核</span>
|
||||
<span v-if="scope.row.applyState==1" style="color: #FEE838;font-size: 15px;">审核中</span>
|
||||
<span v-if="scope.row.applyState==2" style="color: #03DF6D;font-size: 15px;">已审核</span>
|
||||
<span v-if="scope.row.applyState==3" style="color: #FEE838;font-size: 15px;">已退回</span>
|
||||
<span v-if="scope.row.applyState==4" style="color: #FF7322;font-size: 15px;">已执行</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.state==0||scope.row.state==4"
|
||||
size="mini"
|
||||
<el-button
|
||||
size="mini" v-if="scope.row.applyState==-1"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button v-if="scope.row.state==0||scope.row.state==4"
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>查看</el-button>
|
||||
<el-button
|
||||
size="mini" v-if="scope.row.applyState==-1"
|
||||
type="text"
|
||||
style="color: red;"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
|
|
@ -112,7 +122,7 @@
|
|||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title+''" :visible.sync="open" width="900px" append-to-body>
|
||||
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="120px">
|
||||
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="120px" style="height: 650px;overflow-y: auto;">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请人" prop="name">
|
||||
|
|
@ -138,9 +148,9 @@
|
|||
>
|
||||
<el-option
|
||||
v-for="item in postOptions"
|
||||
:key="item.postId"
|
||||
:key="item.postId+''"
|
||||
:label="item.postName"
|
||||
:value="item.postId"
|
||||
:value="item.postId+''"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -196,6 +206,7 @@
|
|||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd" style="width: 100%">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
|
@ -212,7 +223,8 @@
|
|||
:on-progress="handleFileUploadProgress"
|
||||
:file-list="fileList"
|
||||
:on-success="handleFileSuccess"
|
||||
:on-change="handleChange"
|
||||
:on-remove="handleRemove"
|
||||
:on-preview="handlePreviewDownloadFile"
|
||||
:auto-upload="true"
|
||||
drag
|
||||
>
|
||||
|
|
@ -231,8 +243,8 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="success" @click="submitForm(-1)">保 存</el-button>
|
||||
<el-button type="primary" @click="submitForm(0)">提 交</el-button>
|
||||
<el-button type="success" @click="submitForm(-1)" v-if="!isView">保 存</el-button>
|
||||
<el-button type="primary" @click="submitForm(0)" v-if="!isView">提 交</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -344,6 +356,7 @@
|
|||
endTime:"",
|
||||
dateRange:[]
|
||||
},
|
||||
isView:false,
|
||||
baseForm2: {
|
||||
userId:"",
|
||||
phone:""
|
||||
|
|
@ -387,15 +400,21 @@
|
|||
url: process.env.VUE_APP_BASE_API + '/file/upload?type=face',
|
||||
},
|
||||
fileList:[],
|
||||
fileUrls:[]
|
||||
fileUrls:[],
|
||||
fileNames:[]
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
this.getPostList();
|
||||
this.getList();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
getPostList(){
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
@ -425,6 +444,9 @@
|
|||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.fileList=[]
|
||||
this.fileUrls=[]
|
||||
this.fileNames = []
|
||||
this.baseForm = {
|
||||
userId:"",
|
||||
postId:"",
|
||||
|
|
@ -442,16 +464,35 @@
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
this.open = true;
|
||||
this.isReadOnly=false;
|
||||
this.title = "新增";
|
||||
})
|
||||
this.open = true;
|
||||
this.isReadOnly=false;
|
||||
this.title = "新增";
|
||||
console.log("this.baseForm",this.baseForm);
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.isReadOnly=true;
|
||||
this.baseForm = Object.assign({}, row)
|
||||
this.baseForm.dateRange = [row.startTime,row.endTime]
|
||||
if(row.fileUrl&&row.fileUrl!=''){
|
||||
let arr = row.fileUrl.split(",");
|
||||
let arr2 = row.fileName.split(",");
|
||||
arr.forEach((item,index)=>{
|
||||
this.fileList.push({url:item,name:arr2[index]})
|
||||
this.fileUrls.push(item)
|
||||
this.fileNames.push(arr2[index])
|
||||
})
|
||||
}else{
|
||||
this.fileList=[]
|
||||
this.fileUrls=[]
|
||||
this.fileNames = []
|
||||
}
|
||||
his.isView = false
|
||||
this.title = "修改";
|
||||
},
|
||||
handleView(row) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.isReadOnly=true;
|
||||
|
|
@ -459,37 +500,56 @@
|
|||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
})
|
||||
this.title = "修改";
|
||||
this.baseForm.dateRange = [row.startTime,row.endTime]
|
||||
if(row.fileUrl&&row.fileUrl!=''){
|
||||
let arr = row.fileUrl.split(",");
|
||||
let arr2 = row.fileName.split(",");
|
||||
arr.forEach((item,index)=>{
|
||||
this.fileList.push({url:item,name:arr2[index]})
|
||||
this.fileUrls.push(item)
|
||||
this.fileNames.push(arr2[index])
|
||||
})
|
||||
}else{
|
||||
this.fileList=[]
|
||||
this.fileUrls=[]
|
||||
this.fileNames = []
|
||||
}
|
||||
this.upload.isUploading = true
|
||||
this.isView = true
|
||||
this.title = "查看";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function(type) {
|
||||
console.log(this.baseForm.dateRange)
|
||||
if(this.baseForm.dateRange&&this.baseForm.dateRange.length>0){
|
||||
this.baseForm.startTime = this.formatDate(this.baseForm.dateRange[0])
|
||||
this.baseForm.endTime = this.formatDate(this.baseForm.dateRange[1])
|
||||
// this.baseForm.startTime = this.formatDate(this.baseForm.dateRange[0])
|
||||
// this.baseForm.endTime = this.formatDate(this.baseForm.dateRange[1])
|
||||
this.baseForm.startTime = this.baseForm.dateRange[0]
|
||||
this.baseForm.endTime = this.baseForm.dateRange[1]
|
||||
}else{
|
||||
this.baseForm.startTime = ""
|
||||
this.baseForm.endTime = ""
|
||||
}
|
||||
//applyState -1 仅保存不提交 0保存提交
|
||||
this.baseForm.applyState = type;
|
||||
|
||||
//fileUrls 附件 数组
|
||||
console.log(this.fileUrls)
|
||||
this.baseForm.fileUrls = this.fileUrls
|
||||
this.baseForm.fileNames = this.fileNames
|
||||
console.log("this.baseForm",this.baseForm);
|
||||
this.$refs["baseForm"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.baseForm.createTime != undefined) {
|
||||
// editCertificateApplyApi(this.baseForm).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
if (this.baseForm.checkId != undefined) {
|
||||
editCertificateApplyApi(this.baseForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
// addCertificateApplyApi(this.baseForm).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
addCertificateApplyApi(this.baseForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -536,14 +596,8 @@
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
var certificateNoRow="";
|
||||
if(row!=undefined &&row.certificateNo!=null&&row.certificateNo!=undefined){
|
||||
certificateNoRow=row.certificateNo.split(" ");
|
||||
}
|
||||
const certificateNos = certificateNoRow || this.certificateNos;
|
||||
console.log("certificateNos",certificateNos);
|
||||
this.$modal.confirm('是否确认删除数据项?').then(() => {
|
||||
delCertificateApplyApi({certificateNos:certificateNos}).then(response => {
|
||||
delCertificateApplyApi({checkId:row.checkId}).then(response => {
|
||||
console.log("delCertificateApplyApi",response);
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
|
@ -559,15 +613,52 @@
|
|||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.isUploading = false;
|
||||
if(response.code==200){
|
||||
this.fileUrls.push(response.data.url)
|
||||
this.fileNames.push(response.data.name)
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
}else{
|
||||
this.$modal.msgError(response.msg);
|
||||
}
|
||||
},
|
||||
handleChange(file, fileList) {
|
||||
console.log(fileList)
|
||||
// this.fileUrls = fileList.map(item => item.response.data.url)
|
||||
|
||||
handleRemove(file, fileList) {
|
||||
let sum = 0
|
||||
this.fileNames.forEach((item, index) => {
|
||||
if (item == file.name) {
|
||||
sum = index
|
||||
}
|
||||
})
|
||||
this.fileUrls.splice(sum, 1)
|
||||
this.fileNames.splice(sum, 1)
|
||||
},
|
||||
async handlePreviewDownloadFile(file) {
|
||||
if (file.url != null && file.url !== '') {
|
||||
let downloadUrl = file.url;
|
||||
try {
|
||||
const response = await fetch(downloadUrl); // 获取文件内容
|
||||
if (!response.ok) {
|
||||
throw new Error('文件下载失败');
|
||||
}
|
||||
const blob = await response.blob(); // 将文件内容转换为 Blob 对象
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob); // 创建一个 URL 对象
|
||||
link.download = file.name; // 指定下载的文件名
|
||||
document.body.appendChild(link); // 将链接添加到 DOM 中
|
||||
link.click(); // 触发下载
|
||||
document.body.removeChild(link); // 下载后移除 <a> 元素
|
||||
} catch (error) {
|
||||
message.warning("文件下载失败!");
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
if (file.raw != null && file.raw !== '') {
|
||||
const blob = file.raw; // 将文件内容转换为 Blob 对象
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob); // 创建一个 URL 对象
|
||||
link.download = file.name; // 指定下载的文件名
|
||||
document.body.appendChild(link); // 将链接添加到 DOM 中
|
||||
link.click(); // 触发下载
|
||||
document.body.removeChild(link); // 下载后移除 <a> 元素
|
||||
}
|
||||
},
|
||||
/** 批量删除 */
|
||||
handleBatchDel(){
|
||||
|
|
@ -582,7 +673,6 @@
|
|||
// this.multiple = !selection.length
|
||||
},
|
||||
formatDate(date) {
|
||||
// 格式化为 YYYY-MM-DD
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
|
|
|
|||
Loading…
Reference in New Issue