From def2a9a6fe620081a10d8272b2f16a706f11e0c6 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: Mon, 13 Jul 2020 15:53:27 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E5=88=A0?=
=?UTF-8?q?=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.js | 6 +-
.../frame/uploadImage/uploadImage.html | 2 +-
.../purchaseApprovers/purchaseApprovers.js | 28 ++++----
.../addPurchaseApplyStep.js | 10 +--
public/vcCore/vcFramework.js | 65 ++++++++++++++++---
5 files changed, 77 insertions(+), 34 deletions(-)
diff --git a/app.js b/app.js
index cf23f416e..6a4d727fe 100644
--- a/app.js
+++ b/app.js
@@ -33,9 +33,9 @@ let opts = {
//app.use('/callComponent',proxy('https://app.demo.winqi.cn/',opts));
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012/',opts));
-app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
-//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
-
+//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
+app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
+app.use('/app',proxy('http://192.168.1.16:8012',opts));
//app.listen(3000);
app.use(express.json());
diff --git a/public/components/frame/uploadImage/uploadImage.html b/public/components/frame/uploadImage/uploadImage.html
index 98fa090ef..102347ca6 100644
--- a/public/components/frame/uploadImage/uploadImage.html
+++ b/public/components/frame/uploadImage/uploadImage.html
@@ -1,7 +1,7 @@
![]()
-
diff --git a/public/components/property/purchaseApprovers/purchaseApprovers.js b/public/components/property/purchaseApprovers/purchaseApprovers.js
index 2e60c1284..31012f37a 100644
--- a/public/components/property/purchaseApprovers/purchaseApprovers.js
+++ b/public/components/property/purchaseApprovers/purchaseApprovers.js
@@ -46,29 +46,23 @@
let _staffId = _userInfo.userId;
var param = {
params: {
- staffId: _staffId,
- page: 1,
- row: 1
+ communityId: vc.getCurrentCommunity().communityId,
+ flowType: '30003'
}
};
//发送get请求
- vc.http.apiGet('org.listOrgs',
+ vc.http.apiGet('/workflow/getFirstStaff',
param,
- function (json) {
+ function (json,res) {
var _staffInfo = JSON.parse(json);
- if (_staffInfo.total == 1) {
- let _tmpOrg = _staffInfo.orgs[0];
- $that.purchaseApproversInfo.companyName = _tmpOrg.parentOrgName;
- $that.purchaseApproversInfo.departmentName = _tmpOrg.orgName;
- $that.purchaseApproversInfo.departmentId = _tmpOrg.orgId;
- $that.purchaseApproversInfo.companyId = _tmpOrg.parentOrgId;
-
- vc.emit('purchaseApprovers','staffSelect2', 'setStaff',{
- companyId:_tmpOrg.parentOrgId,
- departmentId:_tmpOrg.orgId
- });
-
+ if (_staffInfo.code != 0) {
+ vc.toast(_staffInfo.msg);
+ return ;
}
+ let _data = _staffInfo.data;
+ vc.copyObject(_data,$that.purchaseApproversInfo);
+ $that.purchaseApproversInfo.companyName = _data.parentOrgName;
+ $that.purchaseApproversInfo.departmentName = _data.orgName;
}, function () {
console.log('请求失败处理');
}
diff --git a/public/pages/common/addPurchaseApplyStep/addPurchaseApplyStep.js b/public/pages/common/addPurchaseApplyStep/addPurchaseApplyStep.js
index fce60b577..e60d4c43a 100644
--- a/public/pages/common/addPurchaseApplyStep/addPurchaseApplyStep.js
+++ b/public/pages/common/addPurchaseApplyStep/addPurchaseApplyStep.js
@@ -94,10 +94,12 @@
_finishStep: function () {
vc.emit('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', null);
var _currentData = vc.component.addPurchaseApplyStepInfo.infos[vc.component.addPurchaseApplyStepInfo.index];
- if (_currentData == null || _currentData == undefined) {
- vc.toast("请选择或填写必选信息");
- return;
- }
+ if(vc.component.addPurchaseApplyStepInfo.index != 2){
+ if (_currentData == null || _currentData == undefined) {
+ vc.toast("请选择或填写必选信息");
+ return;
+ }
+ }
vc.http.post(
'addPurchaseApply',
'save',
diff --git a/public/vcCore/vcFramework.js b/public/vcCore/vcFramework.js
index 89184c31c..918cde5f5 100644
--- a/public/vcCore/vcFramework.js
+++ b/public/vcCore/vcFramework.js
@@ -151,7 +151,7 @@
_vcComponent.appendChild(_pathVcCreate);
}
- }else{
+ } else {
let _vcComponent = document.getElementById('component');
let _commonPath = _vcComponent.getAttribute('vc-path');
if (vc.isNotEmpty(_commonPath)) {
@@ -217,7 +217,7 @@
_divComponentAttr.value = _componentUrl;
_tmpVcCreate.setAttributeNode(_divComponentAttr);
_vcComponent.appendChild(_tmpVcCreate);
-
+
let _commonPath = _vcComponent.getAttribute('vc-path');
if (vc.isNotEmpty(_commonPath)) {
let _pathVcCreate = document.createElement("vc:create");
@@ -906,7 +906,10 @@
},
apiGet: function (api, param, successCallback, errorCallback) {
//加入缓存机制
- let _getPath = '/' + api;
+ let _getPath = '';
+ if (api.indexOf('/') != 0) {
+ _getPath = '/' + api;
+ }
if (vcFramework.constant.GET_CACHE_URL.includes(_getPath)) {
let _cacheData = vcFramework.getData(_getPath);
//浏览器缓存中能获取到
@@ -915,8 +918,20 @@
return;
}
}
+
+ let _api = '';
+
+ if (api.indexOf('/') >= 0) {
+ _api = '/app' + api;
+ Vue.http.headers.common['APP-ID'] = '8000418004';
+ Vue.http.headers.common['TRANSACTION-ID'] = vcFramework.uuid();
+ Vue.http.headers.common['REQ-TIME'] = vcFramework.getDateYYYYMMDDHHMISS();
+ Vue.http.headers.common['SIGN'] = '';
+ } else {
+ _api = '/callComponent/' + api;
+ }
vcFramework.loading('open');
- Vue.http.get('/callComponent/' + api, param)
+ Vue.http.get(_api, param)
.then(function (res) {
try {
@@ -1316,6 +1331,38 @@
return y + '-' + add0(m) + '-' + add0(d) + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s);
}
+ vcFramework.getDateYYYYMMDDHHMISS = function () {
+ let date = new Date();
+ let year = date.getFullYear();
+ let month = date.getMonth() + 1;
+ let day = date.getDate();
+ let hour = date.getHours();
+ let minute = date.getMinutes();
+ let second = date.getSeconds();
+
+ if (month < 10) {
+ month = '0' + month;
+ }
+
+ if (day < 10) {
+ day = '0' + day;
+ }
+
+ if (hour < 10) {
+ hour = '0' + hour;
+ }
+
+ if (minute < 10) {
+ minute = '0' + minute;
+ }
+
+ if (second < 10) {
+ second = '0' + second;
+ }
+
+ return year + "" + month + "" + day + "" + hour + "" + minute + "" + second;
+ };
+
})(window.vcFramework);
@@ -1624,21 +1671,21 @@ vc 校验 工具类 -method
* @param {校验文本} text
*/
num: function (text) {
- if(text == null || text == undefined){
+ if (text == null || text == undefined) {
return true;
}
let regNum = /^[0-9][0-9]*$/;
return regNum.test(text);
},
date: function (str) {
- if(str == null || str == undefined){
+ if (str == null || str == undefined) {
return true;
}
let regDate = /^(\d{4})-(\d{2})-(\d{2})$/;
return regDate.test(str);
},
dateTime: function (str) {
- if(str == null || str == undefined){
+ if (str == null || str == undefined) {
return true;
}
let reDateTime = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
@@ -1648,14 +1695,14 @@ vc 校验 工具类 -method
金额校验
**/
money: function (text) {
- if(text == null || text == undefined){
+ if (text == null || text == undefined) {
return true;
}
let regMoney = /^\d+\.?\d{0,2}$/;
return regMoney.test(text);
},
idCard: function (num) {
- if(num == null || num == undefined){
+ if (num == null || num == undefined) {
return true;
}
num = num.toUpperCase();