vue2-client 1.15.29 → 1.15.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.15.29",
3
+ "version": "1.15.31",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -68,7 +68,7 @@ export default {
68
68
  },
69
69
  mounted () {
70
70
  this.activeKey = this.defaultActiveKey
71
- this.tabPaneChange('workFlowTab')
71
+ this.tabPaneChange('initTabLoading')
72
72
  },
73
73
  methods: {
74
74
  // 自定义函数中调用的方法 这个不能删
@@ -82,9 +82,9 @@ export default {
82
82
  getConfigByNameAsync,
83
83
  tabPaneChange (newKey) {
84
84
  let result = {}
85
- // if (this.activeKey === newKey) {
86
- // return
87
- // }
85
+ if (this.activeKey === newKey) {
86
+ return
87
+ }
88
88
  const oldKey = this.activeKey
89
89
  if (this.config.changeFunc) {
90
90
  let oldRef
@@ -1059,6 +1059,10 @@ export default {
1059
1059
  const stepDefine = this.targetStepDefine[i]
1060
1060
  const key = this.getRealKey(stepDefine.model, isKeyHandle)
1061
1061
  if (Object.prototype.hasOwnProperty.call(dataObj, key)) {
1062
+ // 历史表单内容根据流程中配置的表单项顺序进行渲染,需要兼容表单项展示函数
1063
+ if (stepDefine.showFormItemFunc && !(await this.showFormItemFunc(stepDefine.showFormItemFunc, dataObj))) {
1064
+ continue
1065
+ }
1062
1066
  let value = dataObj[key]
1063
1067
  // 字典值处理
1064
1068
  if (stepDefine.formType === 'select' && stepDefine.selectType === 'key') {
@@ -1361,6 +1365,26 @@ export default {
1361
1365
  this.$message.error('执行操作失败')
1362
1366
  }
1363
1367
  },
1368
+ // 表单项展示函数--用来渲染历史节点数据时和填写表单显示内容同步
1369
+ async showFormItemFunc (func, form) {
1370
+ try {
1371
+ if (func) {
1372
+ // 一般展示项函数中不应该存在setForm函数 先屏蔽this.setForm和this.attr的传递还有在this上下文指向不同可能存在异常 流程表单的展示项函数尽量功能单一。有异常默认进行展示(先兼容到这后续有问题进行调整)
1373
+ const obj = executeStrFunctionByContext(this, func, [form, null, null, util, '新增/修改'])
1374
+ // 判断是 bool 还是 obj 兼容
1375
+ if (typeof obj === 'boolean') {
1376
+ return obj
1377
+ } else if (obj && typeof obj === 'object') {
1378
+ // obj 是一个对象,并且不是数组
1379
+ return obj?.show
1380
+ }
1381
+ } else {
1382
+ return true
1383
+ }
1384
+ } catch (e) {
1385
+ return true
1386
+ }
1387
+ },
1364
1388
  // 检查按钮是否显示
1365
1389
  checkButtonVisible (button) {
1366
1390
  try {
@@ -19,6 +19,7 @@ export default {
19
19
  return {
20
20
  selectAddressVisible: false,
21
21
  addAddressFlag: false,
22
+ confirmLoading: false,
22
23
  form: {
23
24
  f_address_type: '',
24
25
  f_residential_area_id: '',
@@ -120,25 +121,36 @@ export default {
120
121
  this.$message.warning('请选择小区')
121
122
  return
122
123
  }
123
- this.deleteAddressData()
124
- runLogic('addAddress', Object.assign({}, this.form, {
125
- f_address: this.generateAddressString()
126
- }, {
127
- orgid: this.currUser.orgid,
128
- f_orgid: this.currUser.orgid,
129
- f_orgname: this.currUser.orgs,
130
- f_depid: this.currUser.depids,
131
- f_depname: this.currUser.deps,
132
- f_operatorid: this.currUser.id,
133
- f_operator: this.currUser.name,
134
- f_filialeid: this.currUser.orgid
135
- }), 'af-revenue').then(res => {
136
- if (res) {
137
- this.$message.success(`${this.addAddressMsg}成功`)
124
+ this.confirmLoading = true
125
+ try {
126
+ this.deleteAddressData()
127
+ runLogic('addAddress', Object.assign({}, this.form, {
128
+ f_address: this.generateAddressString()
129
+ }, {
130
+ orgid: this.currUser.orgid,
131
+ f_orgid: this.currUser.orgid,
132
+ f_orgname: this.currUser.orgs,
133
+ f_depid: this.currUser.depids,
134
+ f_depname: this.currUser.deps,
135
+ f_operatorid: this.currUser.id,
136
+ f_operator: this.currUser.name,
137
+ f_filialeid: this.currUser.orgid
138
+ }), 'af-revenue').then(res => {
139
+ if (res) {
140
+ this.$message.success(`${this.addAddressMsg}成功`)
141
+ }
142
+ }).catch(() => {
143
+ this.$message.error('添加地址失败')
144
+ }).finally(() => {
145
+ this.confirmLoading = false
138
146
  this.addAddressFlag = false
139
147
  this.$refs.selAddressXFormTable.refreshTable(true)
140
- }
141
- })
148
+ })
149
+ } catch (error) {
150
+ this.$message.error('添加地址失败')
151
+ this.confirmLoading = false
152
+ this.addAddressFlag = false
153
+ }
142
154
  },
143
155
  // 删除 addressData 中存在 addressModel 不存在的字段
144
156
  deleteAddressData () {
@@ -215,6 +227,8 @@ export default {
215
227
  :dialog-style="{ top: '30px' }"
216
228
  :z-index="1005"
217
229
  @ok="addressSubmit"
230
+ :ok-button-props="{ loading: confirmLoading }"
231
+ :confirm-loading="confirmLoading"
218
232
  @cancel="addAddressFlag = false"
219
233
  title="新增地址信息"
220
234
  :destroyOnClose="true">