认证清单-添加 上传文件后查看,上传的文件不回显

This commit is contained in:
范强强
2023-03-27 13:53:35 +08:00
parent 21560c0cf1
commit 1833309308
2 changed files with 155 additions and 132 deletions
@@ -179,7 +179,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="deliverableTemplate"> <a-form-model-item class="itemModel" prop="deliverableTemplate">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload('deliverableTemplate',index)"> @click="clickButtonToUpload('deliverableTemplate',index,true)">
{{ (item.deliverableTemplate === 'null' || item.deliverableTemplate === '' {{ (item.deliverableTemplate === 'null' || item.deliverableTemplate === ''
|| ||
item.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles') item.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles')
@@ -719,12 +719,19 @@
} }
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
}, },
clickButtonToUpload(item, index) { clickButtonToUpload(item, index,isTrue) {
this.numIndex = index this.numIndex = index
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true this.$refs.uploadFile.visible = true
this.uploadName = item this.uploadName = item
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => { let ids = ''
console.log(index)
if (isTrue){
ids = this.formInline.dataList[index][item]
}else{
ids = this.formInline[item]
}
getAction('sys/common/getFileInfos', { id: ids }).then((res) => {
if (res.success) { if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result) this.$refs.uploadFile.perentHandleFunc(res.result)
} else { } else {
@@ -1,148 +1,153 @@
<template> <template>
<a-drawer <div>
:title="$t('edit')" <a-drawer
:maskClosable="false" :title="$t('edit')"
:width="900" :maskClosable="false"
placement="right" :width="900"
:closable="true" placement="right"
@close="handleCancel" :closable="true"
:visible="visible" @close="handleCancel"
style="height: 100%;overflow: auto;padding-bottom: 53px;"> :visible="visible"
<a-spin :spinning="confirmLoading"> style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm"> <a-spin :spinning="confirmLoading">
<a-row :gutter="24"> <a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-col :span="12"> <a-row :gutter="24">
<div class="box-title-text"> <a-col :span="12">
<div class="title-text"> <div class="box-title-text">
<span class="Required">*</span> <div class="title-text">
<span class="title-text-text" :title="$t('regulationNo')">{{$t('regulationNo')}}</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('regulationNo')">{{$t('regulationNo')}}</span>
</div>
<a-form-model-item class="itemModel" prop="serialNumber">
<a-input @click.native="serialNumberClick"
class="box-input"
:placeholder="$t('PleaseSelect')+$t('regulationNo')"
v-model="formInline.serialNumber"></a-input>
</a-form-model-item>
</div> </div>
<a-form-model-item class="itemModel" prop="serialNumber"> </a-col>
<j-dict-select-tag class="box-input" <a-col :span="12">
v-model="formInline.serialNumber" <div class="box-title-text">
:disabled="true" <div class="title-text">
:placeholder="$t('PleaseSelect')+$t('regulationNo')" <span class="Required">*</span>
:type="'select'" <span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
:triggerChange="false"/> </div>
</a-form-model-item> <a-form-model-item class="itemModel" prop="dutyTerritory">
</div> <j-dict-select-tag class="box-input"
</a-col> v-model="formInline.dutyTerritory"
<a-col :span="12"> :disabled="disabled"
<div class="box-title-text"> :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
<div class="title-text"> :type="'select'"
<span class="Required">*</span> :triggerChange="false" :dictCode="'duty_territory'"/>
<span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span> </a-form-model-item>
</div> </div>
<a-form-model-item class="itemModel" prop="dutyTerritory"> </a-col>
<j-dict-select-tag class="box-input"
v-model="formInline.dutyTerritory"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="'WVTA ID'">WVTA ID</span>
</div>
<a-form-model-item class="itemModel" prop="wvtaId">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline.wvtaId"
:placeholder="$t('PleaseEnter')+'WVTA ID'"/>
</a-form-model-item>
</div>
</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('category')">{{$t('category')}}</span> <span class="title-text-text" :title="'WVTA ID'">WVTA ID</span>
</div>
<a-form-model-item class="itemModel" prop="wvtaId">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline.wvtaId"
:placeholder="$t('PleaseEnter')+'WVTA ID'"/>
</a-form-model-item>
</div> </div>
<a-form-model-item class="itemModel" prop="category"> </a-col>
<a-input class="box-input" </a-row>
v-model="formInline.category" <a-row :gutter="24">
:disabled="disabled" <a-col :span="12">
:placeholder="$t('PleaseEnter')+$t('category')" /> <div class="box-title-text">
</a-form-model-item> <div class="title-text">
</div> <span class="Required">*</span>
</a-col> <span class="title-text-text" :title="$t('category')">{{$t('category')}}</span>
<a-col :span="12"> </div>
<div class="box-title-text"> <a-form-model-item class="itemModel" prop="category">
<div class="title-text"> <a-input class="box-input"
<span class="Required">*</span> v-model="formInline.category"
<span class="title-text-text" :title="$t('inspectionItems')">{{$t('inspectionItems')}}</span> :disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('category')" />
</a-form-model-item>
</div> </div>
<a-form-model-item class="itemModel" prop="inspectionItem"> </a-col>
<a-input class="box-input" <a-col :span="12">
v-model="formInline.inspectionItem" <div class="box-title-text">
:disabled="disabled" <div class="title-text">
:placeholder="$t('PleaseEnter')+$t('inspectionItems')"/> <span class="Required">*</span>
</a-form-model-item> <span class="title-text-text" :title="$t('inspectionItems')">{{$t('inspectionItems')}}</span>
</div> </div>
</a-col> <a-form-model-item class="itemModel" prop="inspectionItem">
</a-row> <a-input class="box-input"
<a-row :gutter="24"> v-model="formInline.inspectionItem"
<a-col :span="12"> :disabled="disabled"
<div class="box-title-text"> :placeholder="$t('PleaseEnter')+$t('inspectionItems')"/>
<div class="title-text"> </a-form-model-item>
<span class="Required">*</span>
<span class="title-text-text" :title="$t('configurationItem')">{{$t('configurationItem')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="configItem"> </a-col>
<a-input class="box-input" </a-row>
v-model="formInline.configItem" <a-row :gutter="24">
:placeholder="$t('PleaseEnter')+$t('configurationItem')"/> <a-col :span="12">
</a-form-model-item> <div class="box-title-text">
</div> <div class="title-text">
</a-col> <span class="Required">*</span>
<a-col :span="12"> <span class="title-text-text" :title="$t('configurationItem')">{{$t('configurationItem')}}</span>
<div class="box-title-text"> </div>
<div class="title-text"> <a-form-model-item class="itemModel" prop="configItem">
<span class="Required">*</span> <a-input class="box-input"
<span class="title-text-text" :title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span> v-model="formInline.configItem"
:placeholder="$t('PleaseEnter')+$t('configurationItem')"/>
</a-form-model-item>
</div> </div>
<a-form-model-item class="itemModel" </a-col>
prop="deliverableType" <a-col :span="12">
:rules="[{ required: true, message: $t('typeOfDeliverables') + $t('cannotEmpty'), trigger: 'change'},]" <div class="box-title-text">
> <div class="title-text">
<a-tree-select <span class="Required">*</span>
tree-node-filter-prop="title" <span class="title-text-text" :title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
v-model="formInline.deliverableType" </div>
:maxTagCount="1" <a-form-model-item class="itemModel"
:getPopupContainer="triggerNode=> triggerNode.parentNode" prop="deliverableType"
class="box-input" :rules="[{ required: true, message: $t('typeOfDeliverables') + $t('cannotEmpty'), trigger: 'change'},]"
style="width: 100%" >
:tree-data="DeliverableTreeList" <a-tree-select
:placeholder="$t('PleaseSelect')+$t('typeOfDeliverables')" tree-node-filter-prop="title"
/> v-model="formInline.deliverableType"
</a-form-model-item> :maxTagCount="1"
</div> :getPopupContainer="triggerNode=> triggerNode.parentNode"
</a-col> class="box-input"
</a-row> style="width: 100%"
</a-form-model> :tree-data="DeliverableTreeList"
</a-spin> :placeholder="$t('PleaseSelect')+$t('typeOfDeliverables')"
<div class="drawer-bootom-button"> />
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button> </a-form-model-item>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button> </div>
</div> </a-col>
</a-drawer> </a-row>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
<codeNumber ref="codeNumber" @regulation="regulation" />
</div>
</template> </template>
<script> <script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import codeNumber from './codeNumber'
export default { export default {
name:'editModel', name:'editModel',
props: ['url'], props: ['url'],
components:{
codeNumber
},
data() { data() {
return { return {
visible: false, visible: false,
@@ -215,6 +220,9 @@ export default {
handleCancel() { handleCancel() {
this.visible = false this.visible = false
}, },
serialNumberClick(){
this.$refs.codeNumber.add()
},
editModel(item) { editModel(item) {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
@@ -261,6 +269,14 @@ export default {
} }
}) })
}, },
regulation(item,data) {
this.formInline.serialNumber = item
this.formInline.bussDocumentLibraryId = data
this.$nextTick(()=>{
this.formInline = {... this.formInline}
this.$refs.ruleForm.validateField(['serialNumber'])
})
}
} }
} }
</script> </script>