Compare commits

...

3 Commits

@ -99,17 +99,21 @@
<dict-tag :options="wms_in_stock_type" :value="scope.row.inStockType" />
</template>
</el-table-column>
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[4].visible" />
<el-table-column label="所属项目" align="center" prop="projectId" v-if="columns[4].visible">
<template #default="scope">
{{ getProjectName(scope.row.projectId) }}
</template>
</el-table-column>
<el-table-column label="关联单号" align="center" prop="inventoryAmount" v-if="columns[5].visible" />
<el-table-column label="供应商" align="center" prop="supplierName" v-if="columns[6].visible" />
<el-table-column label="联系人" align="center" prop="contactUser" v-if="columns[7].visible" />
<el-table-column label="联系电话" align="center" prop="contactNumber" v-if="columns[8].visible" />
<el-table-column label="入库说明" align="center" prop="directions" v-if="columns[9].visible" />
<!-- <el-table-column label="入库单状态" align="center" prop="inStockBillStatus" v-if="columns[10].visible">-->
<!--<el-table-column label="入库单状态" align="center" prop="inStockBillStatus" v-if="columns[10].visible">-->
<!-- <template #default="scope">-->
<!-- <dict-tag :options="wms_in_stock_bill_status" :value="scope.row.inStockBillStatus" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!--</el-table-column>-->
<!-- <el-table-column label="流程状态" align="center" prop="flowStatus" v-if="columns[11].visible">-->
<!-- <template #default="scope">-->
<!-- <dict-tag :options="wf_business_status" :value="scope.row.flowStatus"></dict-tag>-->
@ -310,13 +314,6 @@ import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo'; // 添加展
import ProductSelect from '@/components/WmsProductSelect/index.vue';
import { parseTime } from '@/utils/ruoyi';
const projectInfoList = ref([]); //
/** 获取项目列表 */
const getProjectInfoList = async () => {
const res = await getErpProjectInfoList({});
projectInfoList.value = res.data || [];
};
//
const handleExpandChange = async (row, expandedRows) => {
if (expandedRows.length && !row.data) {
@ -332,18 +329,30 @@ const handleExpandChange = async (row, expandedRows) => {
//
const productSelectRef = ref();
//
const selectedProducts = ref([]);
//
const projectInfoList = ref([]);
/** 获取项目列表 */
const getProjectInfoList = async () => {
const res = await getErpProjectInfoList({});
projectInfoList.value = res.data || [];
};
//
const openProductSelect = () => {
productSelectRef.value.open();
};
/** 根据项目ID获取项目名称 */
const getProjectName = (projectId) => {
const project = projectInfoList.value.find((item) => item.projectId === projectId);
return project ? project.projectCode : projectId;
};
//
const handleProductSelect = (products) => {
selectedProducts.value = products;
//
// selectedProducts.value = products;
//
const timestamp = parseTime(new Date(), '{y}{m}{d}');
products.forEach((material) => {
@ -357,6 +366,7 @@ const handleProductSelect = (products) => {
material.inStockAmount = 1; // 1
material.totalPrice = (material.unitPrice * material.inStockAmount).toFixed(2);
});
selectedProducts.value.push(...products);
};
//
@ -433,11 +443,11 @@ const columns = ref<FieldOption[]>([
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `入库单号`, visible: true },
{ key: 3, label: `入库单类型`, visible: true },
{ key: 4, label: `项目ID`, visible: true },
{ key: 4, label: `所属项目`, visible: true },
{ key: 5, label: `关联单号`, visible: true },
{ key: 6, label: `供应商`, visible: true },
{ key: 7, label: `联系人`, visible: true },
{ key: 8, label: `联系电话`, visible: true },
{ key: 7, label: `联系人`, visible: false },
{ key: 8, label: `联系电话`, visible: false },
{ key: 9, label: `入库说明`, visible: true },
{ key: 10, label: `入库单状态`, visible: true },
{ key: 11, label: `流程状态`, visible: true },
@ -448,7 +458,7 @@ const columns = ref<FieldOption[]>([
{ key: 16, label: `创建人`, visible: false },
{ key: 17, label: `创建时间`, visible: true },
{ key: 18, label: `更新人`, visible: false },
{ key: 19, label: `更新时间`, visible: true }
{ key: 19, label: `更新时间`, visible: false }
]);
const initFormData: InStockBillForm = {
@ -580,11 +590,11 @@ const handleAddSubmit = () => {
//
const invalidMaterials = selectedProducts.value.filter((material) => {
return !material.unitPrice || material.unitPrice <= 0 || !material.inStockAmount || material.inStockAmount <= 0 || !material.warehouseId;
return !material.inStockAmount || material.inStockAmount <= 0 || !material.warehouseId;
});
if (invalidMaterials.length > 0) {
proxy?.$modal.msgError('请完善物料信息,确保单价和数量都大于0且选择了仓库');
proxy?.$modal.msgError('请完善物料信息,确保数量都大于0且选择了仓库');
return;
}

Loading…
Cancel
Save