bottom-popup.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="popup-page" v-show="showModalStatus">
  3. <view class="popup-box" v-show="showModalStatus">
  4. <view class="item-box" v-for="(item,index) in planList">
  5. <view class="radio-item" @click="toggleSelect(item,index)">
  6. <image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
  7. </view>
  8. <text :class="item.nameClass">{{item.name}}({{item.startDate}} ~ {{item.endDate}})</text>
  9. <view class="compeleted-box" v-if="item.isCompeleted">
  10. <text class="compeleted-text" >已完成</text>
  11. </view>
  12. <view class="continued-box" v-if="item.isContinued">
  13. <text class="continued-text" >进行中</text>
  14. </view>
  15. <image class="checked-pic" v-if="item.isContinued" src="../../../static/checkStatus.png"></image>
  16. </view>
  17. </view>
  18. <view class="btn-confirm" @click="saveChange">
  19. <text class="btn-text">确定</text>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props:{
  26. situationID:String,
  27. },
  28. data() {
  29. return {
  30. currentType:this.type,//当前类型
  31. selectedPlanID:'',//选择的计划id
  32. showModalStatus:false,//查核计划选择弹框
  33. flag:0,//是否为进行中计划,判断下一个未开始的查核计划
  34. // isCompeleted:false,//计划进行状态,是否已完成,状态的显示
  35. // isContinued:true,//是否进行中
  36. planList:[
  37. {
  38. id:'1',
  39. name:'第1次查核',
  40. startDate:'2021-02-05',
  41. endDate:'2021-02-10',
  42. status:3,
  43. },
  44. {
  45. id:'2',
  46. name:'第2次查核',
  47. startDate:'2021-02-05',
  48. endDate:'2021-02-10',
  49. status:2
  50. },
  51. {
  52. id:'3',
  53. name:'第3次查核',
  54. startDate:'2021-02-05',
  55. endDate:'2021-02-10',
  56. status:1
  57. },
  58. {
  59. id:'4',
  60. name:'第4次查核',
  61. startDate:'2021-02-05',
  62. endDate:'2021-02-10',
  63. status:1
  64. },
  65. ],//查核计划列表
  66. }
  67. },
  68. created: function() {
  69. // this.$store.dispatch({
  70. // type: 'situationDetail/commActions',
  71. // payload: {
  72. // key: 'planlList',
  73. // data:{
  74. // situationId:this.situationID
  75. // }
  76. // }
  77. // }).then((data) => {
  78. // console.log(data);
  79. // if (data) {
  80. // this.planList=data.map((item,index)=>{
  81. // if(item.status==2){
  82. // this.flag=index;
  83. // }
  84. // return {
  85. // id:item.id,
  86. // name:item.name,
  87. // startDate:item.startDate,
  88. // endDate:item.endDate,
  89. // status:item.status,
  90. // isCompeleted:item.status==3?true:false,
  91. // isContinued:item.status==2?true:false,
  92. // isChecked:false,
  93. // nameClass:index==this.flag+1?'item-text':'disable-text',
  94. // }
  95. // });
  96. // }
  97. // });
  98. this.planList=this.planList.map((item,index)=>{
  99. if(item.status==2){
  100. this.flag=index;
  101. }
  102. return {
  103. id:item.id,
  104. name:item.name,
  105. startDate:item.startDate,
  106. endDate:item.endDate,
  107. status:item.status,
  108. isCompeleted:item.status==3?true:false,
  109. isContinued:item.status==2?true:false,
  110. isChecked:false,
  111. nameClass:index==this.flag+1?'item-text':'disable-text',
  112. }
  113. });
  114. },
  115. methods: {
  116. show(){
  117. this.showModalStatus=true;
  118. },
  119. hide(){
  120. this.showModalStatus=false;
  121. },
  122. hidePopupBox(){
  123. this.hide();
  124. },
  125. toggleSelect(item,index) {
  126. this.planList.map((item,index)=>{
  127. item.isChecked=false;
  128. });
  129. if(index==this.flag+1){
  130. this.planList[index].isChecked=true;
  131. this.selectedPlanID=item.id;
  132. }
  133. else{
  134. return;
  135. }
  136. },
  137. saveChange(){
  138. this.$store.dispatch({
  139. type: 'situationDetail/commActions',
  140. payload: {
  141. key: 'planlAdvance',
  142. data:{
  143. checkId:this.selectedPlanID
  144. }
  145. }
  146. }).then((data)=>{
  147. console.log(data);
  148. this.hide();
  149. });
  150. },
  151. },
  152. }
  153. </script>
  154. <style lang="less">
  155. .popup-page{
  156. height: 100%;
  157. width: 100%;
  158. position: fixed;
  159. top: 0rpx;
  160. left: 0rpx;
  161. // background: rgba(0,0,0,0.5);
  162. background-color: #FFFFFF;
  163. .popup-box{
  164. width: 100%;
  165. position: fixed;
  166. top: 0rpx;
  167. left: 0rpx;
  168. z-index: 2000;
  169. background-color: #FFFFFF;
  170. display: flex;
  171. flex-direction: column;
  172. overflow: hidden;
  173. .item-box{
  174. width: 100%;
  175. height: 87.5rpx;
  176. border: 0.62rpx solid #DADEE6;
  177. .radio-item {
  178. float: left;
  179. margin-left: 25rpx;
  180. margin-top: 30rpx;
  181. .icon {
  182. width: 25rpx;
  183. height: 25rpx;
  184. }
  185. }
  186. .item-text{
  187. font-size: 22.5rpx;
  188. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  189. font-weight: 400;
  190. color: #292C33;
  191. line-height: 87.5rpx;
  192. margin-left: 25rpx;
  193. float: left;
  194. }
  195. .disable-text{
  196. font-size: 22.5rpx;
  197. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  198. font-weight: 400;
  199. color: #666E80;
  200. line-height: 87.5rpx;
  201. margin-left: 25rpx;
  202. float: left;
  203. }
  204. .compeleted-box{
  205. width: 75rpx;
  206. height: 31.25rpx;
  207. border-radius: 8px;
  208. background: rgba(41, 204, 150, 0.1);
  209. text-align: center;
  210. float: left;
  211. margin-top: 28.12rpx;
  212. .compeleted-text{
  213. font-size: 17.5rpx;
  214. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  215. font-weight: 500;
  216. color: #29CC96;
  217. line-height: 31.25rpx;
  218. }
  219. }
  220. .continued-box{
  221. width: 75rpx;
  222. height: 31.25rpx;
  223. border-radius: 8px;
  224. background: rgba(255, 204, 102, 0.1);
  225. text-align: center;
  226. float: left;
  227. margin-top: 28.12rpx;
  228. .continued-text{
  229. width: 75rpx;
  230. height: 31.25rpx;
  231. font-size: 17.5rpx;
  232. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  233. font-weight: 500;
  234. color: #FFAA00;
  235. line-height: 31.25rpx;
  236. }
  237. }
  238. .checked-pic{
  239. width: 19.37rpx;
  240. height: 14.37rpx;
  241. float: right;
  242. margin-top: 36.87rpx;
  243. margin-right: 25rpx;
  244. }
  245. }
  246. }
  247. .btn-confirm {
  248. width: 750rpx;
  249. height: 75rpx;
  250. background: #3377FF;
  251. position: fixed;
  252. bottom: 0rpx;
  253. .btn-text {
  254. font-size: 22.5rpx;
  255. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  256. font-weight: 400;
  257. color: #FFFFFF;
  258. line-height: 75rpx;
  259. margin-left: 352.5rpx;
  260. }
  261. }
  262. }
  263. </style>