拆分详情按钮

This commit is contained in:
caoyang
2022-03-29 23:19:21 +08:00
parent cd1ee8d70a
commit 303db5f3fc
6 changed files with 287 additions and 67 deletions
+65 -9
View File
@@ -208,6 +208,25 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.field_show_type === '0'">
<div class="box-title-text" :title="item.db_field_txt">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 1">*</span>
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-tree-select
v-model="formInline[item.db_field_name]"
:maxTagCount="1"
style="width: 100%"
:tree-data="item.tree"
tree-checkable
:placeholder="$t('PleaseSelect')+item.db_field_txt"
/>
</a-form-model-item>
</div>
</a-col>
</div> </div>
</a-row> </a-row>
@@ -220,8 +239,11 @@
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import Standardselection from '@/components/Standardselection/index' import Standardselection from '@/components/Standardselection/index'
import { getAction, postAction } from '@/api/manage' import { getAction, postAction } from '@/api/manage'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '../../common/event' import eventBUs from '../../common/event'
import moment from 'moment' import moment from 'moment'
import Vue from 'vue'
export default { export default {
name: 'SplitBatForm', name: 'SplitBatForm',
@@ -270,6 +292,7 @@
confirmLoading: false, confirmLoading: false,
uploadName: 'attId', uploadName: 'attId',
accept:'application/pdf', accept:'application/pdf',
token:Vue.ls.get(ACCESS_TOKEN),
} }
}, },
mounted() { mounted() {
@@ -287,17 +310,44 @@
} else { } else {
url = this.url.addInfo url = this.url.addInfo
} }
console.log('res',this.ids) // console.log('res',this.ids)
this.formInline.ids=this.ids let formInline = JSON.parse(JSON.stringify(this.formInline))
getAction(url, this.formInline).then((res) => {
if (res.success) { Object.keys(formInline).forEach(res => {
this.$message.success(this.$t('OperationSuccessful')) if (formInline[res] instanceof Array) {
eventBUs.$emit('searchReset') formInline[res] = formInline[res].join(',')
this.$emit('addFormClick')
} else {
this.$message.warning(this.$t('operationFailed'))
} }
}) })
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 { } else {
return false return false
} }
@@ -385,6 +435,12 @@
message: res.db_field_txt + '不能为空', message: res.db_field_txt + '不能为空',
trigger: 'change', trigger: 'change',
}) })
}else if (res.field_show_type === '0') {
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
trigger: 'change',
})
} }
} }
if (rule.length > 0) { if (rule.length > 0) {
@@ -213,9 +213,10 @@
this.pageSize = pageSize this.pageSize = pageSize
this.getTableList() this.getTableList()
}, },
onSelectChange(value) { onSelectChange(value,rows) {
// console.log('rowwww',value,rows)
this.selectedRowKeys = value this.selectedRowKeys = value
this.$emit('onSelectChange', value) this.$emit('onSelectChange', value,rows)
}, },
OperationClick(ol, item) { OperationClick(ol, item) {
this.$emit(ol.ClickEvent, item) this.$emit(ol.ClickEvent, item)
@@ -131,6 +131,9 @@
ellipsis: true, ellipsis: true,
sorter: res.sort sorter: res.sort
}) })
if(res.db_field_name==''){
// scope.row.itermsConditions ? scope.row.itermsConditions.replace(/<.*?>/ig, ' ') : ''
}
if (res.click) { if (res.click) {
this.columns[index].scopedSlots = { this.columns[index].scopedSlots = {
customRender: 'showContent' customRender: 'showContent'
@@ -46,7 +46,7 @@
showAction showAction
@onSelectChange="onSelectChange" @onSelectChange="onSelectChange"
@backDocument="backDocument" @backDocument="backDocument"
@handleDel="handleDel" @deleteDetail="deleteDetail"
@detailClick="detailClick" @detailClick="detailClick"
></table-data> ></table-data>
<!-- <a-table--> <!-- <a-table-->
@@ -91,6 +91,7 @@
import ImportResult from './modules/ImportResult' import ImportResult from './modules/ImportResult'
import { getAction, postAction, deleteAction } from '@/api/manage' import { getAction, postAction, deleteAction } from '@/api/manage'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '../../../common/event'
import axios from 'axios' import axios from 'axios'
import Vue from 'vue' import Vue from 'vue'
@@ -161,7 +162,7 @@
}, //查看 }, //查看
{ {
text: this.$t('delete'), text: this.$t('delete'),
ClickEvent: 'handleDel' ClickEvent: 'deleteDetail'
} //删除 } //删除
], ],
url:{ url:{
@@ -186,7 +187,7 @@
}, },
mounted() { mounted() {
this.loadData() // this.loadData()
}, },
methods:{ methods:{
//获取列表数据 //获取列表数据
@@ -247,7 +248,8 @@
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo=this.queryParams.pageNo-1
} }
this.selectedRowKeys=[] this.selectedRowKeys=[]
this.loadData() eventBUs.$emit('searchReset')
// this.loadData()
}else{ }else{
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
@@ -272,7 +274,8 @@
if (this.tableData && this.tableData.length == 1 && this.queryParams.pageNo != 1) { if (this.tableData && this.tableData.length == 1 && this.queryParams.pageNo != 1) {
this.queryParams.pageNo = this.queryParams.pageNo - 1 this.queryParams.pageNo = this.queryParams.pageNo - 1
} }
this.loadData() eventBUs.$emit('searchReset')
// this.loadData()
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
@@ -793,7 +793,7 @@
this.contentList[this.addIndex+1]= { this.contentList[this.addIndex+1]= {
id:'', id:'',
type:'TABLE', type:'TABLE',
content:val itemContent:val
} }
}, },
//取消行数列数按钮 //取消行数列数按钮
@@ -163,7 +163,10 @@
import upload from '@/components/uploadFile/file.vue' import upload from '@/components/uploadFile/file.vue'
import SplitBatForm from '@/components/SplitBatForm/index' import SplitBatForm from '@/components/SplitBatForm/index'
import SplitAddForm from './SplitAddForm' import SplitAddForm from './SplitAddForm'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '@/common/event' import eventBUs from '@/common/event'
import Vue from 'vue'
export default { export default {
name: 'SplitDetail', name: 'SplitDetail',
components:{ components:{
@@ -185,6 +188,7 @@
total:0, total:0,
tableData:[], tableData:[],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows:[],
expandedKeys: [], expandedKeys: [],
searchValue: '', searchValue: '',
autoExpandParent: true, autoExpandParent: true,
@@ -286,10 +290,11 @@
}, },
urlBatSet:{ urlBatSet:{
getAddForm:'split/sarFileSplitItems/getBatchSetForm', getAddForm:'split/sarFileSplitItems/getBatchSetForm',
addInfo:'/split/sarFileSplitItems/batchSet', addInfo:'/jero-boot/split/sarFileSplitItems/batchSet',
}, },
batSetVisible:false, //批量设置弹框显示 batSetVisible:false, //批量设置弹框显示
ids:'' ids:'',
token:Vue.ls.get(ACCESS_TOKEN),
} }
}, },
mounted() { mounted() {
@@ -468,6 +473,7 @@
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.loadMenuData() this.loadMenuData()
eventBUs.$emit('searchReset')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
@@ -491,18 +497,21 @@
} }
this.flag=true this.flag=true
// console.log('parms',this.params) // console.log('parms',this.params)
postAction(`split/sarFileSplitMenu/addMenu`,params).then(res=>{ if(this.flag){
if(res.success){ postAction(`split/sarFileSplitMenu/addMenu`,params).then(res=>{
this.$message.success(this.$t('OperationSuccessful')) if(res.success){
this.onExpand(expandId) this.$message.success(this.$t('OperationSuccessful'))
this.form={} this.onExpand(expandId)
this.loadMenuData() this.form={}
}else{ this.loadMenuData()
this.$message.warning(this.$t('operationFailed')) eventBUs.$emit('searchReset')
} }else{
}).finally(()=>{ this.$message.warning(this.$t('operationFailed'))
this.flag=false }
}) }).finally(()=>{
this.flag=false
})
}
}else{ }else{
let params = { let params = {
info_id: this.infoId, info_id: this.infoId,
@@ -552,23 +561,54 @@
}, },
//复制按钮 //复制按钮
handleCopyManage(record){ 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={ let params={
id:record.id ids:ids.join(','),
infoIds:infoIds.join(','),
menuids:menuIds.join(',')
} }
this.$confirm({ this.$confirm({
title: this.$t('ConfirmReplication'), title: this.$t('ConfirmReplication'),
content: '', content: '',
onOk: onOk:
async () => { async () => {
deleteAction(``,params).then(res=> { axios({
if(res.success){ url: '/jero-boot/split/sarFileSplitMenu/copyMenuNotChildren',
this.$message.success(this.$t('OperationSuccessful')) method: 'post',
this.loadData() data: params,
headers: {
}else{ 'X-Access-Token':this.token
this.$message.warning(this.$t('operationFailed'))
} }
}) })
.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() {}, onCancel() {},
}); });
@@ -624,16 +664,40 @@
content: '', content: '',
onOk: onOk:
async () => { async () => {
getAction(`split/sarFileSplitItems/batchMergeItems`, { ids: ids }).then(res => { axios({
if (res.success) { url: '/jero-boot/split/sarFileSplitItems/batchMergeItems',
this.$message.success(this.$t('OperationSuccessful')) method: 'get',
params: {
} else { ids:ids
this.$message.warning(this.$t('operationFailed')) },
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(){ addFormClick(){
this.batSetVisible=false
}, },
//批量删除 //批量删除
handleBatCancel(){ handleBatCancel(){
let params={ let params={
id:this.selecIds.join(',') ids:this.selecIds.join(',')
} }
this.$confirm({ if(this.selecIds&&this.selecIds.length>0){
title: this.$t('ConfirmBatchDeletion'), this.$confirm({
content: '', title: this.$t('ConfirmBatchDeletion'),
onOk: content: '',
async () => { onOk:
deleteAction(``,params).then(res=> { async () => {
if(res.success){ axios({
this.$message.success(this.$t('OperationSuccessful')) url: '/jero-boot/split/sarFileSplitItems/batchDeleteItems',
if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ method: 'post',
this.queryParams.pageNo=this.queryParams.pageNo-1 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{ .then( (res) =>{
this.$message.warning(this.$t('operationFailed')) if (res.data.success) {
} this.$message.success(this.$t('OperationSuccessful'))
}) this.loadMenuData()
}, eventBUs.$emit('searchReset')
onCancel() {}, }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){ editClick(val){
@@ -699,12 +800,68 @@
}, },
//删除 //删除
deleteClick(val){ 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) { onSelectChange(selectedRowKeys,rows) {
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
this.selectedRows=rows
this.selecIds=selectedRowKeys this.selecIds=selectedRowKeys
// console.log('rows',this.selectedRows)
}, },
//点击页数 //点击页数
onChangePage(page,pageSize){ onChangePage(page,pageSize){