|
|
|
@ -142,7 +142,8 @@ import { getWmsItemRecpt, executeWmsItemRecpt } from '@/service/api/wms/recpt';
|
|
|
|
import { selectWmsItemRecptLineList, delWmsItemRecptLine } from '@/service/api/wms/recptLine';
|
|
|
|
import { selectWmsItemRecptLineList, delWmsItemRecptLine } from '@/service/api/wms/recptLine';
|
|
|
|
import { useDelBtn, useBackBtn, useBtn } from '@/hooks/common/useBtn';
|
|
|
|
import { useDelBtn, useBackBtn, useBtn } from '@/hooks/common/useBtn';
|
|
|
|
import { getlist, getWarehouseAreaList } from '@/service/api/wms/warehouse';
|
|
|
|
import { getlist, getWarehouseAreaList } from '@/service/api/wms/warehouse';
|
|
|
|
|
|
|
|
import { useSocketStore } from '@/store/modules/socket/index';
|
|
|
|
|
|
|
|
const socketStore = useSocketStore();
|
|
|
|
const info = ref<boolean>(false);
|
|
|
|
const info = ref<boolean>(false);
|
|
|
|
const dataRef = ref<FormInst | null>(null);
|
|
|
|
const dataRef = ref<FormInst | null>(null);
|
|
|
|
// import { createRequiredFormRule } from '~/src/utils';
|
|
|
|
// import { createRequiredFormRule } from '~/src/utils';
|
|
|
|
@ -150,6 +151,7 @@ const dataRef = ref<FormInst | null>(null);
|
|
|
|
const rules: any = {};
|
|
|
|
const rules: any = {};
|
|
|
|
const storageOptions = ref<{ value: string; label: string }[]>([]);
|
|
|
|
const storageOptions = ref<{ value: string; label: string }[]>([]);
|
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
|
|
|
|
|
|
|
|
|
const { wms_item_recpt_status, wms_item_recpt_type } = proxy.useDict('wms_item_recpt_status', 'wms_item_recpt_type');
|
|
|
|
const { wms_item_recpt_status, wms_item_recpt_type } = proxy.useDict('wms_item_recpt_status', 'wms_item_recpt_type');
|
|
|
|
console.log(wms_item_recpt_type);
|
|
|
|
console.log(wms_item_recpt_type);
|
|
|
|
|
|
|
|
|
|
|
|
@ -359,6 +361,10 @@ const columns: Ref<DataTableColumns<wms.recptLineRawType.columns>> = ref([
|
|
|
|
key: 'warehouseName',
|
|
|
|
key: 'warehouseName',
|
|
|
|
width: 180,
|
|
|
|
width: 180,
|
|
|
|
render: row => {
|
|
|
|
render: row => {
|
|
|
|
|
|
|
|
row.warehouseId = options.value[0]?.id;
|
|
|
|
|
|
|
|
row.areaId = options.value[0]?.id;
|
|
|
|
|
|
|
|
row.locationId = options.value[0]?.pid;
|
|
|
|
|
|
|
|
row.areaName = options.value[0]?.pname;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<n-cascader
|
|
|
|
<n-cascader
|
|
|
|
disabled={info.value}
|
|
|
|
disabled={info.value}
|
|
|
|
@ -490,6 +496,10 @@ function getWmsItemRecptLineData() {
|
|
|
|
startLoading();
|
|
|
|
startLoading();
|
|
|
|
selectWmsItemRecptLineList({ params: searchForm.value }).then(res => {
|
|
|
|
selectWmsItemRecptLineList({ params: searchForm.value }).then(res => {
|
|
|
|
data.value = res.rows;
|
|
|
|
data.value = res.rows;
|
|
|
|
|
|
|
|
// row.warehouseId = _value;
|
|
|
|
|
|
|
|
// row.areaId = item.id;
|
|
|
|
|
|
|
|
// row.locationId = item.pid;
|
|
|
|
|
|
|
|
// row.areaName = item.pname;
|
|
|
|
if (!Array.isArray(res.rows)) return;
|
|
|
|
if (!Array.isArray(res.rows)) return;
|
|
|
|
data.value.forEach(item => {
|
|
|
|
data.value.forEach(item => {
|
|
|
|
item.quantitySavedTemp = item.quantitySaved;
|
|
|
|
item.quantitySavedTemp = item.quantitySaved;
|
|
|
|
@ -617,6 +627,8 @@ function getRecptInfo() {
|
|
|
|
getWmsItemRecpt(route.query.id as string).then(res => {
|
|
|
|
getWmsItemRecpt(route.query.id as string).then(res => {
|
|
|
|
// console.log(res, res.data.salseDeptId, '11');
|
|
|
|
// console.log(res, res.data.salseDeptId, '11');
|
|
|
|
RecptInfo.value = res.data;
|
|
|
|
RecptInfo.value = res.data;
|
|
|
|
|
|
|
|
console.log('res.data ==>', res.data);
|
|
|
|
|
|
|
|
|
|
|
|
RecptInfo.value.recptDate = new Date(RecptInfo.value.recptDate as unknown as string).getTime();
|
|
|
|
RecptInfo.value.recptDate = new Date(RecptInfo.value.recptDate as unknown as string).getTime();
|
|
|
|
// salesUser(res.data.salseDeptId);
|
|
|
|
// salesUser(res.data.salseDeptId);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -650,20 +662,25 @@ function headSelect(_val, item) {
|
|
|
|
// RecptInfo.value.salseBy = item.userId;
|
|
|
|
// RecptInfo.value.salseBy = item.userId;
|
|
|
|
// RecptInfo.value.salseByNick = item.nickName;
|
|
|
|
// RecptInfo.value.salseByNick = item.nickName;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
function getStorage(val) {
|
|
|
|
async function getStorage(val) {
|
|
|
|
if (!val) return;
|
|
|
|
if (!val) return;
|
|
|
|
getWarehouseAreaList(val).then(res => {
|
|
|
|
await getWarehouseAreaList(val).then(res => {
|
|
|
|
options.value = res.data;
|
|
|
|
options.value = res.data;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function submitInfo() {
|
|
|
|
function submitInfo() {
|
|
|
|
dataRef.value?.validate(err => {
|
|
|
|
dataRef.value?.validate(err => {
|
|
|
|
if (!err) {
|
|
|
|
if (!err) {
|
|
|
|
console.log('校验通过', data.value);
|
|
|
|
|
|
|
|
RecptInfo.value.lineList = data.value;
|
|
|
|
RecptInfo.value.lineList = data.value;
|
|
|
|
executeWmsItemRecpt(RecptInfo.value).then(res => {
|
|
|
|
executeWmsItemRecpt(RecptInfo.value).then(res => {
|
|
|
|
// console.log(res);
|
|
|
|
// console.log(res);
|
|
|
|
if (res.code === 200) {
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
|
|
socketStore.setMsg(
|
|
|
|
|
|
|
|
JSON.stringify({
|
|
|
|
|
|
|
|
templateType: 'YL-MB',
|
|
|
|
|
|
|
|
printValue: res.data.lineList
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
);
|
|
|
|
message.success('入库成功');
|
|
|
|
message.success('入库成功');
|
|
|
|
router.go(-1);
|
|
|
|
router.go(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -673,10 +690,10 @@ function submitInfo() {
|
|
|
|
// console.log(RecptInfo.value, data.value, '--------');
|
|
|
|
// console.log(RecptInfo.value, data.value, '--------');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
async function init() {
|
|
|
|
info.value = Boolean(route.query.info);
|
|
|
|
info.value = Boolean(route.query.info);
|
|
|
|
getWmsItemRecptLineData();
|
|
|
|
getWmsItemRecptLineData();
|
|
|
|
getRecptInfo();
|
|
|
|
|
|
|
|
getlist({}).then(res => {
|
|
|
|
getlist({}).then(res => {
|
|
|
|
if (!Array.isArray(res.data)) return;
|
|
|
|
if (!Array.isArray(res.data)) return;
|
|
|
|
res.data.forEach(item => {
|
|
|
|
res.data.forEach(item => {
|
|
|
|
@ -687,7 +704,8 @@ function init() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
getStorage(route.query.warehouseId as string);
|
|
|
|
await getStorage(route.query.warehouseId as string);
|
|
|
|
|
|
|
|
getRecptInfo();
|
|
|
|
getUser();
|
|
|
|
getUser();
|
|
|
|
// 获取部门信息
|
|
|
|
// 获取部门信息
|
|
|
|
// getDeptTree();
|
|
|
|
// getDeptTree();
|
|
|
|
|