master
xy 1 year ago
parent 28751ccbfd
commit 0f6ce25211

@ -4,10 +4,10 @@ NODE_ENV = production
ENV = 'staging' ENV = 'staging'
# base api # base api
VUE_APP_BASE_API='https://cz-hjjc.115.langye.net' VUE_APP_BASE_API=''
VUE_APP_UPLOAD_API='https://cz-hjjc.115.langye.net/api/upload-file' VUE_APP_UPLOAD_API='/api/upload-file'
VUE_APP_PREVIEW=//view.langye.net/preview/onlinePreview VUE_APP_PREVIEW=//view.langye.net/preview/onlinePreview
VUE_APP_OUT_OLD=https://cz-hjjc.115.langye.net/oa VUE_APP_OUT_OLD = /oa
VUE_APP_OUT_URL=https://cz-hjjc.115.langye.net/oa VUE_APP_OUT_URL = /oa
VUE_APP_MODULE_NAME=ht VUE_APP_MODULE_NAME=ht

@ -61,6 +61,10 @@ import { setToken,getToken } from "@/utils/auth"
if(window.top !== window.self) { if(window.top !== window.self) {
// 当前页面在iframe中 // 当前页面在iframe中
window._IN_IFRAME = true; window._IN_IFRAME = true;
Vue.config.errorHandler = (err, vm, info) => {
parent?._addError(err.message, err.stack)
console.error(err)
}
} }
if (window.__POWERED_BY_WUJIE__) { if (window.__POWERED_BY_WUJIE__) {
let instance; let instance;

@ -14,7 +14,7 @@ let loading;
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests // withCredentials: true, // send cookies when cross-domain requests
timeout: 500000 // request timeout timeout: 50000 // request timeout
}) })
// request interceptor // request interceptor
@ -42,6 +42,7 @@ service.interceptors.request.use(
error => { error => {
// do something with request error // do something with request error
console.log(error) // for debug console.log(error) // for debug
parent?._addError(error, 'axios-request', error.config.params||error.config.data)
return Promise.reject(error) return Promise.reject(error)
} }
) )
@ -86,8 +87,12 @@ service.interceptors.response.use(
store.dispatch('user/resetToken').then(() => { store.dispatch('user/resetToken').then(() => {
location.reload() location.reload()
}) })
if (window._IN_IFRAME) {
parent?._logout()
}
}) })
} }
parent?._addError(res.msg, `axios-response ${response.config.url}`, response.config.params || response.config.data)
return Promise.reject(new Error(res.msg || 'Error')) return Promise.reject(new Error(res.msg || 'Error'))
} else { } else {
return res.data return res.data
@ -97,10 +102,11 @@ service.interceptors.response.use(
loading?.close() loading?.close()
console.error('err' + error) // for debug console.error('err' + error) // for debug
Message({ Message({
message: /Network Error/g.test(error) ? "网络错误" : "系统错误", message: /Network Error/g.test(error) ? "网络错误" : (/timeout/g.test(error) ? "网络超时" : "系统错误"),
type: 'error', type: 'error',
duration: 5 * 1000 duration: 5 * 1000
}) })
parent?._addError(error.toString(), `axios-request ${error.config.url}`, error.config.params || error.config.data)
return Promise.reject(error) return Promise.reject(error)
} }
) )

@ -51,7 +51,7 @@
<div> <div>
<Button <Button
type="primary" type="primary"
@click="$router.push('/contract/away/addAway')">新增</Button> @click="$router.push('/away/addAway')">新增</Button>
</div> </div>
<div> <div>
<Button type="primary" @click="getList"></Button> <Button type="primary" @click="getList"></Button>
@ -405,17 +405,10 @@ export default {
}, },
methods: { methods: {
printFlow (row) { printFlow (row) {
let id; let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=`
if (row.away_flow_id) { url += row.away_flow_id
id = row.away_flow_id; this.oaUrl = url
} else if (row.expense_flow_id) { this.isShowOaModal = true
id = row.expense_flow_id
} else {}
if (!id) {
this.$message.warning("未找到流程");
return
}
window.open(`${process.env.VUE_APP_OUT_URL}/flow/print-relate-flow?id=${id}&except_self=0&auth_token=${this.$store.getters.oa_token}`,"_blank")
}, },
async toOaDetail (tbname,row) { async toOaDetail (tbname,row) {

@ -2474,8 +2474,9 @@ export default {
this.select.is_myself = this.$route.path.split('_')[1] ? Number(this.$route.path.split('_')[1]) : 0; this.select.is_myself = this.$route.path.split('_')[1] ? Number(this.$route.path.split('_')[1]) : 0;
if (/contractLedger/g.test(this.$route.path)) { if (/contractLedger/g.test(this.$route.path)) {
this.select.is_contract = 1; this.select.is_contract = 1;
this.select.purchase_status = 3; // TODO:
this.select.invite_status = 3; /// this.select.purchase_status = 3;
// this.select.invite_status = 3;
} }
if (/contractAll/g.test(this.$route.path)) { if (/contractAll/g.test(this.$route.path)) {
this.select.is_simple = ""; this.select.is_simple = "";

@ -132,7 +132,7 @@
width="160" width="160"
header-align="center" header-align="center"
> >
<template slot-scope="scope" v-if="scope.row.flow_status === 3"> <template slot-scope="scope" v-if="authOa(scope.row)">
<template v-if="scope.row.status === 0"> <template v-if="scope.row.status === 0">
<Button <Button
size="small" size="small"
@ -537,6 +537,13 @@ export default {
}); });
}, },
}, },
computed: {
authOa () {
return function (row) {
return row.flow_list.find(i => i.tag === 'pay')?.status === 1
}
}
},
mounted() { mounted() {
this.getMoneyWay(); this.getMoneyWay();
this.getFundLogs(); this.getFundLogs();

Loading…
Cancel
Save