recordOrder.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="">
  3. <u-sticky v-if="!signVisible" style="background-color: white;padding: 0;">
  4. <uni-search-bar @confirm="searchBill" placeholder="请输入搜索内容"></uni-search-bar>
  5. </u-sticky>
  6. <uni-list style="margin-top: -20rpx">
  7. <uni-list-item style="margin-top: 0;padding-top: 0" v-for="(item,index) in billList" :key="item.id" :index="index" :threshold="0">
  8. <template slot="body">
  9. <uni-card>
  10. <view class="demo-layout">
  11. <view>
  12. <text v-if="item.itemOrderChargeState==0" class="tag-con">未收款</text>
  13. <text v-else style="color: #5ac725 !important;" class="tag-con">已收款</text>
  14. <span>{{ item.shipmentPackageCount }}</span>{{ item.shipmentUnit }}&nbsp;&nbsp;&nbsp;&nbsp;代收金额:<span>{{ item.shipmentMoney }}</span>&nbsp;&nbsp;&nbsp;&nbsp;
  15. </view>
  16. <view>{{ item.erpOrderCode }}</view>
  17. <view>{{ item.clientName }}</view>
  18. <view>{{ item.shipmentName }}&{{item.productName}}</view>
  19. <view style="font-size: 28rpx">{{ item.receiveAddress }}</view>
  20. </view>
  21. </uni-card>
  22. </template>
  23. </uni-list-item>
  24. </uni-list>
  25. <view v-show="isLoadMore && !signVisible">
  26. <uni-load-more :status="loadStatus" :content-text="contentText" showIcon @clickLoadMore="loadMoreBill()"></uni-load-more>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import request from '@/common/libs/request.js';
  32. export default {
  33. data() {
  34. return {
  35. contentText: {
  36. contentdown: '查看更多',
  37. contentrefresh: '加载中',
  38. contentnomore: '没有更多数据了'
  39. },
  40. signVisible:false,
  41. fabPattern: {
  42. color: '#7A7E83',
  43. backgroundColor: '#fff',
  44. selectedColor: '#007AFF',
  45. buttonColor: '#007AFF',
  46. iconColor: '#fff'
  47. },
  48. billList: [],
  49. page: {
  50. pageIndex: 1,
  51. pageSize: 20
  52. },
  53. isLoadMore: true,
  54. loadStatus: 'noMore',
  55. }
  56. },
  57. onLoad() {
  58. this.getSignBillList();
  59. },
  60. created(){
  61. uni.$on('eventName',this.handelEvent)
  62. },
  63. onPullDownRefresh() {
  64. this.billList = [];
  65. this.getSignBillList();
  66. },
  67. methods: {
  68. handelEvent(data){
  69. this.billList.splice(data, 1)
  70. },
  71. scanFabClick() {
  72. //扫码
  73. let _that = this;
  74. uni.scanCode({
  75. onlyFromCamera: true,
  76. scanType: ['barCode', 'qrCode'],
  77. success: function (res) {
  78. // console.log("res1212",res);
  79. if (res.result.indexOf('sendOrder') != -1) {
  80. let idOrder = res.result.split("-")[2];
  81. _that.truckUpOrder(idOrder)
  82. }else if(res.result.indexOf('orderLabel') != -1){
  83. let orderCode = res.result.split("-")[1];
  84. _that.getShipDetails(orderCode)
  85. }else {
  86. uni.showToast({
  87. title: "请扫正确的二维码",
  88. icon: 'none'
  89. })
  90. }
  91. }
  92. })
  93. },
  94. truckUpOrder(idOrder){
  95. let _that = this;
  96. let parms = {
  97. idOrder: idOrder
  98. }
  99. request.httpPost("/dnyDriver/signInScanSendOrder", parms, true).then(res => {
  100. // console.log('res444',res);
  101. })
  102. },
  103. getShipDetails(orderCode){
  104. let _that = this;
  105. let parms = {
  106. orderCode: orderCode
  107. }
  108. request.httpPost("/dnyDriver/signInScanERPOrder", parms, true).then(res => {
  109. _that.signVisible = true;
  110. })
  111. },
  112. getSignBillList: function () {
  113. let _that = this;
  114. var info = {
  115. itemStates:"5,10"
  116. }
  117. let listData = {
  118. params: JSON.stringify(info),
  119. page: JSON.stringify(_that.page)
  120. }
  121. request.httpPost("/dnyDriver/driverQuerySignInItem", listData, true).then(res => {
  122. // console.log("res1111", res);
  123. uni.stopPullDownRefresh();
  124. if (!res.data || res.data.length == 0) {
  125. this.loadStatus = "noMore";
  126. return;
  127. }
  128. this.billList = this.billList.concat(res.data);
  129. this.loadStatus = "more";
  130. // supplierIndex = 0;
  131. });
  132. },
  133. searchBill(res) {
  134. },
  135. loadMoreBill: function () {
  136. this.loadStatus = "loading";
  137. setTimeout(() => {
  138. this.page.pageIndex += 1;
  139. this.getSignBillList();
  140. }, 100);
  141. },
  142. viewDetail: function (item) {
  143. // console.log(item.id);
  144. uni.navigateTo({
  145. url: "./detail?id=" + item.id + "&billCode=" + item.billCode,
  146. animationType: 'pop-in'
  147. })
  148. },
  149. parseBillState: function (item) {
  150. if (item.voidFlag == 1) {
  151. return "已作废";
  152. } else if (item.billState == 1) {
  153. return "已下达";
  154. } else {
  155. return "";
  156. }
  157. },
  158. viewOrderTrace: function (item,index) {
  159. // console.log(item.id);
  160. uni.navigateTo({
  161. url: "../feedback/traceCamera?idOrder=" + item.id + "&orderCode=" + item.erpOrderCode + "&shipmentName=" + item.shipmentName+ "&index=" + index
  162. });
  163. }
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .tag-con {
  169. color: #e4493c;
  170. margin-right: 20rpx;
  171. }
  172. /deep/ .uni-list-item__container {
  173. padding: 0rpx;
  174. }
  175. .demo-layout span {
  176. font-weight: bold;
  177. color: #e4493c;
  178. padding: 0 5rpx;
  179. }
  180. /deep/ .uni-list-item__container {
  181. padding: 0 rpx;
  182. }
  183. /deep/ .uni-card uni-card--border{
  184. padding: 0 rpx;
  185. }
  186. .card-actions {
  187. display: flex;
  188. flex-direction: row;
  189. justify-content: space-around;
  190. align-items: center;
  191. height: 45px;
  192. border-top: 1px #eee solid;
  193. }
  194. .card-actions-item {
  195. display: flex;
  196. flex-direction: row;
  197. align-items: center;
  198. }
  199. .card-actions-item-text {
  200. font-size: 12px;
  201. color: #666;
  202. margin-left: 5px;
  203. }
  204. .textTitle {
  205. border-left: 0px solid #007AFF;
  206. display: inline-block;
  207. width: 180 rpx;
  208. text-align: left;
  209. margin-bottom: 5px;
  210. color: #8799a3;
  211. }
  212. </style>