dispatch.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <div class="addRepair">
  3. <div class="reportBody">
  4. <ul class="detailUl">
  5. <li class="detailLi">
  6. <span class="liName">当前企业</span>
  7. <span class="liInfo">无锡XXXXX有限公司</span>
  8. </li>
  9. <li class="detailLi">
  10. <span class="liName">
  11. <span style="color: red;margin-right: 10rpx;">*</span>
  12. 您是想
  13. </span>
  14. <span class="liInfo">
  15. <label class="radio" @click.stop="isCheck=true" >
  16. <radio value="报事" :checked="isCheck" color="#0365F9"/>报事
  17. </label>
  18. <label class="radio" @click.stop="isCheck=false" >
  19. <radio value="咨询" :checked="!isCheck" color="#0365F9"/>咨询
  20. </label>
  21. </span>
  22. </li>
  23. <li class="detailLi2">
  24. <span class="liName">
  25. 快捷选择
  26. </span>
  27. <div class="detailLi2Box">
  28. <div class="detailLi2BoxTop">
  29. <div class="checkItem" :class="item.isCheck?'checked':''" v-for="item in checkList" @click="clickCheck(item)">{{item.name}}</div>
  30. </div>
  31. <van-field
  32. :value="form.contant"
  33. autosize
  34. type="textarea"
  35. placeholder="请输入文字进行报事报修描述"
  36. class="myField"
  37. maxlength="800"
  38. show-word-limit
  39. />
  40. </div>
  41. </li>
  42. <li class="detailLi">
  43. <span class="liName">
  44. <span style="color: red;margin-right: 10rpx;">*</span>
  45. 位置
  46. </span>
  47. <span class="liInfo">
  48. <label class="radio" @click.stop="isCheck2=true" >
  49. <radio value="报事" :checked="isCheck2" color="#0365F9"/>室内
  50. </label>
  51. <label class="radio" @click.stop="isCheck2=false" >
  52. <radio value="咨询" :checked="!isCheck2" color="#0365F9"/>公区
  53. </label>
  54. </span>
  55. </li>
  56. <li class="detailLi2">
  57. <span class="liName">
  58. 补充说明
  59. <span style="color: #B3B3B3;font-size: 28rpx">(支持图片/视频上传限20M内,最多6张)</span>
  60. </span>
  61. <div class="detailLi2Box" style="margin: 24rpx 0 0 0">
  62. <van-uploader
  63. :max-count="6"
  64. @delete="deleteRYXXZP"
  65. :file-list="fileList"
  66. @after-read="uploadRYXXZP"
  67. :show-upload="true"
  68. />
  69. </div>
  70. </li>
  71. <li class="detailLi">
  72. <span class="liName">
  73. 报事人
  74. </span>
  75. <span class="liInfo">
  76. 章敏-18915281562 <img src="https://www.idea-co-sf.com/gardenProduct/image/phoneIcon.png" class="phoneIcon">
  77. </span>
  78. </li>
  79. <li class="detailLi" style="border-bottom: none">
  80. <span class="liName">
  81. 报事时间
  82. </span>
  83. <span class="liInfo">
  84. 2024-05-16 15:30
  85. </span>
  86. </li>
  87. </ul>
  88. </div>
  89. <div class="handleBox">
  90. <div class="handleTitle">处理情况</div>
  91. <div class="imageBox">
  92. <div class="imageItem">
  93. <img src="https://www.idea-co-sf.com/gardenProduct/image/upImage.svg" class="handleImg">
  94. <span>上报</span>
  95. </div>
  96. <img src="https://www.idea-co-sf.com/gardenProduct/image/arrow.png" class="handleArrow">
  97. <div class="imageItem">
  98. <img src="https://www.idea-co-sf.com/gardenProduct/image/acceptance.svg" class="handleImg">
  99. <span>受理</span>
  100. </div>
  101. <img src="https://www.idea-co-sf.com/gardenProduct/image/arrow.png" class="handleArrow">
  102. <div class="imageItem">
  103. <img :src="optionsType==='待受理'?'https://www.idea-co-sf.com/gardenProduct/image/unHandle.svg':'https://www.idea-co-sf.com/gardenProduct/image/handle.svg'" class="handleImg">
  104. <span>处理</span>
  105. </div>
  106. <img src="https://www.idea-co-sf.com/gardenProduct/image/arrow.png" class="handleArrow">
  107. <div class="imageItem">
  108. <img src="https://www.idea-co-sf.com/gardenProduct/image/evaluate.svg" class="handleImg">
  109. <span>评价</span>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="reportBody" v-if="optionsType!=='已处理'">
  114. <ul class="detailUl">
  115. <li class="detailLi">
  116. <span class="liInfo">
  117. <label>
  118. <radio value="报事" :checked="optionsType==='待受理'" color="#0365F9" :disabled="optionsType==='待处理'"/>派单
  119. </label>
  120. <label style="margin-left: 64rpx">
  121. <radio value="咨询" :checked="optionsType==='待处理'" color="#0365F9" :disabled="optionsType==='待受理'"/>处理
  122. </label>
  123. </span>
  124. </li>
  125. <li class="detailLi" v-if="optionsType==='待受理'">
  126. <span class="liName">
  127. 派单给
  128. </span>
  129. <span class="liInfo">
  130. 李开心
  131. </span>
  132. </li>
  133. <li class="detailLi2" v-if="optionsType==='待受理'">
  134. <span class="liName" style="margin-bottom: 16rpx">
  135. 备注
  136. </span>
  137. <van-field
  138. :value="form.contant"
  139. autosize
  140. type="textarea"
  141. placeholder="请输入文字进行报事报修描述"
  142. class="myField2"
  143. maxlength="800"
  144. show-word-limit
  145. />
  146. </li>
  147. <li class="detailLi2" v-if="optionsType==='待处理'">
  148. <span class="liName">
  149. 处理后拍照
  150. <span style="color: #B3B3B3;font-size: 28rpx">(支持图片上传限20M内,最多6张)</span>
  151. </span>
  152. <div class="detailLi2Box" style="margin: 24rpx 0 0 0">
  153. <van-uploader
  154. :max-count="6"
  155. @delete="deleteRYXXZP"
  156. :file-list="fileList"
  157. @after-read="uploadRYXXZP"
  158. :show-upload="true"
  159. />
  160. </div>
  161. </li>
  162. <li class="detailLi" v-if="optionsType==='待处理'">
  163. <span class="liName">
  164. 处理人
  165. </span>
  166. <span class="liInfo">
  167. 李开心
  168. </span>
  169. </li>
  170. <li class="detailLi" v-if="optionsType==='待处理'" style="border-bottom: none">
  171. <span class="liName">
  172. 处理时间
  173. </span>
  174. <span class="liInfo">
  175. {{timeNow}}
  176. </span>
  177. </li>
  178. </ul>
  179. </div>
  180. <div class="reportBody" v-if="optionsType==='已处理'">
  181. <div class="handleTitle">派单信息</div>
  182. <ul class="detailUl">
  183. <li class="detailLi">
  184. <span class="liName">
  185. 派单给
  186. </span>
  187. <span class="liInfo">
  188. 李开心
  189. </span>
  190. </li>
  191. <li class="detailLi2">
  192. <span class="liName" style="margin-bottom: 16rpx">
  193. 备注
  194. </span>
  195. <van-field
  196. :value="form.contant"
  197. autosize
  198. type="textarea"
  199. placeholder="请输入文字进行报事报修描述"
  200. class="myField2"
  201. maxlength="800"
  202. show-word-limit
  203. />
  204. </li>
  205. <li class="detailLi">
  206. <span class="liName">
  207. 派单人
  208. </span>
  209. <span class="liInfo">
  210. 李欣怡
  211. </span>
  212. </li>
  213. <li class="detailLi" style="border-bottom: none">
  214. <span class="liName">
  215. 派单时间
  216. </span>
  217. <span class="liInfo">
  218. 2024-05-18 15:30
  219. </span>
  220. </li>
  221. </ul>
  222. </div>
  223. <div class="reportBody" v-if="optionsType==='已处理'">
  224. <div class="handleTitle">处理信息</div>
  225. <ul class="detailUl">
  226. <li class="detailLi2">
  227. <span class="liName">
  228. 处理后拍照
  229. <span style="color: #B3B3B3;font-size: 28rpx">(支持图片上传限20M内,最多6张)</span>
  230. </span>
  231. <div class="detailLi2Box" style="margin: 24rpx 0 0 0">
  232. <van-uploader
  233. :max-count="6"
  234. @delete="deleteRYXXZP"
  235. :file-list="fileList"
  236. @after-read="uploadRYXXZP"
  237. :show-upload="true"
  238. />
  239. </div>
  240. </li>
  241. <li class="detailLi">
  242. <span class="liName">
  243. 处理人
  244. </span>
  245. <span class="liInfo">
  246. 李开心
  247. </span>
  248. </li>
  249. <li class="detailLi" style="border-bottom: none">
  250. <span class="liName">
  251. 处理时间
  252. </span>
  253. <span class="liInfo">
  254. 2024-05-18 15:30
  255. </span>
  256. </li>
  257. </ul>
  258. </div>
  259. <div class="buttonBox">
  260. <button class="zcBtn" @tap="closePage" :class="optionsType==='已处理'?'btn2':'btn '">关闭</button>
  261. <button class="btn tjBtn" v-if="optionsType==='待受理'">提交派单</button>
  262. <button class="btn tjBtn" v-if="optionsType==='待处理'">处理完成</button>
  263. </div>
  264. </div>
  265. </template>
  266. <script>
  267. export default {
  268. data(){
  269. return{
  270. isCheck:false,
  271. isCheck2:false,
  272. form:{
  273. contant:''
  274. },
  275. checkList:[
  276. {name:'挂件安装',isCheck:true},
  277. {name:'我要投诉',isCheck:false},
  278. {name:'疏通管道',isCheck:false},
  279. {name:'维修线路',isCheck:false},
  280. {name:'更换灯泡',isCheck:false},
  281. {name:'网络维修',isCheck:false},
  282. {name:'保洁服务',isCheck:false},
  283. {name:'其他维修',isCheck:false},
  284. ],
  285. fileList:[],
  286. optionsType:'',
  287. timeNow:''
  288. }
  289. },
  290. onLoad(options) {
  291. console.log(options);
  292. this.optionsType = options.type
  293. if (options.type==='待处理'){
  294. uni.setNavigationBarTitle({
  295. title: '报修处理',
  296. });
  297. }else if(options.type==='已处理'){
  298. uni.setNavigationBarTitle({
  299. title: '报修详情',
  300. });
  301. }else {
  302. uni.setNavigationBarTitle({
  303. title: '报修派单',
  304. });
  305. }
  306. },
  307. mounted(){
  308. this.getTime()
  309. },
  310. methods:{
  311. // toRecord() {
  312. // uni.navigateTo({
  313. // url:'/pages/subPackages/reportRepair/repairRecord'
  314. // })
  315. // },
  316. getTime(){
  317. let timestamp = new Date().getTime();
  318. let dateStr = new Date().toLocaleDateString();
  319. console.log(dateStr);
  320. let date = new Date();
  321. let year = date.getFullYear();
  322. let month = date.getMonth() + 1;
  323. let day = date.getDate();
  324. let hours = date.getHours();
  325. let minutes = date.getMinutes();
  326. let fullDateStr = `${year}-${month}-${day} ${hours}:${minutes}`;
  327. console.log(fullDateStr);
  328. this.timeNow = fullDateStr
  329. },
  330. closePage() {
  331. uni.navigateTo({
  332. url:'/pages/subPackages/todo/repairAcceptance'
  333. })
  334. },
  335. clickCheck(item){
  336. item.isCheck = !item.isCheck
  337. },
  338. deleteRYXXZP(event) {
  339. this.fileList.splice(event.detail.index, 1);
  340. this.$forceUpdate();
  341. },
  342. uploadRYXXZP(event) {
  343. console.log(event)
  344. let that = this;
  345. const { file } = event.detail;
  346. uni.uploadFile({
  347. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  348. filePath: file.url,
  349. name: "file",
  350. formData: { user: "test" },
  351. success(res) {
  352. // 上传完成需要更新 fileList
  353. let data = JSON.parse(res.data);
  354. that.fileList.push({
  355. imgUrl: "/FileController/download/" + data.data[0],
  356. id: data.data[0],
  357. url:
  358. that.$constant.BASE_URI +
  359. "/FileController/download/" +
  360. data.data[0],
  361. isImage: true,
  362. });
  363. },
  364. fail(res) {},
  365. });
  366. },
  367. }
  368. }
  369. </script>
  370. <style lang="scss">
  371. .addRepair{
  372. .reportBody{
  373. margin-top: 24rpx;
  374. padding: 38rpx 36rpx;
  375. background: white;
  376. //height: 1416rpx;
  377. box-sizing: border-box;
  378. .record {
  379. display: flex;
  380. align-items: center;
  381. justify-content: flex-end;
  382. color: #0365F9;
  383. font-size: 32rpx;
  384. .recordImg{
  385. width: 36rpx;
  386. height: 36rpx;
  387. padding: 5rpx 0 0 10rpx;
  388. }
  389. }
  390. .detailUl{
  391. margin-top: 20rpx;
  392. .liName{
  393. font-size: 32rpx;
  394. color: rgba(51, 51, 51, 1);
  395. white-space: nowrap;
  396. }
  397. .detailLi{
  398. display: flex;
  399. justify-content: space-between;
  400. align-items: center;
  401. padding: 32rpx 0;
  402. border-bottom: 2rpx solid #E6E6E6;
  403. .liInfo{
  404. display: inline-block;
  405. text-align: right;
  406. max-width: 428rpx;
  407. color: rgba(102, 102, 102, 1);
  408. font-size: 32rpx;
  409. line-height: 38rpx;
  410. display: flex;
  411. align-items: center;
  412. .radio{
  413. margin-left: 64rpx;
  414. }
  415. .phoneIcon{
  416. width: 64rpx;
  417. height: 64rpx;
  418. margin-left: 24rpx;
  419. }
  420. }
  421. }
  422. .detailLi2{
  423. display: flex;
  424. flex-direction: column;
  425. padding: 32rpx 0;
  426. border-bottom: 2rpx solid #E6E6E6;
  427. .detailLi2BoxTop{
  428. display: flex;
  429. flex-wrap: wrap;
  430. justify-content: space-between;
  431. margin: 12rpx 0;
  432. .checkItem{
  433. width: 160rpx;
  434. height: 64rpx;
  435. font-size: 28rpx;
  436. color: #666666;
  437. display: flex;
  438. align-items: center;
  439. justify-content: center;
  440. background: #F5F7FA;
  441. border-radius: 8rpx;
  442. margin: 12rpx 0;
  443. }
  444. .checked{
  445. background: #0365F9;
  446. color: white;
  447. }
  448. }
  449. }
  450. }
  451. }
  452. .van-cell {
  453. background: #F5F7FA !important;
  454. border-radius: 8rpx;
  455. font-size: 28rpx;
  456. }
  457. .buttonBox{
  458. display: flex;
  459. justify-content: center;
  460. .btn{
  461. width: 240rpx;
  462. height: 80rpx;
  463. display: flex;
  464. border-radius: 8rpx;
  465. align-items: center;
  466. justify-content: center;
  467. margin: 48rpx 16rpx 150rpx 16rpx;
  468. color: white;
  469. letter-spacing: 2rpx;
  470. text-indent: 2rpx;
  471. }
  472. .btn2{
  473. width: 654rpx;
  474. height: 96rpx;
  475. display: flex;
  476. border-radius: 8rpx;
  477. align-items: center;
  478. justify-content: center;
  479. margin: 48rpx 48rpx 150rpx 48rpx;
  480. color: white;
  481. letter-spacing: 2rpx;
  482. text-indent: 2rpx;
  483. }
  484. .zcBtn{
  485. background: rgba(0, 0, 0, 0.05);
  486. color: rgba(3, 101, 249, 1);
  487. &::after{
  488. border: none;
  489. }
  490. }
  491. .tjBtn{
  492. background: #0365F9;
  493. }
  494. }
  495. .handleBox{
  496. background: white;
  497. padding: 32rpx;
  498. margin: 24rpx 0;
  499. .imageBox{
  500. display: flex;
  501. justify-content: space-evenly;
  502. align-items: center;
  503. margin-top: 48rpx;
  504. .handleImg{
  505. width: 72rpx;
  506. height: 72rpx;
  507. margin-bottom: 8rpx;
  508. }
  509. .handleArrow{
  510. width: 64rpx;
  511. height: 20rpx;
  512. }
  513. }
  514. .imageItem{
  515. display: flex;
  516. flex-direction: column;
  517. align-items: center;
  518. color: rgba(34, 34, 34, 1);
  519. font-size: 28rpx;
  520. }
  521. }
  522. .handleTitle{
  523. color: rgba(34, 34, 34, 1);
  524. font-size: 36rpx;
  525. font-weight: 600;
  526. }
  527. }
  528. </style>