addRepair.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div class="addRepair">
  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" @tap="closePage">关闭</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. closePage() {
  119. uni.navigateTo({
  120. url:'/pages/subPackages/todo/repairAcceptance'
  121. })
  122. },
  123. clickCheck(item){
  124. item.isCheck = !item.isCheck
  125. },
  126. deleteRYXXZP(event) {
  127. this.fileList.splice(event.detail.index, 1);
  128. this.$forceUpdate();
  129. },
  130. uploadRYXXZP(event) {
  131. console.log(event)
  132. let that = this;
  133. const { file } = event.detail;
  134. uni.uploadFile({
  135. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  136. filePath: file.url,
  137. name: "file",
  138. formData: { user: "test" },
  139. success(res) {
  140. // 上传完成需要更新 fileList
  141. let data = JSON.parse(res.data);
  142. that.fileList.push({
  143. imgUrl: "/FileController/download/" + data.data[0],
  144. id: data.data[0],
  145. url:
  146. that.$constant.BASE_URI +
  147. "/FileController/download/" +
  148. data.data[0],
  149. isImage: true,
  150. });
  151. },
  152. fail(res) {},
  153. });
  154. },
  155. }
  156. }
  157. </script>
  158. <style lang="scss">
  159. .addRepair{
  160. .reportBody{
  161. margin-top: 24rpx;
  162. padding: 38rpx 36rpx;
  163. background: white;
  164. //height: 1416rpx;
  165. box-sizing: border-box;
  166. .record {
  167. display: flex;
  168. align-items: center;
  169. justify-content: flex-end;
  170. color: #0365F9;
  171. font-size: 32rpx;
  172. .recordImg{
  173. width: 36rpx;
  174. height: 36rpx;
  175. padding: 5rpx 0 0 10rpx;
  176. }
  177. }
  178. .detailUl{
  179. margin-top: 20rpx;
  180. .liName{
  181. font-size: 32rpx;
  182. color: rgba(51, 51, 51, 1);
  183. white-space: nowrap;
  184. }
  185. .detailLi{
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. padding: 32rpx 0;
  190. border-bottom: 2rpx solid #E6E6E6;
  191. .liInfo{
  192. display: inline-block;
  193. text-align: right;
  194. max-width: 428rpx;
  195. color: rgba(102, 102, 102, 1);
  196. font-size: 32rpx;
  197. line-height: 38rpx;
  198. .radio{
  199. margin-left: 64rpx;
  200. }
  201. }
  202. }
  203. .detailLi2{
  204. display: flex;
  205. flex-direction: column;
  206. padding: 32rpx 0;
  207. border-bottom: 2rpx solid #E6E6E6;
  208. .detailLi2BoxTop{
  209. display: flex;
  210. flex-wrap: wrap;
  211. justify-content: space-between;
  212. margin: 12rpx 0;
  213. .checkItem{
  214. width: 160rpx;
  215. height: 64rpx;
  216. font-size: 28rpx;
  217. color: #666666;
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. background: #F5F7FA;
  222. border-radius: 8rpx;
  223. margin: 12rpx 0;
  224. }
  225. .checked{
  226. background: #0365F9;
  227. color: white;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. .van-cell {
  234. background: #F5F7FA !important;
  235. border-radius: 8rpx;
  236. font-size: 28rpx;
  237. }
  238. .buttonBox{
  239. display: flex;
  240. justify-content: center;
  241. .btn{
  242. width: 240rpx;
  243. height: 80rpx;
  244. display: flex;
  245. border-radius: 8rpx;
  246. align-items: center;
  247. justify-content: center;
  248. margin: 48rpx 16rpx 150rpx 16rpx;
  249. color: white;
  250. letter-spacing: 2rpx;
  251. text-indent: 2rpx;
  252. }
  253. .zcBtn{
  254. background: #FE8643;
  255. }
  256. .tjBtn{
  257. background: #0365F9;
  258. }
  259. }
  260. }
  261. </style>