order.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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" @tap="confirm">搜索</view>
  10. </view>
  11. </view>
  12. <!-- <span>搜索</span> -->
  13. </view>
  14. <view class="tab">
  15. <view v-for="(item, index) in TabList" :key="index" :class="'li ' + (item.active ? 'active' : '')" @click="switchTab(index)">{{ item.label }}</view>
  16. </view>
  17. <view class="tabcon">
  18. <block v-if="pageList && pageList.length > 0">
  19. <ul class="list" v-if="tabIndex == 2">
  20. <li v-for="(item, index) in pageList" :key="index" @click="jumpUrl('refundDetail?id=' + item.id)">
  21. <view class="ddbh dflex" @click="toOrederDel(item.id)">
  22. <view class="ordid">
  23. {{ item.orderId }}
  24. </view>
  25. </view>
  26. <view class="lis" v-for="(pro, ind) in item.productList" :key="ind">
  27. <image :src="pro.image" class="cimage" />
  28. <view class="zhinfo">
  29. <view class="zhtit" v-text="pro.title"></view>
  30. <view v-if="pro.specsList && pro.specsList.length > 0" class="guige">
  31. 规格:
  32. <text v-for="(itemGuige, index) in pro.specsList" :key="index" class="guige" decode="true">{{ itemGuige.value }}&nbsp;</text>
  33. </view>
  34. <view class="jiage">
  35. <view class="price">
  36. <span>¥</span>
  37. {{ pro.money }}
  38. </view>
  39. <view class="num">×{{ pro.quantity }}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="total">
  44. <view>共{{ item.quantity }}件</view>
  45. <view>
  46. 总计:
  47. <span>¥{{ item.refundMoney }}</span>
  48. </view>
  49. </view>
  50. <view class="status">
  51. <span class="ordidss flex">{{ item.refundStateName }}</span>
  52. <!-- <view class="sta-btn" v-if="item.refundState > 29 && item.refundState < 41 && item.refundState != 32">审核</view> -->
  53. </view>
  54. </li>
  55. </ul>
  56. <ul class="list" v-else>
  57. <li v-for="(item, index) in pageList" :key="index">
  58. <view class="ddbh dflex" @click="toOrederDel(item.id)">
  59. <view class="ordid">
  60. <image src="../merchant/static/images/ziti.png" class="ziti" v-if="item.mode == 1" />
  61. <image src="../merchant/static/images/youji.png" class="youji" v-if="item.mode == 2" />
  62. <image src="../merchant/static/images/jishida.png" class="jsd" v-if="item.mode == 3" />
  63. {{ item.id }}
  64. </view>
  65. <view class="flex dflex right ddddd">
  66. <view class="th-code red" v-if="item.mode === 1">
  67. 提货码:
  68. <text>{{ item.code }}</text>
  69. </view>
  70. <image src="../merchant/static/images/jishidaioc.png" class="type" v-if="item.orderType === 5" />
  71. <image src="../merchant/static/images/tuangou.png" class="type" v-if="item.orderType === 2" />
  72. <image src="../merchant/static/images/pingtuan.png" class="type" v-if="item.orderType == 4" />
  73. <image src="../merchant/static/images/seckill.png" class="type" v-if="item.orderType == 3" />
  74. <image src="../merchant/static/images/newbornZone.png" class="type" v-if="item.orderType == 6" />
  75. <image src="../merchant/static/images/kanjia.png" class="type" v-if="item.orderType == 7" />
  76. </view>
  77. </view>
  78. <view class="lis" v-for="(pro, ind) in item.products" :key="ind" @click="toOrederDel(item.id)">
  79. <image :src="pro.pic" class="cimage" />
  80. <view class="zhinfo">
  81. <view class="zhtit" v-text="pro.title"></view>
  82. <view v-if="pro.propertiesList && pro.propertiesList.length > 0" class="guige">
  83. 规格:
  84. <text v-for="(itemGuige, index) in pro.propertiesList" :key="index" class="guige" decode="true">{{ itemGuige.value }}&nbsp;</text>
  85. </view>
  86. <view class="jiage">
  87. <view class="price">
  88. <span>¥</span>
  89. {{ pro.salePrice }}
  90. </view>
  91. <view class="num">×{{ pro.quantity }}</view>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="total" @click="toOrederDel(item.id)">
  96. <view>共{{ item.count }}件</view>
  97. <view>
  98. 总计:
  99. <span>¥{{ item.money }}</span>
  100. </view>
  101. </view>
  102. <view class="status">
  103. <span class="ordidss flex">{{ item.stateName }}</span>
  104. <view class="sta-btn" v-if="merchant.printer != 0 && (item.state == 3 || item.state == 4)" @click="orderPrinting(item.id, index)">打印小票</view>
  105. <!-- <view class="sta-btn" v-if="item.state > 29 && item.state < 41 && item.state != 32" @click="jumpUrl('refund?id=' + item.id)">审核</view> -->
  106. <view class="sta-btn" v-if="item.state == 3" @click="deliverGoods(item.id, merchantId, item.orderType)">确认发货</view>
  107. <view class="sta-btn" v-if="item.state === 4" @click="send(item.id)">通知取件</view>
  108. <view class="sta-btn" v-if="item.state === 4" @click="deliver(item.id, index)">已提货</view>
  109. </view>
  110. </li>
  111. </ul>
  112. </block>
  113. <view v-else class="nodata">
  114. <image src="../merchant/static/images/empty.png"></image>
  115. <view>暂无数据</view>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. const req = require('../utils/request');
  122. export default {
  123. data() {
  124. return {
  125. TabList: [
  126. {
  127. label: '待提货',
  128. state: 4,
  129. active: false
  130. },
  131. {
  132. label: '待发货',
  133. state: 3,
  134. active: false
  135. },
  136. {
  137. label: '售后',
  138. active: false
  139. },
  140. {
  141. label: '全部',
  142. active: true
  143. }
  144. ],
  145. merchant: {},
  146. tabIndex: '',
  147. active: 3,
  148. pageList: [],
  149. ishow: false,
  150. id: '',
  151. index: 0,
  152. searchTitle: '',
  153. form: {
  154. page: 0,
  155. limit: 10
  156. },
  157. isLoad: true,
  158. userInfo: {},
  159. type: 1,
  160. merchantId: ''
  161. };
  162. },
  163. onLoad(opt) {
  164. this.active = opt.tabIndex;
  165. this.merchantId = opt.merchantId;
  166. this.isPrinting();
  167. this.switchTab(this.active);
  168. },
  169. onReachBottom() {
  170. this.form.page++;
  171. this.getOrderlist();
  172. },
  173. methods: {
  174. jumpUrl(url) {
  175. uni.navigateTo({
  176. url: url
  177. });
  178. },
  179. // s是否开启云打印
  180. isPrinting() {
  181. let fromP = {};
  182. fromP.id = this.merchantId;
  183. req.getRequest('/api/merchant/detail', fromP, data => {
  184. this.merchant = data;
  185. });
  186. },
  187. // 查看订单详情
  188. toOrederDel(id) {
  189. this.jumpUrl('show?id=' + id + '&merchantId=' + this.merchant.id);
  190. },
  191. // 确认发货
  192. deliverGoods(id, merchantId, orderType) {
  193. req.postRequest(
  194. '/api/order/deliverExtend',
  195. {
  196. id: id
  197. },
  198. res => {
  199. if (res && res.length > 1) {
  200. this.jumpUrl('deliverExtend?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  201. }
  202. if (res && res.length <= 1) {
  203. this.jumpUrl('express?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  204. }
  205. },
  206. true
  207. );
  208. },
  209. // 打印
  210. orderPrinting(id, index) {
  211. req.getRequest(
  212. '/api/merchant/printOrderInfo',
  213. id,
  214. data => {
  215. req.msg(data.msg);
  216. },
  217. true
  218. );
  219. },
  220. // 通知取件
  221. send(id) {
  222. req.getRequest(
  223. '/api/wxmes/send',
  224. {
  225. orderId: id,
  226. bsusinessType: 11
  227. },
  228. data => {
  229. req.msg('通知成功');
  230. },
  231. true
  232. );
  233. },
  234. // 已提货
  235. deliver(id, index) {
  236. req.postRequest(
  237. '/api/order/confirm',
  238. {
  239. id: id,
  240. mode: '1'
  241. },
  242. data => {
  243. this.pageList[index].state = 6;
  244. this.pageList[index].stateName = '已签收';
  245. },
  246. true
  247. );
  248. },
  249. // 获取订单列表
  250. getOrderlist() {
  251. if (!this.isLoad) return false;
  252. this.isLoad = false;
  253. let fromP = {
  254. merchantId: this.merchantId,
  255. page: this.form.page,
  256. limit: this.form.limit
  257. };
  258. let that = this;
  259. if (this.tabIndex == 2) {
  260. //售后
  261. this.getRefundList(fromP);
  262. } else {
  263. fromP.state = this.TabList[this.tabIndex].state;
  264. //正常其它订单
  265. this.getOrderlists(fromP)
  266. }
  267. },
  268. getRefundList(fromP){
  269. req.getRequest('/api/v3/store/refund/page', fromP, data => {
  270. if (data.list && data.list.length == 10) {
  271. this.isLoad = true;
  272. }
  273. if (this.form.page > 0) {
  274. data.list = this.pageList.concat(data.list);
  275. }
  276. this.pageList = data.list;
  277. });
  278. },
  279. getOrderlists(fromP){
  280. req.getRequest('/api/order/merchant/list', fromP, data => {
  281. if (data && data.length == 10) {
  282. this.isLoad = true;
  283. }
  284. if (this.form.page > 0) {
  285. data = this.pageList.concat(data);
  286. }
  287. this.pageList = data;
  288. });
  289. },
  290. // tab栏切换
  291. switchTab(tabIndex) {
  292. this.tabIndex = tabIndex;
  293. let def = this.TabList.findIndex(it => it.active);
  294. this.TabList[def].active = false;
  295. this.TabList[this.tabIndex].active = true;
  296. this.isLoad = true;
  297. this.form.page = 1;
  298. this.pageList = [];
  299. this.form.state = this.TabList[this.tabIndex].state;
  300. this.getOrderlist();
  301. },
  302. // 搜索订单 获取用户输入的内容
  303. onSearch(e) {
  304. console.log(e.detail.value);
  305. this.searchTitle = e.detail.value;
  306. },
  307. //清除输入框
  308. clearInput() {
  309. this.searchTitle = '';
  310. },
  311. // 搜索订单
  312. confirm() {
  313. let value = this.searchTitle;
  314. uni.navigateTo({
  315. url: 'search?searchValue=' + value + '&merchantId=' + this.merchant.id
  316. });
  317. }
  318. }
  319. };
  320. </script>
  321. <style scoped>
  322. @import './static/css/main.css';
  323. .noguige {
  324. height: 15px;
  325. }
  326. .ssbot {
  327. padding: 5px 10px 7px;
  328. -webkit-box-pack: center;
  329. -webkit-justify-content: center;
  330. justify-content: center;
  331. -webkit-box-align: center;
  332. -webkit-align-items: center;
  333. align-items: center;
  334. }
  335. .ssbot .searchbot {
  336. background: #fff;
  337. height: 33px;
  338. border-radius: 15px;
  339. padding: 0 0 0 10px;
  340. font-size: 13px;
  341. color: #666;
  342. width: 100%;
  343. box-sizing: border-box;
  344. align-items: center;
  345. }
  346. .searchbot input {
  347. font-size: 28rpx !important;
  348. color: #333;
  349. }
  350. .searchbot image {
  351. width: 15px;
  352. height: 15px;
  353. margin-right: 6px;
  354. }
  355. .expressinfo {
  356. display: flex;
  357. justify-content: space-between;
  358. margin-bottom: 10px;
  359. }
  360. .pad20 {
  361. padding: 20px;
  362. }
  363. .refundFalseRes {
  364. text-align: right;
  365. }
  366. .van-button:not(:last-child) {
  367. margin-right: 5px;
  368. }
  369. .tab {
  370. padding: 0 17px;
  371. display: flex;
  372. display: -webkit-flex;
  373. height: 50px;
  374. background: #fff;
  375. line-height: 50px;
  376. }
  377. .tab .li {
  378. font-size: 14px;
  379. color: #999;
  380. width: 25%;
  381. text-align: center;
  382. position: relative;
  383. }
  384. .tab .li.active {
  385. color: #333;
  386. }
  387. .tab .li.active::after {
  388. content: '';
  389. display: block;
  390. width: 49rpx;
  391. height: 6rpx;
  392. background: #0065ac !important;
  393. position: absolute;
  394. left: 50%;
  395. transform: translateX(-50%);
  396. bottom: 0;
  397. }
  398. </style>