diff --git a/src/views/away/addAway.vue b/src/views/away/addAway.vue index aaa2c29..6dcf246 100644 --- a/src/views/away/addAway.vue +++ b/src/views/away/addAway.vue @@ -56,6 +56,10 @@ export default { start_date: '', end_date: '', is_subsidize: 0, + use_car_status: 1, + subsidize_status: 1, + expense_status: 1, + away_status: 1, }, copyForm: { @@ -113,6 +117,8 @@ export default { this.loading = true this.$refs.form.validate((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 => { this.loading = false this.$message({ diff --git a/src/views/away/index.vue b/src/views/away/index.vue index 9fd1a68..e734501 100644 --- a/src/views/away/index.vue +++ b/src/views/away/index.vue @@ -144,7 +144,7 @@ type="primary" @click="examineAway(row,1)" ghost - >财务审核取消 + >审核取消 + + @@ -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 ( - ) @@ -269,6 +289,7 @@ export default {
{ (row.FLOWSTATUS.useCar.getStatus() > 1) ? { + this.toOaDetail('useCar',row,) }}}>查看 : '' } @@ -279,7 +300,7 @@ export default { width: 100, label: "市内补助", customFn:row => { - if (!row.FLOWSTATUS.subsidize.getExecutable()) { + if (!row.is_subsidize) { return ( - ) @@ -290,6 +311,7 @@ export default {
{ (row.FLOWSTATUS.subsidize.getStatus() > 1) ? { + this.toOaDetail('subsidize',row) }}}>查看 : '' } @@ -307,6 +329,7 @@ export default {
{ (row.FLOWSTATUS.away.getStatus() > 1) ? { + this.toOaDetail('away',row) }}}>查看 : '' } @@ -328,6 +351,7 @@ export default {
{ (row.FLOWSTATUS.expense.getStatus() > 1) ? { + this.toOaDetail('expense',row) }}}>查看 : '' } @@ -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; diff --git a/src/views/contract/contractEdit.vue b/src/views/contract/contractEdit.vue index e1aec95..39c7106 100644 --- a/src/views/contract/contractEdit.vue +++ b/src/views/contract/contractEdit.vue @@ -1482,11 +1482,13 @@ export default { switch (row.flow_mod_id) { case 12: baseInfo = { + "flow_title": row.name || "", "6583b42c5c29a": row.name, } break; case 5: baseInfo = { + "flow_title": row.name || "", "65b37c797845d": row.name, "65b37c8facfc9": row.content, } @@ -1494,14 +1496,21 @@ export default { case 29: case 19: baseInfo = { - "65852a58c7bad": row.name, - "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+","),""), - "65852bd7afd2f": row.plan_price, - "65852bc914b8d": row.plan_price, - "65852c08d98f5": row.content, + "flow_title": row.name || "", + "65852a58c7bad": row.name || "", + "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+","),"") || "", + "65852bd7afd2f": row.plan_price || "", + "65852bc914b8d": row.plan_price || "", + "65852c08d98f5": row.content || "", + "65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || "", + "caigouxingshi": row.purchase_type.value } break; + default: + baseInfo = { + "flow_title": row.name || "" + } } // 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=${ diff --git a/src/views/contract/contractList.vue b/src/views/contract/contractList.vue index 05925a8..1988ba6 100644 --- a/src/views/contract/contractList.vue +++ b/src/views/contract/contractList.vue @@ -1672,11 +1672,11 @@ export default { } { - row.is_purchase ? "" : ([{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) }]) + row.is_purchase ? "" : ([{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) ?? '待申请' }]) }

{ - row.is_purchase ? "" : (this.toOaDetail('other',row)}}>查看) + (!row.is_purchase && row.FLOWSTATUS.other.getStatus() > 1) ? (this.toOaDetail('other',row)}}>查看) : "" } ) @@ -2327,13 +2327,13 @@ export default { switch (row.flow_mod_id) { case 12: baseInfo = { - "工作名称": row.name || "", + "flow_title": row.name || "", "6583b42c5c29a": row.name, } break; case 5: baseInfo = { - "工作名称": row.name || "", + "flow_title": row.name || "", "65b37c797845d": row.name, "65b37c8facfc9": row.content, } @@ -2341,19 +2341,20 @@ export default { case 29: case 19: baseInfo = { - "工作名称": row.name || "", + "flow_title": row.name || "", "65852a58c7bad": row.name || "", "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+","),"") || "", "65852bd7afd2f": row.plan_price || "", "65852bc914b8d": row.plan_price || "", "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; default: baseInfo = { - "工作名称": row.name || "" + "flow_title": row.name || "" } } // let res = await getOatoken() @@ -2372,7 +2373,7 @@ export default { this.setNowContract(row, "hetong"); let baseInfo = { "65b37d8c6a94c": row?.name, - "658a6bc82d0b2": row?.money || row?.plan_price, + "658a6bc82d0b2": Number(row?.money) || row?.plan_price, out_contract_id: row.id, "658a6c125e4e6": row.content, "658a6c009002e": row.supply @@ -2869,7 +2870,7 @@ export default { } } 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) { flowStatus["other"].setExecutable(true) } @@ -2886,6 +2887,7 @@ export default { } item.FLOWSTATUS = flowStatus + console.log(flowStatus) } }, computed: {