流程同步

master
xy 2 years ago
parent ea11586e08
commit 0aca07d137

@ -56,6 +56,10 @@ export default {
start_date: '', start_date: '',
end_date: '', end_date: '',
is_subsidize: 0, is_subsidize: 0,
use_car_status: 1,
subsidize_status: 1,
expense_status: 1,
away_status: 1,
}, },
copyForm: { copyForm: {
@ -113,6 +117,8 @@ export default {
this.loading = true this.loading = true
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.form.use_car_status = this.form.use_car ? 1 : "";
this.form.subsidize_status = this.form.is_subsidize ? 1 : "";
save(this.form,true).then(res => { save(this.form,true).then(res => {
this.loading = false this.loading = false
this.$message({ this.$message({

@ -144,7 +144,7 @@
type="primary" type="primary"
@click="examineAway(row,1)" @click="examineAway(row,1)"
ghost ghost
>财务审核取消 >审核取消
</Button> </Button>
<Button <Button
v-else v-else
@ -152,7 +152,26 @@
size="small" size="small"
type="primary" type="primary"
@click="examineAway(row,2)" @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> </Button>
</template> </template>
</template> </template>
@ -191,6 +210,7 @@ export default {
}, },
data() { data() {
return { return {
expenseUser: ["admin","panjiajia","huyangcui","wanghui"],
window: { window: {
width: 0, width: 0,
height: 0, height: 0,
@ -258,7 +278,7 @@ export default {
width: 100, width: 100,
label: "用车", label: "用车",
customFn:row => { customFn:row => {
if (!row.FLOWSTATUS.useCar.getExecutable()) { if (!row.use_car) {
return ( return (
<span style="color: rgb(140, 140, 140);">-</span> <span style="color: rgb(140, 140, 140);">-</span>
) )
@ -269,6 +289,7 @@ export default {
<br/> <br/>
{ {
(row.FLOWSTATUS.useCar.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{ (row.FLOWSTATUS.useCar.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
this.toOaDetail('useCar',row,)
}}}>查看</a> : '' }}}>查看</a> : ''
} }
</div> </div>
@ -279,7 +300,7 @@ export default {
width: 100, width: 100,
label: "市内补助", label: "市内补助",
customFn:row => { customFn:row => {
if (!row.FLOWSTATUS.subsidize.getExecutable()) { if (!row.is_subsidize) {
return ( return (
<span style="color: rgb(140, 140, 140);">-</span> <span style="color: rgb(140, 140, 140);">-</span>
) )
@ -290,6 +311,7 @@ export default {
<br/> <br/>
{ {
(row.FLOWSTATUS.subsidize.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{ (row.FLOWSTATUS.subsidize.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
this.toOaDetail('subsidize',row)
}}}>查看</a> : '' }}}>查看</a> : ''
} }
</div> </div>
@ -307,6 +329,7 @@ export default {
<br/> <br/>
{ {
(row.FLOWSTATUS.away.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{ (row.FLOWSTATUS.away.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
this.toOaDetail('away',row)
}}}>查看</a> : '' }}}>查看</a> : ''
} }
</div> </div>
@ -328,6 +351,7 @@ export default {
<br/> <br/>
{ {
(row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{ (row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
this.toOaDetail('expense',row)
}}}>查看</a> : '' }}}>查看</a> : ''
} }
</div> </div>
@ -365,9 +389,35 @@ export default {
} }
}, },
methods: { 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) { goUseCar (row) {
const baseInfo = { 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=${ let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/3?auth_token=${this.$store.getters.oa_token}&out_away_id=${
row.id row.id
@ -410,6 +460,8 @@ export default {
const baseInfo = { const baseInfo = {
"flow_title": row.title, "flow_title": row.title,
"totalAmt": row.expense, "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=${ let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/26?auth_token=${this.$store.getters.oa_token}&out_away_id=${
row.id row.id
@ -444,7 +496,7 @@ export default {
return this.executable return this.executable
} }
isEnabled () { isEnabled () {
return this.executable && (this.status === 1 || this.status === null) return this.executable && this.status === 1
} }
} }
const res = await index(this.select,!isFirst); const res = await index(this.select,!isFirst);
@ -460,22 +512,22 @@ export default {
} }
if (item.use_car) { if (item.use_car) {
flowStatus.useCar.setStatus(item.use_car_status) 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) flowStatus.useCar.setExecutable(true)
} }
} }
if (item.is_subsidize) { if (item.is_subsidize) {
flowStatus.subsidize.setStatus(item.subsidize_status) 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.subsidize.setExecutable(true)
} }
} }
flowStatus.away.setStatus(item.away_status) 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.away.setExecutable(true)
} }
flowStatus.expense.setStatus(item.expense_status) 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) flowStatus.expense.setExecutable(true)
} }
@ -502,6 +554,17 @@ export default {
this.getList() this.getList()
}) })
}) })
},
canExpense (row, status) {
this.$confirm(`是否${ status ? "开启" : "关闭" }报销?`, "提示", {}).then(_ => {
save({
...row,
can_expenses: status
}).then(_ => {
this.$message.success("操作成功");
this.getList()
})
})
} }
}, },
computed: { 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) 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() { created() {
this.window.width = screen.availWidth * 0.95; this.window.width = screen.availWidth * 0.95;

@ -1482,11 +1482,13 @@ export default {
switch (row.flow_mod_id) { switch (row.flow_mod_id) {
case 12: case 12:
baseInfo = { baseInfo = {
"flow_title": row.name || "",
"6583b42c5c29a": row.name, "6583b42c5c29a": row.name,
} }
break; break;
case 5: case 5:
baseInfo = { baseInfo = {
"flow_title": row.name || "",
"65b37c797845d": row.name, "65b37c797845d": row.name,
"65b37c8facfc9": row.content, "65b37c8facfc9": row.content,
} }
@ -1494,14 +1496,21 @@ export default {
case 29: case 29:
case 19: case 19:
baseInfo = { baseInfo = {
"65852a58c7bad": row.name, "flow_title": row.name || "",
"65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value, "65852a58c7bad": row.name || "",
"65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),""), "65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value || "",
"65852bd7afd2f": row.plan_price, "65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),"") || "",
"65852bc914b8d": row.plan_price, "65852bd7afd2f": row.plan_price || "",
"65852c08d98f5": row.content, "65852bc914b8d": row.plan_price || "",
"65852c08d98f5": row.content || "",
"65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || "",
"caigouxingshi": row.purchase_type.value
} }
break; break;
default:
baseInfo = {
"flow_title": row.name || ""
}
} }
// let res = await getOatoken() // let res = await getOatoken()
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/${row.flow_mod_id}?auth_token=${this.$store.getters.oa_token}&out_contract_id=${ let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/${row.flow_mod_id}?auth_token=${this.$store.getters.oa_token}&out_contract_id=${

@ -1672,11 +1672,11 @@ export default {
} }
</span> </span>
{ {
row.is_purchase ? "" : (<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.other.getStatus()) }}>[{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) }]</span>) row.is_purchase ? "" : (<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.other.getStatus()) }}>[{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) ?? '待申请' }]</span>)
} }
</p> </p>
{ {
row.is_purchase ? "" : (<a on={{['click']:()=>this.toOaDetail('other',row)}}>查看</a>) (!row.is_purchase && row.FLOWSTATUS.other.getStatus() > 1) ? (<a on={{['click']:()=>this.toOaDetail('other',row)}}>查看</a>) : ""
} }
</div> </div>
) )
@ -2327,13 +2327,13 @@ export default {
switch (row.flow_mod_id) { switch (row.flow_mod_id) {
case 12: case 12:
baseInfo = { baseInfo = {
"工作名称": row.name || "", "flow_title": row.name || "",
"6583b42c5c29a": row.name, "6583b42c5c29a": row.name,
} }
break; break;
case 5: case 5:
baseInfo = { baseInfo = {
"工作名称": row.name || "", "flow_title": row.name || "",
"65b37c797845d": row.name, "65b37c797845d": row.name,
"65b37c8facfc9": row.content, "65b37c8facfc9": row.content,
} }
@ -2341,19 +2341,20 @@ export default {
case 29: case 29:
case 19: case 19:
baseInfo = { baseInfo = {
"工作名称": row.name || "", "flow_title": row.name || "",
"65852a58c7bad": row.name || "", "65852a58c7bad": row.name || "",
"65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value || "", "65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value || "",
"65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),"") || "", "65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),"") || "",
"65852bd7afd2f": row.plan_price || "", "65852bd7afd2f": row.plan_price || "",
"65852bc914b8d": row.plan_price || "", "65852bc914b8d": row.plan_price || "",
"65852c08d98f5": row.content || "", "65852c08d98f5": row.content || "",
"65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || "" "65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || "",
"caigouxingshi": row.purchase_type.value
} }
break; break;
default: default:
baseInfo = { baseInfo = {
"工作名称": row.name || "" "flow_title": row.name || ""
} }
} }
// let res = await getOatoken() // let res = await getOatoken()
@ -2372,7 +2373,7 @@ export default {
this.setNowContract(row, "hetong"); this.setNowContract(row, "hetong");
let baseInfo = { let baseInfo = {
"65b37d8c6a94c": row?.name, "65b37d8c6a94c": row?.name,
"658a6bc82d0b2": row?.money || row?.plan_price, "658a6bc82d0b2": Number(row?.money) || row?.plan_price,
out_contract_id: row.id, out_contract_id: row.id,
"658a6c125e4e6": row.content, "658a6c125e4e6": row.content,
"658a6c009002e": row.supply "658a6c009002e": row.supply
@ -2869,7 +2870,7 @@ export default {
} }
} else { } else {
// //
flowStatus["other"].setStatus(item.other_flow_status) flowStatus["other"].setStatus(item.other_flow_status??1)
if (item.other_flow_status === 1 || !item.other_flow_status) { if (item.other_flow_status === 1 || !item.other_flow_status) {
flowStatus["other"].setExecutable(true) flowStatus["other"].setExecutable(true)
} }
@ -2886,6 +2887,7 @@ export default {
} }
item.FLOWSTATUS = flowStatus item.FLOWSTATUS = flowStatus
console.log(flowStatus)
} }
}, },
computed: { computed: {

Loading…
Cancel
Save