detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='故障报修'></cus-header>
  4. <div class="box">
  5. <div class="b_title">
  6. 故障信息
  7. <div class="b_status" :class="{'djj':dto.status===1,'yjj':dto.status===0}">{{dto.status===0?'已解决':'未解决'}}</div>
  8. </div>
  9. <div class="bs_item">
  10. <div class="left">项目订单号</div>
  11. <div class="right">{{'PO0098877666'}}</div>
  12. </div>
  13. <div class="bs_item">
  14. <div class="left">报修地点</div>
  15. <div class="right">{{'长鑫科技集团股份有限公司'}}</div>
  16. </div>
  17. <div class="bs_item">
  18. <div class="left">产品名称</div>
  19. <div class="right">{{'高温罩'}}</div>
  20. </div>
  21. <div class="bs_item">
  22. <div class="left">产品编号</div>
  23. <div class="right">{{'GRT9988811'}}</div>
  24. </div>
  25. <div class="bs_item">
  26. <div class="left">故障发生时间</div>
  27. <div class="right">{{'2025-03-11 13:00'}}</div>
  28. </div>
  29. <div class="bs_item">
  30. <div class="left">故障类型</div>
  31. <div class="right">{{'类型A'}}</div>
  32. </div>
  33. <div class="bs_item">
  34. <div class="left">报修人员</div>
  35. <div class="right">{{'王安宇'}}</div>
  36. </div>
  37. <div class="bs_item">
  38. <div class="left">报修时间</div>
  39. <div class="right">{{'2025-03-12 13:00'}}</div>
  40. </div>
  41. <div class="bs_item">
  42. <div class="left">故障描述</div>
  43. <div class="right">{{'故障描述故障描述'}}</div>
  44. </div>
  45. </div>
  46. <div class="box">
  47. <div class="b_title">故障照片</div>
  48. <div style="padding-top: 24rpx;">
  49. <u-upload width="180" height="180"
  50. :fileList="fileList"
  51. @afterRead="afterRead"
  52. @delete="deletePic"
  53. multiple
  54. :maxCount="5"
  55. ></u-upload>
  56. </div>
  57. </div>
  58. <div class="box">
  59. <div class="b_title">故障处理</div>
  60. <div class="b_item">
  61. <div class="left">问题状态</div>
  62. <div class="right">
  63. <u-radio-group v-model="params.aaa" :size="30" :iconSize="30">
  64. <u-radio :labelSize="26" :label="0">已解决</u-radio>
  65. <u-radio :labelSize="26" :label="1">未解决</u-radio>
  66. </u-radio-group>
  67. </div>
  68. </div>
  69. <div class="b_item">
  70. <div class="left">故障原因</div>
  71. <div class="right">
  72. <input type="text" placeholder="请输入故障原因" placeholder-class="inp_ph" v-model="params.bbb">
  73. </div>
  74. </div>
  75. <div class="b_item">
  76. <div class="left">维修开始时间</div>
  77. <div class="right select" @tap="handleSelect(1)">
  78. <text>{{startDateText}}</text>
  79. <image :src="imgBase+'operation/arrow_right.png'" mode="widthFix"></image>
  80. </div>
  81. </div>
  82. <div class="b_item">
  83. <div class="left">维修结束时间</div>
  84. <div class="right select" @tap="handleSelect(2)">
  85. <text>{{endDateText}}</text>
  86. <image :src="imgBase+'operation/arrow_right.png'" mode="widthFix"></image>
  87. </div>
  88. </div>
  89. <div class="b_item">
  90. <div class="left">维修人员</div>
  91. <div class="right">
  92. <input type="text" placeholder="请输入维修人员" placeholder-class="inp_ph" v-model="params.eee">
  93. </div>
  94. </div>
  95. <div class="b_item2">
  96. <div class="top">维修描述</div>
  97. <div class="bottom">
  98. <u--textarea v-model="dto.fff" placeholder="请输入维修描述" placeholder-class="inp_ph2" border="none" height="110"></u--textarea>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="bottom_btn">
  103. <div class="btn" @tap="submit">提交</div>
  104. <!-- <div class="btn" @tap="back">返回</div> -->
  105. </div>
  106. <u-datetime-picker :itemHeight="88" :show="show1" v-model="dto.ccc" mode="date" title="维修开始时间"
  107. @cancel="show1=false" @confirm="e=>confirm(e,1,'ccc','startDateText')" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
  108. <u-datetime-picker :itemHeight="88" :show="show2" v-model="dto.ccc" mode="date" title="维修结束时间"
  109. @cancel="show2=false" @confirm="e=>confirm(e,2,'ddd','endDateText')" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
  110. </view>
  111. </template>
  112. <script>
  113. export default {
  114. data(){
  115. return {
  116. dto:{
  117. status:1
  118. },
  119. params:{
  120. aaa:'',
  121. bbb:'',
  122. ccc:'',
  123. ddd:'',
  124. eee:'',
  125. fff:''
  126. },
  127. fileList:[],
  128. show1:false,
  129. show2:false,
  130. startDateText:'请输入维修开始时间',
  131. endDateText:'请输入维修结束时间',
  132. minDate:'',
  133. maxDate:'',
  134. }
  135. },
  136. mounted() {
  137. let d = new Date();
  138. this.minDate = new Date(d.getFullYear()-3,d.getMonth()+1,d.getDate()).getTime();
  139. this.maxDate = new Date().getTime();
  140. },
  141. methods:{
  142. handleSelect(type){
  143. this['show'+type] = true;
  144. },
  145. confirm(e,type,key,param){
  146. this[param] = new Date(e.value).Format('yyyy-MM-dd');
  147. this.params[key] = new Date(e.value).Format('yyyy-MM-dd');
  148. this['show'+type] = false;
  149. },
  150. submit(){
  151. uni.navigateBack()
  152. },
  153. back(){
  154. uni.navigateBack()
  155. },
  156. // 删除图片
  157. deletePic(event) {
  158. this.fileList.splice(event.index, 1);
  159. },
  160. // 新增图片
  161. async afterRead(event) {
  162. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  163. let lists = [].concat(event.file);
  164. let fileListLen = this.fileList.length;
  165. lists.map((item) => {
  166. this.fileList.push({
  167. ...item,
  168. status: "uploading",
  169. message: "上传中",
  170. });
  171. });
  172. for (let i = 0; i < lists.length; i++) {
  173. const result = await this.uploadFilePromise(lists[i].url);
  174. let item = this.fileList[fileListLen];
  175. this.fileList.splice(
  176. fileListLen,
  177. 1,
  178. Object.assign(item, {
  179. status: "success",
  180. message: "",
  181. url: result,
  182. })
  183. );
  184. fileListLen++;
  185. }
  186. },
  187. uploadFilePromise(url) {
  188. return new Promise((resolve, reject) => {
  189. let a = uni.uploadFile({
  190. url: "http://192.168.2.21:7001/upload", // 仅为示例,非真实的接口地址
  191. filePath: url,
  192. name: "file",
  193. formData: {
  194. user: "test",
  195. },
  196. success: (res) => {
  197. setTimeout(() => {
  198. resolve(res.data.data);
  199. }, 1000);
  200. },
  201. });
  202. });
  203. },
  204. }
  205. }
  206. </script>
  207. <style>
  208. .inp_ph{
  209. font-family: PingFangSC, PingFang SC;
  210. font-weight: 400;
  211. font-size: 28rpx;
  212. color: #B9C0C8;
  213. line-height: 40rpx;
  214. text-align: right;
  215. }
  216. .inp_ph2{
  217. font-family: PingFangSC, PingFang SC;
  218. font-weight: 400;
  219. font-size: 28rpx;
  220. color: #B9C0C8;
  221. line-height: 40rpx;
  222. text-align: left;
  223. }
  224. </style>
  225. <style scoped lang="less">
  226. ::v-deep .u-radio:last-child{
  227. margin-left: 93rpx !important;
  228. }
  229. ::v-deep .u-upload__button .u-icon__icon{
  230. font-size: 48rpx !important;
  231. }
  232. .page{
  233. padding:0 24rpx 168rpx;
  234. background: #F4F8FB;
  235. .box{
  236. background: #FFFFFF;
  237. border-radius: 16rpx;
  238. margin-top: 20rpx;
  239. padding: 36rpx 24rpx;
  240. .b_title{
  241. padding-left: 16rpx;
  242. position: relative;
  243. font-family: PingFang-SC, PingFang-SC;
  244. font-weight: bold;
  245. font-size: 32rpx;
  246. color: #1D2129;
  247. line-height: 32rpx;
  248. &::before{
  249. content: '';
  250. width: 6rpx;
  251. height: 32rpx;
  252. background: #2E69EB;
  253. position: absolute;
  254. left: 0;
  255. top: 50%;
  256. margin-top: -16rpx;
  257. }
  258. .b_status{
  259. width: 104rpx;
  260. height: 48rpx;
  261. border-radius: 6rpx;
  262. font-family: PingFangSC, PingFang SC;
  263. font-weight: 400;
  264. font-size: 26rpx;
  265. line-height: 48rpx;
  266. text-align: center;
  267. position: absolute;
  268. left: 168rpx;
  269. top: 50%;
  270. margin-top: -24rpx;
  271. &.djj{
  272. color: #FEA400;
  273. background: rgba(254,164,0,0.08);
  274. }
  275. &.yjj{
  276. color: #05C17F;
  277. background: rgba(20,204,140,0.08);
  278. }
  279. }
  280. }
  281. .bs_item{
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-between;
  285. margin-top: 36rpx;
  286. .left{
  287. width: 180rpx;
  288. font-family: PingFangSC, PingFang SC;
  289. font-weight: 400;
  290. font-size: 26rpx;
  291. color: #86909C;
  292. line-height: 26rpx;
  293. }
  294. .right{
  295. width: calc(100% - 180rpx);
  296. font-family: PingFangSC, PingFang SC;
  297. font-weight: 400;
  298. font-size: 26rpx;
  299. color: #1D2129;
  300. line-height: 26rpx;
  301. text-align: right;
  302. }
  303. }
  304. .b_item{
  305. display: flex;
  306. align-items: center;
  307. justify-content: space-between;
  308. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
  309. padding: 24rpx 0;
  310. .left{
  311. font-family: PingFangSC, PingFang SC;
  312. font-weight: 400;
  313. font-size: 30rpx;
  314. color: #1D2129;
  315. line-height: 42rpx;
  316. }
  317. .right{
  318. input{
  319. font-family: PingFangSC, PingFang SC;
  320. font-weight: 400;
  321. font-size: 28rpx;
  322. color: #4E5969;
  323. line-height: 40rpx;
  324. text-align: right;
  325. }
  326. &.select{
  327. display: flex;
  328. align-items: center;
  329. text{
  330. font-family: PingFangSC, PingFang SC;
  331. font-weight: 400;
  332. font-size: 28rpx;
  333. color: #B9C0C8;
  334. line-height: 40rpx;
  335. }
  336. image{
  337. width: 24rpx;
  338. height: 24rpx;
  339. margin-left: 10rpx;
  340. }
  341. }
  342. }
  343. }
  344. .b_item2{
  345. .top{
  346. font-family: PingFangSC, PingFang SC;
  347. font-weight: 400;
  348. font-size: 30rpx;
  349. color: #1D2129;
  350. line-height: 42rpx;
  351. padding-top: 24rpx;
  352. }
  353. .bottom{
  354. padding-bottom: 24rpx;
  355. input{
  356. font-family: PingFangSC, PingFang SC;
  357. font-weight: 400;
  358. font-size: 28rpx;
  359. color: #4E5969;
  360. line-height: 40rpx;
  361. }
  362. }
  363. }
  364. }
  365. .bottom_btn{
  366. width: 100%;
  367. height: 148rpx;
  368. padding: 20rpx 48rpx;
  369. box-sizing: border-box;
  370. background: #FFFFFF;
  371. position: fixed;
  372. bottom: 0;
  373. left: 0;
  374. z-index: 9;
  375. .btn{
  376. width: 100%;
  377. height: 88rpx;
  378. background: #2E69EB;
  379. border-radius: 16rpx;
  380. font-family: PingFang-SC, PingFang-SC;
  381. font-weight: bold;
  382. font-size: 32rpx;
  383. color: #FFFFFF;
  384. line-height: 88rpx;
  385. text-align: center;
  386. }
  387. }
  388. }
  389. </style>