repairsFilter.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view class="container" @touchmove.stop.prevent v-if="pageData.pageRouter === 'default'">
  3. <view class="container_form">
  4. <view class="category">
  5. <text class="name">状态</text>
  6. <text class="value">
  7. <uni-data-picker @change="categoryChange" v-model="searchData.category" :clear-icon="false" :localdata="pageData.categoryList" popup-title="请选择状态">
  8. </uni-data-picker>
  9. </text>
  10. </view>
  11. <!-- <view class="category">
  12. <label class="uni-list-cell uni-list-cell-pd">
  13. <text class="name">待评价</text>
  14. <checkbox value="1" color="#49b856" :checked="searchData.evaluate" />
  15. </label>
  16. </view> -->
  17. </view>
  18. <view class="container_foot">
  19. <view class="clear" @click="clear">清除选项</view>
  20. <view class="foot_btns">
  21. <view class="cancel" @click="cancel">取消</view>
  22. <view class="confirm" @click="confirm">确认</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="mask" @touchmove.stop.prevent></view>
  27. <view class="line" @touchmove.stop.prevent></view>
  28. </template>
  29. <script setup>
  30. import { defineEmits, ref, reactive, defineProps } from 'vue'
  31. import { onLoad } from '@dcloudio/uni-app'
  32. import { useLoginUserStore } from '@/stores/loginUser'
  33. import { repositoryListSearchStore } from '@/stores/repositorySearch'
  34. import { api_area, api_incidentcategory } from "@/http/api.js"
  35. import { transform } from '@/utils/index.js'
  36. const emit = defineEmits(['cancelEmit', 'confirmEmit']);
  37. const loginUserStore = useLoginUserStore();
  38. const repositorySearchStore = repositoryListSearchStore();
  39. // 页面数据
  40. const pageData = reactive({
  41. pageRouter: 'default',
  42. areaList: [],
  43. categoryList: [
  44. {text: '全部', value: 0},
  45. {text: '待受理', value: 'accept,storage'},
  46. {text: '处理中', value: 'pending,handler,reassign'},
  47. {text: '待评价', value: 'close0', hasWxdegree: 0},
  48. {text: '已关闭', value: 'close1', hasWxdegree: 1},
  49. {text: '不受理', value: 'reject'},
  50. {text: '撤销', value: 'cancel'},
  51. ],
  52. });
  53. const searchData = reactive({
  54. evaluate:false,
  55. hospital: {},
  56. selected: 'todoingAll',
  57. area: {id: 0, area: '全部'},
  58. category: 0,
  59. acceptDate: [],
  60. categoryChangeData:[]
  61. })
  62. // 清空
  63. function clear(){
  64. searchData.category = {};
  65. searchData.acceptDate = [];
  66. searchData.evaluate = false;
  67. searchData.categoryChangeData = [];
  68. repositorySearchStore.clearRepositoryListSearchData()
  69. }
  70. // 取消
  71. function cancel(){
  72. emit('cancelEmit')
  73. }
  74. // 确认
  75. function confirm(){
  76. repositorySearchStore.setRepositoryListSearchData(searchData)
  77. emit('confirmEmit', searchData);
  78. }
  79. function categoryChange(val){
  80. searchData.categoryChangeData = val.detail.value
  81. }
  82. function getCategoryList(){
  83. // uni.showLoading({
  84. // title: "加载中",
  85. // mask: true,
  86. // });
  87. // let postData = {
  88. // idx: 0,
  89. // sum: 9999,
  90. // incidentcategory: {
  91. // },
  92. // }
  93. // if(loginUserStore.loginUser.user.duty){
  94. // postData.incidentcategory.duty = loginUserStore.loginUser.user.duty.id;
  95. // }else if(loginUserStore.loginUser.user.branch){
  96. // postData.incidentcategory.branch = loginUserStore.loginUser.user.branch.id;
  97. // }
  98. // api_incidentcategory(postData).then(res => {
  99. // uni.hideLoading();
  100. // if(res.status == 200){
  101. // let list = res.list || [];
  102. // list = list.map(i=> ({...i, parentid: i.parent?.id}))
  103. // pageData.categoryList = transform(list, 'id', 'parentid')
  104. // }else{
  105. // uni.showToast({
  106. // icon: 'none',
  107. // title: res.msg || '请求数据失败!'
  108. // });
  109. // }
  110. // })
  111. }
  112. // 页面路由跳转
  113. function clickPageRouter(type){
  114. pageData.pageRouter = type;
  115. switch(type){
  116. case 'category':
  117. getCategoryList('one');
  118. break;
  119. }
  120. }
  121. onLoad((option) => {
  122. // getCategoryList()
  123. let data = repositorySearchStore.repositorySearch.data
  124. searchData.category = data && data.category;
  125. searchData.title = data && data.title;
  126. searchData.categoryChangeData = data && data.categoryChangeData
  127. searchData.evaluate = data && data.evaluate
  128. })
  129. </script>
  130. <style lang="scss" scoped>
  131. .uni-checkbox-input:hover{
  132. border-color:#49b856;
  133. }
  134. .mask{
  135. position: fixed;
  136. left: 0;
  137. top: 0;
  138. right: 0;
  139. bottom: 0;
  140. background-color: rgba(0, 0, 0, 0.4);
  141. z-index: 999;
  142. }
  143. .line{
  144. content: '';
  145. position: fixed;
  146. top: 0;
  147. left: 0;
  148. z-index: 9999;
  149. height: 8rpx;
  150. width: 100%;
  151. background-color: #EBEBEB;
  152. }
  153. .container{
  154. position: fixed;
  155. left: 125rpx;
  156. top: 0;
  157. right: 0;
  158. bottom: 0;
  159. z-index: 9999;
  160. background-color: #F7F7F7;
  161. display: flex;
  162. flex-direction: column;
  163. justify-content: space-between;
  164. .container_form{
  165. height: 100%;
  166. display: flex;
  167. flex-direction: column;
  168. flex: 1;
  169. min-height: 0;
  170. .item{
  171. padding: 32rpx;
  172. }
  173. }
  174. .hospital{
  175. display: flex;
  176. align-items: center;
  177. padding: 32rpx 24rpx 24rpx;
  178. background-color: #fff;
  179. .name{
  180. font-size: 28rpx;
  181. flex-shrink: 0;
  182. margin-right: 24rpx;
  183. }
  184. .value{
  185. width: 100%;
  186. font-size: 22rpx;
  187. .uni-input{
  188. font-size: 26rpx;
  189. }
  190. }
  191. }
  192. .areas{
  193. flex: 1;
  194. min-height: 0;
  195. margin-top: 16rpx;
  196. background-color: #fff;
  197. .areas_item{
  198. padding: 24rpx;
  199. border-bottom: 1rpx solid #DEDEDE;
  200. }
  201. }
  202. .categorys{
  203. flex: 1;
  204. min-height: 0;
  205. margin-top: 16rpx;
  206. background-color: #fff;
  207. .categorys_item{
  208. padding: 24rpx;
  209. border-bottom: 1rpx solid #DEDEDE;
  210. }
  211. }
  212. .tabs{
  213. margin-top: 16rpx;
  214. background-color: #FBFBFB;
  215. display: flex;
  216. flex-wrap: wrap;
  217. justify-content: space-between;
  218. gap: 16rpx 0;
  219. padding: 24rpx 16rpx;
  220. .tab{
  221. width: 180rpx;
  222. height: 60rpx;
  223. display: flex;
  224. justify-content: center;
  225. align-items: center;
  226. background-color: #F7F7F7;
  227. font-size: 28rpx;
  228. position: relative;
  229. .newicon-xuanzejiaobiao{
  230. opacity: 0;
  231. position: absolute;
  232. right: 0;
  233. bottom: 0;
  234. font-size: 38rpx;
  235. color: #53B9BB;
  236. }
  237. &.active{
  238. background-color: rgba(149, 220, 231, 0.30);
  239. .newicon-xuanzejiaobiao{
  240. opacity: 1;
  241. }
  242. }
  243. }
  244. }
  245. .area,
  246. .category,
  247. .acceptDate{
  248. display: flex;
  249. justify-content: space-between;
  250. align-items: center;
  251. padding: 24rpx;
  252. background-color: #fff;
  253. margin-top: 24rpx;
  254. .name{
  255. font-size: 28rpx;
  256. flex-shrink: 0;
  257. margin-right: 24rpx;
  258. }
  259. .value{
  260. flex:1;
  261. }
  262. }
  263. .container_foot{
  264. .clear{
  265. padding: 24rpx;
  266. font-size: 28rpx;
  267. background-color: #fff;
  268. margin: 0 16rpx;
  269. display: flex;
  270. align-items: center;
  271. justify-content: center;
  272. }
  273. .foot_btns{
  274. margin-top: 24rpx;
  275. display: flex;
  276. border-top: 1rpx solid #BFBFBF;
  277. .cancel{
  278. flex: 1;
  279. background-color: #fff;
  280. font-size: 32rpx;
  281. padding: 24rpx;
  282. display: flex;
  283. justify-content: center;
  284. }
  285. .confirm{
  286. flex: 1;
  287. font-size: 32rpx;
  288. padding: 24rpx;
  289. background-color: $uni-primary;
  290. display: flex;
  291. justify-content: center;
  292. color: #fff;
  293. }
  294. }
  295. }
  296. }
  297. </style>