apply-clients 5.0.35-41 → 5.0.35-44

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.
@@ -1,787 +1,790 @@
1
- <template>
2
- <div class="auto select-overspread">
3
- <div v-if="data.back_reason" class="panel panel-info">
4
- <span style="color: red"> 请注意被退回原因为:{{ data.back_reason }}</span>
5
- </div>
6
- <validator name="v">
7
- <form class="form-horizontal">
8
- <div class="col-sm-11 form-group">
9
- <div v-for="(index,item) in data.fields">
10
- <!--input-->
11
- <div v-if="item.type==='input'" v-show="!item.hidden"
12
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-4 form-group']">
13
- <label
14
- :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-6'">{{
15
- item.label
16
- }}:</label>
17
- <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'">
18
- <input class="form-control"
19
- :type="item.type"
20
- v-model="data.fields[index].value"
21
- :placeholder="item.placeholder"
22
- :value="data.fields[index].value"
23
- :readonly="item.readonly"
24
- :disable="item.disable"
25
- @change="disabled_check(index,data.fields[index].required,data.fields[index].value)"
26
- @blur="check_disable"
27
- />
28
- </div>
29
- </div>
30
- <!--number-->
31
- <div v-if="item.type==='number'" v-show="!item.hidden"
32
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-4 form-group']">
33
- <label
34
- :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-6'">{{
35
- item.label
36
- }}:</label>
37
- <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'">
38
- <input class="form-control"
39
- :type="item.type"
40
- v-model="data.fields[index].value"
41
- :placeholder="item.placeholder"
42
- :value="data.fields[index].value"
43
- :readonly="item.readonly"
44
- :disable="item.disable"
45
- @change="disabled_check(index,data.fields[index].required,data.fields[index].value)"
46
- @blur="check_disable"
47
- />
48
- </div>
49
- </div>
50
-
51
- <!--时间datepicker-->
52
- <div v-if="item.type==='datepicker'"
53
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-xs-12 form-group']">
54
- <label style="margin-top: 0.7em"
55
- :class="item.label_bootstraped?item.label_bootstraped +' control-label':'control-label col-sm-6'">{{
56
- item.label
57
- }}:</label>
58
- <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'">
59
- <datepicker
60
- :placeholder="item.placeholder"
61
- :value.sync="data.fields[index].value"
62
- :format="'yyyy-MM-dd HH:mm:ss'"
63
- v-model="data.fields[index].value"
64
- :width="'100%'"
65
- class="form-control"
66
- :readonly="item.readonly"
67
- :disabled="item.disabled"
68
- @blur="check_disable"
69
- :show-reset-button="reset">
70
- </datepicker>
71
- </div>
72
- </div>
73
-
74
-
75
- <!--textarea-->
76
- <div v-if="item.type==='textarea'"
77
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-12 form-group']">
78
- <label
79
- :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-2'">{{
80
- item.label
81
- }}:</label>
82
- <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-10'">
83
- <textarea
84
- :readonly="item.readonly"
85
- :disabled="item.disabled"
86
- class="form-control"
87
- :rows="item.rows"
88
- v-model="data.fields[index].value"
89
- @change="disabled_check(index,data.fields[index].required,data.fields[index].value)"
90
- @blur="check_disable"
91
- >
92
- </textarea>
93
- </div>
94
- </div>
95
-
96
- <!--radio-->
97
- <div v-if="item.type==='radio'"
98
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-12 form-group']">
99
- <label v-if="item.label"
100
- :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-2'">{{
101
- item.label
102
- }}:</label>
103
- <div class="col-xs-12">
104
- <div
105
- :class="item.value_bootstraped?item.value_bootstraped:item.items.length%2 == 0?'col-xs-5': 'col-xs-3'"
106
- v-for="(index2,row) in item.items">
107
- <label style="margin-top: 0.7em" for="row.label"
108
- :class="item.items.length%2 == 0?'col-xs-4': 'col-xs-2'">{{ row.label }}</label>
109
- <input @blur="check_disable" :class="item.items.length%2 == 0?'col-xs-1': 'col-xs-1'"
110
- :readonly="item.readonly" :disabled="item.disabled" style="margin-top: 10px" type="radio"
111
- :name="index" :id="row.label" v-bind:value="data.fields[index].items[index2].value"
112
- v-model="data.fields[index].value">
113
- </div>
114
- </div>
115
- </div>
116
-
117
- <!--select-->
118
- <div v-if="item.type==='select'"
119
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-4 form-group']">
120
- <label
121
- :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-6'">{{
122
- item.label
123
- }}:</label>
124
- <input-select :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'" @blur="check_disable"
125
- @change="select_change(index),disabled_check(index,data.fields[index].required,data.fields[index].value)"
126
- :readonly="item.readonly" :disable="item.disabled" :value.sync="data.fields[index].value"
127
- v-model="data.fields[index].value"
128
- :options='item.options' :valueSingle="true"></input-select>
129
-
130
- </div>
131
-
132
- <!--checkbox-->
133
- <div v-if="item.type==='checkbox'"
134
- :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-12 form-group']">
135
- <label v-if="item.label"
136
- :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-2'">{{
137
- item.label
138
- }}:</label>
139
- <div style="margin-top: 0.7em"
140
- :class="item.value_bootstraped?item.value_bootstraped:'control-label col-sm-2'"
141
- v-for="(index2,row) in item.items">
142
- <label class="font-size form-group col-sm-6">{{ row.label }}</label>
143
- <input :readonly="item.readonly" :disabled="item.disabled" type="checkbox" class="col-sm-6"
144
- :id="row.label" v-model="data.fields[index].items[index2].value">
145
- </div>
146
- </div>
147
-
148
-
149
- </div>
150
- </div>
151
- <div class="form-group col-sm-11">
152
- <label class="text-left font">现场照片</label>
153
-
154
- <div class="auto">
155
- <div class="panel" style="padding: 10px 10px 5px 10px;">
156
- <div class="panel-body panel-self"
157
- style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
158
- <div class="row" style="height: 240px;overflow: scroll;top: 1px">
159
- <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 35px"
160
- v-for="(index,img) in model.f_overall_imgs">
161
- <img-self :src="img.f_overall_path" alt="现场照片" :width="140" :height="170"></img-self>
162
- <img src="../../../assets/删除.png" @click="delfile('f_overall_path', img.f_overall_path,index)"
163
- style="width: 15px;margin-top: -80px" alt="">
164
- </div>
165
- </div>
166
- <div class="row text-right div-photo">
167
- <button type="button" name="button" class="btn btn-photo" @click="takePic('f_overall_path', '现场照片')">
168
- 拍照
169
- </button>
170
- <!--<button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_overall_path', '总体安检照片1')">拍照</button>-->
171
- <!--&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../../assets/remove.png" :class="style__" @click="delfile('f_overall_path', img.f_overall_path)" style="width: 25%;"></img>-->
172
- </div>
173
- </div>
174
- </div>
175
- </div>
176
- </div>
177
- <div class="form-group col-sm-11" v-show="isshow">
178
- <label class="text-left font">用户签名</label>
179
- <div class="auto">
180
- <div class="panel">
181
- <div class="panel-body panel-self"
182
- style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
183
- <div class="row" style="height: 240px;overflow: scroll;top: 1px">
184
- <div class="col-sm-4">
185
- <img :src="model.f_sign_path" :width="200" :height="150"/>
186
- </div>
187
- </div>
188
- <div class="row text-right div-photo">
189
- <button type="button" name="button" class="btn btn-primary btn-photo" @click="sign">签名</button>
190
- </div>
191
- </div>
192
- </div>
193
- </div>
194
- </div>
195
-
196
- <!-- <input @click="gotohetong('民用')" type="checkbox" v-model="model.f_hege"/><label class="text-left font">我已阅读<a href="#" @click="gotohetong('民用')">居民天然气供用气合同</a></label>-->
197
- <div class="form-group col-sm-11" v-show="kchege&&data.f_user_type=='民用'&&data.title!='现场勘查'">
198
- <input type="checkbox" v-model="model.f_hege"/><label class="text-left font">我已阅读<a href="#"
199
- @click="gotohetong('民用')">居民天然气供用气合同</a></label>
200
- </div>
201
- <div class="form-group col-sm-11" v-show="kchege&&(data.f_user_type=='非民用'||data.title=='现场勘查')">
202
- <input type="checkbox" v-model="model.f_hege"/><label class="text-left font">我已阅读<a href="#"
203
- @click="gotohetong('非民用1')">天然气工程建设安装合同</a>,<a
204
- href="#" @click="gotohetong('非民用2')">管道燃气供用气合同</a></label>
205
- </div>
206
- <div class="form-group col-sm-11" v-show="kcbuhege">
207
- <div class="col-sm-12 form-group">
208
- <label class="control-label col-sm-2">不合格原因:</label>
209
- <div class="col-sm-10">
210
- <textarea
211
- class="form-control"
212
- v-model="model.f_buhege_reason">
213
- </textarea>
214
- </div>
215
- </div>
216
-
217
-
218
- </div>
219
-
220
-
221
-
222
- <div class="col-sm-11 form-group" v-for="item in onetomany" style="text-align: center">
223
-
224
- <button type="button" name="button" class="btn btn-primary" style="background-color:#499edf;" @click="gotoOneToMany(item)">前往{{item.title}}</button>
225
-
226
- </div>
227
-
228
- <div class="col-sm-11 form-group">
229
- <div class="form-group col-sm-6">
230
- <label class=" col-sm-4 control-label">分公司:</label>
231
- <div class="col-sm-5">
232
- <input class="form-control" type="text" v-model="model.f_filiale" disabled>
233
- </div>
234
- </div>
235
- <div class="col-sm-6 form-group">
236
- <label class="control-label col-sm-6">部门:</label>
237
- <div class="col-sm-5">
238
- <input type="text" class="form-control" disabled v-model="model.f_parentname"/>
239
- </div>
240
- </div>
241
- </div>
242
- <div class="col-sm-11 form-group">
243
- <div class="col-sm-6 form-group">
244
- <label class="control-label col-sm-4">操作日期:</label>
245
- <div class="col-sm-5">
246
- <input type="text" class="form-control" disabled v-model="model.f_operate_date"/>
247
- </div>
248
- </div>
249
- <div class="col-sm-6 form-group">
250
- <label class="control-label col-sm-6">操作人:</label>
251
- <div class="col-sm-5">
252
- <input type="text" class="form-control" disabled v-model="model.f_operator"/>
253
- </div>
254
- </div>
255
- </div>
256
-
257
- </form>
258
- </validator>
259
- <div class="from-group col-xs-12">
260
- <center>
261
- <div v-for="(index,button) in data.buttons"
262
- :class="[data.buttons.length==4?'col-xs-3':'',data.buttons.length==3?'col-xs-4':'',data.buttons.length==2?'col-xs-6':'']">
263
- <!-- 按钮组 -->
264
- <button :disabled="(button.button_name==='提交'||button.button_name==='下发')&&disable_button"
265
- type="button" @click="clicked(index,button)" style="border-radius:5px; "
266
- :class="[(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary',data.buttons.length==4 ? 'col-xs-2 col-xs-offset-1':'',data.buttons.length==3 ? 'col-xs-2 col-xs-offset-2':'',data.buttons.length==2 ? 'col-xs-4 col-xs-offset-2':'']">
267
- {{ button.button_name }}
268
- </button>
269
- </div>
270
- </center>
271
- </div>
272
- <div class="form-group col-xs-12" style="height: 50px;width: 100%"></div>
273
- <!-- 模态框 -->
274
- <modal v-if="showmodal" :show.sync="showmodal" v-ref:modal backdrop="false">
275
- <header slot="modal-header" class="modal-header">
276
- <button type="button" class="close" @click="closemodal"><span>&times;</span></button>
277
- <h4 class="modal-title">{{ model.button.button_name }}</h4>
278
- </header>
279
- <article slot="modal-body" class="modal-body">
280
- <div class="col-sm-12" v-for="(index,button_field) in data.buttons[model.button.button_index].button_fields">
281
- <label class="control-label col-sm-3" style="margin-top: 10px">{{ button_field.label }}:</label>
282
- <div class="col-sm-7">
283
- <!--select-->
284
- <input-select v-if="button_field.type=='select'"
285
- :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
286
- v-model="data.buttons[model.button.button_index].button_fields[index].value"
287
- :options='button_field.options'></input-select>
288
- <!-- input -->
289
- <input v-else type="text" class="form-control"
290
- v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
291
- </div>
292
- </div>
293
- </article>
294
- <footer slot="modal-footer" style="border-top:none" class="modal-footer">
295
- <button v-show="showmodal" type="button" class="btn btn-primary" @click='acknowledge'>确认</button>
296
- </footer>
297
- </modal>
298
- </div>
299
- </template>
300
- <script>
301
-
302
- // Date格式化
303
-
304
-
305
- Date.prototype.Format = function (fmt) {
306
- var o = {
307
- "M+": this.getMonth() + 1, //月份
308
- "d+": this.getDate(), //日
309
- "H+": this.getHours(), //小时
310
- "m+": this.getMinutes(), //分
311
- "s+": this.getSeconds(), //秒
312
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
313
- "S": this.getMilliseconds() //毫秒
314
- };
315
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
316
- for (var k in o)
317
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
318
- return fmt;
319
- }
320
-
321
- import Vue from 'vue'
322
- import * as Util from '../../Util'
323
- import {HttpResetClass} from 'vue-client'
324
- export default {
325
- title: '报建业务通用组件',
326
- props: ['data', 'model'],
327
-
328
- data() {
329
- return {
330
- isshow: true,
331
- kchege: false,
332
- kcbuhege: false,
333
- countmoney: [0, 0, 0],
334
- data: null,
335
- showmodal: false,
336
- disable_button: true,
337
- onetomany:[]
338
- }
339
- },
340
- created() {
341
-
342
- // 初始化数据
343
- this.initializtion()
344
- },
345
- methods: {
346
- gotoOneToMany(item){
347
- item.f_process_id = this.data.f_process_id
348
- item.f_filiale = this.data.f_filiale
349
- item.f_apply_num = this.data.f_apply_num
350
- this.$dispatch('onetomany', item)
351
- },
352
- gotohetong(val) {
353
- console.log(val)
354
- console.log("进入goto")
355
- this.$dispatch('gotonewpage', val)
356
- },
357
- cameraCallBack(prop, fileName) {
358
- if (prop == 'f_overall_path') {
359
- let f_overall_path = fileName + '?' + Math.random()
360
- HostApp.__this__.model.f_overall_imgs.push({
361
- f_overall_path: f_overall_path,
362
- f_overall_name: this.data.title
363
- })
364
- } else {
365
- HostApp.__this__.model[prop] = fileName + '?' + Math.random()
366
- }
367
- HostApp.__callback__ = null
368
- HostApp.__this__ = null
369
- },
370
- takePic(prop, title, index) {
371
- HostApp.__callback__ = this.cameraCallBack
372
- HostApp.__this__ = this
373
- console.log("prop:" + prop)
374
- console.log("this.prop:" + this.model[prop])
375
- let fileName
376
- if (prop == 'f_overall_path') {
377
- if (!this.model.f_overall_imgs[index] || this.model.f_overall_imgs[index].f_overall_path.includes("nopic.png")) {
378
- fileName = Util.guid() + '-' + prop + '.jpg'
379
- } else {
380
- fileName = Util.getFileName(this.model.f_overall_imgs[index].f_overall_path)
381
- }
382
- } else {
383
- if (!this.model[prop] || this.model[prop].includes("nopic.png")) {
384
- fileName = Util.guid() + '-' + prop + '.jpg'
385
- } else {
386
- fileName = Util.getFileName(this.model[prop])
387
- }
388
- }
389
-
390
- HostApp._open_a_page({
391
- type: 'boomerang',
392
- page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
393
- param: {
394
- file: fileName,
395
- requestCode: 111,
396
- callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");',
397
- watermark: title + '\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name
398
- }
399
- })
400
- },
401
- signCallback(prop, fileName) {
402
- // HostApp.alert('绑定属性:' + prop + ' 文件全路径如file:///storage/sdcard0/safecheck/abc.jpg:' + fullFileName)
403
- HostApp.__this__.$set('model.f_sign_path', fileName)
404
- HostApp.__callback__ = null
405
- HostApp.__this__ = null
406
- },
407
- delAudioFile(prop, fileName) {
408
- if (!fileName)
409
- return
410
- else {
411
- HostApp.delfile(fileName)
412
- this.model[prop] = null
413
- }
414
- },
415
- sign() {
416
- this.delAudioFile('f_sign_path', this.model.f_sign_path)
417
- let prop = 'f_sign_path'
418
- let idx = 'aofeng'
419
- let fileName
420
- if (!this.model.f_sign_path) {
421
- fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
422
- } else {
423
- fileName = Util.getFileName(this.model.f_sign_path)
424
- }
425
- HostApp.__callback__ = this.signCallback
426
- HostApp.__this__ = this
427
- HostApp.getSignature({
428
- file: fileName,
429
- requestCode: 111,
430
- callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");'
431
- })
432
- },
433
- delfile(prop, fileName, index) {
434
- if (fileName == Vue.nopic)
435
- return
436
- else {
437
- if (prop == 'f_overall_path') {
438
- this.model.f_overall_imgs.splice(index, 1)
439
- HostApp.delfile(fileName)
440
- } else {
441
- HostApp.delfile(fileName)
442
- this.model[prop] = Vue.nopic
443
- }
444
- }
445
- },
446
- // 初始化数据
447
- initializtion() {
448
-
449
- if (this.data.title == '现场勘查' || this.data.title == '现场勘查定价') {
450
- this.isshow = false
451
- }
452
- console.log("5555555555555")
453
- console.log("f_apply_num",this.data.f_apply_num)
454
- console.log("f_filiale",this.data.f_filiale)
455
- console.log(this.data.f_user_type)
456
- console.log(this.isshow)
457
- Vue.nopic = 'file:///android_asset/nopic.png'
458
- if (!this.model.f_sign_path)
459
- this.$set('model.f_sign_path', Vue.nopic)
460
- console.log('!this.model.f_overall_imgs==>' + !this.model.f_overall_imgs)
461
- if (!this.model.f_overall_imgs) {
462
- let imgs = []
463
- this.$set('model.f_overall_imgs', imgs)
464
- console.log('进入setmodel.f_overall_imgs')
465
- }
466
- console.log('进入serviceview的initializtion方法')
467
- console.log(JSON.stringify(this.data))
468
- if(this.data.onetomany){
469
- console.log(JSON.stringify(this.data.onetomany))
470
- this.onetomany = this.data.onetomany
471
- }
472
- if (this.data.fields) {
473
- for (let i = 0; i < this.data.fields.length; i++) {
474
- if (this.data.fields[i].value) {
475
- if (this.data.fields[i].value == 'null') {
476
- console.log("看看为空的字段名" + this.data.fields[i].label)
477
- this.data.fields[i].value = null
478
- console.log("赋值完成")
479
- }
480
- }
481
- if (this.data.fields[i].type === 'datepicker' && !this.data.fields[i].value) {
482
- this.data.fields[i].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
483
- }
484
- if (this.data.fields[i].label==='气价名称'){
485
- console.log(this.data.fields[i].options)
486
- let data={
487
- items:"f_price_name",
488
- tablename:"t_stairprice",
489
- condition:`f_filialeids = '${Vue.user.f_orgids}' and f_state= '有效' and getdate()>=f_perform_date and getdate()<=f_end_date `,
490
- orderitem:'id'
491
- }
492
- let qijia=[]
493
- new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
494
- console.log("66666666666666666666")
495
- console.log(JSON.stringify(res))
496
- console.log(typeof res)
497
- //console.log(JSON.stringify(res.data[0]))
498
- let result=res.data
499
- result.forEach(ress=>{
500
- qijia.push({
501
- label:ress.f_price_name,
502
- value:ress.f_price_name
503
- })
504
- })
505
- this.data.fields[i].options=qijia
506
- })
507
- }
508
- if (this.data.fields[i].label==='气表品牌'){
509
- console.log(this.data.fields[i].options)
510
- let data={
511
- items:"f_meter_brand",
512
- tablename:"t_gasbrand",
513
- condition:`f_filialeids = '${Vue.user.f_orgids}'`,
514
- orderitem:'id'
515
- }
516
- let pinpai=[]
517
- new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
518
- console.log("666666666666666666662")
519
- console.log(JSON.stringify(res))
520
- console.log(typeof res)
521
- //console.log(JSON.stringify(res.data[0]))
522
- let result=res.data
523
- result.forEach(ress=>{
524
- pinpai.push({
525
- label:ress.f_meter_brand,
526
- value:ress.f_meter_brand
527
- })
528
- })
529
- this.data.fields[i].options=pinpai
530
- })
531
- }
532
- }
533
- }
534
-
535
- if (this.data.filiale) {
536
- this.model.f_filiale = this.data.f_filiale
537
- } else if (Vue.user.orgs) {
538
- this.model.f_filiale = Vue.user.orgs
539
- } else {
540
- this.model.f_filiale = Vue.user.f_fengongsi
541
- }
542
- if (this.data.f_parentname) {
543
- this.model.f_parentname = this.data.f_parentname
544
- } else if (Vue.user.f_department_name) {
545
- this.model.f_parentname = Vue.user.f_department_name
546
- } else {
547
- this.model.f_parentname = Vue.user.f_parentname
548
- }
549
- if (this.data.operate_date) {
550
- this.model.f_operate_date = this.data.operate_date
551
- } else {
552
- this.model.f_operate_date = new Date().Format("yyyy-MM-dd HH:mm:ss")
553
- }
554
- if (this.data.operator) {
555
- this.model.f_operator = this.data.operator
556
- } else {
557
- this.model.f_operator = Vue.user.name
558
- }
559
- },
560
- // 模态框点击确定按钮
561
- acknowledge() {
562
- for (let i = 0; i < this.data.buttons[this.model.button.button_index].button_fields.length; i++) {
563
- this.model.button.button_fields[this.data.buttons[this.model.button.button_index].button_fields[i].field] = this.data.buttons[this.model.button.button_index].button_fields[i].value
564
- }
565
- this.showmodal = false
566
- this.$dispatch('button', this.model)
567
- },
568
- // 关闭模态框
569
- closemodal() {
570
- this.showmodal = false
571
- },
572
- watchmoney(val1, val2) {
573
- console.log("监听改变的值")
574
- console.log(val1)
575
- console.log(val2)
576
- },
577
- // 点击按钮
578
- clicked(index, button) {
579
- console.log(`点击了按钮index:${index}+button:${JSON.stringify(button)}`);
580
- if (this.data.title != '现场勘查' && this.data.title != '现场勘查定价' && button.button_name=='提交') {
581
- if (!this.model.f_overall_imgs || this.model.f_overall_imgs.length == 0){
582
- this.$showMessage("必须有现场照片")
583
- return;
584
- }
585
- if(Vue.nopic==this.model.f_sign_path){
586
- this.$showMessage("必须有签名照片")
587
- return;
588
- }
589
- this.model.f_overall_imgs.push({
590
- f_overall_path: this.model.f_sign_path,
591
- f_overall_name: this.data.title
592
- })
593
- }
594
-
595
-
596
- if ((this.data.title == '现场勘查' || this.data.title == '现场勘查定价') && button.button_name=='提交') {
597
- if (!this.model.f_overall_imgs || this.model.f_overall_imgs.length == 0){
598
- this.$showMessage("必须有现场照片")
599
- return;
600
- }
601
- }
602
- if (this.kchege == 'true') {
603
- console.log(this.model.f_hege)
604
- if (this.model.f_hege != 'true') {
605
- this.$showMessage("请勾选阅读合同")
606
- return
607
- }
608
- }
609
- // 组织model.fields数据
610
- let modeldatas = {}
611
- for (let i = 0; i < this.data.fields.length; i++) {
612
- console.log(JSON.stringify(this.data.fields[i]))
613
- // checkbox特殊处理
614
- if (this.data.fields[i].type === 'checkbox') {
615
- for (let j = 0; j < this.data.fields[i].items.length; j++) {
616
- modeldatas[this.data.fields[i].items[j].field] = this.data.fields[i].items[j].value
617
- }
618
- } else {
619
- modeldatas[this.data.fields[i].field] = this.data.fields[i].value
620
- }
621
- }
622
- modeldatas.f_process_id = this.data.f_process_id
623
- modeldatas.f_filiale = this.model.f_filiale
624
- modeldatas.f_parentname = this.model.f_parentname
625
- modeldatas.f_operator = this.model.f_operator
626
- modeldatas.f_operate_date = this.model.f_operate_date
627
- modeldatas.f_overall_imgs = this.model.f_overall_imgs
628
- modeldatas.f_sign_path = this.model.f_sign_path
629
- this.model = null
630
- this.model = modeldatas
631
- // 初始化model.button数据
632
- let buttondatas = {
633
- button_fields: {}
634
- }
635
- buttondatas.button_name = button.button_name
636
- buttondatas.button_index = index
637
- if (button.button_fields) {
638
- for (let i = 0; i < button.button_fields.length; i++) {
639
- buttondatas.button_fields[button.button_fields[i].field] = button.button_fields[i].value
640
- }
641
- }
642
- this.model.button = buttondatas
643
-
644
- if (button.button_name === '退回') {
645
- this.showmodal = true
646
- } else if (button.button_name === '下发') {
647
- this.showmodal = true
648
- } else {
649
- this.$dispatch('button', this.model)
650
- }
651
- },
652
- // 级联操作预留
653
- select_change(index) {
654
- this.$dispatch('select_cascade', index)
655
- },
656
- // 检测按钮的disable
657
- disabled_check(index, required, value) {
658
- console.log("被检测到的值是什么")
659
- console.log(index)
660
- console.log(required)
661
- console.log(value)
662
- console.log(this.data.title)
663
- if (this.data.fields[index].label=='气表品牌'){
664
- console.log("进入改变气表型号")
665
- console.log(this.data.fields[index+1].options)
666
- this.data.fields[index+1].options=[]
667
- let data={
668
- items:"gm.f_meter_style",
669
- tablename:"t_gasmodel gm left join t_gasbrand gb on gm.f_gasbrand_id=gb.id",
670
- condition:`gb.f_filialeids = '${Vue.user.f_orgids}' and gb.f_meter_brand='${value}'`,
671
- orderitem:'gm.id'
672
- }
673
- let xinghao=[]
674
- new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
675
- console.log("66666666666666666666")
676
- console.log(JSON.stringify(res))
677
- console.log(typeof res)
678
- //console.log(JSON.stringify(res.data[0]))
679
- let result=res.data
680
- result.forEach(ress=>{
681
- xinghao.push({
682
- label:ress.f_meter_style,
683
- value:ress.f_meter_style
684
- })
685
- })
686
- this.data.fields[index+1].options=xinghao
687
- })
688
- }
689
- if (this.data.title == '现场勘查') {
690
- if (index == 4) {
691
- if (value == '合格') {
692
- this.kchege = true
693
- this.kcbuhege = false
694
- console.log("1111111111" + this.kchege)
695
- } else if (value == '不合格') {
696
- this.kcbuhege = true
697
- this.kchege = false
698
- console.log("1111111111" + this.kcbuhege)
699
- }
700
- }
701
- }
702
- if (this.data.title == '现场勘查定价') {
703
- // if (index == 6 || index == 7 || index == 5) {
704
- // this.countmoney[index - 5] = parseInt(this.data.fields[index].value)
705
- // console.log(this.data.fields[index].value)
706
- // console.log("做出了改变")
707
- // }
708
- // console.log(JSON.stringify(this.countmoney))
709
- // let money = 0
710
- // for (let i = 0; i < this.countmoney.length; i++) {
711
- // money += this.countmoney[i]
712
- // }
713
- // this.$set('data.fields[8].value', money)
714
- // this.$set('data.fields[9].value', money)
715
- if (index == 10) {
716
- console.log("1111111111" + value)
717
- if (value == '合格') {
718
- this.kchege = true
719
- this.kcbuhege = false
720
- console.log("1111111111" + this.kchege)
721
- } else if (value == '不合格') {
722
- this.kcbuhege = true
723
- this.kchege = false
724
- console.log("1111111111" + this.kcbuhege)
725
- }
726
- }
727
- }
728
- if (required && value) {
729
- this.disable_button = false
730
-
731
- let fields = this.data.fields
732
- let flag = false
733
- for (let i = 0; i < fields.length; i++) {
734
- if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
735
- flag = true
736
- }
737
- }
738
- this.disable_button = flag
739
- }
740
- }
741
- },
742
- watch: {
743
- 'data.filed[12].value'(val) {
744
- console.log("变动")
745
- if (this.data.title == '现场勘查定价') {
746
-
747
- }
748
- },
749
- 'data.operate_date'() {
750
- if (this.data.filiale) {
751
- this.model.f_filiale = this.data.filiale
752
- } else {
753
- this.model.f_filiale = Vue.user.f_parentname
754
- }
755
- if (this.data.f_parentname) {
756
- this.model.f_parentname = this.data.f_parentname
757
- } else {
758
- this.model.f_parentname = Vue.user.f_parentname
759
- }
760
- if (this.data.operate_date) {
761
- this.model.f_operate_date = this.data.operate_date
762
- } else {
763
- this.model.f_operate_date = new Date().Format("yyyy-MM-dd HH:mm:ss")
764
- }
765
- if (this.data.operator) {
766
- this.model.f_operator = this.data.operator
767
- } else {
768
- this.model.f_operator = Vue.user.name
769
- }
770
- },
771
- deep: true
772
- },
773
- computed: {
774
- // 输入后按钮检测
775
- check_disable: function () {
776
- let fields = this.data.fields
777
- let flag = false
778
- for (let i = 0; i < fields.length; i++) {
779
- if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
780
- flag = true
781
- }
782
- }
783
- this.disable_button = flag
784
- }
785
- }
786
- }
787
- </script>
1
+ <template>
2
+ <div class="auto select-overspread">
3
+ <div v-if="data.back_reason" class="panel panel-info">
4
+ <span style="color: red"> 请注意被退回原因为:{{ data.back_reason }}</span>
5
+ </div>
6
+ <validator name="v">
7
+ <form class="form-horizontal">
8
+ <div class="col-sm-11 form-group">
9
+ <div v-for="(index,item) in data.fields">
10
+ <!--input-->
11
+ <div v-if="item.type==='input'" v-show="!item.hidden"
12
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-4 form-group']">
13
+ <label
14
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-6'">{{
15
+ item.label
16
+ }}:</label>
17
+ <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'">
18
+ <input class="form-control"
19
+ :type="item.type"
20
+ v-model="data.fields[index].value"
21
+ :placeholder="item.placeholder"
22
+ :value="data.fields[index].value"
23
+ :readonly="item.readonly"
24
+ :disable="item.disable"
25
+ @change="disabled_check(index,data.fields[index].required,data.fields[index].value)"
26
+ @blur="check_disable"
27
+ />
28
+ </div>
29
+ </div>
30
+ <!--number-->
31
+ <div v-if="item.type==='number'" v-show="!item.hidden"
32
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-4 form-group']">
33
+ <label
34
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-6'">{{
35
+ item.label
36
+ }}:</label>
37
+ <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'">
38
+ <input class="form-control"
39
+ :type="item.type"
40
+ v-model="data.fields[index].value"
41
+ :placeholder="item.placeholder"
42
+ :value="data.fields[index].value"
43
+ :readonly="item.readonly"
44
+ :disable="item.disable"
45
+ @change="disabled_check(index,data.fields[index].required,data.fields[index].value)"
46
+ @blur="check_disable"
47
+ />
48
+ </div>
49
+ </div>
50
+
51
+ <!--时间datepicker-->
52
+ <div v-if="item.type==='datepicker'"
53
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-xs-12 form-group']">
54
+ <label style="margin-top: 0.7em"
55
+ :class="item.label_bootstraped?item.label_bootstraped +' control-label':'control-label col-sm-6'">{{
56
+ item.label
57
+ }}:</label>
58
+ <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'">
59
+ <datepicker
60
+ :placeholder="item.placeholder"
61
+ :value.sync="data.fields[index].value"
62
+ :format="'yyyy-MM-dd HH:mm:ss'"
63
+ v-model="data.fields[index].value"
64
+ :width="'100%'"
65
+ class="form-control"
66
+ :readonly="item.readonly"
67
+ :disabled="item.disabled"
68
+ @blur="check_disable"
69
+ :show-reset-button="reset">
70
+ </datepicker>
71
+ </div>
72
+ </div>
73
+
74
+
75
+ <!--textarea-->
76
+ <div v-if="item.type==='textarea'"
77
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-12 form-group']">
78
+ <label
79
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-2'">{{
80
+ item.label
81
+ }}:</label>
82
+ <div :class="item.value_bootstraped?item.value_bootstraped:'col-sm-10'">
83
+ <textarea
84
+ :readonly="item.readonly"
85
+ :disabled="item.disabled"
86
+ class="form-control"
87
+ :rows="item.rows"
88
+ v-model="data.fields[index].value"
89
+ @change="disabled_check(index,data.fields[index].required,data.fields[index].value)"
90
+ @blur="check_disable"
91
+ >
92
+ </textarea>
93
+ </div>
94
+ </div>
95
+
96
+ <!--radio-->
97
+ <div v-if="item.type==='radio'"
98
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-12 form-group']">
99
+ <label v-if="item.label"
100
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-2'">{{
101
+ item.label
102
+ }}:</label>
103
+ <div class="col-xs-12">
104
+ <div
105
+ :class="item.value_bootstraped?item.value_bootstraped:item.items.length%2 == 0?'col-xs-5': 'col-xs-3'"
106
+ v-for="(index2,row) in item.items">
107
+ <label style="margin-top: 0.7em" for="row.label"
108
+ :class="item.items.length%2 == 0?'col-xs-4': 'col-xs-2'">{{ row.label }}</label>
109
+ <input @blur="check_disable" :class="item.items.length%2 == 0?'col-xs-1': 'col-xs-1'"
110
+ :readonly="item.readonly" :disabled="item.disabled" style="margin-top: 10px" type="radio"
111
+ :name="index" :id="row.label" v-bind:value="data.fields[index].items[index2].value"
112
+ v-model="data.fields[index].value">
113
+ </div>
114
+ </div>
115
+ </div>
116
+
117
+ <!--select-->
118
+ <div v-if="item.type==='select'"
119
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-4 form-group']">
120
+ <label
121
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-6'">{{
122
+ item.label
123
+ }}:</label>
124
+ <input-select :class="item.value_bootstraped?item.value_bootstraped:'col-sm-6'" @blur="check_disable"
125
+ @change="select_change(index),disabled_check(index,data.fields[index].required,data.fields[index].value)"
126
+ :readonly="item.readonly" :disable="item.disabled" :value.sync="data.fields[index].value"
127
+ v-model="data.fields[index].value"
128
+ :options='item.options' :valueSingle="true"></input-select>
129
+
130
+ </div>
131
+
132
+ <!--checkbox-->
133
+ <div v-if="item.type==='checkbox'"
134
+ :class="[data.fields[index].required&&!(data.fields[index].value) ? 'has-error' : '',data.fields[index].bootstraped?data.fields[index].bootstraped+' form-group':'col-sm-12 form-group']">
135
+ <label v-if="item.label"
136
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label':'control-label col-sm-2'">{{
137
+ item.label
138
+ }}:</label>
139
+ <div style="margin-top: 0.7em"
140
+ :class="item.value_bootstraped?item.value_bootstraped:'control-label col-sm-2'"
141
+ v-for="(index2,row) in item.items">
142
+ <label class="font-size form-group col-sm-6">{{ row.label }}</label>
143
+ <input :readonly="item.readonly" :disabled="item.disabled" type="checkbox" class="col-sm-6"
144
+ :id="row.label" v-model="data.fields[index].items[index2].value">
145
+ </div>
146
+ </div>
147
+
148
+
149
+ </div>
150
+ </div>
151
+ <div class="form-group col-sm-11">
152
+ <label class="text-left font">现场照片</label>
153
+
154
+ <div class="auto">
155
+ <div class="panel" style="padding: 10px 10px 5px 10px;">
156
+ <div class="panel-body panel-self"
157
+ style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
158
+ <div class="row" style="height: 240px;overflow: scroll;top: 1px">
159
+ <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 35px"
160
+ v-for="(index,img) in model.f_overall_imgs">
161
+ <img-self :src="img.f_overall_path" alt="现场照片" :width="140" :height="170"></img-self>
162
+ <img src="../../../assets/删除.png" @click="delfile('f_overall_path', img.f_overall_path,index)"
163
+ style="width: 15px;margin-top: -80px" alt="">
164
+ </div>
165
+ </div>
166
+ <div class="row text-right div-photo">
167
+ <button type="button" name="button" class="btn btn-photo" @click="takePic('f_overall_path', '现场照片')">
168
+ 拍照
169
+ </button>
170
+ <!--<button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_overall_path', '总体安检照片1')">拍照</button>-->
171
+ <!--&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../../assets/remove.png" :class="style__" @click="delfile('f_overall_path', img.f_overall_path)" style="width: 25%;"></img>-->
172
+ </div>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ <div class="form-group col-sm-11" v-show="true">
178
+ <label class="text-left font">用户签名</label>
179
+ <div class="auto">
180
+ <div class="panel">
181
+ <div class="panel-body panel-self"
182
+ style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
183
+ <div class="row" style="height: 240px;overflow: scroll;top: 1px">
184
+ <div class="col-sm-4">
185
+ <img :src="model.f_sign_path" :width="200" :height="150"/>
186
+ </div>
187
+ </div>
188
+ <div class="row text-right div-photo">
189
+ <button type="button" name="button" class="btn btn-primary btn-photo" @click="sign">签名</button>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+ <!-- <input @click="gotohetong('民用')" type="checkbox" v-model="model.f_hege"/><label class="text-left font">我已阅读<a href="#" @click="gotohetong('民用')">居民天然气供用气合同</a></label>-->
197
+ <div class="form-group col-sm-11" v-show="kchege&&data.f_user_type=='民用'&&data.title!='现场勘查'">
198
+ <input type="checkbox" v-model="model.f_hege"/><label class="text-left font">我已阅读<a href="#"
199
+ @click="gotohetong('民用')">居民天然气供用气合同</a></label>
200
+ </div>
201
+ <div class="form-group col-sm-11" v-show="kchege&&(data.f_user_type=='非民用'||data.title=='现场勘查')">
202
+ <input type="checkbox" v-model="model.f_hege"/><label class="text-left font">我已阅读<a href="#"
203
+ @click="gotohetong('非民用1')">天然气工程建设安装合同</a>,<a
204
+ href="#" @click="gotohetong('非民用2')">管道燃气供用气合同</a></label>
205
+ </div>
206
+ <div class="form-group col-sm-11" v-show="kcbuhege">
207
+ <div class="col-sm-12 form-group">
208
+ <label class="control-label col-sm-2">不合格原因:</label>
209
+ <div class="col-sm-10">
210
+ <textarea
211
+ class="form-control"
212
+ v-model="model.f_buhege_reason">
213
+ </textarea>
214
+ </div>
215
+ </div>
216
+
217
+
218
+ </div>
219
+
220
+
221
+
222
+ <div class="col-sm-11 form-group" v-for="item in onetomany" style="text-align: center">
223
+
224
+ <button type="button" name="button" class="btn btn-primary" style="background-color:#499edf;" @click="gotoOneToMany(item)">前往{{item.title}}</button>
225
+
226
+ </div>
227
+
228
+ <div class="col-sm-11 form-group">
229
+ <div class="form-group col-sm-6">
230
+ <label class=" col-sm-4 control-label">分公司:</label>
231
+ <div class="col-sm-5">
232
+ <input class="form-control" type="text" v-model="model.f_filiale" disabled>
233
+ </div>
234
+ </div>
235
+ <div class="col-sm-6 form-group">
236
+ <label class="control-label col-sm-6">部门:</label>
237
+ <div class="col-sm-5">
238
+ <input type="text" class="form-control" disabled v-model="model.f_parentname"/>
239
+ </div>
240
+ </div>
241
+ </div>
242
+ <div class="col-sm-11 form-group">
243
+ <div class="col-sm-6 form-group">
244
+ <label class="control-label col-sm-4">操作日期:</label>
245
+ <div class="col-sm-5">
246
+ <input type="text" class="form-control" disabled v-model="model.f_operate_date"/>
247
+ </div>
248
+ </div>
249
+ <div class="col-sm-6 form-group">
250
+ <label class="control-label col-sm-6">操作人:</label>
251
+ <div class="col-sm-5">
252
+ <input type="text" class="form-control" disabled v-model="model.f_operator"/>
253
+ </div>
254
+ </div>
255
+ </div>
256
+
257
+ </form>
258
+ </validator>
259
+ <div class="from-group col-xs-12">
260
+ <center>
261
+ <div v-for="(index,button) in data.buttons"
262
+ :class="[data.buttons.length==4?'col-xs-3':'',data.buttons.length==3?'col-xs-4':'',data.buttons.length==2?'col-xs-6':'']">
263
+ <!-- 按钮组 -->
264
+ <button :disabled="(button.button_name==='提交'||button.button_name==='下发')&&disable_button"
265
+ type="button" @click="clicked(index,button)" style="border-radius:5px; "
266
+ :class="[(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary',data.buttons.length==4 ? 'col-xs-2 col-xs-offset-1':'',data.buttons.length==3 ? 'col-xs-2 col-xs-offset-2':'',data.buttons.length==2 ? 'col-xs-4 col-xs-offset-2':'']">
267
+ {{ button.button_name }}
268
+ </button>
269
+ </div>
270
+ </center>
271
+ </div>
272
+ <div class="form-group col-xs-12" style="height: 50px;width: 100%"></div>
273
+ <!-- 模态框 -->
274
+ <modal v-if="showmodal" :show.sync="showmodal" v-ref:modal backdrop="false">
275
+ <header slot="modal-header" class="modal-header">
276
+ <button type="button" class="close" @click="closemodal"><span>&times;</span></button>
277
+ <h4 class="modal-title">{{ model.button.button_name }}</h4>
278
+ </header>
279
+ <article slot="modal-body" class="modal-body">
280
+ <div class="col-sm-12" v-for="(index,button_field) in data.buttons[model.button.button_index].button_fields">
281
+ <label class="control-label col-sm-3" style="margin-top: 10px">{{ button_field.label }}:</label>
282
+ <div class="col-sm-7">
283
+ <!--select-->
284
+ <input-select v-if="button_field.type=='select'"
285
+ :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
286
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"
287
+ :options='button_field.options'></input-select>
288
+ <!-- input -->
289
+ <input v-else type="text" class="form-control"
290
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
291
+ </div>
292
+ </div>
293
+ </article>
294
+ <footer slot="modal-footer" style="border-top:none" class="modal-footer">
295
+ <button v-show="showmodal" type="button" class="btn btn-primary" @click='acknowledge'>确认</button>
296
+ </footer>
297
+ </modal>
298
+ </div>
299
+ </template>
300
+ <script>
301
+
302
+ // Date格式化
303
+
304
+
305
+ Date.prototype.Format = function (fmt) {
306
+ var o = {
307
+ "M+": this.getMonth() + 1, //月份
308
+ "d+": this.getDate(), //日
309
+ "H+": this.getHours(), //小时
310
+ "m+": this.getMinutes(), //分
311
+ "s+": this.getSeconds(), //秒
312
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
313
+ "S": this.getMilliseconds() //毫秒
314
+ };
315
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
316
+ for (var k in o)
317
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
318
+ return fmt;
319
+ }
320
+
321
+ import Vue from 'vue'
322
+ import * as Util from '../../Util'
323
+ import {HttpResetClass} from 'vue-client'
324
+ export default {
325
+ title: '报建业务通用组件',
326
+ props: ['data', 'model'],
327
+
328
+ data() {
329
+ return {
330
+ isshow: true,
331
+ kchege: false,
332
+ kcbuhege: false,
333
+ countmoney: [0, 0, 0],
334
+ data: null,
335
+ showmodal: false,
336
+ disable_button: true,
337
+ onetomany:[]
338
+ }
339
+ },
340
+ created() {
341
+
342
+ // 初始化数据
343
+ this.initializtion()
344
+ },
345
+ methods: {
346
+ gotoOneToMany(item){
347
+ item.f_process_id = this.data.f_process_id
348
+ item.f_filiale = this.data.f_filiale
349
+ item.f_apply_num = this.data.f_apply_num
350
+ this.$dispatch('onetomany', item)
351
+ },
352
+ gotohetong(val) {
353
+ console.log(val)
354
+ console.log("进入goto")
355
+ this.$dispatch('gotonewpage', val)
356
+ },
357
+ cameraCallBack(prop, fileName) {
358
+ if (prop == 'f_overall_path') {
359
+ let f_overall_path = fileName + '?' + Math.random()
360
+ HostApp.__this__.model.f_overall_imgs.push({
361
+ f_overall_path: f_overall_path,
362
+ f_overall_name: this.data.title
363
+ })
364
+ } else {
365
+ HostApp.__this__.model[prop] = fileName + '?' + Math.random()
366
+ }
367
+ HostApp.__callback__ = null
368
+ HostApp.__this__ = null
369
+ },
370
+ takePic(prop, title, index) {
371
+ HostApp.__callback__ = this.cameraCallBack
372
+ HostApp.__this__ = this
373
+ console.log("prop:" + prop)
374
+ console.log("this.prop:" + this.model[prop])
375
+ let fileName
376
+ if (prop == 'f_overall_path') {
377
+ if (!this.model.f_overall_imgs[index] || this.model.f_overall_imgs[index].f_overall_path.includes("nopic.png")) {
378
+ fileName = Util.guid() + '-' + prop + '.jpg'
379
+ } else {
380
+ fileName = Util.getFileName(this.model.f_overall_imgs[index].f_overall_path)
381
+ }
382
+ } else {
383
+ if (!this.model[prop] || this.model[prop].includes("nopic.png")) {
384
+ fileName = Util.guid() + '-' + prop + '.jpg'
385
+ } else {
386
+ fileName = Util.getFileName(this.model[prop])
387
+ }
388
+ }
389
+
390
+ HostApp._open_a_page({
391
+ type: 'boomerang',
392
+ page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
393
+ param: {
394
+ file: fileName,
395
+ requestCode: 111,
396
+ callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");',
397
+ watermark: title + '\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name
398
+ }
399
+ })
400
+ },
401
+ signCallback(prop, fileName) {
402
+ // HostApp.alert('绑定属性:' + prop + ' 文件全路径如file:///storage/sdcard0/safecheck/abc.jpg:' + fullFileName)
403
+ HostApp.__this__.$set('model.f_sign_path', fileName)
404
+ HostApp.__callback__ = null
405
+ HostApp.__this__ = null
406
+ },
407
+ delAudioFile(prop, fileName) {
408
+ if (!fileName)
409
+ return
410
+ else {
411
+ HostApp.delfile(fileName)
412
+ this.model[prop] = null
413
+ }
414
+ },
415
+ sign() {
416
+ this.delAudioFile('f_sign_path', this.model.f_sign_path)
417
+ let prop = 'f_sign_path'
418
+ let idx = 'aofeng'
419
+ let fileName
420
+ if (!this.model.f_sign_path) {
421
+ fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
422
+ } else {
423
+ fileName = Util.getFileName(this.model.f_sign_path)
424
+ }
425
+ HostApp.__callback__ = this.signCallback
426
+ HostApp.__this__ = this
427
+ HostApp.getSignature({
428
+ file: fileName,
429
+ requestCode: 111,
430
+ callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");'
431
+ })
432
+ },
433
+ delfile(prop, fileName, index) {
434
+ if (fileName == Vue.nopic)
435
+ return
436
+ else {
437
+ if (prop == 'f_overall_path') {
438
+ this.model.f_overall_imgs.splice(index, 1)
439
+ HostApp.delfile(fileName)
440
+ } else {
441
+ HostApp.delfile(fileName)
442
+ this.model[prop] = Vue.nopic
443
+ }
444
+ }
445
+ },
446
+ // 初始化数据
447
+ initializtion() {
448
+
449
+ if (this.data.title == '现场勘查' || this.data.title == '现场勘查定价') {
450
+ this.isshow = false
451
+ }
452
+ console.log("5555555555555")
453
+ console.log("f_apply_num",this.data.f_apply_num)
454
+ console.log("f_filiale",this.data.f_filiale)
455
+ console.log(this.data.f_user_type)
456
+ console.log(this.isshow)
457
+ Vue.nopic = 'file:///android_asset/nopic.png'
458
+ if (!this.model.f_sign_path)
459
+ this.$set('model.f_sign_path', Vue.nopic)
460
+ console.log('!this.model.f_overall_imgs==>' + !this.model.f_overall_imgs)
461
+ if (!this.model.f_overall_imgs) {
462
+ let imgs = []
463
+ this.$set('model.f_overall_imgs', imgs)
464
+ console.log('进入setmodel.f_overall_imgs')
465
+ }
466
+ console.log('进入serviceview的initializtion方法')
467
+ console.log(JSON.stringify(this.data))
468
+ if(this.data.onetomany){
469
+ console.log(JSON.stringify(this.data.onetomany))
470
+ this.onetomany = this.data.onetomany
471
+ }
472
+ if (this.data.fields) {
473
+ for (let i = 0; i < this.data.fields.length; i++) {
474
+ if (this.data.fields[i].value) {
475
+ if (this.data.fields[i].value == 'null') {
476
+ console.log("看看为空的字段名" + this.data.fields[i].label)
477
+ this.data.fields[i].value = null
478
+ console.log("赋值完成")
479
+ }
480
+ }
481
+ if (this.data.fields[i].type === 'datepicker' && !this.data.fields[i].value) {
482
+ this.data.fields[i].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
483
+ }
484
+ if(this.data.f_user_type ==='非民用'){
485
+ this.data.fields[i].required = false
486
+ }
487
+ if (this.data.fields[i].label==='气价名称'){
488
+ console.log(this.data.fields[i].options)
489
+ let data={
490
+ items:"f_price_name",
491
+ tablename:"t_stairprice",
492
+ condition:`f_filialeids = '${Vue.user.f_orgids}' and f_state= '有效' and getdate()>=f_perform_date and getdate()<=f_end_date `,
493
+ orderitem:'id'
494
+ }
495
+ let qijia=[]
496
+ new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
497
+ console.log("66666666666666666666")
498
+ console.log(JSON.stringify(res))
499
+ console.log(typeof res)
500
+ //console.log(JSON.stringify(res.data[0]))
501
+ let result=res.data
502
+ result.forEach(ress=>{
503
+ qijia.push({
504
+ label:ress.f_price_name,
505
+ value:ress.f_price_name
506
+ })
507
+ })
508
+ this.data.fields[i].options=qijia
509
+ })
510
+ }
511
+ if (this.data.fields[i].label==='气表品牌'){
512
+ console.log(this.data.fields[i].options)
513
+ let data={
514
+ items:"f_meter_brand",
515
+ tablename:"t_gasbrand",
516
+ condition:`f_filialeids = '${Vue.user.f_orgids}'`,
517
+ orderitem:'id'
518
+ }
519
+ let pinpai=[]
520
+ new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
521
+ console.log("666666666666666666662")
522
+ console.log(JSON.stringify(res))
523
+ console.log(typeof res)
524
+ //console.log(JSON.stringify(res.data[0]))
525
+ let result=res.data
526
+ result.forEach(ress=>{
527
+ pinpai.push({
528
+ label:ress.f_meter_brand,
529
+ value:ress.f_meter_brand
530
+ })
531
+ })
532
+ this.data.fields[i].options=pinpai
533
+ })
534
+ }
535
+ }
536
+ }
537
+
538
+ if (this.data.filiale) {
539
+ this.model.f_filiale = this.data.f_filiale
540
+ } else if (Vue.user.orgs) {
541
+ this.model.f_filiale = Vue.user.orgs
542
+ } else {
543
+ this.model.f_filiale = Vue.user.f_fengongsi
544
+ }
545
+ if (this.data.f_parentname) {
546
+ this.model.f_parentname = this.data.f_parentname
547
+ } else if (Vue.user.f_department_name) {
548
+ this.model.f_parentname = Vue.user.f_department_name
549
+ } else {
550
+ this.model.f_parentname = Vue.user.f_parentname
551
+ }
552
+ if (this.data.operate_date) {
553
+ this.model.f_operate_date = this.data.operate_date
554
+ } else {
555
+ this.model.f_operate_date = new Date().Format("yyyy-MM-dd HH:mm:ss")
556
+ }
557
+ if (this.data.operator) {
558
+ this.model.f_operator = this.data.operator
559
+ } else {
560
+ this.model.f_operator = Vue.user.name
561
+ }
562
+ },
563
+ // 模态框点击确定按钮
564
+ acknowledge() {
565
+ for (let i = 0; i < this.data.buttons[this.model.button.button_index].button_fields.length; i++) {
566
+ this.model.button.button_fields[this.data.buttons[this.model.button.button_index].button_fields[i].field] = this.data.buttons[this.model.button.button_index].button_fields[i].value
567
+ }
568
+ this.showmodal = false
569
+ this.$dispatch('button', this.model)
570
+ },
571
+ // 关闭模态框
572
+ closemodal() {
573
+ this.showmodal = false
574
+ },
575
+ watchmoney(val1, val2) {
576
+ console.log("监听改变的值")
577
+ console.log(val1)
578
+ console.log(val2)
579
+ },
580
+ // 点击按钮
581
+ clicked(index, button) {
582
+ console.log(`点击了按钮index:${index}+button:${JSON.stringify(button)}`);
583
+ if (button.button_name=='提交') {
584
+ if (!this.model.f_overall_imgs || this.model.f_overall_imgs.length == 0){
585
+ this.$showMessage("必须有现场照片")
586
+ return;
587
+ }
588
+ if(Vue.nopic==this.model.f_sign_path){
589
+ this.$showMessage("必须有签名照片")
590
+ return;
591
+ }
592
+ this.model.f_overall_imgs.push({
593
+ f_overall_path: this.model.f_sign_path,
594
+ f_overall_name: this.data.title
595
+ })
596
+ }
597
+
598
+
599
+ // if ((this.data.title == '现场勘查' || this.data.title == '现场勘查定价') && button.button_name=='提交') {
600
+ // if (!this.model.f_overall_imgs || this.model.f_overall_imgs.length == 0){
601
+ // this.$showMessage("必须有现场照片")
602
+ // return;
603
+ // }
604
+ // }
605
+ if (this.kchege == 'true') {
606
+ console.log(this.model.f_hege)
607
+ if (this.model.f_hege != 'true') {
608
+ this.$showMessage("请勾选阅读合同")
609
+ return
610
+ }
611
+ }
612
+ // 组织model.fields数据
613
+ let modeldatas = {}
614
+ for (let i = 0; i < this.data.fields.length; i++) {
615
+ console.log(JSON.stringify(this.data.fields[i]))
616
+ // checkbox特殊处理
617
+ if (this.data.fields[i].type === 'checkbox') {
618
+ for (let j = 0; j < this.data.fields[i].items.length; j++) {
619
+ modeldatas[this.data.fields[i].items[j].field] = this.data.fields[i].items[j].value
620
+ }
621
+ } else {
622
+ modeldatas[this.data.fields[i].field] = this.data.fields[i].value
623
+ }
624
+ }
625
+ modeldatas.f_process_id = this.data.f_process_id
626
+ modeldatas.f_filiale = this.model.f_filiale
627
+ modeldatas.f_parentname = this.model.f_parentname
628
+ modeldatas.f_operator = this.model.f_operator
629
+ modeldatas.f_operate_date = this.model.f_operate_date
630
+ modeldatas.f_overall_imgs = this.model.f_overall_imgs
631
+ modeldatas.f_sign_path = this.model.f_sign_path
632
+ this.model = null
633
+ this.model = modeldatas
634
+ // 初始化model.button数据
635
+ let buttondatas = {
636
+ button_fields: {}
637
+ }
638
+ buttondatas.button_name = button.button_name
639
+ buttondatas.button_index = index
640
+ if (button.button_fields) {
641
+ for (let i = 0; i < button.button_fields.length; i++) {
642
+ buttondatas.button_fields[button.button_fields[i].field] = button.button_fields[i].value
643
+ }
644
+ }
645
+ this.model.button = buttondatas
646
+
647
+ if (button.button_name === '退回') {
648
+ this.showmodal = true
649
+ } else if (button.button_name === '下发') {
650
+ this.showmodal = true
651
+ } else {
652
+ this.$dispatch('button', this.model)
653
+ }
654
+ },
655
+ // 级联操作预留
656
+ select_change(index) {
657
+ this.$dispatch('select_cascade', index)
658
+ },
659
+ // 检测按钮的disable
660
+ disabled_check(index, required, value) {
661
+ console.log("被检测到的值是什么")
662
+ console.log(index)
663
+ console.log(required)
664
+ console.log(value)
665
+ console.log(this.data.title)
666
+ if (this.data.fields[index].label=='气表品牌'){
667
+ console.log("进入改变气表型号")
668
+ console.log(this.data.fields[index+1].options)
669
+ this.data.fields[index+1].options=[]
670
+ let data={
671
+ items:"gm.f_meter_style",
672
+ tablename:"t_gasmodel gm left join t_gasbrand gb on gm.f_gasbrand_id=gb.id",
673
+ condition:`gb.f_filialeids = '${Vue.user.f_orgids}' and gb.f_meter_brand='${value}'`,
674
+ orderitem:'gm.id'
675
+ }
676
+ let xinghao=[]
677
+ new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
678
+ console.log("66666666666666666666")
679
+ console.log(JSON.stringify(res))
680
+ console.log(typeof res)
681
+ //console.log(JSON.stringify(res.data[0]))
682
+ let result=res.data
683
+ result.forEach(ress=>{
684
+ xinghao.push({
685
+ label:ress.f_meter_style,
686
+ value:ress.f_meter_style
687
+ })
688
+ })
689
+ this.data.fields[index+1].options=xinghao
690
+ })
691
+ }
692
+ if (this.data.title == '现场勘查') {
693
+ if (index == 4) {
694
+ if (value == '合格') {
695
+ this.kchege = true
696
+ this.kcbuhege = false
697
+ console.log("1111111111" + this.kchege)
698
+ } else if (value == '不合格') {
699
+ this.kcbuhege = true
700
+ this.kchege = false
701
+ console.log("1111111111" + this.kcbuhege)
702
+ }
703
+ }
704
+ }
705
+ if (this.data.title == '现场勘查定价') {
706
+ // if (index == 6 || index == 7 || index == 5) {
707
+ // this.countmoney[index - 5] = parseInt(this.data.fields[index].value)
708
+ // console.log(this.data.fields[index].value)
709
+ // console.log("做出了改变")
710
+ // }
711
+ // console.log(JSON.stringify(this.countmoney))
712
+ // let money = 0
713
+ // for (let i = 0; i < this.countmoney.length; i++) {
714
+ // money += this.countmoney[i]
715
+ // }
716
+ // this.$set('data.fields[8].value', money)
717
+ // this.$set('data.fields[9].value', money)
718
+ if (index == 7) {
719
+ console.log("1111111111" + value)
720
+ if (value == '合格') {
721
+ this.kchege = true
722
+ this.kcbuhege = false
723
+ console.log("1111111111" + this.kchege)
724
+ } else if (value == '不合格') {
725
+ this.kcbuhege = true
726
+ this.kchege = false
727
+ console.log("1111111111" + this.kcbuhege)
728
+ }
729
+ }
730
+ }
731
+ if (required && value) {
732
+ this.disable_button = false
733
+
734
+ let fields = this.data.fields
735
+ let flag = false
736
+ for (let i = 0; i < fields.length; i++) {
737
+ if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
738
+ flag = true
739
+ }
740
+ }
741
+ this.disable_button = flag
742
+ }
743
+ }
744
+ },
745
+ watch: {
746
+ 'data.filed[12].value'(val) {
747
+ console.log("变动")
748
+ if (this.data.title == '现场勘查定价') {
749
+
750
+ }
751
+ },
752
+ 'data.operate_date'() {
753
+ if (this.data.filiale) {
754
+ this.model.f_filiale = this.data.filiale
755
+ } else {
756
+ this.model.f_filiale = Vue.user.f_parentname
757
+ }
758
+ if (this.data.f_parentname) {
759
+ this.model.f_parentname = this.data.f_parentname
760
+ } else {
761
+ this.model.f_parentname = Vue.user.f_parentname
762
+ }
763
+ if (this.data.operate_date) {
764
+ this.model.f_operate_date = this.data.operate_date
765
+ } else {
766
+ this.model.f_operate_date = new Date().Format("yyyy-MM-dd HH:mm:ss")
767
+ }
768
+ if (this.data.operator) {
769
+ this.model.f_operator = this.data.operator
770
+ } else {
771
+ this.model.f_operator = Vue.user.name
772
+ }
773
+ },
774
+ deep: true
775
+ },
776
+ computed: {
777
+ // 输入后按钮检测
778
+ check_disable: function () {
779
+ let fields = this.data.fields
780
+ let flag = false
781
+ for (let i = 0; i < fields.length; i++) {
782
+ if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
783
+ flag = true
784
+ }
785
+ }
786
+ this.disable_button = flag
787
+ }
788
+ }
789
+ }
790
+ </script>