|
|
|
|
@ -73,8 +73,9 @@
|
|
|
|
|
label="操作"
|
|
|
|
|
width="220"
|
|
|
|
|
>
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<template #default="{ row }" v-if="!/Finance/g.test($route.path)">
|
|
|
|
|
<Poptip
|
|
|
|
|
v-if="isAuthEdit(row)"
|
|
|
|
|
:transfer="true"
|
|
|
|
|
confirm
|
|
|
|
|
placement="bottom"
|
|
|
|
|
@ -82,7 +83,7 @@
|
|
|
|
|
@on-ok="() => deleteAway(row.id)"
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 4px;"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
ghost
|
|
|
|
|
size="small"
|
|
|
|
|
type="error"
|
|
|
|
|
@ -90,41 +91,62 @@
|
|
|
|
|
</Button>
|
|
|
|
|
</Poptip>
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 4px;"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="$router.push('/contract/away/addAway?id=' + row.id)"
|
|
|
|
|
@click="$refs['addAway'].setType('editor'),$refs['addAway'].setId(row.id),$refs['addAway'].show()"
|
|
|
|
|
>编辑
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
<template v-if="row.FLOWSTATUS.useCar.isEnabled()">
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 4px;"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click=""
|
|
|
|
|
@click="goUseCar(row)"
|
|
|
|
|
>用车审核
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="row.FLOWSTATUS.subsidize.isEnabled()">
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 4px;"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click=""
|
|
|
|
|
@click="goSubsidize(row)"
|
|
|
|
|
>市内补助审核
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="row.FLOWSTATUS.away.isEnabled()">
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 4px;"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click=""
|
|
|
|
|
@click="goAway(row)"
|
|
|
|
|
>出差审核
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else #default="{ row }">
|
|
|
|
|
<template v-if="row.FLOWSTATUS.financial.getExecutable()">
|
|
|
|
|
<Button
|
|
|
|
|
v-if="row.FLOWSTATUS.financial.getStatus() === 2"
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="examineAway(row,1)"
|
|
|
|
|
ghost
|
|
|
|
|
>财务审核取消
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
v-else
|
|
|
|
|
style="margin: 2px;"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="examineAway(row,2)"
|
|
|
|
|
>财务审核确认
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
@ -146,15 +168,26 @@
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<addAway ref="addAway" @refresh="getList"></addAway>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { index, destroy } from "@/api/away";
|
|
|
|
|
import addAway from "@/views/away/component/addAway.vue"
|
|
|
|
|
import { index, destroy, save } from "@/api/away";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addAway
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
window: {
|
|
|
|
|
width: 0,
|
|
|
|
|
height: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
},
|
|
|
|
|
select: {
|
|
|
|
|
keyword: '',
|
|
|
|
|
start_year: "",
|
|
|
|
|
@ -164,6 +197,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
flowStatus: new Map([
|
|
|
|
|
[0, "-"],
|
|
|
|
|
[1, "待申请"],
|
|
|
|
|
[2, "流转中"],
|
|
|
|
|
[3, "已办结"]
|
|
|
|
|
]),
|
|
|
|
|
flowStatusColor: new Map([
|
|
|
|
|
[0, "rgb(140, 140, 140)"],
|
|
|
|
|
[1, "rgb(96, 109, 241)"],
|
|
|
|
|
[2, "rgb(219, 122, 122)"],
|
|
|
|
|
[3, "rgb(147, 201, 134)"]
|
|
|
|
|
]),
|
|
|
|
|
table: [
|
|
|
|
|
{
|
|
|
|
|
label: "标题",
|
|
|
|
|
@ -197,6 +242,68 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
width: 140
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "流程状态",
|
|
|
|
|
multiHd: [
|
|
|
|
|
{
|
|
|
|
|
label: "用车",
|
|
|
|
|
customFn:row => {
|
|
|
|
|
if (!row.FLOWSTATUS.useCar.getExecutable()) {
|
|
|
|
|
return (
|
|
|
|
|
<span style="color: rgb(140, 140, 140);">-</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.useCar.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.useCar.getStatus()) || '待申请' }</span>
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.useCar.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "市内补助",
|
|
|
|
|
customFn:row => {
|
|
|
|
|
if (!row.FLOWSTATUS.subsidize.getExecutable()) {
|
|
|
|
|
return (
|
|
|
|
|
<span style="color: rgb(140, 140, 140);">-</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.subsidize.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.subsidize.getStatus()) || '待申请' }</span>
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.subsidize.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "出差审批",
|
|
|
|
|
customFn:row => {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.away.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.away.getStatus()) || '待申请' }</span>
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.away.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "创建日期",
|
|
|
|
|
width: 160,
|
|
|
|
|
@ -219,7 +326,49 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getList () {
|
|
|
|
|
goUseCar (row) {
|
|
|
|
|
const baseInfo = {
|
|
|
|
|
"flow_title": row.title
|
|
|
|
|
};
|
|
|
|
|
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/3?auth_token=${this.$store.getters.oa_token}&out_away_id=${
|
|
|
|
|
row.id
|
|
|
|
|
}&default_json=${JSON.stringify(baseInfo)}`;
|
|
|
|
|
window.open(
|
|
|
|
|
url,
|
|
|
|
|
"buyProcess",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
goSubsidize (row) {
|
|
|
|
|
const baseInfo = {
|
|
|
|
|
"flow_title": row.title
|
|
|
|
|
};
|
|
|
|
|
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/24?auth_token=${this.$store.getters.oa_token}&out_away_id=${
|
|
|
|
|
row.id
|
|
|
|
|
}&default_json=${JSON.stringify(baseInfo)}`;
|
|
|
|
|
window.open(
|
|
|
|
|
url,
|
|
|
|
|
"buyProcess",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
goAway (row) {
|
|
|
|
|
const baseInfo = {
|
|
|
|
|
"flow_title": row.title,
|
|
|
|
|
"6583dbd6332fd": row.start_date,
|
|
|
|
|
"6583dbec5d888": row.end_date,
|
|
|
|
|
};
|
|
|
|
|
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/21?auth_token=${this.$store.getters.oa_token}&out_away_id=${
|
|
|
|
|
row.id
|
|
|
|
|
}&default_json=${JSON.stringify(baseInfo)}`;
|
|
|
|
|
window.open(
|
|
|
|
|
url,
|
|
|
|
|
"buyProcess",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getList (isFirst) {
|
|
|
|
|
class Flow {
|
|
|
|
|
status = 0
|
|
|
|
|
executable = false
|
|
|
|
|
@ -238,11 +387,14 @@ export default {
|
|
|
|
|
getStatus () {
|
|
|
|
|
return this.status
|
|
|
|
|
}
|
|
|
|
|
getExecutable () {
|
|
|
|
|
return this.executable
|
|
|
|
|
}
|
|
|
|
|
isEnabled () {
|
|
|
|
|
return this.executable && this.status === 1
|
|
|
|
|
return this.executable && (this.status === 1 || this.status === null)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const res = await index(this.select);
|
|
|
|
|
const res = await index(this.select,!isFirst);
|
|
|
|
|
this.total = res.total;
|
|
|
|
|
this.list = res.data;
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
@ -254,37 +406,68 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (item.use_car) {
|
|
|
|
|
flowStatus.useCar.setStatus(item.use_car_status)
|
|
|
|
|
if (item.use_car_status === 1) {
|
|
|
|
|
if (item.use_car_status === 1 || item.use_car_status === null) {
|
|
|
|
|
flowStatus.useCar.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.is_subsidize) {
|
|
|
|
|
flowStatus.subsidize.setStatus(item.subsidize_status)
|
|
|
|
|
if (item.subsidize_status === 1) {
|
|
|
|
|
if (item.subsidize_status === 1 || item.subsidize_status === null) {
|
|
|
|
|
flowStatus.subsidize.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
flowStatus.away.setStatus(item.away_status)
|
|
|
|
|
if (item.away_status === 1) {
|
|
|
|
|
if (item.away_status === 1 || item.away_status === null) {
|
|
|
|
|
flowStatus.away.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
flowStatus.financial.setStatus(item.financial_status)
|
|
|
|
|
if (item.away_status === 3) {
|
|
|
|
|
if ((!item.is_subsidize || item.subsidize_status === 3) && (!item.use_car || item.use_car_status === 3) && item.away_status === 3) {
|
|
|
|
|
flowStatus.financial.setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.FLOWSTATUS = flowStatus;
|
|
|
|
|
});
|
|
|
|
|
console.log(this.list)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async deleteAway (id) {
|
|
|
|
|
await destroy({ id });
|
|
|
|
|
await this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
examineAway (row, status) {
|
|
|
|
|
this.$confirm("是否确认审批?", "提示", {}).then(_ => {
|
|
|
|
|
save({
|
|
|
|
|
...row,
|
|
|
|
|
financial_status: status
|
|
|
|
|
}).then(_ => {
|
|
|
|
|
this.$message.success("操作成功");
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
isAuthEdit () {
|
|
|
|
|
return function (row) {
|
|
|
|
|
return !(row.FLOWSTATUS.useCar.getStatus() > 1 || row.FLOWSTATUS.subsidize.getStatus() > 1 || row.FLOWSTATUS.away.getStatus() > 1 || row.FLOWSTATUS.financial.getStatus() > 1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList()
|
|
|
|
|
this.window.width = screen.availWidth * 0.95;
|
|
|
|
|
this.window.height = screen.availHeight * 0.95;
|
|
|
|
|
this.window.top = (window.screen.height - 30 - this.window.height) / 2;
|
|
|
|
|
this.window.left = (window.screen.width - 10 - this.window.width) / 2;
|
|
|
|
|
|
|
|
|
|
this.getList(true)
|
|
|
|
|
|
|
|
|
|
window.onfocus = () => {
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
destroyed() {
|
|
|
|
|
window.onfocus = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|