callFilter.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="container" @touchmove.stop.prevent>
  3. <view class="container_form">
  4. <view class="hospital">
  5. <view class="name">开始通话时间区间</view>
  6. <view>
  7. <uni-datetime-picker v-model="searchData.datetimerange"
  8. type="datetimerange" rangeSeparator="至" @change="changeDate($event)"/>
  9. </view>
  10. </view>
  11. <view class="hospital">
  12. <view class="name">已接/未接</view>
  13. <view class="tabs">
  14. <view class="tab" :class="{active: tab.value === searchData.selected1}" v-for="tab in tabs1" :key="tab.value" @click="clickTab(tab,1)">{{tab.name}}<text class="newicon newicon-xuanzejiaobiao"></text></view>
  15. </view>
  16. </view>
  17. <view class="hospital">
  18. <view class="name">呼入/呼出</view>
  19. <view class="tabs">
  20. <view class="tab" :class="{active: tab.value === searchData.selected2}" v-for="tab in tabs2" :key="tab.value" @click="clickTab(tab,2)">{{tab.name}}<text class="newicon newicon-xuanzejiaobiao"></text></view>
  21. </view>
  22. </view>
  23. <view class="category">
  24. <text class="name">主叫号码</text>
  25. <input class="uni-input" v-model="searchData.dialing" placeholder="请输入主叫号码" />
  26. </view>
  27. <view class="category">
  28. <text class="name">被叫号码</text>
  29. <input class="uni-input" v-model="searchData.called" placeholder="请输入被叫号码" />
  30. </view>
  31. <!-- <view class="acceptDate" @click="changeIsShowDate()">
  32. <text class="name">登记时间</text>
  33. <text class="value ellipsis" v-if="searchData.acceptDate.length">{{searchData.acceptDate[0] || ''}}至{{searchData.acceptDate[1] || ''}}</text>
  34. <text class="value ellipsis" v-else>全部</text>
  35. </view> -->
  36. </view>
  37. <view class="container_foot">
  38. <view class="clear" @click="clear">清除选项</view>
  39. <view class="foot_btns">
  40. <view class="cancel" @click="cancel">取消</view>
  41. <view class="confirm" @click="confirm">确认</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="mask" @touchmove.stop.prevent></view>
  46. <view class="line" @touchmove.stop.prevent></view>
  47. </template>
  48. <script setup>
  49. import PyhRdtpicker from '@/components/PyhRdtpicker/PyhRdtpicker.vue';
  50. import { defineEmits, ref, reactive, defineProps } from 'vue'
  51. import { subMonths, startOfMonth, endOfMonth, format, add, setDate } from 'date-fns'
  52. import { onLoad } from '@dcloudio/uni-app'
  53. import { useLoginUserStore } from '@/stores/loginUser'
  54. import { api_area, getFetchDataList, api_incidentcategory } from "@/http/api.js"
  55. import { defaultColor } from '@/static/js/theme.js'
  56. import { transform } from '@/utils/index.js'
  57. const emit = defineEmits(['cancelEmit', 'confirmEmit']);
  58. const { evt } = defineProps({
  59. evt: {
  60. type: Object,
  61. required: true,
  62. },
  63. });
  64. const loginUserStore = useLoginUserStore();
  65. // 主题颜色
  66. const primaryColor = ref(defaultColor)
  67. // 登记时间
  68. const isShowDate = ref(false)
  69. // const start = ref(format(startOfYear(add(new Date(), { years: -5})), 'yyyy-MM-dd'));
  70. // const end = ref(format(endOfYear(add(new Date(), { years: 0})), 'yyyy-MM-dd'));
  71. const tabs1 = reactive([
  72. { name: '全部', value: 'all' },
  73. { name: '已接', value: '1' },
  74. { name: '未接', value: '0' },
  75. ])
  76. const tabs2 = reactive([
  77. { name: '全部', value: 'all' },
  78. { name: '呼入', value: '1' },
  79. { name: '呼出', value: '0' },
  80. ])
  81. // 页面数据
  82. const pageData = reactive({
  83. pageRouter: 'default',
  84. areaList: [],
  85. categoryList: [],
  86. deptList:[],
  87. selectBuildingList:[],
  88. });
  89. // 是否开启跨科查看
  90. const showDept = ref(false);
  91. const searchData = reactive({
  92. called: null,
  93. dialing: null,
  94. datetimerange:[],
  95. selected1: '-1',
  96. selected2: '-1'
  97. })
  98. // 显示登记时间
  99. function showDatechange(){
  100. isShowDate.value = !isShowDate.value;
  101. }
  102. // 登记时间确定
  103. function bindDateChange(e){
  104. console.log(e);
  105. searchData.acceptDate = e;
  106. }
  107. // 点击tab
  108. function clickTab(tab, type){
  109. if(type==1){
  110. searchData.selected1 = tab.value;
  111. }else{
  112. searchData.selected2 = tab.value;
  113. }
  114. }
  115. function changeDate(e){
  116. console.log(123, e)
  117. }
  118. // 清空
  119. function clear(){
  120. searchData.called = null
  121. searchData.dialing = null
  122. setDefaultDate()
  123. searchData.selected1 = 'all'
  124. searchData.selected2 = 'all'
  125. }
  126. // 取消
  127. function cancel(){
  128. emit('cancelEmit')
  129. }
  130. // 确认
  131. function confirm(){
  132. emit('confirmEmit', searchData);
  133. }
  134. // 页面路由跳转
  135. function clickPageRouter(type){
  136. pageData.pageRouter = type;
  137. switch(type){
  138. case 'area':
  139. getAreaList();
  140. break;
  141. }
  142. }
  143. // 显示登记时间
  144. function changeIsShowDate(type){
  145. isShowDate.value = true;
  146. }
  147. // 设置默认时间
  148. function setDefaultDate(){
  149. // 获取当前日期
  150. const today = new Date();
  151. // 获取上个月的第一天
  152. const startOfLastMonth = startOfMonth(subMonths(today, 1));
  153. // 获取上个月的最后一天
  154. const endOfLastMonth = endOfMonth(subMonths(today, 1));
  155. searchData.datetimerange = [format(startOfLastMonth, 'yyyy-MM-dd HH:mm:ss'),format(endOfLastMonth, 'yyyy-MM-dd HH:mm:ss')]
  156. }
  157. onLoad((option) => {
  158. console.log(123, evt)
  159. if(evt.datetimerange.length>0){
  160. searchData.datetimerange = evt.datetimerange
  161. }else{
  162. setDefaultDate()
  163. }
  164. let data = loginUserStore.loginUser.infoPermission
  165. pageData.deptList = data.dutyList
  166. searchData.selected1 = evt.selected1;
  167. searchData.selected2 = evt.selected2;
  168. searchData.called = evt.called;
  169. searchData.dialing = evt.dialing;
  170. })
  171. </script>
  172. <style lang="scss" scoped>
  173. .mask{
  174. position: fixed;
  175. left: 0;
  176. top: 0;
  177. right: 0;
  178. bottom: 0;
  179. background-color: rgba(0, 0, 0, 0.4);
  180. z-index: 999;
  181. }
  182. .line{
  183. content: '';
  184. position: fixed;
  185. top: 0;
  186. left: 0;
  187. z-index: 9999;
  188. height: 8rpx;
  189. width: 100%;
  190. background-color: #EBEBEB;
  191. }
  192. .container{
  193. position: fixed;
  194. left: 125rpx;
  195. top: 0;
  196. right: 0;
  197. bottom: 0;
  198. z-index: 9999;
  199. background-color: #F7F7F7;
  200. display: flex;
  201. flex-direction: column;
  202. justify-content: space-between;
  203. .container_form{
  204. height: 100%;
  205. display: flex;
  206. flex-direction: column;
  207. flex: 1;
  208. min-height: 0;
  209. }
  210. .hospital{
  211. padding: 32rpx 24rpx 24rpx;
  212. background-color: #fff;
  213. .name{
  214. font-size: 30rpx;
  215. flex-shrink: 0;
  216. margin-bottom: 20rpx;
  217. }
  218. .value{
  219. font-size: 26rpx;
  220. color: #5DAAB6;
  221. }
  222. }
  223. .areas{
  224. flex: 1;
  225. min-height: 0;
  226. margin-top: 20rpx;
  227. padding-top: 20rpx;
  228. background-color: #fff;
  229. .view-box{
  230. display: flex;
  231. flex-wrap: wrap;
  232. .areas_item{
  233. width: 30%;
  234. height: 80rpx;
  235. background: #F6F6F6;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. border-radius: 10rpx;
  240. margin: 0 10rpx 20rpx 10rpx;
  241. }
  242. .ActiveClass{
  243. background: #FFEAE7;
  244. color: #D95D4D;
  245. border: 1px solid #A13728;
  246. box-sizing: border-box;
  247. }
  248. }
  249. }
  250. .categorys{
  251. flex: 1;
  252. min-height: 0;
  253. margin-top: 16rpx;
  254. background-color: #fff;
  255. .categorys_item{
  256. padding: 24rpx;
  257. border-bottom: 1rpx solid #DEDEDE;
  258. }
  259. }
  260. .tabs{
  261. margin-top: 16rpx;
  262. background-color: #FBFBFB;
  263. display: flex;
  264. flex-wrap: wrap;
  265. justify-content: space-between;
  266. gap: 16rpx 0;
  267. padding: 24rpx 16rpx;
  268. .tab{
  269. width: 180rpx;
  270. height: 60rpx;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. background-color: #F7F7F7;
  275. font-size: 28rpx;
  276. position: relative;
  277. .newicon-xuanzejiaobiao{
  278. opacity: 0;
  279. position: absolute;
  280. right: 0;
  281. bottom: 0;
  282. font-size: 38rpx;
  283. color: #53B9BB;
  284. }
  285. &.active{
  286. background-color: rgba(149, 220, 231, 0.30);
  287. .newicon-xuanzejiaobiao{
  288. opacity: 1;
  289. }
  290. }
  291. }
  292. }
  293. .area,
  294. .category,
  295. .acceptDate{
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. padding: 24rpx;
  300. background-color: #fff;
  301. margin-top: 24rpx;
  302. .name{
  303. font-size: 28rpx;
  304. flex-shrink: 0;
  305. margin-right: 24rpx;
  306. }
  307. .flex-1{
  308. flex: 3;
  309. }
  310. }
  311. .container_foot{
  312. .clear{
  313. padding: 24rpx;
  314. font-size: 28rpx;
  315. background-color: #fff;
  316. margin: 0 16rpx;
  317. display: flex;
  318. align-items: center;
  319. justify-content: center;
  320. }
  321. .foot_btns{
  322. margin-top: 24rpx;
  323. display: flex;
  324. border-top: 1rpx solid #BFBFBF;
  325. .cancel{
  326. flex: 1;
  327. background-color: #fff;
  328. font-size: 32rpx;
  329. padding: 24rpx;
  330. display: flex;
  331. justify-content: center;
  332. }
  333. .submit{
  334. color: #49b856;
  335. border-left: 1px solid #BFBFBF;
  336. }
  337. .confirm{
  338. flex: 1;
  339. font-size: 32rpx;
  340. padding: 24rpx;
  341. background-color: $uni-primary;
  342. display: flex;
  343. justify-content: center;
  344. color: #fff;
  345. }
  346. }
  347. }
  348. }
  349. </style>