Workordertodone.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <view class="page">
  3. <u-tabs :list="list" @click="sectionChange" style="background-color: #fff;" :current=current
  4. :itemStyle="{'width':'250rpx','padding':'24rpx'}" lineHeight="2px" lineWidth="30px"></u-tabs>
  5. <!-- 待指派 -->
  6. <view class="contain" v-show="cdshow==0">
  7. <view style="padding:16rpx 0 16rpx 32rpx">
  8. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  9. </view>
  10. <view class="u-listdata">
  11. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true' style="height:400px;flex:1;">
  12. <u-list-item v-for="(item, index) in indexList" :key="index">
  13. <view class="paisong" @click="Workorderdetails1(item)">
  14. <view class="title">{{item.repairPosition}}</view>
  15. <view class="submit" v-if='item.repairType==1'>
  16. 报修类型: 水
  17. </view>
  18. <view class="submit" v-if='item.repairType==2'>
  19. 报修类型: 电
  20. </view>
  21. <view class="submit" v-if='item.repairType==3'>
  22. 报修类型: 其他
  23. </view>
  24. <view class="submit">
  25. 报修时间: {{item.createDate}}
  26. </view>
  27. </view>
  28. </u-list-item>
  29. </u-list>
  30. </view>
  31. </view>
  32. <!-- 已派送(待维修) -->
  33. <view class="contain" v-show="cdshow==1">
  34. <!-- 列表 -->
  35. <view class="u-listdata">
  36. <view style="padding:16rpx 0 16rpx 32rpx">
  37. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  38. </view>
  39. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true' style="height:400px;flex:1;">
  40. <u-list-item v-for="(item, index) in indexList" :key="index">
  41. <view class="paisong" @click="Workorderdetails2(item)">
  42. <view class="status bg3" v-if="item.urgency==1">
  43. 非常紧急
  44. </view>
  45. <view class="status bg2" v-if="item.urgency==2">
  46. 紧急
  47. </view>
  48. <view class="status bg1" v-if="item.urgency==3">
  49. 普通
  50. </view>
  51. <view class="title">{{item.repairPosition}}</view>
  52. <view class="subtit" v-if='item.repairType==1'>
  53. 报修类型: 水
  54. </view>
  55. <view class="subtit" v-if='item.repairType==2'>
  56. 报修类型: 电
  57. </view>
  58. <view class="subtit" v-if='item.repairType==3'>
  59. 报修类型: 其他
  60. </view>
  61. <view class="subtit">
  62. 派送时间:{{ item.updateDate }}
  63. </view>
  64. </view>
  65. </u-list-item>
  66. </u-list>
  67. </view>
  68. </view>
  69. <!--已维修 -->
  70. <view class="contain" v-show="cdshow==2">
  71. <!-- 列表 -->
  72. <view class="u-listdata">
  73. <view style="padding:16rpx 0 16rpx 32rpx">
  74. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  75. </view>
  76. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true' style="height:400px;flex:1">
  77. <u-list-item v-for="(item, index) in indexList" :key="index">
  78. <view class="paisong" @click="Workorderdetails3(item)">
  79. <view class="status bg3" v-if="item.urgency==1">
  80. 非常紧急
  81. </view>
  82. <view class="status bg2" v-if="item.urgency==2">
  83. 紧急
  84. </view>
  85. <view class="status bg1" v-if="item.urgency==3">
  86. 普通
  87. </view>
  88. <view class="title">{{item.repairPosition}}</view>
  89. <view class="subtit" v-if='item.repairType==1'>
  90. 报修类型: 水
  91. </view>
  92. <view class="subtit" v-if='item.repairType==2'>
  93. 报修类型: 电
  94. </view>
  95. <view class="subtit" v-if='item.repairType==3'>
  96. 报修类型: 其他
  97. </view>
  98. <view class="subtit">
  99. 维修完成时间:{{ item.repairFinishTime }}
  100. </view>
  101. </view>
  102. </u-list-item>
  103. </u-list>
  104. </view>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. // import { isEmpty, getDictDataList } from "@/utils/index";
  110. export default {
  111. name: 'Workordertodone',
  112. data() {
  113. return {
  114. totalnumber: 0,
  115. jfnodata: false,
  116. showtype: false,
  117. cdshow: 0,
  118. fatherparameter: {},
  119. expensedata: '全部',
  120. list: [],
  121. gly: true,
  122. current: 0,
  123. dataForm: {
  124. status: "1",
  125. page: 1,
  126. limit: 10,
  127. },
  128. indexList: [],
  129. payStatusList: [],
  130. nodata: true,
  131. pd: true,
  132. columnstype: [],
  133. repairTypeList: [],
  134. UrgencyTypelist: [],
  135. }
  136. },
  137. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  138. onLoad: function(options) { //option为object类型,会序列化上个页面传递的参数
  139. let permissions = uni.getStorageSync('ButtonPermissions');
  140. let isHave = permissions.includes('app:Tobeassigned');
  141. this.gly = permissions.includes('app:Tobeassigned');
  142. // console.log('2222',isHave)
  143. if (isHave) {
  144. this.list = [{
  145. name: '待指派'
  146. }, {
  147. name: '已指派(待维修)'
  148. }, {
  149. name: '已维修'
  150. }];
  151. this.cdshow = 0;
  152. this.indexList = [];
  153. this.dataForm.page = 1;
  154. this.dataForm.status = 1;
  155. this.getpaisongdata();
  156. } else {
  157. this.list = [{
  158. name: '已指派(待维修)'
  159. }, {
  160. name: '已维修'
  161. }];
  162. this.cdshow = 1;
  163. this.indexList = [];
  164. this.dataForm.page = 1;
  165. this.dataForm.status = 2;
  166. this.getpaisongdata();
  167. }
  168. },
  169. methods: {
  170. Workorderdetails1(e) {
  171. uni.navigateTo({
  172. url: `/pages/index/Workordertodone/Workorderdetails/Workorderdetails?id=${e.id}`
  173. });
  174. },
  175. Workorderdetails2(e) {
  176. uni.navigateTo({
  177. url: `/pages/index/Workordertodone/Toberepaired/Toberepaired?id=${e.id}`
  178. });
  179. },
  180. Workorderdetails3(e) {
  181. uni.navigateTo({
  182. url: `/pages/index/Workordertodone/hasrepaired/hasrepaired?id=${e.id}`
  183. });
  184. },
  185. sectionChange(val) {
  186. if (this.gly) {
  187. this.current = val.index;
  188. if (val.index == 0) {
  189. this.cdshow = 0;
  190. this.indexList = [];
  191. this.dataForm.page = 1;
  192. this.dataForm.status = 1;
  193. this.getpaisongdata();
  194. } else if (val.index == 1) {
  195. this.cdshow = 1;
  196. this.indexList = [];
  197. this.dataForm.page = 1;
  198. this.dataForm.status = 2;
  199. this.getpaisongdata();
  200. } else if (val.index == 2) {
  201. this.cdshow = 2;
  202. this.indexList = [];
  203. this.dataForm.page = 1;
  204. this.dataForm.status = 3;
  205. this.getpaisongdata();
  206. }
  207. } else {
  208. this.current = val.index;
  209. if (val.index == 0) {
  210. this.cdshow = 1;
  211. this.indexList = [];
  212. this.dataForm.page = 1;
  213. this.dataForm.status = 2;
  214. this.getpaisongdata();
  215. } else if (index == 1) {
  216. this.cdshow = 2;
  217. this.indexList = [];
  218. this.dataForm.page = 1;
  219. this.dataForm.status = 3;
  220. this.getpaisongdata();
  221. }
  222. }
  223. },
  224. scrolltolower() {
  225. if (this.pd) {
  226. this.getpaisongdata();
  227. } else {
  228. return
  229. }
  230. },
  231. getpaisongdata() {
  232. this.$api.get('/repairorder/page', this.dataForm)
  233. .then(res => {
  234. this.totalnumber = res.data.data.total;
  235. if (res.data.data.list.length != 0) {
  236. this.indexList.push(...res.data.data.list);
  237. this.dataForm.page = this.dataForm.page + 1;
  238. this.pd = true;
  239. this.jfnodata = false;
  240. } else {
  241. uni.showToast({
  242. title: '暂无更多数据了',
  243. icon: 'none',
  244. duration: 1500
  245. })
  246. this.pd = false;
  247. }
  248. })
  249. },
  250. }
  251. }
  252. </script>
  253. <style lang="scss">
  254. .nodata {
  255. text-align: center;
  256. padding-top: 400rpx;
  257. }
  258. .page {
  259. height: 100%;
  260. overflow: hidden;
  261. .contain {
  262. height: calc(100% - 44px);
  263. padding: 0;
  264. display: flex;
  265. flex-direction: column;
  266. .u-listdata {
  267. height: 400px;
  268. flex: 1;
  269. display: flex;
  270. flex-direction: column;
  271. }
  272. }
  273. }
  274. .paisong {
  275. display: flex;
  276. flex-direction: column;
  277. justify-content: center;
  278. background-color: #fff;
  279. margin: 0 16px 24rpx;
  280. padding: 12px 16px;
  281. border-radius: 4px;
  282. position: relative;
  283. .title {
  284. font-size: 32rpx;
  285. color: #0C1935;
  286. margin-bottom: 16rpx;
  287. span {
  288. color: #FA5555;
  289. font-weight: 600;
  290. }
  291. }
  292. .subtit {
  293. color: #9DA0AC;
  294. margin-bottom: 6rpx;
  295. }
  296. .status {
  297. position: absolute;
  298. padding: 1px 5px;
  299. border-radius: 0 8rpx 0 24rpx;
  300. right: 0;
  301. line-height: 48rpx;
  302. text-align: center;
  303. top: 0;
  304. z-index: 1;
  305. font-size: 22rpx;
  306. background-color: rgba(48, 211, 162, .16);
  307. color: rgba(48, 211, 162, 1);
  308. &.bg2 {
  309. background-color: rgba(255, 156, 39, .16);
  310. color: rgba(255, 156, 39, 1);
  311. }
  312. &.bg3 {
  313. background-color: rgba(237, 58, 37, .16);
  314. color: rgba(237, 58, 37, 1);
  315. }
  316. }
  317. }
  318. </style>