taskPreview.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. <!--add by yfb 20230417-->
  47. <view class="pointsetType" @click="pointsetTypeHandle">
  48. <text>计分方式</text>
  49. <text class="typeValue">{{pointsetTypeName}}</text>
  50. <image class="arrowRight" src="../../../static/incon-more.png" mode=""></image>
  51. </view>
  52. <view v-if="ifShowSetTotal" class="pointsetTotal">
  53. <text>设置总分分值</text>
  54. <input v-model="situationPreview.preTotal" placeholder="请输入" type="number" />
  55. <text>分</text>
  56. </view>
  57. <!--end 20230417-->
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import { mapState,mapMutations } from "vuex";
  63. export default {
  64. data(){
  65. return {
  66. ifShowTemplateSelector:false,//是否展示选择模版的选项
  67. ifShowSetTotal:false,//是否展示填写总分分值内容
  68. taskPointsetType:null,
  69. taskPreTotal:0,
  70. }
  71. },
  72. computed: {
  73. ...mapState({
  74. theme: state => state.creatingSituations.theme,
  75. checkPlan: state => state.creatingSituations.checkPlan,
  76. condition: state => state.creatingSituations.condition,
  77. checkRent: state => state.creatingSituations.checkRent,
  78. situationPreview: state => state.creatingSituations.situationPreview,
  79. situationsCenter: state => state.situationsCenter,
  80. checkPerson: state => state.creatingSituations.checkPerson,
  81. situationTypeList:state => state.creatingSituations.situationTypeList,
  82. pointsetTypeList:state=>state.creatingSituations.pointsetTypeList //add by yfb 20230417
  83. }),
  84. situationTypeName(){
  85. if(this.situationTypeList.length>0&&this.situationPreview){
  86. const temp = this.situationTypeList.filter(item=>item.situationType == this.situationPreview.situationType);
  87. return temp.length>0?temp[0].situationTypeName:null;
  88. }
  89. return null;
  90. },
  91. pointsetTypeName(){
  92. if(this.pointsetTypeList.length>0&&this.situationPreview){
  93. const temp = this.pointsetTypeList.filter(item=>item.pointsetType == this.situationPreview.pointsetType);
  94. return temp.length>0?temp[0].pointsetTypeName:null;
  95. }
  96. return null;
  97. },
  98. list: function() {
  99. const { conditionIds, options } = this.condition;
  100. let list = [];
  101. this.loopOptions(options, conditionIds, list);
  102. return list;
  103. },
  104. title(){
  105. if(this.theme.id == 0)return '个案追踪';
  106. if(this.theme.id == 1)return '普通';
  107. if(this.theme.id == 2)return '自查督查';
  108. }
  109. },
  110. watch:{
  111. situationPreview(newVal){
  112. if(newVal.situationType == 2){
  113. //情境类型为分页时
  114. this.ifShowTemplateSelector = true;
  115. this.dispatch('getTemplates').then(res=>{
  116. this.$store.commit('creatingSituations/comChangeState',{key:'templateList',data:res});
  117. })
  118. }else {
  119. this.ifShowTemplateSelector = false;
  120. this.$store.commit('creatingSituations/comChangeState',{key:'templateList',data:[]});
  121. }
  122. if (newVal.pointsetType == 2){
  123. //情境类型为预设总分
  124. this.ifShowSetTotal=true;
  125. }else{
  126. //
  127. this.ifShowSetTotal=false;
  128. }
  129. }
  130. },
  131. methods: {
  132. ...mapMutations(['comChangeState']),
  133. selectSituationType(){
  134. // this.$refs.popup.open();
  135. this.$store.commit('creatingSituations/comChangeState',{key:'popupType',data:1});
  136. this.$store.commit('creatingSituations/comChangeState',{key:'showPopupSelectorList',data:true});
  137. },
  138. selectTemplateHandle(){
  139. this.$store.commit('creatingSituations/comChangeState',{key:'popupType',data:2});
  140. this.$store.commit('creatingSituations/comChangeState',{key:'showPopupSelectorList',data:true});
  141. },
  142. pointsetTypeHandle(){
  143. // this.$refs.popup.open();
  144. this.$store.commit('creatingSituations/comChangeState',{key:'popupType',data:3});
  145. this.$store.commit('creatingSituations/comChangeState',{key:'showPopupSelectorList',data:true});
  146. },
  147. loopOptions: function(arr, conditionIds, list) {
  148. arr.map((item)=>{
  149. if(conditionIds.includes(item.id)) {
  150. list.push(item);
  151. }
  152. if(item.children.length > 0) {
  153. this.loopOptions(item.children, conditionIds, list);
  154. }
  155. });
  156. },
  157. goMapList: function() {
  158. uni.navigateTo({
  159. url: '/pages/checkMapList/checkMapList'
  160. });
  161. },
  162. setIfShowNotApplicable(){
  163. const showNotApplicable = this.situationPreview.showNotApplicable;
  164. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,showNotApplicable:showNotApplicable?0:1}});
  165. },
  166. setIfCountNum(){
  167. const showCountNum = this.situationPreview.showCountNum;
  168. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,showCountNum:showCountNum?0:1}});
  169. },
  170. dispatch: function(key, data) {
  171. return this.$store.dispatch({type: 'creatingSituations/commActions', key, data});
  172. },
  173. }
  174. }
  175. </script>
  176. <style lang="less">
  177. .taskPreview {
  178. overflow: hidden;
  179. font-size: 22.5rpx;
  180. line-height: 33.75rpx;
  181. color: #292C33;
  182. .box1,
  183. .box2 {
  184. margin-bottom: 15rpx;
  185. padding: 25rpx;
  186. width: 100%;
  187. background-color: #fff;
  188. }
  189. .box1 {
  190. display: flex;
  191. flex-direction: column;
  192. .row1 {
  193. display: flex;
  194. flex-direction: column;
  195. margin-bottom: 35rpx;
  196. .top {
  197. display: flex;
  198. flex-direction: row;
  199. justify-content: space-between;
  200. margin-bottom: 6.25rpx;
  201. >text {
  202. font-size: 30rpx;
  203. line-height: 45rpx;
  204. }
  205. >view {
  206. display: flex;
  207. flex-direction: row;
  208. align-items: center;
  209. font-size: 20rpx;
  210. line-height: 30rpx;
  211. color: #3377FF;
  212. image {
  213. margin-left: 10rpx;
  214. width: 11.87rpx;
  215. height: 20rpx;
  216. }
  217. }
  218. }
  219. .list {
  220. overflow: hidden;
  221. display: flex;
  222. flex-direction: row;
  223. flex-wrap: wrap;
  224. align-items: center;
  225. >text {
  226. margin-top: 6.25rpx;
  227. margin-right: 15rpx;
  228. border-radius: 5rpx;
  229. padding: 2.5rpx 20.62rpx;
  230. font-size: 17.5rpx;
  231. line-height: 26.25rpx;
  232. color: #7A8499;
  233. background-color: #EBEFF7;
  234. }
  235. }
  236. }
  237. .row2 {
  238. display: flex;
  239. flex-direction: row;
  240. justify-content: center;
  241. align-items: center;
  242. .item {
  243. display: flex;
  244. flex-direction: column;
  245. width: 47.5%;
  246. text {
  247. overflow: hidden;
  248. white-space: nowrap;
  249. text-overflow: ellipsis;
  250. font-size: 25rpx;
  251. line-height: 37.5rpx;
  252. }
  253. text:first-child {
  254. margin-bottom: 4.37rpx;
  255. font-size: 17.5rpx;
  256. line-height: 26.25rpx;
  257. color: #666F80;
  258. }
  259. &:first-child {
  260. margin-right: 5%;
  261. border-right: 1px solid #DADEE6;
  262. }
  263. }
  264. }
  265. }
  266. .box2 {
  267. padding: 0;
  268. padding-left: 25rpx;
  269. >view {
  270. display: flex;
  271. flex-direction: row;
  272. align-items: center;
  273. border-bottom: 1px solid #DADEE6;
  274. height: 87.5rpx;
  275. color: #525866;
  276. >text {
  277. white-space: nowrap;
  278. color: #292C33;
  279. }
  280. >input {
  281. padding: 0 9.37rpx;
  282. width: 80rpx;
  283. height: 33.75rpx;
  284. font-size: 22.5rpx;
  285. line-height: 33.75rpx;
  286. text-align: center;
  287. }
  288. &:last-child {
  289. border-bottom: 0;
  290. }
  291. &.input-wrap {
  292. display: flex;
  293. flex-direction: row;
  294. &:last-child {
  295. align-items: flex-start;
  296. padding: 20rpx 0;
  297. height: 200rpx;
  298. }
  299. view {
  300. margin-right: 40rpx;
  301. white-space: nowrap;
  302. }
  303. input, textarea {
  304. padding: 0;
  305. padding-right: 25rpx;
  306. width: 100%;
  307. font-size: 22.5rpx;
  308. line-height: 33.75rpx;
  309. text-align: left;
  310. }
  311. textarea {
  312. height: 100%;
  313. }
  314. }
  315. }
  316. .setIfShowNotApplicable {
  317. display: flex;
  318. flex-direction: row;
  319. justify-content: space-between;
  320. .icon {
  321. width: 30rpx;
  322. height: 30rpx;
  323. margin-right: 25rpx;
  324. }
  325. }
  326. .situationType {
  327. position: relative;
  328. .typeValue {
  329. display: inline-block;
  330. margin-left: 40rpx;
  331. }
  332. .arrowRight {
  333. position: absolute;
  334. right:20rpx;
  335. width: 15rpx;
  336. height: 25rpx;
  337. }
  338. }
  339. .pointsetType {
  340. position: relative;
  341. .typeValue {
  342. display: inline-block;
  343. margin-left: 40rpx;
  344. }
  345. .arrowRight {
  346. position: absolute;
  347. right:20rpx;
  348. width: 15rpx;
  349. height: 25rpx;
  350. }
  351. }
  352. }
  353. }
  354. </style>