index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <span>提货管理</span>
  5. </div>
  6. <div class="table-body">
  7. <div>
  8. <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
  9. <div class="flex">
  10. <el-form-item label="">
  11. <el-select v-model="search_data.status" placeholder="请选择状态" size="small">
  12. <el-option label="全部" value=""></el-option>
  13. <el-option label="待审核" value="0"></el-option>
  14. <el-option label="已审核" value="1"></el-option>
  15. <el-option label="部分发货" value="2"></el-option>
  16. <el-option label="待确认" value="3"></el-option>
  17. <el-option label="已收货" value="4"></el-option>
  18. <el-option label="已拒绝" value="4"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="提货时间">
  22. <el-date-picker v-model="dates" size="small" type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="selectedDates"> </el-date-picker>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="primary" @click="search">搜索</el-button>
  26. <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn">清除条件</el-button>
  27. </el-form-item>
  28. </div>
  29. </el-form>
  30. </div>
  31. <el-table :data="list" stripe v-loading="listLoading" size="small" style="margin-bottom: 15px; width: 100%">
  32. <el-table-column label="提货时间" width="200" prop="money">
  33. <template slot-scope="scope">
  34. <div v-if="scope.row.created_at>0">{{scope.row.created_at | dateTimeFormat('Y-m-d H:i:s')}}</div>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="order_no" label="提货批次" align="center">
  38. <template slot-scope="scope">
  39. <div>{{scope.row.order_no}}</div>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="收货人信息" width="200" prop="money">
  43. <template slot-scope="scope">
  44. <div>收货人姓名: {{scope.row.user_name}}</div>
  45. <div>手机号: {{scope.row.mobile}}</div>
  46. <div>地址: {{scope.row.address}}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="配送方式" align="center">
  50. <div>物流配送</div>
  51. </el-table-column>
  52. <el-table-column label="状态" width="200" prop="money">
  53. <template slot-scope="scope">
  54. <div>{{scope.row.order_status_text}}</div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="操作" style="width: 180px;" fixed="right" align="center">
  58. <template slot-scope="scope">
  59. <template>
  60. <el-button v-if="scope.row.order_status==2 || scope.row.order_status==3" type="text"
  61. size="small" @click="confirm(scope
  62. .row)">确认收货</el-button>
  63. <el-button type="text" size="small" @click="express
  64. (scope.row)">发货详情</el-button>
  65. <el-button v-if="scope.row.order_status>=1" type="text" size="small" @click="showGoods(scope.row)">查看商品</el-button>
  66. </template>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <div style="text-align: right;margin: 20px 0;">
  71. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  72. </div>
  73. </div>
  74. <el-dialog title="发货详情" :visible.sync="dialogExpressVisible" width="1200px">
  75. <div v-for="(item,index) in express_list">
  76. <div style="margin-left: 10px"><span style="margin-right: 50px">物流单号:{{item
  77. .express_no}}</span><span>物流公司:{{item
  78. .express_company}}</span></div>
  79. <el-table :data="item.goods" stripe size="small" style="margin-bottom: 15px; width: 100%">
  80. <el-table-column label="商品图片" width="100">
  81. <template slot-scope="scope">
  82. <div v-if="scope.row.cover_pic">
  83. <img :src="scope.row.cover_pic" style="width: 50px;heightheight: 50px;">
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="商品名称" width="200">
  88. <template slot-scope="scope">
  89. <div>{{scope.row.goods_name}}{{scope.row.goods_attr_name}}</div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="提货数量">
  93. <template slot-scope="scope">
  94. <div>{{scope.row.buy_num}}件</div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="生产日期">
  98. <template slot-scope="scope">
  99. <div>{{scope.row.create_date | dateTimeFormat("Y-m-d")}}</div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="保质期">
  103. <template slot-scope="scope">
  104. <div>{{scope.row.save_day}}</div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="过期时间" >
  108. <template slot-scope="scope">
  109. <div>{{scope.row.expire_date | dateTimeFormat("Y-m-d")}}</div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="发货数量">
  113. <template slot-scope="scope">
  114. <div>{{scope.row.num}}</div>
  115. </template>
  116. </el-table-column>
  117. </el-table>
  118. </div>
  119. <div style="margin-top: 20px;text-align: center">
  120. <el-button size="mini" @click="dialogExpressVisible=false">取消</el-button>
  121. </div>
  122. </el-dialog>
  123. <el-dialog title="查看商品" :visible.sync="dialogGoodsVisible" width="1200px">
  124. <el-table :data="detail.goods" stripe size="small" style="margin-bottom: 15px; width: 100%">
  125. <el-table-column label="商品图片" width="100">
  126. <template slot-scope="scope">
  127. <div v-if="scope.row.cover_pic">
  128. <img :src="scope.row.cover_pic" style="width: 50px;heightheight: 50px;">
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="商品名称" width="200">
  133. <template slot-scope="scope">
  134. <div>{{scope.row.goods_name}}{{scope.row.goods_attr_name}}</div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="提货数量">
  138. <template slot-scope="scope">
  139. <div>{{scope.row.num}}件</div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="剩余待发数量">
  143. <template slot-scope="scope">
  144. <div>{{scope.row.leave_num}}</div>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. <div style="margin-top: 20px;text-align: center">
  149. <el-button size="mini" @click="dialogGoodsVisible=false">取消</el-button>
  150. </div>
  151. </el-dialog>
  152. </el-card>
  153. </div>
  154. <script>
  155. const app = new Vue({
  156. el: '#app',
  157. data() {
  158. return {
  159. search_data: {
  160. status: '',
  161. start_time:'',
  162. end_time:''
  163. },
  164. btnLoading:false,
  165. list: [],
  166. dates: null,
  167. page: 1,
  168. pageCount: 0,
  169. listLoading: false,
  170. detail:[],
  171. dialogExpressVisible:false,
  172. dialogGoodsVisible:false,
  173. express_list:[],
  174. };
  175. },
  176. mounted: function() {
  177. this.getList();
  178. },
  179. computed: {
  180. show_clear_search_btn: function() {
  181. return !isEmpty(this.search_data.start_time) || !isEmpty(this.search_data
  182. .end_time)||!isEmpty(this.search_data
  183. .status);
  184. }
  185. },
  186. methods: {
  187. showGoods(row)
  188. {
  189. this.getDetail(row.id,'goods');
  190. this.dialogGoodsVisible=true;
  191. },
  192. confirm(row)
  193. {
  194. //确认
  195. this.$confirm('确定要确认收货吗?', '提示').then(e => {
  196. this.btnLoading=true;
  197. this.$request({
  198. params: {
  199. r: 'happiness/client/voucher-order/confirm'
  200. },
  201. data:{id:row.id},
  202. method: 'post',
  203. }).then(e => {
  204. if (e.data.code === 0) {
  205. this.getList();
  206. this.btnLoading=false;
  207. } else {
  208. this.$message.error(e.data.msg);
  209. this.btnLoading=false;
  210. }
  211. }).catch(e => {
  212. });
  213. });
  214. },
  215. // 选中时间
  216. selectedDates(e) {
  217. if (e) {
  218. this.search_data.start_time = e[0];
  219. this.search_data.end_time = e[1];
  220. } else {
  221. this.search_data.start_time = '';
  222. this.search_data.end_time = '';
  223. this.dates = null;
  224. }
  225. },
  226. getDetail(id,type)
  227. {
  228. let self = this;
  229. request({
  230. params: {
  231. r: 'happiness/store-voucher-order/detail',
  232. id: id,
  233. },
  234. method: 'get',
  235. }).then(e => {
  236. if(e.data.code === 0)
  237. {
  238. self.detail=e.data.data;
  239. }
  240. else
  241. {
  242. self.$message.error(e.data.msg);
  243. }
  244. }).catch(e => {
  245. });
  246. },
  247. pagination(currentPage) {
  248. let self = this;
  249. self.page = currentPage;
  250. self.getList();
  251. },
  252. express(row)
  253. {
  254. this.dialogExpressVisible=true;
  255. let self = this;
  256. let basic_params = {
  257. r: 'happiness/client/voucher-order/express',
  258. id:row.id
  259. };
  260. request({
  261. params: basic_params,
  262. method: 'get',
  263. }).then(e => {
  264. self.listLoading = false;
  265. if (e.data.code === 0) {
  266. self.express_list = e.data.data;
  267. } else {
  268. self.$message.error(e.data.msg);
  269. }
  270. }).catch(e => {
  271. });
  272. },
  273. getList(id) {
  274. let self = this;
  275. let basic_params = {
  276. r: 'happiness/client/voucher-order/index',
  277. page: self.page,
  278. };
  279. params = Object.assign(basic_params, this.search_data);
  280. if (self.listLoading === false) {
  281. self.listLoading = true;
  282. request({
  283. params: params,
  284. method: 'get',
  285. }).then(e => {
  286. self.listLoading = false;
  287. if (e.data.code === 0) {
  288. self.list = e.data.data.list;
  289. self.pageCount = e.data.data.page_count;
  290. } else {
  291. self.$message.error(e.data.msg);
  292. }
  293. }).catch(e => {
  294. });
  295. }
  296. },
  297. search() {
  298. this.page = 1;
  299. this.getList();
  300. },
  301. clearSearch() {
  302. this.search_data.start_time = null;
  303. this.search_data.end_time = null;
  304. this.dates = null;
  305. this.search_data.status = '';
  306. this.getList();
  307. }
  308. }
  309. })
  310. </script>
  311. <style>
  312. .flex {
  313. display: flex;
  314. align-items: center;
  315. }
  316. .stat_details{
  317. padding: 0 0 20px;
  318. display: flex;
  319. }
  320. .stat_details .order_module{
  321. flex: 1;
  322. background: #F2F2F2;
  323. margin: 0 5px;
  324. padding: 20px 25px;
  325. }
  326. .order_module{
  327. display: flex;
  328. flex-direction: column;
  329. }
  330. .order_module:last-child{
  331. margin-right: 0;
  332. }
  333. .order_module:first-child{
  334. margin-left: 0;
  335. }
  336. .price{
  337. font-size: 14px;
  338. flex: 1;
  339. word-break: break-all;
  340. }
  341. .oirder_modul_title{
  342. font-size: 12px;
  343. margin-bottom: 10px;
  344. display: flex;
  345. align-items: center;
  346. }
  347. ..el-input__inner{
  348. border-right: 1px solid #EBEEF5;
  349. }
  350. .oirder_modul_title .text{
  351. margin-right: 10px;
  352. }
  353. .stat_icon{
  354. font-size: 19px;
  355. color: #BFBFBF;
  356. }
  357. </style>