|
|
|
|
@ -144,7 +144,7 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="examineAway(row,1)"
|
|
|
|
|
ghost
|
|
|
|
|
>财务审核取消
|
|
|
|
|
>审核取消
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
v-else
|
|
|
|
|
@ -152,7 +152,26 @@
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="examineAway(row,2)"
|
|
|
|
|
>财务审核确认
|
|
|
|
|
>审核确认
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="/Finance/g.test($route.path)">
|
|
|
|
|
<Button
|
|
|
|
|
v-if="isAuthCanExpense(row)"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="canExpense(row,1)"
|
|
|
|
|
>开启报销
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
v-else
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
ghost
|
|
|
|
|
@click="canExpense(row,0)"
|
|
|
|
|
>关闭报销
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
@ -191,6 +210,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
expenseUser: ["admin","panjiajia","huyangcui","wanghui"],
|
|
|
|
|
window: {
|
|
|
|
|
width: 0,
|
|
|
|
|
height: 0,
|
|
|
|
|
@ -258,7 +278,7 @@ export default {
|
|
|
|
|
width: 100,
|
|
|
|
|
label: "用车",
|
|
|
|
|
customFn:row => {
|
|
|
|
|
if (!row.FLOWSTATUS.useCar.getExecutable()) {
|
|
|
|
|
if (!row.use_car) {
|
|
|
|
|
return (
|
|
|
|
|
<span style="color: rgb(140, 140, 140);">-</span>
|
|
|
|
|
)
|
|
|
|
|
@ -269,6 +289,7 @@ export default {
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.useCar.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
this.toOaDetail('useCar',row,)
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
@ -279,7 +300,7 @@ export default {
|
|
|
|
|
width: 100,
|
|
|
|
|
label: "市内补助",
|
|
|
|
|
customFn:row => {
|
|
|
|
|
if (!row.FLOWSTATUS.subsidize.getExecutable()) {
|
|
|
|
|
if (!row.is_subsidize) {
|
|
|
|
|
return (
|
|
|
|
|
<span style="color: rgb(140, 140, 140);">-</span>
|
|
|
|
|
)
|
|
|
|
|
@ -290,6 +311,7 @@ export default {
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.subsidize.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
this.toOaDetail('subsidize',row)
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
@ -307,6 +329,7 @@ export default {
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.away.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
this.toOaDetail('away',row)
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
@ -328,6 +351,7 @@ export default {
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
this.toOaDetail('expense',row)
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
@ -365,9 +389,35 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async toOaDetail (tbname,row) {
|
|
|
|
|
let url = `${process.env.VUE_APP_OUT_URL}/flow/view/`
|
|
|
|
|
switch (tbname) {
|
|
|
|
|
case "useCar":
|
|
|
|
|
url += row.use_car_flow_id
|
|
|
|
|
break;
|
|
|
|
|
case "subsidize":
|
|
|
|
|
url += row.subsidize_flow_id
|
|
|
|
|
break;
|
|
|
|
|
case "away":
|
|
|
|
|
url += row.away_flow_id
|
|
|
|
|
break;
|
|
|
|
|
case "expense":
|
|
|
|
|
url += row.expense_flow_id
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
url = `${process.env.VUE_APP_OUT_URL}/admin/flow/list/todo`
|
|
|
|
|
}
|
|
|
|
|
window.open(
|
|
|
|
|
url,
|
|
|
|
|
"detail",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
goUseCar (row) {
|
|
|
|
|
const baseInfo = {
|
|
|
|
|
"flow_title": row.title
|
|
|
|
|
"flow_title": row.title,
|
|
|
|
|
"65802fc31dc8f": row.start_date,
|
|
|
|
|
"65f7e6e45ab4f": row.end_date,
|
|
|
|
|
};
|
|
|
|
|
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/3?auth_token=${this.$store.getters.oa_token}&out_away_id=${
|
|
|
|
|
row.id
|
|
|
|
|
@ -410,6 +460,8 @@ export default {
|
|
|
|
|
const baseInfo = {
|
|
|
|
|
"flow_title": row.title,
|
|
|
|
|
"totalAmt": row.expense,
|
|
|
|
|
"65af591780427[65b1ff2a2546a][]": row.start_date,
|
|
|
|
|
"65af591780427[65b1ff3f243d0][]": row.end_date
|
|
|
|
|
};
|
|
|
|
|
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/26?auth_token=${this.$store.getters.oa_token}&out_away_id=${
|
|
|
|
|
row.id
|
|
|
|
|
@ -444,7 +496,7 @@ export default {
|
|
|
|
|
return this.executable
|
|
|
|
|
}
|
|
|
|
|
isEnabled () {
|
|
|
|
|
return this.executable && (this.status === 1 || this.status === null)
|
|
|
|
|
return this.executable && this.status === 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const res = await index(this.select,!isFirst);
|
|
|
|
|
@ -460,22 +512,22 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (item.use_car) {
|
|
|
|
|
flowStatus.useCar.setStatus(item.use_car_status)
|
|
|
|
|
if (item.use_car_status === 1 || item.use_car_status === null) {
|
|
|
|
|
if (item.use_car_status === 1) {
|
|
|
|
|
flowStatus.useCar.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.is_subsidize) {
|
|
|
|
|
flowStatus.subsidize.setStatus(item.subsidize_status)
|
|
|
|
|
if (item.subsidize_status === 1 || item.subsidize_status === null) {
|
|
|
|
|
if (item.subsidize_status === 1) {
|
|
|
|
|
flowStatus.subsidize.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
flowStatus.away.setStatus(item.away_status)
|
|
|
|
|
if (item.away_status === 1 || item.away_status === null) {
|
|
|
|
|
if (item.away_status === 1) {
|
|
|
|
|
flowStatus.away.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
flowStatus.expense.setStatus(item.expense_status)
|
|
|
|
|
if ((!item.is_subsidize || item.subsidize_status === 3) && (!item.use_car || item.use_car_status === 3) && item.away_status === 3 && !item.expense_status && (this.$moment().diff(this.$moment(item.end_date),"days") <= 30)) {
|
|
|
|
|
if ((!item.is_subsidize || item.subsidize_status === 3) && (!item.use_car || item.use_car_status === 3) && item.away_status === 3 && (!item.expense_status || item.expense_status === 1) && (this.$moment().diff(this.$moment(item.end_date),"days") <= 30 || item.can_expenses)) {
|
|
|
|
|
flowStatus.expense.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -502,6 +554,17 @@ export default {
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
canExpense (row, status) {
|
|
|
|
|
this.$confirm(`是否${ status ? "开启" : "关闭" }报销?`, "提示", {}).then(_ => {
|
|
|
|
|
save({
|
|
|
|
|
...row,
|
|
|
|
|
can_expenses: status
|
|
|
|
|
}).then(_ => {
|
|
|
|
|
this.$message.success("操作成功");
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
@ -510,6 +573,11 @@ export default {
|
|
|
|
|
return !(row.FLOWSTATUS.useCar.getStatus() > 1 || row.FLOWSTATUS.subsidize.getStatus() > 1 || row.FLOWSTATUS.away.getStatus() > 1 || row.FLOWSTATUS.financial.getStatus() > 1)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
isAuthCanExpense () {
|
|
|
|
|
return function (row) {
|
|
|
|
|
return (this.$moment().diff(this.$moment(row.end_date),"days") > 30) && this.expenseUser.indexOf(this.$store.state.user.username) !== -1 && !row.can_expenses
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.window.width = screen.availWidth * 0.95;
|
|
|
|
|
|