apply-clients 7.1.35 → 7.1.38

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 (188) 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/package.json +1 -1
  180. package/src/components/image/TXT.png +0 -0
  181. package/src/components/image/dwg.png +0 -0
  182. package/src/components/image/dxf.png +0 -0
  183. package/src/components/product/Function/InstallFunction.vue +147 -147
  184. package/src/components/product/Process/ExplorationUser.vue +2 -5
  185. package/src/components/product/Process/Processes/InstallationDetails.vue +520 -484
  186. package/src/components/product/Process/Service/ServiceControl.vue +752 -856
  187. package/src/components/product/Supervisory/SupervisoryControl.vue +121 -121
  188. package/src/components/product/VueUtils/ApplyUpload.vue +266 -261
@@ -1,856 +1,752 @@
1
- <template>
2
-
3
- <div class="auto clearfix">
4
- <show-back-reason :selectdata="show_data"></show-back-reason>
5
- </div>
6
-
7
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
-
9
- </template>
10
- <script>
11
- import Vue from 'vue'
12
- import {HttpResetClass} from 'vue-client'
13
- import {getNowDate,isEmpty} from '../../../Util'
14
- // Date格式化
15
- Date.prototype.Format = function (fmt) {
16
- var o = {
17
- "M+": this.getMonth() + 1, //月份
18
- "d+": this.getDate(), //日
19
- "H+": this.getHours(), //小时
20
- "m+": this.getMinutes(), //分
21
- "s+": this.getSeconds(), //秒
22
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
- "S": this.getMilliseconds() //毫秒
24
- };
25
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
- for (var k in o)
27
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
- return fmt;
29
- }
30
-
31
- export default {
32
- title: '报建流程业务控制层',
33
- props: ['selectdata'],
34
- data() {
35
- return {
36
- data: null, // 数据库数据,json配置文件数据的数据集合
37
- json_datas: null, // Json配置文件集合
38
- showview: false, // 控制显示service-view组件
39
- show_data: null // 给view层显示的数据
40
- }
41
- },
42
- created () {
43
- this.refurbish()
44
- },
45
- methods: {
46
- // 组件初始化操作
47
- refurbish() {
48
- this.json_datas = this.$workflow_vue
49
- let sum = 0
50
- let jsonData = {}
51
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
52
- this.$showMessage("网络故障,请刷新页面")
53
- return
54
- }
55
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
56
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
57
- jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
58
- sum++ // 节点名一样的个数
59
- }
60
- }
61
- if (sum == 1) {
62
- this.data = null
63
- this.data = jsonData
64
- // selectdata 填充 data
65
- this.data = Object.assign({}, this.data, this.selectdata)
66
- this.initializeJSON()
67
- } else if (sum == 0) {
68
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
69
- } else {
70
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
71
- }
72
- },
73
- // json配置数据处理
74
- async initializeJSON() {
75
- // 有默认值,value就给默认值,没有就是null
76
- this.data.fields.forEach(item => {
77
- if (!item.value) {
78
- if (item.value === 0) {
79
- item.value = 0
80
- } else {
81
- item.value = null
82
- }
83
- }
84
- if (item.default || item.default == 0) {
85
- item.value = item.default
86
- }
87
- if (this.selectdata[item.field]) {
88
- // 将json字符串格式化赋值给value
89
- if (String(this.selectdata[item.field]).startsWith("{")) {
90
- item.value = JSON.parse(this.selectdata[item.field])
91
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
92
- } else {
93
- item.value = this.selectdata[item.field]
94
- }
95
- } else {
96
- if (this.selectdata[item.field] === 0) {
97
- item.value = 0
98
- }
99
- }
100
-
101
- // datepicker 没有值给当时值
102
- if (item.type === 'datepicker' && !item.value && item.default) {
103
- item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
104
- }
105
-
106
- // 如果配置类型为select,优先从参数列表获取options
107
- if (item.type === 'select') {
108
- let temp = null
109
-
110
- temp = this.$appdata.getParam(item.label)
111
-
112
- if (temp && temp.length > 0 && item.label) {
113
- item.options = temp
114
- } else {
115
- if (item.paramLabel) {
116
- temp = this.$appdata.getParam(item.paramLabel)
117
- if (temp && temp.length > 0) {
118
- item.options = temp
119
- }
120
- }
121
- }
122
- }
123
- })
124
-
125
- // 控制组件
126
- if (this.data.components) {
127
- this.data.components.forEach(item => {
128
- item.mark = 0
129
- })
130
- }
131
-
132
- // 初始化 fields 可对数据进行特殊处理
133
- this.initializeFields()
134
- console.log("this.data的数据:" + JSON.stringify(this.data))
135
- // 初始化 buttons_fields
136
- for (let i = 0; i < this.data.buttons.length; i++) {
137
- // 下发按钮相关配置
138
- if (this.data.buttons[i].button_name === '下发') {
139
- if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
140
- if (this.data.source){
141
- let http = new HttpResetClass()
142
- let res = await http.load('POST', 'rs/search', {
143
- source: this.data.source,
144
- userid: this.$login.f.id
145
- }, {resolveMsg: null, rejectMsg: null})
146
-
147
- let options = []
148
- for (let i = 0; i < res.data.length; i++) {
149
- options.push(
150
- {
151
- "label": res.data[i].name,
152
- "value": res.data[i].name
153
- }
154
- )
155
- }
156
- this.data.buttons[i].button_fields[0]['options'] = options
157
- } else {
158
- this.$showMessage("请配置获取人员表达式")
159
- }
160
- } else {
161
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
162
- }
163
- }
164
- if (this.data.buttons[i].button_fields) {
165
- this.data.buttons[i].button_fields.forEach(x => {
166
- // 如果配置类型为select,优先从参数列表获取options
167
- if (x.type === 'select' && this.$appdata.getParam(x.label)) {
168
- x.options = this.$appdata.getParam(x.label).trim()
169
- }
170
- })
171
- }
172
- }
173
-
174
- // onetomany 数据获取
175
- if (this.data.onetomany) {
176
- for (let index = 0; index < this.data.onetomany.length; index++) {
177
- let res = null
178
- if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
179
- let http = new HttpResetClass()
180
- let data = {
181
- tablename: this.data.onetomany[index].tables[0],
182
- condition: `f_process_id='${this.selectdata.f_process_id}'`
183
- }
184
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
185
- resolveMsg: null,
186
- rejectMsg: 'onetomany查询失败'
187
- })
188
- } else {
189
- res = this[this.data.onetomany[index].queryEvent]()
190
- }
191
-
192
- // 初始化 onetomany
193
- this.data.onetomany[index].rows = res.data
194
-
195
- // 初始化onetomany中的fields
196
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
197
- if (!this.data.onetomany[index].fields[j].value) {
198
- if (this.data.onetomany[index].fields[j].value === 0) {
199
- this.data.onetomany[index].fields[j].value = 0
200
- } else {
201
- this.data.onetomany[index].fields[j].value = null
202
- }
203
- }
204
- if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
205
- this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
206
- }
207
- // 如果配置类型为select,优先从参数列表获取options
208
- if (this.data.onetomany[index].fields[j].type === 'select') {
209
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
210
- if (temp && temp.length > 0) {
211
- this.data.onetomany[index].fields[j].options = temp
212
- }
213
- }
214
- }
215
- }
216
- }
217
-
218
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
219
- let temp = JSON.parse(JSON.stringify(this.data))
220
-
221
- this.show_data = temp
222
- this.$nextTick(() => {
223
- this.showview = true
224
- })
225
- // 查询区域和街道
226
- if (this.selectdata.defname === '报装申请') {
227
- let http = new HttpResetClass()
228
- let condition = "f_filialeids = '" + this.$login.f.f_orgids + "'"
229
- let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
230
- for (let i = 0; i < this.show_data.fields.length; i++) {
231
-
232
- if (this.show_data.fields[i].label == '区域') {
233
- let data = []
234
- let array = []
235
- data = res.data.map(item => {
236
- return item.f_area;
237
- })
238
- for (let q = 0; q < data.length; q++) {
239
- let arraydata = {
240
- 'label': data[q],
241
- 'value': data[q]
242
- }
243
- if (array.length != 0) {
244
- for (let w = 0; w < array.length; w++) {
245
- if (array[w].label == data[q]) {
246
- break
247
- }
248
- while (w == array.length - 1) {
249
- array.push(arraydata)
250
- break
251
- }
252
- }
253
- } else {
254
- array.push(arraydata)
255
- }
256
- }
257
- this.show_data.fields[i].options = array
258
- console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
259
- }
260
- if (this.show_data.fields[i].label == '街道') {
261
- let data = []
262
- let array = []
263
- data = res.data.map(item => {
264
- return item.f_street;
265
- })
266
- for (let q = 0; q < data.length; q++) {
267
- let arraydata = {
268
- 'label': data[q],
269
- 'value': data[q]
270
- }
271
- if (array.length != 0) {
272
- for (let w = 0; w < array.length; w++) {
273
- if (array[w].label == data[q]) {
274
- break
275
- }
276
- while (w == array.length - 1) {
277
- array.push(arraydata)
278
- break
279
- }
280
- }
281
- } else {
282
- array.push(arraydata)
283
- }
284
- }
285
- this.show_data.fields[i].options = array
286
- console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
287
- }
288
- }
289
- }
290
- },
291
- // 初始化fields值
292
- initializeFields() {
293
-
294
- },
295
- // 金额转大写
296
- smalltoBIG(n) {
297
- let fraction = ['角', '分'];
298
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
299
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
300
- let head = n < 0 ? '欠' : '';
301
- n = Math.abs(n);
302
-
303
- let s = '';
304
-
305
- for (var i = 0; i < fraction.length; i++) {
306
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
307
- }
308
- s = s || '';
309
- n = Math.floor(n);
310
-
311
- for (var i = 0; i < unit[0].length && n > 0; i++) {
312
- let p = '';
313
- for (var j = 0; j < unit[1].length && n > 0; j++) {
314
- p = digit[n % 10] + unit[1][j] + p;
315
- n = Math.floor(n / 10);
316
- }
317
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
318
- }
319
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
320
- },
321
- getLableValue(label) {
322
- for (const item of this.show_data.fields) {
323
- if (item.label === label && item.type !== 'number') {
324
- return item.value || ''
325
- }
326
- if (item.label === label && item.type === 'number') {
327
- return item.value || 0
328
- }
329
- }
330
- },
331
- setLabelValue(label, value) {
332
- for (const item of this.show_data.fields) {
333
- if (item.label === label) {
334
- item.value = value
335
- }
336
- }
337
- },
338
- async buttonBefore(model) {
339
- // if (
340
- // model.button.button_name === '提交' &&
341
- // model.defname === '收费' &&
342
- // (
343
- // model.f_apply_type === '散户报建' ||
344
- // model.f_apply_type === '工业户报建' ||
345
- // model.f_apply_type === '商业户报建'
346
- // ) &&
347
- // model.f_surplus_money > 0
348
- // ) {
349
- // throw '未结金额大于0,无法提交!!!'
350
- // }
351
- // if (model.defname === '施工' && model.button.button_name === '提交') {
352
- // let http = new HttpResetClass()
353
- // let data = {
354
- // f_process_id: model.f_process_id
355
- // }
356
- // let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
357
- // if (res.data[0].num > 0) {
358
- // throw `还有${res.data[0].num}户未安装,无法提交`
359
- // }
360
- // }
361
- return model
362
- },
363
- // ========================= 武安 =================================
364
- // 地址类型变化
365
- addressType() {
366
- for (const item of this.show_data.fields) {
367
- if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
368
- item.required = true
369
- }
370
- if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
371
- item.required = false
372
- }
373
- if (
374
- (
375
- item.label === '楼号' ||
376
- item.label === '单元' ||
377
- item.label === '楼层' ||
378
- item.label === '门牌号'
379
- ) && this.show_data.f_address_type === '民用地址'
380
- ) {
381
- item.required = true
382
- item.hidden = false
383
- item.value = null
384
- }
385
- if (
386
- (
387
- item.label === '楼号' ||
388
- item.label === '单元' ||
389
- item.label === '楼层' ||
390
- item.label === '门牌号'
391
- ) && this.show_data.f_address_type === '特殊地址'
392
- ) {
393
- item.required = false
394
- item.hidden = true
395
- item.value = null
396
- }
397
- }
398
- },
399
- async getStreetList () {
400
- let data = {
401
- tablename: 't_street',
402
- condition: `f_filialeid = ${this.$login.f.orgid} and f_street is not null`
403
- }
404
-
405
- let res = await this.$resetpost(
406
- `rs/sql/singleTable`,
407
- {data: data},
408
- {resolveMsg: null, rejectMsg: '街道查询失败,请重新进入!!!'}
409
- )
410
-
411
- let streetList = []
412
-
413
- res.data.forEach(item => {
414
- streetList.push({
415
- label: item.f_street,
416
- value: item.f_street
417
- })
418
- })
419
-
420
- for (const item of this.show_data.fields) {
421
- if (item.label === '街道') {
422
- item.options = streetList
423
- }
424
- }
425
- },
426
- async getAreaList () {
427
- let data = {
428
- tablename: 't_area',
429
- condition: `f_filialeid = ${this.$login.f.orgid} and f_street = '${this.getLableValue('街道')}'`
430
- }
431
-
432
- let res = await this.$resetpost(
433
- `rs/sql/singleTable`,
434
- {data: data},
435
- {resolveMsg: null, rejectMsg: '小区查询失败,请重新进入!!!'}
436
- )
437
-
438
- let areaList = []
439
-
440
- res.data.forEach(item => {
441
- areaList.push({
442
- label: item.f_residential_area,
443
- value: item.f_residential_area
444
- })
445
- })
446
-
447
- for (const item of this.show_data.fields) {
448
- if (item.label === '小区') {
449
- item.options = areaList
450
- }
451
- }
452
- }
453
- // ========================= 武安 =================================
454
- },
455
- events: {
456
- // ========================= 武安 =================================
457
- // ========================= 武安 =================================
458
- 'openAddModel'(index) {
459
- // ========================= 武安 =================================
460
- // ========================= 武安 =================================
461
- },
462
- // 获取view层button事件/
463
- async 'button'(model) {
464
- // 修改提交数据
465
- model = Object.assign({}, this.selectdata, model)
466
- // 点击重置按钮就重置数据
467
- if (model.button.button_name === '重置') {
468
- this.$dispatch('breakControl', this.data)
469
- return
470
- }
471
- // 联合验收必须上传附件
472
- if (model.defname === '联合验收' && model.button.button_name === '提交') {
473
- let http = new HttpResetClass()
474
- let data = {
475
- tablename: 't_files',
476
- condition: "f_blobid = '" + this.selectdata.f_process_id + "'"
477
- }
478
- let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
479
- if (!res.data.length > 0) {
480
- this.$showMessage("您没有上传附件,无法提交!")
481
- return
482
- }
483
- }
484
-
485
- // 提交前置
486
- try {
487
- model = await this.buttonBefore(model)
488
- } catch (e) {
489
- this.$showAlert(e, 'warning', 3000)
490
- return
491
- }
492
-
493
- let http = new HttpResetClass()
494
- let requestData = {
495
- tables: this.data.tables,
496
- start_activity: this.$workflow_vue.start_activity,
497
- model: model,
498
- loginUser: this.$login.f,
499
- workflow_xmlfilename: this.$workflow_vue.workflow_xmlfilename
500
- }
501
- // 下发,提交,保存,退回通用业务后台处理logic
502
- let url = 'rs/logic/ApplyProductService'
503
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
504
-
505
- if (res.data.code == 200) {
506
- this.$dispatch('search')
507
- } else {
508
- if (res.data.msg) {
509
- this.$showMessage(res.data.msg)
510
- }
511
- }
512
- },
513
- async 'initializtionView'() {
514
- // ========================= 武安 =================================
515
- this.addressType()
516
-
517
- if (this.show_data.defname === '用户受理' && this.show_data.f_apply_type === '散户报建') {
518
- await this.getStreetList()
519
- }
520
- // ========================= 武安 =================================
521
- },
522
- // 失去焦点出触发事件
523
- async 'onchange'(index) {
524
- console.log('失去焦点')
525
- // ========================= 武安 =================================
526
- if (this.show_data.defname === '用户受理'){
527
- if (this.show_data.fields[index].label === '地址类型'){
528
- this.addressType()
529
- }
530
- if (this.show_data.fields[index].label === '街道' && this.show_data.f_apply_type !== '散户报建'){
531
- console.log('-----------添加街道-----------')
532
- if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
533
- this.show_data.fields[index].value = null
534
- this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
535
- return
536
- }
537
- let http = new HttpResetClass()
538
- let data = {
539
- f_adjustable_id: '', // 调压箱编号
540
- f_orgid: this.$login.f.orgid, // 组织id
541
- f_orgname: this.$login.f.orgs, // 组织名
542
- f_pcd: '河北省邯郸市武安市', // 省市区
543
- f_pcd_id: 8, // 省市区id
544
- // f_pcd_id: 124, // 50.4测试
545
- f_slice_area: '', // 片区
546
- f_operatorid: this.$login.f.id, // 操作人id
547
- f_operator: this.$login.f.name, // 操作人
548
- f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
549
- f_street: this.show_data.fields[index].value.trim(), // 地址
550
- f_comments: '报建系统自动创建' // 备注
551
- }
552
- try{
553
- let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {resolveMsg: null, rejectMsg: null})
554
- } catch (e) {
555
- if (e.status === 635){
556
- this.$showAlert('此街道已存在!!!', 'warning', 3000)
557
- } else {
558
- this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
559
- }
560
- }
561
- }
562
- if (this.show_data.fields[index].label === '街道' && this.show_data.f_apply_type === '散户报建') {
563
- this.setLabelValue('小区', '')
564
- await this.getAreaList()
565
- }
566
- if (this.show_data.fields[index].label === '小区' && this.show_data.f_apply_type !== '散户报建'){
567
- if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
568
- this.show_data.fields[index].value = null
569
- this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
570
- return
571
- }
572
- // 先查询街道
573
- let street = null
574
- for (const item of this.show_data.fields) {
575
- if (item.label === '街道') {
576
- if (item.value.trim() === null || item.value.trim() === ''){
577
- this.show_data.fields[index].value = null
578
- this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
579
- return
580
- }
581
- let http = new HttpResetClass()
582
- let data = {
583
- condition: `1=1 and s.f_filialeid in ('${this.$login.f.orgid}') and f_province = '河北省' and f_city = '邯郸市' and f_district = '武安市' and f_street = '${item.value.trim()}'`
584
- }
585
- let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {resolveMsg: null, rejectMsg: null})
586
- if (res.data.length > 0) {
587
- street = res.data[0]
588
- } else {
589
- this.show_data.fields[index].value = null
590
- this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
591
- }
592
- }
593
- }
594
- console.log('-----------添加小区-----------')
595
- let data = {
596
- f_linkname: '', // 联系人
597
- f_linkphone: '', // 联系电话
598
- f_adjustable_id: '', // 调压箱编号
599
- f_user_type: '', // 用户类型
600
- f_gasproperties: '', // 用气性质
601
- f_meter_brand: '', // 气表品牌
602
- f_price_name: '', // 气价名称
603
- f_price_type: '', // 气价类型
604
- f_meter_style: '', // 气表型号
605
- f_position: '', // 表安装位置
606
- f_meter_type: '', // 气表类型
607
- f_area_id: '', // 小区编号 (自动生成)
608
- f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
609
- f_operatorid: this.$login.f.id, // 操作人id
610
- f_operator: this.$login.f.name, // 操作人
611
- f_orgid: this.$login.f.orgid, // 组织id
612
- f_orgname: this.$login.f.orgs, // 组织名
613
- f_pcd_id: 8, // 省市区id
614
- // f_pcd_id: 124, // 50.4测试
615
- f_pcd: '河北省邯郸市武安市', // 省市区
616
- f_street_id: street.id, // 街道id
617
- f_street: street.f_street,// 街道
618
- f_area_code: '01', // 片区编码
619
- f_slice_area: '武安片区', // 片区
620
- // f_area_code: '66556', // 50.4测试
621
- // f_slice_area: '武安明星', // 50.4测试
622
- slice_area: [
623
- {
624
- name: '武安片区',
625
- code: '01'
626
- }
627
- ],
628
- // slice_area: [ // 50.4测试
629
- // {
630
- // name: '武安明星',
631
- // code: '66556'
632
- // }
633
- // ],
634
- f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
635
- f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
636
- f_comments: '报建系统自动创建'
637
- }
638
- try{
639
- let http = new HttpResetClass()
640
- let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {resolveMsg: null, rejectMsg: null})
641
- } catch (e) {
642
- if (e.status === 635){
643
- this.$showAlert('此小区已存在!!!', 'warning', 3000)
644
- } else {
645
- this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
646
- }
647
- }
648
- }
649
- // 地址拼接
650
- if (
651
- this.show_data.fields[index].label === '区域' ||
652
- this.show_data.fields[index].label === '街道' ||
653
- this.show_data.fields[index].label === '小区' ||
654
- this.show_data.fields[index].label === '楼号' ||
655
- this.show_data.fields[index].label === '单元' ||
656
- this.show_data.fields[index].label === '楼层' ||
657
- this.show_data.fields[index].label === '门牌号'
658
- ) {
659
- let f_address = null
660
- // if (this.show_data.f_address_type !== '民用地址') {
661
- f_address = this.getLableValue('区域') + this.getLableValue('街道')
662
- // }
663
- this.setLabelValue('地址',f_address)
664
- }
665
- }
666
- if (this.show_data.defname === '竣工验收') {
667
- if (this.show_data.fields[index].label === '验收是否合格'){
668
- for (const button of this.show_data.buttons) {
669
- if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
670
- button.hidden = false
671
- } else {
672
- button.hidden = true
673
- }
674
- }
675
- }
676
- }
677
- if (this.show_data.defname === '合同签订') {
678
- if (this.show_data.fields[index].label === '合同编号') {
679
- if (!isEmpty(this.show_data.fields[index].value)) {
680
- let http = new HttpResetClass()
681
- let data = {
682
- tablename: 't_apply',
683
- condition: `f_contract_number='${this.show_data.fields[index].value}'`
684
- }
685
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
686
- resolveMsg: null,
687
- rejectMsg: '合同编号查重失败'
688
- })
689
- if (res.data.length > 0) {
690
- this.show_data.fields[index].value = null
691
- this.$showAlert('合同编号已存在!!!', 'warning', 3000)
692
- }
693
- }
694
- }
695
- if (this.show_data.fields[index].label === '单价(户)') {
696
- let http = new HttpResetClass()
697
- let data = {
698
- num1: this.getLableValue(this.show_data.fields[index].label),
699
- num2: this.getLableValue('户数'),
700
- operator: '*'
701
- }
702
- try {
703
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
704
- resolveMsg: null,
705
- rejectMsg: null
706
- })
707
- data = {
708
- num1: res.data,
709
- num2: this.getLableValue('其他费用'),
710
- operator: '+'
711
- }
712
- res = await http.load('POST', 'rs/logic/compute', {data: data}, {
713
- resolveMsg: null,
714
- rejectMsg: null
715
- })
716
- this.setLabelValue('合同金额',res.data)
717
- } catch (e) {
718
- this.$showAlert(e.data.msg, 'warning', 3000)
719
- }
720
- }
721
- if (this.show_data.fields[index].label === '其他费用') {
722
- let http = new HttpResetClass()
723
- let data = {
724
- num1: this.getLableValue(this.show_data.fields[index].label),
725
- num2: this.getLableValue('合同金额'),
726
- operator: '+'
727
- }
728
- try {
729
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
730
- resolveMsg: null,
731
- rejectMsg: null
732
- })
733
- this.setLabelValue('合同金额',res.data)
734
- } catch (e) {
735
- this.$showAlert(e.data.msg, 'warning', 3000)
736
- }
737
- }
738
- }
739
- // ========================= 武安 =================================
740
- // 号码检测
741
- if (this.show_data.fields[index].label === '电话号码') {
742
- let phone = this.show_data.fields[index].value
743
- // 电话号码效验
744
- if (!(/^1[3456789]\d{9}$/.test(phone))) {
745
- this.show_data.fields[index].value = ""
746
- this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
747
- }
748
- }
749
- //时间提醒
750
- if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
751
- let setTime = this.show_data.fields[index].value
752
- let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
753
- if (nowTime >= setTime) {
754
- this.$showMessage("请注意,当前节点时间/工期已过期!")
755
- }
756
- }
757
- },
758
- // input值发生变化
759
- async 'oninput'(index) {
760
-
761
- },
762
- // 错误事件
763
- error_check(index) {
764
- // 时间格式检测
765
- if (this.show_data.fields[index].type == 'datepicker') {
766
- let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
767
- let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
768
- if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
769
- this.show_data.fields[index].error.flag = false
770
- } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
771
- this.show_data.fields[index].error.flag = false
772
- } else {
773
- if (this.show_data.fields[index].fullsize) {
774
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
775
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
776
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
777
- this.show_data.fields[index].error.flag = true
778
- this.show_data.fields[index].value = ''
779
- } else {
780
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
781
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
782
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
783
- this.show_data.fields[index].error.flag = true
784
- this.show_data.fields[index].value = ''
785
- }
786
-
787
- }
788
- }
789
- },
790
- // onetomany模态框默认监听监听事件
791
- async 'onetomanydelete'(i, j) {
792
- console.log('默认删除')
793
- let http = new HttpResetClass()
794
- let data = {
795
- table: this.show_data.onetomany[i].tables[0],
796
- row: this.show_data.onetomany[i].rows[j]
797
- }
798
- let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
799
- resolveMsg: null,
800
- rejectMsg: '删除失败'
801
- })
802
-
803
- if (res.data <= 0){
804
- this.$showMessage('删除失败')
805
- return
806
- }
807
-
808
- this.$dispatch('breakControl', this.show_data)
809
- },
810
- async 'onetomanyadd'(index) {
811
-
812
- let data = {
813
- f_process_id : this.show_data.f_process_id
814
- }
815
- this.show_data.onetomany[index].fields.forEach(item => {
816
- data[item.field] = item.value
817
- })
818
- let res = await this.$resetpost(
819
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
820
- data
821
- )
822
- this.$dispatch('breakControl', this.show_data)
823
- },
824
- async 'onetomanyupdate'(i, j) {
825
- let onetomany = this.show_data.onetomany[i]
826
- let data = onetomany.rows[j]
827
-
828
- onetomany.fields.forEach(item => {
829
- data[item.field] = item.value
830
- })
831
- let res = await this.$resetpost(
832
- `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
833
- data
834
- )
835
-
836
- this.$dispatch('breakControl', this.show_data)
837
- },
838
- // onetomany模态框监听事件
839
- async 'onchange_modal'(index, i) {
840
- },
841
- async 'oninput_modal'(index, i) {
842
- }
843
- },
844
- watch: {
845
- }
846
- }
847
- </script>
848
- <style scoped>
849
- /*清除model中的浮动*/
850
- .clearfix:after,.clearfix:before{
851
- display: table;
852
- }
853
- .clearfix:after{
854
- clear: both;
855
- }
856
- </style>
1
+ <template>
2
+
3
+ <div class="auto clearfix">
4
+ <show-back-reason :selectdata="show_data"></show-back-reason>
5
+ </div>
6
+
7
+ <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
+
9
+ </template>
10
+ <script>
11
+ import Vue from 'vue'
12
+ import {HttpResetClass} from 'vue-client'
13
+ import {getNowDate,isEmpty} from '../../../Util'
14
+ // Date格式化
15
+ Date.prototype.Format = function (fmt) {
16
+ var o = {
17
+ "M+": this.getMonth() + 1, //月份
18
+ "d+": this.getDate(), //日
19
+ "H+": this.getHours(), //小时
20
+ "m+": this.getMinutes(), //分
21
+ "s+": this.getSeconds(), //秒
22
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
+ "S": this.getMilliseconds() //毫秒
24
+ };
25
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
+ for (var k in o)
27
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
+ return fmt;
29
+ }
30
+
31
+ export default {
32
+ title: '报建流程业务控制层',
33
+ props: ['selectdata'],
34
+ data() {
35
+ return {
36
+ data: null, // 数据库数据,json配置文件数据的数据集合
37
+ json_datas: null, // Json配置文件集合
38
+ showview: false, // 控制显示service-view组件
39
+ show_data: null // 给view层显示的数据
40
+ }
41
+ },
42
+ created () {
43
+ this.refurbish()
44
+ },
45
+ methods: {
46
+ // 组件初始化操作
47
+ refurbish() {
48
+ this.json_datas = this.$workflow_vue
49
+ let sum = 0
50
+ let jsonData = {}
51
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
52
+ this.$showMessage("网络故障,请刷新页面")
53
+ return
54
+ }
55
+ for (let i = 0; i < this.json_datas.activitys.length; i++) {
56
+ if (this.selectdata.defname == this.json_datas.activitys[i].title) {
57
+ jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
58
+ sum++ // 节点名一样的个数
59
+ }
60
+ }
61
+ if (sum == 1) {
62
+ this.data = null
63
+ this.data = jsonData
64
+ // selectdata 填充 data
65
+ this.data = Object.assign({}, this.data, this.selectdata)
66
+ this.initializeJSON()
67
+ } else if (sum == 0) {
68
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
69
+ } else {
70
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
71
+ }
72
+ },
73
+ // json配置数据处理
74
+ async initializeJSON() {
75
+ // 有默认值,value就给默认值,没有就是null
76
+ this.data.fields.forEach(item => {
77
+ if (!item.value) {
78
+ if (item.value === 0) {
79
+ item.value = 0
80
+ } else {
81
+ item.value = null
82
+ }
83
+ }
84
+ if (item.default || item.default == 0) {
85
+ item.value = item.default
86
+ }
87
+ if (this.selectdata[item.field]) {
88
+ // 将json字符串格式化赋值给value
89
+ if (String(this.selectdata[item.field]).startsWith("{")) {
90
+ item.value = JSON.parse(this.selectdata[item.field])
91
+ this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
92
+ } else {
93
+ item.value = this.selectdata[item.field]
94
+ }
95
+ } else {
96
+ if (this.selectdata[item.field] === 0) {
97
+ item.value = 0
98
+ }
99
+ }
100
+
101
+ // datepicker 没有值给当时值
102
+ if (item.type === 'datepicker' && !item.value && item.default) {
103
+ item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
104
+ }
105
+
106
+ // 如果配置类型为select,优先从参数列表获取options
107
+ if (item.type === 'select') {
108
+ let temp = null
109
+
110
+ temp = this.$appdata.getParam(item.label)
111
+
112
+ if (temp && temp.length > 0 && item.label) {
113
+ item.options = temp
114
+ } else {
115
+ if (item.paramLabel) {
116
+ temp = this.$appdata.getParam(item.paramLabel)
117
+ if (temp && temp.length > 0) {
118
+ item.options = temp
119
+ }
120
+ }
121
+ }
122
+ }
123
+ })
124
+
125
+ // 控制组件
126
+ if (this.data.components) {
127
+ this.data.components.forEach(item => {
128
+ item.mark = 0
129
+ })
130
+ }
131
+
132
+ // 初始化 fields 可对数据进行特殊处理
133
+ this.initializeFields()
134
+ console.log("this.data的数据:" + JSON.stringify(this.data))
135
+ // 初始化 buttons_fields
136
+ for (let i = 0; i < this.data.buttons.length; i++) {
137
+ // 下发按钮相关配置
138
+ if (this.data.buttons[i].button_name === '下发') {
139
+ if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
140
+ if (this.data.source){
141
+ let http = new HttpResetClass()
142
+ let res = await http.load('POST', 'rs/search', {
143
+ source: this.data.source,
144
+ userid: this.$login.f.id
145
+ }, {resolveMsg: null, rejectMsg: null})
146
+
147
+ let options = []
148
+ for (let i = 0; i < res.data.length; i++) {
149
+ options.push(
150
+ {
151
+ "label": res.data[i].name,
152
+ "value": res.data[i].name
153
+ }
154
+ )
155
+ }
156
+ this.data.buttons[i].button_fields[0]['options'] = options
157
+ } else {
158
+ this.$showMessage("请配置获取人员表达式")
159
+ }
160
+ } else {
161
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
162
+ }
163
+ }
164
+ if (this.data.buttons[i].button_fields) {
165
+ this.data.buttons[i].button_fields.forEach(x => {
166
+ // 如果配置类型为select,优先从参数列表获取options
167
+ if (x.type === 'select' && this.$appdata.getParam(x.label)) {
168
+ x.options = this.$appdata.getParam(x.label).trim()
169
+ }
170
+ })
171
+ }
172
+ }
173
+
174
+ // onetomany 数据获取
175
+ if (this.data.onetomany) {
176
+ for (let index = 0; index < this.data.onetomany.length; index++) {
177
+ let res = null
178
+ if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
179
+ let http = new HttpResetClass()
180
+ let data = {
181
+ tablename: this.data.onetomany[index].tables[0],
182
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
183
+ }
184
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
185
+ resolveMsg: null,
186
+ rejectMsg: 'onetomany查询失败'
187
+ })
188
+ } else {
189
+ res = this[this.data.onetomany[index].queryEvent]()
190
+ }
191
+
192
+ // 初始化 onetomany
193
+ this.data.onetomany[index].rows = res.data
194
+
195
+ // 初始化onetomany中的fields
196
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
197
+ if (!this.data.onetomany[index].fields[j].value) {
198
+ if (this.data.onetomany[index].fields[j].value === 0) {
199
+ this.data.onetomany[index].fields[j].value = 0
200
+ } else {
201
+ this.data.onetomany[index].fields[j].value = null
202
+ }
203
+ }
204
+ if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
205
+ this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
206
+ }
207
+ // 如果配置类型为select,优先从参数列表获取options
208
+ if (this.data.onetomany[index].fields[j].type === 'select') {
209
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
210
+ if (temp && temp.length > 0) {
211
+ this.data.onetomany[index].fields[j].options = temp
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+
218
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
219
+ let temp = JSON.parse(JSON.stringify(this.data))
220
+
221
+ this.show_data = temp
222
+ this.$nextTick(() => {
223
+ this.showview = true
224
+ })
225
+ // 查询区域和街道
226
+ if (this.selectdata.defname === '报装申请') {
227
+
228
+ for (let i = 0; i < this.show_data.fields.length; i++) {
229
+
230
+ if (this.show_data.fields[i].label === '区/县') {
231
+ let http = new HttpResetClass()
232
+ let condition = "f_type = ''"
233
+ let res = await http.load('POST','rs/sql/apply_singleTable',{
234
+ data:{tablename:'t_address',condition:condition}},
235
+ {resolveMsg: null, rejectMsg: null})
236
+ let data = []
237
+ let array = []
238
+ data = res.data.map(item => {
239
+ return item.f_name;
240
+ })
241
+ for (let q = 0; q < data.length; q++) {
242
+ let arraydata = {
243
+ 'label': data[q],
244
+ 'value': data[q]
245
+ }
246
+ if (array.length !== 0) {
247
+ for (let w = 0; w < array.length; w++) {
248
+ if (array[w].label === data[q]) {
249
+ break
250
+ }
251
+ while (w === array.length - 1) {
252
+ array.push(arraydata)
253
+ break
254
+ }
255
+ }
256
+ } else {
257
+ array.push(arraydata)
258
+ }
259
+ }
260
+ this.show_data.fields[i].options = array
261
+ console.log("区县选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
262
+ }
263
+ if (this.show_data.fields[i].label === '片区') {
264
+ let http = new HttpResetClass()
265
+ let condition = "f_type = '街道'"
266
+ let res = await http.load('POST','rs/sql/apply_singleTable',{
267
+ data:{tablename:'t_address',condition:condition}},
268
+ {resolveMsg: null, rejectMsg: null})
269
+ let data = []
270
+ let array = []
271
+ data = res.data.map(item => {
272
+ return item.f_name;
273
+ })
274
+ for (let q = 0; q < data.length; q++) {
275
+ let arraydata = {
276
+ 'label': data[q],
277
+ 'value': data[q]
278
+ }
279
+ if (array.length !== 0) {
280
+ for (let w = 0; w < array.length; w++) {
281
+ if (array[w].label === data[q]) {
282
+ break
283
+ }
284
+ while (w === array.length - 1) {
285
+ array.push(arraydata)
286
+ break
287
+ }
288
+ }
289
+ } else {
290
+ array.push(arraydata)
291
+ }
292
+ }
293
+ this.show_data.fields[i].options = array
294
+ console.log("片区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
295
+ }
296
+ }
297
+ }
298
+ },
299
+ // 初始化fields值
300
+ initializeFields() {
301
+
302
+ },
303
+ // 金额转大写
304
+ smalltoBIG(n) {
305
+ let fraction = ['角', '分'];
306
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '', '玖'];
307
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
308
+ let head = n < 0 ? '' : '';
309
+ n = Math.abs(n);
310
+
311
+ let s = '';
312
+
313
+ for (var i = 0; i < fraction.length; i++) {
314
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
315
+ }
316
+ s = s || '整';
317
+ n = Math.floor(n);
318
+
319
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
320
+ let p = '';
321
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
322
+ p = digit[n % 10] + unit[1][j] + p;
323
+ n = Math.floor(n / 10);
324
+ }
325
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
326
+ }
327
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
328
+ },
329
+ getLableValue(label) {
330
+ for (const item of this.show_data.fields) {
331
+ if (item.label === label && item.type !== 'number') {
332
+ return item.value || ''
333
+ }
334
+ if (item.label === label && item.type === 'number') {
335
+ return item.value || 0
336
+ }
337
+ }
338
+ },
339
+ setLabelValue(label, value) {
340
+ for (const item of this.show_data.fields) {
341
+ if (item.label === label) {
342
+ item.value = value
343
+ }
344
+ }
345
+ },
346
+ async buttonBefore(model) {
347
+ // if (
348
+ // model.button.button_name === '提交' &&
349
+ // model.defname === '收费' &&
350
+ // (
351
+ // model.f_apply_type === '散户报建' ||
352
+ // model.f_apply_type === '工业户报建' ||
353
+ // model.f_apply_type === '商业户报建'
354
+ // ) &&
355
+ // model.f_surplus_money > 0
356
+ // ) {
357
+ // throw '未结金额大于0,无法提交!!!'
358
+ // }
359
+ // if (model.defname === '施工' && model.button.button_name === '提交') {
360
+ // let http = new HttpResetClass()
361
+ // let data = {
362
+ // f_process_id: model.f_process_id
363
+ // }
364
+ // let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
365
+ // if (res.data[0].num > 0) {
366
+ // throw `还有${res.data[0].num}户未安装,无法提交`
367
+ // }
368
+ // }
369
+ return model
370
+ },
371
+ // ========================= 武安 =================================
372
+ // 地址类型变化
373
+ addressType() {
374
+ for (const item of this.show_data.fields) {
375
+ if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
376
+ item.required = true
377
+ }
378
+ if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
379
+ item.required = false
380
+ }
381
+ if (
382
+ (
383
+ item.label === '楼号' ||
384
+ item.label === '单元' ||
385
+ item.label === '楼层' ||
386
+ item.label === '门牌号'
387
+ ) && this.show_data.f_address_type === '民用地址'
388
+ ) {
389
+ item.required = true
390
+ item.hidden = false
391
+ item.value = null
392
+ }
393
+ if (
394
+ (
395
+ item.label === '楼号' ||
396
+ item.label === '单元' ||
397
+ item.label === '楼层' ||
398
+ item.label === '门牌号'
399
+ ) && this.show_data.f_address_type === '特殊地址'
400
+ ) {
401
+ item.required = false
402
+ item.hidden = true
403
+ item.value = null
404
+ }
405
+ }
406
+ },
407
+ //根据区县获取街道
408
+ async getStreetList () {
409
+ console.log("街道查询")
410
+ let data = {
411
+ son: '街道',
412
+ parent: '区',
413
+ condition: `b.f_name = '${this.getLableValue('区/县')}'`
414
+ }
415
+
416
+ let res = await this.$resetpost(
417
+ `rs/sql/getAddress`,
418
+ {data: data},
419
+ {resolveMsg: null, rejectMsg: '街道查询失败,请重新进入!!!'}
420
+ )
421
+
422
+ let streetList = []
423
+
424
+ res.data.forEach(item => {
425
+ streetList.push({
426
+ label: item.f_name,
427
+ value: item.f_name
428
+ })
429
+ })
430
+
431
+ for (const item of this.show_data.fields) {
432
+ if (item.label === '街道') {
433
+ item.options = streetList
434
+ }
435
+ }
436
+ },
437
+ //根据街道获取小区
438
+ async getAreaList () {
439
+ let data = {
440
+ son: '小区',
441
+ parent: '街道',
442
+ condition: `b.f_name = '${this.getLableValue('街道')}'`
443
+ }
444
+
445
+ let res = await this.$resetpost(
446
+ `rs/sql/getAddress`,
447
+ {data: data},
448
+ {resolveMsg: null, rejectMsg: '小区查询失败,请重新进入!!!'}
449
+ )
450
+
451
+ let areaList = []
452
+
453
+ res.data.forEach(item => {
454
+ areaList.push({
455
+ label: item.f_name,
456
+ value: item.f_name
457
+ })
458
+ })
459
+
460
+ for (const item of this.show_data.fields) {
461
+ if (item.label === '小区') {
462
+ item.options = areaList
463
+ }
464
+ }
465
+ }
466
+
467
+ },
468
+ events: {
469
+
470
+ 'openAddModel'(index) {
471
+
472
+ },
473
+ // 获取view层button事件/
474
+ async 'button'(model) {
475
+ // 修改提交数据
476
+ model = Object.assign({}, this.selectdata, model)
477
+ // 点击重置按钮就重置数据
478
+ if (model.button.button_name === '重置') {
479
+ this.$dispatch('breakControl', this.data)
480
+ return
481
+ }
482
+ // 联合验收必须上传附件
483
+ if (model.defname === '联合验收' && model.button.button_name === '提交') {
484
+ let http = new HttpResetClass()
485
+ let data = {
486
+ tablename: 't_files',
487
+ condition: "f_blobid = '" + this.selectdata.f_process_id + "'"
488
+ }
489
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
490
+ if (!res.data.length > 0) {
491
+ this.$showMessage("您没有上传附件,无法提交!")
492
+ return
493
+ }
494
+ }
495
+
496
+ // 提交前置
497
+ try {
498
+ model = await this.buttonBefore(model)
499
+ } catch (e) {
500
+ this.$showAlert(e, 'warning', 3000)
501
+ return
502
+ }
503
+
504
+ let http = new HttpResetClass()
505
+ let requestData = {
506
+ tables: this.data.tables,
507
+ start_activity: this.$workflow_vue.start_activity,
508
+ model: model,
509
+ loginUser: this.$login.f,
510
+ workflow_xmlfilename: this.$workflow_vue.workflow_xmlfilename
511
+ }
512
+ // 下发,提交,保存,退回通用业务后台处理logic
513
+ let url = 'rs/logic/ApplyProductService'
514
+ let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
515
+
516
+ if (res.data.code == 200) {
517
+ this.$dispatch('search')
518
+ } else {
519
+ if (res.data.msg) {
520
+ this.$showMessage(res.data.msg)
521
+ }
522
+ }
523
+ },
524
+ async 'initializtionView'() {
525
+
526
+ // if (this.show_data.defname === '报装申请' && this.show_data.f_apply_type === '工商户报装') {
527
+ // await this.getStreetList()
528
+ // }
529
+ },
530
+ // 失去焦点出触发事件
531
+ async 'onchange'(index) {
532
+ console.log('失去焦点')
533
+
534
+ if (this.show_data.defname === '报装申请' && this.show_data.f_apply_type === '工商户报装'){
535
+
536
+ if (this.show_data.fields[index].label === '区/县'){
537
+ console.log('-----------添加街道-----------')
538
+ if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
539
+ this.show_data.fields[index].value = null
540
+ this.$showAlert('区/县不能为空!!!', 'warning', 3000)
541
+ return
542
+ }
543
+ this.setLabelValue('街道', '')
544
+ await this.getStreetList()
545
+ }
546
+ if (this.show_data.fields[index].label === '街道') {
547
+ this.setLabelValue('小区', '')
548
+ await this.getAreaList()
549
+ }
550
+ }
551
+ // 地址拼接
552
+ if (
553
+ this.show_data.fields[index].label === '区/县' ||
554
+ this.show_data.fields[index].label === '街道' ||
555
+ this.show_data.fields[index].label === '小区' ||
556
+ this.show_data.fields[index].label === '门牌号'
557
+ ) {
558
+ let f_address = null
559
+ f_address = this.getLableValue('区/县') + this.getLableValue('街道') + this.getLableValue('小区') + this.getLableValue('门牌号')
560
+ this.setLabelValue('地址',f_address)
561
+ }
562
+ if (this.show_data.defname === '竣工验收') {
563
+ if (this.show_data.fields[index].label === '验收是否合格'){
564
+ for (const button of this.show_data.buttons) {
565
+ if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
566
+ button.hidden = false
567
+ } else {
568
+ button.hidden = true
569
+ }
570
+ }
571
+ }
572
+ }
573
+ if (this.show_data.defname === '合同签订') {
574
+ if (this.show_data.fields[index].label === '合同编号') {
575
+ if (!isEmpty(this.show_data.fields[index].value)) {
576
+ let http = new HttpResetClass()
577
+ let data = {
578
+ tablename: 't_apply',
579
+ condition: `f_contract_number='${this.show_data.fields[index].value}'`
580
+ }
581
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
582
+ resolveMsg: null,
583
+ rejectMsg: '合同编号查重失败'
584
+ })
585
+ if (res.data.length > 0) {
586
+ this.show_data.fields[index].value = null
587
+ this.$showAlert('合同编号已存在!!!', 'warning', 3000)
588
+ }
589
+ }
590
+ }
591
+ if (this.show_data.fields[index].label === '单价(户)') {
592
+ let http = new HttpResetClass()
593
+ let data = {
594
+ num1: this.getLableValue(this.show_data.fields[index].label),
595
+ num2: this.getLableValue('户数'),
596
+ operator: '*'
597
+ }
598
+ try {
599
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
600
+ resolveMsg: null,
601
+ rejectMsg: null
602
+ })
603
+ data = {
604
+ num1: res.data,
605
+ num2: this.getLableValue('其他费用'),
606
+ operator: '+'
607
+ }
608
+ res = await http.load('POST', 'rs/logic/compute', {data: data}, {
609
+ resolveMsg: null,
610
+ rejectMsg: null
611
+ })
612
+ this.setLabelValue('合同金额',res.data)
613
+ } catch (e) {
614
+ this.$showAlert(e.data.msg, 'warning', 3000)
615
+ }
616
+ }
617
+ if (this.show_data.fields[index].label === '其他费用') {
618
+ let http = new HttpResetClass()
619
+ let data = {
620
+ num1: this.getLableValue(this.show_data.fields[index].label),
621
+ num2: this.getLableValue('合同金额'),
622
+ operator: '+'
623
+ }
624
+ try {
625
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
626
+ resolveMsg: null,
627
+ rejectMsg: null
628
+ })
629
+ this.setLabelValue('合同金额',res.data)
630
+ } catch (e) {
631
+ this.$showAlert(e.data.msg, 'warning', 3000)
632
+ }
633
+ }
634
+ }
635
+ // ========================= 武安 =================================
636
+ // 号码检测
637
+ if (this.show_data.fields[index].label === '电话号码') {
638
+ let phone = this.show_data.fields[index].value
639
+ // 电话号码效验
640
+ if (!(/^1[3456789]\d{9}$/.test(phone))) {
641
+ this.show_data.fields[index].value = ""
642
+ this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
643
+ }
644
+ }
645
+ //时间提醒
646
+ if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
647
+ let setTime = this.show_data.fields[index].value
648
+ let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
649
+ if (nowTime >= setTime) {
650
+ this.$showMessage("请注意,当前节点时间/工期已过期!")
651
+ }
652
+ }
653
+ },
654
+ // input值发生变化
655
+ async 'oninput'(index) {
656
+
657
+ },
658
+ // 错误事件
659
+ error_check(index) {
660
+ // 时间格式检测
661
+ if (this.show_data.fields[index].type == 'datepicker') {
662
+ let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
663
+ let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
664
+ if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
665
+ this.show_data.fields[index].error.flag = false
666
+ } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
667
+ this.show_data.fields[index].error.flag = false
668
+ } else {
669
+ if (this.show_data.fields[index].fullsize) {
670
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
671
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
672
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
673
+ this.show_data.fields[index].error.flag = true
674
+ this.show_data.fields[index].value = ''
675
+ } else {
676
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
677
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
678
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
679
+ this.show_data.fields[index].error.flag = true
680
+ this.show_data.fields[index].value = ''
681
+ }
682
+
683
+ }
684
+ }
685
+ },
686
+ // onetomany模态框默认监听监听事件
687
+ async 'onetomanydelete'(i, j) {
688
+ console.log('默认删除')
689
+ let http = new HttpResetClass()
690
+ let data = {
691
+ table: this.show_data.onetomany[i].tables[0],
692
+ row: this.show_data.onetomany[i].rows[j]
693
+ }
694
+ let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
695
+ resolveMsg: null,
696
+ rejectMsg: '删除失败'
697
+ })
698
+
699
+ if (res.data <= 0){
700
+ this.$showMessage('删除失败')
701
+ return
702
+ }
703
+
704
+ this.$dispatch('breakControl', this.show_data)
705
+ },
706
+ async 'onetomanyadd'(index) {
707
+
708
+ let data = {
709
+ f_process_id : this.show_data.f_process_id
710
+ }
711
+ this.show_data.onetomany[index].fields.forEach(item => {
712
+ data[item.field] = item.value
713
+ })
714
+ let res = await this.$resetpost(
715
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
716
+ data
717
+ )
718
+ this.$dispatch('breakControl', this.show_data)
719
+ },
720
+ async 'onetomanyupdate'(i, j) {
721
+ let onetomany = this.show_data.onetomany[i]
722
+ let data = onetomany.rows[j]
723
+
724
+ onetomany.fields.forEach(item => {
725
+ data[item.field] = item.value
726
+ })
727
+ let res = await this.$resetpost(
728
+ `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
729
+ data
730
+ )
731
+
732
+ this.$dispatch('breakControl', this.show_data)
733
+ },
734
+ // onetomany模态框监听事件
735
+ async 'onchange_modal'(index, i) {
736
+ },
737
+ async 'oninput_modal'(index, i) {
738
+ }
739
+ },
740
+ watch: {
741
+ }
742
+ }
743
+ </script>
744
+ <style scoped>
745
+ /*清除model中的浮动*/
746
+ .clearfix:after,.clearfix:before{
747
+ display: table;
748
+ }
749
+ .clearfix:after{
750
+ clear: both;
751
+ }
752
+ </style>