signOrderCode.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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.shipmentName }}&{{item.productName}}</view>
  18. <view style="font-size: 28rpx">{{ item.receiveAddress }}</view>
  19. </view>
  20. <view slot="actions" class="card-actions">
  21. <view class="card-actions-item" @click="updateBillBtn(item)">
  22. <uni-icons type="info-filled" size="18" color="#999"></uni-icons>
  23. <text class="card-actions-item-text">货款代收</text>
  24. </view>
  25. <view class="card-actions-item" @click="viewOrderTrace(item,index)">
  26. <uni-icons type="camera-filled" size="18" color="#999"></uni-icons>
  27. <text class="card-actions-item-text">拍照签收</text>
  28. </view>
  29. </view>
  30. </uni-card>
  31. </template>
  32. </uni-list-item>
  33. </uni-list>
  34. <view v-show="isLoadMore && !signVisible">
  35. <uni-load-more :status="loadStatus" showIcon @clickLoadMore="loadMoreBill()"></uni-load-more>
  36. </view>
  37. <uni-fab style="bottom: 100rpx;" ref="fab" :pattern="fabPattern" icon="color" :popMenu="false" horizontal="right"
  38. vertical="bottom"
  39. @fabClick="scanFabClick"/>
  40. <u-loading-page :loading="loading"></u-loading-page>
  41. <view>
  42. <u-popup :show="show" @close="close" :closeable="true" mode="center" @open="open">
  43. <view class="popup-con">
  44. <div v-if="qrCodeInfo" class="qrCodeInfo">
  45. {{erpOrderCode}} &nbsp;&nbsp;代收金额:<span>{{qrCodeInfo}}</span>
  46. </div>
  47. <div style="margin: auto;width: 600rpx">
  48. <u--image :showLoading="true" :src="src" width="600rpx" height="600rpx"></u--image>
  49. </div>
  50. <div style="text-align: center;line-height: 60rpx;margin-left: 180rpx;padding-top: 10px">
  51. <span style="float: left">请使用</span>
  52. <u-icon style="float: left" name="zhifubao-circle-fill" color="#2979ff" size="28"></u-icon>
  53. &nbsp;&nbsp;&nbsp;&nbsp;
  54. <u-icon style="float: left" name="weixin-circle-fill" color="#53c21d" size="28"></u-icon>
  55. <span style="float: left">支付</span>
  56. </div>
  57. </view>
  58. </u-popup>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import request from '@/common/libs/request.js';
  64. export default {
  65. data() {
  66. return {
  67. src:"",
  68. qrCodeInfo:"",
  69. erpOrderCode:"",
  70. show:false,
  71. loading:false,
  72. signVisible:false,
  73. fabPattern: {
  74. color: '#7A7E83',
  75. backgroundColor: '#fff',
  76. selectedColor: '#007AFF',
  77. buttonColor: '#007AFF',
  78. iconColor: '#fff'
  79. },
  80. billList: [],
  81. page: {
  82. pageIndex: 1,
  83. pageSize: 20
  84. },
  85. isLoadMore: true,
  86. loadStatus: 'noMore',
  87. }
  88. },
  89. onLoad() {
  90. this.getSignBillList();
  91. },
  92. created(){
  93. uni.$on('eventName',this.handelEvent)
  94. },
  95. onPullDownRefresh() {
  96. this.billList = [];
  97. this.getSignBillList();
  98. },
  99. methods: {
  100. close(){
  101. this.show=false;
  102. },
  103. open(){},
  104. handelEvent(data){
  105. this.billList.splice(data, 1)
  106. },
  107. scanFabClick() {
  108. //扫码
  109. let _that = this;
  110. uni.scanCode({
  111. onlyFromCamera: true,
  112. scanType: ['barCode', 'qrCode'],
  113. success: function (res) {
  114. // console.log("res1212",res);
  115. if (res.result.indexOf('sendOrder') != -1) {
  116. let idOrder = res.result.split("-")[2];
  117. _that.truckUpOrder(idOrder)
  118. }else if(res.result.indexOf('orderLabel') != -1){
  119. let orderCode = res.result.split("-")[1];
  120. _that.getShipDetails(orderCode)
  121. }else {
  122. uni.showToast({
  123. title: "请扫正确的二维码",
  124. icon: 'none'
  125. })
  126. }
  127. }
  128. })
  129. },
  130. truckUpOrder(idOrder){
  131. let _that = this;
  132. _that.billList = [];
  133. let parms = {
  134. idOrder: idOrder
  135. }
  136. request.httpPost("/dnyDriver/signInScanSendOrder", parms, true).then(res => {
  137. _that.signVisible = true;
  138. _that.billList = res.data
  139. })
  140. },
  141. getShipDetails(orderCode){
  142. let _that = this;
  143. _that.billList = [];
  144. let parms = {
  145. orderCode: orderCode
  146. }
  147. request.httpPost("/dnyDriver/signInScanERPOrder", parms, true).then(res => {
  148. _that.signVisible = true;
  149. _that.billList = res.data
  150. })
  151. },
  152. getSignBillList: function () {
  153. let _that = this;
  154. _that.loading = true;
  155. _that.signVisible = false;
  156. var info = {
  157. ltItemState: 5
  158. }
  159. let listData = {
  160. params: JSON.stringify(info),
  161. page: JSON.stringify(_that.page)
  162. }
  163. request.httpPost("/dnyDriver/driverQuerySignInItem", listData, true).then(res => {
  164. _that.loading = false;
  165. // console.log("res1111", res);
  166. uni.stopPullDownRefresh();
  167. if (!res.data || res.data.length == 0) {
  168. this.loadStatus = "noMore";
  169. return;
  170. }
  171. this.billList = this.billList.concat(res.data);
  172. this.loadStatus = "more";
  173. // supplierIndex = 0;
  174. });
  175. },
  176. searchBill(res) {
  177. },
  178. loadMoreBill: function () {
  179. this.loadStatus = "loading";
  180. setTimeout(() => {
  181. this.page.pageIndex += 1;
  182. this.getSignBillList();
  183. }, 100);
  184. },
  185. updateBillBtn: function (item) {
  186. let _that = this;
  187. _that.loading = true;
  188. let parms = {
  189. idOrder: item.idOrder
  190. }
  191. request.httpPost("/dnyDriver/orderPayRequest3", parms, true).then(res => {
  192. // console.log("res333",res);
  193. _that.loading = false;
  194. if (res.httpCode == 200) {
  195. _that.show = true;
  196. _that.erpOrderCode = item.erpOrderCode
  197. _that.qrCodeInfo = res.data.qrCodeInfo
  198. _that.src = res.data.qrCodeImageUrl.substring(1).replace('apis', 'http://192.168.1.24:51106');
  199. console.log(_that.src);
  200. // _that.src = res.data.qrCodeImageUrl
  201. }else {
  202. uni.showToast({
  203. title: res.msg,
  204. icon: 'none',
  205. mask: true,
  206. duration: 1000,
  207. })
  208. }
  209. })
  210. },
  211. parseBillState: function (item) {
  212. if (item.voidFlag == 1) {
  213. return "已作废";
  214. } else if (item.billState == 1) {
  215. return "已下达";
  216. } else {
  217. return "";
  218. }
  219. },
  220. viewOrderTrace: function (item,index) {
  221. // console.log(item.id);
  222. uni.navigateTo({
  223. url: "../feedback/traceCamera?idOrder=" + item.id + "&orderCode=" + item.erpOrderCode + "&shipmentName=" + item.shipmentName+ "&index=" + index
  224. });
  225. }
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. .qrCodeInfo{
  231. font-size: 30rpx;
  232. }
  233. .qrCodeInfo span{
  234. color: #e4493c !important;
  235. font-size: 30rpx;
  236. font-weight: bold;
  237. }
  238. .popup-con{
  239. min-height: 800rpx;
  240. padding: 40rpx;
  241. width: 700rpx;
  242. margin: auto;
  243. box-sizing: border-box;
  244. }
  245. .tag-con {
  246. color: #e4493c;
  247. margin-right: 20rpx;
  248. }
  249. /deep/ .uni-list-item__container {
  250. padding: 0rpx;
  251. }
  252. .demo-layout span {
  253. font-weight: bold;
  254. color: #e4493c;
  255. padding: 0 5rpx;
  256. }
  257. /deep/ .uni-list-item__container {
  258. padding: 0 rpx;
  259. }
  260. /deep/ .uni-card uni-card--border{
  261. padding: 0 rpx;
  262. }
  263. .card-actions {
  264. display: flex;
  265. flex-direction: row;
  266. justify-content: space-around;
  267. align-items: center;
  268. height: 45px;
  269. border-top: 1px #eee solid;
  270. }
  271. .card-actions-item {
  272. display: flex;
  273. flex-direction: row;
  274. align-items: center;
  275. }
  276. .card-actions-item-text {
  277. font-size: 12px;
  278. color: #666;
  279. margin-left: 5px;
  280. }
  281. .textTitle {
  282. border-left: 0px solid #007AFF;
  283. display: inline-block;
  284. width: 180 rpx;
  285. text-align: left;
  286. margin-bottom: 5px;
  287. color: #8799a3;
  288. }
  289. </style>