Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

239 rindas
4.7 KiB

  1. <template>
  2. <view class="box">
  3. <view class="conmsg" v-if="allList.length!=0">
  4. <view class="conmsg-msg">
  5. <view v-for="(item,index) in allList" :key="index">
  6. <view class="">
  7. <view class="conmsg-msg-lab" style="border: none;">
  8. <view class="conmsg-msg-lab-1">
  9. {{item.name}}
  10. </view>
  11. </view>
  12. <view class="con-msg-con"
  13. :style="{borderBottom:index==allList.length-1?'none':'1px solid #E0E0E0'}">
  14. <view v-for='(item1,i) in item.children' :key='i' @click="Edittag(item,item1,index,i)"
  15. :style="{border:item1.selected==0?'1px solid #0A6EE9':'1px solid #E0E0E0'}"
  16. class="chebox">
  17. {{item1.label}}
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="submit">
  25. <view class="btn" @click="submit">
  26. 确定
  27. </view>
  28. </view>
  29. <view class="" style="height: 220rpx;"></view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. allList:[],
  37. customerId:''
  38. }
  39. },
  40. onLoad(e) {
  41. this.customerId=e.id;
  42. this.getListByType()
  43. },
  44. methods: {
  45. Edittag(item,item1,index,i){
  46. if(this.allList[index].children[i].selected==0){
  47. this.allList[index].children[i].selected=1;
  48. }else{
  49. this.allList[index].children[i].selected=0;
  50. }
  51. this.$forceUpdate()
  52. },
  53. // 字典表接口
  54. getListByType() {
  55. this.$u.get("/matchKeywords/findManualCalibration", {
  56. customerId: this.customerId,
  57. type:2
  58. })
  59. .then(res => {
  60. res.forEach(item1 => {
  61. item1.children.map(item => {
  62. if (item.isInterval == 0) {
  63. item.label = item.name + item.unit + '-' + item.endName + item
  64. .unit;
  65. } else {
  66. item.label = item.name
  67. }
  68. item.value = item.id;
  69. })
  70. })
  71. this.allList = res
  72. })
  73. },
  74. // 提交
  75. submit() {
  76. let param = {
  77. keywordIds:'',
  78. id: this.customerId,
  79. projectId: uni.getStorageSync('buildingID').id,
  80. }
  81. let str = []
  82. this.allList.map(item => {
  83. item.children.map(item1 => {
  84. if (item1.selected == 0) {
  85. str.push(item1.keywordsId)
  86. }
  87. })
  88. })
  89. str = str.join(',')
  90. param.keywordIds = str
  91. this.$u.post("matchKeywords/updateManualCalibration", param).then(res => {
  92. uni.showToast({
  93. title: '操作成功',
  94. icon: 'none',
  95. success: () => {
  96. let sdd={
  97. keywordIds: this.customerId,
  98. id: this.customerId,
  99. bg:0,
  100. speaker:0
  101. }
  102. let pages = getCurrentPages() //获取当前页面栈的信息
  103. let prevPage = pages[pages.length - 2] //获取上一个页面
  104. prevPage.setData({ //把需要回传的值保存到上一个页面
  105. info: sdd
  106. });
  107. uni.navigateBack()
  108. }
  109. })
  110. })
  111. },
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .box {
  117. width: 100%;
  118. height: 100%;
  119. background: #F8F8F8;
  120. overflow: hidden;
  121. }
  122. .conmsg {
  123. background: #FFFFFF;
  124. margin-top: 20rpx;
  125. .conmsg-title {
  126. height: 92rpx;
  127. line-height: 92rpx;
  128. font-weight: bold;
  129. padding: 0 30rpx;
  130. // font-weight: 500;
  131. color: #303030;
  132. font-size: 32rpx;
  133. border-bottom: 1px solid #E0E0E0;
  134. }
  135. .conmsg-msg {
  136. padding: 0 30rpx;
  137. .conmsg-msg-lab {
  138. height: 102rpx;
  139. display: flex;
  140. font-size: 30rpx;
  141. font-weight: 400;
  142. color: #333333;
  143. border-bottom: 1px solid #E0E0E0;
  144. line-height: 102rpx;
  145. .conmsg-msg-lab-1 {
  146. display: flex;
  147. min-width: 136rpx;
  148. .star {
  149. color: #E7483C;
  150. line-height: 108rpx;
  151. }
  152. }
  153. .conmsg-msg-lab-inp {
  154. margin-top: 30rpx;
  155. margin-left: 44rpx;
  156. }
  157. .conmsg-msg-lab-img {
  158. width: 14rpx;
  159. height: 30rpx;
  160. margin-top: 6rpx;
  161. margin-left: auto;
  162. image {
  163. width: 100%;
  164. height: 100%;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. .submit {
  171. position: fixed;
  172. bottom: 20rpx;
  173. left: 20rpx;
  174. height: 120rpx;
  175. background: #FFFFFF;
  176. .btn {
  177. // margin: 60rpx auto;
  178. text-align: center;
  179. width: 690rpx;
  180. height: 88rpx;
  181. background: #2671E2;
  182. border-radius: 8rpx;
  183. font-size: 32tpx;
  184. font-weight: 400;
  185. color: #FFFFFF;
  186. line-height: 88rpx;
  187. }
  188. }
  189. .con-msg-con {
  190. display: flex;
  191. flex-wrap: wrap;
  192. // justify-content: space-around;
  193. border-bottom: 1px solid #E0E0E0;
  194. padding-bottom: 16rpx;
  195. .chebox {
  196. // width: 20%;
  197. height: 60rpx;
  198. line-height: 60rpx;
  199. // margin: 10rpx 0;
  200. margin-bottom: 25rpx;
  201. margin-right: 20rpx;
  202. border: 1px solid #E0E0E0;
  203. box-sizing: border-box;
  204. padding: 0 10rpx;
  205. }
  206. }
  207. .sexchose {
  208. width: 120rpx;
  209. height: 60rpx;
  210. background: #FFFFFF;
  211. border-radius: 4rpx;
  212. border: 1px solid #E0E0E0;
  213. text-align: center;
  214. line-height: 60rpx;
  215. margin-right: 20rpx;
  216. }
  217. </style>