From ea11586e08a35475ab3914467520fc414d5d5fa8 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Mon, 20 May 2024 17:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.js | 21 +++ src/views/away/component/addAway.vue | 15 +- src/views/away/index.vue | 15 +- .../contract/components/editorContract.vue | 33 ++--- .../components/paymentRegistration.vue | 2 +- src/views/contract/contractEdit.vue | 5 +- src/views/contract/contractList.vue | 130 ++++++++++++------ 7 files changed, 145 insertions(+), 76 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index fc12e4b..31e5f43 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -126,6 +126,27 @@ export function debounce(fn,delay=500){ }, delay) } } +export function throttle (fn, interval) { + let _self = fn, // 保存需要被延迟执行的函数引用 + timer, // 定时器 + firstTime = true; // 是否是第一次调用 + return function () { + const args = arguments; + const _me = this; + if (firstTime) { // 如果是第一次调用不需要延迟 + _self.apply(_me, args); // 执行fn函数并且修正此函数中this所运行的上下文指向 + return firstTime = false; + } + if (timer) { // 如果定时器还在,说明前一次延迟执行还没有完成 + return false; + } + timer = setTimeout(function () { // 延迟一段时间执行 + clearTimeout(timer); + timer = null; + _self.apply(_me, args); // 执行fn函数并且修正此函数中this所运行的上下文指向 + }, interval || 500); + } +} //金额分隔 export function moneyFormatter(money,precision=2){ diff --git a/src/views/away/component/addAway.vue b/src/views/away/component/addAway.vue index 24bfdc3..b98a35c 100644 --- a/src/views/away/component/addAway.vue +++ b/src/views/away/component/addAway.vue @@ -14,7 +14,6 @@
标题 :
是否用车 :
- + @@ -38,7 +37,7 @@
是否室内补助 :
- + @@ -50,7 +49,6 @@
开始时间 :
开始时间 :
用车审核 :
- + 待申请 流转中 已结办 @@ -89,7 +86,7 @@
市内补助审核 :
- + 待申请 流转中 已结办 @@ -101,7 +98,7 @@
出差审核 :
- + 待申请 流转中 已结办 @@ -113,7 +110,7 @@
出差报销审核 :
- + 待申请 流转中 已结办 diff --git a/src/views/away/index.vue b/src/views/away/index.vue index 9bc5a1d..9fd1a68 100644 --- a/src/views/away/index.vue +++ b/src/views/away/index.vue @@ -255,6 +255,7 @@ export default { label: "流程状态", multiHd: [ { + width: 100, label: "用车", customFn:row => { if (!row.FLOWSTATUS.useCar.getExecutable()) { @@ -275,6 +276,7 @@ export default { } }, { + width: 100, label: "市内补助", customFn:row => { if (!row.FLOWSTATUS.subsidize.getExecutable()) { @@ -296,6 +298,7 @@ export default { }, { + width: 100, label: "出差审批", customFn:row => { return ( @@ -313,10 +316,15 @@ export default { }, { label: "出差报销", + width: 100, customFn:row => { return (
- { this.flowStatus.get(row.FLOWSTATUS.expense.getStatus()) || '待申请' } + { + ((this.$moment().diff(this.$moment(row.end_date),"days") <= 30) || (row.FLOWSTATUS.expense.getStatus() > 1)) ? + ({ this.flowStatus.get(row.FLOWSTATUS.expense.getStatus()) || '待申请' }) : + (超时未办理) + }
{ (row.FLOWSTATUS.expense.getStatus() > 1) ? { @@ -327,6 +335,7 @@ export default { } }, { + width: 100, label: "财务审核", customFn:row => { return (row.FLOWSTATUS.financial.getStatus() === 2) ? (已确认) : (待审核) @@ -466,7 +475,7 @@ export default { 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) { + 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)) { flowStatus.expense.setExecutable(true) } @@ -500,7 +509,7 @@ export default { return function (row) { return !(row.FLOWSTATUS.useCar.getStatus() > 1 || row.FLOWSTATUS.subsidize.getStatus() > 1 || row.FLOWSTATUS.away.getStatus() > 1 || row.FLOWSTATUS.financial.getStatus() > 1) } - } + }, }, created() { this.window.width = screen.availWidth * 0.95; diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue index be75a95..5e0b313 100644 --- a/src/views/contract/components/editorContract.vue +++ b/src/views/contract/components/editorContract.vue @@ -198,6 +198,18 @@
+ + @@ -1136,6 +1145,7 @@ { return (
-

{ - this.flowIds.find(i => i.id === row.flow_mod_id)?.name - }

-
查看 +

+ + { + this.flowIds.find(i => i.id === row.flow_mod_id)?.name + } + + { + row.is_purchase ? "" : ([{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) }]) + } +

+ { + row.is_purchase ? "" : (this.toOaDetail('other',row)}}>查看) + }
) } @@ -2178,6 +2200,9 @@ export default { case "hetong": url += row.join_last_flow_id break; + case "other": + url += row.other_flow_id + break; default: url = `${process.env.VUE_APP_OUT_URL}/admin/flow/list/todo` } @@ -2302,11 +2327,13 @@ export default { switch (row.flow_mod_id) { case 12: baseInfo = { + "工作名称": row.name || "", "6583b42c5c29a": row.name, } break; case 5: baseInfo = { + "工作名称": row.name || "", "65b37c797845d": row.name, "65b37c8facfc9": row.content, } @@ -2324,6 +2351,10 @@ export default { "65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || "" } break; + default: + baseInfo = { + "工作名称": 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=${ @@ -2439,7 +2470,7 @@ export default { ); }, //事前流程 - async getFlowIds () { + async getFlowIds () {`` let copy = deepCopy(this.flowIds) const res = await getparameter({ number: "flow_ids" @@ -2504,7 +2535,7 @@ export default { this.getContracts(); }, //获取合同列表 - async getContracts(is_export,noloading=false,isopenOa=false) { + getContracts: throttle(async function (is_export,noloading=false,isopenOa=false) { if (/contractLedger/g.test(this.$route.path)) { this.select.is_contract = 1 } else { @@ -2558,7 +2589,7 @@ export default { await this.buyProcess(res.list.data[0]) } } - }, + },1000), //新建合同 //显示 @@ -2787,7 +2818,7 @@ export default { return this.status } isEnabled () { - return this.executable && this.status === 1 + return this.executable && (this.status === 1 || this.status === "") } } //0无该流程,1未开始,2进行中,3已完成(合同签订1待签订,2已签订) @@ -2796,47 +2827,57 @@ export default { "zhaobiao": new Flow(), "shenpi": new Flow(), "qianding": new Flow(), - "zhifu": new Flow() + "zhifu": new Flow(), + "other": new Flow() } - if (item.is_simple !== 1 && !item.is_substitute) { - //不为简易 采购未开始 - - flowStatus["caigou"].setStatus(item.purchase_status) - if (item.purchase_status === 1) { - //采购未开始 - if (item.is_plan === 1 || (item.is_plan === 0 && item.req_status === 3)) { - //不为预算时,请示流程完成 - flowStatus["caigou"].setExecutable(true) + if (item.is_purchase) { + //为采购项目 + if (item.is_simple !== 1 && !item.is_substitute) { + //不为简易 采购未开始 + + flowStatus["caigou"].setStatus(item.purchase_status) + if (item.purchase_status === 1) { + //采购未开始 + if (item.is_plan === 1 || (item.is_plan === 0 && item.req_status === 3)) { + //不为预算时,请示流程完成 + flowStatus["caigou"].setExecutable(true) + } } } - } - if (item.purchase_way?.value !== '网上商城' && item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) { - //不为网上商场 是合同\ - flowStatus["zhaobiao"].setStatus(item.invite_status) - if (item.invite_status === 1 && item.purchase_status === 3) { - //采购完成,招标未开始 - flowStatus["zhaobiao"].setExecutable(true) + if (item.purchase_way?.value !== '网上商城' && item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) { + //不为网上商场 是合同\ + flowStatus["zhaobiao"].setStatus(item.invite_status) + if (item.invite_status === 1 && item.purchase_status === 3) { + //采购完成,招标未开始 + flowStatus["zhaobiao"].setExecutable(true) + } } - } - if (item.is_contract && item.purchase_way?.value !== "网上商城") { - //为合同 不为网上商城 - flowStatus["shenpi"].setStatus(item.join_status) - if (item.join_status === 1 && (item.invite_status === 3 || - (item.purchase_way?.remark === 'false' && item.purchase_status === 3))) { - //审批未开始 走招标招标完成或不走招标采购完成 - flowStatus["shenpi"].setExecutable(true) + if (item.is_contract && item.purchase_way?.value !== "网上商城") { + //为合同 不为网上商城 + flowStatus["shenpi"].setStatus(item.join_status) + if (item.join_status === 1 && (item.invite_status === 3 || + (item.purchase_way?.remark === 'false' && item.purchase_status === 3))) { + //审批未开始 走招标招标完成或不走招标采购完成 + flowStatus["shenpi"].setExecutable(true) + } } - } - if (item.is_contract && item.purchase_way?.value !== "网上商城" && !item.is_substitute) { - flowStatus["qianding"].setStatus(item.status) - if (item.join_status === 3 && item.status === 1) { - flowStatus["qianding"].setExecutable(true) + if (item.is_contract && item.purchase_way?.value !== "网上商城" && !item.is_substitute) { + flowStatus["qianding"].setStatus(item.status) + if (item.join_status === 3 && item.status === 1) { + flowStatus["qianding"].setExecutable(true) + } + } + } else { + //非采购事前流程 + flowStatus["other"].setStatus(item.other_flow_status) + if (item.other_flow_status === 1 || !item.other_flow_status) { + flowStatus["other"].setExecutable(true) } } if (item.is_end === 0) { flowStatus["zhifu"].setStatus(1) //最后一笔没付完 - if ((!item.is_contract && !item.is_substitute && item.purchase_status === 3) || (item.purchase_way?.value === "网上商城" && item.purchase_status === 3) || + if ((item.is_purchase === 0 && item.other_flow_status === 3) || (!item.is_contract && !item.is_substitute && item.purchase_status === 3) || (item.purchase_way?.value === "网上商城" && item.purchase_status === 3) || item.status === 2 || (!item.is_contract && item.is_simple) || (item.is_contract && item.is_substitute && item.join_status === 3)) { //网上商场的话采购完成 合同签订完成 不为合同并且为简易 @@ -2859,6 +2900,12 @@ export default { } }; }, + + otherFlowBtn () { + return function (flowModId) { + return this.flowIds.find(i => i.id === flowModId)?.name + } + } }, watch: { isShowContractToContracts(val) { @@ -2916,6 +2963,7 @@ export default { } if (/contractAll/g.test(this.$route.path)) { this.select.is_simple = ""; + this.select.is_purchase = 0; } }, destroyed() {