diff --git a/jero-web/src/components/SplitBatForm/index.vue b/jero-web/src/components/SplitBatForm/index.vue index 498a5c0e0..a52b37b86 100644 --- a/jero-web/src/components/SplitBatForm/index.vue +++ b/jero-web/src/components/SplitBatForm/index.vue @@ -208,6 +208,25 @@ + + +
+
+ * + {{item.db_field_txt}} +
+ + + +
+
@@ -220,8 +239,11 @@ import PersonnelSelection from '@/components/PersonnelSelection/index' import Standardselection from '@/components/Standardselection/index' import { getAction, postAction } from '@/api/manage' + import axios from 'axios' + import { ACCESS_TOKEN } from '@/store/mutation-types' import eventBUs from '../../common/event' import moment from 'moment' + import Vue from 'vue' export default { name: 'SplitBatForm', @@ -270,6 +292,7 @@ confirmLoading: false, uploadName: 'attId', accept:'application/pdf', + token:Vue.ls.get(ACCESS_TOKEN), } }, mounted() { @@ -287,17 +310,44 @@ } else { url = this.url.addInfo } - console.log('res',this.ids) - this.formInline.ids=this.ids - getAction(url, this.formInline).then((res) => { - if (res.success) { - this.$message.success(this.$t('OperationSuccessful')) - eventBUs.$emit('searchReset') - this.$emit('addFormClick') - } else { - this.$message.warning(this.$t('operationFailed')) + // console.log('res',this.ids) + let formInline = JSON.parse(JSON.stringify(this.formInline)) + + Object.keys(formInline).forEach(res => { + if (formInline[res] instanceof Array) { + formInline[res] = formInline[res].join(',') } }) + formInline.ids=this.ids + axios({ + url: url, + method: 'post', + data: formInline, + headers: { + 'X-Access-Token':this.token + } + }) + .then( (res) => { + if(res.data.success){ + this.$message.success(this.$t('OperationSuccessful')) + // this.loadData() + this.$emit('addFormClick') + eventBUs.$emit('searchReset') + }else{ + this.$message.warning(this.$t('operationFailed')) + } + }) + + + // postAction(url, formInline).then((res) => { + // if (res.success) { + // this.$message.success(this.$t('OperationSuccessful')) + // eventBUs.$emit('searchReset') + // this.$emit('addFormClick') + // } else { + // this.$message.warning(this.$t('operationFailed')) + // } + // }) } else { return false } @@ -385,6 +435,12 @@ message: res.db_field_txt + '不能为空', trigger: 'change', }) + }else if (res.field_show_type === '0') { + rule.push({ + required: true, + message: res.db_field_txt + '不能为空', + trigger: 'change', + }) } } if (rule.length > 0) { diff --git a/jero-web/src/components/SplitDetailTable/index.vue b/jero-web/src/components/SplitDetailTable/index.vue index 3212ba5f0..4ab4c0480 100644 --- a/jero-web/src/components/SplitDetailTable/index.vue +++ b/jero-web/src/components/SplitDetailTable/index.vue @@ -213,9 +213,10 @@ this.pageSize = pageSize this.getTableList() }, - onSelectChange(value) { + onSelectChange(value,rows) { + // console.log('rowwww',value,rows) this.selectedRowKeys = value - this.$emit('onSelectChange', value) + this.$emit('onSelectChange', value,rows) }, OperationClick(ol, item) { this.$emit(ol.ClickEvent, item) diff --git a/jero-web/src/components/SplitTable/index.vue b/jero-web/src/components/SplitTable/index.vue index 8e36dbeb8..13924fe18 100644 --- a/jero-web/src/components/SplitTable/index.vue +++ b/jero-web/src/components/SplitTable/index.vue @@ -131,6 +131,9 @@ ellipsis: true, sorter: res.sort }) + if(res.db_field_name==''){ + // scope.row.itermsConditions ? scope.row.itermsConditions.replace(/<.*?>/ig, ' ') : '' + } if (res.click) { this.columns[index].scopedSlots = { customRender: 'showContent' diff --git a/jero-web/src/views/documentManage/splitting/index.vue b/jero-web/src/views/documentManage/splitting/index.vue index 2727cc0d1..807693cb0 100644 --- a/jero-web/src/views/documentManage/splitting/index.vue +++ b/jero-web/src/views/documentManage/splitting/index.vue @@ -46,7 +46,7 @@ showAction @onSelectChange="onSelectChange" @backDocument="backDocument" - @handleDel="handleDel" + @deleteDetail="deleteDetail" @detailClick="detailClick" > @@ -91,6 +91,7 @@ import ImportResult from './modules/ImportResult' import { getAction, postAction, deleteAction } from '@/api/manage' import { ACCESS_TOKEN } from '@/store/mutation-types' + import eventBUs from '../../../common/event' import axios from 'axios' import Vue from 'vue' @@ -161,7 +162,7 @@ }, //查看 { text: this.$t('delete'), - ClickEvent: 'handleDel' + ClickEvent: 'deleteDetail' } //删除 ], url:{ @@ -186,7 +187,7 @@ }, mounted() { - this.loadData() + // this.loadData() }, methods:{ //获取列表数据 @@ -247,7 +248,8 @@ this.queryParams.pageNo=this.queryParams.pageNo-1 } this.selectedRowKeys=[] - this.loadData() + eventBUs.$emit('searchReset') + // this.loadData() }else{ this.$message.warning(this.$t('operationFailed')) } @@ -272,7 +274,8 @@ if (this.tableData && this.tableData.length == 1 && this.queryParams.pageNo != 1) { this.queryParams.pageNo = this.queryParams.pageNo - 1 } - this.loadData() + eventBUs.$emit('searchReset') + // this.loadData() } else { this.$message.warning(this.$t('operationFailed')) } diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue index f9c39d459..7b6d25da7 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue @@ -793,7 +793,7 @@ this.contentList[this.addIndex+1]= { id:'', type:'TABLE', - content:val + itemContent:val } }, //取消行数列数按钮 diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue b/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue index 0515aed1d..d8963fa82 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue @@ -163,7 +163,10 @@ import upload from '@/components/uploadFile/file.vue' import SplitBatForm from '@/components/SplitBatForm/index' import SplitAddForm from './SplitAddForm' + import axios from 'axios' + import { ACCESS_TOKEN } from '@/store/mutation-types' import eventBUs from '@/common/event' + import Vue from 'vue' export default { name: 'SplitDetail', components:{ @@ -185,6 +188,7 @@ total:0, tableData:[], selectedRowKeys: [], + selectedRows:[], expandedKeys: [], searchValue: '', autoExpandParent: true, @@ -286,10 +290,11 @@ }, urlBatSet:{ getAddForm:'split/sarFileSplitItems/getBatchSetForm', - addInfo:'/split/sarFileSplitItems/batchSet', + addInfo:'/jero-boot/split/sarFileSplitItems/batchSet', }, batSetVisible:false, //批量设置弹框显示 - ids:'' + ids:'', + token:Vue.ls.get(ACCESS_TOKEN), } }, mounted() { @@ -468,6 +473,7 @@ if (res.success) { this.$message.success(this.$t('OperationSuccessful')) this.loadMenuData() + eventBUs.$emit('searchReset') } else { this.$message.warning(this.$t('operationFailed')) } @@ -491,18 +497,21 @@ } this.flag=true // console.log('parms',this.params) - postAction(`split/sarFileSplitMenu/addMenu`,params).then(res=>{ - if(res.success){ - this.$message.success(this.$t('OperationSuccessful')) - this.onExpand(expandId) - this.form={} - this.loadMenuData() - }else{ - this.$message.warning(this.$t('operationFailed')) - } - }).finally(()=>{ - this.flag=false - }) + if(this.flag){ + postAction(`split/sarFileSplitMenu/addMenu`,params).then(res=>{ + if(res.success){ + this.$message.success(this.$t('OperationSuccessful')) + this.onExpand(expandId) + this.form={} + this.loadMenuData() + eventBUs.$emit('searchReset') + }else{ + this.$message.warning(this.$t('operationFailed')) + } + }).finally(()=>{ + this.flag=false + }) + } }else{ let params = { info_id: this.infoId, @@ -552,23 +561,54 @@ }, //复制按钮 handleCopyManage(record){ + // console.log('') + let ids=[] + let infoIds=[] + let menuIds=[] + this.selectedRows.forEach(item=>{ + ids.push(item.id) + infoIds.push(item.info_id) + menuIds.push(item.menu_id) + }) let params={ - id:record.id + ids:ids.join(','), + infoIds:infoIds.join(','), + menuids:menuIds.join(',') } this.$confirm({ title: this.$t('ConfirmReplication'), content: '', onOk: async () => { - deleteAction(``,params).then(res=> { - if(res.success){ - this.$message.success(this.$t('OperationSuccessful')) - this.loadData() - - }else{ - this.$message.warning(this.$t('operationFailed')) + axios({ + url: '/jero-boot/split/sarFileSplitMenu/copyMenuNotChildren', + method: 'post', + data: params, + headers: { + 'X-Access-Token':this.token } }) + .then( (res) => { + if(res.data.success){ + this.$message.success(this.$t('OperationSuccessful')) + // this.loadData() + this.loadMenuData() + eventBUs.$emit('searchReset') + }else{ + this.$message.warning(this.$t('operationFailed')) + } + }) + + // postAction(`split/sarFileSplitMenu/copyMenuNotChildren`,params).then(res=> { + // if(res.success){ + // this.$message.success(this.$t('OperationSuccessful')) + // // this.loadData() + // this.loadMenuData() + // eventBUs.$emit('searchReset') + // }else{ + // this.$message.warning(this.$t('operationFailed')) + // } + // }) }, onCancel() {}, }); @@ -624,16 +664,40 @@ content: '', onOk: async () => { - getAction(`split/sarFileSplitItems/batchMergeItems`, { ids: ids }).then(res => { - if (res.success) { - this.$message.success(this.$t('OperationSuccessful')) - - } else { - this.$message.warning(this.$t('operationFailed')) + axios({ + url: '/jero-boot/split/sarFileSplitItems/batchMergeItems', + method: 'get', + params: { + ids:ids + }, + headers: { + 'X-Access-Token':this.token } - }).finally(()=>{ - this.selectedRowKeys=[] }) + .then( (res) => { + if (res.data.success) { + this.$message.success(this.$t('OperationSuccessful')) + this.loadMenuData() + eventBUs.$emit('searchReset') + this.selectedRowKeys=[] + } else { + this.$message.warning(this.$t('operationFailed')) + } + }).finally(()=>{ + + }) + + + // getAction(`split/sarFileSplitItems/batchMergeItems`, { ids: ids }).then(res => { + // if (res.success) { + // this.$message.success(this.$t('OperationSuccessful')) + // + // } else { + // this.$message.warning(this.$t('operationFailed')) + // } + // }).finally(()=>{ + // this.selectedRowKeys=[] + // }) } }) } @@ -659,32 +723,69 @@ }, //批量设置确定提交 addFormClick(){ - + this.batSetVisible=false }, //批量删除 handleBatCancel(){ let params={ - id:this.selecIds.join(',') + ids:this.selecIds.join(',') } - this.$confirm({ - title: this.$t('ConfirmBatchDeletion'), - content: '', - onOk: - async () => { - deleteAction(``,params).then(res=> { - if(res.success){ - this.$message.success(this.$t('OperationSuccessful')) - if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ - this.queryParams.pageNo=this.queryParams.pageNo-1 + if(this.selecIds&&this.selecIds.length>0){ + this.$confirm({ + title: this.$t('ConfirmBatchDeletion'), + content: '', + onOk: + async () => { + axios({ + url: '/jero-boot/split/sarFileSplitItems/batchDeleteItems', + method: 'post', + data: params, + transformRequest: [function (data) { + // Do whatever you want to transform the data + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Access-Token':this.token } - this.loadData() - }else{ - this.$message.warning(this.$t('operationFailed')) - } - }) - }, - onCancel() {}, - }); + }) + .then( (res) =>{ + if (res.data.success) { + this.$message.success(this.$t('OperationSuccessful')) + this.loadMenuData() + eventBUs.$emit('searchReset') + }else{ + this.$message.warning(this.$t('operationFailed')) + } + }) + .catch( (error) =>{ + console.log(error); + }); + + + // postAction(`split/sarFileSplitItems/batchDeleteItems`,params).then(res=> { + // if(res.success){ + // this.$message.success(this.$t('OperationSuccessful')) + // // if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ + // // this.queryParams.pageNo=this.queryParams.pageNo-1 + // // } + // // this.loadData() + // this.loadMenuData() + // eventBUs.$emit('searchReset') + // }else{ + // this.$message.warning(this.$t('operationFailed')) + // } + // }) + }, + onCancel() {}, + }); + }else{ + this.$message.warning(this.$t('selectLeastOne')) + } }, //编辑 editClick(val){ @@ -699,12 +800,68 @@ }, //删除 deleteClick(val){ + let params={ + ids:val.id + } + this.$confirm({ + title: this.$t('ConfirmBatchDeletion'), + content: '', + onOk: + async () => { + axios({ + url: '/jero-boot/split/sarFileSplitItems/batchDeleteItems', + method: 'post', + data: params, + transformRequest: [function (data) { + // Do whatever you want to transform the data + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Access-Token':this.token + } + }) + .then( (res) =>{ + if (res.data.success) { + this.$message.success(this.$t('OperationSuccessful')) + this.loadMenuData() + eventBUs.$emit('searchReset') + }else{ + this.$message.warning(this.$t('operationFailed')) + } + }) + .catch( (error) =>{ + console.log(error); + }); + + // postAction(`split/sarFileSplitItems/batchDeleteItems`,params).then(res=> { + // if(res.success){ + // this.$message.success(this.$t('OperationSuccessful')) + // // if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ + // // this.queryParams.pageNo=this.queryParams.pageNo-1 + // // } + // // this.loadData() + // this.loadMenuData() + // eventBUs.$emit('searchReset') + // }else{ + // this.$message.warning(this.$t('operationFailed')) + // } + // }) + }, + onCancel() {}, + }); }, //选择框 onSelectChange(selectedRowKeys,rows) { this.selectedRowKeys = selectedRowKeys; + this.selectedRows=rows this.selecIds=selectedRowKeys + // console.log('rows',this.selectedRows) }, //点击页数 onChangePage(page,pageSize){