|
@@ -5,6 +5,7 @@
|
|
|
<template #prepend>工号/身份证号/姓名 </template>
|
|
|
</el-input>
|
|
|
<el-button type="primary" icon="Search" @click="queryEmployeeInfo" style="margin-left: 10px">查询</el-button>
|
|
|
+ <!-- <el-button type="primary" icon="Search" @click="queryTa1" style="margin-left: 10px">查询</el-button> -->
|
|
|
<el-button type="primary" icon="Check" @click="submitForm(ruleFormRef)" style="margin-left: 10px">保存</el-button>
|
|
|
<el-button type="primary" icon="Refresh" @click="resetForm(ruleFormRef)" style="margin-left: 10px">重置</el-button>
|
|
|
<el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增记录</el-button>
|
|
@@ -268,7 +269,7 @@
|
|
|
ref="upload"
|
|
|
v-model:file-list="fileList"
|
|
|
list-type="picture-card"
|
|
|
- :action="apiUrl + `/technologyArchives/putCertificateImage?getTime=` + scope.row.getTime"
|
|
|
+ :action="apiUrl + `/technologyArchives/putCertificateImage?socialNo=` + scope.row.socialNo + `&getTime=` + scope.row.getTime"
|
|
|
:headers="header"
|
|
|
:on-success="uploadSuccess"
|
|
|
:on-preview="handlePreview"
|
|
@@ -363,24 +364,40 @@
|
|
|
<el-table-column prop="image" label="图片链接">
|
|
|
<template v-slot="scope">
|
|
|
<!-- <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.image"></el-input> -->
|
|
|
- <div v-if="scope.row.isEdit">
|
|
|
+ <div v-if="scope.row.isEdit" stylr="display:flex;">
|
|
|
<el-upload
|
|
|
- class="upload-demo"
|
|
|
ref="upload"
|
|
|
- :action="apiUrl + '/technologyArchives/putProImage'"
|
|
|
+ v-model:file-list="fileList"
|
|
|
+ list-type="picture-card"
|
|
|
+ :action="apiUrl + `/technologyArchives/putProImage?socialNo=` + scope.row.socialNo + `&no=` + scope.row.no"
|
|
|
:headers="header"
|
|
|
- :file-list="fileList"
|
|
|
- :data="{ socialNo: scope.row.socialNo }"
|
|
|
:on-success="uploadSuccess"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
:auto-upload="false"
|
|
|
+ :multiple
|
|
|
+ :show-file-list="true"
|
|
|
>
|
|
|
- <template #trigger>
|
|
|
- <el-button type="primary" icon="Picture">选取文件</el-button>
|
|
|
- </template>
|
|
|
- <el-button style="margin-left: 10px" type="success" icon="Upload" @click="submitUpload">上传到服务器</el-button>
|
|
|
+ <el-icon> <Plus /></el-icon>
|
|
|
</el-upload>
|
|
|
+ <el-button style="margin-top: 10px" type="success" icon="Upload" @click="submitUpload(scope.row)">上传到服务器</el-button>
|
|
|
+ <el-dialog width="75%" v-model="dialogVisible">
|
|
|
+ <img width="100%" :src="dialogImageUrl" />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
- <span v-else>{{ scope.row.image }}</span>
|
|
|
+ <div v-else class="demo-image__preview">
|
|
|
+ <el-image
|
|
|
+ style="width: 100px; height: 100px"
|
|
|
+ :src="url"
|
|
|
+ :zoom-rate="1.2"
|
|
|
+ :max-scale="7"
|
|
|
+ :min-scale="0.2"
|
|
|
+ :preview-src-list="srcList"
|
|
|
+ fit="cover"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <!-- <span v-else>{{ scope.row.image }}</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column fixed="right" label="操作" min-width="180" width="180" center>
|
|
@@ -1078,7 +1095,6 @@ import {nextTick, onMounted, ref} from "vue";
|
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
|
import type { UploadFile, UploadFiles, UploadProps, UploadUserFile, UploadInstance } from 'element-plus'
|
|
|
import XEUtils from "xe-utils";
|
|
|
-import {stringIsBlank} from "@/utils/blank-utils";
|
|
|
import {QuestionFilled, StarFilled} from '@element-plus/icons-vue'
|
|
|
import {
|
|
|
delTechnologyArchives10ByCode,
|
|
@@ -1095,7 +1111,11 @@ import {
|
|
|
delTechnologyArchives9ByCode,
|
|
|
saveTechnologyArchives1,
|
|
|
selectImage1,
|
|
|
+ selectImage2,
|
|
|
deleteImage1,
|
|
|
+ selectTa1,
|
|
|
+ setImage1,
|
|
|
+ setImage2,
|
|
|
saveTechnologyArchives10,
|
|
|
saveTechnologyArchives12,
|
|
|
saveTechnologyArchives13,
|
|
@@ -1197,6 +1217,24 @@ const queryEmployeeInfo = () => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+// const queryTa1 = () => {
|
|
|
+// if(!text.value){
|
|
|
+// ElMessage({
|
|
|
+// type: "warning",
|
|
|
+// message: '查询关键字不能为空!',
|
|
|
+// duration: 2500,
|
|
|
+// showClose: true,
|
|
|
+// });
|
|
|
+// return
|
|
|
+// }
|
|
|
+
|
|
|
+// selectTa1(text.value)
|
|
|
+// .then((res) => {
|
|
|
+// if(res){
|
|
|
+// baseInfoForm.value = res
|
|
|
+// }
|
|
|
+// })
|
|
|
+// }
|
|
|
const queryDictInfo = () => {
|
|
|
selectDictInfo()
|
|
|
.then((res) => {
|
|
@@ -1335,7 +1373,7 @@ const queryTechnologyArchives1 = () => {
|
|
|
.then((res1)=>{
|
|
|
url.value = row.image
|
|
|
srcList.value = [res1.data.image]
|
|
|
- console.log(res1.data)
|
|
|
+ console.log(row)
|
|
|
console.log(srcList.value)
|
|
|
})
|
|
|
})
|
|
@@ -1353,6 +1391,13 @@ const queryTechnologyArchives2 = () => {
|
|
|
row['isEdit'] = false
|
|
|
// 是否新增
|
|
|
row['isAdd'] = false
|
|
|
+ selectImage2(row.socialNo, row.no)
|
|
|
+ .then((res1)=>{
|
|
|
+ url.value = row.image
|
|
|
+ srcList.value = [res1.data.image]
|
|
|
+ console.log(row)
|
|
|
+ console.log(srcList.value)
|
|
|
+ })
|
|
|
})
|
|
|
secondData.value = res
|
|
|
})
|
|
@@ -1521,7 +1566,8 @@ const onAddItem = () => {
|
|
|
image: '',
|
|
|
isEdit: true,
|
|
|
isAdd: true,
|
|
|
- isUpload: false
|
|
|
+ isUpload: false,
|
|
|
+ isOversize: false
|
|
|
})
|
|
|
} else if(editableTabsValue.value === 'secondInfo'){
|
|
|
secondData.value.push({
|
|
@@ -1534,6 +1580,8 @@ const onAddItem = () => {
|
|
|
image: '',
|
|
|
isEdit: true,
|
|
|
isAdd: true,
|
|
|
+ isUpload: false,
|
|
|
+ isOversize: false
|
|
|
})
|
|
|
} else if(editableTabsValue.value === 'thirdInfo'){
|
|
|
thirdData.value.push({
|
|
@@ -1677,6 +1725,9 @@ const cancelFirstInfo = (row, index) => {
|
|
|
row[i] = row.oldRow[i]
|
|
|
}
|
|
|
}
|
|
|
+ if(!row.isUpload){
|
|
|
+ fileList.value = []
|
|
|
+ }
|
|
|
firstKey.value = Math.random()
|
|
|
}
|
|
|
|
|
@@ -1698,12 +1749,11 @@ const handlePreview= (uploadFile) => {
|
|
|
console.log(fileList.value[0].name)
|
|
|
}
|
|
|
|
|
|
-const isOversize = ref(false)
|
|
|
// 图片上传前文件信息
|
|
|
-const beforeUpload = (file: File) => {
|
|
|
+const beforeUpload = (file: File,row) => {
|
|
|
if (file.size / 1024 / 1024 > 2) {
|
|
|
ElMessage.error('上传图片大小不能超过 2MB!')
|
|
|
- return isOversize.value = true
|
|
|
+ row.isOversize = true
|
|
|
}
|
|
|
console.log('正在上传文件:'+ file.name)
|
|
|
}
|
|
@@ -1720,15 +1770,14 @@ const multiple = computed(() => {
|
|
|
return false
|
|
|
})
|
|
|
|
|
|
-
|
|
|
+//上传
|
|
|
const submitUpload = (row) => {
|
|
|
- upload.value!.submit();
|
|
|
- if(!isOversize.value){
|
|
|
+ if(!row.isOversize){
|
|
|
+ upload.value!.submit();
|
|
|
row.isUpload = true
|
|
|
}else{
|
|
|
row.isUpload = false
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function uploadSuccess(response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) {
|
|
@@ -1834,6 +1883,7 @@ const callSaveFirstInfo = (row, oldGetTime) => {
|
|
|
} else {
|
|
|
queryTechnologyArchives1()
|
|
|
}
|
|
|
+ setImage1(row)
|
|
|
})
|
|
|
}).catch((action) => {
|
|
|
if (action === 'cancel') {
|
|
@@ -1889,6 +1939,9 @@ const cancelSecondInfo = (row, index) => {
|
|
|
row[i] = row.oldRow[i]
|
|
|
}
|
|
|
}
|
|
|
+ if(!row.isUpload){
|
|
|
+ fileList.value = []
|
|
|
+ }
|
|
|
secondKey.value = Math.random()
|
|
|
}
|
|
|
// 保存
|
|
@@ -1954,35 +2007,45 @@ const updateSecondInfo = (row) => {
|
|
|
}
|
|
|
|
|
|
const callSaveSecondInfo = (row, oldNo) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveTechnologyArchives2(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- if (oldNo !== null && oldNo !== row.no) {
|
|
|
- // 删除原始数据
|
|
|
- delTechnologyArchives2ByCode(row.socialNo, row.no).then((res) => {
|
|
|
+ if(!row.isUpload){
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: "图片还未上传!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ saveTechnologyArchives2(row).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ if (oldNo !== null && oldNo !== row.no) {
|
|
|
+ // 删除原始数据
|
|
|
+ delTechnologyArchives2ByCode(row.socialNo, row.no).then((res) => {
|
|
|
+ queryTechnologyArchives2()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
queryTechnologyArchives2()
|
|
|
- })
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ setImage2(row)
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
queryTechnologyArchives2()
|
|
|
}
|
|
|
})
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryTechnologyArchives2()
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const deleteSecondInfo = (row) => {
|