shareOrderInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view class="order-infos content">
  3. <u-sticky bgColor="#f5f7fa" class="sticky-main">
  4. <view class="order-card">
  5. <view class="order-card-title">
  6. <text class="info">{{shareInfo.share.tenantName || ''}}</text>
  7. <!-- <text class="no">No {{shareInfo.share.code || ''}}</text> -->
  8. <view class="orderStatus-info">
  9. <u--image width="100rpx" height="88rpx" v-if="shareInfo.share.orderStatus == 0"
  10. src="/subpages/static/img/no-take-order.png"></u--image>
  11. <u--image width="100rpx" height="88rpx" v-if="shareInfo.share.orderStatus == 1"
  12. src="/subpages/static/img/start-take-order.png"></u--image>
  13. <u--image width="100rpx" height="88rpx" v-if="shareInfo.share.orderStatus == 2"
  14. src="/subpages/static/img/completed.png"></u--image>
  15. <u--image width="100rpx" height="88rpx" v-if="shareInfo.share.orderStatus == 4"
  16. src="/subpages/static/img/cancellation.png"></u--image>
  17. </view>
  18. </view>
  19. <view class="order-card-info">
  20. <view class="row">
  21. <p class="cell">
  22. <text class="label">{{$t('order.orderDate')}}</text>
  23. <text class="info">{{shareInfo.share.setDate || ''}}</text>
  24. </p>
  25. <p class="cell">
  26. <text class="label">{{$t('order.vehicleType')}}</text>
  27. <text class="info"
  28. v-if="shareInfo.share.vehicleType == '101'">{{$t('order.saleOrder')}}【<text
  29. class="success">{{shareInfo.share.orderNumber}}{{$t('customer_meter.unitN')}}</text>】</text>
  30. <text class="info"
  31. v-if="shareInfo.share.vehicleType == '102'">{{$t('order.purchaseOrder')}}【<text
  32. class="success">{{shareInfo.share.orderNumber}}{{$t('customer_meter.unitN')}}</text>】</text>
  33. </p>
  34. </view>
  35. <view class="row">
  36. <p class="cell">
  37. <text class="label">{{$t('order.companyName')}}</text>
  38. <text class="info">{{shareInfo.share.companyName || ''}}</text>
  39. </p>
  40. </view>
  41. <view class="row">
  42. <p class="cell">
  43. <text class="label">{{$t('order.materialName')}}</text>
  44. <text class="info">{{shareInfo.share.materialName || ''}}</text>
  45. </p>
  46. <p class="cell">
  47. <text class="label">{{$t('order.haveOrderReceiving')}}</text>
  48. <text
  49. class="info warning">{{(shareInfo.share.tempOrderCount)}}{{$t('customer_meter.unitN')}}</text>
  50. </p>
  51. </view>
  52. <!-- <view class="row">
  53. <p class="cell">
  54. <text class="label">{{$t('order.orderDate')}}</text>
  55. <text class="info">{{shareInfo.share.createTime || ''}}</text>
  56. </p>
  57. </view> -->
  58. <button ref="sharebtn" class="share-button" data-name="shareBtn" open-type="share">
  59. 分享订单
  60. <!-- <u--image width="100rpx" height="88rpx" src="/subpages/static/img/share.png"></u--image> -->
  61. </button>
  62. </view>
  63. <view class="code">
  64. <view class="label">{{$t('spare.orderCode')}}</view>
  65. <view class="info">{{ shareInfo.share.code || '' }}</view>
  66. </view>
  67. </view>
  68. <view class="tabs-box">
  69. <u-tabs lineWidth="40" :list="statusList" :current="statusActive" @change="onChangeStatus"
  70. lineColor="#3275F5" :itemStyle="{'height':'90rpx','padding':'0 32rpx'}">
  71. </u-tabs>
  72. </view>
  73. </u-sticky>
  74. <view class="swiper-box">
  75. <view class="order-card" v-if="shareInfo.orderInfo && shareInfo.orderInfo.length>0">
  76. <view v-for="(item,index) in shareInfo.orderInfo" :key="index" class="card-main">
  77. <view class="order-card-title">
  78. <view class="left-info">
  79. <u-checkbox-group v-if="statusActive=='2' && item.enabledMarkType==2">
  80. <u-checkbox shape="circle" v-model="item.isAudit" :checked="item.checked"
  81. @change="onAutoChange(item)"></u-checkbox>
  82. </u-checkbox-group>
  83. <text class="info">No {{item.code || ''}}</text>
  84. </view>
  85. <view class="orderStatus-info">
  86. <u-tag :text="$t('mine.reviewed')" plain shape="circle"
  87. v-if="item.enabledMarkType==0 && item.orderStatus == 0"></u-tag>
  88. <u-tag :text="$t('mine.unpaid')" plain type="warning" shape="circle"
  89. v-if="item.orderStatus == 1 && item.weighingStatus== 0" />
  90. <u-tag :text="$t('mine.ongoing')" plain type="success" shape="circle"
  91. v-if="item.enabledMarkType==0 && item.orderStatus == 2"></u-tag>
  92. <u-tag :text="$t('mine.weigh')" plain type="success" shape="circle"
  93. v-if="item.orderStatus==1 && item.weighingStatus !=0"></u-tag>
  94. <u-tag :text="$t('mine.invalid')" plain type="error" shape="circle"
  95. v-if="item.enabledMarkType==1 && item.orderStatus == 4"></u-tag>
  96. <u-tag :text="$t('mine.noneAudit')" plain type="warning" shape="circle"
  97. v-if="item.enabledMarkType==2" @click="onAudit(item)"></u-tag>
  98. <u-tag :text="$t('mine.nonePass')" plain type="error" shape="circle"
  99. v-if="item.enabledMarkType==1 && item.orderStatus == 5"></u-tag>
  100. </view>
  101. </view>
  102. <view class="order-card-info">
  103. <!-- <view class="order-type">
  104. <span class="tag tag-l" v-if="item.orderType == '1'">{{$t('order.temp')}}</span>
  105. <span class="tag tag-g" v-if="item.orderType == '2'">{{$t('order.fixed')}}</span>
  106. <span class="tag tag-s" v-if="item.orderType == '4'">{{$t('order.share')}}</span>
  107. </view> -->
  108. <view class="row">
  109. <p class="cell">
  110. <text class="label">{{$t('order.orderDate')}}</text>
  111. <text class="info">{{item.setDate}}</text>
  112. </p>
  113. </view>
  114. <view class="row" v-if="item.orderStatus == 1">
  115. <p class="cell">
  116. <text class="label">{{$t('order.inDoorTime')}}</text>
  117. <text class="info">{{item.enterTime}}</text>
  118. </p>
  119. </view>
  120. <view class="row">
  121. <p class="cell">
  122. <text class="label">{{$t('order.vehicle')}}</text>
  123. <text class="info">{{item.vehicle}}</text>
  124. </p>
  125. <p class="cell">
  126. <text class="label">{{$t('order.driver')}}</text>
  127. <text class="info">{{item.driver}}</text>
  128. </p>
  129. </view>
  130. <view class="row" v-if="item.orderStatus == 1 && item.weighingStatus!=0">
  131. <p class="cell">
  132. <text class="label">{{$t('order.tareWeight')}}</text>
  133. <text class="info">{{item.tareWeight}}</text>
  134. </p>
  135. <p class="cell">
  136. <text class="label">{{$t('order.grossWeight')}}</text>
  137. <text class="info">{{item.grossWeight}}</text>
  138. </p>
  139. </view>
  140. <view class="row">
  141. <p class="cell" v-if="item.orderStatus == 1 && item.weighingStatus!=0">
  142. <text class="label">{{$t('order.netWeight')}}</text>
  143. <text class="info">{{item.netWeight}}</text>
  144. </p>
  145. <p class="cell">
  146. <text class="label">{{$t('order.orderNumber')}}</text>
  147. <text class="info">{{item.orderNumber}} T</text>
  148. </p>
  149. </view>
  150. <view class="row" v-if="item.orderStatus == 1 && item.weighingStatus!=0">
  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.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>
  170. </view>
  171. </view>
  172. <view class="bottom-btn" v-if="enabledMarkType=='2' && shareInfo.orderInfo && shareInfo.orderInfo.length>0">
  173. <view class="left">
  174. <view class="all">
  175. <u-checkbox-group>
  176. <u-checkbox @change="onAutoAllChange" shape="circle" label="全选"></u-checkbox>
  177. </u-checkbox-group>
  178. </view>
  179. <view class="title">
  180. <text class="label">已选择:{{shareInfo.orderInfo.filter((a,i)=>{return a.isAudit==1}).length }}车</text>
  181. </view>
  182. </view>
  183. <view class="right">
  184. <view class="btn">
  185. <u-button type="success" size="small" text="通过" class="ok" @click="onAuditBatch(1)"></u-button>
  186. <u-button type="error" size="small" text="不通过" class="no" @click="onAuditBatch(0)"></u-button>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </template>
  192. <script>
  193. import {
  194. getShareOrderInfo,
  195. receiveOrderAudit
  196. } from "../../api/order"
  197. export default {
  198. data() {
  199. return {
  200. loading: false,
  201. statusActive: 0,
  202. enabledMarkType: "3",
  203. shareInfo: {
  204. orderInfo: {
  205. isAudit: 1,
  206. checked: true,
  207. },
  208. share: {}
  209. },
  210. statusList: [{
  211. name: this.$t("customer_meter.all"),
  212. enabledMarkType: '3'
  213. },
  214. {
  215. name: this.$t("mine.alreadyAudit"),
  216. enabledMarkType: '0'
  217. },
  218. {
  219. name: this.$t("mine.noneAudit"),
  220. enabledMarkType: '2'
  221. },
  222. {
  223. name: this.$t("mine.nonePass"),
  224. enabledMarkType: '5'
  225. },
  226. ],
  227. keyword: '',
  228. options: {},
  229. };
  230. },
  231. onLoad(options) {
  232. this.options = options;
  233. this.onGetShoreOrderList()
  234. },
  235. // #ifdef MP-WEIXIN
  236. onShareAppMessage() {
  237. console.log("1开始分享订单")
  238. return {
  239. title: this.$t("common.shareSend"),
  240. path: `/subpages/order/receiving?orderId=${this.shareInfo.share.id}&tenantId=${this.shareInfo.share.tenantId}`,
  241. }
  242. },
  243. // #endif
  244. methods: {
  245. onAutoAllChange(n) {
  246. this.shareInfo.orderInfo = this.shareInfo.orderInfo.map(item => {
  247. item.isAudit = (n == true ? 1 : 0);
  248. item.checked = n;
  249. return item
  250. })
  251. console.log("选择需要审核的订单后、", this.shareInfo.orderInfo);
  252. },
  253. onAutoChange(item) {
  254. if (item.checked == true) {
  255. item.checked = false;
  256. item.isAudit = 0;
  257. } else {
  258. item.checked = true;
  259. item.isAudit = 1;
  260. }
  261. this.$forceUpdate()
  262. },
  263. onGetShoreOrderList() {
  264. var that = this;
  265. let param = {
  266. ...that.options,
  267. enabledMarkType: that.enabledMarkType,
  268. }
  269. getShareOrderInfo(param).then(res => {
  270. if (res.statusCode == 200) {
  271. that.shareInfo = res.data.data.data
  272. }
  273. console.log("获取到的共享订单信息、", that.shareInfo);
  274. })
  275. },
  276. onAudit(data) {
  277. let param = {
  278. tenantId: data.tenantId,
  279. "orderInfos": [{
  280. orderId: data.id,
  281. isAudit: "1"
  282. }]
  283. }
  284. this.audit("1", param)
  285. },
  286. onAuditBatch(type) {
  287. var arrOrderId = this.shareInfo.orderInfo.filter(ele => ele.isAudit == 1);
  288. if (!arrOrderId || arrOrderId.length == 0) {
  289. uni.showToast({
  290. title: this.$t("order.noAuditOrderData"),
  291. icon: 'none',
  292. duration: 2000
  293. })
  294. return;
  295. }
  296. let orderInfos = []
  297. arrOrderId.forEach(item => {
  298. orderInfos.push({
  299. orderId: item.id,
  300. isAudit: type
  301. });
  302. });
  303. let param = {
  304. "tenantId": this.options.tenantId,
  305. "orderInfos": orderInfos
  306. }
  307. this.audit(type, param)
  308. },
  309. audit(type, param) {
  310. uni.showModal({
  311. content: (type == 1 ? this.$t("order.isAuditPass") : this.$t("order.isAuditNoPass")),
  312. success: ({
  313. confirm,
  314. cancel
  315. }) => {
  316. if (confirm) {
  317. console.log("开始审核订单信息、", param);
  318. receiveOrderAudit(param).then(res => {
  319. if (res.statusCode == 200) {
  320. uni.showToast({
  321. title: this.$t("common.complete"),
  322. icon: 'none',
  323. duration: 2000
  324. })
  325. this.onGetShoreOrderList()
  326. }
  327. })
  328. }
  329. }
  330. })
  331. },
  332. onChangeStatus(index) {
  333. this.statusActive = index;
  334. var enabledMarkType = this.statusList[index].enabledMarkType;
  335. if (this.enabledMarkType == enabledMarkType) {
  336. return
  337. } else {
  338. this.enabledMarkType = enabledMarkType;
  339. this.onGetShoreOrderList()
  340. }
  341. },
  342. },
  343. };
  344. </script>
  345. <style scoped>
  346. /* #ifndef APP-NVUE */
  347. view {
  348. display: flex;
  349. box-sizing: border-box;
  350. flex-direction: column;
  351. }
  352. page {
  353. box-sizing: border-box;
  354. /* padding: 40rpx 40rpx 80rpx; */
  355. /* height: 100%;
  356. background-size: 750rpx auto; */
  357. }
  358. /* #endif*/
  359. </style>
  360. <style lang="scss" scoped>
  361. @import '../../common/css/public.scss';
  362. .order-card {
  363. margin: 24rpx;
  364. }
  365. </style>