safecheck-client 4.0.1-3 → 4.0.1-4

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 (263) hide show
  1. package/.babelrc +5 -5
  2. package/.editorconfig +9 -9
  3. package/android.html +18 -18
  4. package/config/dev.env.js +6 -6
  5. package/config/index.js +38 -38
  6. package/config/prod.env.js +3 -3
  7. package/config/test.env.js +6 -6
  8. package/docs/AppBase.md +22 -22
  9. package/docs/Busy.md +14 -14
  10. package/docs/CriteriaPaged.md +47 -47
  11. package/docs/DataGrid.md +54 -54
  12. package/docs/DataModel.md +22 -22
  13. package/docs/Dynamic.md +42 -42
  14. package/docs/GetParams.md +11 -11
  15. package/docs/HttpBusy.md +13 -13
  16. package/docs/HttpStore.md +29 -29
  17. package/docs/MessageBox.md +28 -28
  18. package/docs/PagedList.md +29 -29
  19. package/docs/Pager.md +21 -21
  20. package/docs/Project.md +23 -23
  21. package/docs/Route.md +105 -105
  22. package/docs/SafetyCheck/AdjustPlan.md +13 -13
  23. package/docs/SafetyCheck/CheckerPlan.md +12 -12
  24. package/docs/Task.md +46 -46
  25. package/docs/TreeList.md +28 -28
  26. package/docs/TreeMixin.md +18 -18
  27. package/docs/all.md +10 -10
  28. package/docs/list.md +42 -42
  29. package/docs/partial.md +75 -75
  30. package/docs/selector.md +82 -82
  31. package/docs//345/274/200/345/217/221/346/226/207/346/241/243/Snippets.md +28 -28
  32. 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
  33. 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
  34. 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
  35. package/docs//347/225/214/351/235/242/345/210/266/344/275/234/350/247/204/350/214/203.md +54 -54
  36. package/examples/AddressList/App.vue +13 -13
  37. package/examples/AddressList/index.html +11 -11
  38. package/examples/DispatchList/App.vue +10 -10
  39. package/examples/DispatchList/BaseTree.vue +13 -13
  40. package/examples/DispatchList/Init.vue +22 -22
  41. package/examples/DispatchList/Test.vue +20 -20
  42. package/examples/DispatchList/index.html +11 -11
  43. package/examples/DispatchList/main.js +18 -18
  44. package/home.html +16 -16
  45. package/package.json +1 -1
  46. package/publish.bat +7 -7
  47. package/release.bat +5 -5
  48. package/src/Widget.vue +13 -13
  49. package/src/android-bootstrap/fonts/glyphicons-halflings-regular.svg +287 -287
  50. package/src/android-bootstrap/less/.csscomb.json +304 -304
  51. package/src/android-bootstrap/less/.csslintrc +19 -19
  52. package/src/android-bootstrap/less/alerts.less +73 -73
  53. package/src/android-bootstrap/less/badges.less +66 -66
  54. package/src/android-bootstrap/less/bootstrap.less +56 -56
  55. package/src/android-bootstrap/less/breadcrumbs.less +26 -26
  56. package/src/android-bootstrap/less/button-groups.less +247 -247
  57. package/src/android-bootstrap/less/buttons.less +173 -173
  58. package/src/android-bootstrap/less/carousel.less +269 -269
  59. package/src/android-bootstrap/less/close.less +34 -34
  60. package/src/android-bootstrap/less/code.less +69 -69
  61. package/src/android-bootstrap/less/component-animations.less +33 -33
  62. package/src/android-bootstrap/less/grid.less +84 -84
  63. package/src/android-bootstrap/less/input-groups.less +167 -167
  64. package/src/android-bootstrap/less/jumbotron.less +52 -52
  65. package/src/android-bootstrap/less/labels.less +64 -64
  66. package/src/android-bootstrap/less/list-group.less +141 -141
  67. package/src/android-bootstrap/less/media.less +66 -66
  68. package/src/android-bootstrap/less/mixins/alerts.less +14 -14
  69. package/src/android-bootstrap/less/mixins/background-variant.less +9 -9
  70. package/src/android-bootstrap/less/mixins/border-radius.less +18 -18
  71. package/src/android-bootstrap/less/mixins/buttons.less +69 -69
  72. package/src/android-bootstrap/less/mixins/center-block.less +7 -7
  73. package/src/android-bootstrap/less/mixins/clearfix.less +22 -22
  74. package/src/android-bootstrap/less/mixins/forms.less +90 -90
  75. package/src/android-bootstrap/less/mixins/gradients.less +59 -59
  76. package/src/android-bootstrap/less/mixins/grid-framework.less +92 -92
  77. package/src/android-bootstrap/less/mixins/grid.less +122 -122
  78. package/src/android-bootstrap/less/mixins/hide-text.less +21 -21
  79. package/src/android-bootstrap/less/mixins/image.less +33 -33
  80. package/src/android-bootstrap/less/mixins/labels.less +12 -12
  81. package/src/android-bootstrap/less/mixins/list-group.less +30 -30
  82. package/src/android-bootstrap/less/mixins/nav-divider.less +10 -10
  83. package/src/android-bootstrap/less/mixins/nav-vertical-align.less +9 -9
  84. package/src/android-bootstrap/less/mixins/opacity.less +8 -8
  85. package/src/android-bootstrap/less/mixins/pagination.less +24 -24
  86. package/src/android-bootstrap/less/mixins/panels.less +24 -24
  87. package/src/android-bootstrap/less/mixins/progress-bar.less +10 -10
  88. package/src/android-bootstrap/less/mixins/reset-filter.less +8 -8
  89. package/src/android-bootstrap/less/mixins/reset-text.less +18 -18
  90. package/src/android-bootstrap/less/mixins/resize.less +6 -6
  91. package/src/android-bootstrap/less/mixins/responsive-visibility.less +15 -15
  92. package/src/android-bootstrap/less/mixins/size.less +10 -10
  93. package/src/android-bootstrap/less/mixins/tab-focus.less +9 -9
  94. package/src/android-bootstrap/less/mixins/table-row.less +44 -44
  95. package/src/android-bootstrap/less/mixins/text-emphasis.less +9 -9
  96. package/src/android-bootstrap/less/mixins/text-overflow.less +8 -8
  97. package/src/android-bootstrap/less/mixins/vendor-prefixes.less +227 -227
  98. package/src/android-bootstrap/less/mixins.less +40 -40
  99. package/src/android-bootstrap/less/modals.less +151 -151
  100. package/src/android-bootstrap/less/navbar.less +660 -660
  101. package/src/android-bootstrap/less/navs.less +290 -290
  102. package/src/android-bootstrap/less/normalize.less +424 -424
  103. package/src/android-bootstrap/less/pager.less +76 -76
  104. package/src/android-bootstrap/less/pagination.less +89 -89
  105. package/src/android-bootstrap/less/panels.less +274 -274
  106. package/src/android-bootstrap/less/popovers.less +131 -131
  107. package/src/android-bootstrap/less/print.less +101 -101
  108. package/src/android-bootstrap/less/progress-bars.less +87 -87
  109. package/src/android-bootstrap/less/responsive-embed.less +35 -35
  110. package/src/android-bootstrap/less/responsive-utilities.less +194 -194
  111. package/src/android-bootstrap/less/scaffolding.less +161 -161
  112. package/src/android-bootstrap/less/tables.less +262 -262
  113. package/src/android-bootstrap/less/theme.less +291 -291
  114. package/src/android-bootstrap/less/thumbnails.less +36 -36
  115. package/src/android-bootstrap/less/tooltip.less +102 -102
  116. package/src/android-bootstrap/less/type.less +303 -303
  117. package/src/android-bootstrap/less/utilities.less +55 -55
  118. package/src/android-bootstrap/less/variables.less +896 -896
  119. package/src/android-bootstrap/less/wells.less +29 -29
  120. package/src/bootstrap/less/.csscomb.json +304 -304
  121. package/src/bootstrap/less/.csslintrc +19 -19
  122. package/src/bootstrap/less/alerts.less +73 -73
  123. package/src/bootstrap/less/badges.less +66 -66
  124. package/src/bootstrap/less/breadcrumbs.less +26 -26
  125. package/src/bootstrap/less/button-groups.less +247 -247
  126. package/src/bootstrap/less/buttons.less +172 -172
  127. package/src/bootstrap/less/carousel.less +269 -269
  128. package/src/bootstrap/less/close.less +34 -34
  129. package/src/bootstrap/less/code.less +69 -69
  130. package/src/bootstrap/less/component-animations.less +33 -33
  131. package/src/bootstrap/less/dropdowns.less +216 -216
  132. package/src/bootstrap/less/grid.less +84 -84
  133. package/src/bootstrap/less/input-groups.less +167 -167
  134. package/src/bootstrap/less/jumbotron.less +52 -52
  135. package/src/bootstrap/less/labels.less +64 -64
  136. package/src/bootstrap/less/list-group.less +141 -141
  137. package/src/bootstrap/less/media.less +66 -66
  138. package/src/bootstrap/less/mixins/alerts.less +14 -14
  139. package/src/bootstrap/less/mixins/background-variant.less +9 -9
  140. package/src/bootstrap/less/mixins/border-radius.less +18 -18
  141. package/src/bootstrap/less/mixins/buttons.less +69 -69
  142. package/src/bootstrap/less/mixins/center-block.less +7 -7
  143. package/src/bootstrap/less/mixins/clearfix.less +22 -22
  144. package/src/bootstrap/less/mixins/forms.less +90 -90
  145. package/src/bootstrap/less/mixins/gradients.less +59 -59
  146. package/src/bootstrap/less/mixins/grid-framework.less +92 -92
  147. package/src/bootstrap/less/mixins/grid.less +122 -122
  148. package/src/bootstrap/less/mixins/hide-text.less +21 -21
  149. package/src/bootstrap/less/mixins/image.less +33 -33
  150. package/src/bootstrap/less/mixins/labels.less +12 -12
  151. package/src/bootstrap/less/mixins/list-group.less +30 -30
  152. package/src/bootstrap/less/mixins/nav-divider.less +10 -10
  153. package/src/bootstrap/less/mixins/nav-vertical-align.less +9 -9
  154. package/src/bootstrap/less/mixins/opacity.less +8 -8
  155. package/src/bootstrap/less/mixins/pagination.less +24 -24
  156. package/src/bootstrap/less/mixins/panels.less +24 -24
  157. package/src/bootstrap/less/mixins/progress-bar.less +10 -10
  158. package/src/bootstrap/less/mixins/reset-filter.less +8 -8
  159. package/src/bootstrap/less/mixins/reset-text.less +18 -18
  160. package/src/bootstrap/less/mixins/resize.less +6 -6
  161. package/src/bootstrap/less/mixins/responsive-visibility.less +15 -15
  162. package/src/bootstrap/less/mixins/size.less +10 -10
  163. package/src/bootstrap/less/mixins/tab-focus.less +9 -9
  164. package/src/bootstrap/less/mixins/table-row.less +44 -44
  165. package/src/bootstrap/less/mixins/text-emphasis.less +9 -9
  166. package/src/bootstrap/less/mixins/text-overflow.less +8 -8
  167. package/src/bootstrap/less/mixins/vendor-prefixes.less +227 -227
  168. package/src/bootstrap/less/mixins.less +40 -40
  169. package/src/bootstrap/less/modals.less +151 -151
  170. package/src/bootstrap/less/navbar.less +660 -660
  171. package/src/bootstrap/less/normalize.less +424 -424
  172. package/src/bootstrap/less/pagination.less +89 -89
  173. package/src/bootstrap/less/panels.less +275 -275
  174. package/src/bootstrap/less/popovers.less +131 -131
  175. package/src/bootstrap/less/print.less +101 -101
  176. package/src/bootstrap/less/progress-bars.less +87 -87
  177. package/src/bootstrap/less/responsive-embed.less +35 -35
  178. package/src/bootstrap/less/responsive-utilities.less +194 -194
  179. package/src/bootstrap/less/scaffolding.less +161 -161
  180. package/src/bootstrap/less/theme.less +291 -291
  181. package/src/bootstrap/less/thumbnails.less +36 -36
  182. package/src/bootstrap/less/tooltip.less +102 -102
  183. package/src/bootstrap/less/type.less +303 -303
  184. package/src/bootstrap/less/utilities.less +55 -55
  185. package/src/bootstrap/less/wells.less +29 -29
  186. package/src/components/FileUpload.vue +696 -696
  187. package/src/components/Hello.vue +39 -39
  188. package/src/components/LeftTree.vue +27 -27
  189. package/src/components/NewDefectList/DefectListNew.vue +663 -660
  190. package/src/components/NewDefectList/DefectPaperNew.vue +1184 -1184
  191. package/src/components/Util/SafecheckUpload.vue +281 -281
  192. package/src/components/android/AttendanceTally.vue +116 -116
  193. package/src/components/android/Blank.vue +10 -10
  194. package/src/components/android/CheckUnplanPage.vue +56 -56
  195. package/src/components/android/Checker.vue +12 -12
  196. package/src/components/android/CheckerAnnual.vue +81 -81
  197. package/src/components/android/CheckerAvarta.vue +82 -82
  198. package/src/components/android/EquipmentInspection.vue +348 -348
  199. package/src/components/android/FootprintMap.vue +120 -120
  200. package/src/components/android/HiddentroubleInvestigation.vue +192 -192
  201. package/src/components/android/MasterMain.vue +77 -77
  202. package/src/components/android/Menu.vue +132 -132
  203. package/src/components/android/PaperAlarm.vue +85 -85
  204. package/src/components/android/PaperDeviceNoncivil.vue +214 -214
  205. package/src/components/android/PhoneUpUserinfo.vue +1249 -1249
  206. package/src/components/android/PlumberAnnual.vue +83 -83
  207. package/src/components/android/PlumberAnnualDetail.vue +65 -65
  208. package/src/components/android/PlumberMonthly.vue +84 -84
  209. package/src/components/android/PostMap.vue +83 -83
  210. package/src/components/android/QueryCheckHistory.vue +122 -122
  211. package/src/components/android/QueryCheckHistoryItem.vue +62 -62
  212. package/src/components/android/RepairMain.vue +60 -60
  213. package/src/components/android/Repairman.vue +12 -12
  214. package/src/components/android/SafeRightTree.vue +218 -218
  215. package/src/components/android/SafecheckDevices.vue +1340 -1340
  216. package/src/components/android/StationMaster.vue +12 -12
  217. package/src/components/defects/DefectModal.vue +101 -101
  218. package/src/components/defects/DevicesAndItem.vue +39 -39
  219. package/src/components/issueplan/IssuePlanMain.vue +23 -23
  220. package/src/components/notice/NoticeForm.vue +100 -100
  221. package/src/components/notice/NoticeIssue.vue +20 -20
  222. package/src/components/paper/PaperList.vue +797 -797
  223. package/src/components/paper/PicViewer.vue +18 -18
  224. package/src/components/pc/CheckBook.vue +303 -303
  225. package/src/components/pc/CheckBookArea.vue +146 -146
  226. package/src/components/pc/CheckBookCompany.vue +144 -144
  227. package/src/components/pc/CheckBookDetails.vue +161 -161
  228. package/src/components/pc/CheckBookEntry.vue +60 -60
  229. package/src/components/pc/CheckBookSearchArea.vue +560 -560
  230. package/src/components/pc/CheckBookSearchUnit.vue +229 -229
  231. package/src/components/pc/CheckBookSearchUser.vue +659 -659
  232. package/src/components/pc/CheckBookSearchUserList.vue +674 -674
  233. package/src/components/pc/CheckBookUser.vue +333 -333
  234. package/src/components/pc/PaperDefectMain.vue +880 -880
  235. package/src/components/phonestate/MonthlyTraffic.vue +66 -66
  236. package/src/components/phonestate/MonthlyTrafficRouter.vue +15 -15
  237. package/src/components/phonestate/PostMap.vue +82 -82
  238. package/src/components/querycheckpaper/PaperItem.vue +59 -59
  239. package/src/components/userfile/MeterFile.vue +145 -145
  240. package/src/components/userfile/MeterModify.vue +46 -46
  241. package/src/components/userfileaudit/MeterAuditFile.vue +129 -129
  242. package/src/filiale/meihekou/android/CheckPlanList.vue +198 -198
  243. package/src/filiale/meihekou/android/CheckPlanListArea.vue +190 -190
  244. package/src/filiale/meihekou/android/CurrentCreate.vue +1038 -1038
  245. package/src/filiale/meihekou/android/PaperFeedback.vue +1542 -1542
  246. package/src/filiale/meihekou/android/SafecheckDevices.vue +1340 -1340
  247. package/src/filiale/meihekou/android/SafecheckOrderV.vue +2433 -2433
  248. package/src/filiale/meihekou/android.js +22 -22
  249. package/src/filiale/meihekou/pc/NewCheckpaper.vue +2027 -2027
  250. package/src/filiale/yunchengminsheng/android/SafecheckOrderV.vue +2850 -2850
  251. package/src/main.js +33 -33
  252. package/src/plugins/LoadData.js +10 -10
  253. package/src/plugins/LoadParams.js +24 -24
  254. package/src/stores/wxconfig.js +10 -10
  255. package/src/utils/getNowDate.js +33 -33
  256. package/test/e2e/custom-assertions/elementCount.js +26 -26
  257. package/test/e2e/nightwatch.conf.js +40 -40
  258. package/test/e2e/runner.js +30 -30
  259. package/test/e2e/specs/test.js +13 -13
  260. package/test/unit/.eslintrc +5 -5
  261. package/test/unit/TestUtil.js +62 -62
  262. package/test/unit/context.html +20 -20
  263. package/test/unit/index.js +13 -13
