Workordertodone.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <template>
  2. <view class="">
  3. <view class="" style="width: 750rpx;height: 50rpx;">
  4. </view>
  5. <view class="topname">
  6. <view class="topname1" @click="goback">
  7. <u-icon name="arrow-left" color="#000000" size="36"></u-icon>
  8. </view>
  9. <view class="topname2">
  10. 报修工单
  11. </view>
  12. </view>
  13. <view class="subsection">
  14. <u-subsection :list="list" fontSize="30rpx" :current="current" @change="sectionChange"></u-subsection>
  15. </view>
  16. <!-- 待指派 -->
  17. <view class="" v-show="cdshow==0">
  18. <view style="padding:20rpx 0 0 30rpx">
  19. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  20. </view>
  21. <view class="u-listdata" >
  22. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  23. <u-list-item v-for="(item, index) in indexList" :key="index">
  24. <view class="paisong" @click="Workorderdetails1(item)">
  25. <h3>{{item.repairPosition}}</h3>
  26. <view class="Currentamount1" v-if='item.repairType==1'>
  27. 报修类型: 水
  28. </view>
  29. <view class="Currentamount1" v-if='item.repairType==2'>
  30. 报修类型: 电
  31. </view>
  32. <view class="Currentamount1" v-if='item.repairType==3'>
  33. 报修类型: 其他
  34. </view>
  35. <view class="Currentamount1">
  36. 报修时间: {{item.createDate}}
  37. </view>
  38. </view>
  39. </u-list-item>
  40. </u-list>
  41. </view>
  42. </view>
  43. <!-- 已派送(待维修) -->
  44. <view class="" v-show="cdshow==1">
  45. <!-- 列表 -->
  46. <view class="u-listdata" >
  47. <view style="padding:20rpx 0 0 30rpx">
  48. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  49. </view>
  50. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  51. <u-list-item v-for="(item, index) in indexList" :key="index">
  52. <view class="paisong" @click="Workorderdetails2(item)">
  53. <view class="settled1" v-if="item.urgency==1">
  54. 非常紧急
  55. </view>
  56. <view class="settled2" v-if="item.urgency==2">
  57. 紧急
  58. </view>
  59. <view class="settled3" v-if="item.urgency==3">
  60. 普通
  61. </view>
  62. <h3>{{item.repairPosition}}</h3>
  63. <view class="Currentamount1" v-if='item.repairType==1'>
  64. 报修类型: 水
  65. </view>
  66. <view class="Currentamount1" v-if='item.repairType==2'>
  67. 报修类型: 电
  68. </view>
  69. <view class="Currentamount1" v-if='item.repairType==3'>
  70. 报修类型: 其他
  71. </view>
  72. <view class="Currentamount1">
  73. 派送时间:{{ item.updateDate }}
  74. </view>
  75. </view>
  76. </u-list-item>
  77. </u-list>
  78. </view>
  79. </view>
  80. <!--已维修 -->
  81. <view class="" v-show="cdshow==2">
  82. <!-- 列表 -->
  83. <view class="u-listdata" >
  84. <view style="padding:20rpx 0 0 30rpx">
  85. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  86. </view>
  87. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  88. <u-list-item v-for="(item, index) in indexList" :key="index">
  89. <view class="paisong" @click="Workorderdetails2(item)">
  90. <view class="settled1" v-if="item.urgency==1">
  91. 非常紧急
  92. </view>
  93. <view class="settled2" v-if="item.urgency==2">
  94. 紧急
  95. </view>
  96. <view class="settled3" v-if="item.urgency==3">
  97. 普通
  98. </view>
  99. <h3>{{item.repairPosition}}</h3>
  100. <view class="Currentamount1" v-if='item.repairType==1'>
  101. 报修类型: 水
  102. </view>
  103. <view class="Currentamount1" v-if='item.repairType==2'>
  104. 报修类型: 电
  105. </view>
  106. <view class="Currentamount1" v-if='item.repairType==3'>
  107. 报修类型: 其他
  108. </view>
  109. <view class="Currentamount1">
  110. 维修完成时间:{{ item.repairFinishTime }}
  111. </view>
  112. </view>
  113. </u-list-item>
  114. </u-list>
  115. </view>
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. // import { isEmpty, getDictDataList } from "@/utils/index";
  121. export default {
  122. name:'Workordertodone',
  123. data() {
  124. return {
  125. totalnumber:0,
  126. jfnodata:false,
  127. showtype: false,
  128. cdshow: 0,
  129. fatherparameter: {},
  130. expensedata:'全部',
  131. list: ['待指派', '已指派(待维修)','已维修' ],
  132. current: 0,
  133. dataForm: {
  134. status: "1",
  135. page: 1,
  136. limit: 10,
  137. },
  138. indexList: [],
  139. payStatusList: [],
  140. nodata:true,
  141. pd:true,
  142. columnstype: [],
  143. repairTypeList:[],
  144. UrgencyTypelist:[],
  145. }
  146. },
  147. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  148. onLoad: function(options) { //option为object类型,会序列化上个页面传递的参数
  149. this.getRepairTypeList();
  150. this.getpaisongdata();
  151. },
  152. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  153. onReady() {},
  154. //监听页面隐藏
  155. onHide() {},
  156. //监听窗口尺寸变化
  157. onResize() {},
  158. //监听页面卸载
  159. onUnload() {},
  160. //监听用户下拉动作,一般用于下拉刷新
  161. onPullDownRefresh() {},
  162. methods: {
  163. getRepairTypeList() {
  164. // console.log('9999', getDictDataList("UrgencyType"))
  165. // this.UrgencyTypelist=getDictDataList("UrgencyType");
  166. // console.log('888', getDictDataList("RepairType"))
  167. // this.repairTypeList = getDictDataList("RepairType");
  168. },
  169. Workorderdetails1(e){
  170. // console.log('111111111111111111',e)
  171. uni.navigateTo({
  172. url: `/pages/index/Workordertodone/Workorderdetails/Workorderdetails?id=${e.id}`
  173. });
  174. },
  175. Workorderdetails2(e){
  176. // console.log('111111111111111111',e)
  177. uni.navigateTo({
  178. url: `/pages/index/Workordertodone/Toberepaired/Toberepaired?id=${e.id}`
  179. });
  180. },
  181. // Workorderdetails3(e){
  182. // // console.log('111111111111111111',e)
  183. // uni.navigateTo({
  184. // url: `/pages/index/Workordertodone/hasrepaired/hasrepaired?id=${e.id}`
  185. // });
  186. // },
  187. sectionChange(index) {
  188. this.current = index;
  189. if (index == 0) {
  190. this.cdshow = 0;
  191. this.indexList=[];
  192. this.dataForm.page = 1;
  193. this.dataForm.status = 1;
  194. this.getpaisongdata();
  195. } else if(index == 1) {
  196. this.cdshow = 1;
  197. this.indexList=[];
  198. this.dataForm.page = 1;
  199. this.dataForm.status = 2;
  200. this.getpaisongdata();
  201. } else if(index == 2) {
  202. this.cdshow = 2;
  203. this.indexList=[];
  204. this.dataForm.page = 1;
  205. this.dataForm.status = 3;
  206. this.getpaisongdata();
  207. }
  208. },
  209. scrolltolower() {
  210. if(this.pd){
  211. this.getpaisongdata();
  212. }else{
  213. return
  214. }
  215. },
  216. // dict_filter(val, list) {
  217. // if (isEmpty(val)) {
  218. // return {};
  219. // }
  220. // return this[list].find((item) => item.dictValue == val);
  221. // },
  222. getpaisongdata(){
  223. this.$api.get('/repairorder/page', this.dataForm)
  224. .then(res => {
  225. this.totalnumber=res.data.data.total;
  226. if (res.data.data.list.length != 0) {
  227. this.indexList.push(...res.data.data.list);
  228. this.dataForm.page = this.dataForm.page + 1;
  229. this.pd=true;
  230. this.jfnodata=false;
  231. } else {
  232. uni.showToast({
  233. title:'暂无更多数据了',
  234. icon: 'none',
  235. duration: 1500
  236. })
  237. this.pd=false;
  238. //this.jfnodata=true
  239. }
  240. })
  241. },
  242. goback() {
  243. uni.navigateTo({
  244. url: '/pages/index/index'
  245. })
  246. },
  247. }
  248. }
  249. </script>
  250. <style lang="scss">
  251. .topname {
  252. height: 44px;
  253. width: 750rpx;
  254. display: flex;
  255. align-items: center;
  256. }
  257. .topname1 {
  258. width: 50rpx;
  259. padding-left: 10rpx;
  260. }
  261. .topname2 {
  262. width: 700rpx;
  263. text-align: center;
  264. font-weight: bold;
  265. }
  266. .nodata{
  267. text-align: center;
  268. padding-top: 400rpx;
  269. }
  270. .paisong{
  271. display: flex;
  272. flex-direction: column;
  273. justify-content:center;
  274. height:170rpx;
  275. background-color: #fff;
  276. margin: 30rpx;
  277. border-radius: 9rpx;
  278. position: relative;
  279. h3 {
  280. height: 70rpx;
  281. line-height: 70rpx;
  282. padding-left: 30rpx;
  283. }
  284. }
  285. .companylist {
  286. margin: 20rpx 30rpx;
  287. background: #fff;
  288. height: 280rpx;
  289. border-radius: 10px;
  290. position: relative;
  291. h3 {
  292. height: 70rpx;
  293. line-height: 70rpx;
  294. padding-left: 30rpx;
  295. }
  296. }
  297. .settled1 {
  298. background-color: #ED3A25;
  299. width: 100rpx;
  300. height: 40rpx;
  301. text-align: center;
  302. line-height: 40rpx;
  303. color: #fff;
  304. font-size: 14rpx;
  305. position: absolute;
  306. top: 0px;
  307. right: 0px;
  308. border-top-right-radius: 10rpx;
  309. border-bottom-left-radius: 10rpx;
  310. }
  311. .settled2 {
  312. background-color: #FF9C27;
  313. width: 100rpx;
  314. height: 40rpx;
  315. text-align: center;
  316. line-height: 40rpx;
  317. color: #fff;
  318. font-size: 14rpx;
  319. position: absolute;
  320. top: 0px;
  321. right: 0px;
  322. border-top-right-radius: 10rpx;
  323. border-bottom-left-radius: 10rpx;
  324. }
  325. .settled3 {
  326. background-color: #30D3A2;
  327. width: 100rpx;
  328. height: 40rpx;
  329. text-align: center;
  330. line-height: 40rpx;
  331. color: #fff;
  332. font-size: 14rpx;
  333. position: absolute;
  334. top: 0px;
  335. right: 0px;
  336. border-top-right-radius: 10rpx;
  337. border-bottom-left-radius: 10rpx;
  338. }
  339. .Currentamount {
  340. padding-left: 30rpx;
  341. height: 50rpx;
  342. line-height: 50rpx;
  343. color: #BCB3A7;
  344. span {
  345. color: #FA5555;
  346. padding-left: 9rpx;
  347. }
  348. }
  349. .Currentamount1 {
  350. padding-left: 30rpx;
  351. height: 40rpx;
  352. line-height: 40rpx;
  353. color: #BCB3A7;
  354. span {
  355. color: #FA5555;
  356. padding-left: 9rpx;
  357. }
  358. }
  359. .records1{
  360. background-color: #FA5555;
  361. width: 100rpx;
  362. height: 40rpx;
  363. text-align: center;
  364. line-height: 40rpx;
  365. color: #fff;
  366. font-size: 14rpx;
  367. position: absolute;
  368. top: 0px;
  369. right: 0px;
  370. border-top-right-radius: 10rpx;
  371. border-bottom-left-radius: 10rpx;
  372. }
  373. .records{
  374. display: flex;
  375. flex-direction: column;
  376. // justify-content: center;
  377. position: relative;
  378. width: 690rpx;
  379. height: 210rpx;
  380. background: #fff;
  381. margin: 0 auto;
  382. border-radius: 9rpx;
  383. }
  384. .onerecord{
  385. width: 750rpx;
  386. height: 90rpx;
  387. line-height: 90rpx;
  388. padding-left: 30rpx;
  389. color: #999;
  390. span{
  391. color: red;
  392. }
  393. }
  394. .topbilledit {
  395. display: flex;
  396. justify-content: center;
  397. align-items: center;
  398. background: #fff;
  399. height: 60rpx;
  400. }
  401. .changetime2 {
  402. padding-left: 10rpx;
  403. }
  404. .subsection {
  405. padding: 30rpx;
  406. background: #fff;
  407. }
  408. .topname {
  409. height: 44px;
  410. width: 750rpx;
  411. display: flex;
  412. align-items: center;
  413. }
  414. .topname1 {
  415. width: 50rpx;
  416. padding-left: 10rpx;
  417. }
  418. .topname2 {
  419. width: 700rpx;
  420. text-align: center;
  421. font-weight: bold;
  422. }
  423. </style>