Commit 0f248261 by yuzhenWang

优化5

parent a5820f2d
...@@ -306,29 +306,7 @@ function previewFile(file, item) { ...@@ -306,29 +306,7 @@ function previewFile(file, item) {
name: file.name name: file.name
}) })
} }
// 预览文件(页面内弹窗,不打开新窗口)
// function previewFile(file, item) {
// const url = file.url || file.response?.data?.url
// if (!url) {
// ElMessage.warning('文件地址不存在')
// return
// }
// const ext = (file.name || '').split('.').pop().toLowerCase()
// previewUrl.value = url
// previewFileName.value = file.name || '文件'
// if (['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'svg'].includes(ext)) {
// previewFileType.value = 'image'
// previewDialogVisible.value = true
// } else if (ext === 'pdf') {
// previewFileType.value = 'pdf'
// previewDialogVisible.value = true
// } else {
// // 不支持预览的文件类型,弹窗显示提示
// previewFileType.value = 'unsupported'
// previewDialogVisible.value = true
// }
// }
// 删除文件(复用原有删除逻辑) // 删除文件(复用原有删除逻辑)
function removeFile(file, item) { function removeFile(file, item) {
......
...@@ -1124,18 +1124,21 @@ const addCheckRecordConfig = [ ...@@ -1124,18 +1124,21 @@ const addCheckRecordConfig = [
// label: '出账币种', // label: '出账币种',
// dictType: 'bx_currency_type' // dictType: 'bx_currency_type'
// }, // },
{ // {
type: 'input', // type: 'input',
prop: 'fortuneName', // prop: 'fortuneName',
label: '出账项目名称', // label: '出账项目名称',
rules: [{ required: true, message: '出账项目名称必填', trigger: 'blur' }] // rules: [{ required: true, message: '出账项目名称必填', trigger: 'blur' }]
}, // },
{ {
type: 'select', type: 'select',
prop: 'fortuneType', prop: 'fortuneType',
label: '出账项目类型', label: '出账项目类型',
dictType: 'csf_fortune_type', dictType: 'csf_fortune_type',
rules: [{ required: true, message: '出账项目类型必填', trigger: 'blur' }] rules: [{ required: true, message: '出账项目类型必填', trigger: 'blur' }],
onChangeExtraFields: {
fortuneName: 'itemLabel'
}
}, },
{ {
type: 'select', type: 'select',
......
...@@ -797,16 +797,19 @@ const updatePayRecordFormConfig = [ ...@@ -797,16 +797,19 @@ const updatePayRecordFormConfig = [
placeholder: '请选择', placeholder: '请选择',
maxDate: 'today' maxDate: 'today'
}, },
{ // {
type: 'input', // type: 'input',
prop: 'fortuneName', // prop: 'fortuneName',
label: '出账项目' // label: '出账项目'
}, // },
{ {
type: 'select', type: 'select',
prop: 'fortuneType', prop: 'fortuneType',
label: '出账项目类型', label: '出账项目类型',
dictType: 'csf_fortune_type' dictType: 'csf_fortune_type',
onChangeExtraFields: {
fortuneName: 'itemLabel'
}
}, },
{ {
type: 'input', type: 'input',
...@@ -870,7 +873,7 @@ const updatePayRecordFormConfig = [ ...@@ -870,7 +873,7 @@ const updatePayRecordFormConfig = [
transform: res => { transform: res => {
return res?.data.records || [] return res?.data.records || []
}, },
rules: [{ required: true, message: '所属团队必填', trigger: 'blur' }] rules: [{ required: false, message: '所属团队必填', trigger: 'blur' }]
}, },
{ {
type: 'select', type: 'select',
...@@ -1149,18 +1152,21 @@ const addPayRecordFormConfig = [ ...@@ -1149,18 +1152,21 @@ const addPayRecordFormConfig = [
prop: 'statusDesc', prop: 'statusDesc',
label: '修改理由' label: '修改理由'
}, },
{ // {
type: 'input', // type: 'input',
prop: 'fortuneName', // prop: 'fortuneName',
label: '出账项目名称', // label: '出账项目名称',
rules: [{ required: true, message: '出账项目名称必填', trigger: 'blur' }] // rules: [{ required: true, message: '出账项目名称必填', trigger: 'blur' }]
}, // },
{ {
type: 'select', type: 'select',
prop: 'fortuneType', prop: 'fortuneType',
label: '出账项目类型', label: '出账项目类型',
dictType: 'csf_fortune_type', dictType: 'csf_fortune_type',
rules: [{ required: true, message: '出账项目类型必填', trigger: 'blur' }] rules: [{ required: true, message: '出账项目类型必填', trigger: 'blur' }],
onChangeExtraFields: {
fortuneName: 'itemLabel'
}
}, },
{ {
type: 'input', type: 'input',
...@@ -1570,6 +1576,7 @@ const handleConfirmUpdatePayRecord = async () => { ...@@ -1570,6 +1576,7 @@ const handleConfirmUpdatePayRecord = async () => {
loadPayRecordTableData(selectedRow.value.expectedFortuneBizId) loadPayRecordTableData(selectedRow.value.expectedFortuneBizId)
expectedFortuneListData() expectedFortuneListData()
loadTableData()
} catch (error) { } catch (error) {
if (error.message && error.message.includes('Validation')) { if (error.message && error.message.includes('Validation')) {
ElMessage.error('必填项不能为空') ElMessage.error('必填项不能为空')
...@@ -1748,7 +1755,7 @@ const handleCurrentChange = val => { ...@@ -1748,7 +1755,7 @@ const handleCurrentChange = val => {
// 加载表格数据 // 加载表格数据
const loadTableData = async () => { const loadTableData = async () => {
const searchParams = searchFormRef.value.getFormData() || {} const searchParams = (await searchFormRef.value.getFormData()) || {}
loading.value = true loading.value = true
if (searchParams.payoutDate.length > 0) { if (searchParams.payoutDate.length > 0) {
searchParams.payoutDateStart = `${searchParams.payoutDate[0]}-01` searchParams.payoutDateStart = `${searchParams.payoutDate[0]}-01`
......
...@@ -274,16 +274,19 @@ ...@@ -274,16 +274,19 @@
</div> </div>
</el-scrollbar> </el-scrollbar>
</CommonDialog> </CommonDialog>
<filePreviewDialog <!-- <filePreviewDialog
v-model="previewVisible" v-model="previewVisible"
:file-url="currentOtherFile.fileUrl" :file-url="currentOtherFile.fileUrl"
:file-name="currentOtherFile.fileName" :file-name="currentOtherFile.fileName"
ref="filePreviewDialogRef" ref="filePreviewDialogRef"
/> /> -->
<!-- 文件预览弹窗 -->
<FilePreview ref="filePreviewRef" />
</div> </div>
</template> </template>
<script setup> <script setup>
import FilePreview from '@/components/Preview/filePreview.vue'
import { validateEnglish2 } from '@/utils/validate' import { validateEnglish2 } from '@/utils/validate'
import { ref, reactive, watch } from 'vue' import { ref, reactive, watch } from 'vue'
import CommonPage from '@/components/commonPage' import CommonPage from '@/components/commonPage'
...@@ -316,6 +319,7 @@ import useUserStore from '@/store/modules/user' ...@@ -316,6 +319,7 @@ import useUserStore from '@/store/modules/user'
import { loadDicts, getDictLabel } from '@/utils/useDict' import { loadDicts, getDictLabel } from '@/utils/useDict'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { getNowTime, formatToDate, formatToDateTime } from '@/utils/date' import { getNowTime, formatToDate, formatToDateTime } from '@/utils/date'
const filePreviewRef = ref(null)
let tempPolicyNo = ref('') let tempPolicyNo = ref('')
const previewVisible = ref(false) const previewVisible = ref(false)
const currentFileUrl = ref('') const currentFileUrl = ref('')
...@@ -458,8 +462,12 @@ const viewFile = row => { ...@@ -458,8 +462,12 @@ const viewFile = row => {
console.log('====================================') console.log('====================================')
console.log('其他附件', row) console.log('其他附件', row)
console.log('====================================') console.log('====================================')
previewVisible.value = true // previewVisible.value = true
currentOtherFile.value = JSON.parse(JSON.stringify(row)) // currentOtherFile.value = JSON.parse(JSON.stringify(row))
filePreviewRef.value?.open({
url: row.url,
name: row.fileName
})
} }
//获取远程搜索下拉框数据,回显数据用 //获取远程搜索下拉框数据,回显数据用
const getSelectOptions = async () => { const getSelectOptions = async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment