search.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view>
  3. <view class="search-box">
  4. <view class="ssbot dflex">
  5. <view class="searchbot dflex">
  6. <image src="../merchant/static/images/ssico.png"></image>
  7. <input placeholder="请输入订单号、客户手机号后4位" class="flex" :value="searchTitle" @input="onSearch" @confirm="confirm" confirm-type="search" />
  8. <!-- <image src="/static/images/clear.png" @tap="clearInput" v-if="searchTitle != ''"></image> -->
  9. <view class="sousuo" @click="searchClick()">搜索</view>
  10. </view>
  11. </view>
  12. <!-- <span>搜索</span> -->
  13. </view>
  14. <!-- <view class="nodata" v-if="ishow">
  15. <image src="/static/images/empty_dd.png" />
  16. <view>还没有订单哦</view>
  17. </view> -->
  18. <ul class="list" v-if="pageList && pageList.length > 0">
  19. <li v-for="(item, index) in pageList" :key="index">
  20. <view class="ddbh dflex" @click="toOrederDel(item.id)">
  21. <view class="ordid">
  22. <image src="../merchant/static/images/ziti.png" class="ziti" v-if="item.mode == 1" />
  23. <image src="../merchant/static/images/youji.png" class="youji" v-if="item.mode == 2" />
  24. <image src="../merchant/static/images/jishida.png" class="jsd" v-if="item.mode == 3" />
  25. {{ item.id }}
  26. </view>
  27. <view class="flex dflex right ddddd">
  28. <view class="th-code red" v-if="item.mode === 1">
  29. 提货码:
  30. <text>{{ item.code }}</text>
  31. </view>
  32. <image src="../merchant/static/images/jishidaioc.png" class="type" v-if="item.orderType === 5" />
  33. <image src="../merchant/static/images/tuangou.png" class="type" v-if="item.orderType === 2" />
  34. <image src="../merchant/static/images/pingtuan.png" class="type" v-if="item.orderType == 4" />
  35. <image src="../merchant/static/images/seckill.png" class="type" v-if="item.orderType == 3" />
  36. <image src="../merchant/static/images/newbornZone.png" class="type" v-if="item.orderType == 6" />
  37. <image src="../merchant/static/images/kanjia.png" class="type" v-if="item.orderType == 7" />
  38. </view>
  39. </view>
  40. <view class="lis" v-for="(pro, ind) in item.products" :key="ind" @click="toOrederDel(item.id)">
  41. <image :src="pro.pic" class="cimage" />
  42. <view class="zhinfo">
  43. <view class="zhtit" v-text="pro.title"></view>
  44. <view class="jiage">
  45. <view class="price">
  46. <span>¥</span>
  47. {{ pro.salePrice }}
  48. </view>
  49. <view class="num">×{{ pro.quantity }}</view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="total" @click="toOrederDel(item.id)">
  54. <view>共{{ item.count }}件</view>
  55. <view>
  56. 总计:
  57. <span>¥{{ item.money }}</span>
  58. </view>
  59. </view>
  60. <view class="status">
  61. <span class="ordidss flex">{{ item.stateName }}</span>
  62. <view class="sta-btn" v-if="merchant.printer != 0 && (item.state == 3 || item.state == 4)" @click="orderPrinting(item.id, index)">打印小票</view>
  63. <view class="sta-btn" v-if="item.state > 29 && item.state < 41 && item.state != 32" @click="jumpUrl('refund?id=' + item.id)">审核</view>
  64. <view class="sta-btn" v-if="item.state == 3" @click="deliverGoods(item.id, merchantId, item.orderType)">确认发货</view>
  65. <view class="sta-btn" v-if="item.state === 4" @click="send(item.id)">通知取件</view>
  66. <view class="sta-btn" v-if="item.state === 4" @click="deliver(item.id, index)">已提货</view>
  67. </view>
  68. </li>
  69. </ul>
  70. <view v-else class="nodata">
  71. <image src="../merchant/static/images/empty.png"></image>
  72. <view>暂无数据</view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. // import cache from '../datas/cache'
  78. const req = require('../utils/request');
  79. export default {
  80. data: () => ({
  81. pageList: [],
  82. searchTitle: '',
  83. ishow: false,
  84. params: {
  85. page: 0,
  86. limit: 10
  87. },
  88. merchant: {},
  89. userInfo: {},
  90. isLoad: true,
  91. merchantId: ''
  92. }),
  93. onLoad(opt) {
  94. this.userInfo = req.getStorage('userInfo');
  95. this.searchTitle = opt.searchValue;
  96. this.merchantId = opt.merchantId;
  97. this.isPrinting();
  98. this.confirm(true);
  99. },
  100. onShow() {},
  101. onReachBottom() {
  102. this.params.page++;
  103. this.confirm(false);
  104. },
  105. methods: {
  106. jumpUrl(url) {
  107. uni.navigateTo({
  108. url: url
  109. });
  110. },
  111. // s是否开启云打印
  112. isPrinting() {
  113. let fromP = {};
  114. fromP.id = this.merchantId;
  115. req.getRequest('/api/merchant/detail', fromP, data => {
  116. this.merchant = data;
  117. });
  118. },
  119. //是否为自己发货
  120. isMyDeliver(item) {
  121. return item.supplierId == this.userInfo.supplierId;
  122. },
  123. // 搜索订单 获取用户输入的内容
  124. onSearch(e) {
  125. this.searchTitle = e.detail.value;
  126. this.isLoad = true;
  127. console.log(this.searchTitle);
  128. },
  129. // 查看订单详情
  130. toOrederDel(id) {
  131. this.jumpUrl('show?id=' + id+ '&merchantId=' + this.merchant.id);
  132. },
  133. searchClick() {
  134. this.isLoad = true;
  135. this.params.page = 0;
  136. this.confirm(true);
  137. },
  138. // 搜索订单
  139. confirm(isShowLoad) {
  140. let that = this;
  141. let value = this.searchTitle;
  142. let form = this.params;
  143. form.search = value;
  144. form.merchantId = this.merchantId;
  145. if (!this.isLoad) return false;
  146. this.isLoad = false;
  147. req.getRequest(
  148. '/api/order/merchant/list',
  149. form,
  150. data => {
  151. if (data && data.length == 10) {
  152. this.isLoad = true;
  153. }
  154. if (that.params.page > 0) {
  155. data = that.pageList.concat(data);
  156. }
  157. this.pageList = data;
  158. },
  159. isShowLoad
  160. );
  161. },
  162. //清除输入框
  163. clearInput() {
  164. this.searchTitle = '';
  165. },
  166. // 查看订单详情
  167. toOrederDel(id) {
  168. this.jumpUrl('show?id=' + id+ '&merchantId=' + this.merchant.id);
  169. },
  170. // 打印
  171. orderPrinting(id, index) {
  172. req.getRequest(
  173. '/api/merchant/printOrderInfo',
  174. id,
  175. data => {
  176. req.msg(data.msg);
  177. },
  178. true
  179. );
  180. },
  181. // 确认发货
  182. deliverGoods(id, merchantId, orderType) {
  183. req.postRequest(
  184. '/api/order/deliverExtend',
  185. {
  186. id: id
  187. },
  188. res => {
  189. if (res && res.length > 1) {
  190. this.jumpUrl('deliverExtend?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  191. }
  192. if (res && res.length <= 1) {
  193. this.jumpUrl('express?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  194. }
  195. },
  196. true
  197. );
  198. },
  199. // 通知取件
  200. send(id) {
  201. req.getRequest(
  202. '/api/wxmes/send',
  203. {
  204. orderId: id,
  205. bsusinessType: 11
  206. },
  207. data => {
  208. req.msg('通知成功');
  209. },
  210. true
  211. );
  212. },
  213. // 已提货
  214. deliver(id, index) {
  215. req.postRequest(
  216. '/api/order/confirm',
  217. {
  218. id: id,
  219. mode: '1'
  220. },
  221. data => {
  222. this.pageList[index].state = 6;
  223. this.pageList[index].stateName = '已签收';
  224. },
  225. true
  226. );
  227. }
  228. }
  229. };
  230. </script>
  231. <style scoped>
  232. @import './static/css/main.css';
  233. .ssbot {
  234. padding: 5px 10px 7px;
  235. -webkit-box-pack: center;
  236. -webkit-justify-content: center;
  237. justify-content: center;
  238. -webkit-box-align: center;
  239. -webkit-align-items: center;
  240. align-items: center;
  241. }
  242. .ssbot .searchbot {
  243. background: #fff;
  244. height: 33px;
  245. border-radius: 15px;
  246. padding: 0 0 0 10px;
  247. font-size: 13px;
  248. color: #666;
  249. width: 100%;
  250. box-sizing: border-box;
  251. align-items: center;
  252. }
  253. .searchbot input {
  254. font-size: 28rpx !important;
  255. color: #333;
  256. }
  257. .searchbot image {
  258. width: 15px;
  259. height: 15px;
  260. margin-right: 6px;
  261. }
  262. .van-button:not(:last-child) {
  263. margin-right: 5px;
  264. }
  265. .list {
  266. padding: 0.2rem 0.2rem 0;
  267. }
  268. </style>