Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

肖康 / cloudSystem

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit b5740f64 authored 4 months ago by LJM's avatar LJM
Browse files
Options
  • _('Browse Files')
  • Download
  • Email Patches
  • Plain Diff

寄售库存

parent 5e949a9f
Show whitespace changes
Inline Side-by-side
Showing with 69 additions and 41 deletions
  • src/views/consignmentManagement/consignmentInventory.vue
src/views/consignmentManagement/consignmentInventory.vue
View file @ b5740f64
......@@ -152,7 +152,7 @@
<div class="data-box">
<el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column prop="sku_id" label="SKUID" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_id" label="SKUID" width="160" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_name" label="型号" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_name" label="品牌" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_standard_name" label="猎芯标准品牌" width="150" align="center" :show-overflow-tooltip="true">
......@@ -174,9 +174,9 @@
<el-table-column prop="moq" label="起订量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="mpq" label="标准包装量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="stock" label="库存数量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="" label="可用库存数量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="" label="在途库存" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="" label="安全库存" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="stock" label="可用库存数量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="in_transit_stock" label="在途库存" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="consignment_safe_stock" label="安全库存" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="cn_ladder_price" label="含税销售价(¥)" width="120" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length>0">
<el-popover effect="light" trigger="hover" placement="bottom">
......@@ -259,20 +259,17 @@
</el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
<!--修改库存弹窗-->
</div>
<!--修改安全库存-->
<el-dialog title="修改安全库存" :close-on-click-modal="false" :visible.sync="dialogVisible" width="900px">
<div class="kc-mask">
<el-table :data="kucundata" border max-height="600">
<el-table-column prop="goods_name" label="型号" min-width="25%">
</el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="25%">
</el-table-column>
<el-table-column prop="stock" label="库存数量" min-width="25%">
</el-table-column>
<el-table-column prop="goods_name" label="型号" min-width="25%"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="25%"></el-table-column>
<el-table-column prop="consignment_safe_stock" label="安全库存" min-width="25%"></el-table-column>
<el-table-column label="修改库存" min-width="25%">
<template slot-scope="scope">
<el-input v-model="scope.row.updateStock" placeholder="点击修改" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}">
</el-input>
<el-input v-model="scope.row.updateStock" placeholder="点击修改" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}"></el-input>
</template>
</el-table-column>
</el-table>
......@@ -435,17 +432,14 @@
<!--寄售召回-->
<el-dialog title="寄售召回" :close-on-click-modal="false" :visible.sync="dialogVisibleConsignmentRecall" width="900px">
<div class="kc-mask">
<el-table :data="kucundata" border max-height="600">
<el-table-column prop="goods_name" label="型号" min-width="25%">
</el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="25%">
</el-table-column>
<el-table-column prop="stock" label="可用库存数量" min-width="25%">
</el-table-column>
<el-table :data="consignmentRecallData" border max-height="600">
<el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column>
<el-table-column prop="goods_name" label="型号" min-width="25%"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="25%"></el-table-column>
<el-table-column prop="stock" label="可用库存数量" min-width="25%"></el-table-column>
<el-table-column label="申请召回数量" min-width="25%">
<template slot-scope="scope">
<el-input v-model="scope.row.updateStock" placeholder="点击修改" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}">
</el-input>
<el-input v-model="scope.row.updateStock" placeholder="申请召回数量" @input="validateInput(scope.row)" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}"></el-input>
</template>
</el-table-column>
</el-table>
......@@ -455,7 +449,6 @@
<el-button type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
<Menu/>
</div>
</template>
......@@ -463,7 +456,7 @@
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui'
import Util from "../../tool";
import Util from "@/tool";
Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Tag).use(Link)
......@@ -483,6 +476,7 @@ export default {
dialogVisibleLogDetail: false,//日志详情
dialogVisibleBatchModify: false,//批量修改
dialogVisibleConsignmentRecall: false,//寄售召回
consignmentRecallData: [],//寄售召回数据
logs: [],
downHref: "",
cp_time_val: '',
......@@ -520,10 +514,6 @@ export default {
this.getSkuRankList();
},
methods: {
closeBothDialogs() {
this.dialogVisibleLog = false;
this.dialogVisibleLogDetail = false;
},
/**
* 查看日志
* @param row
......@@ -565,6 +555,13 @@ export default {
});
},
/**
* 关闭弹窗
*/
closeBothDialogs() {
this.dialogVisibleLog = false;
this.dialogVisibleLogDetail = false;
},
/**
* 修改价格删除
* @param index
* @param row
......@@ -990,28 +987,28 @@ export default {
* 修改库存提交
*/
submitKc() {
var arr_ = {}
var self = this;
for (var i = 0; i < self.kucundata.length; i++) {
arr_[self.kucundata[i]['goods_id']] = {
stock: self.kucundata[i]['updateStock']
}
}
this.$http('post', "/api/sku/updateSku", arr_).then(res => {
// 使用reduce将库存数据转换为对象
const stockUpdates = this.kucundata.reduce((acc, item) => ({
...acc,
[item.goods_id]: { stock: item.updateStock }
}), {});
this.$http('post', "/api/sku/updateSku", stockUpdates)
.then(res => {
if (res.code === 0) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getData()
this.dialogVisible = false
this.getData();
this.dialogVisible = false;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
});
},
/**
* 上下架
......@@ -1085,11 +1082,11 @@ export default {
cancelButtonText: '取消',
dangerouslyUseHTMLString: true
}).then(() => {
let sku_ids = this.multipleSelection.map(item => item.sku_id).join(',');
let sku_ids = this.multipleSelection.map(item => item.goods_id).join(',');
this.$http('POST', "/api/consignmentReplenishment/addConsignmentReplenishment", {sku_ids: sku_ids}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
message: res.msg,
type: 'success',
onClose: () => {
this.getData();
......@@ -1104,6 +1101,19 @@ export default {
});
break;
case 3:
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
this.consignmentRecallData = this.multipleSelection.map(item => {
return {
sku_id: item.goods_id,
goods_name: item.goods_name,
brand_name: item.brand_name,
stock: item.stock,
updateStock: item.stock
}
});
this.dialogVisibleConsignmentRecall = true;
break;
}
......@@ -1135,6 +1145,24 @@ export default {
*/
handleUploadError(err, file, fileList) {
this.$message.error('上传失败,请重试');
},
/**
* 输入验证
* @param row
*/
validateInput(row) {
// 转换为数字进行比较
let inputValue = Number(row.updateStock) || 0;
let stockValue = Number(row.stock) || 0;
// 如果输入值大于库存,则设置为库存值
if (inputValue > stockValue) {
row.updateStock = stockValue;
this.$message({
message: '申请召回数量不能大于可用库存数量',
type: 'warning'
});
}
}
},
components: {
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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