| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <?php
- /**
- * @link:http://www.goodmall.com/
- * @copyright: Copyright (c) 2020
- * Created by PhpStorm
- * Author: ganxiaohao
- * Date: 2020-05-08
- * Time: 15:48
- */
- use common\helpers\ComponentHelper;
- //Yii::$app->loadPluginComponentView('agent-order-edit');
- $diyPath = dirname(__DIR__) . '/components';
- ComponentHelper::loadComponentView('agent-order-edit', $diyPath);
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>自提订单</span>
- </div>
- <div class="table-body">
- <div style="display: flex;align-items: center;">
- <el-input style="width: 260px;margin-right: 20px;" @keyup.enter.native="loadData" size="small" placeholder="请输入代理商昵称/手机号" v-model="search.keyword"
- clearable @clear="toSearch">
- <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
- </el-input>
- <el-select size="small" v-model="search.status" @change='toSearch' class="select" style="width:130px;margin-right: 20px;">
- <el-option label="全部订单状态" value="" ></el-option>
- <el-option label="待发货" :value="0" ></el-option>
- <el-option label="已发货" :value="1" ></el-option>
- <el-option label="已完成" :value="2" ></el-option>
- <!-- 0待发货;1已发货;2已完成 -->
- </el-select>
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" class="myTable">
- <el-table-column prop="id" min-width="80" label="ID" align="center"></el-table-column>
- <el-table-column label="代理商昵称" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div style="color:#000;">{{scope.row.user.nickname}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="手机号" prop="user_mobile" min-width="120" align="center">
- <template slot-scope="scope">
- <div style="display: flex;align-items: center;">
- <div>{{scope.row.user.mobile}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="自提时间" prop="created_at" min-width="120" align="center">
- <template slot-scope="scope">
- {{formatTime(scope.row.created_at)}}
- </template>
- </el-table-column>
- <el-table-column
- label="商品"
- min-width="150">
- <template slot-scope="scope">
- <div style="display: flex;align-items: center;">
- <img :src="scope.row.goods.cover_pic" style="width: 40px;height: 40px;display: block;margin-right: 5px;" />
- <div>{{scope.row.goods.goods_name}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="商品数量" prop="num" min-width="80" align="center"></el-table-column>
- <el-table-column label="收货地址" prop="address" min-width="150" align="center">
- <template slot-scope="scope">
- <div>收货人:{{scope.row.name}} {{scope.row.mobile}} </div>
- <div>地址:{{scope.row.address}}</div>
- </template>
- </el-table-column>
- <!-- <el-table-column label="收货信息">
- <template slot-scope="scope">
- <div>收货地址: {{scope.row.address}}</div>
- <div>收货人: {{scope.row.name}} {{scope.row.mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column label="发货信息">
- <template slot-scope="scope">
- <div>快递名称: {{scope.row.express_name}}</div>
- <div>快递单号: {{scope.row.express_no}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="created_at" label="提交时间"></el-table-column> -->
- <el-table-column label="操作" min-width="100" align="center">
- <template slot-scope="scope">
- <!-- <el-button type="text" @click="editClick(scope.row.id)" v-if="scope.row.status==0">发货</el-button>
- <el-button type="text" v-if="scope.row.status==1">已发货</el-button>
- <el-button type="text" v-if="scope.row.status==2">已收货</el-button> -->
- <!-- 0待发货;1已发货;2已完成 -->
- <el-button type="primary" @click="editClick(scope.row)" v-if="scope.row.send_status==0" size="small">待发货</el-button>
- <el-button type="info" v-if="scope.row.send_status==1" size="small">已发货</el-button>
- <el-button type="success" v-if="scope.row.send_status==2" size="small">已完成</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tabs>
- <div flex="box:last cross:center">
- <div></div>
- <div>
- <el-pagination
- @current-change="pageChange"
- background
- layout="prev, pager, next"
- :page-count="page_count">
- </el-pagination>
- </div>
- </div>
- </div>
- </el-card>
- <agent-order-edit v-model="edit.show" :edit_row="edit" @success="loadData"></agent-order-edit>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- edit: {
- show: false,
- id: 0,
- data:{}
- },
- loading: false,
- activeName: '-1',
- list: [],
- pagination: null,
- agent_level_list: [],
- search: {
- page: 1,
- keyword:'',
- status:''
- },
- page_count:0
- },
- mounted() {
- this.loadData();
- },
- methods: {
- editClick(row) {
- //console.log('row='+JSON.stringify(row))
- //if (id) {
- /* this.edit.id = id; */
- this.edit.show = true;
- this.edit.data = row;
- //} else {
- //this.edit.show = true;
- //}
- },formatTime(timeStamp) {
- var date = new Date();
- date.setTime(timeStamp * 1000);
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- m = m < 10 ? ('0' + m) : m;
- var d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- var h = date.getHours();
- h = h < 10 ? ('0' + h) : h;
- var minute = date.getMinutes();
- var second = date.getSeconds();
- minute = minute < 10 ? ('0' + minute) : minute;
- second = second < 10 ? ('0' + second) : second;
- return y + '-' + m + '-' + d +' '+ h + ':' + minute + ':' + second;
- },
- loadData() {
- this.loading = true;
- let params = {
- r: 'cloud-stock-two/order/invite',//plugin/cloud_stock/mall/pick-up/get-list自取订单列表
- limit:10
- };
- params = Object.assign(params, this.search);
- //console.log('请求前的params='+JSON.stringify(params))
- request({
- params: params,
- method: 'get',
- }).then(e => {
- //console.log('自取订单列表='+JSON.stringify(e))
- this.loading = false;
- if (e.data.code == 0) {
- this.list = e.data.data.list;
- this.page_count = e.data.data.page_count;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- pageChange(page) {
- this.search.page = page;
- this.loadData();
- },
- handleClick(tab, event) {
- this.search.page = 1;
- this.search.status = this.activeName;
- this.loadData()
- },
- toSearch() {
- this.search.page = 1;
- this.loadData();
- },
- }
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- /* .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- } */
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: flex;
- align-items: center;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- /* .batch .el-button {
- padding: 9px 15px !important;
- } */
- .el-table th>.cell{
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .myTable .el-table__footer-wrapper,.myTable .el-table__header-wrapper{
- border-bottom: 1.4px solid #D6D6D6;
- }
- </style>
|