From 49dfdd3bf265db28d38167f34e9aabfdd3e8e5db Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 17 十月 2025 10:16:58 +0800
Subject: [PATCH] imagebutton
---
pages/modal/3037.vue | 3657 +++++++++++++++++++++++++----------------------------------
1 files changed, 1,535 insertions(+), 2,122 deletions(-)
diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue
index 0022d13..900baf4 100644
--- a/pages/modal/3037.vue
+++ b/pages/modal/3037.vue
@@ -1,5 +1,5 @@
<template>
- <view class="content">
+ <view class="content" :class="largeMode?'large-mode':''">
<!-- 涓绘暟鎹�-->
<view class="v-area" v-for="(classattr,index) in classAttrList">
<div class="class_attr_title" style="display: none;">
@@ -163,7 +163,7 @@
<a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a>
</div>
<input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
- disabled="true" :maxlength="-1">
+ disabled="true" :maxlength="-1">
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2"
@@ -172,7 +172,7 @@
</p>
<input type="text" class="attr_field" :data-index="index" :data-iindex="iindex"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
- disabled="true" :maxlength="-1">
+ disabled="true" :maxlength="-1">
<div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'|| attr.Type=='obj-ref'">
<a @tap="classAttr_AddRef" :data-classid="attr.RelCls[0].id"
:data-classname="attr.RelCls[0].name"><i class="ace-icon fa fa-plus-circle"></i></a>
@@ -196,7 +196,8 @@
<a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" :maxlength="-1">
+ <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
+ :maxlength="-1">
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2"
@@ -222,7 +223,8 @@
<a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" :maxlength="-1">
+ <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
+ :maxlength="-1">
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2"
@@ -295,7 +297,8 @@
<!-- 宸﹀彸甯冨眬 -->
<p class="tx_title2">{{param.Scan_Code.Name}}:</p>
<input type="text" class="attr_field" :value="scanCodeVal" @focus="scan_ontap" @blur="scan_onevent"
- :style="param.Scan_Code.Have_Select_Button==true?'width: '+(100-(param.Scan_Code.Name.length * 5)-14)+'%;':'width: '+(100-(param.Scan_Code.Name.length * 5)-5)+'%;'" :maxlength="-1">
+ :style="param.Scan_Code.Have_Select_Button==true?'width: '+(100-(param.Scan_Code.Name.length * 5)-14)+'%;':'width: '+(100-(param.Scan_Code.Name.length * 5)-5)+'%;'"
+ :maxlength="-1">
<div class="text-right2" v-if="param.Scan_Code.Have_Select_Button==true">
<a @tap="scan_classAttr_extButton()"><i class="ace-icon fa"
:class="param.Scan_Code.Img?param.Scan_Code.Img:'fa-plus-circle'"></i></a>
@@ -512,8 +515,8 @@
<a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input type="text" :value="attr.Value" :style="{'width':attr.Width}"
- disabled="true" :maxlength="-1">
+ <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
+ :maxlength="-1">
</view>
<view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2"
@@ -539,8 +542,8 @@
<a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input type="text" :value="attr.Value" :style="{'width':attr.Width}"
- disabled="true" :maxlength="-1">
+ <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
+ :maxlength="-1">
</view>
<view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2"
@@ -612,9 +615,9 @@
<button type="default" @tap="cancel" class="btn_cancel"
v-if="param.Sub_Cls.Can_Add_Delete == true">{{translateSys('cancel')}}</button>
- <button type="default" @tap="sava" class="btn_add"
+ <button type="default" @tap="onSave" class="btn_add"
v-if="param.Sub_Cls.Can_Add_Delete == true">{{title}}</button>
- <button type="default" @tap="sava" class="btn_sava"
+ <button type="default" @tap="onSave" class="btn_sava"
v-else-if="param.Sub_Cls.Can_Add_Delete == false">{{title}}</button>
<!-- 鏅�寮圭獥 top bottom center left right -->
@@ -622,8 +625,9 @@
<uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange">
<view class="popup-header">{{check_list.title}}</view>
<view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }"
- :style="{'width':check_list.width?check_list.width+'px':'200px','height':check_list.height?check_list.height+'px':'88%'}">
- <view class="popup-cont" :style="{'height':check_list.height?check_list.height-45+'px':'415px'}">
+ :style="{'width':check_list.width?check_list.width+'px':'375rpx','height':check_list.height?check_list.height+'px':popupType =='center'?'60vh':'88vh'}">
+ <view class="popup-cont"
+ :style="{'height':check_list.height?check_list.height-45+'px':popupType =='center'?'50vh':'80vh'}">
<view class="view_popup_CheckList" v-for="(item,index) in check_list.items">
<checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check"
:data-index="index" :style="{'margin-left': '10rpx'}">
@@ -646,7 +650,9 @@
</template>
<script>
- import Base64 from '../../components/js-base64/base64.js'
+ import {
+ Base64
+ } from '@/js/Base64.js';
import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
import utils from "@/js/utils.js"
import {
@@ -663,17 +669,22 @@
import {
classAttrList,
} from "@/api/index.js"
-
+ import buttonClickMixin from '@/mixins/button-click.js';
+ import {
+ showInfo,
+ showError,
+ showLoading,
+ hideLoading
+ } from "@/js/Page.js"
export default {
- modules: {
- Base64,
- },
+ mixins: [buttonClickMixin],
components: {
pickerAddress
},
data() {
return {
+ largeMode: getApp().globalData.largeMode || false,
title: '鏂板',
param: {},
classAttrList: [],
@@ -698,27 +709,19 @@
title: options.titlename
}); //璁剧疆椤堕儴鏍囬
var param = JSON.parse(options.param);
- this.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧
+ 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('cancel')
- });
+ showInfo("璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒")
+
return;
}
if (!param.Master_Cls.View_Style.Name) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showInfo("璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒")
+
return;
}
- this.$data.param = param;
+ this.param = param;
// var edit_dlg = {
// Model: param.EditDlgMode,
// Name: param.Master_Cls.View_Style.Name
@@ -731,7 +734,7 @@
let that = this;
let keys = [];
let val, data;
-
+
Object.keys(obj).forEach(function(key) {
keys = key.split(".");
val = obj[key];
@@ -748,18 +751,26 @@
});
});
},
-
+
async loadData() {
//涓绘暟鎹被鑾峰彇
- const param = this.param
- this.$data.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID)
- this.$data.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls
- ?.View_Style?.Name)
- this.viewParam('Mast');
- this.$data.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID)
- this.$data.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style
- ?.Name)
- this.viewParam('Sub');
+ try {
+ showLoading("loading...")
+ const param = this.param
+ this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID)
+ this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls
+ ?.View_Style?.Name)
+ this.viewParam('Mast');
+ this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID)
+ this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style
+ ?.Name)
+ this.viewParam('Sub');
+ } catch (ex) {
+ // console.log(ex);
+ hideLoading()
+ showError(ex, this.translateSys('error') + " 1")
+
+ }
},
async DictItemGetList(attr) { //Mobox3寰楀埌瀛楀吀椤瑰垪琛� try {
@@ -773,12 +784,8 @@
return result?.dict_item_list || []
} catch (ex) {
- uni.showModal({
- title: this.translateSys('error') + " 1.2",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showError(ex, this.translateSys('error') + " 1.2")
+
return []
}
@@ -802,17 +809,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("cancel")
- });
+ showError(ex, this.translateSys("error") + " 1.1")
+
return []
};
},
@@ -833,16 +831,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("cancel")
- });
+ showError(ex, this.translateSys("error") + " 1.2")
+
return {}
};
},
@@ -850,11 +840,11 @@
var classGridStyle = '';
var classAttrList = '';
if (type == 'Mast') {
- classGridStyle = this.$data.classGridStyle;
- classAttrList = this.$data.classAttrList;
+ classGridStyle = this.classGridStyle;
+ classAttrList = this.classAttrList;
} else if (type == 'Sub') {
- classGridStyle = this.$data.subClassGridStyle;
- classAttrList = this.$data.subClassAttrList;
+ classGridStyle = this.subClassGridStyle;
+ classAttrList = this.subClassAttrList;
}
var class_gridStyle = {
ID: classGridStyle.id,
@@ -946,31 +936,31 @@
});
if (type == 'Mast') {
- this.$data.classGridStyle = class_gridStyle;
- this.$data.classAttrList = class_attrList;
+ this.classGridStyle = class_gridStyle;
+ this.classAttrList = class_attrList;
// console.log('------Mast--------');
- // console.log(this.$data.classGridStyle);
- // console.log(this.$data.classAttrList);
+ // console.log(this.classGridStyle);
+ // console.log(this.classAttrList);
this.class_attr_init();
} else if (type == 'Sub') {
- this.$data.subClassGridStyle = class_gridStyle;
- this.$data.subClassAttrList = class_attrList;
+ this.subClassGridStyle = class_gridStyle;
+ this.subClassAttrList = class_attrList;
// console.log('------Sub--------');
- // console.log(this.$data.subClassGridStyle);
- // console.log(this.$data.subClassAttrList);
+ // console.log(this.subClassGridStyle);
+ // console.log(this.subClassAttrList);
this.subClass_attr_init();
}
},
class_attr_init() {
- var attrlist = this.$data.classGridStyle.StyleDef.show_style;
+ var attrlist = this.classGridStyle.StyleDef.show_style;
var newattrlist = [];
- if (this.$data.classAttrList.length > 0) {
+ if (this.classAttrList.length > 0) {
for (var i = 0; i < attrlist.length; i++) {
var open = attrlist[i].open;
var name = attrlist[i].attrgroup_name;
var attrs = attrlist[i].attrs;
- for (var s = 0; s < this.$data.classAttrList.length; s++) {
- var clsattr = this.$data.classAttrList[s];
+ for (var s = 0; s < this.classAttrList.length; s++) {
+ var clsattr = this.classAttrList[s];
// if (name == clsattr.Name) {
var attr = [];
for (var j = 0; j < attrs.length; j++) {
@@ -1043,25 +1033,25 @@
Order: clsattr.Order,
Open: open,
Attr: attr,
- control_style: this.$data.classGridStyle.StyleDef.control_style,
- title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith,
- Font: this.$data.classGridStyle.StyleDef.Font ? this.$data.classGridStyle.StyleDef
+ control_style: this.classGridStyle.StyleDef.control_style,
+ title_p_wdith: this.classGridStyle.StyleDef.title_p_wdith,
+ Font: this.classGridStyle.StyleDef.Font ? this.classGridStyle.StyleDef
.Font : {},
- Bk_Color: this.$data.classGridStyle.StyleDef.Bk_Color ? this.$data.classGridStyle
+ Bk_Color: this.classGridStyle.StyleDef.Bk_Color ? this.classGridStyle
.StyleDef.Bk_Color : '#FFFFFF',
- Text_Color: this.$data.classGridStyle.StyleDef.Text_Color ? this.$data
- .classGridStyle.StyleDef.Text_Color : '#000000'
+ Text_Color: this.classGridStyle.StyleDef.Text_Color ? this.classGridStyle.StyleDef
+ .Text_Color : '#000000'
});
// }
}
}
if (newattrlist.length > 0) {
- this.$data.classAttrList = newattrlist;
+ this.classAttrList = newattrlist;
}
var req = [];
- if (this.$data.classGridStyle.StyleDef) {
- if (this.$data.classGridStyle.StyleDef.show_style.length > 0) {
- var attrlist = this.$data.classGridStyle.StyleDef.show_style
+ if (this.classGridStyle.StyleDef) {
+ if (this.classGridStyle.StyleDef.show_style.length > 0) {
+ var attrlist = this.classGridStyle.StyleDef.show_style
// $el.find('.attr_field').prop('readonly', true);
// $el.find('.attr_field').prop('disabled', true);
for (var i = 0; i < attrlist.length; i++) {
@@ -1077,24 +1067,24 @@
}
}
- var eventlist = this.$data.classGridStyle.StyleDef.event;
+ var eventlist = this.classGridStyle.StyleDef.event;
if (eventlist) {
if (eventlist.length > 0) {
for (var i = 0; i < eventlist.length; i++) {
if (eventlist[i].event_id == 'before_ok') {
- this.$data.edit_ok_event = eventlist[i];
+ this.edit_ok_event = eventlist[i];
} else if (eventlist[i].event_id == 'initial') {
- this.$data.edit_inital_event = eventlist[i];
+ this.edit_inital_event = eventlist[i];
} else if (eventlist[i].event_id == 'before_select_compose') {
- this.$data.edit_select_compose_event = eventlist[i].scrip_id;
- this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id;
+ this.edit_select_compose_event = eventlist[i].scrip_id;
+ this.edit_compose_cls_id = eventlist[i].compose_cls_id;
}
}
}
}
// console.log(req);
- if (this.$data.edit_inital_event) {
- var eventid = this.$data.edit_inital_event.scrip_id;
+ if (this.edit_inital_event) {
+ var eventid = this.edit_inital_event.scrip_id;
var info = {
eventid: eventid,
edtype: "0",
@@ -1102,34 +1092,30 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.Master_Cls.ID,
+ clsid: this.param.Master_Cls.ID,
objid: "",
attr: req,
}
this.ini_DataObjRunCustomEvent(info);
}
- console.log(this.$data.classGridStyle);
- console.log(this.$data.classAttrList);
+ console.log(this.classGridStyle);
+ console.log(this.classAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showInfo("鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛�)
+
}
},
subClass_attr_init() {
- var attrlist = this.$data.subClassGridStyle.StyleDef.show_style;
+ var attrlist = this.subClassGridStyle.StyleDef.show_style;
var newattrlist = [];
- if (this.$data.subClassAttrList.length > 0) {
+ if (this.subClassAttrList.length > 0) {
for (var i = 0; i < attrlist.length; i++) {
var open = attrlist[i].open;
var name = attrlist[i].attrgroup_name;
var attrs = attrlist[i].attrs;
- for (var s = 0; s < this.$data.subClassAttrList.length; s++) {
- var clsattr = this.$data.subClassAttrList[s];
+ for (var s = 0; s < this.subClassAttrList.length; s++) {
+ var clsattr = this.subClassAttrList[s];
// if (name == clsattr.Name) {
var attr = [];
for (var j = 0; j < attrs.length; j++) {
@@ -1198,25 +1184,25 @@
Order: clsattr.Order,
Open: open,
Attr: attr,
- control_style: this.$data.subClassGridStyle.StyleDef.control_style,
- title_p_wdith: this.$data.subClassGridStyle.StyleDef.title_p_wdith,
- Font: this.$data.subClassGridStyle.StyleDef.Font ? this.$data.subClassGridStyle
+ control_style: this.subClassGridStyle.StyleDef.control_style,
+ title_p_wdith: this.subClassGridStyle.StyleDef.title_p_wdith,
+ Font: this.subClassGridStyle.StyleDef.Font ? this.subClassGridStyle
.StyleDef.Font : {},
- Bk_Color: this.$data.subClassGridStyle.StyleDef.Bk_Color ? this.$data
- .subClassGridStyle.StyleDef.Bk_Color : '#FFFFFF',
- Text_Color: this.$data.subClassGridStyle.StyleDef.Text_Color ? this.$data
- .subClassGridStyle.StyleDef.Text_Color : '#000000'
+ Bk_Color: this.subClassGridStyle.StyleDef.Bk_Color ? this.subClassGridStyle
+ .StyleDef.Bk_Color : '#FFFFFF',
+ Text_Color: this.subClassGridStyle.StyleDef.Text_Color ? this.subClassGridStyle
+ .StyleDef.Text_Color : '#000000'
});
// }
}
}
if (newattrlist.length > 0) {
- this.$data.subClassAttrList = newattrlist;
+ this.subClassAttrList = newattrlist;
}
var req = [];
- if (this.$data.subClassGridStyle.StyleDef) {
- if (this.$data.subClassGridStyle.StyleDef.show_style.length > 0) {
- var attrlist = this.$data.subClassGridStyle.StyleDef.show_style
+ if (this.subClassGridStyle.StyleDef) {
+ if (this.subClassGridStyle.StyleDef.show_style.length > 0) {
+ var attrlist = this.subClassGridStyle.StyleDef.show_style
// $el.find('.attr_field').prop('readonly', true);
// $el.find('.attr_field').prop('disabled', true);
for (var i = 0; i < attrlist.length; i++) {
@@ -1232,24 +1218,24 @@
}
}
- var eventlist = this.$data.subClassGridStyle.StyleDef.event;
+ var eventlist = this.subClassGridStyle.StyleDef.event;
if (eventlist) {
if (eventlist.length > 0) {
for (var i = 0; i < eventlist.length; i++) {
if (eventlist[i].event_id == 'before_ok') {
- this.$data.edit_ok_event = eventlist[i];
+ this.edit_ok_event = eventlist[i];
} else if (eventlist[i].event_id == 'initial') {
- this.$data.edit_inital_event = eventlist[i];
+ this.edit_inital_event = eventlist[i];
} else if (eventlist[i].event_id == 'before_select_compose') {
- this.$data.edit_select_compose_event = eventlist[i].scrip_id;
- this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id;
+ this.edit_select_compose_event = eventlist[i].scrip_id;
+ this.edit_compose_cls_id = eventlist[i].compose_cls_id;
}
}
}
}
// console.log(req);
- if (this.$data.edit_inital_event) {
- var eventid = this.$data.edit_inital_event.scrip_id;
+ if (this.edit_inital_event) {
+ var eventid = this.edit_inital_event.scrip_id;
var info = {
eventid: eventid,
edtype: "0",
@@ -1257,49 +1243,37 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.Sub_Cls.ID,
+ clsid: this.param.Sub_Cls.ID,
objid: "",
attr: req,
}
this.scan_ini_DataObjRunCustomEvent(info);
}
- console.log(this.$data.subClassGridStyle);
- console.log(this.$data.subClassAttrList);
+ console.log(this.subClassGridStyle);
+ console.log(this.subClassAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showInfo("鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛�)
+
}
},
scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this;
- var Before_Select_Event = $this.$data.param.Scan_Code.Before_Select_Event;
+ 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('cancel')
- });
+ showInfo("閫夋嫨鍓嶄簨浠朵负绌猴紒")
+
return;
}
var mast_attr = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
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('cancel')
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
@@ -1307,7 +1281,7 @@
}
var objects = [];
- var subPanelList = $this.$data.subPanelList;
+ var subPanelList = $this.subPanelList;
for (var s = 0; s < subPanelList.length; s++) {
var sub_req = [];
for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) {
@@ -1345,13 +1319,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('cancel')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -1362,19 +1330,19 @@
}
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
edit_dlg: {
type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d
+ class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d
},
master_cls: {
- cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name,
+ cls_name: 'MBOX', //$this.param.Master_Cls.Name,
obj_attrs: req
},
sub_cls: {
- cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name,
+ cls_name: 'MBOX', //$this.param.Sub_Cls.Name,
objects: objects
}
@@ -1388,7 +1356,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: 'MBOX', //this.$data.param.Sub_Cls.ID,
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
objid: "",
attr: [],
global_attr: req,
@@ -1406,15 +1374,15 @@
// console.log(e.target.dataset);
var index = e.target.dataset.index;
var ischeck = e.target.dataset.ischeck;
- var data = this.$data.check_list.items;
- // this.$data.check_list.items=[];
- if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items;
+ // this.check_list.items=[];
+ if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) {
data[i].check = false;
}
}
data[index].check = ischeck ? false : true;
- this.$data.check_list.items = data;
+ this.check_list.items = data;
},
popup_cancel(e) { //寮规鍙栨秷
@@ -1422,17 +1390,13 @@
},
popup_sava(e) { //寮规纭畾 閫夋嫨鎸夐挳鍚� var $this = this;
- var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event;
+ 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('cancel')
- });
+ showInfo("閫夋嫨鍚庝簨浠朵负绌猴紒")
+
return;
}
- var items = $this.$data.check_list.items;
+ var items = $this.check_list.items;
var data = [];
var name = "";
for (var i = 0; i < items.length; i++) {
@@ -1447,34 +1411,26 @@
}
}
if (data.length == 0) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showInfo("鏈�鎷╂暟鎹紒")
+
return;
}
var mast_attr = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
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('cancel')
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
}
}
- $this.$data.scanCodeVal = name;
+ $this.scanCodeVal = name;
var info = {
eventid: After_Select_Event.ID,
edtype: "7",
@@ -1504,16 +1460,16 @@
},
panel_del(index) {
var $this = this;
- if (this.$data.subPanelList[index].scanCodeVal == this.$data.scanCodeVal) {
- this.$data.scanCodeVal = '';
+ if (this.subPanelList[index].scanCodeVal == this.scanCodeVal) {
+ this.scanCodeVal = '';
}
- if (!this.$data.subPanelList[index].ObjID)
- this.$data.subPanelList.splice(index, 1);
+ if (!this.subPanelList[index].ObjID)
+ this.subPanelList.splice(index, 1);
else {
var dataInfo = {
- class_id: this.$data.param.Sub_Cls.ID,
+ class_id: this.param.Sub_Cls.ID,
class_name: '',
- obj_id: this.$data.subPanelList[index].ObjID
+ obj_id: this.subPanelList[index].ObjID
};
// console.log(dataInfo);
// return;
@@ -1523,47 +1479,38 @@
dataObjDel(dataInfo).then(success => {
// console.log(success);
uni.hideLoading();
- $this.$data.subPanelList.splice(index, 1);
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鍒犻櫎鎴愬姛锛�,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ $this.subPanelList.splice(index, 1);
+ showInfo("鍒犻櫎鎴愬姛锛�)
+
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('tip') + "9.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showError(ex, this.translateSys('tip') + "9.1")
});
}
},
ontap(e) { //鎵爜鍔熻兘
//console.log(e.target)
getApp().onScan((result) => {
- //console.log(result.decodedata);
- var isVal = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
+ //console.log(result);
+ var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']].Value;
// if(!isVal){
- // this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata;
- // var isVald =this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value;
+ // 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) {
- this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
- 'iindex']].Value = result.decodedata;
+ if (isVal != result) {
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
+ 'iindex']].Value = result;
uni.hideKeyboard();
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID;
+ var eventid = this.param.Scan_Code.Input_Change_Event.ID;
if (eventid) {
var req = [];
- var attrlist = this.$data.classAttrList; //涓绘暟鎹被灞炴�
+ var attrlist = this.classAttrList; //涓绘暟鎹被灞炴�
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1578,13 +1525,13 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: 'MBOX', //this.$data.param.Sub_Cls.ID,
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
objid: "",
attr: req,
mast_attr: [],
inputParamter: [{
attr: 'mast_input_3037',
- value: result.decodedata
+ value: result
}]
}
@@ -1596,19 +1543,19 @@
subontap(e) { //鎵爜鍔熻兘
//console.log(e.target)
getApp().onScan((result) => {
- //console.log(result.decodedata);
- var isVal = this.$data.subClassAttrList[e.target.dataset['index']].Attr[e
+ //console.log(result);
+ var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e
.target.dataset['iindex']].Value;
//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
- if (isVal != result.decodedata) {
- this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target
- .dataset['iindex']].Value = result.decodedata;
+ if (isVal != result) {
+ this.subClassAttrList[e.target.dataset['index']].Attr[e.target
+ .dataset['iindex']].Value = result;
uni.hideKeyboard();
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID;
+ var eventid = this.param.Scan_Code.Input_Change_Event.ID;
if (eventid) {
var req = [];
- var attrlist = this.$data.subClassAttrList; //涓绘暟鎹被灞炴�
+ var attrlist = this.subClassAttrList; //涓绘暟鎹被灞炴�
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1623,13 +1570,13 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: 'MBOX', //this.$data.param.Sub_Cls.ID,
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
objid: "",
attr: req,
mast_attr: [],
inputParamter: [{
attr: 'mast_input_3037',
- value: result.decodedata
+ value: result
}]
}
@@ -1641,21 +1588,21 @@
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.$data.subPanelList) {
- if (this.$data.subPanelList[i].scanCodeVal == result.decodedata)
+ for (var i in this.subPanelList) {
+ if (this.subPanelList[i].scanCodeVal == result)
isflag = false;
}
//瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁
if (isflag) {
uni.hideKeyboard();
- this.$data.scanCodeVal = result.decodedata;
- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID;
+ this.scanCodeVal = result;
+ var eventid = this.param.Scan_Code.Input_Change_Event.ID;
if (eventid) {
var mast_req = [];
//涓绘暟鎹被灞炴�
- var classattrlist = this.$data.classAttrList;
+ var classattrlist = this.classAttrList;
for (var i = 0; i < classattrlist.length; i++) {
var attr = classattrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1665,7 +1612,7 @@
}
var req = [];
//瀛愭暟鎹被灞炴�
- var attrlist = this.$data.subClassAttrList;
+ var attrlist = this.subClassAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1681,13 +1628,13 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: 'MBOX', //this.$data.param.Sub_Cls.ID,
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
objid: "",
attr: mast_req,
sub_attr: req,
inputParamter: [{
attr: 'input_3037',
- value: this.$data.scanCodeVal
+ value: this.scanCodeVal
}]
}
@@ -1698,21 +1645,21 @@
},
scan_onevent(e) {
// console.log(e.target);
- if (e.target.value) {
+ if (e.detail.value) {
var isflag = true;
- for (var i in this.$data.subPanelList) {
- if (this.$data.subPanelList[i].scanCodeVal == e.target.value)
+ for (var i in this.subPanelList) {
+ if (this.subPanelList[i].scanCodeVal == e.detail.value)
isflag = false;
}
//瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁
if (isflag) {
uni.hideKeyboard();
- this.$data.scanCodeVal = e.target.value;
- var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID;
+ this.scanCodeVal = e.detail.value;
+ var eventid = this.param.Scan_Code.Input_Change_Event.ID;
if (eventid) {
var mast_req = [];
//涓绘暟鎹被灞炴�
- var classattrlist = this.$data.classAttrList;
+ var classattrlist = this.classAttrList;
for (var i = 0; i < classattrlist.length; i++) {
var attr = classattrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1722,7 +1669,7 @@
}
var req = [];
//瀛愭暟鎹被灞炴�
- var attrlist = this.$data.subClassAttrList;
+ var attrlist = this.subClassAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1738,13 +1685,13 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: 'MBOX', //this.$data.param.Sub_Cls.ID,
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
objid: "",
attr: mast_req,
sub_attr: req,
inputParamter: [{
attr: 'input_3037',
- value: this.$data.scanCodeVal
+ value: this.scanCodeVal
}]
}
@@ -1755,54 +1702,54 @@
},
onarrow(index, open) {
// console.log(index+'--'+open);
- var data_attr = this.$data.classAttrList[e.target.dataset[
+ var data_attr = this.classAttrList[e.target.dataset[
'index']].Attr[e.target.dataset['iindex']].Open;
if (!data_attr) {
- this.$data.subPanelList[e.target.dataset['iiindex']]
+ this.subPanelList[e.target.dataset['iiindex']]
.subClassAttr[e.target.dataset['index']].Attr[e
.target.dataset['iindex']].Value = open ==
true ? false : true;
return;
}
- this.$data.classAttrList[e.target.dataset['iiindex']]
+ this.classAttrList[e.target.dataset['iiindex']]
.subClassAttr[index].Open = open == true ? false :
true;
},
ondateTime(e) {
//console.log(e.target)
- var data_attr = this.$data.classAttrList[e.target.dataset[
+ var data_attr = this.classAttrList[e.target.dataset[
'index']].Attr[e.target.dataset['iindex']].Value;
if (!data_attr) {
- this.$data.subPanelList[e.target.dataset['iiindex']]
+ this.subPanelList[e.target.dataset['iiindex']]
.subClassAttr[e.target.dataset['index']].Attr[e
.target.dataset['iindex']].Value = e.target
.value;
return;
}
- this.$data.classAttrList[e.target.dataset['index']].Attr[e
- .target.dataset['iindex']].Value = e.target.value;
+ this.classAttrList[e.target.dataset['index']].Attr[e
+ .target.dataset['iindex']].Value = e.detail.value;
},
onchange(e) {
console.log(e.target);
- var value = this.$data.classAttrList[e.target.dataset[
+ var value = this.classAttrList[e.target.dataset[
'index']].Attr[e.target.dataset['iindex']]
- .dictitem[e.target.value];
- var data_attr = this.$data.classAttrList[e.target.dataset[
+ .dictitem[e.detail.value];
+ var data_attr = this.classAttrList[e.target.dataset[
'index']].Attr[e.target.dataset['iindex']];
// console.log(data_attr);
if (value.Name != data_attr.Value) {
- this.$data.classAttrList[e.target.dataset['index']]
+ this.classAttrList[e.target.dataset['index']]
.Attr[e.target.dataset['iindex']].Value = value
.Name;
- // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
- var eventid = this.$data.classAttrList[e.target
+ // console.log(this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
+ var eventid = this.classAttrList[e.target
.dataset['index']].Attr[e.target.dataset[
'iindex']].action;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1818,7 +1765,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.Master_Cls.ID,
+ clsid: this.param.Master_Cls.ID,
objid: "",
attr: req,
}
@@ -1833,12 +1780,11 @@
// console.log(delvalue);
if (item.length == 0) { //涓虹┖鏃讹紝娓呯┖灞炴�value
var index, iindex, dindex = 0;
- for (var i in this.$data.classAttrList) {
- for (var j in this.$data.classAttrList[i]
+ for (var i in this.classAttrList) {
+ for (var j in this.classAttrList[i]
.Attr) {
- if (delvalue[0].attr == this.$data
- .classAttrList[i].Attr[j].Name) {
- this.$data.classAttrList[i].Attr[j]
+ if (delvalue[0].attr == this.classAttrList[i].Attr[j].Name) {
+ this.classAttrList[i].Attr[j]
.Value = "";
}
}
@@ -1847,32 +1793,30 @@
for (var v in item) {
var index, iindex, dindex = 0;
- for (var i in this.$data.classAttrList) {
- for (var j in this.$data.classAttrList[i]
+ for (var i in this.classAttrList) {
+ for (var j in this.classAttrList[i]
.Attr) {
- if (item[v].attr == this.$data
- .classAttrList[i].Attr[j].Name) {
+ if (item[v].attr == this.classAttrList[i].Attr[j].Name) {
index = i;
iindex = j;
}
}
}
var itemvalue = item[v];
- var data_attr = this.$data.classAttrList[index]
+ var data_attr = this.classAttrList[index]
.Attr[iindex];
console.log(data_attr);
if (itemvalue.Name != data_attr.Value) {
- this.$data.classAttrList[index].Attr[
+ this.classAttrList[index].Attr[
iindex].Value = value;
- // console.log(this.$data.classAttrList[index].Attr[iindex].Value);
- var eventid = this.$data.classAttrList[
+ // console.log(this.classAttrList[index].Attr[iindex].Value);
+ var eventid = this.classAttrList[
index].Attr[iindex].action;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data
- .classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist
.length; i++) {
var attr = attrlist[i].Attr;
@@ -1897,7 +1841,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param
+ clsid: this.param
.Master_Cls.ID,
objid: "",
attr: req,
@@ -1909,27 +1853,27 @@
},
sub_onchange(e) {
console.log(e.target);
- var value = this.$data.subPanelList[e
+ var value = this.subPanelList[e
.target.dataset['iiindex']]
.subClassAttr[e.target.dataset[
'index']].Attr[e.target.dataset[
'iindex']].dictitem[e.target
.value];
- var data_attr = this.$data.subPanelList[e
+ var data_attr = this.subPanelList[e
.target.dataset['iiindex']]
.subClassAttr[e.target.dataset[
'index']].Attr[e.target.dataset[
'iindex']];
// console.log(data_attr);
if (value.Name != data_attr.Value) {
- this.$data.subPanelList[e.target
+ this.subPanelList[e.target
.dataset['iiindex']]
.subClassAttr[e.target.dataset[
'index']].Attr[e.target
.dataset['iindex']].Value =
value.Name;
- // console.log(this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
- var eventid = this.$data.subPanelList[e
+ // console.log(this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
+ var eventid = this.subPanelList[e
.target.dataset['iiindex']]
.subClassAttr[e.target.dataset[
'index']].Attr[e.target
@@ -1937,9 +1881,8 @@
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data
- .subPanelList[e.target.dataset[
- 'iiindex']].subClassAttr;
+ var attrlist = this.subPanelList[e.target.dataset[
+ 'iiindex']].subClassAttr;
for (var i = 0; i < attrlist
.length; i++) {
var attr = attrlist[i].Attr;
@@ -1957,7 +1900,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param
+ clsid: this.param
.Sub_Cls.ID,
objid: "",
attr: req,
@@ -1971,7 +1914,7 @@
// console.log(item);
// console.log(value);
// console.log(delvalue);
- var subClassAttr = this.$data.subPanelList[
+ var subClassAttr = this.subPanelList[
e.target.dataset['iiindex']]
.subClassAttr;
if (item.length == 0) { //涓虹┖鏃讹紝娓呯┖灞炴�value
@@ -2054,7 +1997,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param
+ clsid: this.param
.Sub_Cls.ID,
objid: "",
attr: req,
@@ -2067,33 +2010,28 @@
},
onevent(e) {
// console.log(e.target);
- var data_attr = this.$data.classAttrList[e
+ var data_attr = this.classAttrList[e
.target.dataset['index']].Attr[e
.target.dataset['iindex']];
if (!data_attr) {
- this.$data.subPanelList[e.target
- .dataset['iiindex']]
- .subClassAttr[e.target.dataset[
- 'index']].Attr[e.target
- .dataset['iindex']].Value = e
- .target.value;
+ this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target
+ .dataset['iindex']].Value = e.detail.value;
return;
}
// console.log(data_attr);
- if (e.target.value != data_attr.Value) {
- this.$data.classAttrList[e.target
+ if (e.detail.value != data_attr.Value) {
+ this.classAttrList[e.target
.dataset['index']].Attr[e
.target.dataset['iindex']]
- .Value = e.target.value;
- // var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
+ .Value = e.detail.value;
+ // var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.$data.param
+ var eventid = this.param
.Scan_Code.Input_Change_Event.ID;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data
- .classAttrList; //涓绘暟鎹被灞炴�
+ var attrlist = this.classAttrList; //涓绘暟鎹被灞炴�
for (var i = 0; i < attrlist
.length; i++) {
var attr = attrlist[i].Attr;
@@ -2111,7 +2049,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: 'MBOX', //this.$data.param.Sub_Cls.ID,
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
objid: "",
attr: req,
mast_attr: [],
@@ -2133,11 +2071,11 @@
// console.log(e.target);
var ischecked = e.target.dataset.ischeck ?
false : true;
- var data_attr = this.$data.classAttrList[e
+ var data_attr = this.classAttrList[e
.target.dataset['index']].Attr[e
.target.dataset['iindex']];
if (!data_attr) {
- this.$data.subPanelList[e.target
+ this.subPanelList[e.target
.dataset['iiindex']]
.subClassAttr[e.target.dataset[
'index']].Attr[e.target
@@ -2147,19 +2085,18 @@
}
// console.log(data_attr);
if (ischecked != data_attr.Value) {
- this.$data.classAttrList[e.target
+ this.classAttrList[e.target
.dataset['index']].Attr[e
.target.dataset['iindex']]
.Value = ischecked;
- var eventid = this.$data.classAttrList[
+ var eventid = this.classAttrList[
e.target.dataset['index']]
.Attr[e.target.dataset['iindex']]
.action;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data
- .classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist
.length; i++) {
var attr = attrlist[i].Attr;
@@ -2176,7 +2113,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param
+ clsid: this.param
.Master_Cls.ID,
objid: "",
attr: req,
@@ -2188,41 +2125,31 @@
},
inputValListIsDel(index) {
// console.log(index);
- this.$data.inputValList.splice(index,
+ this.inputValList.splice(index,
1); //鍒犻櫎tabPagejson鐨勫唴瀹�- // console.log(this.$data.inputValList);
+ // console.log(this.inputValList);
},
addresschange(e) {
- this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data
+ this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data
.join(';');
},
classAttr_extButton(index, iindex) {
var $this = this;
- var before_click_button = $this.$data
- .classAttrList[index].Attr[iindex]
+ var before_click_button = $this.classAttrList[index].Attr[iindex]
.before_click_button;
- var button_callback = $this.$data
- .classAttrList[index].Attr[iindex]
+ 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('cancel')
- });
+ 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('cancel')
- });
+ showInfo("button_callback-event_id涓虹┖锛�)
+
return;
}
- var data_attr = this.$data.classAttrList[
+ var data_attr = this.classAttrList[
index].Attr[iindex];
this.DataObjRunCustomEvent_Return(
before_click_button, data_attr,
@@ -2241,23 +2168,19 @@
AddPer(data, param) {
// console.log(param);
console.log(data);
- $this.$data
- .classAttrList[
+ $this.classAttrList[
param.index]
.Attr[param.iindex]
.Value = data[0]
.Name;
- $this.$data
- .classAttrList[
+ $this.classAttrList[
param.index]
.Attr[param.iindex]
.ValID = data[0]
.Login + ';' +
data[0].Name;
- var eventid = $this
- .$data
- .classAttrList[
+ var eventid = $this.classAttrList[
param.index]
.Attr[param.iindex]
.action;
@@ -2275,16 +2198,14 @@
0
]
.Login,
- clsid: $this
- .$data
- .param
+ clsid: $this.param
.Master_Cls
.ID,
objid: "",
attr: [],
}
- // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex];
+ // var data_attr = $this.classAttrList[param.index].Attr[param.iindex];
$this
.DataObjRunCustomEvent(
info);
@@ -2296,14 +2217,10 @@
},
classAttr_AddRef(e) {
console.log(e.target);
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "姝ゅ姛鑳借繕鏈疄鐜帮紒",
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value];
- // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
+ 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;
},
classAttr_AddPrj(index, iindex) {
var param = {
@@ -2318,23 +2235,19 @@
AddPer(data, param) {
// console.log(param);
// console.log(data);
- $this.$data
- .classAttrList[
+ $this.classAttrList[
param.index]
.Attr[param.iindex]
.Value = data[0]
.Name;
- $this.$data
- .classAttrList[
+ $this.classAttrList[
param.index]
.Attr[param.iindex]
.ValID = data[0]
.ID + ';' + data[0]
.Name;
- var eventid = $this
- .$data
- .classAttrList[
+ var eventid = $this.classAttrList[
param.index]
.Attr[param.iindex]
.action;
@@ -2352,16 +2265,14 @@
rclsid: "",
robjid: "",
userlogin: "",
- clsid: $this
- .$data
- .param
+ clsid: $this.param
.Master_Cls
.ID,
objid: "",
attr: [],
}
- // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex];
+ // var data_attr = $this.classAttrList[param.index].Attr[param.iindex];
$this
.DataObjRunCustomEvent(
info);
@@ -2371,15 +2282,21 @@
}
});
},
+ onSave() {
+ this.handleButtonClick((done) => {
+ this.sava()
+ setTimeout(() => {
+ done(); // 閲嶇疆鐘舵�
+ }, 1000);
+ });
+ },
sava() {
- if (this.$data.param
+ if (this.param
.Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈�- this.scan_OKDataObjRunCustomEvent(this
- .$data.param.Before_OK_Event.ID);
- else if (this.$data.param
+ this.scan_OKDataObjRunCustomEvent(this.param.Before_OK_Event.ID);
+ else if (this.param
.After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈�- this.scan_OKDataObjRunCustomEvent(this
- .$data.param.After_OK_Event.ID);
+ this.scan_OKDataObjRunCustomEvent(this.param.After_OK_Event.ID);
else
uni.navigateBack({
delta: 1
@@ -2391,7 +2308,7 @@
mask: true
});
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -2430,33 +2347,25 @@
.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('cancel')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
}
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls
+ cls_id: this.param.Master_Cls
.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
master: {
- cls_id: this.$data.param
+ cls_id: this.param
.Master_Cls.ID,
}
};
// var dataInfo={
- // class_id: this.$data.param.Master_Cls.ID, data_obj_id: '', masterclsid: '',
+ // class_id: this.param.Master_Cls.ID, data_obj_id: '', masterclsid: '',
// req: JSON.stringify(req), upfile: JSON.stringify([]), post_data: JSON.stringify({}),
// compose: JSON.stringify([]), refdatastore: JSON.stringify([]), extinfo: JSON.stringify(enviroment),
// not_trigger_sys_event: ''
@@ -2469,7 +2378,7 @@
.value;
});
var dataInfo = {
- class_id: this.$data.param
+ class_id: this.param
.Master_Cls.ID,
class_name: '',
master_cls_id: '',
@@ -2487,74 +2396,73 @@
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=' +
JSON
.stringify(
- this
- .$data
- .param
+ this.param
) +
"&titlename=" +
- this.$data
- .title
+ this.title
});
// this.class_attr_init();
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showError(ex, this.translateSys('tip'))
});
},
ini_DataObjRunCustomEvent(info) {
var param = {
- EditStyle: this.$data.param
+ EditStyle: this.param
.Master_Cls.View_Style.Name,
- ViewStyle: this.$data.param
+ ViewStyle: this.param
.Master_Cls.View_Style.Name,
NotTriggerSysEvent: 0,
enviroment: {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param
+ cls_id: this.param
.Master_Cls
.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
master: {
- cls_id: this.$data.param
+ cls_id: this.param
.Master_Cls
.ID, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
@@ -2602,260 +2510,177 @@
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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
+ 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
- .$data
- .classAttrList
- .length; a++
+ var i =
+ 0; i <
+ val
+ .length; i++
) {
for (
- var l =
- 0; l <
- this
- .$data
- .classAttrList[
- a
- ]
- .Attr
- .length; l++
+ var a =
+ 0; a <
+ this.classAttrList
+ .length; a++
) {
- var ca =
- this
- .$data
- .classAttrList[
+ 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;
}
}
}
- }
- var length =
- 0;
- if (!
- this
- .$data
- .refdatastore
- .filter(
- function(
- s
- ) {
- return val[
- i
- ]
- .attr ==
- s
- .attr
- }
- )
- .length
- ) {
- length
- =
- 1;
- this.$data
- .refdatastore
- .push(
- val[
- i]
- );
- }
- if (length ==
- 0
- ) {
- for (
- var j =
- 0; j <
- this
- .$data
- .refdatastore
- .length; j++
- ) {
- if (this
- .$data
- .refdatastore[
- j
- ]
- .attr ==
- val[
- i]
- .attr
- ) {
- this.$data
- .refdatastore[
- j
- ]
- .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('cancel')
- });
+
}
}
+ } 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('cancel')
- });
+ showError(ex, this.translateSys('tip') + "2.1")
});
},
DataObjRunCustomEvent(info, data_attr) {
var $this = this;
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls
+ cls_id: this.param.Master_Cls
.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
master: {
- cls_id: this.$data.param
+ cls_id: this.param
.Master_Cls
.ID, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
@@ -2863,7 +2688,7 @@
};
enviroment.edit_dlg = {
type: 'small', //灏忕獥鍙�- class_id: this.$data.param
+ class_id: this.param
.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d
}
if (data_attr) {
@@ -2886,12 +2711,12 @@
// var dataInfo = {
// edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''),
// rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid,
- // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.$data.global_attr)
+ // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.global_attr)
// }
enviroment = Base64.encode(JSON.stringify(
enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var global_attr = Base64.encode(JSON
- .stringify(this.$data.global_attr)
+ .stringify(this.global_attr)
); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
if (info.dataJson)
info.dataJson = Base64.encode(JSON
@@ -2927,87 +2752,227 @@
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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
-
- 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 <
- $this
- .$data
- .classAttrList
+ $this.classAttrList
.length; c++
) {
var attr =
- $this
- .$data
- .classAttrList[
+ $this.classAttrList[
c
]
.Attr;
@@ -3017,6 +2982,18 @@
attr
.length; j++
) {
+ console
+ .log(
+ attr[
+ j
+ ]
+ .Name +
+ '==' +
+ result[
+ i
+ ]
+ .attr
+ );
if (attr[
j
]
@@ -3026,310 +3003,125 @@
]
.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
- .$data
- .classAttrList
- .length; c++
- ) {
- var attr =
- $this
- .$data
- .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;
- }
- }
- }
- var length =
- 0;
- if (!
- $this
- .$data
- .refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- }
- )
- .length
- ) {
- length
- =
- 1;
- $this
- .$data
- .refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0
- ) {
- for (
- var j =
- 0; j <
- $this
- .$data
- .refdatastore
- .length; j++
- ) {
- if ($this
- .$data
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .$data
- .refdatastore[
- j
- ]
- .value =
- result[
- i
- ]
- .value;
- }
- }
- }
- }
- } else if (data
- .action[i]
- .action_type ==
- 'set_global_attr'
- ) {
- $this.$data
- .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.$data
- .classAttrList
- .length; c++
- ) {
- var attr =
- $this
- .$data
- .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
- .$data
- .refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- })
- .length) {
- length = 1;
- $this.$data
- .refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0) {
- for (var j =
- 0; j <
- $this
- .$data
- .refdatastore
- .length; j++
- ) {
- if ($this
- .$data
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .$data
- .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('cancel')
- });
+ showError(ex, this.translateSys('tip') + "3.1")
});
},
OKDataObjRunCustomEvent() {
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls
+ cls_id: this.param.Master_Cls
.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
master: {
- cls_id: this.$data.param
+ cls_id: this.param
.Master_Cls
.ID, // button=bottom鏃�master鐨刢ls_id
}
};
- var eventid = this.$data.edit_ok_event
+ var eventid = this.edit_ok_event
.scrip_id;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -3342,22 +3134,18 @@
req.push(this.formatAttr(ar));
}
}
- if (this.$data.refdatastore.length > 0) {
- for (var i = 0; i < this.$data
- .refdatastore.length; i++) {
+ if (this.refdatastore.length > 0) {
+ for (var i = 0; i < this.refdatastore.length; i++) {
if (!req.filter(function(s) {
- return this.$data
- .refdatastore[i]
+ return this.refdatastore[i]
.attr == s.name
}).length) {
length = 1;
req.push({
- 'attr': this.$data
- .refdatastore[
- i].attr,
- 'value': this.$data
- .refdatastore[
- i].value
+ 'attr': this.refdatastore[
+ i].attr,
+ 'value': this.refdatastore[
+ i].value
});
}
}
@@ -3369,7 +3157,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.Master_Cls
+ clsid: this.param.Master_Cls
.ID,
objid: "",
attr: req,
@@ -3377,12 +3165,12 @@
// var dataInfo = {
// edtype: info.edtype, eventid: info.eventid, projectid: info.projectid,rclsid: info.rclsid,
// robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid,
- // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), global_attr: JSON.stringify(this.$data.global_attr)
+ // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), global_attr: JSON.stringify(this.global_attr)
// }
enviroment = Base64.encode(JSON.stringify(
enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var global_attr = Base64.encode(JSON
- .stringify(this.$data.global_attr)
+ .stringify(this.global_attr)
); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var obj_attr = {};
info.attr.forEach(item => {
@@ -3414,116 +3202,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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- 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('cancel')
- });
-
- 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.$data
- .refdatastore
- .filter(
- function(
- s) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- }).length
- ) {
- length = 1;
- this.$data
- .refdatastore
- .push(
- result[
- i]
- );
- }
- if (length == 0) {
- for (var j =
- 0; j < this
- .$data
- .refdatastore
- .length; j++
- ) {
- if (this
- .$data
- .refdatastore[
- j]
- .attr ==
- result[
- i]
- .attr
- ) {
- this.$data
- .refdatastore[
- j
- ]
- .value =
- result[
- i
- ]
- .value;
- }
- }
+ 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('\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++
+ ) {
+ // 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
+ ) {
+ 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;
+ }
+ }
+ }
+ }
- 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('cancel')
- });
+ showError(ex, this.translateSys('tip') + "4.1")
});
},
DataObjRunCustomEvent_Return(eventid,
@@ -3531,19 +3299,19 @@
) {
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.Master_Cls
+ cls_id: this.param.Master_Cls
.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
master: {
- cls_id: this.$data.param
+ cls_id: this.param
.Master_Cls
.ID, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
}
};
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -3551,22 +3319,18 @@
req.push(this.formatAttr(ar));
}
}
- if (this.$data.refdatastore.length > 0) {
- for (var i = 0; i < this.$data
- .refdatastore.length; i++) {
+ if (this.refdatastore.length > 0) {
+ for (var i = 0; i < this.refdatastore.length; i++) {
if (!req.filter(function(s) {
- return this.$data
- .refdatastore[i]
+ return this.refdatastore[i]
.attr == s.name
}).length) {
length = 1;
req.push({
- 'attr': this.$data
- .refdatastore[
- i].attr,
- 'value': this.$data
- .refdatastore[
- i].value
+ 'attr': this.refdatastore[
+ i].attr,
+ 'value': this.refdatastore[
+ i].value
});
}
}
@@ -3574,7 +3338,7 @@
var extinfo = enviroment;
extinfo.edit_dlg = {
type: 'small', //灏忕獥鍙�- class_id: this.$data.param
+ class_id: this.param
.Master_Cls.ID, //褰撳墠鏁版嵁绫籭d
}
if (data_attr) {
@@ -3596,13 +3360,13 @@
}
// var dataInfo = {
// edtype: "0", eventid: eventid, projectid: '',rclsid: '', robjid: '', userlogin: '',
- // clsid: this.$data.param.Master_Cls.ID, objid: '',attr: JSON.stringify(req),
- // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.$data.global_attr)
+ // clsid: this.param.Master_Cls.ID, objid: '',attr: JSON.stringify(req),
+ // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.global_attr)
// }
extinfo = Base64.encode(JSON.stringify(
extinfo)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var global_attr = Base64.encode(JSON
- .stringify(this.$data.global_attr)
+ .stringify(this.global_attr)
); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var obj_attr = {};
req.forEach(item => {
@@ -3613,7 +3377,7 @@
var dataInfo = {
ed_type: "0",
start_transaction: '',
- class_id: this.$data.param.clsid,
+ class_id: this.param.clsid,
class_name: '',
event_id: eventid,
event_name: '',
@@ -3633,53 +3397,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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
+ 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
@@ -3757,7 +3507,6 @@
robjid: '',
userlogin: '',
clsid: $this
- .$data
.param
.Master_Cls
.ID,
@@ -3882,7 +3631,6 @@
param
) {
$this
- .$data
.classAttrList[
param
.index
@@ -3897,7 +3645,6 @@
]
.Name;
$this
- .$data
.classAttrList[
param
.index
@@ -3933,7 +3680,6 @@
robjid: "",
userlogin: "",
clsid: $this
- .$data
.param
.Master_Cls
.ID,
@@ -3963,26 +3709,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('cancel')
- });
}
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('tip') + "5.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ showError(ex, this.translateSys('tip') + "5.1")
});
},
scan_ini_DataObjRunCustomEvent(info) {
@@ -3992,19 +3733,19 @@
.value;
});
var param = {
- EditStyle: this.$data.param.Sub_Cls
+ EditStyle: this.param.Sub_Cls
.View_Style.Name,
- ViewStyle: this.$data.param.Sub_Cls
+ ViewStyle: this.param.Sub_Cls
.View_Style.Name,
NotTriggerSysEvent: 0,
enviroment: {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param
+ cls_id: this.param
.Sub_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: '鏂板',
master: {
- cls_id: this.$data.param
+ cls_id: this.param
.Sub_Cls
.ID, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
@@ -4046,365 +3787,377 @@
console.log(dataInfo);
// 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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- 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('cancel')
- });
+ console.log(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);
+ }
+ }
+ 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
+ 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
- );
- for (
- var i =
- 0; i <
- val
- .length; i++
- ) {
- for (
- var a =
- 0; a <
- this
- .$data
- .subClassAttrList
- .length; a++
- ) {
- for (
- var l =
- 0; l <
- this
- .$data
- .subClassAttrList[
- a
- ]
- .Attr
- .length; l++
- ) {
- var ca =
- this
- .$data
- .subClassAttrList[
- 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
- });
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
+ 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;
- // attr[j].dictitem = val[i].choice_list;
- } else {
- // ca.value = val[i].value;
}
- }
- }
- }
-
- var length =
- 0;
- if (!
- this
- .$data
- .refdatastore
- .filter(
- function(
- s
- ) {
- return val[
- i
- ]
- .attr ==
- s
- .attr
- }
- )
- .length
- ) {
- length
- =
- 1;
- this.$data
- .refdatastore
- .push(
- val[
- i]
- );
- }
- if (length ==
- 0
- ) {
- for (
- var j =
- 0; j <
- this
- .$data
- .refdatastore
- .length; j++
- ) {
- if (this
- .$data
- .refdatastore[
- j
- ]
- .attr ==
- val[
- i]
- .attr
- ) {
- this.$data
- .refdatastore[
- j
- ]
- .value =
- val[
- i]
- .value;
}
}
}
}
}
- }
- 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('cancel')
- });
+ } 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') + " 6.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- });
- },
- scan_DataObjRunCustomEvent(info, data_attr) {
- var $this = this;
- var obj_attr = {};
- info.attr.forEach(item => {
- obj_attr[item.attr] = item
- .value;
- });
- var enviroment = {};
- if (info.enviroment) {
- enviroment = info.enviroment;
- } else {
- enviroment = {
- 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�- 'button': 'top', // top/bottom
- button_name: '鏂板',
- edit_dlg: {
- type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d
- },
- master: {
- cls_id: info
- .clsid, // button=bottom鏃�master鐨刢ls_id
- //obj_id: '' // button=bottom鏃�master鐨刼bj_id
- obj_attrs: obj_attr,
- }
- };
-
- }
- var global_attr = this.$data.global_attr;
- if (info.global_attr) {
- global_attr = info.global_attr;
- }
-
- enviroment = Base64.encode(JSON.stringify(
- enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var inputParamter = info.inputParamter;
- if (info.inputParamter) {
- info.inputParamter = Base64.encode(JSON
- .stringify(info.inputParamter)
- ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- }
- var global_attr = Base64.encode(JSON
- .stringify(this.$data.global_attr)
- ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
-
- if (!info.eventid.includes('{')) info
- .eventid = '{' + info.eventid + '}';
- var dataInfo = {
- ed_type: info.edtype,
- start_transaction: '',
- class_id: info.clsid,
- class_name: '',
- event_id: info.eventid,
- event_name: '',
- data_obj_id: info.objid,
- obj_attr: obj_attr,
- prj_id: info.projectid.replace('{',
- '').replace('}', ''),
- ref_cls_id: info.rclsid,
- rel_obj_id: info.robjid,
- user_login: info.userlogin,
- data_json: '',
- compose_info: '',
- ext_info: enviroment,
- global_attr: global_attr,
- input_param: info.inputParamter,
+ // console.log(ex);
+ showError(ex, this.translateSys('tip') + "6.1")
+ });
+ },
+ scan_DataObjRunCustomEvent(info, data_attr) {
+ var $this = this;
+ var obj_attr = {};
+ info.attr.forEach(item => {
+ obj_attr[item.attr] = item
+ .value;
+ });
+ var enviroment = {};
+ if (info.enviroment) {
+ enviroment = info.enviroment;
+ } else {
+ enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: '鏂板',
+ edit_dlg: {
+ type: 'small', //灏忕獥鍙�+ class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d
+ },
+ master: {
+ cls_id: info
+ .clsid, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
+ obj_attrs: obj_attr,
+ }
};
- console.log(dataInfo);
- // 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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- 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('cancel')
- });
- var actionlist = data
- .action;
- if (actionlist) {
- console.log(
- actionlist);
+ }
+ var global_attr = this.global_attr;
+ if (info.global_attr) {
+ global_attr = info.global_attr;
+ }
+
+ enviroment = Base64.encode(JSON.stringify(
+ enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var inputParamter = info.inputParamter;
+ if (info.inputParamter) {
+ info.inputParamter = Base64.encode(JSON
+ .stringify(info.inputParamter)
+ ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ }
+ var global_attr = Base64.encode(JSON
+ .stringify(this.global_attr)
+ ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+
+ if (!info.eventid.includes('{')) info
+ .eventid = '{' + info.eventid + '}';
+ var dataInfo = {
+ ed_type: info.edtype,
+ start_transaction: '',
+ class_id: info.clsid,
+ class_name: '',
+ event_id: info.eventid,
+ event_name: '',
+ data_obj_id: info.objid,
+ obj_attr: obj_attr,
+ prj_id: info.projectid.replace('{',
+ '').replace('}', ''),
+ ref_cls_id: info.rclsid,
+ rel_obj_id: info.robjid,
+ user_login: info.userlogin,
+ data_json: '',
+ compose_info: '',
+ ext_info: enviroment,
+ global_attr: global_attr,
+ input_param: info.inputParamter,
+ };
+ console.log(dataInfo);
+ // return;
+ runCustomEvent(dataInfo).then(data => {
+ console.log(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);
+ }
+ }
+ 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
+ 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 <
+ 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;
+ 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;
+ }
+ }
+ }
+ }
+ }
+
+ 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 ii =
0; ii <
actionlist
@@ -4433,26 +4186,13 @@
for (
var s =
0; s <
- $this
- .$data
- .subPanelList
+ $this.subPanelList
.length; s++
) {
- for (
- var c =
- 0; c <
- $this
- .$data
- .subPanelList[
- s
- ]
- .subClassAttrList
- .length; c++
- ) {
+ for (var c = 0; c < $this.subPanelList[s].subClassAttrList
+ .length; c++) {
var attr =
- $this
- .$data
- .subPanelList[
+ $this.subPanelList[
s
]
.subClassAttrList[
@@ -4516,7 +4256,6 @@
var s =
0; s <
$this
- .$data
.subPanelList
.length; s++
) {
@@ -4524,7 +4263,6 @@
var c =
0; c <
$this
- .$data
.subPanelList[
s
]
@@ -4533,7 +4271,6 @@
) {
var attr =
$this
- .$data
.subPanelList[
s
]
@@ -4579,73 +4316,6 @@
}
}
}
- var length =
- 0;
- if (!
- $this
- .$data
- .refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- }
- )
- .length
- ) {
- length
- =
- 1;
- $this
- .$data
- .refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0
- ) {
- for (
- var j =
- 0; j <
- $this
- .$data
- .refdatastore
- .length; j++
- ) {
- if ($this
- .$data
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .$data
- .refdatastore[
- j
- ]
- .value =
- result[
- i
- ]
- .value;
- }
- }
- }
}
} else if (
action
@@ -4668,9 +4338,7 @@
.common_dlg_id ==
'check_list'
) {
- $this
- .$data
- .check_list =
+ $this.check_list =
action
.value
.config;
@@ -4681,13 +4349,10 @@
'sideslip'
) //鍒ゆ柇鏄惁鏄晶婊� $this
- .$data
.popupType =
'right';
else
- $this
- .$data
- .popupType =
+ $this.popupType =
'center'
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
$this
@@ -4695,7 +4360,6 @@
.popup
.open(
$this
- .$data
.popupType
);
}
@@ -4714,15 +4378,11 @@
.parse(
JSON
.stringify(
- this
- .$data
- .subClassAttrList
+ this.subClassAttrList
)
);
var scanCodeVal =
- $this
- .$data
- .scanCodeVal;
+ $this.scanCodeVal;
var rand =
'';
for (var i =
@@ -4767,8 +4427,7 @@
"mast_input_3037-" +
rand;
}
- $this.$data
- .subPanelList
+ $this.subPanelList
.push({
scanCodeVal: scanCodeVal,
subClassAttr: list_1
@@ -4781,14 +4440,10 @@
for (
var s =
0; s <
- $this
- .$data
- .subPanelList
+ $this.subPanelList
.length; s++
) {
- if ($this
- .$data
- .subPanelList[
+ if ($this.subPanelList[
s
]
.scanCodeVal ==
@@ -4800,9 +4455,7 @@
.attr ==
"S_ID"
)
- $this
- .$data
- .subPanelList[
+ $this.subPanelList[
s
]
.ObjID =
@@ -4811,9 +4464,7 @@
]
.value;
var _subClassAttr =
- $this
- .$data
- .subPanelList[
+ $this.subPanelList[
s
]
.subClassAttr;
@@ -4855,16 +4506,14 @@
}
}
- // $this.$data.subPanelList[s].subClassAttr=list_1;
+ // $this.subPanelList[s].subClassAttr=list_1;
}
}
var length =
0;
if (!
- $this
- .$data
- .refdatastore
+ $this.refdatastore
.filter(
function(
s
@@ -4882,9 +4531,7 @@
length
=
1;
- $this
- .$data
- .refdatastore
+ $this.refdatastore
.push(
result[
i
@@ -4897,14 +4544,10 @@
for (
var j =
0; j <
- $this
- .$data
- .refdatastore
+ $this.refdatastore
.length; j++
) {
- if ($this
- .$data
- .refdatastore[
+ if ($this.refdatastore[
j
]
.attr ==
@@ -4913,9 +4556,7 @@
]
.attr
) {
- $this
- .$data
- .refdatastore[
+ $this.refdatastore[
j
]
.value =
@@ -4929,489 +4570,257 @@
}
}
}
- }
- if (data.result) {
- var list_1 = JSON
- .parse(JSON
- .stringify(
- this
- .$data
- .subClassAttrList
- ));
- var scanCodeVal =
- $this.$data
- .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.$data
- .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.$data
- .subPanelList
- .length; s++
- ) {
- if ($this
- .$data
- .subPanelList[
- s]
- .scanCodeVal ==
- scanCodeVal
- ) {
- if (result[
- i
- ]
- .attr ==
- "S_ID"
- )
- $this
- .$data
- .subPanelList[
- s
- ]
- .ObjID =
- result[
- i
- ]
- .value;
- var _subClassAttr =
- $this
- .$data
- .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;
- }
- }
- }
- }
- }
-
- var length = 0;
- if (!$this
- .$data
- .refdatastore
- .filter(
- function(
- s
- ) {
- return result[
- i
- ]
- .attr ==
- s
- .attr
- })
- .length) {
- length = 1;
- $this.$data
- .refdatastore
- .push(
- result[
- i
- ]
- );
- }
- if (length ==
- 0) {
- for (var j =
- 0; j <
- $this
- .$data
- .refdatastore
- .length; j++
- ) {
- if ($this
- .$data
- .refdatastore[
- j
- ]
- .attr ==
- result[
- i
- ]
- .attr
- ) {
- $this
- .$data
- .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('cancel')
- });
- });
- },
- scan_OKDataObjRunCustomEvent(eventID) {
- uni.showLoading({
- title: "鍔犺浇涓�..",
- mask: true
- });
- var $this = this;
- var req = [];
- var attrlist = $this.$data.classAttrList;
- for (var i = 0; i < attrlist.length; i++) {
- var attr = attrlist[i].Attr;
- for (var j = 0; j < attr.length; j++) {
+ }
+
+ }).catch(ex => {
+ // console.log(ex);
+ showError(ex, this.translateSys('tip') + "7.1")
+ });
+ },
+ scan_OKDataObjRunCustomEvent(eventID) {
+ uni.showLoading({
+ title: "鍔犺浇涓�..",
+ mask: true
+ });
+ var $this = this;
+ var req = [];
+ var attrlist = $this.classAttrList;
+ for (var i = 0; i < attrlist.length; i++) {
+ var attr = attrlist[i].Attr;
+ for (var j = 0; j < attr.length; j++) {
+ var ar = attr[j];
+ if (ar.Value == '璇烽�鎷� || ar
+ .Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value =
+ '';
+ if (utils.classUtils.attrTypeIsDict(ar.Type)) {
+ if (ar.select ==
+ true) { //鍒ゆ柇涓嬫媺鏄惁澶氶�
+ var valStr = "";
+ for (var v in ar.Value) {
+ if (valStr)
+ valStr += ";";
+ valStr += ar.Value[v];
+ }
+ req.push({
+ attr: ar.Name,
+ value: valStr
+ });
+ } else
+ req.push({
+ attr: ar.Name,
+ value: ar.Value
+ });
+ } else
+ req.push(this.formatAttr(ar));
+
+ if (ar.notempty == true && !ar
+ .Value) {
+ // if(ar.NotEmpty=='1'){
+ uni.hideLoading();
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
+ return;
+ }
+ }
+ }
+ var objects = [];
+ var subPanelList = $this.subPanelList;
+ for (var s = 0; s < subPanelList
+ .length; s++) {
+ var sub_req = [];
+ for (var i = 0; i < subPanelList[s]
+ .subClassAttr.length; i++) {
+ var attr = subPanelList[s]
+ .subClassAttr[i].Attr;
+ for (var j = 0; j < attr
+ .length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷� || ar
- .Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value =
- '';
+ .Value == '鈥斺�璇烽�鎷┾�鈥�) ar
+ .Value = '';
if (utils.classUtils.attrTypeIsDict(ar.Type)) {
if (ar.select ==
true) { //鍒ゆ柇涓嬫媺鏄惁澶氶�
var valStr = "";
- for (var v in ar.Value) {
+ for (var v in ar
+ .Value) {
if (valStr)
valStr += ";";
- valStr += ar.Value[v];
+ valStr += ar.Value[
+ v];
}
- req.push({
- attr: ar.Name,
+ sub_req.push({
+ attr: ar
+ .Name,
value: valStr
});
} else
- req.push({
+ sub_req.push({
attr: ar.Name,
value: ar.Value
});
} else
- req.push(this.formatAttr(ar));
+ sub_req.push(this.formatAttr(ar));
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('cancel')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
}
- var objects = [];
- var subPanelList = $this.$data
- .subPanelList;
- for (var s = 0; s < subPanelList
- .length; s++) {
- var sub_req = [];
- for (var i = 0; i < subPanelList[s]
- .subClassAttr.length; i++) {
- var attr = subPanelList[s]
- .subClassAttr[i].Attr;
- for (var j = 0; j < attr
- .length; j++) {
- var ar = attr[j];
- if (ar.Value == '璇烽�鎷� || ar
- .Value == '鈥斺�璇烽�鎷┾�鈥�) ar
- .Value = '';
- if (utils.classUtils.attrTypeIsDict(ar.Type)) {
- if (ar.select ==
- true) { //鍒ゆ柇涓嬫媺鏄惁澶氶�
- var valStr = "";
- for (var v in ar
- .Value) {
- if (valStr)
- valStr += ";";
- valStr += ar.Value[
- v];
- }
- sub_req.push({
- attr: ar
- .Name,
- value: valStr
- });
- } else
- sub_req.push({
- attr: ar.Name,
- value: ar.Value
- });
- } else
- sub_req.push(this.formatAttr(ar));
-
- 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('cancel')
- });
- return;
- }
- }
- }
- objects.push({
- obj_id: subPanelList[s]
- .scanCodeVal,
- obj_attrs: sub_req
- });
- }
- var dataJson = {
- master_cls: {
- cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name,
- obj_attrs: req
- },
- input_3037: $this.$data
- .scanCodeVal, //鎵爜鍐呭
- op_type: $this.$data.param
- .OperationType, //浣滀笟绫诲瀷瀹氫箟
- sub_cls: {
- cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name,
- objects: objects
- }
- };
- // console.log(JSON.stringify(dataJson));
- // var dataInfo = {
- // edtype: "7", eventid: eventID, projectid: '',rclsid: '', robjid: '', userlogin: '',
- // clsid: 'MBOX', objid: '',attr: JSON.stringify([]), extinfo: JSON.stringify([]),
- // global_attr: JSON.stringify($this.$data.global_attr),dataJson:JSON.stringify(dataJson)
- // }
- // console.log(JSON.stringify(dataInfo));
- var dataJson = Base64.encode(JSON
- .stringify(dataJson)
- ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var global_attr = Base64.encode(JSON
- .stringify(this.$data.global_attr)
- ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- if (!eventID.includes('{')) eventID = '{' +
- eventID + '}';
- var dataInfo = {
- ed_type: "7",
- start_transaction: '',
- class_id: 'MBOX',
- class_name: '',
- event_id: eventID,
- event_name: '',
- data_obj_id: '',
- obj_attr: '',
- prj_id: '',
- ref_cls_id: '',
- rel_obj_id: '',
- user_login: '',
- data_json: dataJson,
- compose_info: '',
- ext_info: '',
- global_attr: global_attr,
- input_param: '',
- };
- console.log(dataInfo);
- // return;
- 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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- 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('cancel')
- });
-
- var result = data
- .result;
- if (eventID != $this
- .$data.param
- .After_OK_Event.ID)
- $this
- .scan_OKDataObjRunCustomEvent(
- $this.$data
- .param
- .After_OK_Event
- .ID);
- else {
- //鍒锋柊
- uni.redirectTo({
- url: '../modal/3037?param=' +
- JSON
- .stringify(
- $this
- .$data
- .param
- ) +
- "&titlename=" +
- $this
- .$data
- .title
- });
- }
- }
-
- }).catch(ex => {
- // console.log(ex);
- uni.hideLoading();
- uni.showModal({
- title: this.translateSys('error') + " 8.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ objects.push({
+ obj_id: subPanelList[s]
+ .scanCodeVal,
+ obj_attrs: sub_req
});
- },
+ }
+ var dataJson = {
+ master_cls: {
+ cls_name: 'MBOX', //$this.param.Master_Cls.Name,
+ obj_attrs: req
+ },
+ input_3037: $this.scanCodeVal, //鎵爜鍐呭
+ op_type: $this.param
+ .OperationType, //浣滀笟绫诲瀷瀹氫箟
+ sub_cls: {
+ cls_name: 'MBOX', //$this.param.Sub_Cls.Name,
+ objects: objects
+ }
+ };
+ // console.log(JSON.stringify(dataJson));
+ // var dataInfo = {
+ // edtype: "7", eventid: eventID, projectid: '',rclsid: '', robjid: '', userlogin: '',
+ // clsid: 'MBOX', objid: '',attr: JSON.stringify([]), extinfo: JSON.stringify([]),
+ // global_attr: JSON.stringify($this.global_attr),dataJson:JSON.stringify(dataJson)
+ // }
+ // console.log(JSON.stringify(dataInfo));
+ var dataJson = Base64.encode(JSON
+ .stringify(dataJson)
+ ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var global_attr = Base64.encode(JSON
+ .stringify(this.global_attr)
+ ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ if (!eventID.includes('{')) eventID = '{' +
+ eventID + '}';
+ var dataInfo = {
+ ed_type: "7",
+ start_transaction: '',
+ class_id: 'MBOX',
+ class_name: '',
+ event_id: eventID,
+ event_name: '',
+ data_obj_id: '',
+ obj_attr: '',
+ prj_id: '',
+ ref_cls_id: '',
+ rel_obj_id: '',
+ user_login: '',
+ data_json: dataJson,
+ compose_info: '',
+ ext_info: '',
+ global_attr: global_attr,
+ input_param: '',
+ };
+ console.log(dataInfo);
+ // return;
+ runCustomEvent(dataInfo).then(data => {
+ console.log(data);
+ uni.hideLoading();
+ 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('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
- formatAttr(attr) {
- if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='寮曠敤瀵硅薄(澶氫釜)')
- if (attr.Value == '璇�) ar.Value = '';
- if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr
- .Type)) //if(ar.Type=='寮曠敤浜哄憳' || ar.Type=='寮曠敤椤圭洰')
- return {
- attr: attr.Name,
- value: attr.ValID ? attr.ValID : ''
- };
- else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='甯冨皵鍊�)
- return {
- attr: attr.Name,
- value: attr.Value ? '1' : '0'
- };
- else
- return {
- attr: attr.Name,
- value: attr.Value ? attr.Value : ''
- };
- },
- translate(t) {
- if (typeof this.$t == "function") return this.$t(`page.${t}`)
- else return t;
- },
- translateSys(t) {
- if (typeof this.$t == "function") return this.$t(`sys.${t}`)
- else return t;
- },
- }
+ // var result = data.result;
+ if (eventID != $this.param.After_OK_Event.ID)
+ $this.scan_OKDataObjRunCustomEvent(
+ $this.param
+ .After_OK_Event
+ .ID);
+ else {
+ //鍒锋柊
+ uni.redirectTo({
+ url: '../modal/3037?param=' +
+ JSON
+ .stringify(
+ $this.param
+ ) +
+ "&titlename=" +
+ $this.title
+ });
+ }
+ }
+
+ }).catch(ex => {
+ // console.log(ex);
+ uni.hideLoading();
+ showError(ex, this.translateSys('tip') + "8.1")
+ });
+ },
+
+ formatAttr(attr) {
+ if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='寮曠敤瀵硅薄(澶氫釜)')
+ if (attr.Value == '璇�) ar.Value = '';
+ if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr
+ .Type)) //if(ar.Type=='寮曠敤浜哄憳' || ar.Type=='寮曠敤椤圭洰')
+ return {
+ attr: attr.Name,
+ value: attr.ValID ? attr.ValID : ''
+ };
+ else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='甯冨皵鍊�)
+ return {
+ attr: attr.Name,
+ value: attr.Value ? '1' : '0'
+ };
+ else
+ return {
+ attr: attr.Name,
+ value: attr.Value ? attr.Value : ''
+ };
+ },
+ translate(t) {
+ if (typeof this.$t == "function") return this.$t(`page.${t}`)
+ else return t;
+ },
+ translateSys(t) {
+ if (typeof this.$t == "function") return this.$t(`sys.${t}`)
+ else return t;
+ },
+ }
}
</script>
<style>
@@ -5608,9 +5017,11 @@
margin-top: 50rpx;
padding: 20rpx;
line-height: 1.5;
- background: #27A6E1;
+ /* background: #27A6E1;
border: none;
- color: #fff;
+ color: #fff; */
+ background: #fff;
+ color: #000;
font-size: 38rpx;
font-weight: bold;
float: left;
@@ -5748,7 +5159,7 @@
.popup-footer {
float: right;
position: absolute;
- bottom: 0;
+ bottom: 10rpx;
right: 20rpx;
}
@@ -5772,9 +5183,11 @@
margin-top: 50rpx;
padding: 15rpx;
line-height: 1.5;
- background: #27A6E1;
+ /* background: #27A6E1;
border: none;
- color: #fff;
+ color: #fff; */
+ background: #fff;
+ color: #000;
font-size: 38rpx;
font-weight: bold;
/* float: right; */
--
Gitblit v1.9.1