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

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

@ -280,6 +280,14 @@ export function getEleTempData() {
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 发送货 -- 门店列表
*/ */

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"
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>
<el-form-item label="订单号:"> <el-form-item label="订单号:">
<span>{{ orderData.order_sn }}</span> <span>{{ orderData.order_sn }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-top: 20px;"> <div style="margin-top: 20px">
<el-table <el-table
ref="multipleSelection" ref="multipleSelection"
:data="productList" :data="productList"
tooltip-effect="dark" :default-selection="[0]"
size="mini" size="mini"
:row-key="(row) => { return row.product_id }" :row-key="
(row) => {
return row.product_id;
}
"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
:header-cell-style="{ background: '#F0F5FF' }" :header-cell-style="{ background: '#F0F5FF' }"
> >
<el-table-column align="center" type="selection" :reserve-selection="true" min-width="50"/> <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> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" size="small">取消</el-button> <el-button @click="dialogVisible = false" size="small">取消</el-button>
<el-button type="primary" @click="handleCancellation" size="small">核销</el-button> <el-button type="primary" @click="handleCancellation" size="small"
>核销</el-button
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -96,6 +133,7 @@ export default {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
code: '', code: '',
verify_code: '', //
order_id: "", order_id: "",
orderData: "", orderData: "",
multipleSelection: [], multipleSelection: [],
@ -109,10 +147,10 @@ export default {
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) {
@ -122,7 +160,7 @@ export default {
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', '')
@ -130,17 +168,23 @@ export default {
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)