对接法规月报

This commit is contained in:
qq787203167
2022-06-29 10:52:19 +08:00
parent 209e02538d
commit de03a8350d
5 changed files with 126 additions and 93 deletions
+1
View File
@@ -1054,4 +1054,5 @@ module.exports = {
Copyparameterlist: 'Copy parameter list', Copyparameterlist: 'Copy parameter list',
Templatenamelist: 'Template name - parameter item collection list', Templatenamelist: 'Template name - parameter item collection list',
newNiONumber: 'Number', newNiONumber: 'Number',
English: 'English'
} }
+1
View File
@@ -1058,4 +1058,5 @@ module.exports = {
Copyparameterlist: '复制参数清单', Copyparameterlist: '复制参数清单',
Templatenamelist: '模板名称-参数项收集清单', Templatenamelist: '模板名称-参数项收集清单',
newNiONumber: 'NIO编号', newNiONumber: 'NIO编号',
English:'英文',
} }
+14 -6
View File
@@ -8,7 +8,7 @@
:class="{'uploadFile':isUploadFile}" :class="{'uploadFile':isUploadFile}"
name="file" name="file"
:file-list="myfileList" :file-list="myfileList"
:multiple="true" :multiple="multiple"
:action="uploadAction+'?state='+state+'&cut='+cut" :action="uploadAction+'?state='+state+'&cut='+cut"
:headers="headers" :headers="headers"
@preview="preview" @preview="preview"
@@ -33,7 +33,7 @@
export default { export default {
name: 'file', name: 'file',
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile'], props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple'],
data() { data() {
return { return {
visible: false, visible: false,
@@ -46,7 +46,8 @@
fileList: [], fileList: [],
myfileList: [], myfileList: [],
isLoding: false, isLoding: false,
cut: '' cut: '',
multiple: true
} }
}, },
created() { created() {
@@ -62,6 +63,9 @@
} else if (long && long == 'en-us') { } else if (long && long == 'en-us') {
this.cut = 'en' this.cut = 'en'
} }
if (this.isMultiple) {
this.multiple = false
}
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
}, },
methods: { methods: {
@@ -76,11 +80,15 @@
this.myfileList = [] this.myfileList = []
} }
}, },
beforeUpload(file) { beforeUpload(file, fileList) {
console.log(file)
// let thisFileType = this.thisFileType.replace(/\s+/g, ""); // let thisFileType = this.thisFileType.replace(/\s+/g, "");
this.fileTypeSatus = true this.fileTypeSatus = true
if (this.isMultiple) {
if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) {
this.$message.warning('只能上传一个文件')
return false
}
}
//TODO 客户要求不拦截文件 //TODO 客户要求不拦截文件
// if(file.type){ // if(file.type){
// if (thisFileType.indexOf(file.type) != -1) { // if (thisFileType.indexOf(file.type) != -1) {
@@ -9,7 +9,7 @@
<span>{{$t('RegulationMonthlyName')}}</span> <span>{{$t('RegulationMonthlyName')}}</span>
</div> </div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('RegulationMonthlyName')" <j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('RegulationMonthlyName')"
v-model="queryParam.RegulationMonthlyName"></j-input> v-model="queryParam.name"></j-input>
</div> </div>
</a-col> </a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons"> <span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
@@ -46,7 +46,7 @@
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" <a class="text-operation"
@click="withdraw(record)"> @click="withdraw(record)">
{{record.state == 2 ? $t('release') : $t('withdraw')}} {{record.issueStatus == 2 ? $t('release') : $t('withdraw')}}
</a> </a>
<a class="text-operation" <a class="text-operation"
@click="deleteLib(record)">{{$t('deleteLib')}}</a> @click="deleteLib(record)">{{$t('deleteLib')}}</a>
@@ -82,9 +82,9 @@
return { return {
//url传参严格按照当前命名 //url传参严格按照当前命名
url: { url: {
list: '', list: '/report/lawsMonthlyReportManageEO/page',
urlWithdraw: '', urlWithdraw: '/report/lawsMonthlyReportManageEO/issue',
deleteBatch: '' deleteBatch: '/report/lawsMonthlyReportManageEO/deleteBatch'
}, },
loading: false, loading: false,
dataSource: [], dataSource: [],
@@ -111,7 +111,7 @@
align: 'center', align: 'center',
width: 140, width: 140,
ellipsis: true, ellipsis: true,
dataIndex: 'releaseStatus' dataIndex: 'issueStatus'
}, },
{ {
title: this.$t('uploadTime'), title: this.$t('uploadTime'),
@@ -210,17 +210,17 @@
} }
}, },
managementAddForm() { managementAddForm() {
this.getList() this.pageOnChange(1)
}, },
//撤回 //撤回
withdraw(val) { withdraw(val) {
let item = {} let item = {}
let content = '' let content = ''
if (val.state == 2) { if (val.issueStatus == 2) {
content = this.$t('confirmRelease') content = this.$t('confirmRelease')
item.state = 1 item.issueStatus = 1
} else { } else {
item.state = 2 item.issueStatus = 2
content = this.$t('confirmWithdraw') content = this.$t('confirmWithdraw')
} }
item.id = val.id item.id = val.id
@@ -19,11 +19,11 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('monthlyReportRegulations')">{{$t('monthlyReportRegulations')}}</span> :title="$t('monthlyReportRegulations')">{{$t('monthlyReportRegulations')}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="'RegulationMonthlyName'"> <a-form-model-item class="itemModel" :prop="'name'">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload('RegulationMonthlyName')"> @click="clickButtonToUpload('name')">
{{ (formInline['RegulationMonthlyName'] === 'null' || formInline['RegulationMonthlyName'] === '' || {{ (formInline['name'] === 'null' || formInline['name'] === '' ||
formInline['RegulationMonthlyName'] == null) ? $t('clickUpload') : $t('viewUploadedFiles') formInline['name'] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}} }}
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
@@ -36,9 +36,20 @@
<span class="title-text-text" :title="$t('monthlyLanguage')">{{$t('monthlyLanguage')}}</span> <span class="title-text-text" :title="$t('monthlyLanguage')">{{$t('monthlyLanguage')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="useExplain"> <a-form-model-item class="itemModel" prop="useExplain">
<a-textarea <a-select :placeholder="$t('PleaseSelect')+$t('monthlyLanguage')"
:placeholder="$t('PleaseEnter')+$t('instructionForUse')" :disabled="disabled"
v-model.trim="formInline.useExplain" :rows="4"/> class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="formInline.language">
<a-select-option v-for="(item, key) in languageList"
:key="item.value"
:value="item.value">
<span style="display: inline-block;width: 100%" :title="item.text ">
{{ item.text }}
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -50,7 +61,7 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div> </div>
</a-drawer> </a-drawer>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" :isMultiple="true" @uploadSuccess="uploadSuccess"></uploadFile>
</div> </div>
</template> </template>
@@ -69,32 +80,33 @@
name: [ name: [
{ {
required: true, required: true,
message: this.$t('VirtualListName') + this.$t('cannotEmpty'), message: this.$t('monthlyReportRegulations') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'change'
},
{
max: 100,
message: this.$t('VirtualListName') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
} }
], ],
useExplain: [ language: [
{ {
required: true, required: true,
message: this.$t('instructionForUse') + this.$t('cannotEmpty'), message: this.$t('monthlyLanguage') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'change'
},
{
max: 500,
message: this.$t('instructionForUse') + this.$t('cannotExceed') + 500 + this.$t('Characters'),
trigger: 'blur'
} }
] ]
}, },
visible: false, visible: false,
languageList: [
{
text: this.$t('chinese'),
value: 1
},
{
text: this.$t('English'),
value: 2
}
],
formInline: {}, formInline: {},
confirmLoading: false, confirmLoading: false,
uploadName: '' uploadName: '',
disabled: false
} }
}, },
methods: { methods: {
@@ -104,7 +116,18 @@
handleSubmit() { handleSubmit() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
this.confirmLoading = true
postAction('/report/lawsMonthlyReportManageEO/add', this.formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('managementAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
} }
}) })
}, },