diff --git a/src/api/certificateManage/index.js b/src/api/certificateManage/index.js
index 7c4b0ec..a75df80 100644
--- a/src/api/certificateManage/index.js
+++ b/src/api/certificateManage/index.js
@@ -291,7 +291,7 @@ export function getCertificateExamListPageApi(data) {
params:data
})
}
-// 证件领用申请删除
+// 证件领用审核-审核
export function checkCertificateApplyApi(data) {
return request({
url: '/certificate/certificate_check/certificateCheck/check',
diff --git a/src/views/certificate/certificateReturnManage/certificateExam/index.vue b/src/views/certificate/certificateReturnManage/certificateExam/index.vue
index ac67a5b..7ed98b2 100644
--- a/src/views/certificate/certificateReturnManage/certificateExam/index.vue
+++ b/src/views/certificate/certificateReturnManage/certificateExam/index.vue
@@ -9,7 +9,7 @@
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
-
+
-
+
新增申请
-
-
- 删除
-->
@@ -75,23 +67,33 @@
-
-
-
+
+
+ 查看
+
+
+
+
+ 待提交
+ 待审核
+ 审核中
+ 已审核
+ 已退回
+ 已执行
+
- 审批
+ >审核
+ 查看
@@ -105,39 +107,35 @@
-
-
+
+
-
-
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
@@ -151,8 +149,8 @@
-
-
+
+
-
-
+
+
-
+
@@ -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
>
@@ -200,21 +202,27 @@
+
+ 注意事项
+ 1.因公出国需提供单位出具的出差证明
+ 2.因私出国需提供相关证明材料(如邀请函等)
+ 3.证件领取后请妥善保管,如有遗失需立即报告
+ 4.使用完毕后请及时归还证件
+
-
+
diff --git a/src/views/certificate/certificateReturnManage/certificateRequest/index.vue b/src/views/certificate/certificateReturnManage/certificateRequest/index.vue
index 5ed0812..648196b 100644
--- a/src/views/certificate/certificateReturnManage/certificateRequest/index.vue
+++ b/src/views/certificate/certificateReturnManage/certificateRequest/index.vue
@@ -44,14 +44,14 @@
@click="handleAdd"
>新增申请
-
+
@@ -75,25 +75,35 @@
-
-
-
+
+
+ 查看
+
+
+
+
+ 待提交
+ 待审核
+ 审核中
+ 已审核
+ 已退回
+ 已执行
+
- 编辑
- 查看
+
-
+
@@ -138,9 +148,9 @@
>
@@ -196,6 +206,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
+ value-format="yyyy-MM-dd"
format="yyyy-MM-dd" style="width: 100%">
@@ -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 @@
@@ -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.getList();
-
+ 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.applyState = type;
+ //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();
+ });
}
}
});
@@ -535,15 +595,9 @@
this.openSelectUser = false;
},
/** 删除按钮操作 */
- 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);
+ handleDelete(row) {
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); // 下载后移除 元素
+ } 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); // 下载后移除 元素
+ }
},
/** 批量删除 */
handleBatchDel(){
@@ -581,8 +672,7 @@
// this.single = selection.length !== 1
// this.multiple = !selection.length
},
- formatDate(date) {
- // 格式化为 YYYY-MM-DD
+ formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
const day = String(date.getDate()).padStart(2, '0');