禅道 任务264

feature-JimuReport-1106-yjl
张同海 4 weeks ago
parent 0a7935ea0d
commit 32e7d7401e

@ -1,6 +1,39 @@
<template>
<div class="ds-file">
<a-button v-if="show" type="primary" @click="openFileModel"></a-button>
<a-form
v-if="succinct"
ref="fileForm"
:model="formData"
name="basic"
layout="vertical"
autocomplete="off"
@finishFailed="onFinishFailed"
@finish="onFinish"
>
<a-form-item name="upFileList">
<a-upload
ref="RefsUpload"
:file-list="upFileList"
:before-upload="beforeUpload"
:maxCount="maxCount"
accept=".xlsm,.xlsx,.xls,.pdf,.txt,.pms,.jpeg,.png"
:rules="[{ required: true, message: '请上传文件!' }]"
@remove="handleRemove"
@change="ChangeUpload"
:showUploadList="false"
>
<a-button>
<span
class="iconfont icon-shujushangchuan-shixin"
:style="{ fontSize: '12px', marginRight: '5px' }"
></span>
选择文件
</a-button>
</a-upload>
</a-form-item>
</a-form>
<a-button v-if="show && !succinct" type="primary" @click="openFileModel"></a-button>
<a-modal
class="ds-form-detail"
v-model:visible="visible"
@ -38,6 +71,7 @@
</a-form-item>
<a-form-item label="附件" name="upFileList">
<a-upload
ref="RefsUpload"
:file-list="upFileList"
:before-upload="beforeUpload"
:maxCount="maxCount"
@ -135,6 +169,11 @@
type: Number,
default: null,
},
//
succinct: {
type: Boolean,
default: false,
},
})
//
const visible = ref(false)
@ -146,12 +185,17 @@
typeName: '',
fileList: [],
})
const RefsUpload = ref<any>(null)
//
const init = () => {
let code = props.fileType ? `${props.fileType}_file_type` : 'file_type'
getDictOption(code).then((res) => {
fileTypeList.value = res
if (!props.succinct) {
visible.value = true
} else {
RefsUpload.value.click()
}
formData.typeCode = props.dynamicDisabled
fileTypeList.value.forEach((e: any) => {
if (e.value == props.dynamicDisabled) {
@ -170,6 +214,34 @@
newFileList.splice(index, 1)
upFileList.value = newFileList
}
function ChangeUpload(e) {
const postData = new FormData()
const list = unref(upFileList)
list.forEach((item) => {
postData.append('formCollection[]', item)
})
postData.append('linkId', props.id)
postData.append('typeCode', formData.typeCode)
postData.append('typeName', formData.typeName)
loading.value = true
AddMultiFiles(postData)
.then((res) => {
loading.value = false
visible.value = false
upFileList.value = []
if (props.showFileList) {
dsFileList.value.init()
emits('handleSuccess', { id: res.data })
} else {
emits('handleSuccess')
}
createMessage.success('上传成功!')
})
.catch((res) => {
loading.value = false
createMessage.error('上传失败!')
})
}
function beforeUpload(file) {
//
if (props.maxSize) {
@ -206,6 +278,7 @@
}
}
const fileForm = ref(null)
//
const dsFileList = ref(null)
const emits = defineEmits(['handleSuccess', 'FnTriggerSave'])

@ -236,6 +236,30 @@ export const searchFormSchema: FormSchema[] = [
}
},
},
{
field: 'isOnlineId',
label: '是否上线',
component: 'ApiSelect',
colProps: { span: 4 },
defaultValue: '1',
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_IsOnlineEnum').then((res) => {
resolve(res)
})
})
},
labelField: 'label',
valueField: 'value',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
field: 'CM_ctnCode',
label: '箱型',

@ -61,6 +61,7 @@
fileType="infoclient"
:dynamicDisabled="3"
:TriggerSave="true"
:succinct="true"
:id="rowId"
@FnTriggerSave="FnTriggerSave"
@handleSuccess="handleSuccess"
@ -165,6 +166,7 @@
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
rowId.value = ''
}
setModalProps({ loading: false })
})
@ -210,7 +212,6 @@
someCheck.value = false
res.data.bodyList.forEach((item) => {
list.value.push({ ...item, selected: false })
console.log(item.cntrno)
if (item.isOnlineId != 1) {
MessageArr.push(item.cntrno)
}
@ -614,7 +615,6 @@
ApiData.jsonDataStr = JSON.stringify(ApiData.jsonDataStr)
ExportExcelByColumn(ApiData).then((res) => {
console.log(res)
const xlsUrl = window.URL.createObjectURL(
new Blob([res], {
type: 'application/vnd.ms-excel;charset=utf-8',

Loading…
Cancel
Save