apply-clients 3.3.213 → 3.4.1

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 (93) hide show
  1. package/android.html +23 -23
  2. package/index.html +33 -33
  3. package/package.json +3 -3
  4. package/src/AndroidApp.vue +35 -30
  5. package/src/App.vue +20 -20
  6. package/src/android.js +21 -21
  7. package/src/apply.js +81 -90
  8. package/src/applyAndroid.js +2 -16
  9. package/src/components/android/AppOnetomany.vue +301 -285
  10. package/src/components/android/AppServiceView.vue +566 -570
  11. package/src/components/android/AppSign.vue +142 -142
  12. package/src/components/android/AppTakePic.vue +143 -144
  13. package/src/components/android/Process/AppExplorationUser.vue +320 -270
  14. package/src/components/android/Process/AppServiceControl.vue +757 -686
  15. package/src/components/android/Process/Processes/AppInstallationDetails.vue +456 -466
  16. package/src/components/android/ProgressReport/ProgressReportDetail.vue +64 -0
  17. package/src/components/android/ProgressReport/ProgressReportList.vue +209 -0
  18. package/src/components/android/Supervisory/AppProcessSupervisory.vue +73 -152
  19. package/src/components/android/Supervisory/AppSupervisoryCart.vue +121 -115
  20. package/src/components/android/TaskGraph.vue +125 -0
  21. package/src/components/product/ApplyCharge/ApplyChargeList.vue +36 -50
  22. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +3 -3
  23. package/src/components/product/Function/InstallFunction.vue +125 -122
  24. package/src/components/product/Function/InstallInfoSelect.vue +292 -318
  25. package/src/components/product/Function/Service/FunctionServiceControl.vue +222 -254
  26. package/src/components/product/Function/StopApplyCrrdList.vue +176 -0
  27. package/src/components/product/Function/functions/ApplyRecordCancel.vue +102 -0
  28. package/src/components/product/Function/functions/StopInstall.vue +106 -0
  29. package/src/components/product/Onetomany.vue +377 -296
  30. package/src/components/product/Order/OrderApply.vue +30 -30
  31. package/src/components/product/Order/OrderApplyList.vue +78 -67
  32. package/src/components/product/Order/OrderMessage.vue +11 -87
  33. package/src/components/product/Process/ExplorationSelect.vue +410 -369
  34. package/src/components/product/Process/ExplorationUser.vue +138 -128
  35. package/src/components/product/Process/Processes/InstallationDetails.vue +592 -504
  36. package/src/components/product/Process/Processes/Print/img/10101.png +0 -0
  37. package/src/components/product/Process/Processes/Print/img/1010109.png +0 -0
  38. package/src/components/product/Process/Processes/Print/img/1010110.png +0 -0
  39. package/src/components/product/Process/Processes/Print/img/1010111.png +0 -0
  40. package/src/components/product/Process/Processes/Print/img/1010112.png +0 -0
  41. package/src/components/product/Process/Processes/Print/printCharge.vue +142 -0
  42. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +207 -181
  43. package/src/components/product/Process/Processes/chargeManagement.vue +639 -638
  44. package/src/components/product/Process/Processes/devicesManagement.vue +22 -2
  45. package/src/components/product/Process/Processes/selectApply.vue +1 -1
  46. package/src/components/product/Process/Service/ServiceControl.vue +1254 -883
  47. package/src/components/product/Process/Service/ShowBackReason.vue +33 -0
  48. package/src/components/product/ServiceView.vue +631 -741
  49. package/src/components/product/Stop/StopApply.vue +103 -103
  50. package/src/components/product/Stop/StopApplyList.vue +269 -254
  51. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +186 -517
  52. package/src/components/product/Supervisory/SupervisoryControl.vue +100 -108
  53. package/src/components/product/Supervisory/SupervisoryList.vue +233 -253
  54. package/src/components/product/Supervisory/SupervisoryhCart.vue +107 -124
  55. package/src/components/product/VueUtils/ApplyUpload.vue +273 -264
  56. package/src/components/product/VueUtils/HighMeter.vue +208 -0
  57. package/src/expandcssAndroid.less +1034 -517
  58. package/src/filiale/yuchuan/android/Process/AppServiceControl.vue +548 -414
  59. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetails.vue +754 -456
  60. package/src/filiale/yuchuan/android/Task/Survey/SurveyTsak.vue +60 -0
  61. package/src/filiale/yuchuan/android.js +7 -8
  62. package/src/filiale/yuchuan/pc/Order/OrderApply.vue +528 -517
  63. package/src/filiale/yuchuan/pc/Order/OrderApplyList.vue +343 -343
  64. package/src/filiale/yuchuan/pc/Process/ExplorationSelect.vue +270 -231
  65. package/src/filiale/yuchuan/pc/Process/ExplorationUser.vue +147 -131
  66. package/src/filiale/yuchuan/pc/Process/Processes/ApplyMapCom.vue +66 -0
  67. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetails.vue +759 -0
  68. package/src/filiale/yuchuan/pc/Process/Processes/chargeManagement.vue +470 -0
  69. package/src/filiale/yuchuan/pc/Process/Service/ServiceControl.vue +879 -517
  70. package/src/filiale/yuchuan/pc.js +11 -13
  71. package/src/main.js +23 -23
  72. package/src/components/android/Function/AppFunctionServiceControl.vue +0 -329
  73. package/src/components/android/Function/AppInstallFunction.vue +0 -330
  74. package/src/components/android/Process/Processes/AppBuildSign.vue +0 -47
  75. package/src/components/android/Process/Processes/AppChargeManagement.vue +0 -468
  76. package/src/components/android/Process/Processes/AppDevicesManagement.vue +0 -490
  77. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +0 -297
  78. package/src/components/image/dwg.jpg +0 -0
  79. package/src/components/image/yasuobao.jpg +0 -0
  80. package/src/components/product/Function/Inform.vue +0 -73
  81. package/src/components/product/Function/MarketSurvey.vue +0 -81
  82. package/src/components/product/Process/Processes/printCharge.vue +0 -121
  83. package/src/components/product/Process/ShowBackReason.vue +0 -33
  84. package/src/components/product/Supervisory/Service/printChargeNode.vue +0 -873
  85. package/src/components/product/VueUtils/GaoPaiYi/HighMeter.vue +0 -1090
  86. package/src/components/product/VueUtils/ToolsPage.vue +0 -51
  87. package/src/components/product/VueUtils/Tree.vue +0 -330
  88. package/src/filiale/wuan/android.js +0 -0
  89. package/src/filiale/wuan/pc.js +0 -4
  90. package/src/filiale/yuchuan/android/AppServiceView.vue +0 -599
  91. package/src/filiale/yuchuan/android/Reserve/ApplyReserve.vue +0 -200
  92. package/src/filiale/yuchuan/android/SiteSurvey/TaskGraph.vue +0 -137
  93. package/src/filiale/yuchuan/pc/Process/Processes/MapCom.vue +0 -51
