situationsCenter.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="situationsCenter-page">
  3. <view class="situation-list">
  4. <view class="search-box">
  5. <view class="search-model" @click="openSearchBar" v-show="isSearchBoxShow">
  6. <image class="search-pic" src="/static/search.png"></image>
  7. </view>
  8. <view class="search-bar" v-show="isSearchBarShow">
  9. <view class="search-item">
  10. <image class="search-pic" src="/static/search.png"></image>
  11. <image class="text-clear" @click="valueEmpty" src="/static/text-clear.png"></image>
  12. <input class="searh-input" v-model="inputValue" @confirm="searchByKeywords($event)" placeholder="搜索项目" placeholder-style="font-weight: 400,color: #A1A7B3" />
  13. </view>
  14. <text class="cancel-text" @click="closeSearchBar">取消</text>
  15. </view>
  16. </view>
  17. <scroll-view class="scroll-box" scroll-y="true" @scrolltolower="toLower" lower-threshold="184">
  18. <view class="content">
  19. <view class="situation" v-for="(item,index) in situationList" :key="item.id" @click="gotoDetail(item.situationID)">
  20. <image class="situation-topic" :src="`/static/${item.topic ? 'situation-case' : 'situation-system'}.png`"></image>
  21. <view class="title">
  22. <text class="title-name">{{item.name}}</text>
  23. </view>
  24. <view class="check-group">
  25. <text class="group-text">{{item.checkGroupName}}</text>
  26. </view>
  27. <view class="row">
  28. <image class="situation-check" src="/static/situation-check.png"></image>
  29. <text class="text">{{item.checkStatus}}</text>
  30. </view>
  31. <view class="row">
  32. <image class="situation-time" src="/static/situation-time.png"></image>
  33. <text class="text">{{item.nextCheckTime}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. <view class="situaions-add" @click="gotoCreate">
  40. <image class="add-pic" src="/static/situation-add.png"></image>
  41. </view>
  42. <tm-tabbar :permission="nowPermission" />
  43. </view>
  44. </template>
  45. /**
  46. * 情境中心
  47. */
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. page:1,//页数
  53. inputValue:'',
  54. nowPermission:'',
  55. isSearchBarShow:false,//搜索栏是否可见
  56. isSearchBoxShow:true,//搜索图标是否可见
  57. // situationList:[],//情境卡片列表
  58. totalCount:'',//返回数据的总条数
  59. situationList:[
  60. {
  61. name:"药物管理系统追踪访查",
  62. checkStatus:"第2/9次查核进行中",
  63. nextCheckTime:"距离计划结束12天06小时",
  64. checkGroupName:"查核二组",
  65. topic:true,
  66. situationID:16
  67. },
  68. {
  69. name:"药物管理系统追踪访查",
  70. checkStatus:"第2/9次查核进行中",
  71. nextCheckTime:"距离计划结束12天06小时",
  72. checkGroupName:"查核二组",
  73. topic:false,
  74. situationID:17
  75. },
  76. {
  77. name:"药物管理系统追踪访查",
  78. checkStatus:"第2/9次查核进行中",
  79. nextCheckTime:"距离计划结束12天06小时",
  80. checkGroupName:"查核二组",
  81. topic:true,
  82. situationID:26
  83. },
  84. {
  85. name:"药物管理系统追踪访查",
  86. checkStatus:"第2/9次查核进行中",
  87. nextCheckTime:"距离计划结束12天06小时",
  88. checkGroupName:"查核二组",
  89. topic:true,
  90. situationID:1
  91. }
  92. ]
  93. }
  94. },
  95. created: function() {
  96. this.nowPermission=uni.getStorageSync('nowPermission');
  97. this.$store.dispatch({
  98. type: 'situationsCenter/commActions',
  99. payload: {
  100. key: 'situationList',
  101. data:{
  102. pageNum:1,
  103. pageSize:10
  104. }
  105. }
  106. }).then((data) => {
  107. if (data) {
  108. // this.totalCount=data.totalCount;
  109. // this.situationList=data.list.map((item,index)=>{
  110. // return{
  111. // name:item.name,
  112. // checkStatus:item.checkStatus,
  113. // nextCheckTime:item.nextCheckTime,
  114. // checkGroupName:item.checkGroupName,
  115. // topic:item.topic==0?true:false,
  116. // situationID:item.id,
  117. // }
  118. // });
  119. }
  120. });
  121. },
  122. methods: {
  123. openSearchBar(){
  124. this.isSearchBarShow=true;
  125. this.isSearchBoxShow=false;
  126. },
  127. closeSearchBar(){
  128. this.isSearchBarShow=false;
  129. this.isSearchBoxShow=true;
  130. },
  131. valueEmpty(){
  132. this.inputValue='';
  133. },
  134. gotoCreate(){
  135. uni.navigateTo({
  136. url: '/pages/creatingSituations/creatingSituations'
  137. });
  138. },
  139. gotoDetail(id){
  140. uni.navigateTo({
  141. url: `/pages/situationDetail/situationDetail?situationId=${id}`
  142. });
  143. },
  144. searchByKeywords(event){
  145. console.log(event);
  146. this.$store.dispatch({
  147. type: 'situationsCenter/commActions',
  148. payload: {
  149. key: 'situationList',
  150. data:{
  151. pageNum:1,
  152. pageSize:10,
  153. keyword:event.target.value,
  154. }
  155. }
  156. }).then((data)=>{
  157. if (data) {
  158. this.situationList=data.list.map((item,index)=>{
  159. return{
  160. name:item.name,
  161. checkStatus:item.checkStatus,
  162. nextCheckTime:item.nextCheckTime,
  163. checkGroupName:item.checkGroupName,
  164. topic:item.topic==0?true:false,
  165. }
  166. });
  167. }
  168. });
  169. },
  170. toLower(){
  171. uni.showToast({
  172. title:'加载中....',
  173. icon:'loading',
  174. duration:2000
  175. });
  176. let count=this.situationList.length;
  177. if(this.totalCount!=count){
  178. this.page++;
  179. this.$store.dispatch({
  180. type: 'situationsCenter/commActions',
  181. payload: {
  182. key: 'situationList',
  183. data:{
  184. pageNum:this.page,
  185. pageSize:10
  186. }
  187. }
  188. }).then((data) => {
  189. if (data) {
  190. this.situationList=data.list.map((item,index)=>{
  191. return{
  192. name:item.name,
  193. checkStatus:item.checkStatus,
  194. nextCheckTime:item.nextCheckTime,
  195. checkGroupName:item.checkGroupName,
  196. topic:item.topic==0?true:false,
  197. situationID:item.id,
  198. }
  199. });
  200. }
  201. });
  202. }
  203. else{
  204. uni.showToast({
  205. title:'没有更多数据了',
  206. icon:'none',
  207. duration:1000
  208. });
  209. }
  210. },
  211. }
  212. }
  213. </script>
  214. <style lang="less">
  215. .situationsCenter-page{
  216. height: 100%;
  217. .situation-list{
  218. // display: flex;
  219. // flex-flow: row wrap;
  220. // margin-top: 12.5rpx;
  221. position: relative;
  222. .search-box{
  223. position: absolute;
  224. left: 25rpx;
  225. top: 0rpx;
  226. z-index: 2;
  227. .search-model{
  228. height: 62.5rpx;
  229. width: 62.5rpx;
  230. background-color: #FFFFFF;
  231. text-align: center;
  232. border-radius: 50%;
  233. box-shadow: 0px 10px 10px 0px rgba(217, 221, 228, 0.5);
  234. border: 1px solid #E6EAF2;
  235. opacity: 0.85;
  236. .search-pic{
  237. width: 27.5rpx;
  238. height: 27.5rpx;
  239. margin-top: 17.5rpx;
  240. }
  241. }
  242. .search-bar{
  243. background-color: #FFFFFF;
  244. width: 700rpx;
  245. height: 62.5rpx;
  246. top: 31.25rpx;
  247. position: absolute;
  248. z-index: 2;
  249. .search-item{
  250. background-color: #FFFFFF;
  251. width: 593.75rpx;
  252. height: 62.5rpx;
  253. float: left;
  254. border-radius: 6.25rpx;
  255. border: 1.25rpx solid #F0F2F7;
  256. .search-pic{
  257. width: 21.87rpx;
  258. height: 21.87rpx;
  259. margin-left:12.5rpx ;
  260. margin-top: 20.62rpx;
  261. float: left;
  262. }
  263. .searh-input{
  264. background-color: #FFFFFF;
  265. width: 525rpx;
  266. height: 55rpx;
  267. font-size: 22.5rpx;
  268. float: right;
  269. margin-top: 3.75rpx;
  270. margin-left: 3.12rpx;
  271. }
  272. .text-clear{
  273. width: 21.87rpx;
  274. height: 21.87rpx;
  275. float: right;
  276. margin-top: 20.62rpx;
  277. margin-right: 6.25rpx;
  278. }
  279. }
  280. .cancel-text{
  281. font-size: 22.5rpx;
  282. line-height: 62.5rpx;
  283. color: #A1A7B3;
  284. margin-right: 31.25rpx;
  285. float: right;
  286. }
  287. }
  288. }
  289. .scroll-box{
  290. height: 1072.5rpx;
  291. width: 750rpx;
  292. // margin-top: 25rpx;
  293. .content{
  294. display: flex;
  295. flex-flow: row wrap;
  296. .situation{
  297. height: 187.5rpx;
  298. width: 337.5rpx;
  299. background: #FFFFFF;
  300. box-shadow: 0px 6px 20px 0px rgba(0, 13, 51, 0.1);
  301. border-radius: 8px;
  302. margin-left: 25rpx;
  303. margin-top: 25rpx;
  304. .situation-topic{
  305. width: 62.5rpx;
  306. height: 25rpx;
  307. float: right;
  308. }
  309. .title{
  310. height: 22.5rpx;
  311. margin-left: 20rpx;
  312. margin-top: 25rpx;
  313. display: flex;
  314. align-items: center;
  315. .title-name{
  316. font-size: 22.5rpx;
  317. font-family: SourceHanSansCN-Bold, SourceHanSansCN;
  318. font-weight: bold;
  319. color: #292C33;
  320. }
  321. }
  322. .check-group{
  323. margin-left: 20rpx;
  324. margin-top: 15rpx;
  325. margin-bottom: 25rpx;
  326. height: 17.5rpx;
  327. display: flex;
  328. align-items: center;
  329. .group-text{
  330. font-size: 17.5rpx;
  331. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  332. font-weight: 400;
  333. color: #666E80;
  334. }
  335. }
  336. .row{
  337. margin-left: 20rpx;
  338. margin-bottom: 17.5rpx;
  339. display: flex;
  340. align-items: center;
  341. height: 20rpx;
  342. .situation-check{
  343. width: 20rpx;
  344. height: 20rpx;
  345. }
  346. .situation-time{
  347. width: 20rpx;
  348. height: 20rpx;
  349. }
  350. .text{
  351. font-size: 20rpx;
  352. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  353. font-weight: 400;
  354. color: #292C33;
  355. margin-left: 11.25rpx;
  356. }
  357. }
  358. }
  359. }
  360. }
  361. }
  362. .situaions-add{
  363. position: absolute;
  364. right: 25rpx;
  365. bottom: 130rpx;
  366. .add-pic{
  367. width: 75rpx;
  368. height: 75rpx;
  369. }
  370. }
  371. }
  372. </style>