Commit 080dd313 by 钟乾明

u: 对该供方综合评估审批意见不能为空,请选择

parent 7ff062ff
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
build: build:
version: version:
## 本地运行
1. 修改src/api/index.js中testToken、testFid等主要参数
## Build Setup ## Build Setup
...@@ -93,6 +95,12 @@ npm run jffc-add-splashscreen ...@@ -93,6 +95,12 @@ npm run jffc-add-splashscreen
# add cordova plugin statusbar # add cordova plugin statusbar
npm run jffc-add-statusbar npm run jffc-add-statusbar
# 新老V+打包
npm run build:test:cordova // 打包美信云测试环境
npm run build:prod:cordova // 打包美信云正式环境
npm run build:test:qing // 打包云之家测试环境
npm run build:prod:qing // 打包云之家正式环境
``` ```
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
...@@ -28,7 +28,8 @@ var webpackConfig = merge(baseWebpackConfig, { ...@@ -28,7 +28,8 @@ var webpackConfig = merge(baseWebpackConfig, {
// http://vuejs.github.io/vue-loader/en/workflow/production.html // http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': env, 'process.env': env,
'process.env.PACK_ENV': JSON.stringify(process.env.PACK_ENV) 'process.env.PACK_ENV': JSON.stringify(process.env.PACK_ENV),
'process.env.PACK_PLATFORM': JSON.stringify(process.env.PACK_PLATFORM),
}), }),
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { compress: {
......
...@@ -9,7 +9,59 @@ ...@@ -9,7 +9,59 @@
<meta name="format-detection" content="telephone=no,email=no,adress=no" /> <meta name="format-detection" content="telephone=no,email=no,adress=no" />
<meta name="mobile-web-app-capable" content="jf"> <meta name="mobile-web-app-capable" content="jf">
<title>建发供方系统流程审批</title> <title>建发供方系统流程审批</title>
<script src="miniapp://common/js/qing/qing.js"></script> <script>
console.log('更新了 变量>>');
console.log('开始引入库>>');
const ua = window.navigator.userAgent.toLocaleLowerCase();
if (ua.indexOf('qing') > -1) {
console.log('ua qing>>')
if (ua.indexOf('miniapp') > -1) {
console.log('ua 云之家小程序>>')
document.write('<scr' + 'ipt src="miniapp://common/js/qing/qing.js"></scr' + 'ipt>');
sessionStorage.setItem('runClientEnv', 'miniapp');
} else {
console.log('轻应用>>');
const testFlags = ['test', 'localhost', '192.168'];// 测试环境的url标志
if (testFlags.some(flag => location.origin.includes(flag))) {
sessionStorage.setItem('env', 'test');
} else {
sessionStorage.setItem('env', 'prod');
}
const qingUrl = sessionStorage.getItem('env') === 'test' ? 'https://staging.jffctest.com/public/js/qing/latest/qing.js' : 'https://portal.cndrealty.com/public/js/qing/latest/qing.js';
document.write('<scr' + 'ipt src="' + qingUrl + '"></scr' + 'ipt>');
// 轻应用从url上取ticket
let urlParamStr = location.href.split('?')[ 1 ] || '';
urlParamStr = urlParamStr.split('/')[ 0 ] || ''; // 截止/。用于去除尾部 /
urlParamStr = urlParamStr.split('#')[ 0 ] || ''; // 截止#。用于去除尾部 #
const urlParams = new URLSearchParams(((location.href.split('?')[ 1 ] || '').split('/')[ 0 ] || '').split('#')[ 0 ]);
// 从url上取ticket 存至全局
sessionStorage.setItem('ticket', urlParams.get('ticket') || '');
sessionStorage.setItem('runClientEnv', 'qing');
}
}
</script>
<script>
console.log('window.qing 已经引入>>', window.qing)
window.qing && window.qing.ready(() => {
// 隐藏轻应用自带的标题栏
window.qing && window.qing.call('setWebViewTitleBar', {isShow: false})
// 适配iPhone X底部偏移量
window.qing && window.qing.call('setWebBottomInset', {show: true});
// 适配iPhone状态栏背景色
window.qing && window.qing.call('setStatuBarBackgroudColor', {
'color': '0D141C'// 背景色
})
// disappear: 离开当前页面窗口
window.qing.on('disappear', function () {
window.qing && window.qing.call('setStatuBarBackgroudColor', { 'color': '0D141C' })
});
// appear: 回到当前页面窗口
window.qing.on('appear', function () {
window.qing && window.qing.call('setStatuBarBackgroudColor', { 'color': '0D141C' })
});
})
</script>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
"dev": "node build/dev-server.js", "dev": "node build/dev-server.js",
"start": "node build/dev-server.js", "start": "node build/dev-server.js",
"build:test": "cross-env PACK_ENV=test node build/vt-build.js", "build:test": "cross-env PACK_ENV=test node build/vt-build.js",
"build:prod": "cross-env PACK_ENV=prod node build/vt-build.js" "build:prod": "cross-env PACK_ENV=prod node build/vt-build.js",
"build:test:cordova": "cross-env PACK_ENV=test PACK_PLATFORM=cordova node build/build.js",
"build:test:qing": "cross-env PACK_ENV=test PACK_PLATFORM=qing node build/build.js",
"build:prod:cordova": "cross-env PACK_ENV=prod PACK_PLATFORM=cordova node build/build.js",
"build:prod:qing": "cross-env PACK_ENV=prod PACK_PLATFORM=qing node build/build.js"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
......
...@@ -18,10 +18,10 @@ const mas = MAS.getInstance().config(masConfig) ...@@ -18,10 +18,10 @@ const mas = MAS.getInstance().config(masConfig)
// 测试token,从美信云平台的登录记录获取 // 测试token,从美信云平台的登录记录获取
const testToken = 'yzj_d0760d55e9d54b0bd7af2392e1722feb' const testToken = 'yzj_1a344f9d0e4eb1395ea59209b69a555c'
// 测试流程单据id // 测试流程单据id
const testFid = 'x9oAADIWh6nirKan' // x9oAAArMGB/irKan 营销类 x9oAAArNAtPirKan 商业类 x9oAAArNClDirKan const testFid = 'x9oAADIpYxfirKan' // x9oAAArMGB/irKan 营销类 x9oAAArNAtPirKan 商业类 x9oAAArNClDirKan
/* 1.供方更名:(会签)x9oAAArQslp2xf1N 、x9oAAArTSgN2xf1N - dingzhy@cndrealty.com 、x9oAAArQqcV2xf1N \\ (审批)x9oAAArTSdR2xf1N - liub@cndrealty.com /* 1.供方更名:(会签)x9oAAArQslp2xf1N 、x9oAAArTSgN2xf1N - dingzhy@cndrealty.com 、x9oAAArQqcV2xf1N \\ (审批)x9oAAArTSdR2xf1N - liub@cndrealty.com
* 2.调整联系方式:(会签)x9oAAArTSgN2xf1N - dingzhy@cndrealty.com 、x9oAAArMYD12xf1N - caimm \ \\ (审批)x9oAAArTSdR2xf1N - liub@cndrealty.com * 2.调整联系方式:(会签)x9oAAArTSgN2xf1N - dingzhy@cndrealty.com 、x9oAAArMYD12xf1N - caimm \ \\ (审批)x9oAAArTSdR2xf1N - liub@cndrealty.com
* 3.调整品牌方式:(会签)x9oAAArTShV2xf1N - xiewei * 3.调整品牌方式:(会签)x9oAAArTShV2xf1N - xiewei
......
...@@ -28,28 +28,31 @@ export default class CordovaApi extends NativeApi { ...@@ -28,28 +28,31 @@ export default class CordovaApi extends NativeApi {
if (typeof window !== 'undefined' && typeof window.document !== 'undefined') { if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {
var self = this var self = this
/* if (process.env.PACK_PLATFORM === 'qing') {
if (!window.document.getElementById('cordovaJS')) { window.qing.ready(() => {
var script = window.document.createElement('script') self.doReady(self)
script.id = 'cordovaJS' })
script.src = 'cordova.js' } else {
script.type = 'text/javascript' console.log('走的这里 cordova>>')
script.async = false if (!window.document.getElementById('cordovaJS')) {
script.onload = function () { var script = window.document.createElement('script')
console.log('Loading Cordova Plugin...') script.id = 'cordovaJS'
window.document.addEventListener('deviceready', function () { script.src = 'cordova.js'
self.doReady(self) script.type = 'text/javascript'
}, false) script.async = false
} script.onload = function () {
script.onerror = function () { console.log('Loading Cordova Plugin...')
console.error('Cannot Load Cordova Plugin!') window.document.addEventListener('deviceready', function () {
console.log('cordova 就绪!!!>>')
self.doReady(self)
}, false)
}
script.onerror = function () {
console.error('Cannot Load Cordova Plugin!')
}
window.document.body.appendChild(script)
} }
window.document.body.appendChild(script)
} }
*/
window.qing.ready(() => {
self.doReady(self)
})
} }
} }
......
...@@ -8,7 +8,12 @@ import store from './vuex/store' ...@@ -8,7 +8,12 @@ import store from './vuex/store'
/* V+兼容 */ /* V+兼容 */
import nativeApi from './base/NativeApi/cordova' import nativeApi from './base/NativeApi/cordova'
Vue.use(nativeApi, Object.assign({debug: true, maxRetryTimes: 10, retrySleepTime: 100}))
Vue.use(nativeApi, Object.assign({
debug: true,
maxRetryTimes: 10,
retrySleepTime: 100
}))
Vue.config.productionTip = false Vue.config.productionTip = false
...@@ -17,8 +22,21 @@ const VMT = new Vue({ ...@@ -17,8 +22,21 @@ const VMT = new Vue({
store, store,
render: h => h(App) render: h => h(App)
}) })
window.qing.ready(() => {
if (process.env.NODE_ENV === 'production') {
if (process.env.PACK_PLATFORM === 'qing') {
window.qing.ready(() => {
VMT.$mount('#app')
})
} else {
document.addEventListener('deviceready', function () {
VMT.$mount('#app')
})
}
} else {
VMT.$mount('#app') VMT.$mount('#app')
}) }
export default VMT export default VMT
...@@ -336,8 +336,7 @@ export default { ...@@ -336,8 +336,7 @@ export default {
break break
case this.PageTypes.Approval_Todo: case this.PageTypes.Approval_Todo:
if (!v.auditOpinion.trim()) { if (!v.auditOpinion.trim()) {
// tipText = '考察组综合结论不能为空!' tipText = '考察组综合结论不能为空!'
tipText = '对该供方综合评估审批意见不能为空,请选择'
isFinished = false isFinished = false
break break
} }
......
...@@ -218,7 +218,8 @@ export default { ...@@ -218,7 +218,8 @@ export default {
let tipTitle = `【${this.currentSupplierInfo.supplierName}-${this.currentSupplierInfo.supplierTypeName}】` let tipTitle = `【${this.currentSupplierInfo.supplierName}-${this.currentSupplierInfo.supplierTypeName}】`
let tipText = '' let tipText = ''
if (!this.supplyRank.opinion.trim()) { if (!this.supplyRank.opinion.trim()) {
tipText = '考察组综合结论不能为空!' // tipText = '考察组综合结论不能为空!'
tipText = '对该供方综合评估审批意见不能为空,请选择'
isFinished = false isFinished = false
} else if (this.supplyRank.supplyRank == '-1') { } else if (this.supplyRank.supplyRank == '-1') {
tipText = '综合评估不能为空!' tipText = '综合评估不能为空!'
......
import axios from 'axios' import axios from 'axios'
// 若有跨域一定要开启
var originAdapter = axios.defaults.adapter var originAdapter = axios.defaults.adapter
axios.defaults.adapter = function (config) { axios.defaults.adapter = function (config) {
if (!/^https?/.test(config.url)) { // 区分美信云cordova环境、云之家qing环境
if (process.env.PACK_PLATFORM === 'qing') {
if (sessionStorage.getItem('runClientEnv') === 'qing') {
console.log('轻应用request config>>', config)
return request(config)
}
if (!/^https?/.test(config.url)) {
console.log('is https>>')
return originAdapter(config)
}
console.log('适配器接管axios请求>>', config)
return request(config)
} else {
return originAdapter(config) return originAdapter(config)
} }
return request(config)
} }
function isObject (value) { function isObject (value) {
...@@ -23,7 +35,7 @@ function isFormData (fd) { ...@@ -23,7 +35,7 @@ function isFormData (fd) {
function formData2obj (fd) { function formData2obj (fd) {
var data = {} var data = {}
for (var p of fd.entries()) { for (var p of fd.entries()) {
data[p[0]] = p[1] data[ p[ 0 ] ] = p[ 1 ]
} }
return data return data
} }
...@@ -39,7 +51,7 @@ function params2object (url) { ...@@ -39,7 +51,7 @@ function params2object (url) {
.forEach((n) => { .forEach((n) => {
n = n.split('=') n = n.split('=')
if (n.length === 2) { if (n.length === 2) {
params[n[0]] = decodeURIComponent(n[1]) params[ n[ 0 ] ] = decodeURIComponent(n[ 1 ])
} }
}) })
} }
...@@ -65,11 +77,11 @@ function request (opt) { ...@@ -65,11 +77,11 @@ function request (opt) {
opt.url = opt.url.replace(/^\s+|\s+$/g, '') opt.url = opt.url.replace(/^\s+|\s+$/g, '')
// 将params拼接到url中 // 将params拼接到url中
opt.url = opt.url =
opt.url.split('?')[0] + opt.url.split('?')[ 0 ] +
'?' + '?' +
Object.keys(urlParams) Object.keys(urlParams)
.map((key) => { .map((key) => {
var val = urlParams[key] var val = urlParams[ key ]
if (isObject(val)) { if (isObject(val)) {
val = JSON.stringify(val) val = JSON.stringify(val)
val = decodeURIComponent(val)// 有对象参数的先解码 val = decodeURIComponent(val)// 有对象参数的先解码
...@@ -85,7 +97,7 @@ function request (opt) { ...@@ -85,7 +97,7 @@ function request (opt) {
if (opt.method.toLowerCase() === 'post') { if (opt.method.toLowerCase() === 'post') {
var data = opt.data var data = opt.data
const headers = opt.headers const headers = opt.headers
const contentType = headers['content-type'] || headers['Content-Type'] || headers['CONTENT-TYPE'] || '' const contentType = headers[ 'content-type' ] || headers[ 'Content-Type' ] || headers[ 'CONTENT-TYPE' ] || ''
if (contentType.indexOf('application/json') !== -1) { if (contentType.indexOf('application/json') !== -1) {
serializer = 'json' serializer = 'json'
} }
...@@ -109,7 +121,7 @@ function request (opt) { ...@@ -109,7 +121,7 @@ function request (opt) {
const headers = {} const headers = {}
// headers字段值必须是字符串型 // headers字段值必须是字符串型
Object.keys(opt.headers).forEach(function (key) { Object.keys(opt.headers).forEach(function (key) {
var val = opt.headers[key] var val = opt.headers[ key ]
if (val) { if (val) {
var type = typeof val var type = typeof val
if (type !== 'string') { if (type !== 'string') {
...@@ -119,12 +131,12 @@ function request (opt) { ...@@ -119,12 +131,12 @@ function request (opt) {
// 因content-type可能存在大小写不规范,这里先过滤掉,后面根据serializer统一添加 // 因content-type可能存在大小写不规范,这里先过滤掉,后面根据serializer统一添加
var _key = key.toLowerCase() var _key = key.toLowerCase()
if (_key !== 'content-type') { if (_key !== 'content-type') {
headers[_key] = val headers[ _key ] = val
} }
} }
}) })
// 根据serializer统一添加content-type // 根据serializer统一添加content-type
headers['content-type'] = serializer === 'json' ? 'application/json' : 'application/x-www-form-urlencoded' headers[ 'content-type' ] = serializer === 'json' ? 'application/json' : 'application/x-www-form-urlencoded'
opt.headers = headers opt.headers = headers
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
......
...@@ -194,7 +194,7 @@ export default { ...@@ -194,7 +194,7 @@ export default {
} else { } else {
let arr = [] let arr = []
response.data.rows.forEach(v => { response.data.rows.forEach(v => {
arr.push(getReviewSummaryInfo({billId: (Coder.encode(v.id))})) arr.push(getReviewSummaryInfo({billId: process.env.PACK_PLATFORM ? (Coder.encode(v.id)) : Coder.replace(v.id)}))
}) })
Promise.all(arr) Promise.all(arr)
.then(resultArr => { .then(resultArr => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment