apply-clients 4.1.26-weinan → 4.1.28-weinan

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": "apply-clients",
3
- "version": "4.1.26-weinan",
3
+ "version": "4.1.28-weinan",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -299,6 +299,7 @@ export default {
299
299
  resolveMsg: null,
300
300
  rejectMsg: '表具添加失败!!!'
301
301
  })
302
+ this.showUserFile = false
302
303
  this.$dispatch('breakControl', this.selectdata)
303
304
  },
304
305
  // 检查表号是否存在
@@ -124,7 +124,9 @@
124
124
  }
125
125
  }
126
126
  }
127
-
127
+ if (this.data.fields[i].ready) {
128
+ this.data.fields[i].options = await this[this.data.fields[i].ready]()
129
+ }
128
130
  }
129
131
  }
130
132
  // 初始化 buttons_fields
@@ -235,24 +237,44 @@
235
237
  }
236
238
  })
237
239
  },
240
+ getLableValue(label) {
241
+ for (const item of this.show_data.fields) {
242
+ if (item.label === label && item.type !== 'number') {
243
+ return item.value || ''
244
+ }
245
+ if (item.label === label && item.type === 'number') {
246
+ return item.value || 0
247
+ }
248
+ }
249
+ },
250
+ setLabelValue(label, value) {
251
+ for (const item of this.show_data.fields) {
252
+ if (item.label === label) {
253
+ item.value = value
254
+ }
255
+ }
256
+ },
238
257
  },
