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

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 订单 -- 列表
*/
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)
}
}

File diff suppressed because it is too large Load Diff

View File

@ -4,56 +4,87 @@
v-if="dialogVisible"
title="订单核销"
:visible.sync="dialogVisible"
width="900px"
width="1000px"
>
<div class="container">
<el-form label-width="80px" size="small">
<el-form-item v-if="!isColum" label="核销码:">
<el-input v-model="code" placeholder="请输入核销码查询订单号和商品" class="selWidth" size="small" @keyup.enter.native="searchOrder" />
<el-button size="small" type="primary" @click="searchOrder">搜索</el-button>
</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"
tooltip-effect="dark"
size="mini"
:row-key="(row) => { return row.product_id }"
@selection-change="handleSelectionChange"
:header-cell-style="{background:'#F0F5FF'}"
<el-form label-width="80px" size="small">
<el-form-item v-if="!isColum" label="核销码:">
<el-input
v-model="code"
placeholder="请输入核销码查询订单号和商品"
class="selWidth"
size="small"
@keyup.enter.native="searchOrder"
/>
<el-button size="small" type="primary" @click="searchOrder"
>搜索</el-button
>
<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">
<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">
<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>
<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>
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="80">
<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>
</el-table-column>
<el-table-column align="center" label="订单金额" min-width="80">
<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>
</el-table-column>
<el-table-column align="center" label="状态" min-width="80">
<template slot-scope="scope">
<span class="priceBox">待核销</span>
</template>
</el-table-column>
<el-table-column align="center" prop="product_num" label="总数" min-width="80" />
<el-table-column label="待核销数量" align="center" min-width="120">
</el-table-column>
<el-table-column
align="center"
prop="product_num"
label="总数"
min-width="80"
/>
<!-- <el-table-column label="待核销数量" align="center" min-width="120">
<template slot-scope="scope">
<el-input
v-model="scope.row['refund_num']"
@ -62,18 +93,24 @@
:max="scope.row.max_num"
class="priceBox"
@change="limitNum(scope.row)"
/>
/>
</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>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" size="small">取消</el-button>
<el-button type="primary" @click="handleCancellation" size="small">核销</el-button>
</span>
</el-dialog>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" size="small">取消</el-button>
<el-button type="primary" @click="handleCancellation" size="small"
>核销</el-button
>
</span>
</el-dialog>
</div>
</template>
@ -87,15 +124,16 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
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 {
</script>
<style scoped lang="scss">
.selWidth{
.selWidth {
width: 330px;
}
.title{
.title {
margin-bottom: 16px;
color: #17233d;
font-weight: 500;