bottom-popup.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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:-3,//是否为进行中计划,判断下一个未开始的查核计划
  34. planList:[],//查核计划列表
  35. arrUnstarted:[],//未开始计划数组
  36. }
  37. },
  38. created: function() {
  39. this.$store.dispatch({
  40. type: 'situationDetail/commActions',
  41. payload: {
  42. key: 'planList',
  43. data:{
  44. situationId:this.situationID
  45. }
  46. }
  47. }).then((data) => {
  48. if (data) {
  49. this.planList=data.map((item,index)=>{
  50. if(item.status==1){
  51. this.arrUnstarted.push(item);
  52. this.flag=this.arrUnstarted[0].id;
  53. }
  54. return {
  55. id:item.id,
  56. name:item.name,
  57. startDate:item.startDate,
  58. endDate:item.endDate,
  59. status:item.status,
  60. isCompeleted:item.status==3?true:false,
  61. isContinued:item.status==2?true:false,
  62. isChecked:false,
  63. nameClass:item.id==this.flag?'item-text':'disable-text',
  64. }
  65. });
  66. }
  67. });
  68. },
  69. methods: {
  70. show(){
  71. this.showModalStatus=true;
  72. },
  73. hide(){
  74. this.showModalStatus=false;
  75. },
  76. hidePopupBox(){
  77. this.hide();
  78. },
  79. toggleSelect(item,index) {
  80. this.planList.map((item,index)=>{
  81. item.isChecked=false;
  82. });
  83. if(item.id==this.flag){
  84. this.planList[index].isChecked=true;
  85. this.selectedPlanID=item.id;
  86. }
  87. else{
  88. return;
  89. }
  90. },
  91. saveChange(){
  92. this.$store.dispatch({
  93. type: 'situationDetail/commActions',
  94. payload: {
  95. key: 'planAdvance',
  96. data:{
  97. checkId:this.selectedPlanID
  98. }
  99. }
  100. }).then((data)=>{
  101. if(data){
  102. this.hide();
  103. }
  104. });
  105. },
  106. },
  107. }
  108. </script>
  109. <style lang="less">
  110. .popup-page{
  111. height: 100%;
  112. width: 100%;
  113. position: fixed;
  114. top: 0rpx;
  115. left: 0rpx;
  116. // background: rgba(0,0,0,0.5);
  117. background-color: #FFFFFF;
  118. .popup-box{
  119. width: 100%;
  120. position: fixed;
  121. top: 0rpx;
  122. left: 0rpx;
  123. z-index: 2000;
  124. background-color: #FFFFFF;
  125. display: flex;
  126. flex-direction: column;
  127. overflow: hidden;
  128. .item-box{
  129. width: 100%;
  130. height: 87.5rpx;
  131. border: 0.62rpx solid #DADEE6;
  132. .radio-item {
  133. float: left;
  134. margin-left: 25rpx;
  135. margin-top: 30rpx;
  136. .icon {
  137. width: 25rpx;
  138. height: 25rpx;
  139. }
  140. }
  141. .item-text{
  142. font-size: 22.5rpx;
  143. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  144. font-weight: 400;
  145. color: #292C33;
  146. line-height: 87.5rpx;
  147. margin-left: 25rpx;
  148. float: left;
  149. }
  150. .disable-text{
  151. font-size: 22.5rpx;
  152. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  153. font-weight: 400;
  154. color: #666E80;
  155. line-height: 87.5rpx;
  156. margin-left: 25rpx;
  157. float: left;
  158. }
  159. .compeleted-box{
  160. width: 75rpx;
  161. height: 31.25rpx;
  162. border-radius: 8px;
  163. background: rgba(41, 204, 150, 0.1);
  164. text-align: center;
  165. float: left;
  166. margin-top: 28.12rpx;
  167. .compeleted-text{
  168. font-size: 17.5rpx;
  169. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  170. font-weight: 500;
  171. color: #29CC96;
  172. line-height: 31.25rpx;
  173. }
  174. }
  175. .continued-box{
  176. width: 75rpx;
  177. height: 31.25rpx;
  178. border-radius: 8px;
  179. background: rgba(255, 204, 102, 0.1);
  180. text-align: center;
  181. float: left;
  182. margin-top: 28.12rpx;
  183. .continued-text{
  184. width: 75rpx;
  185. height: 31.25rpx;
  186. font-size: 17.5rpx;
  187. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  188. font-weight: 500;
  189. color: #FFAA00;
  190. line-height: 31.25rpx;
  191. }
  192. }
  193. .checked-pic{
  194. width: 19.37rpx;
  195. height: 14.37rpx;
  196. float: right;
  197. margin-top: 36.87rpx;
  198. margin-right: 25rpx;
  199. }
  200. }
  201. }
  202. .btn-confirm {
  203. width: 750rpx;
  204. height: 75rpx;
  205. background: #3377FF;
  206. position: fixed;
  207. bottom: 0rpx;
  208. .btn-text {
  209. font-size: 22.5rpx;
  210. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  211. font-weight: 400;
  212. color: #FFFFFF;
  213. line-height: 75rpx;
  214. margin-left: 352.5rpx;
  215. }
  216. }
  217. }
  218. </style>