| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610 |
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>订单列表</span>
- </div>
- </div>
- <div class="table-body">
- 商品名称:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="商品名称" v-model="searchData.search_words" clearable @clear="search"></el-input>
- </div>
- 供应链:
- <el-select size="small" v-model="searchData.supply_id" class="select" style="float:none;width: 140px;">
- <el-option v-for="item in supplyList" :label="item.app_name" :value="item.id">
- </el-option>
- </el-select>
- 订单号:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="订单号" v-model="searchData.order_no" clearable @clear="search"></el-input>
- </div>
- 用户ID:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="用户ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
- </div>
- 收件人:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="收件人" v-model="searchData.name" clearable @clear="search"></el-input>
- </div>
- 平台类型:
- <el-select size="small" v-model="searchData.source" @change='search' class="select" style="float:none;width: 140px;">
- <el-option key="1" label="云仓" value="1"></el-option>
- <el-option key="2" label="京东" value="2"></el-option>
- <el-option key="6" label="阿里巴巴" value="6"></el-option>
- <el-option key="7" label="天猫" value="7"></el-option>
- </el-select>
- 推单状态:
- <el-select size="small" v-model="searchData.push_status" @change='search' class="select" style="float:none;width: 140px;">
- <el-option key="0" label="全部" value="0"></el-option>
- <el-option key="1" label="未推单" value="1"></el-option>
- <el-option key="2" label="推单中" value="2"></el-option>
- <el-option key="3" label="推单成功" value="3"></el-option>
- <el-option key="4" label="推单失败" value="4"></el-option>
- <el-option key="5" label="已退单" value="5"></el-option>
- </el-select>
- <!-- 订单状态:
- <el-select size="small" v-model="searchData.order_status" @change='search' class="select" style="float:none;width: 140px;">
- <el-option key="0" label="全部" value="0"></el-option>
- <el-option v-for="(item,key) in order_status_list" :key="key" :label="item" :value="key"></el-option>
- </el-select> -->
- <div style="display: inline-block;margin-left: 10px;">
- <el-button type="primary" size="small" @click="search">查询</el-button>
- <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
- </div>
- </div>
- <div class="table-body">
- <el-row>
- <el-col :sm="1" style="text-align: right">
- <el-button size="mini" @click="batchPatchOrder" type="primary">批量补单</el-button>
- </el-col>
- </el-row>
- <!--商品信息-->
- <template>
- <el-table ref="multipleTable" :data="order_list" @selection-change="handleSelectionChange">
- <!-- 空数据 -->
- <template slot="empty">
- <el-empty description="暂无订单"></el-empty>
- </template>
- <el-table-column type="selection">
- </el-table-column>
- <el-table-column prop="order_no" align="center" label="订单编号">
- </el-table-column>
- <el-table-column prop="goods_name" align="center" label="商品标题">
- <template slot-scope="scope">
- <div class="ellipsis" style="clear:both;">{{ stateFormat(scope.row.mallOrderDetail.goods_name) }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="img" align="center" label="商品图片">
- <template slot-scope="scope">
- <div class="goods-image">
- <com-image mode="aspectFill" :src="scope.row.mallOrderDetail.pic_url"></com-image>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="mallOrderDetail.goods_attr_name" align="center" label="商品属性">
- </el-table-column>
- <el-table-column prop="supply_name" align="center" label="供应链">
- </el-table-column>
- <el-table-column prop="goods_price" label="订单总价" align="center">
- <template slot-scope="scope">
- {{scope.row.mallOrder.goods_price}}
- </template>
- </el-table-column>
- <el-table-column prop="pay_money" label="实际支付" align="center">
- <template slot-scope="scope">
- {{scope.row.mallOrder.pay_money}}
- </template>
- </el-table-column>
- <el-table-column prop="consignee" label="收件人" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.mallOrder.consignee}}</div>
- <div>{{scope.row.mallOrder.mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="pay_at" label="支付时间" align="center">
- <template slot-scope="scope">
- {{scope.row.mallOrder.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column prop="status_text" label="推单状态" align="center">
- <template slot-scope="scope">
- {{scope.row.status_text}}
- </template>
- </el-table-column>
- <el-table-column prop="updated_at" label="更新时间" align="center">
- <template slot-scope="scope">
- {{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column prop="error" label="推单信息" align="center">
- <template slot-scope="scope">
- <div class="ellipsis" style="clear:both;">{{scope.row.error}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作">
- <template slot-scope="scope">
- <el-button @click="orderDetail(scope.row)" type="text" size="small">
- 详情
- </el-button>
- <el-button
- v-if="(scope.row.status == 4) && (scope.row.mallOrder.order_source == 'QiJuhe')"
- @click="patchOrder(scope.row)"
- type="text"
- size="small"
- >补单</el-button>
- <el-button
- v-if="scope.row.refund_order_id > 0"
- @click="refundOrder(scope.row)"
- type="text"
- size="small"
- >售后</el-button>
- <el-button
- v-if="(scope.row.status == 4) && (scope.row.mallOrder.order_source == 'QiJuhe')"
- @click="changeOrder(scope.row)"
- type="text"
- size="small"
- >转普通订单</el-button>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <!-- 分页 -->
- <el-row type="flex" class="page" justify="end">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="order_list"></el-pagination>
- </el-row>
- </div>
- </el-card>
- </div>
- </el-card>
- </div>
- <script>
- var activity_id = <?php echo 1 ?>;
- const app = new Vue({
- el: '#app',
- filters: {
- addZero: function(data) {
- return Math.round((data / 100) * 100) / 100 + '元';
- },
- },
- data() {
- return {
- searchData: {
- search_words: '',
- source: '',
- range_type: '',
- range_from: '',
- range_to: '',
- is_free_shipping: '',
- name: '',
- push_status: '',
- order_no: '',
- user_id: '',
- supply_id: '',
- limit: 15
- },
- order_list: [],
- select_order: [],
- supplyList: [],
- category_1: [],
- category_2: [],
- category_3: [],
- category_id_1: '',
- category_id_2: '',
- category_id_3: '',
- order_status_list: [],
- level: 0,
- parent_id: 0,
- pageCount: 0,
- page: 1,
- member_page: 1,
- currentPage: null,
- listLoading: false,
- btnLoading: false,
- checked: false,
- type: '',
- sort: '',
- };
- },
- created() {
- this.searchData.order_no = getQuery('order_no')
- },
- methods: {
- handleSelectionChange(val) {
- this.select_order = val;
- },
- // 订单详情
- orderDetail(order) {
- navigateTo({
- r: 'mall/order/detail',
- id: order.order_id,
- }, true);
- },
- // 订单详情
- refundOrder(order) {
- navigateTo({
- r: 'mall/order/refund-detail',
- refund_order_id: order.refund_order_id,
- }, true);
- },
- // 推单
- batchPatchOrder() {
- let num = 0;
- let order_id = new Array();
- this.select_order.forEach(function(item, index) {
- num++;
- order_id.push(item.id);
- })
- if (num <= 0) {
- this.$message.error('请选择订单');
- return false;
- }
- let self = this;
- this.$confirm('是否要对该订单进行补单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.patch_order(order_id);
- }).catch(() => {
- this.$message.info('已取消删除')
- })
- },
- // 推单
- patchOrder(order) {
- this.$confirm('是否要对该订单进行补单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.patch_order([order.id]);
- }).catch(() => {
- this.$message.info('已取消删除')
- })
- },
- // 全选
- allSelect() {
- if (this.checked) {
- this.goods_list.forEach(function(item, index) {
- if (!item.storage) {
- item.is_select = true;
- }
- })
- } else {
- this.goods_list.forEach(function(item, index) {
- item.is_select = false;
- })
- }
- },
- //搜索
- search() {
- this.page = 1;
- this.getOrderList();
- },
- pagination(currentPage) {
- this.page = currentPage;
- this.getOrderList();
- },
- getSupply(){
- request({
- params: {
- r: 'qi-juhe/supplys/index',
- },
- method: 'get',
- }).then(e => {
- if (e.data.code === 0) {
- this.supplyList = e.data.data.list
- // this.searchData.supply_id = this.supplyList[0].id
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {});
- },
- getOrderList() {
- this.listLoading = true;
- var param = this.searchData;
- param.r = 'qi-juhe/order/index';
- param.page = this.page;
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.order_list = e.data.data.list;
- this.order_status_list = e.data.data.order_status_list;
- this.pageCount = e.data.data.page_count;
- this.currentPage = e.data.data.pagination.current_page;
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- },
- patch_order(order_id) {
- this.listLoading = true;
- var param = {
- r: 'qi-juhe/order/patch-order',
- method: 'post',
- order_ids: order_id
- }
- request({
- params: param,
- }).then(e => {
- let self = this;
- if (e.data.code === 0) {
- let html = '';
- e.data.data.error.forEach(function(item, key) {
- html += '<p style="color: red">' + item.msg + '</p>'
- })
- e.data.data.success.forEach(function(item, key) {
- html += '<p style="color: green">' + item.msg + '</p>'
- })
- self.listLoading = false;
- this.$alert(html, '补单结果', {
- dangerouslyUseHTMLString: true,
- confirmButtonText: '确定'
- });
- this.getOrderList();
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.listLoading = false;
- });
- },
- //重置
- resetForm() {
- this.searchData.search_words = '';
- this.searchData.source = '';
- this.searchData.range_type = '';
- this.searchData.range_from = '';
- this.searchData.range_to = '';
- this.searchData.is_free_shipping = '';
- this.searchData.name = '';
- this.searchData.push_status = '';
- this.searchData.order_no = '';
- this.searchData.user_id = '';
- this.searchData.supply_id = '';
- },
- // 限制字数
- stateFormat(str) {
- if (!str) return ''
- let num = 12
- if (str.length > num) {
- return str.slice(0, num) + '...'
- }
- return str
- },
- // 转订单
- changeOrder(row) {
- this.$confirm('确认转普通订单吗,转换后无法补单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- request({
- params: {
- r: 'qi-juhe/order/change-order',
- id: row.id,
- },
- method: 'get',
- }).then(e => {
- if (e.data.code === 0) {
- this.$message.success(e.data.msg)
- setTimeout(() => {
- this.getOrderList();
- }, 1500)
- } else {
- this.$message.error(e.data.msg);
- }
- })
- })
- },
- },
- mounted: function() {
- this.page = getQuery('page') ? getQuery('page') : 1;
- this.getSupply();
- this.getOrderList();
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- /* .table-info .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- } */
- .input-item {
- display: inline-block;
- width: 150px;
- margin: 0 0 20px;
- margin-right: 10px;
- }
- .input-item .el-input__inner {
- border-right: 1px solid #dcdfe6;
- }
- .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;
- }
- .select {
- float: left;
- width: 100px;
- margin-right: 10px;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .search-sort {
- display: inline-block;
- margin: 0px 10px;
- cursor: pointer;
- color: rgb(51, 51, 51);
- }
- .caret-wrapper {
- display: inline-flex;
- flex-direction: column;
- align-items: center;
- height: 25px;
- width: 11px;
- vertical-align: middle;
- cursor: pointer;
- overflow: initial;
- position: relative;
- }
- .caret-top {
- border: 5px solid transparent;
- margin: 1px 0;
- border-bottom-color: rgb(51, 51, 51);
- }
- .caret-bottom {
- border: 5px solid transparent;
- margin: 1px 0;
- border-top-color: rgb(51, 51, 51);
- }
- .active {
- border-top-color: rgb(41, 186, 156);
- }
- .ellipsis {
- font-size: 12px;
- color: #333;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .goods-wrapper {
- border: 2px solid #CCCCCC;
- display: inline-block
- }
- .goods-select {
- border: 2px solid #bb730c;
- }
- .goods-price {
- text-align: center;
- }
- .goods-price .number {
- color: red;
- font-weight: 600;
- font-size: 18px;
- }
- .goods-price .title {
- padding: 5px 0;
- color: #999;
- ;
- font-size: 10px;
- font-weight: 600;
- }
- .bottom-price .title {
- padding: 5px 0;
- color: #8b8888;
- ;
- font-size: 10px;
- }
- .bottom-price .number {
- color: #ff5100;
- font-size: 10px;
- }
- .goods-action {
- margin-top: 8px;
- }
- .goods-action .title {
- color: #0634aa;
- }
- .bottom-active {
- border-bottom-color: rgb(186, 41, 92);
- }
- .top-active {
- border-top-color: rgb(186, 41, 92);
- }
- .price {
- white-space: nowrap;
- }
- .goods-image {
- display: flex;
- justify-content: center;
- }
- .page {
- padding: 10px 0;
- }
- </style>
|