From bc7464d6732545331bc51e3604423fc18adcf104 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Tue, 15 Oct 2024 18:16:50 +0800 Subject: [PATCH] init --- .env.development | 4 +- .env.production | 4 +- src/api/dashboard/notice.js | 2 +- src/main.js | 39 +- src/permission.js | 6 +- src/settings.js | 2 +- .../contract/components/biddingUpload.vue | 2 +- src/views/contract/contractList.vue | 640 +++--------------- src/views/dashboard/index.vue | 8 +- 9 files changed, 115 insertions(+), 592 deletions(-) diff --git a/.env.development b/.env.development index dfdaf06..b17c67a 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ ENV = 'development' VUE_APP_BASE_API='https://cz-hjjc.115.langye.net' VUE_APP_UPLOAD_API='https://cz-hjjc.115.langye.net/api/admin/upload-file' VUE_APP_PREVIEW=//view.langye.net/preview/onlinePreview -VUE_APP_OUT_OLD = http://oa-sqhj-test.ali251.langye.net/admin -VUE_APP_OUT_URL = http://oa-sqhj-test.ali251.langye.net/admin +VUE_APP_OUT_OLD=https://cz-hjjc.115.langye.net/oa +VUE_APP_OUT_URL=https://cz-hjjc.115.langye.net/oa VUE_APP_MODULE_NAME=ht diff --git a/.env.production b/.env.production index d8c5e20..ee89fd9 100644 --- a/.env.production +++ b/.env.production @@ -5,7 +5,7 @@ ENV = 'production' VUE_APP_BASE_API='https://cz-hjjc.115.langye.net' VUE_APP_UPLOAD_API='https://cz-hjjc.115.langye.net/api/admin/upload-file' VUE_APP_PREVIEW=//view.langye.net/preview/onlinePreview -VUE_APP_OUT_OLD = http://oa-sqhj-test.ali251.langye.net/admin -VUE_APP_OUT_URL = http://oa-sqhj-test.ali251.langye.net/admin +VUE_APP_OUT_OLD = https://cz-hjjc.115.langye.net/oa +VUE_APP_OUT_URL = https://cz-hjjc.115.langye.net/oa VUE_APP_MODULE_NAME=ht diff --git a/src/api/dashboard/notice.js b/src/api/dashboard/notice.js index ca89170..a91ab3d 100644 --- a/src/api/dashboard/notice.js +++ b/src/api/dashboard/notice.js @@ -3,7 +3,7 @@ import request from "@/utils/request"; export function getNotice(params,noLoading = false){ return request({ method:'get', - url:'/api/ht/notice/index', + url:'/api/notification/todo', params, noLoading }) diff --git a/src/main.js b/src/main.js index 90706e5..63c2965 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,4 @@ import Vue from 'vue' -import { setToken } from '@/utils/auth' import { getQueryParam } from '@/utils' import 'normalize.css/normalize.css' // A modern alternative to CSS resets @@ -58,6 +57,11 @@ Vue.prototype.$integrateData = (target,value) => { } window.$router = router; +import { setToken,getToken } from "@/utils/auth" +if(window.top !== window.self) { + // 当前页面在iframe中 + window._IN_IFRAME = true; +} if (window.__POWERED_BY_WUJIE__) { let instance; window.__WUJIE_MOUNT = () => { @@ -74,37 +78,8 @@ if (window.__POWERED_BY_WUJIE__) { window.__WUJIE_UNMOUNT = () => { instance.$destroy(); }; -} -else if(window.top !== window.self) { - if (window.top !== window.self) { - // 当前页面在iframe中 - // 当前页面在iframe中 - window._IN_IFRAME = true; - - setToken(getQueryParam('auth_token')) - window.MODULE_NAME = getQueryParam('module_name') - new Vue({ - router, - store, - render: h => h(App) - }).$mount("#app") - router.push(getQueryParam('to') || '/') - // window._IN_IFRAME = true; - // window.addEventListener("message",function (e) { - // const { module_name, auth_token } = e.data; - // window.MODULE_NAME = module_name; - // console.log('token',auth_token) - // setToken(auth_token) - // new Vue({ - // router, - // store, - // render: h => h(App) - // }).$mount("#app") - // router.push('/') - // }) - } -} -else { +} else { + window.MODULE_NAME = getQueryParam('module_name') new Vue({ router, store, diff --git a/src/permission.js b/src/permission.js index 410abf6..7c0251b 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,7 +3,7 @@ import store from './store' import { Message } from 'element-ui' import NProgress from 'nprogress' // progress bar import 'nprogress/nprogress.css' // progress bar style -import { getToken } from '@/utils/auth' // get token from cookie +import { getToken, setToken } from '@/utils/auth' // get token from cookie import getPageTitle from '@/utils/get-page-title' NProgress.configure({ showSpinner: false }) // NProgress Configuration @@ -16,7 +16,9 @@ router.beforeEach(async(to, from, next) => { // set page title document.title = getPageTitle(to.meta.title) - + if(to.query.auth_token) { + setToken(window.decodeURIComponent(to.query.auth_token)) + } // determine whether the user has logged in const hasToken = getToken() if (hasToken) { diff --git a/src/settings.js b/src/settings.js index fd32f33..c573021 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,6 +1,6 @@ module.exports = { - title: '江苏省宿迁环境监测中心内控管理平台', + title: '内控管理平台', /** * @type {boolean} true | false diff --git a/src/views/contract/components/biddingUpload.vue b/src/views/contract/components/biddingUpload.vue index a486521..4b4ad53 100644 --- a/src/views/contract/components/biddingUpload.vue +++ b/src/views/contract/components/biddingUpload.vue @@ -83,7 +83,7 @@ export default { })) : [] }, submit() { - this.detail.invite_status = 3; + this.detail.invite_status = 1; this.detail.tender_id = this.fileList.map(i => i.response?.id) editorContract(this.detail).then((res) => { this.hide(); diff --git a/src/views/contract/contractList.vue b/src/views/contract/contractList.vue index 92caf3c..32d4f3e 100644 --- a/src/views/contract/contractList.vue +++ b/src/views/contract/contractList.vue @@ -389,123 +389,6 @@ {{ otherFlowBtn(scope.row.flow_mod_id) }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -605,371 +488,6 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+ +
+
@@ -1304,6 +837,8 @@ export default { }; return { + isShowOaModal: false, + oaUrl: "", //事前流程 flowIds: [ { @@ -1602,16 +1137,18 @@ export default { } ], flowStatus: new Map([ - [0, "-"], - [1, "待申请"], - [2, "流转中"], - [3, "已办结"] + [2, "待申请"], + [-1, "已退回"], + [-2, "-"], + [0, "流转中"], + [1, "已办结"] ]), flowStatusColor: new Map([ - [0, "rgb(140, 140, 140)"], - [1, "rgb(96, 109, 241)"], - [2, "rgb(219, 122, 122)"], - [3, "rgb(147, 201, 134)"] + [-2, "rgb(140, 140, 140)"], + [-1, "#dca550"], + [2, "rgb(96, 109, 241)"], + [0, "rgb(219, 122, 122)"], + [1, "rgb(147, 201, 134)"] ]), table: [ { @@ -1691,15 +1228,12 @@ export default { width: 158, prop: "purchase_status", customFn:row => { - if (!row.FLOWSTATUS.caigou.getStatus()) { - return (); - } return (
- { this.flowStatus.get(row.FLOWSTATUS.caigou.getStatus()) } + { this.flowStatus.get(row.FLOWSTATUS.caigou.getStatus()) || '无2' }
{ - (row.FLOWSTATUS.caigou.getStatus() > 1) ? this.toOaDetail('caigou',row)}}>查看 : '' + (row.FLOWSTATUS.caigou.getStatus() !== 2 && row.FLOWSTATUS.caigou.getStatus() !== -2) ? this.toOaDetail('caigou',row)}}>查看 : '' }
) @@ -1718,7 +1252,7 @@ export default { { this.flowStatus.get(row.FLOWSTATUS.zhaobiao.getStatus()) }
{ - (row.FLOWSTATUS.zhaobiao.getStatus() > 1) ? { + (row.FLOWSTATUS.zhaobiao.getStatus() !== 2 && row.FLOWSTATUS.zhaobiao.getStatus() !== -2) ? { this.$refs['biddingUpload'].setId(row.id) this.$refs['biddingUpload'].show() }}}>查看 : '' @@ -2209,10 +1743,13 @@ export default { }) }, async toOaDetail (tbname,row) { - let url = `${process.env.VUE_APP_OUT_URL}/flow/view/` + let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=` + //let url = `${process.env.VUE_APP_OUT_URL}?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&` switch (tbname) { case "caigou": - url += row.purchase_last_flow_id + let caigou = row.flow_list.find(i => i.tag === 'caigou')?.detail + //url += `&to=/flow/detail?flow_id=${caigou.id}` + url += caigou?.id break; case "hetong": url += row.join_last_flow_id @@ -2223,11 +1760,8 @@ export default { default: url = `${process.env.VUE_APP_OUT_URL}/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` - ); + this.oaUrl = url + this.isShowOaModal = true }, reset () { this.select = deepCopy(this.selectCopy) @@ -2356,56 +1890,50 @@ export default { } break; case 29: - case 19: + case 71: baseInfo = { "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 || "", + "caigouxiangmu": row.name || "", + "caigoufangshi": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value || "", + "zijinlaiyuan": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+","),"") || "", + "caigoujine": row.plan_price || "", + "caigouxiangmushuoming": row.content || "", + "zuzhixingshi": 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=${ - row.id - }&default_json=${JSON.stringify(baseInfo)}`; + let url = `${process.env.VUE_APP_OUT_OLD}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=${row.flow_mod_id}&out_contract_id=${row.id}&default_json=${JSON.stringify(baseInfo)}`; console.log('url',url) - let buyProcess = window.open( - url, - "buyProcess", - `top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0` - ); + // let buyProcess = window.open( + // url, + // "buyProcess", + // `top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0` + // ); + this.oaUrl = url + this.isShowOaModal = true }, //会签流程 async signProcess(row) { + // 72 this.setNowContract(row, "hetong"); let baseInfo = { "flow_title": row.name || "", - "65b37d8c6a94c": row?.name, - "658a6bc82d0b2": Number(row?.money) || row?.plan_price, + "hetongmingcheng": row?.name, + "amt": Number(row?.money) || row?.plan_price, out_contract_id: row.id, - "658a6c125e4e6": row.content, - "658a6c009002e": row.supply - //"承包商\\供应商":row.supply + "zhuyaoneirong": row.content, + "jiafang": row.supply }; - // let res = await getOatoken() - let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/20?&auth_token=${this.$store.getters.oa_token}&out_contract_id=${ - row.id - }&default_json=${JSON.stringify(baseInfo)}`; - let signProcess = window.open( - url, - "signProcess", - `top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0` - ); + let url = `${process.env.VUE_APP_OUT_OLD}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=72&out_contract_id=${row.id}&default_json=${JSON.stringify(baseInfo)}`; + + this.oaUrl = url; + this.isShowOaModal = true; }, //付款流程 async paying(row) { @@ -2583,6 +2111,7 @@ export default { res.list.data.forEach(i => this.handleContractFlow(i)) this.list = res.list.data; + console.log(this.list) this.total = res.list.total; this.tableTotal.fundLogTotal = res.fund_log_total; this.tableTotal.moneyTotal = Number(res.money_total) @@ -2822,7 +2351,7 @@ export default { class Flow { status = 0 executable = false - constructor(status=0, executable=false) { + constructor(status=-2, executable=false) { this.status = status this.executable = executable } @@ -2838,10 +2367,14 @@ export default { return this.status } isEnabled () { - return this.executable && (this.status === 1 || this.status === "") + return this.executable && (this.status === 2 || this.status === "") } } - //0无该流程,1未开始,2进行中,3已完成(合同签订1待签订,2已签订) + // [2, "待申请"], + // [-1, "已退回"], + // [-2, "-"], + // [0, "流转中"], + // [1, "已办结"] let flowStatus = { "caigou": new Flow(), "zhaobiao": new Flow(), @@ -2850,40 +2383,40 @@ export default { "zhifu": new Flow(), "other": new Flow() } + const caigou = item.flow_list.find(i => i.tag === 'caigou')?.detail + const shenpi = item.flow_list.find(i => i.tag === 'contract')?.detail if (item.is_purchase) { //为采购项目 if (item.is_simple !== 1 && !item.is_substitute) { //不为简易 采购未开始 - - flowStatus["caigou"].setStatus(item.purchase_status) - if (item.purchase_status === 1) { + flowStatus["caigou"].setStatus(caigou?.status ?? 2) + if (!caigou) { //采购未开始 - if (item.is_plan === 1 || (item.is_plan === 0 && item.req_status === 3)) { - //不为预算时,请示流程完成 + if (item.is_plan === 1) { 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"].setStatus(item.invite_status ?? 2) + if ((!item.invite_status || item.invite_status === 2) && caigou?.status === 1) { //采购完成,招标未开始 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.flow_mod_id === 5 || item.flow_mod_id === 29) && item.purchase_status === 3))) { + flowStatus["shenpi"].setStatus(shenpi?.status ?? 2) + if ((!shenpi?.status || shenpi?.status === 2) && (item.invite_status === 1 || + ((item.purchase_way?.remark === 'false' || item.flow_mod_id === 5 || item.flow_mod_id === 29) && caigou?.status === 1))) { //审批未开始 走招标招标完成或不走招标采购完成 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) { + if (shenpi?.status === 1 && item.status === 1) { flowStatus["qianding"].setExecutable(true) } } @@ -3074,3 +2607,14 @@ a:hover { text-decoration: underline; } + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 0ac12cf..69b70a4 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -191,7 +191,7 @@ -
+