situationPreview.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="situation-preview">
  3. <view class="title">情境预览</view>
  4. <view class="box1">
  5. <view class="row1">
  6. <view class="top">
  7. <text>主题:{{theme.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>{{checkRent.checkedItem.name}}</text>
  21. </view>
  22. <view class="item">
  23. <text>组长</text>
  24. <text>{{checkRent.checkedItem.groupManagerName}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="box2">
  29. <view class="situationType" @click="selectSituationType">
  30. <text>情境类型</text>
  31. <text class="typeValue">{{situationTypeName}}</text>
  32. <image class="arrowRight" src="../../../static/incon-more.png" mode=""></image>
  33. </view>
  34. <view class="input-wrap">
  35. <view>情境名称</view>
  36. <input maxlength="16"
  37. v-model="situationPreview.sitName"
  38. placeholder="限2~16个中文、英文或数字" />
  39. </view>
  40. <view class="input-wrap">
  41. <view>情境描述</view>
  42. <textarea maxlength="300"
  43. rows=""
  44. v-model="situationPreview.description"
  45. placeholder="限300字" />
  46. </view>
  47. </view>
  48. <view class="box2">
  49. <view>
  50. <text>计划开始前</text>
  51. <input v-model="situationPreview.preDay"
  52. placeholder="请输入"
  53. type="number" />
  54. <text>天的</text>
  55. <input v-model="situationPreview.preH"
  56. placeholder="请输入"
  57. type="number" />
  58. <text>时提醒</text>
  59. </view>
  60. <view>
  61. <text>启动</text>
  62. <input v-model="situationPreview.startDay"
  63. placeholder="请输入"
  64. type="number" />
  65. <text>天前提醒</text>
  66. </view>
  67. <view class="setIfShowNotApplicable" @click="setIfShowNotApplicable">
  68. <text>是否需要不适用场景</text>
  69. <image class="icon"
  70. :src="`/static/${situationPreview.showNotApplicable == 0 ? 'check-checkbox' : 'check-no'}.png`">
  71. </image>
  72. </view>
  73. <view class="setIfShowNotApplicable" @click="setIfCountNum">
  74. <text>是否统计小计</text>
  75. <image class="icon"
  76. :src="`/static/${situationPreview.showCountNum == 1 ? 'check-checkbox' : 'check-no'}.png`">
  77. </image>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import { mapState,mapMutations } from "vuex";
  84. export default {
  85. computed: {
  86. ...mapState({
  87. theme: state => state.creatingSituations.theme,
  88. condition: state => state.creatingSituations.condition,
  89. checkRent: state => state.creatingSituations.checkRent,
  90. situationPreview: state => state.creatingSituations.situationPreview,
  91. situationTypeList:state => state.creatingSituations.situationTypeList
  92. }),
  93. situationTypeName(){
  94. if(this.situationTypeList.length>0&&this.situationPreview){
  95. const temp = this.situationTypeList.filter(item=>item.situationType == this.situationPreview.situationType);
  96. return temp.length>0?temp[0].situationTypeName:null;
  97. }
  98. return null;
  99. },
  100. list: function() {
  101. const { conditionIds, options } = this.condition;
  102. let list = [];
  103. this.loopOptions(options, conditionIds, list);
  104. return list;
  105. }
  106. },
  107. methods: {
  108. ...mapMutations(['comChangeState']),
  109. selectSituationType(){
  110. // this.$refs.popup.open();
  111. this.$store.commit('creatingSituations/comChangeState',{key:'showSelectableSituationTypeList',data:true});
  112. },
  113. loopOptions: function(arr, conditionIds, list) {
  114. arr.map((item)=>{
  115. if(conditionIds.includes(item.id)) {
  116. list.push(item);
  117. }
  118. if(item.children.length > 0) {
  119. this.loopOptions(item.children, conditionIds, list);
  120. }
  121. });
  122. },
  123. goMapList: function() {
  124. uni.navigateTo({
  125. url: '/pages/checkMapList/checkMapList'
  126. });
  127. },
  128. setIfShowNotApplicable(){
  129. const showNotApplicable = this.situationPreview.showNotApplicable;
  130. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,showNotApplicable:showNotApplicable?0:1}});
  131. },
  132. setIfCountNum(){
  133. const showCountNum = this.situationPreview.showCountNum;
  134. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,showCountNum:showCountNum?0:1}});
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="less">
  140. .situation-preview {
  141. overflow: hidden;
  142. font-size: 22.5rpx;
  143. line-height: 33.75rpx;
  144. color: #292C33;
  145. .box1,
  146. .box2 {
  147. margin-bottom: 15rpx;
  148. padding: 25rpx;
  149. width: 100%;
  150. background-color: #fff;
  151. }
  152. .box1 {
  153. display: flex;
  154. flex-direction: column;
  155. .row1 {
  156. display: flex;
  157. flex-direction: column;
  158. margin-bottom: 35rpx;
  159. .top {
  160. display: flex;
  161. flex-direction: row;
  162. justify-content: space-between;
  163. margin-bottom: 6.25rpx;
  164. >text {
  165. font-size: 30rpx;
  166. line-height: 45rpx;
  167. }
  168. >view {
  169. display: flex;
  170. flex-direction: row;
  171. align-items: center;
  172. font-size: 20rpx;
  173. line-height: 30rpx;
  174. color: #3377FF;
  175. image {
  176. margin-left: 10rpx;
  177. width: 11.87rpx;
  178. height: 20rpx;
  179. }
  180. }
  181. }
  182. .list {
  183. overflow: hidden;
  184. display: flex;
  185. flex-direction: row;
  186. flex-wrap: wrap;
  187. align-items: center;
  188. >text {
  189. margin-top: 6.25rpx;
  190. margin-right: 15rpx;
  191. border-radius: 5rpx;
  192. padding: 2.5rpx 20.62rpx;
  193. font-size: 17.5rpx;
  194. line-height: 26.25rpx;
  195. color: #7A8499;
  196. background-color: #EBEFF7;
  197. }
  198. }
  199. }
  200. .row2 {
  201. display: flex;
  202. flex-direction: row;
  203. justify-content: center;
  204. align-items: center;
  205. .item {
  206. display: flex;
  207. flex-direction: column;
  208. width: 47.5%;
  209. text {
  210. overflow: hidden;
  211. white-space: nowrap;
  212. text-overflow: ellipsis;
  213. font-size: 25rpx;
  214. line-height: 37.5rpx;
  215. }
  216. text:first-child {
  217. margin-bottom: 4.37rpx;
  218. font-size: 17.5rpx;
  219. line-height: 26.25rpx;
  220. color: #666F80;
  221. }
  222. &:first-child {
  223. margin-right: 5%;
  224. border-right: 1px solid #DADEE6;
  225. }
  226. }
  227. }
  228. }
  229. .box2 {
  230. padding: 0;
  231. padding-left: 25rpx;
  232. >view {
  233. display: flex;
  234. flex-direction: row;
  235. align-items: center;
  236. border-bottom: 1px solid #DADEE6;
  237. height: 87.5rpx;
  238. color: #525866;
  239. >text {
  240. white-space: nowrap;
  241. color: #292C33;
  242. }
  243. >input {
  244. padding: 0 9.37rpx;
  245. width: 80rpx;
  246. height: 33.75rpx;
  247. font-size: 22.5rpx;
  248. line-height: 33.75rpx;
  249. text-align: center;
  250. }
  251. &:last-child {
  252. border-bottom: 0;
  253. }
  254. &.input-wrap {
  255. display: flex;
  256. flex-direction: row;
  257. &:last-child {
  258. align-items: flex-start;
  259. padding: 20rpx 0;
  260. height: 200rpx;
  261. }
  262. view {
  263. margin-right: 40rpx;
  264. white-space: nowrap;
  265. }
  266. input, textarea {
  267. padding: 0;
  268. padding-right: 25rpx;
  269. width: 100%;
  270. font-size: 22.5rpx;
  271. line-height: 33.75rpx;
  272. text-align: left;
  273. }
  274. textarea {
  275. height: 100%;
  276. }
  277. }
  278. }
  279. .setIfShowNotApplicable {
  280. display: flex;
  281. flex-direction: row;
  282. justify-content: space-between;
  283. .icon {
  284. width: 30rpx;
  285. height: 30rpx;
  286. margin-right: 25rpx;
  287. }
  288. }
  289. .situationType {
  290. position: relative;
  291. .typeValue {
  292. display: inline-block;
  293. margin-left: 40rpx;
  294. }
  295. .arrowRight {
  296. position: absolute;
  297. right:20rpx;
  298. width: 15rpx;
  299. height: 25rpx;
  300. }
  301. }
  302. }
  303. }
  304. </style>