新增核销与扫码取货功能,取消原有发货功能

This commit is contained in:
weipengfei 2023-11-23 11:08:41 +08:00
parent 9aad2d9863
commit 8915f0256b
3 changed files with 1061 additions and 383 deletions

View File

@ -12,307 +12,315 @@ import request from './request'
/** /**
* @description 订单 -- 列表 * @description 订单 -- 列表
*/ */
export function orderListApi(data) { export function orderListApi (data) {
return request.get('store/order/lst', data) return request.get('store/order/lst', data)
} }
/** /**
* @description 订单 -- 表头 * @description 订单 -- 表头
*/ */
export function chartApi() { export function chartApi () {
return request.get('store/order/chart') return request.get('store/order/chart')
} }
/** /**
* @description 订单 -- 卡片 * @description 订单 -- 卡片
*/ */
export function cardListApi(data) { export function cardListApi (data) {
return request.get('store/order/title', data) return request.get('store/order/title', data)
} }
/** /**
* @description 订单 -- 编辑 * @description 订单 -- 编辑
*/ */
export function orderUpdateApi(id, data) { export function orderUpdateApi (id, data) {
return request.post(`store/order/update/${id}`, data) return request.post(`store/order/update/${id}`, data)
} }
/** /**
* @description 订单 -- 发货 * @description 订单 -- 发货
*/ */
export function orderDeliveryApi(id, data) { export function orderDeliveryApi (id, data) {
return request.post(`store/order/delivery/${id}`, data) return request.post(`store/order/delivery/${id}`, data)
} }
/** /**
* @description 订单 -- 详情 * @description 订单 -- 详情
*/ */
export function orderDetailApi(id) { export function orderDetailApi (id) {
return request.get(`store/order/detail/${id}`) return request.get(`store/order/detail/${id}`)
} }
/** /**
* @description 订单 -- 子订单 * @description 订单 -- 子订单
*/ */
export function getChildrenOrderApi(id) { export function getChildrenOrderApi (id) {
return request.get(`store/order/children/${id}`) return request.get(`store/order/children/${id}`)
} }
/** /**
* @description 订单 -- 记录 * @description 订单 -- 记录
*/ */
export function orderLogApi(id, data) { export function orderLogApi (id, data) {
return request.get(`store/order/log/${id}`, data) return request.get(`store/order/log/${id}`, data)
} }
/** /**
* @description 订单 -- 备注from * @description 订单 -- 备注from
*/ */
export function orderRemarkApi(id) { export function orderRemarkApi (id) {
return request.get(`store/order/remark/${id}/form`) return request.get(`store/order/remark/${id}/form`)
} }
/** /**
* @description 订单 -- 删除 * @description 订单 -- 删除
*/ */
export function orderDeleteApi(id) { export function orderDeleteApi (id) {
return request.post(`store/order/delete/${id}`) return request.post(`store/order/delete/${id}`)
} }
/** /**
* @description 订单 -- 打印 * @description 订单 -- 打印
*/ */
export function orderPrintApi(id) { export function orderPrintApi (id) {
return request.get(`store/order/printer/${id}`) return request.get(`store/order/printer/${id}`)
} }
/** /**
* @description 退款订单 -- 列表 * @description 退款订单 -- 列表
*/ */
export function refundorderListApi(data) { export function refundorderListApi (data) {
return request.get('store/refundorder/lst', data) return request.get('store/refundorder/lst', data)
} }
/** /**
* @description 退款订单 -- 详情 * @description 退款订单 -- 详情
*/ */
export function refundorderDetailApi(id) { export function refundorderDetailApi (id) {
return request.get(`store/refundorder/detail/${id}`) return request.get(`store/refundorder/detail/${id}`)
} }
/** /**
* @description 退款订单 -- 审核from * @description 退款订单 -- 审核from
*/ */
export function refundorderStatusApi(id) { export function refundorderStatusApi (id) {
return request.get(`store/refundorder/status/${id}/form`) return request.get(`store/refundorder/status/${id}/form`)
} }
/** /**
* @description 退款订单 -- 备注from * @description 退款订单 -- 备注from
*/ */
export function refundorderMarkApi(id) { export function refundorderMarkApi (id) {
return request.get(`store/refundorder/mark/${id}/form`) return request.get(`store/refundorder/mark/${id}/form`)
} }
/** /**
* @description 退款订单 -- 记录from * @description 退款订单 -- 记录from
*/ */
export function refundorderLogApi(id) { export function refundorderLogApi (id) {
return request.get(`store/refundorder/log/${id}`) return request.get(`store/refundorder/log/${id}`)
} }
/** /**
* @description 退款订单 -- 删除 * @description 退款订单 -- 删除
*/ */
export function refundorderDeleteApi(id) { export function refundorderDeleteApi (id) {
return request.get(`store/refundorder/delete/${id}`) return request.get(`store/refundorder/delete/${id}`)
} }
/** /**
* @description 退款订单 -- 确认收货 * @description 退款订单 -- 确认收货
*/ */
export function confirmReceiptApi(id) { export function confirmReceiptApi (id) {
return request.post(`store/refundorder/refund/${id}`) return request.post(`store/refundorder/refund/${id}`)
} }
/** /**
* @description 获取物流信息 * @description 获取物流信息
*/ */
export function getExpress(id) { export function getExpress (id) {
return request.get(`store/order/express/${id}`) return request.get(`store/order/express/${id}`)
} }
/** /**
* @description 退款单获取物流信息 * @description 退款单获取物流信息
*/ */
export function refundorderExpressApi(id) { export function refundorderExpressApi (id) {
return request.get(`store/refundorder/express/${id}`) return request.get(`store/refundorder/express/${id}`)
} }
/** /**
* @description 导出订单 * @description 导出订单
*/ */
export function exportOrderApi(data) { export function exportOrderApi (data) {
return request.get(`store/order/excel`, data) return request.get(`store/order/excel`, data)
} }
/** /**
* @description 生成发货单 * @description 生成发货单
*/ */
export function exportInvoiceApi(data) { export function exportInvoiceApi (data) {
return request.get(`store/order/delivery_export`, data) return request.get(`store/order/delivery_export`, data)
} }
/** /**
* @description 导出文件列表 * @description 导出文件列表
*/ */
export function exportFileLstApi(data) { export function exportFileLstApi (data) {
return request.get(`excel/lst`, data) return request.get(`excel/lst`, data)
} }
/** /**
* @description 下载 * @description 下载
*/ */
export function downloadFileApi(id) { export function downloadFileApi (id) {
return request.get(`excel/download/${id}`) return request.get(`excel/download/${id}`)
} }
/** /**
* @description 订单核销详情 * @description 订单核销详情
*/ */
export function orderCancellationApi(code) { export function orderCancellationApi (code) {
return request.get(`store/order/verify/${code}`) return request.get(`store/order/verify/${code}`)
} }
/** /**
* @description 订单核销 * @description 订单核销
*/ */
export function goCancellationApi(id, data) { export function goCancellationApi (id, data) {
return request.post(`store/order/verify/${id}`, data) return request.post(`store/order/verify/${id}`, data)
} }
/** /**
* @description 订单 -- 头部 * @description 订单 -- 头部
*/ */
export function orderHeadListApi() { export function orderHeadListApi () {
return request.get(`store/order/filtter`) return request.get(`store/order/filtter`)
} }
/** /**
* @description 核销订单 -- 表头 * @description 核销订单 -- 表头
*/ */
export function takeChartApi() { export function takeChartApi () {
return request.get('store/order/takechart') return request.get('store/order/takechart')
} }
/** /**
* @description 核销订单 -- 列表 * @description 核销订单 -- 列表
*/ */
export function takeOrderListApi(data) { export function takeOrderListApi (data) {
return request.get('store/order/takelst', data) return request.get('store/order/takelst', data)
} }
/** /**
* @description 核销订单 -- 卡片 * @description 核销订单 -- 卡片
*/ */
export function takeCardListApi(data) { export function takeCardListApi (data) {
return request.get('store/order/take_title', data) return request.get('store/order/take_title', data)
} }
/** /**
* @description 发票管理 -- 列表 * @description 发票管理 -- 列表
*/ */
export function invoiceOrderListApi(data) { export function invoiceOrderListApi (data) {
return request.get('store/receipt/lst', data) return request.get('store/receipt/lst', data)
} }
/** /**
* @description 发票 -- 备注from * @description 发票 -- 备注from
*/ */
export function invoiceorderMarkApi(id) { export function invoiceorderMarkApi (id) {
return request.get(`store/receipt/mark/${id}/form`) return request.get(`store/receipt/mark/${id}/form`)
} }
/** /**
* @description 发票 -- 开票信息 * @description 发票 -- 开票信息
*/ */
export function invoiceInfoApi(data) { export function invoiceInfoApi (data) {
return request.get(`store/receipt/set_recipt`, data) return request.get(`store/receipt/set_recipt`, data)
} }
/** /**
* @description 发票 -- 开票 * @description 发票 -- 开票
*/ */
export function invoiceApi(data) { export function invoiceApi (data) {
return request.post(`store/receipt/save_recipt`, data) return request.post(`store/receipt/save_recipt`, data)
} }
/** /**
* @description 发票 -- 详情 * @description 发票 -- 详情
*/ */
export function invoiceDetailApi(id) { export function invoiceDetailApi (id) {
return request.get(`store/receipt/detail/${id}`) return request.get(`store/receipt/detail/${id}`)
} }
/** /**
* @description 发票 -- 编辑 * @description 发票 -- 编辑
*/ */
export function invoiceUpdateApi(id, data) { export function invoiceUpdateApi (id, data) {
return request.post(`store/receipt/update/${id}`, data) return request.post(`store/receipt/update/${id}`, data)
} }
/** /**
* @description 批量发货记录 -- 列表 * @description 批量发货记录 -- 列表
*/ */
export function deliveryRecordListApi(data) { export function deliveryRecordListApi (data) {
return request.get('store/import/lst', data) return request.get('store/import/lst', data)
} }
/** /**
* @description 批量发货记录 -- 详情 * @description 批量发货记录 -- 详情
*/ */
export function deliveryRecordDetailApi(id, data) { export function deliveryRecordDetailApi (id, data) {
return request.get(`store/import/detail/${id}`, data) return request.get(`store/import/detail/${id}`, data)
} }
/** /**
* @description 批量发货记录 -- 导出 * @description 批量发货记录 -- 导出
*/ */
export function deliveryRecordImportApi(id) { export function deliveryRecordImportApi (id) {
return request.get(`store/import/excel/${id}`) return request.get(`store/import/excel/${id}`)
} }
/** /**
* @description 退款单 -- 导出 * @description 退款单 -- 导出
*/ */
export function refundListImportApi(data) { export function refundListImportApi (data) {
return request.get(`store/refundorder/excel`, data) return request.get(`store/refundorder/excel`, data)
} }
/** /**
* @description 发送货 -- 物流公司列表 * @description 发送货 -- 物流公司列表
*/ */
export function expressLst() { export function expressLst () {
return request.get(`expr/options`) return request.get(`expr/options`)
} }
/** /**
* @description 发送货 -- 电子面单列表 * @description 发送货 -- 电子面单列表
*/ */
export function exprTempsLst(data) { export function exprTempsLst (data) {
return request.get(`expr/temps`, data) return request.get(`expr/temps`, data)
} }
/** /**
* @description 发送货 -- 批量发送货 * @description 发送货 -- 批量发送货
*/ */
export function batchDeliveryApi(data) { export function batchDeliveryApi (data) {
return request.post(`store/order/delivery_batch`, data) return request.post(`store/order/delivery_batch`, data)
} }
/** /**
* @description 发送货 -- 电子面单默认数据 * @description 发送货 -- 电子面单默认数据
*/ */
export function getEleTempData() { export function getEleTempData () {
return request.get(`serve/config`) return request.get(`serve/config`)
} }
/** /**
* @description 发送货 -- 门店列表 * @description 发送货 -- 门店列表
*/ */
export function getStoreLst() { export function getStoreLst () {
return request.get(`delivery/station/select`) return request.get(`delivery/station/select`)
} }
/**
* @description 发送货 -- 取件码
*/
export function getLogisticsCode (id) {
return request.get(`store/order/logistics_code/${id}`)
}
/** /**
* @description 发送货 -- 门店列表 * @description 发送货 -- 门店列表
*/ */
export function getDeliveryStoreLst() { export function getDeliveryStoreLst () {
return request.get(`delivery/station/options`) return request.get(`delivery/station/options`)
} }
/** /**
* @description 同城配送 -- 订单列表 * @description 同城配送 -- 订单列表
*/ */
export function deliveryOrderLst(data) { export function deliveryOrderLst (data) {
return request.get(`delivery/order/lst`, data) return request.get(`delivery/order/lst`, data)
} }
/** /**
* @description 同城订单 -- 取消 * @description 同城订单 -- 取消
*/ */
export function deliveryOrderCancle(id) { export function deliveryOrderCancle (id) {
return request.get(`delivery/order/cancel/${id}/form`) return request.get(`delivery/order/cancel/${id}/form`)
} }
/** /**
* @description 同城配送 -- 充值记录列表 * @description 同城配送 -- 充值记录列表
*/ */
export function rechargeLst(data) { export function rechargeLst (data) {
return request.get(`delivery/station/payLst`, data) return request.get(`delivery/station/payLst`, data)
} }
/** /**
* @description 同城配送 -- 充值 * @description 同城配送 -- 充值
*/ */
export function rechargeInfoApi(data) { export function rechargeInfoApi (data) {
return request.get(`delivery/station/code`, data) return request.get(`delivery/station/code`, data)
} }
/** /**
* @description 订单 -- 导出 * @description 订单 -- 导出
*/ */
export function storeOrderApi(data) { export function storeOrderApi (data) {
return request.get(`delivery/station/code`, data) return request.get(`delivery/station/code`, data)
} }

