平台件项目库 法规清单关联平台件修改

This commit is contained in:
zyx.net
2023-09-20 10:36:53 +08:00
parent 1525744867
commit 4d3ddee406
3 changed files with 110 additions and 118 deletions
@@ -9,30 +9,17 @@
:visible="visible" :visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;"> style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px" v-for='(item,index) in data'> <div style="margin-bottom: 60px" v-for='(item,index) in data'>
<div>{{'GB 111'}}{{$t('associatedItem')}}</div> <div>{{item.title}}{{$t('associatedItem')}}</div>
<a-table <a-table
:components="drag(columns,'columns')" :components="drag(columns,'columns')"
:columns="columns" :columns="columns"
rowKey="id" rowKey="id"
:scroll="{x: 1000}" :scroll="{x: 1000}"
:data-source="item.list" :data-source="item.result"
:pagination="false" :pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:'' }" :row-selection="{ selectedRowKeys: selectQuery['selectedRowKeys'+index], onChange:(value, data) =>onChange(value, data, index),columnTitle:'' }"
:loading="loading"> :loading="loading">
</a-table> </a-table>
<!-- <div class="page" v-if="dataList.length > 0">-->
<!-- <a-pagination-->
<!-- :show-total="total => $t('total')+` ${total} `+$t('strip')"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :page-size.sync="pageSize"-->
<!-- :total="total"-->
<!-- :current="pageNo"-->
<!-- @change="onChange"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
</div> </div>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
@@ -57,6 +44,8 @@
queryParam: {}, queryParam: {},
confirmLoading: false, confirmLoading: false,
selectedRowKeys: [], selectedRowKeys: [],
selectQuery:{},
selectedRow: [],
columns: [ columns: [
{ {
title: this.$t('entryName'), title: this.$t('entryName'),
@@ -81,7 +70,7 @@
}, },
{ {
title: this.$t('NareaOfResponsibility'), title: this.$t('NareaOfResponsibility'),
dataIndex: 'dutyTerritory', dataIndex: 'dutyTerritory_dictText',
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
width: 140 width: 140
@@ -102,57 +91,57 @@
}, },
{ {
title: this.$t('verify') + '-' + this.$t('typeOfDeliverables'), title: this.$t('verify') + '-' + this.$t('typeOfDeliverables'),
dataIndex: 'deliverableTypeName', dataIndex: 'verifyDeliverableTypeName',
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
width: 130 width: 130
}, },
], ],
data: [ data: [
{ // {
id:'1', // id:'1',
list:[ // list:[
{ // {
createBy: "linda.zhao", // createBy: "linda.zhao",
createByCn: null, // createByCn: null,
createTime: "2023-04-17 19:10:14", // createTime: "2023-04-17 19:10:14",
cut: null, // cut: null,
id: "1647920396307046401", // id: "1647920396307046401",
name: "EU/UK Regulation List V23.04", // name: "EU/UK Regulation List V23.04",
orderBy: null, // orderBy: null,
orderByField: null, // orderByField: null,
readFlag: null, // readFlag: null,
state: "1", // state: "1",
state_dictText: "已发布", // state_dictText: "已发布",
sysOrgCode: "SUPERVISORY_ORGANIZATION-3-522", // sysOrgCode: "SUPERVISORY_ORGANIZATION-3-522",
updateBy: "admin", // updateBy: "admin",
updateTime: "2023-05-10 15:24:33", // updateTime: "2023-05-10 15:24:33",
upgradeExplanation: "asd", // upgradeExplanation: "asd",
} // }
] // ]
}, // },
{ // {
id:'1', // id:'1',
list:[ // list:[
{ // {
createBy: "linda.zhao", // createBy: "linda.zhao",
createByCn: null, // createByCn: null,
createTime: "2023-04-17 19:10:14", // createTime: "2023-04-17 19:10:14",
cut: null, // cut: null,
id: "1647920396307046401", // id: "1647920396307046401",
name: "EU/UK Regulation List V23.04", // name: "EU/UK Regulation List V23.04",
orderBy: null, // orderBy: null,
orderByField: null, // orderByField: null,
readFlag: null, // readFlag: null,
state: "1", // state: "1",
state_dictText: "已发布", // state_dictText: "已发布",
sysOrgCode: "SUPERVISORY_ORGANIZATION-3-522", // sysOrgCode: "SUPERVISORY_ORGANIZATION-3-522",
updateBy: "admin", // updateBy: "admin",
updateTime: "2023-05-10 15:24:33", // updateTime: "2023-05-10 15:24:33",
upgradeExplanation: "asd", // upgradeExplanation: "asd",
} // }
] // ]
}, // },
], ],
content: [], content: [],
loading: false, loading: false,
@@ -173,7 +162,7 @@
this.type = type this.type = type
this.ids = ids this.ids = ids
this.queryParam = {} this.queryParam = {}
this.selectedRowKeys = [] this.selectQuery = {}
this.replacePage() this.replacePage()
}, },
searchQuery() { searchQuery() {
@@ -185,15 +174,6 @@
this.queryParam = {} this.queryParam = {}
this.replacePage() this.replacePage()
}, },
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() { replacePage() {
let query = { let query = {
ids: this.ids, ids: this.ids,
@@ -203,57 +183,69 @@
this.loading = true this.loading = true
postAction('project/projectLibraryBase/listPlatform', query).then((res) => { postAction('project/projectLibraryBase/listPlatform', query).then((res) => {
if (res.success) { if (res.success) {
this.dataList = res.result.records || [] this.data = res.result || []
this.selectedRowKeys = this.dataList.map(item => item.id) this.data.forEach((item,index) => {
this.total = res.result.total let name = 'selectedRowKeys'+index
this.selectQuery[name] = item.result.map(val => val.id)
// for(var i in item.result.map(val => val.id)){
// this.selectedRowKeys.push(item.result.map(val => val.id)[i])
// }
// this.selectedRow.push(item.result)
})
console.log(this.selectQuery)
// console.log(this.selectedRow)
this.loading = false this.loading = false
this.visible = true if(this.data.length >= 1){
this.visible = true
}
} else { } else {
this.loading = false this.loading = false
} }
}) })
}, },
onSelectChange(value) { onChange(value,data,ind) {
this.selectedRowKeys = value this.selectQuery['selectedRowKeys'+ind] = value
// if (this.selectedRowKeys.length > 1) { this.data = [...this.data]
// this.selectedRowKeys.shift()
// }
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
}, },
handleSubmit(flag) { handleSubmit(flag) {
console.log(this.selectedRowKeys) if (this.selectQuery) {
return
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let array = Object.values(this.selectQuery)
this.confirmLoading = false let arr = []
this.$emit('associatedplatthreeForm',selectedRowKeys.join(',')) this.data.forEach((val,index) => {
this.selectedRowKeys = [] array.forEach((item,index1) => {
// postAction(this.url.addModel, { if(index == index1){
// dummyInventoryBaseId: selectedRowKeys.join(','), arr.push({
// projectLibraryId: this.$route.query.id, lawsInventoryId:val.lawsInventoryId,
// flag: flag platformLawsInventoryIds:item.join(',')
// }).then((res) => { })
// if (res.success) { }
// this.confirmLoading = false })
// this.$message.success(this.$t('OperationSuccessful')) })
// this.visible = false arr = arr
// this.selectedRowKeys = [] console.log(arr)
// this.$emit('transferListForm') let query = {
// } else { list : JSON.parse(JSON.stringify(arr))
// if (res.message == '该虚拟清单的维护清单中没有数据,是否需要添加') { }
// this.confirmLoading = false console.log(query)
// this.getAdd() postAction('project/lawsInventoryPlatformEO/addBatch', query).then((res) => {
// return if (res.success) {
// } this.confirmLoading = false
// this.$message.warning(this.$t('operationFailed')) this.$message.success(this.$t('OperationSuccessful'))
// this.confirmLoading = false this.visible = false
// } this.selectQuery = {}
// }) this.$emit('associatedplatthreeForm')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) // this.$message.warning(this.$t('selectLeastOne'))
this.visible = false
} }
}, },
getAdd() { getAdd() {
@@ -1297,18 +1297,18 @@
} }
}else{ }else{
flag = '2' flag = '2'
this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
associatedplatForm(id,flag,type,ids){ associatedplatForm(id,flag,type,ids){
if(flag == '1'){ // if(flag == '1'){
this.$refs.associatedplatthreeRef.transferModel(id,type,ids) // this.$refs.associatedplatthreeRef.transferModel(id,type,ids)
}else{ // }else{
this.$refs.associatedplattwoRef.transferModel(id,type,ids) // this.$refs.associatedplattwoRef.transferModel(id,type,ids)
} // }
}, },
associatedplattwoForm(id,type,ids){ associatedplattwoForm(id,type,ids){
this.$refs.associatedplatthreeRef.transferModel(id,type,ids) // this.$refs.associatedplatthreeRef.transferModel(id,type,ids)
}, },
associatedplatthreeForm(id){ associatedplatthreeForm(id){
console.log(id) console.log(id)
@@ -1982,7 +1982,7 @@
this.$refs.associatedplatthreeRef.transferModel(id,type,ids) this.$refs.associatedplatthreeRef.transferModel(id,type,ids)
}, },
associatedplatthreeForm(id){ associatedplatthreeForm(id){
console.log(id) this.getList()
}, },
//批量设置 //批量设置
batSettingClick() { batSettingClick() {