apply-clients 5.0.35-ezhou-16 → 5.0.35-ezhou-18

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.
Files changed (20) hide show
  1. package/package.json +1 -1
  2. package/src/apply.js +1 -2
  3. package/src/components/product/EngineeringManagement/EngineerUpload.vue +304 -304
  4. package/src/components/product/EngineeringManagement/EngineeringSelect.vue +586 -586
  5. package/src/components/product/EngineeringSupervisory/EngineeringApplyStopInfo.vue +281 -281
  6. package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryControl.vue +132 -132
  7. package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryList.vue +340 -340
  8. package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryServiceControl.vue +490 -490
  9. package/src/components/product/Function/InstallInfoSelect.vue +255 -255
  10. package/src/components/product/Function/functions/BuyerMessage.vue +512 -512
  11. package/src/components/product/Overview/addMaterialScience.vue +217 -217
  12. package/src/components/product/Process/ExplorationSelect.vue +805 -805
  13. package/src/components/product/Process/Processes/Service/ApplyChargeSearch.vue +405 -405
  14. package/src/components/product/Process/Processes/Service/ServiceControl.vue +2285 -2285
  15. package/src/components/product/Process/Processes/selectUserinfo.vue +13 -11
  16. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +556 -556
  17. package/src/components/product/Supervisory/SupervisoryList.vue +435 -435
  18. package/src/components/product/report/ChargeMoneyReport.vue +150 -136
  19. package/src/components/product/stopInfo/ApplyStopInfo.vue +281 -281
  20. package/src/ezhouAndroid.js +48 -48
