From f9aa1010e164e21a3c8147e0f2e13b828676800a Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 29 八月 2025 18:38:55 +0800
Subject: [PATCH] initialEvent 输入参数格式和web端保持一致
---
pages/modal/3037_2.vue | 1598 ++++++++++++++++++++++++++--------------------------------
1 files changed, 718 insertions(+), 880 deletions(-)
diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index 34e9a39..884acb7 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -118,13 +118,17 @@
} from '@/js/Base64.js';
import utils from "@/js/utils.js"
import {
+ showInfo,
+ showError
+ } from "@/js/Page.js"
+ import {
appGetInfo,
dictGetInfo
} from "@/api/mobox.js"
import {
getUIStyleInfo,
runCustomEvent,
- dataObjCreate,
+
dataObjDel
} from "@/api/data.js"
import dayjs from "dayjs";
@@ -173,10 +177,18 @@
}); //璁剧疆椤堕儴鏍囬
this.title = options.titlename;
this.param = JSON.parse(options.param);
- this.loadData(options.paramValue)
+ const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
+ this.loadData(paramValue)
//椤甸潰鍒濆鍖栬幏鍙栫劍鐐� // this.focusMateria=true;
+ },
+ initialEvent() {
+ let event = (this.head_styledef.event || []).find((e) => e.event_id == "initial");
+ return {
+ id: event?.scrip_id || "",
+ name: event?.scrip_name || "",
+ };
},
methods: {
setData: function(obj) {
@@ -206,31 +218,67 @@
await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
//浼犲叆鍙傛暟鍊� if (paramValue) {
- const attrs = paramValue.attrs || [];
+ this.setFormValues(this.head_styledef, paramValue)
+ // const attrs = paramValue.attrs || [];
+ // (this.head_styledef?.form?.items || []).forEach(async (ele, index) => {
+ // if (ele.name != "Layout") {
+ // attrs.forEach(async (ele2, index2) => {
+ // if (ele.fieldId == ele2.name) {
+ // ele.value = ele2.value;
+ // }
+ // });
+ // } else {
+ // ele.setting.colList.forEach(async (col) => {
+ // if (col) {
+ // attrs.forEach(async (ele2,
+ // index2) => {
+ // if (col.fieldId == ele2.name) {
+ // col.value = ele2.value;
+ // }
+ // });
+ // }
+ // });
+ // }
+ // })
- (this.head_styledef?.form?.items || []).forEach(async (ele, index) => {
- if (ele.name != "Layout") {
- attrs.forEach(async (ele2, index2) => {
- if (ele.fieldId == ele2.name) {
- ele.value = ele2.value;
- }
- });
- } else {
- ele.setting.colList.forEach(async (col) => {
- if (col) {
- attrs.forEach(async (ele2,
- index2) => {
- if (col.fieldId == ele2.name) {
- col.value = ele2.value;
- }
- });
- }
- });
- }
- })
}
await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID);
+ await this.loadInitialEvent();
+ },
+ async loadInitialEvent() {
+ try {
+ var eventid = this.initialEvent?.id; //鍐呭鍙樺寲鍚庝簨浠�+ if (eventid) {
+ // self.event_no_sub = 1;
+ var obj_attr = this.head_styledef.form.model;
+ // console.log(obj_attr);
+ let req = {
+ id: "",
+ attrs: Object.keys(obj_attr).map((a) => ({
+ attr: a,
+ value: obj_attr[a] || "",
+ }))
+ }
+ var info = {
+ eventid: eventid,
+ edtype: "0",
+ projectid: '',
+ rclsid: '',
+ robjid: '',
+ userlogin: '',
+ clsid: this.head_styledef.form.clsId,
+ objid: "",
+ attr: req,
+ }
+ this.DataObjRunCustomEvent(info);
+ }
+
+ } catch (ex) {
+ showError(ex, this.translateSys('error'))
+
+
+ }
},
async Head_UIStyleGetInfo(class_id, style_id) { //鑾峰彇鑷畾涔夎〃鍗曟牱寮� var $this = this;
@@ -305,13 +353,7 @@
}
} catch (ex) {
// console.log(ex);
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
- uni.showModal({
- title: this.translateSys("error") + "1.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + " 1.1")
}
},
@@ -366,12 +408,7 @@
} catch (ex) {
// console.log(ex);
let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
- uni.showModal({
- title: this.translateSys("error") + "2.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + " 2.1")
}
@@ -416,12 +453,7 @@
} catch (ex) {
// console.log(ex);
- uni.showModal({
- title: this.translateSys("error") + "1.3",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + " 1.3")
}
},
@@ -440,209 +472,108 @@
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 != 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);
}
- uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- } else uni.showModal({
- title: this.translateSys("tip"),
- content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ }
+ 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/>') : '';
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- if (data.result_type == 2) {
+ 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) {
- } else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ } 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 < styledef.form.items.length; c++) {
- var attr = styledef.form.items[c];
- if (attr.name != 'Layout') {
- if (attr.fieldId == result[i].attr) {
- 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,
- "text": val,
- "value": val
- });
- }
- attr.dict = dictItemList;
- }
- } else if (attr.name == 'Layout') {
- attr.setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr) {
- 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,
- "text": val,
- "value": val
- });
- }
- col.dict = dictItemList;
- }
- }
- });
- }
+ 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;
+ $this.setFormValues(styledef, result)
- }
- }
- for (var c = 0; c < styledef.form.items.length; c++) {
- var attr = styledef.form.items[c];
- // console.log(attr[j].Name+'=='+result[i].attr);
- //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] ==
- undefined) {
- $this.head_styledef.form.model[result[i].attr] = result[i]
- .value;
- }
- //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') {
- if (attr.fieldId == result[i].attr) {
- attr.value = '';
- attr.oldvalue = '';
- attr.value = result[i].value;
- attr.oldvalue = result[i].value;
- $this.head_styledef.form.model[attr.fieldId] = result[
- i].value;
- }
- } else if (attr.name == 'Layout') {
- attr.setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr) {
- col.value = '';
- col.oldvalue = '';
- col.value = result[i].value;
- col.oldvalue = result[i].value;
- $this.head_styledef.form.model[col
- .fieldId] = result[i].value;
+ } else if (data.action[i].action_type == 'set_dlg_attr_show') {
+ var result = action.value;
+ if (type == 'head') {
+ $this.setFormItemVisible(result)
+ // console.log($this.head_styledef);
+ } else {
+ result.forEach(async (attr, key) => {
+ styledef.form.items.forEach(async (ele, index) => {
+ //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+ if (ele.name != 'Layout') {
+ if (ele.fieldId == attr.attr) {
+ ele.show = attr.show;
}
+ } else if (ele.name == 'Layout') {
+ ele.setting.colList.forEach(
+ col => {
+ if (col) {
+ if (col
+ .fieldId ==
+ attr.attr
+ ) {
+ col.show =
+ attr
+ .show;
+ }
+ }
+ });
}
});
- }
- }
-
- }
- } else if (data.action[i].action_type == 'set_dlg_attr_show') {
- var result = action.value;
- if (type == 'head') {
- $this.setFormItemVisible(result)
- // console.log($this.head_styledef);
- } else {
- result.forEach(async (attr, key) => {
- styledef.form.items.forEach(async (ele, index) => {
- //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (ele.name != 'Layout') {
- if (ele.fieldId == attr.attr) {
- ele.show = attr.show;
- }
- } else if (ele.name == 'Layout') {
- ele.setting.colList.forEach(
- col => {
- if (col) {
- if (col.fieldId ==
- attr.attr) {
- col.show = attr
- .show;
- }
- }
- });
- }
});
- });
- var style_def = JSON.parse(JSON.stringify(styledef));
+ var style_def = JSON.parse(JSON.stringify(styledef));
- $this.detail1_styledef = [];
- $this.detail1_styledef = style_def;
- // console.log($this.detail1_styledef);
- }
- } else {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate('execute_init_event_failed') +
+ $this.detail1_styledef = [];
+ $this.detail1_styledef = style_def;
+ // console.log($this.detail1_styledef);
+ }
+ } else {
+ showInfo(this.translate('execute_init_event_failed') +
this.translateSys("full_stop") +
this.translate('reason') + this.translateSys("colon") +
this.translateSys("quotation_mark_left") + action
.action_type + this.translateSys(
"quotation_mark_right") + this
- .translate('tip_action_unprocessed'),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ .translate('tip_action_unprocessed'))
+
+ }
}
+
+ } 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'))
+ return
}
-
- } catch (ex) {
- let actionList = (data.action || []).map(a => a.action_type).join(';')
- let tip = typeof ex == 'string' ? ex : ex.message
- tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- console.log(ex)
- return
}
-
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys("error") + "3.1",
- content: this.translate('execute_init_event_failed') +
- this.translateSys("full_stop") +
- this.translate('reason') + this.translateSys("colon") + ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + "3.1")
});
},
@@ -752,21 +683,12 @@
var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑讳簨浠�
if (!onSuffixClickCallbackEvent.id) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate('icon_click_callback_empty'),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("icon_click_callback_empty"))
return;
}
if (!onSuffixClickEvent.id) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate('icon_click_event_empty'),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("icon_click_event_empty"))
+
return;
}
this.popupType = 'right'
@@ -850,258 +772,224 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(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 != 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) {
+ if (this.param.Only_Script_Error) {
let pos = tip.indexOf("锛�);
if (pos > -1) tip = tip.substring(pos + 1);
}
- uni.showModal({
- title: $this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
- } else uni.showModal({
- title: $this.translateSys("tip"),
- content: tip + ',' + $this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ }
+ 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/>') : '';
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: $this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
- if (data.result_type == 2) {
+ 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) {
- } else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
}
- }
- try {
- var actions = data.action || []
- for (var i = 0; i < actions.length; i++) {
- var action = actions[i];
- console.log(action)
- var val = action.value;
- var enviroment = JSON.stringify(enviroment);
+ try {
+ var actions = data.action || []
+ for (var i = 0; i < actions.length; i++) {
+ var action = actions[i];
+ console.log(action)
+ var val = action.value;
+ var enviroment = JSON.stringify(enviroment);
- if (action.action_type == 'open_panel') {
- var d = dialog({
- title: '<i class="ace-icon fa fa-info-circle"></i> ' +
- $this.translateSys("tip"),
- content: $this.translateSys("quotation_mark_left") +
- action.action_type + $this.translateSys(
- "quotation_mark_right") +
- $this.translate("tip_action_unprocessed")
- });
- d.show();
- } else if (action.action_type == 'open_select_userdlg') {
- var style = val.style;
- // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : ''
- var param = {
- item: item,
- button_callback: button_callback,
- req: req,
- data_attr: data_attr
- }
- uni.navigateTo({
- url: '../selpsn/index?mulit=false¶m=' +
- JSON
- .stringify(
- param),
- events: {
- AddPer(data, param) {
- // console.log(param);
- console.log(data);
- var callback_eventid = param
- .button_callback
- .trim();
- var info = {
- eventid: callback_eventid,
- edtype: "0",
- projectid: '',
- rclsid: '',
- robjid: '',
- userlogin: '',
- clsid: $this.param
- .DataCls
- .id,
- objid: "",
- attr: param.req,
- inputparameter: data,
- dataJson: [],
- }
- $this.DataObjRunCustomEvent(info,
- param
- .data_attr);
- }
- }
- });
- } else if (action.action_type == 'open_data_query_dlg') {
- var d = dialog({
- title: '<i class="ace-icon fa fa-info-circle"></i> ' +
- $this.translateSys("tip"),
- content: $this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + $this.translateSys(
- "quotation_mark_right") + $this
- .translate(
- "tip_action_unprocessed")
- });
- d.show();
- } else if (action.action_type == 'open_common_dlg') {
-
- if (val.common_dlg_id == 'check_list') {
-
- $this.setData({
- check_list: val.config
- })
- if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.setData({
- popupType: "right"
- })
- else
- $this.setData({
- popupType: "center"
- })
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
- $this.$refs.popup.open($this.popupType);
- var popupParam = {
+ if (action.action_type == 'open_panel') {
+ var d = dialog({
+ title: '<i class="ace-icon fa fa-info-circle"></i> ' +
+ $this.translateSys("tip"),
+ content: $this.translateSys("quotation_mark_left") +
+ action.action_type + $this.translateSys(
+ "quotation_mark_right") +
+ $this.translate("tip_action_unprocessed")
+ });
+ d.show();
+ } else if (action.action_type == 'open_select_userdlg') {
+ var style = val.style;
+ // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : ''
+ var param = {
item: item,
button_callback: button_callback,
req: req,
data_attr: data_attr
}
- $this.setData({
- popupParam: popupParam
- })
- }
- } else if (action.action_type == 'open_project_query_dlg') {
- //console.log(action.value.select_range);
- //console.log(action.value.mulit_select);
- var priRel = '-1';
- if (action.value.select_range == '鍏ㄩ儴鐩稿叧')
- priRel = '0';
- else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰')
- priRel = '1';
- else if (action.value.select_range == '鎴戝垱寤虹殑')
- priRel = '2';
- else if (action.value.select_range == '鎴戝弬涓庣殑' || action
- .value
- .select_range == '鎴戝弬鍔犵殑')
- priRel = '3';
- else if (action.value.select_range == '鎴戝叧娉ㄧ殑')
- priRel = '4';
- else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰')
- priRel = '5';
- var param_ = {
- item: item,
- button_callback: button_callback,
- req: req
- }
- uni.navigateTo({
- url: '../selPrj/index?relation=' + priRel +
- '¶m=' +
- JSON.stringify(param_),
- events: {
- AddPer(data, param) {
- var attr = param.item.fieldId;
- $this.head_styledef.form.model[
- attr] =
- data[0].ID +
- ';' + data[0].Name;
-
- // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name;
- // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name;
- var callback_eventid = param
- .button_callback
- .trim();
- if (callback_eventid) {
+ uni.navigateTo({
+ url: '../selpsn/index?mulit=false¶m=' +
+ JSON
+ .stringify(
+ param),
+ events: {
+ AddPer(data, param) {
+ // console.log(param);
+ console.log(data);
+ var callback_eventid = param
+ .button_callback
+ .trim();
var info = {
eventid: callback_eventid,
- edtype: "2",
- projectid: data[0].ID,
- rclsid: "",
- robjid: "",
- userlogin: "",
+ edtype: "0",
+ projectid: '',
+ rclsid: '',
+ robjid: '',
+ userlogin: '',
clsid: $this.param
- .DataCls.id,
+ .DataCls
+ .id,
objid: "",
attr: param.req,
+ inputparameter: data,
dataJson: [],
}
-
- $this.DataObjRunCustomEvent(
- info);
+ $this.DataObjRunCustomEvent(info,
+ param
+ .data_attr);
}
}
+ });
+ } else if (action.action_type == 'open_data_query_dlg') {
+ var d = dialog({
+ title: '<i class="ace-icon fa fa-info-circle"></i> ' +
+ $this.translateSys("tip"),
+ content: $this.translateSys(
+ "quotation_mark_left") +
+ action
+ .action_type + $this.translateSys(
+ "quotation_mark_right") + $this
+ .translate(
+ "tip_action_unprocessed")
+ });
+ d.show();
+ } else if (action.action_type == 'open_common_dlg') {
+
+ if (val.common_dlg_id == 'check_list') {
+
+ $this.setData({
+ check_list: val.config
+ })
+ if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.setData({
+ popupType: "right"
+ })
+ else
+ $this.setData({
+ popupType: "center"
+ })
+ // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
+ $this.$refs.popup.open($this.popupType);
+ var popupParam = {
+ item: item,
+ button_callback: button_callback,
+ req: req,
+ data_attr: data_attr
+ }
+ $this.setData({
+ popupParam: popupParam
+ })
}
- });
- } else {
- uni.showModal({
- title: $this.translateSys("tip"),
- content: $this.translateSys(
+ } else if (action.action_type == 'open_project_query_dlg') {
+ //console.log(action.value.select_range);
+ //console.log(action.value.mulit_select);
+ var priRel = '-1';
+ if (action.value.select_range == '鍏ㄩ儴鐩稿叧')
+ priRel = '0';
+ else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰')
+ priRel = '1';
+ else if (action.value.select_range == '鎴戝垱寤虹殑')
+ priRel = '2';
+ else if (action.value.select_range == '鎴戝弬涓庣殑' || action
+ .value
+ .select_range == '鎴戝弬鍔犵殑')
+ priRel = '3';
+ else if (action.value.select_range == '鎴戝叧娉ㄧ殑')
+ priRel = '4';
+ else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰')
+ priRel = '5';
+ var param_ = {
+ item: item,
+ button_callback: button_callback,
+ req: req
+ }
+ uni.navigateTo({
+ url: '../selPrj/index?relation=' + priRel +
+ '¶m=' +
+ JSON.stringify(param_),
+ events: {
+ AddPer(data, param) {
+ var attr = param.item.fieldId;
+ $this.head_styledef.form.model[
+ attr] =
+ data[0].ID +
+ ';' + data[0].Name;
+
+ // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name;
+ // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name;
+ var callback_eventid = param
+ .button_callback
+ .trim();
+ if (callback_eventid) {
+ var info = {
+ eventid: callback_eventid,
+ edtype: "2",
+ projectid: data[0].ID,
+ rclsid: "",
+ robjid: "",
+ userlogin: "",
+ clsid: $this.param
+ .DataCls.id,
+ objid: "",
+ attr: param.req,
+ dataJson: [],
+ }
+
+ $this.DataObjRunCustomEvent(
+ info);
+ }
+ }
+ }
+ });
+ } else {
+ showInfo($this.translateSys(
"quotation_mark_left") +
action.action_type + $this.translateSys(
"quotation_mark_right") + $this
.translate(
- "tip_action_unprocessed"),
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
- }
- }
+ "tip_action_unprocessed"))
- } catch (ex) {
- let actionList = (data.action || []).map(a => a.action_type).join(';')
- let tip = typeof ex == 'string' ? ex : ex.message
- tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- console.log(ex)
- return
+ }
+ }
+
+ } 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'))
+ return
+ }
}
}
}).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('tip') + "5.1",
- content: exStr,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ showError(ex, this.translateSys("error") + "5.1")
});
},
@@ -1290,22 +1178,13 @@
uni.hideLoading();
$this.subPanelList.splice(index, 1);
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate("delete_success"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("delete_success"))
+
}).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("error") + "9.1")
});
}
},
@@ -1313,12 +1192,8 @@
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: this.translate("before_select_event_empty"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("before_select_event_empty"))
+
return;
}
var obj_attr = this.head_styledef.form.model;
@@ -1413,12 +1288,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: this.translate("after_select_event_empty"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("after_select_event_empty"))
+
return;
}
var items = $this.check_list.items;
@@ -1436,12 +1307,8 @@
}
}
if (data.length == 0) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate("tip_no_select_data"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("tip_no_select_data"))
+
return;
}
var obj_attr = this.head_styledef.form.model;
@@ -1545,205 +1412,198 @@
// 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 != 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);
}
- uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- } else uni.showModal({
- title: this.translateSys("tip"),
- content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ }
+ 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/>') : '';
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- if (data.result_type == 2) {
- var result = data.result || []
+ 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.head_styledef.form.items.length; c++) {
- var attr = $this.head_styledef.form.items[c];
- if (attr.name != 'Layout') {
- if (attr.fieldId == result[i].attr) {
- attr.value = '';
- attr.oldvalue = '';
- attr.value = result[i].value;
- attr.oldvalue = result[i].value;
- $this.head_styledef.form.model[attr.fieldId] = result[i].value;
- }
- } else if (attr.name == 'Layout') {
- attr.setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr) {
- col.value = '';
- col.oldvalue = '';
- col.value = result[i].value;
- col.oldvalue = result[i].value;
- $this.head_styledef.form.model[col.fieldId] =
- result[i].value;
- }
+ for (var i = 0; i < result.length; i++) {
+ for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
+ var attr = $this.head_styledef.form.items[c];
+ if (attr.name != 'Layout') {
+ if (attr.fieldId == result[i].attr) {
+ attr.value = '';
+ attr.oldvalue = '';
+ attr.value = result[i].value;
+ attr.oldvalue = result[i].value;
+ $this.head_styledef.form.model[attr.fieldId] = result[i].value;
}
- });
+ } else if (attr.name == 'Layout') {
+ attr.setting.colList.forEach(col => {
+ if (col) {
+ if (col.fieldId == result[i].attr) {
+ col.value = '';
+ col.oldvalue = '';
+ col.value = result[i].value;
+ col.oldvalue = result[i].value;
+ $this.head_styledef.form.model[col.fieldId] =
+ 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;
+ 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;
+ $this.setFormValues($this.head_styledef, result)
+ } else if (action.action_type == 'set_dlg_attr_show') {
+ var data = action.value;
+ $this.setFormItemVisible(data)
+ // console.log($this.head_styledef);
+ } else if (action.action_type == 'set_global_attr') {
+ $this.global_attr = action.value || [];
+ }
+ }
- } else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- 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'))
+ return
}
}
- 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.head_styledef.form.items.length; c++) {
- var attr = $this.head_styledef.form.items[c];
- if (attr.name != 'Layout') {
- if (attr.fieldId == result[i].attr) {
- 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,
- "text": val,
- "value": val
- });
- }
- attr.dict = dictItemList;
- }
- } else if (attr.name == 'Layout') {
- attr.setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr) {
- 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,
- "text": val,
- "value": val
- });
- }
- col.dict = dictItemList;
- }
- }
- });
- }
- }
- }
- for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
- var attr = $this.head_styledef.form.items[c];
- // console.log(attr[j].Name+'=='+result[i].attr);
- if (attr.name != 'Layout') {
- if (attr.fieldId == result[i].attr) {
- attr.value = '';
- attr.oldvalue = '';
- attr.value = result[i].value;
- attr.oldvalue = result[i].value;
- $this.head_styledef.form.model[attr.fieldId] = result[i]
- .value;
- }
- } else if (attr.name == 'Layout') {
- attr.setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr) {
- col.value = '';
- col.oldvalue = '';
- col.value = result[i].value;
- col.oldvalue = result[i].value;
- $this.head_styledef.form.model[col
- .fieldId] = result[i].value;
- }
- }
- });
- }
-
- }
-
- }
- } else if (action.action_type == 'set_dlg_attr_show') {
- var data = action.value;
- $this.setFormItemVisible(data)
- // console.log($this.head_styledef);
- } else if (action.action_type == 'set_global_attr') {
- $this.global_attr = action.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}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- 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("error") + "3.1")
});
+ },
+ setFormValues(styledef, attrs) {
+ if (!Array.isArray(attrs)) {
+ return
+ }
+ for (var i = 0; i < attrs.length; i++) {
+ if (attrs[i].choice_list) {
+ for (var c = 0; c < styledef.form.items.length; c++) {
+ var attr = styledef.form.items[c];
+ if (attr.name != 'Layout') {
+ if (attr.fieldId == attrs[i].attr) {
+ var dictItemList = [];
+ for (var d in attrs[i].choice_list) {
+ var val = attrs[i].choice_list[d];
+ dictItemList.push({
+ "CN_S_NAME": val,
+ "CN_S_VALUE": val,
+ "text": val,
+ "value": val
+ });
+ }
+ attr.dict = dictItemList;
+ }
+ } else if (attr.name == 'Layout') {
+ attr.setting.colList.forEach(col => {
+ if (col) {
+ if (col.fieldId == attrs[i].attr) {
+ var dictItemList = [];
+ for (var d in attrs[i]
+ .choice_list) {
+ var val = attrs[i]
+ .choice_list[d];
+ dictItemList.push({
+ "CN_S_NAME": val,
+ "CN_S_VALUE": val,
+ "text": val,
+ "value": val
+ });
+ }
+ col.dict = dictItemList;
+ }
+ }
+ });
+ }
+
+ }
+ }
+ for (var c = 0; c < styledef.form.items.length; c++) {
+ var attr = styledef.form.items[c];
+ // console.log(attr[j].Name+'=='+attrs[i].attr);
+ //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+ if (styledef.form.model[attrs[i].attr] ==
+ undefined) {
+ styledef.form.model[attrs[i].attr] = attrs[i]
+ .value;
+ }
+ //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+ if (attr.name != 'Layout') {
+ if (attr.fieldId == attrs[i].attr) {
+ attr.value = '';
+ attr.oldvalue = '';
+ attr.value = attrs[i].value;
+ attr.oldvalue = attrs[i].value;
+ styledef.form.model[attr.fieldId] = attrs[
+ i].value;
+ }
+ } else if (attr.name == 'Layout') {
+ attr.setting.colList.forEach(col => {
+ if (col) {
+ if (col.fieldId == attrs[i].attr) {
+ col.value = '';
+ col.oldvalue = '';
+ col.value = attrs[i].value;
+ col.oldvalue = attrs[i].value;
+ styledef.form.model[col
+ .fieldId] = attrs[i].value;
+ }
+ }
+ });
+ }
+ }
+
+ }
},
setFormItemVisible(attrs) {
if (!Array.isArray(attrs)) {
@@ -1830,182 +1690,35 @@
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 != 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);
}
- uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- } else uni.showModal({
- title: this.translateSys("tip"),
- content: tip + this.translateSys('comma') + this.translate('result') + this
- .translateSys('colon') + data.ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ }
+ 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/>') : '';
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- if (data.result_type == 2) {
- if (data.result) {
+ 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.detail1_styledef));
- 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
- });
- var result = data.result || []
- 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.form
- .items;
- for (var c = 0; c < _subClassAttr.length; c++) {
- if (_subClassAttr[c].name != 'Layout') {
- if (_subClassAttr[c].fieldId == result[i].attr)
- _subClassAttr[c].value = result[i].value;
- } else if (_subClassAttr[c].name == 'Layout') {
- _subClassAttr[c].setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr)
- col.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') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
- }
- try {
- var actionlist = data.action || []
- 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;
- // attr.value = '';
- // attr.oldvalue = '';
- // attr.value = result[i].value;
- // attr.oldvalue = result[i].value;
- }
- }
- }
- }
- var length = 0;
-
- }
- } 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.detail1_styledef));
var scanCodeVal = $this.scanCodeVal;
var rand = '';
@@ -2024,16 +1737,14 @@
scanCodeVal: scanCodeVal,
subClassAttr: list_1
});
- $this.activelist.push({
- active: false
- });
+ var result = data.result || []
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
- .form.items;
+ var _subClassAttr = $this.subPanelList[s].subClassAttr.form
+ .items;
for (var c = 0; c < _subClassAttr.length; c++) {
if (_subClassAttr[c].name != 'Layout') {
if (_subClassAttr[c].fieldId == result[i].attr)
@@ -2047,11 +1758,9 @@
});
}
}
-
- // $this.subPanelList[s].subClassAttr=list_1;
}
}
- // console.log($this.subPanelList);
+
var length = 0;
if (!$this.refdatastore.filter(function(s) {
return result[i].attr == s.attr
@@ -2067,43 +1776,168 @@
}
}
}
- } else {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translateSys("quotation_mark_left") + action
+ }
+
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
+ try {
+ var actionlist = data.action || []
+ 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;
+ // attr.value = '';
+ // attr.oldvalue = '';
+ // attr.value = result[i].value;
+ // attr.oldvalue = result[i].value;
+ }
+ }
+ }
+ }
+ var length = 0;
+
+ }
+ } 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.detail1_styledef));
+ 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
+ });
+ $this.activelist.push({
+ active: false
+ });
+ 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
+ .form.items;
+ for (var c = 0; c < _subClassAttr.length; c++) {
+ if (_subClassAttr[c].name != 'Layout') {
+ if (_subClassAttr[c].fieldId == result[i].attr)
+ _subClassAttr[c].value = result[i].value;
+ } else if (_subClassAttr[c].name == 'Layout') {
+ _subClassAttr[c].setting.colList.forEach(col => {
+ if (col) {
+ if (col.fieldId == result[i].attr)
+ col.value = result[i].value;
+ }
+ });
+ }
+ }
+
+ // $this.subPanelList[s].subClassAttr=list_1;
+ }
+ }
+ // console.log($this.subPanelList);
+ 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 {
+ showInfo(this.translateSys("quotation_mark_left") + action
.action_type + this.translateSys(
"quotation_mark_right") + this.translate(
- "tip_action_unprocessed"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ "tip_action_unprocessed"))
+
+ }
}
+
+
+ } 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'))
+ return
}
-
-
- } catch (ex) {
- let actionList = (data.action || []).map(a => a.action_type).join(';')
- let tip = typeof ex == 'string' ? ex : ex.message
- tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- 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("error") + "7.1")
});
},
onSave() {
@@ -2203,39 +2037,48 @@
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 != 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);
}
- uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- } else uni.showModal({
- title: this.translateSys("tip"),
- content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ }
+ 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/>') : '';
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ 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) {
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+ }
+ var actionlist = data.action || []
+ for (var i = 0; i < actionlist.length; i++) {
+ var action = actionlist[i];
+ if (action.action_type == "goback_to_pre_page") {
+ //杩斿洖涓婁竴椤�+ uni.navigateBack({
+ delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
+ });
+ }
+ }
+ }
// var result = data.result;
if (eventID != $this.param.After_OK_Event.ID)
$this.scan_OKDataObjRunCustomEvent($this.param.After_OK_Event.ID);
@@ -2253,12 +2096,7 @@
// console.log(ex);
this.saving = false
uni.hideLoading();
- uni.showModal({
- title: this.translateSys("error") + "8.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys("error") + "8.1")
});
},
--
Gitblit v1.9.1