bottom-popup.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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" :key="index">
  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. z-index: 10001;
  117. // background: rgba(0,0,0,0.5);
  118. background-color: #FFFFFF;
  119. .popup-box{
  120. width: 100%;
  121. position: fixed;
  122. top: 0rpx;
  123. left: 0rpx;
  124. z-index: 2000;
  125. background-color: #FFFFFF;
  126. display: flex;
  127. flex-direction: column;
  128. overflow: hidden;
  129. .item-box{
  130. width: 100%;
  131. height: 87.5rpx;
  132. border: 0.62rpx solid #DADEE6;
  133. .radio-item {
  134. float: left;
  135. margin-left: 25rpx;
  136. margin-top: 30rpx;
  137. .icon {
  138. width: 25rpx;
  139. height: 25rpx;
  140. }
  141. }
  142. .item-text{
  143. font-size: 22.5rpx;
  144. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  145. font-weight: 400;
  146. color: #292C33;
  147. line-height: 87.5rpx;
  148. margin-left: 25rpx;
  149. float: left;
  150. }
  151. .disable-text{
  152. font-size: 22.5rpx;
  153. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  154. font-weight: 400;
  155. color: #666E80;
  156. line-height: 87.5rpx;
  157. margin-left: 25rpx;
  158. float: left;
  159. }
  160. .compeleted-box{
  161. width: 75rpx;
  162. height: 31.25rpx;
  163. border-radius: 8px;
  164. background: rgba(41, 204, 150, 0.1);
  165. text-align: center;
  166. float: left;
  167. margin-top: 28.12rpx;
  168. .compeleted-text{
  169. font-size: 17.5rpx;
  170. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  171. font-weight: 500;
  172. color: #29CC96;
  173. line-height: 31.25rpx;
  174. }
  175. }
  176. .continued-box{
  177. width: 75rpx;
  178. height: 31.25rpx;
  179. border-radius: 8px;
  180. background: rgba(255, 204, 102, 0.1);
  181. text-align: center;
  182. float: left;
  183. margin-top: 28.12rpx;
  184. .continued-text{
  185. width: 75rpx;
  186. height: 31.25rpx;
  187. font-size: 17.5rpx;
  188. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  189. font-weight: 500;
  190. color: #FFAA00;
  191. line-height: 31.25rpx;
  192. }
  193. }
  194. .checked-pic{
  195. width: 19.37rpx;
  196. height: 14.37rpx;
  197. float: right;
  198. margin-top: 36.87rpx;
  199. margin-right: 25rpx;
  200. }
  201. }
  202. }
  203. .btn-confirm {
  204. width: 750rpx;
  205. height: 75rpx;
  206. background: #3377FF;
  207. position: fixed;
  208. bottom: 0rpx;
  209. .btn-text {
  210. font-size: 22.5rpx;
  211. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  212. font-weight: 400;
  213. color: #FFFFFF;
  214. line-height: 75rpx;
  215. margin-left: 352.5rpx;
  216. }
  217. }
  218. }
  219. </style>