mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
commit
a420ea0a6d
@ -1 +1 @@
|
|||||||
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a[data-v-9f160e6c]{text-decoration:none;color:#fff}.opaBox[data-v-9f160e6c]{margin-bottom:15px}
|
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a[data-v-d25d9320]{text-decoration:none;color:#fff}.opaBox[data-v-d25d9320]{margin-bottom:15px}
|
||||||
2
public/dist/index.html
vendored
2
public/dist/index.html
vendored
@ -1 +1 @@
|
|||||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.f1ce3c3c.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.10acb235.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||||
File diff suppressed because one or more lines are too long
1
public/dist/js/147.34297e9a.js.map
vendored
Normal file
1
public/dist/js/147.34297e9a.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/147.53e38aa6.js.map
vendored
1
public/dist/js/147.53e38aa6.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/19.39213a6d.js
vendored
Normal file
2
public/dist/js/19.39213a6d.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/19.39213a6d.js.map
vendored
Normal file
1
public/dist/js/19.39213a6d.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/298.143f4f4b.js.map
vendored
1
public/dist/js/298.143f4f4b.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/dist/js/298.c971cd33.js.map
vendored
Normal file
1
public/dist/js/298.c971cd33.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/463.09656921.js
vendored
Normal file
2
public/dist/js/463.09656921.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/463.09656921.js.map
vendored
Normal file
1
public/dist/js/463.09656921.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/613.5a7f6161.js
vendored
2
public/dist/js/613.5a7f6161.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/613.5a7f6161.js.map
vendored
1
public/dist/js/613.5a7f6161.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/dist/js/64.2db5913e.js.map
vendored
Normal file
1
public/dist/js/64.2db5913e.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/64.7efc004a.js.map
vendored
1
public/dist/js/64.7efc004a.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/808.eabeec45.js
vendored
2
public/dist/js/808.eabeec45.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/808.eabeec45.js.map
vendored
1
public/dist/js/808.eabeec45.js.map
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/999.1bc20d27.js.map
vendored
1
public/dist/js/999.1bc20d27.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/dist/js/999.7767bffa.js.map
vendored
Normal file
1
public/dist/js/999.7767bffa.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/app.10acb235.js
vendored
Normal file
2
public/dist/js/app.10acb235.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/dist/js/app.f1ce3c3c.js
vendored
2
public/dist/js/app.f1ce3c3c.js
vendored
File diff suppressed because one or more lines are too long
8
resources/frontend/src/api/plat.js
vendored
8
resources/frontend/src/api/plat.js
vendored
@ -96,3 +96,11 @@ export function exportAfterOrder(params) {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getPrintInfo(params) {
|
||||||
|
return http({
|
||||||
|
url: "/api/print/orders",
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
16
resources/frontend/src/api/shop.js
vendored
16
resources/frontend/src/api/shop.js
vendored
@ -82,3 +82,19 @@ export function orderRest(params) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function shopAddress(params) {
|
||||||
|
return http({
|
||||||
|
url: "/api/shop_sends",
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateShopAddress(params) {
|
||||||
|
return http({
|
||||||
|
url: '/api/shop_sends',
|
||||||
|
method: 'post',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
174
resources/frontend/src/components/shop/address.vue
Normal file
174
resources/frontend/src/components/shop/address.vue
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog :visible.sync="showVisible" title="地址管理" width="900px" @close="closeDialog">
|
||||||
|
<div style="margin-bottom: 20px;"><el-button type="primary" @click="addPrintAddr()">添加地址</el-button></div>
|
||||||
|
<div>
|
||||||
|
<el-table :data="addrList" border style="width: 100%;height: auto;" v-loading="loading">
|
||||||
|
<el-table-column prop="id" label="ID" align="center" width="70"/>
|
||||||
|
<el-table-column prop="name" label="姓名" align="center" width="100"/>
|
||||||
|
<el-table-column prop="mobile" label="联系方式" align="center" width="120"/>
|
||||||
|
<el-table-column label="详细地址">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.province }}{{ scope.row.city }}{{ scope.row.district }}{{ scope.row.detail }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="editPrintAddr(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="printVisible" :title="curAddrId ? '编辑地址' : '新增地址'" width="500px">
|
||||||
|
<el-form label-width="100px">
|
||||||
|
<el-form-item label="姓名:">
|
||||||
|
<el-input v-model="printForm.name" type="input" placeholder="请输入姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话:">
|
||||||
|
<el-input v-model="printForm.mobile" type="input" placeholder="请输入联系电话" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="省:">
|
||||||
|
<el-input v-model="printForm.province" type="input" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="市:">
|
||||||
|
<el-input v-model="printForm.city" type="input" placeholder="请输入号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区:">
|
||||||
|
<el-input v-model="printForm.district" type="input" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="详细地址:">
|
||||||
|
<el-input v-model="printForm.detail" type="input" placeholder="街道-小区-门牌号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序:">
|
||||||
|
<el-input v-model="printForm.sort" type="number" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="printVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="commitPrintAddr()" :loading="btnLoading">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { shopAddress, updateShopAddress } from "@/api/shop"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
default: () => {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
btnLoading: false,
|
||||||
|
showVisible: false,
|
||||||
|
addrList: [],
|
||||||
|
curAddrId: '',
|
||||||
|
loading: false,
|
||||||
|
|
||||||
|
printForm: {},
|
||||||
|
printVisible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getAddrList() {
|
||||||
|
this.loading = true
|
||||||
|
let params = {
|
||||||
|
shop_id: this.id,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
}
|
||||||
|
shopAddress(params).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
this.addrList = res.data.data
|
||||||
|
this.loading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addPrintAddr() {
|
||||||
|
this.curAddrId = ''
|
||||||
|
this.printForm = {}
|
||||||
|
this.printVisible = true
|
||||||
|
},
|
||||||
|
commitPrintAddr(){
|
||||||
|
if(!this.printForm.name) {
|
||||||
|
ElMessage({ type: 'warning', message: '请输入姓名' })
|
||||||
|
return
|
||||||
|
} else if(!this.printForm.mobile) {
|
||||||
|
ElMessage({ type: 'warning', message: '请输入联系电话' })
|
||||||
|
return
|
||||||
|
} else if(!this.printForm.province || !this.printForm.city || !this.printForm.district || !this.printForm.detail) {
|
||||||
|
ElMessage({ type: 'warning', message: '请输入地址信息' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.btnLoading = true
|
||||||
|
let params = {
|
||||||
|
...this.printForm
|
||||||
|
}
|
||||||
|
if(this.curAddrId) {
|
||||||
|
params.id = this.curAddrId
|
||||||
|
updateShopAddress(params).then((res) => {
|
||||||
|
this.$message({ type: 'success', message: '编辑成功' })
|
||||||
|
this.printVisible = false
|
||||||
|
this.getAddrList()
|
||||||
|
this.btnLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.btnLoading = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
updateShopAddress(params).then((res) => {
|
||||||
|
this.$message({ type: 'success', message: '添加成功' })
|
||||||
|
this.printVisible = false
|
||||||
|
this.getAddrList()
|
||||||
|
this.btnLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.btnLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
editPrintAddr(row) {
|
||||||
|
this.curAddrId = row.id
|
||||||
|
this.printForm = JSON.parse(JSON.stringify(row))
|
||||||
|
this.printVisible = true
|
||||||
|
},
|
||||||
|
closeDialog() {
|
||||||
|
this.showVisible = false
|
||||||
|
this.$emit('close')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show: {
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.showVisible = true
|
||||||
|
this.addrList = []
|
||||||
|
this.printList = []
|
||||||
|
this.getAddrList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
489
resources/frontend/src/views/plat/orderList - 副本.vue
Normal file
489
resources/frontend/src/views/plat/orderList - 副本.vue
Normal file
@ -0,0 +1,489 @@
|
|||||||
|
<template>
|
||||||
|
<div class="conent">
|
||||||
|
<el-card>
|
||||||
|
<el-form ref="form" :inline="true" label-width="90px">
|
||||||
|
<el-form-item label="所属店铺:">
|
||||||
|
<el-select v-model="filter.shop_id" placeholder="店铺" @change="handleChoose()">
|
||||||
|
<el-option v-for="item in shopsList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="发货状态:">
|
||||||
|
<el-select v-model="filter.shipping_status" placeholder="发货状态" @change="handleChoose()">
|
||||||
|
<el-option value="" label="全部"></el-option>
|
||||||
|
<el-option value="0" label="未发货"></el-option>
|
||||||
|
<el-option value="2" label="部分发货"></el-option>
|
||||||
|
<el-option value="1" label="已发货"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="订单类型:">
|
||||||
|
<el-select v-model="filter.is_supplier" placeholder="订单类型" @change="handleChoose()">
|
||||||
|
<el-option value="" label="全部订单"></el-option>
|
||||||
|
<el-option :value="1" label="自卖团订单"></el-option>
|
||||||
|
<el-option :value="0" label="帮卖团订单"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="订单状态:">
|
||||||
|
<el-select v-model="filter.cancel_status" placeholder="订单状态" @change="handleChoose()">
|
||||||
|
<el-option value="" label="全部"></el-option>
|
||||||
|
<el-option :value="0" label="未取消"></el-option>
|
||||||
|
<el-option :value="1" label="已取消"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="售后状态:">
|
||||||
|
<el-select v-model="filter.after_sales_status" placeholder="售后状态" @change="handleChoose()">
|
||||||
|
<el-option value="" label="全部"></el-option>
|
||||||
|
<el-option :value="0" label="未售后"></el-option>
|
||||||
|
<el-option :value="1" label="有售后"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="商品数量:">
|
||||||
|
<el-select v-model="filter.goods_sku_num" placeholder="商品数量" @change="handleChoose()">
|
||||||
|
<el-option value="" label="全部"></el-option>
|
||||||
|
<el-option :value="1" label="1个商品"></el-option>
|
||||||
|
<el-option :value="2" label="2-5个商品"></el-option>
|
||||||
|
<el-option :value="6" label="6个以上商品"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="订单商品:">
|
||||||
|
<el-select v-model="filter.external_sku_ids" multiple filterable remote reserve-keyword placeholder="订单商品"
|
||||||
|
:remote-method="remoteMethod" :loading="searchLoading">
|
||||||
|
<el-option v-for="item in options" :key="item.external_sku_id" :label="item.title"
|
||||||
|
:value="item.external_sku_id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="下单时间:">
|
||||||
|
<el-date-picker v-model="confirmAt" type="datetimerange" range-separator="-" start-placeholder="起"
|
||||||
|
end-placeholder="止" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" @change="handleChoose()">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="跟团号:">
|
||||||
|
<el-input v-model="filter.pno" placeholder="跟团号" @keyup.enter.native="handleChoose"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
||||||
|
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||||
|
<el-button type="primary" @click="openPrint">打印</el-button>
|
||||||
|
<!-- <el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button> -->
|
||||||
|
<el-button type="warning" :loading="exportLoading" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
<el-table v-loading="loading" ref="multipleTable" :data="orderList" style="width: 100%" border
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="店铺名称" prop="shop.name" />
|
||||||
|
<el-table-column label="跟团号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.is_supplier ? '自卖团: ' : '帮卖团: ' }}
|
||||||
|
{{ scope.row.is_supplier ? scope.row.participate_no : scope.row.supply_participate_no }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="收件人信息" width="240">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p>{{ scope.row.receiver_name }} {{ scope.row.receiver_mobile }}</p>
|
||||||
|
<p>{{ scope.row.receiver_address_province }}/{{ scope.row.receiver_address_city }}/{{
|
||||||
|
scope.row.receiver_address_district }}</p>
|
||||||
|
<p>{{ scope.row.receiver_address_detail }}</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="shipping_status" label="发货状态" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="cancel_status" label="订单状态" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="after_sales_status" label="售后状态" align="center"></el-table-column>
|
||||||
|
<el-table-column label="商品信息" width="380">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-for="item in scope.row.items" :key="item.id">
|
||||||
|
{{ item.goods_name }}
|
||||||
|
<span style="color: red;">+{{ item.goods_number }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="confirm_at" label="下单时间" width="150" align="center"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div class="page-pagination">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="page"
|
||||||
|
:page-sizes="[10, 50, 100]"
|
||||||
|
:page-size="per_page"
|
||||||
|
layout="prev, pager, next, sizes, jumper, total"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { platOrderList, printOrders, printSuccess, exportOrder } from "@/api/plat";
|
||||||
|
import { storeList } from "@/api/shop"
|
||||||
|
import { goodsSkusList } from "@/api/goods"
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filter: {
|
||||||
|
shop_id: '',
|
||||||
|
shipping_status: '',
|
||||||
|
is_supplier: '',
|
||||||
|
cancel_status: 0,
|
||||||
|
after_sales_status: 0,
|
||||||
|
goods_sku_num: '',
|
||||||
|
external_sku_ids: '',
|
||||||
|
pno: ''
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
searchLoading: false,
|
||||||
|
options: [],
|
||||||
|
orderList: [],
|
||||||
|
total: 0,
|
||||||
|
page: 1, //当前页
|
||||||
|
per_page: 10, //每页显示数量
|
||||||
|
shopsList: [],
|
||||||
|
confirmAt: [],
|
||||||
|
print_order_ids: '',
|
||||||
|
print_documents: [],
|
||||||
|
socket: null,
|
||||||
|
lockReconnect: false, //是否真正建立连接
|
||||||
|
timeout: 58 * 1000, //58秒一次心跳
|
||||||
|
timeoutObj: null, //心跳心跳倒计时
|
||||||
|
serverTimeoutObj: null, //心跳倒计时
|
||||||
|
timeoutnum: null, //断开 重连倒计时
|
||||||
|
defaultPrinter: null,
|
||||||
|
taskIDArray: [],
|
||||||
|
requestIDGetGlobalConfig: '',
|
||||||
|
exportLoading: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let start = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
let end = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
this.confirmAt = [start, end]
|
||||||
|
this.getOrderList()
|
||||||
|
this.getShopsList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getOrderList() {
|
||||||
|
this.loading = true
|
||||||
|
let params = {
|
||||||
|
...this.filter,
|
||||||
|
page: this.page,
|
||||||
|
per_page: this.per_page,
|
||||||
|
confirm_at_start: this.confirmAt ? this.confirmAt[0] : '',
|
||||||
|
confirm_at_end: this.confirmAt ? this.confirmAt[1] : ''
|
||||||
|
}
|
||||||
|
platOrderList(params).then((res) => {
|
||||||
|
this.orderList = res.data.data
|
||||||
|
this.total = res.data.meta.total
|
||||||
|
this.loading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopsList() {
|
||||||
|
let params = {
|
||||||
|
page: 0,
|
||||||
|
per_page: 99
|
||||||
|
}
|
||||||
|
storeList(params).then((res) => {
|
||||||
|
this.shopsList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.page = 1
|
||||||
|
this.per_page = val
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.page = val
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
|
handleChoose() {
|
||||||
|
this.page = 1
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
|
handleReChoose() {
|
||||||
|
this.filter = {
|
||||||
|
shop_id: '',
|
||||||
|
shipping_status: '',
|
||||||
|
is_supplier: '',
|
||||||
|
cancel_status: 0,
|
||||||
|
after_sales_status: 0,
|
||||||
|
goods_sku_num: '',
|
||||||
|
external_sku_ids: '',
|
||||||
|
pno: ''
|
||||||
|
}
|
||||||
|
this.page = 1
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
|
remoteMethod(query) {
|
||||||
|
if (query !== '') {
|
||||||
|
this.searchLoading = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.searchLoading = false;
|
||||||
|
goodsSkusList(query).then((res) => {
|
||||||
|
this.options = res.data.filter(item => {
|
||||||
|
return item.title.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, 200);
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
print() {
|
||||||
|
const print_loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: 'Loading',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
});
|
||||||
|
printOrders(this.filter).then((res) => {
|
||||||
|
this.print_documents = res.data.documents;
|
||||||
|
this.print_order_ids = res.data.order_ids;
|
||||||
|
print_loading.close();
|
||||||
|
this.doPrint();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
let ids = []
|
||||||
|
val.forEach((item) => {
|
||||||
|
ids.push(item.id)
|
||||||
|
})
|
||||||
|
this.filter.ids = ids
|
||||||
|
},
|
||||||
|
initWebSocket() {
|
||||||
|
//初始化weosocket
|
||||||
|
const wsuri = "ws://127.0.0.1:5000";
|
||||||
|
this.socket = new WebSocket(wsuri);
|
||||||
|
// 客户端接收服务端数据时触发
|
||||||
|
this.socket.onmessage = this.websocketonmessage;
|
||||||
|
// 连接建立时触发
|
||||||
|
this.socket.onopen = this.websocketonopen;
|
||||||
|
// 通信发生错误时触发
|
||||||
|
this.socket.onerror = this.websocketonerror;
|
||||||
|
// 连接关闭时触发
|
||||||
|
this.socket.onclose = this.websocketclose;
|
||||||
|
},
|
||||||
|
// 连接建立时触发
|
||||||
|
websocketonopen() {
|
||||||
|
//开启心跳
|
||||||
|
this.start();
|
||||||
|
if (this.socket.readyState === 1) {
|
||||||
|
// 获取打印机列表
|
||||||
|
this.getPrinters();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
start() {
|
||||||
|
//开启心跳
|
||||||
|
console.log("开启心跳");
|
||||||
|
var self = this;
|
||||||
|
self.timeoutObj && clearTimeout(self.timeoutObj);
|
||||||
|
self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj);
|
||||||
|
self.timeoutObj = setTimeout(function () {
|
||||||
|
//这里发送一个心跳,后端收到后,返回一个心跳消息,
|
||||||
|
if (self.socket.readyState == 1) {
|
||||||
|
//如果连接正常
|
||||||
|
} else {
|
||||||
|
//否则重连
|
||||||
|
self.reconnect();
|
||||||
|
}
|
||||||
|
self.serverTimeoutObj = setTimeout(function () {
|
||||||
|
//超时关闭
|
||||||
|
self.socket.close();
|
||||||
|
}, self.timeout);
|
||||||
|
}, self.timeout);
|
||||||
|
},
|
||||||
|
reconnect() {
|
||||||
|
//重新连接
|
||||||
|
var that = this;
|
||||||
|
if (that.lockReconnect) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
that.lockReconnect = true;
|
||||||
|
//没连接上会一直重连,设置延迟避免请求过多
|
||||||
|
that.timeoutnum && clearTimeout(that.timeoutnum);
|
||||||
|
that.timeoutnum = setTimeout(function () {
|
||||||
|
//新连接
|
||||||
|
that.initWebSocket();
|
||||||
|
that.lockReconnect = false;
|
||||||
|
}, 5000);
|
||||||
|
},
|
||||||
|
// 通信发生错误时触发
|
||||||
|
websocketonerror() {
|
||||||
|
console.log("出现错误");
|
||||||
|
this.reconnect();
|
||||||
|
},
|
||||||
|
// 客户端接收服务端数据时触发
|
||||||
|
websocketonmessage(e) {
|
||||||
|
console.log(e);
|
||||||
|
if (JSON.parse(e.data).printers !== undefined) {
|
||||||
|
this.defaultPrinter = JSON.parse(e.data).defaultPrinter;
|
||||||
|
}
|
||||||
|
// JSON.parse 用来解析JSON字符串
|
||||||
|
console.log("默认打印机" + this.defaultPrinter)
|
||||||
|
|
||||||
|
if (JSON.parse(e.data).status === 'success') {
|
||||||
|
console.log("打印就绪..")
|
||||||
|
}
|
||||||
|
if (JSON.parse(e.data).status === 'failed') {
|
||||||
|
console.log("打印未就绪..")
|
||||||
|
}
|
||||||
|
if (JSON.parse(e.data).taskStatus === 'printed') {
|
||||||
|
console.log('出纸成功--打印成功')
|
||||||
|
// 打印成功回调
|
||||||
|
printSuccess({ order_ids: this.print_order_ids }).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (JSON.parse(e.data).taskStatus === 'failed') {
|
||||||
|
console.log("打印失败!")
|
||||||
|
}
|
||||||
|
if (JSON.parse(e.data).taskStatus === 'canceled') {
|
||||||
|
console.log("打印取消!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//收到服务器信息,心跳重置
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
//重置心跳
|
||||||
|
var that = this;
|
||||||
|
//清除时间
|
||||||
|
clearTimeout(that.timeoutObj);
|
||||||
|
clearTimeout(that.serverTimeoutObj);
|
||||||
|
//重启心跳
|
||||||
|
that.start();
|
||||||
|
},
|
||||||
|
websocketsend(Data) {
|
||||||
|
//数据发送
|
||||||
|
this.socket.send(Data);
|
||||||
|
},
|
||||||
|
// 连接关闭时触发
|
||||||
|
websocketclose(e) {
|
||||||
|
//关闭
|
||||||
|
console.log("断开连接", e);
|
||||||
|
//重连
|
||||||
|
this.reconnect();
|
||||||
|
},
|
||||||
|
getPrinters() {
|
||||||
|
var request = this.getRequestObject("getPrinters");
|
||||||
|
this.websocketsend(JSON.stringify(request));
|
||||||
|
},
|
||||||
|
doPrint() {
|
||||||
|
var request = this.getRequestObject("print");
|
||||||
|
request.task = new Object();
|
||||||
|
request.task.taskID = this.getUUID(8, 10);
|
||||||
|
// 把每次打印的任务 taskID 保存到 taskIDArray 数组
|
||||||
|
this.taskIDArray.push(request.task.taskID)
|
||||||
|
// 记录当前打印请求的ID
|
||||||
|
this.requestIDGetGlobalConfig = request.task.taskID
|
||||||
|
request.task.preview = false;
|
||||||
|
request.task.printer = this.defaultPrinter;
|
||||||
|
request.task.documents = this.print_documents;
|
||||||
|
console.log(request.task.documents)
|
||||||
|
|
||||||
|
this.websocketsend(JSON.stringify(request));
|
||||||
|
},
|
||||||
|
getRequestObject(cmd) {
|
||||||
|
var request = new Object();
|
||||||
|
// 必须:请求的ID,用于唯一标识每个请求,每个客户端保证生成唯一的ID
|
||||||
|
request.requestID = this.getUUID(8, 16);
|
||||||
|
//必须: 协议当前版本
|
||||||
|
request.version = "1.0";
|
||||||
|
//必须: 请求命令名称
|
||||||
|
request.cmd = cmd;
|
||||||
|
|
||||||
|
return request;
|
||||||
|
},
|
||||||
|
getUUID(len, radix) {
|
||||||
|
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
||||||
|
var uuid = [], i;
|
||||||
|
radix = radix || chars.length;
|
||||||
|
if (len) {
|
||||||
|
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
|
||||||
|
} else {
|
||||||
|
var r;
|
||||||
|
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
||||||
|
uuid[14] = '4';
|
||||||
|
for (i = 0; i < 36; i++) {
|
||||||
|
if (!uuid[i]) {
|
||||||
|
r = 0 | Math.random() * 16;
|
||||||
|
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return uuid.join('');
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
this.exportLoading = true
|
||||||
|
let params = {
|
||||||
|
...this.form,
|
||||||
|
page: 1,
|
||||||
|
per_page: this.per_page,
|
||||||
|
confirm_at_start: this.confirmAt[0] ? this.confirmAt[0] : '',
|
||||||
|
confirm_at_end: this.confirmAt[1] ? this.confirmAt[1] : '',
|
||||||
|
is_export: 1
|
||||||
|
}
|
||||||
|
// window.open("/api/plat_orders?" + this.objectToQueryString(params))
|
||||||
|
|
||||||
|
exportOrder(params).then((res) => {
|
||||||
|
this.downLoadXls(res.data)
|
||||||
|
this.$message({ type: 'success', message: '导出成功!' })
|
||||||
|
this.exportLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.exportLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
downLoadXls(response) {
|
||||||
|
const content = response
|
||||||
|
const blob = new Blob([content])
|
||||||
|
const today = new Date().toLocaleDateString()
|
||||||
|
const fileName = `订单列表${today}.xlsx`
|
||||||
|
if ('download' in document.createElement('a')) {
|
||||||
|
// 非IE下载
|
||||||
|
const elink = document.createElement('a')
|
||||||
|
elink.download = fileName
|
||||||
|
elink.style.display = 'none'
|
||||||
|
elink.href = URL.createObjectURL(blob)
|
||||||
|
document.body.appendChild(elink)
|
||||||
|
elink.click()
|
||||||
|
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
||||||
|
document.body.removeChild(elink)
|
||||||
|
} else {
|
||||||
|
// IE10+下载
|
||||||
|
navigator.msSaveBlob(blob, fileName)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
objectToQueryString(obj) {
|
||||||
|
return Object.keys(obj)
|
||||||
|
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
||||||
|
.join('&');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -18,6 +18,10 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="订单ID:">
|
||||||
|
<el-input v-model="filter.id" placeholder="订单编号" @keyup.enter.native="handleChoose"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="订单类型:">
|
<el-form-item label="订单类型:">
|
||||||
<el-select v-model="filter.is_supplier" placeholder="订单类型" @change="handleChoose()">
|
<el-select v-model="filter.is_supplier" placeholder="订单类型" @change="handleChoose()">
|
||||||
<el-option value="" label="全部订单"></el-option>
|
<el-option value="" label="全部订单"></el-option>
|
||||||
@ -60,20 +64,31 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="下单时间:">
|
<el-form-item label="商品编码:">
|
||||||
<el-date-picker v-model="confirmAt" type="datetimerange" range-separator="-" start-placeholder="起"
|
<el-input v-model="filter.external_sku_id" placeholder="商品编码" @keyup.enter.native="handleChoose"></el-input>
|
||||||
end-placeholder="止" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" @change="handleChoose()">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="跟团号:">
|
<el-form-item label="跟团号:">
|
||||||
<el-input v-model="filter.pno" placeholder="跟团号" @keyup.enter.native="handleChoose"></el-input>
|
<el-input v-model="filter.pno" placeholder="跟团号" @keyup.enter.native="handleChoose"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="打印状态:">
|
||||||
|
<el-select v-model="filter.print_status" placeholder="请选择" @change="handleChoose()" clearable>
|
||||||
|
<el-option :value="1" label="已打印"></el-option>
|
||||||
|
<el-option :value="0" label="未打印"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="下单时间:">
|
||||||
|
<el-date-picker v-model="confirmAt" type="datetimerange" range-separator="-" start-placeholder="起"
|
||||||
|
end-placeholder="止" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" @change="handleChoose()">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
||||||
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||||
<el-button type="primary" @click="print">打印</el-button>
|
<el-button type="primary" @click="openPrint">打印</el-button>
|
||||||
<!-- <el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button> -->
|
<!-- <el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button> -->
|
||||||
<el-button type="warning" :loading="exportLoading" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
<el-button type="warning" :loading="exportLoading" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -83,7 +98,8 @@
|
|||||||
<el-card style="margin-top: 10px">
|
<el-card style="margin-top: 10px">
|
||||||
<el-table v-loading="loading" ref="multipleTable" :data="orderList" style="width: 100%" border
|
<el-table v-loading="loading" ref="multipleTable" :data="orderList" style="width: 100%" border
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" :selectable="selectable" />
|
||||||
|
<el-table-column label="订单ID" prop="id" width="80" align="center" />
|
||||||
<el-table-column label="店铺名称" prop="shop.name" />
|
<el-table-column label="店铺名称" prop="shop.name" />
|
||||||
<el-table-column label="跟团号" align="center">
|
<el-table-column label="跟团号" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -103,7 +119,7 @@
|
|||||||
<el-table-column prop="shipping_status" label="发货状态" align="center"></el-table-column>
|
<el-table-column prop="shipping_status" label="发货状态" align="center"></el-table-column>
|
||||||
<el-table-column prop="cancel_status" label="订单状态" align="center"></el-table-column>
|
<el-table-column prop="cancel_status" label="订单状态" align="center"></el-table-column>
|
||||||
<el-table-column prop="after_sales_status" label="售后状态" align="center"></el-table-column>
|
<el-table-column prop="after_sales_status" label="售后状态" align="center"></el-table-column>
|
||||||
<el-table-column label="商品信息" width="380">
|
<el-table-column label="商品信息" min-width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="item in scope.row.items" :key="item.id">
|
<div v-for="item in scope.row.items" :key="item.id">
|
||||||
{{ item.goods_name }}
|
{{ item.goods_name }}
|
||||||
@ -111,6 +127,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="面单信息" min-width="100" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-if="scope.row.waybill">
|
||||||
|
<el-tag type="info" v-if="scope.row.waybill.status == 0">待申请运单</el-tag>
|
||||||
|
<el-tag type="primary" v-else-if="scope.row.waybill.status == 1">已申请运单</el-tag>
|
||||||
|
<el-tag type="warning" v-else-if="scope.row.waybill.status == 2">待打印</el-tag>
|
||||||
|
<el-tag type="success" v-else-if="scope.row.waybill.status == 3">打印成功</el-tag>
|
||||||
|
<div style="line-height: 16px;margin-top: 10px;">运单号:{{ scope.row.waybill.waybill_code }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="打印状态" align="center" width="110">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.print_status == 1" style="color: rgb(4, 190, 2);">已打印</span>
|
||||||
|
<span v-else>未打印</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="confirm_at" label="下单时间" width="150" align="center"></el-table-column>
|
<el-table-column prop="confirm_at" label="下单时间" width="150" align="center"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
@ -119,18 +152,66 @@
|
|||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:current-page="page"
|
:current-page="page"
|
||||||
:page-sizes="[10, 50, 100]"
|
:page-sizes="[10, 50, 100, 500]"
|
||||||
:page-size="per_page"
|
:page-size="per_page"
|
||||||
layout="prev, pager, next, sizes, jumper, total"
|
layout="prev, pager, next, sizes, jumper, total"
|
||||||
:total="total">
|
:total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog title="发货信息" width="960px" :visible.sync="showPrint" :close-on-click-modal="false" @close="closePrint">
|
||||||
|
<div v-if="connectStatus == 1" style="margin: -20px 0 20px;">
|
||||||
|
<el-alert title="已建立连接" type="success" show-icon></el-alert>
|
||||||
|
</div>
|
||||||
|
<el-table :data="tempList" style="width: 100%" border>
|
||||||
|
<el-table-column label="订单ID" prop="id" width="80" align="center" />
|
||||||
|
<el-table-column label="收件人信息" width="240">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p>{{ scope.row.receiver_name }} {{ scope.row.receiver_mobile }}</p>
|
||||||
|
<p>{{ scope.row.receiver_address_province }}/{{ scope.row.receiver_address_city }}/{{
|
||||||
|
scope.row.receiver_address_district }}</p>
|
||||||
|
<p>{{ scope.row.receiver_address_detail }}</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="shipping_status" label="发货状态" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="cancel_status" label="订单状态" align="center"></el-table-column>
|
||||||
|
<el-table-column label="商品信息" width="220">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-for="item in scope.row.items" :key="item.id">
|
||||||
|
{{ item.goods_name }}
|
||||||
|
<span style="color: red;">+{{ item.goods_number }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="打印状态" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.print_status == 0 || !scope.row.print_status">等待打印</span>
|
||||||
|
<span v-else-if="scope.row.print_status == 1" style="color: rgb(4, 190, 2);">打印成功</span>
|
||||||
|
<div v-else-if="scope.row.print_status == 2">
|
||||||
|
<div style="color: #f00;">打印失败</div>
|
||||||
|
<span style="font-size: 12px;color: #777;">{{ scope.row.fail_msg }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-form label-width="80px" style="margin-top: 20px;">
|
||||||
|
<el-form-item label="打印机:">
|
||||||
|
<el-select v-model="printName" placeholder="请选择打印机">
|
||||||
|
<el-option v-for="(item, i) in printsList" :key="i" :label="item" :value="item"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button plain @click="showPrint = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="toPrint()" :loading="loading1">保存</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { platOrderList, printOrders, printSuccess, exportOrder } from "@/api/plat";
|
import { platOrderList, printOrders, getPrintInfo, exportOrder, printSuccess } from "@/api/plat";
|
||||||
import { storeList } from "@/api/shop"
|
import { storeList } from "@/api/shop"
|
||||||
import { goodsSkusList } from "@/api/goods"
|
import { goodsSkusList } from "@/api/goods"
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
@ -146,7 +227,8 @@ export default {
|
|||||||
after_sales_status: 0,
|
after_sales_status: 0,
|
||||||
goods_sku_num: '',
|
goods_sku_num: '',
|
||||||
external_sku_ids: '',
|
external_sku_ids: '',
|
||||||
pno: ''
|
pno: '',
|
||||||
|
external_sku_id: ''
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
searchLoading: false,
|
searchLoading: false,
|
||||||
@ -168,15 +250,23 @@ export default {
|
|||||||
defaultPrinter: null,
|
defaultPrinter: null,
|
||||||
taskIDArray: [],
|
taskIDArray: [],
|
||||||
requestIDGetGlobalConfig: '',
|
requestIDGetGlobalConfig: '',
|
||||||
exportLoading: false
|
exportLoading: false,
|
||||||
|
webSocket: null,
|
||||||
|
chooseList: [],
|
||||||
|
showPrint: false,
|
||||||
|
printName: '',
|
||||||
|
printsList: [],
|
||||||
|
loading1: false,
|
||||||
|
connectStatus: -1,
|
||||||
|
tempList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
let start = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
let start = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
let end = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
let end = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
this.confirmAt = [start, end]
|
this.confirmAt = [start, end]
|
||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
this.getShopsList()
|
this.getShopsList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
@ -261,176 +351,15 @@ export default {
|
|||||||
this.doPrint();
|
this.doPrint();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSelectionChange(val) {
|
selectable(row, index) {
|
||||||
let ids = []
|
if (row.shipping_status == '未发货' && row.cancel_status == '未取消' && row.print_status !== 1) {
|
||||||
val.forEach((item) => {
|
return true
|
||||||
ids.push(item.id)
|
|
||||||
})
|
|
||||||
this.filter.ids = ids
|
|
||||||
},
|
|
||||||
initWebSocket() {
|
|
||||||
//初始化weosocket
|
|
||||||
const wsuri = "ws://127.0.0.1:5000";
|
|
||||||
this.socket = new WebSocket(wsuri);
|
|
||||||
// 客户端接收服务端数据时触发
|
|
||||||
this.socket.onmessage = this.websocketonmessage;
|
|
||||||
// 连接建立时触发
|
|
||||||
this.socket.onopen = this.websocketonopen;
|
|
||||||
// 通信发生错误时触发
|
|
||||||
this.socket.onerror = this.websocketonerror;
|
|
||||||
// 连接关闭时触发
|
|
||||||
this.socket.onclose = this.websocketclose;
|
|
||||||
},
|
|
||||||
// 连接建立时触发
|
|
||||||
websocketonopen() {
|
|
||||||
//开启心跳
|
|
||||||
this.start();
|
|
||||||
if (this.socket.readyState === 1) {
|
|
||||||
// 获取打印机列表
|
|
||||||
this.getPrinters();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
start() {
|
|
||||||
//开启心跳
|
|
||||||
console.log("开启心跳");
|
|
||||||
var self = this;
|
|
||||||
self.timeoutObj && clearTimeout(self.timeoutObj);
|
|
||||||
self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj);
|
|
||||||
self.timeoutObj = setTimeout(function () {
|
|
||||||
//这里发送一个心跳,后端收到后,返回一个心跳消息,
|
|
||||||
if (self.socket.readyState == 1) {
|
|
||||||
//如果连接正常
|
|
||||||
} else {
|
|
||||||
//否则重连
|
|
||||||
self.reconnect();
|
|
||||||
}
|
|
||||||
self.serverTimeoutObj = setTimeout(function () {
|
|
||||||
//超时关闭
|
|
||||||
self.socket.close();
|
|
||||||
}, self.timeout);
|
|
||||||
}, self.timeout);
|
|
||||||
},
|
|
||||||
reconnect() {
|
|
||||||
//重新连接
|
|
||||||
var that = this;
|
|
||||||
if (that.lockReconnect) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
that.lockReconnect = true;
|
|
||||||
//没连接上会一直重连,设置延迟避免请求过多
|
|
||||||
that.timeoutnum && clearTimeout(that.timeoutnum);
|
|
||||||
that.timeoutnum = setTimeout(function () {
|
|
||||||
//新连接
|
|
||||||
that.initWebSocket();
|
|
||||||
that.lockReconnect = false;
|
|
||||||
}, 5000);
|
|
||||||
},
|
|
||||||
// 通信发生错误时触发
|
|
||||||
websocketonerror() {
|
|
||||||
console.log("出现错误");
|
|
||||||
this.reconnect();
|
|
||||||
},
|
|
||||||
// 客户端接收服务端数据时触发
|
|
||||||
websocketonmessage(e) {
|
|
||||||
console.log(e);
|
|
||||||
if (JSON.parse(e.data).printers !== undefined) {
|
|
||||||
this.defaultPrinter = JSON.parse(e.data).defaultPrinter;
|
|
||||||
}
|
|
||||||
// JSON.parse 用来解析JSON字符串
|
|
||||||
console.log("默认打印机" + this.defaultPrinter)
|
|
||||||
|
|
||||||
if (JSON.parse(e.data).status === 'success') {
|
|
||||||
console.log("打印就绪..")
|
|
||||||
}
|
|
||||||
if (JSON.parse(e.data).status === 'failed') {
|
|
||||||
console.log("打印未就绪..")
|
|
||||||
}
|
|
||||||
if (JSON.parse(e.data).taskStatus === 'printed') {
|
|
||||||
console.log('出纸成功--打印成功')
|
|
||||||
// 打印成功回调
|
|
||||||
printSuccess({ order_ids: this.print_order_ids }).then((res) => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (JSON.parse(e.data).taskStatus === 'failed') {
|
|
||||||
console.log("打印失败!")
|
|
||||||
}
|
|
||||||
if (JSON.parse(e.data).taskStatus === 'canceled') {
|
|
||||||
console.log("打印取消!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//收到服务器信息,心跳重置
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
//重置心跳
|
|
||||||
var that = this;
|
|
||||||
//清除时间
|
|
||||||
clearTimeout(that.timeoutObj);
|
|
||||||
clearTimeout(that.serverTimeoutObj);
|
|
||||||
//重启心跳
|
|
||||||
that.start();
|
|
||||||
},
|
|
||||||
websocketsend(Data) {
|
|
||||||
//数据发送
|
|
||||||
this.socket.send(Data);
|
|
||||||
},
|
|
||||||
// 连接关闭时触发
|
|
||||||
websocketclose(e) {
|
|
||||||
//关闭
|
|
||||||
console.log("断开连接", e);
|
|
||||||
//重连
|
|
||||||
this.reconnect();
|
|
||||||
},
|
|
||||||
getPrinters() {
|
|
||||||
var request = this.getRequestObject("getPrinters");
|
|
||||||
this.websocketsend(JSON.stringify(request));
|
|
||||||
},
|
|
||||||
doPrint() {
|
|
||||||
var request = this.getRequestObject("print");
|
|
||||||
request.task = new Object();
|
|
||||||
request.task.taskID = this.getUUID(8, 10);
|
|
||||||
// 把每次打印的任务 taskID 保存到 taskIDArray 数组
|
|
||||||
this.taskIDArray.push(request.task.taskID)
|
|
||||||
// 记录当前打印请求的ID
|
|
||||||
this.requestIDGetGlobalConfig = request.task.taskID
|
|
||||||
request.task.preview = false;
|
|
||||||
request.task.printer = this.defaultPrinter;
|
|
||||||
request.task.documents = this.print_documents;
|
|
||||||
console.log(request.task.documents)
|
|
||||||
|
|
||||||
this.websocketsend(JSON.stringify(request));
|
|
||||||
},
|
|
||||||
getRequestObject(cmd) {
|
|
||||||
var request = new Object();
|
|
||||||
// 必须:请求的ID,用于唯一标识每个请求,每个客户端保证生成唯一的ID
|
|
||||||
request.requestID = this.getUUID(8, 16);
|
|
||||||
//必须: 协议当前版本
|
|
||||||
request.version = "1.0";
|
|
||||||
//必须: 请求命令名称
|
|
||||||
request.cmd = cmd;
|
|
||||||
|
|
||||||
return request;
|
|
||||||
},
|
|
||||||
getUUID(len, radix) {
|
|
||||||
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
||||||
var uuid = [], i;
|
|
||||||
radix = radix || chars.length;
|
|
||||||
if (len) {
|
|
||||||
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
|
|
||||||
} else {
|
} else {
|
||||||
var r;
|
return false
|
||||||
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
|
||||||
uuid[14] = '4';
|
|
||||||
for (i = 0; i < 36; i++) {
|
|
||||||
if (!uuid[i]) {
|
|
||||||
r = 0 | Math.random() * 16;
|
|
||||||
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
return uuid.join('');
|
handleSelectionChange(val) {
|
||||||
|
this.chooseList = val
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.exportLoading = true
|
this.exportLoading = true
|
||||||
@ -476,6 +405,143 @@ export default {
|
|||||||
return Object.keys(obj)
|
return Object.keys(obj)
|
||||||
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
||||||
.join('&');
|
.join('&');
|
||||||
|
},
|
||||||
|
|
||||||
|
// https://open.jdl.com/#/open-business-document/access-guide/157/54222 京东云打印文档
|
||||||
|
initWebSocket() {
|
||||||
|
try {
|
||||||
|
let State = new Array('正在连接', '已建立连接', '正在关闭连接', '已关闭连接')
|
||||||
|
let host = 'ws://localhost:9113'
|
||||||
|
const that = this
|
||||||
|
that.webSocket = new WebSocket(host)
|
||||||
|
that.webSocket.onopen = function() {
|
||||||
|
console.log(that.webSocket)
|
||||||
|
that.connectStatus = that.webSocket.readyState
|
||||||
|
that.getPrintList()
|
||||||
|
}
|
||||||
|
that.webSocket.onmessage = function(msg) {
|
||||||
|
let returnData = msg.data
|
||||||
|
let json = eval('(' + returnData + ')')
|
||||||
|
let content = json.content;
|
||||||
|
if(json.code == '6'){ // 打印机返回消息
|
||||||
|
that.printsList = content.split(',')
|
||||||
|
} else if(json.success == 'true' && json.code == '2'){ // 打印成功
|
||||||
|
console.log('0.0', json)
|
||||||
|
that.getOrderList()
|
||||||
|
if(json.message == 'print success all'){ // 全部打印成功
|
||||||
|
let ids = []
|
||||||
|
that.tempList.forEach((item, index) => {
|
||||||
|
ids.push(item.id)
|
||||||
|
that.$set(that.tempList[index], 'print_status', 1)
|
||||||
|
})
|
||||||
|
let params = {
|
||||||
|
order_ids: ids.join(',')
|
||||||
|
}
|
||||||
|
printSuccess(params)
|
||||||
|
} else if(json.message == 'print success, partly wrong.') { // 部分打印成功
|
||||||
|
for (let i = 0; i < json.detailinfo.errors.length; i++) {
|
||||||
|
const it = json.detailinfo.errors[i]
|
||||||
|
that.$set(that.tempList[it.seq * 1 - 1], 'print_status', 2) // 打印失败
|
||||||
|
that.$set(that.tempList[it.seq * 1 - 1], 'fail_msg', it.msg) // 失败信息
|
||||||
|
}
|
||||||
|
let ids = []
|
||||||
|
that.tempList.forEach((item, index) => {
|
||||||
|
if(!item.fail_msg) {
|
||||||
|
that.$set(that.tempList[index], 'print_status', 1)
|
||||||
|
ids.push(item.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let params = {
|
||||||
|
order_ids: ids.join(',')
|
||||||
|
}
|
||||||
|
printSuccess(params) // 将打印成功的执行特定接口
|
||||||
|
}
|
||||||
|
} else if(json.success == 'true' && json.code == '2') { // 打印失败
|
||||||
|
for (let i = 0; i < json.detailinfo.detail.length; i++) {
|
||||||
|
const it = json.detailinfo.detail[i]
|
||||||
|
that.$set(that.tempList[it.seq * 1 - 1], 'print_status', 2)
|
||||||
|
that.$set(that.tempList[it.seq * 1 - 1], 'fail_msg', it.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
that.webSocket.onclose = function() {
|
||||||
|
that.$message({ type: 'info', message: State[that.webSocket.readyState] })
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
that.$message({ type: 'info', message: '连接失败' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPrintList() {
|
||||||
|
if(this.printsList.length){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//打印机列表
|
||||||
|
var text = "{\"orderType\":\"GET_Printers\",\"pin\":\"用户名\",\"parameters\":{ \"tempUrl\":\"\", \"printName\":\"\", \"printData\":\"\" }}";
|
||||||
|
this.webSocket.send(text)
|
||||||
|
},
|
||||||
|
openPrint() {
|
||||||
|
if(this.chooseList.length) {
|
||||||
|
this.initWebSocket()
|
||||||
|
this.tempList = JSON.parse(JSON.stringify(this.chooseList))
|
||||||
|
this.tempList.forEach((item) => {
|
||||||
|
item.fail_msg = ''
|
||||||
|
})
|
||||||
|
this.showPrint = true
|
||||||
|
} else {
|
||||||
|
this.$message({ type: 'info', message: '请选择需要打印的订单' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toPrint() {
|
||||||
|
if(!this.printName) {
|
||||||
|
this.$message({ type: 'info', message: '请选择打印机' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.loading1 = true
|
||||||
|
let ids = []
|
||||||
|
this.chooseList.forEach((item) => {
|
||||||
|
ids.push(item.id)
|
||||||
|
})
|
||||||
|
let params = {
|
||||||
|
ids: ids.join(',')
|
||||||
|
}
|
||||||
|
getPrintInfo(params).then((res) => {
|
||||||
|
let printObject = res.data.data
|
||||||
|
console.log(printObject)
|
||||||
|
let parameters = {
|
||||||
|
"orderType": "print",
|
||||||
|
"version": "2",
|
||||||
|
"parameters": {
|
||||||
|
"printName": this.printName,
|
||||||
|
"contents": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(let key in printObject) {
|
||||||
|
console.log(key)
|
||||||
|
parameters.parameters.contents.push({
|
||||||
|
"tempUrl": printObject[key].templateUrl,
|
||||||
|
"printData": printObject[key].encryptedData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.webSocket.send(JSON.stringify(parameters))
|
||||||
|
this.loading1 = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading1 = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toPrint1() {
|
||||||
|
let printCmd = 'print'
|
||||||
|
let temp = 'https://template-content.jd.com/template-oss?tempCode=jdkd76x130'
|
||||||
|
let tempUser = ''
|
||||||
|
let printDataUser = ''
|
||||||
|
let printData = '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'
|
||||||
|
let text = "{\"orderType\": \""+ printCmd +"\", \"parameters\": {\"printName\": \""+ this.printName +"\", \"tempUrl\": \""+ temp +"\", \"customTempUrl\": \""+ tempUser +"\", \"customData\": [" + printDataUser +"], \"printData\": [\""+ printData +"\"] } }";
|
||||||
|
this.webSocket.send(text)
|
||||||
|
},
|
||||||
|
closePrint() {
|
||||||
|
this.$refs.multipleTable.clearSelection()
|
||||||
|
this.chooseList = []
|
||||||
|
this.printName = ''
|
||||||
|
this.webSocket.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,28 +18,29 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="操作" width="280">
|
<el-table-column label="操作" width="360">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="danger" v-if="scope.row.status === '未授权'" size="mini"><a :href="scope.row.authUrl"
|
<el-button type="danger" v-if="scope.row.status === '未授权'" size="mini"><a :href="scope.row.authUrl"
|
||||||
target="_blank" rel="noopener noreferrer">授权</a>
|
target="_blank" rel="noopener noreferrer">授权</a>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<div v-if="scope.row.status === '已授权'">
|
<template v-if="scope.row.status === '已授权'">
|
||||||
<el-button type="success" :disabled="true" size="mini">{{ scope.row.status }}</el-button>
|
<el-button type="success" :disabled="true" size="mini">{{ scope.row.status }}</el-button>
|
||||||
<el-button @click="download(scope.row)" size="mini">下载商品</el-button>
|
<el-button @click="download(scope.row)" size="mini">下载商品</el-button>
|
||||||
<el-button type="primary" v-if="scope.row.status === '已授权'" size="mini"
|
<el-button type="primary" v-if="scope.row.status === '已授权'" size="mini"
|
||||||
@click="syncShopStock(scope.row.id)">同步库存</el-button>
|
@click="syncShopStock(scope.row.id)">同步库存</el-button>
|
||||||
</div>
|
</template>
|
||||||
<div v-if="scope.row.status === '重新授权'">
|
<template v-if="scope.row.status === '重新授权'">
|
||||||
<el-button type="danger" target="_blank" size="mini">
|
<el-button type="danger" target="_blank" size="mini">
|
||||||
<a :href="scope.row.authUrl" rel="noopener noreferrer">重新授权</a>
|
<a :href="scope.row.authUrl" rel="noopener noreferrer">重新授权</a>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="download(scope.row)" size="mini">下载商品</el-button>
|
<el-button @click="download(scope.row)" size="mini">下载商品</el-button>
|
||||||
</div>
|
</template>
|
||||||
|
|
||||||
<div v-if="scope.row.status === '无需授权'">
|
<template v-if="scope.row.status === '无需授权'">
|
||||||
<el-button type="success" :disabled="true" size="mini">{{ scope.row.status }}</el-button>
|
<el-button type="info" :disabled="true" size="mini">{{ scope.row.status }}</el-button>
|
||||||
</div>
|
</template>
|
||||||
|
<el-button type="warning" size="mini" @click="openAddr(scope.row.id)">发货地址</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -72,14 +73,22 @@
|
|||||||
<el-button type="primary" @click="addSubmit">确 定</el-button>
|
<el-button type="primary" @click="addSubmit">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<shop-address :show="showAddr" :id="shop_id" @close="showAddr = false"></shop-address>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { shopListId, shopAdd, storeList, downloadGoods, updateStore, syncStoreStock } from "../../api/shop";
|
import { shopListId, shopAdd, storeList, downloadGoods, updateStore, syncStoreStock } from "../../api/shop";
|
||||||
|
import shopAddress from "@/components/shop/address.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { shopAddress },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showAddr: false,
|
||||||
|
shop_id: 0,
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
form: {
|
form: {
|
||||||
name: "",
|
name: "",
|
||||||
@ -98,7 +107,7 @@ export default {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
storeId: [], // 店铺id
|
storeId: [], // 店铺id
|
||||||
loading: true,
|
loading: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
Paginationdata: {}, //分页相关数据
|
Paginationdata: {}, //分页相关数据
|
||||||
current_page: 1, //当前页
|
current_page: 1, //当前页
|
||||||
@ -135,6 +144,7 @@ export default {
|
|||||||
|
|
||||||
// 店铺列表
|
// 店铺列表
|
||||||
getStoreList() {
|
getStoreList() {
|
||||||
|
this.loading = true
|
||||||
let page = {
|
let page = {
|
||||||
page: this.current_page,
|
page: this.current_page,
|
||||||
per_page: this.per_page,
|
per_page: this.per_page,
|
||||||
@ -142,8 +152,11 @@ export default {
|
|||||||
storeList(page).then((res) => {
|
storeList(page).then((res) => {
|
||||||
this.tableData = res.data.data;
|
this.tableData = res.data.data;
|
||||||
this.Paginationdata = res.data.meta;
|
this.Paginationdata = res.data.meta;
|
||||||
});
|
this.loading = false
|
||||||
this.loading = false
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//分页功能
|
//分页功能
|
||||||
@ -167,19 +180,21 @@ export default {
|
|||||||
|
|
||||||
// 下载商品
|
// 下载商品
|
||||||
download(row) {
|
download(row) {
|
||||||
const loading = this.$loading({
|
const Loading = this.$loading({
|
||||||
lock: true,
|
lock: true,
|
||||||
text: row.name + ' 店铺商品下载中...',
|
text: row.name + ' 店铺商品下载中...',
|
||||||
spinner: 'el-icon-loading',
|
spinner: 'el-icon-loading',
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
});
|
});
|
||||||
downloadGoods(row.id).then((res) => {
|
downloadGoods(row.id).then((res) => {
|
||||||
loading.close();
|
Loading.close();
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "success",
|
type: "success",
|
||||||
message: res.data.message,
|
message: res.data.message,
|
||||||
});
|
});
|
||||||
});
|
}).catch(() => {
|
||||||
|
Loading.close()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleCellChange(row) {
|
handleCellChange(row) {
|
||||||
this.$confirm('确认修改成本变动吗?', '提示', {
|
this.$confirm('确认修改成本变动吗?', '提示', {
|
||||||
@ -197,19 +212,25 @@ export default {
|
|||||||
},
|
},
|
||||||
// 同步
|
// 同步
|
||||||
syncShopStock(id) {
|
syncShopStock(id) {
|
||||||
let loading = this.$loading({
|
const Loading = this.$loading({
|
||||||
lock: true,
|
lock: true,
|
||||||
text: '店铺商品库存同步中...',
|
text: '店铺商品库存同步中...',
|
||||||
spinner: 'el-icon-loading',
|
spinner: 'el-icon-loading',
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
});
|
});
|
||||||
syncStoreStock({ shop_id: id }).then((res) => {
|
syncStoreStock({ shop_id: id }).then((res) => {
|
||||||
loading.close();
|
Loading.close()
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: res.data.message
|
message: res.data.message
|
||||||
})
|
})
|
||||||
});
|
}).catch(() => {
|
||||||
|
Loading.close()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openAddr(id) {
|
||||||
|
this.shop_id = id
|
||||||
|
this.showAddr = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user