File diff suppressed because it is too large Load Diff

View File

@ -4,47 +4,73 @@
v-if="dialogVisible" v-if="dialogVisible"
title="订单核销" title="订单核销"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="900px" width="1000px"
> >
<div class="container"> <div class="container">
<el-form label-width="80px" size="small"> <el-form label-width="80px" size="small">
<el-form-item v-if="!isColum" label="核销码:"> <el-form-item v-if="!isColum" label="核销码:">
<el-input v-model="code" placeholder="请输入核销码查询订单号和商品" class="selWidth" size="small" @keyup.enter.native="searchOrder" /> <el-input
<el-button size="small" type="primary" @click="searchOrder">搜索</el-button> v-model="code"
</el-form-item> placeholder="请输入核销码查询订单号和商品"
<el-form-item label="订单号:"> class="selWidth"
<span>{{orderData.order_sn}}</span> size="small"
</el-form-item> @keyup.enter.native="searchOrder"
</el-form> />
<div style="margin-top: 20px;"> <el-button size="small" type="primary" @click="searchOrder"
<el-table >搜索</el-button
ref="multipleSelection"
:data="productList"
tooltip-effect="dark"
size="mini"
:row-key="(row) => { return row.product_id }"
@selection-change="handleSelectionChange"
:header-cell-style="{background:'#F0F5FF'}"
> >
<el-table-column align="center" type="selection" :reserve-selection="true" min-width="50"/> </el-form-item>
<el-form-item label="订单号:">
<span>{{ orderData.order_sn }}</span>
</el-form-item>
</el-form>
<div style="margin-top: 20px">
<el-table
ref="multipleSelection"
:data="productList"
:default-selection="[0]"
size="mini"
:row-key="
(row) => {
return row.product_id;
}
"
@selection-change="handleSelectionChange"
:header-cell-style="{ background: '#F0F5FF' }"
>
<el-table-column
align="center"
type="selection"
:reserve-selection="true"
min-width="50"
/>
<el-table-column align="center" label="商品信息" min-width="200"> <el-table-column align="center" label="商品信息" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="acea-row" style="align-items: center;"> <div class="acea-row" style="align-items: center">
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image :src="scope.row.cart_info.product.image" :preview-src-list="[scope.row.cart_info.product.image]" /> <el-image
:src="scope.row.cart_info.product.image"
:preview-src-list="[scope.row.cart_info.product.image]"
/>
</div> </div>
<span class="priceBox" style="width: 150px;">{{scope.row.cart_info.product.store_name}}</span> <span class="priceBox" style="width: 150px">{{
scope.row.cart_info.product.store_name
}}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="规格" min-width="80"> <el-table-column align="center" label="规格" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="priceBox">{{scope.row.cart_info.productAttr.sku}}</span> <span class="priceBox">{{
scope.row.cart_info.productAttr.sku
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="订单金额" min-width="80"> <el-table-column align="center" label="订单金额" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="priceBox">{{scope.row.cart_info.productAttr.price}}</span> <span class="priceBox">{{
scope.row.cart_info.productAttr.price
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="状态" min-width="80"> <el-table-column align="center" label="状态" min-width="80">
@ -52,8 +78,13 @@
<span class="priceBox">待核销</span> <span class="priceBox">待核销</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="product_num" label="总数" min-width="80" /> <el-table-column
<el-table-column label="待核销数量" align="center" min-width="120"> align="center"
prop="product_num"
label="总数"
min-width="80"
/>
<!-- <el-table-column label="待核销数量" align="center" min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row['refund_num']" v-model="scope.row['refund_num']"
@ -64,16 +95,22 @@
@change="limitNum(scope.row)" @change="limitNum(scope.row)"
/> />
</template> </template>
</el-table-column> -->
<el-table-column label="核销码" align="center" min-width="180">
<template slot-scope="scope">
<el-input v-model="verify_code" class="priceBox" />
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
</div> </div>
<span slot="footer" class="dialog-footer"> </div>
<el-button @click="dialogVisible = false" size="small">取消</el-button> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCancellation" size="small">核销</el-button> <el-button @click="dialogVisible = false" size="small">取消</el-button>
</span> <el-button type="primary" @click="handleCancellation" size="small"
>核销</el-button
>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -87,15 +124,16 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { orderCancellationApi, goCancellationApi } from '@/api/order' import { orderCancellationApi, goCancellationApi } from '@/api/order'
export default { export default {
name: 'OrderCancellate', name: 'OrderCancellate',
data() { data () {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
code: '', code: '',
verify_code: '', //
order_id: "", order_id: "",
orderData: "", orderData: "",
multipleSelection: [], multipleSelection: [],
@ -105,14 +143,14 @@ export default {
} }
}, },
methods: { methods: {
searchOrder() { searchOrder () {
if(!this.code){ if (!this.code) {
return this.$message.warning('输入核销码!') return this.$message.warning('输入核销码!')
} }
this.productDetails(this.code) this.productDetails(this.code, true)
}, },
handleCancellation() { handleCancellation () {
if(!this.code){ if (!this.verify_code) {
return this.$message.warning('输入核销码!') return this.$message.warning('输入核销码!')
} }
if (!this.multipleSelection.length) { if (!this.multipleSelection.length) {
@ -120,40 +158,46 @@ export default {
} }
const data = [] const data = []
this.multipleSelection.map((item) => { 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 => { goCancellationApi(this.order_id, { verify_code: this.verify_code, data: data }).then(res => {
this.$message.success(res.message) this.$message.success(res.message)
this.dialogVisible = false this.dialogVisible = false
this.$emit('getList','') this.$emit('getList', '')
}).catch(({ message }) => { }).catch(({ message }) => {
this.$message.error(message) this.$message.error(message)
}) })
}, },
productDetails(code) { productDetails (code, type = false) {
this.code = code if (type) this.code = code
else {
this.code = "";
this.verify_code = "";
}
this.loading = true this.loading = true
orderCancellationApi(code).then(res => { orderCancellationApi(code).then(res => {
this.orderData = res.data this.orderData = res.data
this.order_id = res.data.order_id this.order_id = res.data.order_id
if (type) this.verify_code = res.data.verify_code
this.productList = res.data.orderProduct this.productList = res.data.orderProduct
this.productList.forEach((item, index)=>{ this.productList.forEach((item, index) => {
item.max_num = item.refund_num item.max_num = item.refund_num
}) })
this.loading = false this.loading = false
this.$refs.multipleSelection.toggleAllSelection()
}).catch(({ message }) => { }).catch(({ message }) => {
this.loading = false this.loading = false
this.$message.error(message) this.$message.error(message)
}) })
}, },
// //
handleSelectionChange(val) { handleSelectionChange (val) {
this.multipleSelection = val this.multipleSelection = val
}, },
limitNum(row){ limitNum (row) {
if(row.refund_num > row.max_num){ if (row.refund_num > row.max_num) {
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 row.refund_num = 1
} }
} }
@ -162,10 +206,10 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.selWidth{ .selWidth {
width: 330px; width: 330px;
} }
.title{ .title {
margin-bottom: 16px; margin-bottom: 16px;
color: #17233d; color: #17233d;
font-weight: 500; font-weight: 500;