|
@@ -94,7 +94,7 @@
|
|
|
</a-form>
|
|
|
</a-collapse-panel>
|
|
|
<a-collapse-panel key="2" header="表体信息">
|
|
|
- <a-button type="primary" @click="onBodyReset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="onBodyReset" v-if="!isView">重置</a-button>
|
|
|
<a-form ref="bodyFormRef" :model="bodyData" :rules="bodyRules" layout="inline" style="margin-bottom: 20px;">
|
|
|
<a-row :gutter="[0, 16]">
|
|
|
<a-col :span="8">
|
|
@@ -274,12 +274,14 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
- <a-button type="primary" style="margin-right: 8px;" v-if="!(bodyData.id || bodyData.__index)" @click="onBodyAdd">插入</a-button>
|
|
|
- <a-button type="primary" style="margin-right: 8px;" v-else @click="onBodyEdit">保存</a-button>
|
|
|
- <xn-batch-delete
|
|
|
- :selectedRowKeys="bodySelectedRowKeys"
|
|
|
- @batchDelete="deleteBatchBody"
|
|
|
- />
|
|
|
+ <template v-if="!isView">
|
|
|
+ <a-button type="primary" style="margin-right: 8px;" v-if="!(bodyData.id || bodyData.__index)" @click="onBodyAdd">插入</a-button>
|
|
|
+ <a-button type="primary" style="margin-right: 8px;" v-else @click="onBodyEdit">保存</a-button>
|
|
|
+ <xn-batch-delete
|
|
|
+ :selectedRowKeys="bodySelectedRowKeys"
|
|
|
+ @batchDelete="deleteBatchBody"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<a-table
|
|
|
style="margin-top: 10px"
|
|
|
bordered
|
|
@@ -303,15 +305,21 @@
|
|
|
</a-table>
|
|
|
</a-collapse-panel>
|
|
|
<a-collapse-panel key="3" header="附件信息">
|
|
|
- <div>
|
|
|
- 友情提示<br/>
|
|
|
- 1、附件大小要求不超过4M,如果文件过大,建议拆分多个上传;<br/>
|
|
|
- 2、附件格式要求:PDF文件;<br/>
|
|
|
- 3、同一附件类型可以上传多个附件;<br/>
|
|
|
- 4、附件传输过程中会出现传输失败的情况,请随时关注附件传输状态;<br/>
|
|
|
- 5、要求上传复印件的可上传原件的扫描件。
|
|
|
- </div>
|
|
|
- <xn-upload ref="ref_upload" v-model:value="fileData.fileUrl" @onChange="fileChange" accept=".pdf" v-if="showFileUpload"/>
|
|
|
+ <template v-if="!isView">
|
|
|
+ <div>
|
|
|
+ 友情提示<br/>
|
|
|
+ 1、附件大小要求不超过4M,如果文件过大,建议拆分多个上传;<br/>
|
|
|
+ 2、附件格式要求:PDF文件;<br/>
|
|
|
+ 3、同一附件类型可以上传多个附件;<br/>
|
|
|
+ 4、附件传输过程中会出现传输失败的情况,请随时关注附件传输状态;<br/>
|
|
|
+ 5、要求上传复印件的可上传原件的扫描件。
|
|
|
+ </div>
|
|
|
+ <xn-upload ref="ref_upload" v-model:value="fileData.fileUrl" @onChange="fileChange" accept=".pdf" v-if="showFileUpload"/>
|
|
|
+ <xn-batch-delete
|
|
|
+ :selectedRowKeys="fileSelectedRowKeys"
|
|
|
+ @batchDelete="deleteBatchFile"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<a-table
|
|
|
style="margin-top: 10px"
|
|
|
bordered
|
|
@@ -335,11 +343,9 @@
|
|
|
</template>
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
|
<template v-if="isView">
|
|
|
- <a-button type="link" primary size="small" @click="onBodyReset(), bodyData = cloneDeep(record)">查看</a-button>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <a-button type="link" primary size="small" @click="onBodyReset(), bodyData = cloneDeep(record)">编辑</a-button>
|
|
|
- <a-button type="link" danger size="small" @click="onFileDel(index)">删除</a-button>
|
|
|
+ <a-button type="link" danger size="small" @click="onFileDel(index)" v-if="!isView">删除</a-button>
|
|
|
</template>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -353,7 +359,7 @@
|
|
|
import tool from '@/utils/tool'
|
|
|
import {cloneDeep} from 'lodash-es'
|
|
|
import {required} from '@/utils/formRules'
|
|
|
-import qyRecordInfoApi from '@/api/biz/qyRecordInfoApi'
|
|
|
+import qyRecordInfoApi from '@/api/yqyc/qyRecordInfoApi'
|
|
|
import {message, Modal} from "ant-design-vue";
|
|
|
import {createVNode} from "vue";
|
|
|
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
|
|
@@ -398,11 +404,17 @@ const fileOptions = {
|
|
|
}
|
|
|
}
|
|
|
// 打开抽屉
|
|
|
-const onOpen = (record, view = false) => {
|
|
|
+const onOpen = (record, view = false, type) => {
|
|
|
isView.value = view
|
|
|
if (record) {
|
|
|
- let recordData = cloneDeep(record)
|
|
|
- formData.value = Object.assign({}, recordData)
|
|
|
+ qyRecordInfoApi.qyRecordInfoDetail({id: record.id}).then(res => {
|
|
|
+ formData.value = res
|
|
|
+ bodyList.value = res.qyRecardBodyAddParams
|
|
|
+ fileList.value = res.qyRecordAttachmentAddParams
|
|
|
+ if (type) {
|
|
|
+ formData.value.applyType = type
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
formData.value.companyCode = userInfo.companyNumber
|
|
|
formData.value.companyName = userInfo.companyName
|
|
@@ -665,12 +677,14 @@ const onSubmit = () => {
|
|
|
.then(() => {
|
|
|
submitLoading.value = true
|
|
|
const formDataParam = cloneDeep(formData.value)
|
|
|
- if (formDataParam.id) {
|
|
|
+ if (!formDataParam.id) {
|
|
|
formDataParam.qyRecardBodyAddParams = bodyList.value
|
|
|
formDataParam.qyRecordAttachmentAddParams = fileList.value
|
|
|
} else {
|
|
|
formDataParam.qyRecardBodyEditParams = bodyList.value
|
|
|
formDataParam.qyRecordAttachmentEditParams = fileList.value
|
|
|
+ delete formDataParam.qyRecardBodyAddParams
|
|
|
+ delete formDataParam.qyRecordAttachmentAddParams
|
|
|
}
|
|
|
formDataParam.status = '2'
|
|
|
qyRecordInfoApi
|
|
@@ -693,12 +707,14 @@ const onTemp = () => {
|
|
|
.then(() => {
|
|
|
submitLoading.value = true
|
|
|
const formDataParam = cloneDeep(formData.value)
|
|
|
- if (formDataParam.id) {
|
|
|
+ if (!formDataParam.id) {
|
|
|
formDataParam.qyRecardBodyAddParams = bodyList.value
|
|
|
formDataParam.qyRecordAttachmentAddParams = fileList.value
|
|
|
} else {
|
|
|
formDataParam.qyRecardBodyEditParams = bodyList.value
|
|
|
formDataParam.qyRecordAttachmentEditParams = fileList.value
|
|
|
+ delete formDataParam.qyRecardBodyAddParams
|
|
|
+ delete formDataParam.qyRecordAttachmentAddParams
|
|
|
}
|
|
|
formDataParam.status = '1'
|
|
|
qyRecordInfoApi
|
|
@@ -722,7 +738,7 @@ const onBodyAdd = () => {
|
|
|
bodyFormRef.value
|
|
|
.validate()
|
|
|
.then(() => {
|
|
|
- bodyList.value.push(Object.assign({__index: bodyList.value.length + 1}, bodyData.value))
|
|
|
+ bodyList.value.push(Object.assign({__index: new Date().getTime()}, bodyData.value))
|
|
|
onBodyReset()
|
|
|
message.success('插入表体信息成功!')
|
|
|
})
|
|
@@ -792,6 +808,7 @@ const fileChange = (file) => {
|
|
|
if (file) {
|
|
|
const f = ref_upload.value.uploadFileList()[0]
|
|
|
fileList.value.push({
|
|
|
+ __index: new Date().getTime(),
|
|
|
attachmentUrl: f.url,
|
|
|
attachmentName: f.name,
|
|
|
attachmentFormat: getFileExtension(f.name),
|
|
@@ -818,6 +835,17 @@ const onFileDel = (recode, index) => {
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
+const deleteBatchFile = () => {
|
|
|
+ fileList.value = fileList.value.filter(v => {
|
|
|
+ let flag = true
|
|
|
+ bodySelectedRowKeys.value.forEach(s => {
|
|
|
+ if ((v.id && (v.id === s.id)) || (v.__index && (v.__index === s.__index))) {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return flag
|
|
|
+ })
|
|
|
+}
|
|
|
// 抛出函数
|
|
|
defineExpose({
|
|
|
onOpen
|