orderAcceptList.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <view class="order-list">
  3. <u-sticky bgColor="#fff">
  4. <view class="search-wrap">
  5. <view class="input-wrap">
  6. <view @click="showPopup('popupTenant')" class="input">
  7. <u-icon name="account-fill" size="25"></u-icon>{{form.tenantName}}
  8. </view>
  9. </view>
  10. </view>
  11. <view class="tabs-box">
  12. <u-tabs lineWidth="40" :list="orderCheckList"
  13. :current="currentCheckType" @change="onChangeCheckType" lineColor="#3275F5"
  14. :itemStyle="{'height':'90rpx','padding':'0 32rpx'}">
  15. <view slot="right" style="padding-left: 160rpx;">
  16. </view>
  17. </u-tabs>
  18. <view @click="onClickRight" class="sx-btn">
  19. <uni-icons type="settings-filled" size='24'></uni-icons>
  20. <view>筛选</view>
  21. </view>
  22. <!-- <view class="orderStatus-tab" v-if="form.orderType != '5' && form.orderType != '4'">
  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 class="orderStatus-tab" v-if="form.orderType == '4'">
  29. <span :class="form.orderStatus == item.value ? 'active' : ''" v-for="item in shareOrderStatusList"
  30. @click="changeOrderStatus(item)" :key="item.name">
  31. {{ item.name }}
  32. </span>
  33. </view> -->
  34. </view>
  35. <PopupSelect ref="popupTenant" :hasSearch='false' :option="tenantOption" @onConfirm="onTenantConfirm"
  36. @search="bindOption" />
  37. </u-sticky>
  38. <!-- 企业选项 -->
  39. <view class="swiper-box">
  40. <template v-if="orderList.length">
  41. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5">
  42. <u-list-item v-for="(item, index) in orderList" :key="index">
  43. <view class="order-card">
  44. <view class="order-card-title">
  45. <span class="type" v-if="item.orderType == '1'">{{ $t('order.temp') }}</span>
  46. <span class="type fixed" v-if="item.orderType == '2'">{{ $t('order.fixed') }}</span>
  47. <span class="type fixed" v-if="item.orderType == '5'">{{ $t('order.plan') }}</span>
  48. <text class="info">{{ item.tenantName || '' }}</text>
  49. <view class="out-type" v-if="item.backFlag == '1'">
  50. {{item.vehicleType=='101'?$t('order.isBackOut'):$t('order.return')}}
  51. </view>
  52. <template>
  53. <span class="status" v-if="item.isCheck == '0'">未验收</span>
  54. <span class="status" v-if="item.isCheck == '1'">已验收</span>
  55. </template>
  56. </view>
  57. <view class="order-card-info">
  58. <view class="order-type">
  59. <u-tag :text="$t('order.suppOrder')" type="error" v-if="item.isMain == 1"></u-tag>
  60. <u-tag :text="$t('order.mixed')" type="success" v-if="item.isMain == 2"></u-tag>
  61. </view>
  62. <view class="row">
  63. <p class="cell">
  64. <!-- <text class="label">{{ $t('order.companyName') }}</text> -->
  65. <text class="info">{{ item.companyName || '' }}</text>
  66. </p>
  67. </view>
  68. <view class="row">
  69. <p class="cell">
  70. <!-- <text class="label">{{ $t('order.orderDate') }}</text> -->
  71. <text class="info">{{ item.setDate || '' }}</text>
  72. </p>
  73. <p class="cell">
  74. <!-- <text class="label">{{ $t('order.vehicleType') }}</text> -->
  75. <text class="info"
  76. v-if="item.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  77. <text class="info"
  78. v-if="item.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  79. <!-- <span class="tag tag-ls"
  80. v-if="item.orderType == '1'">{{ $t('order.temp') }}</span>
  81. <span class="tag tag-gd"
  82. v-if="item.orderType == '2'">{{ $t('order.fixed') }}</span> -->
  83. </p>
  84. </view>
  85. <view class="row">
  86. <p class="cell">
  87. <!-- <text class="label">{{ $t('order.materialName') }}</text> -->
  88. <text class="info">{{ item.materialName || '' }}</text>
  89. </p>
  90. <p class="cell">
  91. <!-- <text class="label">{{ $t('order.orderNumber') }}</text> -->
  92. <text
  93. :style="'font-size: 9pt;font-weight: bold;'+(item.companyClientType=='109'?'color: green;':'color: red;')"
  94. class="info">{{ item.orderNumber || '' }}{{item.materialKind=='101' && item.companyClientType=='109'?$t('customer_meter.unitB') :(item.orderType ==
  95. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT')) }}</text>
  96. </p>
  97. </view>
  98. <view class="row">
  99. <p class="cell">
  100. <!-- <text class="label">{{ $t('order.vehicle') }}</text> -->
  101. <text class="info">{{ item.vehicle || '' }}</text>
  102. </p>
  103. <p class="cell">
  104. <!-- <text class="label">{{ $t('order.driver') }}</text> -->
  105. <text class="info">{{ item.driver || '' }}-{{ item.phone || '' }}</text>
  106. </p>
  107. </view>
  108. <view class="row" v-if="item.isCheck == '1'">
  109. <p class="cell">
  110. <text class="label">{{ $t('accept.acceptUserName') }}</text>
  111. <text class="info">{{ item.checkUserName || '' }}</text>
  112. </p>
  113. </view>
  114. <view class="row">
  115. <p class="cell">
  116. <text class="label">{{ $t('accept.acceptTime') }}</text>
  117. <text class="info">{{ item.checkDate || '' }}</text>
  118. </p>
  119. </view>
  120. <!-- <view class="row" v-if="item.isMain == 1 || item.isMain == 2">
  121. <p class="cell">
  122. <text
  123. class="label">{{ item.isMain == 1 ? $t('order.mainOrder') : $t('order.suppOrder') }}</text>
  124. <text class="info used">{{ item.relationOrderCode || '' }}</text>
  125. </p>
  126. </view> -->
  127. <!-- <view class="qrcode-logo" @click="drawQrcode(item)">
  128. <image class="img" src="/subpages/static/czzn-img/state/qrcode.png"
  129. mode="scaleToFill" />
  130. </view> -->
  131. <!-- <view class="row" v-if="item.orderStatus != 0 && item.weighingStatus != 0">
  132. <p class="cell">
  133. <text class="label">{{ $t('order.tareWeight') }}</text>
  134. <text class="info">{{ item.tareWeight || '0' }}</text>
  135. </p>
  136. <p class="cell">
  137. <text class="label">{{ $t('order.grossWeight') }}</text>
  138. <text class="info">{{ item.grossWeight || '0' }}</text>
  139. </p>
  140. </view>
  141. <view class="row">
  142. <p class="cell">
  143. <text class="label">{{ $t('order.netWeight') }}</text>
  144. <text class="info">{{ item.netWeight || '0' }}</text>
  145. </p>
  146. </view>
  147. <view class="row" v-if="item.orderStatus != 0 && item.weighingStatus == 1">
  148. <p class="cell">
  149. <text class="label">{{ $t('order.inTime') }}</text>
  150. <text class="info">{{ item.inTime || '' }}</text>
  151. </p>
  152. </view>
  153. <view class="row" v-if="item.orderStatus != 0 && item.weighingStatus == 2">
  154. <p class="cell">
  155. <text class="label">{{ $t('order.outTime') }}</text>
  156. <text class="info">{{ item.outTime || '' }}</text>
  157. </p>
  158. </view>
  159. <view class="row" v-if="item.orderStatus == 2">
  160. <p class="cell">
  161. <text class="label">{{ $t('order.outDate') }}</text>
  162. <text class="info">{{ item.outDoorTime || '' }}</text>
  163. </p>
  164. </view> -->
  165. </view>
  166. <view class="code">
  167. <view class="label">{{$t('order.orderCode')}}</view>
  168. <view class="info">{{ item.code || '' }}</view>
  169. <view class="label">{{$t('order.source')}}</view>
  170. <view class="info"> {{$t('order.mini')}}</view>
  171. <!-- <view class="info"> {{getLabel(item.orderSource,orderSourceList)}}</view> -->
  172. </view>
  173. <view class="order-card-bottom">
  174. <view class="btn" v-if="item.isCheck!='1'">
  175. <button class="oper-btn" type='primary' shape="circle" color='#4680F9' size="small"
  176. @click="onOrderCheckClick(item)">
  177. {{ $t('order.accept') }}
  178. </button>
  179. </view>
  180. <view class="btn">
  181. <button class="oper-btn" type='primary' shape="circle" color='#4680F9' size="small"
  182. @click="onOrderInfoClick(item)">
  183. {{ $t('mine.detail') }}
  184. </button>
  185. </view>
  186. </view>
  187. </view>
  188. </u-list-item>
  189. </u-list>
  190. </template>
  191. <template v-else>
  192. <u-empty mode="order" icon="https://cdn.uviewui.com/uview/empty/list.png">
  193. </u-empty>
  194. </template>
  195. </view>
  196. <u-popup :show="showSearch" :round="16" @close="showSearch = false" mode="bottom">
  197. <view class="search-dialog">
  198. <p class="dialog-title">{{ $t('base.common.condition') }}</p>
  199. <view class="condition-wrap">
  200. <view class="row">
  201. <uni-datetime-picker :end='maxDate' :clear-icon="false" :value="searchOption.range"
  202. type="daterange" @change="confirm" />
  203. </view>
  204. <!-- 输入内容 -->
  205. <view class="row">
  206. <p class="p-title">{{ $t('base.common.placeholder') }}</p>
  207. <u-search class="p-input" bgColor='#fff' :showAction='false'
  208. :placeholder="$t('base.common.inputPlaceholder')" v-model="keyword">
  209. </u-search>
  210. </view>
  211. <!-- 选择客商 -->
  212. <view @click="showPopup('popupCompany')" class="row">
  213. <p class="p-title">{{ $t('order.vehicle') }}</p>
  214. <u-search class="p-input" bgColor='#fff' :showAction='false'
  215. :placeholder="$t('base.common.inputPlaceholder')" v-model="vehicle">
  216. </u-search>
  217. </view>
  218. </view>
  219. <view class="sure-btn">
  220. <button class="btn" @click="bindOrderList">{{ $t('base.common.submit') }}</button>
  221. </view>
  222. </view>
  223. </u-popup>
  224. <u-loading-page color="#666" loading-mode="semicircle" :loading="loading">
  225. </u-loading-page>
  226. <u-toast ref="loadingToast"></u-toast>
  227. </view>
  228. </template>
  229. <script>
  230. import {
  231. mapGetters,
  232. } from "vuex";
  233. import {
  234. getOrderPage,
  235. cancelOrder,
  236. getCustomerList,
  237. getMeterList,
  238. getOption,
  239. getPlanOrderVehicleList
  240. } from "../../../api/order";
  241. import PopupSelect from '../../../components/popup-select/index'
  242. import {
  243. getTenantCacheList,
  244. getLabel
  245. } from '../../../utils/util.js'
  246. import {
  247. getDealerTenantList,
  248. } from "../../../api/tenant.js";
  249. import dayjs from 'dayjs'
  250. export default {
  251. components: {
  252. PopupSelect
  253. },
  254. data() {
  255. return {
  256. noClick: true,
  257. getLabel,
  258. maxDate: dayjs().format('YYYY-MM-DD'),
  259. searchOption: {
  260. range: [dayjs().add(-30, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
  261. vehicleTypeList: [{
  262. name: this.$t("mine.all"),
  263. disabled: false,
  264. value: '0',
  265. }, ],
  266. },
  267. loading: true, //页面加载状态
  268. currentOrder: {}, //订单id
  269. form: {
  270. type: "0",
  271. orderType: '',
  272. vehicleType: '102',
  273. orderStatus: 0,
  274. tenantId: '',
  275. tenantName: '',
  276. companyId: "", //客商
  277. materialId: "", //物料
  278. companyName: "", //客商
  279. materialName: "", //物料
  280. isCheck:"0"
  281. },
  282. currentCheckType: 0,
  283. orderCheckList: [{
  284. name: this.$t("accept.noneAccept"),
  285. disabled: true,
  286. value: '0',
  287. index: 0,
  288. key: "all",
  289. },
  290. {
  291. name: this.$t("accept.accepted"),
  292. disabled: true,
  293. value: '1',
  294. index: 1,
  295. },
  296. ],
  297. orderSourceList: [{
  298. name: this.$t("order.pc"), //PC端
  299. value: '1'
  300. },
  301. {
  302. name: this.$t("order.mini"), //小程序
  303. value: '2'
  304. }, {
  305. name: this.$t("order.fixed"), //固定订单生成
  306. value: '3'
  307. },
  308. {
  309. name: this.$t("order.special"), //由特殊订单生成
  310. value: '4'
  311. },
  312. {
  313. name: this.$t("order.handWeigh"), //由手工过磅生成
  314. value: '5'
  315. },
  316. {
  317. name: this.$t("order.repair"), //由补录生成
  318. value: '6'
  319. },
  320. {
  321. name: this.$t("order.bath"), //由批量订单生成
  322. value: '7'
  323. },
  324. {
  325. name: this.$t("order.third"), //第三方生成
  326. value: '8'
  327. },
  328. {
  329. name: this.$t("order.share"), //共享订单
  330. value: '12'
  331. },
  332. {
  333. name: this.$t("order.plan"), //计划订单
  334. value: '13'
  335. },
  336. ],
  337. page: {
  338. pages: 1,
  339. size: 5,
  340. },
  341. orderList: [],
  342. showSearch: false,
  343. keyword: '',
  344. vehicle: '',
  345. hasMore: false,
  346. tenantOption: [{
  347. text: this.$t('base.common.noData'),
  348. value: null
  349. }], //企业选项
  350. permissionList: [],
  351. };
  352. },
  353. mounted() {
  354. console.log("order list mounted");
  355. },
  356. computed: {
  357. ...mapGetters({
  358. userInfo: "user/info",
  359. hasLogin: "user/hasLogin",
  360. }),
  361. },
  362. onShow() {
  363. let routes = getCurrentPages();
  364. let options = routes[routes.length - 1].options;
  365. console.log("开始onShow 当前用户信息", options, this.userInfo);
  366. this.currentCheckType = options.isCheck
  367. for (var i = 0; i < this.orderCheckList.length; i++) {
  368. if (this.currentCheckType == this.orderCheckList[i].index) {
  369. this.$set(this.orderCheckList[i], "disabled", false);
  370. }
  371. }
  372. this.form.isCheck = this.currentCheckType
  373. this.bindTenant()
  374. },
  375. onLoad() {},
  376. methods: {
  377. //切换订单类型
  378. onChangeCheckType(item) {
  379. this.form.isCheck = item.value;
  380. this.searchList()
  381. },
  382. //获取企业选项
  383. bindTenant() {
  384. this.tenantOption = getTenantCacheList();
  385. if (this.tenantOption.length > 0) {
  386. this.form.tenantId = this.tenantOption[0].value
  387. this.form.tenantName = this.tenantOption[0].text
  388. } else {
  389. // uni.showModal({
  390. // title: this.$t('settings.tips'),
  391. // showCancel: false,
  392. // content: this.$t('base.common.registerTenant'),
  393. // confirmText: this.$t('base.button.regedit'),
  394. // success: res => {
  395. // if (res.confirm) {
  396. // uni.navigateTo({
  397. // url: '/subpages/tenant/list?q=add'
  398. // });
  399. // }
  400. // },
  401. // fail: () => {},
  402. // complete: () => {}
  403. // });
  404. this.loading = false;
  405. return;
  406. }
  407. this.searchList();
  408. },
  409. //去订单详情
  410. onOrderInfoClick(item) {
  411. uni.navigateTo({
  412. url: `/substaticpages/cargoOperator/order/orderInfo?orderId=${item.id}&tenantId=${item.tenantId}`
  413. })
  414. },
  415. onOrderCheckClick(item) {
  416. uni.navigateTo({
  417. url: `/substaticpages/cargoOperator/order/orderInfo?orderId=${item.id}&tenantId=${item.tenantId}&operationType=1`
  418. })
  419. },
  420. //确定选择日期
  421. confirm(item) {
  422. this.searchOption.range = item
  423. },
  424. //点击右侧筛选
  425. onClickRight() {
  426. this.showSearch = true
  427. },
  428. //搜索列表
  429. searchList() {
  430. this.page.pages = 1
  431. this.hasMore = false
  432. this.bindOrderList()
  433. },
  434. //获取订单列表
  435. bindOrderList() {
  436. var that = this;
  437. if (!that.form.tenantId) {
  438. uni.showToast({
  439. title: that.$t('base.common.placeholderS') + that.$t('base.common.tenant'),
  440. icon: 'none',
  441. duration: 2000
  442. })
  443. return;
  444. }
  445. that.form.orderStatus = ''
  446. that.form.weighingStatus = ''
  447. if (that.form.isCheck == '0') {
  448. that.form.orderStatus = '1'
  449. that.form.weighingStatus = '1'
  450. }
  451. that.showSearch = false
  452. let data = {
  453. appUserType: "6",
  454. current: that.page.pages,
  455. size: that.page.size,
  456. orderStatus: that.form.orderStatus,
  457. weighingStatus: that.form.weighingStatus,
  458. keywords: that.keyword || '',
  459. startDate: that.searchOption.range[0] || '',
  460. endDate: that.searchOption.range[1] || '',
  461. vehicleType: that.form.vehicleType,
  462. orderType: that.form.orderType || '',
  463. tenantId: that.form.tenantId || '',
  464. isCheck: that.form.isCheck,
  465. vehicle: that.vehicle || '',
  466. backFlag:'0',
  467. weighingStatus: that.form.weighingStatus || '',
  468. };
  469. getOrderPage(data).then((res) => {
  470. if (res.statusCode == 200) {
  471. // that.orderList = res.data.data.records;
  472. if (res.data.data.records.length == 0) {
  473. that.orderList = [];
  474. }
  475. if (that.hasMore) {
  476. that.orderList = [
  477. ...that.orderList,
  478. ...res.data.data.records,
  479. ];
  480. } else {
  481. that.orderList = res.data.data.records;
  482. }
  483. that.total = res.data.data.total;
  484. if (that.orderList.length >= that.total) {
  485. that.hasMore = false;
  486. } else {
  487. that.hasMore = true;
  488. }
  489. console.log("当前订单信息、", that.orderList);
  490. }
  491. that.loading = false;
  492. });
  493. },
  494. //加载更多
  495. scrolltolower() {
  496. console.log("1111111111111111");
  497. if (this.hasMore) {
  498. this.page.pages += 1;
  499. this.bindOrderList();
  500. }
  501. },
  502. //显示选择
  503. showPopup(refs) {
  504. this.$refs[refs].showPicker = true
  505. },
  506. //选择企业
  507. onTenantConfirm(value) {
  508. this.form.tenantId = ''
  509. this.form.tenantName = ''
  510. if (value.value) {
  511. this.form.tenantId = value.value
  512. this.form.tenantName = value.text
  513. }
  514. this.searchList();
  515. },
  516. },
  517. };
  518. </script>
  519. <style>
  520. /* #ifndef H5 */
  521. page {
  522. /* height: 100%; */
  523. background-color: #f2f2f2;
  524. }
  525. /* #endif */
  526. </style>
  527. <style lang="scss" scoped>
  528. @import '../../../common/css/public.scss';
  529. </style>