apply-clients 3.4.1 → 3.4.2-FuGu-7

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 (136) hide show
  1. package/android.html +23 -23
  2. package/build/css-loaders.js +34 -0
  3. package/build/dev-android.js +101 -0
  4. package/build/dev-client.js +8 -0
  5. package/build/dev-server-app.js +76 -0
  6. package/build/dev-server.js +119 -0
  7. package/build/example-server.js +80 -0
  8. package/build/release.sh +28 -0
  9. package/build/utils.js +80 -0
  10. package/build/webpack.base.conf.js +85 -0
  11. package/build/webpack.baseandroid.conf.js +84 -0
  12. package/build/webpack.dev.conf.js +51 -0
  13. package/build/webpack.devandroid.conf.js +34 -0
  14. package/build/webpack.example.conf.js +49 -0
  15. package/build/webpack.prod.conf.js +60 -0
  16. package/build/webpack.prodandroid.conf.js +60 -0
  17. package/build/webpack.test.conf.js +31 -0
  18. package/dingding.html +23 -0
  19. package/dist-android/static/doc.jpg +0 -0
  20. package/dist-android/static/images/lefticon//345/215/241/346/234/215/345/212/241/347/256/241/347/220/206.png +0 -0
  21. package/dist-android/static/images/lefticon//345/221/274/345/217/253/347/263/273/347/273/237.png +0 -0
  22. package/dist-android/static/images/lefticon//345/224/256/346/260/224/346/224/266/350/264/271.png +0 -0
  23. package/dist-android/static/images/lefticon//345/233/276/345/261/2023/346/213/267/350/264/2354.png +0 -0
  24. package/dist-android/static/images/lefticon//345/233/276/345/261/202577.png +0 -0
  25. package/dist-android/static/images/lefticon//345/233/276/345/261/2028/346/213/267/350/264/23513.png +0 -0
  26. package/dist-android/static/images/lefticon//345/256/211/346/243/200/346/237/245/347/234/213.png +0 -0
  27. package/dist-android/static/images/lefticon//345/256/211/346/243/200/350/256/241/345/210/222.png +0 -0
  28. package/dist-android/static/images/lefticon//345/276/256/344/277/241/346/234/215/345/212/241.png +0 -0
  29. package/dist-android/static/images/lefticon//346/212/245/345/273/272/347/263/273/347/273/237.png +0 -0
  30. package/dist-android/static/images/lefticon//346/212/245/350/241/250/346/237/245/350/257/242.png +0 -0
  31. package/dist-android/static/images/lefticon//346/227/245/345/270/270/347/256/241/347/220/206.png +0 -0
  32. package/dist-android/static/images/lefticon//346/234/272/350/241/250/347/256/241/347/220/206.png +0 -0
  33. package/dist-android/static/images/lefticon//346/237/245/350/257/242/345/210/227/350/241/250.png +0 -0
  34. package/dist-android/static/images/lefticon//346/241/243/346/241/210/347/256/241/347/220/206.png +0 -0
  35. package/dist-android/static/images/lefticon//347/211/251/350/201/224/347/275/221/350/241/250.png +0 -0
  36. package/dist-android/static/images/lefticon//347/263/273/347/273/237/347/256/241/347/220/206.png +0 -0
  37. package/dist-android/static/images/lefticon//347/263/273/347/273/237/350/256/276/347/275/256.png +0 -0
  38. package/dist-android/static/images/lefticon//347/273/217/350/220/245/347/256/241/346/216/247.png +0 -0
  39. package/dist-android/static/images/lefticon//347/273/274/345/220/210/344/270/232/345/212/241.png +0 -0
  40. package/dist-android/static/images/lefticon//347/273/274/345/220/210/346/237/245/350/257/242.png +0 -0
  41. package/dist-android/static/images/lefticon//350/217/234/345/215/225/344/274/270/347/274/251.png +0 -0
  42. package/dist-android/static/images/lefticon//351/200/200/345/207/272/347/263/273/347/273/237.png +0 -0
  43. package/dist-android/static/imgerror.jpg +0 -0
  44. package/dist-android/static/newStyle/clear.png +0 -0
  45. package/dist-android/static/newStyle/fife.png +0 -0
  46. package/dist-android/static/newStyle/hidden.png +0 -0
  47. package/dist-android/static/newStyle/label-clear.png +0 -0
  48. package/dist-android/static/newStyle/left-img.png +0 -0
  49. package/dist-android/static/newStyle/list_ok.png +0 -0
  50. package/dist-android/static/newStyle/login-check.png +0 -0
  51. package/dist-android/static/newStyle/login-con.png +0 -0
  52. package/dist-android/static/newStyle/login-do.gif +0 -0
  53. package/dist-android/static/newStyle/login-f.png +0 -0
  54. package/dist-android/static/newStyle/login-info.png +0 -0
  55. package/dist-android/static/newStyle/login-left.png +0 -0
  56. package/dist-android/static/newStyle/login-org.png +0 -0
  57. package/dist-android/static/newStyle/login-pwd.png +0 -0
  58. package/dist-android/static/newStyle/login-user.png +0 -0
  59. package/dist-android/static/newStyle/loginbg.gif +0 -0
  60. package/dist-android/static/newStyle/loginbg1280.gif +0 -0
  61. package/dist-android/static/newStyle/loginbg1366.gif +0 -0
  62. package/dist-android/static/newStyle/setting.png +0 -0
  63. package/dist-android/static/newStyle/setting1.png +0 -0
  64. package/dist-android/static/newStyle/shirk.png +0 -0
  65. package/dist-android/static/newStyle/stretch_bottom.png +0 -0
  66. package/dist-android/static/newStyle/stretch_left.png +0 -0
  67. package/dist-android/static/newStyle/stretch_right.png +0 -0
  68. package/dist-android/static/newStyle/stretch_top.png +0 -0
  69. package/dist-android/static/newStyle/system-off.png +0 -0
  70. package/dist-android/static/pdf.jpg +0 -0
  71. package/index.html +33 -33
  72. package/package.json +2 -1
  73. package/src/AndroidApp.vue +35 -35
  74. package/src/App.vue +20 -20
  75. package/src/DingDingApp.vue +51 -0
  76. package/src/android.js +21 -21
  77. package/src/apply.js +75 -81
  78. package/src/applyAndroid.js +25 -31
  79. package/src/applyDingDing.js +12 -0
  80. package/src/components/android/AppOnetomany.vue +301 -301
  81. package/src/components/android/AppServiceView.vue +566 -566
  82. package/src/components/android/AppSign.vue +142 -142
  83. package/src/components/android/AppTakePic.vue +143 -143
  84. package/src/components/android/Process/AppExplorationUser.vue +320 -320
  85. package/src/components/android/Process/AppServiceControl.vue +757 -757
  86. package/src/components/android/Process/Processes/AppInstallationDetails.vue +456 -456
  87. package/src/components/android/ProgressReport/ProgressReportDetail.vue +64 -64
  88. package/src/components/android/Supervisory/AppSupervisoryCart.vue +121 -121
  89. package/src/components/android/TaskGraph.vue +125 -125
  90. package/src/components/build/Install/ExplorationUser.vue +304 -0
  91. package/src/components/build/Install/Process/zhongran/ZR_Design.vue +537 -0
  92. package/src/components/product/{Process/Processes/Print → ApplyCharge}/printCharge.vue +142 -142
  93. package/src/components/product/Function/InstallFunction.vue +131 -125
  94. package/src/components/product/Function/InstallInfoSelect.vue +21 -13
  95. package/src/components/product/Function/Service/FunctionServiceControl.vue +420 -222
  96. package/src/components/product/Onetomany.vue +377 -377
  97. package/src/components/product/Process/ExplorationSelect.vue +401 -410
  98. package/src/components/product/Process/ExplorationUser.vue +138 -138
  99. package/src/components/product/Process/Processes/InstallationDetails.vue +592 -592
  100. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +207 -207
  101. package/src/components/product/Process/Processes/chargeManagement.vue +634 -639
  102. package/src/components/product/Process/Service/ServiceControl.vue +58 -63
  103. package/src/components/product/Process/Service/ShowBackReason.vue +33 -33
  104. package/src/components/product/ServiceView.vue +631 -631
  105. package/src/components/product/Stop/StopApply.vue +105 -103
  106. package/src/components/product/Stop/StopApplyList.vue +269 -269
  107. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +7 -0
  108. package/src/components/product/Supervisory/SupervisoryControl.vue +10 -0
  109. package/src/components/product/Supervisory/SupervisoryList.vue +6 -2
  110. package/src/components/product/Supervisory/SupervisoryhCart.vue +110 -107
  111. package/src/components/product/VueUtils/ApplyUpload.vue +273 -273
  112. package/src/components/product/VueUtils/HighMeter.vue +208 -208
  113. package/src/dingding.js +20 -0
  114. package/src/expandcssAndroid.less +1034 -1034
  115. package/src/main.js +23 -23
  116. package/src/components/product/Function/StopApplyCrrdList.vue +0 -176
  117. package/src/components/product/Function/functions/ApplyRecordCancel.vue +0 -102
  118. package/src/components/product/Function/functions/StopInstall.vue +0 -106
  119. package/src/components/product/Process/Processes/Print/img/10101.png +0 -0
  120. package/src/components/product/Process/Processes/Print/img/1010109.png +0 -0
  121. package/src/components/product/Process/Processes/Print/img/1010110.png +0 -0
  122. package/src/components/product/Process/Processes/Print/img/1010111.png +0 -0
  123. package/src/components/product/Process/Processes/Print/img/1010112.png +0 -0
  124. package/src/filiale/yuchuan/android/Process/AppServiceControl.vue +0 -548
  125. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetails.vue +0 -754
  126. package/src/filiale/yuchuan/android/Task/Survey/SurveyTsak.vue +0 -60
  127. package/src/filiale/yuchuan/android.js +0 -7
  128. package/src/filiale/yuchuan/pc/Order/OrderApply.vue +0 -528
  129. package/src/filiale/yuchuan/pc/Order/OrderApplyList.vue +0 -343
  130. package/src/filiale/yuchuan/pc/Process/ExplorationSelect.vue +0 -395
  131. package/src/filiale/yuchuan/pc/Process/ExplorationUser.vue +0 -147
  132. package/src/filiale/yuchuan/pc/Process/Processes/ApplyMapCom.vue +0 -66
  133. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetails.vue +0 -759
  134. package/src/filiale/yuchuan/pc/Process/Processes/chargeManagement.vue +0 -470
  135. package/src/filiale/yuchuan/pc/Process/Service/ServiceControl.vue +0 -879
  136. package/src/filiale/yuchuan/pc.js +0 -11
