拆分详情按钮
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user