页面优化
This commit is contained in:
parent
3db0a2064c
commit
864cb9b4bc
|
|
@ -237,7 +237,7 @@ export function addCertificateCheckApi(data) {
|
|||
// 证件领用申请列表-分页查询
|
||||
export function getCertificateApplyListPageApi(data) {
|
||||
return request({
|
||||
url: '/certificate/certificate_apply/certificateApply/list',
|
||||
url: '/certificate/certificate_check/certificateApply/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
|
|
@ -248,7 +248,18 @@ export function getCertificateApplyListPageApi(data) {
|
|||
// 证件领用申请添加申请
|
||||
export function addCertificateApplyApi(data) {
|
||||
return request({
|
||||
url: '/certificate/certificate_apply/certificateApply/add',
|
||||
url: '/certificate/certificate_check/certificateApply/add',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 证件领用申请编辑申请
|
||||
export function editCertificateApplyApi(data) {
|
||||
return request({
|
||||
url: '/certificate/certificate_check/certificateApply/edit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
|
|
@ -256,11 +267,10 @@ export function addCertificateApplyApi(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 证件领用申请删除
|
||||
export function delCertificateApplyApi(data) {
|
||||
return request({
|
||||
url: '/certificate/certificate_apply/certificateApply/del',
|
||||
url: '/certificate/certificate_check/certificateApply/del',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
|
|
|
|||
|
|
@ -62,16 +62,17 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请人" align="center" prop="name" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="岗位" align="center" prop="idNumber" :show-overflow-tooltip="true" width="180"/>
|
||||
<el-table-column label="联系方式" align="center" prop="phone" :show-overflow-tooltip="true" width="150"/>
|
||||
<!-- <el-table-column label="身份证号" align="center" prop="idNumber" :show-overflow-tooltip="true" width="180"/> -->
|
||||
<el-table-column label="证件类型" align="center" prop="certificateTypeName" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="证件编号" align="center" prop="certificateNo" :show-overflow-tooltip="true" width="180"></el-table-column> -->
|
||||
<el-table-column label="领用原因" align="center" prop="requestReason" :show-overflow-tooltip="true">
|
||||
<el-table-column label="领用原因" align="center" prop="applyReason" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.issue_type" :value="scope.row.requestReason"/>
|
||||
<dict-tag :options="dict.type.issue_type" :value="scope.row.applyReason"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详细说明" align="center" width="120" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="详细说明" align="center" width="120" prop="applyDetail" :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"/>
|
||||
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true"/>
|
||||
|
|
@ -110,33 +111,39 @@
|
|||
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title+''" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="100px">
|
||||
<el-dialog :title="title+''" :visible.sync="open" width="900px" append-to-body>
|
||||
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="120px">
|
||||
<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 el-col :span="12" v-if="baseForm.deptId !== 0">
|
||||
<el-col el-col :span="12">
|
||||
<el-form-item label="">
|
||||
<el-button
|
||||
type="success"
|
||||
size="mini"
|
||||
@click="handleSelect()"
|
||||
>选择人员
|
||||
>选择申请人
|
||||
</el-button>
|
||||
</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">
|
||||
|
|
@ -163,8 +170,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"
|
||||
|
|
@ -175,14 +182,14 @@
|
|||
</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
|
||||
|
|
@ -204,7 +211,7 @@
|
|||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
:auto-upload="true"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
|
|
@ -212,10 +219,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)">保 存</el-button>
|
||||
<el-button type="primary" @click="submitForm(0)">提 交</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -260,8 +275,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listDept } from '@/api/system/dept'
|
||||
import { getCertificateApplyListPageApi,addCertificateApplyApi, updateCertificateInfoApi,
|
||||
import { getUser } from '@/api/system/user'
|
||||
import { getCertificateApplyListPageApi,addCertificateApplyApi, editCertificateApplyApi,
|
||||
delCertificateApplyApi,getSysUserListApi,addCertificateCheckApi } from "@/api/certificateManage/index";
|
||||
import base64 from 'base-64';
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
|
@ -312,22 +327,20 @@
|
|||
},
|
||||
activeName:"baseSetting",
|
||||
deviceData:{},
|
||||
// 表单参数
|
||||
// 岗位选项
|
||||
postOptions: [],
|
||||
// 表单参数
|
||||
baseForm: {
|
||||
deptId:null,
|
||||
name:"",
|
||||
idNumber:"",
|
||||
birthday:"",
|
||||
birthAddr:"",
|
||||
certificateType:"",
|
||||
certificateTypeName:"",
|
||||
certificateNo:"",
|
||||
issueAddr:"",
|
||||
issueDay:"",
|
||||
createTime:"",
|
||||
phone:"",
|
||||
userId:"",
|
||||
isEle:""
|
||||
postId:"",
|
||||
phone:"",
|
||||
certificateType:"",
|
||||
applyReason:"",
|
||||
applyDetail:"",
|
||||
startTime:"",
|
||||
startTime:"",
|
||||
endTime:"",
|
||||
dateRange:[]
|
||||
},
|
||||
baseForm2: {
|
||||
userId:"",
|
||||
|
|
@ -335,52 +348,38 @@
|
|||
},
|
||||
// 表单校验
|
||||
baseFormRules: {
|
||||
deptId: [
|
||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
||||
userId: [
|
||||
{ required: true, message: "申请人不能为空", trigger: "change" }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
idNumber: [
|
||||
{ required: true, message: "身份证不能为空", trigger: "blur" },
|
||||
{ validator: this.validateIDCard, trigger: 'blur' }
|
||||
],
|
||||
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',
|
||||
url: process.env.VUE_APP_BASE_API + '/file/upload?type=face',
|
||||
}
|
||||
};
|
||||
},
|
||||
|
|
@ -390,17 +389,6 @@
|
|||
},
|
||||
|
||||
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('请输入有效的身份证号')); // 验证失败,显示错误信息提示
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
@ -431,81 +419,71 @@
|
|||
// 表单重置
|
||||
reset() {
|
||||
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");
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.isReadOnly=false;
|
||||
this.title = "新增";
|
||||
listDept().then((response) => {
|
||||
this.deptOptions = this.handleTree(response.data, 'deptId')
|
||||
this.reset();
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
this.open = true;
|
||||
this.isReadOnly=false;
|
||||
this.title = "新增";
|
||||
})
|
||||
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.baseForm = Object.assign({}, row)
|
||||
listDept().then((response) => {
|
||||
this.deptOptions = this.handleTree(response.data, 'deptId')
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts
|
||||
})
|
||||
this.title = "修改";
|
||||
},
|
||||
handleTabClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
submitForm: function(type) {
|
||||
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])
|
||||
}else{
|
||||
this.baseForm.startTime = ""
|
||||
this.baseForm.endTime = ""
|
||||
}
|
||||
//applyState -1 仅保存不提交 0保存提交
|
||||
this.baseForm.applyState = type;
|
||||
|
||||
//fileUrls 附件 数组
|
||||
|
||||
console.log("this.baseForm",this.baseForm);
|
||||
this.$refs["baseForm"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.baseForm.createTime != undefined) {
|
||||
updateCertificateInfoApi(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();
|
||||
});
|
||||
}
|
||||
// if (this.baseForm.createTime != 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();
|
||||
// });
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -514,6 +492,7 @@
|
|||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
//选择人员
|
||||
handleSelect(){
|
||||
this.openSelectUser = true;
|
||||
getSysUserListApi({}).then(response => {
|
||||
|
|
@ -523,13 +502,14 @@
|
|||
this.$set(this.baseForm2,"phone",this.baseForm.phone)
|
||||
});
|
||||
},
|
||||
//选中人员-渲染数据
|
||||
getCorpAndDept(val){
|
||||
console.log("getCorpAndDept",val)
|
||||
this.selectItme=val;
|
||||
this.$set(this.baseForm2,"phone",this.selectItme.phone)
|
||||
this.$set(this.baseForm2,"userId",this.selectItme.userId)
|
||||
},
|
||||
/** 提交按钮 */
|
||||
/** 提交选中人员*/
|
||||
submitForm2: function() {
|
||||
console.log("this.baseForm2",this.baseForm2);
|
||||
this.$refs["baseForm2"].validate(valid => {
|
||||
|
|
@ -564,13 +544,7 @@
|
|||
});
|
||||
}).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}`;
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('certificate/certificate_manage/certificateInfo/export', {
|
||||
|
|
@ -604,7 +578,14 @@
|
|||
// // 更新单选和多选状态
|
||||
// this.single = selection.length !== 1
|
||||
// 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');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue