市场认证清单-维护清单-交付物模板
This commit is contained in:
@@ -145,6 +145,25 @@
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text"
|
||||
:title="$t('deliverableTemplate')">{{$t('deliverableTemplate')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="deliverableTemplate">
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload('deliverableTemplate',index,true)">
|
||||
{{ (item.deliverableTemplate === 'null' || item.deliverableTemplate === ''
|
||||
||
|
||||
item.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
@@ -154,12 +173,14 @@
|
||||
</div>
|
||||
</a-drawer>
|
||||
<codeNumber ref="codeNumber" @regulation="regulation" />
|
||||
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import codeNumber from './codeNumber'
|
||||
import uploadFile from '@/components/uploadFile/file'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
@@ -167,7 +188,8 @@ export default {
|
||||
name:"addModel",
|
||||
props: ['url'],
|
||||
components:{
|
||||
codeNumber
|
||||
codeNumber,
|
||||
uploadFile
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -299,7 +321,45 @@ export default {
|
||||
this.formInline = {... this.formInline}
|
||||
this.$refs.ruleForm.validateField(['serialNumber'])
|
||||
})
|
||||
}
|
||||
},
|
||||
//交付物模板上传
|
||||
clickButtonToUpload(item, index,isTrue) {
|
||||
this.numIndex = index
|
||||
this.$refs.uploadFile.perentHandleFunc()
|
||||
this.$refs.uploadFile.visible = true
|
||||
this.uploadName = item
|
||||
let ids = ''
|
||||
console.log(index)
|
||||
if (isTrue){
|
||||
ids = this.formInline.dataList[index][item]
|
||||
}else{
|
||||
ids = this.formInline[item]
|
||||
}
|
||||
console.log(this.formInline,1111)
|
||||
getAction('sys/common/getFileInfos', { id: ids }).then((res) => {
|
||||
if (res.success) {
|
||||
this.$refs.uploadFile.perentHandleFunc(res.result)
|
||||
} else {
|
||||
this.$refs.uploadFile.perentHandleFunc()
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 上传文件的回调 */
|
||||
uploadSuccess(data) {
|
||||
let attIdList = []
|
||||
if (data && data.length > 0) {
|
||||
data.map(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
})
|
||||
}
|
||||
/** 赋值给当前对应的表单文件 */
|
||||
if (this.formInline.id) {
|
||||
this.formInline[this.uploadName] = attIdList.join(',')
|
||||
} else {
|
||||
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
|
||||
}
|
||||
this.formInline = { ...this.formInline }
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -366,4 +426,13 @@ export default {
|
||||
font-size: 16px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.button-text {
|
||||
height: 38px;
|
||||
width: calc(100% - 100px);
|
||||
line-height: 38px;
|
||||
background: #fff;
|
||||
border: 1px #00B3BE solid;
|
||||
color: #00B3BE;
|
||||
}
|
||||
</style>
|
||||
@@ -127,6 +127,25 @@
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text"
|
||||
:title="$t('deliverableTemplate')">{{$t('deliverableTemplate')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="deliverableTemplate">
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload('deliverableTemplate')">
|
||||
{{ (formInline.deliverableTemplate === 'null' || formInline.deliverableTemplate === ''
|
||||
||
|
||||
formInline.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
<div class="drawer-bootom-button">
|
||||
@@ -135,18 +154,21 @@
|
||||
</div>
|
||||
</a-drawer>
|
||||
<codeNumber ref="codeNumber" @regulation="regulation" />
|
||||
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
|
||||
import codeNumber from './codeNumber'
|
||||
import uploadFile from '@/components/uploadFile/file'
|
||||
|
||||
export default {
|
||||
name:'editModel',
|
||||
props: ['url'],
|
||||
components:{
|
||||
codeNumber
|
||||
codeNumber,
|
||||
uploadFile
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -276,7 +298,44 @@ export default {
|
||||
this.formInline = {... this.formInline}
|
||||
this.$refs.ruleForm.validateField(['serialNumber'])
|
||||
})
|
||||
}
|
||||
},
|
||||
//交付物模板
|
||||
clickButtonToUpload(item, index,isTrue) {
|
||||
this.numIndex = index
|
||||
this.$refs.uploadFile.perentHandleFunc()
|
||||
this.$refs.uploadFile.visible = true
|
||||
this.uploadName = item
|
||||
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) {
|
||||
this.$refs.uploadFile.perentHandleFunc(res.result)
|
||||
} else {
|
||||
this.$refs.uploadFile.perentHandleFunc()
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 上传文件的回调 */
|
||||
uploadSuccess(data) {
|
||||
let attIdList = []
|
||||
if (data && data.length > 0) {
|
||||
data.map(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
})
|
||||
}
|
||||
/** 赋值给当前对应的表单文件 */
|
||||
if (this.formInline.id) {
|
||||
this.formInline[this.uploadName] = attIdList.join(',')
|
||||
} else {
|
||||
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
|
||||
}
|
||||
this.formInline = { ...this.formInline }
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -333,4 +392,13 @@ export default {
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
|
||||
.button-text {
|
||||
height: 38px;
|
||||
width: calc(100% - 100px);
|
||||
line-height: 38px;
|
||||
background: #fff;
|
||||
border: 1px #00B3BE solid;
|
||||
color: #00B3BE;
|
||||
}
|
||||
</style>
|
||||
+26
-3
@@ -206,9 +206,17 @@
|
||||
@change="tableOnChange"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:columns="columns">
|
||||
<span slot="item" slot-scope="text,record">
|
||||
<a @click="itemClick(record)">{{text}}</a>
|
||||
<span slot="deliverableTemplate" slot-scope="text,result">
|
||||
<span class="viewFile"
|
||||
@click="viewFileClick(result.deliverableTemplate)"
|
||||
v-if="result.deliverableTemplate">
|
||||
{{$t('viewFile')}}
|
||||
</span>
|
||||
<span v-else>--</span>
|
||||
</span>
|
||||
<!-- <span slot="item" slot-scope="text,record">-->
|
||||
<!-- <a @click="itemClick(record)">{{text}}</a>-->
|
||||
<!-- </span>-->
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<a v-if="isTrue"
|
||||
class="text-operation"
|
||||
@@ -236,6 +244,7 @@
|
||||
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
|
||||
<edit-model :url="url" ref="editModelRef" @editModelList="editModelList"></edit-model>
|
||||
<bat-setting :url="url" ref="batSettingRef" @batSettingList="batSettingList"></bat-setting>
|
||||
<viewFileModel ref="viewFileModelRef"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -250,6 +259,7 @@
|
||||
import addModel from '../components/addModel'
|
||||
import editModel from '../components/editModel'
|
||||
import batSetting from '../components/batSetting'
|
||||
import viewFileModel from '@/components/viewFileModel/index'
|
||||
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
|
||||
|
||||
export default {
|
||||
@@ -261,7 +271,8 @@
|
||||
transferList,
|
||||
addModel,
|
||||
editModel,
|
||||
batSetting
|
||||
batSetting,
|
||||
viewFileModel
|
||||
},
|
||||
mixins: [ResizeHeader, ResizeColumnProvide],
|
||||
data() {
|
||||
@@ -340,6 +351,14 @@
|
||||
width: 330,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: this.$t('deliverableTemplate'),
|
||||
align: 'left',
|
||||
dataIndex: 'deliverableTemplate',
|
||||
width: 330,
|
||||
ellipsis: true,
|
||||
scopedSlots: { customRender: 'deliverableTemplate' }
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
align: 'left',
|
||||
@@ -536,6 +555,10 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 交付物模板
|
||||
viewFileClick(item) {
|
||||
this.$refs.viewFileModelRef.clickButtonToUpload(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user