From 7662665a4f88da0f8afa804bd4a34dfbefc1fb56 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 29 八月 2025 15:17:59 +0800
Subject: [PATCH] get_pre_page_subtable_next_row
---
pages/modal/3037.vue | 2613 +++++++++++++++++++++++++++--------------------------------
1 files changed, 1,198 insertions(+), 1,415 deletions(-)
diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue
index 8705578..a1e17b8 100644
--- a/pages/modal/3037.vue
+++ b/pages/modal/3037.vue
@@ -670,7 +670,10 @@
classAttrList,
} from "@/api/index.js"
import buttonClickMixin from '@/mixins/button-click.js';
-
+ import {
+ showInfo,
+ showError
+ } from "@/js/Page.js"
export default {
mixins: [buttonClickMixin],
@@ -679,7 +682,7 @@
},
data() {
return {
- largeMode: getApp().globalData.largeMode || false,
+ largeMode: getApp().globalData.largeMode || false,
title: '鏂板',
param: {},
classAttrList: [],
@@ -707,21 +710,13 @@
this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧
console.log(param);
if (!param.Master_Cls.View_Style) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒")
+
return;
}
if (!param.Master_Cls.View_Style.Name) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒")
+
return;
}
this.param = param;
@@ -779,12 +774,8 @@
return result?.dict_item_list || []
} catch (ex) {
- uni.showModal({
- title: this.translateSys('error') + " 1.2",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + " 1.2")
+
return []
}
@@ -808,17 +799,8 @@
}
return result
} catch (ex) {
- // console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("error") + " 1.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys("error") + " 1.1")
+
return []
};
},
@@ -839,16 +821,8 @@
} catch (ex) {
// console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("error") + " 1.2",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys("error") + " 1.2")
+
return {}
};
},
@@ -1118,12 +1092,8 @@
console.log(this.classAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛�)
+
}
},
subClass_attr_init() {
@@ -1273,24 +1243,16 @@
console.log(this.subClassAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛�)
+
}
},
scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this;
var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event;
if (!Before_Select_Event) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "閫夋嫨鍓嶄簨浠朵负绌猴紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("閫夋嫨鍓嶄簨浠朵负绌猴紒")
+
return;
}
var mast_attr = [];
@@ -1300,12 +1262,8 @@
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷�) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar.DispName + "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
@@ -1351,13 +1309,7 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -1430,12 +1382,8 @@
var $this = this;
var After_Select_Event = $this.param.Scan_Code.After_Select_Event;
if (!After_Select_Event) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "閫夋嫨鍚庝簨浠朵负绌猴紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("閫夋嫨鍚庝簨浠朵负绌猴紒")
+
return;
}
var items = $this.check_list.items;
@@ -1453,12 +1401,8 @@
}
}
if (data.length == 0) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鏈�鎷╂暟鎹紒")
+
return;
}
var mast_attr = [];
@@ -1468,12 +1412,8 @@
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷�) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar.DispName + "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
@@ -1530,40 +1470,31 @@
// console.log(success);
uni.hideLoading();
$this.subPanelList.splice(index, 1);
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鍒犻櫎鎴愬姛锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鍒犻櫎鎴愬姛锛�)
+
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('tip') + "9.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "9.1")
});
}
},
ontap(e) { //鎵爜鍔熻兘
//console.log(e.target)
getApp().onScan((result) => {
- //console.log(result.decodedata);
+ //console.log(result);
var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']].Value;
// if(!isVal){
- // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata;
+ // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result;
// var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value;
// return;
// }
//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
- if (isVal != result.decodedata) {
+ if (isVal != result) {
this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
- 'iindex']].Value = result.decodedata;
+ 'iindex']].Value = result;
uni.hideKeyboard();
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1590,7 +1521,7 @@
mast_attr: [],
inputParamter: [{
attr: 'mast_input_3037',
- value: result.decodedata
+ value: result
}]
}
@@ -1602,13 +1533,13 @@
subontap(e) { //鎵爜鍔熻兘
//console.log(e.target)
getApp().onScan((result) => {
- //console.log(result.decodedata);
+ //console.log(result);
var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e
.target.dataset['iindex']].Value;
//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
- if (isVal != result.decodedata) {
+ if (isVal != result) {
this.subClassAttrList[e.target.dataset['index']].Attr[e.target
- .dataset['iindex']].Value = result.decodedata;
+ .dataset['iindex']].Value = result;
uni.hideKeyboard();
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1635,7 +1566,7 @@
mast_attr: [],
inputParamter: [{
attr: 'mast_input_3037',
- value: result.decodedata
+ value: result
}]
}
@@ -1647,16 +1578,16 @@
scan_ontap(e) { //鎵爜鍖烘壂鐮佸姛鑳� //console.log(e.target)
getApp().onScan((result) => {
- console.log(result.decodedata);
+ console.log(result);
var isflag = true;
for (var i in this.subPanelList) {
- if (this.subPanelList[i].scanCodeVal == result.decodedata)
+ if (this.subPanelList[i].scanCodeVal == result)
isflag = false;
}
//瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁
if (isflag) {
uni.hideKeyboard();
- this.scanCodeVal = result.decodedata;
+ this.scanCodeVal = result;
var eventid = this.param.Scan_Code.Input_Change_Event.ID;
if (eventid) {
var mast_req = [];
@@ -2199,21 +2130,13 @@
var button_callback = $this.classAttrList[index].Attr[iindex]
.button_callback;
if (!before_click_button) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "before_click_button-event_id涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("before_click_button-event_id涓虹┖锛�)
+
return;
}
if (!button_callback) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "button_callback-event_id涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("button_callback-event_id涓虹┖锛�)
+
return;
}
var data_attr = this.classAttrList[
@@ -2284,12 +2207,8 @@
},
classAttr_AddRef(e) {
console.log(e.target);
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "姝ゅ姛鑳借繕鏈疄鐜帮紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("姝ゅ姛鑳借繕鏈疄鐜帮紒")
+
// var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value];
// this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
},
@@ -2418,15 +2337,7 @@
.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar
- .DispName +
- '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -2475,32 +2386,39 @@
dataObjCreate(dataInfo).then(result => {
console.log(result);
uni.hideLoading();
- if (success.result
- .action) {
- var action = JSON
- .parse(success
- .result.Action
- );
- if (action.ret ==
- '0') {
- if (action
- .result_type ==
- '0') {
- uni.showToast({
- title: action
- .result,
- icon: "success",
- duration: 3000
- });
+ let data = result.lua_result
+ if (data) {
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
}
- // "{"ret":0, "result_type":0, "result":"鍒涘缓鎴愬姛123123123","info":""}"
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
+ return false
+ } else {
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ if (tip) {
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ } else
+ showInfo(this.translate('create_success'));
}
- } else
- uni.showToast({
- title: "鍒涘缓鎴愬姛锛�,
- icon: "success",
- duration: 3000
- });
+
+ }
//鍒锋柊
uni.redirectTo({
url: '../modal/3037?param=' +
@@ -2516,12 +2434,7 @@
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip'))
});
},
ini_DataObjRunCustomEvent(info) {
@@ -2587,180 +2500,165 @@
runCustomEvent(
dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
- if (data.action) {
- var actionlist =
- data.action;
- if (actionlist) {
- for (var j =
- 0; j <
- actionlist
- .length; j++
- ) {
- var action =
- actionlist[
- j]
- var action_type =
- action
- .action_type;
- var value =
- action
- .value;
- if (action_type ==
- 'set_dlg_attr'
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
+ try {
+ var actionlist =
+ data.action || []
+ if (actionlist) {
+ for (var j =
+ 0; j <
+ actionlist
+ .length; j++
) {
- if (
- value) {
- var val =
- value;
- if (typeof value ==
- 'string'
- ) {
- val =
- JSON
- .parse(
- value
+ var action =
+ actionlist[
+ j]
+ var action_type =
+ action
+ .action_type;
+ var value =
+ action
+ .value;
+ if (action_type ==
+ 'set_dlg_attr'
+ ) {
+ if (
+ value) {
+ var val =
+ value;
+ if (typeof value ==
+ 'string'
+ ) {
+ val =
+ JSON
+ .parse(
+ value
+ );
+ }
+ console
+ .log(
+ val
);
- }
- console
- .log(
- val
- );
- for (
- var i =
- 0; i <
- val
- .length; i++
- ) {
for (
- var a =
- 0; a <
- this.classAttrList
- .length; a++
+ var i =
+ 0; i <
+ val
+ .length; i++
) {
for (
- var l =
- 0; l <
- this.classAttrList[
- a
- ]
- .Attr
- .length; l++
+ var a =
+ 0; a <
+ this.classAttrList
+ .length; a++
) {
- var ca =
+ for (
+ var l =
+ 0; l <
this.classAttrList[
a
]
- .Attr[
- l
- ];
- if (val[
- i]
- .attr ==
- ca
- .Name
+ .Attr
+ .length; l++
) {
- if (utils.classUtils.attrTypeIsDict(ca.Type)) {
- var
- dictItemList = [];
- for (
- var d in
- val[
- i]
- .choice_list
- ) {
- var val =
- val[
- i]
- .choice_list[
- d
- ];
- dictItemList
- .push({
- "CN_S_NAME": val,
- "CN_S_VALUE": val,
- "Name": val,
- "label": val,
- "value": val
- });
+ var ca =
+ this.classAttrList[
+ a
+ ]
+ .Attr[
+ l
+ ];
+ if (val[
+ i]
+ .attr ==
+ ca
+ .Name
+ ) {
+ if (utils.classUtils.attrTypeIsDict(ca.Type)) {
+ var
+ dictItemList = [];
+ for (
+ var d in
+ val[
+ i]
+ .choice_list
+ ) {
+ var val =
+ val[
+ i]
+ .choice_list[
+ d
+ ];
+ dictItemList
+ .push({
+ "CN_S_NAME": val,
+ "CN_S_VALUE": val,
+ "Name": val,
+ "label": val,
+ "value": val
+ });
+ }
+ ca.dictitem =
+ dictItemList;
+ // attr[j].dictitem = val[i].choice_list;
+ } else {
+ // ca.value = val[i].value;
}
- ca.dictitem =
- dictItemList;
- // attr[j].dictitem = val[i].choice_list;
- } else {
- // ca.value = val[i].value;
}
}
}
- }
+ }
}
}
- }
- if (action_type ==
- 'open_select_userdlg'
- ) {
- uni.showModal({
- title: this.translateSys('error') + " 2.2",
- content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+
}
}
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ console.log(ex)
+ return
}
}
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 2.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "2.1")
});
},
DataObjRunCustomEvent(info, data_attr) {
@@ -2844,75 +2742,219 @@
runCustomEvent(
dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
-
- var actionlist = data
- .action;
- if (actionlist) {
- console.log(
- actionlist);
- for (var i = 0; i <
- actionlist
- .length; i++) {
- var action =
- actionlist[
- i];
- if (action
- .action_type ==
- 'set_dlg_attr'
- ) {
- var result =
- action
- .value;
- for (var i =
- 0; i <
- result
- .length; i++
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
+ var result = data
+ .result || []
+ for (var i = 0; i <
+ result
+ .length; i++) {
+ for (var c =
+ 0; c <
+ $this.classAttrList
+ .length; c++
) {
- if (result[
- i
- ]
- .choice_list
+ var attr =
+ $this
+ .classAttrList[
+ c]
+ .Attr;
+ for (var j =
+ 0; j <
+ attr
+ .length; j++
) {
+ if (attr[
+ j
+ ]
+ .Name ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ attr[
+ j]
+ .Value =
+ result[
+ i
+ ]
+ .value;
+ }
+ }
+ }
+
+ var length = 0;
+ if (!$this
+ .refdatastore
+ .filter(
+ function(
+ s
+ ) {
+ return result[
+ i
+ ]
+ .attr ==
+ s
+ .attr
+ })
+ .length) {
+ length = 1;
+ $this.refdatastore
+ .push(
+ result[
+ i
+ ]
+ );
+ }
+ if (length ==
+ 0) {
+ for (var j =
+ 0; j <
+ $this
+ .refdatastore
+ .length; j++
+ ) {
+ if ($this
+ .refdatastore[
+ j
+ ]
+ .attr ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ $this
+ .refdatastore[
+ j
+ ]
+ .value =
+ result[
+ i
+ ]
+ .value;
+ }
+ }
+ }
+ }
+
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
+ try {
+ var actionlist = data.action || []
+ for (var i = 0; i <
+ actionlist
+ .length; i++) {
+ var action =
+ actionlist[
+ i];
+ if (action
+ .action_type ==
+ 'set_dlg_attr'
+ ) {
+ var result =
+ action
+ .value;
+ for (var i =
+ 0; i <
+ result
+ .length; i++
+ ) {
+ if (result[
+ i
+ ]
+ .choice_list
+ ) {
+ for (
+ var c =
+ 0; c <
+ $this.classAttrList
+ .length; c++
+ ) {
+ var attr =
+ $this.classAttrList[
+ c
+ ]
+ .Attr;
+ for (
+ var j =
+ 0; j <
+ attr
+ .length; j++
+ ) {
+ if (attr[
+ j
+ ]
+ .Name ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ if (utils.classUtils.attrTypeIsDict(attr[j].Type)) {
+ var
+ dictItemList = [];
+ for (
+ var d in
+ result[
+ i
+ ]
+ .choice_list
+ ) {
+ var val =
+ result[
+ i
+ ]
+ .choice_list[
+ d
+ ];
+ dictItemList
+ .push({
+ "CN_S_NAME": val,
+ "CN_S_VALUE": val,
+ "Name": val,
+ "label": val,
+ "value": val
+ });
+ }
+ attr[
+ j]
+ .dictitem =
+ dictItemList;
+ // attr[j].dictitem = result[i].choice_list;
+ }
+ }
+ }
+ }
+ }
for (
var c =
0; c <
@@ -2930,6 +2972,18 @@
attr
.length; j++
) {
+ console
+ .log(
+ attr[
+ j
+ ]
+ .Name +
+ '==' +
+ result[
+ i
+ ]
+ .attr
+ );
if (attr[
j
]
@@ -2939,271 +2993,105 @@
]
.attr
) {
- if (utils.classUtils.attrTypeIsDict(attr[j].Type)) {
- var
- dictItemList = [];
- for (
- var d in
- result[
- i
- ]
- .choice_list
- ) {
- var val =
- result[
- i
- ]
- .choice_list[
- d
- ];
- dictItemList
- .push({
- "CN_S_NAME": val,
- "CN_S_VALUE": val,
- "Name": val,
- "label": val,
- "value": val
- });
- }
- attr[
- j]
- .dictitem =
- dictItemList;
- // attr[j].dictitem = result[i].choice_list;
- }
+ attr[
+ j]
+ .Value =
+ result[
+ i
+ ]
+ .value;
+ }
+ }
+ }
+ 0;
+ if (!
+ $this.refdatastore
+ .filter(
+ function(
+ s
+ ) {
+ return result[
+ i
+ ]
+ .attr ==
+ s
+ .attr
+ }
+ )
+ .length
+ ) {
+ length
+ =
+ 1;
+ $this
+ .refdatastore
+ .push(
+ result[
+ i
+ ]
+ );
+ }
+ if (length ==
+ 0
+ ) {
+ for (
+ var j =
+ 0; j <
+ $this
+ .refdatastore
+ .length; j++
+ ) {
+ if ($this
+ .refdatastore[
+ j
+ ]
+ .attr ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ $this
+ .refdatastore[
+ j
+ ]
+ .value =
+ result[
+ i
+ ]
+ .value;
}
}
}
}
- for (
- var c =
- 0; c <
- $this.classAttrList
- .length; c++
- ) {
- var attr =
- $this.classAttrList[
- c
- ]
- .Attr;
- for (
- var j =
- 0; j <
- attr
- .length; j++
- ) {
- console
- .log(
- attr[
- j
- ]
- .Name +
- '==' +
- result[
- i
- ]
- .attr
- );
- if (attr[
- j
- ]
- .Name ==
- result[
- i
- ]
- .attr
- ) {
- attr[
- j]
- .Value =
- result[
- i
- ]
- .value;
- }
- }
- }
- 0;
- if (!
- $this.refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- }
- )
- .length
- ) {
- length
- =
- 1;
- $this
- .refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0
- ) {
- for (
- var j =
- 0; j <
- $this
- .refdatastore
- .length; j++
- ) {
- if ($this
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .refdatastore[
- j
- ]
- .value =
- result[
- i
- ]
- .value;
- }
- }
- }
- }
- } else if (data
- .action[i]
- .action_type ==
- 'set_global_attr'
- ) {
- $this.global_attr =
- data
- .action[
- i]
- .value || [];
- }
- }
- }
-
- if (data.result) {
- var result = data
- .result;
- for (var i = 0; i <
- result
- .length; i++) {
- for (var c =
- 0; c <
- $this.classAttrList
- .length; c++
- ) {
- var attr =
- $this
- .classAttrList[
- c]
- .Attr;
- for (var j =
- 0; j <
- attr
- .length; j++
+ } else if (data
+ .action[i]
+ .action_type ==
+ 'set_global_attr'
) {
- if (attr[
- j
- ]
- .Name ==
- result[
- i
- ]
- .attr
- ) {
- attr[
- j]
- .Value =
- result[
- i
- ]
- .value;
- }
+ $this.global_attr =
+ data
+ .action[
+ i]
+ .value || [];
}
}
- var length = 0;
- if (!$this
- .refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- })
- .length) {
- length = 1;
- $this.refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0) {
- for (var j =
- 0; j <
- $this
- .refdatastore
- .length; j++
- ) {
- if ($this
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .refdatastore[
- j
- ]
- .value =
- result[
- i
- ]
- .value;
- }
- }
- }
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ console.log(ex)
+ return
}
}
+
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 3.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "3.1")
});
},
OKDataObjRunCustomEvent() {
@@ -3304,111 +3192,96 @@
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- if (data.result) {
- var result = data
- .result;
- for (var i = 0; i <
- result.length; i++
- ) {
- // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value);
- var length = 0;
- if (!this.refdatastore
- .filter(
- function(
- s) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- }).length
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
+ var result = data.result || []
+ for (var i = 0; i <
+ result.length; i++
) {
- length = 1;
- this.refdatastore.push(
- result[
- i]
- );
- }
- if (length == 0) {
- for (var j =
- 0; j < this
- .refdatastore
- .length; j++
+ // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value);
+ var length = 0;
+ if (!this.refdatastore
+ .filter(
+ function(
+ s) {
+ return result[
+ i
+ ]
+ .attr ==
+ s
+ .attr
+ }).length
) {
- if (this
- .refdatastore[
- j]
- .attr ==
+ length = 1;
+ this.refdatastore.push(
result[
i]
- .attr
+ );
+ }
+ if (length == 0) {
+ for (var j =
+ 0; j < this
+ .refdatastore
+ .length; j++
) {
- this.refdatastore[
- j
- ]
- .value =
+ if (this
+ .refdatastore[
+ j]
+ .attr ==
result[
- i
- ]
- .value;
+ i]
+ .attr
+ ) {
+ this.refdatastore[
+ j
+ ]
+ .value =
+ result[
+ i
+ ]
+ .value;
+ }
}
}
}
- }
- this.add();
+ this.add();
+
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
}
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 4.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "4.1")
});
},
DataObjRunCustomEvent_Return(eventid,
@@ -3514,53 +3387,39 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
- if (data != "") {
- var actions = data
- .action;
- console.log(
- actions);
- if (actions) {
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+ }
+ try {
+ var actions = data.action || []
for (var i =
0; i <
actions
@@ -3840,26 +3699,21 @@
.show();
}
}
+
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ console.log(ex)
+ return
}
- } else {
- uni.showModal({
- title: this.translateSys('tip') + "5.2",
- content: '璋冪敤 before_click_button 鑴氭湰杩斿洖绌猴紝event_id' +
- eventid,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
}
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('tip') + "5.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "5.1")
});
},
scan_ini_DataObjRunCustomEvent(info) {
@@ -3924,109 +3778,88 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
- var actionlist = data
- .action;
- if (actionlist) {
- for (var j = 0; j <
- actionlist
- .length; j++) {
- var action =
- actionlist[
- j]
- var action_type =
- action
- .action_type;
- var value =
- action
- .value;
- if (action_type ==
- 'set_dlg_attr'
- ) {
- if (value) {
- var val = value;
- if (typeof value == 'string') {
- val = JSON.parse(value);
- }
- console.log(val);
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
- for (var i = 0; i < val.length; i++) {
- for (var a = 0; a < this.subClassAttrList.length; a++) {
- for (var l = 0; l < this.subClassAttrList[a].Attr.length; l++) {
- var ca = this.subClassAttrList[a].Attr[l];
- if (val[i].attr == .Name) {
- if (utils.classUtils.attrTypeIsDict(ca.Type)) {
- var dictItemList = [];
- for (var d in val[i].choice_list) {
- var val = val[i].choice_list[d];
- dictItemList.push({
- "CN_S_NAME": val,
- "CN_S_VALUE": val,
- "Name": val,
- "label": val,
- "value": val
- });
+ }
+ try {
+ var actionlist = data.action || []
+ for (var j = 0; j < actionlist.length; j++) {
+ var action = actionlist[j]
+ var action_type = action.action_type;
+ var value = action.value;
+ if (action_type == 'set_dlg_attr') {
+ if (value) {
+ var val = value;
+ if (typeof value == 'string') {
+ val = JSON.parse(value);
+ }
+ console.log(val);
+ for (var i = 0; i < val.length; i++) {
+ for (var a = 0; a < this.subClassAttrList.length; a++) {
+ for (var l = 0; l < this.subClassAttrList[a].Attr
+ .length; l++) {
+ var ca = this.subClassAttrList[a].Attr[l];
+ if (val[i].attr == .Name) {
+ if (utils.classUtils.attrTypeIsDict(ca.Type)) {
+ var dictItemList = [];
+ for (var d in val[i].choice_list) {
+ var val = val[i].choice_list[d];
+ dictItemList.push({
+ "CN_S_NAME": val,
+ "CN_S_VALUE": val,
+ "Name": val,
+ "label": val,
+ "value": val
+ });
+
+ }
+ ca.dictitem = dictItemList;
}
- ca.dictitem = dictItemList;
- }
+ }
}
}
}
}
}
}
- }
- if (action_type ==
- 'open_select_userdlg'
- ) {
- uni.showModal({
- title: this.translateSys('error') + " 6.2",
- content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ console.log(ex)
+ return
}
}
}
@@ -4034,12 +3867,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 6.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "6.1")
});
},
scan_DataObjRunCustomEvent(info, data_attr) {
@@ -4114,298 +3942,54 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
-
- var actionlist = data
- .action;
- if (actionlist) {
- console.log(
- actionlist);
- for (var ii =
- 0; ii <
- actionlist
- .length; ii++
- ) {
- var action =
- actionlist[
- ii];
- if (action
- .action_type ==
- 'set_dlg_attr'
- ) {
- var result =
- action
- .value;
- for (var i =
- 0; i <
- result
- .length; i++
- ) {
- if (result[
- i
- ]
- .choice_list
- ) {
- for (
- var s =
- 0; s <
- $this.subPanelList
- .length; s++
- ) {
- for (var c = 0; c < $this.subPanelList[s].subClassAttrList
- .length; c++) {
- var attr =
- $this.subPanelList[
- s
- ]
- .subClassAttrList[
- c
- ]
- .Attr;
- for (
- var j =
- 0; j <
- attr
- .length; j++
- ) {
- if (attr[
- j
- ]
- .Name ==
- result[
- i
- ]
- .attr
- ) {
- if (utils.classUtils.attrTypeIsDict(attr[j]
- .Type)) {
- var
- dictItemList = [];
- for (
- var d in
- result[
- i
- ]
- .choice_list
- ) {
- var val =
- result[
- i
- ]
- .choice_list[
- d
- ];
- dictItemList
- .push({
- "CN_S_NAME": val,
- "CN_S_VALUE": val,
- "Name": val,
- "label": val,
- "value": val
- });
- }
- attr[
- j]
- .dictitem =
- dictItemList;
- // attr[j].dictitem = result[i].choice_list;
- }
- }
- }
- }
- }
- }
- for (
- var s =
- 0; s <
- $this
- .subPanelList
- .length; s++
- ) {
- for (
- var c =
- 0; c <
- $this
- .subPanelList[
- s
- ]
- .subClassAttrList
- .length; c++
- ) {
- var attr =
- $this
- .subPanelList[
- s
- ]
- .subClassAttrList[
- c
- ]
- .Attr;
- for (
- var j =
- 0; j <
- attr
- .length; j++
- ) {
- console
- .log(
- attr[
- j
- ]
- .Name +
- '==' +
- result[
- i
- ]
- .attr
- );
- if (attr[
- j
- ]
- .Name ==
- result[
- i
- ]
- .attr
- ) {
- attr[
- j]
- .Value =
- result[
- i
- ]
- .value;
- }
- }
- }
- }
- }
- } else if (
- action
- .action_type ==
- 'set_global_attr'
- ) {
- $this
- .$actiontr =
- action
- .value || [];
- } else if (
- action
- .action_type ==
- 'open_common_dlg'
- ) { //鎵撳紑渚ф粦寮规
- var $this =
- this;
- if (action
- .value
- .common_dlg_id ==
- 'check_list'
- ) {
- $this.check_list =
- action
- .value
- .config;
- if (action
- .value
- .config
- .appear_style ==
- 'sideslip'
- ) //鍒ゆ柇鏄惁鏄晶婊�- $this
- .popupType =
- 'right';
- else
- $this.popupType =
- 'center'
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
- $this
- .$refs
- .popup
- .open(
- $this
- .popupType
- );
- }
- } else if (
- action
- .action_type ==
- 'add_subcls_panel'
- ) { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- var result =
- action
- .value;
- var $this =
- this;
- var list_1 =
- JSON
- .parse(
- JSON
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
+ if (data.result) {
+ var list_1 = JSON
+ .parse(JSON
.stringify(
this.subClassAttrList
- )
- );
+ ));
var scanCodeVal =
$this.scanCodeVal;
- var rand =
- '';
- for (var i =
- 0; i <
+ var rand = '';
+ for (var i = 0; i <
5; i++
) { //鐢熸垚5浣嶉殢鏈烘暟
- rand +=
- Math
- .floor(
- Math
+ rand += Math
+ .floor(Math
.random() *
- 10
- );
+ 10);
}
if (inputParamter[
- 0]
- .attr
- ) {
+ 0].attr) {
if (inputParamter[
- 0
- ]
+ 0]
.attr ==
"mast_input_3037"
) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�@@ -4413,15 +3997,10 @@
"mast_input_3037-" +
rand;
}
- if (info
- .attr[
- 0]
- .attr
- ) {
- if (info
- .attr[
- 0
- ]
+ if (info.attr[0]
+ .attr) {
+ if (info.attr[
+ 0]
.attr ==
"mast_input_3037"
) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�@@ -4434,20 +4013,18 @@
scanCodeVal: scanCodeVal,
subClassAttr: list_1
});
- for (var i =
- 0; i <
+ var result = data
+ .result;
+ for (var i = 0; i <
result
- .length; i++
- ) {
- for (
- var s =
+ .length; i++) {
+ for (var s =
0; s <
$this.subPanelList
.length; s++
) {
if ($this.subPanelList[
- s
- ]
+ s]
.scanCodeVal ==
scanCodeVal
) {
@@ -4507,15 +4084,11 @@
}
}
}
-
- // $this.subPanelList[s].subClassAttr=list_1;
}
}
- var length =
- 0;
- if (!
- $this.refdatastore
+ var length = 0;
+ if (!$this.refdatastore
.filter(
function(
s
@@ -4526,13 +4099,9 @@
.attr ==
s
.attr
- }
- )
- .length
- ) {
- length
- =
- 1;
+ })
+ .length) {
+ length = 1;
$this.refdatastore
.push(
result[
@@ -4541,15 +4110,15 @@
);
}
if (length ==
- 0
- ) {
- for (
- var j =
+ 0) {
+ for (var j =
0; j <
- $this.refdatastore
+ $this
+ .refdatastore
.length; j++
) {
- if ($this.refdatastore[
+ if ($this
+ .refdatastore[
j
]
.attr ==
@@ -4558,7 +4127,8 @@
]
.attr
) {
- $this.refdatastore[
+ $this
+ .refdatastore[
j
]
.value =
@@ -4571,191 +4141,441 @@
}
}
}
- }
- }
- if (data.result) {
- var list_1 = JSON
- .parse(JSON
- .stringify(
- this.subClassAttrList
- ));
- var scanCodeVal =
- $this.scanCodeVal;
- var rand = '';
- for (var i = 0; i <
- 5; i++
- ) { //鐢熸垚5浣嶉殢鏈烘暟
- rand += Math
- .floor(Math
- .random() *
- 10);
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
}
- if (inputParamter[
- 0].attr) {
- if (inputParamter[
- 0]
- .attr ==
- "mast_input_3037"
- ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- scanCodeVal =
- "mast_input_3037-" +
- rand;
- }
- if (info.attr[0]
- .attr) {
- if (info.attr[
- 0]
- .attr ==
- "mast_input_3037"
- ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- scanCodeVal =
- "mast_input_3037-" +
- rand;
- }
- $this.subPanelList
- .push({
- scanCodeVal: scanCodeVal,
- subClassAttr: list_1
- });
- var result = data
- .result;
- for (var i = 0; i <
- result
- .length; i++) {
- for (var s =
- 0; s <
- $this.subPanelList
- .length; s++
+ try {
+ var actionlist = data.action || []
+ for (var ii =
+ 0; ii <
+ actionlist
+ .length; ii++
) {
- if ($this.subPanelList[
- s]
- .scanCodeVal ==
- scanCodeVal
+ var action =
+ actionlist[
+ ii];
+ if (action
+ .action_type ==
+ 'set_dlg_attr'
) {
- if (result[
- i
- ]
- .attr ==
- "S_ID"
- )
- $this.subPanelList[
- s
- ]
- .ObjID =
- result[
- i
- ]
+ var result =
+ action
.value;
- var _subClassAttr =
- $this.subPanelList[
- s
- ]
- .subClassAttr;
- for (
- var c =
- 0; c <
- _subClassAttr
- .length; c++
+ for (var i =
+ 0; i <
+ result
+ .length; i++
) {
- var attr =
- _subClassAttr[
- c
+ if (result[
+ i
]
- .Attr;
- for (
- var j =
- 0; j <
- attr
- .length; j++
+ .choice_list
) {
- // console.log(attr[j].Name+'=='+result[i].attr);
- if (attr[
- j
- ]
- .Name ==
- result[
- i
- ]
- .attr
+ for (
+ var s =
+ 0; s <
+ $this.subPanelList
+ .length; s++
) {
- attr[
- j]
- .Value =
+ for (var c = 0; c < $this.subPanelList[s].subClassAttrList
+ .length; c++) {
+ var attr =
+ $this.subPanelList[
+ s
+ ]
+ .subClassAttrList[
+ c
+ ]
+ .Attr;
+ for (
+ var j =
+ 0; j <
+ attr
+ .length; j++
+ ) {
+ if (attr[
+ j
+ ]
+ .Name ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ if (utils.classUtils.attrTypeIsDict(attr[j]
+ .Type)) {
+ var
+ dictItemList = [];
+ for (
+ var d in
+ result[
+ i
+ ]
+ .choice_list
+ ) {
+ var val =
+ result[
+ i
+ ]
+ .choice_list[
+ d
+ ];
+ dictItemList
+ .push({
+ "CN_S_NAME": val,
+ "CN_S_VALUE": val,
+ "Name": val,
+ "label": val,
+ "value": val
+ });
+ }
+ attr[
+ j]
+ .dictitem =
+ dictItemList;
+ // attr[j].dictitem = result[i].choice_list;
+ }
+ }
+ }
+ }
+ }
+ }
+ for (
+ var s =
+ 0; s <
+ $this
+ .subPanelList
+ .length; s++
+ ) {
+ for (
+ var c =
+ 0; c <
+ $this
+ .subPanelList[
+ s
+ ]
+ .subClassAttrList
+ .length; c++
+ ) {
+ var attr =
+ $this
+ .subPanelList[
+ s
+ ]
+ .subClassAttrList[
+ c
+ ]
+ .Attr;
+ for (
+ var j =
+ 0; j <
+ attr
+ .length; j++
+ ) {
+ console
+ .log(
+ attr[
+ j
+ ]
+ .Name +
+ '==' +
+ result[
+ i
+ ]
+ .attr
+ );
+ if (attr[
+ j
+ ]
+ .Name ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ attr[
+ j]
+ .Value =
+ result[
+ i
+ ]
+ .value;
+ }
+ }
+ }
+ }
+ }
+ } else if (
+ action
+ .action_type ==
+ 'set_global_attr'
+ ) {
+ $this
+ .$actiontr =
+ action
+ .value || [];
+ } else if (
+ action
+ .action_type ==
+ 'open_common_dlg'
+ ) { //鎵撳紑渚ф粦寮规
+ var $this =
+ this;
+ if (action
+ .value
+ .common_dlg_id ==
+ 'check_list'
+ ) {
+ $this.check_list =
+ action
+ .value
+ .config;
+ if (action
+ .value
+ .config
+ .appear_style ==
+ 'sideslip'
+ ) //鍒ゆ柇鏄惁鏄晶婊�+ $this
+ .popupType =
+ 'right';
+ else
+ $this.popupType =
+ 'center'
+ // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
+ $this
+ .$refs
+ .popup
+ .open(
+ $this
+ .popupType
+ );
+ }
+ } else if (
+ action
+ .action_type ==
+ 'add_subcls_panel'
+ ) { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ var result =
+ action
+ .value;
+ var $this =
+ this;
+ var list_1 =
+ JSON
+ .parse(
+ JSON
+ .stringify(
+ this.subClassAttrList
+ )
+ );
+ var scanCodeVal =
+ $this.scanCodeVal;
+ var rand =
+ '';
+ for (var i =
+ 0; i <
+ 5; i++
+ ) { //鐢熸垚5浣嶉殢鏈烘暟
+ rand +=
+ Math
+ .floor(
+ Math
+ .random() *
+ 10
+ );
+ }
+ if (inputParamter[
+ 0]
+ .attr
+ ) {
+ if (inputParamter[
+ 0
+ ]
+ .attr ==
+ "mast_input_3037"
+ ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ scanCodeVal =
+ "mast_input_3037-" +
+ rand;
+ }
+ if (info
+ .attr[
+ 0]
+ .attr
+ ) {
+ if (info
+ .attr[
+ 0
+ ]
+ .attr ==
+ "mast_input_3037"
+ ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ scanCodeVal =
+ "mast_input_3037-" +
+ rand;
+ }
+ $this.subPanelList
+ .push({
+ scanCodeVal: scanCodeVal,
+ subClassAttr: list_1
+ });
+ for (var i =
+ 0; i <
+ result
+ .length; i++
+ ) {
+ for (
+ var s =
+ 0; s <
+ $this.subPanelList
+ .length; s++
+ ) {
+ if ($this.subPanelList[
+ s
+ ]
+ .scanCodeVal ==
+ scanCodeVal
+ ) {
+ if (result[
+ i
+ ]
+ .attr ==
+ "S_ID"
+ )
+ $this.subPanelList[
+ s
+ ]
+ .ObjID =
result[
i
]
.value;
+ var _subClassAttr =
+ $this.subPanelList[
+ s
+ ]
+ .subClassAttr;
+ for (
+ var c =
+ 0; c <
+ _subClassAttr
+ .length; c++
+ ) {
+ var attr =
+ _subClassAttr[
+ c
+ ]
+ .Attr;
+ for (
+ var j =
+ 0; j <
+ attr
+ .length; j++
+ ) {
+ // console.log(attr[j].Name+'=='+result[i].attr);
+ if (attr[
+ j
+ ]
+ .Name ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ attr[
+ j]
+ .Value =
+ result[
+ i
+ ]
+ .value;
+ }
+ }
+ }
+
+ // $this.subPanelList[s].subClassAttr=list_1;
+ }
+ }
+
+ var length =
+ 0;
+ if (!
+ $this.refdatastore
+ .filter(
+ function(
+ s
+ ) {
+ return result[
+ i
+ ]
+ .attr ==
+ s
+ .attr
+ }
+ )
+ .length
+ ) {
+ length
+ =
+ 1;
+ $this.refdatastore
+ .push(
+ result[
+ i
+ ]
+ );
+ }
+ if (length ==
+ 0
+ ) {
+ for (
+ var j =
+ 0; j <
+ $this.refdatastore
+ .length; j++
+ ) {
+ if ($this.refdatastore[
+ j
+ ]
+ .attr ==
+ result[
+ i
+ ]
+ .attr
+ ) {
+ $this.refdatastore[
+ j
+ ]
+ .value =
+ result[
+ i
+ ]
+ .value;
+ }
}
}
}
}
}
- var length = 0;
- if (!$this.refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- })
- .length) {
- length = 1;
- $this.refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0) {
- for (var j =
- 0; j <
- $this
- .refdatastore
- .length; j++
- ) {
- if ($this
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .refdatastore[
- j
- ]
- .value =
- result[
- i
- ]
- .value;
- }
- }
- }
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ console.log(ex)
+ return
}
}
+
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 7.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "7.1")
});
},
scan_OKDataObjRunCustomEvent(eventID) {
@@ -4798,15 +4618,7 @@
.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar
- .DispName +
- '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -4854,15 +4666,7 @@
.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar
- .DispName +
- '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -4925,49 +4729,33 @@
runCustomEvent(dataInfo).then(data => {
console.log(data);
uni.hideLoading();
- if (data.ret != 0) {
- var tip = data
- .err_info ?
- typeof data
- .err_info ==
- 'string' ? data
- .err_info : data
- .err_info.join(
- '<br/>') : '';
- if (data.ret == 801)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
- var result = data
- .result;
+ // var result = data.result;
if (eventID != $this.param.After_OK_Event.ID)
$this.scan_OKDataObjRunCustomEvent(
$this.param
@@ -4990,12 +4778,7 @@
}).catch(ex => {
// console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('error') + " 8.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "8.1")
});
},
--
Gitblit v1.9.1