@@ -1,560 +1,560 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged>
5
- <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row">
8
-
9
- <div class="col-sm-3 form-group" style="margin-bottom: 0px">
10
- <label class="font_normal_body">公&emsp;&emsp;司</label>
11
- <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="ta.f_orgid in {}"></right-tree-safe>
12
- </div>
13
- <div class="form-group col-sm-3">
14
- <label class="font_normal_body">小区名称</label>
15
- <input type="text" class="input_search" v-model="model.f_residential_area"
16
- style="width: 60%" placeholder="小区名称" condition="f_residential_area like '%{}%'">
17
- </div>
18
- <div class="form-group col-sm-3">
19
- <label class="font_normal_body">是否在册</label>
20
- <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
21
- :value-single="true" style="width: 60%"
22
- class="select_list select"
23
- @change="$parent.$parent.changeState"
24
- :options='$parent.$parent.isCheckBook' placeholder='有无所属安检册'
25
- close-on-select
26
- condition="{}"></v-select>
27
- </div>
28
- <div class="form-group col-sm-3">
29
- <button class="button_spacing button_search" @click="search()">查询</button>
30
- <!-- <div style="float: right" class="button_spacing"
31
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
32
- @click="$parent.$parent.hidden()"></div>-->
33
- </div>
34
-
35
-
36
-
37
-
38
- </div>
39
- </div>
40
- </criteria>
41
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
42
- <template partial='head'>
43
- <tr @dblclick.stop="">
44
- <th>
45
- <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
46
- </th>
47
- <th>
48
- <nobr>区/县</nobr>
49
- </th>
50
- <th>
51
- <nobr>街道/乡镇</nobr>
52
- </th>
53
- <th>
54
- <nobr>片区/行政村</nobr>
55
- </th>
56
- <th>
57
- <nobr>小区/自然村</nobr>
58
- </th>
59
- <th>
60
- <nobr>所属安检册</nobr>
61
- </th>
62
- </tr>
63
- </template>
64
- <template partial='body'>
65
- <td style="text-align: center">
66
- <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
67
- @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
68
- </nobr>
69
- </td>
70
- <td style="text-align: center">{{ row.f_pcd }}</td>
71
- <td style="text-align: center">{{ row.f_street }}</td>
72
- <td style="text-align: center">{{ row.f_community_name }}</td>
73
- <td style="text-align: center">{{ row.f_residential_area }}</td>
74
- <td style="text-align: center">{{ row.f_check_book_name }}</td>
75
- </template>
76
- </data-grid>
77
- </criteria-paged>
78
- </div>
79
- <modal :show.sync="showModal" :backdrop="false">
80
- <div slot="modal-header" class="modal-header">
81
- <h4 class="modal-title">
82
- 创建安检册
83
- </h4>
84
- </div>
85
- <div slot="modal-body" class="modal-body">
86
- <div v-if="true">
87
- <div class="row" style="margin-top: 10px">
88
-
89
- <div class="col-sm-12 form-group" style="margin: 0">
90
- <role-selector-safe
91
- @re-res="getRes"
92
- role-name="安检员"
93
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
94
- :value.sync="checkBook.f_checker_name"
95
- v-model="checkBook.f_checker_name">
96
- </role-selector-safe>
97
- </div>
98
- <div class="form-group col-sm-6" style="margin-top: 20px">
99
- <label class="font_normal_body">安检册名</label>
100
- <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
101
- style="width: 60%" >
102
- </div>
103
- <div class="form-group col-sm-6" style="margin-top: 20px">
104
- <label class="font_normal_body">执行日期</label>
105
- <datepicker
106
- :value.sync="checkBook.f_run_date"
107
- style="width: 60%"
108
- :format="'yyyy-MM-dd'"
109
- v-model="checkBook.f_run_date"
110
- >
111
- </datepicker>
112
- </div>
113
- <div class="form-group col-sm-6" style="margin-top: 20px">
114
- <label class="font_normal_body">执行周期</label>
115
- <input type="number" class="input_search" v-model="checkBook.f_around_time"
116
- style="width: 60%" >
117
- </div>
118
- <div class="form-group col-sm-6" style="margin-top: 20px">
119
- <label class="font_normal_body">周期单位</label>
120
- <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
121
- :value-single="true" style="width: 60%"
122
- class="select_list select"
123
- :options='aroundUnit' placeholder=''
124
- close-on-select></v-select>
125
- </div>
126
- </div>
127
- </div>
128
- </div>
129
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
130
- <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
131
- <button class="button_search" @click="cancel">取消</button>
132
- </div>
133
- </modal>
134
- <modal :show.sync="showModal2" :backdrop="false">
135
- <div slot="modal-header" class="modal-header">
136
- <h4 class="modal-title">
137
- 添加用户
138
- </h4>
139
- </div>
140
- <div slot="modal-body" class="modal-body">
141
- <div v-if="true">
142
- <div class="row" style="margin-top: 10px">
143
- <div class="form-group col-sm-12" style="margin-top: 20px">
144
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
145
- <v-select :value.sync="selectBook" v-model='selectBook'
146
- :value-single="true" style="width: 80%"
147
- class="select_list select"
148
- :options='checkBooks' placeholder=''
149
- close-on-select></v-select>
150
- </div>
151
- </div>
152
- </div>
153
- </div>
154
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
155
- <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
156
- <button class="button_search" @click="cancel2">取消</button>
157
- </div>
158
- </modal>
159
- <modal :show.sync="showModal3" :backdrop="false">
160
- <div slot="modal-header" class="modal-header">
161
- <h4 class="modal-title">
162
- 调整用户
163
- </h4>
164
- </div>
165
- <div slot="modal-body" class="modal-body">
166
- <div v-if="true">
167
- <div class="row" style="margin-top: 10px;text-align: center">
168
- <div class="form-group col-sm-12" style="margin-top: 20px">
169
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
170
- <v-select :value.sync="selectBook" v-model='selectBook'
171
- :value-single="true" style="width: 80%"
172
- class="select_list select"
173
- :options='checkBooks' placeholder=''
174
- close-on-select></v-select>
175
- </div>
176
- </div>
177
- </div>
178
- </div>
179
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
180
- <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
181
- <button class="button_search" @click="cancel3">取消</button>
182
- </div>
183
- </modal>
184
-
185
- </div>
186
- </template>
187
-
188
- <script>
189
- import {PagedList, HttpResetClass} from 'vue-client'
190
- import * as Util from '../../components/Util'
191
- import bus from "../../bus";
192
-
193
- export default {
194
- title: '安检册管理',
195
- data () {
196
- let model = new PagedList('api/af-safecheck/sql/safe_singleTable_OrderBy', 20,{
197
- items: "'ta.f_residential_area,ta.id,tcb.f_check_book_name,tcm.f_community_name,tcm.f_street'",
198
- tablename: "'t_area ta left join t_check_book tcb on ta.f_check_book_id=tcb.id left join t_community tcm on ta.f_community_id = tcm.id'",
199
- orderitem: "'id desc'"
200
- })
201
- return {
202
- model: model,
203
- criteriaShow: false,
204
- excelHeaders: {},
205
- checkBooks: [],
206
- f_orgid: '',
207
- bookAll: false,
208
- bookList: [],
209
- selectBook:'',
210
- // init:false,
211
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
212
- isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_id is not null'}, {label: '否', value: 'f_check_book_id is null'}],
213
- isSearch: false,
214
- checkBook: {
215
- f_check_book_name: '',
216
- f_run_date: '',
217
- f_around_time: '',
218
- f_around_unit: '',
219
- f_create_date: Util.toStandardDateString(),
220
- f_create_person: this.$login.f.name,
221
- f_orgid: '',
222
- f_checker_name: ''
223
- },
224
- showModal: false,
225
- showModal2: false,
226
- showModal3: false
227
- }
228
- },
229
- beforeDestroy() {
230
- //tag
231
- bus.$off('fresh-area')
232
- },
233
- computed: {
234
- searchData () {
235
- return {condition: this.model.condition}
236
- },
237
- bookCondition () {
238
- return this.model.condition
239
- },
240
- isCreateBook () {
241
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
242
- },
243
- isChangeBook () {
244
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
245
- }
246
- },
247
- watch:{
248
- 'bookList'(){
249
- this.$emit('book-list',this.bookList)
250
- },
251
- 'bookAll'(val){
252
- if(!val){
253
- this.bookList=[]
254
- }
255
- this.$emit('book-all',this.bookAll)
256
- }
257
- },
258
- methods: {
259
- async ok2() {
260
- if (!this.selectBook) {
261
- this.$showMessage('请选择安检册')
262
- return
263
- }
264
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
265
- let userCondition = ''
266
- if (this.bookList.length < 1) {
267
- //tag
268
- userCondition = this.bookCondition
269
- } else {
270
- //tag)
271
-
272
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
273
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
274
- //tag
275
- }
276
- let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
277
- FROM
278
- t_userinfo tui
279
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
280
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
281
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
282
- WHERE
283
- tui.f_user_state = '正常'
284
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
285
- AND ${userCondition}`
286
- await new HttpResetClass().load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: addUser}},
287
- {resolveMsg: null, rejectMsg: '添加用户失败'})
288
- this.$showMessage('添加用户成功')
289
- this.selectBook = ''
290
- this.bookAll = false
291
- this.bookList = []
292
- this.showModal2 = false
293
- this.$refs.paged.$refs.criteria.search()
294
- }
295
- },
296
- async ok3() {
297
- if (!this.selectBook) {
298
- this.$showMessage('请选择安检册')
299
- return
300
- }
301
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
302
- let userCondition = ''
303
- if (this.bookList.length < 1) {
304
- //tag
305
- userCondition = this.bookCondition
306
- } else {
307
- //tag)
308
-
309
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
310
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
311
- //tag
312
- }
313
- let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
314
- FROM
315
- t_userinfo tui
316
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
317
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
318
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
319
- WHERE
320
- tui.f_user_state = '正常'
321
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
322
- AND ${userCondition}`
323
- await new HttpResetClass().load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: upUser}},
324
- {resolveMsg: null, rejectMsg: '调整用户失败'})
325
- this.$showMessage('调整用户成功')
326
- this.selectBook = ''
327
- this.bookAll = false
328
- this.bookList = []
329
- this.showModal3 = false
330
- this.$refs.paged.$refs.criteria.search()
331
- }
332
- },
333
- cancel2(){
334
- this.selectBook = ''
335
- this.bookAll = false
336
- this.bookList = []
337
- this.showModal2 = false
338
- this.$refs.paged.$refs.criteria.search()
339
- },
340
- cancel3(){
341
- this.selectBook = ''
342
- this.bookAll = false
343
- this.bookList = []
344
- this.showModal3 = false
345
- this.$refs.paged.$refs.criteria.search()
346
- },
347
- addUser () {
348
- if (!this.isCreateBook) {
349
- this.$showMessage('请选择查询未划分安检册的用户')
350
- return
351
- }
352
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
353
- this.showModal2 = true
354
- this.freshCheckBook()
355
- return
356
- }
357
- this.$showMessage('请选择用户')
358
- },
359
- upUser () {
360
- if (!this.isChangeBook) {
361
- this.$showMessage('请选择查询已划分安检册的用户')
362
- return
363
- }
364
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
365
- this.showModal3 = true
366
- this.freshCheckBook()
367
- return
368
- }
369
- this.$showMessage('请选择用户')
370
- },
371
- async delUser () {
372
- if (!this.isChangeBook) {
373
- this.$showMessage('请选择查询已划分安检册的用户')
374
- return
375
- }
376
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
377
- let userCondition= ''
378
- if (this.bookList.length < 1) {
379
- //tag
380
- userCondition = this.bookCondition
381
- } else {
382
- //tag)
383
-
384
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
385
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
386
- //tag
387
- }
388
- let delUser= `update t_user_address set f_check_book_id =null
389
- FROM
390
- t_userinfo tui
391
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
392
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
393
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
394
- WHERE
395
- tui.f_user_state = '正常'
396
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
397
- AND ${userCondition}`
398
- await new HttpResetClass().load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: delUser}},
399
- {resolveMsg: null, rejectMsg: '删除安检册失败'})
400
- this.$showMessage('从安检册删除所选用户成功')
401
- this.selectBook = ''
402
- this.bookAll = false
403
- this.bookList = []
404
- this.showModal3 = false
405
- this.$refs.paged.$refs.criteria.search()
406
- return
407
- }
408
- this.$showMessage('请选择用户')
409
- },
410
- beforeCreateBook () {
411
- if (!this.isCreateBook) {
412
- this.$showMessage('请选择查询未划分安检册的用户')
413
- return
414
- }
415
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
416
- this.showModal = true
417
- return
418
- }
419
- this.$showMessage('请选择用户')
420
- },
421
- ok () {
422
- //tag)
423
- let condition = ''
424
- if (!this.checkBook.f_check_book_name) {
425
- return this.$showMessage('请填写册名')
426
- }
427
- if (!this.checkBook.f_checker_name) {
428
- return this.$showMessage('请选择安检员')
429
- }
430
- if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
431
- return this.$showMessage('请选填写周期信息')
432
- }
433
- if (!this.checkBook.f_run_date) {
434
- return this.$showMessage('执行日期')
435
- }
436
- if (this.bookList.length < 1) {
437
- //tag
438
- condition = this.bookCondition
439
- } else {
440
- //tag)
441
-
442
- condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
443
- condition = 'tui.f_userinfo_id in (' + condition + ')'
444
- //tag
445
- }
446
- let data = {
447
- checkBook: this.checkBook,
448
- sqlStr: condition
449
- }
450
- new HttpResetClass().load('post', 'api/af-safecheck/logic/AddCheckBook', {data}).then(res => {
451
- //tag)
452
- if (res.data.id) {
453
- this.$showMessage('创建成功')
454
- this.showModal = false
455
- this.isSearch = false
456
- this.bookList = []
457
- this.bookAll = false
458
- this.freshCheckBook()
459
- this.$refs.paged.$refs.criteria.search()
460
- }
461
- })
462
- },
463
- changeState (val) {
464
- //tag
465
- //tag
466
- this.bookAll = false
467
- this.bookList = []
468
- if (this.$refs.paged.$refs.criteria.model.f_orgid){
469
- this.$refs.paged.$refs.criteria.search()
470
- }
471
- },
472
- cancel () {
473
- this.bookAll = false
474
- this.bookList = []
475
- this.showModal = false
476
- this.$refs.paged.$refs.criteria.search()
477
- },
478
- checkModel (row) {
479
- if (this.bookAll) {
480
- //tag)
481
- return true
482
- } else {
483
- if (this.bookList.findIndex(res => res === row.id) !== -1) {
484
- return true
485
- } else {
486
- return false
487
- }
488
- }
489
- },
490
- checkChange (row, e) {
491
- //tag
492
- if (e.target.checked) {
493
- this.bookList.push(row.id)
494
- } else {
495
- this.bookList.splice(this.bookList.findIndex(res => res === row.id), 1)
496
- }
497
- // //tag)
498
- },
499
- getRes (obj) {
500
- this.checkBook.f_orgid = obj.resids[0]
501
- },
502
- getResm (obj) {
503
- this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
504
- },
505
- hidden () {
506
- this.criteriaShow = !this.criteriaShow
507
- },
508
- selfSearch (args) {
509
- this.isSearch = true
510
- this.bookAll = false
511
- this.bookList = []
512
-
513
- console.log("查询66666666666666666")
514
- this.$emit('book-condition',args.condition)
515
- // if (this.$refs.paged.$refs.criteria.model.f_orgid){
516
- // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
517
- // }
518
- this.model.search(args.condition, args.model)
519
- },
520
- freshCheckBook () {
521
- this.checkBooks = []
522
- new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy`, {
523
- data: {
524
- items: 'id,f_check_book_name',
525
- tablename: 't_check_book',
526
- condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1',
527
- orderitem: 'id desc'
528
- }
529
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
530
- this.checkBooks.push({label: '全部', value: ''})
531
- res.data.forEach(ress => {
532
- this.checkBooks.push({
533
- label: ress.f_check_book_name,
534
- value: ress.id
535
- })
536
- })
537
- })
538
- }
539
- },
540
-
541
- ready () {
542
- bus.$on('fresh-area',()=>{
543
- console.log("进入方法",this.bookAll,this.bookList)
544
- this.bookAll = false
545
- this.bookList = []
546
- this.$refs.paged.$refs.criteria.search()
547
- })
548
- this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_id is null'
549
- //tag
550
- // this.init=true
551
- this.freshCheckBook()
552
- }
553
- }
554
- </script>
555
- <style scoped>
556
- /*.btn-group > .btn:first-child {*/
557
- /* margin-left: 0;*/
558
- /* width: 100%;*/
559
- /*}*/
560
- </style>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="basic-main">
4
+ <criteria-paged :model="model" v-ref:paged>
5
+ <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <div class="row">
8
+
9
+ <div class="col-sm-3 form-group" style="margin-bottom: 0px">
10
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
11
+ <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="ta.f_orgid in {}"></right-tree-safe>
12
+ </div>
13
+ <div class="form-group col-sm-3">
14
+ <label class="font_normal_body">小区名称</label>
15
+ <input type="text" class="input_search" v-model="model.f_residential_area"
16
+ style="width: 60%" placeholder="小区名称" condition="f_residential_area like '%{}%'">
17
+ </div>
18
+ <div class="form-group col-sm-3">
19
+ <label class="font_normal_body">是否在册</label>
20
+ <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
21
+ :value-single="true" style="width: 60%"
22
+ class="select_list select"
23
+ @change="$parent.$parent.changeState"
24
+ :options='$parent.$parent.isCheckBook' placeholder='有无所属安检册'
25
+ close-on-select
26
+ condition="{}"></v-select>
27
+ </div>
28
+ <div class="form-group col-sm-3">
29
+ <button class="button_spacing button_search" @click="search()">查询</button>
30
+ <!-- <div style="float: right" class="button_spacing"
31
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
32
+ @click="$parent.$parent.hidden()"></div>-->
33
+ </div>
34
+
35
+
36
+
37
+
38
+ </div>
39
+ </div>
40
+ </criteria>
41
+ <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
42
+ <template partial='head'>
43
+ <tr @dblclick.stop="">
44
+ <th>
45
+ <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
46
+ </th>
47
+ <th>
48
+ <nobr>区/县</nobr>
49
+ </th>
50
+ <th>
51
+ <nobr>街道/乡镇</nobr>
52
+ </th>
53
+ <th>
54
+ <nobr>片区/行政村</nobr>
55
+ </th>
56
+ <th>
57
+ <nobr>小区/自然村</nobr>
58
+ </th>
59
+ <th>
60
+ <nobr>所属安检册</nobr>
61
+ </th>
62
+ </tr>
63
+ </template>
64
+ <template partial='body'>
65
+ <td style="text-align: center">
66
+ <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
67
+ @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
68
+ </nobr>
69
+ </td>
70
+ <td style="text-align: center">{{ row.f_pcd }}</td>
71
+ <td style="text-align: center">{{ row.f_street }}</td>
72
+ <td style="text-align: center">{{ row.f_community_name }}</td>
73
+ <td style="text-align: center">{{ row.f_residential_area }}</td>
74
+ <td style="text-align: center">{{ row.f_check_book_name }}</td>
75
+ </template>
76
+ </data-grid>
77
+ </criteria-paged>
78
+ </div>
79
+ <modal :show.sync="showModal" :backdrop="false">
80
+ <div slot="modal-header" class="modal-header">
81
+ <h4 class="modal-title">
82
+ 创建安检册
83
+ </h4>
84
+ </div>
85
+ <div slot="modal-body" class="modal-body">
86
+ <div v-if="true">
87
+ <div class="row" style="margin-top: 10px">
88
+
89
+ <div class="col-sm-12 form-group" style="margin: 0">
90
+ <role-selector-safe
91
+ @re-res="getRes"
92
+ role-name="安检员"
93
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
94
+ :value.sync="checkBook.f_checker_name"
95
+ v-model="checkBook.f_checker_name">
96
+ </role-selector-safe>
97
+ </div>
98
+ <div class="form-group col-sm-6" style="margin-top: 20px">
99
+ <label class="font_normal_body">安检册名</label>
100
+ <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
101
+ style="width: 60%" >
102
+ </div>
103
+ <div class="form-group col-sm-6" style="margin-top: 20px">
104
+ <label class="font_normal_body">执行日期</label>
105
+ <datepicker
106
+ :value.sync="checkBook.f_run_date"
107
+ style="width: 60%"
108
+ :format="'yyyy-MM-dd'"
109
+ v-model="checkBook.f_run_date"
110
+ >
111
+ </datepicker>
112
+ </div>
113
+ <div class="form-group col-sm-6" style="margin-top: 20px">
114
+ <label class="font_normal_body">执行周期</label>
115
+ <input type="number" class="input_search" v-model="checkBook.f_around_time"
116
+ style="width: 60%" >
117
+ </div>
118
+ <div class="form-group col-sm-6" style="margin-top: 20px">
119
+ <label class="font_normal_body">周期单位</label>
120
+ <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
121
+ :value-single="true" style="width: 60%"
122
+ class="select_list select"
123
+ :options='aroundUnit' placeholder=''
124
+ close-on-select></v-select>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
130
+ <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
131
+ <button class="button_search" @click="cancel">取消</button>
132
+ </div>
133
+ </modal>
134
+ <modal :show.sync="showModal2" :backdrop="false">
135
+ <div slot="modal-header" class="modal-header">
136
+ <h4 class="modal-title">
137
+ 添加用户
138
+ </h4>
139
+ </div>
140
+ <div slot="modal-body" class="modal-body">
141
+ <div v-if="true">
142
+ <div class="row" style="margin-top: 10px">
143
+ <div class="form-group col-sm-12" style="margin-top: 20px">
144
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
145
+ <v-select :value.sync="selectBook" v-model='selectBook'
146
+ :value-single="true" style="width: 80%"
147
+ class="select_list select"
148
+ :options='checkBooks' placeholder=''
149
+ close-on-select></v-select>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
155
+ <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
156
+ <button class="button_search" @click="cancel2">取消</button>
157
+ </div>
158
+ </modal>
159
+ <modal :show.sync="showModal3" :backdrop="false">
160
+ <div slot="modal-header" class="modal-header">
161
+ <h4 class="modal-title">
162
+ 调整用户
163
+ </h4>
164
+ </div>
165
+ <div slot="modal-body" class="modal-body">
166
+ <div v-if="true">
167
+ <div class="row" style="margin-top: 10px;text-align: center">
168
+ <div class="form-group col-sm-12" style="margin-top: 20px">
169
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
170
+ <v-select :value.sync="selectBook" v-model='selectBook'
171
+ :value-single="true" style="width: 80%"
172
+ class="select_list select"
173
+ :options='checkBooks' placeholder=''
174
+ close-on-select></v-select>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
180
+ <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
181
+ <button class="button_search" @click="cancel3">取消</button>
182
+ </div>
183
+ </modal>
184
+
185
+ </div>
186
+ </template>
187
+
188
+ <script>
189
+ import {PagedList, HttpResetClass} from 'vue-client'
190
+ import * as Util from '../../components/Util'
191
+ import bus from "../../bus";
192
+
193
+ export default {
194
+ title: '安检册管理',
195
+ data () {
196
+ let model = new PagedList('api/af-safecheck/sql/safe_singleTable_OrderBy', 20,{
197
+ items: "'ta.f_residential_area,ta.id,tcb.f_check_book_name,tcm.f_community_name,tcm.f_street'",
198
+ tablename: "'t_area ta left join t_check_book tcb on ta.f_check_book_id=tcb.id left join t_community tcm on ta.f_community_id = tcm.id'",
199
+ orderitem: "'id desc'"
200
+ })
201
+ return {
202
+ model: model,
203
+ criteriaShow: false,
204
+ excelHeaders: {},
205
+ checkBooks: [],
206
+ f_orgid: '',
207
+ bookAll: false,
208
+ bookList: [],
209
+ selectBook:'',
210
+ // init:false,
211
+ aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
212
+ isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_id is not null'}, {label: '否', value: 'f_check_book_id is null'}],
213
+ isSearch: false,
214
+ checkBook: {
215
+ f_check_book_name: '',
216
+ f_run_date: '',
217
+ f_around_time: '',
218
+ f_around_unit: '',
219
+ f_create_date: Util.toStandardDateString(),
220
+ f_create_person: this.$login.f.name,
221
+ f_orgid: '',
222
+ f_checker_name: ''
223
+ },
224
+ showModal: false,
225
+ showModal2: false,
226
+ showModal3: false
227
+ }
228
+ },
229
+ beforeDestroy() {
230
+ //tag
231
+ bus.$off('fresh-area')
232
+ },
233
+ computed: {
234
+ searchData () {
235
+ return {condition: this.model.condition}
236
+ },
237
+ bookCondition () {
238
+ return this.model.condition
239
+ },
240
+ isCreateBook () {
241
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
242
+ },
243
+ isChangeBook () {
244
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
245
+ }
246
+ },
247
+ watch:{
248
+ 'bookList'(){
249
+ this.$emit('book-list',this.bookList)
250
+ },
251
+ 'bookAll'(val){
252
+ if(!val){
253
+ this.bookList=[]
254
+ }
255
+ this.$emit('book-all',this.bookAll)
256
+ }
257
+ },
258
+ methods: {
259
+ async ok2() {
260
+ if (!this.selectBook) {
261
+ this.$showMessage('请选择安检册')
262
+ return
263
+ }
264
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
265
+ let userCondition = ''
266
+ if (this.bookList.length < 1) {
267
+ //tag
268
+ userCondition = this.bookCondition
269
+ } else {
270
+ //tag)
271
+
272
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
273
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
274
+ //tag
275
+ }
276
+ let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
277
+ FROM
278
+ t_userinfo tui
279
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
280
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
281
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
282
+ WHERE
283
+ tui.f_user_state = '正常'
284
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
285
+ AND ${userCondition}`
286
+ await new HttpResetClass().load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: addUser}},
287
+ {resolveMsg: null, rejectMsg: '添加用户失败'})
288
+ this.$showMessage('添加用户成功')
289
+ this.selectBook = ''
290
+ this.bookAll = false
291
+ this.bookList = []
292
+ this.showModal2 = false
293
+ this.$refs.paged.$refs.criteria.search()
294
+ }
295
+ },
296
+ async ok3() {
297
+ if (!this.selectBook) {
298
+ this.$showMessage('请选择安检册')
299
+ return
300
+ }
301
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
302
+ let userCondition = ''
303
+ if (this.bookList.length < 1) {
304
+ //tag
305
+ userCondition = this.bookCondition
306
+ } else {
307
+ //tag)
308
+
309
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
310
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
311
+ //tag
312
+ }
313
+ let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
314
+ FROM
315
+ t_userinfo tui
316
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
317
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
318
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
319
+ WHERE
320
+ tui.f_user_state = '正常'
321
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
322
+ AND ${userCondition}`
323
+ await new HttpResetClass().load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: upUser}},
324
+ {resolveMsg: null, rejectMsg: '调整用户失败'})
325
+ this.$showMessage('调整用户成功')
326
+ this.selectBook = ''
327
+ this.bookAll = false
328
+ this.bookList = []
329
+ this.showModal3 = false
330
+ this.$refs.paged.$refs.criteria.search()
331
+ }
332
+ },
333
+ cancel2(){
334
+ this.selectBook = ''
335
+ this.bookAll = false
336
+ this.bookList = []
337
+ this.showModal2 = false
338
+ this.$refs.paged.$refs.criteria.search()
339
+ },
340
+ cancel3(){
341
+ this.selectBook = ''
342
+ this.bookAll = false
343
+ this.bookList = []
344
+ this.showModal3 = false
345
+ this.$refs.paged.$refs.criteria.search()
346
+ },
347
+ addUser () {
348
+ if (!this.isCreateBook) {
349
+ this.$showMessage('请选择查询未划分安检册的用户')
350
+ return
351
+ }
352
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
353
+ this.showModal2 = true
354
+ this.freshCheckBook()
355
+ return
356
+ }
357
+ this.$showMessage('请选择用户')
358
+ },
359
+ upUser () {
360
+ if (!this.isChangeBook) {
361
+ this.$showMessage('请选择查询已划分安检册的用户')
362
+ return
363
+ }
364
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
365
+ this.showModal3 = true
366
+ this.freshCheckBook()
367
+ return
368
+ }
369
+ this.$showMessage('请选择用户')
370
+ },
371
+ async delUser () {
372
+ if (!this.isChangeBook) {
373
+ this.$showMessage('请选择查询已划分安检册的用户')
374
+ return
375
+ }
376
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
377
+ let userCondition= ''
378
+ if (this.bookList.length < 1) {
379
+ //tag
380
+ userCondition = this.bookCondition
381
+ } else {
382
+ //tag)
383
+
384
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
385
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
386
+ //tag
387
+ }
388
+ let delUser= `update t_user_address set f_check_book_id =null
389
+ FROM
390
+ t_userinfo tui
391
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
392
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
393
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
394
+ WHERE
395
+ tui.f_user_state = '正常'
396
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
397
+ AND ${userCondition}`
398
+ await new HttpResetClass().load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: delUser}},
399
+ {resolveMsg: null, rejectMsg: '删除安检册失败'})
400
+ this.$showMessage('从安检册删除所选用户成功')
401
+ this.selectBook = ''
402
+ this.bookAll = false
403
+ this.bookList = []
404
+ this.showModal3 = false
405
+ this.$refs.paged.$refs.criteria.search()
406
+ return
407
+ }
408
+ this.$showMessage('请选择用户')
409
+ },
410
+ beforeCreateBook () {
411
+ if (!this.isCreateBook) {
412
+ this.$showMessage('请选择查询未划分安检册的用户')
413
+ return
414
+ }
415
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
416
+ this.showModal = true
417
+ return
418
+ }
419
+ this.$showMessage('请选择用户')
420
+ },
421
+ ok () {
422
+ //tag)
423
+ let condition = ''
424
+ if (!this.checkBook.f_check_book_name) {
425
+ return this.$showMessage('请填写册名')
426
+ }
427
+ if (!this.checkBook.f_checker_name) {
428
+ return this.$showMessage('请选择安检员')
429
+ }
430
+ if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
431
+ return this.$showMessage('请选填写周期信息')
432
+ }
433
+ if (!this.checkBook.f_run_date) {
434
+ return this.$showMessage('执行日期')
435
+ }
436
+ if (this.bookList.length < 1) {
437
+ //tag
438
+ condition = this.bookCondition
439
+ } else {
440
+ //tag)
441
+
442
+ condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
443
+ condition = 'tui.f_userinfo_id in (' + condition + ')'
444
+ //tag
445
+ }
446
+ let data = {
447
+ checkBook: this.checkBook,
448
+ sqlStr: condition
449
+ }
450
+ new HttpResetClass().load('post', 'api/af-safecheck/logic/AddCheckBook', {data}).then(res => {
451
+ //tag)
452
+ if (res.data.id) {
453
+ this.$showMessage('创建成功')
454
+ this.showModal = false
455
+ this.isSearch = false
456
+ this.bookList = []
457
+ this.bookAll = false
458
+ this.freshCheckBook()
459
+ this.$refs.paged.$refs.criteria.search()
460
+ }
461
+ })
462
+ },
463
+ changeState (val) {
464
+ //tag
465
+ //tag
466
+ this.bookAll = false
467
+ this.bookList = []
468
+ if (this.$refs.paged.$refs.criteria.model.f_orgid){
469
+ this.$refs.paged.$refs.criteria.search()
470
+ }
471
+ },
472
+ cancel () {
473
+ this.bookAll = false
474
+ this.bookList = []
475
+ this.showModal = false
476
+ this.$refs.paged.$refs.criteria.search()
477
+ },
478
+ checkModel (row) {
479
+ if (this.bookAll) {
480
+ //tag)
481
+ return true
482
+ } else {
483
+ if (this.bookList.findIndex(res => res === row.id) !== -1) {
484
+ return true
485
+ } else {
486
+ return false
487
+ }
488
+ }
489
+ },
490
+ checkChange (row, e) {
491
+ //tag
492
+ if (e.target.checked) {
493
+ this.bookList.push(row.id)
494
+ } else {
495
+ this.bookList.splice(this.bookList.findIndex(res => res === row.id), 1)
496
+ }
497
+ // //tag)
498
+ },
499
+ getRes (obj) {
500
+ this.checkBook.f_orgid = obj.resids[0]
501
+ },
502
+ getResm (obj) {
503
+ this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
504
+ },
505
+ hidden () {
506
+ this.criteriaShow = !this.criteriaShow
507
+ },
508
+ selfSearch (args) {
509
+ this.isSearch = true
510
+ this.bookAll = false
511
+ this.bookList = []
512
+
513
+ console.log("查询66666666666666666")
514
+ this.$emit('book-condition',args.condition)
515
+ // if (this.$refs.paged.$refs.criteria.model.f_orgid){
516
+ // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
517
+ // }
518
+ this.model.search(args.condition, args.model)
519
+ },
520
+ freshCheckBook () {
521
+ this.checkBooks = []
522
+ new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy`, {
523
+ data: {
524
+ items: 'id,f_check_book_name',
525
+ tablename: 't_check_book',
526
+ condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1',
527
+ orderitem: 'id desc'
528
+ }
529
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
530
+ this.checkBooks.push({label: '全部', value: ''})
531
+ res.data.forEach(ress => {
532
+ this.checkBooks.push({
533
+ label: ress.f_check_book_name,
534
+ value: ress.id
535
+ })
536
+ })
537
+ })
538
+ }
539
+ },
540
+
541
+ ready () {
542
+ bus.$on('fresh-area',()=>{
543
+ console.log("进入方法",this.bookAll,this.bookList)
544
+ this.bookAll = false
545
+ this.bookList = []
546
+ this.$refs.paged.$refs.criteria.search()
547
+ })
548
+ this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_id is null'
549
+ //tag
550
+ // this.init=true
551
+ this.freshCheckBook()
552
+ }
553
+ }
554
+ </script>
555
+ <style scoped>
556
+ /*.btn-group > .btn:first-child {*/
557
+ /* margin-left: 0;*/
558
+ /* width: 100%;*/
559
+ /*}*/
560
+ </style>