taskPreview.vue 11 KB

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