@@ -1,301 +1,301 @@
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'],
155
- data () {
156
- return {
157
- showModal: false,
158
- disableButton: true,
159
- modelTitle: null,
160
- rowIndex: null
161
- }
162
- },
163
- ready () {
164
- },
165
- methods: {
166
- confirmModal () {
167
- if (this.modelTitle === '新增') {
168
- if (this.onetomany.add.event) {
169
- this.$dispatch(this.onetomany.add.event, this.index)
170
- } else {
171
- this.$dispatch('onetomanyadd', this.index)
172
- }
173
- }
174
- if (this.modelTitle === '修改') {
175
- if (this.onetomany.update.event) {
176
- this.$dispatch(this.onetomany.update.event, this.index, this.rowIndex)
177
- } else {
178
- this.$dispatch('onetomanyupdate', this.index, this.rowIndex)
179
- }
180
- }
181
-
182
- this.closeModal()
183
- },
184
- onchange (fieldIndex) {
185
- this.disableModalButton()
186
- if (this.onetomany.fields[fieldIndex].onchange) {
187
- this.$dispatch(this.onetomany.fields[fieldIndex].onchange, this.index, fieldIndex)
188
- } else {
189
- this.$dispatch('onchangeModal', this.index, fieldIndex)
190
- }
191
- },
192
- onblur (fieldIndex) {
193
- this.disableModalButton()
194
- if (this.onetomany.fields[fieldIndex].onblur) {
195
- this.$dispatch(this.onetomany.fields[fieldIndex].onblur, this.index, fieldIndex)
196
- } else {
197
- this.$dispatch('onblurModal', this.index, fieldIndex)
198
- }
199
- },
200
- oninput (fieldIndex) {
201
- this.disableModalButton()
202
- if (this.onetomany.fields[fieldIndex].oninput) {
203
- this.$dispatch(this.onetomany.fields[fieldIndex].oninput, this.index, fieldIndex)
204
- } else {
205
- this.$dispatch('oninputModal', this.index, fieldIndex)
206
- }
207
- },
208
- openDelete (rowIndex) {
209
- this.$showMessage(this.onetomany.delete.message ? this.onetomany.delete.message : '您确定要删除这条记录吗?', ['confirm']).then((res) => {
210
- if (res === 'confirm') {
211
- if (this.onetomany.delete.event) {
212
- this.$dispatch(this.onetomany.delete.event, this.index, rowIndex)
213
- } else {
214
- this.$dispatch('onetomanydelete', this.index, rowIndex)
215
- }
216
- }
217
- })
218
- },
219
- // 修改
220
- openUpdate (rowIndex) {
221
- let row = this.onetomany.rows[rowIndex]
222
- for (const item of this.onetomany.fields) {
223
- item.value = row[item.field]
224
- }
225
-
226
- this.disableModalButton()
227
-
228
- this.modelTitle = '修改'
229
- this.rowIndex = rowIndex
230
-
231
- if (this.onetomany.update.openEvent) {
232
- this.$dispatch(this.onetomany.update.openEvent, this.index, this.rowIndex)
233
- }
234
- this.$dispatch('openUpdateModel', this.index, this.rowIndex)
235
-
236
- this.showModal = true
237
- },
238
- openAdd () {
239
- this.disableModalButton()
240
- this.modelTitle = '新增'
241
-
242
- if (this.onetomany.add.openEvent) {
243
- this.$dispatch(this.onetomany.add.openEvent, this.index)
244
- }
245
- this.$dispatch('openAddModel', this.index)
246
-
247
- this.showModal = true
248
- },
249
- closeModal () {
250
- this.showModal = false
251
- this.disableButton = false
252
- this.modelTitle = null
253
- this.rowIndex = null
254
-
255
- for (const item of this.onetomany.fields) {
256
- item.value = null
257
- }
258
- },
259
- // 是否禁用按钮
260
- disableModalButton () {
261
- let flag = false
262
-
263
- for (const field of this.onetomany.fields) {
264
- if (field.required && !field.value && !field.hidden && field.value !== 0) {
265
- flag = true
266
- }
267
- }
268
-
269
- this.disableButton = flag
270
- }
271
- },
272
- computed: {
273
- },
274
- events: {
275
- }
276
- }
277
- </script>
278
-
279
- <style scoped>
280
- .control-label-justify {
281
- width: 30%;
282
- text-align: justify;
283
- text-align-last: justify;
284
- font-family: PingFang-SC-Bold;
285
- float: left;
286
- }
287
- .label-justify {
288
- text-align: justify;
289
- text-align-last: justify;
290
- float: left;
291
- }
292
- .panel-self{
293
- border-radius: 10px;
294
- border:1px solid #499EDF;
295
- background-color: #F8F8F8;
296
- }
297
- .font{
298
- font: 15px PingFang-SC-Medium;
299
- color: #666666;
300
- }
301
- </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'],
155
+ data () {
156
+ return {
157
+ showModal: false,
158
+ disableButton: true,
159
+ modelTitle: null,
160
+ rowIndex: null
161
+ }
162
+ },
163
+ ready () {
164
+ },
165
+ methods: {
166
+ confirmModal () {
167
+ if (this.modelTitle === '新增') {
168
+ if (this.onetomany.add.event) {
169
+ this.$dispatch(this.onetomany.add.event, this.index)
170
+ } else {
171
+ this.$dispatch('onetomanyadd', this.index)
172
+ }
173
+ }
174
+ if (this.modelTitle === '修改') {
175
+ if (this.onetomany.update.event) {
176
+ this.$dispatch(this.onetomany.update.event, this.index, this.rowIndex)
177
+ } else {
178
+ this.$dispatch('onetomanyupdate', this.index, this.rowIndex)
179
+ }
180
+ }
181
+
182
+ this.closeModal()
183
+ },
184
+ onchange (fieldIndex) {
185
+ this.disableModalButton()
186
+ if (this.onetomany.fields[fieldIndex].onchange) {
187
+ this.$dispatch(this.onetomany.fields[fieldIndex].onchange, this.index, fieldIndex)
188
+ } else {
189
+ this.$dispatch('onchangeModal', this.index, fieldIndex)
190
+ }
191
+ },
192
+ onblur (fieldIndex) {
193
+ this.disableModalButton()
194
+ if (this.onetomany.fields[fieldIndex].onblur) {
195
+ this.$dispatch(this.onetomany.fields[fieldIndex].onblur, this.index, fieldIndex)
196
+ } else {
197
+ this.$dispatch('onblurModal', this.index, fieldIndex)
198
+ }
199
+ },
200
+ oninput (fieldIndex) {
201
+ this.disableModalButton()
202
+ if (this.onetomany.fields[fieldIndex].oninput) {
203
+ this.$dispatch(this.onetomany.fields[fieldIndex].oninput, this.index, fieldIndex)
204
+ } else {
205
+ this.$dispatch('oninputModal', this.index, fieldIndex)
206
+ }
207
+ },
208
+ openDelete (rowIndex) {
209
+ this.$showMessage(this.onetomany.delete.message ? this.onetomany.delete.message : '您确定要删除这条记录吗?', ['confirm']).then((res) => {
210
+ if (res === 'confirm') {
211
+ if (this.onetomany.delete.event) {
212
+ this.$dispatch(this.onetomany.delete.event, this.index, rowIndex)
213
+ } else {
214
+ this.$dispatch('onetomanydelete', this.index, rowIndex)
215
+ }
216
+ }
217
+ })
218
+ },
219
+ // 修改
220
+ openUpdate (rowIndex) {
221
+ let row = this.onetomany.rows[rowIndex]
222
+ for (const item of this.onetomany.fields) {
223
+ item.value = row[item.field]
224
+ }
225
+
226
+ this.disableModalButton()
227
+
228
+ this.modelTitle = '修改'
229
+ this.rowIndex = rowIndex
230
+
231
+ if (this.onetomany.update.openEvent) {
232
+ this.$dispatch(this.onetomany.update.openEvent, this.index, this.rowIndex)
233
+ }
234
+ this.$dispatch('openUpdateModel', this.index, this.rowIndex)
235
+
236
+ this.showModal = true
237
+ },
238
+ openAdd () {
239
+ this.disableModalButton()
240
+ this.modelTitle = '新增'
241
+
242
+ if (this.onetomany.add.openEvent) {
243
+ this.$dispatch(this.onetomany.add.openEvent, this.index)
244
+ }
245
+ this.$dispatch('openAddModel', this.index)
246
+
247
+ this.showModal = true
248
+ },
249
+ closeModal () {
250
+ this.showModal = false
251
+ this.disableButton = false
252
+ this.modelTitle = null
253
+ this.rowIndex = null
254
+
255
+ for (const item of this.onetomany.fields) {
256
+ item.value = null
257
+ }
258
+ },
259
+ // 是否禁用按钮
260
+ disableModalButton () {
261
+ let flag = false
262
+
263
+ for (const field of this.onetomany.fields) {
264
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
265
+ flag = true
266
+ }
267
+ }
268
+
269
+ this.disableButton = flag
270
+ }
271
+ },
272
+ computed: {
273
+ },
274
+ events: {
275
+ }
276
+ }
277
+ </script>
278
+
279
+ <style scoped>
280
+ .control-label-justify {
281
+ width: 30%;
282
+ text-align: justify;
283
+ text-align-last: justify;
284
+ font-family: PingFang-SC-Bold;
285
+ float: left;
286
+ }
287
+ .label-justify {
288
+ text-align: justify;
289
+ text-align-last: justify;
290
+ float: left;
291
+ }
292
+ .panel-self{
293
+ border-radius: 10px;
294
+ border:1px solid #499EDF;
295
+ background-color: #F8F8F8;
296
+ }
297
+ .font{
298
+ font: 15px PingFang-SC-Medium;
299
+ color: #666666;
300
+ }
301
+ </style>