apply-clients 7.1.34 → 7.1.37

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 (198) hide show
  1. package/dist-android/static/0.50054aa998577d450157.js +2 -0
  2. package/dist-android/static/1.0b685d8dcbf4f3a8a5b2.js +1 -0
  3. package/dist-android/static/10.2a698c421c0ff5f57336.js +2 -0
  4. package/dist-android/static/11.75a39568e320abbddcc2.js +2 -0
  5. package/dist-android/static/12.4ac0c584da492acc599d.js +1 -0
  6. package/dist-android/static/13.5471bac3b39798923a79.js +1 -0
  7. package/dist-android/static/14.ee274728fdeb5107c357.js +1 -0
  8. package/dist-android/static/15.a1dc233c1804ede2ba87.js +1 -0
  9. package/dist-android/static/16.5081ea8a90d0dacbc748.js +1 -0
  10. package/dist-android/static/17.5b5184c9a9337a88d4f9.js +1 -0
  11. package/dist-android/static/18.0c99e5cb0de0f76008f6.js +1 -0
  12. package/dist-android/static/19.b50c8bf85b8e7fb27e2a.js +1 -0
  13. package/dist-android/static/2.16718caad0da13b463a3.js +1 -0
  14. package/dist-android/static/20.8f6767f58df1fde18784.js +1 -0
  15. package/dist-android/static/21.026f5cbfd90d70d8dd3a.js +1 -0
  16. package/dist-android/static/22.4631f8885615e9b6ad6e.js +1 -0
  17. package/dist-android/static/23.437b569f91863452daeb.js +1 -0
  18. package/dist-android/static/24.f1310985a29496bc5fd8.js +1 -0
  19. package/dist-android/static/25.b6dcf8c6d26f44035506.js +1 -0
  20. package/dist-android/static/27.2185c9e2e7116302e1e1.js +13 -0
  21. package/dist-android/static/28.b429eaf351968226c395.js +3 -0
  22. package/dist-android/static/29.aed6b18ccda9ca3748ce.js +3 -0
  23. package/dist-android/static/3.761de5413a2ed045ab10.js +1 -0
  24. package/dist-android/static/30.567f5fbffc0601227294.js +2 -0
  25. package/dist-android/static/31.179f87c71c11fd562feb.js +1 -0
  26. package/dist-android/static/32.8d45d3f6c5e874582cff.js +1 -0
  27. package/dist-android/static/33.32fd8d2f4e6e7b065a5c.js +1 -0
  28. package/dist-android/static/34.df47f9984baec20bdf5b.js +1 -0
  29. package/dist-android/static/35.5883200f073b546cb1a3.js +1 -0
  30. package/dist-android/static/36.477f89087e507526163f.js +1 -0
  31. package/dist-android/static/37.b82438692bca848519f6.js +1 -0
  32. package/dist-android/static/38.83c950bebdb997be2ef8.js +1 -0
  33. package/dist-android/static/39.333e42c6dbabf1bf2706.js +1 -0
  34. package/dist-android/static/4.eb190515d001a4e1bebd.js +13 -0
  35. package/dist-android/static/40.f6807724af2482375d7c.js +1 -0
  36. package/dist-android/static/41.92f39c44002772179f48.js +1 -0
  37. package/dist-android/static/42.662a0643f36dc759abc0.js +1 -0
  38. package/dist-android/static/43.5b55816aa2ca7b510d72.js +1 -0
  39. package/dist-android/static/44.4a6af5dd359e3973dea4.js +1 -0
  40. package/dist-android/static/45.d5992c604ad9eb4f40d2.js +1 -0
  41. package/dist-android/static/46.aa87912e9361ab053234.js +1 -0
  42. package/dist-android/static/47.b9efca55c1ea582c59e7.js +2 -0
  43. package/dist-android/static/48.8902ce91c715d61c63ef.js +1 -0
  44. package/dist-android/static/49.dd2591b071fe1901d2f2.js +2 -0
  45. package/dist-android/static/5.304b463f21c8253aa514.js +13 -0
  46. package/dist-android/static/50.e49f64d967a7f7350105.js +1 -0
  47. package/dist-android/static/51.0d311b6815373c5a3b1b.js +1 -0
  48. package/dist-android/static/52.344f9d59bb5cb156380d.js +1 -0
  49. package/dist-android/static/53.289984b9a04a7d11ffef.js +1 -0
  50. package/dist-android/static/54.5808cc57ddb689577efe.js +1 -0
  51. package/dist-android/static/55.9874aac28d0d80b55860.js +1 -0
  52. package/dist-android/static/56.babac04ffcc93c5573ed.js +1 -0
  53. package/dist-android/static/57.ca9993d9b0137ec93a81.js +1 -0
  54. package/dist-android/static/58.be8a5ac661eb638aff79.js +1 -0
  55. package/dist-android/static/59.2d0116e8a66e13cbabe2.js +1 -0
  56. package/dist-android/static/6.3f10426d99466042d079.js +13 -0
  57. package/dist-android/static/60.e60b562292633421a3d7.js +1 -0
  58. package/dist-android/static/61.492b25e8e1b66366329b.js +1 -0
  59. package/dist-android/static/62.24924f3f6fd5f97975d1.js +1 -0
  60. package/dist-android/static/63.7628250218be54b5c52f.js +1 -0
  61. package/dist-android/static/64.0c2d7593ebede3d30dc8.js +1 -0
  62. package/dist-android/static/65.220dfd6b1dd8e75c9d08.js +1 -0
  63. package/dist-android/static/66.da91b8ed2181ced4a4de.js +1 -0
  64. package/dist-android/static/67.75a3f13bea3c0ac4bbbe.js +1 -0
  65. package/dist-android/static/68.37aa2fd75666d1461dac.js +1 -0
  66. package/dist-android/static/69.e6a3e52929239e08b8d3.js +1 -0
  67. package/dist-android/static/7.57945431c1f505e425c1.js +13 -0
  68. package/dist-android/static/70.945cf028761bd66a2302.js +1 -0
  69. package/dist-android/static/71.0ae45dcfc105541b051d.js +1 -0
  70. package/dist-android/static/72.d89a35482e9c434d0bd0.js +1 -0
  71. package/dist-android/static/8.830a99f33590aeb637a3.js +13 -0
  72. package/dist-android/static/9.2432be88a7316649f45b.js +12 -0
  73. package/dist-android/static/appca71cf7af0c441a6b6ff.js +135 -0
  74. package/dist-android/static/doc.jpg +0 -0
  75. package/dist-android/static/images/lefticon//345/215/241/346/234/215/345/212/241/347/256/241/347/220/206.png +0 -0
  76. package/dist-android/static/images/lefticon//345/221/274/345/217/253/347/263/273/347/273/237.png +0 -0
  77. package/dist-android/static/images/lefticon//345/224/256/346/260/224/346/224/266/350/264/271.png +0 -0
  78. package/dist-android/static/images/lefticon//345/233/276/345/261/2023/346/213/267/350/264/2354.png +0 -0
  79. package/dist-android/static/images/lefticon//345/233/276/345/261/202577.png +0 -0
  80. package/dist-android/static/images/lefticon//345/233/276/345/261/2028/346/213/267/350/264/23513.png +0 -0
  81. package/dist-android/static/images/lefticon//345/256/211/346/243/200/346/237/245/347/234/213.png +0 -0
  82. package/dist-android/static/images/lefticon//345/256/211/346/243/200/350/256/241/345/210/222.png +0 -0
  83. package/dist-android/static/images/lefticon//345/276/256/344/277/241/346/234/215/345/212/241.png +0 -0
  84. package/dist-android/static/images/lefticon//346/212/245/345/273/272/347/263/273/347/273/237.png +0 -0
  85. package/dist-android/static/images/lefticon//346/212/245/350/241/250/346/237/245/350/257/242.png +0 -0
  86. package/dist-android/static/images/lefticon//346/227/245/345/270/270/347/256/241/347/220/206.png +0 -0
  87. package/dist-android/static/images/lefticon//346/234/272/350/241/250/347/256/241/347/220/206.png +0 -0
  88. package/dist-android/static/images/lefticon//346/237/245/350/257/242/345/210/227/350/241/250.png +0 -0
  89. package/dist-android/static/images/lefticon//346/241/243/346/241/210/347/256/241/347/220/206.png +0 -0
  90. package/dist-android/static/images/lefticon//347/211/251/350/201/224/347/275/221/350/241/250.png +0 -0
  91. package/dist-android/static/images/lefticon//347/263/273/347/273/237/347/256/241/347/220/206.png +0 -0
  92. package/dist-android/static/images/lefticon//347/263/273/347/273/237/350/256/276/347/275/256.png +0 -0
  93. package/dist-android/static/images/lefticon//347/273/217/350/220/245/347/256/241/346/216/247.png +0 -0
  94. package/dist-android/static/images/lefticon//347/273/274/345/220/210/344/270/232/345/212/241.png +0 -0
  95. package/dist-android/static/images/lefticon//347/273/274/345/220/210/346/237/245/350/257/242.png +0 -0
  96. package/dist-android/static/images/lefticon//350/217/234/345/215/225/344/274/270/347/274/251.png +0 -0
  97. package/dist-android/static/images/lefticon//351/200/200/345/207/272/347/263/273/347/273/237.png +0 -0
  98. package/dist-android/static/imgerror.jpg +0 -0
  99. package/dist-android/static/jsoneditor-icons.svg +893 -0
  100. package/dist-android/static/newStyle/clear.png +0 -0
  101. package/dist-android/static/newStyle/fife.png +0 -0
  102. package/dist-android/static/newStyle/hidden.png +0 -0
  103. package/dist-android/static/newStyle/label-clear.png +0 -0
  104. package/dist-android/static/newStyle/left-img.png +0 -0
  105. package/dist-android/static/newStyle/list_ok.png +0 -0
  106. package/dist-android/static/newStyle/login-check.png +0 -0
  107. package/dist-android/static/newStyle/login-con.png +0 -0
  108. package/dist-android/static/newStyle/login-do.gif +0 -0
  109. package/dist-android/static/newStyle/login-f.png +0 -0
  110. package/dist-android/static/newStyle/login-info.png +0 -0
  111. package/dist-android/static/newStyle/login-left.png +0 -0
  112. package/dist-android/static/newStyle/login-org.png +0 -0
  113. package/dist-android/static/newStyle/login-pwd.png +0 -0
  114. package/dist-android/static/newStyle/login-user.png +0 -0
  115. package/dist-android/static/newStyle/loginbg.gif +0 -0
  116. package/dist-android/static/newStyle/loginbg1280.gif +0 -0
  117. package/dist-android/static/newStyle/loginbg1366.gif +0 -0
  118. package/dist-android/static/newStyle/setting.png +0 -0
  119. package/dist-android/static/newStyle/setting1.png +0 -0
  120. package/dist-android/static/newStyle/shirk.png +0 -0
  121. package/dist-android/static/newStyle/stretch_bottom.png +0 -0
  122. package/dist-android/static/newStyle/stretch_left.png +0 -0
  123. package/dist-android/static/newStyle/stretch_right.png +0 -0
  124. package/dist-android/static/newStyle/stretch_top.png +0 -0
  125. package/dist-android/static/newStyle/system-off.png +0 -0
  126. package/dist-android/static/pdf.jpg +0 -0
  127. package/dist-android/static//344/270/213/350/275/275/350/256/241/345/210/222.png +0 -0
  128. package/dist-android/static//344/273/273/345/212/241/346/237/245/350/257/242.png +0 -0
  129. package/dist-android/static//344/277/241/346/201/257/345/205/254/345/221/212.png +0 -0
  130. package/dist-android/static//345/205/254/345/221/212/346/237/245/347/234/213.png +0 -0
  131. package/dist-android/static//345/206/214/345/206/205/351/241/272/345/272/217/344/277/256/346/224/271.png +0 -0
  132. package/dist-android/static//345/215/241/350/241/250/345/234/250/347/272/277/346/212/204/350/241/250.png +0 -0
  133. package/dist-android/static//345/234/250/347/272/277/345/256/211/346/243/200.png +0 -0
  134. package/dist-android/static//345/234/250/347/272/277/345/267/241/346/243/200.png +0 -0
  135. package/dist-android/static//345/234/250/347/272/277/346/212/204/350/241/250.png +0 -0
  136. package/dist-android/static//345/234/250/347/272/277/346/212/242/344/277/256.png +0 -0
  137. package/dist-android/static//345/234/250/347/272/277/346/212/245/350/243/205.png +0 -0
  138. package/dist-android/static//345/234/250/347/272/277/346/223/215/344/275/234.png +0 -0
  139. package/dist-android/static//345/234/250/347/272/277/347/273/264/344/277/256.png +0 -0
  140. package/dist-android/static//345/234/250/347/272/277/347/274/264/350/264/271.png +0 -0
  141. package/dist-android/static//345/234/250/347/272/277/351/200/232/346/260/224.png +0 -0
  142. package/dist-android/static//345/256/211/346/243/200/345/267/262/345/212/236.png +0 -0
  143. package/dist-android/static//345/256/211/346/243/200/345/276/205/345/212/236.png +0 -0
  144. package/dist-android/static//345/256/211/346/243/200/346/212/275/345/215/225.png +0 -0
  145. package/dist-android/static//345/256/211/350/243/205/344/270/212/344/274/240.png +0 -0
  146. package/dist-android/static//345/256/211/350/243/205/345/267/262/345/212/236.png +0 -0
  147. package/dist-android/static//345/256/211/350/243/205/345/276/205/345/212/236.png +0 -0
  148. package/dist-android/static//345/267/241/346/243/200/344/270/212/344/274/240.png +0 -0
  149. package/dist-android/static//345/267/241/346/243/200/345/267/262/345/212/236.png +0 -0
  150. package/dist-android/static//345/274/200/345/205/263/351/230/200.png +0 -0
  151. package/dist-android/static//345/275/242/347/212/2664.png +0 -0
  152. package/dist-android/static//346/211/271/351/207/217/346/212/204/350/241/250.png +0 -0
  153. package/dist-android/static//346/212/204/350/241/250/344/270/212/344/274/240.png +0 -0
  154. package/dist-android/static//346/212/204/350/241/250/345/267/262/345/212/236.png +0 -0
  155. package/dist-android/static//346/212/204/350/241/250/345/276/205/345/212/236.png +0 -0
  156. package/dist-android/static//346/212/204/350/241/250/350/256/260/345/275/225.png +0 -0
  157. package/dist-android/static//346/212/245/345/273/272/346/234/215/345/212/241.png +0 -0
  158. package/dist-android/static//346/224/266/350/264/271/346/261/207/346/200/273/350/241/250.png +0 -0
  159. package/dist-android/static//346/224/266/350/264/271/350/256/260/345/275/225.png +0 -0
  160. package/dist-android/static//346/227/245/346/212/245/346/237/245/350/257/242.png +0 -0
  161. package/dist-android/static//346/241/243/346/241/210/344/277/256/346/224/271.png +0 -0
  162. package/dist-android/static//346/265/201/347/250/213/344/270/232/345/212/241.png +0 -0
  163. package/dist-android/static//346/265/201/347/250/213/347/233/221/346/216/247.png +0 -0
  164. package/dist-android/static//347/247/273/345/212/250/346/212/204/350/241/250.png +0 -0
  165. package/dist-android/static//347/247/273/345/212/250/346/212/204/350/241/250/345/267/262/345/212/236.png +0 -0
  166. package/dist-android/static//347/273/237/350/256/241/346/212/245/350/241/250.png +0 -0
  167. package/dist-android/static//347/273/264/344/277/256/346/264/276/345/217/221.png +0 -0
  168. package/dist-android/static//350/220/245/344/270/232/345/233/276/350/241/250.png +0 -0
  169. package/dist-android/static//350/241/250/345/206/214/351/241/272/345/272/217.png +0 -0
  170. package/dist-android/static//350/260/203/344/273/267/350/241/245/345/267/256/347/274/264/350/264/271.png +0 -0
  171. package/dist-android/static//350/277/233/345/272/246/345/210/227/350/241/250.png +0 -0
  172. package/dist-android/static//351/200/200/345/207/272/347/231/273/345/275/225.png +0 -0
  173. package/dist-android/static//351/200/201/346/260/224/344/270/212/344/274/240.png +0 -0
  174. package/dist-android/static//351/200/201/346/260/224/345/267/262/345/212/236.png +0 -0
  175. package/dist-android/static//351/200/201/346/260/224/345/276/205/345/212/236.png +0 -0
  176. package/dist-android/static//351/232/220/346/202/243/345/244/204/347/220/206.png +0 -0
  177. package/dist-android/static//351/233/206/344/270/255/345/256/211/346/243/200.png +0 -0
  178. package/dist-android/static//351/253/230/345/257/206/345/205/254/345/221/212.png +0 -0
  179. package/index.html +30 -30
  180. package/package.json +1 -1
  181. package/src/apply.js +69 -69
  182. package/src/components/image/TXT.png +0 -0
  183. package/src/components/image/dwg.png +0 -0
  184. package/src/components/image/dxf.png +0 -0
  185. package/src/components/product/Function/InstallFunction.vue +1 -1
  186. package/src/components/product/Function/InstallInfoSelect.vue +281 -281
  187. package/src/components/product/Process/ExplorationSelect.vue +347 -347
  188. package/src/components/product/Process/ExplorationUser.vue +1 -1
  189. package/src/components/product/Process/Processes/InstallationDetails.vue +45 -9
  190. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +261 -249
  191. package/src/components/product/Process/Processes/chargeManagement.vue +562 -562
  192. package/src/components/product/Process/Service/ServiceControl.vue +46 -154
  193. package/src/components/product/ReportForm/GasIgnitionSummary.vue +352 -352
  194. package/src/components/product/ServiceView.vue +755 -755
  195. package/src/components/product/Supervisory/SupervisoryControl.vue +1 -1
  196. package/src/components/product/Supervisory/SupervisoryList.vue +208 -208
  197. package/src/components/product/Supervisory/SupervisoryhCart.vue +103 -103
  198. package/src/components/product/VueUtils/ApplyUpload.vue +266 -261
