driverList.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <template>
  2. <view class="order-list content">
  3. <u-sticky bgColor="#fff" class="main-sticky">
  4. <view class="search-wrap">
  5. <view class="input-wrap">
  6. <view @click="showPopup('popupTenant')" class="input">
  7. <u--input prefixIcon="account-fill" readonly :placeholder="$t('queue.pleaseSelectTenant')"
  8. :prefixIconStyle="{fontSize:'46rpx',color:'#c8d8ef'}" border="none"
  9. v-model="form.tenantName" placeholderStyle="color:'#c8d8ef'" color="#666"
  10. :showAction='false'></u--input>
  11. </view>
  12. <view @click="onClickRight" class="sx-btn">
  13. <uni-icons type="settings-filled" size='24' color="#333"></uni-icons>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="tabs-box">
  18. <view v-if="form.orderType != '4'">
  19. <u-tabs lineWidth="40" :list="orderStatusList"
  20. :current="form.orderStatus" @change="changeOrderStatus" lineColor="#3275F5"
  21. :itemStyle="{'height':'90rpx','padding':'0 32rpx'}">
  22. </u-tabs>
  23. <!-- <span :class="form.orderStatus == item.value ? 'active' : ''" v-for="item in orderStatusList"
  24. @click="changeOrderStatus(item)" :key="item.name">
  25. {{ item.name }}
  26. </span> -->
  27. </view>
  28. <view v-if="form.orderType == '4'">
  29. <u-tabs lineWidth="40" :list="shareOrderStatusList"
  30. :current="form.orderStatus" @change="changeOrderStatus" lineColor="#3275F5"
  31. :itemStyle="{'height':'90rpx','padding':'0 32rpx'}">
  32. </u-tabs>
  33. <!-- <span :class="form.orderStatus == item.value ? 'active' : ''" v-for="item in shareOrderStatusList"
  34. @click="changeOrderStatus(item)" :key="item.name">
  35. {{ item.name }}
  36. </span> -->
  37. </view>
  38. </view>
  39. <PopupSelect ref="popupTenant" :hasSearch='false' :option="tenantOption" @onConfirm="onTenantConfirm"
  40. @search="getOption" />
  41. </u-sticky>
  42. <!-- 企业选项 -->
  43. <view class="swiper-box">
  44. <template v-if="orderList.length">
  45. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5">
  46. <u-list-item v-for="(item, index) in orderList" :key="index">
  47. <view class="order-card">
  48. <view class="order-card-title">
  49. <span class="type" v-if="item.orderType == '1'">{{ $t('order.temp') }}</span>
  50. <span class="type fixed" v-if="item.orderType == '2'">{{ $t('order.fixed') }}</span>
  51. <span class="type fixed" v-if="item.orderType == '5'">{{ $t('order.plan') }}</span>
  52. <text class="info">{{ item.tenantName || '' }}</text>
  53. <!-- <text class="no">No {{ item.code || '' }}</text> -->
  54. <view class="out-type" v-if="item.backFlag == '1'">
  55. {{item.vehicleType=='101'?$t('order.isBackOut'):$t('order.return')}}
  56. </view>
  57. <template v-if="item.orderType != '4'">
  58. <span class="status" v-if="item.orderStatus == '0'">未进厂</span>
  59. <span class="status"
  60. v-if="item.orderStatus == '1' && item.weighingStatus == '0'">已进厂</span>
  61. <span class="status" v-if="item.orderStatus == '2'">已完成</span>
  62. <span class="status"
  63. v-if="item.orderStatus == '1' && item.weighingStatus != '0'">已过磅</span>
  64. <span class="status bad-status" v-if="item.orderStatus == '4'">已作废</span>
  65. </template>
  66. <template v-if="item.orderType == '4'">
  67. <span class="status" v-if="item.orderStatus == '0'">未接单</span>
  68. <span class="status" v-if="item.orderStatus == '1'">接单中</span>
  69. <span class="status" v-if="item.orderStatus == '2'">已完成</span>
  70. <span class="status bad-status"
  71. v-if="item.enabledMarkType =='1' || item.orderStatus == '4'">已作废</span>
  72. </template>
  73. </view>
  74. <view class="order-card-info">
  75. <view class="order-type">
  76. <u-tag :text="$t('order.suppOrder')" type="error" v-if="item.isMain == 1"></u-tag>
  77. <u-tag :text="$t('order.mixed')" type="success" v-if="item.isMain == 2"></u-tag>
  78. </view>
  79. <view class="row">
  80. <p class="cell">
  81. <!-- <text class="label">{{ $t('order.companyName') }}</text> -->
  82. <text class="info">{{ item.companyName || '' }}</text>
  83. </p>
  84. </view>
  85. <view class="row">
  86. <p class="cell">
  87. <!-- <text class="label">{{ $t('order.orderDate') }}</text> -->
  88. <text class="info">{{ item.setDate || '' }}</text>
  89. </p>
  90. <p class="cell">
  91. <text class="info"
  92. v-if="item.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  93. <text class="info"
  94. v-if="item.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  95. <text class="info"
  96. v-if="item.vehicleType == '103'">{{ $t('order.materialsOrder') }}</text>
  97. <text class="info"
  98. v-if="item.vehicleType == '104'">{{ $t('order.transferOrder') }}</text>
  99. </p>
  100. </view>
  101. <view class="row">
  102. <p class="cell">
  103. <!-- <text class="label">{{ $t('order.materialName') }}</text> -->
  104. <text class="info">{{ item.materialName || '' }}</text>
  105. </p>
  106. <p class="cell">
  107. <!-- <text class="label">{{ $t('order.orderNumber') }}</text> -->
  108. <text class="info"
  109. :style="'font-size: 9pt;font-weight: bold;'+(item.companyClientType=='109'?'color: green;':'color: red;')">{{ item.orderNumber || '' }}{{item.materialKind=='101' && item.companyClientType=='109'?$t('customer_meter.unitB') :(item.orderType ==
  110. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT')) }}</text>
  111. </p>
  112. </view>
  113. <view class="row">
  114. <p class="cell">
  115. <!-- <text class="label">{{ $t('order.driver') }}</text> -->
  116. <text class="info">{{ item.driver || '' }}-{{ item.phone || '' }}</text>
  117. </p>
  118. <p class="cell">
  119. <!-- <text class="label">{{ $t('order.vehicle') }}</text> -->
  120. <text class="info">{{ item.vehicle || '' }}</text>
  121. </p>
  122. </view>
  123. <view class="qrcode-logo" @click="drawQrcode(item)">
  124. <image class="img" src="/subpages/static/czzn-img/state/qrcode.png"
  125. mode=" scaleToFill" />
  126. </view>
  127. <!-- <view class="row" v-if="item.isMain == 1 || item.isMain == 2">
  128. <p class="cell">
  129. <text
  130. class="label">{{ item.isMain == 1 ? $t('order.mainOrder') : $t('order.suppOrder') }}</text>
  131. <text class="info used">{{ item.relationOrderCode || '' }}</text>
  132. </p>
  133. </view> -->
  134. <!-- <view class="row" v-if="item.orderStatus != 0 && item.weighingStatus != 0">
  135. <p class="cell">
  136. <text class="label">{{ $t('order.tareWeight') }}</text>
  137. <text class="info">{{ item.tareWeight || '0' }}</text>
  138. </p>
  139. <p class="cell">
  140. <text class="label">{{ $t('order.grossWeight') }}</text>
  141. <text class="info">{{ item.grossWeight || '0' }}</text>
  142. </p>
  143. </view>
  144. <view class="row">
  145. <p class="cell">
  146. <text class="label">{{ $t('order.netWeight') }}</text>
  147. <text class="info">{{ item.netWeight || '0' }}</text>
  148. </p>
  149. </view>
  150. <view class="row" v-if="item.orderStatus != 0 && item.weighingStatus == 1">
  151. <p class="cell">
  152. <text class="label">{{ $t('order.inTime') }}</text>
  153. <text class="info">{{ item.inTime || '' }}</text>
  154. </p>
  155. </view>
  156. <view class="row" v-if="item.orderStatus != 0 && item.weighingStatus == 2">
  157. <p class="cell">
  158. <text class="label">{{ $t('order.outTime') }}</text>
  159. <text class="info">{{ item.outTime || '' }}</text>
  160. </p>
  161. </view>
  162. <view class="row" v-if="item.orderStatus == 2">
  163. <p class="cell">
  164. <text class="label">{{ $t('order.outDate') }}</text>
  165. <text class="info">{{ item.outDoorTime || '' }}</text>
  166. </p>
  167. </view> -->
  168. </view>
  169. <view class="code">
  170. <view class="label">{{$t('spare.orderCode')}}</view>
  171. <view class="info">{{ item.code || '' }}</view>
  172. <view class="label">{{$t('order.source')}}</view>
  173. <view class="info"> {{$t('order.mini')}}</view>
  174. <!-- <view class="info"> {{getLabel(item.orderSource,orderSourceList)}}</view> -->
  175. </view>
  176. <view class="order-card-bottom">
  177. <view class="btn" v-if="item.orderStatus!=4">
  178. <button class="oper-btn" type='primary' shape="circle" color='#CCCCCC' size="small"
  179. @click="onOrderInfoClick(item)">
  180. {{ $t('mine.detail') }}
  181. </button>
  182. </view>
  183. <!-- <view class="btn" v-if="item.orderType==4 && item.orderStatus!=2">
  184. <u-button type='success' shape="circle" size="small"
  185. @click="onShareOrderClick(item)">
  186. {{$t('base.common.share')}}
  187. </u-button>
  188. </view> -->
  189. <!-- <view class="btn"
  190. v-if="item.companyClientType!='109' && item.isMixed!='0' && item.orderType == 1 && (item.orderStatus == 0 || item.orderStatus == 1) && item.vehicleType == 101 && item.materialKind == 101 && (!item.loadFlag || item.loadFlag == 0 ) && item.isMain != 1">
  191. <button class="oper-btn" type='warning' shape="circle" size="small"
  192. @click="onMixedOrderClick(item)">
  193. {{ $t('base.button.mixed') }}
  194. </button>
  195. </view> -->
  196. </view>
  197. </view>
  198. </u-list-item>
  199. </u-list>
  200. </template>
  201. <template v-else>
  202. <u-empty mode="orderTypeList" icon="https://cdn.uviewui.com/uview/empty/list.png">
  203. </u-empty>
  204. </template>
  205. </view>
  206. <u-popup :show="showSearch" :round="16" @close="showSearch = false" mode="bottom">
  207. <view class="search-dialog">
  208. <p class="dialog-title">{{ $t('base.common.condition') }}</p>
  209. <view class="condition-wrap">
  210. <view class="row">
  211. <uni-datetime-picker :end='maxDate' :clear-icon="false" :value="searchOption.range"
  212. type="daterange" @change="confirm" />
  213. </view>
  214. <!-- 输入内容 -->
  215. <view class="row">
  216. <p class="p-title">{{ $t('base.common.placeholder') }}</p>
  217. <u-search class="p-input" bgColor='#fff' :showAction='false'
  218. :placeholder="$t('base.common.inputPlaceholder')" v-model="keyword">
  219. </u-search>
  220. </view>
  221. <!-- <view class="row"> -->
  222. <!-- 选择业务类型 -->
  223. <!-- <p class="p-title">{{ $t('order.vehicleType') }}</p>
  224. <u-radio-group v-model="form.vehicleType" @change="onVehicleTypeChange" placement="row"
  225. class="p-input">
  226. <u-radio :customStyle="{ marginRight: '10px' }" v-for="item in searchOption.vehicleTypeList"
  227. :key="item.value" :label="item.text" :name="item.value">
  228. </u-radio>
  229. </u-radio-group>
  230. </view> -->
  231. <!-- 选择客商 -->
  232. <!--
  233. <view @click="showPopup('popupCompany')" class="row">
  234. <p class="p-title">{{ $t('order.companyName') }}</p>
  235. <u--input readonly class="p-input"
  236. :placeholder="`${$t('base.common.placeholderS') + $t('order.companyName')}`" border="none"
  237. v-model="form.dealerName"></u--input>
  238. </view> -->
  239. <!-- 选择物料
  240. <view @click="showPopup('popupMaterial')" class="row last-one">
  241. <p class="p-title">{{$t('order.materialName')}}
  242. </p>
  243. <u--input readonly :placeholder="`${$t('base.common.placeholderS')+$t('order.materialName')}`"
  244. border="none" v-model="form.materialName" class="p-input"></u--input>
  245. </view> -->
  246. <view @click="showPopup('popupVehicle')" class="row">
  247. <p class="p-title">{{ $t('order.vehicle') }}</p>
  248. <u--input readonly class="p-input"
  249. :placeholder="`${$t('base.common.placeholderS') + $t('order.vehicle')}`" border="none"
  250. v-model="form.vehicle"></u--input>
  251. </view>
  252. </view>
  253. <view class="sure-btn">
  254. <button class="btn" @click="bindOrderList">{{ $t('base.common.submit') }}</button>
  255. </view>
  256. </view>
  257. <!-- 选择供应商/客户 -->
  258. <PopupSelect ref="popupCompany" :hasSearch='false' :option="companyOption" @onConfirm="onCompanyConfirm" />
  259. <PopupSelect ref="popupVehicle" :option="vehicleOption" :hasSearch='false' @onConfirm="onVehicleConfirm" />
  260. <!-- 选择物料/产品-->
  261. </u-popup>
  262. <u-loading-page color="#666" loading-mode="semicircle">
  263. </u-loading-page>
  264. <u-popup :show="showQrcode" :round="16" @close="showQrcode = false" mode="center"
  265. :overlayStyle="{ background: '#fff' }">
  266. <view class="qrcode-wrap" @click="showQrcode = false">
  267. <uqrcode ref='ordercode' canvas-id="order-canvas" :value="currentOrder.id" :start="false" />
  268. <view class="info-line">
  269. {{ $t('mine.customer') }} : {{ currentOrder.companyName || '' }}
  270. </view>
  271. <view class="info-line">
  272. {{ $t('mine.mater') }} : {{ currentOrder.materialName || '' }}
  273. </view>
  274. <view class="info-line" v-if="currentOrder.vehicle">
  275. {{ $t('order.vehicle') }} : {{ currentOrder.vehicle || '' }}
  276. </view>
  277. <view class="info-line" v-if="currentOrder.password">
  278. {{ $t('order.password') }} : {{ currentOrder.password || '' }}
  279. </view>
  280. </view>
  281. </u-popup>
  282. <u-toast ref="loadingToast"></u-toast>
  283. </view>
  284. </template>
  285. <script>
  286. import {
  287. getOrderPage,
  288. cancelOrder,
  289. getCustomerList,
  290. getMeterList,
  291. getOption
  292. } from "../../api/order";
  293. import {
  294. getVehicleListByCondition
  295. } from "../../api/driver";
  296. import PopupSelect from '../../components/popup-select/index'
  297. import {
  298. getTenantCacheList,
  299. getVehicleType,
  300. getLabel
  301. } from '../../utils/util.js'
  302. import dayjs from 'dayjs'
  303. import {
  304. getDriverTenantList,
  305. } from "../../api/tenant.js";
  306. export default {
  307. components: {
  308. PopupSelect
  309. },
  310. data() {
  311. return {
  312. getLabel,
  313. maxDate: dayjs().format('YYYY-MM-DD'),
  314. searchOption: {
  315. range: [dayjs().add(-30, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
  316. vehicleTypeList: [{
  317. name: this.$t("mine.all"),
  318. disabled: false,
  319. value: '0',
  320. }, ],
  321. },
  322. loading: true, //页面加载状态
  323. showQrcode: false, // 二维码展示
  324. currentOrder: {}, //订单id
  325. vehicleOption: [],
  326. form: {
  327. type: "0",
  328. orderType: '',
  329. orderStatus: 0,
  330. tenantId: '',
  331. tenantName: '',
  332. dealerId: "", //客商
  333. dealerName: "", //客商
  334. vehicle: "",
  335. },
  336. currentOrderType: 0,
  337. orderTypeList: [{
  338. name: this.$t("mine.all"),
  339. disabled: false,
  340. value: '',
  341. index: 0,
  342. },
  343. {
  344. name: this.$t("order.temp"),
  345. disabled: false,
  346. value: '1',
  347. index: 1,
  348. },
  349. {
  350. name: this.$t("order.fixed"),
  351. disabled: false,
  352. value: '2',
  353. index: 2,
  354. },
  355. {
  356. name: this.$t("order.share"),
  357. disabled: false,
  358. value: '4',
  359. index: 3,
  360. },
  361. ],
  362. orderStatusList: [{
  363. name: this.$t("mine.reviewed"),
  364. value: '0'
  365. },
  366. {
  367. name: this.$t("mine.unpaid"),
  368. value: '1'
  369. },
  370. {
  371. name: this.$t("mine.ongoing"),
  372. value: '2'
  373. },
  374. {
  375. name: this.$t("mine.weigh"),
  376. value: '3'
  377. },
  378. {
  379. name: this.$t("mine.invalid"),
  380. value: '4'
  381. },
  382. ],
  383. orderSourceList: [{
  384. name: this.$t("order.pc"), //PC端
  385. value: '1'
  386. },
  387. {
  388. name: this.$t("order.mini"), //小程序
  389. value: '2'
  390. }, {
  391. name: this.$t("order.fixed"), //固定订单生成
  392. value: '3'
  393. },
  394. {
  395. name: this.$t("order.special"), //由特殊订单生成
  396. value: '4'
  397. },
  398. {
  399. name: this.$t("order.handWeigh"), //由手工过磅生成
  400. value: '5'
  401. },
  402. {
  403. name: this.$t("order.repair"), //由补录生成
  404. value: '6'
  405. },
  406. {
  407. name: this.$t("order.bath"), //由批量订单生成
  408. value: '7'
  409. },
  410. {
  411. name: this.$t("order.third"), //第三方生成
  412. value: '8'
  413. },
  414. {
  415. name: this.$t("order.share"), //共享订单
  416. value: '12'
  417. },
  418. {
  419. name: this.$t("order.plan"), //计划订单
  420. value: '13'
  421. },
  422. ],
  423. shareOrderStatusList: [{
  424. name: this.$t("order.waitOrderReceive"),
  425. value: '0'
  426. },
  427. {
  428. name: this.$t("order.orderReceiving"),
  429. value: '1'
  430. },
  431. {
  432. name: this.$t("order.orderReceiveComplete"),
  433. value: '2'
  434. },
  435. {
  436. name: this.$t("mine.invalid"),
  437. value: '4'
  438. }
  439. ],
  440. page: {
  441. pages: 1,
  442. size: 5,
  443. },
  444. currentOrderType: '',
  445. orderList: [],
  446. showSearch: false,
  447. keyword: '',
  448. hasMore: false,
  449. tenantOption: [{
  450. text: this.$t('base.common.noData'),
  451. value: null
  452. }], //企业选项
  453. companyOption: [], //客户选项
  454. materialOption: [{
  455. text: this.$t('base.common.noData'),
  456. value: null
  457. }], //物料选项
  458. //业务对应的客户信息
  459. vehicleTypeCompanyList: [],
  460. //客户对应的物料信息
  461. companyMaterialList: [],
  462. //业务类型对应的物料信息
  463. appAllMaterial: [],
  464. isAuditUser: false,
  465. isDealerUser: false,
  466. isDriverUser: false,
  467. isRefresh: false,
  468. };
  469. },
  470. mounted() {
  471. console.log("order list mounted");
  472. },
  473. onLoad(options) {
  474. this.isAuditUser = uni.getStorageSync('isAuditUser')
  475. this.isDealerUser = uni.getStorageSync('isDealerUser')
  476. this.isDriverUser = uni.getStorageSync('isDriverUser')
  477. this.form.orderStatus = options.orderStatus || '0';
  478. let param = {
  479. "statusFlag": "1"
  480. }
  481. getDriverTenantList(param).then((res) => {
  482. if (res.statusCode == 200 && res.data.code == 0 && res.data.data.length > 0) {
  483. console.log("获取到司机对应的租户信息,", res.data.data);
  484. uni.removeStorageSync('tenantInfo')
  485. uni.setStorageSync('tenantInfo', res.data.data)
  486. }
  487. this.bindTenant()
  488. });
  489. },
  490. onShow() {
  491. // this.isAuditUser = uni.getStorageSync('isAuditUser')
  492. // this.isDealerUser = uni.getStorageSync('isDealerUser')
  493. // this.isDriverUser = uni.getStorageSync('isDriverUser')
  494. console.log("是否需要刷新页面,", this.isRefresh);
  495. if (this.isRefresh == true) {
  496. this.searchList();
  497. }
  498. },
  499. methods: {
  500. bindVehicle() {
  501. let data = {}
  502. var that = this
  503. getVehicleListByCondition(data).then(res => {
  504. console.log("查询车号数据返回、", res);
  505. if (res.statusCode == 200) {
  506. if (res.data.data) {
  507. that.vehicleOption = [{
  508. text: that.$t('order.notSelected'),
  509. value: null
  510. }]
  511. res.data.data.forEach(item => {
  512. that.vehicleOption.push({
  513. text: item.vehicle,
  514. value: item.id
  515. })
  516. })
  517. console.log("查询车号返回数组、", that.vehicleOption);
  518. }
  519. }
  520. })
  521. },
  522. onVehicleConfirm(value) {
  523. this.form.vehicle = ''
  524. if (value.value) {
  525. this.form.vehicle = value.text
  526. }
  527. },
  528. //二维码弹窗
  529. drawQrcode(item) {
  530. this.currentOrder = item
  531. this.showQrcode = true
  532. console.log(this.$refs.ordercode);
  533. setTimeout(() => {
  534. this.$refs.ordercode.make()
  535. }, 100)
  536. },
  537. //切换订单状态
  538. changeOrderStatus(item) {
  539. if (item.value == this.form.orderStatus) {
  540. this.form.orderStatus = "";
  541. } else {
  542. this.form.orderStatus = item.value
  543. }
  544. this.searchList()
  545. },
  546. //获取企业选项
  547. bindTenant() {
  548. this.tenantOption = getTenantCacheList();
  549. if (this.tenantOption.length > 0) {
  550. this.form.tenantId = this.tenantOption[0].value
  551. this.form.tenantName = this.tenantOption[0].text
  552. } else {
  553. uni.showToast({
  554. title: this.$t('driver.dealerNoBindVehicle'),
  555. icon: 'none',
  556. duration: 2000
  557. })
  558. this.loading = false;
  559. return;
  560. }
  561. this.bindVehicle();
  562. this.searchList();
  563. },
  564. //去订单详情
  565. onOrderInfoClick(item) {
  566. if (item.orderType == '1') {
  567. if (item.isMain == "2") {
  568. uni.navigateTo({
  569. url: `/subpages/order/mixedOrderInfo?userType=4&orderId=${item.id}&tenantId=${item.tenantId}&orderStatus=${item.orderStatus}`
  570. })
  571. } else {
  572. uni.navigateTo({
  573. url: `/subpages/order/orderInfo?orderId=${item.id}&tenantId=${item.tenantId}`
  574. })
  575. }
  576. } else if (item.orderType == '2') {
  577. uni.navigateTo({
  578. url: `/subpages/order/fixedOrderInfo?orderId=${item.id}&tenantId=${item.tenantId}`
  579. })
  580. } else if (item.orderType == '4') {
  581. uni.navigateTo({
  582. url: `/subpages/order/shareOrderInfo?orderId=${item.id}&tenantId=${item.tenantId}`
  583. })
  584. } else if (item.orderType == '5') {
  585. uni.navigateTo({
  586. url: `/subpages/order/planOrderInfo?orderId=${item.id}&tenantId=${item.tenantId}`
  587. })
  588. }
  589. },
  590. //拼车
  591. onMixedOrderClick(item) {
  592. uni.navigateTo({
  593. url: `/subpages/order/mixed?orderId=${item.id}&tenantId=${item.tenantId}`
  594. })
  595. },
  596. //确定选择日期
  597. confirm(item) {
  598. this.searchOption.range = item
  599. },
  600. //点击右侧筛选
  601. onClickRight() {
  602. this.showSearch = true
  603. },
  604. //搜索列表
  605. searchList() {
  606. this.page.pages = 1
  607. this.hasMore = false
  608. this.isRefresh = false
  609. this.bindOrderList()
  610. },
  611. //获取订单列表
  612. bindOrderList() {
  613. var that = this;
  614. if (!that.form.tenantId) {
  615. uni.showToast({
  616. title: that.$t("base.common.placeholderS") + that.$t("base.common.tenant"),
  617. icon: 'none',
  618. duration: 2000
  619. })
  620. return;
  621. }
  622. that.showSearch = false
  623. let data = {
  624. appUserType: "4",
  625. current: that.page.pages,
  626. size: that.page.size,
  627. orderStatus: that.form.orderStatus,
  628. keywords: that.keyword || '',
  629. startDate: that.searchOption.range[0] || '',
  630. endDate: that.searchOption.range[1] || '',
  631. // orderType: '1',
  632. tenantId: that.form.tenantId || '',
  633. dealerId: that.form.dealerId,
  634. vehicle: that.form.vehicle || '',
  635. };
  636. getOrderPage(data).then((res) => {
  637. if (res.statusCode == 200) {
  638. // that.orderList = res.data.data.records;
  639. if (res.data.data.records.length == 0) {
  640. that.orderList = []
  641. }
  642. if (that.hasMore) {
  643. that.orderList = [
  644. ...that.orderList,
  645. ...res.data.data.records,
  646. ];
  647. } else {
  648. that.orderList = res.data.data.records;
  649. }
  650. that.total = res.data.data.total;
  651. if (that.orderList.length >= that.total) {
  652. that.hasMore = false;
  653. } else {
  654. that.hasMore = true;
  655. }
  656. console.log("当前订单信息、", that.orderList);
  657. }
  658. that.loading = false;
  659. });
  660. },
  661. //加载更多
  662. scrolltolower() {
  663. console.log("1111111111111111");
  664. if (this.hasMore) {
  665. this.page.pages += 1;
  666. this.bindOrderList();
  667. }
  668. },
  669. // tab栏切换
  670. orderStatusChange(item) {
  671. this.orderStatus = item.orderStatus;
  672. this.page.pages = 1;
  673. this.hasMore = false;
  674. this.bindOrderList();
  675. },
  676. //订单作废
  677. onCancelOrder(item) {
  678. let _this = this
  679. uni.showModal({
  680. content: '确认作废此订单',
  681. showCancell: true,
  682. success: function(res) {
  683. if (res.confirm) {
  684. let data = {
  685. tenantId: item.tenantId,
  686. orderId: item.id
  687. };
  688. _this.$refs.loadingToast.show({
  689. type: "loading",
  690. message: that.$t('base.common.loading'),
  691. duration: "1000000"
  692. })
  693. cancelOrder(data).then(res => {
  694. _this.$refs.loadingToast.hide()
  695. if (res.statusCode == 200) {
  696. uni.showToast({
  697. title: '作废成功',
  698. icon: 'none',
  699. duration: 2000
  700. })
  701. _this.page.pages = 1
  702. _this.hasMore = false
  703. _this.bindOrderList()
  704. }
  705. }).catch(res => {
  706. _this.$refs.loadingToast.hide()
  707. })
  708. console.log('用户点击确定');
  709. } else if (res.cancell) {
  710. _this.$refs.loadingToast.hide()
  711. console.log('用户点击取消');
  712. }
  713. }
  714. });
  715. },
  716. onShareOrderClick(item) {
  717. uni.navigateTo({
  718. url: `/subpages/order/shareOrderInfo?orderId=${item.id}&tenantId=${item.tenantId}&isShare=1`
  719. })
  720. },
  721. //显示选择
  722. showPopup(refs) {
  723. this.$refs[refs].showPicker = true
  724. },
  725. //选择企业
  726. onTenantConfirm(value) {
  727. this.form.tenantId = ''
  728. this.form.tenantName = ''
  729. if (value.value) {
  730. this.form.tenantId = value.value
  731. this.form.tenantName = value.text
  732. }
  733. uni.setStorageSync("currentTenantId", value);
  734. this.bindOrderList()
  735. },
  736. //选择客户
  737. onCompanyConfirm(value) {
  738. this.form.dealerId = ''
  739. this.form.dealerName = ''
  740. if (value.value) {
  741. this.form.dealerId = value.value
  742. this.form.dealerName = value.text
  743. }
  744. },
  745. clear() {
  746. },
  747. },
  748. };
  749. </script>
  750. <style>
  751. /* #ifndef APP-NVUE */
  752. page {
  753. background-color: #f5f7fa;
  754. }
  755. /* #endif */
  756. </style>
  757. <style lang="scss" scoped>
  758. @import '../../common/css/public.scss';
  759. </style>