todaycheckorderlist.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="wrap">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. :title="title" @clickLeft="toBack">
  5. </uni-nav-bar>
  6. <!-- <u-gap height="75px"></u-gap> -->
  7. <view class="container">
  8. <uni-list>
  9. <uni-list-item v-for="item in list" :key="item.id">
  10. <!-- 自定义 body -->
  11. <template v-slot:body>
  12. <view style="min-height: 110px;width: 100%;display: flex;flex-direction: column;">
  13. <view>
  14. <text style="font-size: 1rem;font-weight: bold;">{{item.rtuName}}</text>
  15. <text style="font-size: 0.9rem;">[{{item.rtuCode}}]</text>
  16. </view>
  17. <view style="display: flex;flex-direction: row;min-height: 30px;">
  18. <view style="font-size: 0.7rem;color: #18B566;">{{item.orderStatusName}}</view>
  19. <view style="margin-left:10px;width:100px;font-size: 0.7rem;color:gray;">
  20. {{item.processorName}}
  21. </view>
  22. <view style="margin-left:0px;font-size: 0.7rem;color:gray;">{{item.createTime}}</view>
  23. </view>
  24. <view style="margin-top: 0px;">
  25. <text style="font-size: 0.7rem;">{{item.orderDesc}}</text>
  26. </view>
  27. <view style="margin-top:4px;display: flex;flex-direction: row;justify-content: flex-end;">
  28. <view
  29. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  30. @click="toWarningPage(item.warnId)">
  31. <view style="display:flex;flex-direction: column;justify-content: center;">
  32. <uIcons class="input-uni-icon" type="notification" size="18" color="#999" />
  33. </view>
  34. <view
  35. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  36. <text style="color:black;font-size:0.6rem">预警信息</text>
  37. </view>
  38. </view>
  39. <view v-if="item.isConfirm ==1"
  40. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  41. @click="toOrderReport(item.id)">
  42. <view style="display:flex;flex-direction: column;justify-content: center;">
  43. <uIcons class="input-uni-icon" type="gear" size="18" color="#999" />
  44. </view>
  45. <view
  46. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  47. <text style="color:black;font-size:0.6rem">工单填报</text>
  48. </view>
  49. </view>
  50. <view v-else
  51. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  52. @click="toOrderConfirm(item.id)">
  53. <view style="display:flex;flex-direction: column;justify-content: center;">
  54. <uIcons class="input-uni-icon" type="gear" size="18" color="#999" />
  55. </view>
  56. <view
  57. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  58. <text style="color:black;font-size:0.6rem">接单确认</text>
  59. </view>
  60. </view>
  61. <view
  62. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  63. @click="toLocation(item)">
  64. <view style="display:flex;flex-direction: column;justify-content: center;">
  65. <uIcons class="input-uni-icon" type="location" size="18" color="#999" />
  66. </view>
  67. <view
  68. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  69. <text style="color:black;font-size:0.6rem">导航</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. </uni-list-item>
  76. </uni-list>
  77. <uGroup>
  78. <view class="uni-pagination-box">
  79. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  80. @change="change" />
  81. </view>
  82. </uGroup>
  83. </view>
  84. <u-gap height="70"></u-gap>
  85. </view>
  86. </template>
  87. <script>
  88. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  89. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  90. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  91. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  92. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  93. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  94. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  95. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  96. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  97. import http from '@/http/api.js';
  98. export default {
  99. components: {
  100. uNavBar,
  101. uList,
  102. uListItem,
  103. uIcons,
  104. uGroup,
  105. },
  106. onLoad(option) {
  107. this.getOrderList();
  108. },
  109. data() {
  110. return {
  111. list: [],
  112. title: '今日工单',
  113. desc: '',
  114. pageSize: 10,
  115. // 当前页
  116. pageCurrent: 1,
  117. // 数据总量
  118. total: 0,
  119. }
  120. },
  121. computed: {
  122. getIcon() {
  123. return path => {
  124. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  125. }
  126. },
  127. },
  128. onShow() {
  129. },
  130. created() {
  131. },
  132. methods: {
  133. toBack() {
  134. uni.navigateBack({
  135. delta: 1
  136. })
  137. },
  138. // 分页触发
  139. change(e) {
  140. //this.$refs.table.clearSelection()
  141. this.selectedIndexs.length = 0
  142. this.pageCurrent = e.current;
  143. this.getOrderList()
  144. },
  145. getOrderList() {
  146. const current = this.pageCurrent;
  147. const size = this.pageSize;
  148. const isSubmit = '0';
  149. var that = this;
  150. http.request({
  151. url: '/galaxy-test/rtu/check/order/today/page',
  152. method: 'GET',
  153. params: {
  154. current,
  155. size,
  156. isSubmit
  157. },
  158. }).then(res => {
  159. if (res.data.records != null) {
  160. that.list = res.data.records;
  161. }
  162. this.total = res.data.total;
  163. }).catch(err => {
  164. console.log(err)
  165. })
  166. },
  167. toWarningPage(id) {
  168. var url = '/pages/warning/warninginfodetail?id=' + id;
  169. uni.navigateTo({
  170. url: url
  171. })
  172. },
  173. toOrderReport(id) {
  174. var url = '/pages/check-order/orderprocesslist?id=' + id;
  175. uni.navigateTo({
  176. url: url
  177. })
  178. },
  179. toOrderConfirm(id) {
  180. var that = this;
  181. var postData = {};
  182. postData['id'] = id;
  183. http.request({
  184. url: '/galaxy-test/rtu/check/order/confirm',
  185. method: 'POST',
  186. data: postData
  187. }).then(res => {
  188. console.log(res)
  189. if (res.success) {
  190. this.getOrderList()
  191. uni.showToast({
  192. title: '工单确认操作已成功!',
  193. icon: 'none'
  194. })
  195. }
  196. }).catch(err => {
  197. console.log(err)
  198. })
  199. },
  200. toLocation(item) {
  201. let lat = item.lat;
  202. let lng = item.lng;
  203. let name = item.rtuName;
  204. let add = item.locationDesc;
  205. uni.openLocation({
  206. latitude: Number(lat),
  207. longitude: Number(lng),
  208. name: name,
  209. address: add,
  210. success() {
  211. }
  212. })
  213. },
  214. getTitle(checkNo) {
  215. return "问题编号:" + checkNo;
  216. },
  217. swipeChange(e, index) {
  218. console.log('返回:', e);
  219. console.log('当前索引:', index);
  220. },
  221. swipeClick(e, index) {
  222. },
  223. locationToHandle(id) {
  224. const that = this;
  225. // uni.showModal({
  226. // content: '确定删除记录?',
  227. // showCancel: true,
  228. // success(res) {
  229. // if (res.confirm) {
  230. // var ids = id;
  231. // http.request({
  232. // url: '/blade-business/report/failure/remove',
  233. // method: 'POST',
  234. // params: {
  235. // ids
  236. // }
  237. // }).then(res => {
  238. // console.log(JSON.stringify(res.data))
  239. // if (res.success) {
  240. // uni.showModal({
  241. // content: '删除已成功',
  242. // showCancel: false,
  243. // success(res) {
  244. // if (res.confirm) {
  245. // that.loadList();
  246. // }
  247. // }
  248. // });
  249. // }
  250. // }).catch(err => {
  251. // console.log(err)
  252. // })
  253. // }
  254. // }
  255. // });
  256. }
  257. }
  258. }
  259. </script>
  260. <style>
  261. /* page {
  262. background-color: rgb(240, 242, 244);
  263. } */
  264. </style>
  265. <style lang="scss" scoped>
  266. .container {
  267. padding: 0 0 150rpx;
  268. }
  269. .u-cell-icon {
  270. width: 36rpx;
  271. height: 36rpx;
  272. margin-right: 8rpx;
  273. }
  274. .slot-box {
  275. /* #ifndef APP-NVUE */
  276. display: flex;
  277. /* #endif */
  278. flex-direction: row;
  279. align-items: center;
  280. }
  281. .slot-image {
  282. /* #ifndef APP-NVUE */
  283. display: block;
  284. /* #endif */
  285. margin-right: 10px;
  286. width: 30px;
  287. height: 30px;
  288. }
  289. .slot-text {
  290. flex: 1;
  291. font-size: 14px;
  292. color: #4cd964;
  293. margin-right: 10px;
  294. }
  295. .content-box {
  296. flex: 1;
  297. /* #ifdef APP-NVUE */
  298. justify-content: center;
  299. /* #endif */
  300. height: 100%;
  301. line-height: 44px;
  302. padding: 0 15px;
  303. position: relative;
  304. background-color: #fff;
  305. border-bottom-color: #f5f5f5;
  306. border-bottom-width: 1px;
  307. border-bottom-style: solid;
  308. }
  309. .content-text {
  310. font-size: 15px;
  311. }
  312. .example-body {
  313. /* #ifndef APP-NVUE */
  314. display: flex;
  315. /* #endif */
  316. flex-direction: row;
  317. justify-content: center;
  318. padding: 10px 0;
  319. background-color: #fff;
  320. }
  321. .button {
  322. border-color: #e5e5e5;
  323. border-style: solid;
  324. border-width: 1px;
  325. padding: 4px 8px;
  326. border-radius: 4px;
  327. }
  328. .button-text {
  329. font-size: 15px;
  330. }
  331. .slot-button {
  332. /* #ifndef APP-NVUE */
  333. display: flex;
  334. height: 100%;
  335. /* #endif */
  336. flex: 1;
  337. flex-direction: row;
  338. justify-content: center;
  339. align-items: center;
  340. padding: 0 20px;
  341. background-color: #ff5a5f;
  342. }
  343. .slot-button-text {
  344. color: #ffffff;
  345. font-size: 14px;
  346. }
  347. </style>