@@ -1,755 +1,755 @@
1
- <template>
2
- <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
- <validator name="v">
4
- <form class="form-horizontal">
5
- <div class="form-group">
6
- <div v-for="(index,item) in data.fields" style="">
7
- <!--input-->
8
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
9
- v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
10
- v-show="!item.hidden"
11
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
12
- <label :style="item.label_style ? item.label_style : ''"
13
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
14
- <div :style="item.value_style ? item.value_style:''"
15
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
16
- <input class="form-control input_view" style=""
17
- :type="item.type"
18
- v-model="data.fields[index].value"
19
- :placeholder="item.placeholder"
20
- :value="data.fields[index].value"
21
- :readonly="item.readonly"
22
- :disabled="item.disabled"
23
- @change="onchange(index)"
24
- @blur="onblur(index)"
25
- @input="oninput(index)"
26
- />
27
- <span
28
- v-if="item.error&&item.error.msg&&item.error.flag"
29
- style="color: red">{{item.error.msg}}</span>
30
- </div>
31
- </div>
32
- <!--时间datepicker-->
33
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
34
- v-if="item.type==='datepicker'"
35
- v-show="!item.hidden"
36
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
37
- <label
38
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
39
- <div :style="item.value_style ? item.value_style:''"
40
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
41
- <datepicker
42
- @change="onchange(index)"
43
- @blur="onblur(index)"
44
- :placeholder="item.placeholder"
45
- :value.sync="data.fields[index].value"
46
- :format="item.format ? item.format : 'yyyy-MM-dd'"
47
- v-model="data.fields[index].value"
48
- :readonly="item.readonly"
49
- :disabled="item.disabled"
50
- :show-reset-button="reset">
51
- </datepicker>
52
- </div>
53
- <span
54
- v-if="item.error&&item.error.msg&&item.error.flag"
55
- style="color: red">{{item.error.msg}}</span>
56
- </div>
57
-
58
- <!--textarea-->
59
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
60
- v-if="item.type==='textarea'" v-show="!item.hidden"
61
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
62
- <label :style="item.label_style ? item.label_style : ''"
63
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
64
- <div :style="item.value_style ? item.value_style:''"
65
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
66
- <textarea
67
- :readonly="item.readonly"
68
- :disabled="item.disabled"
69
- class="form-control input_view"
70
- style="width: 100%;height: 100%"
71
- :rows="item.rows"
72
- v-model="data.fields[index].value"
73
- :value="data.fields[index].value"
74
- @change="onchange(index)"
75
- @blur="onblur(index)"
76
- @input="oninput(index)"
77
- >
78
- </textarea>
79
- </div>
80
- <span
81
- v-if="item.error&&item.error.msg&&item.error.flag"
82
- style="color: red">{{item.error.msg}}</span>
83
- </div>
84
-
85
- <!--radio-->
86
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
87
- v-if="item.type==='radio'"
88
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
89
- <label v-if="item.label"
90
- :class="item.label_bootstraped?item.label_bootstraped+' control-label-justify control-label':'control-label-justify control-label col-sm-2'">{{item.label}}</label>
91
- <div
92
- :style="item.value_style ? item.value_style:''"
93
- :class="item.value_bootstraped?item.value_bootstraped:item.items.length%2 == 0?'col-sm-5': 'col-sm-3'"
94
- v-for="(index2,row) in item.items">
95
- <label :for="row.label"
96
- :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'">{{row.label}}</label>
97
- <input @blur="onblur(index)"
98
- :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'"
99
- :readonly="item.readonly" :disabled="item.disabled" style="margin-top: 10px" type="radio"
100
- :name="index" :id="row.label" v-bind:value="data.fields[index].items[index2].value"
101
- v-model="data.fields[index].value">
102
- </div>
103
- <span
104
- v-if="item.error&&item.error.msg&&item.error.flag"
105
- style="color: red">{{item.error.msg}}</span>
106
- </div>
107
-
108
- <!--select-->
109
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
110
- v-if="item.type==='select'" v-show="!item.hidden"
111
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
112
- <label
113
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
114
- <div :style="item.value_style ? item.value_style:''"
115
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
116
- <input-select
117
- class="select select_list"
118
- @blur="onblur(index)"
119
- @change="onchange(index)"
120
- :readonly="item.readonly"
121
- :disable="item.disabled"
122
- :value.sync="data.fields[index].value"
123
- v-model="data.fields[index].value"
124
- :options='data.fields[index].options'
125
- :valueSingle="true"></input-select>
126
- </div>
127
- <span
128
- v-if="item.error&&item.error.msg&&item.error.flag"
129
- style="color: red">{{item.error.msg}}</span>
130
- </div>
131
-
132
- <!--checkbox-->
133
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
134
- v-if="item.type==='checkbox'"
135
- :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
136
- <label v-if="item.label"
137
- :class="item.label_bootstraped?item.label_bootstraped+' control-label ':'control-label col-sm-2'">{{item.label}}</label>
138
- <div style="margin-top: 6px"
139
- :class="item.value_bootstraped?item.value_bootstraped:'control-label col-sm-2'"
140
- v-for="(index2,row) in item.items">
141
- <label class="font-size form-group col-sm-6">{{row.label}}</label>
142
- <input :readonly="item.readonly" :disabled="item.disabled" type="checkbox" class="col-sm-6"
143
- :id="row.label" v-model="data.fields[index].items[index2].value" @blur="onblur(index)" >
144
- </div>
145
- </div>
146
- </div>
147
- </div>
148
- <!-- onetomany -->
149
- <div class="" v-for="(i,item) in data.onetomany" style="overflow:auto;width:100%">
150
- <table v-show="!item.hidden" class="table table-bordered table-striped table-hover" style="white-space:nowrap">
151
- <tr>
152
- <th>序号</th>
153
- <th v-for="field in item.fields" v-if="!field.displayPosition || field.displayPosition === '*' || field.displayPosition === 'list'">
154
- <nobr>{{field.label}}</nobr>
155
- </th>
156
- <th v-if="!item.hiddenOperate">
157
- <button type="button" @click="add(i)" class="btn btn-info"
158
- v-if="showprint && !item.addHidden">
159
- <span v-if="item.addText === 'default' || !item.addText" class="glyphicon glyphicon-plus" aria-hidden="true"></span>
160
- <span v-else :style="item.addStyle">{{item.addText}}</span>
161
- </button>
162
- </th>
163
- </tr>
164
- <tr v-for="(j,row) in item.rows" style="">
165
- <td style="text-align: center">{{$index+1}}</td>
166
- <td v-for="key in item.fields" v-if="!key.displayPosition || key.displayPosition === '*' || key.displayPosition === 'list'" style="text-align: center">
167
- {{row[key.field]}}
168
- </td>
169
- <td style="text-align: center" v-if="!item.hiddenOperate">
170
- <span @click="update(i,j)" v-if="showprint && !item.updateHidden">
171
- <span v-if="item.updateText === 'default' || !item.updateText" class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
172
- <span v-else :style="item.updateStyle">{{item.updateText}}</span>
173
- </span>
174
- <span @click="delete(i,j)" v-if="showprint && !item.deleteHidden" style="margin-left: 10px">
175
- <span v-if="item.deleteText === 'default' || !item.deleteText" class="glyphicon glyphicon-trash" aria-hidden="true"></span>
176
- <span v-else :style="item.deleteStyle">{{item.deleteText}}</span>
177
- </span>
178
- </td>
179
- </tr>
180
- </table>
181
- </div>
182
-
183
- <div v-for="(i,item) in data.components">
184
- <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
185
- </div>
186
-
187
- <!--自定义组件-->
188
- <slot></slot>
189
- <!--公司等属性-->
190
- <div class="col-sm-12 form-group text-center" style="padding-top:8px">
191
- <div class="col-sm-3 form-group center-block">
192
- <label class="col-sm-5">所属公司:</label>
193
- <div class="col-sm-6" style="text-align: left">
194
- {{model.f_filiale}}
195
- </div>
196
- </div>
197
- <div class="col-sm-3 form-group center-block">
198
- <label class="col-sm-5">部门:</label>
199
- <div class="col-sm-6" style="text-align: left">
200
- {{model.f_parentname}}
201
- </div>
202
- </div>
203
- <div class="col-sm-3 form-group center-block">
204
- <label class="col-sm-5">操作人:</label>
205
- <div class="col-sm-6 " style="text-align: left">
206
- {{model.f_operator}}
207
- </div>
208
- </div>
209
- <div class="col-sm-3 form-group center-block">
210
- <label class="col-sm-5">操作日期:</label>
211
- <div class="col-sm-6" style="text-align: left">
212
- {{model.f_operate_date}}
213
- </div>
214
- </div>
215
- </div>
216
-
217
- </form>
218
- </validator>
219
-
220
- <!-- 按钮组 -->
221
- <div class="from-group col-sm-12" style="margin-top: 20px;height: 100px">
222
- <center>
223
- <!-- 按钮组 -->
224
- <button v-for="(index,button) in data.buttons"
225
- :disabled="(button.button_name==='提交'||button.button_name==='下发')&&disable_button" type="button"
226
- @click="clicked(index,button)"
227
- :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
228
- v-if="!button.hidden"
229
- style="min-width:100px; margin-right:50px;">
230
- {{button.button_name}}
231
- </button>
232
- </center>
233
- </div>
234
-
235
- <!-- onetomany模态框 -->
236
- <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
237
- <header slot="modal-header" class="modal-header">
238
- <button type="button" class="close" @click="closemodal(modeltitle)"><span>&times;</span></button>
239
- <span class="modal-title"><font
240
- size="3">{{modeltitle}}</font></span>
241
- </header>
242
- <article slot="modal-body" class="modal-body clearfix">
243
- <div
244
- :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped:'col-sm-12']"
245
- v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
246
- <label v-show="!item.hidden" :class="item.label_bootstraped ? item.label_bootstraped + ' control-label' : 'control-label col-sm-3'" style="margin-top: 10px">{{item.label}}:</label>
247
- <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-7'" v-show="!item.hidden">
248
- <!--时间datepicker-->
249
- <datepicker
250
- v-if="item.type=='datepicker'"
251
- @change="onchange_modal(index)"
252
- @blur="onblur_modal(index)"
253
- :placeholder="item.placeholder"
254
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
255
- :format="'yyyy-MM-dd'"
256
- v-model="data.onetomany[onetomany_index].fields[index].value"
257
- :readonly="item.readonly"
258
- :disabled="item.disabled"
259
- :show-reset-button="reset">
260
- </datepicker>
261
- <!--select-->
262
- <input-select
263
- @change="onchange_modal(index)"
264
- v-if="item.type=='select'"
265
- @blur="onblur_modal(index)"
266
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
267
- v-model="data.onetomany[onetomany_index].fields[index].value"
268
- :options='data.onetomany[onetomany_index].fields[index].options'>
269
- </input-select>
270
- <!-- input -->
271
- <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
272
- class="form-control"
273
- :type="item.type"
274
- v-model="data.onetomany[onetomany_index].fields[index].value"
275
- :placeholder="item.placeholder"
276
- :value="data.onetomany[onetomany_index].fields[index].value"
277
- :readonly="item.readonly"
278
- :disabled="item.disabled"
279
- @change="onchange_modal(index)"
280
- @blur="onblur_modal(index)"
281
- @input="oninput_modal(index)"
282
- />
283
- </div>
284
- </div>
285
- </article>
286
- <footer slot="modal-footer" class="modal-footer">
287
- <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
288
- :disabled="disable_button_onetomany" type="button" @click="confirm_modal(modeltitle)">
289
- 确认
290
- </button>
291
- </footer>
292
- </modal>
293
-
294
- <!-- 按钮模态框 -->
295
- <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
296
- <header slot="modal-header" class="modal-header">
297
- <button type="button" class="close" @click="closemodal('but')"><span>&times;</span></button>
298
- <h4 class="modal-title">{{model.button.button_name}}</h4>
299
- </header>
300
- <article slot="modal-body" class="modal-body">
301
- <div class="col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
302
- <label class="control-label col-sm-3" style="margin-top: 10px">{{button.label}}:</label>
303
- <div class="col-sm-7">
304
- <!--select-->
305
- <input-select v-if="button.type=='select'"
306
- :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
307
- v-model="data.buttons[model.button.button_index].button_fields[index].value"
308
- :options='button.options'></input-select>
309
- <!-- input -->
310
- <input v-else type="text" class="form-control"
311
- v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
312
- </div>
313
- </div>
314
- </article>
315
- <footer slot="modal-footer" style="border-top:none" class="modal-footer">
316
- <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
317
- </footer>
318
- </modal>
319
- </div>
320
- </template>
321
- <script>
322
- import Vue from 'vue'
323
- // Date格式化
324
- Date.prototype.Format = function (fmt) {
325
- var o = {
326
- 'M+': this.getMonth() + 1, // 月份
327
- 'd+': this.getDate(), // 日
328
- 'H+': this.getHours(), // 小时
329
- 'm+': this.getMinutes(), // 分
330
- 's+': this.getSeconds(), // 秒
331
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
332
- 'S': this.getMilliseconds() // 毫秒
333
- }
334
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
335
- for (var k in o) {
336
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
337
- }
338
- return fmt
339
- }
340
-
341
- export default {
342
- title: '报建业务通用组件',
343
- props: {
344
- data: {
345
- type: Object
346
- },
347
- showprint: {
348
- type: Boolean,
349
- default: true
350
- }
351
- },
352
- data () {
353
- return {
354
- model: {}, // 公司等属性
355
- disable_button: true, // 控制按钮禁用
356
- show: false, // 控制onetomany模态框
357
- disable_button_onetomany: true, // 控制onetomany模态框按钮
358
- onetomany_index: null, // 当前选择的下标
359
- update_onetomany_index: null, // 当前需要修改的下标
360
- modeltitle: null, // 模态框标题
361
- modalSize: null, // 模态框大小
362
- showbutmodal: false,
363
- }
364
- },
365
- watch: {
366
- deep: true
367
- },
368
- computed: {
369
-
370
- },
371
- created () {
372
- // 初始化数据
373
- this.initializtion()
374
- this.$dispatch('initializtionView')
375
-
376
- this.disableButton()
377
- },
378
- methods: {
379
- // 按钮模态框确定
380
- confirm_but_modal() {
381
- for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
382
- this.model.button.button_fields[item.field] = item.value
383
- }
384
- this.showbutmodal = false
385
- this.disable_button_but = true
386
- this.$dispatch('button', this.model)
387
- },
388
- // 点击按钮组按钮
389
- async clicked(index, button) {
390
- this.disable_button = true
391
- // 组织model.fields数据
392
- for (const item of this.data.fields) {
393
- // checkbox特殊处理
394
- if (item.type === 'checkbox') {
395
- for (let j = 0; j < item.items.length; j++) {
396
- this.model[item.items[j].field] = item.items[j].value
397
- }
398
- } else {
399
- this.model[item.field] = item.value
400
- }
401
- }
402
- this.model.f_process_id = this.data.f_process_id
403
-
404
- // 初始化model.button数据
405
- let buttondatas = {
406
- button_fields: {}
407
- }
408
- buttondatas.button_name = button.button_name
409
- buttondatas.button_index = index
410
- if (button.button_fields) {
411
- for (const item of button.button_fields) {
412
- buttondatas.button_fields[item.field] = item.value
413
- }
414
- }
415
- this.model.button = buttondatas
416
- this.model.title = this.data.title
417
- this.model.fields = this.data.fields
418
- this.model.onetomany = this.data.onetomany
419
-
420
-
421
- if (button.button_name === '退回') {
422
- this.showbutmodal = true
423
- } else if (button.button_name === '下发') {
424
- this.showbutmodal = true
425
- } else {
426
- this.$dispatch('button', this.model)
427
- }
428
- },
429
- // 初始化数据
430
- initializtion () {
431
- // 是否禁用按钮
432
- this.disableButton()
433
-
434
- // datepicker 没有值给当时值
435
- for (const item of this.data.fields) {
436
- if (item.type === 'datepicker' && !item.value) {
437
- item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
438
- }
439
- }
440
-
441
- // 公司等属性初始化
442
- if (this.data.filiale) {
443
- this.model.f_filiale = this.data.filiale
444
- } else {
445
- this.model.f_filiale = this.$login.f.f_fengongsi
446
- }
447
- if (this.data.f_parentname) {
448
- this.model.f_parentname = this.data.f_parentname
449
- } else {
450
- this.model.f_parentname = this.$login.f.f_parentname
451
- }
452
- if (this.data.operate_date) {
453
- this.model.f_operate_date = this.data.operate_date
454
- } else {
455
- this.model.f_operate_date = new Date().Format('yyyy-MM-dd')
456
- }
457
- if (this.data.operator) {
458
- this.model.f_operator = this.data.operator
459
- } else {
460
- this.model.f_operator = this.$login.f.name
461
- }
462
- },
463
- // 是否禁用按钮
464
- disableButton () {
465
- let fields = this.data.fields
466
-
467
- let flag = false
468
- for (const item of fields) {
469
- if (item.type !== 'checkbox' && item.required && !item.value) {
470
- if (item.value === 0) {
471
- flag = false
472
- } else {
473
- flag = true
474
- }
475
- }
476
- // 任何选择框只要是否都不能提交
477
- if (item.type === 'select' && item.value === '否' && item.disabledButton) {
478
- flag = true
479
- }
480
- }
481
-
482
- let count = 0
483
- for (const item of fields) {
484
- if (item.type !== 'checkbox' && item.required) {
485
- count++
486
- }
487
- }
488
- if (count === 0) {
489
- flag = false
490
- }
491
-
492
- this.disable_button = flag
493
- },
494
- // 失去焦点触发,无论值是否发生变化
495
- onblur (index) {
496
- // 是否禁用按钮
497
- this.disableButton()
498
-
499
- this.$dispatch('onblur', index)
500
- // 如果有错误信息提示走错误信息判断处理
501
-
502
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
503
- this.$dispatch('error_check', index)
504
- }
505
- },
506
- // 失去焦点且值最终发生变化触发
507
- onchange (index) {
508
- // 是否禁用按钮
509
- this.disableButton()
510
-
511
- this.data.fields[index].value = this.data.fields[index].value.trim()
512
-
513
- if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
514
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
515
- }
516
-
517
- this.data[this.data.fields[index].field] = this.data.fields[index].value
518
-
519
- this.$dispatch('onchange', index)
520
-
521
- // 如果有错误信息提示走错误信息判断处理
522
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
523
- this.$dispatch('error_check', index)
524
- }
525
- },
526
- oninput (index) {
527
- // 是否禁用按钮
528
- this.disableButton()
529
-
530
- this.$dispatch('oninput', index)
531
-
532
- // 如果有错误信息提示走错误信息判断处理
533
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
534
- this.$dispatch('error_check', index)
535
- }
536
- },
537
- // 模态框确认按钮
538
- confirm_modal (title) {
539
- if (title === '新增') {
540
- if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
541
- this.$dispatch('onetomanyadd', this.onetomany_index)
542
- } else {
543
- this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
544
- }
545
- } else {
546
- if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
547
- this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
548
- } else {
549
- this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
550
- }
551
- }
552
-
553
- this.closemodal()
554
- },
555
- // 删除
556
- delete (i, j) {
557
- this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
558
- if (res === 'confirm') {
559
- if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
560
- this.$dispatch('onetomanydelete', i, j)
561
- } else {
562
- this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
563
- }
564
- }
565
- })
566
- },
567
- // 修改
568
- update (i, j) {
569
- let onetomany = this.data.onetomany[i]
570
- let item = this.data.onetomany[i].rows[j]
571
- let count = 0
572
- for (let k = 0; k < onetomany.fields.length; k++) {
573
- // 防止初始化的时候没有value
574
- Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
575
-
576
- if (onetomany.fields[j].required) {
577
- count++
578
- }
579
- }
580
- if (count === 0) {
581
- this.disable_button_onetomany = false
582
- }
583
- this.modeltitle = '修改'
584
- this.modalSize = this.data.onetomany[i].modalSize
585
- this.onetomany_index = i
586
- this.update_onetomany_index = j
587
-
588
- this.$dispatch('openUpdateModel',i,j)
589
-
590
- this.show = true
591
- },
592
- // 添加
593
- add (index) {
594
- let count = 0
595
- for (const item of this.data.onetomany[index].fields) {
596
- if (item.type === 'datepicker') {
597
- item.value = new Date().Format('yyyy-MM-dd')
598
- }
599
- if (item.required) {
600
- count++
601
- }
602
- }
603
-
604
- if (count === 0) {
605
- this.disable_button_onetomany = false
606
- }
607
- this.modeltitle = '新增'
608
- this.modalSize = this.data.onetomany[index].modalSize
609
- this.onetomany_index = index
610
-
611
- this.$dispatch('openAddModel',index)
612
-
613
- this.show = true
614
- },
615
- // 关闭模态框
616
- closemodal (val) {
617
- if (val === 'but'){
618
- this.disableButton()
619
- this.showbutmodal = false
620
- return
621
- }
622
- for (const item of this.data.onetomany[this.onetomany_index].fields) {
623
- item.value = ''
624
- }
625
- this.show = false
626
- this.disable_button_onetomany = true
627
- this.onetomany_index = null
628
- this.update_onetomany_index = null
629
- this.modeltitle = null
630
- this.modalSize = null
631
- },
632
- // 是否禁用模态框按钮
633
- disableModalButton () {
634
- let fields = this.data.onetomany[this.onetomany_index].fields
635
-
636
- let flag = false
637
- for (const item of fields) {
638
- if (item.type !== 'checkbox' && item.required && !item.value) {
639
- if (item.value === 0) {
640
- flag = false
641
- } else {
642
- flag = true
643
- }
644
- }
645
- }
646
-
647
- let count = 0
648
- for (const item of fields) {
649
- if (item.type !== 'checkbox' && item.required) {
650
- count++
651
- }
652
- }
653
- if (count === 0) {
654
- flag = false
655
- }
656
- this.disable_button_onetomany = flag
657
- },
658
- // 监听模态框属性失去焦点
659
- onchange_modal (index) {
660
- this.disableModalButton()
661
- this.$dispatch('onchange_modal', this.onetomany_index, index)
662
- },
663
- // 监听模态框属性失去焦点
664
- onblur_modal (index) {
665
- this.disableModalButton()
666
- this.$dispatch('onblur_modal', this.onetomany_index, index)
667
- },
668
- // input输入属性值发生变化监听
669
- oninput_modal (index) {
670
- this.disableModalButton()
671
- this.$dispatch('oninput_modal', this.onetomany_index, index)
672
- }
673
- },
674
- events: {
675
-
676
- }
677
- }
678
- </script>
679
- <style>
680
- .datepicker{
681
- width: 100%!important;
682
- }
683
- .datepicker-input{
684
- background-color: #ffffff!important;
685
- width: 100%!important;
686
- }
687
- .datepicker-input:disabled{
688
- border: 1px solid #DDD!important;
689
- color: #ACA899!important;
690
- width: 100%!important;
691
- }
692
- </style>
693
- <style scoped>
694
- th{
695
- font-size: 15px !important;
696
- text-align: center !important;
697
- background-color: #dfedfb!important;
698
- color: #666666 !important;
699
- font-family: PINGFANG-BOLD !important;
700
- font-weight: normal!important;
701
- }
702
- /*清除model中的浮动*/
703
- .clearfix:after,.clearfix:before{
704
- display: table;
705
- }
706
- .clearfix:after{
707
- clear: both;
708
- }
709
-
710
- .input_view{
711
- padding: 8px;
712
- background-color: #ffffff;
713
- border-radius: 2px;
714
- border: solid 1px #c7c7c7!important;
715
- color: #333333!important;
716
- font-size: 15px!important;
717
- }
718
-
719
- .input_view[readonly]{
720
- border: 1px solid #DDD!important;
721
- /*background-color: #F5F5F5;*/
722
- color:#ACA899!important;
723
- }
724
- .input_view:disabled{
725
- border: 1px solid #DDD!important;
726
- /*background-color: #F5F5F5;*/
727
- color:#ACA899!important;
728
- }
729
-
730
- .control-label-justify {
731
- display: inline-block;
732
- vertical-align: top;
733
- width: 110px;
734
- text-align: justify;
735
- font-family: PingFang-SC-Bold;
736
- }
737
-
738
- .control-label-justify::after {
739
- content: "";
740
- display: inline-block;
741
- width: 70px;
742
- overflow: hidden;
743
- height: 0;
744
- }
745
-
746
- input::-webkit-outer-spin-button,
747
- input::-webkit-inner-spin-button {
748
- -webkit-appearance: none;
749
- }
750
-
751
- input[type="number"] {
752
- -moz-appearance: textfield;
753
- }
754
-
755
- </style>
1
+ <template>
2
+ <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
+ <validator name="v">
4
+ <form class="form-horizontal">
5
+ <div class="form-group">
6
+ <div v-for="(index,item) in data.fields" style="">
7
+ <!--input-->
8
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
9
+ v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
10
+ v-show="!item.hidden"
11
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
12
+ <label :style="item.label_style ? item.label_style : ''"
13
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
14
+ <div :style="item.value_style ? item.value_style:''"
15
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
16
+ <input class="form-control input_view" style=""
17
+ :type="item.type"
18
+ v-model="data.fields[index].value"
19
+ :placeholder="item.placeholder"
20
+ :value="data.fields[index].value"
21
+ :readonly="item.readonly"
22
+ :disabled="item.disabled"
23
+ @change="onchange(index)"
24
+ @blur="onblur(index)"
25
+ @input="oninput(index)"
26
+ />
27
+ <span
28
+ v-if="item.error&&item.error.msg&&item.error.flag"
29
+ style="color: red">{{item.error.msg}}</span>
30
+ </div>
31
+ </div>
32
+ <!--时间datepicker-->
33
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
34
+ v-if="item.type==='datepicker'"
35
+ v-show="!item.hidden"
36
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
37
+ <label
38
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
39
+ <div :style="item.value_style ? item.value_style:''"
40
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
41
+ <datepicker
42
+ @change="onchange(index)"
43
+ @blur="onblur(index)"
44
+ :placeholder="item.placeholder"
45
+ :value.sync="data.fields[index].value"
46
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
47
+ v-model="data.fields[index].value"
48
+ :readonly="item.readonly"
49
+ :disabled="item.disabled"
50
+ :show-reset-button="reset">
51
+ </datepicker>
52
+ </div>
53
+ <span
54
+ v-if="item.error&&item.error.msg&&item.error.flag"
55
+ style="color: red">{{item.error.msg}}</span>
56
+ </div>
57
+
58
+ <!--textarea-->
59
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
60
+ v-if="item.type==='textarea'" v-show="!item.hidden"
61
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
62
+ <label :style="item.label_style ? item.label_style : ''"
63
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
64
+ <div :style="item.value_style ? item.value_style:''"
65
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
66
+ <textarea
67
+ :readonly="item.readonly"
68
+ :disabled="item.disabled"
69
+ class="form-control input_view"
70
+ style="width: 100%;height: 100%"
71
+ :rows="item.rows"
72
+ v-model="data.fields[index].value"
73
+ :value="data.fields[index].value"
74
+ @change="onchange(index)"
75
+ @blur="onblur(index)"
76
+ @input="oninput(index)"
77
+ >
78
+ </textarea>
79
+ </div>
80
+ <span
81
+ v-if="item.error&&item.error.msg&&item.error.flag"
82
+ style="color: red">{{item.error.msg}}</span>
83
+ </div>
84
+
85
+ <!--radio-->
86
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
87
+ v-if="item.type==='radio'"
88
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
89
+ <label v-if="item.label"
90
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label-justify control-label':'control-label-justify control-label col-sm-2'">{{item.label}}</label>
91
+ <div
92
+ :style="item.value_style ? item.value_style:''"
93
+ :class="item.value_bootstraped?item.value_bootstraped:item.items.length%2 == 0?'col-sm-5': 'col-sm-3'"
94
+ v-for="(index2,row) in item.items">
95
+ <label :for="row.label"
96
+ :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'">{{row.label}}</label>
97
+ <input @blur="onblur(index)"
98
+ :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'"
99
+ :readonly="item.readonly" :disabled="item.disabled" style="margin-top: 10px" type="radio"
100
+ :name="index" :id="row.label" v-bind:value="data.fields[index].items[index2].value"
101
+ v-model="data.fields[index].value">
102
+ </div>
103
+ <span
104
+ v-if="item.error&&item.error.msg&&item.error.flag"
105
+ style="color: red">{{item.error.msg}}</span>
106
+ </div>
107
+
108
+ <!--select-->
109
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
110
+ v-if="item.type==='select'" v-show="!item.hidden"
111
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
112
+ <label
113
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
114
+ <div :style="item.value_style ? item.value_style:''"
115
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
116
+ <input-select
117
+ class="select select_list"
118
+ @blur="onblur(index)"
119
+ @change="onchange(index)"
120
+ :readonly="item.readonly"
121
+ :disable="item.disabled"
122
+ :value.sync="data.fields[index].value"
123
+ v-model="data.fields[index].value"
124
+ :options='data.fields[index].options'
125
+ :valueSingle="true"></input-select>
126
+ </div>
127
+ <span
128
+ v-if="item.error&&item.error.msg&&item.error.flag"
129
+ style="color: red">{{item.error.msg}}</span>
130
+ </div>
131
+
132
+ <!--checkbox-->
133
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
134
+ v-if="item.type==='checkbox'"
135
+ :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
136
+ <label v-if="item.label"
137
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label ':'control-label col-sm-2'">{{item.label}}</label>
138
+ <div style="margin-top: 6px"
139
+ :class="item.value_bootstraped?item.value_bootstraped:'control-label col-sm-2'"
140
+ v-for="(index2,row) in item.items">
141
+ <label class="font-size form-group col-sm-6">{{row.label}}</label>
142
+ <input :readonly="item.readonly" :disabled="item.disabled" type="checkbox" class="col-sm-6"
143
+ :id="row.label" v-model="data.fields[index].items[index2].value" @blur="onblur(index)" >
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <!-- onetomany -->
149
+ <div class="" v-for="(i,item) in data.onetomany" style="overflow:auto;width:100%">
150
+ <table v-show="!item.hidden" class="table table-bordered table-striped table-hover" style="white-space:nowrap">
151
+ <tr>
152
+ <th>序号</th>
153
+ <th v-for="field in item.fields" v-if="!field.displayPosition || field.displayPosition === '*' || field.displayPosition === 'list'">
154
+ <nobr>{{field.label}}</nobr>
155
+ </th>
156
+ <th v-if="!item.hiddenOperate">
157
+ <button type="button" @click="add(i)" class="btn btn-info"
158
+ v-if="showprint && !item.addHidden">
159
+ <span v-if="item.addText === 'default' || !item.addText" class="glyphicon glyphicon-plus" aria-hidden="true"></span>
160
+ <span v-else :style="item.addStyle">{{item.addText}}</span>
161
+ </button>
162
+ </th>
163
+ </tr>
164
+ <tr v-for="(j,row) in item.rows" style="">
165
+ <td style="text-align: center">{{$index+1}}</td>
166
+ <td v-for="key in item.fields" v-if="!key.displayPosition || key.displayPosition === '*' || key.displayPosition === 'list'" style="text-align: center">
167
+ {{row[key.field]}}
168
+ </td>
169
+ <td style="text-align: center" v-if="!item.hiddenOperate">
170
+ <span @click="update(i,j)" v-if="showprint && !item.updateHidden">
171
+ <span v-if="item.updateText === 'default' || !item.updateText" class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
172
+ <span v-else :style="item.updateStyle">{{item.updateText}}</span>
173
+ </span>
174
+ <span @click="delete(i,j)" v-if="showprint && !item.deleteHidden" style="margin-left: 10px">
175
+ <span v-if="item.deleteText === 'default' || !item.deleteText" class="glyphicon glyphicon-trash" aria-hidden="true"></span>
176
+ <span v-else :style="item.deleteStyle">{{item.deleteText}}</span>
177
+ </span>
178
+ </td>
179
+ </tr>
180
+ </table>
181
+ </div>
182
+
183
+ <div v-for="(i,item) in data.components">
184
+ <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
185
+ </div>
186
+
187
+ <!--自定义组件-->
188
+ <slot></slot>
189
+ <!--公司等属性-->
190
+ <div class="col-sm-12 form-group text-center" style="padding-top:8px">
191
+ <div class="col-sm-3 form-group center-block">
192
+ <label class="col-sm-5">所属公司:</label>
193
+ <div class="col-sm-6" style="text-align: left">
194
+ {{model.f_filiale}}
195
+ </div>
196
+ </div>
197
+ <div class="col-sm-3 form-group center-block">
198
+ <label class="col-sm-5">部门:</label>
199
+ <div class="col-sm-6" style="text-align: left">
200
+ {{model.f_parentname}}
201
+ </div>
202
+ </div>
203
+ <div class="col-sm-3 form-group center-block">
204
+ <label class="col-sm-5">操作人:</label>
205
+ <div class="col-sm-6 " style="text-align: left">
206
+ {{model.f_operator}}
207
+ </div>
208
+ </div>
209
+ <div class="col-sm-3 form-group center-block">
210
+ <label class="col-sm-5">操作日期:</label>
211
+ <div class="col-sm-6" style="text-align: left">
212
+ {{model.f_operate_date}}
213
+ </div>
214
+ </div>
215
+ </div>
216
+
217
+ </form>
218
+ </validator>
219
+
220
+ <!-- 按钮组 -->
221
+ <div class="from-group col-sm-12" style="margin-top: 20px;height: 100px">
222
+ <center>
223
+ <!-- 按钮组 -->
224
+ <button v-for="(index,button) in data.buttons"
225
+ :disabled="(button.button_name==='提交'||button.button_name==='下发')&&disable_button" type="button"
226
+ @click="clicked(index,button)"
227
+ :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
228
+ v-if="!button.hidden"
229
+ style="min-width:100px; margin-right:50px;">
230
+ {{button.button_name}}
231
+ </button>
232
+ </center>
233
+ </div>
234
+
235
+ <!-- onetomany模态框 -->
236
+ <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
237
+ <header slot="modal-header" class="modal-header">
238
+ <button type="button" class="close" @click="closemodal(modeltitle)"><span>&times;</span></button>
239
+ <span class="modal-title"><font
240
+ size="3">{{modeltitle}}</font></span>
241
+ </header>
242
+ <article slot="modal-body" class="modal-body clearfix">
243
+ <div
244
+ :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped:'col-sm-12']"
245
+ v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
246
+ <label v-show="!item.hidden" :class="item.label_bootstraped ? item.label_bootstraped + ' control-label' : 'control-label col-sm-3'" style="margin-top: 10px">{{item.label}}:</label>
247
+ <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-7'" v-show="!item.hidden">
248
+ <!--时间datepicker-->
249
+ <datepicker
250
+ v-if="item.type=='datepicker'"
251
+ @change="onchange_modal(index)"
252
+ @blur="onblur_modal(index)"
253
+ :placeholder="item.placeholder"
254
+ :value.sync="data.onetomany[onetomany_index].fields[index].value"
255
+ :format="'yyyy-MM-dd'"
256
+ v-model="data.onetomany[onetomany_index].fields[index].value"
257
+ :readonly="item.readonly"
258
+ :disabled="item.disabled"
259
+ :show-reset-button="reset">
260
+ </datepicker>
261
+ <!--select-->
262
+ <input-select
263
+ @change="onchange_modal(index)"
264
+ v-if="item.type=='select'"
265
+ @blur="onblur_modal(index)"
266
+ :value.sync="data.onetomany[onetomany_index].fields[index].value"
267
+ v-model="data.onetomany[onetomany_index].fields[index].value"
268
+ :options='data.onetomany[onetomany_index].fields[index].options'>
269
+ </input-select>
270
+ <!-- input -->
271
+ <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
272
+ class="form-control"
273
+ :type="item.type"
274
+ v-model="data.onetomany[onetomany_index].fields[index].value"
275
+ :placeholder="item.placeholder"
276
+ :value="data.onetomany[onetomany_index].fields[index].value"
277
+ :readonly="item.readonly"
278
+ :disabled="item.disabled"
279
+ @change="onchange_modal(index)"
280
+ @blur="onblur_modal(index)"
281
+ @input="oninput_modal(index)"
282
+ />
283
+ </div>
284
+ </div>
285
+ </article>
286
+ <footer slot="modal-footer" class="modal-footer">
287
+ <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
288
+ :disabled="disable_button_onetomany" type="button" @click="confirm_modal(modeltitle)">
289
+ 确认
290
+ </button>
291
+ </footer>
292
+ </modal>
293
+
294
+ <!-- 按钮模态框 -->
295
+ <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
296
+ <header slot="modal-header" class="modal-header">
297
+ <button type="button" class="close" @click="closemodal('but')"><span>&times;</span></button>
298
+ <h4 class="modal-title">{{model.button.button_name}}</h4>
299
+ </header>
300
+ <article slot="modal-body" class="modal-body">
301
+ <div class="col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
302
+ <label class="control-label col-sm-3" style="margin-top: 10px">{{button.label}}:</label>
303
+ <div class="col-sm-7">
304
+ <!--select-->
305
+ <input-select v-if="button.type=='select'"
306
+ :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
307
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"
308
+ :options='button.options'></input-select>
309
+ <!-- input -->
310
+ <input v-else type="text" class="form-control"
311
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
312
+ </div>
313
+ </div>
314
+ </article>
315
+ <footer slot="modal-footer" style="border-top:none" class="modal-footer">
316
+ <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
317
+ </footer>
318
+ </modal>
319
+ </div>
320
+ </template>
321
+ <script>
322
+ import Vue from 'vue'
323
+ // Date格式化
324
+ Date.prototype.Format = function (fmt) {
325
+ var o = {
326
+ 'M+': this.getMonth() + 1, // 月份
327
+ 'd+': this.getDate(), // 日
328
+ 'H+': this.getHours(), // 小时
329
+ 'm+': this.getMinutes(), // 分
330
+ 's+': this.getSeconds(), // 秒
331
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
332
+ 'S': this.getMilliseconds() // 毫秒
333
+ }
334
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
335
+ for (var k in o) {
336
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
337
+ }
338
+ return fmt
339
+ }
340
+
341
+ export default {
342
+ title: '报建业务通用组件',
343
+ props: {
344
+ data: {
345
+ type: Object
346
+ },
347
+ showprint: {
348
+ type: Boolean,
349
+ default: true
350
+ }
351
+ },
352
+ data () {
353
+ return {
354
+ model: {}, // 公司等属性
355
+ disable_button: true, // 控制按钮禁用
356
+ show: false, // 控制onetomany模态框
357
+ disable_button_onetomany: true, // 控制onetomany模态框按钮
358
+ onetomany_index: null, // 当前选择的下标
359
+ update_onetomany_index: null, // 当前需要修改的下标
360
+ modeltitle: null, // 模态框标题
361
+ modalSize: null, // 模态框大小
362
+ showbutmodal: false,
363
+ }
364
+ },
365
+ watch: {
366
+ deep: true
367
+ },
368
+ computed: {
369
+
370
+ },
371
+ created () {
372
+ // 初始化数据
373
+ this.initializtion()
374
+ this.$dispatch('initializtionView')
375
+
376
+ this.disableButton()
377
+ },
378
+ methods: {
379
+ // 按钮模态框确定
380
+ confirm_but_modal() {
381
+ for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
382
+ this.model.button.button_fields[item.field] = item.value
383
+ }
384
+ this.showbutmodal = false
385
+ this.disable_button_but = true
386
+ this.$dispatch('button', this.model)
387
+ },
388
+ // 点击按钮组按钮
389
+ async clicked(index, button) {
390
+ this.disable_button = true
391
+ // 组织model.fields数据
392
+ for (const item of this.data.fields) {
393
+ // checkbox特殊处理
394
+ if (item.type === 'checkbox') {
395
+ for (let j = 0; j < item.items.length; j++) {
396
+ this.model[item.items[j].field] = item.items[j].value
397
+ }
398
+ } else {
399
+ this.model[item.field] = item.value
400
+ }
401
+ }
402
+ this.model.f_process_id = this.data.f_process_id
403
+
404
+ // 初始化model.button数据
405
+ let buttondatas = {
406
+ button_fields: {}
407
+ }
408
+ buttondatas.button_name = button.button_name
409
+ buttondatas.button_index = index
410
+ if (button.button_fields) {
411
+ for (const item of button.button_fields) {
412
+ buttondatas.button_fields[item.field] = item.value
413
+ }
414
+ }
415
+ this.model.button = buttondatas
416
+ this.model.title = this.data.title
417
+ this.model.fields = this.data.fields
418
+ this.model.onetomany = this.data.onetomany
419
+
420
+
421
+ if (button.button_name === '退回') {
422
+ this.showbutmodal = true
423
+ } else if (button.button_name === '下发') {
424
+ this.showbutmodal = true
425
+ } else {
426
+ this.$dispatch('button', this.model)
427
+ }
428
+ },
429
+ // 初始化数据
430
+ initializtion () {
431
+ // 是否禁用按钮
432
+ this.disableButton()
433
+
434
+ // datepicker 没有值给当时值
435
+ for (const item of this.data.fields) {
436
+ if (item.type === 'datepicker' && !item.value) {
437
+ item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
438
+ }
439
+ }
440
+
441
+ // 公司等属性初始化
442
+ if (this.data.filiale) {
443
+ this.model.f_filiale = this.data.filiale
444
+ } else {
445
+ this.model.f_filiale = this.$login.f.f_fengongsi
446
+ }
447
+ if (this.data.f_parentname) {
448
+ this.model.f_parentname = this.data.f_parentname
449
+ } else {
450
+ this.model.f_parentname = this.$login.f.f_parentname
451
+ }
452
+ if (this.data.operate_date) {
453
+ this.model.f_operate_date = this.data.operate_date
454
+ } else {
455
+ this.model.f_operate_date = new Date().Format('yyyy-MM-dd')
456
+ }
457
+ if (this.data.operator) {
458
+ this.model.f_operator = this.data.operator
459
+ } else {
460
+ this.model.f_operator = this.$login.f.name
461
+ }
462
+ },
463
+ // 是否禁用按钮
464
+ disableButton () {
465
+ let fields = this.data.fields
466
+
467
+ let flag = false
468
+ for (const item of fields) {
469
+ if (item.type !== 'checkbox' && item.required && !item.value) {
470
+ if (item.value === 0) {
471
+ flag = false
472
+ } else {
473
+ flag = true
474
+ }
475
+ }
476
+ // 任何选择框只要是否都不能提交
477
+ if (item.type === 'select' && item.value === '否' && item.disabledButton) {
478
+ flag = true
479
+ }
480
+ }
481
+
482
+ let count = 0
483
+ for (const item of fields) {
484
+ if (item.type !== 'checkbox' && item.required) {
485
+ count++
486
+ }
487
+ }
488
+ if (count === 0) {
489
+ flag = false
490
+ }
491
+
492
+ this.disable_button = flag
493
+ },
494
+ // 失去焦点触发,无论值是否发生变化
495
+ onblur (index) {
496
+ // 是否禁用按钮
497
+ this.disableButton()
498
+
499
+ this.$dispatch('onblur', index)
500
+ // 如果有错误信息提示走错误信息判断处理
501
+
502
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
503
+ this.$dispatch('error_check', index)
504
+ }
505
+ },
506
+ // 失去焦点且值最终发生变化触发
507
+ onchange (index) {
508
+ // 是否禁用按钮
509
+ this.disableButton()
510
+
511
+ this.data.fields[index].value = this.data.fields[index].value.trim()
512
+
513
+ if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
514
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
515
+ }
516
+
517
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
518
+
519
+ this.$dispatch('onchange', index)
520
+
521
+ // 如果有错误信息提示走错误信息判断处理
522
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
523
+ this.$dispatch('error_check', index)
524
+ }
525
+ },
526
+ oninput (index) {
527
+ // 是否禁用按钮
528
+ this.disableButton()
529
+
530
+ this.$dispatch('oninput', index)
531
+
532
+ // 如果有错误信息提示走错误信息判断处理
533
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
534
+ this.$dispatch('error_check', index)
535
+ }
536
+ },
537
+ // 模态框确认按钮
538
+ confirm_modal (title) {
539
+ if (title === '新增') {
540
+ if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
541
+ this.$dispatch('onetomanyadd', this.onetomany_index)
542
+ } else {
543
+ this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
544
+ }
545
+ } else {
546
+ if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
547
+ this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
548
+ } else {
549
+ this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
550
+ }
551
+ }
552
+
553
+ this.closemodal()
554
+ },
555
+ // 删除
556
+ delete (i, j) {
557
+ this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
558
+ if (res === 'confirm') {
559
+ if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
560
+ this.$dispatch('onetomanydelete', i, j)
561
+ } else {
562
+ this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
563
+ }
564
+ }
565
+ })
566
+ },
567
+ // 修改
568
+ update (i, j) {
569
+ let onetomany = this.data.onetomany[i]
570
+ let item = this.data.onetomany[i].rows[j]
571
+ let count = 0
572
+ for (let k = 0; k < onetomany.fields.length; k++) {
573
+ // 防止初始化的时候没有value
574
+ Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
575
+
576
+ if (onetomany.fields[j].required) {
577
+ count++
578
+ }
579
+ }
580
+ if (count === 0) {
581
+ this.disable_button_onetomany = false
582
+ }
583
+ this.modeltitle = '修改'
584
+ this.modalSize = this.data.onetomany[i].modalSize
585
+ this.onetomany_index = i
586
+ this.update_onetomany_index = j
587
+
588
+ this.$dispatch('openUpdateModel',i,j)
589
+
590
+ this.show = true
591
+ },
592
+ // 添加
593
+ add (index) {
594
+ let count = 0
595
+ for (const item of this.data.onetomany[index].fields) {
596
+ if (item.type === 'datepicker') {
597
+ item.value = new Date().Format('yyyy-MM-dd')
598
+ }
599
+ if (item.required) {
600
+ count++
601
+ }
602
+ }
603
+
604
+ if (count === 0) {
605
+ this.disable_button_onetomany = false
606
+ }
607
+ this.modeltitle = '新增'
608
+ this.modalSize = this.data.onetomany[index].modalSize
609
+ this.onetomany_index = index
610
+
611
+ this.$dispatch('openAddModel',index)
612
+
613
+ this.show = true
614
+ },
615
+ // 关闭模态框
616
+ closemodal (val) {
617
+ if (val === 'but'){
618
+ this.disableButton()
619
+ this.showbutmodal = false
620
+ return
621
+ }
622
+ for (const item of this.data.onetomany[this.onetomany_index].fields) {
623
+ item.value = ''
624
+ }
625
+ this.show = false
626
+ this.disable_button_onetomany = true
627
+ this.onetomany_index = null
628
+ this.update_onetomany_index = null
629
+ this.modeltitle = null
630
+ this.modalSize = null
631
+ },
632
+ // 是否禁用模态框按钮
633
+ disableModalButton () {
634
+ let fields = this.data.onetomany[this.onetomany_index].fields
635
+
636
+ let flag = false
637
+ for (const item of fields) {
638
+ if (item.type !== 'checkbox' && item.required && !item.value) {
639
+ if (item.value === 0) {
640
+ flag = false
641
+ } else {
642
+ flag = true
643
+ }
644
+ }
645
+ }
646
+
647
+ let count = 0
648
+ for (const item of fields) {
649
+ if (item.type !== 'checkbox' && item.required) {
650
+ count++
651
+ }
652
+ }
653
+ if (count === 0) {
654
+ flag = false
655
+ }
656
+ this.disable_button_onetomany = flag
657
+ },
658
+ // 监听模态框属性失去焦点
659
+ onchange_modal (index) {
660
+ this.disableModalButton()
661
+ this.$dispatch('onchange_modal', this.onetomany_index, index)
662
+ },
663
+ // 监听模态框属性失去焦点
664
+ onblur_modal (index) {
665
+ this.disableModalButton()
666
+ this.$dispatch('onblur_modal', this.onetomany_index, index)
667
+ },
668
+ // input输入属性值发生变化监听
669
+ oninput_modal (index) {
670
+ this.disableModalButton()
671
+ this.$dispatch('oninput_modal', this.onetomany_index, index)
672
+ }
673
+ },
674
+ events: {
675
+
676
+ }
677
+ }
678
+ </script>
679
+ <style>
680
+ .datepicker{
681
+ width: 100%!important;
682
+ }
683
+ .datepicker-input{
684
+ background-color: #ffffff!important;
685
+ width: 100%!important;
686
+ }
687
+ .datepicker-input:disabled{
688
+ border: 1px solid #DDD!important;
689
+ color: #ACA899!important;
690
+ width: 100%!important;
691
+ }
692
+ </style>
693
+ <style scoped>
694
+ th{
695
+ font-size: 15px !important;
696
+ text-align: center !important;
697
+ background-color: #dfedfb!important;
698
+ color: #666666 !important;
699
+ font-family: PINGFANG-BOLD !important;
700
+ font-weight: normal!important;
701
+ }
702
+ /*清除model中的浮动*/
703
+ .clearfix:after,.clearfix:before{
704
+ display: table;
705
+ }
706
+ .clearfix:after{
707
+ clear: both;
708
+ }
709
+
710
+ .input_view{
711
+ padding: 8px;
712
+ background-color: #ffffff;
713
+ border-radius: 2px;
714
+ border: solid 1px #c7c7c7!important;
715
+ color: #333333!important;
716
+ font-size: 15px!important;
717
+ }
718
+
719
+ .input_view[readonly]{
720
+ border: 1px solid #DDD!important;
721
+ /*background-color: #F5F5F5;*/
722
+ color:#ACA899!important;
723
+ }
724
+ .input_view:disabled{
725
+ border: 1px solid #DDD!important;
726
+ /*background-color: #F5F5F5;*/
727
+ color:#ACA899!important;
728
+ }
729
+
730
+ .control-label-justify {
731
+ display: inline-block;
732
+ vertical-align: top;
733
+ width: 110px;
734
+ text-align: justify;
735
+ font-family: PingFang-SC-Bold;
736
+ }
737
+
738
+ .control-label-justify::after {
739
+ content: "";
740
+ display: inline-block;
741
+ width: 70px;
742
+ overflow: hidden;
743
+ height: 0;
744
+ }
745
+
746
+ input::-webkit-outer-spin-button,
747
+ input::-webkit-inner-spin-button {
748
+ -webkit-appearance: none;
749
+ }
750
+
751
+ input[type="number"] {
752
+ -moz-appearance: textfield;
753
+ }
754
+
755
+ </style>