| | |
| | | <el-row :gutter="10" style="margin-bottom: 10px"> |
| | | <el-col :span="3"> |
| | | <el-button type="primary" @click="handlData" |
| | | ><el-icon> <Plus /> </el-icon>选择数据</el-button |
| | | > |
| | | <el-icon> |
| | | <Plus/> |
| | | </el-icon> |
| | | 选择数据 |
| | | </el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="4"> |
| | |
| | | <el-button |
| | | @click="handleClose" |
| | | v-if="dialogType === 'add' || dialogType === 'edit'" |
| | | >取 消</el-button |
| | | >取 消 |
| | | </el-button |
| | | > |
| | | <!-- <el-button @click="handleReset" v-if="dialogType === 'edit'" |
| | | >重 置</el-button |
| | | > --> |
| | | <el-button type="primary" :loading="loading" @click="handleSubmit" |
| | | >确 定</el-button |
| | | >确 定 |
| | | </el-button |
| | | > |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | getOfficialAll, |
| | | addOrEditPM, |
| | | getCoalInfoList, |
| | | deleteProductionInventory, |
| | | } from "@/api/production/index.js"; |
| | | import { validateFormData, validateNumber, deepClone, createDefaultProductionRow } from "@/utils/production"; |
| | |
| | | const selectedIds = ref([]); |
| | | const currentRow = ref(null); |
| | | const copyForm = ref(null); |
| | | const coalList = ref([]) |
| | | const supplierList = ref({}); |
| | | // 表格列配置 |
| | | const columns = [ |
| | | { label: "煤种", prop: "coal", minwidth: 120 }, |
| | | {prop: "coalId", label: "煤种", minwidth: 60,slot:false, |
| | | formatter: (row) => { |
| | | return coalList.value.find(coal => coal.id === row.coalId)?.coal || "--"; |
| | | } |
| | | }, |
| | | { label: "库存数量", prop: "inventoryQuantity", minwidth: 100 }, |
| | | { |
| | | label: "使用数量", |
| | |
| | | ]; |
| | | |
| | | const formalDatabaseColumns = ref([ |
| | | { prop: "supplierName", label: "供应商名称", minwidth: 150 }, |
| | | { prop: "coal", label: "煤种类型", minwidth: 60 }, |
| | | {prop: "supplierName", label: "供应商名称", minwidth: 150 |
| | | // ,formatter: (row) => { |
| | | // console.log(row); |
| | | // return supplierList.value[row.supplierId] || "--"; |
| | | // } |
| | | }, |
| | | {prop: "coalId", label: "煤种", minwidth: 60, |
| | | formatter: (row) => { |
| | | // return coalList.value[row.coalId].coal || "--"; |
| | | return coalList.value.find(coal => coal.id === row.coalId)?.coal || "--"; |
| | | } |
| | | }, |
| | | { prop: "inventoryQuantity", label: "库存数量", minwidth: 80 }, |
| | | { prop: "unit", label: "单位", minwidth: 20 }, |
| | | { prop: "priceExcludingTax", label: "单价(不含税)", minwidth: 80 }, |
| | |
| | | // 获取配置数据 |
| | | const handlData = async () => { |
| | | innerVisible.value = true; |
| | | let res = await getOfficialAll(); |
| | | if (res.code === 200) { |
| | | formalDatabaseData.value = res.data; |
| | | let getSupplier = await getOfficialAll(); |
| | | let getCoalName = await getCoalInfoList(); |
| | | coalList.value = getCoalName.data || []; |
| | | supplierList.value = getSupplier.data || []; |
| | | if (getSupplier.code === 200) { |
| | | formalDatabaseData.value = getSupplier.data; |
| | | const existingOfficialIds = tableData.value |
| | | .map((item) => item.officialId) |
| | | .filter((id) => id); |
| | |
| | | selectedIds.value = []; |
| | | ElMessage.success("已清空所有数据"); |
| | | }) |
| | | .catch(() => {}); |
| | | .catch(() => { |
| | | }); |
| | | }; |
| | | |
| | | // 计算总使用量 |
| | |
| | | .el-row > .el-col > h1 { |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | .empty-table > .el-row { |
| | | margin-bottom: 12px; |
| | | } |