safecheck-client 4.0.2-48 → 4.0.2-49

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 (258) hide show
  1. package/.babelrc +5 -5
  2. package/.editorconfig +9 -9
  3. package/android.html +18 -18
  4. package/build/css-loaders.js +34 -0
  5. package/build/dev-android.js +151 -0
  6. package/build/dev-client.js +8 -0
  7. package/build/example-server.js +157 -0
  8. package/build/release.sh +28 -0
  9. package/build/utils.js +71 -0
  10. package/build/webpack.base.conf.js +129 -0
  11. package/build/webpack.baseandroid.conf.js +83 -0
  12. package/build/webpack.dev.conf.js +44 -0
  13. package/build/webpack.devandroid.conf.js +33 -0
  14. package/build/webpack.example.conf.js +49 -0
  15. package/build/webpack.hanwei.conf.js +57 -0
  16. package/build/webpack.hwbase.conf.js +78 -0
  17. package/build/webpack.prod.conf.js +78 -0
  18. package/build/webpack.prodandroid.conf.js +60 -0
  19. package/build/webpack.test.conf.js +31 -0
  20. package/config/dev.env.js +6 -6
  21. package/config/index.js +38 -38
  22. package/config/prod.env.js +3 -3
  23. package/config/test.env.js +6 -6
  24. package/docs/AppBase.md +22 -22
  25. package/docs/Busy.md +14 -14
  26. package/docs/CriteriaPaged.md +47 -47
  27. package/docs/DataGrid.md +54 -54
  28. package/docs/DataModel.md +22 -22
  29. package/docs/Dynamic.md +42 -42
  30. package/docs/GetParams.md +11 -11
  31. package/docs/HttpBusy.md +13 -13
  32. package/docs/HttpStore.md +29 -29
  33. package/docs/MessageBox.md +28 -28
  34. package/docs/PagedList.md +29 -29
  35. package/docs/Pager.md +21 -21
  36. package/docs/Project.md +23 -23
  37. package/docs/Route.md +105 -105
  38. package/docs/SafetyCheck/AdjustPlan.md +13 -13
  39. package/docs/SafetyCheck/CheckerPlan.md +12 -12
  40. package/docs/Task.md +46 -46
  41. package/docs/TreeList.md +28 -28
  42. package/docs/TreeMixin.md +18 -18
  43. package/docs/all.md +10 -10
  44. package/docs/list.md +42 -42
  45. package/docs/partial.md +75 -75
  46. package/docs/selector.md +82 -82
  47. package/docs//345/274/200/345/217/221/346/226/207/346/241/243/Snippets.md +28 -28
  48. package/docs//345/274/200/345/217/221/346/226/207/346/241/243/vue-strap/345/217/230/346/233/264/350/256/260/345/275/225.md +7 -7
  49. package/docs//345/274/200/345/217/221/346/226/207/346/241/243/vue/345/217/230/346/233/264/350/256/260/345/275/225.md +13 -13
  50. package/docs//345/274/200/345/217/221/346/226/207/346/241/243//345/274/200/345/217/221/347/216/257/345/242/203/350/256/276/347/275/256.md +77 -77
  51. package/docs//347/225/214/351/235/242/345/210/266/344/275/234/350/247/204/350/214/203.md +54 -54
  52. package/examples/AddressList/App.vue +13 -13
  53. package/examples/AddressList/index.html +11 -11
  54. package/examples/DispatchList/App.vue +10 -10
  55. package/examples/DispatchList/BaseTree.vue +13 -13
  56. package/examples/DispatchList/Init.vue +22 -22
  57. package/examples/DispatchList/Test.vue +20 -20
  58. package/examples/DispatchList/index.html +11 -11
  59. package/examples/DispatchList/main.js +18 -18
  60. package/home.html +16 -16
  61. package/package.json +1 -1
  62. package/publish.bat +7 -7
  63. package/release.bat +5 -5
  64. package/src/Widget.vue +13 -13
  65. package/src/android-bootstrap/fonts/glyphicons-halflings-regular.svg +287 -287
  66. package/src/android-bootstrap/less/.csscomb.json +304 -304
  67. package/src/android-bootstrap/less/.csslintrc +19 -19
  68. package/src/android-bootstrap/less/alerts.less +73 -73
  69. package/src/android-bootstrap/less/badges.less +66 -66
  70. package/src/android-bootstrap/less/bootstrap.less +56 -56
  71. package/src/android-bootstrap/less/breadcrumbs.less +26 -26
  72. package/src/android-bootstrap/less/button-groups.less +247 -247
  73. package/src/android-bootstrap/less/buttons.less +173 -173
  74. package/src/android-bootstrap/less/carousel.less +269 -269
  75. package/src/android-bootstrap/less/close.less +34 -34
  76. package/src/android-bootstrap/less/code.less +69 -69
  77. package/src/android-bootstrap/less/component-animations.less +33 -33
  78. package/src/android-bootstrap/less/grid.less +84 -84
  79. package/src/android-bootstrap/less/input-groups.less +167 -167
  80. package/src/android-bootstrap/less/jumbotron.less +52 -52
  81. package/src/android-bootstrap/less/labels.less +64 -64
  82. package/src/android-bootstrap/less/list-group.less +141 -141
  83. package/src/android-bootstrap/less/media.less +66 -66
  84. package/src/android-bootstrap/less/mixins/alerts.less +14 -14
  85. package/src/android-bootstrap/less/mixins/background-variant.less +9 -9
  86. package/src/android-bootstrap/less/mixins/border-radius.less +18 -18
  87. package/src/android-bootstrap/less/mixins/buttons.less +69 -69
  88. package/src/android-bootstrap/less/mixins/center-block.less +7 -7
  89. package/src/android-bootstrap/less/mixins/clearfix.less +22 -22
  90. package/src/android-bootstrap/less/mixins/forms.less +90 -90
  91. package/src/android-bootstrap/less/mixins/gradients.less +59 -59
  92. package/src/android-bootstrap/less/mixins/grid-framework.less +92 -92
  93. package/src/android-bootstrap/less/mixins/grid.less +122 -122
  94. package/src/android-bootstrap/less/mixins/hide-text.less +21 -21
  95. package/src/android-bootstrap/less/mixins/image.less +33 -33
  96. package/src/android-bootstrap/less/mixins/labels.less +12 -12
  97. package/src/android-bootstrap/less/mixins/list-group.less +30 -30
  98. package/src/android-bootstrap/less/mixins/nav-divider.less +10 -10
  99. package/src/android-bootstrap/less/mixins/nav-vertical-align.less +9 -9
  100. package/src/android-bootstrap/less/mixins/opacity.less +8 -8
  101. package/src/android-bootstrap/less/mixins/pagination.less +24 -24
  102. package/src/android-bootstrap/less/mixins/panels.less +24 -24
  103. package/src/android-bootstrap/less/mixins/progress-bar.less +10 -10
  104. package/src/android-bootstrap/less/mixins/reset-filter.less +8 -8
  105. package/src/android-bootstrap/less/mixins/reset-text.less +18 -18
  106. package/src/android-bootstrap/less/mixins/resize.less +6 -6
  107. package/src/android-bootstrap/less/mixins/responsive-visibility.less +15 -15
  108. package/src/android-bootstrap/less/mixins/size.less +10 -10
  109. package/src/android-bootstrap/less/mixins/tab-focus.less +9 -9
  110. package/src/android-bootstrap/less/mixins/table-row.less +44 -44
  111. package/src/android-bootstrap/less/mixins/text-emphasis.less +9 -9
  112. package/src/android-bootstrap/less/mixins/text-overflow.less +8 -8
  113. package/src/android-bootstrap/less/mixins/vendor-prefixes.less +227 -227
  114. package/src/android-bootstrap/less/mixins.less +40 -40
  115. package/src/android-bootstrap/less/modals.less +151 -151
  116. package/src/android-bootstrap/less/navbar.less +660 -660
  117. package/src/android-bootstrap/less/navs.less +290 -290
  118. package/src/android-bootstrap/less/normalize.less +424 -424
  119. package/src/android-bootstrap/less/pager.less +76 -76
  120. package/src/android-bootstrap/less/pagination.less +89 -89
  121. package/src/android-bootstrap/less/panels.less +274 -274
  122. package/src/android-bootstrap/less/popovers.less +131 -131
  123. package/src/android-bootstrap/less/print.less +101 -101
  124. package/src/android-bootstrap/less/progress-bars.less +87 -87
  125. package/src/android-bootstrap/less/responsive-embed.less +35 -35
  126. package/src/android-bootstrap/less/responsive-utilities.less +194 -194
  127. package/src/android-bootstrap/less/scaffolding.less +161 -161
  128. package/src/android-bootstrap/less/tables.less +262 -262
  129. package/src/android-bootstrap/less/theme.less +291 -291
  130. package/src/android-bootstrap/less/thumbnails.less +36 -36
  131. package/src/android-bootstrap/less/tooltip.less +102 -102
  132. package/src/android-bootstrap/less/type.less +303 -303
  133. package/src/android-bootstrap/less/utilities.less +55 -55
  134. package/src/android-bootstrap/less/variables.less +896 -896
  135. package/src/android-bootstrap/less/wells.less +29 -29
  136. package/src/bootstrap/less/.csscomb.json +304 -304
  137. package/src/bootstrap/less/.csslintrc +19 -19
  138. package/src/bootstrap/less/alerts.less +73 -73
  139. package/src/bootstrap/less/badges.less +66 -66
  140. package/src/bootstrap/less/breadcrumbs.less +26 -26
  141. package/src/bootstrap/less/button-groups.less +247 -247
  142. package/src/bootstrap/less/buttons.less +172 -172
  143. package/src/bootstrap/less/carousel.less +269 -269
  144. package/src/bootstrap/less/close.less +34 -34
  145. package/src/bootstrap/less/code.less +69 -69
  146. package/src/bootstrap/less/component-animations.less +33 -33
  147. package/src/bootstrap/less/dropdowns.less +216 -216
  148. package/src/bootstrap/less/grid.less +84 -84
  149. package/src/bootstrap/less/input-groups.less +167 -167
  150. package/src/bootstrap/less/jumbotron.less +52 -52
  151. package/src/bootstrap/less/labels.less +64 -64
  152. package/src/bootstrap/less/list-group.less +141 -141
  153. package/src/bootstrap/less/media.less +66 -66
  154. package/src/bootstrap/less/mixins/alerts.less +14 -14
  155. package/src/bootstrap/less/mixins/background-variant.less +9 -9
  156. package/src/bootstrap/less/mixins/border-radius.less +18 -18
  157. package/src/bootstrap/less/mixins/buttons.less +69 -69
  158. package/src/bootstrap/less/mixins/center-block.less +7 -7
  159. package/src/bootstrap/less/mixins/clearfix.less +22 -22
  160. package/src/bootstrap/less/mixins/forms.less +90 -90
  161. package/src/bootstrap/less/mixins/gradients.less +59 -59
  162. package/src/bootstrap/less/mixins/grid-framework.less +92 -92
  163. package/src/bootstrap/less/mixins/grid.less +122 -122
  164. package/src/bootstrap/less/mixins/hide-text.less +21 -21
  165. package/src/bootstrap/less/mixins/image.less +33 -33
  166. package/src/bootstrap/less/mixins/labels.less +12 -12
  167. package/src/bootstrap/less/mixins/list-group.less +30 -30
  168. package/src/bootstrap/less/mixins/nav-divider.less +10 -10
  169. package/src/bootstrap/less/mixins/nav-vertical-align.less +9 -9
  170. package/src/bootstrap/less/mixins/opacity.less +8 -8
  171. package/src/bootstrap/less/mixins/pagination.less +24 -24
  172. package/src/bootstrap/less/mixins/panels.less +24 -24
  173. package/src/bootstrap/less/mixins/progress-bar.less +10 -10
  174. package/src/bootstrap/less/mixins/reset-filter.less +8 -8
  175. package/src/bootstrap/less/mixins/reset-text.less +18 -18
  176. package/src/bootstrap/less/mixins/resize.less +6 -6
  177. package/src/bootstrap/less/mixins/responsive-visibility.less +15 -15
  178. package/src/bootstrap/less/mixins/size.less +10 -10
  179. package/src/bootstrap/less/mixins/tab-focus.less +9 -9
  180. package/src/bootstrap/less/mixins/table-row.less +44 -44
  181. package/src/bootstrap/less/mixins/text-emphasis.less +9 -9
  182. package/src/bootstrap/less/mixins/text-overflow.less +8 -8
  183. package/src/bootstrap/less/mixins/vendor-prefixes.less +227 -227
  184. package/src/bootstrap/less/mixins.less +40 -40
  185. package/src/bootstrap/less/modals.less +151 -151
  186. package/src/bootstrap/less/navbar.less +660 -660
  187. package/src/bootstrap/less/normalize.less +424 -424
  188. package/src/bootstrap/less/pagination.less +89 -89
  189. package/src/bootstrap/less/panels.less +275 -275
  190. package/src/bootstrap/less/popovers.less +131 -131
  191. package/src/bootstrap/less/print.less +101 -101
  192. package/src/bootstrap/less/progress-bars.less +87 -87
  193. package/src/bootstrap/less/responsive-embed.less +35 -35
  194. package/src/bootstrap/less/responsive-utilities.less +194 -194
  195. package/src/bootstrap/less/scaffolding.less +161 -161
  196. package/src/bootstrap/less/theme.less +291 -291
  197. package/src/bootstrap/less/thumbnails.less +36 -36
  198. package/src/bootstrap/less/tooltip.less +102 -102
  199. package/src/bootstrap/less/type.less +303 -303
  200. package/src/bootstrap/less/utilities.less +55 -55
  201. package/src/bootstrap/less/wells.less +29 -29
  202. package/src/components/FileUpload.vue +696 -696
  203. package/src/components/Hello.vue +39 -39
  204. package/src/components/LeftTree.vue +27 -27
  205. package/src/components/android/AttendanceTally.vue +116 -116
  206. package/src/components/android/Blank.vue +10 -10
  207. package/src/components/android/CheckUnplanPage.vue +56 -56
  208. package/src/components/android/Checker.vue +12 -12
  209. package/src/components/android/CheckerAnnual.vue +81 -81
  210. package/src/components/android/CheckerAvarta.vue +82 -82
  211. package/src/components/android/EquipmentInspection.vue +348 -348
  212. package/src/components/android/FootprintMap.vue +120 -120
  213. package/src/components/android/HiddentroubleInvestigation.vue +192 -192
  214. package/src/components/android/MasterMain.vue +77 -77
  215. package/src/components/android/Menu.vue +132 -132
  216. package/src/components/android/PaperAlarm.vue +85 -85
  217. package/src/components/android/PaperDeviceNoncivil.vue +214 -214
  218. package/src/components/android/PlumberAnnual.vue +83 -83
  219. package/src/components/android/PlumberAnnualDetail.vue +65 -65
  220. package/src/components/android/PlumberMonthly.vue +84 -84
  221. package/src/components/android/PostMap.vue +83 -83
  222. package/src/components/android/QueryCheckHistory.vue +122 -122
  223. package/src/components/android/QueryCheckHistoryItem.vue +62 -62
  224. package/src/components/android/RepairMain.vue +60 -60
  225. package/src/components/android/Repairman.vue +12 -12
  226. package/src/components/android/StationMaster.vue +12 -12
  227. package/src/components/defects/DefectModal.vue +101 -101
  228. package/src/components/defects/DevicesAndItem.vue +39 -39
  229. package/src/components/issueplan/IssuePlanMain.vue +23 -23
  230. package/src/components/notice/NoticeForm.vue +100 -100
  231. package/src/components/notice/NoticeIssue.vue +20 -20
  232. package/src/components/paper/PicViewer.vue +18 -18
  233. package/src/components/phonestate/MonthlyTraffic.vue +66 -66
  234. package/src/components/phonestate/MonthlyTrafficRouter.vue +15 -15
  235. package/src/components/phonestate/PostMap.vue +82 -82
  236. package/src/components/querycheckpaper/PaperItem.vue +59 -59
  237. package/src/components/userfile/MeterFile.vue +145 -145
  238. package/src/components/userfile/MeterModify.vue +46 -46
  239. package/src/components/userfileaudit/MeterAuditFile.vue +129 -129
  240. package/src/filiale/jinhong/android/CurrentCreate.vue +1335 -1316
  241. package/src/filiale/jinhong/android/SafecheckOrderV.vue +2300 -0
  242. package/src/filiale/jinhong/android.js +12 -11
  243. package/src/filiale/jinhong/pc/CheckSearchUser.vue +1134 -1120
  244. package/src/filiale/xinkang/android/SafecheckDevices.vue +1213 -1213
  245. package/src/plugins/LoadData.js +10 -10
  246. package/src/plugins/LoadParams.js +24 -24
  247. package/src/stores/wxconfig.js +10 -10
  248. package/src/utils/getNowDate.js +33 -33
  249. package/test/e2e/custom-assertions/elementCount.js +26 -26
  250. package/test/e2e/nightwatch.conf.js +40 -40
  251. package/test/e2e/runner.js +30 -30
  252. package/test/e2e/specs/test.js +13 -13
  253. package/test/unit/.eslintrc +5 -5
  254. package/test/unit/TestUtil.js +62 -62
  255. package/test/unit/context.html +20 -20
  256. package/test/unit/index.js +13 -13
  257. package/build/libs/SafecheckClient-1.15.6-9.jar +0 -0
  258. package/build/tmp/jar/MANIFEST.MF +0 -2
