apply-clients 7.1.11 → 7.1.15

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": "7.1.11",
3
+ "version": "7.1.15",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
package/src/apply.js CHANGED
@@ -1,67 +1,69 @@
1
- import Vue from 'vue'
2
- Vue.config.silent = true
3
- import ApplyGetSaleParam from './stores/ApplyGetSaleParams'
4
- import ApplyLoadParams from './stores/ApplyLoadParams'
5
- /** ****************服务插件*********************/
6
-
7
- export default function () {
8
- Vue.use(ApplyGetSaleParam)
9
- Vue.use(ApplyLoadParams)
10
- /** ***************************报建模块*********************************/
11
- /** 报建流程业务 **/
12
- // 报建流程业务总入口
13
- Vue.component('exploration-user', (resolve) => { require(['./components/product/Process/ExplorationUser'], resolve) })
14
- // 报建流程业务总入口页面list布局
15
- Vue.component('exploration-select', (resolve) => { require(['./components/product/Process/ExplorationSelect'], resolve) })
16
- // 业务tab(control层)页
17
- Vue.component('service-control', (resolve) => { require(['./components/product/Process/Service/ServiceControl'], resolve) })
18
- // 公共业务显示(view层)页
19
- Vue.component('service-view', (resolve) => { require(['./components/product/ServiceView'], resolve) })
20
- // 显示退回理由tab页
21
- Vue.component('show-back-reason', (resolve) => { require(['./components/product/Process/ShowBackReason'], resolve) })
22
-
23
- /** 报建监控业务 **/
24
- // 流程监控入口页
25
- Vue.component('supervisory-control', (resolve) => { require(['./components/product/Supervisory/SupervisoryControl'], resolve) })
26
- // 流程监控列表页
27
- Vue.component('supervisory-list', (resolve) => { require(['./components/product/Supervisory/SupervisoryList'], resolve) })
28
- // 业务tab(control层)页
29
- Vue.component('supervisory-service-control', (resolve) => { require(['./components/product/Supervisory/Service/SupervisoryServiceControl'], resolve) })
30
- // 流程列表页
31
- Vue.component('supervisory-chart', (resolve) => { require(['./components/product/Supervisory/SupervisoryhCart'], resolve) })
32
-
33
- /** 报建功能业务 **/
34
- // 报建功能业务总入口
35
- Vue.component('install-function', (resolve) => { require(['./components/product/Function/InstallFunction'], resolve) })
36
- // 报建功能工程列表
37
- Vue.component('installinfoselect', (resolve) => { require(['./components/product/Function/InstallInfoSelect'], resolve) })
38
- // 报建菜单页面控制层
39
- Vue.component('function-service-control', (resolve) => { require(['./components/product/Function/Service/FunctionServiceControl'], resolve) })
40
- // 终止报建业务
41
- Vue.component('stop-install', (resolve) => { require(['./components/product/Function/functions/StopInstall'], resolve) })
42
- // 终止报建列表页
43
- Vue.component('stop-apply-cardlist', (resolve) => { require(['./components/product/Function/StopApplyCrrdList'], resolve) })
44
- // 撤销报建终止页
45
- Vue.component('apply-record-cancel', (resolve) => { require(['./components/product/Function/functions/ApplyRecordCancel'], resolve) })
46
-
47
- /** 报建收费记录 **/
48
- Vue.component('apply-charge-search', (resolve) => { require(['./components/product/ApplyCharge/ApplyChargeSearch'], resolve) })
49
- Vue.component('apply-charge-list', (resolve) => { require(['./components/product/ApplyCharge/ApplyChargeList'], resolve) })
50
- Vue.component('apply-charge-report', (resolve) => { require(['./components/product/ApplyCharge/ApplyChargeReport'], resolve) })
51
-
52
- // 地址管理
53
- Vue.component('apply-address-userinfo-management', (resolve) => { require(['./components/product/Process/Processes/addressAndUserinfoManagement'], resolve) })
54
- // 施工安装明细
55
- Vue.component('installation-details', (resolve) => { require(['./components/product/Process/Processes/InstallationDetails'], resolve) })
56
- // 收费管理
57
- Vue.component('apply-charge-management', (resolve) => { require(['./components/product/Process/Processes/chargeManagement'], resolve) })
58
- Vue.component('apply-print-charge', (resolve) => { require(['./components/product/Process/Processes/printCharge'], resolve) })
59
- // 补充协议
60
- Vue.component('supplemental-agreement', (resolve) => { require(['./components/product/Process/Processes/supplementalAgreement'], resolve) })
61
- Vue.component('test', (resolve) => { require(['./components/product/Test'], resolve) })
62
-
63
- /** VueUtils **/
64
- Vue.component('back-page', (resolve) => { require(['./components/product/VueUtils/ToolsPage'], resolve) })
65
- Vue.component('tree2', (resolve) => { require(['./components/product/VueUtils/Tree'], resolve) })
66
- Vue.component('apply-upload', (resolve) => { require(['./components/product/VueUtils/ApplyUpload'], resolve) })
67
- }
1
+ import Vue from 'vue'
2
+ Vue.config.silent = true
3
+ import ApplyGetSaleParam from './stores/ApplyGetSaleParams'
4
+ import ApplyLoadParams from './stores/ApplyLoadParams'
5
+ /** ****************服务插件*********************/
6
+
7
+ export default function () {
8
+ Vue.use(ApplyGetSaleParam)
9
+ Vue.use(ApplyLoadParams)
10
+ /** ***************************报建模块*********************************/
11
+ /** 报建流程业务 **/
12
+ // 报建流程业务总入口
13
+ Vue.component('exploration-user', (resolve) => { require(['./components/product/Process/ExplorationUser'], resolve) })
14
+ // 报建流程业务总入口页面list布局
15
+ Vue.component('exploration-select', (resolve) => { require(['./components/product/Process/ExplorationSelect'], resolve) })
16
+ // 业务tab(control层)页
17
+ Vue.component('service-control', (resolve) => { require(['./components/product/Process/Service/ServiceControl'], resolve) })
18
+ // 公共业务显示(view层)页
19
+ Vue.component('service-view', (resolve) => { require(['./components/product/ServiceView'], resolve) })
20
+ // 显示退回理由tab页
21
+ Vue.component('show-back-reason', (resolve) => { require(['./components/product/Process/ShowBackReason'], resolve) })
22
+
23
+ /** 报建监控业务 **/
24
+ // 流程监控入口页
25
+ Vue.component('supervisory-control', (resolve) => { require(['./components/product/Supervisory/SupervisoryControl'], resolve) })
26
+ // 流程监控列表页
27
+ Vue.component('supervisory-list', (resolve) => { require(['./components/product/Supervisory/SupervisoryList'], resolve) })
28
+ // 业务tab(control层)页
29
+ Vue.component('supervisory-service-control', (resolve) => { require(['./components/product/Supervisory/Service/SupervisoryServiceControl'], resolve) })
30
+ // 流程列表页
31
+ Vue.component('supervisory-chart', (resolve) => { require(['./components/product/Supervisory/SupervisoryhCart'], resolve) })
32
+
33
+ /** 报建功能业务 **/
34
+ // 报建功能业务总入口
35
+ Vue.component('install-function', (resolve) => { require(['./components/product/Function/InstallFunction'], resolve) })
36
+ // 报建功能工程列表
37
+ Vue.component('installinfoselect', (resolve) => { require(['./components/product/Function/InstallInfoSelect'], resolve) })
38
+ // 报建菜单页面控制层
39
+ Vue.component('function-service-control', (resolve) => { require(['./components/product/Function/Service/FunctionServiceControl'], resolve) })
40
+ // 终止报建业务
41
+ Vue.component('stop-install', (resolve) => { require(['./components/product/Function/functions/StopInstall'], resolve) })
42
+ // 终止报建列表页
43
+ Vue.component('stop-apply-cardlist', (resolve) => { require(['./components/product/Function/StopApplyCrrdList'], resolve) })
44
+ // 撤销报建终止页
45
+ Vue.component('apply-record-cancel', (resolve) => { require(['./components/product/Function/functions/ApplyRecordCancel'], resolve) })
46
+
47
+ /** 报建收费记录 **/
48
+ Vue.component('apply-charge-search', (resolve) => { require(['./components/product/ApplyCharge/ApplyChargeSearch'], resolve) })
49
+ Vue.component('apply-charge-list', (resolve) => { require(['./components/product/ApplyCharge/ApplyChargeList'], resolve) })
50
+ Vue.component('apply-charge-report', (resolve) => { require(['./components/product/ApplyCharge/ApplyChargeReport'], resolve) })
51
+
52
+ // 地址管理
53
+ Vue.component('apply-address-userinfo-management', (resolve) => { require(['./components/product/Process/Processes/addressAndUserinfoManagement'], resolve) })
54
+ // 施工安装明细
55
+ Vue.component('installation-details', (resolve) => { require(['./components/product/Process/Processes/InstallationDetails'], resolve) })
56
+ // 收费管理
57
+ Vue.component('apply-charge-management', (resolve) => { require(['./components/product/Process/Processes/chargeManagement'], resolve) })
58
+ Vue.component('apply-print-charge', (resolve) => { require(['./components/product/Process/Processes/printCharge'], resolve) })
59
+ // 补充协议
60
+ Vue.component('supplemental-agreement', (resolve) => { require(['./components/product/Process/Processes/supplementalAgreement'], resolve) })
61
+ Vue.component('test', (resolve) => { require(['./components/product/Test'], resolve) })
62
+ // 通气点火汇总报表
63
+ Vue.component('gas-ignition-summary', (resolve) => { require(['./components/product/ReportForm/GasIgnitionSummary'], resolve) })
64
+
65
+ /** VueUtils **/
66
+ Vue.component('back-page', (resolve) => { require(['./components/product/VueUtils/ToolsPage'], resolve) })
67
+ Vue.component('tree2', (resolve) => { require(['./components/product/VueUtils/Tree'], resolve) })
68
+ Vue.component('apply-upload', (resolve) => { require(['./components/product/VueUtils/ApplyUpload'], resolve) })
69
+ }
@@ -13,11 +13,11 @@
13
13
  <!-- <th v-if="$parent.$parent.selectdata.f_apply_type === '散户集体报建' || $parent.$parent.selectdata.f_apply_type === '煤改气报建'">单价(户)</th>-->
