库存查询的移库与修改
This commit is contained in:
@@ -1,13 +1,28 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询库存单据主列表
|
// 修改
|
||||||
export function listBill(data) {
|
export function editStock(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wisdom/stock/bill/groups',
|
url: '/wisdom/stock/update',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//明细列表
|
//明细列表
|
||||||
export function listStock(data) {
|
export function listStock(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -221,8 +221,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="库存类型" prop="rkType">
|
<el-form-item label="库存类型" prop="operationType">
|
||||||
<el-select v-model="updateData.rkType" placeholder="请选择入库类型" clearable>
|
<el-select v-model="updateData.operationType" placeholder="请选择入库类型" clearable>
|
||||||
<el-option v-for="dict in storeTypeList" :key="dict.id" :label="dict.typeName" :value="dict.typeCode" />
|
<el-option v-for="dict in storeTypeList" :key="dict.id" :label="dict.typeName" :value="dict.typeCode" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -230,8 +230,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="入库时间" prop="rkTime">
|
<el-form-item label="入库时间" prop="operationTime">
|
||||||
<el-date-picker style="width: 100%;" v-model="updateData.rkTime" type="datetime" />
|
<el-date-picker style="width: 100%;" v-model="updateData.operationTime" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" type="datetime" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -243,29 +243,27 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="移库" v-model="openSwitch" append-to-body width="60%">
|
<el-dialog title="移库" v-model="openMove" append-to-body width="60%">
|
||||||
|
<el-form :model="checkStockList">
|
||||||
<el-form :model="switchData">
|
|
||||||
|
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="物料号">
|
<el-form-item label="物料号">
|
||||||
<el-input v-model="showData.wlNo" disabled />
|
<el-input v-model="checkStockList[0].wlNo" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="项目号">
|
<el-form-item label="项目号">
|
||||||
<el-input v-model="showData.xmNo" disabled />
|
<el-input v-model="checkStockList[0].xmNo" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="订单号">
|
<el-form-item label="订单号">
|
||||||
<el-input v-model="showData.sapNo" disabled />
|
<el-input v-model="checkStockList[0].sapNo" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="项目描述">
|
<el-form-item label="项目描述">
|
||||||
<el-input v-model="showData.xmMs" disabled />
|
<el-input v-model="checkStockList[0].xmMs" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -275,10 +273,9 @@
|
|||||||
<el-input v-model="moveReason" type="textarea" />
|
<el-input v-model="moveReason" type="textarea" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table :data="switchData" height="400" style="width: 100%">
|
<el-table :data="checkStockList" height="400" style="width: 100%">
|
||||||
<el-table-column label="数量" align="center">
|
<el-table-column label="数量" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-model="scope.row.realQty" placeholder="数量">
|
<el-input v-model="scope.row.realQty" placeholder="数量">
|
||||||
@@ -287,7 +284,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="仓库" align="center">
|
<el-table-column label="仓库" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-cascader :options="warehouseOptions" v-model="scope.row.toCangku" @change="pcodeListNew"
|
<el-cascader :options="warehouseOptions" v-model="scope.row.toCangku" @change="pcodeList"
|
||||||
:props="{ children: 'children', label: 'warehouseName', value: 'warehouseCode' }" />
|
:props="{ children: 'children', label: 'warehouseName', value: 'warehouseCode' }" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -321,41 +318,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="stockSearch">
|
<script setup name="Stock">
|
||||||
|
import {
|
||||||
import { moveHouse, printTag, listStock } from "@/api/wisdom/stock";
|
moveRecord,
|
||||||
import { getToken } from "@/utils/auth";
|
} from "@/api/wisdom/bill";
|
||||||
import { updateStock } from "@/api/wisdom/inventorySearch";
|
import { editStock, printTag, listStock } from "@/api/wisdom/stock";
|
||||||
import { warehousingDict } from "@/api/information/warehousingtype"; //入库类型
|
import { warehousingDict } from "@/api/information/warehousingtype"; //入库类型
|
||||||
import { materialtypeDict } from "@/api/information/materialtype"; //物资类型
|
import { materialtypeDict } from "@/api/information/materialtype"; //物资类型
|
||||||
import { warehouseAll } from "@/api/information/warehouseinfo"; //所属仓库
|
import { warehouseAll } from "@/api/information/warehouseinfo"; //所属仓库
|
||||||
import { personListDict } from "@/api/system/user"; //理货员
|
import { personListDict } from "@/api/system/user"; //理货员
|
||||||
import { getKwList, getKwAllList } from "@/api/information/pcdedetail"; //库位下拉数据
|
import { getKwAllList } from "@/api/information/pcdedetail"; //库位下拉数据
|
||||||
import { parseTime } from '@/utils/manage'
|
import { parseTime } from '@/utils/manage'
|
||||||
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
const stockList = ref([]);
|
|
||||||
|
|
||||||
const openSwitch = ref(false); //移库
|
|
||||||
const openUpdate = ref(false); //修改
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
|
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
|
|
||||||
const planList = ref([]); //从供应计划中添加列表
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const warehouseCode = ref(''); //所属仓库下拉数据
|
const warehouseCode = ref(''); //所属仓库下拉数据
|
||||||
|
|
||||||
const printList = ref([]) //要打印的数据列表
|
const printList = ref([]) //要打印的数据列表
|
||||||
|
|
||||||
const moveReason = ref("") //移库原因
|
|
||||||
const optionTime = ref([]) //入库时间
|
const optionTime = ref([]) //入库时间
|
||||||
const dialogImageUrl = ref('')
|
const dialogImageUrl = ref('')
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
@@ -363,8 +350,7 @@ const dialogVisible = ref(false)
|
|||||||
const totalMoney = ref(null)
|
const totalMoney = ref(null)
|
||||||
const pcodeCount = ref(null)
|
const pcodeCount = ref(null)
|
||||||
const sumQty = ref(null)
|
const sumQty = ref(null)
|
||||||
const showData = ref({})
|
|
||||||
const updateData = ref({})
|
|
||||||
const printNum = ref(1) //打印机编号
|
const printNum = ref(1) //打印机编号
|
||||||
const printNumList = ref([
|
const printNumList = ref([
|
||||||
{ id: 1, statusName: "1" },
|
{ id: 1, statusName: "1" },
|
||||||
@@ -373,9 +359,6 @@ const printNumList = ref([
|
|||||||
{ id: 4, statusName: "4" }
|
{ id: 4, statusName: "4" }
|
||||||
])
|
])
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
|
||||||
storeData: {}, //入库数据
|
|
||||||
switchData: [], //移库数据
|
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -407,13 +390,13 @@ const data = reactive({
|
|||||||
toCangku: [{ required: true, message: "目标仓库不能为空", trigger: "change" }],
|
toCangku: [{ required: true, message: "目标仓库不能为空", trigger: "change" }],
|
||||||
toPcode: [{ required: true, message: "目标存放位置不能为空", trigger: "change" }],
|
toPcode: [{ required: true, message: "目标存放位置不能为空", trigger: "change" }],
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, storeData, rules, form, switchData } = toRefs(data);
|
const { queryParams, rules } = toRefs(data);
|
||||||
|
|
||||||
|
|
||||||
/** 查询库存单据主列表 */
|
/** 查询库存单据主列表 */
|
||||||
|
const stockList = ref([]);
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listStock(queryParams.value).then(response => {
|
listStock(queryParams.value).then(response => {
|
||||||
@@ -432,20 +415,6 @@ function getSumInfo() {
|
|||||||
//});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 库位字典
|
|
||||||
const kwOptions = ref([]);
|
|
||||||
function pcodeList() {
|
|
||||||
//getKwList().then(response=>{
|
|
||||||
// kwOptions.value = response.data
|
|
||||||
//})
|
|
||||||
}
|
|
||||||
function pcodeListNew(value) {
|
|
||||||
getKwAllList(value[1]).then(response => {
|
|
||||||
kwOptions.value = response.data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//所属仓库字典
|
//所属仓库字典
|
||||||
const warehouseOptions = ref([]);
|
const warehouseOptions = ref([]);
|
||||||
function warehouseFun() {
|
function warehouseFun() {
|
||||||
@@ -478,6 +447,14 @@ function rklxList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 库位字典
|
||||||
|
const kwOptions = ref([]);
|
||||||
|
function pcodeList(value) {
|
||||||
|
getKwAllList(value[1]).then((response) => {
|
||||||
|
kwOptions.value = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
if (warehouseCode.value) {
|
if (warehouseCode.value) {
|
||||||
@@ -509,6 +486,13 @@ function resetQuery() {
|
|||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {
|
||||||
|
proxy.download('wisdom/stock/export', {
|
||||||
|
...queryParams.value
|
||||||
|
}, `库存记录_${parseTime(new Date().getTime(), '{y}年{m}月{d}日 {h}_{i}_{s}')}.xlsx`)
|
||||||
|
}
|
||||||
|
|
||||||
//打印标签
|
//打印标签
|
||||||
function handlePrintTag() {
|
function handlePrintTag() {
|
||||||
if (printList.value.length == 0) {
|
if (printList.value.length == 0) {
|
||||||
@@ -553,40 +537,89 @@ function getSummaries(param) {
|
|||||||
return sums
|
return sums
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 移库弹框
|
||||||
|
const openMove = ref(false); //移库
|
||||||
|
const checkStockList = ref([]); //移库数据
|
||||||
|
const moveReason = ref("") //移库原因
|
||||||
// 移库弹框
|
// 移库弹框
|
||||||
function handleStockYk(row) {
|
function handleStockYk(row) {
|
||||||
showData.value = row
|
checkStockList.value = JSON.parse(JSON.stringify([row]));
|
||||||
switchData.value = []
|
moveReason.value = "";
|
||||||
moveReason.value = ""
|
if (checkStockList.value.length != 1) {
|
||||||
openSwitch.value = true
|
proxy.$modal.msgError("请勾选一条数据");
|
||||||
|
return;
|
||||||
const {
|
}
|
||||||
realQty: realQty,
|
checkStockList.value[0].toCangku = [
|
||||||
pcode: toPcode,
|
checkStockList.value[0].parentWarehouseCode,
|
||||||
trayCode: toTrayCode,
|
checkStockList.value[0].cangku,
|
||||||
parentWarehouseCode: parentWarehouseCode,
|
];
|
||||||
cangku: warehouseCode
|
checkStockList.value[0].toPcode = checkStockList.value[0].pcode;
|
||||||
} = showData.value
|
checkStockList.value[0].toTrayCode = checkStockList.value[0].trayCode;
|
||||||
switchData.value[0] = {
|
checkStockList.value[0].num = checkStockList.value[0].realQty;
|
||||||
realQty,
|
openMove.value = true;
|
||||||
toPcode,
|
pcodeList([
|
||||||
toTrayCode,
|
checkStockList.value[0].parentWarehouseCode,
|
||||||
toCangku: [parentWarehouseCode, warehouseCode]
|
checkStockList.value[0].cangku,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
// 移库提交
|
||||||
|
function submitMoveForm() {
|
||||||
|
if (checkStockList.value.filter((item) => item.realQty == 0).length > 0) {
|
||||||
|
proxy.$modal.msgError("数量不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (checkStockList.value.filter((item) => !item.toPcode).length > 0) {
|
||||||
|
proxy.$modal.msgError("存放位置不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (checkStockList.value.filter((item) => !item.toCangku).length > 0) {
|
||||||
|
proxy.$modal.msgError("仓库不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (checkStockList.value[0].pcode == checkStockList.value[0].toPcode) {
|
||||||
|
proxy.$modal.msgError(
|
||||||
|
"不允许选择原来的库位【" + checkStockList.value[0].pcode + "】"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (checkStockList.value[0].realQty > checkStockList.value[0].num) {
|
||||||
|
proxy.$modal.msgError("移库数量不正确");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let arr = JSON.parse(JSON.stringify(checkStockList.value));
|
||||||
|
arr[0].toCangku = arr[0].toCangku[1];
|
||||||
|
let submitData = {
|
||||||
|
fromRkId: checkStockList.value[0].id,
|
||||||
|
moveReason: moveReason.value,
|
||||||
|
targets: arr,
|
||||||
|
};
|
||||||
|
moveRecord(submitData).then((response) => {
|
||||||
|
if (response.code == 200) {
|
||||||
|
proxy.$modal.msgSuccess("操作成功");
|
||||||
|
//数据列表
|
||||||
|
getList();
|
||||||
|
openMove.value = false;
|
||||||
|
} else {
|
||||||
|
proxy.$modal.msgError("操作失败");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function cancelMove() {
|
||||||
|
openMove.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// 修改弹框
|
||||||
|
const openUpdate = ref(false); //修改
|
||||||
|
const updateData = ref({})
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
openUpdate.value = true
|
openUpdate.value = true
|
||||||
updateData.value = row
|
updateData.value = JSON.parse(JSON.stringify(row))
|
||||||
|
|
||||||
}
|
}
|
||||||
//修改提交
|
//修改提交
|
||||||
function editForm() {
|
function editForm() {
|
||||||
proxy.$refs["updateRef"].validate(valid => {
|
proxy.$refs["updateRef"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// console.log(updateData.value)
|
editStock(updateData.value).then(response => {
|
||||||
updateStock(updateData.value).then(response => {
|
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
openUpdate.value = false
|
openUpdate.value = false
|
||||||
@@ -597,83 +630,10 @@ function editForm() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移库提交
|
|
||||||
function submitMoveForm() {
|
|
||||||
if (switchData.value.length == 0) {
|
|
||||||
proxy.$modal.msgError("请添加数据");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (switchData.value.filter(item => item.realQty == 0).length > 0) {
|
|
||||||
proxy.$modal.msgError("数量不能为空");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (switchData.value.filter(item => !item.toPcode).length > 0) {
|
|
||||||
proxy.$modal.msgError("存放位置不能为空");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (switchData.value.filter(item => !item.toCangku).length > 0) {
|
|
||||||
proxy.$modal.msgError("仓库不能为空");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if(switchData.value.length==1 && printList.value[0].realQty==switchData.value[0].realQty && printList.value[0].pcode==switchData.value[0].toPcode && printList.value[0].cangku==switchData.value[0].toCangku){
|
|
||||||
// proxy.$modal.msgError("请选择新的存放位置");
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if(switchData.value.filter(x=>x.toPcode==printList.value[0].pcode).length>0){
|
|
||||||
// proxy.$modal.msgError("不允许选择原来的库位【"+printList.value[0].pcode+"】");
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// let sumNum=0
|
|
||||||
// for(let i=0;i<switchData.value.length;i++){
|
|
||||||
// sumNum += Number(switchData.value[i].realQty)*1000
|
|
||||||
// }
|
|
||||||
// if(printList.value[0].realQty<sumNum/1000){
|
|
||||||
// proxy.$modal.msgError("移库数量不正确");
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// console.log(switchData.value)
|
|
||||||
// return
|
|
||||||
let arr = JSON.parse(JSON.stringify(switchData.value))
|
|
||||||
// console.log(arr)
|
|
||||||
// return
|
|
||||||
arr[0].toCangku = arr[0].toCangku[1]
|
|
||||||
let submitData = {
|
|
||||||
fromRkId: showData.value.id,
|
|
||||||
moveReason: moveReason.value,
|
|
||||||
targets: arr
|
|
||||||
}
|
|
||||||
moveHouse(submitData).then(response => {
|
|
||||||
if (response.code == 200) {
|
|
||||||
proxy.$modal.msgSuccess("操作成功");
|
|
||||||
//数据列表
|
|
||||||
// getList();
|
|
||||||
handleQuery()
|
|
||||||
openSwitch.value = false
|
|
||||||
} else {
|
|
||||||
proxy.$modal.msgError("操作失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
// console.log(submitData)
|
|
||||||
}
|
|
||||||
function cancelMove() {
|
|
||||||
openSwitch.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
function handleExport() {
|
|
||||||
proxy.download('wisdom/stock/export', {
|
|
||||||
...queryParams.value
|
|
||||||
}, `库存记录_${parseTime(new Date().getTime(), '{y}年{m}月{d}日 {h}_{i}_{s}')}.xlsx`)
|
|
||||||
}
|
|
||||||
|
|
||||||
//统计信息
|
//统计信息
|
||||||
getSumInfo()
|
getSumInfo()
|
||||||
//数据列表
|
//数据列表
|
||||||
getList();
|
getList();
|
||||||
//库位字典
|
|
||||||
pcodeList()
|
|
||||||
//所属仓库
|
//所属仓库
|
||||||
warehouseFun()
|
warehouseFun()
|
||||||
//物资类型
|
//物资类型
|
||||||
@@ -682,7 +642,6 @@ materialFun()
|
|||||||
lhyList()
|
lhyList()
|
||||||
//入库类型下拉数据
|
//入库类型下拉数据
|
||||||
rklxList()
|
rklxList()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.searchBtn {
|
.searchBtn {
|
||||||
|
|||||||
Reference in New Issue
Block a user