@@ -1,512 +1,512 @@
1
- <template>
2
- <div class="auto" style="padding-right:5px;" v-if="templateshow">
3
- <div class="panel panel-info">
4
- <div class="panel-heading" v-if="title_show">
5
- <h3 class="panel-title text-center"><span style="cursor: pointer;" class="pull-left">{{title}}</span></h3>
6
- </div>
7
- <div class="col-sm-12" v-for="(i,datagrid) in data.onetomany">
8
- <table v-show="!datagrid.hidden" class="table table-bordered table-striped table-hover">
9
- <tr style="background-color: #00A3F0">
10
- <th style="border-color: #00A3F0"><font color="white">序号</font></th>
11
- <th v-for="labels in datagrid.fields" style="text-align: center;border-color: #00A3F0">
12
- <nobr><font color="white">{{labels.label}}</font></nobr>
13
- </th>
14
- <th style="text-align: center;border-color: #00A3F0;padding: 0px">
15
- <button type="button" @click="$dispatch('add',i)" class="btn btn-warning">
16
- +
17
- </button>
18
- </th>
19
- </tr>
20
- <tr v-for="(j,row) in model.rows[i]">
21
- <td style="text-align: center">{{$index+1}}</td>
22
- <td v-for="key in surBodyData[i]" style="text-align: center">
23
- {{row[key]}}
24
- </td>
25
- <td style="text-align: center">
26
- <a href="#" @click="revise(i,j)">修改</a>
27
- |<a href="#" @click="deleted(i,j)">删除</a>
28
- </td>
29
- </tr>
30
- </table>
31
- </div>
32
- <!-- onetomany新增模态框 -->
33
- <div class="auto"
34
- style="margin-left: 20vw;max-width: 700px;max-hight:500px;z-index:8888;box-shadow: 0px 0px 100px 10px grey;position: fixed;"
35
- v-if="showadd">
36
- <div class="auto" style="background-color:white;">
37
- <div style="padding-top: 15px;padding-left: 15px;padding-right: 15px;border-bottom: 0px solid #e5e5e5;">
38
- <span><font size="3">{{modeltitle}}</font></span>
39
- <button type="button;float:right" class="close" @click="closemodal(modeltitle)"><span>&times;</span>
40
- </button>
41
- </div>
42
-            
43
- <div style="padding-top: 15px;border-top: 1px solid #e5e5e5;border-bottom: 1px solid #e5e5e5;">
44
- <div class="col-sm-12" v-for="(index,showadd_field) in showadd_fields.fields" v-if="refresh_modal">
45
- <label
46
- :class="showadd_field.required&&!showadd_fields.fields[index].value?'has-error control-label col-sm-3' : 'control-label col-sm-3'"
47
- style="margin-top: 10px" v-if="!showadd_field.hidden">{{showadd_field.label}}:</label>
48
- <div class="col-sm-7">
49
- <!--时间datepicker-->
50
- <div v-if="showadd_field.type=='datepicker'"
51
- :class="[showadd_fields[index].required&&!(showadd_fields.fields[index].value) ? 'has-error' : '']">
52
- <div>
53
- <datepicker
54
- :width="'100%'"
55
- :placeholder="showadd_field.placeholder"
56
- :value.sync="showadd_fields.fields[index].value"
57
- :format="'yyyy-MM-dd HH:mm:ss'"
58
- v-model="showadd_fields.fields[index].value"
59
- :readonly=true
60
- :disabled="showadd_fields.fields[index].disabled"
61
- @blur="check_disable"
62
- :show-reset-button="reset">
63
- </datepicker>
64
- </div>
65
- </div>
66
- <!--select-->
67
- <input-select
68
- @change="select_change_modal(index),disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
69
- v-if="showadd_field.type=='select'"
70
- :value.sync="showadd_fields.fields[index].value"
71
- v-model="showadd_fields.fields[index].value"
72
- :options='showadd_fields.fields[index].options'
73
- :class="showadd_field.required&&!showadd_fields.fields[index].value?'has-error form-control' : 'form-control'"
74
- @blur="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
75
- :mouseout="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)">
76
- </input-select>
77
- <!-- input -->
78
- <input :for="showadd_fields.fields[index].value" :type="showadd_field.type"
79
- @change="select_change_modal(index),check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
80
- v-if="(showadd_field.type=='input'||showadd_field.type=='number'||showadd_field.type=='email'||showadd_field.type=='url'||showadd_field.type=='range'||showadd_field.type=='search'||showadd_field.type=='color')&&!showadd_field.hidden"
81
- v-model="showadd_fields.fields[index].value"
82
- :value.sync="showadd_fields[index].value"
83
- @blur="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
84
- class="form-control"
85
- :mouseout="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"/>
86
- <span
87
- v-if="showadd_fields.fields[index].error&&showadd_fields.fields[index].error.msg&&showadd_fields.fields[index].error.flag"
88
- style="color: red">{{showadd_fields.fields[index].error.msg}}</span>
89
- </div>
90
- </div>
91
-          
92
- </div>
93
- <div
94
- style="padding-top: 15px;padding-left: 15px;padding-right: 15px;text-align: right;border-top: 0px solid #e5e5e5;">
95
- <button :class="disable_button_modal?'btn btn-default':'btn btn-primary'" v-show="showadd"
96
- :disabled="disable_button_modal" type="button" @click="acknowledge(modeltitle)">
97
- 确认
98
- </button>
99
- </div>
100
-  
101
- </div>
102
- </div>
103
-
104
- </div>
105
- </div>
106
- </template>
107
- <script>
108
- import {HttpResetClass} from 'vue-client'
109
- import Vue from 'vue'
110
-
111
- export default {
112
- title: '基本信息',
113
- props: ['griddata', 'gridtitle', 'selectdata'],
114
- data() {
115
- return {
116
- templateshow: true,
117
- title: '',
118
- title_show: true,
119
- tempid: null,
120
- data: null,
121
- surBodyData: [],
122
- refresh: true, // 控制重新渲染
123
- model: {
124
- rows: [],
125
- button: {
126
- button_name: null,
127
- button_index: null
128
- },
129
- f_filiale: null,
130
- f_parentname: null,
131
- f_operate_date: null,
132
- f_operator: null
133
- },
134
- showadd: false, // onetomany 新增模态框
135
- showadd_fields: [], // onetomany 新增模态框的字段配置
136
- data: null,
137
- showadd_index: null,
138
- showmodal: false,
139
- modeltitle: null,
140
- refresh_modal: true,
141
- disable_button_modal: true,
142
- }
143
- },
144
- ready() {
145
- // if(this.gridtitle){
146
- // this.title = this.gridtitle
147
- // }else {
148
- // this.title_show = false
149
- // }
150
- // this.data = this.griddata
151
- this.title = '购买方信息'
152
- this.data = {
153
- onetomany: [
154
- {
155
- tables: ["t_buyer_info"],
156
- safedelete: true,
157
- hidden: false,
158
- fields: [
159
- {
160
- label: "购货方名称",
161
- type: "input",
162
- bootstraped: "col-sm-4",
163
- label_bootstraped: "col-sm-3",
164
- value_bootstraped: "col-sm-9",
165
- field: "f_user_name",
166
- placeholder: "请输入",
167
- required: true,
168
- readonly: false
169
- },
170
- {
171
- label: "购货方纳税人识别号",
172
- type: "input",
173
- bootstraped: "col-sm-4",
174
- label_bootstraped: "col-sm-3",
175
- value_bootstraped: "col-sm-9",
176
- field: "f_buyer_identify",
177
- placeholder: "请输入",
178
- readonly: false,
179
- required: true,
180
- disabled: false,
181
- error: {
182
- flag: false,
183
- msg: '购货方纳税人识别号必须为15位,18位或者20位'
184
- }
185
- },
186
- {
187
- label: "购货方地址、电话",
188
- type: "input",
189
- bootstraped: "col-sm-4",
190
- label_bootstraped: "col-sm-3",
191
- value_bootstraped: "col-sm-9",
192
- field: "f_buyer_addphone",
193
- placeholder: "请输入",
194
- readonly: false,
195
- disabled: false
196
- },
197
- {
198
- label: "购货方开户行及账号",
199
- type: "input",
200
- bootstraped: "col-sm-4",
201
- label_bootstraped: "col-sm-3",
202
- value_bootstraped: "col-sm-9",
203
- field: "f_buyer_bank",
204
- placeholder: "请输入",
205
- readonly: false,
206
- disabled: false
207
- },
208
- {
209
- label: "购货方电子邮箱",
210
- type: "email",
211
- bootstraped: "col-sm-4",
212
- label_bootstraped: "col-sm-3",
213
- value_bootstraped: "col-sm-9",
214
- field: "f_buyer_email",
215
- placeholder: "请输入",
216
- readonly: false,
217
- disabled: false
218
- }
219
- ]
220
- }
221
- ]
222
- }
223
- this.load()
224
- },
225
- methods: {
226
- // 模态框级联操作预留
227
- select_change_modal(index) {
228
- if (this.showadd_fields.fields[index].value) {
229
- this.showadd_fields[index] = {}
230
- this.showadd_fields[index].value = this.showadd_fields.fields[index].value
231
- } else if (this.showadd_fields[index] && this.showadd_fields[index].value) {
232
- this.showadd_fields.fields[index].value = this.showadd_fields[index].value
233
- }
234
- this.refresh_modal = false
235
- this.$nextTick(() => {
236
- this.refresh_modal = true
237
- })
238
- // this.$dispatch('select_cascade_modal', index)
239
- if (this.showadd_fields.fields[index].label == '购货方纳税人识别号') {
240
- if (this.showadd_fields.fields[index].value.length != 15 && this.showadd_fields.fields[index].value.length != 18 && this.showadd_fields.fields[index].value.length != 20) {
241
- this.showadd_fields.fields[index].error.flag = true
242
- this.clear_showadd_fields_value(index)
243
- } else {
244
- this.showadd_fields.fields[index].error.flag = false
245
- }
246
- }
247
- },
248
- // 清理
249
- clear_showadd_fields_value(index) {
250
- this.showadd_fields.fields[index].value = ''
251
- this.showadd_fields[index].value = ''
252
- },
253
- // 检测模态框按钮的disable
254
- disabled_check_modal(required, value) {
255
- if (required && value) {
256
- this.disable_button_modal = false
257
-
258
- let fields = this.showadd_fields.fields
259
- let flag = false
260
- for (let i = 0; i < fields.length; i++) {
261
- if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
262
- flag = true
263
- }
264
- }
265
- this.disable_button_modal = flag
266
- }
267
- },
268
- check_disable_modal() {
269
- let fields = this.showadd_fields.fields
270
- let flag = false
271
- for (let i = 0; i < fields.length; i++) {
272
- if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
273
- flag = true
274
- }
275
- }
276
- let count = 0
277
- for (let i = 0; i < fields.length; i++) {
278
- if (fields[i].type !== 'checkbox' && !fields[i].required) {
279
- count++
280
- }
281
- }
282
- if (count = 0) {
283
- flag = false
284
- }
285
- this.disable_button_modal = flag
286
- },
287
- // 删除
288
- deleted(i, j) {
289
- this.$showMessage("您确定要删除这条记录吗?", ['confirm']).then((res) => {
290
- if (res == 'confirm') {
291
- this.onetomanydelete(i, j)
292
- }
293
- })
294
- },
295
- // 修改
296
- revise(index, index2) {
297
- this.showadd_fields = []
298
- let templet = new Object()
299
- templet = this.data.onetomany[index]
300
- for (let j = 0; j < templet.fields.length; j++) {
301
- if (templet.fields[j].type == 'input') {
302
- templet[j] = {}
303
- templet[j].value = this.model.rows[index][index2][templet.fields[j].field]
304
- templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
305
- } else {
306
- templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
307
- if (templet.fields[j].type == 'datepicker') {
308
- templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
309
- }
310
- }
311
- }
312
- this.tempid = this.model.rows[index][index2].id
313
- this.modeltitle = '修改'
314
- this.showadd_fields = templet
315
- this.showadd_index = index
316
- this.showadd = true
317
- },
318
- async onetomanydelete(i, j) {
319
- let http = new HttpResetClass()
320
- let data = {
321
- tables: this.data.onetomany[i].tables,
322
- row: this.model.rows[i][j]
323
- }
324
- await http.load('POST', 'rs/logic/applyDeleteValue', {data: data}, {
325
- resolveMsg: null,
326
- rejectMsg: 'onetomanydelete失败'
327
- }).then(() => {
328
- this.$dispatch('selfsearch')
329
- this.model.rows[i].splice(j, 1)
330
- })
331
- },
332
- //获取view层confirm事件
333
- async confirm(tables, row, showadd_index, j) {
334
- var _this = this
335
- for (let i = 0; i < tables.length; i++) {
336
- let datas = {
337
- tables: tables,
338
- row: row
339
- }
340
- datas.row['f_process_id'] = this.selectdata.f_process_id
341
- datas.row['f_apply_num'] = this.selectdata.f_apply_num
342
- datas.row['f_filiale'] = this.selectdata.f_filiale
343
- datas.row['f_operator'] = this.$login.f.name
344
- datas.row['f_parentname'] = this.$login.f.f_parentname
345
- datas.row['f_operator_date'] = new Date().Format("yyyy-MM-dd HH:mm:ss")
346
- let http = new HttpResetClass()
347
- if (tables[i] == 't_charge_record') {
348
- await http.load('POST', 'rs/logic/applycharge', datas, {
349
- resolveMsg: null,
350
- rejectMsg: '收费保存失败'
351
- }).then((res) => {
352
- for (let i = 0; i < this.data.fields.length; i++) {
353
-
354
- if (this.data.fields[i].label == '累计缴费金额') {
355
- this.data.fields[i].value = res.data.f_cumulative_money
356
- }
357
-
358
- if (this.data.fields[i].label == '未结总金额') {
359
- this.data.fields[i].value = res.data.f_unaccounts_money
360
- }
361
- }
362
- })
363
- } else {
364
- await http.load('POST', 'rs/logic/saveentity', datas, {
365
- resolveMsg: null,
366
- rejectMsg: 'onetomany保存失败'
367
- }).then((res) => {
368
- this.load()
369
- })
370
- }
371
- }
372
- },
373
- // 模态框点击确定按钮
374
- acknowledge(val) {
375
- let temp = {}
376
- console.log('点击按钮后的this.showadd_fields.fields=>' + JSON.stringify(this.showadd_fields.fields))
377
- for (let i = 0; i < this.showadd_fields.fields.length; i++) {
378
- if (this.showadd_fields.fields[i].value) {
379
- temp[this.showadd_fields.fields[i].field] = this.showadd_fields.fields[i].value
380
- } else {
381
- temp[this.showadd_fields.fields[i].field] = this.showadd_fields[i].value
382
- }
383
- }
384
- console.log('点击按钮后搜集到的页面数据temp=>' + JSON.stringify(temp))
385
- if (val == '新增') {
386
- console.log('即将新增记录,新增数据=>' + JSON.stringify(temp))
387
- console.log('this.model.rows[this.showadd_index]=>' + JSON.stringify(this.model.rows[this.showadd_index]))
388
- this.model.rows[this.showadd_index].push(temp)
389
- this.confirm(this.data.onetomany[this.showadd_index].tables, temp, this.showadd_index, this.model.rows[this.showadd_index].length - 1)
390
- this.closemodal(val)
391
- } else if (val == '修改') {
392
- console.log(`修改信息=======>${JSON.stringify(temp)}`)
393
- temp.id = this.tempid
394
- this.confirm(this.data.onetomany[this.showadd_index].tables, temp, this.showadd_index, this.model.rows[this.showadd_index].length - 1)
395
- this.closemodal(val)
396
- }
397
- },
398
- // 关闭模态框
399
- closemodal() {
400
- console.log('进入关闭模态框方法,先清空数据this.showadd_fields,目前数据=>' + JSON.stringify(this.showadd_fields))
401
- for (let i = 0; i < this.showadd_fields.fields.length; i++) {
402
- if (this.showadd_fields[i] && this.showadd_fields[i].value) {
403
- this.showadd_fields[i].value = ''
404
- }
405
- if (this.showadd_fields.fields[i] && this.showadd_fields.fields[i].value) {
406
- this.showadd_fields.fields[i].value = ''
407
- }
408
- }
409
-
410
- this.showadd_fields = null
411
- this.showadd = false
412
- this.disable_button_modal = true
413
- this.modeltitle = null
414
- this.tempid = null
415
- },
416
- async load() {
417
- let index = 0
418
- this.model = Object.assign({}, this.model, this.griddata)
419
- let http = new HttpResetClass()
420
- let data = {
421
- tablename: this.data.onetomany[index].tables[0],
422
- condition: `f_apply_num = '${this.selectdata.f_apply_num}' and f_process_id='${this.selectdata.f_process_id}'`
423
- }
424
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
425
- resolveMsg: null,
426
- rejectMsg: 'onetomany查询失败'
427
- })
428
- // 初始化 onetomany
429
- let rows = []
430
- console.log('查询返回结果res.data=>' + JSON.stringify(res.data))
431
- this.data.onetomany[index].rows = res.data
432
- console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
433
-
434
- // 初始化onetomany中的fields
435
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
436
- // 如果配置类型为select,优先从参数列表获取options
437
- if (this.data.onetomany[index].fields[j].type === 'select') {
438
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
439
- if (temp && temp.length > 0) {
440
- this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
441
- }
442
- }
443
- }
444
- this.model.rows = []
445
- this.surBodyData = []
446
- if (this.data.onetomany && this.data.onetomany.length > 0) {
447
- for (let i = 0; i < this.data.onetomany.length; i++) {
448
- let temp = []
449
- for (let j = 0; j < this.data.onetomany[i].fields.length; j++) {
450
- temp.push(this.data.onetomany[i].fields[j].field)
451
- }
452
- this.surBodyData.push(temp)
453
- }
454
- for (let i = 0; i < this.data.onetomany.length; i++) {
455
- if (this.data.onetomany[i].rows) {
456
- this.model.rows.push(this.data.onetomany[i].rows)
457
- }
458
- }
459
- }
460
- this.templateshow = false
461
- this.$nextTick(() => {
462
- this.templateshow = true
463
- })
464
- }
465
- },
466
- events: {
467
- 'add'(index) {
468
- let templet = new Object()
469
- templet = this.data.onetomany[index]
470
- for (let j = 0; j < templet.fields.length; j++) {
471
- templet.fields[j].value = ''
472
- if (templet.fields[j].type == 'datepicker') {
473
- templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
474
- }
475
- }
476
- this.modeltitle = '新增'
477
- this.showadd_fields = templet
478
- this.showadd_index = index
479
- this.showadd = true
480
- }
481
- },
482
- computed: {},
483
- watch: {
484
- 'selectdata'(){
485
- this.load()
486
- },
487
- deep:true
488
- }
489
- }
490
-
491
- // Date格式化
492
- Date.prototype.Format = function (fmt) {
493
- var o = {
494
- "M+": this.getMonth() + 1, //月份
495
- "d+": this.getDate(), //日
496
- "H+": this.getHours(), //小时
497
- "m+": this.getMinutes(), //分
498
- "s+": this.getSeconds(), //秒
499
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
500
- "S": this.getMilliseconds() //毫秒
501
- };
502
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
503
- for (var k in o)
504
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
505
- return fmt;
506
- }
507
- </script>
508
- <style scoped>
509
- tr {
510
- height: 34px;
511
- }
512
- </style>
1
+ <template>
2
+ <div class="auto" style="padding-right:5px;" v-if="templateshow">
3
+ <div class="panel panel-info">
4
+ <div class="panel-heading" v-if="title_show">
5
+ <h3 class="panel-title text-center"><span style="cursor: pointer;" class="pull-left">{{title}}</span></h3>
6
+ </div>
7
+ <div class="col-sm-12" v-for="(i,datagrid) in data.onetomany">
8
+ <table v-show="!datagrid.hidden" class="table table-bordered table-striped table-hover">
9
+ <tr style="background-color: #00A3F0">
10
+ <th style="border-color: #00A3F0"><font color="white">序号</font></th>
11
+ <th v-for="labels in datagrid.fields" style="text-align: center;border-color: #00A3F0">
12
+ <nobr><font color="white">{{labels.label}}</font></nobr>
13
+ </th>
14
+ <th style="text-align: center;border-color: #00A3F0;padding: 0px">
15
+ <button type="button" @click="$dispatch('add',i)" class="btn btn-warning">
16
+ +
17
+ </button>
18
+ </th>
19
+ </tr>
20
+ <tr v-for="(j,row) in model.rows[i]">
21
+ <td style="text-align: center">{{$index+1}}</td>
22
+ <td v-for="key in surBodyData[i]" style="text-align: center">
23
+ {{row[key]}}
24
+ </td>
25
+ <td style="text-align: center">
26
+ <a href="#" @click="revise(i,j)">修改</a>
27
+ |<a href="#" @click="deleted(i,j)">删除</a>
28
+ </td>
29
+ </tr>
30
+ </table>
31
+ </div>
32
+ <!-- onetomany新增模态框 -->
33
+ <div class="auto"
34
+ style="margin-left: 20vw;max-width: 700px;max-hight:500px;z-index:8888;box-shadow: 0px 0px 100px 10px grey;position: fixed;"
35
+ v-if="showadd">
36
+ <div class="auto" style="background-color:white;">
37
+ <div style="padding-top: 15px;padding-left: 15px;padding-right: 15px;border-bottom: 0px solid #e5e5e5;">
38
+ <span><font size="3">{{modeltitle}}</font></span>
39
+ <button type="button;float:right" class="close" @click="closemodal(modeltitle)"><span>&times;</span>
40
+ </button>
41
+ </div>
42
+            
43
+ <div style="padding-top: 15px;border-top: 1px solid #e5e5e5;border-bottom: 1px solid #e5e5e5;">
44
+ <div class="col-sm-12" v-for="(index,showadd_field) in showadd_fields.fields" v-if="refresh_modal">
45
+ <label
46
+ :class="showadd_field.required&&!showadd_fields.fields[index].value?'has-error control-label col-sm-3' : 'control-label col-sm-3'"
47
+ style="margin-top: 10px" v-if="!showadd_field.hidden">{{showadd_field.label}}:</label>
48
+ <div class="col-sm-7">
49
+ <!--时间datepicker-->
50
+ <div v-if="showadd_field.type=='datepicker'"
51
+ :class="[showadd_fields[index].required&&!(showadd_fields.fields[index].value) ? 'has-error' : '']">
52
+ <div>
53
+ <datepicker
54
+ :width="'100%'"
55
+ :placeholder="showadd_field.placeholder"
56
+ :value.sync="showadd_fields.fields[index].value"
57
+ :format="'yyyy-MM-dd HH:mm:ss'"
58
+ v-model="showadd_fields.fields[index].value"
59
+ :readonly=true
60
+ :disabled="showadd_fields.fields[index].disabled"
61
+ @blur="check_disable"
62
+ :show-reset-button="reset">
63
+ </datepicker>
64
+ </div>
65
+ </div>
66
+ <!--select-->
67
+ <input-select
68
+ @change="select_change_modal(index),disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
69
+ v-if="showadd_field.type=='select'"
70
+ :value.sync="showadd_fields.fields[index].value"
71
+ v-model="showadd_fields.fields[index].value"
72
+ :options='showadd_fields.fields[index].options'
73
+ :class="showadd_field.required&&!showadd_fields.fields[index].value?'has-error form-control' : 'form-control'"
74
+ @blur="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
75
+ :mouseout="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)">
76
+ </input-select>
77
+ <!-- input -->
78
+ <input :for="showadd_fields.fields[index].value" :type="showadd_field.type"
79
+ @change="select_change_modal(index),check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
80
+ v-if="(showadd_field.type=='input'||showadd_field.type=='number'||showadd_field.type=='email'||showadd_field.type=='url'||showadd_field.type=='range'||showadd_field.type=='search'||showadd_field.type=='color')&&!showadd_field.hidden"
81
+ v-model="showadd_fields.fields[index].value"
82
+ :value.sync="showadd_fields[index].value"
83
+ @blur="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
84
+ class="form-control"
85
+ :mouseout="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"/>
86
+ <span
87
+ v-if="showadd_fields.fields[index].error&&showadd_fields.fields[index].error.msg&&showadd_fields.fields[index].error.flag"
88
+ style="color: red">{{showadd_fields.fields[index].error.msg}}</span>
89
+ </div>
90
+ </div>
91
+          
92
+ </div>
93
+ <div
94
+ style="padding-top: 15px;padding-left: 15px;padding-right: 15px;text-align: right;border-top: 0px solid #e5e5e5;">
95
+ <button :class="disable_button_modal?'btn btn-default':'btn btn-primary'" v-show="showadd"
96
+ :disabled="disable_button_modal" type="button" @click="acknowledge(modeltitle)">
97
+ 确认
98
+ </button>
99
+ </div>
100
+  
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+ </div>
106
+ </template>
107
+ <script>
108
+ import {HttpResetClass} from 'vue-client'
109
+ import Vue from 'vue'
110
+
111
+ export default {
112
+ title: '基本信息',
113
+ props: ['griddata', 'gridtitle', 'selectdata'],
114
+ data() {
115
+ return {
116
+ templateshow: true,
117
+ title: '',
118
+ title_show: true,
119
+ tempid: null,
120
+ data: null,
121
+ surBodyData: [],
122
+ refresh: true, // 控制重新渲染
123
+ model: {
124
+ rows: [],
125
+ button: {
126
+ button_name: null,
127
+ button_index: null
128
+ },
129
+ f_filiale: null,
130
+ f_parentname: null,
131
+ f_operate_date: null,
132
+ f_operator: null
133
+ },
134
+ showadd: false, // onetomany 新增模态框
135
+ showadd_fields: [], // onetomany 新增模态框的字段配置
136
+ data: null,
137
+ showadd_index: null,
138
+ showmodal: false,
139
+ modeltitle: null,
140
+ refresh_modal: true,
141
+ disable_button_modal: true,
142
+ }
143
+ },
144
+ ready() {
145
+ // if(this.gridtitle){
146
+ // this.title = this.gridtitle
147
+ // }else {
148
+ // this.title_show = false
149
+ // }
150
+ // this.data = this.griddata
151
+ this.title = '购买方信息'
152
+ this.data = {
153
+ onetomany: [
154
+ {
155
+ tables: ["t_buyer_info"],
156
+ safedelete: true,
157
+ hidden: false,
158
+ fields: [
159
+ {
160
+ label: "购货方名称",
161
+ type: "input",
162
+ bootstraped: "col-sm-4",
163
+ label_bootstraped: "col-sm-3",
164
+ value_bootstraped: "col-sm-9",
165
+ field: "f_user_name",
166
+ placeholder: "请输入",
167
+ required: true,
168
+ readonly: false
169
+ },
170
+ {
171
+ label: "购货方纳税人识别号",
172
+ type: "input",
173
+ bootstraped: "col-sm-4",
174
+ label_bootstraped: "col-sm-3",
175
+ value_bootstraped: "col-sm-9",
176
+ field: "f_buyer_identify",
177
+ placeholder: "请输入",
178
+ readonly: false,
179
+ required: true,
180
+ disabled: false,
181
+ error: {
182
+ flag: false,
183
+ msg: '购货方纳税人识别号必须为15位,18位或者20位'
184
+ }
185
+ },
186
+ {
187
+ label: "购货方地址、电话",
188
+ type: "input",
189
+ bootstraped: "col-sm-4",
190
+ label_bootstraped: "col-sm-3",
191
+ value_bootstraped: "col-sm-9",
192
+ field: "f_buyer_addphone",
193
+ placeholder: "请输入",
194
+ readonly: false,
195
+ disabled: false
196
+ },
197
+ {
198
+ label: "购货方开户行及账号",
199
+ type: "input",
200
+ bootstraped: "col-sm-4",
201
+ label_bootstraped: "col-sm-3",
202
+ value_bootstraped: "col-sm-9",
203
+ field: "f_buyer_bank",
204
+ placeholder: "请输入",
205
+ readonly: false,
206
+ disabled: false
207
+ },
208
+ {
209
+ label: "购货方电子邮箱",
210
+ type: "email",
211
+ bootstraped: "col-sm-4",
212
+ label_bootstraped: "col-sm-3",
213
+ value_bootstraped: "col-sm-9",
214
+ field: "f_buyer_email",
215
+ placeholder: "请输入",
216
+ readonly: false,
217
+ disabled: false
218
+ }
219
+ ]
220
+ }
221
+ ]
222
+ }
223
+ this.load()
224
+ },
225
+ methods: {
226
+ // 模态框级联操作预留
227
+ select_change_modal(index) {
228
+ if (this.showadd_fields.fields[index].value) {
229
+ this.showadd_fields[index] = {}
230
+ this.showadd_fields[index].value = this.showadd_fields.fields[index].value
231
+ } else if (this.showadd_fields[index] && this.showadd_fields[index].value) {
232
+ this.showadd_fields.fields[index].value = this.showadd_fields[index].value
233
+ }
234
+ this.refresh_modal = false
235
+ this.$nextTick(() => {
236
+ this.refresh_modal = true
237
+ })
238
+ // this.$dispatch('select_cascade_modal', index)
239
+ if (this.showadd_fields.fields[index].label == '购货方纳税人识别号') {
240
+ if (this.showadd_fields.fields[index].value.length != 15 && this.showadd_fields.fields[index].value.length != 18 && this.showadd_fields.fields[index].value.length != 20) {
241
+ this.showadd_fields.fields[index].error.flag = true
242
+ this.clear_showadd_fields_value(index)
243
+ } else {
244
+ this.showadd_fields.fields[index].error.flag = false
245
+ }
246
+ }
247
+ },
248
+ // 清理
249
+ clear_showadd_fields_value(index) {
250
+ this.showadd_fields.fields[index].value = ''
251
+ this.showadd_fields[index].value = ''
252
+ },
253
+ // 检测模态框按钮的disable
254
+ disabled_check_modal(required, value) {
255
+ if (required && value) {
256
+ this.disable_button_modal = false
257
+
258
+ let fields = this.showadd_fields.fields
259
+ let flag = false
260
+ for (let i = 0; i < fields.length; i++) {
261
+ if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
262
+ flag = true
263
+ }
264
+ }
265
+ this.disable_button_modal = flag
266
+ }
267
+ },
268
+ check_disable_modal() {
269
+ let fields = this.showadd_fields.fields
270
+ let flag = false
271
+ for (let i = 0; i < fields.length; i++) {
272
+ if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
273
+ flag = true
274
+ }
275
+ }
276
+ let count = 0
277
+ for (let i = 0; i < fields.length; i++) {
278
+ if (fields[i].type !== 'checkbox' && !fields[i].required) {
279
+ count++
280
+ }
281
+ }
282
+ if (count = 0) {
283
+ flag = false
284
+ }
285
+ this.disable_button_modal = flag
286
+ },
287
+ // 删除
288
+ deleted(i, j) {
289
+ this.$showMessage("您确定要删除这条记录吗?", ['confirm']).then((res) => {
290
+ if (res == 'confirm') {
291
+ this.onetomanydelete(i, j)
292
+ }
293
+ })
294
+ },
295
+ // 修改
296
+ revise(index, index2) {
297
+ this.showadd_fields = []
298
+ let templet = new Object()
299
+ templet = this.data.onetomany[index]
300
+ for (let j = 0; j < templet.fields.length; j++) {
301
+ if (templet.fields[j].type == 'input') {
302
+ templet[j] = {}
303
+ templet[j].value = this.model.rows[index][index2][templet.fields[j].field]
304
+ templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
305
+ } else {
306
+ templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
307
+ if (templet.fields[j].type == 'datepicker') {
308
+ templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
309
+ }
310
+ }
311
+ }
312
+ this.tempid = this.model.rows[index][index2].id
313
+ this.modeltitle = '修改'
314
+ this.showadd_fields = templet
315
+ this.showadd_index = index
316
+ this.showadd = true
317
+ },
318
+ async onetomanydelete(i, j) {
319
+ let http = new HttpResetClass()
320
+ let data = {
321
+ tables: this.data.onetomany[i].tables,
322
+ row: this.model.rows[i][j]
323
+ }
324
+ await http.load('POST', 'rs/logic/applyDeleteValue', {data: data}, {
325
+ resolveMsg: null,
326
+ rejectMsg: 'onetomanydelete失败'
327
+ }).then(() => {
328
+ this.$dispatch('selfsearch')
329
+ this.model.rows[i].splice(j, 1)
330
+ })
331
+ },
332
+ //获取view层confirm事件
333
+ async confirm(tables, row, showadd_index, j) {
334
+ var _this = this
335
+ for (let i = 0; i < tables.length; i++) {
336
+ let datas = {
337
+ tables: tables,
338
+ row: row
339
+ }
340
+ datas.row['f_process_id'] = this.selectdata.f_process_id
341
+ datas.row['f_apply_num'] = this.selectdata.f_apply_num
342
+ datas.row['f_filiale'] = this.selectdata.f_filiale
343
+ datas.row['f_operator'] = this.$login.f.name
344
+ datas.row['f_parentname'] = this.$login.f.f_parentname
345
+ datas.row['f_operator_date'] = new Date().Format("yyyy-MM-dd HH:mm:ss")
346
+ let http = new HttpResetClass()
347
+ if (tables[i] == 't_charge_record') {
348
+ await http.load('POST', 'rs/logic/applycharge', datas, {
349
+ resolveMsg: null,
350
+ rejectMsg: '收费保存失败'
351
+ }).then((res) => {
352
+ for (let i = 0; i < this.data.fields.length; i++) {
353
+
354
+ if (this.data.fields[i].label == '累计缴费金额') {
355
+ this.data.fields[i].value = res.data.f_cumulative_money
356
+ }
357
+
358
+ if (this.data.fields[i].label == '未结总金额') {
359
+ this.data.fields[i].value = res.data.f_unaccounts_money
360
+ }
361
+ }
362
+ })
363
+ } else {
364
+ await http.load('POST', 'rs/logic/saveentity', datas, {
365
+ resolveMsg: null,
366
+ rejectMsg: 'onetomany保存失败'
367
+ }).then((res) => {
368
+ this.load()
369
+ })
370
+ }
371
+ }
372
+ },
373
+ // 模态框点击确定按钮
374
+ acknowledge(val) {
375
+ let temp = {}
376
+ console.log('点击按钮后的this.showadd_fields.fields=>' + JSON.stringify(this.showadd_fields.fields))
377
+ for (let i = 0; i < this.showadd_fields.fields.length; i++) {
378
+ if (this.showadd_fields.fields[i].value) {
379
+ temp[this.showadd_fields.fields[i].field] = this.showadd_fields.fields[i].value
380
+ } else {
381
+ temp[this.showadd_fields.fields[i].field] = this.showadd_fields[i].value
382
+ }
383
+ }
384
+ console.log('点击按钮后搜集到的页面数据temp=>' + JSON.stringify(temp))
385
+ if (val == '新增') {
386
+ console.log('即将新增记录,新增数据=>' + JSON.stringify(temp))
387
+ console.log('this.model.rows[this.showadd_index]=>' + JSON.stringify(this.model.rows[this.showadd_index]))
388
+ this.model.rows[this.showadd_index].push(temp)
389
+ this.confirm(this.data.onetomany[this.showadd_index].tables, temp, this.showadd_index, this.model.rows[this.showadd_index].length - 1)
390
+ this.closemodal(val)
391
+ } else if (val == '修改') {
392
+ console.log(`修改信息=======>${JSON.stringify(temp)}`)
393
+ temp.id = this.tempid
394
+ this.confirm(this.data.onetomany[this.showadd_index].tables, temp, this.showadd_index, this.model.rows[this.showadd_index].length - 1)
395
+ this.closemodal(val)
396
+ }
397
+ },
398
+ // 关闭模态框
399
+ closemodal() {
400
+ console.log('进入关闭模态框方法,先清空数据this.showadd_fields,目前数据=>' + JSON.stringify(this.showadd_fields))
401
+ for (let i = 0; i < this.showadd_fields.fields.length; i++) {
402
+ if (this.showadd_fields[i] && this.showadd_fields[i].value) {
403
+ this.showadd_fields[i].value = ''
404
+ }
405
+ if (this.showadd_fields.fields[i] && this.showadd_fields.fields[i].value) {
406
+ this.showadd_fields.fields[i].value = ''
407
+ }
408
+ }
409
+
410
+ this.showadd_fields = null
411
+ this.showadd = false
412
+ this.disable_button_modal = true
413
+ this.modeltitle = null
414
+ this.tempid = null
415
+ },
416
+ async load() {
417
+ let index = 0
418
+ this.model = Object.assign({}, this.model, this.griddata)
419
+ let http = new HttpResetClass()
420
+ let data = {
421
+ tablename: this.data.onetomany[index].tables[0],
422
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' and f_process_id='${this.selectdata.f_process_id}'`
423
+ }
424
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
425
+ resolveMsg: null,
426
+ rejectMsg: 'onetomany查询失败'
427
+ })
428
+ // 初始化 onetomany
429
+ let rows = []
430
+ console.log('查询返回结果res.data=>' + JSON.stringify(res.data))
431
+ this.data.onetomany[index].rows = res.data
432
+ console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
433
+
434
+ // 初始化onetomany中的fields
435
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
436
+ // 如果配置类型为select,优先从参数列表获取options
437
+ if (this.data.onetomany[index].fields[j].type === 'select') {
438
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
439
+ if (temp && temp.length > 0) {
440
+ this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
441
+ }
442
+ }
443
+ }
444
+ this.model.rows = []
445
+ this.surBodyData = []
446
+ if (this.data.onetomany && this.data.onetomany.length > 0) {
447
+ for (let i = 0; i < this.data.onetomany.length; i++) {
448
+ let temp = []
449
+ for (let j = 0; j < this.data.onetomany[i].fields.length; j++) {
450
+ temp.push(this.data.onetomany[i].fields[j].field)
451
+ }
452
+ this.surBodyData.push(temp)
453
+ }
454
+ for (let i = 0; i < this.data.onetomany.length; i++) {
455
+ if (this.data.onetomany[i].rows) {
456
+ this.model.rows.push(this.data.onetomany[i].rows)
457
+ }
458
+ }
459
+ }
460
+ this.templateshow = false
461
+ this.$nextTick(() => {
462
+ this.templateshow = true
463
+ })
464
+ }
465
+ },
466
+ events: {
467
+ 'add'(index) {
468
+ let templet = new Object()
469
+ templet = this.data.onetomany[index]
470
+ for (let j = 0; j < templet.fields.length; j++) {
471
+ templet.fields[j].value = ''
472
+ if (templet.fields[j].type == 'datepicker') {
473
+ templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
474
+ }
475
+ }
476
+ this.modeltitle = '新增'
477
+ this.showadd_fields = templet
478
+ this.showadd_index = index
479
+ this.showadd = true
480
+ }
481
+ },
482
+ computed: {},
483
+ watch: {
484
+ 'selectdata'(){
485
+ this.load()
486
+ },
487
+ deep:true
488
+ }
489
+ }
490
+
491
+ // Date格式化
492
+ Date.prototype.Format = function (fmt) {
493
+ var o = {
494
+ "M+": this.getMonth() + 1, //月份
495
+ "d+": this.getDate(), //日
496
+ "H+": this.getHours(), //小时
497
+ "m+": this.getMinutes(), //分
498
+ "s+": this.getSeconds(), //秒
499
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
500
+ "S": this.getMilliseconds() //毫秒
501
+ };
502
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
503
+ for (var k in o)
504
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
505
+ return fmt;
506
+ }
507
+ </script>
508
+ <style scoped>
509
+ tr {
510
+ height: 34px;
511
+ }
512
+ </style>