@@ -1,599 +0,0 @@
1
- <template>
2
- <div class="form-horizontal select-overspread">
3
- <div v-for="(index,item) in data.fields">
4
- <!--input-->
5
- <div :style="item.style ? item.style : ''"
6
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
7
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
8
- <label class="control-label-justify">{{item.label}}</label>
9
- <div :style="item.value_style ? item.value_style:''"
10
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
11
- <input class=""
12
- :type="item.type"
13
- v-model="data.fields[index].value"
14
- :placeholder="item.placeholder"
15
- :value="data.fields[index].value"
16
- :readonly="item.readonly"
17
- :disabled="item.disabled"
18
- @change="onchange(index)"
19
- @blur="onblur(index)"
20
- @input="oninput(index)"
21
- />
22
- </div>
23
- </div>
24
-
25
- <!--select-->
26
- <div :style="item.style ? item.style : ''"
27
- v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
28
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
29
- <label class="control-label-justify">{{item.label}}</label>
30
- <div :style="item.value_style ? item.value_style:''"
31
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
32
- <v-select
33
- class="select" width="100%" align="right"
34
- :placeholder="item.placeholder"
35
- :search="item.search"
36
- close-on-select value-single
37
- :options="data.fields[index].options"
38
- v-model="data.fields[index].value"
39
- :value.sync="data.fields[index].value"
40
- @blur="onblur(index)"
41
- @change="onchange(index)"
42
- :readonly="item.readonly"
43
- :disabled="item.disabled"
44
- ></v-select>
45
- </div>
46
- </div>
47
-
48
- <!--时间datepicker-->
49
- <div :style="item.style ? item.style : ''"
50
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
51
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
52
- <label class="control-label-justify has-error">{{item.label}}</label>
53
- <div :style="item.value_style ? item.value_style:''"
54
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
55
- <datepicker
56
- @change="onchange(index)"
57
- @blur="onblur(index)"
58
- :placeholder="item.placeholder"
59
- :value.sync="data.fields[index].value"
60
- :format="item.format ? item.format : 'yyyy-MM-dd'"
61
- v-model="data.fields[index].value"
62
- :readonly="item.readonly"
63
- :disabled="item.disabled"
64
- :show-reset-button="true">
65
- </datepicker>
66
- </div>
67
- </div>
68
-
69
- <!--textarea-->
70
- <div :style="item.style ? item.style : ''"
71
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
72
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
73
- <label class="control-label-justify">{{item.label}}</label>
74
- <div :style="item.value_style ? item.value_style:''"
75
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
76
- <textarea
77
- :readonly="item.readonly"
78
- :disabled="item.disabled"
79
- class="" rows="1"
80
- style="width: 100%;height: 100%"
81
- v-model="data.fields[index].value"
82
- :value="data.fields[index].value"
83
- @change="onchange(index)"
84
- @blur="onblur(index)"
85
- @input="oninput(index)"
86
- ></textarea>
87
- </div>
88
- </div>
89
- </div>
90
- <accordion one-at-a-time="true">
91
- <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
92
- <app-onetomany :onetomany="item" :index="i"></app-onetomany>
93
- </panel>
94
- <panel v-for="(i,item) in data.components" :header="item.title" :is-open="false" type="primary" v-if="item.device === 'app' || !item.device">
95
- <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
96
- </panel>
97
- </accordion>
98
-
99
- <!--自定义组件-->
100
- <slot></slot>
101
-
102
- <!-- 按钮组 -->
103
- <div class="form-group text-center">
104
- <div v-for="(index,button) in data.buttons" class="form-group col-xs-6" v-if="!button.hidden">
105
- <button :disabled="(button.button_name==='提交'||button.button_name==='下发') && disable_button"
106
- :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
107
- @click.prevent="clicked(index,button)"
108
- style="min-width:100px;">
109
- {{button.button_name}}
110
- </button>
111
- </div>
112
- </div>
113
-
114
- <!-- onetomany模态框 -->
115
- <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
116
- <header slot="modal-header" class="modal-header">
117
- <button type="button" class="close" @click="closemodal()"><span>&times;</span></button>
118
- <span class="modal-title"><font
119
- size="3">{{modeltitle}}</font></span>
120
- </header>
121
- <article slot="modal-body" class="modal-body clearfix">
122
- <div
123
- :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped + 'form-group' :'col-xs-12 form-group']"
124
- v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
125
- <div :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-3'">
126
- <label v-show="!item.hidden" class="control-label-justify control-label" >{{item.label}}</label>
127
- </div>
128
- <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-9'" v-show="!item.hidden">
129
- <!--时间datepicker-->
130
- <datepicker
131
- v-if="item.type === 'datepicker'"
132
- @change="onchange_modal(index)"
133
- @blur="onblur_modal(index)"
134
- :placeholder="item.placeholder"
135
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
136
- :format="'yyyy-MM-dd'"
137
- v-model="data.onetomany[onetomany_index].fields[index].value"
138
- :readonly="item.readonly"
139
- :disabled="item.disabled"
140
- :show-reset-button="reset">
141
- </datepicker>
142
- <!--select-->
143
- <input-select
144
- @change="onchange_modal(index)"
145
- v-if="item.type === 'select'"
146
- @blur="onblur_modal(index)"
147
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
148
- v-model="data.onetomany[onetomany_index].fields[index].value"
149
- :options='data.onetomany[onetomany_index].fields[index].options'>
150
- </input-select>
151
- <!-- input -->
152
- <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
153
- class="form-control"
154
- :type="item.type"
155
- v-model="data.onetomany[onetomany_index].fields[index].value"
156
- :placeholder="item.placeholder"
157
- :value="data.onetomany[onetomany_index].fields[index].value"
158
- :readonly="item.readonly"
159
- :disabled="item.disabled"
160
- @change="onchange_modal(index)"
161
- @blur="onblur_modal(index)"
162
- @input="oninput_modal(index)"
163
- />
164
-
165
- <textarea
166
- v-if="item.type==='textarea'"
167
- :readonly="item.readonly"
168
- :disabled="item.disabled"
169
- class="form-control input_view"
170
- style="width: 100%;height: 100%"
171
- :rows="item.rows"
172
- v-model="data.onetomany[onetomany_index].fields[index].value"
173
- :value="data.onetomany[onetomany_index].fields[index].value"
174
- @change="onchange_modal(index)"
175
- @blur="onblur_modal(index)"
176
- @input="oninput_modal(index)"
177
- >
178
- </textarea>
179
- </div>
180
- </div>
181
- </article>
182
- <footer slot="modal-footer" class="modal-footer">
183
- <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
184
- :disabled="disable_button_onetomany" type="button" @click.prevent="confirm_modal(modeltitle)">
185
- 确认
186
- </button>
187
- </footer>
188
- </modal>
189
-
190
- <!-- 按钮模态框 -->
191
- <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
192
- <header slot="modal-header" class="modal-header">
193
- <button type="button" class="close" @click="closemodal()"><span>&times;</span></button>
194
- <h4 class="modal-title">{{model.button.button_name}}</h4>
195
- </header>
196
- <article slot="modal-body" class="modal-body clearfix">
197
- <div class="col-xs-12 col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
198
- <label class="control-label col-xs-4" style="margin-top: 10px">{{button.label}}:</label>
199
- <div class="col-xs-8">
200
- <!--select-->
201
- <input-select v-if="button.type=='select'"
202
- :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
203
- v-model="data.buttons[model.button.button_index].button_fields[index].value"
204
- :options='button.options'></input-select>
205
- <!-- input -->
206
- <input v-else type="text" class="form-control"
207
- v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
208
- </div>
209
- </div>
210
- </article>
211
- <footer slot="modal-footer" class="modal-footer">
212
- <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
213
- </footer>
214
- </modal>
215
- </div>
216
- </template>
217
- <script>
218
- import Vue from 'vue'
219
- // Date格式化
220
- Date.prototype.Format = function (fmt) {
221
- var o = {
222
- 'M+': this.getMonth() + 1, // 月份
223
- 'd+': this.getDate(), // 日
224
- 'H+': this.getHours(), // 小时
225
- 'm+': this.getMinutes(), // 分
226
- 's+': this.getSeconds(), // 秒
227
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
228
- 'S': this.getMilliseconds() // 毫秒
229
- }
230
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
231
- for (var k in o) {
232
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
233
- }
234
- return fmt
235
- }
236
-
237
- export default {
238
- title: '报建业务通用组件',
239
- props: {
240
- data: {
241
- type: Object
242
- },
243
- showprint: {
244
- type: Boolean,
245
- default: true
246
- }
247
- },
248
- data () {
249
- return {
250
- model: {}, // 公司等属性
251
- disable_button: true, // 控制按钮禁用
252
- show: false, // 控制onetomany模态框
253
- disable_button_onetomany: true, // 控制onetomany模态框按钮
254
- onetomany_index: null, // 当前选择的下标
255
- update_onetomany_index: null, // 当前需要修改的下标
256
- modeltitle: null, // 模态框标题
257
- modalSize: null, // 模态框大小
258
- showbutmodal: false,
259
- }
260
- },
261
- watch: {
262
- deep: true
263
- },
264
- computed: {
265
-
266
- },
267
- created () {
268
- // 初始化数据
269
- this.initializtion()
270
- },
271
- methods: {
272
- // 初始化数据
273
- initializtion () {
274
- // 是否禁用按钮
275
- this.disableButton()
276
- this.$dispatch('initializtionView')
277
- },
278
- // 按钮模态框确定
279
- confirm_but_modal() {
280
- for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
281
- this.model.button.button_fields[item.field] = item.value
282
- }
283
- this.showbutmodal = false
284
- this.disable_button_but = true
285
- this.$dispatch('button', this.model)
286
- },
287
- // 点击按钮组按钮
288
- async clicked(index, button) {
289
- this.disable_button = true
290
- // 组织model.fields数据
291
- for (const item of this.data.fields) {
292
- // checkbox特殊处理
293
- if (item.type === 'checkbox') {
294
- for (let j = 0; j < item.items.length; j++) {
295
- this.model[item.items[j].field] = item.items[j].value
296
- }
297
- } else {
298
- this.model[item.field] = item.value
299
- }
300
- }
301
- this.model.f_process_id = this.data.f_process_id
302
-
303
- // 初始化model.button数据
304
- let buttondatas = {
305
- button_fields: {}
306
- }
307
- buttondatas.button_name = button.button_name
308
- buttondatas.button_index = index
309
- if (button.button_fields) {
310
- for (const item of button.button_fields) {
311
- buttondatas.button_fields[item.field] = item.value
312
- }
313
- }
314
- this.model.button = buttondatas
315
- this.model.title = this.data.title
316
- this.model.fields = this.data.fields
317
- this.model.onetomany = this.data.onetomany
318
-
319
-
320
- if (button.button_name === '退回') {
321
- this.showbutmodal = true
322
- } else if (button.button_name === '下发') {
323
- this.showbutmodal = true
324
- } else {
325
- this.$dispatch('button', this.model)
326
- }
327
- },
328
- // 是否禁用按钮
329
- disableButton () {
330
- let fields = this.data.fields
331
-
332
- let flag = false
333
- for (const item of fields) {
334
- if (item.type !== 'checkbox' && item.required && !item.value) {
335
- if (item.value === 0) {
336
- flag = false
337
- } else {
338
- flag = true
339
- }
340
- }
341
- // 任何选择框只要是否都不能提交
342
- if (item.type === 'select' && item.value === '否' && item.disabledButton) {
343
- flag = true
344
- }
345
- }
346
-
347
- let count = 0
348
- for (const item of fields) {
349
- if (item.type !== 'checkbox' && item.required) {
350
- count++
351
- }
352
- }
353
- if (count === 0) {
354
- flag = false
355
- }
356
-
357
- this.disable_button = flag
358
- },
359
- // 失去焦点触发,无论值是否发生变化
360
- onblur (index) {
361
- // 是否禁用按钮
362
- this.disableButton()
363
-
364
- this.$dispatch('onblur', index)
365
- // 如果有错误信息提示走错误信息判断处理
366
-
367
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
368
- this.$dispatch('error_check', index)
369
- }
370
- },
371
- // 失去焦点且值最终发生变化触发
372
- async onchange (index) {
373
- console.log('失去焦点-----', index)
374
- console.log(this.data.fields[index].label)
375
- console.log('禁用按钮--前--', this.disable_button)
376
- // 是否禁用按钮
377
- this.disableButton()
378
-
379
- console.log('禁用按钮--后--', this.disable_button)
380
-
381
- this.data.fields[index].value = this.data.fields[index].value.trim()
382
-
383
- if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
384
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
385
- }
386
-
387
- this.data[this.data.fields[index].field] = this.data.fields[index].value
388
-
389
- await this.$dispatch('onchange', index)
390
-
391
- // 如果有错误信息提示走错误信息判断处理
392
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
393
- this.$dispatch('error_check', index)
394
- }
395
- },
396
- oninput (index) {
397
- // 是否禁用按钮
398
- this.disableButton()
399
-
400
- this.$dispatch('oninput', index)
401
-
402
- // 如果有错误信息提示走错误信息判断处理
403
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
404
- this.$dispatch('error_check', index)
405
- }
406
- },
407
- // 模态框确认按钮
408
- confirm_modal (title) {
409
- if (title === '新增') {
410
- if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
411
- this.$dispatch('onetomanyadd', this.onetomany_index)
412
- } else {
413
- this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
414
- }
415
- } else {
416
- if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
417
- this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
418
- } else {
419
- this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
420
- }
421
- }
422
-
423
- this.closemodal()
424
- },
425
- // 关闭模态框
426
- closemodal () {
427
- debugger
428
- for (const item of this.data.onetomany[this.onetomany_index].fields) {
429
- item.value = ''
430
- }
431
-
432
- this.show = false
433
- this.showbutmodal = false
434
- this.disable_button_onetomany = true
435
- this.onetomany_index = null
436
- this.update_onetomany_index = null
437
- this.modeltitle = null
438
- this.modalSize = null
439
- },
440
- // 是否禁用模态框按钮
441
- disableModalButton () {
442
- let fields = this.data.onetomany[this.onetomany_index].fields
443
-
444
- let flag = false
445
- for (const item of fields) {
446
- if (item.type !== 'checkbox' && item.required && !item.value) {
447
- if (item.value === 0) {
448
- flag = false
449
- } else {
450
- flag = true
451
- }
452
- }
453
- }
454
-
455
- let count = 0
456
- for (const item of fields) {
457
- if (item.type !== 'checkbox' && item.required) {
458
- count++
459
- }
460
- }
461
- if (count === 0) {
462
- flag = false
463
- }
464
- this.disable_button_onetomany = flag
465
- },
466
- // 监听模态框属性失去焦点
467
- onchange_modal (index) {
468
- this.disableModalButton()
469
- this.$dispatch('onchange_modal', this.onetomany_index, index)
470
- },
471
- // 监听模态框属性失去焦点
472
- onblur_modal (index) {
473
- this.disableModalButton()
474
- this.$dispatch('onblur_modal', this.onetomany_index, index)
475
- },
476
- // input输入属性值发生变化监听
477
- oninput_modal (index) {
478
- this.disableModalButton()
479
- this.$dispatch('oninput_modal', this.onetomany_index, index)
480
- }
481
- },
482
- events: {
483
- 'add' (index) {
484
- let count = 0
485
- for (const item of this.data.onetomany[index].fields) {
486
- if (item.type === 'datepicker' && !item.value && item.default) {
487
- item.value = new Date().Format('yyyy-MM-dd')
488
- }
489
- if (item.required) {
490
- count++
491
- }
492
- }
493
-
494
- if (count === 0) {
495
- this.disable_button_onetomany = false
496
- }
497
- this.modeltitle = '新增'
498
- this.modalSize = this.data.onetomany[index].modalSize
499
- this.onetomany_index = index
500
-
501
- this.$dispatch('openAddModel',index)
502
-
503
- this.show = true
504
- },
505
- 'update' (i, j) {
506
- let onetomany = this.data.onetomany[i]
507
- let item = this.data.onetomany[i].rows[j]
508
- let count = 0
509
- for (let k = 0; k < onetomany.fields.length; k++) {
510
- // 防止初始化的时候没有value
511
- Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
512
-
513
- if (onetomany.fields[j].required) {
514
- count++
515
- }
516
- }
517
- if (count === 0) {
518
- this.disable_button_onetomany = false
519
- }
520
- this.modeltitle = '修改'
521
- this.modalSize = this.data.onetomany[i].modalSize
522
- this.onetomany_index = i
523
- this.update_onetomany_index = j
524
-
525
- this.$dispatch('openUpdateModel',i,j)
526
-
527
- this.show = true
528
-
529
- this.disableModalButton()
530
- },
531
- 'delete'(i, j) {
532
- this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
533
- if (res === 'confirm') {
534
- if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
535
- this.$dispatch('onetomanydelete', i, j)
536
- } else {
537
- this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
538
- }
539
- }
540
- })
541
- }
542
- }
543
- }
544
- </script>
545
- <style scoped>
546
- .control-label-justify {
547
- width: 30%;
548
- text-align: justify;
549
- text-align-last: justify;
550
- font-family: PingFang-SC-Bold;
551
- }
552
- </style>
553
- <style lang="less">
554
- .apply-has-error {
555
- border-bottom: 1px solid #a94442;
556
- }
557
- .app-input {
558
- textarea {
559
- padding: 8px 10px;
560
- border: none;
561
- outline: none;
562
- margin: 0px;
563
- }
564
- input[readonly]{
565
- color: #ACA899!important;
566
- background: #FFFFFF;
567
- border: none;
568
- outline: none;
569
- }
570
- input:disabled{
571
- color: #ACA899!important;
572
- background: #FFFFFF;
573
- border: none;
574
- outline: none;
575
- }
576
- textarea[readonly]{
577
- color: #ACA899!important;
578
- background: #FFFFFF;
579
- border: none;
580
- outline: none;
581
- }
582
- textarea:disabled{
583
- color: #ACA899!important;
584
- background: #FFFFFF;
585
- border: none;
586
- outline: none;
587
- }
588
- }
589
- .select {
590
- margin: 0px;
591
- .select-style {
592
- border: 0px;
593
- }
594
- input {
595
- border-left: none;
596
- width: 100%!important;
597
- }
598
- }
599
- </style>