|
|
@@ -326,7 +326,45 @@ export default {
|
|
|
async handleAgree (key, data) {
|
|
|
// console.log(data)
|
|
|
data.status = (key === 'agree' ? this.isNextStep(data) : '已拒绝')
|
|
|
- this.handleAccess(data)
|
|
|
+ // 改为通用接口
|
|
|
+ const tableName = 't_adjustment'
|
|
|
+ const updateParams = {
|
|
|
+ tableName,
|
|
|
+ updList: [
|
|
|
+ {
|
|
|
+ where: {
|
|
|
+ id_: data.id
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ status: data.status
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ this.$common.request('update', updateParams).then(async () => {
|
|
|
+ const sonTableName = 't_adjustment_detail'
|
|
|
+ const sonUpdateParams = {
|
|
|
+ tableName: sonTableName,
|
|
|
+ updList: [
|
|
|
+ {
|
|
|
+ where: {
|
|
|
+ parent_id_: data.id
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ status_: data.status
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ await this.$common.request('update', sonUpdateParams) // 更新调班子表
|
|
|
+ ActionUtils.successMessage()
|
|
|
+ if (data.status === '已通过') {
|
|
|
+ // 获取排班子表数据
|
|
|
+ const response = await getAdjustment({ id: data.id })
|
|
|
+ this.handleAccess(response.data)
|
|
|
+ }
|
|
|
+ this.sendMsg(data) // 发送系统通知
|
|
|
+ this.search()
|
|
|
+ }).catch((e) => { console.error(e) })
|
|
|
+ /*
|
|
|
saveAdjustment(data).then(() => {
|
|
|
ActionUtils.successMessage()
|
|
|
if (data.status === '已通过') {
|
|
|
@@ -334,7 +372,7 @@ export default {
|
|
|
}
|
|
|
this.sendMsg(data) // 发送系统通知
|
|
|
this.search()
|
|
|
- }).catch((e) => { console.error(e) })
|
|
|
+ }).catch((e) => { console.error(e) })*/
|
|
|
},
|
|
|
/**
|
|
|
* 批量处理同意/不同意
|
|
|
@@ -347,6 +385,7 @@ export default {
|
|
|
}
|
|
|
const tableName = 't_adjustment'
|
|
|
let uparr = []
|
|
|
+ let sonuparr = []
|
|
|
data.forEach((el) => {
|
|
|
el.status = key === 'massAgree' ? this.isNextStep(el) : '已拒绝'
|
|
|
uparr.push({
|
|
|
@@ -357,16 +396,30 @@ export default {
|
|
|
status: el.status
|
|
|
}
|
|
|
})
|
|
|
+ sonuparr.push({
|
|
|
+ where: {
|
|
|
+ parent_id_: el.id
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ status_: el.status
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
const updateParams = {
|
|
|
tableName,
|
|
|
updList: uparr
|
|
|
}
|
|
|
- this.$common.request('update', updateParams).then(() => {
|
|
|
+ this.$common.request('update', updateParams).then(async () => {
|
|
|
+ const sonTableName = 't_adjustment_detail'
|
|
|
+ const sonUpdateParams = {
|
|
|
+ tableName: sonTableName,
|
|
|
+ updList: sonuparr
|
|
|
+ }
|
|
|
+ await this.$common.request('update', sonUpdateParams) // 更新调班子表
|
|
|
ActionUtils.successMessage()
|
|
|
data.forEach(async (el) => { // 给每个申请单发通知
|
|
|
if (el.status === '已通过') {
|
|
|
- // 获取子表数据
|
|
|
+ // 获取排班子表数据
|
|
|
const response = await getAdjustment({ id: el.id })
|
|
|
this.handleAccess(response.data)
|
|
|
}
|