核销码

This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-03-16 13:48:24 +08:00
parent 987c8a33ae
commit b3477f03fe

View File

@ -1,15 +1,11 @@
<template> <template>
<div> <div>
<el-dialog <el-dialog v-if="dialogVisible" title="订单核销" :visible.sync="dialogVisible" width="900px">
v-if="dialogVisible"
title="订单核销"
:visible.sync="dialogVisible"
width="900px"
>
<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 v-model="code" placeholder="请输入核销码" class="selWidth" size="small"
@keyup.enter.native="searchOrder" />
<el-button size="small" type="primary" @click="searchOrder">搜索</el-button> <el-button size="small" type="primary" @click="searchOrder">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item label="订单号:"> <el-form-item label="订单号:">
@ -17,22 +13,16 @@
</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" :data="productList" tooltip-effect="dark" size="mini"
ref="multipleSelection" :row-key="(row) => { return row.product_id }" @selection-change="handleSelectionChange"
:data="productList" :header-cell-style="{ background: '#F0F5FF' }">
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" :selectable="judgeSelect" min-width="50" /> <el-table-column align="center" type="selection" :selectable="judgeSelect" 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>
@ -54,7 +44,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="product_num" label="总数" min-width="80" /> <el-table-column align="center" prop="product_num" label="总数" min-width="80" />
<el-table-column label="待核销数量" align="center" min-width="120"> <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 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']"
@ -65,7 +60,7 @@
@change="limitNum(scope.row)" @change="limitNum(scope.row)"
/> />
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
</div> </div>
</div> </div>
@ -101,6 +96,7 @@ export default {
orderData: "", orderData: "",
multipleSelection: [], multipleSelection: [],
ids: [], ids: [],
verify_code: '', //
isColum: false, isColum: false,
productList: [] productList: []
} }
@ -116,9 +112,13 @@ export default {
return row.is_refund == 0 return row.is_refund == 0
}, },
handleCancellation() { handleCancellation() {
if(!this.code){ // if (!this.code) {
// return this.$message.warning('!')
// }
if (!this.verify_code) {
return this.$message.warning('输入核销码!') return this.$message.warning('输入核销码!')
} }
if (!this.multipleSelection.length) { if (!this.multipleSelection.length) {
return this.$message.warning('请选择核销商品!') return this.$message.warning('请选择核销商品!')
} }
@ -129,7 +129,7 @@ export default {
} }
}) })
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', '')
@ -137,12 +137,17 @@ 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