239
258
  events: {
240
259
  // 选择气价
241
260
  'priceChange'(index) {
242
- if (isEmpty(this.show_data.f_stair_price_name)) {
261
+ /* if (isEmpty(this.show_data.f_stair_price_name)) {
243
262
  return
244
- }
245
-
263
+ }*/
246
264
  let stairPrice = this.getLableValue('气价名称')
247
265
  console.log("气价信息", stairPrice)
248
266
  this.setLabelValue('气价类型', stairPrice.f_price_type)
249
267
  this.setLabelValue('用气性质', stairPrice.f_gasproperties)
250
268
  this.setLabelValue('气价', stairPrice.f_price)
269
+
270
+
251
271
  this.selectdata.f_price_id = stairPrice.f_price_id
252
272
  this.selectdata.f_price_name = stairPrice.f_price_name
273
+ this.$refs.service_show.update()
253
274
  },
254
275
  // 任意select选中时触发事件
255
276
  'select_cascade'(index){
277
+ console.log("sihoennoojooinoi",this.selectdata.f_stair_price_name,this.$refs.service_show.data)
256
278
  // this.$refs.service_show.model_temp // 子业务显示组件
257
279
  // 级联操作示例:
258
280
  /*
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="auto select-overspread">
2
+ <div class="auto select-overspread" v-if="refresh">
3
3
  <div v-if="data.back_reason" class="panel panel-info">
4
4
  <span style="color: red"> 请注意被退回原因为:{{data.back_reason}}</span>
5
5
  </div>
@@ -201,7 +201,8 @@
201
201
  },
202
202
  data:null,
203
203
  showmodal:false,
204
- disable_button:true
204
+ disable_button:true,
205
+ refresh: true // 控制重新渲染
205
206
  }
206
207
  },
207
208
  created(){
@@ -322,6 +323,9 @@
322
323
  // 级联操作预留
323
324
  select_change(index){
324
325
  this.disableButton()
326
+ if (this.data.fields[index].onchange) {
327
+ this.$dispatch(this.data.fields[index].onchange, index)
328
+ }
325
329
  this.$dispatch('select_cascade',index)
326
330
  },
327
331
  // 检测按钮的disable
@@ -338,6 +342,14 @@
338
342
  }
339
343
  this.disable_button = flag
340
344
  }
345
+ },
346
+ // 强制刷新
347
+ update (){
348
+ this.refresh = false
349
+ this.$nextTick(() => {
350
+ this.refresh = true
351
+ })
352
+ this.initializtion()
341
353
  }
342
354
  },
343
355
  watch:{
@@ -1,194 +1,200 @@
1
- <template>
2
- <div class="auto clearfix">
3
- <show-back-reason :selectdata="data"></show-back-reason>
4
- </div>
5
- <service-view v-ref:service_show :data="data" v-if="showview"></service-view>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- // Date格式化
11
- Date.prototype.Format = function (fmt) {
12
- var o = {
13
- 'M+': this.getMonth() + 1, // 月份
14
- 'd+': this.getDate(), // 日
15
- 'H+': this.getHours(), // 小时
16
- 'm+': this.getMinutes(), // 分
17
- 's+': this.getSeconds(), // 秒
18
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
19
- 'S': this.getMilliseconds() // 毫秒
20
- }
21
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
22
- for (var k in o) {
23
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
24
- }
25
- return fmt
26
- }
27
- export default {
28
- title: '报建监控控制层',
29
- props: {
30
- selectdata: {
31
- type: Object
32
- },
33
- nodeSnapshot: {
34
- type: Boolean,
35
- default: false
36
- }
37
- },
38
- data() {
39
- return {
40
- data: null, // 展示的数据
41
- json_datas: null, // json配置数据结构
42
- showview: false // 控制显示层显示
43
- }
44
- },
45
- created () {
46
- this.initial()
47
- },
48
- methods: {
49
- // 初始化模块
50
- async initial() {
51
- this.showview = false
52
- this.json_datas = this.$workflow_vue
53
- let sum = 0
54
- let jsonData = {}
55
- this.json_datas.activitys.forEach(item => {
56
- if (this.selectdata.defname === item.title) {
57
- jsonData = item
58
- sum++
59
- }
60
- })
61
- if (sum === 0) {
62
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
63
- return
64
- }
65
- if (sum === 1) {
66
- this.data = jsonData
67
- this.data = Object.assign({}, this.data, this.selectdata)
68
-
69
- await this.initializtion()
70
- this.showview = true
71
- return
72
- }
73
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
74
- },
75
- // json配置数据处理
76
- async initializtion() {
77
- this.data.fields.forEach(item => {
78
- if (this.selectdata[item.field]) {
79
- item.value = this.selectdata[item.field]
80
- }
81
- // 如果配置类型为select,获取options
82
- if(item.type==='select'){
83
- item.options=[]
84
- }
85
- if (typeof item.value === 'string' && item.value.startsWith("{") && item.value.endsWith("}")) {
86
- item.value = JSON.parse(item.value)
87
- }
88
- })
89
-
90
- // 控制组件
91
- if (this.data.components) {
92
- this.data.components.forEach(item => {
93
- item.mark = 1
94
- })
95
- }
96
-
97
-
98
- // onetomany 数据获取
99
- if (this.data.onetomany) {
100
- for (let index = 0; index < this.data.onetomany.length; index++) {
101
- let http = new HttpResetClass()
102
- let data = {
103
- tablename: this.data.onetomany[index].tables[0],
104
- condition: `f_process_id='${this.selectdata.f_process_id}'`
105
- }
106
-
107
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
108
- resolveMsg: null,
109
- rejectMsg: 'onetomany查询失败'
110
- })
111
-
112
- // 初始化 onetomany
113
- this.data.onetomany[index].rows = res.data
114
-
115
- // 初始化onetomany中的fields
116
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
117
- // 如果配置类型为select,优先从参数列表获取options
118
- if (this.data.onetomany[index].fields[j].type === 'select') {
119
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
120
- if (temp && temp.length > 0) {
121
- this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
122
- }
123
- }
124
- }
125
- }
126
- }
127
- // 去除button
128
- this.data.buttons = null
129
-
130
-
131
- // 查询是否有当前节点快照信息,如果有使用快照数据,没有则展示最新数据
132
- if (this.nodeSnapshot && this.data.nodeSnapshot) {
133
- let http = new HttpResetClass()
134
- let data = {
135
- tablename: 't_node_snapshot',
136
- condition: `actid = '${this.selectdata.actid}' and f_process_id='${this.selectdata.f_process_id}'`
137
- }
138
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
139
- resolveMsg: null,
140
- rejectMsg: null
141
- })
142
- if (res.data.length > 0) {
143
- data = JSON.parse(res.data[0].f_node_data)
144
-
145
- this.data.fields = data.fields
146
- this.data.onetomany = data.onetomany
147
- this.data.title = data.title
148
- }
149
- }
150
-
151
-
152
- // 将所有field都不可修改,不可操作
153
- this.data.fields.forEach(item => {
154
- item.readonly = true
155
- item.disabled = true
156
- })
157
- // 去除所有onetomany的操作
158
- if (this.data.onetomany) {
159
- this.data.onetomany.forEach(item => {
160
- item.hiddenOperate = true
161
- })
162
- }
163
-
164
- // 完成时间和完成人,部门,分公司
165
- if (this.selectdata.state === '结束') {
166
- let http = new HttpResetClass()
167
- let res = await http.load('POST', 'rs/search', {
168
- source: 'this.getInfo()',
169
- userid: this.selectdata.userid
170
- }, {resolveMsg: null, rejectMsg: null})
171
- let user = res.data
172
- this.data.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
173
- this.data.operator = this.selectdata.person
174
- this.data.f_filiale = user.orgs
175
- this.data.f_parentname = user.deps
176
- }
177
- }
178
- },
179
- events:{
180
- },
181
- watch: {
182
- deep: true
183
- }
184
- }
185
- </script>
186
- <style scoped>
187
- /*清除model中的浮动*/
188
- .clearfix:after,.clearfix:before{
189
- display: table;
190
- }
191
- .clearfix:after{
192
- clear: both;
193
- }
194
- </style>
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="data"></show-back-reason>
4
+ </div>
5
+ <service-view v-ref:service_show :data="data" v-if="showview"></service-view>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ // Date格式化
11
+ Date.prototype.Format = function (fmt) {
12
+ var o = {
13
+ 'M+': this.getMonth() + 1, // 月份
14
+ 'd+': this.getDate(), // 日
15
+ 'H+': this.getHours(), // 小时
16
+ 'm+': this.getMinutes(), // 分
17
+ 's+': this.getSeconds(), // 秒
18
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
19
+ 'S': this.getMilliseconds() // 毫秒
20
+ }
21
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
22
+ for (var k in o) {
23
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
24
+ }
25
+ return fmt
26
+ }
27
+ export default {
28
+ title: '报建监控控制层',
29
+ props: {
30
+ selectdata: {
31
+ type: Object
32
+ },
33
+ nodeSnapshot: {
34
+ type: Boolean,
35
+ default: false
36
+ }
37
+ },
38
+ data() {
39
+ return {
40
+ data: null, // 展示的数据
41
+ json_datas: null, // json配置数据结构
42
+ showview: false // 控制显示层显示
43
+ }
44
+ },
45
+ created () {
46
+ this.initial()
47
+ },
48
+ methods: {
49
+ // 初始化模块
50
+ async initial() {
51
+ this.showview = false
52
+ this.json_datas = this.$workflow_vue
53
+ let sum = 0
54
+ let jsonData = {}
55
+ this.json_datas.activitys.forEach(item => {
56
+ if (this.selectdata.defname === item.title) {
57
+ jsonData = item
58
+ sum++
59
+ }
60
+ })
61
+ if (sum === 0) {
62
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
63
+ return
64
+ }
65
+ if (sum === 1) {
66
+ this.data = jsonData
67
+ this.data = Object.assign({}, this.data, this.selectdata)
68
+
69
+ await this.initializtion()
70
+ this.showview = true
71
+ return
72
+ }
73
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
74
+ },
75
+ // json配置数据处理
76
+ async initializtion() {
77
+ this.data.fields.forEach(item => {
78
+ if (this.selectdata[item.field]) {
79
+ item.value = this.selectdata[item.field]
80
+ }
81
+ // 如果配置类型为select,获取options
82
+ if(item.type==='select'){
83
+ item.options=[]
84
+ }
85
+ if (typeof item.value === 'string' && item.value.startsWith("{") && item.value.endsWith("}")) {
86
+ item.value = JSON.parse(item.value)
87
+ }
88
+ })
89
+
90
+ // 控制组件
91
+ if (this.data.components) {
92
+ this.data.components.forEach(item => {
93
+ item.mark = 1
94
+ })
95
+ }
96
+
97
+
98
+ // onetomany 数据获取
99
+ if (this.data.onetomany) {
100
+ for (let index = 0; index < this.data.onetomany.length; index++) {
101
+ let http = new HttpResetClass()
102
+ let data = {
103
+ tablename: this.data.onetomany[index].tables[0],
104
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
105
+ }
106
+
107
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
108
+ resolveMsg: null,
109
+ rejectMsg: 'onetomany查询失败'
110
+ })
111
+
112
+ // 初始化 onetomany
113
+ this.data.onetomany[index].rows = res.data
114
+
115
+ // 初始化onetomany中的fields
116
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
117
+ // 如果配置类型为select,优先从参数列表获取options
118
+ if (this.data.onetomany[index].fields[j].type === 'select') {
119
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
120
+ if (temp && temp.length > 0) {
121
+ this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ // 去除button
128
+ this.data.buttons = null
129
+
130
+
131
+ // 查询是否有当前节点快照信息,如果有使用快照数据,没有则展示最新数据
132
+ if (this.nodeSnapshot && this.data.nodeSnapshot) {
133
+ let http = new HttpResetClass()
134
+ let data = {
135
+ tablename: 't_node_snapshot',
136
+ condition: `actid = '${this.selectdata.actid}' and f_process_id='${this.selectdata.f_process_id}'`
137
+ }
138
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
139
+ resolveMsg: null,
140
+ rejectMsg: null
141
+ })
142
+ if (res.data.length > 0) {
143
+ data = JSON.parse(res.data[0].f_node_data)
144
+
145
+ this.data.fields = data.fields
146
+ this.data.onetomany = data.onetomany
147
+ this.data.title = data.title
148
+ }
149
+ }
150
+
151
+
152
+ // 将所有field都不可修改,不可操作
153
+ this.data.fields.forEach(item => {
154
+ item.readonly = true
155
+ item.disabled = true
156
+ })
157
+ // 去除所有onetomany的操作
158
+ if (this.data.onetomany) {
159
+ this.data.onetomany.forEach(item => {
160
+ item.hiddenOperate = true
161
+ })
162
+ }
163
+
164
+ // 完成时间和完成人,部门,分公司
165
+ if (this.selectdata.state === '结束') {
166
+ let http = new HttpResetClass()
167
+ let res = await http.load('POST', 'rs/search', {
168
+ source: 'this.getInfo()',
169
+ userid: this.selectdata.userid
170
+ }, {resolveMsg: null, rejectMsg: null})
171
+ let user = res.data
172
+ this.data.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
173
+ this.data.operator = this.selectdata.person
174
+ this.data.f_filiale = user.orgs
175
+ this.data.f_parentname = user.deps
176
+ }
177
+ for (const item of this.data.fields) {
178
+ debugger
179
+ if(item.label==='气价名称'){
180
+ item.value=this.data.f_price_name
181
+ }
182
+ }
183
+ }
184
+ },
185
+ events:{
186
+ },
187
+ watch: {
188
+ deep: true
189
+ }
190
+ }
191
+ </script>
192
+ <style scoped>
193
+ /*清除model中的浮动*/
194
+ .clearfix:after,.clearfix:before{
195
+ display: table;
196
+ }
197
+ .clearfix:after{
198
+ clear: both;
199
+ }
200
+ </style>