diff --git a/src/pages/regulatoryRepository/accessStandardsAndRegulations/page/listTracking.vue b/src/pages/regulatoryRepository/accessStandardsAndRegulations/page/listTracking.vue index fc014d546..55774d81e 100644 --- a/src/pages/regulatoryRepository/accessStandardsAndRegulations/page/listTracking.vue +++ b/src/pages/regulatoryRepository/accessStandardsAndRegulations/page/listTracking.vue @@ -4,25 +4,22 @@
- - - - - - - + + + + + + + @@ -49,15 +46,13 @@ type="primary" class="common-button-primary add-button" size="mini" - @click="openModal(null,'addOpt')" - v-btn-permission="'J2YEFN9MH4KWW5HMR2QH'" + @click="showAddModel(1, null)" >新增 批量删除
@@ -78,64 +73,42 @@ align="center"> - - - - - - - - - + @@ -153,14 +275,54 @@ export default { name: "listTracking", data () { return { + submitLoading: false, + attrTypeOptions: [ + { label: '下拉选项', value: 'SEL_OPTION' }, + { label: '树形结构', value: 'TREE' } + ], + addOrEdit: '', + attributeEOFormRules: { + lawId: [ + { required: true, message: '标准编号/政策编号不能为空', trigger: 'blur' }, + ], + lawName: [ + { required: true, message: '标准名称/政策名称不能为空', trigger: 'blur' }, + ], + productType: [ + { required: true, message: '产品类型不能为空', trigger: 'change' } + ], + implTime: [ + { required: true, message: '实施日期不能为空', trigger: 'change' } + ], + implRequire: [ + { required: true, message: '实施要求不能为空', trigger: 'change' } + ], + }, + attributeEO: { + id: '', + lawId: '', + lawName: '', + productType: '', + implTime: '', + implRequire: '', + }, + styles: { + height: 'calc(100% - 55px)', + overflow: 'auto', + paddingBottom: '53px', + position: 'static' + }, + attributeTitle: '', + showInfoModal: false, searching: false, total: 0, page: 1, rows: 10, // 查询相关参数 sarSarAccessEOSearch: { - ListName: '', - country: '', + lawId: '', + lawName: '', + productType: '', accessContent: '', energyKind: '', applyArctic: '', @@ -173,6 +335,7 @@ export default { sarAccessListTotal: 0, loading: false, selectedList: [], + selectedString: '', // 新增、编辑 准入信息字段 sarAccessEO: { country: '', @@ -183,18 +346,6 @@ export default { }, drawerPage: 1, // 当前抽屉分页的页码 drawerTotal: 0, // 抽屉分页的总条数 - sarAccessEORules: { - region: [ - {required: true, message: '区域不能为空', trigger: 'change'} - ], - country: [ - {required: true, message: '国家不能为空', trigger: 'change'} - ], - accessContent: [ - {required: true, message: '表格名称不能为空', trigger: 'blur'}, - {type: 'string', max: 100, message: '表格名称不能超过100个字符', trigger: 'blur'} - ] - }, countryOptions: [], drawerCountryOptions: [], // 准入信息 国家下拉框 drawerCountryTwoOptions: [], // 数据搜索-多属性搜索国家下拉框 @@ -247,11 +398,153 @@ export default { } }, methods: { + saveInfo () { + this.$refs['attributeEO'].validate((valid) => { + if (valid) { + if (this.addOrEdit === 'add') { + this.submitLoading = true + this.$http.putData( + '/sarIssueTrack/issueTrack', + this.attributeEO, + { + _this: this, + loading: 'roleDataLoading' + }, + (res) => { + if (res.ok) { + this.submitLoading = false + this.showInfoModal = false + this.searchSarAccessBtn() + this.getAttrByPage() + this.cancelModel() + // this.showInfoModal = false + } else { + this.submitLoading = false + } + } + ) + } else { + this.$http.postData( + 'sarIssueTrack/issueTrack', + this.attributeEO, + { + _this: this, + loading: 'roleDataLoading' + }, + (res) => { + if (res.ok) { + this.submitLoading = false + this.showInfoModal = false + this.searchSarAccessBtn() + this.getAttrByPage() + this.cancelModel() + this.showInfoModal = false + } else { + this.submitLoading = false + } + } + ) + } + } + }) + }, + cancelModel () { + this.$nextTick(() => { + this.$refs['attributeEO'].resetFields() + this.attributeEO = { + id: '', + lawId: '', + lawName: '', + productType: '', + implTime: '', + implRequire: '', + } + }) + this.showInfoModal = false + }, + showAddModel (oprState, row) { + this.oprState = oprState + if (this.oprState === 1) { + this.addOrEdit = 'add' + this.attributeTitle = '新增' + this.getDictionarySelList(null) + this.$nextTick(() => { + this.attributeEO = { + id: '', + lawId: '', + lawName: '', + productType: '', + implTime: '', + implRequire: '', + } + this.$refs['attributeEO'].resetFields() + }) + this.showInfoModal = true + } else if (this.oprState === 2) { + this.addOrEdit = 'edit' + this.attributeTitle = '编辑' + this.getDictionarySelList(null) + this.attributeEO = JSON.parse(JSON.stringify(row)) + this.showInfoModal = true + } + }, + getDictionarySelList (id) { + this.$http.get( + 'sys/dictionary/getDictionarySelList', + { + id: id + }, + { + _this: this + }, + (res) => { + this.relateDicIdOptions = res.data + }, + (e) => {} + ) + }, + // 删除 + deleteSarAccess(flag, id) { + if (flag === 'delOne') { + this.selectedList = []; + this.selectedList[0] = id; + } + if (this.selectedList.length === 0) { + this.$message.warning('请选择要删除的数据') + } else { + this.$confirm('确定删除这些数据?', '提示', { + confirmButtonText: '确定', + confirmButtonClass: 'common-button-primary', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + for (let i = 0; i < this.selectedList.length; i++) { + this.selectedString += this.selectedList[i]+"," + } + let selectedString = this.selectedString.substring(0,this.selectedString.length-1) + this.$http.delete("sarIssueTrack/issueTrack", {selectedString},{ + _this: this, + loading: 'roleDataLoading' + }, (res) => { + this.selectedList = []; + this.$message.success('删除成功') + this.searchSarAccessBtn() + this.getAttrByPage() + this.cancelModel() + }, e => { + }); + }).catch(() => { + // 取消删除,清空选择 + this.selectedList = []; + }) + } + }, // 更多 handleCommand (command) { + console.log('536',command) switch (command[1]) { case '编辑': - this.editTable(command[0]) + this.showAddModel(2, command[0]) break case '删除': this.deleteSarAccess('delOne', command[0].id) @@ -265,7 +558,24 @@ export default { }, //分页查询 searchSarAccess (advanceSearch) { - + console.log('准备开始分页查询') + this.$http.get("/sarIssueTrack/issueTrack", { + page: 1, + pageSize: this.pageSize, + ...this.sarSarAccessEOSearch, + sortKey: 2 + }, { + _this: this + }, res => { + let arr = res.data; + console.log('分页查询中',arr) + this.sarAccessListDatas = arr + this.tableLoading = false + this.sarSarAccessEOSearch.page = 1 + this.sarAccessListTotal = res.data.total + }, e => { + }); + console.log('分页查询完毕') }, pageChange (page) { this.sarSarAccessEOSearch.page = page @@ -277,7 +587,9 @@ export default { }, clearSearch (search = true) { // search 字段是为了处理高级查询时清空字段用的 - this.sarSarAccessEOSearch.country = '' + this.sarSarAccessEOSearch.lawId = '' + this.sarSarAccessEOSearch.lawName = '' + this.sarSarAccessEOSearch.productType = '' this.sarSarAccessEOSearch.accessContent = '' this.sarSarAccessEOSearch.applyArctic = '' this.sarSarAccessEOSearch.energyKind = '' @@ -285,15 +597,6 @@ export default { this.sarSarAccessEOSearch.page = 1 search && this.searchSarAccess() }, - // 新增相关 - openModal (row, optType) { - this.$router.push({ - name: 'ListOfStandardsAndRegulationsDetails' - }) - }, - // 删除 - deleteSarAccess (flag, id) { - }, // 表格选择框 selectOne (alldata, nowdata) { this.selectedList = [] @@ -301,16 +604,26 @@ export default { this.selectedList.push(alldata[i]['id']) } }, - // 点击 table编辑按钮 事件 - editTable (item) { - sessionStorage.setItem('accessRow', JSON.stringify(item)) - this.$router.push({ - name: 'ListOfStandardsAndRegulationsDetails', - query: { - id: item.id - } - }) - }, + // // 点击 table编辑按钮 事件 + // editTable (item) { + // sessionStorage.setItem('accessRow', JSON.stringify(item)) + // this.$router.push({ + // name: 'ListOfStandardsAndRegulationsDetails', + // query: { + // id: item.id + // } + // }) + // }, + // async handleTableEdit (params) { + // await this.queryDisplayLocationList(params.sarType) + // // this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields() + // this.addOrEdit = 'edit' + // this.attributeTitle = '编辑' + // this.showInfoModal = true + // this.$nextTick(() => { + // this.attributeEO = JSON.parse(JSON.stringify(params)) + // }) + // }, }, mounted () { // 分页查询数据