上报库管理-参数项查看-自定义导出
This commit is contained in:
@@ -1,46 +1,38 @@
|
||||
<!--常规导出-->
|
||||
<template>
|
||||
<div>
|
||||
<a-drawer
|
||||
<a-modal
|
||||
:title="title"
|
||||
:maskClosable="false"
|
||||
:width="1000"
|
||||
:width="750"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
@cancel="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form>
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
:title="$t('parameterTemplate')">{{$t('parameterTemplate')}}</span>
|
||||
<div class="title-text" :title="$t('configure')">
|
||||
<span>{{$t('configure')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="templateName">
|
||||
<a-input class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.templateName"
|
||||
:placeholder="$t('PleaseEnter')+$t('templateName')"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text" :title="$t('status')">{{$t('status')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="state">
|
||||
<a-select allowClear :placeholder="$t('PleaseSelect')+$t('status')" v-model='formInline.state'>
|
||||
<a-select-option :key="'0'" :value="'0'">{{$t('Enable')}}
|
||||
</a-select-option>
|
||||
<a-select-option :key="'1'" :value="'1'">{{$t('disable')}}
|
||||
<a-form-model-item class="itemModel" prop="configIds">
|
||||
<a-select v-model="formInline.configIds" class="code-mode-select" :placeholder="$t('PleaseSelect')+$t('configure')">
|
||||
<a-select-option
|
||||
v-for="mode in dictOptions"
|
||||
:key="mode.value"
|
||||
:value="mode.value">
|
||||
{{ mode.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<!-- <j-dict-select-tag class="box-input" v-model="formInline.configIds"-->
|
||||
<!-- :options="dictOptions"-->
|
||||
<!-- :placeholder="$t('PleaseSelect')+$t('configure')"-->
|
||||
<!-- :type="'select'"-->
|
||||
<!-- :triggerChange="false" :dictCode="'cert_category'"/>-->
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -48,48 +40,29 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<div class="title-text" :title="$t('CustomTemplateName')">
|
||||
<span>{{$t('CustomTemplateName')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="certCategory">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline.certCategory"
|
||||
:placeholder="$t('PleaseSelect')+$t('CustomTemplateName')"
|
||||
:type="'select'"
|
||||
@input="certCategoryName"
|
||||
:triggerChange="false" :dictCode="'cert_category'"/>
|
||||
</a-form-model-item>
|
||||
|
||||
<span class="title-text-text"
|
||||
:title="$t('contentDescription')">{{$t('contentDescription')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="description">
|
||||
<a-input class="box-input add-input"
|
||||
type="textarea"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.description"
|
||||
:placeholder="$t('PleaseEnter')+$t('contentDescription')"/>
|
||||
</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="$t('attachmentTemplate')">{{$t('attachmentTemplate')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="fileConnectId">
|
||||
<a-button type="primary" class="button-text"
|
||||
v-model='formInline.fileConnectId'
|
||||
@click="clickButtonToUpload('fileTemplateConnectId')">
|
||||
{{ (formInline.fileConnectId === 'null' || formInline.fileConnectId === '' ||
|
||||
formInline.fileConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-form>
|
||||
</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>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('export')}}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</a-modal>
|
||||
<uploadFileChange ref="uploadFile" :accept="'.doc,.doxc,.xls,.xlsx'" @uploadSuccess="uploadSuccess"></uploadFileChange>
|
||||
</div>
|
||||
</template>
|
||||
@@ -98,6 +71,7 @@
|
||||
import PersonnelSelection from '@/components/PersonnelSelection/index'
|
||||
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
|
||||
import uploadFileChange from '@/components/uploadFileChange/file'
|
||||
import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
|
||||
|
||||
export default {
|
||||
name: 'addModel',
|
||||
@@ -108,13 +82,30 @@ export default {
|
||||
props: ['url'],
|
||||
data() {
|
||||
return {
|
||||
formInline: {},
|
||||
formInline: {
|
||||
},
|
||||
confirmLoading: false,
|
||||
description:false,
|
||||
dictOptions:[],
|
||||
visible: false,
|
||||
required:false,
|
||||
disabled:false,
|
||||
rules: {
|
||||
templateName:[
|
||||
{ required: true, message: this.$t('PleaseEnter')+this.$t('parameterTemplate'), trigger: 'change' },
|
||||
{ min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' },
|
||||
separator:[
|
||||
{ required: true, message: this.$t('PleaseEnter')+this.$t('MergeSeparator'), trigger: 'change' },
|
||||
// { min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('MergeSeparator'), trigger: 'blur' },
|
||||
],
|
||||
certCategory:[
|
||||
{ required: true, message: this.$t('PleaseEnter')+this.$t('certificationCategory'), trigger: 'change' },
|
||||
// { min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('MergeSeparator'), trigger: 'blur' },
|
||||
],
|
||||
combineFlag:[
|
||||
{ required: true, message: this.$t('PleaseSelect')+this.$t('WhetherMergeParameters'), trigger: 'change' },
|
||||
// { min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('MergeSeparator'), trigger: 'blur' },
|
||||
],
|
||||
configIds:[
|
||||
{ required: true, message: this.$t('PleaseSelect')+this.$t('configure'), trigger: 'change' },
|
||||
// { min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('MergeSeparator'), trigger: 'blur' },
|
||||
],
|
||||
description:[
|
||||
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' },
|
||||
@@ -126,7 +117,6 @@ export default {
|
||||
{ required: true, message: this.$t('PleaseSelect')+this.$t('attachmentTemplate'), trigger: 'change' },
|
||||
],
|
||||
},
|
||||
disabled: false,
|
||||
projectNameList: [],
|
||||
title: ''
|
||||
}
|
||||
@@ -170,12 +160,27 @@ export default {
|
||||
this.visible = true
|
||||
this.title = this.$t('CustomExport')
|
||||
this.formInline = {}
|
||||
this.formInline.state = '0'
|
||||
this.formInline.separator = ','
|
||||
this.formInline = {...this.formInline}
|
||||
this.getConfigure()
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['ruleForm'].clearValidate()
|
||||
})
|
||||
},
|
||||
getConfigure(){
|
||||
let pram = {
|
||||
paramsManifestId: this.$route.query.id
|
||||
}
|
||||
getAction('report/detail/getConfigLabelList', pram).then((res) => {
|
||||
if (res.success) {
|
||||
console.log(res.result)
|
||||
this.dictOptions = res.result
|
||||
} else {
|
||||
// this.$refs.uploadFile.perentHandleFunc()
|
||||
}
|
||||
})
|
||||
},
|
||||
editModel(value) {
|
||||
this.visible = true
|
||||
this.title = '编辑'
|
||||
@@ -185,40 +190,41 @@ export default {
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
this.$refs.ruleForm.resetFields()
|
||||
},
|
||||
certCategoryName(value){
|
||||
getAction('sys/dict/getDictItems/cert_category', { }).then((res) => {
|
||||
if (res.success) {
|
||||
let tt = ''
|
||||
res.result.forEach((item) => {
|
||||
if(item.value == value){
|
||||
tt=item.title
|
||||
}
|
||||
})
|
||||
this.contentListStart = tt
|
||||
console.log(this.contentListStart)
|
||||
}
|
||||
})
|
||||
console.log(value)
|
||||
},
|
||||
handleSubmit() {
|
||||
if(this.formInline.paramsTemplateName !== undefined) {
|
||||
this.formInline.paramsTemplateName = this.formInline.paramsTemplateName.trim()
|
||||
}
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
let url = ''
|
||||
let Action
|
||||
if (this.formInline.id) {
|
||||
url = this.url.edit
|
||||
Action = postAction
|
||||
} else {
|
||||
url = this.url.add
|
||||
Action = postAction
|
||||
}
|
||||
let url = this.url.ConventionalExport
|
||||
let Action = getAction
|
||||
let query = JSON.parse(JSON.stringify(this.formInline))
|
||||
Object.keys(query).forEach(res => {
|
||||
if (query[res] && query[res] instanceof Array) {
|
||||
query[res] = query[res].join(',')
|
||||
}
|
||||
})
|
||||
if(this.contentListStart){
|
||||
query.certCategoryName = this.contentListStart
|
||||
}
|
||||
query.paramsManifestId = this.$route.query.id
|
||||
this.confirmLoading = true
|
||||
Action(url, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.confirmLoading = false
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.$emit('addModelList')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
downloadFile('report/detail/exportNormal', this.$t('GeneralExportInformation')+'.zip', query)
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user