@@ -1,1120 +1,1134 @@
1
- <template>
2
- <div class="flex">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
7
- <div :class="$parent.$parent.style">
8
- <label class="font_normal_body">用户编号</label>
9
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
10
- id="f_userinfo_code"
11
- placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
12
- </div>
13
- <div :class="$parent.$parent.style">
14
- <label class="font_normal_body">用户姓名</label>
15
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name" id="f_user_name"
16
- placeholder="用户姓名" condition="f_user_name like '%{}%'">
17
- </div>
18
- <div :class="$parent.$parent.style">
19
- <label class="font_normal_body">小&emsp;&emsp;区</label>
20
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
21
- id="f_residential_area"
22
- placeholder="小区" condition="f_residential_area like '%{}%'">
23
- </div>
24
- <div :class="$parent.$parent.style">
25
- <label class="font_normal_body">地&emsp;&emsp;址</label>
26
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_address" id="f_address"
27
- placeholder="地址" condition="f_address like '%{}%'">
28
- </div>
29
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
30
- <export-excel :data="$parent.$parent.searchData"
31
- :field="$parent.$parent.excelHeaders"
32
- :choose-col="true"
33
- sqlurl="api/af-safecheck/logic/exportfile" sql-name="根据安检员查询用户档案"
34
- template-name='用户安检情况'></export-excel>
35
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
36
- <div style="float: right" class="button_spacing"
37
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
38
- @click="$parent.$parent.hiddenr()"></div>
39
- <div style="float: right" class="button_spacing"
40
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
41
- @click="$parent.$parent.hidden()">
42
-
43
- </div>
44
- </div>
45
-
46
-
47
- </div>
48
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
49
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
50
- <label class="font_normal_body">用户类型</label>
51
- <v-select id="f_usertype"
52
- placeholder='用户类型'
53
- class="select select_list"
54
- :value.sync="model.f_usertype"
55
- :value-single="true"
56
- :options='$parent.$parent.usertypes'
57
- v-model="model.f_usertype"
58
- condition="f_user_type = '{}'"
59
- close-on-select clear-button></v-select>
60
- </div>
61
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
62
-
63
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
64
- <label class="font_normal_body" style="color: red;">安检筛选</label>
65
- <v-select
66
- placeholder='安检筛选'
67
- :value-single="true"
68
- class="select select_list"
69
- :value.sync="$parent.$parent.SafeCheckXZ"
70
- :options='$parent.$parent.SafeCheckXZs'
71
- v-model="$parent.$parent.SafeCheckXZ"
72
- close-on-select clear-button></v-select>
73
- </div>
74
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
75
- <label class="font_normal_body">安检起始</label>
76
- <datepicker
77
- :value.sync="model.f_check_start"
78
- placeholder='最后安检时间起始'
79
- style="width: 60%"
80
- :format="'yyyy-MM-dd 00:00:00'"
81
- :show-rest-button="reset"
82
- v-model="model.f_check_start">
83
- </datepicker>
84
- </div>
85
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
86
- <label class="font_normal_body">安检结束</label>
87
- <datepicker
88
- :value.sync="model.f_check_end"
89
- placeholder='最后安检时间结束'
90
- style="width: 60%"
91
- :format="'yyyy-MM-dd 23:59:59'"
92
- :show-rest-button="reset"
93
- v-model="model.f_check_end">
94
- </datepicker>
95
- </div>
96
-
97
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
98
- <label class="font_normal_body">安检状态</label>
99
- <v-select id="f_entry"
100
- placeholder='安检状态'
101
- :multiple="true"
102
- class="select select_list"
103
- :value.sync="$parent.$parent.checkStates"
104
- :options='$parent.$parent.checkstatus'
105
- ></v-select>
106
- </div>
107
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
108
- <label class="font_normal_body">隐患情况</label>
109
- <v-select
110
- placeholder='隐患情况'
111
- class="select select_list"
112
- :value-single="true"
113
- v-model='model.f_check_result'
114
- :value.sync="model.f_check_result"
115
- :options='$parent.$parent.f_check_results'
116
- condition="f_defect_content like '%{}%'"
117
- close-on-select clear-button></v-select>
118
- </div>
119
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
120
- </div>
121
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
122
-
123
- <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
124
- <role-selector-safe
125
- role-name="安检员"
126
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
127
- @re-res="$parent.$parent.getRes"
128
- :value.sync="model.f_checker_id"
129
- v-model="model.f_checker_id"
130
- :value-multiple="true"
131
- condition=" f_checker_name in {}">
132
- </role-selector-safe>
133
- </div>
134
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
135
- <label class="font_normal_body">片&emsp;&emsp;区</label>
136
- <v-select class="select_list select"
137
- placeholder='片区/管理站' style="width: 60%"
138
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
139
- :options='$parent.$parent.sliceArea'
140
- filer-key="name"
141
- close-on-select clear-button
142
- condition="f_slice_area='{}'"
143
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
144
- :value-single="true">
145
- </v-select>
146
- </div>
147
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
148
- <label class="font_normal_body">安检册</label>
149
- <v-select class="select_list select"
150
- placeholder='安检册' style="width: 60%"
151
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
152
- :options='$parent.$parent.checkBooks'
153
- filer-key="name"
154
- close-on-select clear-button
155
- condition="f_check_book_name like '%{}%'"
156
- :value-single="true">
157
- </v-select>
158
- </div>
159
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
160
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
161
- <v-select class="select_list select"
162
- placeholder='请选择' style="width: 60%"
163
- :value.sync="model.f_pcd" v-model="model.f_pcd"
164
- :options='$parent.$parent.pcds'
165
- filer-key="name"
166
- close-on-select clear-button
167
- condition="f_pcd='{}'"
168
- :value-single="true">
169
- </v-select>
170
- </div>
171
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
172
- <label class="font_normal_body">用户状态</label>
173
- <v-select class="select_list select"
174
- placeholder='用户状态' style="width: 60%"
175
- :value.sync="model.f_user_state" v-model="model.f_user_state"
176
- :options='$parent.$parent.userstates'
177
- close-on-select clear-button
178
- condition="f_user_state = '{}'"
179
- :value-single="true">
180
- </v-select>
181
- </div>
182
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
183
- <label class="font_normal_body">两年未入户</label>
184
- <v-select class="select_list select"
185
- placeholder='两年未入户' style="width: 60%"
186
- :value.sync="model.is_no_ruhu" v-model="model.is_no_ruhu"
187
- :options='$parent.$parent.SafeCheckSXs'
188
- close-on-select clear-button
189
- :value-single="true">
190
- </v-select>
191
- </div>
192
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
193
- <label class="font_normal_body">距上次安检天数</label>
194
- <input type="number" class="input_search" v-model="model.f_check_date"
195
- style="width: 60%" placeholder="距上次安检天数" >
196
- </div>
197
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
198
- <label class="font_normal_body">到访不遇次数</label>
199
- <input type="number" class="input_search" v-model="model.f_check_version"
200
- style="width: 60%" placeholder="到访不遇次数">
201
- </div>
202
- </div>
203
-
204
- <div class="row" v-show="$parent.$parent.$parent.showItem">
205
- <div :class="$parent.$parent.style">
206
- <label class="font_normal_body">用户编号</label>
207
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
208
-
209
- placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
210
- </div>
211
- <div :class="$parent.$parent.style">
212
- <label class="font_normal_body">用户姓名</label>
213
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name"
214
- placeholder="用户姓名" condition="f_user_name like '%{}%'">
215
- </div>
216
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
217
- <export-excel :data="$parent.$parent.searchData"
218
- :field="$parent.$parent.excelHeaders"
219
- sqlurl="api/af-safecheck/logic/exportfile" sql-name="根据安检员查询用户档案"
220
- template-name='用户安检情况'></export-excel>
221
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
222
- <div style="float: right" class="button_spacing"
223
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
224
- @click="$parent.$parent.hiddenr()"></div>
225
- <div style="float: right" class="button_spacing"
226
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
227
- @click="$parent.$parent.hidden()">
228
-
229
- </div>
230
- </div>
231
-
232
- </div>
233
- <div class="row" v-show="$parent.$parent.$parent.showItem">
234
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
235
- <label class="font_normal_body">小&emsp;&emsp;区</label>
236
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
237
-
238
- placeholder="小区" condition="f_residential_area like '%{}%'">
239
- </div>
240
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
241
- <label class="font_normal_body">地&emsp;&emsp;址</label>
242
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_address"
243
-
244
- placeholder="地址" condition="f_address like '%{}%'">
245
- </div>
246
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
247
- <label class="font_normal_body">用户类型</label>
248
- <v-select
249
- placeholder='用户类型'
250
- class="select select_list"
251
-
252
- :value.sync="model.f_usertype"
253
- :value-single="true"
254
- :options='$parent.$parent.usertypes'
255
- v-model="model.f_usertype"
256
- condition="f_user_type = '{}'"
257
- close-on-select clear-button></v-select>
258
- </div>
259
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
260
-
261
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
262
- <label class="font_normal_body" style="color: red;">安检筛选</label>
263
- <v-select
264
- placeholder='安检筛选'
265
- :value-single="true"
266
-
267
- class="select select_list"
268
- :value.sync="$parent.$parent.SafeCheckXZ"
269
- :options='$parent.$parent.SafeCheckXZs'
270
- v-model="$parent.$parent.SafeCheckXZ"
271
- close-on-select clear-button></v-select>
272
- </div>
273
-
274
- </div>
275
- <div class="row" v-show="$parent.$parent.$parent.showItem">
276
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
277
- <label class="font_normal_body">安检起始</label>
278
- <datepicker
279
- :value.sync="model.f_check_start"
280
- placeholder='最后安检时间起始'
281
- :disabled-days-of-week="[]"
282
- style="width: 60%"
283
- :format="'yyyy-MM-dd'"
284
- :show-rest-button="reset"
285
- v-model="model.f_check_start">
286
- </datepicker>
287
- </div>
288
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
289
- <label class="font_normal_body">安检结束</label>
290
- <datepicker
291
- :value.sync="model.f_check_end"
292
- placeholder='最后安检时间结束'
293
- style="width: 60%"
294
- :disabled-days-of-week="[]"
295
- :format="'yyyy-MM-dd'"
296
- :show-rest-button="reset"
297
- v-model="model.f_check_end">
298
- </datepicker>
299
- </div>
300
-
301
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
302
- <label class="font_normal_body">安检状态</label>
303
- <v-select
304
- placeholder='安检状态'
305
- class="select select_list"
306
- :value.sync="$parent.$parent.checkStates"
307
- :options='$parent.$parent.checkstatus'
308
- :multiple="true"
309
- close-on-select clear-button></v-select>
310
- </div>
311
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
312
- <label class="font_normal_body">隐患情况</label>
313
- <v-select
314
- placeholder='隐患情况'
315
- class="select select_list"
316
- :value-single="true"
317
- v-model='model.f_check_result'
318
- :value.sync="model.f_check_result"
319
- :options='$parent.$parent.f_check_results'
320
- condition="f_defect_content like '%{}%'"
321
- close-on-select clear-button></v-select>
322
- </div>
323
- </div>
324
- <!--<div class="row" v-show="$parent.$parent.$parent.showItem">
325
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
326
- <label class="font_normal_body">公&emsp;&emsp;司</label>
327
- <right-tree @re-res="$parent.$parent.getRes" :initresid="$parent.$parent.$login.f.orgid">
328
- </right-tree>
329
- </div>
330
-
331
- </div>-->
332
- </div>
333
- </criteria>
334
- <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
335
- <template partial='head'>
336
- <tr>
337
- <th>
338
- <nobr>用户编号</nobr>
339
- </th>
340
- <th>
341
- <nobr>用户名称</nobr>
342
- </th>
343
- <th>
344
- <nobr>已安检天数</nobr>
345
- </th>
346
- <th>
347
- <nobr>用户电话</nobr>
348
- </th>
349
- <th>
350
- <nobr>用户表号</nobr>
351
- </th>
352
- <!-- <th>-->
353
- <!-- <nobr>气表品牌</nobr>-->
354
- <!-- </th>-->
355
- <th>
356
- <nobr>用户类型</nobr>
357
- </th>
358
- <!-- <th>-->
359
- <!-- <nobr>壁挂炉</nobr>-->
360
- <!-- </th>-->
361
- <!-- <th>-->
362
- <!-- <nobr>灶具</nobr>-->
363
- <!-- </th>-->
364
- <th>
365
- <nobr>小区名称</nobr>
366
- </th>
367
- <th style="padding: 0 40px">
368
- <nobr>地址</nobr>
369
- </th>
370
- <th>
371
- <nobr>安检员</nobr>
372
- </th>
373
- <!-- <th>-->
374
- <!-- <nobr>安检员备注</nobr>-->
375
- <!-- </th>-->
376
- <th>
377
- <nobr>安检日期</nobr>
378
- </th>
379
- <th>
380
- <nobr>安检状态</nobr>
381
- </th>
382
- <th>
383
- <nobr>安检结果</nobr>
384
- </th>
385
- <th>
386
- <nobr>建档日期</nobr>
387
- </th>
388
- <th>
389
- <nobr>通气日期</nobr>
390
- </th>
391
- <th>
392
- <nobr>最后一次入户时间</nobr>
393
- </th>
394
- <th v-show="$parent.$parent.$parent.showcode">
395
- <nobr>二维码</nobr>
396
- </th>
397
- </tr>
398
- </template>
399
- <template partial='body'>
400
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_userinfo_code }}</td>
401
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_name }}</td>
402
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{$parent.$parent.$parent.dateDiff(row.f_last_check_date)}}</td>
403
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_phone }}</td>
404
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_meternumber}}</td>
405
- <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_meter_brand}}</td>-->
406
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_user_type }}</td>
407
- <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_hasfurnace }}</td>-->
408
- <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_haskitchen }}</td>-->
409
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_residential_area }}</td>
410
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_address }}</td>
411
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_checker_name }}</td>
412
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_date }}</td>
413
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_state }}</td>
414
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">
415
- {{row.f_last_check_state!='入户' ? '': (row.f_last_check_result == '无隐患' ? '无问题' : row.f_last_check_result) }}
416
- </td>
417
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_createfile_date }}</td>
418
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_gas_date }}</td>
419
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.last_ruhu_f_offsite_time }}</td>
420
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center" v-show="$parent.$parent.$parent.showcode">
421
- <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.searchInfo(row.f_userinfo_code)' >点击</button>
422
- </td>
423
- </template>
424
- </data-grid>
425
- </criteria-paged>
426
- <modal :show.sync="dialogVisible" style="text-align: center" destroyOnClose={true} v-ref:modal v-if="dialogVisible">
427
- <div slot="modal-header" class="modal-header">
428
- <h4 class="modal-title">
429
- 二维码
430
- </h4>
431
- </div>
432
- <div slot="modal-body" class="modal-body" >
433
- <div id="dd" ></div>
434
- </div>
435
- <div slot="modal-footer" class="modal-footer">
436
- <print-element class="btn btn-success width-80" id="dd" styleid='style1' top='40' left='60' width='100%' height='100%' v-ref:printelement>打印</print-element>
437
- <button type="button" class="btn btn-success width-80" @click="dialogVisible = false">确认</button>
438
- <button type="button" class="btn btn-success width-80" @click="dialogVisible = false" >取消</button>
439
- </div>
440
- </modal>
441
- </div>
442
-
443
- </template>
444
-
445
- <script>
446
- import {PagedList} from 'vue-client'
447
- import {HttpResetClass} from 'vue-client'
448
- import co from 'co'
449
- import * as Util from '../../../components/Util'
450
- import Vue from 'vue'
451
-
452
- // let select = function * (self,userid) {
453
- // let http = new HttpResetClass()
454
- // let getGasman = yield http.load('POST','/rs/search', {
455
- // source: 'this.getChildByName($安检员$).getUsers()',
456
- // userid: userid
457
- // }, {resolveMsg: null, rejectMsg: null})
458
- // //tag
459
- // getGasman.data.forEach((checker)=>{
460
- // self.checkersid.push({label:checker.name,value:checker.id})
461
- // })
462
- // self.checkersid.push({label:'全部',value:''})
463
- // }
464
-
465
-
466
- export default {
467
- title: '用户安检情况',
468
- data() {
469
- let options = []
470
- let year = (new Date()).getFullYear()
471
- for (let i = year; i <= year + 3; i++)
472
- options.push({label: i + '', value: i + ''})
473
- let moptions = []
474
- for (let i = 1; i <= 12; i++)
475
- moptions.push({label: i + '', value: i + ''})
476
-
477
- return {
478
- dialogVisible: false,
479
- searchData: {
480
- condition: '1=1',
481
- orderitem: "f_last_check_date",
482
- timetype: "dd",
483
- f_defect_content: "CASE WHEN CHARINDEX( '\"result\":\"正常\"', tp.f_defect_content ) > 0 THEN '正常' ELSE replace(replace(replace( replace( RIGHT ( tp.f_defect_content, len( tp.f_defect_content ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END"
484
- },
485
- excelHeaders: {
486
- //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
487
-
488
- 'f_userinfo_code': '用户编号',
489
- 'f_user_name': '用户名称',
490
- 'f_user_phone': '用户电话',
491
- 'f_meternumber': '用户表号',
492
- 'f_user_type': '用户类型',
493
- 'f_checker_name': '安检员',
494
- 'f_residential_area': '小区名称',
495
- 'f_address': '地址',
496
- 'f_last_check_date': '安检日期',
497
- 'f_last_check_state': '安检状态',
498
- 'f_last_check_result': '安检结果',
499
- 'f_createfile_date': '建档日期',
500
- 'f_gas_date': '通气日期'
501
- },
502
- model: new PagedList('api/af-safecheck/sql/根据安检员查询用户档案', 20, {
503
- orderitem: "'f_last_check_date'",
504
- timetype: "'dd'",
505
- f_defect_content: 'this.f_defect_content'
506
- }),
507
- f_defect_content:"CASE WHEN CHARINDEX( '\"result\":\"正常\"', tp.f_defect_content ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( tp.f_defect_content, len( tp.f_defect_content ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END",
508
- orgstrs: [{label: '全部', value: ''}],
509
- checkersid: [],
510
- checkStates:[],
511
- SafeCheckXZ: '',
512
- civil: '', //民用安检周期
513
- civilian: '', //非民用安检周期
514
- SafeCheckXZs: [{label: '全部', value: ''}, {label: '未安检', value: '未安检'}, {label: '已安检', value: '已安检'}], // 安检筛选选项
515
- SafeCheckSXs: [ {label: '全部', value: ''},{label: '是', value: '是'}, {label: '否', value: '否'}],
516
- // user_states:[{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')],
517
- IsShares: [{label: '', value: '是'}, {label: '否', value: '否'}],
518
- IsShare: '',
519
- checker: {},
520
- NoBuys: [{label: '', value: ''}, {label: '', value: ''}],
521
- criteriaShow: false,
522
- checkers: [],
523
- showcode:false,
524
- chosenOrg: {id: 0},
525
- showModal: false,
526
- checkedAll: false,
527
- checkrows: [],
528
- adjustables: [],
529
- f_plan_year: year + '',
530
- f_plan_month: moptions[new Date().getMonth()].value,
531
- f_effective_start_time: '', //计划有效起始时间
532
- f_effective_end_time: '', //计划有效结束时间
533
- checkboxModel: {},
534
- c_year_list: options,
535
- c_month_list: moptions,
536
- // areas: this.areas(),
537
- checkstatus: this.checkstatus(),
538
- usertypes: this.usertypes(),
539
- userstates: this.userstates(),
540
- sqlname: '',
541
- f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'}, {label: '有隐患', value: '有隐患'}],
542
- creatPlanWay: '',
543
- sliceArea: [],
544
- cbcs:[],
545
- cbc:[],
546
- pcds:[],
547
- checkBooks:[]
548
- }
549
- },
550
- props: {
551
- style: {
552
- type: String,
553
- default: 'col-sm-2 form-group'
554
- },
555
- style2: {
556
- type: String,
557
- default: 'col-sm-4 form-group'
558
- },
559
- checkplan: { // 传入一条安检计划信息
560
- type: Object
561
- },
562
- additemshow: {
563
- type: Boolean,
564
- default: false
565
- }
566
- },
567
- ready() {
568
- // 获取分公司信息
569
- this.model.f_defect_content=this.f_defect_content
570
- this.showcode=this.$appdata.getSingleValue('用户安检情况二维码')
571
- //this.getfengongsi()
572
- this.model.chosenOrg = {id: 0}
573
- this.model.f_filialeids = this.$login.f.f_orgids
574
- this.model.f_filiale = this.$login.f.f_fengongsi
575
- this.model.f_OrgStr = this.$login.f.orgpathstr
576
- this.Mreadibook(`('${this.$login.f.orgid}')`)
577
- this.getAllMeterBook(`('${this.$login.f.orgid}')`)
578
- document.addEventListener('keydown', this.handleEnter, true);
579
- this.getCheckBook()
580
- },
581
- methods: {
582
- handleEnter(e) {
583
- if (e.key === 'Enter') {
584
- this.$refs.paged.$refs.criteria.search()
585
- }
586
- },
587
- getCheckBook(){
588
- this.checkBooks=[]
589
- new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy`, {
590
- data: {
591
- items: 'id,f_check_book_name,f_check_book_type',
592
- tablename: 't_check_book',
593
- condition: `f_orgid = '${this.$login.f.orgid}'`,
594
- orderitem: 'id desc'
595
- }
596
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
597
- this.checkBooks.push({label: '全部', value: ''})
598
- res.data.forEach(ress => {
599
- this.checkBooks.push({
600
- label: ress.f_check_book_name,
601
- value: ress.f_check_book_name
602
- })
603
- })
604
- })
605
- },
606
-
607
- dateDiff(date1Str) {
608
- // 确保传入的date1Str是有效的字符串格式
609
- if (typeof date1Str !== 'string' || !/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(date1Str)) {
610
- throw new Error('Invalid date format. Expected format: yyyy-mm-dd hh:mm:ss');
611
- }
612
- // 将date1Str格式化为Date对象,并提取日期部分
613
- const date1 = new Date(date1Str);
614
- const year = date1.getFullYear();
615
- const month = String(date1.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要加1
616
- const day = String(date1.getDate()).padStart(2, '0');
617
- const formattedDate1 = `${year}-${month}-${day}`;
618
- // 获取当前日期,并同样格式化为yyyy-mm-dd
619
- const date2 = new Date();
620
- const currentYear = date2.getFullYear();
621
- const currentMonth = String(date2.getMonth() + 1).padStart(2, '0');
622
- const currentDay = String(date2.getDate()).padStart(2, '0');
623
- const formattedDate2 = `${currentYear}-${currentMonth}-${currentDay}`;
624
- // 将格式化后的日期字符串转换为Date对象,以便比较
625
- const formattedDate1Obj = new Date(`${formattedDate1}T00:00:00`); // 添加时间部分以确保比较准确
626
- const formattedDate2Obj = new Date(`${formattedDate2}T00:00:00`);
627
- // 计算两个日期之间的差值(以毫秒为单位),然后转换为天数
628
- const diffInMilliseconds = Math.abs(formattedDate2Obj - formattedDate1Obj);
629
- const diffInDays = Math.ceil(diffInMilliseconds / (1000 * 60 * 60 * 24));
630
- // 返回天数差
631
- return diffInDays;
632
- },
633
- //查询二维码
634
- searchInfo(val){
635
- this.dialogVisible = true
636
- //tag
637
- new HttpResetClass().load('POST','api/af-safecheck/logic/QrcodeUtil', {
638
- data: {
639
- id:val
640
- }
641
- },{resolveMsg: null, rejectMsg: null}).then(res=>{
642
- //tag
643
- //tag
644
- let imageer=new Image()
645
- imageer.src="data:image/jpg;base64,"+res.data.result
646
- document.getElementById("dd").appendChild(imageer);
647
- //tag
648
- })
649
-
650
- },
651
- //获取省市区列表
652
- getPcd(val){
653
- this.pcds = [{label:'全部',value:''}]
654
- new HttpResetClass().load("POST", `/api/af-safecheck/sql/safe_singleTable_OrderBy`,
655
- {data:{items:"*",tablename:"t_pcd",orderitem:"id",condition:`f_orgid in ${val}`}},
656
- {resolveMsg: null, rejectMsg: null}).then((pcdlist)=>{
657
- pcdlist.data.forEach((result)=>{
658
- this.pcds.push({label:result.f_pcd,value:result.f_pcd})
659
- })
660
- })
661
- },
662
- getmeterbook(val){
663
-
664
- //tag
665
- this.cbc=[]
666
- this.cbc.push({
667
- label:'全部',
668
- value:''
669
- })
670
- if (val==''){
671
-
672
- this.cbcs.forEach(res=>{
673
- this.cbc.push({
674
- label:res.f_book_name,
675
- value:res.id
676
- })
677
- })
678
- }else{
679
- this.cbcs.forEach(res=>{
680
- if (res.f_book_slice_area==val){
681
- this.cbc.push({
682
- label:res.f_book_name,
683
- value:res.id
684
- })
685
- }
686
- })
687
- }
688
- },
689
- Mreadibook(val){
690
- ////tag
691
- ////tag
692
- if (val){
693
- new HttpResetClass().load('POST',`/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data: {
694
- items: 'name',
695
- tablename: 't_zone',
696
- condition: `parentid in ${val}`,
697
- orderitem: 'id'
698
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
699
- this.sliceArea=[]
700
- this.sliceArea.push({
701
- label:'全部',
702
- value:''
703
- })
704
- res.data.forEach(ress=>{
705
- this.sliceArea.push({
706
- label:ress.name,
707
- value:ress.name
708
- })
709
- })
710
-
711
- })
712
- }
713
- },
714
- // 获取县域分公司内容
715
- getfengongsi() {
716
- let val = {
717
- source: 'this.getParentByType($organization$).getSpecialResByType($organization$)',
718
- userid: `${this.$login.f.id}`
719
- }
720
- let http = new HttpResetClass()
721
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
722
- res.data.forEach((item) => {
723
- this.orgstrs.push({label: item.name, value: item.id})
724
- })
725
- //tag
726
- })
727
- },
728
- // 县域分公司发生改变
729
- // orgstrchange(val){
730
- // if(val == undefined || val == ''){
731
- // return
732
- // }else {
733
- // this.checkersid = []
734
- // let gen = select(this,val)
735
- // return co(gen)
736
- // }
737
- // },
738
- getDefect(val) {
739
- if (val) {
740
- try {
741
- var defect = JSON.parse(val)
742
- return defect.result
743
- } catch (e) {
744
- //tag
745
- return '正常'
746
- }
747
- }
748
- return '正常'
749
- },
750
- checkerchange(val) {
751
- this.checkboxModel.f_checker = val.name
752
- this.checkboxModel.f_checker_id = val.id
753
- },
754
- search(args) {
755
- if (this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')) {
756
- this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始时间!')
757
- return
758
- }
759
- if ((args.model.f_check_start || args.model.f_check_end ) && !this.SafeCheckXZ) {
760
- this.$showMessage('如果录入 安检起始时间,需要选择 安检筛选条件!')
761
- return
762
- }
763
- /*if (this.SafeCheckXZ == '未安检') {
764
- args.condition += " and ( f_last_check_date >= '" + args.model.f_check_start + "' or f_last_check_date <= '" + args.model.f_check_end + "' or f_last_check_date is null)"
765
- } else {
766
- if (args.model.f_check_start) {
767
- args.condition += " and f_last_check_date >= '" + args.model.f_check_start + "'"
768
- }
769
- if (args.model.f_check_end) {
770
- args.condition += " and f_last_check_date <= '" + args.model.f_check_end + "'"
771
- }
772
- }*/
773
- args.condition += " and f_filialeid in " + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
774
- let con = ' f_filialeid in ' + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
775
- con += args.model.f_userinfo_code ? ` and f_userinfo_code like '%${args.model.f_userinfo_code}%'`:''
776
- /*con += args.model.f_user_name ? ` and f_user_name like '%${args.model.f_user_name}%'` : ''
777
- con += args.model.f_residential_area ? ` and f_residential_area like '%${args.model.f_residential_area}%'` : ''
778
- con += args.model.f_address ? ` and f_address like '%${args.model.f_address}%'` : ''
779
- con += args.model.f_usertype ? ` and f_check_type = '${args.model.f_usertype}'` : ''*/
780
- if (this.SafeCheckXZ) {
781
- con += ` and f_offsite_time >= '${args.model.f_check_start}' and f_offsite_time <= '${args.model.f_check_end}' `
782
- if (this.SafeCheckXZ == '未安检'){
783
- args.condition += ' and ruhuid is null'
784
- }else{
785
- args.condition += ' and ruhuid is not null'
786
- }
787
- }
788
- let states = ` (`
789
- if (this.checkStates.length > 0 ){
790
- for (let i = 0; i < this.checkStates.length; i++) {
791
- if (this.checkStates[i]){
792
- states += `'${this.checkStates[i]}',`
793
- }else {
794
- states = ''
795
- break
796
- }
797
- }
798
- if (states){
799
- states=states.substring(0,states.length-1)
800
- states += `) `
801
- args.condition += ` and f_last_check_state in ${states}`
802
- }
803
- }else {
804
- states = ''
805
- }
806
- if(args.model.f_check_date){
807
- const daysBefore = Number(args.model.f_check_date);
808
- if ( daysBefore > 0) {
809
- // 获取当前日期
810
- const now = new Date();
811
- // 计算三天前的日期
812
- const threeDaysBefore = new Date(now.getTime() - (daysBefore * 24 * 60 * 60 * 1000));
813
- // 如果需要格式化日期,可以使用Date对象的方法
814
- var formattedDate = threeDaysBefore.toISOString().split('T')[0];
815
- args.condition += ` and f_last_check_date<='${formattedDate} 23:59:59'`;
816
- } else {
817
- console.error('f_check_date不是一个有效的正整数');
818
- }
819
- }
820
- if (args.model.f_check_version){
821
- con+= ` and f_check_version = '${args.model.f_check_version}'`
822
- }
823
- con += args.model.f_checker_id ? ` and f_checker_name in ${args.model.f_checker_id}` : ' and 1=1'
824
- let condition3 = `1=1`
825
- if (args.model.is_no_ruhu){
826
- if (args.model.is_no_ruhu == '否'){
827
- condition3 += ` and f_entry_status = '入户' and f_offsite_time >= DATEADD(YEAR, -2, GETDATE()) AND f_offsite_time < GETDATE()`
828
- args.condition += ` and aj_count > 0`
829
- }else {
830
- condition3 += ` and f_entry_status = '入户' and f_offsite_time >= DATEADD(YEAR, -2, GETDATE()) AND f_offsite_time < GETDATE()`
831
- args.condition += ` and aj_count is null`
832
- }
833
- }
834
-
835
- let condition = {
836
- condition1: args.condition,
837
- condition2: con,
838
- condition3: condition3
839
- }
840
- this.searchData.condition = condition
841
- return this.model.search(condition, args.model)
842
- },
843
- checkstatus() {
844
- return this.$appdata.getParam('安检状态') ? [{
845
- label: '全部',
846
- value: ''
847
- }, ...this.$appdata.getParam('安检状态')] : [{label: '全部', value: ''}]
848
- },
849
- usertypes() {
850
- return this.$appdata.getParam('用户类型') ? [{
851
- label: '全部',
852
- value: ''
853
- }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
854
- },
855
- userstates() {
856
- return this.$appdata.getParam('用户状态') ? [{
857
- label: '全部',
858
- value: ''
859
- }, ...this.$appdata.getParam('用户状态')] : [{label: '全部', value: ''}]
860
- },
861
- hiddenr() {
862
- this.$parent.showItem = !this.$parent.showItem
863
- },
864
- hidden() {
865
- this.criteriaShow = !this.criteriaShow
866
- },
867
- confirm() {
868
- if (!this.checkboxModel.f_plan_name) {
869
- this.$showMessage('请填写安检计划名称!')
870
- return
871
- }
872
- // if(this.f_effective_start_time == ''){
873
- // this.$showMessage('请选择有效起始日期!')
874
- // return
875
- // }
876
- // if(this.f_effective_end_time == ''){
877
- // this.$showMessage('请选择有效结束日期!')
878
- // return
879
- // }
880
- if (this.IsShare == '否') {
881
- if (!this.checkboxModel.f_checker_id) {
882
- this.$showMessage('请选择安检员!')
883
- return
884
- }
885
- }
886
- let gen = saveGen(this)
887
- return co(gen)
888
- },
889
- changeStates() {
890
- if (this.checkedAll) {//实现反选/
891
- this.checkrows = [];
892
- for (let i = 0; i < c.rows.length; i++) {
893
- this.$set('$refs.paged.model.rows[' + i + '].checked', false)
894
- }
895
- } else {//实现全选
896
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
897
- this.$set('$refs.paged.model.rows[' + i + '].checked', true)
898
- }
899
- let _this = this
900
- let condition = this.$refs.paged.$refs.criteria.condition
901
- let url = this.model.url
902
- this.$resetpost(`${url}?pageSize=9999999`, {
903
- data: {
904
- condition: condition,
905
- groupitem: '',
906
- orderitem: 'f_residential_area',
907
- f_usertype: this.model.f_usertype,
908
- f_filialeids: this.model.f_filialeids,
909
- month: this.model.month,
910
- safeCycle: this.model.safeCycle,
911
- f_checktime_start: this.model.f_checktime_start,
912
- f_checktime_end: this.model.f_checktime_end,
913
- SafeCheckSX: this.model.SafeCheckSX,
914
- f_last_check_state: this.model.f_last_check_state
915
- },
916
- }, {resolveMsg: null, rejectMsg: null}, -1).then(
917
- (respanse) => {
918
- if (respanse.data.length >= 5000) {
919
- this.$showMessage("数据量太大,请重新选择")
920
- } else {
921
- _this.checkrows = []
922
- for (let j = 0; j < respanse.data.length; j++) {
923
- _this.checkrows.push(respanse.data[j])
924
- }
925
- //tag;
926
- }
927
- })
928
- }
929
- },
930
- addChecked(item) {
931
- //tag;
932
- if (!item.checked) {
933
- this.checkrows.push(item);
934
- //tag;
935
- } else {
936
- for (let i = 0; i < this.checkrows.length; i++) {
937
- if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
938
- this.checkrows.splice(i, 1)
939
- }
940
- }
941
- }
942
- },
943
- ToshowModal() {
944
- this.creatPlanWay = 'single'
945
- if (this.checkrows.length > 0) {
946
- this.showModal = true
947
- } else {
948
- this.$showMessage("请选择需要安检的用户!")
949
- }
950
- },
951
- FiltrationPlan() {
952
- if (this.model.rows.length == 0) {
953
- this.$showMessage("暂无可生成的计划!")
954
- return
955
- }
956
- this.creatPlanWay = 'filtration'
957
- this.showModal = true
958
- },
959
- AllPlan() {
960
- if (this.model.rows.length == 0) {
961
- this.$showMessage("暂无可生成的计划!")
962
- return
963
- }
964
- this.creatPlanWay = 'all'
965
- this.showModal = true
966
- },
967
- cancel() {
968
- this.showModal = false
969
- },
970
- /*areas() {
971
- let rs = []
972
- for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
973
- let temp = {
974
- label: this.$login.f.f_allArea[i].label,
975
- value: this.$login.f.f_allArea[i].label
976
- }
977
- rs.push(temp)
978
- }
979
- return [{label: '全部', value: ''}, ...rs]
980
- },*/
981
- initAdjustables() {
982
- //tag
983
- let arr = []
984
- let filter = this.$login.f.f_orgids
985
- this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
986
- let temp = {}
987
- temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
988
- temp.value = `${item.value.id}`
989
- arr.push(temp)
990
- })
991
- this.adjustables = [{label: '全部', value: ''}, ...arr]
992
- },
993
- getAllMeterBook(val){
994
- ////tag
995
- ////tag
996
- this.cbcs=[]
997
- if (val){
998
- new HttpResetClass().load('POST',`/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data: {
999
- items: 'f_book_name,f_book_slice_area,id',
1000
- tablename: 't_meter_book',
1001
- condition: `f_filiale_id in ${val}`,
1002
- orderitem: 'id'
1003
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
1004
- res.data.forEach(ress=>{
1005
- this.cbcs.push({
1006
- id:ress.id,
1007
- f_book_name:ress.f_book_name,
1008
- f_book_slice_area:ress.f_book_slice_area
1009
- })
1010
- })
1011
- this.cbc=[]
1012
- this.cbc.push({
1013
- label:'全部',
1014
- value:''
1015
- })
1016
- this.cbcs.forEach(res=>{
1017
- this.cbc.push({
1018
- label:res.f_book_name,
1019
- value:res.id
1020
- })
1021
- })
1022
- })
1023
- }
1024
- },
1025
- getRes(obj) {
1026
- this.model.f_filialeids = this.$login.convertToIn(obj.resids);
1027
- this.Mreadibook(this.model.f_filialeids)
1028
- this.getAllMeterBook(this.model.f_filialeids)
1029
- this.getPcd(this.model.f_filialeids)
1030
- }
1031
- },
1032
-
1033
- watch: {
1034
- 'model.f_usertype'(val) {
1035
- if (val == '民用') {
1036
- this.model.safeCycle = this.civil
1037
- } else if (val == '非民用') {
1038
- this.model.safeCycle = this.civilian
1039
- }
1040
- },
1041
- 'model.SafeCheckXZ'(val) {
1042
- this.model.SafeCheckSC = ''
1043
- if (val == '已安检') {
1044
- this.model.SafeCheckCQ = ''
1045
- this.model.SafeCheckSX = {
1046
- f_check_end: '', // 安检时间 查询起始条件
1047
- f_check_start: ''// 安检时间 查询终止条件
1048
- }
1049
- } else {
1050
- // 当使用筛选条件时,清空不需要的条件选项
1051
- this.model.f_issue_start = ''
1052
- this.model.f_issue_end = ''
1053
- this.$refs.paged.$refs.criteria.model.f_check_start = ''
1054
- this.$refs.paged.$refs.criteria.model.f_check_end = ''
1055
- this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
1056
- this.model.month = ''
1057
- if (val == '应安检') {
1058
- this.model.SafeCheckSC = ''
1059
-
1060
- this.model.f_issue_start = Util.toStartDateString()
1061
- this.model.f_issue_end = Util.toStandardDateString()
1062
- }
1063
- // this.model.f_checktime_start = ''
1064
- // this.model.f_checktime_end = ''
1065
- }
1066
- },
1067
- 'model.SafeCheckSC'(val) {
1068
- if (val == '') {
1069
- this.model.f_issue_start = ''
1070
- this.model.f_issue_end = ''
1071
- }
1072
- },
1073
- // 'checker'(val){
1074
- // //tag
1075
- // if(val){
1076
- // this.checkboxModel.f_checker = this.checker[0].name
1077
- // this.checkboxModel.f_checker_id = this.checker[0].id
1078
- // }
1079
- // },
1080
- 'model.rows'() {
1081
- // if (!this.checkedAll) {//实现反选/
1082
- // this.checkrows = [];
1083
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1084
- var k = false
1085
- for (let j = 0; j < this.checkrows.length; j++) {
1086
- if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
1087
- this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1088
- k = true
1089
- continue
1090
- }
1091
- }
1092
- if (!k) {
1093
- this.$set('$refs.paged.model.rows[' + i + '].checked', false)
1094
- }
1095
- }
1096
- // } else {//实现全选
1097
- // // this.checkboxModel = {};
1098
- // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1099
- // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1100
- // }
1101
- // }
1102
- }
1103
- },
1104
- computed: {
1105
- selected() {
1106
- return this.$refs.paged.$refs.grid.selected
1107
- }
1108
- }
1109
- }
1110
- </script>
1111
- <style scoped>
1112
- .newcolor {
1113
- color: red;
1114
- }
1115
-
1116
- .table th {
1117
- background-color: #f2f6fa;
1118
- color: black;
1119
- }
1120
- </style>
1
+ <template>
2
+ <div class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
7
+ <div :class="$parent.$parent.style">
8
+ <label class="font_normal_body">用户编号</label>
9
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
10
+ id="f_userinfo_code"
11
+ placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
12
+ </div>
13
+ <div :class="$parent.$parent.style">
14
+ <label class="font_normal_body">用户姓名</label>
15
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name" id="f_user_name"
16
+ placeholder="用户姓名" condition="f_user_name like '%{}%'">
17
+ </div>
18
+ <div :class="$parent.$parent.style">
19
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
20
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
21
+ id="f_residential_area"
22
+ placeholder="小区" condition="f_residential_area like '%{}%'">
23
+ </div>
24
+ <div :class="$parent.$parent.style">
25
+ <label class="font_normal_body">地&emsp;&emsp;址</label>
26
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_address" id="f_address"
27
+ placeholder="地址" condition="f_address like '%{}%'">
28
+ </div>
29
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
30
+ <export-excel :data="$parent.$parent.searchData"
31
+ :field="$parent.$parent.excelHeaders"
32
+ :choose-col="true"
33
+ sqlurl="api/af-safecheck/logic/exportfile" sql-name="根据安检员查询用户档案"
34
+ template-name='用户安检情况'></export-excel>
35
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
36
+ <div style="float: right" class="button_spacing"
37
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
38
+ @click="$parent.$parent.hiddenr()"></div>
39
+ <div style="float: right" class="button_spacing"
40
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
41
+ @click="$parent.$parent.hidden()">
42
+
43
+ </div>
44
+ </div>
45
+
46
+
47
+ </div>
48
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
49
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
50
+ <label class="font_normal_body">用户类型</label>
51
+ <v-select id="f_usertype"
52
+ placeholder='用户类型'
53
+ class="select select_list"
54
+ :value.sync="model.f_usertype"
55
+ :value-single="true"
56
+ :options='$parent.$parent.usertypes'
57
+ v-model="model.f_usertype"
58
+ condition="f_user_type = '{}'"
59
+ close-on-select clear-button></v-select>
60
+ </div>
61
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
62
+
63
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
64
+ <label class="font_normal_body" style="color: red;">安检筛选</label>
65
+ <v-select
66
+ placeholder='安检筛选'
67
+ :value-single="true"
68
+ class="select select_list"
69
+ :value.sync="$parent.$parent.SafeCheckXZ"
70
+ :options='$parent.$parent.SafeCheckXZs'
71
+ v-model="$parent.$parent.SafeCheckXZ"
72
+ close-on-select clear-button></v-select>
73
+ </div>
74
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
75
+ <label class="font_normal_body">安检起始</label>
76
+ <datepicker
77
+ :value.sync="model.f_check_start"
78
+ placeholder='最后安检时间起始'
79
+ style="width: 60%"
80
+ :format="'yyyy-MM-dd 00:00:00'"
81
+ :show-rest-button="reset"
82
+ v-model="model.f_check_start">
83
+ </datepicker>
84
+ </div>
85
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
86
+ <label class="font_normal_body">安检结束</label>
87
+ <datepicker
88
+ :value.sync="model.f_check_end"
89
+ placeholder='最后安检时间结束'
90
+ style="width: 60%"
91
+ :format="'yyyy-MM-dd 23:59:59'"
92
+ :show-rest-button="reset"
93
+ v-model="model.f_check_end">
94
+ </datepicker>
95
+ </div>
96
+
97
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
98
+ <label class="font_normal_body">安检状态</label>
99
+ <v-select id="f_entry"
100
+ placeholder='安检状态'
101
+ :multiple="true"
102
+ class="select select_list"
103
+ :value.sync="$parent.$parent.checkStates"
104
+ :options='$parent.$parent.checkstatus'
105
+ ></v-select>
106
+ </div>
107
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
108
+ <label class="font_normal_body">隐患情况</label>
109
+ <v-select
110
+ placeholder='隐患情况'
111
+ class="select select_list"
112
+ :value-single="true"
113
+ v-model='model.f_check_result'
114
+ :value.sync="model.f_check_result"
115
+ :options='$parent.$parent.f_check_results'
116
+ condition="f_defect_content like '%{}%'"
117
+ close-on-select clear-button></v-select>
118
+ </div>
119
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
120
+ </div>
121
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
122
+
123
+ <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
124
+ <role-selector-safe
125
+ role-name="安检员"
126
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
127
+ @re-res="$parent.$parent.getRes"
128
+ :value.sync="model.f_checker_id"
129
+ v-model="model.f_checker_id"
130
+ :value-multiple="true"
131
+ condition=" f_checker_name in {}">
132
+ </role-selector-safe>
133
+ </div>
134
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
135
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
136
+ <v-select class="select_list select"
137
+ placeholder='片区/管理站' style="width: 60%"
138
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
139
+ :options='$parent.$parent.sliceArea'
140
+ filer-key="name"
141
+ close-on-select clear-button
142
+ condition="f_slice_area='{}'"
143
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
144
+ :value-single="true">
145
+ </v-select>
146
+ </div>
147
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
148
+ <label class="font_normal_body">安检册</label>
149
+ <v-select class="select_list select"
150
+ placeholder='安检册' style="width: 60%"
151
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
152
+ :options='$parent.$parent.checkBooks'
153
+ filer-key="name"
154
+ close-on-select clear-button
155
+ condition="f_check_book_name like '%{}%'"
156
+ :value-single="true">
157
+ </v-select>
158
+ </div>
159
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
160
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
161
+ <v-select class="select_list select"
162
+ placeholder='请选择' style="width: 60%"
163
+ :value.sync="model.f_pcd" v-model="model.f_pcd"
164
+ :options='$parent.$parent.pcds'
165
+ filer-key="name"
166
+ close-on-select clear-button
167
+ condition="f_pcd='{}'"
168
+ :value-single="true">
169
+ </v-select>
170
+ </div>
171
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
172
+ <label class="font_normal_body">用户状态</label>
173
+ <v-select class="select_list select"
174
+ placeholder='用户状态' style="width: 60%"
175
+ :value.sync="model.f_user_state" v-model="model.f_user_state"
176
+ :options='$parent.$parent.userstates'
177
+ close-on-select clear-button
178
+ condition="f_user_state = '{}'"
179
+ :value-single="true">
180
+ </v-select>
181
+ </div>
182
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
183
+ <label class="font_normal_body">年份</label>
184
+ <input type="number" class="input_search" v-model="$parent.$parent.f_year"
185
+ style="width: 60%" placeholder="年份">
186
+ </div>
187
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
188
+ <label class="font_normal_body">{{$parent.$parent.f_year}}年未入户</label>
189
+ <v-select class="select_list select"
190
+ :placeholder="$parent.$parent.f_year + '年未入户'" style="width: 60%"
191
+ :value.sync="model.is_no_ruhu" v-model="model.is_no_ruhu"
192
+ :options='$parent.$parent.SafeCheckSXs'
193
+ close-on-select clear-button
194
+ :value-single="true">
195
+ </v-select>
196
+ </div>
197
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
198
+ <label class="font_normal_body">距上次安检天数</label>
199
+ <input type="number" class="input_search" v-model="model.f_check_date"
200
+ style="width: 60%" placeholder="距上次安检天数" >
201
+ </div>
202
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
203
+ <label class="font_normal_body">到访不遇次数</label>
204
+ <input type="number" class="input_search" v-model="model.f_check_version"
205
+ style="width: 60%" placeholder="到访不遇次数">
206
+ </div>
207
+ </div>
208
+
209
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
210
+ <div :class="$parent.$parent.style">
211
+ <label class="font_normal_body">用户编号</label>
212
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
213
+
214
+ placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
215
+ </div>
216
+ <div :class="$parent.$parent.style">
217
+ <label class="font_normal_body">用户姓名</label>
218
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name"
219
+ placeholder="用户姓名" condition="f_user_name like '%{}%'">
220
+ </div>
221
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
222
+ <export-excel :data="$parent.$parent.searchData"
223
+ :field="$parent.$parent.excelHeaders"
224
+ sqlurl="api/af-safecheck/logic/exportfile" sql-name="根据安检员查询用户档案"
225
+ template-name='用户安检情况'></export-excel>
226
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
227
+ <div style="float: right" class="button_spacing"
228
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
229
+ @click="$parent.$parent.hiddenr()"></div>
230
+ <div style="float: right" class="button_spacing"
231
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
232
+ @click="$parent.$parent.hidden()">
233
+
234
+ </div>
235
+ </div>
236
+
237
+ </div>
238
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
239
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
240
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
241
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
242
+
243
+ placeholder="小区" condition="f_residential_area like '%{}%'">
244
+ </div>
245
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
246
+ <label class="font_normal_body">地&emsp;&emsp;址</label>
247
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_address"
248
+
249
+ placeholder="地址" condition="f_address like '%{}%'">
250
+ </div>
251
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
252
+ <label class="font_normal_body">用户类型</label>
253
+ <v-select
254
+ placeholder='用户类型'
255
+ class="select select_list"
256
+
257
+ :value.sync="model.f_usertype"
258
+ :value-single="true"
259
+ :options='$parent.$parent.usertypes'
260
+ v-model="model.f_usertype"
261
+ condition="f_user_type = '{}'"
262
+ close-on-select clear-button></v-select>
263
+ </div>
264
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
265
+
266
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
267
+ <label class="font_normal_body" style="color: red;">安检筛选</label>
268
+ <v-select
269
+ placeholder='安检筛选'
270
+ :value-single="true"
271
+
272
+ class="select select_list"
273
+ :value.sync="$parent.$parent.SafeCheckXZ"
274
+ :options='$parent.$parent.SafeCheckXZs'
275
+ v-model="$parent.$parent.SafeCheckXZ"
276
+ close-on-select clear-button></v-select>
277
+ </div>
278
+
279
+ </div>
280
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
281
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
282
+ <label class="font_normal_body">安检起始</label>
283
+ <datepicker
284
+ :value.sync="model.f_check_start"
285
+ placeholder='最后安检时间起始'
286
+ :disabled-days-of-week="[]"
287
+ style="width: 60%"
288
+ :format="'yyyy-MM-dd'"
289
+ :show-rest-button="reset"
290
+ v-model="model.f_check_start">
291
+ </datepicker>
292
+ </div>
293
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
294
+ <label class="font_normal_body">安检结束</label>
295
+ <datepicker
296
+ :value.sync="model.f_check_end"
297
+ placeholder='最后安检时间结束'
298
+ style="width: 60%"
299
+ :disabled-days-of-week="[]"
300
+ :format="'yyyy-MM-dd'"
301
+ :show-rest-button="reset"
302
+ v-model="model.f_check_end">
303
+ </datepicker>
304
+ </div>
305
+
306
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
307
+ <label class="font_normal_body">安检状态</label>
308
+ <v-select
309
+ placeholder='安检状态'
310
+ class="select select_list"
311
+ :value.sync="$parent.$parent.checkStates"
312
+ :options='$parent.$parent.checkstatus'
313
+ :multiple="true"
314
+ close-on-select clear-button></v-select>
315
+ </div>
316
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
317
+ <label class="font_normal_body">隐患情况</label>
318
+ <v-select
319
+ placeholder='隐患情况'
320
+ class="select select_list"
321
+ :value-single="true"
322
+ v-model='model.f_check_result'
323
+ :value.sync="model.f_check_result"
324
+ :options='$parent.$parent.f_check_results'
325
+ condition="f_defect_content like '%{}%'"
326
+ close-on-select clear-button></v-select>
327
+ </div>
328
+ </div>
329
+ <!--<div class="row" v-show="$parent.$parent.$parent.showItem">
330
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
331
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
332
+ <right-tree @re-res="$parent.$parent.getRes" :initresid="$parent.$parent.$login.f.orgid">
333
+ </right-tree>
334
+ </div>
335
+
336
+ </div>-->
337
+ </div>
338
+ </criteria>
339
+ <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
340
+ <template partial='head'>
341
+ <tr>
342
+ <th>
343
+ <nobr>用户编号</nobr>
344
+ </th>
345
+ <th>
346
+ <nobr>用户名称</nobr>
347
+ </th>
348
+ <th>
349
+ <nobr>已安检天数</nobr>
350
+ </th>
351
+ <th>
352
+ <nobr>用户电话</nobr>
353
+ </th>
354
+ <th>
355
+ <nobr>用户表号</nobr>
356
+ </th>
357
+ <!-- <th>-->
358
+ <!-- <nobr>气表品牌</nobr>-->
359
+ <!-- </th>-->
360
+ <th>
361
+ <nobr>用户类型</nobr>
362
+ </th>
363
+ <!-- <th>-->
364
+ <!-- <nobr>壁挂炉</nobr>-->
365
+ <!-- </th>-->
366
+ <!-- <th>-->
367
+ <!-- <nobr>灶具</nobr>-->
368
+ <!-- </th>-->
369
+ <th>
370
+ <nobr>小区名称</nobr>
371
+ </th>
372
+ <th style="padding: 0 40px">
373
+ <nobr>地址</nobr>
374
+ </th>
375
+ <th>
376
+ <nobr>安检员</nobr>
377
+ </th>
378
+ <!-- <th>-->
379
+ <!-- <nobr>安检员备注</nobr>-->
380
+ <!-- </th>-->
381
+ <th>
382
+ <nobr>安检日期</nobr>
383
+ </th>
384
+ <th>
385
+ <nobr>安检状态</nobr>
386
+ </th>
387
+ <th>
388
+ <nobr>安检结果</nobr>
389
+ </th>
390
+ <th>
391
+ <nobr>建档日期</nobr>
392
+ </th>
393
+ <th>
394
+ <nobr>通气日期</nobr>
395
+ </th>
396
+ <th>
397
+ <nobr>最后一次入户时间</nobr>
398
+ </th>
399
+ <th v-show="$parent.$parent.$parent.showcode">
400
+ <nobr>二维码</nobr>
401
+ </th>
402
+ </tr>
403
+ </template>
404
+ <template partial='body'>
405
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_userinfo_code }}</td>
406
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_name }}</td>
407
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{$parent.$parent.$parent.dateDiff(row.f_last_check_date)}}</td>
408
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_phone }}</td>
409
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_meternumber}}</td>
410
+ <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_meter_brand}}</td>-->
411
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_user_type }}</td>
412
+ <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_hasfurnace }}</td>-->
413
+ <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_haskitchen }}</td>-->
414
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_residential_area }}</td>
415
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_address }}</td>
416
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_checker_name }}</td>
417
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_date }}</td>
418
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_state }}</td>
419
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">
420
+ {{row.f_last_check_state!='入户' ? '': (row.f_last_check_result == '无隐患' ? '无问题' : row.f_last_check_result) }}
421
+ </td>
422
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_createfile_date }}</td>
423
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_gas_date }}</td>
424
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.last_ruhu_f_offsite_time }}</td>
425
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center" v-show="$parent.$parent.$parent.showcode">
426
+ <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.searchInfo(row.f_userinfo_code)' >点击</button>
427
+ </td>
428
+ </template>
429
+ </data-grid>
430
+ </criteria-paged>
431
+ <modal :show.sync="dialogVisible" style="text-align: center" destroyOnClose={true} v-ref:modal v-if="dialogVisible">
432
+ <div slot="modal-header" class="modal-header">
433
+ <h4 class="modal-title">
434
+ 二维码
435
+ </h4>
436
+ </div>
437
+ <div slot="modal-body" class="modal-body" >
438
+ <div id="dd" ></div>
439
+ </div>
440
+ <div slot="modal-footer" class="modal-footer">
441
+ <print-element class="btn btn-success width-80" id="dd" styleid='style1' top='40' left='60' width='100%' height='100%' v-ref:printelement>打印</print-element>
442
+ <button type="button" class="btn btn-success width-80" @click="dialogVisible = false">确认</button>
443
+ <button type="button" class="btn btn-success width-80" @click="dialogVisible = false" >取消</button>
444
+ </div>
445
+ </modal>
446
+ </div>
447
+
448
+ </template>
449
+
450
+ <script>
451
+ import {PagedList} from 'vue-client'
452
+ import {HttpResetClass} from 'vue-client'
453
+ import co from 'co'
454
+ import * as Util from '../../../components/Util'
455
+ import Vue from 'vue'
456
+
457
+ // let select = function * (self,userid) {
458
+ // let http = new HttpResetClass()
459
+ // let getGasman = yield http.load('POST','/rs/search', {
460
+ // source: 'this.getChildByName($安检员$).getUsers()',
461
+ // userid: userid
462
+ // }, {resolveMsg: null, rejectMsg: null})
463
+ // //tag
464
+ // getGasman.data.forEach((checker)=>{
465
+ // self.checkersid.push({label:checker.name,value:checker.id})
466
+ // })
467
+ // self.checkersid.push({label:'全部',value:''})
468
+ // }
469
+
470
+
471
+ export default {
472
+ title: '用户安检情况',
473
+ data() {
474
+ let options = []
475
+ let year = (new Date()).getFullYear()
476
+ for (let i = year; i <= year + 3; i++)
477
+ options.push({label: i + '', value: i + ''})
478
+ let moptions = []
479
+ for (let i = 1; i <= 12; i++)
480
+ moptions.push({label: i + '', value: i + ''})
481
+
482
+ return {
483
+ dialogVisible: false,
484
+ searchData: {
485
+ condition: '1=1',
486
+ orderitem: "f_last_check_date",
487
+ timetype: "dd",
488
+ f_defect_content: "CASE WHEN CHARINDEX( '\"result\":\"正常\"', tp.f_defect_content ) > 0 THEN '正常' ELSE replace(replace(replace( replace( RIGHT ( tp.f_defect_content, len( tp.f_defect_content ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END"
489
+ },
490
+ excelHeaders: {
491
+ //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
492
+
493
+ 'f_userinfo_code': '用户编号',
494
+ 'f_user_name': '用户名称',
495
+ 'f_user_phone': '用户电话',
496
+ 'f_meternumber': '用户表号',
497
+ 'f_user_type': '用户类型',
498
+ 'f_checker_name': '安检员',
499
+ 'f_residential_area': '小区名称',
500
+ 'f_address': '地址',
501
+ 'f_last_check_date': '安检日期',
502
+ 'f_last_check_state': '安检状态',
503
+ 'f_last_check_result': '安检结果',
504
+ 'f_createfile_date': '建档日期',
505
+ 'f_gas_date': '通气日期'
506
+ },
507
+ model: new PagedList('api/af-safecheck/sql/根据安检员查询用户档案', 20, {
508
+ orderitem: "'f_last_check_date'",
509
+ timetype: "'dd'",
510
+ f_defect_content: 'this.f_defect_content'
511
+ }),
512
+ f_defect_content:"CASE WHEN CHARINDEX( '\"result\":\"正常\"', tp.f_defect_content ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( tp.f_defect_content, len( tp.f_defect_content ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END",
513
+ orgstrs: [{label: '全部', value: ''}],
514
+ checkersid: [],
515
+ checkStates:[],
516
+ f_year:2,
517
+ SafeCheckXZ: '',
518
+ civil: '', //民用安检周期
519
+ civilian: '', //非民用安检周期
520
+ SafeCheckXZs: [{label: '全部', value: ''}, {label: '未安检', value: '未安检'}, {label: '已安检', value: '已安检'}], // 安检筛选选项
521
+ SafeCheckSXs: [ {label: '全部', value: ''},{label: '是', value: '是'}, {label: '否', value: '否'}],
522
+ // user_states:[{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')],
523
+ IsShares: [{label: '是', value: '是'}, {label: '否', value: '否'}],
524
+ IsShare: '否',
525
+ checker: {},
526
+ NoBuys: [{label: '是', value: '是'}, {label: '否', value: '否'}],
527
+ criteriaShow: false,
528
+ checkers: [],
529
+ showcode:false,
530
+ chosenOrg: {id: 0},
531
+ showModal: false,
532
+ checkedAll: false,
533
+ checkrows: [],
534
+ adjustables: [],
535
+ f_plan_year: year + '',
536
+ f_plan_month: moptions[new Date().getMonth()].value,
537
+ f_effective_start_time: '', //计划有效起始时间
538
+ f_effective_end_time: '', //计划有效结束时间
539
+ checkboxModel: {},
540
+ c_year_list: options,
541
+ c_month_list: moptions,
542
+ // areas: this.areas(),
543
+ checkstatus: this.checkstatus(),
544
+ usertypes: this.usertypes(),
545
+ userstates: this.userstates(),
546
+ sqlname: '',
547
+ f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'}, {label: '有隐患', value: '有隐患'}],
548
+ creatPlanWay: '',
549
+ sliceArea: [],
550
+ cbcs:[],
551
+ cbc:[],
552
+ pcds:[],
553
+ checkBooks:[]
554
+ }
555
+ },
556
+ props: {
557
+ style: {
558
+ type: String,
559
+ default: 'col-sm-2 form-group'
560
+ },
561
+ style2: {
562
+ type: String,
563
+ default: 'col-sm-4 form-group'
564
+ },
565
+ checkplan: { // 传入一条安检计划信息
566
+ type: Object
567
+ },
568
+ additemshow: {
569
+ type: Boolean,
570
+ default: false
571
+ }
572
+ },
573
+ ready() {
574
+ // 获取分公司信息
575
+ this.model.f_defect_content=this.f_defect_content
576
+ this.showcode=this.$appdata.getSingleValue('用户安检情况二维码')
577
+ //this.getfengongsi()
578
+ this.model.chosenOrg = {id: 0}
579
+ this.model.f_filialeids = this.$login.f.f_orgids
580
+ this.model.f_filiale = this.$login.f.f_fengongsi
581
+ this.model.f_OrgStr = this.$login.f.orgpathstr
582
+ this.Mreadibook(`('${this.$login.f.orgid}')`)
583
+ this.getAllMeterBook(`('${this.$login.f.orgid}')`)
584
+ document.addEventListener('keydown', this.handleEnter, true);
585
+ this.getCheckBook()
586
+ },
587
+ methods: {
588
+ handleEnter(e) {
589
+ if (e.key === 'Enter') {
590
+ this.$refs.paged.$refs.criteria.search()
591
+ }
592
+ },
593
+ getCheckBook(){
594
+ this.checkBooks=[]
595
+ new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy`, {
596
+ data: {
597
+ items: 'id,f_check_book_name,f_check_book_type',
598
+ tablename: 't_check_book',
599
+ condition: `f_orgid = '${this.$login.f.orgid}'`,
600
+ orderitem: 'id desc'
601
+ }
602
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
603
+ this.checkBooks.push({label: '全部', value: ''})
604
+ res.data.forEach(ress => {
605
+ this.checkBooks.push({
606
+ label: ress.f_check_book_name,
607
+ value: ress.f_check_book_name
608
+ })
609
+ })
610
+ })
611
+ },
612
+
613
+ dateDiff(date1Str) {
614
+ // 确保传入的date1Str是有效的字符串格式
615
+ if (typeof date1Str !== 'string' || !/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(date1Str)) {
616
+ throw new Error('Invalid date format. Expected format: yyyy-mm-dd hh:mm:ss');
617
+ }
618
+ // 将date1Str格式化为Date对象,并提取日期部分
619
+ const date1 = new Date(date1Str);
620
+ const year = date1.getFullYear();
621
+ const month = String(date1.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要加1
622
+ const day = String(date1.getDate()).padStart(2, '0');
623
+ const formattedDate1 = `${year}-${month}-${day}`;
624
+ // 获取当前日期,并同样格式化为yyyy-mm-dd
625
+ const date2 = new Date();
626
+ const currentYear = date2.getFullYear();
627
+ const currentMonth = String(date2.getMonth() + 1).padStart(2, '0');
628
+ const currentDay = String(date2.getDate()).padStart(2, '0');
629
+ const formattedDate2 = `${currentYear}-${currentMonth}-${currentDay}`;
630
+ // 将格式化后的日期字符串转换为Date对象,以便比较
631
+ const formattedDate1Obj = new Date(`${formattedDate1}T00:00:00`); // 添加时间部分以确保比较准确
632
+ const formattedDate2Obj = new Date(`${formattedDate2}T00:00:00`);
633
+ // 计算两个日期之间的差值(以毫秒为单位),然后转换为天数
634
+ const diffInMilliseconds = Math.abs(formattedDate2Obj - formattedDate1Obj);
635
+ const diffInDays = Math.ceil(diffInMilliseconds / (1000 * 60 * 60 * 24));
636
+ // 返回天数差
637
+ return diffInDays;
638
+ },
639
+ //查询二维码
640
+ searchInfo(val){
641
+ this.dialogVisible = true
642
+ //tag
643
+ new HttpResetClass().load('POST','api/af-safecheck/logic/QrcodeUtil', {
644
+ data: {
645
+ id:val
646
+ }
647
+ },{resolveMsg: null, rejectMsg: null}).then(res=>{
648
+ //tag
649
+ //tag
650
+ let imageer=new Image()
651
+ imageer.src="data:image/jpg;base64,"+res.data.result
652
+ document.getElementById("dd").appendChild(imageer);
653
+ //tag
654
+ })
655
+
656
+ },
657
+ //获取省市区列表
658
+ getPcd(val){
659
+ this.pcds = [{label:'全部',value:''}]
660
+ new HttpResetClass().load("POST", `/api/af-safecheck/sql/safe_singleTable_OrderBy`,
661
+ {data:{items:"*",tablename:"t_pcd",orderitem:"id",condition:`f_orgid in ${val}`}},
662
+ {resolveMsg: null, rejectMsg: null}).then((pcdlist)=>{
663
+ pcdlist.data.forEach((result)=>{
664
+ this.pcds.push({label:result.f_pcd,value:result.f_pcd})
665
+ })
666
+ })
667
+ },
668
+ getmeterbook(val){
669
+
670
+ //tag
671
+ this.cbc=[]
672
+ this.cbc.push({
673
+ label:'全部',
674
+ value:''
675
+ })
676
+ if (val==''){
677
+
678
+ this.cbcs.forEach(res=>{
679
+ this.cbc.push({
680
+ label:res.f_book_name,
681
+ value:res.id
682
+ })
683
+ })
684
+ }else{
685
+ this.cbcs.forEach(res=>{
686
+ if (res.f_book_slice_area==val){
687
+ this.cbc.push({
688
+ label:res.f_book_name,
689
+ value:res.id
690
+ })
691
+ }
692
+ })
693
+ }
694
+ },
695
+ Mreadibook(val){
696
+ ////tag
697
+ ////tag
698
+ if (val){
699
+ new HttpResetClass().load('POST',`/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data: {
700
+ items: 'name',
701
+ tablename: 't_zone',
702
+ condition: `parentid in ${val}`,
703
+ orderitem: 'id'
704
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
705
+ this.sliceArea=[]
706
+ this.sliceArea.push({
707
+ label:'全部',
708
+ value:''
709
+ })
710
+ res.data.forEach(ress=>{
711
+ this.sliceArea.push({
712
+ label:ress.name,
713
+ value:ress.name
714
+ })
715
+ })
716
+
717
+ })
718
+ }
719
+ },
720
+ // 获取县域分公司内容
721
+ getfengongsi() {
722
+ let val = {
723
+ source: 'this.getParentByType($organization$).getSpecialResByType($organization$)',
724
+ userid: `${this.$login.f.id}`
725
+ }
726
+ let http = new HttpResetClass()
727
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
728
+ res.data.forEach((item) => {
729
+ this.orgstrs.push({label: item.name, value: item.id})
730
+ })
731
+ //tag
732
+ })
733
+ },
734
+ // 县域分公司发生改变
735
+ // orgstrchange(val){
736
+ // if(val == undefined || val == ''){
737
+ // return
738
+ // }else {
739
+ // this.checkersid = []
740
+ // let gen = select(this,val)
741
+ // return co(gen)
742
+ // }
743
+ // },
744
+ getDefect(val) {
745
+ if (val) {
746
+ try {
747
+ var defect = JSON.parse(val)
748
+ return defect.result
749
+ } catch (e) {
750
+ //tag
751
+ return '正常'
752
+ }
753
+ }
754
+ return '正常'
755
+ },
756
+ checkerchange(val) {
757
+ this.checkboxModel.f_checker = val.name
758
+ this.checkboxModel.f_checker_id = val.id
759
+ },
760
+ search(args) {
761
+ if (this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')) {
762
+ this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始时间!')
763
+ return
764
+ }
765
+ if ((args.model.f_check_start || args.model.f_check_end ) && !this.SafeCheckXZ) {
766
+ this.$showMessage('如果录入 安检起始时间,需要选择 安检筛选条件!')
767
+ return
768
+ }
769
+ /*if (this.SafeCheckXZ == '未安检') {
770
+ args.condition += " and ( f_last_check_date >= '" + args.model.f_check_start + "' or f_last_check_date <= '" + args.model.f_check_end + "' or f_last_check_date is null)"
771
+ } else {
772
+ if (args.model.f_check_start) {
773
+ args.condition += " and f_last_check_date >= '" + args.model.f_check_start + "'"
774
+ }
775
+ if (args.model.f_check_end) {
776
+ args.condition += " and f_last_check_date <= '" + args.model.f_check_end + "'"
777
+ }
778
+ }*/
779
+ args.condition += " and f_filialeid in " + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
780
+ let con = ' f_filialeid in ' + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
781
+ con += args.model.f_userinfo_code ? ` and f_userinfo_code like '%${args.model.f_userinfo_code}%'`:''
782
+ /*con += args.model.f_user_name ? ` and f_user_name like '%${args.model.f_user_name}%'` : ''
783
+ con += args.model.f_residential_area ? ` and f_residential_area like '%${args.model.f_residential_area}%'` : ''
784
+ con += args.model.f_address ? ` and f_address like '%${args.model.f_address}%'` : ''
785
+ con += args.model.f_usertype ? ` and f_check_type = '${args.model.f_usertype}'` : ''*/
786
+ if (this.SafeCheckXZ) {
787
+ con += ` and f_offsite_time >= '${args.model.f_check_start}' and f_offsite_time <= '${args.model.f_check_end}' `
788
+ if (this.SafeCheckXZ == '未安检'){
789
+ args.condition += ' and ruhuid is null'
790
+ }else{
791
+ args.condition += ' and ruhuid is not null'
792
+ }
793
+ }
794
+ let states = ` (`
795
+ if (this.checkStates.length > 0 ){
796
+ for (let i = 0; i < this.checkStates.length; i++) {
797
+ if (this.checkStates[i]){
798
+ states += `'${this.checkStates[i]}',`
799
+ }else {
800
+ states = ''
801
+ break
802
+ }
803
+ }
804
+ if (states){
805
+ states=states.substring(0,states.length-1)
806
+ states += `) `
807
+ args.condition += ` and f_last_check_state in ${states}`
808
+ }
809
+ }else {
810
+ states = ''
811
+ }
812
+ if(args.model.f_check_date){
813
+ const daysBefore = Number(args.model.f_check_date);
814
+ if ( daysBefore > 0) {
815
+ // 获取当前日期
816
+ const now = new Date();
817
+ // 计算三天前的日期
818
+ const threeDaysBefore = new Date(now.getTime() - (daysBefore * 24 * 60 * 60 * 1000));
819
+ // 如果需要格式化日期,可以使用Date对象的方法
820
+ var formattedDate = threeDaysBefore.toISOString().split('T')[0];
821
+ args.condition += ` and f_last_check_date<='${formattedDate} 23:59:59'`;
822
+ } else {
823
+ console.error('f_check_date不是一个有效的正整数');
824
+ }
825
+ }
826
+ if (args.model.f_check_version){
827
+ con+= ` and f_check_version = '${args.model.f_check_version}'`
828
+ }
829
+ con += args.model.f_checker_id ? ` and f_checker_name in ${args.model.f_checker_id}` : ' and 1=1'
830
+ let condition3 = `1=1`
831
+ if (args.model.is_no_ruhu){
832
+ if (!this.f_year){
833
+ this.$showMessage('选择未入户时,需选择指定年限')
834
+ return
835
+ }
836
+ if (this.f_year <=0){
837
+ this.$showMessage('年份输入错误')
838
+ return
839
+ }
840
+ if (args.model.is_no_ruhu == '否'){
841
+ condition3 += ` and f_entry_status = '入户' and f_offsite_time >= DATEADD(YEAR, -${this.f_year}, GETDATE()) AND f_offsite_time < GETDATE()`
842
+ args.condition += ` and aj_count > 0`
843
+ }else {
844
+ condition3 += ` and f_entry_status = '入户' and f_offsite_time >= DATEADD(YEAR, -${this.f_year}, GETDATE()) AND f_offsite_time < GETDATE()`
845
+ args.condition += ` and aj_count is null`
846
+ }
847
+ }
848
+
849
+ let condition = {
850
+ condition1: args.condition,
851
+ condition2: con,
852
+ condition3: condition3
853
+ }
854
+ this.searchData.condition = condition
855
+ return this.model.search(condition, args.model)
856
+ },
857
+ checkstatus() {
858
+ return this.$appdata.getParam('安检状态') ? [{
859
+ label: '全部',
860
+ value: ''
861
+ }, ...this.$appdata.getParam('安检状态')] : [{label: '全部', value: ''}]
862
+ },
863
+ usertypes() {
864
+ return this.$appdata.getParam('用户类型') ? [{
865
+ label: '全部',
866
+ value: ''
867
+ }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
868
+ },
869
+ userstates() {
870
+ return this.$appdata.getParam('用户状态') ? [{
871
+ label: '全部',
872
+ value: ''
873
+ }, ...this.$appdata.getParam('用户状态')] : [{label: '全部', value: ''}]
874
+ },
875
+ hiddenr() {
876
+ this.$parent.showItem = !this.$parent.showItem
877
+ },
878
+ hidden() {
879
+ this.criteriaShow = !this.criteriaShow
880
+ },
881
+ confirm() {
882
+ if (!this.checkboxModel.f_plan_name) {
883
+ this.$showMessage('请填写安检计划名称!')
884
+ return
885
+ }
886
+ // if(this.f_effective_start_time == ''){
887
+ // this.$showMessage('请选择有效起始日期!')
888
+ // return
889
+ // }
890
+ // if(this.f_effective_end_time == ''){
891
+ // this.$showMessage('请选择有效结束日期!')
892
+ // return
893
+ // }
894
+ if (this.IsShare == '否') {
895
+ if (!this.checkboxModel.f_checker_id) {
896
+ this.$showMessage('请选择安检员!')
897
+ return
898
+ }
899
+ }
900
+ let gen = saveGen(this)
901
+ return co(gen)
902
+ },
903
+ changeStates() {
904
+ if (this.checkedAll) {//实现反选/
905
+ this.checkrows = [];
906
+ for (let i = 0; i < c.rows.length; i++) {
907
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
908
+ }
909
+ } else {//实现全选
910
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
911
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
912
+ }
913
+ let _this = this
914
+ let condition = this.$refs.paged.$refs.criteria.condition
915
+ let url = this.model.url
916
+ this.$resetpost(`${url}?pageSize=9999999`, {
917
+ data: {
918
+ condition: condition,
919
+ groupitem: '',
920
+ orderitem: 'f_residential_area',
921
+ f_usertype: this.model.f_usertype,
922
+ f_filialeids: this.model.f_filialeids,
923
+ month: this.model.month,
924
+ safeCycle: this.model.safeCycle,
925
+ f_checktime_start: this.model.f_checktime_start,
926
+ f_checktime_end: this.model.f_checktime_end,
927
+ SafeCheckSX: this.model.SafeCheckSX,
928
+ f_last_check_state: this.model.f_last_check_state
929
+ },
930
+ }, {resolveMsg: null, rejectMsg: null}, -1).then(
931
+ (respanse) => {
932
+ if (respanse.data.length >= 5000) {
933
+ this.$showMessage("数据量太大,请重新选择")
934
+ } else {
935
+ _this.checkrows = []
936
+ for (let j = 0; j < respanse.data.length; j++) {
937
+ _this.checkrows.push(respanse.data[j])
938
+ }
939
+ //tag;
940
+ }
941
+ })
942
+ }
943
+ },
944
+ addChecked(item) {
945
+ //tag;
946
+ if (!item.checked) {
947
+ this.checkrows.push(item);
948
+ //tag;
949
+ } else {
950
+ for (let i = 0; i < this.checkrows.length; i++) {
951
+ if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
952
+ this.checkrows.splice(i, 1)
953
+ }
954
+ }
955
+ }
956
+ },
957
+ ToshowModal() {
958
+ this.creatPlanWay = 'single'
959
+ if (this.checkrows.length > 0) {
960
+ this.showModal = true
961
+ } else {
962
+ this.$showMessage("请选择需要安检的用户!")
963
+ }
964
+ },
965
+ FiltrationPlan() {
966
+ if (this.model.rows.length == 0) {
967
+ this.$showMessage("暂无可生成的计划!")
968
+ return
969
+ }
970
+ this.creatPlanWay = 'filtration'
971
+ this.showModal = true
972
+ },
973
+ AllPlan() {
974
+ if (this.model.rows.length == 0) {
975
+ this.$showMessage("暂无可生成的计划!")
976
+ return
977
+ }
978
+ this.creatPlanWay = 'all'
979
+ this.showModal = true
980
+ },
981
+ cancel() {
982
+ this.showModal = false
983
+ },
984
+ /*areas() {
985
+ let rs = []
986
+ for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
987
+ let temp = {
988
+ label: this.$login.f.f_allArea[i].label,
989
+ value: this.$login.f.f_allArea[i].label
990
+ }
991
+ rs.push(temp)
992
+ }
993
+ return [{label: '全部', value: ''}, ...rs]
994
+ },*/
995
+ initAdjustables() {
996
+ //tag
997
+ let arr = []
998
+ let filter = this.$login.f.f_orgids
999
+ this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
1000
+ let temp = {}
1001
+ temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
1002
+ temp.value = `${item.value.id}`
1003
+ arr.push(temp)
1004
+ })
1005
+ this.adjustables = [{label: '全部', value: ''}, ...arr]
1006
+ },
1007
+ getAllMeterBook(val){
1008
+ ////tag
1009
+ ////tag
1010
+ this.cbcs=[]
1011
+ if (val){
1012
+ new HttpResetClass().load('POST',`/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data: {
1013
+ items: 'f_book_name,f_book_slice_area,id',
1014
+ tablename: 't_meter_book',
1015
+ condition: `f_filiale_id in ${val}`,
1016
+ orderitem: 'id'
1017
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
1018
+ res.data.forEach(ress=>{
1019
+ this.cbcs.push({
1020
+ id:ress.id,
1021
+ f_book_name:ress.f_book_name,
1022
+ f_book_slice_area:ress.f_book_slice_area
1023
+ })
1024
+ })
1025
+ this.cbc=[]
1026
+ this.cbc.push({
1027
+ label:'全部',
1028
+ value:''
1029
+ })
1030
+ this.cbcs.forEach(res=>{
1031
+ this.cbc.push({
1032
+ label:res.f_book_name,
1033
+ value:res.id
1034
+ })
1035
+ })
1036
+ })
1037
+ }
1038
+ },
1039
+ getRes(obj) {
1040
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids);
1041
+ this.Mreadibook(this.model.f_filialeids)
1042
+ this.getAllMeterBook(this.model.f_filialeids)
1043
+ this.getPcd(this.model.f_filialeids)
1044
+ }
1045
+ },
1046
+
1047
+ watch: {
1048
+ 'model.f_usertype'(val) {
1049
+ if (val == '民用') {
1050
+ this.model.safeCycle = this.civil
1051
+ } else if (val == '非民用') {
1052
+ this.model.safeCycle = this.civilian
1053
+ }
1054
+ },
1055
+ 'model.SafeCheckXZ'(val) {
1056
+ this.model.SafeCheckSC = ''
1057
+ if (val == '已安检') {
1058
+ this.model.SafeCheckCQ = ''
1059
+ this.model.SafeCheckSX = {
1060
+ f_check_end: '', // 安检时间 查询起始条件
1061
+ f_check_start: ''// 安检时间 查询终止条件
1062
+ }
1063
+ } else {
1064
+ // 当使用筛选条件时,清空不需要的条件选项
1065
+ this.model.f_issue_start = ''
1066
+ this.model.f_issue_end = ''
1067
+ this.$refs.paged.$refs.criteria.model.f_check_start = ''
1068
+ this.$refs.paged.$refs.criteria.model.f_check_end = ''
1069
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
1070
+ this.model.month = ''
1071
+ if (val == '应安检') {
1072
+ this.model.SafeCheckSC = '否'
1073
+
1074
+ this.model.f_issue_start = Util.toStartDateString()
1075
+ this.model.f_issue_end = Util.toStandardDateString()
1076
+ }
1077
+ // this.model.f_checktime_start = ''
1078
+ // this.model.f_checktime_end = ''
1079
+ }
1080
+ },
1081
+ 'model.SafeCheckSC'(val) {
1082
+ if (val == '') {
1083
+ this.model.f_issue_start = ''
1084
+ this.model.f_issue_end = ''
1085
+ }
1086
+ },
1087
+ // 'checker'(val){
1088
+ // //tag
1089
+ // if(val){
1090
+ // this.checkboxModel.f_checker = this.checker[0].name
1091
+ // this.checkboxModel.f_checker_id = this.checker[0].id
1092
+ // }
1093
+ // },
1094
+ 'model.rows'() {
1095
+ // if (!this.checkedAll) {//实现反选/
1096
+ // this.checkrows = [];
1097
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1098
+ var k = false
1099
+ for (let j = 0; j < this.checkrows.length; j++) {
1100
+ if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
1101
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1102
+ k = true
1103
+ continue
1104
+ }
1105
+ }
1106
+ if (!k) {
1107
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
1108
+ }
1109
+ }
1110
+ // } else {//实现全选
1111
+ // // this.checkboxModel = {};
1112
+ // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1113
+ // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1114
+ // }
1115
+ // }
1116
+ }
1117
+ },
1118
+ computed: {
1119
+ selected() {
1120
+ return this.$refs.paged.$refs.grid.selected
1121
+ }
1122
+ }
1123
+ }
1124
+ </script>
1125
+ <style scoped>
1126
+ .newcolor {
1127
+ color: red;
1128
+ }
1129
+
1130
+ .table th {
1131
+ background-color: #f2f6fa;
1132
+ color: black;
1133
+ }
1134
+ </style>