apply-clients 3.3.94-4 → 3.3.94-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "3.3.94-4",
3
+ "version": "3.3.94-9",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -1,39 +1,39 @@
1
- import Vue from 'vue'
2
- import { all } from 'vue-client'
3
- Vue.config.silent = true
4
- import ApplyGetSaleParam from './stores/ApplyGetSaleParams'
5
- import ApplyLoadParams from './stores/ApplyLoadParams'
6
- /** ****************服务插件*********************/
7
-
8
- export default function () {
9
- Vue.use(ApplyGetSaleParam)
10
- Vue.use(ApplyLoadParams)
11
- /** ***************************报建模块*********************************/
12
- // 报建 总入口
13
- Vue.component('app-exploration-user', (resolve) => { require(['./components/android/Process/AppExplorationUser'], resolve) })
14
- Vue.component('app-service-control', (resolve) => { require(['./components/android/Process/AppServiceControl'], resolve) })
15
- Vue.component('app-process-supervisory', (resolve) => { require(['./components/android/Supervisory/AppProcessSupervisory'], resolve) })
16
- Vue.component('app-supervisory-cart', (resolve) => { require(['./components/android/Supervisory/AppSupervisoryCart'], resolve) })
17
- Vue.component('app-istall-function', (resolve) => { require(['./components/android/Function/AppInstallFunction'], resolve) })
18
- Vue.component('app-function-service-control', (resolve) => { require(['./components/android/Function/AppFunctionServiceControl'], resolve) })
19
-
20
- Vue.component('app-sign', (resolve) => { require(['./components/android/AppSign'], resolve) })
21
- Vue.component('app-take-pic', (resolve) => { require(['./components/android/AppTakePic'], resolve) })
22
- Vue.component('app-service-view', (resolve) => { require(['./components/android/AppServiceView'], resolve) })
23
- Vue.component('app-onetomany', (resolve) => { require(['./components/android/AppOnetomany'], resolve) })
24
-
25
- Vue.component('app-installation-details', (resolve) => { require(['./components/android/Process/Processes/AppInstallationDetails'], resolve) })
26
- Vue.component('app-apply-devices-management', (resolve) => { require(['./components/android/Process/Processes/AppDevicesManagement'], resolve) })
27
- Vue.component('app-charge-management', (resolve) => { require(['./components/android/Process/Processes/AppChargeManagement'], resolve) })
28
- Vue.component('app-supplemental-agreement', (resolve) => { require(['./components/android/Process/Processes/AppSupplementalAgreement'], resolve) })
29
- // 选择用户信息
30
- Vue.component('select-userinfo', (resolve) => { require(['./components/android/Process/Processes/selectUserinfo'], resolve) })
31
- // 选择报建项目
32
- Vue.component('select-apply', (resolve) => { require(['./components/android/Process/Processes/selectApply'], resolve) })
33
- Vue.component('app-build-sign', (resolve) => { require(['./components/android/Process/Processes/AppBuildSign'], resolve) })
34
-
35
- // 区域 地址下拉框联动组件
36
- Vue.component('app-res-area-select', (resolve) => { require(['./components/android/AreaSelect/AppResAreaSelect'], resolve) })
37
- Vue.component('app-res-area-select-group', (resolve) => { require(['./components/android/AreaSelect/AppResAreaSelectGroup'], resolve) })
38
- Vue.component('area-select', (resolve) => { require(['./components/product/AreaSelect/MyAreaSelect'], resolve) })
39
- }
1
+ import Vue from 'vue'
2
+ import { all } from 'vue-client'
3
+ Vue.config.silent = true
4
+ import ApplyGetSaleParam from './stores/ApplyGetSaleParams'
5
+ import ApplyLoadParams from './stores/ApplyLoadParams'
6
+ /** ****************服务插件*********************/
7
+
8
+ export default function () {
9
+ Vue.use(ApplyGetSaleParam)
10
+ Vue.use(ApplyLoadParams)
11
+ /** ***************************报建模块*********************************/
12
+ // 报建 总入口
13
+ Vue.component('app-exploration-user', (resolve) => { require(['./components/android/Process/AppExplorationUser'], resolve) })
14
+ Vue.component('app-service-control', (resolve) => { require(['./components/android/Process/AppServiceControl'], resolve) })
15
+ Vue.component('app-process-supervisory', (resolve) => { require(['./components/android/Supervisory/AppProcessSupervisory'], resolve) })
16
+ Vue.component('app-supervisory-cart', (resolve) => { require(['./components/android/Supervisory/AppSupervisoryCart'], resolve) })
17
+ Vue.component('app-istall-function', (resolve) => { require(['./components/android/Function/AppInstallFunction'], resolve) })
18
+ Vue.component('app-function-service-control', (resolve) => { require(['./components/android/Function/AppFunctionServiceControl'], resolve) })
19
+
20
+ Vue.component('app-sign', (resolve) => { require(['./components/android/AppSign'], resolve) })
21
+ Vue.component('app-take-pic', (resolve) => { require(['./components/android/AppTakePic'], resolve) })
22
+ Vue.component('app-service-view', (resolve) => { require(['./components/android/AppServiceView'], resolve) })
23
+ Vue.component('app-onetomany', (resolve) => { require(['./components/android/AppOnetomany'], resolve) })
24
+
25
+ Vue.component('app-installation-details', (resolve) => { require(['./components/android/Process/Processes/AppInstallationDetails'], resolve) })
26
+ Vue.component('app-apply-devices-management', (resolve) => { require(['./components/android/Process/Processes/AppDevicesManagement'], resolve) })
27
+ Vue.component('app-charge-management', (resolve) => { require(['./components/android/Process/Processes/AppChargeManagement'], resolve) })
28
+ Vue.component('app-supplemental-agreement', (resolve) => { require(['./components/android/Process/Processes/AppSupplementalAgreement'], resolve) })
29
+ // 选择用户信息
30
+ Vue.component('select-userinfo', (resolve) => { require(['./components/android/Process/Processes/selectUserinfo'], resolve) })
31
+ // 选择报建项目
32
+ Vue.component('select-apply', (resolve) => { require(['./components/android/Process/Processes/selectApply'], resolve) })
33
+ Vue.component('app-build-sign', (resolve) => { require(['./components/android/Process/Processes/AppBuildSign'], resolve) })
34
+
35
+ // 区域 地址下拉框联动组件
36
+ // Vue.component('app-res-area-select', (resolve) => { require(['./components/android/AreaSelect/AppResAreaSelect'], resolve) })
37
+ // Vue.component('app-res-area-select-group', (resolve) => { require(['./components/android/AreaSelect/AppResAreaSelectGroup'], resolve) })
38
+ // Vue.component('area-select', (resolve) => { require(['./components/product/AreaSelect/MyAreaSelect'], resolve) })
39
+ }
@@ -1,331 +1,331 @@
1
- <template>
2
- <div>
3
- <div class="col-sm-12 col-xs-12 form-group app-btn">
4
- <button
5
- :class="onetomany.add.class || 'btn btn-info'"
6
- @click.prevent="openAdd()"
7
- v-if="!onetomany.add.hidden"
8
- :style="onetomany.add.style || ''">
9
- {{ onetomany.add.text || '添加'}}
10
- </button>
11
- </div>
12
- <div class="col-sm-12 col-xs-12">
13
- <list :model="onetomany" partial='list'>
14
- <div partial class="auto app-text panel">
15
- <div class="panel-body panel-self">
16
- <div class="row" v-for="field in $parent.$parent.onetomany.fields" v-if="!field.displayPosition || field.displayPosition === 'list'">
17
- <p class="col-xs-3 text-left font label-justify"><b>{{ field.label }}</b></p>
18
- <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row[field.field] }}</p>
19
- </div>
20
- <div class="row text-right" v-if="!$parent.$parent.onetomany.hiddenOperate">
21
- <button
22
- :class="$parent.$parent.onetomany.update.style || 'btn btn-warning'"
23
- @click.prevent="$parent.$parent.openUpdate($index)"
24
- v-if="!$parent.$parent.onetomany.update.hidden"
25
- :style="$parent.$parent.onetomany.update.style || ''">
26
- {{ $parent.$parent.onetomany.update.text || '修改'}}
27
- </button>
28
- <button
29
- :class="$parent.$parent.onetomany.delete.style || 'btn btn-danger'"
30
- @click.prevent="$parent.$parent.openDelete($index)"
31
- v-if="!$parent.$parent.onetomany.delete.hidden"
32
- :style="$parent.$parent.onetomany.delete.style || ''">
33
- {{ $parent.$parent.onetomany.delete.text || '删除'}}
34
- </button>
35
- </div>
36
- </div>
37
- </div>
38
- </list>
39
- </div>
40
-
41
-
42
- <!-- onetomany模态框 -->
43
- <modal v-if="showModal" :show.sync="showModal" backdrop="false" :large="onetomany.modalSize === 'large' ? true : false" :small="onetomany.modalSize === 'small' ? true : false">
44
- <header slot="modal-header" class="modal-header">
45
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
46
- <span class="modal-title"><font
47
- size="3">{{modelTitle}}</font></span>
48
- </header>
49
- <article slot="modal-body" class="modal-body clearfix">
50
- <div v-for="(index,item) in onetomany.fields">
51
- <!--input-->
52
- <div :style="item.style ? item.style : ''"
53
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
54
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
55
- <label class="control-label-justify">{{item.label}}</label>
56
- <div :style="item.value_style ? item.value_style:''"
57
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
58
- <input class="" style="width: 100%"
59
- :type="item.type"
60
- v-model="onetomany.fields[index].value"
61
- :placeholder="item.placeholder"
62
- :value="onetomany.fields[index].value"
63
- :readonly="item.readonly"
64
- :disabled="item.disabled"
65
- @change="onchange(index)"
66
- @blur="onblur(index)"
67
- @input="oninput(index)"
68
- />
69
- </div>
70
- </div>
71
-
72
- <!--select-->
73
- <div :style="item.style ? item.style : ''"
74
- v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
75
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
76
- <label class="control-label-justify">{{item.label}}</label>
77
- <div :style="item.value_style ? item.value_style:''"
78
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
79
- <v-select
80
- class="select" width="100%" align="right"
81
- :placeholder="item.placeholder"
82
- :search="item.search"
83
- close-on-select value-single
84
- :options="item.options"
85
- v-model="onetomany.fields[index].value"
86
- :value.sync="onetomany.fields[index].value"
87
- :readonly="item.readonly"
88
- :disabled="item.disabled"
89
- @blur="onblur(index)"
90
- @change="onchange(index)"
91
- ></v-select>
92
- </div>
93
- </div>
94
-
95
- <!--时间datepicker-->
96
- <div :style="item.style ? item.style : ''"
97
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
98
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
99
- <label class="control-label-justify">{{item.label}}</label>
100
- <div :style="item.value_style ? item.value_style:''"
101
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
102
- <datepicker
103
- :placeholder="item.placeholder"
104
- :value.sync="onetomany.fields[index].value"
105
- :format="item.format ? item.format : 'yyyy-MM-dd'"
106
- v-model="onetomany.fields[index].value"
107
- :readonly="item.readonly"
108
- :disabled="item.disabled"
109
- @change="onchange(index)"
110
- @blur="onblur(index)"
111
- :show-reset-button="true">
112
- </datepicker>
113
- </div>
114
- </div>
115
-
116
- <!--textarea-->
117
- <div :style="item.style ? item.style : ''"
118
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
119
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
120
- <label class="control-label-justify">{{item.label}}</label>
121
- <div :style="item.value_style ? item.value_style:''"
122
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
123
- <textarea
124
- :readonly="item.readonly"
125
- :disabled="item.disabled"
126
- class="" rows="1"
127
- style="width: 100%;height: 100%"
128
- v-model="onetomany.fields[index].value"
129
- :value="onetomany.fields[index].value"
130
- @change="onchange(index)"
131
- @blur="onblur(index)"
132
- @input="oninput(index)"
133
- ></textarea>
134
- </div>
135
- </div>
136
- </div>
137
- </article>
138
- <footer slot="modal-footer" class="modal-footer">
139
- <button :class="disableButton?'btn btn-default':'btn btn-primary'"
140
- :disabled="disableButton" type="button" @click.prevent="confirmModal()">
141
- 确认
142
- </button>
143
- </footer>
144
- </modal>
145
- </div>
146
- </template>
147
-
148
- <script>
149
- import {HttpResetClass} from 'vue-client'
150
- import {guid, toStandardTimeString} from '../Util'
151
- import Vue from 'vue'
152
- export default {
153
- title: 'onetomany',
154
- props: ['onetomany', 'index','selectdata'],
155
- data () {
156
- return {
157
- showModal: false,
158
- disableButton: true,
159
- modelTitle: null,
160
- rowIndex: null
161
- }
162
- },
163
- ready () {
164
- },
165
- methods: {
166
- async confirmModal () {
167
- //报警器设备型号校验
168
- if (this.selectdata.f_apply_type === '报警器报建') {
169
- let data = {
170
- f_material_name: "",
171
- f_bjq_sid: "",
172
- }
173
- this.onetomany.fields.forEach(item => {
174
- if (item.label === '材料编号') {
175
- data.f_bjq_sid = item.value
176
- }
177
- if (item.label === '材料名称') {
178
- data.f_material_name = item.value
179
- }
180
- })
181
- if (data.f_material_name.substr(0, 3) === '报警器') {
182
- let res = await this.$resetpost(
183
- `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqcheck`,
184
- // `ncc/rs/logic/bjqcheck`,
185
- // `/rs/logic/bjqcheck`,
186
- data
187
- )
188
- if (res.data.code != 200) {
189
- this.disableButton = true
190
- this.$showMessage(res.data.msg)
191
- return
192
- }
193
- }
194
- }
195
-
196
- if (this.modelTitle === '新增') {
197
- if (this.onetomany.add.event) {
198
- this.$dispatch(this.onetomany.add.event, this.index)
199
- } else {
200
- this.$dispatch('onetomanyadd', this.index)
201
- }
202
- this.closeModal()
203
- }
204
- if (this.modelTitle === '修改') {
205
- if (this.onetomany.update.event) {
206
- this.$dispatch(this.onetomany.update.event, this.index, this.rowIndex)
207
- } else {
208
- this.$dispatch('onetomanyupdate', this.index, this.rowIndex)
209
- }
210
- this.closeModal()
211
- }
212
- // this.closeModal()
213
- },
214
- onchange (fieldIndex) {
215
- this.disableModalButton()
216
- if (this.onetomany.fields[fieldIndex].onchange) {
217
- this.$dispatch(this.onetomany.fields[fieldIndex].onchange, this.index, fieldIndex)
218
- } else {
219
- this.$dispatch('onchangeModal', this.index, fieldIndex)
220
- }
221
- },
222
- onblur (fieldIndex) {
223
- this.disableModalButton()
224
- if (this.onetomany.fields[fieldIndex].onblur) {
225
- this.$dispatch(this.onetomany.fields[fieldIndex].onblur, this.index, fieldIndex)
226
- } else {
227
- this.$dispatch('onblurModal', this.index, fieldIndex)
228
- }
229
- },
230
- oninput (fieldIndex) {
231
- this.disableModalButton()
232
- if (this.onetomany.fields[fieldIndex].oninput) {
233
- this.$dispatch(this.onetomany.fields[fieldIndex].oninput, this.index, fieldIndex)
234
- } else {
235
- this.$dispatch('oninputModal', this.index, fieldIndex)
236
- }
237
- },
238
- openDelete (rowIndex) {
239
- this.$showMessage(this.onetomany.delete.message ? this.onetomany.delete.message : '您确定要删除这条记录吗?', ['confirm']).then((res) => {
240
- if (res === 'confirm') {
241
- if (this.onetomany.delete.event) {
242
- this.$dispatch(this.onetomany.delete.event, this.index, rowIndex)
243
- } else {
244
- this.$dispatch('onetomanydelete', this.index, rowIndex)
245
- }
246
- }
247
- })
248
- },
249
- // 修改
250
- openUpdate (rowIndex) {
251
- let row = this.onetomany.rows[rowIndex]
252
- for (const item of this.onetomany.fields) {
253
- item.value = row[item.field]
254
- }
255
-
256
- this.disableModalButton()
257
-
258
- this.modelTitle = '修改'
259
- this.rowIndex = rowIndex
260
-
261
- if (this.onetomany.update.openEvent) {
262
- this.$dispatch(this.onetomany.update.openEvent, this.index, this.rowIndex)
263
- }
264
- this.$dispatch('openUpdateModel', this.index, this.rowIndex)
265
-
266
- this.showModal = true
267
- },
268
- openAdd () {
269
- this.disableModalButton()
270
- this.modelTitle = '新增'
271
-
272
- if (this.onetomany.add.openEvent) {
273
- this.$dispatch(this.onetomany.add.openEvent, this.index)
274
- }
275
- this.$dispatch('openAddModel', this.index)
276
-
277
- this.showModal = true
278
- },
279
- closeModal () {
280
- this.showModal = false
281
- this.disableButton = false
282
- this.modelTitle = null
283
- this.rowIndex = null
284
-
285
- for (const item of this.onetomany.fields) {
286
- item.value = null
287
- }
288
- },
289
- // 是否禁用按钮
290
- disableModalButton () {
291
- let flag = false
292
-
293
- for (const field of this.onetomany.fields) {
294
- if (field.required && !field.value && !field.hidden && field.value !== 0) {
295
- flag = true
296
- }
297
- }
298
-
299
- this.disableButton = flag
300
- }
301
- },
302
- computed: {
303
- },
304
- events: {
305
- }
306
- }
307
- </script>
308
-
309
- <style scoped>
310
- .control-label-justify {
311
- width: 30%;
312
- text-align: justify;
313
- text-align-last: justify;
314
- font-family: PingFang-SC-Bold;
315
- float: left;
316
- }
317
- .label-justify {
318
- text-align: justify;
319
- text-align-last: justify;
320
- float: left;
321
- }
322
- .panel-self{
323
- border-radius: 10px;
324
- border:1px solid #499EDF;
325
- background-color: #F8F8F8;
326
- }
327
- .font{
328
- font: 15px PingFang-SC-Medium;
329
- color: #666666;
330
- }
331
- </style>
1
+ <template>
2
+ <div>
3
+ <div class="col-sm-12 col-xs-12 form-group app-btn">
4
+ <button
5
+ :class="onetomany.add.class || 'btn btn-info'"
6
+ @click.prevent="openAdd()"
7
+ v-if="!onetomany.add.hidden"
8
+ :style="onetomany.add.style || ''">
9
+ {{ onetomany.add.text || '添加'}}
10
+ </button>
11
+ </div>
12
+ <div class="col-sm-12 col-xs-12">
13
+ <list :model="onetomany" partial='list'>
14
+ <div partial class="auto app-text panel">
15
+ <div class="panel-body panel-self">
16
+ <div class="row" v-for="field in $parent.$parent.onetomany.fields" v-if="!field.displayPosition || field.displayPosition === 'list'">
17
+ <p class="col-xs-3 text-left font label-justify"><b>{{ field.label }}</b></p>
18
+ <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row[field.field] }}</p>
19
+ </div>
20
+ <div class="row text-right" v-if="!$parent.$parent.onetomany.hiddenOperate">
21
+ <button
22
+ :class="$parent.$parent.onetomany.update.style || 'btn btn-warning'"
23
+ @click.prevent="$parent.$parent.openUpdate($index)"
24
+ v-if="!$parent.$parent.onetomany.update.hidden"
25
+ :style="$parent.$parent.onetomany.update.style || ''">
26
+ {{ $parent.$parent.onetomany.update.text || '修改'}}
27
+ </button>
28
+ <button
29
+ :class="$parent.$parent.onetomany.delete.style || 'btn btn-danger'"
30
+ @click.prevent="$parent.$parent.openDelete($index)"
31
+ v-if="!$parent.$parent.onetomany.delete.hidden"
32
+ :style="$parent.$parent.onetomany.delete.style || ''">
33
+ {{ $parent.$parent.onetomany.delete.text || '删除'}}
34
+ </button>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </list>
39
+ </div>
40
+
41
+
42
+ <!-- onetomany模态框 -->
43
+ <modal v-if="showModal" :show.sync="showModal" backdrop="false" :large="onetomany.modalSize === 'large' ? true : false" :small="onetomany.modalSize === 'small' ? true : false">
44
+ <header slot="modal-header" class="modal-header">
45
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
46
+ <span class="modal-title"><font
47
+ size="3">{{modelTitle}}</font></span>
48
+ </header>
49
+ <article slot="modal-body" class="modal-body clearfix">
50
+ <div v-for="(index,item) in onetomany.fields">
51
+ <!--input-->
52
+ <div :style="item.style ? item.style : ''"
53
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
54
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
55
+ <label class="control-label-justify">{{item.label}}</label>
56
+ <div :style="item.value_style ? item.value_style:''"
57
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
58
+ <input class="" style="width: 100%"
59
+ :type="item.type"
60
+ v-model="onetomany.fields[index].value"
61
+ :placeholder="item.placeholder"
62
+ :value="onetomany.fields[index].value"
63
+ :readonly="item.readonly"
64
+ :disabled="item.disabled"
65
+ @change="onchange(index)"
66
+ @blur="onblur(index)"
67
+ @input="oninput(index)"
68
+ />
69
+ </div>
70
+ </div>
71
+
72
+ <!--select-->
73
+ <div :style="item.style ? item.style : ''"
74
+ v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
75
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
76
+ <label class="control-label-justify">{{item.label}}</label>
77
+ <div :style="item.value_style ? item.value_style:''"
78
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
79
+ <v-select
80
+ class="select" width="100%" align="right"
81
+ :placeholder="item.placeholder"
82
+ :search="item.search"
83
+ close-on-select value-single
84
+ :options="item.options"
85
+ v-model="onetomany.fields[index].value"
86
+ :value.sync="onetomany.fields[index].value"
87
+ :readonly="item.readonly"
88
+ :disabled="item.disabled"
89
+ @blur="onblur(index)"
90
+ @change="onchange(index)"
91
+ ></v-select>
92
+ </div>
93
+ </div>
94
+
95
+ <!--时间datepicker-->
96
+ <div :style="item.style ? item.style : ''"
97
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
98
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
99
+ <label class="control-label-justify">{{item.label}}</label>
100
+ <div :style="item.value_style ? item.value_style:''"
101
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
102
+ <datepicker
103
+ :placeholder="item.placeholder"
104
+ :value.sync="onetomany.fields[index].value"
105
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
106
+ v-model="onetomany.fields[index].value"
107
+ :readonly="item.readonly"
108
+ :disabled="item.disabled"
109
+ @change="onchange(index)"
110
+ @blur="onblur(index)"
111
+ :show-reset-button="true">
112
+ </datepicker>
113
+ </div>
114
+ </div>
115
+
116
+ <!--textarea-->
117
+ <div :style="item.style ? item.style : ''"
118
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
119
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
120
+ <label class="control-label-justify">{{item.label}}</label>
121
+ <div :style="item.value_style ? item.value_style:''"
122
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
123
+ <textarea
124
+ :readonly="item.readonly"
125
+ :disabled="item.disabled"
126
+ class="" rows="1"
127
+ style="width: 100%;height: 100%"
128
+ v-model="onetomany.fields[index].value"
129
+ :value="onetomany.fields[index].value"
130
+ @change="onchange(index)"
131
+ @blur="onblur(index)"
132
+ @input="oninput(index)"
133
+ ></textarea>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </article>
138
+ <footer slot="modal-footer" class="modal-footer">
139
+ <button :class="disableButton?'btn btn-default':'btn btn-primary'"
140
+ :disabled="disableButton" type="button" @click.prevent="confirmModal()">
141
+ 确认
142
+ </button>
143
+ </footer>
144
+ </modal>
145
+ </div>
146
+ </template>
147
+
148
+ <script>
149
+ import {HttpResetClass} from 'vue-client'
150
+ import {guid, toStandardTimeString} from '../Util'
151
+ import Vue from 'vue'
152
+ export default {
153
+ title: 'onetomany',
154
+ props: ['onetomany', 'index','selectdata'],
155
+ data () {
156
+ return {
157
+ showModal: false,
158
+ disableButton: true,
159
+ modelTitle: null,
160
+ rowIndex: null
161
+ }
162
+ },
163
+ ready () {
164
+ },
165
+ methods: {
166
+ async confirmModal () {
167
+ // //报警器设备型号校验
168
+ // if (this.selectdata.f_apply_type === '报警器报建') {
169
+ // let data = {
170
+ // f_material_name: "",
171
+ // f_bjq_sid: "",
172
+ // }
173
+ // this.onetomany.fields.forEach(item => {
174
+ // if (item.label === '材料编号') {
175
+ // data.f_bjq_sid = item.value
176
+ // }
177
+ // if (item.label === '材料名称') {
178
+ // data.f_material_name = item.value
179
+ // }
180
+ // })
181
+ // if (data.f_material_name.substr(0, 3) === '报警器') {
182
+ // let res = await this.$resetpost(
183
+ // `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqcheck`,
184
+ // // `ncc/rs/logic/bjqcheck`,
185
+ // // `/rs/logic/bjqcheck`,
186
+ // data
187
+ // )
188
+ // if (res.data.code != 200) {
189
+ // this.disableButton = true
190
+ // this.$showMessage(res.data.msg)
191
+ // return
192
+ // }
193
+ // }
194
+ // }
195
+
196
+ if (this.modelTitle === '新增') {
197
+ if (this.onetomany.add.event) {
198
+ this.$dispatch(this.onetomany.add.event, this.index)
199
+ } else {
200
+ this.$dispatch('onetomanyadd', this.index)
201
+ }
202
+ this.closeModal()
203
+ }
204
+ if (this.modelTitle === '修改') {
205
+ if (this.onetomany.update.event) {
206
+ this.$dispatch(this.onetomany.update.event, this.index, this.rowIndex)
207
+ } else {
208
+ this.$dispatch('onetomanyupdate', this.index, this.rowIndex)
209
+ }
210
+ this.closeModal()
211
+ }
212
+ // this.closeModal()
213
+ },
214
+ onchange (fieldIndex) {
215
+ this.disableModalButton()
216
+ if (this.onetomany.fields[fieldIndex].onchange) {
217
+ this.$dispatch(this.onetomany.fields[fieldIndex].onchange, this.index, fieldIndex)
218
+ } else {
219
+ this.$dispatch('onchangeModal', this.index, fieldIndex)
220
+ }
221
+ },
222
+ onblur (fieldIndex) {
223
+ this.disableModalButton()
224
+ if (this.onetomany.fields[fieldIndex].onblur) {
225
+ this.$dispatch(this.onetomany.fields[fieldIndex].onblur, this.index, fieldIndex)
226
+ } else {
227
+ this.$dispatch('onblurModal', this.index, fieldIndex)
228
+ }
229
+ },
230
+ oninput (fieldIndex) {
231
+ this.disableModalButton()
232
+ if (this.onetomany.fields[fieldIndex].oninput) {
233
+ this.$dispatch(this.onetomany.fields[fieldIndex].oninput, this.index, fieldIndex)
234
+ } else {
235
+ this.$dispatch('oninputModal', this.index, fieldIndex)
236
+ }
237
+ },
238
+ openDelete (rowIndex) {
239
+ this.$showMessage(this.onetomany.delete.message ? this.onetomany.delete.message : '您确定要删除这条记录吗?', ['confirm']).then((res) => {
240
+ if (res === 'confirm') {
241
+ if (this.onetomany.delete.event) {
242
+ this.$dispatch(this.onetomany.delete.event, this.index, rowIndex)
243
+ } else {
244
+ this.$dispatch('onetomanydelete', this.index, rowIndex)
245
+ }
246
+ }
247
+ })
248
+ },
249
+ // 修改
250
+ openUpdate (rowIndex) {
251
+ let row = this.onetomany.rows[rowIndex]
252
+ for (const item of this.onetomany.fields) {
253
+ item.value = row[item.field]
254
+ }
255
+
256
+ this.disableModalButton()
257
+
258
+ this.modelTitle = '修改'
259
+ this.rowIndex = rowIndex
260
+
261
+ if (this.onetomany.update.openEvent) {
262
+ this.$dispatch(this.onetomany.update.openEvent, this.index, this.rowIndex)
263
+ }
264
+ this.$dispatch('openUpdateModel', this.index, this.rowIndex)
265
+
266
+ this.showModal = true
267
+ },
268
+ openAdd () {
269
+ this.disableModalButton()
270
+ this.modelTitle = '新增'
271
+
272
+ if (this.onetomany.add.openEvent) {
273
+ this.$dispatch(this.onetomany.add.openEvent, this.index)
274
+ }
275
+ this.$dispatch('openAddModel', this.index)
276
+
277
+ this.showModal = true
278
+ },
279
+ closeModal () {
280
+ this.showModal = false
281
+ this.disableButton = false
282
+ this.modelTitle = null
283
+ this.rowIndex = null
284
+
285
+ for (const item of this.onetomany.fields) {
286
+ item.value = null
287
+ }
288
+ },
289
+ // 是否禁用按钮
290
+ disableModalButton () {
291
+ let flag = false
292
+
293
+ for (const field of this.onetomany.fields) {
294
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
295
+ flag = true
296
+ }
297
+ }
298
+
299
+ this.disableButton = flag
300
+ }
301
+ },
302
+ computed: {
303
+ },
304
+ events: {
305
+ }
306
+ }
307
+ </script>
308
+
309
+ <style scoped>
310
+ .control-label-justify {
311
+ width: 30%;
312
+ text-align: justify;
313
+ text-align-last: justify;
314
+ font-family: PingFang-SC-Bold;
315
+ float: left;
316
+ }
317
+ .label-justify {
318
+ text-align: justify;
319
+ text-align-last: justify;
320
+ float: left;
321
+ }
322
+ .panel-self{
323
+ border-radius: 10px;
324
+ border:1px solid #499EDF;
325
+ background-color: #F8F8F8;
326
+ }
327
+ .font{
328
+ font: 15px PingFang-SC-Medium;
329
+ color: #666666;
330
+ }
331
+ </style>