上报库-参数项查看-保存

This commit is contained in:
zyx.net
2022-08-03 16:32:02 +08:00
parent 9d029392da
commit 061341d589
6 changed files with 912 additions and 117 deletions
@@ -66,7 +66,7 @@
:title="$t('WhetherMergeParameters')">{{$t('WhetherMergeParameters')}}</span>
</div>
<a-form-model-item class="itemModel" prop="combineFlag">
<a-radio-group style="margin-top: 2px" @change="flagChange" class="box-input" v-model="formInline.combineFlag">
<a-radio-group style="margin-top: 2px" @change="flagChange" defaultValue='1' class="box-input" v-model="formInline.combineFlag">
<a-radio value="1">
{{$t('nonjoinder')}}
</a-radio>
@@ -82,11 +82,11 @@
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if='required'>*</span>
<span class="Required" v-if='!required'>*</span>
<span class="title-text-text"
:title="$t('MergeSeparator')">{{$t('MergeSeparator')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="required?'separator':''">
<a-form-model-item class="itemModel" :prop="!required?'separator':''">
<!-- :disabled="disabled"-->
<a-input class="box-input"
v-model="formInline.separator"
@@ -132,6 +132,11 @@ export default {
rules: {
separator:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('MergeSeparator'), trigger: 'change' },
{
pattern: /[`~!@$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/,
message: this.$t('punctuationmark'),
trigger: 'blur'
}
],
certCategory:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('certificationCategory'), trigger: 'change' },
@@ -188,9 +193,9 @@ export default {
flagChange(value){
console.log(value.target.value)
if(value.target.value == 2){
this.required = true
}else{
this.required = false
}else{
this.required = true
}
},
getNameList() {
@@ -81,12 +81,17 @@
</div>
</div>
<div class="table-operator">
<!-- 保存-->
<div @click="handlePreservation" class="operator-text" v-has="'report:detail:export:save'">
<a-icon type="check-circle"/>
{{$t('preservation')}}
</div>
<div @click="ConventionalExport" class="operator-text" v-has="'report:detail:export:normal'">
<!-- <a-icon type="plus"/>-->
<a-icon type="download"/>
{{$t('ConventionalExport')}}
</div>
<div @click="CustomExport" class="operator-text" v-has="'report:detail:export:custom'">
<!-- <a-icon type="delete"/>-->
<a-icon type="download"/>
{{$t('CustomExport')}}
</div>
</div>
@@ -134,6 +139,7 @@
<!-- </div>-->
<conventionalModel :url="url" ref="conventionalModel"/>
<customelModel :url="url" ref="customelModel"/>
<JLoading :loading="textLoading">{{this.$t('pleaseWaitWhileRunning')}}</JLoading>
</a-card>
</template>
@@ -159,6 +165,7 @@ export default {
columns:[],
selectedRowKeys: [],
formInline: {},
textLoading:false,
url: {
tableHeader: 'report/detail/getHeader',
tableList: 'report/detail/list',
@@ -286,6 +293,58 @@ export default {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
// 保存
handlePreservation(num) {
let _this = this
let postDate = []
let data = JSON.parse(JSON.stringify(this.dataSource))
let selectedRowKeysValue = []
data.forEach(res => {
selectedRowKeysValue.push(res)
})
console.log(selectedRowKeysValue)
for (let i = 0; i < selectedRowKeysValue.length; i++) {
let postDateobj = {}
let itemIn = Object.keys(selectedRowKeysValue[i])
console.log(itemIn)
for (let j = 0; j < itemIn.length; j++) {
if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) {
if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
// for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
// if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') {
// console.log(selectedRowKeysValue[i][itemIn[j]].list[k].dataValue)
// selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
// }
// if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
// selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
// }
// }
}
}
}
postDateobj.id = selectedRowKeysValue[i].id
postDate.push(postDateobj)
}
let configDataList = { configDataList: postDate }
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
this.textLoading = true
let query = {
...configDataList,
paramsManifestId: this.$route.query.id
}
postAction('/report/detail/save', query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
this.textLoading = false
} else {
_this.$message.warning(_this.$t('operationFailed'))
this.textLoading = false
}
})
} else {
}
},
getTableList() {
// console.log('this.searchParmestable',this.searchParmes)
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
@@ -319,70 +378,6 @@ export default {
getDataSource(data) {
this.dataSource = data
},
handlePreservation(num) {
let _this = this
let postDate = []
let data = JSON.parse(JSON.stringify(this.dataSource))
let selectedRowKeysValue = []
data.forEach(res => {
if (res.state == 'Wait Fill' || res.state == '待填写') {
selectedRowKeysValue.push(res)
}
})
for (let i = 0; i < selectedRowKeysValue.length; i++) {
let postDateobj = {}
let itemIn = Object.keys(selectedRowKeysValue[i])
for (let j = 0; j < itemIn.length; j++) {
if (itemIn[j] !== 'sdt') {
if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') {
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
}
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
}
}
}
}
}
postDateobj.id = selectedRowKeysValue[i].id
postDate.push(postDateobj)
}
let configDataList = { configDataList: postDate }
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
if (num && num == 1) {
this.textLoading = true
}
let query = {
...configDataList,
paramsManifestId: this.paramsManifest.id
}
postAction('/params/collectManifest/save', query).then((res) => {
if (res.success) {
if (num && num == 1) {
_this.$message.success(_this.$t('OperationSuccessful'))
this.textLoading = false
}
setTimeout(() => {
if (this.currentPersonRole == 'dre') {
this.handlePreservation()
}
}, 10000)
} else {
if (num && num == 1) {
_this.$message.warning(_this.$t('operationFailed'))
this.textLoading = false
}
}
})
} else {
if (num && num == 1) {
this.$message.warning(this.$t('theCurrentListSaved'))
}
}
},
LoginUserType(val, currentPersonRole, userType) {
this.RoleType = []
if (this.currentPersonRole == '') {
@@ -376,7 +376,7 @@ export default {
{ required: true, message: this.$t('PleaseEnter')+this.$t('NiONumber'), trigger: 'blur' },
{ min:1, max: 15, message: this.$t('cantExeed')+'15'+this.$t('characters'), trigger: 'blur' },
{
pattern: /^[0-9a-zA-Z-/. ]{1,}$/,
pattern: /^[0-9a-zA-Z-/ ]{1,}$/,
message: this.$t('onlyThree'),
trigger: 'blur'
}