checkorderlist.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <view class="wrap">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. @clickLeft="toBack">
  5. <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  6. <text style="color: white;font-size: 1rem;">{{title}}</text>
  7. </view>
  8. </uni-nav-bar>
  9. <view class="container">
  10. <uSection title="查询" type="line" style="padding-left: 10px;padding-right: 10px;">
  11. <uni-data-picker placeholder="请选择机构" popup-title="请选择所在地区" :localdata="projectTree"
  12. v-model="selectedTreeNode" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
  13. @popupclosed="onpopupclosed">
  14. </uni-data-picker>
  15. </uSection>
  16. <view>
  17. <uni-search-bar placeholder="请录入测站编码或测站名称" @confirm="search" :focus="false" v-model="searchVal"
  18. @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear">
  19. </uni-search-bar>
  20. </view>
  21. <uSection title="">
  22. <uni-list>
  23. <uni-list-item v-for="item in list" :key="item.id">
  24. <template v-slot:body>
  25. <view style="min-height: 110px;width: 100%;display: flex;flex-direction: column;">
  26. <view style="display: flex;flex-direction: row;align-items: center;">
  27. <image class="order-title-image" style="box-shadow:0 0 2px 2px lightblue"
  28. src="/static/images/logo_app.png" mode="widthFix">
  29. </image>
  30. <text
  31. style="margin-left: 5px;font-size: 1rem;font-weight: bold;">{{item.rtuName}}</text>
  32. <text style="margin-left: 5px;font-size: 0.9rem;">[{{item.rtuCode}}]</text>
  33. </view>
  34. <view v-if="item.orderClose == 1"
  35. style="display: flex;flex-direction: row;align-items: center; min-height: 30px;">
  36. <uIcons class="input-uni-icon" type="checkbox" size="18" color="skyblue" />
  37. <view style="margin-left:5px;font-size: 0.8rem;">关闭时间:</view>
  38. <view style="margin-left:5px;font-size: 0.8rem;color:gray;">{{item.updateTime}}
  39. </view>
  40. </view>
  41. <view v-else-if="item.orderConfirm == 1"
  42. style="display: flex;flex-direction: row;align-items: center; min-height: 30px;">
  43. <view style="width: 35%;display: flex;flex-direction: row;align-items: center;">
  44. <uIcons class="input-uni-icon" type="auth" size="18" color="skyblue" />
  45. <view style="margin-left: 5px;font-size: 0.8rem;color: gray;">
  46. {{item.processorName}}
  47. </view>
  48. </view>
  49. <view style="font-size: 0.8rem;">接单时间:</view>
  50. <view style="margin-left:5px;font-size: 0.8rem;color:gray;">
  51. {{item.orderConfirmTime}}
  52. </view>
  53. </view>
  54. <view v-else
  55. style="display: flex;flex-direction: row;align-items: center; min-height: 30px;">
  56. <uIcons class="input-uni-icon" type="notification" size="18" color="skyblue" />
  57. <view style="margin-left:5px;font-size: 0.8rem;">报单时间:</view>
  58. <view style="margin-left:5px;font-size: 0.8rem;color:gray;">{{item.createTime}}
  59. </view>
  60. </view>
  61. <view v-if="item.orderClose == 0"
  62. style="display:flex;flex-direction:row;align-items: center;">
  63. <image class="slot-image" src="/static/images/icon_warning.png" mode="widthFix">
  64. </image>
  65. <text style="font-size:0.8rem;padding-left: 10rpx;">{{item.orderDesc}}</text>
  66. </view>
  67. <view
  68. style="margin-top:4px;display: flex;flex-direction: row;justify-content: flex-end;">
  69. <view v-if="item.orderClose == 1"
  70. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightgreen"
  71. @click="toDetailPage(item.id)">
  72. <view style="display:flex;flex-direction: column;justify-content: center;">
  73. <uIcons class="input-uni-icon" type="info" size="18" color="gray" />
  74. </view>
  75. <view
  76. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  77. <text style="color:black;font-size:0.7rem">查看详情</text>
  78. </view>
  79. </view>
  80. <view v-else-if="item.orderConfirm == 1"
  81. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  82. @click="toOrderReport(item.id)">
  83. <view style="display:flex;flex-direction: column;justify-content: center;">
  84. <uIcons class="input-uni-icon" type="compose" size="18" color="gray" />
  85. </view>
  86. <view
  87. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  88. <text style="color:black;font-size:0.7rem">工单填报</text>
  89. </view>
  90. </view>
  91. <view v-else
  92. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightpink"
  93. @click="toOrderConfirm(item.id)">
  94. <view style="display:flex;flex-direction: column;justify-content: center;">
  95. <uIcons class="input-uni-icon" type="location" size="18" color="gray" />
  96. </view>
  97. <view
  98. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  99. <text style="color:black;font-size:0.7rem">接单确认</text>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. </uni-list-item>
  106. </uni-list>
  107. </uSection>
  108. <uGroup>
  109. <view class="uni-pagination-box">
  110. <uPagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  111. @change="change" />
  112. </view>
  113. </uGroup>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  119. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  120. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  121. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  122. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  123. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  124. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  125. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  126. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  127. import http from '@/http/api.js';
  128. export default {
  129. components: {
  130. uNavBar,
  131. uList,
  132. uListItem,
  133. uIcons,
  134. uGroup,
  135. uPagination,
  136. uBreadcrumb,
  137. uSection,
  138. uDataPicker
  139. },
  140. onLoad(option) {
  141. this.getProjectTree();
  142. },
  143. data() {
  144. return {
  145. list: [],
  146. title: '工单查询',
  147. desc: '',
  148. pageSize: 10,
  149. // 当前页
  150. pageCurrent: 1,
  151. // 数据总量
  152. total: 0,
  153. orgId: '',
  154. projectId: '',
  155. projectTree: [],
  156. selectedTreeNode: '',
  157. searchVal: '',
  158. }
  159. },
  160. computed: {
  161. getIcon() {
  162. return path => {
  163. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  164. }
  165. },
  166. },
  167. onShow() {
  168. },
  169. methods: {
  170. toBack() {
  171. uni.navigateBack({
  172. delta: 1
  173. })
  174. },
  175. // 分页触发
  176. change(e) {
  177. //this.$refs.table.clearSelection()
  178. //this.selectedIndexs.length = 0
  179. this.pageCurrent = e.current;
  180. this.getOrderList()
  181. },
  182. onnodeclick(node) {
  183. if (node.projectId != null) {
  184. this.orgId = node.orgId;
  185. this.projectId = node.projectId;
  186. this.searchVal = '';
  187. this.pageCurrent = 1;
  188. this.getOrderList();
  189. }
  190. },
  191. onpopupopened(e) {
  192. },
  193. onpopupclosed(e) {
  194. },
  195. onchange(e) {
  196. },
  197. search(res) {
  198. this.getOrderList();
  199. },
  200. input(res) {
  201. },
  202. clear(res) {
  203. this.searchVal = '';
  204. this.getOrderList();
  205. },
  206. blur(res) {},
  207. focus(e) {},
  208. cancel(res) {
  209. this.searchVal = '';
  210. this.getOrderList();
  211. },
  212. onBackPress() {
  213. // #ifdef APP-PLUS
  214. plus.key.hideSoftKeybord();
  215. // #endif
  216. },
  217. getProjectTree() {
  218. var that = this;
  219. http.request({
  220. url: '/galaxy-test/rtu/manage/tree',
  221. method: 'GET',
  222. }).then(res => {
  223. console.log(res)
  224. if (res.data != null) {
  225. that.projectTree = res.data;
  226. that.selectedTreeNode = that.projectTree[0].value;
  227. that.orgId = that.projectTree[0].orgId;
  228. that.projectId = that.projectTree[0].projectId;
  229. that.getOrderList();
  230. }
  231. }).catch(err => {
  232. console.log(err)
  233. })
  234. },
  235. getOrderList() {
  236. const current = this.pageCurrent;
  237. const size = this.pageSize;
  238. const isSubmit = '0';
  239. var postData = {};
  240. postData['rtuCode'] = this.searchVal;
  241. postData['rtuName'] = this.searchVal;
  242. postData['orgId'] = this.orgId;
  243. postData['projectId'] = this.projectId;
  244. var that = this;
  245. http.request({
  246. url: '/galaxy-test/rtu/check/order/page',
  247. method: 'GET',
  248. params: {
  249. current,
  250. size,
  251. isSubmit
  252. },
  253. data: postData,
  254. }).then(res => {
  255. if (res.data.records != null) {
  256. that.list = res.data.records;
  257. }
  258. this.total = res.data.total;
  259. }).catch(err => {
  260. console.log(err)
  261. })
  262. },
  263. toDetailPage(id) {
  264. var url = '/pages/check-order/orderprocessrecord?id=' + id;
  265. uni.navigateTo({
  266. url: url
  267. })
  268. },
  269. toOrderReport(id) {
  270. var url = '/pages/check-order/orderprocesslist?id=' + id;
  271. uni.navigateTo({
  272. url: url
  273. })
  274. },
  275. toOrderConfirm(id) {
  276. var that = this;
  277. uni.showModal({
  278. content: '确定进行接单确认操作?',
  279. showCancel: true,
  280. success(res) {
  281. if (res.confirm) {
  282. var postData2 = {};
  283. postData2['id'] = id;
  284. http.request({
  285. url: '/galaxy-test/rtu/check/order/confirm',
  286. method: 'POST',
  287. data: postData2
  288. }).then(res => {
  289. console.log(res)
  290. if (res.success) {
  291. uni.showModal({
  292. content: '接单已成功,是否立即填报?',
  293. showCancel: true,
  294. success(res) {
  295. if (res.confirm) {
  296. var url =
  297. '/pages/check-order/orderprocesslist?id=' + id;
  298. uni.navigateTo({
  299. url: url
  300. })
  301. }
  302. }
  303. });
  304. }
  305. }).catch(err => {
  306. console.log(err)
  307. })
  308. }
  309. }
  310. });
  311. },
  312. toLocation(item) {
  313. let lat = item.lat;
  314. let lng = item.lng;
  315. let name = item.rtuName;
  316. let add = item.locationDesc;
  317. uni.openLocation({
  318. latitude: Number(lat),
  319. longitude: Number(lng),
  320. name: name,
  321. address: "",
  322. success() {}
  323. })
  324. },
  325. }
  326. }
  327. </script>
  328. <style>
  329. </style>
  330. <style lang="scss" scoped>
  331. .container {
  332. padding: 0 0 100rpx;
  333. }
  334. .u-cell-icon {
  335. width: 36rpx;
  336. height: 36rpx;
  337. margin-right: 8rpx;
  338. }
  339. .slot-box {
  340. /* #ifndef APP-NVUE */
  341. display: flex;
  342. /* #endif */
  343. flex-direction: row;
  344. align-items: center;
  345. }
  346. .slot-image {
  347. /* #ifndef APP-NVUE */
  348. display: block;
  349. /* #endif */
  350. //margin-right: 10px;
  351. width: 20px;
  352. height: 20px;
  353. }
  354. .order-title-image {
  355. /* #ifndef APP-NVUE */
  356. display: block;
  357. /* #endif */
  358. // margin-right: 10px;
  359. width: 20px;
  360. height: 20px;
  361. border-radius: 50%;
  362. }
  363. .slot-text {
  364. flex: 1;
  365. font-size: 14px;
  366. color: #4cd964;
  367. margin-right: 10px;
  368. }
  369. .content-box {
  370. flex: 1;
  371. /* #ifdef APP-NVUE */
  372. justify-content: center;
  373. /* #endif */
  374. height: 100%;
  375. line-height: 44px;
  376. padding: 0 15px;
  377. position: relative;
  378. background-color: #fff;
  379. border-bottom-color: #f5f5f5;
  380. border-bottom-width: 1px;
  381. border-bottom-style: solid;
  382. }
  383. .content-text {
  384. font-size: 15px;
  385. }
  386. .example-body {
  387. /* #ifndef APP-NVUE */
  388. display: flex;
  389. /* #endif */
  390. flex-direction: row;
  391. justify-content: center;
  392. padding: 10px 0;
  393. background-color: #fff;
  394. }
  395. .button {
  396. border-color: #e5e5e5;
  397. border-style: solid;
  398. border-width: 1px;
  399. padding: 4px 8px;
  400. border-radius: 4px;
  401. }
  402. .button-text {
  403. font-size: 15px;
  404. }
  405. .slot-button {
  406. /* #ifndef APP-NVUE */
  407. display: flex;
  408. height: 100%;
  409. /* #endif */
  410. flex: 1;
  411. flex-direction: row;
  412. justify-content: center;
  413. align-items: center;
  414. padding: 0 20px;
  415. background-color: #ff5a5f;
  416. }
  417. .slot-button-text {
  418. color: #ffffff;
  419. font-size: 14px;
  420. }
  421. </style>