14
14
  <!-- <th v-if="$parent.$parent.selectdata.f_apply_type === '散户集体报建' || $parent.$parent.selectdata.f_apply_type === '煤改气报建'">累计缴费</th>-->
15
15
  <th>
16
- <!-- <button type="button" class="btn btn-info head-but"-->
17
- <!-- :disabled="$parent.$parent.mark === 1"-->
18
- <!-- @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>-->
19
- <!-- <a type="button" class="btn btn-info head-but"-->
20
- <!-- href="/apply/download/excel/安装明细.xlsx" download>模板下载</a>-->
16
+ <button type="button" class="btn btn-info head-but"
17
+ :disabled="$parent.$parent.mark === 1"
18
+ @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
19
+ <a type="button" class="btn btn-info head-but"
20
+ href="/apply/download/excel/安装明细.xlsx" download>模板下载</a>
21
21
  操作
22
22
  </th>
23
23
  </tr>
@@ -68,7 +68,13 @@
68
68
  </td>
69
69
  <td style="text-align: center;">
70
70
  <nobr>
71
-
71
+ <button
72
+ v-if="selectdata.defname == '方案确定'"
73
+ type="button"
74
+ name="button"
75
+ class="btn btn-link"
76
+ @click="updateState(row.f_userinfo_id)"
77
+ >操作</button>
72
78
  </nobr>
73
79
  </td>
74
80
  </tr>
@@ -87,6 +93,7 @@
87
93
  </article>
88
94
  <footer slot="modal-footer" class="modal-footer"></footer>
89
95
  </modal>
96
+
90
97
  </template>
91
98
  <script>
92
99
  import {PagedList} from 'vue-client'
@@ -153,6 +160,24 @@ export default {
153
160
  // 将选的文件清空
154
161
  this.$refs.file.$el.querySelector('input').value = ''
155
162
  this.search()
163
+ },
164
+ async updateState(f_userinfo_id) {
165
+ let http = new HttpResetClass()
166
+ let data = {
167
+ f_userinfo_id: f_userinfo_id
168
+ }
169
+ this.$showMessage('确定要修改用户状态为不符合吗!!!', ['confirm']).then(async (res) => {
170
+ if (res === 'confirm') {
171
+ let res = await http.load('POST', 'rs/logic/updateUserinfoState', {data:data}, {
172
+ resolveMsg: null,
173
+ rejectMsg: null
174
+ })
175
+ if (res.data.length > 0) {
176
+ this.$showMessage("修改成功!")
177
+ }
178
+ }
179
+ })
180
+
156
181
  }
157
182
  },
