|
|
@@ -657,6 +657,31 @@ export default {
|
|
|
})
|
|
|
|
|
|
console.log('处理后导入数据:\n', list)
|
|
|
+ const newArray = list.filter(
|
|
|
+ (item) => item.shu_ju_lai_yuan_ === 'importAssociation'
|
|
|
+ )
|
|
|
+ let updList = []
|
|
|
+ let updateParams = {}
|
|
|
+ if (newArray.length > 0) {
|
|
|
+ newArray.forEach((item) => {
|
|
|
+ let o = {
|
|
|
+ where: {
|
|
|
+ id_: item.she_bei_bian_hao_ || ''
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ xiao_zhun_z_q_: item.jian_ding_zhou_qi || '',
|
|
|
+ shi_yong_ke_shi_: item.dan_wei_id || '',
|
|
|
+ yi_xiao_ri_qi_: item.shi_shi_ri_qi_ || '',
|
|
|
+ xiao_zhun_you_xia: item.chu_chang_bian_ha || ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ updList.push(o)
|
|
|
+ })
|
|
|
+ updateParams = {
|
|
|
+ tableName: 't_sbdj',
|
|
|
+ updList
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 数据校验
|
|
|
let index = 0
|
|
|
@@ -705,13 +730,15 @@ export default {
|
|
|
tableName: 't_mjsbjdxzjhzb',
|
|
|
paramWhere: list
|
|
|
}
|
|
|
- this.$common.request('add', params).then(() => {
|
|
|
- this.$message.success('导入成功')
|
|
|
- if (typeof callback === 'function') {
|
|
|
- callback(list)
|
|
|
- }
|
|
|
- this.$emit('confirm', this.paramForm)
|
|
|
- })
|
|
|
+ await this.$common.request('add', params).then(() => {})
|
|
|
+ if (newArray.length > 0) {
|
|
|
+ await this.$common.request('update', updateParams)
|
|
|
+ }
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ if (typeof callback === 'function') {
|
|
|
+ callback(list)
|
|
|
+ }
|
|
|
+ this.$emit('confirm', this.paramForm)
|
|
|
},
|
|
|
dataTransfer(dataset, data, from = 'id_', to = 'name_') {
|
|
|
const list = data ? data.split(',') : []
|