From 8915f0256b062e88234c10d7573103bc747a16f3 Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Thu, 23 Nov 2023 11:08:41 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=B8=E9=94=80=E4=B8=8E?=
=?UTF-8?q?=E6=89=AB=E7=A0=81=E5=8F=96=E8=B4=A7=E5=8A=9F=E8=83=BD,?=
=?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8E=9F=E6=9C=89=E5=8F=91=E8=B4=A7=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/order.js | 112 +--
src/views/order/index.vue | 1170 ++++++++++++++++++++-------
src/views/order/orderCancellate.vue | 162 ++--
3 files changed, 1061 insertions(+), 383 deletions(-)
diff --git a/src/api/order.js b/src/api/order.js
index f8cc351..d2b505c 100644
--- a/src/api/order.js
+++ b/src/api/order.js
@@ -12,307 +12,315 @@ import request from './request'
/**
* @description 订单 -- 列表
*/
-export function orderListApi(data) {
+export function orderListApi (data) {
return request.get('store/order/lst', data)
}
/**
* @description 订单 -- 表头
*/
-export function chartApi() {
+export function chartApi () {
return request.get('store/order/chart')
}
/**
* @description 订单 -- 卡片
*/
-export function cardListApi(data) {
+export function cardListApi (data) {
return request.get('store/order/title', data)
}
/**
* @description 订单 -- 编辑
*/
-export function orderUpdateApi(id, data) {
+export function orderUpdateApi (id, data) {
return request.post(`store/order/update/${id}`, data)
}
/**
* @description 订单 -- 发货
*/
-export function orderDeliveryApi(id, data) {
+export function orderDeliveryApi (id, data) {
return request.post(`store/order/delivery/${id}`, data)
}
/**
* @description 订单 -- 详情
*/
-export function orderDetailApi(id) {
+export function orderDetailApi (id) {
return request.get(`store/order/detail/${id}`)
}
/**
* @description 订单 -- 子订单
*/
-export function getChildrenOrderApi(id) {
+export function getChildrenOrderApi (id) {
return request.get(`store/order/children/${id}`)
}
/**
* @description 订单 -- 记录
*/
-export function orderLogApi(id, data) {
+export function orderLogApi (id, data) {
return request.get(`store/order/log/${id}`, data)
}
/**
* @description 订单 -- 备注from
*/
-export function orderRemarkApi(id) {
+export function orderRemarkApi (id) {
return request.get(`store/order/remark/${id}/form`)
}
/**
* @description 订单 -- 删除
*/
-export function orderDeleteApi(id) {
+export function orderDeleteApi (id) {
return request.post(`store/order/delete/${id}`)
}
/**
* @description 订单 -- 打印
*/
-export function orderPrintApi(id) {
+export function orderPrintApi (id) {
return request.get(`store/order/printer/${id}`)
}
/**
* @description 退款订单 -- 列表
*/
-export function refundorderListApi(data) {
+export function refundorderListApi (data) {
return request.get('store/refundorder/lst', data)
}
/**
* @description 退款订单 -- 详情
*/
-export function refundorderDetailApi(id) {
+export function refundorderDetailApi (id) {
return request.get(`store/refundorder/detail/${id}`)
}
/**
* @description 退款订单 -- 审核from
*/
-export function refundorderStatusApi(id) {
+export function refundorderStatusApi (id) {
return request.get(`store/refundorder/status/${id}/form`)
}
/**
* @description 退款订单 -- 备注from
*/
-export function refundorderMarkApi(id) {
+export function refundorderMarkApi (id) {
return request.get(`store/refundorder/mark/${id}/form`)
}
/**
* @description 退款订单 -- 记录from
*/
-export function refundorderLogApi(id) {
+export function refundorderLogApi (id) {
return request.get(`store/refundorder/log/${id}`)
}
/**
* @description 退款订单 -- 删除
*/
-export function refundorderDeleteApi(id) {
+export function refundorderDeleteApi (id) {
return request.get(`store/refundorder/delete/${id}`)
}
/**
* @description 退款订单 -- 确认收货
*/
-export function confirmReceiptApi(id) {
+export function confirmReceiptApi (id) {
return request.post(`store/refundorder/refund/${id}`)
}
/**
* @description 获取物流信息
*/
-export function getExpress(id) {
+export function getExpress (id) {
return request.get(`store/order/express/${id}`)
}
/**
* @description 退款单获取物流信息
*/
-export function refundorderExpressApi(id) {
+export function refundorderExpressApi (id) {
return request.get(`store/refundorder/express/${id}`)
}
/**
* @description 导出订单
*/
-export function exportOrderApi(data) {
+export function exportOrderApi (data) {
return request.get(`store/order/excel`, data)
}
/**
* @description 生成发货单
*/
-export function exportInvoiceApi(data) {
+export function exportInvoiceApi (data) {
return request.get(`store/order/delivery_export`, data)
}
/**
* @description 导出文件列表
*/
-export function exportFileLstApi(data) {
+export function exportFileLstApi (data) {
return request.get(`excel/lst`, data)
}
/**
* @description 下载
*/
-export function downloadFileApi(id) {
+export function downloadFileApi (id) {
return request.get(`excel/download/${id}`)
}
/**
* @description 订单核销详情
*/
-export function orderCancellationApi(code) {
+export function orderCancellationApi (code) {
return request.get(`store/order/verify/${code}`)
}
/**
* @description 订单核销
*/
- export function goCancellationApi(id, data) {
+export function goCancellationApi (id, data) {
return request.post(`store/order/verify/${id}`, data)
}
/**
* @description 订单 -- 头部
*/
-export function orderHeadListApi() {
+export function orderHeadListApi () {
return request.get(`store/order/filtter`)
}
/**
* @description 核销订单 -- 表头
*/
-export function takeChartApi() {
+export function takeChartApi () {
return request.get('store/order/takechart')
}
/**
* @description 核销订单 -- 列表
*/
-export function takeOrderListApi(data) {
+export function takeOrderListApi (data) {
return request.get('store/order/takelst', data)
}
/**
* @description 核销订单 -- 卡片
*/
-export function takeCardListApi(data) {
+export function takeCardListApi (data) {
return request.get('store/order/take_title', data)
}
/**
* @description 发票管理 -- 列表
*/
-export function invoiceOrderListApi(data) {
+export function invoiceOrderListApi (data) {
return request.get('store/receipt/lst', data)
}
/**
* @description 发票 -- 备注from
*/
-export function invoiceorderMarkApi(id) {
+export function invoiceorderMarkApi (id) {
return request.get(`store/receipt/mark/${id}/form`)
}
/**
* @description 发票 -- 开票信息
*/
-export function invoiceInfoApi(data) {
+export function invoiceInfoApi (data) {
return request.get(`store/receipt/set_recipt`, data)
}
/**
* @description 发票 -- 开票
*/
-export function invoiceApi(data) {
+export function invoiceApi (data) {
return request.post(`store/receipt/save_recipt`, data)
}
/**
* @description 发票 -- 详情
*/
-export function invoiceDetailApi(id) {
+export function invoiceDetailApi (id) {
return request.get(`store/receipt/detail/${id}`)
}
/**
* @description 发票 -- 编辑
*/
-export function invoiceUpdateApi(id, data) {
+export function invoiceUpdateApi (id, data) {
return request.post(`store/receipt/update/${id}`, data)
}
/**
* @description 批量发货记录 -- 列表
*/
-export function deliveryRecordListApi(data) {
+export function deliveryRecordListApi (data) {
return request.get('store/import/lst', data)
}
/**
* @description 批量发货记录 -- 详情
*/
-export function deliveryRecordDetailApi(id, data) {
+export function deliveryRecordDetailApi (id, data) {
return request.get(`store/import/detail/${id}`, data)
}
/**
* @description 批量发货记录 -- 导出
*/
-export function deliveryRecordImportApi(id) {
+export function deliveryRecordImportApi (id) {
return request.get(`store/import/excel/${id}`)
}
/**
* @description 退款单 -- 导出
*/
-export function refundListImportApi(data) {
+export function refundListImportApi (data) {
return request.get(`store/refundorder/excel`, data)
}
/**
* @description 发送货 -- 物流公司列表
*/
-export function expressLst() {
+export function expressLst () {
return request.get(`expr/options`)
}
/**
* @description 发送货 -- 电子面单列表
*/
-export function exprTempsLst(data) {
+export function exprTempsLst (data) {
return request.get(`expr/temps`, data)
}
/**
* @description 发送货 -- 批量发送货
*/
-export function batchDeliveryApi(data) {
+export function batchDeliveryApi (data) {
return request.post(`store/order/delivery_batch`, data)
}
/**
* @description 发送货 -- 电子面单默认数据
*/
-export function getEleTempData() {
+export function getEleTempData () {
return request.get(`serve/config`)
}
/**
* @description 发送货 -- 门店列表
*/
- export function getStoreLst() {
+export function getStoreLst () {
return request.get(`delivery/station/select`)
}
+
+/**
+ * @description 发送货 -- 取件码
+ */
+export function getLogisticsCode (id) {
+ return request.get(`store/order/logistics_code/${id}`)
+}
+
/**
* @description 发送货 -- 门店列表
*/
- export function getDeliveryStoreLst() {
+export function getDeliveryStoreLst () {
return request.get(`delivery/station/options`)
}
/**
* @description 同城配送 -- 订单列表
*/
- export function deliveryOrderLst(data) {
+export function deliveryOrderLst (data) {
return request.get(`delivery/order/lst`, data)
}
/**
* @description 同城订单 -- 取消
*/
- export function deliveryOrderCancle(id) {
+export function deliveryOrderCancle (id) {
return request.get(`delivery/order/cancel/${id}/form`)
}
/**
* @description 同城配送 -- 充值记录列表
*/
- export function rechargeLst(data) {
+export function rechargeLst (data) {
return request.get(`delivery/station/payLst`, data)
}
/**
* @description 同城配送 -- 充值
*/
- export function rechargeInfoApi(data) {
+export function rechargeInfoApi (data) {
return request.get(`delivery/station/code`, data)
}
/**
* @description 订单 -- 导出
*/
- export function storeOrderApi(data) {
+export function storeOrderApi (data) {
return request.get(`delivery/station/code`, data)
-}
\ No newline at end of file
+}
diff --git a/src/views/order/index.vue b/src/views/order/index.vue
index b872bd1..2190643 100644
--- a/src/views/order/index.vue
+++ b/src/views/order/index.vue
@@ -4,34 +4,138 @@
-
-
- 全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}
- 待付款 {{ '(' +orderChartType.unpaid?orderChartType.unpaid:0+ ')' }}
- 待发货 {{ '(' +orderChartType.unshipped?orderChartType.unshipped:0+ ')' }}
- 待收货 {{ '(' +orderChartType.untake?orderChartType.untake:0+ ')' }}
- 待评价 {{ '(' +orderChartType.unevaluate?orderChartType.unevaluate:0+ ')' }}
- 交易完成 {{ '(' +orderChartType.complete?orderChartType.complete:0+ ')' }}
- 已退款 {{ '(' +orderChartType.refund?orderChartType.refund:0+ ')' }}
- 已删除 {{ '(' +orderChartType.del?orderChartType.del:0+ ')' }}
+
+
+ 全部
+ {{
+ "(" + orderChartType.all ? orderChartType.all : 0 + ")"
+ }}
+ 待付款
+ {{
+ "(" + orderChartType.unpaid
+ ? orderChartType.unpaid
+ : 0 + ")"
+ }}
+ 待发货
+ {{
+ "(" + orderChartType.unshipped
+ ? orderChartType.unshipped
+ : 0 + ")"
+ }}
+ 待收货
+ {{
+ "(" + orderChartType.untake
+ ? orderChartType.untake
+ : 0 + ")"
+ }}
+ 待评价
+ {{
+ "(" + orderChartType.unevaluate
+ ? orderChartType.unevaluate
+ : 0 + ")"
+ }}
+ 交易完成
+ {{
+ "(" + orderChartType.complete
+ ? orderChartType.complete
+ : 0 + ")"
+ }}
+ 已退款
+ {{
+ "(" + orderChartType.refund
+ ? orderChartType.refund
+ : 0 + ")"
+ }}
+ 已删除
+ {{
+ "(" + orderChartType.del ? orderChartType.del : 0 + ")"
+ }}
-
-
- {{ item.text }}
+
+
+ {{ item.text }}
-
+
-
-
-
+
+
-
-
+
+
@@ -40,7 +144,7 @@
placeholder="请选择"
class="filter-item selWidth mr20"
clearable
- @change="getList(1),getCardList()"
+ @change="getList(1), getCardList()"
>
-
-
-
+
+
+
@@ -67,13 +187,30 @@
-
-
+
+
- 订单核销
+ 订单核销
导入批量发货
批量发货记录
- 下载物流公司对照表
+ 下载物流公司对照表
-
-
+
+
-
+
@@ -104,7 +260,9 @@
{{ props.row.create_time }}
- {{ props.row.mark | filterEmpty }}
+ {{
+ props.row.mark | filterEmpty
+ }}
{{ props.row.remark | filterEmpty }}
@@ -114,48 +272,149 @@
-
+
- 选中本页
- 选中全部
+ 选中本页
+ 选中全部
-
+
- changeOne(v,scope.row)" />
+ changeOne(v, scope.row)"
+ />
-
- 用户已删除
+
+ 用户已删除
- {{ scope.row.is_virtual == 1 ? "虚拟订单" : scope.row.order_type == 0 ? "普通订单" : "核销订单" }}
+ {{
+ scope.row.is_virtual == 1
+ ? "虚拟订单"
+ : scope.row.order_type == 0
+ ? "普通订单"
+ : "核销订单"
+ }}
- {{ scope.row.activity_type === 1 ? "秒杀" : scope.row.activity_type === 2 ? "预售" : scope.row.activity_type === 3 ? "助力" : "--" }}
- 拼团订单 -{{ scope.row.groupUser.groupBuying.status | activityOrderStatus }}
+ {{
+ scope.row.activity_type === 1
+ ? "秒杀"
+ : scope.row.activity_type === 2
+ ? "预售"
+ : scope.row.activity_type === 3
+ ? "助力"
+ : "--"
+ }}
+ 拼团订单
+ -{{
+ scope.row.groupUser.groupBuying.status | activityOrderStatus
+ }}
-
+
-
+
-
+
-
{{ val.cart_info.product.store_name + ' | ' }}{{ val.cart_info.productAttr.sku }}
+
{{ val.cart_info.product.store_name + " | "
+ }}{{ val.cart_info.productAttr.sku }}
- {{ '¥'+ val.cart_info.productPresellAttr.presell_price + ' x '+ val.product_num }}
- {{ '¥'+ val.cart_info.productAssistAttr.assist_price + ' x '+ val.product_num }}
- {{ '¥'+ val.cart_info.productAttr.price + ' x '+ val.product_num }}
- (-{{ val.product_num - val.refund_num }})
+ {{
+ "¥" +
+ val.cart_info.productPresellAttr.presell_price +
+ " x " +
+ val.product_num
+ }}
+ {{
+ "¥" +
+ val.cart_info.productAssistAttr.assist_price +
+ " x " +
+ val.product_num
+ }}
+ {{
+ "¥" +
+ val.cart_info.productAttr.price +
+ " x " +
+ val.product_num
+ }}
+ (-{{ val.product_num - val.refund_num }})
@@ -163,18 +422,41 @@
{{ scope.row.pay_price }}
- 尾款:{{ scope.row.finalOrder.pay_price }}
+
+ 尾款:{{ scope.row.finalOrder.pay_price }}
+
- {{ (parseFloat(scope.row.extension_one) + parseFloat(scope.row.extension_two) + parseFloat(scope.row.refund_extension_one) + parseFloat(scope.row.refund_extension_two)).toFixed(2) }}
- (-{{ (parseFloat(scope.row.refund_extension_one)+parseFloat(scope.row.refund_extension_two)).toFixed(2) }})
+ {{
+ (
+ parseFloat(scope.row.extension_one) +
+ parseFloat(scope.row.extension_two) +
+ parseFloat(scope.row.refund_extension_one) +
+ parseFloat(scope.row.refund_extension_two)
+ ).toFixed(2)
+ }}
+ (-{{
+ (
+ parseFloat(scope.row.refund_extension_one) +
+ parseFloat(scope.row.refund_extension_two)
+ ).toFixed(2)
+ }})
- {{ scope.row.pay_type | orderPayType }}
+ {{
+ scope.row.pay_type | orderPayType
+ }}
--
@@ -188,8 +470,15 @@
待付款
- {{ scope.row.status | orderStatusFilter }}
- {{ scope.row.status | takeOrderStatusFilter }}
+ {{ scope.row.status | orderStatusFilter }}
+ {{
+ scope.row.status | takeOrderStatusFilter
+ }}
已删除
@@ -198,23 +487,85 @@
- {{ scope.row.spread && scope.row.spread.nickname || '无' }}
+ {{
+ (scope.row.spread && scope.row.spread.nickname) || "无"
+ }}
- {{ scope.row.TopSpread && scope.row.TopSpread.nickname || '无' }}
+ {{
+ (scope.row.TopSpread && scope.row.TopSpread.nickname) || "无"
+ }}
-
+
- 查看退款单
- 编辑
- 发送货
- 订单详情
- 删除
- 去核销
-
+ 查看退款单
+ 编辑
+ 发送货
+ 订单详情
+ 删除
+ 去核销
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
{{ formValidate.coupon_price }}
@@ -268,38 +670,80 @@
-
-
-
+
+
+
{{ original.delivery_name }}
-
+
{{ original.delivery_id }}
- 手动发货
+ 扫码发货
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
预览
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
- 可选择表格中的商品单独发货,发货后会生成新的订单且不能撤回,请谨慎操作!
+
+ 可选择表格中的商品单独发货,发货后会生成新的订单且不能撤回,请谨慎操作!
+
-
+
-
-
-
-
-
-
-
-
{{scope.row.cart_info.product.store_name}}
-
-
-
-
-
- {{scope.row.cart_info.productAttr.sku}}
-
-
-
-
- {{scope.row.cart_info.productAttr.price}}
-
-
-
-
- {{scope.row.stock_num}}
-
-
-
-
-
-
-
-
+ ref="multipleSelection"
+ :data="productList"
+ tooltip-effect="dark"
+ size="mini"
+ :row-key="
+ (row) => {
+ return row.product_id;
+ }
+ "
+ @selection-change="handleSelectionChange"
+ >
+
+
+
+
+
+
+
+
{{
+ scope.row.cart_info.product.store_name
+ }}
+
+
+
+
+
+ {{
+ scope.row.cart_info.productAttr.sku
+ }}
+
+
+
+
+ {{
+ scope.row.cart_info.productAttr.price
+ }}
+
+
+
+
+ {{ scope.row.stock_num }}
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
row.product_num)row.stock = row.product_num
+ limitCount (row) {
+ if (row.stock > row.product_num) row.stock = row.product_num
},
- changeDrawer(v) {
+ changeDrawer (v) {
this.drawer = v;
},
- closeDrawer() {
+ closeDrawer () {
this.drawer = false;
},
// 分单发货选择商品
- handleSelectionChange(val) {
+ handleSelectionChange (val) {
this.multipleSelection = val
const data = []
this.multipleSelection.map((item) => {
- data.push({id:item.order_product_id,num:item.product_num})
+ data.push({ id: item.order_product_id, num: item.product_num })
})
this.ids = data
},
// 是否开启电子面单
- isOpenDump() {
+ isOpenDump () {
serveInfoApi().then((res) => {
this.isDump = res.data.crmeb_serve_dump
if (res.data.crmeb_serve_dump == 1) this.getEleTempData()
@@ -699,7 +1321,7 @@ export default {
})
},
// 获取快递公司列表
- getExpressLst() {
+ getExpressLst () {
expressLst().then((res) => {
this.deliveryList = res.data
}).catch((res) => {
@@ -707,13 +1329,13 @@ export default {
})
},
// 获取电子面单列表
- getTempsLst(name) {
+ getTempsLst (name) {
exprTempsLst({ com: name }).then((res) => {
this.eleTempsLst = res.data.data
})
},
// 获取电子面单默认数据
- getEleTempData() {
+ getEleTempData () {
getEleTempData().then((res) => {
const data = res.data
const delivery_type = this.shipment.delivery_type
@@ -725,32 +1347,32 @@ export default {
delivery_name: data.mer_from_com,
temp_id: data.mer_config_temp_id
}
- if(data.mer_from_com != ''){
+ if (data.mer_from_com != '') {
this.getTempsLst(data.mer_from_com)
}
-
+
})
.catch((res) => {
this.$message.error(res.message)
})
},
//获取门店列表
- getStoreList() {
+ getStoreList () {
getDeliveryStoreLst().then((res) => {
this.storeList = res.data
}).catch((res) => {
this.$message.error(res.message)
})
},
- changeSend(e) {
+ changeSend (e) {
this.$refs['shipment'].clearValidate();
- if(e == 3){
+ if (e == 3) {
//如果是无需配送,就重置拆单信息
this.shipment.is_split = '0';
delete this.shipment.split;
}
},
- getPicture(name) {
+ getPicture (name) {
if (this.shipment.temp_id) {
this.eleTempsLst.forEach((o, i) => {
if (o['temp_id'] == this.shipment.temp_id) {
@@ -763,7 +1385,7 @@ export default {
}
},
// 批量发送货
- batchSend() {
+ batchSend () {
if (this.checkedIds.length == 0) {
return this.$message.warning('请先选择订单')
} else {
@@ -773,15 +1395,15 @@ export default {
this.shipment.order_id = this.checkedIds
}
},
- handleClose() {
+ handleClose () {
this.sendVisible = false
this.$refs['shipment'].resetFields()
},
- onHandle(name) {
+ onHandle (name) {
this.chkName = this.chkName === name ? '' : name
this.changeType(!(this.chkName === ''))
},
- changeType(v) {
+ changeType (v) {
if (v) {
if (!this.chkName) {
this.chkName = 'dan'
@@ -798,7 +1420,7 @@ export default {
}
this.syncCheckedId()
},
- syncCheckedId() {
+ syncCheckedId () {
const ids = this.tableData.data.map(v => v.order_id)
if (this.chkName === 'duo') {
this.checkedIds = []
@@ -821,7 +1443,7 @@ export default {
}
},
// 分开选择
- changeOne(v, row) {
+ changeOne (v, row) {
if (v) {
if (this.chkName === 'duo') {
const index = this.noChecked.indexOf(row.order_id)
@@ -841,7 +1463,7 @@ export default {
}
},
// 头部
- getHeaderList() {
+ getHeaderList () {
orderHeadListApi()
.then((res) => {
this.headeNum = res.data
@@ -851,7 +1473,7 @@ export default {
})
},
// 订单筛选
- orderFilter(item) {
+ orderFilter (item) {
let status = false
item.orderProduct.forEach((el) => {
if (el.refund_num < el.product_num) {
@@ -861,7 +1483,7 @@ export default {
return status
},
// 退款详情页
- onRefundDetail(sn) {
+ onRefundDetail (sn) {
this.$router.push({
path: 'refund',
query: {
@@ -870,7 +1492,7 @@ export default {
})
},
// 表格某一行添加特定的样式
- addTdClass(val) {
+ addTdClass (val) {
if (val.row.status > 0 && val.row.paid == 1) {
for (let i = 0; i < val.row.orderProduct.length; i++) {
if (val.row.orderProduct[i].refund_num >= 0 && val.row.orderProduct[i].refund_num < val.row.orderProduct[i].product_num) {
@@ -882,7 +1504,7 @@ export default {
}
},
// 详情
- onOrderDetails(id) {
+ onOrderDetails (id) {
this.orderId = id
this.$refs.orderDetail.getInfo(id);
this.drawer = true;
@@ -890,25 +1512,25 @@ export default {
// this.$refs.orderDetail.onOrderDetails(id)
// this.$refs.orderDetail.onOrderLog(id)
},
- async exports(value) {
+ async exports (value) {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
- excelData.ids = this.checkedIds.toString()
+ excelData.ids = this.checkedIds.toString()
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = value == 1 ? await this.downOrderData(excelData) : await this.downInvoiceData(excelData)
- pageCount = Math.ceil(lebData.count/excelData.limit)
+ pageCount = Math.ceil(lebData.count / excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
- }
+ }
}
- createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
+ createWorkBook(lebData.header, lebData.title, data, lebData.foot, lebData.filename);
return
},
/**订单 */
- downOrderData(excelData) {
+ downOrderData (excelData) {
return new Promise((resolve, reject) => {
exportOrderApi(excelData).then((res) => {
return resolve(res.data)
@@ -916,7 +1538,7 @@ export default {
})
},
/**发货单 */
- downInvoiceData(excelData) {
+ downInvoiceData (excelData) {
return new Promise((resolve, reject) => {
exportInvoiceApi(excelData).then((res) => {
return resolve(res.data)
@@ -969,11 +1591,11 @@ export default {
// this.$refs.exportList.exportFileList()
// },
// 批量发货记录
- getDeliveryList() {
+ getDeliveryList () {
this.$refs.deliveryList.getList()
},
// 上传成功
- handleSuccess(response) {
+ handleSuccess (response) {
if (response.status === 200) {
this.$message.success(response.message)
} else {
@@ -981,18 +1603,18 @@ export default {
}
},
// 下载物流公司对照表
- downloadLogistics() {
+ downloadLogistics () {
window.open(SettingMer.https + `/excel/download/express?token=` + getToken())
},
// 订单核销
- orderCancellation(code) {
+ orderCancellation (code) {
const that = this
that.$refs.orderCancellate.dialogVisible = true;
- if(code) {
- that.$refs.orderCancellate.productDetails(code)
- that.$refs.orderCancellate.isColum = true;
- }else{
- that.$refs.orderCancellate.isColum = false;
+ if (code) {
+ that.$refs.orderCancellate.productDetails(code)
+ that.$refs.orderCancellate.isColum = true;
+ } else {
+ that.$refs.orderCancellate.isColum = false;
}
// this.$prompt('', '提示', {
// confirmButtonText: '立即核销',
@@ -1014,7 +1636,7 @@ export default {
},
// 去核销
- handleCancellation(code) {
+ handleCancellation (code) {
this.$confirm('确定核销此订单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -1039,7 +1661,7 @@ export default {
})
},
// 订单记录
- onOrderLog(id) {
+ onOrderLog (id) {
this.dialogVisible = true
this.LogLoading = true
orderLogApi(id, this.tableFromLog)
@@ -1053,16 +1675,16 @@ export default {
this.LogLoading = false
})
},
- pageChangeLog(page) {
+ pageChangeLog (page) {
this.tableFromLog.page = page
this.getList('')
},
- handleSizeChangeLog(val) {
+ handleSizeChangeLog (val) {
this.tableFromLog.limit = val
this.getList('')
},
// 打印订单
- printOrder(id) {
+ printOrder (id) {
orderPrintApi(id)
.then((res) => {
this.$message.success(res.message)
@@ -1072,7 +1694,7 @@ export default {
})
},
// 订单删除
- handleDelete(row, idx) {
+ handleDelete (row, idx) {
if (row.is_del === 1) {
this.$modalSure().then(() => {
orderDeleteApi(row.order_id)
@@ -1092,32 +1714,32 @@ export default {
this.$confirm(
'您选择的的订单存在用户未删除的订单,无法删除用户未删除的订单!',
'提示', {
- confirmButtonText: '确定',
- type: 'error'
- }
+ confirmButtonText: '确定',
+ type: 'error'
+ }
)
}
},
// 备注
- onOrderMark(id) {
+ onOrderMark (id) {
this.$modalForm(orderRemarkApi(id)).then(() => this.getList(''))
},
// 选择时间
- selectChange(tab) {
+ selectChange (tab) {
this.timeVal = []
this.tableFrom.date = tab
this.getCardList()
this.getList(1)
},
// 具体日期
- onchangeTime(e) {
+ onchangeTime (e) {
this.timeVal = e
this.tableFrom.date = e ? this.timeVal.join('-') : ''
this.getCardList()
this.getList(1)
},
// 编辑
- edit(id) {
+ edit (id) {
this.editId = id
this.editVisible = true
orderDetailApi(id).then(res => {
@@ -1133,7 +1755,7 @@ export default {
this.$message.error(message)
})
},
- editConfirm() {
+ editConfirm () {
orderUpdateApi(this.editId, this.formValidate).then(res => {
this.editVisible = false
this.$message.success(res.message)
@@ -1142,11 +1764,11 @@ export default {
this.$message.error(message)
})
},
- changePrice() {
+ changePrice () {
this.formValidate.pay_price = (this.formValidate.total_price + this.formValidate.pay_postage - this.formValidate.coupon_price).toFixed(2)
},
// 发货
- send(row,id) {
+ send (row, id) {
this.isBatch = false
this.sendVisible = true
this.isResend = false
@@ -1155,14 +1777,18 @@ export default {
this.orderType = row.is_virtual
this.shipment.delivery_type = this.orderType === 1 ? 3 : 1
row.orderProduct.forEach(item => {
- item.stock_num = item.product_num
+ item.stock_num = item.product_num
+ })
+ getLogisticsCode(id).then((res) => {
+ this.orderSendQrCode = res.data.qrcode;
})
this.productList = row.orderProduct
- this.productNum = row.orderProduct && row.orderProduct[0] && row.orderProduct[0]['product_num'] || 0
+ this.productNum = row.orderProduct && row.orderProduct[0] && row.orderProduct[0]['product_num'] || 0
delete this.shipment.order_id
- if(this.tableFrom.order_type == 2)this.shipment.delivery_type = 3
+ if (this.tableFrom.order_type == 2) this.shipment.delivery_type = 3
+ this.shipment.delivery_type = 6
},
- sendReset() {
+ sendReset () {
this.shipment = {
delivery_type: 1,
delivery_name: '',
@@ -1174,7 +1800,7 @@ export default {
}
},
// 修改发货信息
- reSend(id) {
+ reSend (id) {
this.isBatch = false
this.sendVisible = true
this.orderId = id
@@ -1195,18 +1821,18 @@ export default {
this.$message.error(message)
})
},
- submitForm(name) {
+ submitForm (name) {
if (this.shipment.delivery_type == 2) {
this.shipment.delivery_name = this.shipment.to_name
this.shipment.delivery_id = this.shipment.to_phone
}
- if(this.shipment.is_split != '0' && this.shipment.is_split && this.orderType != 2){
+ if (this.shipment.is_split != '0' && this.shipment.is_split && this.orderType != 2) {
if (!this.multipleSelection.length) {
return this.$message.warning('请选择拆单商品!')
}
const data = []
this.multipleSelection.map((item) => {
- data.push({id:item.order_product_id,num:item.product_num_input})
+ data.push({ id: item.order_product_id, num: item.product_num_input })
})
this.ids = data
this.shipment.split = this.ids
@@ -1241,7 +1867,7 @@ export default {
})
},
// 列表
- getList(num) {
+ getList (num) {
this.listLoading = true
this.tableFrom.page = num || this.tableFrom.page
orderListApi(this.tableFrom)
@@ -1261,7 +1887,7 @@ export default {
this.listLoading = false
})
},
- getCardList() {
+ getCardList () {
cardListApi(this.tableFrom)
.then((res) => {
this.cardLists = res.data
@@ -1270,15 +1896,15 @@ export default {
this.$message.error(res.message)
})
},
- pageChange(page) {
+ pageChange (page) {
this.tableFrom.page = page
this.getList('')
},
- handleSizeChange(val) {
+ handleSizeChange (val) {
this.tableFrom.limit = val
this.getList('')
},
- headerList() {
+ headerList () {
chartApi()
.then((res) => {
this.orderChartType = res.data
@@ -1292,59 +1918,59 @@ export default {
diff --git a/src/views/order/orderCancellate.vue b/src/views/order/orderCancellate.vue
index 8051be6..3fcd92f 100644
--- a/src/views/order/orderCancellate.vue
+++ b/src/views/order/orderCancellate.vue
@@ -4,56 +4,87 @@
v-if="dialogVisible"
title="订单核销"
:visible.sync="dialogVisible"
- width="900px"
+ width="1000px"
>
-
-
-
- 搜索
-
-
- {{orderData.order_sn}}
-
-
-
-
+
+
+ 搜索
-
+
+
+ {{ orderData.order_sn }}
+
+
+
+
+
-
+
-
+
-
{{scope.row.cart_info.product.store_name}}
+
{{
+ scope.row.cart_info.product.store_name
+ }}
- {{scope.row.cart_info.productAttr.sku}}
+ {{
+ scope.row.cart_info.productAttr.sku
+ }}
- {{scope.row.cart_info.productAttr.price}}
+ {{
+ scope.row.cart_info.productAttr.price
+ }}
待核销
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
@@ -87,15 +124,16 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team
// +----------------------------------------------------------------------
-import { orderCancellationApi, goCancellationApi } from '@/api/order'
+import { orderCancellationApi, goCancellationApi } from '@/api/order'
export default {
name: 'OrderCancellate',
- data() {
+ data () {
return {
dialogVisible: false,
loading: false,
code: '',
+ verify_code: '', //核销码
order_id: "",
orderData: "",
multipleSelection: [],
@@ -105,14 +143,14 @@ export default {
}
},
methods: {
- searchOrder() {
- if(!this.code){
+ searchOrder () {
+ if (!this.code) {
return this.$message.warning('输入核销码!')
}
- this.productDetails(this.code)
+ this.productDetails(this.code, true)
},
- handleCancellation() {
- if(!this.code){
+ handleCancellation () {
+ if (!this.verify_code) {
return this.$message.warning('输入核销码!')
}
if (!this.multipleSelection.length) {
@@ -120,40 +158,46 @@ export default {
}
const data = []
this.multipleSelection.map((item) => {
- data.push({id:item.order_product_id,num:item.refund_num})
+ data.push({ id: item.order_product_id, num: item.refund_num })
})
- goCancellationApi(this.order_id,{verify_code: this.code,data: data}).then(res => {
- this.$message.success(res.message)
- this.dialogVisible = false
- this.$emit('getList','')
+ goCancellationApi(this.order_id, { verify_code: this.verify_code, data: data }).then(res => {
+ this.$message.success(res.message)
+ this.dialogVisible = false
+ this.$emit('getList', '')
}).catch(({ message }) => {
this.$message.error(message)
})
},
- productDetails(code) {
- this.code = code
+ productDetails (code, type = false) {
+ if (type) this.code = code
+ else {
+ this.code = "";
+ this.verify_code = "";
+ }
this.loading = true
orderCancellationApi(code).then(res => {
this.orderData = res.data
this.order_id = res.data.order_id
+ if (type) this.verify_code = res.data.verify_code
this.productList = res.data.orderProduct
- this.productList.forEach((item, index)=>{
+ this.productList.forEach((item, index) => {
item.max_num = item.refund_num
})
this.loading = false
+ this.$refs.multipleSelection.toggleAllSelection()
}).catch(({ message }) => {
this.loading = false
this.$message.error(message)
})
},
- // 选择商品
- handleSelectionChange(val) {
+ // 选择商品
+ handleSelectionChange (val) {
this.multipleSelection = val
},
- limitNum(row){
- if(row.refund_num > row.max_num){
+ limitNum (row) {
+ if (row.refund_num > row.max_num) {
row.refund_num = row.max_num
- }else if(row.refund_num < 1){
+ } else if (row.refund_num < 1) {
row.refund_num = 1
}
}
@@ -162,10 +206,10 @@ export default {