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':wid,'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. wid:'250rpx',
  115. totalnumber: 0,
  116. jfnodata: false,
  117. showtype: false,
  118. cdshow: 0,
  119. fatherparameter: {},
  120. expensedata: '全部',
  121. list: [],
  122. gly: true,
  123. current: 0,
  124. dataForm: {
  125. status: "1",
  126. page: 1,
  127. limit: 10,
  128. },
  129. indexList: [],
  130. payStatusList: [],
  131. nodata: true,
  132. pd: true,
  133. columnstype: [],
  134. repairTypeList: [],
  135. UrgencyTypelist: [],
  136. }
  137. },
  138. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  139. onLoad: function(options) { //option为object类型,会序列化上个页面传递的参数
  140. let permissions = uni.getStorageSync('ButtonPermissions');
  141. let isHave = permissions.includes('app:Tobeassigned');
  142. this.gly = permissions.includes('app:Tobeassigned');
  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.wid="375rpx";
  158. this.list = [{
  159. name: '已指派(待维修)'
  160. }, {
  161. name: '已维修'
  162. }];
  163. this.cdshow = 1;
  164. this.indexList = [];
  165. this.dataForm.page = 1;
  166. this.dataForm.status = 2;
  167. this.getpaisongdata();
  168. }
  169. },
  170. methods: {
  171. Workorderdetails1(e) {
  172. uni.navigateTo({
  173. url: `/pages/index/Workordertodone/Workorderdetails/Workorderdetails?id=${e.id}`
  174. });
  175. },
  176. Workorderdetails2(e) {
  177. uni.navigateTo({
  178. url: `/pages/index/Workordertodone/Toberepaired/Toberepaired?id=${e.id}`
  179. });
  180. },
  181. Workorderdetails3(e) {
  182. uni.navigateTo({
  183. url: `/pages/index/Workordertodone/hasrepaired/hasrepaired?id=${e.id}`
  184. });
  185. },
  186. sectionChange(val) {
  187. if (this.gly) {
  188. this.current = val.index;
  189. if (val.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 (val.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 (val.index == 2) {
  202. this.cdshow = 2;
  203. this.indexList = [];
  204. this.dataForm.page = 1;
  205. this.dataForm.status = 3;
  206. this.getpaisongdata();
  207. }
  208. } else {
  209. this.current = val.index;
  210. if (val.index == 0) {
  211. this.cdshow = 1;
  212. this.indexList = [];
  213. this.dataForm.page = 1;
  214. this.dataForm.status = 2;
  215. this.getpaisongdata();
  216. } else if (val.index == 1) {
  217. this.cdshow = 2;
  218. this.indexList = [];
  219. this.dataForm.page = 1;
  220. this.dataForm.status = 3;
  221. this.getpaisongdata();
  222. }
  223. }
  224. },
  225. scrolltolower() {
  226. if (this.pd) {
  227. this.getpaisongdata();
  228. } else {
  229. return
  230. }
  231. },
  232. getpaisongdata() {
  233. this.$api.get('/repairorder/page', this.dataForm)
  234. .then(res => {
  235. this.totalnumber = res.data.data.total;
  236. if (res.data.data.list.length != 0) {
  237. this.indexList.push(...res.data.data.list);
  238. this.dataForm.page = this.dataForm.page + 1;
  239. this.pd = true;
  240. this.jfnodata = false;
  241. } else {
  242. uni.showToast({
  243. title: '暂无更多数据了',
  244. icon: 'none',
  245. duration: 1500
  246. })
  247. this.pd = false;
  248. }
  249. })
  250. },
  251. }
  252. }
  253. </script>
  254. <style lang="scss">
  255. .nodata {
  256. text-align: center;
  257. padding-top: 400rpx;
  258. }
  259. .page {
  260. height: 100%;
  261. overflow: hidden;
  262. .contain {
  263. height: calc(100% - 44px);
  264. padding: 0;
  265. display: flex;
  266. flex-direction: column;
  267. .u-listdata {
  268. height: 400px;
  269. flex: 1;
  270. display: flex;
  271. flex-direction: column;
  272. }
  273. }
  274. }
  275. .paisong {
  276. display: flex;
  277. flex-direction: column;
  278. justify-content: center;
  279. background-color: #fff;
  280. margin: 0 16px 24rpx;
  281. padding: 12px 16px;
  282. border-radius: 4px;
  283. position: relative;
  284. .title {
  285. font-size: 32rpx;
  286. color: #0C1935;
  287. margin-bottom: 16rpx;
  288. span {
  289. color: #FA5555;
  290. font-weight: 600;
  291. }
  292. }
  293. .subtit {
  294. color: #9DA0AC;
  295. margin-bottom: 6rpx;
  296. }
  297. .status {
  298. position: absolute;
  299. padding: 1px 5px;
  300. border-radius: 0 8rpx 0 24rpx;
  301. right: 0;
  302. line-height: 48rpx;
  303. text-align: center;
  304. top: 0;
  305. z-index: 1;
  306. font-size: 22rpx;
  307. background-color: rgba(48, 211, 162, .16);
  308. color: rgba(48, 211, 162, 1);
  309. &.bg2 {
  310. background-color: rgba(255, 156, 39, .16);
  311. color: rgba(255, 156, 39, 1);
  312. }
  313. &.bg3 {
  314. background-color: rgba(237, 58, 37, .16);
  315. color: rgba(237, 58, 37, 1);
  316. }
  317. }
  318. }
  319. </style>