taskPreview.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view class="taskPreview">
  3. <view class="title">任务预览</view>
  4. <view class="box1">
  5. <view class="row1">
  6. <view class="top">
  7. <text>主题:{{title}}</text>
  8. <view @click="goMapList">
  9. <text>查看查核地图</text>
  10. <image src="../../../static/icon-blueMore.png"></image>
  11. </view>
  12. </view>
  13. <view class="list">
  14. <text v-for="(item, index) in list" :key="index">{{item.name}}</text>
  15. </view>
  16. </view>
  17. <view class="row2">
  18. <view class="item">
  19. <text>职能科室</text>
  20. <text>{{situationsCenter.currentSelectedSituation.checkGroupName}}</text>
  21. </view>
  22. <view class="item">
  23. <text>查核人</text>
  24. <text>{{(checkPerson.checkedItems.map(item=>item.empName)).join(',')}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="box2">
  29. <view>
  30. <text>计划频率</text>
  31. <text style="padding-left: 20px;">{{checkPlan.checkedItem.label}}</text>
  32. </view>
  33. <view>
  34. <text>起止时间</text>
  35. <text style="padding-left: 20px;">{{`${checkPlan.dateObj.start} ~ ${checkPlan.dateObj.end}`}}</text>
  36. </view>
  37. <view>
  38. <text>查核频次</text>
  39. <text style="padding-left: 20px;">{{checkPlan.checkList.length}}</text>
  40. </view>
  41. <view class="situationType" @click="selectSituationType">
  42. <text>情境类型</text>
  43. <text class="typeValue">{{situationTypeName}}</text>
  44. <image class="arrowRight" src="../../../static/incon-more.png" mode=""></image>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { mapState,mapMutations } from "vuex";
  51. export default {
  52. data(){
  53. return {
  54. ifShowTemplateSelector:false,//是否展示选择模版的选项
  55. }
  56. },
  57. computed: {
  58. ...mapState({
  59. theme: state => state.creatingSituations.theme,
  60. checkPlan: state => state.creatingSituations.checkPlan,
  61. condition: state => state.creatingSituations.condition,
  62. checkRent: state => state.creatingSituations.checkRent,
  63. situationPreview: state => state.creatingSituations.situationPreview,
  64. situationsCenter: state => state.situationsCenter,
  65. checkPerson: state => state.creatingSituations.checkPerson,
  66. situationTypeList:state => state.creatingSituations.situationTypeList
  67. }),
  68. situationTypeName(){
  69. if(this.situationTypeList.length>0&&this.situationPreview){
  70. const temp = this.situationTypeList.filter(item=>item.situationType == this.situationPreview.situationType);
  71. return temp.length>0?temp[0].situationTypeName:null;
  72. }
  73. return null;
  74. },
  75. list: function() {
  76. const { conditionIds, options } = this.condition;
  77. let list = [];
  78. this.loopOptions(options, conditionIds, list);
  79. return list;
  80. },
  81. title(){
  82. if(this.theme.id == 0)return '个案追踪';
  83. if(this.theme.id == 1)return '普通';
  84. if(this.theme.id == 2)return '自查督查';
  85. }
  86. },
  87. watch:{
  88. situationPreview(newVal){
  89. if(newVal.situationType == 2){
  90. //情境类型为分页时
  91. this.ifShowTemplateSelector = true;
  92. this.dispatch('getTemplates').then(res=>{
  93. this.$store.commit('creatingSituations/comChangeState',{key:'templateList',data:res});
  94. })
  95. }else {
  96. this.ifShowTemplateSelector = false;
  97. this.$store.commit('creatingSituations/comChangeState',{key:'templateList',data:[]});
  98. }
  99. }
  100. },
  101. methods: {
  102. ...mapMutations(['comChangeState']),
  103. selectSituationType(){
  104. // this.$refs.popup.open();
  105. this.$store.commit('creatingSituations/comChangeState',{key:'popupType',data:1});
  106. this.$store.commit('creatingSituations/comChangeState',{key:'showPopupSelectorList',data:true});
  107. },
  108. selectTemplateHandle(){
  109. this.$store.commit('creatingSituations/comChangeState',{key:'popupType',data:2});
  110. this.$store.commit('creatingSituations/comChangeState',{key:'showPopupSelectorList',data:true});
  111. },
  112. loopOptions: function(arr, conditionIds, list) {
  113. arr.map((item)=>{
  114. if(conditionIds.includes(item.id)) {
  115. list.push(item);
  116. }
  117. if(item.children.length > 0) {
  118. this.loopOptions(item.children, conditionIds, list);
  119. }
  120. });
  121. },
  122. goMapList: function() {
  123. uni.navigateTo({
  124. url: '/pages/checkMapList/checkMapList'
  125. });
  126. },
  127. setIfShowNotApplicable(){
  128. const showNotApplicable = this.situationPreview.showNotApplicable;
  129. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,showNotApplicable:showNotApplicable?0:1}});
  130. },
  131. setIfCountNum(){
  132. const showCountNum = this.situationPreview.showCountNum;
  133. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,showCountNum:showCountNum?0:1}});
  134. },
  135. dispatch: function(key, data) {
  136. return this.$store.dispatch({type: 'creatingSituations/commActions', key, data});
  137. },
  138. }
  139. }
  140. </script>
  141. <style lang="less">
  142. .taskPreview {
  143. overflow: hidden;
  144. font-size: 22.5rpx;
  145. line-height: 33.75rpx;
  146. color: #292C33;
  147. .box1,
  148. .box2 {
  149. margin-bottom: 15rpx;
  150. padding: 25rpx;
  151. width: 100%;
  152. background-color: #fff;
  153. }
  154. .box1 {
  155. display: flex;
  156. flex-direction: column;
  157. .row1 {
  158. display: flex;
  159. flex-direction: column;
  160. margin-bottom: 35rpx;
  161. .top {
  162. display: flex;
  163. flex-direction: row;
  164. justify-content: space-between;
  165. margin-bottom: 6.25rpx;
  166. >text {
  167. font-size: 30rpx;
  168. line-height: 45rpx;
  169. }
  170. >view {
  171. display: flex;
  172. flex-direction: row;
  173. align-items: center;
  174. font-size: 20rpx;
  175. line-height: 30rpx;
  176. color: #3377FF;
  177. image {
  178. margin-left: 10rpx;
  179. width: 11.87rpx;
  180. height: 20rpx;
  181. }
  182. }
  183. }
  184. .list {
  185. overflow: hidden;
  186. display: flex;
  187. flex-direction: row;
  188. flex-wrap: wrap;
  189. align-items: center;
  190. >text {
  191. margin-top: 6.25rpx;
  192. margin-right: 15rpx;
  193. border-radius: 5rpx;
  194. padding: 2.5rpx 20.62rpx;
  195. font-size: 17.5rpx;
  196. line-height: 26.25rpx;
  197. color: #7A8499;
  198. background-color: #EBEFF7;
  199. }
  200. }
  201. }
  202. .row2 {
  203. display: flex;
  204. flex-direction: row;
  205. justify-content: center;
  206. align-items: center;
  207. .item {
  208. display: flex;
  209. flex-direction: column;
  210. width: 47.5%;
  211. text {
  212. overflow: hidden;
  213. white-space: nowrap;
  214. text-overflow: ellipsis;
  215. font-size: 25rpx;
  216. line-height: 37.5rpx;
  217. }
  218. text:first-child {
  219. margin-bottom: 4.37rpx;
  220. font-size: 17.5rpx;
  221. line-height: 26.25rpx;
  222. color: #666F80;
  223. }
  224. &:first-child {
  225. margin-right: 5%;
  226. border-right: 1px solid #DADEE6;
  227. }
  228. }
  229. }
  230. }
  231. .box2 {
  232. padding: 0;
  233. padding-left: 25rpx;
  234. >view {
  235. display: flex;
  236. flex-direction: row;
  237. align-items: center;
  238. border-bottom: 1px solid #DADEE6;
  239. height: 87.5rpx;
  240. color: #525866;
  241. >text {
  242. white-space: nowrap;
  243. color: #292C33;
  244. }
  245. >input {
  246. padding: 0 9.37rpx;
  247. width: 80rpx;
  248. height: 33.75rpx;
  249. font-size: 22.5rpx;
  250. line-height: 33.75rpx;
  251. text-align: center;
  252. }
  253. &:last-child {
  254. border-bottom: 0;
  255. }
  256. &.input-wrap {
  257. display: flex;
  258. flex-direction: row;
  259. &:last-child {
  260. align-items: flex-start;
  261. padding: 20rpx 0;
  262. height: 200rpx;
  263. }
  264. view {
  265. margin-right: 40rpx;
  266. white-space: nowrap;
  267. }
  268. input, textarea {
  269. padding: 0;
  270. padding-right: 25rpx;
  271. width: 100%;
  272. font-size: 22.5rpx;
  273. line-height: 33.75rpx;
  274. text-align: left;
  275. }
  276. textarea {
  277. height: 100%;
  278. }
  279. }
  280. }
  281. .setIfShowNotApplicable {
  282. display: flex;
  283. flex-direction: row;
  284. justify-content: space-between;
  285. .icon {
  286. width: 30rpx;
  287. height: 30rpx;
  288. margin-right: 25rpx;
  289. }
  290. }
  291. .situationType {
  292. position: relative;
  293. .typeValue {
  294. display: inline-block;
  295. margin-left: 40rpx;
  296. }
  297. .arrowRight {
  298. position: absolute;
  299. right:20rpx;
  300. width: 15rpx;
  301. height: 25rpx;
  302. }
  303. }
  304. }
  305. }
  306. </style>