158
183
  events: {
@@ -4,7 +4,7 @@
4
4
  <template partial='head'>
5
5
  <tr>
6
6
  <th class="textNoLineBreak">序号</th>
7
- <th class="textNoLineBreak" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'">地址</th>
7
+ <th class="textNoLineBreak" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报装'">地址</th>
8
8
  <th class="textNoLineBreak">缴费编号</th>
9
9
  <th class="textNoLineBreak">收费金额</th>
10
10
  <th class="textNoLineBreak">金额大写</th>
@@ -31,7 +31,7 @@
31
31
  <td style="text-align: center;">
32
32
  <nobr>{{$index+1}}</nobr>
33
33
  </td>
34
- <td style="text-align: center;" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'">
34
+ <td style="text-align: center;" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报装'">
35
35
  <nobr>{{row.f_useraddress}}</nobr>
36
36
  </td>
37
37
  <td style="text-align: center;">
@@ -1,788 +1,855 @@
1
- <template>
2
-
3
- <div class="auto clearfix">
4
- <show-back-reason :selectdata="show_data"></show-back-reason>
5
- </div>
6
-
7
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
-
9
- </template>
10
- <script>
11
- import Vue from 'vue'
12
- import {HttpResetClass} from 'vue-client'
13
- import {getNowDate,isEmpty} from '../../../Util'
14
- // Date格式化
15
- Date.prototype.Format = function (fmt) {
16
- var o = {
17
- "M+": this.getMonth() + 1, //月份
18
- "d+": this.getDate(), //日
19
- "H+": this.getHours(), //小时
20
- "m+": this.getMinutes(), //分
21
- "s+": this.getSeconds(), //秒
22
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
- "S": this.getMilliseconds() //毫秒
24
- };
25
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
- for (var k in o)
27
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
- return fmt;
29
- }
30
-
31
- export default {
32
- title: '报建流程业务控制层',
33
- props: ['selectdata'],
34
- data() {
35
- return {
36
- data: null, // 数据库数据,json配置文件数据的数据集合
37
- json_datas: null, // Json配置文件集合
38
- showview: false, // 控制显示service-view组件
39
- show_data: null // 给view层显示的数据
40
- }
41
- },
42
- created () {
43
- this.refurbish()
44
- },
45
- methods: {
46
- // 组件初始化操作
47
- refurbish() {
48
- this.json_datas = this.$workflow_vue
49
- let sum = 0
50
- let jsonData = {}
51
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
52
- this.$showMessage("网络故障,请刷新页面")
53
- return
54
- }
55
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
56
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
57
- jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
58
- sum++ // 节点名一样的个数
59
- }
60
- }
61
- if (sum == 1) {
62
- this.data = null
63
- this.data = jsonData
64
- // selectdata 填充 data
65
- this.data = Object.assign({}, this.data, this.selectdata)
66
- this.initializeJSON()
67
- } else if (sum == 0) {
68
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
69
- } else {
70
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
71
- }
72
- },
73
- // json配置数据处理
74
- async initializeJSON() {
75
- // 有默认值,value就给默认值,没有就是null
76
- this.data.fields.forEach(item => {
77
- if (!item.value) {
78
- if (item.value === 0) {
79
- item.value = 0
80
- } else {
81
- item.value = null
82
- }
83
- }
84
- if (item.default || item.default == 0) {
85
- item.value = item.default
86
- }
87
- if (this.selectdata[item.field]) {
88
- // 将json字符串格式化赋值给value
89
- if (String(this.selectdata[item.field]).startsWith("{")) {
90
- item.value = JSON.parse(this.selectdata[item.field])
91
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
92
- } else {
93
- item.value = this.selectdata[item.field]
94
- }
95
- } else {
96
- if (this.selectdata[item.field] === 0) {
97
- item.value = 0
98
- }
99
- }
100
-
101
- // datepicker 没有值给当时值
102
- if (item.type === 'datepicker' && !item.value && item.default) {
103
- item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
104
- }
105
-
106
- // 如果配置类型为select,优先从参数列表获取options
107
- if (item.type === 'select') {
108
- let temp = null
109
-
110
- temp = this.$appdata.getParam(item.label)
111
-
112
- if (temp && temp.length > 0 && item.label) {
113
- item.options = temp
114
- } else {
115
- if (item.paramLabel) {
116
- temp = this.$appdata.getParam(item.paramLabel)
117
- if (temp && temp.length > 0) {
118
- item.options = temp
119
- }
120
- }
121
- }
122
- }
123
- })
124
-
125
- // 控制组件
126
- if (this.data.components) {
127
- this.data.components.forEach(item => {
128
- item.mark = 0
129
- })
130
- }
131
-
132
- // 初始化 fields 可对数据进行特殊处理
133
- this.initializeFields()
134
-
135
- // 初始化 buttons_fields
136
- for (let i = 0; i < this.data.buttons.length; i++) {
137
- // 下发按钮相关配置
138
- if (this.data.buttons[i].button_name === '下发') {
139
- if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
140
- if (this.data.buttons[i].source){
141
- let http = new HttpResetClass()
142
- let res = await http.load('POST', 'rs/search', {
143
- source: this.data.buttons[i].source,
144
- userid: this.$login.f.id
145
- }, {resolveMsg: null, rejectMsg: null})
146
-
147
- let options = []
148
- for (let i = 0; i < res.data.length; i++) {
149
- options.push(
150
- {
151
- "label": res.data[i].name,
152
- "value": res.data[i].id
153
- }
154
- )
155
- }
156
- this.data.buttons[i].button_fields[0]['options'] = options
157
- } else {
158
- this.$showMessage("请配置获取人员表达式")
159
- }
160
- } else {
161
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
162
- }
163
- }
164
- if (this.data.buttons[i].button_fields) {
165
- this.data.buttons[i].button_fields.forEach(x => {
166
- // 如果配置类型为select,优先从参数列表获取options
167
- if (x.type === 'select' && this.$appdata.getParam(x.label)) {
168
- x.options = this.$appdata.getParam(x.label).trim()
169
- }
170
- })
171
- }
172
- }
173
-
174
- // onetomany 数据获取
175
- if (this.data.onetomany) {
176
- for (let index = 0; index < this.data.onetomany.length; index++) {
177
- let res = null
178
- if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
179
- let http = new HttpResetClass()
180
- let data = {
181
- tablename: this.data.onetomany[index].tables[0],
182
- condition: `f_process_id='${this.selectdata.f_process_id}'`
183
- }
184
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
185
- resolveMsg: null,
186
- rejectMsg: 'onetomany查询失败'
187
- })
188
- } else {
189
- res = this[this.data.onetomany[index].queryEvent]()
190
- }
191
-
192
- // 初始化 onetomany
193
- this.data.onetomany[index].rows = res.data
194
-
195
- // 初始化onetomany中的fields
196
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
197
- if (!this.data.onetomany[index].fields[j].value) {
198
- if (this.data.onetomany[index].fields[j].value === 0) {
199
- this.data.onetomany[index].fields[j].value = 0
200
- } else {
201
- this.data.onetomany[index].fields[j].value = null
202
- }
203
- }
204
- if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
205
- this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
206
- }
207
- // 如果配置类型为select,优先从参数列表获取options
208
- if (this.data.onetomany[index].fields[j].type === 'select') {
209
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
210
- if (temp && temp.length > 0) {
211
- this.data.onetomany[index].fields[j].options = temp
212
- }
213
- }
214
- }
215
- }
216
- }
217
-
218
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
219
- let temp = JSON.parse(JSON.stringify(this.data))
220
-
221
- this.show_data = temp
222
- this.$nextTick(() => {
223
- this.showview = true
224
- })
225
- },
226
- // 初始化fields值
227
- initializeFields() {
228
-
229
- },
230
- // 金额转大写
231
- smalltoBIG(n) {
232
- let fraction = ['', '分'];
233
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
234
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
235
- let head = n < 0 ? '欠' : '';
236
- n = Math.abs(n);
237
-
238
- let s = '';
239
-
240
- for (var i = 0; i < fraction.length; i++) {
241
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
242
- }
243
- s = s || '整';
244
- n = Math.floor(n);
245
-
246
- for (var i = 0; i < unit[0].length && n > 0; i++) {
247
- let p = '';
248
- for (var j = 0; j < unit[1].length && n > 0; j++) {
249
- p = digit[n % 10] + unit[1][j] + p;
250
- n = Math.floor(n / 10);
251
- }
252
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
253
- }
254
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
255
- },
256
- getLableValue(label) {
257
- for (const item of this.show_data.fields) {
258
- if (item.label === label && item.type !== 'number') {
259
- return item.value || ''
260
- }
261
- if (item.label === label && item.type === 'number') {
262
- return item.value || 0
263
- }
264
- }
265
- },
266
- setLabelValue(label, value) {
267
- for (const item of this.show_data.fields) {
268
- if (item.label === label) {
269
- item.value = value
270
- }
271
- }
272
- },
273
- async buttonBefore(model) {
274
- if (
275
- model.button.button_name === '提交' &&
276
- model.defname === '收费' &&
277
- (
278
- model.f_apply_type === '散户报建' ||
279
- model.f_apply_type === '工业户报建' ||
280
- model.f_apply_type === '商业户报建'
281
- ) &&
282
- model.f_surplus_money > 0
283
- ) {
284
- throw '未结金额大于0,无法提交!!!'
285
- }
286
- if (model.defname === '施工' && model.button.button_name === '提交') {
287
- let http = new HttpResetClass()
288
- let data = {
289
- f_process_id: model.f_process_id
290
- }
291
- let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
292
- if (res.data[0].num > 0) {
293
- throw `还有${res.data[0].num}户未安装,无法提交`
294
- }
295
- }
296
- return model
297
- },
298
- // ========================= 武安 =================================
299
- // 地址类型变化
300
- addressType() {
301
- for (const item of this.show_data.fields) {
302
- if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
303
- item.required = true
304
- }
305
- if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
306
- item.required = false
307
- }
308
- if (
309
- (
310
- item.label === '楼号' ||
311
- item.label === '单元' ||
312
- item.label === '楼层' ||
313
- item.label === '门牌号'
314
- ) && this.show_data.f_address_type === '民用地址'
315
- ) {
316
- item.required = true
317
- item.hidden = false
318
- item.value = null
319
- }
320
- if (
321
- (
322
- item.label === '楼号' ||
323
- item.label === '单元' ||
324
- item.label === '楼层' ||
325
- item.label === '门牌号'
326
- ) && this.show_data.f_address_type === '特殊地址'
327
- ) {
328
- item.required = false
329
- item.hidden = true
330
- item.value = null
331
- }
332
- }
333
- },
334
- async getStreetList () {
335
- let data = {
336
- tablename: 't_street',
337
- condition: `f_filialeid = ${this.$login.f.orgid} and f_street is not null`
338
- }
339
-
340
- let res = await this.$resetpost(
341
- `rs/sql/singleTable`,
342
- {data: data},
343
- {resolveMsg: null, rejectMsg: '街道查询失败,请重新进入!!!'}
344
- )
345
-
346
- let streetList = []
347
-
348
- res.data.forEach(item => {
349
- streetList.push({
350
- label: item.f_street,
351
- value: item.f_street
352
- })
353
- })
354
-
355
- for (const item of this.show_data.fields) {
356
- if (item.label === '街道') {
357
- item.options = streetList
358
- }
359
- }
360
- },
361
- async getAreaList () {
362
- let data = {
363
- tablename: 't_area',
364
- condition: `f_filialeid = ${this.$login.f.orgid} and f_street = '${this.getLableValue('街道')}'`
365
- }
366
-
367
- let res = await this.$resetpost(
368
- `rs/sql/singleTable`,
369
- {data: data},
370
- {resolveMsg: null, rejectMsg: '小区查询失败,请重新进入!!!'}
371
- )
372
-
373
- let areaList = []
374
-
375
- res.data.forEach(item => {
376
- areaList.push({
377
- label: item.f_residential_area,
378
- value: item.f_residential_area
379
- })
380
- })
381
-
382
- for (const item of this.show_data.fields) {
383
- if (item.label === '小区') {
384
- item.options = areaList
385
- }
386
- }
387
- }
388
- // ========================= 武安 =================================
389
- },
390
- events: {
391
- // ========================= 武安 =================================
392
- // ========================= 武安 =================================
393
- 'openAddModel'(index) {
394
- // ========================= 武安 =================================
395
- // ========================= 武安 =================================
396
- },
397
- // 获取view层button事件/
398
- async 'button'(model) {
399
- // 修改提交数据
400
- model = Object.assign({}, this.selectdata, model)
401
- // 点击重置按钮就重置数据
402
- if (model.button.button_name === '重置') {
403
- this.$dispatch('breakControl', this.data)
404
- return
405
- }
406
-
407
- // 提交前置
408
- try {
409
- model = await this.buttonBefore(model)
410
- } catch (e) {
411
- this.$showAlert(e, 'warning', 3000)
412
- return
413
- }
414
-
415
- let http = new HttpResetClass()
416
- let requestData = {
417
- tables: this.data.tables,
418
- start_activity: this.$workflow_vue.start_activity,
419
- model: model,
420
- loginUser: this.$login.f,
421
- workflow_xmlfilename: this.$workflow_vue.workflow_xmlfilename
422
- }
423
- // 下发,提交,保存,退回通用业务后台处理logic
424
- let url = 'rs/logic/ApplyProductService'
425
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
426
-
427
- if (res.data.code == 200) {
428
- this.$dispatch('search')
429
- } else {
430
- if (res.data.msg) {
431
- this.$showMessage(res.data.msg)
432
- }
433
- }
434
- },
435
- async 'initializtionView'() {
436
- // ========================= 武安 =================================
437
- this.addressType()
438
-
439
- if (this.show_data.defname === '用户受理' && this.show_data.f_apply_type === '散户报建') {
440
- await this.getStreetList()
441
- }
442
- // ========================= 武安 =================================
443
- },
444
- // 失去焦点出触发事件
445
- async 'onchange'(index) {
446
- console.log('失去焦点')
447
- // ========================= 武安 =================================
448
- if (this.show_data.defname === '用户受理'){
449
- if (this.show_data.fields[index].label === '地址类型'){
450
- this.addressType()
451
- }
452
- if (this.show_data.fields[index].label === '街道' && this.show_data.f_apply_type !== '散户报建'){
453
- console.log('-----------添加街道-----------')
454
- if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
455
- this.show_data.fields[index].value = null
456
- this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
457
- return
458
- }
459
- let http = new HttpResetClass()
460
- let data = {
461
- f_adjustable_id: '', // 调压箱编号
462
- f_orgid: this.$login.f.orgid, // 组织id
463
- f_orgname: this.$login.f.orgs, // 组织名
464
- f_pcd: '河北省邯郸市武安市', // 省市区
465
- f_pcd_id: 8, // 省市区id
466
- // f_pcd_id: 124, // 50.4测试
467
- f_slice_area: '', // 片区
468
- f_operatorid: this.$login.f.id, // 操作人id
469
- f_operator: this.$login.f.name, // 操作人
470
- f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
471
- f_street: this.show_data.fields[index].value.trim(), // 地址
472
- f_comments: '报建系统自动创建' // 备注
473
- }
474
- try{
475
- let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {resolveMsg: null, rejectMsg: null})
476
- } catch (e) {
477
- if (e.status === 635){
478
- this.$showAlert('此街道已存在!!!', 'warning', 3000)
479
- } else {
480
- this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
481
- }
482
- }
483
- }
484
- if (this.show_data.fields[index].label === '街道' && this.show_data.f_apply_type === '散户报建') {
485
- this.setLabelValue('小区', '')
486
- await this.getAreaList()
487
- }
488
- if (this.show_data.fields[index].label === '小区' && this.show_data.f_apply_type !== '散户报建'){
489
- if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
490
- this.show_data.fields[index].value = null
491
- this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
492
- return
493
- }
494
- // 先查询街道
495
- let street = null
496
- for (const item of this.show_data.fields) {
497
- if (item.label === '街道') {
498
- if (item.value.trim() === null || item.value.trim() === ''){
499
- this.show_data.fields[index].value = null
500
- this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
501
- return
502
- }
503
- let http = new HttpResetClass()
504
- let data = {
505
- condition: `1=1 and s.f_filialeid in ('${this.$login.f.orgid}') and f_province = '河北省' and f_city = '邯郸市' and f_district = '武安市' and f_street = '${item.value.trim()}'`
506
- }
507
- let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {resolveMsg: null, rejectMsg: null})
508
- if (res.data.length > 0) {
509
- street = res.data[0]
510
- } else {
511
- this.show_data.fields[index].value = null
512
- this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
513
- }
514
- }
515
- }
516
- console.log('-----------添加小区-----------')
517
- let data = {
518
- f_linkname: '', // 联系人
519
- f_linkphone: '', // 联系电话
520
- f_adjustable_id: '', // 调压箱编号
521
- f_user_type: '', // 用户类型
522
- f_gasproperties: '', // 用气性质
523
- f_meter_brand: '', // 气表品牌
524
- f_price_name: '', // 气价名称
525
- f_price_type: '', // 气价类型
526
- f_meter_style: '', // 气表型号
527
- f_position: '', // 表安装位置
528
- f_meter_type: '', // 气表类型
529
- f_area_id: '', // 小区编号 (自动生成)
530
- f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
531
- f_operatorid: this.$login.f.id, // 操作人id
532
- f_operator: this.$login.f.name, // 操作人
533
- f_orgid: this.$login.f.orgid, // 组织id
534
- f_orgname: this.$login.f.orgs, // 组织名
535
- f_pcd_id: 8, // 省市区id
536
- // f_pcd_id: 124, // 50.4测试
537
- f_pcd: '河北省邯郸市武安市', // 省市区
538
- f_street_id: street.id, // 街道id
539
- f_street: street.f_street,// 街道
540
- f_area_code: '01', // 片区编码
541
- f_slice_area: '武安片区', // 片区
542
- // f_area_code: '66556', // 50.4测试
543
- // f_slice_area: '武安明星', // 50.4测试
544
- slice_area: [
545
- {
546
- name: '武安片区',
547
- code: '01'
548
- }
549
- ],
550
- // slice_area: [ // 50.4测试
551
- // {
552
- // name: '武安明星',
553
- // code: '66556'
554
- // }
555
- // ],
556
- f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
557
- f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
558
- f_comments: '报建系统自动创建'
559
- }
560
- try{
561
- let http = new HttpResetClass()
562
- let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {resolveMsg: null, rejectMsg: null})
563
- } catch (e) {
564
- if (e.status === 635){
565
- this.$showAlert('此小区已存在!!!', 'warning', 3000)
566
- } else {
567
- this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
568
- }
569
- }
570
- }
571
- // 地址拼接
572
- if (
573
- this.show_data.fields[index].label === '街道' ||
574
- this.show_data.fields[index].label === '小区' ||
575
- this.show_data.fields[index].label === '楼号' ||
576
- this.show_data.fields[index].label === '单元' ||
577
- this.show_data.fields[index].label === '楼层' ||
578
- this.show_data.fields[index].label === '门牌号'
579
- ) {
580
- let f_address = null
581
- if (this.show_data.f_address_type !== '民用地址') {
582
- f_address = this.getLableValue('街道') + this.getLableValue('小区')
583
- } else {
584
- f_address = this.getLableValue('街道') +
585
- this.getLableValue('小区') +
586
- this.getLableValue('楼号') +
587
- (isEmpty(this.getLableValue('楼号')) ? '' : '号楼') +
588
- this.getLableValue('单元') +
589
- (isEmpty(this.getLableValue('单元')) ? '' : '单元') +
590
- this.getLableValue('楼层') +
591
- (isEmpty(this.getLableValue('楼层')) ? '' : '层') +
592
- this.getLableValue('门牌号') +
593
- (isEmpty(this.getLableValue('门牌号')) ? '' : '室')
594
- }
595
- this.setLabelValue('地址',f_address)
596
- }
597
- }
598
- if (this.show_data.defname === '竣工验收') {
599
- if (this.show_data.fields[index].label === '验收是否合格'){
600
- for (const button of this.show_data.buttons) {
601
- if (this.show_data.fields[index].value === '' && button.button_name === '退回') {
602
- button.hidden = false
603
- } else {
604
- button.hidden = true
605
- }
606
- }
607
- }
608
- }
609
- if (this.show_data.defname === '合同签订') {
610
- if (this.show_data.fields[index].label === '合同编号') {
611
- if (!isEmpty(this.show_data.fields[index].value)) {
612
- let http = new HttpResetClass()
613
- let data = {
614
- tablename: 't_apply',
615
- condition: `f_contract_number='${this.show_data.fields[index].value}'`
616
- }
617
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
618
- resolveMsg: null,
619
- rejectMsg: '合同编号查重失败'
620
- })
621
- if (res.data.length > 0) {
622
- this.show_data.fields[index].value = null
623
- this.$showAlert('合同编号已存在!!!', 'warning', 3000)
624
- }
625
- }
626
- }
627
- if (this.show_data.fields[index].label === '单价(户)') {
628
- let http = new HttpResetClass()
629
- let data = {
630
- num1: this.getLableValue(this.show_data.fields[index].label),
631
- num2: this.getLableValue('户数'),
632
- operator: '*'
633
- }
634
- try {
635
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
636
- resolveMsg: null,
637
- rejectMsg: null
638
- })
639
- data = {
640
- num1: res.data,
641
- num2: this.getLableValue('其他费用'),
642
- operator: '+'
643
- }
644
- res = await http.load('POST', 'rs/logic/compute', {data: data}, {
645
- resolveMsg: null,
646
- rejectMsg: null
647
- })
648
- this.setLabelValue('合同金额',res.data)
649
- } catch (e) {
650
- this.$showAlert(e.data.msg, 'warning', 3000)
651
- }
652
- }
653
- if (this.show_data.fields[index].label === '其他费用') {
654
- let http = new HttpResetClass()
655
- let data = {
656
- num1: this.getLableValue(this.show_data.fields[index].label),
657
- num2: this.getLableValue('合同金额'),
658
- operator: '+'
659
- }
660
- try {
661
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
662
- resolveMsg: null,
663
- rejectMsg: null
664
- })
665
- this.setLabelValue('合同金额',res.data)
666
- } catch (e) {
667
- this.$showAlert(e.data.msg, 'warning', 3000)
668
- }
669
- }
670
- }
671
- // ========================= 武安 =================================
672
- // 号码检测
673
- if (this.show_data.fields[index].label === '电话号码') {
674
- let phone = this.show_data.fields[index].value
675
- // 电话号码效验
676
- if (!(/^1[3456789]\d{9}$/.test(phone))) {
677
- this.show_data.fields[index].value = ""
678
- this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
679
- }
680
- }
681
- //时间提醒
682
- if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
683
- let setTime = this.show_data.fields[index].value
684
- let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
685
- if (nowTime >= setTime) {
686
- this.$showMessage("请注意,当前节点时间/工期已过期!")
687
- }
688
- }
689
- },
690
- // input值发生变化
691
- async 'oninput'(index) {
692
-
693
- },
694
- // 错误事件
695
- error_check(index) {
696
- // 时间格式检测
697
- if (this.show_data.fields[index].type == 'datepicker') {
698
- let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
699
- let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
700
- if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
701
- this.show_data.fields[index].error.flag = false
702
- } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
703
- this.show_data.fields[index].error.flag = false
704
- } else {
705
- if (this.show_data.fields[index].fullsize) {
706
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
707
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
708
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
709
- this.show_data.fields[index].error.flag = true
710
- this.show_data.fields[index].value = ''
711
- } else {
712
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
713
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
714
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
715
- this.show_data.fields[index].error.flag = true
716
- this.show_data.fields[index].value = ''
717
- }
718
-
719
- }
720
- }
721
- },
722
- // onetomany模态框默认监听监听事件
723
- async 'onetomanydelete'(i, j) {
724
- console.log('默认删除')
725
- let http = new HttpResetClass()
726
- let data = {
727
- table: this.show_data.onetomany[i].tables[0],
728
- row: this.show_data.onetomany[i].rows[j]
729
- }
730
- let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
731
- resolveMsg: null,
732
- rejectMsg: '删除失败'
733
- })
734
-
735
- if (res.data <= 0){
736
- this.$showMessage('删除失败')
737
- return
738
- }
739
-
740
- this.$dispatch('breakControl', this.show_data)
741
- },
742
- async 'onetomanyadd'(index) {
743
-
744
- let data = {
745
- f_process_id : this.show_data.f_process_id
746
- }
747
- this.show_data.onetomany[index].fields.forEach(item => {
748
- data[item.field] = item.value
749
- })
750
- let res = await this.$resetpost(
751
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
752
- data
753
- )
754
- this.$dispatch('breakControl', this.show_data)
755
- },
756
- async 'onetomanyupdate'(i, j) {
757
- let onetomany = this.show_data.onetomany[i]
758
- let data = onetomany.rows[j]
759
-
760
- onetomany.fields.forEach(item => {
761
- data[item.field] = item.value
762
- })
763
- let res = await this.$resetpost(
764
- `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
765
- data
766
- )
767
-
768
- this.$dispatch('breakControl', this.show_data)
769
- },
770
- // onetomany模态框监听事件
771
- async 'onchange_modal'(index, i) {
772
- },
773
- async 'oninput_modal'(index, i) {
774
- }
775
- },
776
- watch: {
777
- }
778
- }
779
- </script>
780
- <style scoped>
781
- /*清除model中的浮动*/
782
- .clearfix:after,.clearfix:before{
783
- display: table;
784
- }
785
- .clearfix:after{
786
- clear: both;
787
- }
788
- </style>
1
+ <template>
2
+
3
+ <div class="auto clearfix">
4
+ <show-back-reason :selectdata="show_data"></show-back-reason>
5
+ </div>
6
+
7
+ <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
+
9
+ </template>
10
+ <script>
11
+ import Vue from 'vue'
12
+ import {HttpResetClass} from 'vue-client'
13
+ import {getNowDate,isEmpty} from '../../../Util'
14
+ // Date格式化
15
+ Date.prototype.Format = function (fmt) {
16
+ var o = {
17
+ "M+": this.getMonth() + 1, //月份
18
+ "d+": this.getDate(), //日
19
+ "H+": this.getHours(), //小时
20
+ "m+": this.getMinutes(), //分
21
+ "s+": this.getSeconds(), //秒
22
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
+ "S": this.getMilliseconds() //毫秒
24
+ };
25
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
+ for (var k in o)
27
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
+ return fmt;
29
+ }
30
+
31
+ export default {
32
+ title: '报建流程业务控制层',
33
+ props: ['selectdata'],
34
+ data() {
35
+ return {
36
+ data: null, // 数据库数据,json配置文件数据的数据集合
37
+ json_datas: null, // Json配置文件集合
38
+ showview: false, // 控制显示service-view组件
39
+ show_data: null // 给view层显示的数据
40
+ }
41
+ },
42
+ created () {
43
+ this.refurbish()
44
+ },
45
+ methods: {
46
+ // 组件初始化操作
47
+ refurbish() {
48
+ this.json_datas = this.$workflow_vue
49
+ let sum = 0
50
+ let jsonData = {}
51
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
52
+ this.$showMessage("网络故障,请刷新页面")
53
+ return
54
+ }
55
+ for (let i = 0; i < this.json_datas.activitys.length; i++) {
56
+ if (this.selectdata.defname == this.json_datas.activitys[i].title) {
57
+ jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
58
+ sum++ // 节点名一样的个数
59
+ }
60
+ }
61
+ if (sum == 1) {
62
+ this.data = null
63
+ this.data = jsonData
64
+ // selectdata 填充 data
65
+ this.data = Object.assign({}, this.data, this.selectdata)
66
+ this.initializeJSON()
67
+ } else if (sum == 0) {
68
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
69
+ } else {
70
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
71
+ }
72
+ },
73
+ // json配置数据处理
74
+ async initializeJSON() {
75
+ // 有默认值,value就给默认值,没有就是null
76
+ this.data.fields.forEach(item => {
77
+ if (!item.value) {
78
+ if (item.value === 0) {
79
+ item.value = 0
80
+ } else {
81
+ item.value = null
82
+ }
83
+ }
84
+ if (item.default || item.default == 0) {
85
+ item.value = item.default
86
+ }
87
+ if (this.selectdata[item.field]) {
88
+ // 将json字符串格式化赋值给value
89
+ if (String(this.selectdata[item.field]).startsWith("{")) {
90
+ item.value = JSON.parse(this.selectdata[item.field])
91
+ this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
92
+ } else {
93
+ item.value = this.selectdata[item.field]
94
+ }
95
+ } else {
96
+ if (this.selectdata[item.field] === 0) {
97
+ item.value = 0
98
+ }
99
+ }
100
+
101
+ // datepicker 没有值给当时值
102
+ if (item.type === 'datepicker' && !item.value && item.default) {
103
+ item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
104
+ }
105
+
106
+ // 如果配置类型为select,优先从参数列表获取options
107
+ if (item.type === 'select') {
108
+ let temp = null
109
+
110
+ temp = this.$appdata.getParam(item.label)
111
+
112
+ if (temp && temp.length > 0 && item.label) {
113
+ item.options = temp
114
+ } else {
115
+ if (item.paramLabel) {
116
+ temp = this.$appdata.getParam(item.paramLabel)
117
+ if (temp && temp.length > 0) {
118
+ item.options = temp
119
+ }
120
+ }
121
+ }
122
+ }
123
+ })
124
+
125
+ // 控制组件
126
+ if (this.data.components) {
127
+ this.data.components.forEach(item => {
128
+ item.mark = 0
129
+ })
130
+ }
131
+
132
+ // 初始化 fields 可对数据进行特殊处理
133
+ this.initializeFields()
134
+
135
+ // 初始化 buttons_fields
136
+ for (let i = 0; i < this.data.buttons.length; i++) {
137
+ // 下发按钮相关配置
138
+ if (this.data.buttons[i].button_name === '下发') {
139
+ if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
140
+ if (this.data.buttons[i].source){
141
+ let http = new HttpResetClass()
142
+ let res = await http.load('POST', 'rs/search', {
143
+ source: this.data.buttons[i].source,
144
+ userid: this.$login.f.id
145
+ }, {resolveMsg: null, rejectMsg: null})
146
+
147
+ let options = []
148
+ for (let i = 0; i < res.data.length; i++) {
149
+ options.push(
150
+ {
151
+ "label": res.data[i].name,
152
+ "value": res.data[i].id
153
+ }
154
+ )
155
+ }
156
+ this.data.buttons[i].button_fields[0]['options'] = options
157
+ } else {
158
+ this.$showMessage("请配置获取人员表达式")
159
+ }
160
+ } else {
161
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
162
+ }
163
+ }
164
+ if (this.data.buttons[i].button_fields) {
165
+ this.data.buttons[i].button_fields.forEach(x => {
166
+ // 如果配置类型为select,优先从参数列表获取options
167
+ if (x.type === 'select' && this.$appdata.getParam(x.label)) {
168
+ x.options = this.$appdata.getParam(x.label).trim()
169
+ }
170
+ })
171
+ }
172
+ }
173
+
174
+ // onetomany 数据获取
175
+ if (this.data.onetomany) {
176
+ for (let index = 0; index < this.data.onetomany.length; index++) {
177
+ let res = null
178
+ if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
179
+ let http = new HttpResetClass()
180
+ let data = {
181
+ tablename: this.data.onetomany[index].tables[0],
182
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
183
+ }
184
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
185
+ resolveMsg: null,
186
+ rejectMsg: 'onetomany查询失败'
187
+ })
188
+ } else {
189
+ res = this[this.data.onetomany[index].queryEvent]()
190
+ }
191
+
192
+ // 初始化 onetomany
193
+ this.data.onetomany[index].rows = res.data
194
+
195
+ // 初始化onetomany中的fields
196
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
197
+ if (!this.data.onetomany[index].fields[j].value) {
198
+ if (this.data.onetomany[index].fields[j].value === 0) {
199
+ this.data.onetomany[index].fields[j].value = 0
200
+ } else {
201
+ this.data.onetomany[index].fields[j].value = null
202
+ }
203
+ }
204
+ if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
205
+ this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
206
+ }
207
+ // 如果配置类型为select,优先从参数列表获取options
208
+ if (this.data.onetomany[index].fields[j].type === 'select') {
209
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
210
+ if (temp && temp.length > 0) {
211
+ this.data.onetomany[index].fields[j].options = temp
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+
218
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
219
+ let temp = JSON.parse(JSON.stringify(this.data))
220
+
221
+ this.show_data = temp
222
+ this.$nextTick(() => {
223
+ this.showview = true
224
+ })
225
+ // 查询区域和街道
226
+ if (this.selectdata.defname === '报装申请') {
227
+ let http = new HttpResetClass()
228
+ let condition = "f_filialeids = " + this.$login.f.f_orgids
229
+ let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
230
+ for (let i = 0; i < this.show_data.fields.length; i++) {
231
+
232
+ if (this.show_data.fields[i].label == '区域') {
233
+ let data = []
234
+ let array = []
235
+ data = res.data.map(item => {
236
+ return item.f_area;
237
+ })
238
+ for (let q = 0; q < data.length; q++) {
239
+ let arraydata = {
240
+ 'label': data[q],
241
+ 'value': data[q]
242
+ }
243
+ if (array.length != 0) {
244
+ for (let w = 0; w < array.length; w++) {
245
+ if (array[w].label == data[q]) {
246
+ break
247
+ }
248
+ while (w == array.length - 1) {
249
+ array.push(arraydata)
250
+ break
251
+ }
252
+ }
253
+ } else {
254
+ array.push(arraydata)
255
+ }
256
+ }
257
+ this.show_data.fields[i].options = array
258
+ console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
259
+ }
260
+ if (this.show_data.fields[i].label == '街道') {
261
+ let data = []
262
+ let array = []
263
+ data = res.data.map(item => {
264
+ return item.f_street;
265
+ })
266
+ for (let q = 0; q < data.length; q++) {
267
+ let arraydata = {
268
+ 'label': data[q],
269
+ 'value': data[q]
270
+ }
271
+ if (array.length != 0) {
272
+ for (let w = 0; w < array.length; w++) {
273
+ if (array[w].label == data[q]) {
274
+ break
275
+ }
276
+ while (w == array.length - 1) {
277
+ array.push(arraydata)
278
+ break
279
+ }
280
+ }
281
+ } else {
282
+ array.push(arraydata)
283
+ }
284
+ }
285
+ this.show_data.fields[i].options = array
286
+ console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
287
+ }
288
+ }
289
+ }
290
+ },
291
+ // 初始化fields值
292
+ initializeFields() {
293
+
294
+ },
295
+ // 金额转大写
296
+ smalltoBIG(n) {
297
+ let fraction = ['角', '分'];
298
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
299
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
300
+ let head = n < 0 ? '欠' : '';
301
+ n = Math.abs(n);
302
+
303
+ let s = '';
304
+
305
+ for (var i = 0; i < fraction.length; i++) {
306
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
307
+ }
308
+ s = s || '整';
309
+ n = Math.floor(n);
310
+
311
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
312
+ let p = '';
313
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
314
+ p = digit[n % 10] + unit[1][j] + p;
315
+ n = Math.floor(n / 10);
316
+ }
317
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
318
+ }
319
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
320
+ },
321
+ getLableValue(label) {
322
+ for (const item of this.show_data.fields) {
323
+ if (item.label === label && item.type !== 'number') {
324
+ return item.value || ''
325
+ }
326
+ if (item.label === label && item.type === 'number') {
327
+ return item.value || 0
328
+ }
329
+ }
330
+ },
331
+ setLabelValue(label, value) {
332
+ for (const item of this.show_data.fields) {
333
+ if (item.label === label) {
334
+ item.value = value
335
+ }
336
+ }
337
+ },
338
+ async buttonBefore(model) {
339
+ if (
340
+ model.button.button_name === '提交' &&
341
+ model.defname === '收费' &&
342
+ (
343
+ model.f_apply_type === '散户报建' ||
344
+ model.f_apply_type === '工业户报建' ||
345
+ model.f_apply_type === '商业户报建'
346
+ ) &&
347
+ model.f_surplus_money > 0
348
+ ) {
349
+ throw '未结金额大于0,无法提交!!!'
350
+ }
351
+ if (model.defname === '施工' && model.button.button_name === '提交') {
352
+ let http = new HttpResetClass()
353
+ let data = {
354
+ f_process_id: model.f_process_id
355
+ }
356
+ let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
357
+ if (res.data[0].num > 0) {
358
+ throw `还有${res.data[0].num}户未安装,无法提交`
359
+ }
360
+ }
361
+ return model
362
+ },
363
+ // ========================= 武安 =================================
364
+ // 地址类型变化
365
+ addressType() {
366
+ for (const item of this.show_data.fields) {
367
+ if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
368
+ item.required = true
369
+ }
370
+ if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
371
+ item.required = false
372
+ }
373
+ if (
374
+ (
375
+ item.label === '楼号' ||
376
+ item.label === '单元' ||
377
+ item.label === '楼层' ||
378
+ item.label === '门牌号'
379
+ ) && this.show_data.f_address_type === '民用地址'
380
+ ) {
381
+ item.required = true
382
+ item.hidden = false
383
+ item.value = null
384
+ }
385
+ if (
386
+ (
387
+ item.label === '楼号' ||
388
+ item.label === '单元' ||
389
+ item.label === '楼层' ||
390
+ item.label === '门牌号'
391
+ ) && this.show_data.f_address_type === '特殊地址'
392
+ ) {
393
+ item.required = false
394
+ item.hidden = true
395
+ item.value = null
396
+ }
397
+ }
398
+ },
399
+ async getStreetList () {
400
+ let data = {
401
+ tablename: 't_street',
402
+ condition: `f_filialeid = ${this.$login.f.orgid} and f_street is not null`
403
+ }
404
+
405
+ let res = await this.$resetpost(
406
+ `rs/sql/singleTable`,
407
+ {data: data},
408
+ {resolveMsg: null, rejectMsg: '街道查询失败,请重新进入!!!'}
409
+ )
410
+
411
+ let streetList = []
412
+
413
+ res.data.forEach(item => {
414
+ streetList.push({
415
+ label: item.f_street,
416
+ value: item.f_street
417
+ })
418
+ })
419
+
420
+ for (const item of this.show_data.fields) {
421
+ if (item.label === '街道') {
422
+ item.options = streetList
423
+ }
424
+ }
425
+ },
426
+ async getAreaList () {
427
+ let data = {
428
+ tablename: 't_area',
429
+ condition: `f_filialeid = ${this.$login.f.orgid} and f_street = '${this.getLableValue('街道')}'`
430
+ }
431
+
432
+ let res = await this.$resetpost(
433
+ `rs/sql/singleTable`,
434
+ {data: data},
435
+ {resolveMsg: null, rejectMsg: '小区查询失败,请重新进入!!!'}
436
+ )
437
+
438
+ let areaList = []
439
+
440
+ res.data.forEach(item => {
441
+ areaList.push({
442
+ label: item.f_residential_area,
443
+ value: item.f_residential_area
444
+ })
445
+ })
446
+
447
+ for (const item of this.show_data.fields) {
448
+ if (item.label === '小区') {
449
+ item.options = areaList
450
+ }
451
+ }
452
+ }
453
+ // ========================= 武安 =================================
454
+ },
455
+ events: {
456
+ // ========================= 武安 =================================
457
+ // ========================= 武安 =================================
458
+ 'openAddModel'(index) {
459
+ // ========================= 武安 =================================
460
+ // ========================= 武安 =================================
461
+ },
462
+ // 获取view层button事件/
463
+ async 'button'(model) {
464
+ // 修改提交数据
465
+ model = Object.assign({}, this.selectdata, model)
466
+ // 点击重置按钮就重置数据
467
+ if (model.button.button_name === '重置') {
468
+ this.$dispatch('breakControl', this.data)
469
+ return
470
+ }
471
+ // 联合验收必须上传附件
472
+ if (model.defname === '联合验收' && model.button.button_name === '提交') {
473
+ let http = new HttpResetClass()
474
+ let data = {
475
+ tablename: 't_files',
476
+ condition: "f_blobid = '" + this.selectdata.f_process_id + "'"
477
+ }
478
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
479
+ if (!res.data.length > 0) {
480
+ this.$showMessage("您没有上传附件,无法提交!")
481
+ }
482
+ }
483
+
484
+ // 提交前置
485
+ try {
486
+ model = await this.buttonBefore(model)
487
+ } catch (e) {
488
+ this.$showAlert(e, 'warning', 3000)
489
+ return
490
+ }
491
+
492
+ let http = new HttpResetClass()
493
+ let requestData = {
494
+ tables: this.data.tables,
495
+ start_activity: this.$workflow_vue.start_activity,
496
+ model: model,
497
+ loginUser: this.$login.f,
498
+ workflow_xmlfilename: this.$workflow_vue.workflow_xmlfilename
499
+ }
500
+ // 下发,提交,保存,退回通用业务后台处理logic
501
+ let url = 'rs/logic/ApplyProductService'
502
+ let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
503
+
504
+ if (res.data.code == 200) {
505
+ this.$dispatch('search')
506
+ } else {
507
+ if (res.data.msg) {
508
+ this.$showMessage(res.data.msg)
509
+ }
510
+ }
511
+ },
512
+ async 'initializtionView'() {
513
+ // ========================= 武安 =================================
514
+ this.addressType()
515
+
516
+ if (this.show_data.defname === '用户受理' && this.show_data.f_apply_type === '散户报建') {
517
+ await this.getStreetList()
518
+ }
519
+ // ========================= 武安 =================================
520
+ },
521
+ // 失去焦点出触发事件
522
+ async 'onchange'(index) {
523
+ console.log('失去焦点')
524
+ // ========================= 武安 =================================
525
+ if (this.show_data.defname === '用户受理'){
526
+ if (this.show_data.fields[index].label === '地址类型'){
527
+ this.addressType()
528
+ }
529
+ if (this.show_data.fields[index].label === '街道' && this.show_data.f_apply_type !== '散户报建'){
530
+ console.log('-----------添加街道-----------')
531
+ if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
532
+ this.show_data.fields[index].value = null
533
+ this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
534
+ return
535
+ }
536
+ let http = new HttpResetClass()
537
+ let data = {
538
+ f_adjustable_id: '', // 调压箱编号
539
+ f_orgid: this.$login.f.orgid, // 组织id
540
+ f_orgname: this.$login.f.orgs, // 组织名
541
+ f_pcd: '河北省邯郸市武安市', // 省市区
542
+ f_pcd_id: 8, // 省市区id
543
+ // f_pcd_id: 124, // 50.4测试
544
+ f_slice_area: '', // 片区
545
+ f_operatorid: this.$login.f.id, // 操作人id
546
+ f_operator: this.$login.f.name, // 操作人
547
+ f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
548
+ f_street: this.show_data.fields[index].value.trim(), // 地址
549
+ f_comments: '报建系统自动创建' // 备注
550
+ }
551
+ try{
552
+ let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {resolveMsg: null, rejectMsg: null})
553
+ } catch (e) {
554
+ if (e.status === 635){
555
+ this.$showAlert('此街道已存在!!!', 'warning', 3000)
556
+ } else {
557
+ this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
558
+ }
559
+ }
560
+ }
561
+ if (this.show_data.fields[index].label === '街道' && this.show_data.f_apply_type === '散户报建') {
562
+ this.setLabelValue('小区', '')
563
+ await this.getAreaList()
564
+ }
565
+ if (this.show_data.fields[index].label === '小区' && this.show_data.f_apply_type !== '散户报建'){
566
+ if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
567
+ this.show_data.fields[index].value = null
568
+ this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
569
+ return
570
+ }
571
+ // 先查询街道
572
+ let street = null
573
+ for (const item of this.show_data.fields) {
574
+ if (item.label === '街道') {
575
+ if (item.value.trim() === null || item.value.trim() === ''){
576
+ this.show_data.fields[index].value = null
577
+ this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
578
+ return
579
+ }
580
+ let http = new HttpResetClass()
581
+ let data = {
582
+ condition: `1=1 and s.f_filialeid in ('${this.$login.f.orgid}') and f_province = '河北省' and f_city = '邯郸市' and f_district = '武安市' and f_street = '${item.value.trim()}'`
583
+ }
584
+ let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {resolveMsg: null, rejectMsg: null})
585
+ if (res.data.length > 0) {
586
+ street = res.data[0]
587
+ } else {
588
+ this.show_data.fields[index].value = null
589
+ this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
590
+ }
591
+ }
592
+ }
593
+ console.log('-----------添加小区-----------')
594
+ let data = {
595
+ f_linkname: '', // 联系人
596
+ f_linkphone: '', // 联系电话
597
+ f_adjustable_id: '', // 调压箱编号
598
+ f_user_type: '', // 用户类型
599
+ f_gasproperties: '', // 用气性质
600
+ f_meter_brand: '', // 气表品牌
601
+ f_price_name: '', // 气价名称
602
+ f_price_type: '', // 气价类型
603
+ f_meter_style: '', // 气表型号
604
+ f_position: '', // 表安装位置
605
+ f_meter_type: '', // 气表类型
606
+ f_area_id: '', // 小区编号 (自动生成)
607
+ f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
608
+ f_operatorid: this.$login.f.id, // 操作人id
609
+ f_operator: this.$login.f.name, // 操作人
610
+ f_orgid: this.$login.f.orgid, // 组织id
611
+ f_orgname: this.$login.f.orgs, // 组织名
612
+ f_pcd_id: 8, // 省市区id
613
+ // f_pcd_id: 124, // 50.4测试
614
+ f_pcd: '河北省邯郸市武安市', // 省市区
615
+ f_street_id: street.id, // 街道id
616
+ f_street: street.f_street,// 街道
617
+ f_area_code: '01', // 片区编码
618
+ f_slice_area: '武安片区', // 片区
619
+ // f_area_code: '66556', // 50.4测试
620
+ // f_slice_area: '武安明星', // 50.4测试
621
+ slice_area: [
622
+ {
623
+ name: '武安片区',
624
+ code: '01'
625
+ }
626
+ ],
627
+ // slice_area: [ // 50.4测试
628
+ // {
629
+ // name: '武安明星',
630
+ // code: '66556'
631
+ // }
632
+ // ],
633
+ f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
634
+ f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
635
+ f_comments: '报建系统自动创建'
636
+ }
637
+ try{
638
+ let http = new HttpResetClass()
639
+ let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {resolveMsg: null, rejectMsg: null})
640
+ } catch (e) {
641
+ if (e.status === 635){
642
+ this.$showAlert('此小区已存在!!!', 'warning', 3000)
643
+ } else {
644
+ this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
645
+ }
646
+ }
647
+ }
648
+ // 地址拼接
649
+ if (
650
+ this.show_data.fields[index].label === '区域' ||
651
+ this.show_data.fields[index].label === '街道' ||
652
+ this.show_data.fields[index].label === '小区' ||
653
+ this.show_data.fields[index].label === '楼号' ||
654
+ this.show_data.fields[index].label === '单元' ||
655
+ this.show_data.fields[index].label === '楼层' ||
656
+ this.show_data.fields[index].label === '门牌号'
657
+ ) {
658
+ let f_address = null
659
+ // if (this.show_data.f_address_type !== '民用地址') {
660
+ f_address = this.getLableValue('区域') + this.getLableValue('街道')
661
+ // }
662
+ this.setLabelValue('地址',f_address)
663
+ }
664
+ }
665
+ if (this.show_data.defname === '竣工验收') {
666
+ if (this.show_data.fields[index].label === '验收是否合格'){
667
+ for (const button of this.show_data.buttons) {
668
+ if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
669
+ button.hidden = false
670
+ } else {
671
+ button.hidden = true
672
+ }
673
+ }
674
+ }
675
+ }
676
+ if (this.show_data.defname === '合同签订') {
677
+ if (this.show_data.fields[index].label === '合同编号') {
678
+ if (!isEmpty(this.show_data.fields[index].value)) {
679
+ let http = new HttpResetClass()
680
+ let data = {
681
+ tablename: 't_apply',
682
+ condition: `f_contract_number='${this.show_data.fields[index].value}'`
683
+ }
684
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
685
+ resolveMsg: null,
686
+ rejectMsg: '合同编号查重失败'
687
+ })
688
+ if (res.data.length > 0) {
689
+ this.show_data.fields[index].value = null
690
+ this.$showAlert('合同编号已存在!!!', 'warning', 3000)
691
+ }
692
+ }
693
+ }
694
+ if (this.show_data.fields[index].label === '单价(户)') {
695
+ let http = new HttpResetClass()
696
+ let data = {
697
+ num1: this.getLableValue(this.show_data.fields[index].label),
698
+ num2: this.getLableValue('户数'),
699
+ operator: '*'
700
+ }
701
+ try {
702
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
703
+ resolveMsg: null,
704
+ rejectMsg: null
705
+ })
706
+ data = {
707
+ num1: res.data,
708
+ num2: this.getLableValue('其他费用'),
709
+ operator: '+'
710
+ }
711
+ res = await http.load('POST', 'rs/logic/compute', {data: data}, {
712
+ resolveMsg: null,
713
+ rejectMsg: null
714
+ })
715
+ this.setLabelValue('合同金额',res.data)
716
+ } catch (e) {
717
+ this.$showAlert(e.data.msg, 'warning', 3000)
718
+ }
719
+ }
720
+ if (this.show_data.fields[index].label === '其他费用') {
721
+ let http = new HttpResetClass()
722
+ let data = {
723
+ num1: this.getLableValue(this.show_data.fields[index].label),
724
+ num2: this.getLableValue('合同金额'),
725
+ operator: '+'
726
+ }
727
+ try {
728
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
729
+ resolveMsg: null,
730
+ rejectMsg: null
731
+ })
732
+ this.setLabelValue('合同金额',res.data)
733
+ } catch (e) {
734
+ this.$showAlert(e.data.msg, 'warning', 3000)
735
+ }
736
+ }
737
+ }
738
+ // ========================= 武安 =================================
739
+ // 号码检测
740
+ if (this.show_data.fields[index].label === '电话号码') {
741
+ let phone = this.show_data.fields[index].value
742
+ // 电话号码效验
743
+ if (!(/^1[3456789]\d{9}$/.test(phone))) {
744
+ this.show_data.fields[index].value = ""
745
+ this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
746
+ }
747
+ }
748
+ //时间提醒
749
+ if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
750
+ let setTime = this.show_data.fields[index].value
751
+ let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
752
+ if (nowTime >= setTime) {
753
+ this.$showMessage("请注意,当前节点时间/工期已过期!")
754
+ }
755
+ }
756
+ },
757
+ // input值发生变化
758
+ async 'oninput'(index) {
759
+
760
+ },
761
+ // 错误事件
762
+ error_check(index) {
763
+ // 时间格式检测
764
+ if (this.show_data.fields[index].type == 'datepicker') {
765
+ let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
766
+ let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
767
+ if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
768
+ this.show_data.fields[index].error.flag = false
769
+ } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
770
+ this.show_data.fields[index].error.flag = false
771
+ } else {
772
+ if (this.show_data.fields[index].fullsize) {
773
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
774
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
775
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
776
+ this.show_data.fields[index].error.flag = true
777
+ this.show_data.fields[index].value = ''
778
+ } else {
779
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
780
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
781
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
782
+ this.show_data.fields[index].error.flag = true
783
+ this.show_data.fields[index].value = ''
784
+ }
785
+
786
+ }
787
+ }
788
+ },
789
+ // onetomany模态框默认监听监听事件
790
+ async 'onetomanydelete'(i, j) {
791
+ console.log('默认删除')
792
+ let http = new HttpResetClass()
793
+ let data = {
794
+ table: this.show_data.onetomany[i].tables[0],
795
+ row: this.show_data.onetomany[i].rows[j]
796
+ }
797
+ let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
798
+ resolveMsg: null,
799
+ rejectMsg: '删除失败'
800
+ })
801
+
802
+ if (res.data <= 0){
803
+ this.$showMessage('删除失败')
804
+ return
805
+ }
806
+
807
+ this.$dispatch('breakControl', this.show_data)
808
+ },
809
+ async 'onetomanyadd'(index) {
810
+
811
+ let data = {
812
+ f_process_id : this.show_data.f_process_id
813
+ }
814
+ this.show_data.onetomany[index].fields.forEach(item => {
815
+ data[item.field] = item.value
816
+ })
817
+ let res = await this.$resetpost(
818
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
819
+ data
820
+ )
821
+ this.$dispatch('breakControl', this.show_data)
822
+ },
823
+ async 'onetomanyupdate'(i, j) {
824
+ let onetomany = this.show_data.onetomany[i]
825
+ let data = onetomany.rows[j]
826
+
827
+ onetomany.fields.forEach(item => {
828
+ data[item.field] = item.value
829
+ })
830
+ let res = await this.$resetpost(
831
+ `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
832
+ data
833
+ )
834
+
835
+ this.$dispatch('breakControl', this.show_data)
836
+ },
837
+ // onetomany模态框监听事件
838
+ async 'onchange_modal'(index, i) {
839
+ },
840
+ async 'oninput_modal'(index, i) {
841
+ }
842
+ },
843
+ watch: {
844
+ }
845
+ }
846
+ </script>
847
+ <style scoped>
848
+ /*清除model中的浮动*/
849
+ .clearfix:after,.clearfix:before{
850
+ display: table;
851
+ }
852
+ .clearfix:after{
853
+ clear: both;
854
+ }
855
+ </style>