拆分详情按钮

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>
</div>
</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>
</a-row>
@@ -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) {
@@ -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)
@@ -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'
@@ -46,7 +46,7 @@
showAction
@onSelectChange="onSelectChange"
@backDocument="backDocument"
@handleDel="handleDel"
@deleteDetail="deleteDetail"
@detailClick="detailClick"
></table-data>
<!-- <a-table-->
@@ -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'))
}
@@ -793,7 +793,7 @@
this.contentList[this.addIndex+1]= {
id:'',
type:'TABLE',
content:val
itemContent:val
}
},
//取消行数列数按钮
@@ -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){