| | |
| | | <!-- 操作按钮区 --> |
| | | <el-space> |
| | | <!-- <el-button type="danger" :icon="Delete">删除</el-button>--> |
| | | <el-button type="info" plain :icon="Download">导出</el-button> |
| | | <!-- <el-button type="info" plain :icon="Download">导出</el-button> --> |
| | | <el-button type="success" plain :icon="Refresh" v-if="activeTab=== 'officialInventory'" @click="mergeRows('merge')">合并</el-button> |
| | | </el-space> |
| | | <div> |
| | |
| | | <el-table-column prop="totalPriceIncludingTax" label="总价(含税)" width="130" /> |
| | | <el-table-column prop="priceExcludingTax" label="单价(不含税)" width="130" /> |
| | | <el-table-column prop="totalPriceExcludingTax" label="总价(不含税)" width="130" /> |
| | | <el-table-column prop="pendingReplenishment" label="待补库" width="130" /> |
| | | <el-table-column prop="pendingReplenishment" label="待补库" width="130" v-if="activeTab=== 'officialInventory'"/> |
| | | <el-table-column label="煤质" align="center" v-if="activeTab=== 'officialInventory'" width="600"> |
| | | <el-table-column v-for="col in columnTitle" :key="col.prop" :prop="col.prop" :label="col.label" align="center" sortable min-width="200"/> |
| | | </el-table-column> |
| | | <el-table-column prop="registrantId" label="登记人" width="180"/> |
| | | <el-table-column prop="registrant" label="登记人" width="180"/> |
| | | <el-table-column prop="registrationDate" label="登记日期" width="180"/> |
| | | <el-table-column fixed="right" label="操作" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="180px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供货商名称" prop="supplierName"> |
| | | <el-input v-model="form.supplierName" placeholder="请输入供货商名称" maxlength="30" /> |
| | | <el-form-item label="供应商名称" prop="supplierId"> |
| | | <el-select v-model="form.supplierId" placeholder="请选择供应商"> |
| | | <el-option :label="item.label" v-for="item in supplyList" :key="item.value" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="煤种" prop="coal"> |
| | | <el-input v-model="form.coal" placeholder="请输入煤种" maxlength="30" /> |
| | | <el-form-item label="煤种" prop="coalId"> |
| | | <el-select v-model="form.coalId" placeholder="请选择煤种"> |
| | | <el-option :label="item.label" v-for="item in coalList" :key="item.value" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="煤质方案" prop="qualityPlan"> |
| | | <el-select v-model="form.qualityPlan" placeholder="请选择" @change="coalPlanByIdList" clearable> |
| | | <el-form-item label="煤质方案" prop="coalPlanId"> |
| | | <el-select v-model="form.coalPlanId" placeholder="请选择" @change="coalPlanByIdList" clearable> |
| | | <el-option |
| | | v-for="dict in qualityPlanOption" |
| | | :key="dict.id" |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 合并数据弹框 --> |
| | | <el-dialog title="合并库存" v-model="mergeVisible" width="800px"> |
| | | <el-dialog :title="operationType.value === 'edit' ? '编辑库存' : '合并库存'" v-model="mergeVisible" width="800px"> |
| | | <el-form :model="mergeForm" :rules="mergeRules" ref="mergeRef" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供货商名称" prop="supplierName"> |
| | | <el-input v-model="mergeForm.supplierName" placeholder="请输入供货商名称" maxlength="30" /> |
| | | <el-form-item label="供应商名称" prop="supplierId"> |
| | | <el-select v-model="mergeForm.supplierId" placeholder="请选择供应商"> |
| | | <el-option :label="item.label" v-for="item in supplyList" :key="item.value" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="煤种" prop="coal"> |
| | | <el-input v-model="mergeForm.coal" placeholder="请输入煤种" maxlength="30" /> |
| | | <el-form-item label="煤种" prop="coalId"> |
| | | <el-select v-model="mergeForm.coalId" placeholder="请选择煤种"> |
| | | <el-option :label="item.label" v-for="item in coalList" :key="item.value" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="煤质方案" prop="coalPlanId"> |
| | | <el-select v-model="mergeForm.coalPlanId" placeholder="请选择" @change="coalPlanByIdList" clearable> |
| | | <el-option |
| | | v-for="dict in qualityPlanOption" |
| | | :key="dict.id" |
| | | :label="dict.plan" |
| | | :value="dict.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider></el-divider> |
| | | <el-row> |
| | | <el-col :span="12" v-for="item in filteredList" :key="item.id"> |
| | |
| | | pendingInventoryList |
| | | } from "@/api/warehouseManagement/index.js"; |
| | | import {editOfficial, merge} from "../../api/warehouseManagement/index.js"; |
| | | import {getSupplyList} from "@/api/procureMent/index.js"; |
| | | import {getCoalInfoList} from "@/api/production/index.js"; |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | |
| | | totalPriceIncludingTax: '', |
| | | priceExcludingTax: '', |
| | | totalPriceExcludingTax: '', |
| | | qualityPlan: '', |
| | | coalPlanId: '', |
| | | pId: '', |
| | | }, |
| | | mergeForm: { |
| | | supplierName: '', |
| | | coal: '', |
| | | supplierId: '', |
| | | coalId: '', |
| | | unit: '', |
| | | inventoryQuantity: '', |
| | | priceIncludingTax: '', |
| | | totalPriceIncludingTax: '', |
| | | priceExcludingTax: '', |
| | | totalPriceExcludingTax: '', |
| | | qualityPlan: '', |
| | | coalPlanId: '', |
| | | pId: '', |
| | | }, |
| | | rules: { |
| | | supplierName: [{ required: true, message: "请输入供应商名称", trigger: "blur" }], |
| | | coal: [{ required: true, message: "请输入煤种", trigger: "blur" }], |
| | | unit: [{ required: true, message: "请输入单位", trigger: "blur" }], |
| | | qualityPlan: [{ required: true, message: "请选择", trigger: "change" }], |
| | | coalPlanId: [{ required: true, message: "请选择", trigger: "change" }], |
| | | }, |
| | | mergeRules: { |
| | | supplierName: [{ required: true, message: "请输入供应商名称", trigger: "blur" }], |
| | | coal: [{ required: true, message: "请输入煤种", trigger: "blur" }], |
| | | unit: [{ required: true, message: "请输入单位", trigger: "blur" }], |
| | | qualityPlan: [{ required: true, message: "请选择", trigger: "change" }], |
| | | coalPlanId: [{ required: true, message: "请选择", trigger: "change" }], |
| | | } |
| | | }) |
| | | |
| | |
| | | coal: "", |
| | | }) |
| | | const columnTitle = ref([]) |
| | | const supplyList = ref([]); |
| | | const coalList = ref([]); |
| | | |
| | | // 获取供应商下拉和煤种下拉 |
| | | const getDropdownData = async () => { |
| | | try { |
| | | const [supplyRes, coalRes] = await Promise.all([ |
| | | getSupplyList(), |
| | | getCoalInfoList(), |
| | | ]); |
| | | let supplyData = supplyRes.data; |
| | | let coalData = coalRes.data; |
| | | supplyList.value = supplyData.map((item) => ({ |
| | | value: item.id, |
| | | label: item.supplierName, |
| | | })); |
| | | coalList.value = coalData.map((item) => ({ |
| | | value: item.id, |
| | | label: item.coal, |
| | | })); |
| | | } catch (error) { |
| | | ElMessage.error("获取下拉数据失败,请稍后重试"); |
| | | } |
| | | }; |
| | | defineExpose({ |
| | | getDropdownData, |
| | | }); |
| | | onMounted(() => { |
| | | handleTabClick({ props: { name: "pendingInbound" } }); |
| | | }); |
| | |
| | | form.value = {...row} |
| | | form.value.pId = row.id |
| | | inventoryQuantity.value = row.inventoryQuantity |
| | | getDropdownData() |
| | | coalPlanListOptions() |
| | | } |
| | | // 查询煤质方案下拉框 |
| | |
| | | } |
| | | // 合并库存数据方法 |
| | | const mergeRows = (type,row) => { |
| | | coalFieldListOption(); |
| | | getDropdownData() |
| | | coalPlanListOptions() |
| | | mergeVisible.value = true; |
| | | operationType.value = type; |
| | | if (type === 'edit') { |