|
|
@ -15,21 +15,28 @@
|
|
|
|
ref="RefsUpload"
|
|
|
|
ref="RefsUpload"
|
|
|
|
:file-list="upFileList"
|
|
|
|
:file-list="upFileList"
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
:maxCount="maxCount"
|
|
|
|
:maxCount="1"
|
|
|
|
accept=".xlsm,.xlsx,.xls,.pdf,.txt,.pms,.jpeg,.png"
|
|
|
|
accept=".xlsm,.xlsx,.xls,.pdf,.txt,.pms,.jpeg,.png"
|
|
|
|
:rules="[{ required: true, message: '请上传文件!' }]"
|
|
|
|
:rules="[{ required: true, message: '请上传文件!' }]"
|
|
|
|
@remove="handleRemove"
|
|
|
|
@remove="handleRemove"
|
|
|
|
@change="ChangeUpload"
|
|
|
|
@change="ChangeUpload"
|
|
|
|
:showUploadList="false"
|
|
|
|
:showUploadList="false"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<a-button :disabled="props.id ? false : true">
|
|
|
|
<!-- <a-button :disabled="props.id ? false : true">
|
|
|
|
|
|
|
|
<span
|
|
|
|
|
|
|
|
class="iconfont icon-shujushangchuan-shixin"
|
|
|
|
|
|
|
|
:style="{ fontSize: '12px', marginRight: '5px' }"
|
|
|
|
|
|
|
|
></span>
|
|
|
|
|
|
|
|
选择文件
|
|
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
<p class="UploadText" v-if="props.id ? false : true">请先保存,再进行文件上传。</p> -->
|
|
|
|
|
|
|
|
<a-button>
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
class="iconfont icon-shujushangchuan-shixin"
|
|
|
|
class="iconfont icon-shujushangchuan-shixin"
|
|
|
|
:style="{ fontSize: '12px', marginRight: '5px' }"
|
|
|
|
:style="{ fontSize: '12px', marginRight: '5px' }"
|
|
|
|
></span>
|
|
|
|
></span>
|
|
|
|
选择文件
|
|
|
|
选择文件
|
|
|
|
</a-button>
|
|
|
|
</a-button>
|
|
|
|
<p class="UploadText" v-if="props.id ? false : true">请先保存,再进行文件上传。</p>
|
|
|
|
|
|
|
|
</a-upload>
|
|
|
|
</a-upload>
|
|
|
|
</a-form-item>
|
|
|
|
</a-form-item>
|
|
|
|
</a-form>
|
|
|
|
</a-form>
|
|
|
@ -215,33 +222,38 @@
|
|
|
|
newFileList.splice(index, 1)
|
|
|
|
newFileList.splice(index, 1)
|
|
|
|
upFileList.value = newFileList
|
|
|
|
upFileList.value = newFileList
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function ChangeUpload(e) {
|
|
|
|
async function ChangeUpload() {
|
|
|
|
const postData = new FormData()
|
|
|
|
let FnUp = (id) => {
|
|
|
|
const list = unref(upFileList)
|
|
|
|
console.log('FnUp', 1111111111)
|
|
|
|
list.forEach((item) => {
|
|
|
|
const postData = new FormData()
|
|
|
|
postData.append('formCollection[]', item)
|
|
|
|
const list = unref(upFileList)
|
|
|
|
})
|
|
|
|
// list.forEach((item) => {
|
|
|
|
postData.append('linkId', props.id)
|
|
|
|
// postData.append('formCollection[]', item)
|
|
|
|
postData.append('typeCode', formData.typeCode)
|
|
|
|
// })
|
|
|
|
postData.append('typeName', formData.typeName)
|
|
|
|
postData.append('formCollection', list[list.length - 1])
|
|
|
|
loading.value = true
|
|
|
|
postData.append('linkId', id)
|
|
|
|
AddMultiFiles(postData)
|
|
|
|
postData.append('typeCode', formData.typeCode)
|
|
|
|
.then((res) => {
|
|
|
|
postData.append('typeName', formData.typeName)
|
|
|
|
loading.value = false
|
|
|
|
loading.value = true
|
|
|
|
visible.value = false
|
|
|
|
AddMultiFiles(postData)
|
|
|
|
upFileList.value = []
|
|
|
|
.then((res) => {
|
|
|
|
if (props.showFileList) {
|
|
|
|
loading.value = false
|
|
|
|
dsFileList.value.init()
|
|
|
|
visible.value = false
|
|
|
|
emits('handleSuccess', { id: res.data })
|
|
|
|
upFileList.value = []
|
|
|
|
} else {
|
|
|
|
if (props.showFileList) {
|
|
|
|
emits('handleSuccess')
|
|
|
|
dsFileList.value.init()
|
|
|
|
}
|
|
|
|
emits('handleSuccess', { id: res.data })
|
|
|
|
createMessage.success('上传成功!')
|
|
|
|
} else {
|
|
|
|
})
|
|
|
|
emits('handleSuccess')
|
|
|
|
.catch((res) => {
|
|
|
|
}
|
|
|
|
loading.value = false
|
|
|
|
createMessage.success('上传成功!')
|
|
|
|
createMessage.error('上传失败!')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((res) => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
createMessage.error('上传失败!')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
emits('FnUpload', FnUp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function beforeUpload(file) {
|
|
|
|
function beforeUpload(file) {
|
|
|
|
// 判断文件大小
|
|
|
|
// 判断文件大小
|
|
|
@ -282,7 +294,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
// 附件列表组件
|
|
|
|
// 附件列表组件
|
|
|
|
const dsFileList = ref(null)
|
|
|
|
const dsFileList = ref(null)
|
|
|
|
const emits = defineEmits(['handleSuccess', 'FnTriggerSave'])
|
|
|
|
const emits = defineEmits(['handleSuccess', 'FnTriggerSave', 'FnUpload'])
|
|
|
|
// 提交上传
|
|
|
|
// 提交上传
|
|
|
|
const handleOk = async () => {
|
|
|
|
const handleOk = async () => {
|
|
|
|
const res = await fileForm.value.validateFields()
|
|
|
|
const res = await fileForm.value.validateFields()
|
|
|
|