|
|
|
@ -245,7 +245,9 @@
|
|
|
|
let flow_id = [];
|
|
|
|
let flow_id = [];
|
|
|
|
let chuchai_pay_id = [];
|
|
|
|
let chuchai_pay_id = [];
|
|
|
|
let chuchai_pay_details = [];
|
|
|
|
let chuchai_pay_details = [];
|
|
|
|
let person_arr = []
|
|
|
|
let person_arr = []
|
|
|
|
|
|
|
|
let plan_moneys = []
|
|
|
|
|
|
|
|
let away_ids_arr = []
|
|
|
|
let money = 0
|
|
|
|
let money = 0
|
|
|
|
flowsList.map(f => {
|
|
|
|
flowsList.map(f => {
|
|
|
|
if (f.flow && !f.oa_ht_away_links) {
|
|
|
|
if (f.flow && !f.oa_ht_away_links) {
|
|
|
|
@ -255,11 +257,18 @@
|
|
|
|
if (person_arr.length < 1) {
|
|
|
|
if (person_arr.length < 1) {
|
|
|
|
this.$message.warning('请选择待审批的出差报销')
|
|
|
|
this.$message.warning('请选择待审批的出差报销')
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log("person_arr",person_arr)
|
|
|
|
person_arr.map(item => {
|
|
|
|
person_arr.map(item => {
|
|
|
|
flow_id.push(item.flow.id);
|
|
|
|
flow_id.push(item.flow.id);
|
|
|
|
chuchai_pay_id.push(item.belongs_id);
|
|
|
|
chuchai_pay_id.push(item.belongs_id);
|
|
|
|
chuchai_pay_details.push(item.id);
|
|
|
|
chuchai_pay_details.push(item.id);
|
|
|
|
|
|
|
|
away_ids_arr.push(item.flow.out_away_id)
|
|
|
|
|
|
|
|
plan_moneys.push({
|
|
|
|
|
|
|
|
plan_id:item.plan_id,
|
|
|
|
|
|
|
|
money:item.amt,
|
|
|
|
|
|
|
|
away_id:item.flow.out_away_id
|
|
|
|
|
|
|
|
})
|
|
|
|
money += parseFloat(item.amt)
|
|
|
|
money += parseFloat(item.amt)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// away/save
|
|
|
|
// away/save
|
|
|
|
@ -270,7 +279,7 @@
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
id,
|
|
|
|
id,
|
|
|
|
plan_id,
|
|
|
|
plan_id,
|
|
|
|
amt
|
|
|
|
amt,
|
|
|
|
} = item;
|
|
|
|
} = item;
|
|
|
|
if (!planMap[plan_id]) {
|
|
|
|
if (!planMap[plan_id]) {
|
|
|
|
planMap[plan_id] = {
|
|
|
|
planMap[plan_id] = {
|
|
|
|
@ -283,14 +292,15 @@
|
|
|
|
planMap[plan_id].use_money += parseFloat(amt);
|
|
|
|
planMap[plan_id].use_money += parseFloat(amt);
|
|
|
|
planMap[plan_id].chuchai_pay_details.push(id);
|
|
|
|
planMap[plan_id].chuchai_pay_details.push(id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log("away_plan_links", away_plan_links)
|
|
|
|
console.log("away_plan_links", plan_moneys,away_plan_links)
|
|
|
|
|
|
|
|
// return
|
|
|
|
const res = await updateAwayDetails({
|
|
|
|
const res = await updateAwayDetails({
|
|
|
|
away_ids: this.away_ids,
|
|
|
|
away_ids: away_ids_arr,
|
|
|
|
flow_id: flow_id,
|
|
|
|
flow_id: flow_id,
|
|
|
|
chuchai_pay_id: chuchai_pay_id,
|
|
|
|
chuchai_pay_id: chuchai_pay_id,
|
|
|
|
chuchai_pay_details: chuchai_pay_details,
|
|
|
|
chuchai_pay_details: chuchai_pay_details,
|
|
|
|
money: money
|
|
|
|
money: money,
|
|
|
|
|
|
|
|
plan_money:plan_moneys
|
|
|
|
}, true);
|
|
|
|
}, true);
|
|
|
|
console.log("res", res)
|
|
|
|
console.log("res", res)
|
|
|
|
await Promise.allSettled(away_plan_links.map((i, index) => {
|
|
|
|
await Promise.allSettled(away_plan_links.map((i, index) => {
|
|
|
|
|