From 7662665a4f88da0f8afa804bd4a34dfbefc1fb56 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 29 八月 2025 15:17:59 +0800
Subject: [PATCH] get_pre_page_subtable_next_row
---
pages/modal/form/index.vue | 907 +++++++++++++++++++++++---------------------------------
1 files changed, 373 insertions(+), 534 deletions(-)
diff --git a/pages/modal/form/index.vue b/pages/modal/form/index.vue
index bc51570..baa3869 100644
--- a/pages/modal/form/index.vue
+++ b/pages/modal/form/index.vue
@@ -1,8 +1,9 @@
<template>
- <view class="uni-page-modal-form">
+ <view class="uni-page-modal-form" :class="largeMode?'large-mode':''">
<view class="view-content">
<!-- 琛ㄥご鏍峰紡 -->
- <OIForm ref="refBaseForm" class="v-head-style" :form="head_styledef.form" :focusId="focusFieldId"
+ <OIForm ref="refBaseForm" class="v-head-style" :form="head_styledef.form"
+ :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " :focusId="focusFieldId"
@on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton"
@on-click-suffix="classAttr_extButton"></OIForm>
</view>
@@ -43,7 +44,7 @@
<script>
import {
Base64
- } from '@/js/Base64.js';
+ } from '@/js/Base64.js';
import {
dictGetInfo
} from "@/api/mobox.js"
@@ -56,7 +57,10 @@
} from "@/api/data.js"
import dayjs from "dayjs";
import OIForm from '@/components/oi-form/index.vue'
-
+ import {
+ showInfo,
+ showError
+ } from "@/js/Page.js"
export default {
name: "PageModalForm",
components: {
@@ -64,6 +68,7 @@
},
data() {
return {
+ largeMode: getApp().globalData.largeMode || false,
okLoading: false,
title: this.translateSys('add2'),
type: '',
@@ -156,12 +161,8 @@
if (this.clsId) {
this.loadData(objAttr)
} else {
- uni.showModal({
- title: this.translateSys("error"),
- content: this.translate("tip_no_master_class"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("tip_no_master_class"))
+
}
},
//椤甸潰鍒濆鍖栬幏鍙栫劍鐐�@@ -293,6 +294,25 @@
}
}
}
+ const app = getApp()
+ if (app.globalData.bindClasses) {
+ styledefHead.form.items.push({
+ name: "Input",
+ label: this.translate("classes"),
+ labelWidth: 100,
+ disabled: true,
+ value: app.globalData.classes,
+ setting: {
+ width: 100,
+ height: 50,
+ },
+ bind: {
+ attr: "",
+ },
+ fieldId: "S_CLASSES",
+ })
+ styledefHead.form.model["S_CLASSES"] = app.globalData.classes
+ }
}
this.setData({
@@ -302,16 +322,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('tip') + "1",
- content: exStr,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "1")
+
}
@@ -344,12 +356,7 @@
formItem.dict = list;
} catch (ex) {
// console.log(ex);
- uni.showModal({
- title: this.translateSys("error") + "3",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + "3")
}
},
@@ -417,108 +424,85 @@
data_json,
ext_info
})
- if (result.ret != 0) {
- var tip = result.err_info ? typeof result
- .err_info == 'string' ? result
- .err_info : result.err_info.join('<br/>') :
- '';
- if (result.ret == 801) {
- if (this.param.Only_Script_Error) {
- let pos = tip.indexOf("锛�);
- if (pos > -1) tip = tip.substring(pos +
- 1);
- }
- uni.showModal({
- title: this.translateSys(
- "tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys(
- 'close')
- });
- } else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this
- .translateSys('tip') + ':' +
- result
- .ret,
- showCancel: false,
- confirmText: this.translateSys(
- 'close')
- });
- return false;
+ if (result.ret != 0 && result.ret != 1) {
+ let cls_name = result.event_info?.cls_name
+ let event_name = result.event_info?.event_name
+ tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result
+ .err_info
+ .join('\n') : ''
+
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (result.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
+ this.saving = false
+ return false
} else {
- var tip = result.info ? typeof result.info ==
- 'string' ? result.info :
- result.info.join('<br/>') : '';
- if (tip) uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys(
- 'close')
- });
+ var tip = result.info ? typeof result.info == 'string' ? result.info :
+ result.info.join('\n') : '';
+ tip = tip || result.err_info
+ let time = result.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(result.result_type)) {
+ if (result.result_type == 2) {
- if (result.result_type == 0 && result.action) {
- result.action.forEach(item => {
+ } else if (typeof result.result == 'string') {
+ showError(result.result)
- if (item.action_type ==
- "set_dlg_current_edit_attr"
- ) {
+ }
+ try {
+ var actionList = result.action || []
+ actionList.forEach(item => {
- if ($this
- .focusOldFieldId ==
- item.value) {
- $this.setData({
- focusFieldId: ""
- })
- } else {
- $this.setData({
- focusFieldId: $this
- .focusOldFieldId
- })
+ if (item.action_type ==
+ "set_dlg_current_edit_attr"
+ ) {
+
+ if ($this
+ .focusOldFieldId ==
+ item.value) {
+ $this.setData({
+ focusFieldId: ""
+ })
+ } else {
+ $this.setData({
+ focusFieldId: $this
+ .focusOldFieldId
+ })
+ }
+ $this.$nextTick(() => {
+ $this.setData({
+ focusFieldId: item
+ .value
+ })
+ });
+ } else if (item.action_type ==
+ "set_dlg_attr") {
+ // value = {"attr":"xxx", "value":"xxx"}
+ var data = item.value;
+ $this.setFormValues(data)
+ } else if (action.action_type == 'set_dlg_attr_show') {
+ var data = action.value;
+
+ $this.setFormItemVisible(data)
}
- $this.$nextTick(() => {
- $this.setData({
- focusFieldId: item
- .value
- })
- });
- } else if (item.action_type ==
- "set_dlg_attr") {
- // value = {"attr":"xxx", "value":"xxx"}
- var data = item.value;
- $this.setFormValues(data)
- }
- });
- } else {
-
- if (result.info) {
- uni.showModal({
- title: this.translateSys(
- "error") + "4.3",
- content: result.info,
- showCancel: false,
- confirmText: this
- .translateSys('close')
});
+
+ } catch (ex) {
+ let actionList = (result.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ return
}
}
-
}
}
} catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: $this.translateSys('tip') + "2",
- content: exStr,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "2")
}
},
onClick(item) {
@@ -529,8 +513,8 @@
//console.log(e.target)
this.focusOldFieldId = item.fieldId
getApp().onScan((result) => {
- console.log(result.decodedata);
- item.value = result.decodedata;
+ console.log(result);
+ item.value = result;
var $this = this;
let newVal = item.value.trim()
if (newVal) {
@@ -645,21 +629,13 @@
var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�
if (!onSuffixClickCallbackEvent.id) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate('icon_click_callback_empty'),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate('icon_click_callback_empty'))
+
return;
}
if (!onSuffixClickEvent.id) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate('icon_click_event_empty'),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate('icon_click_event_empty'))
+
return;
}
this.popupType = 'right'
@@ -721,92 +697,81 @@
};
runCustomEvent(dataInfo).then(result => {
console.log(result);
+ if (result.ret != 0 && result.ret != 1) {
+ let cls_name = result.event_info?.cls_name
+ let event_name = result.event_info?.event_name
+ tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info :
+ result.err_info
+ .join('\n') : ''
- if (result.ret != 0) {
- var tip = result.err_info ? typeof result
- .err_info == 'string' ? result
- .err_info : result.err_info.join('<br/>') :
- '';
- if (result.ret == 801) {
- if (this.param.Only_Script_Error) {
- let pos = tip.indexOf("锛�);
- if (pos > -1) tip = tip.substring(pos +
- 1);
- }
- uni.showModal({
- title: this.translateSys(
- "tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys(
- 'close')
- });
- } else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this
- .translateSys('tip') + ':' +
- result
- .ret,
- showCancel: false,
- confirmText: this.translateSys(
- 'close')
- });
- return false;
+ if (cls_name && event_name) tip =
+ `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (result.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
+ this.saving = false
+ return false
} else {
- var tip = result.info ? typeof result.info ==
- 'string' ? result.info :
- result.info.join('<br/>') : '';
- if (tip) uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys(
- 'close')
- });
+ var tip = result.info ? typeof result.info == 'string' ? result.info :
+ result.info.join('\n') : '';
+ tip = tip || result.err_info
+ let time = result.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(result.result_type)) {
+ if (result.result_type == 2) {
- if (result.result_type == 0 && result.action) {
- result.action.forEach(item => {
+ } else if (typeof result.result == 'string') {
+ showInfo(result.result)
- if (item.action_type ==
- "set_dlg_current_edit_attr"
- ) {
+ }
+ try {
+ var actionList = result.action || []
+ actionList.forEach(item => {
- if ($this
- .focusOldFieldId ==
- item.value) {
- $this.setData({
- focusFieldId: ""
- })
- } else {
- $this.setData({
- focusFieldId: $this
- .focusOldFieldId
- })
+ if (item.action_type ==
+ "set_dlg_current_edit_attr"
+ ) {
+
+ if ($this
+ .focusOldFieldId ==
+ item.value) {
+ $this.setData({
+ focusFieldId: ""
+ })
+ } else {
+ $this.setData({
+ focusFieldId: $this
+ .focusOldFieldId
+ })
+ }
+ $this.$nextTick(() => {
+ $this.setData({
+ focusFieldId: item
+ .value
+ })
+ });
+ } else if (item.action_type ==
+ "set_dlg_attr") {
+ // value = {"attr":"xxx", "value":"xxx"}
+ var data = item.value;
+ $this.setFormValues(data)
+ } else if (action.action_type ==
+ 'set_dlg_attr_show') {
+ var data = action.value;
+
+ $this.setFormItemVisible(data)
}
- $this.$nextTick(() => {
- $this.setData({
- focusFieldId: item
- .value
- })
- });
- } else if (item.action_type ==
- "set_dlg_attr") {
- // value = {"attr":"xxx", "value":"xxx"}
- var data = item.value;
- $this.setFormValues(data)
- }
- });
- } else {
-
- if (result.info) {
- uni.showModal({
- title: this.translateSys(
- "error") + "4.3",
- content: result.info,
- showCancel: false,
- confirmText: this
- .translateSys('close')
});
+
+ } catch (ex) {
+ let actionList = (result.action || []).map(a => a.action_type)
+ .join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ return
}
}
@@ -814,36 +779,19 @@
}).catch(ex => {
// console.log(ex);
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
- uni.showModal({
- title: this.translateSys("error") + "4.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + "4.1")
});
}
} catch (ex) {
- var tip = typeof ex == "string" ? ex : ex.message;
- uni.showModal({
- title: this.translateSys("error") + "4.2",
- content: this.translate(
- 'execute_after_change_event_failed') + this
- .translateSys(
- "comma") +
- this.translate('reason') + this.translateSys("colon") +
- tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "4.2")
}
},
setFormValues(attrs) {
console.log(attrs)
const head_styledef = this.head_styledef
- if (JSON.stringify(attrs) == '{}') {
- return;
+ if (!Array.isArray(attrs)) {
+ return
}
attrs.forEach(async (attr, key) => {
if (attr.choice_list) {
@@ -870,7 +818,8 @@
if (col.useDict) {
col.dict = dictItemList;
} else {
- col.selections = dictItemList;
+ col.selections =
+ dictItemList;
}
}
}
@@ -900,11 +849,32 @@
//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹� })
- console.log(head_styledef)
this.setData({
head_styledef: head_styledef
})
},
+ setFormItemVisible(attrs) {
+ if (!Array.isArray(attrs)) {
+ return
+ }
+ const head_styledef = this.head_styledef
+ if (!head_styledef.hiddenIds) {
+ head_styledef.hiddenIds = []
+ }
+ attrs.forEach((attr) => {
+ let index = head_styledef.hiddenIds.findIndex((id) => id == attr.attr);
+ if (attr.show) {
+ if (index > -1) head_styledef.hiddenIds.splice(index, 1);
+ } else {
+ if (index == -1) head_styledef.hiddenIds.push(attr.attr);
+ }
+ });
+ this.setData({
+ head_styledef: head_styledef
+ })
+
+ },
+
popupChange(e) {
console.log('褰撳墠妯″紡锛� + e.type + ',鐘舵�锛� + e.show);
},
@@ -943,21 +913,13 @@
}
}
if (!$this.popupParam) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: "popupParam涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("popupParam涓虹┖锛�)
+
return;
}
if (data.length == 0) {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translate("tip_no_select_data"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(this.translate("tip_no_select_data"))
+
return;
}
let global_attr = Base64.encode(JSON.stringify(this.global_attr))
@@ -1041,125 +1003,75 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
- if (data.ret != 0) {
- var tip = data.err_info ? typeof data.err_info == 'string' ? data
- .err_info :
- data
- .err_info.join('<br/>') : '';
- if (data.ret == 801) {
- if (this.param.Only_Script_Error) {
- let pos = tip.indexOf("锛�);
- if (pos > -1) tip = tip.substring(pos + 1);
- }
- uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- } else uni.showModal({
- title: this.translateSys("tip"),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (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 (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ? typeof data.info == 'string' ? data.info : data
- .info
- .join(
- '<br/>') : '';
- if (tip) uni.showModal({
- title: this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
+ $this.setFormValues(data.result || [])
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
- 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;
- $this.setFormValues(result)
- } else if (action.action_type == 'set_dlg_attr_show') {
- var result = action.value;
- result.forEach(async (attr, key) => {
- $this.head_styledef.form.items
- .forEach(
- async (ele,
- index) => {
- //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (ele.name != 'Layout') {
- if (ele.fieldId == attr
- .attr) {
- ele.show = attr
- .show;
- }
- } else if (ele.name ==
- 'Layout') {
- ele.setting.colList
- .forEach(
- col => {
- if (col) {
- if (col
- .fieldId ==
- attr
- .attr
- ) {
- col.show =
- attr
- .show;
- }
- }
- });
- }
- });
- });
- var head_styledef = JSON.parse(JSON.stringify($this.$data
- .head_styledef));
- $this.head_styledef = [];
- $this.head_styledef = head_styledef;
- // console.log($this.head_styledef);
- } else if (action.action_type == 'set_global_attr') {
- $this.global_attr = action.value || [];
- } else {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + this.translateSys(
- "quotation_mark_right") + this
- .translate(
- "tip_action_unprocessed"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ }
+ try {
+ var actionlist = data.action || []
+ for (var i = 0; i < actionlist.length; i++) {
+ var action = actionlist[i];
+ if (action.action_type == 'set_dlg_attr') {
+ var result = action.value;
+ $this.setFormValues(result)
+ } else if (action.action_type == 'set_dlg_attr_show') {
+ var result = action.value;
+
+ $this.setFormItemVisible(result)
+ } else if (action.action_type == 'set_global_attr') {
+ $this.global_attr = action.value || [];
+ } else {
+ uni.showModal({
+ title: this.translateSys("tip"),
+ content: this.translateSys(
+ "quotation_mark_left") +
+ action
+ .action_type + this.translateSys(
+ "quotation_mark_right") + this
+ .translate(
+ "tip_action_unprocessed")
+ });
+ }
}
+
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ return
}
}
- console.log($this.head_styledef);
- if (data.result) {
- $this.setFormValues(data.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") + "3.1",
- content: exStr,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + "3.1")
});
},
dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) {
@@ -1220,45 +1132,36 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
- if (data.ret != 0) {
- var tip = data.err_info ? typeof data.err_info == 'string' ? data
- .err_info :
- data
- .err_info.join('<br/>') : '';
- if (data.ret == 801) {
- if ($this.param.Only_Script_Error) {
- let pos = tip.indexOf("锛�);
- if (pos > -1) tip = tip.substring(pos + 1);
- }
- uni.showModal({
- title: $this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
- } else uni.showModal({
- title: $this.translateSys("tip"),
- content: tip + ',' + $this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ if (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 (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ? typeof data.info == 'string' ? data.info : data
- .info
- .join(
- '<br/>') : '';
- if (tip) uni.showModal({
- title: $this.translateSys("tip"),
- content: tip,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
- if (data != "") {
- var actions = data.action;
- if (actions) {
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
+ try {
+ var actions = data.action || []
for (var i = 0; i < actions.length; i++) {
var action = actions[i];
console.log(action)
@@ -1337,7 +1240,8 @@
$this.setData({
check_list: val.config
})
- if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ if (val.config.appear_style ==
+ 'sideslip') //鍒ゆ柇鏄惁鏄晶婊� $this.setData({
popupType: "right"
})
@@ -1357,7 +1261,8 @@
popupParam: popupParam
})
}
- } else if (action.action_type == 'open_project_query_dlg') {
+ } else if (action.action_type ==
+ 'open_project_query_dlg') {
//console.log(action.value.select_range);
//console.log(action.value.mulit_select);
var priRel = '-1';
@@ -1418,45 +1323,30 @@
}
});
} else {
- uni.showModal({
- title: $this.translateSys("tip"),
- content: $this.translateSys(
- "quotation_mark_left") +
- action.action_type + $this.translateSys(
- "quotation_mark_right") + $this
- .translate(
- "tip_action_unprocessed"),
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ showInfo($this.translateSys(
+ "quotation_mark_left") +
+ action.action_type + $this
+ .translateSys(
+ "quotation_mark_right") + $this
+ .translate(
+ "tip_action_unprocessed"))
+
}
}
+
+ } catch (ex) {
+ let actionList = (data.action || []).map(a => a.action_type).join(';')
+ let tip = typeof ex == 'string' ? ex : ex.message
+ tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+ showError(tip, this.translateSys('tip'))
+ return
}
- } else {
- uni.showModal({
- title: $this.translateSys('tip') + "5.2",
- content: $this.translateSys("quotation_mark_left") +
- "before_click_button" + $this.translateSys(
- "quotation_mark_right") + $this.translateSys(
- "comma") + 'event_id' + eventid,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
}
}
}).catch(ex => {
- // console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: $this.translateSys('tip') + "5.1",
- content: exStr,
- showCancel: false,
- confirmText: $this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "5.1")
+
});
},
//纭畾
@@ -1484,6 +1374,7 @@
uni.navigateBack()
} catch (ex) {
this.okLoading = true
+ showError(ex, this.translateSys('tip') + "1")
return false;
}
},
@@ -1520,7 +1411,7 @@
return true;
} catch (ex) {
console.log("sava", ex)
- this.showError(ex)
+ showError(ex, this.translateSys('tip'))
return false;
}
@@ -1566,16 +1457,7 @@
await runCustomEvent(dataInfo)
return true
} catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys('tip') + "7.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "7.1")
return false
}
@@ -1593,16 +1475,7 @@
await dataObjCreate(dataInfo)
return true
} catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("tip") + "6.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "6.1")
return false
}
@@ -1620,16 +1493,7 @@
return true
} catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("tip") + "6.2",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "6.2")
return false
}
@@ -1646,8 +1510,10 @@
value: obj_attr[a],
})),
};
- let global_attr = Base64.encode(JSON.stringify(this.global_attr))
- let data_json = Base64.encode(JSON.stringify(this.data_json))
+ let global_attr = Base64.encode(JSON.stringify(this
+ .global_attr))
+ let data_json = Base64.encode(JSON.stringify(this
+ .data_json))
let ext_info = Base64.encode(JSON.stringify(this.ext_info))
var dataInfo = {
ed_type: "0",
@@ -1666,21 +1532,13 @@
data_json,
ext_info,
compose_info: '',
- input_param: Base64.encode(JSON.stringify(input_param)),
+ input_param: Base64.encode(JSON.stringify(
+ input_param)),
};
await runCustomEvent(dataInfo)
return true
} catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys('tip') + "7.2",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "7.2")
return false
}
@@ -1704,59 +1562,15 @@
delta: 1 //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
});
await this.afterCancel();
- } catch (ex) {}
+ } catch (ex) {
+ showError(ex, this.translateSys('tip'))
+ }
},
async beforeCancel() {
try {
if (!this.beforeCancelEvent.id) return true;
var obj_attr = this.head_styledef.form.model;
- let inputParam = {
- id: "",
- attrs: Object.keys(obj_attr).map((a) => ({
- attr: a,
- value: obj_attr[a],
- })),
- };
- let input_param = Base64.encode(JSON.stringify(
- inputParam));
- let global_attr = Base64.encode(JSON.stringify(this
- .global_attr))
- let data_json = Base64.encode(JSON.stringify(this
- .data_json))
- let ext_info = Base64.encode(JSON.stringify(this.ext_info))
-
- await runCustomEvent({
- ed_type: 0,
- start_transaction: true,
- class_id: this.clsId,
- event_id: this.beforeCancelEvent.id,
- data_obj_id: this.objId,
- obj_attr,
- input_param,
- global_attr,
- data_json,
- ext_info,
- })
- return true
- } catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("tip") + "8.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- return false
- }
- },
- async afterCancel() {
- try {
- if (!this.afterCancelEvent.id) return true;
- var obj_attr = this.head_styledef.form.model;
let inputParam = {
id: "",
attrs: Object.keys(obj_attr).map((a) => ({
@@ -1777,6 +1591,48 @@
ed_type: 0,
start_transaction: true,
class_id: this.clsId,
+ event_id: this.beforeCancelEvent.id,
+ data_obj_id: this.objId,
+ obj_attr,
+ input_param,
+ global_attr,
+ data_json,
+ ext_info,
+ })
+ return true
+ } catch (ex) {
+ showError(ex, this.translateSys('tip') + "8.1")
+ return false
+ }
+ },
+ async afterCancel() {
+ try {
+ if (!this.afterCancelEvent.id) return true;
+ var obj_attr = this.head_styledef.form.model;
+ let inputParam = {
+ id: "",
+ attrs: Object.keys(obj_attr).map((a) =>
+ ({
+ attr: a,
+ value: obj_attr[a],
+ })),
+ };
+ let input_param = Base64.encode(JSON.stringify(
+ inputParam));
+ let global_attr = Base64.encode(JSON.stringify(
+ this
+ .global_attr))
+ let data_json = Base64.encode(JSON.stringify(
+ this
+ .data_json))
+ let ext_info = Base64.encode(JSON.stringify(
+ this
+ .ext_info))
+
+ await runCustomEvent({
+ ed_type: 0,
+ start_transaction: true,
+ class_id: this.clsId,
event_id: this.afterCancelEvent.id,
data_obj_id: this.objId,
obj_attr,
@@ -1787,28 +1643,11 @@
})
return true
} catch (ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg :
- exStr
- uni.showModal({
- title: this.translateSys("tip") + "8.2",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "8.2")
return false
}
},
- showError(ex) {
- uni.showModal({
- title: this.translateSys('error'),
- content: typeof ex == "string" ? ex : typeof ex.errMsg == "string" ? ex.errMsg : "",
- showCancel: false,
- confirmText: this.translateSys('cancel')
- })
- },
+
translate(t) {
if (typeof this.$t == "function") return this.$t(
`page.${t}`)
@@ -1838,7 +1677,7 @@
flex-direction: column;
}
-
+
.view-content {
display: flex;
flex: 1;
--
Gitblit v1.9.1