Commit 5049281d by liangjianmin

feat(寄售召回): 优化寄售召回功能并添加数量控制

- 在寄售召回单列表中添加"作废"状态选项
- 实现表格多选功能并优化作废操作逻辑
- 添加召回数量输入控件并设置合理范围限制
- 简化作废确认对话框,移除原因说明字段
- 修复变量声明方式从const改为var以兼容旧浏览器
parent 8621717f
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="operation-area row"> <div class="operation-area row">
<el-button type="primary" @click="importChange">导入</el-button> <el-button type="primary" @click="importChange">导入</el-button>
<a :href="skuHref" class="downTemplate">下载模版</a> <a :href="skuHref" class="downTemplate">下载模版</a>
<el-button type="danger" @click="del">删除</el-button> <!-- <el-button type="danger" @click="del">删除</el-button> -->
</div> </div>
<!--列表区--> <!--列表区-->
<div class="data-box th-all" v-if="tableData"> <div class="data-box th-all" v-if="tableData">
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="进行中" value="1"></el-option> <el-option label="进行中" value="1"></el-option>
<el-option label="出库完成" value="2"></el-option> <el-option label="出库完成" value="2"></el-option>
<el-option label="作废" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -25,9 +26,9 @@ ...@@ -25,9 +26,9 @@
<div class="operation-area row verCenter bothSide"> <div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter"> <div class="operation-button row verCenter">
<el-button type="primary" @click="$router.push('/createConsignmentRecallOrder')">生成寄售召回单</el-button> <el-button type="primary" @click="$router.push('/createConsignmentRecallOrder')">生成寄售召回单</el-button>
<el-button type="danger" @click="popupEvent(2)">作废</el-button>
<!-- <!--
<el-button type="primary" @click="popupEvent(1)">提交审核</el-button> <el-button type="primary" @click="popupEvent(1)">提交审核</el-button>
<el-button type="primary" @click="popupEvent(2)">作废</el-button>
<el-button type="danger" @click="popupEvent(3)"> 收货信息</el-button> <el-button type="danger" @click="popupEvent(3)"> 收货信息</el-button>
--> -->
</div> </div>
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
<!--列表区--> <!--列表区-->
<div class="data-box"> <div class="data-box">
<el-table :data="list" border max-height="600" @selection-change="handleSelectionChange"> <el-table :data="list" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" align="center" fixed></el-table-column>
<el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column> <el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column>
<el-table-column prop="msg_sn" label="寄售召回单号" min-width="150" :show-overflow-tooltip="true" align="center"> <el-table-column prop="msg_sn" label="寄售召回单号" min-width="150" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -65,12 +67,7 @@ ...@@ -65,12 +67,7 @@
</el-dialog> </el-dialog>
<!--作废--> <!--作废-->
<el-dialog title="作废" :close-on-click-modal="false" :visible.sync="dialogVisible_2" width="500px"> <el-dialog title="作废" :close-on-click-modal="false" :visible.sync="dialogVisible_2" width="500px">
<p style="margin-bottom: 15px;margin-left: 80px;">确定将选择的寄售召回单作废?</p> <p style="font-size:13px;">确定将选择的寄售召回单作废?</p>
<el-form ref="form" label-width="80px">
<el-form-item label="原因说明">
<el-input type="textarea" v-model="remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible_2 = false">取 消</el-button> <el-button @click="dialogVisible_2 = false">取 消</el-button>
<el-button type="primary" @click="cancelConsignmentRecall">确 定</el-button> <el-button type="primary" @click="cancelConsignmentRecall">确 定</el-button>
...@@ -261,7 +258,7 @@ ...@@ -261,7 +258,7 @@
switch (type) { switch (type) {
case 1: case 1:
// 提交审核:校验待提审状态 // 提交审核:校验待提审状态
const invalidVerify = this.multipleSelection.filter(item => item.recall_status !== '0'); var invalidVerify = this.multipleSelection.filter(item => item.recall_status !== '0');
if (invalidVerify.length) { if (invalidVerify.length) {
this.$message.warning('只能选择待提审状态的数据'); this.$message.warning('只能选择待提审状态的数据');
return; return;
...@@ -271,9 +268,9 @@ ...@@ -271,9 +268,9 @@
break; break;
case 2: case 2:
// 作废:待提审、待退货出库状态可作废 // 作废:待提审、待退货出库状态可作废
const invalidCancel = this.multipleSelection.filter(item => !(['0', '2'].includes(item.recall_status))); var invalidCancel = this.multipleSelection.filter(item => !([1].includes(item.recall_status)));
if (invalidCancel.length) { if (invalidCancel.length) {
this.$message.warning('待提审、待退货出库状态才可作废'); this.$message.warning('只能选中寄售召回单状态为进行中');
return; return;
} }
this.recall_ids = this.multipleSelection.map(item => item.recall_id).join(','); this.recall_ids = this.multipleSelection.map(item => item.recall_id).join(',');
...@@ -309,7 +306,7 @@ ...@@ -309,7 +306,7 @@
* 作废 * 作废
*/ */
cancelConsignmentRecall() { cancelConsignmentRecall() {
this.$http('POST', "/api/consignmentRecall/cancelConsignmentRecall", { recall_ids: this.recall_ids, cancel_remark: this.remark }).then(res => { this.$http('POST', "/api/consignmentRecall/cancelConsignmentRecall", { recall_id: this.recall_ids}).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
......
...@@ -45,7 +45,11 @@ ...@@ -45,7 +45,11 @@
<el-table-column prop="goods_name" label="型号" min-width="180" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="goods_name" label="型号" min-width="180" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="brand_name" label="标准品牌" min-width="180" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="brand_name" label="标准品牌" min-width="180" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="useable_qty" label="可用库存数量" width="150" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="useable_qty" label="可用库存数量" width="150" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="useable_qty" label="召回数量" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column label="召回数量" width="150" align="center">
<template slot-scope="scope">
<el-input-number v-model="scope.row.recall_num" :min="1" :max="scope.row.useable_qty" :precision="0" :step="1" size="mini" controls-position="right" @change="handleRecallQtyChange" style="width: 120px;"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="date_code" label="D/C" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="date_code" label="D/C" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="coo" label="产地" width="80" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="coo" label="产地" width="80" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="create_time" label="入库时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="create_time" label="入库时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -121,12 +125,12 @@ ...@@ -121,12 +125,12 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import { Autocomplete, Button, Cascader, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui' import { Autocomplete, Button, Cascader, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, InputNumber, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import { pcaTextArr } from 'element-china-area-data' import { pcaTextArr } from 'element-china-area-data'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Cascader).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Cascader).use(Form).use(Select).use(Option).use(Input).use(InputNumber).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "createConsignmentRecallOrder", name: "createConsignmentRecallOrder",
...@@ -212,10 +216,10 @@ ...@@ -212,10 +216,10 @@
return; return;
} }
// 处理 recall_json,添加 recall_num 字段 // 处理 recall_json,使用用户输入的召回数量
const processedRecallJson = this.recall_json.map(item => ({ const processedRecallJson = this.recall_json.map(item => ({
...item, ...item,
recall_num: item.useable_qty recall_num: item.recall_num
})); }));
this.$confirm(`<p style="font-size: 13px;">确定将选择的库存提交寄售召回?</p><p style="color: #FF7E11;font-size: 13px;">提交后,猎芯将进行出库作业,寄回到指定收货地址</p>`, '提交', { this.$confirm(`<p style="font-size: 13px;">确定将选择的库存提交寄售召回?</p><p style="color: #FF7E11;font-size: 13px;">提交后,猎芯将进行出库作业,寄回到指定收货地址</p>`, '提交', {
...@@ -363,7 +367,11 @@ ...@@ -363,7 +367,11 @@
const res = await this.$http('GET', "/api/consignmentRecall/getWmsStockList", params); const res = await this.$http('GET', "/api/consignmentRecall/getWmsStockList", params);
if (res.code === 0) { if (res.code === 0) {
this.recall_json = res.data.list || []; // 为每个库存项添加默认召回数量
this.recall_json = (res.data.list || []).map(item => ({
...item,
recall_num: item.useable_qty // 默认召回全部可用库存
}));
this.$message.success('成功添加全部商品'); this.$message.success('成功添加全部商品');
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -375,7 +383,10 @@ ...@@ -375,7 +383,10 @@
} }
} else { } else {
// 添加选中的库存 // 添加选中的库存
const uniqueItems = checkDuplicate(this.multipleSelection); const uniqueItems = checkDuplicate(this.multipleSelection).map(item => ({
...item,
recall_num: item.useable_qty // 默认召回全部可用库存
}));
this.recall_json = [...this.recall_json, ...uniqueItems]; this.recall_json = [...this.recall_json, ...uniqueItems];
this.$message.success('成功添加选中商品'); this.$message.success('成功添加选中商品');
} }
...@@ -443,6 +454,22 @@ ...@@ -443,6 +454,22 @@
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
/** /**
* 处理召回数量变化
* @param {number} index - 当前行的索引
* @param {object} row - 当前行数据
*/
handleRecallQtyChange(index, row) {
// 确保召回数量不超过可用库存数量
if (row.recall_num > row.useable_qty) {
row.recall_num = row.useable_qty;
this.$message.warning('召回数量不能超过可用库存数量');
}
// 确保召回数量不小于1
if (row.recall_num < 1) {
row.recall_num = 1;
}
},
/**
* 删除召回库存明细 * 删除召回库存明细
* @param {number} index - 当前行的索引 * @param {number} index - 当前行的索引
* @param {object} row - 当前行数据 * @param {object} row - 当前行数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment