index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <div class="reportRepair">
  3. <div class="reportBody">
  4. <div class="record" @click.stop="toRecord">
  5. 报事记录 <img src="https://www.idea-co-sf.com/gardenProduct/image/rightIcon.png" class="recordImg">
  6. </div>
  7. <ul class="detailUl">
  8. <li class="detailLi">
  9. <span class="liName">当前企业</span>
  10. <span class="liInfo">无锡XXXXX有限公司</span>
  11. </li>
  12. <li class="detailLi">
  13. <span class="liName">
  14. <span style="color: red;margin-right: 10rpx;">*</span>
  15. 您是想
  16. </span>
  17. <span class="liInfo">
  18. <label class="radio" @click.stop="isCheck=true" >
  19. <radio value="报事" :checked="isCheck" color="#0365F9"/>报事
  20. </label>
  21. <label class="radio" @click.stop="isCheck=false" >
  22. <radio value="咨询" :checked="!isCheck" color="#0365F9"/>咨询
  23. </label>
  24. </span>
  25. </li>
  26. <li class="detailLi2">
  27. <span class="liName">
  28. 快捷选择
  29. </span>
  30. <div class="detailLi2Box">
  31. <div class="detailLi2BoxTop">
  32. <div class="checkItem" :class="item.isCheck?'checked':''" v-for="item in checkList" @click="clickCheck(item)">{{item.name}}</div>
  33. </div>
  34. <van-field
  35. :value="form.contant"
  36. autosize
  37. type="textarea"
  38. placeholder="请输入文字进行报事报修描述"
  39. class="myField"
  40. maxlength="800"
  41. show-word-limit
  42. />
  43. </div>
  44. </li>
  45. <li class="detailLi">
  46. <span class="liName">
  47. <span style="color: red;margin-right: 10rpx;">*</span>
  48. 位置
  49. </span>
  50. <span class="liInfo">
  51. <label class="radio" @click.stop="isCheck2=true" >
  52. <radio value="报事" :checked="isCheck2" color="#0365F9"/>室内
  53. </label>
  54. <label class="radio" @click.stop="isCheck2=false" >
  55. <radio value="咨询" :checked="!isCheck2" color="#0365F9"/>公区
  56. </label>
  57. </span>
  58. </li>
  59. <li class="detailLi2">
  60. <span class="liName">
  61. 补充说明
  62. <span style="color: #B3B3B3;font-size: 28rpx">(支持图片/视频上传限20M内,最多6张)</span>
  63. </span>
  64. <div class="detailLi2Box" style="margin: 24rpx 0 0 0">
  65. <van-uploader
  66. :max-count="6"
  67. @delete="deleteRYXXZP"
  68. :file-list="fileList"
  69. @after-read="uploadRYXXZP"
  70. :show-upload="true"
  71. />
  72. </div>
  73. </li>
  74. <li class="detailLi" style="border-bottom: none">
  75. <span class="liName">
  76. 报事人
  77. </span>
  78. <span class="liInfo">
  79. 章敏-18915281562
  80. </span>
  81. </li>
  82. </ul>
  83. </div>
  84. <div class="buttonBox">
  85. <button class="btn zcBtn">暂存</button>
  86. <button class="btn tjBtn">提交</button>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. export default {
  92. data(){
  93. return{
  94. isCheck:false,
  95. isCheck2:false,
  96. form:{
  97. contant:''
  98. },
  99. checkList:[
  100. {name:'挂件安装',isCheck:true},
  101. {name:'我要投诉',isCheck:false},
  102. {name:'疏通管道',isCheck:false},
  103. {name:'维修线路',isCheck:false},
  104. {name:'更换灯泡',isCheck:false},
  105. {name:'网络维修',isCheck:false},
  106. {name:'保洁服务',isCheck:false},
  107. {name:'其他维修',isCheck:false},
  108. ],
  109. fileList:[]
  110. }
  111. },
  112. methods:{
  113. toRecord() {
  114. uni.navigateTo({
  115. url:'/pages/subPackages/reportRepair/repairRecord'
  116. })
  117. },
  118. clickCheck(item){
  119. item.isCheck = !item.isCheck
  120. },
  121. deleteRYXXZP(event) {
  122. this.fileList.splice(event.detail.index, 1);
  123. this.$forceUpdate();
  124. },
  125. uploadRYXXZP(event) {
  126. console.log(event)
  127. let that = this;
  128. const { file } = event.detail;
  129. uni.uploadFile({
  130. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  131. filePath: file.url,
  132. name: "file",
  133. formData: { user: "test" },
  134. success(res) {
  135. // 上传完成需要更新 fileList
  136. let data = JSON.parse(res.data);
  137. that.fileList.push({
  138. imgUrl: "/FileController/download/" + data.data[0],
  139. id: data.data[0],
  140. url:
  141. that.$constant.BASE_URI +
  142. "/FileController/download/" +
  143. data.data[0],
  144. isImage: true,
  145. });
  146. },
  147. fail(res) {},
  148. });
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="scss">
  154. .reportRepair{
  155. .reportBody{
  156. margin-top: 24rpx;
  157. padding: 38rpx 36rpx;
  158. background: white;
  159. //height: 1416rpx;
  160. box-sizing: border-box;
  161. .record {
  162. display: flex;
  163. align-items: center;
  164. justify-content: flex-end;
  165. color: #0365F9;
  166. font-size: 32rpx;
  167. .recordImg{
  168. width: 36rpx;
  169. height: 36rpx;
  170. padding: 5rpx 0 0 10rpx;
  171. }
  172. }
  173. .detailUl{
  174. margin-top: 20rpx;
  175. .liName{
  176. font-size: 32rpx;
  177. color: rgba(51, 51, 51, 1);
  178. white-space: nowrap;
  179. }
  180. .detailLi{
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 32rpx 0;
  185. border-bottom: 2rpx solid #E6E6E6;
  186. .liInfo{
  187. display: inline-block;
  188. text-align: right;
  189. max-width: 428rpx;
  190. color: rgba(102, 102, 102, 1);
  191. font-size: 32rpx;
  192. line-height: 38rpx;
  193. .radio{
  194. margin-left: 64rpx;
  195. }
  196. }
  197. }
  198. .detailLi2{
  199. display: flex;
  200. flex-direction: column;
  201. padding: 32rpx 0;
  202. border-bottom: 2rpx solid #E6E6E6;
  203. .detailLi2BoxTop{
  204. display: flex;
  205. flex-wrap: wrap;
  206. justify-content: space-between;
  207. margin: 12rpx 0;
  208. .checkItem{
  209. width: 160rpx;
  210. height: 64rpx;
  211. font-size: 28rpx;
  212. color: #666666;
  213. display: flex;
  214. align-items: center;
  215. justify-content: center;
  216. background: #F5F7FA;
  217. border-radius: 8rpx;
  218. margin: 12rpx 0;
  219. }
  220. .checked{
  221. background: #0365F9;
  222. color: white;
  223. }
  224. }
  225. }
  226. }
  227. }
  228. .van-cell {
  229. background: #F5F7FA !important;
  230. border-radius: 8rpx;
  231. font-size: 28rpx;
  232. }
  233. .buttonBox{
  234. display: flex;
  235. justify-content: center;
  236. .btn{
  237. width: 240rpx;
  238. height: 80rpx;
  239. display: flex;
  240. border-radius: 8rpx;
  241. align-items: center;
  242. justify-content: center;
  243. margin: 48rpx 16rpx 150rpx 16rpx;
  244. color: white;
  245. letter-spacing: 2rpx;
  246. text-indent: 2rpx;
  247. }
  248. .zcBtn{
  249. background: #FE8643;
  250. }
  251. .tjBtn{
  252. background: #0365F9;
  253. }
  254. }
  255. }
  256. </style>