| | |
| | | label="操作" |
| | | width="120" |
| | | fixed="right" |
| | | v-if="dialogType !== 'viewRow'" |
| | | v-if="dialogType === 'add'" |
| | | > |
| | | <template #default="{ $index }"> |
| | | <el-button |
| | |
| | | <el-button type="success" :icon="Plus" @click="openDialog('add')"> |
| | | 新增加工 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | :icon="Delete" |
| | | :disabled="!selectedRows.length" |
| | | @click="() => deleteSelected(delPM)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | <!-- <el-button--> |
| | | <!-- type="danger"--> |
| | | <!-- :icon="Delete"--> |
| | | <!-- :disabled="!selectedRows.length"--> |
| | | <!-- @click="() => deleteSelected(delPM)"--> |
| | | <!-- >--> |
| | | <!-- 删除--> |
| | | <!-- </el-button>--> |
| | | </div> |
| | | <!-- 数据表格 --> |
| | | <ETable |
| | |
| | | const defaultRow = { |
| | | process: "工序1", |
| | | unit: "项", |
| | | schedulingNum: "", |
| | | schedulingNum: 0, |
| | | workHours: "", |
| | | schedulingDate: "", |
| | | schedulingUserId: "", |
| | |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div style="font-size: 16px;">待排产数量:{{productionQuantity}}</div> |
| | | <div style="font-size: 16px;">待排产数量:{{pendingQuantity}}</div> |
| | | </el-col> |
| | | <!-- <el-col :span="2"> |
| | | <el-button type="danger" @click="clearAllRows"> |
| | |
| | | const copyForm = ref(null); |
| | | const coalList = ref([]) |
| | | const supplierList = ref([]); |
| | | const productionQuantity = ref(0); |
| | | const pendingQuantity = ref(0); |
| | | |
| | | // 工具函数 |
| | | const debugIdMatching = () => { |
| | |
| | | }; |
| | | |
| | | const editInitialization = async (type, data) => { |
| | | productionQuantity.value = data.productionQuantity; |
| | | pendingQuantity.value = data.productionQuantity - data.pendingQuantity; |
| | | copyForm.value = deepClone(data); |
| | | tableData.value = data.productionInventoryList || []; |
| | | detailsTableData.value = data.productionList || []; |
| | |
| | | } |
| | | let num = 0; |
| | | detailsTableData.value.forEach((row) => { |
| | | num += row.schedulingNum |
| | | num += Number(row.schedulingNum) |
| | | }) |
| | | if(productionQuantity.value < num){ |
| | | console.log(num) |
| | | if(pendingQuantity.value < num){ |
| | | ElMessage.warning("待排产数量不能小于生产明细数量") |
| | | return; |
| | | } |
| | | console.log(copyForm.value) |
| | | detailsTableData.value.forEach((row) => { |
| | |
| | | row.productionId = copyForm.value.id |
| | | row.coalId = copyForm.value.coalId |
| | | }) |
| | | detailsTableData.value[0].productionQuantity = copyForm.value.productionQuantity |
| | | detailsTableData.value[0].productionQuantity = pendingQuantity.value |
| | | try{ |
| | | const res = await addProductionScheduling(detailsTableData.value) |
| | | if (res.code === 200) { |
| | |
| | | <div class="app-container"> |
| | | <!-- 搜索表单 --> |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item label="搜索"> |
| | | <el-input |
| | | v-model="queryParams.searchAll" |
| | | placeholder="请输入关键词" |
| | | clearable |
| | | /> |
| | | <el-form-item label="状态"> |
| | | <el-select style="width: 200px;" clearable v-model="queryParams.searchAll" placeholder="请选择状态"> |
| | | <el-option label="待排产" value="1"></el-option> |
| | | <el-option label="排产中" value="2"></el-option> |
| | | <el-option label="已排产" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | |
| | | } |
| | | }, |
| | | { prop: "producer", label: "生产人", minWidth: 150 }, |
| | | { prop: "productionQuantity", label: "生产数量", minWidth: 120 }, |
| | | { prop: "productionQuantity", label: "排产数量", minWidth: 120 }, |
| | | { prop: "pendingQuantity", label: "已排产数量", minWidth: 120, |
| | | formatter: (row) => { |
| | | return row.pendingQuantity || '0'; |
| | | } |
| | | }, |
| | | { prop: "laborCost", label: "人工成本", minWidth: 150 }, |
| | | { prop: "energyConsumptionCost", label: "能耗成本", minWidth: 120 }, |
| | | { prop: "equipmentDepreciation", label: "设备折旧", minWidth: 143 }, |
| | |
| | | <div class="app-container"> |
| | | <!-- 搜索表单 --> |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item label="搜索"> |
| | | <el-input |
| | | v-model="queryParams.searchAll" |
| | | placeholder="请输入关键词" |
| | | clearable |
| | | /> |
| | | <el-form-item label="状态"> |
| | | <el-select style="width: 200px;" clearable v-model="queryParams.searchAll" placeholder="请选择状态"> |
| | | <el-option label="待生产" value="1"></el-option> |
| | | <el-option label="生产中" value="2"></el-option> |
| | | <el-option label="已入库" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | |
| | | <!-- 主要内容区域 --> |
| | | <el-card> |
| | | <!-- 操作按钮 --> |
| | | <div class="toolbar"> |
| | | <el-button |
| | | type="danger" |
| | | :icon="Delete" |
| | | :disabled="!selectedRows.length" |
| | | @click="() => deleteSelected(delProductionScheduling)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | <!-- <div class="toolbar">--> |
| | | <!-- <el-button--> |
| | | <!-- type="danger"--> |
| | | <!-- :icon="Delete"--> |
| | | <!-- :disabled="!selectedRows.length"--> |
| | | <!-- @click="() => deleteSelected(delProductionScheduling)"--> |
| | | <!-- >--> |
| | | <!-- 删除--> |
| | | <!-- </el-button>--> |
| | | <!-- </div>--> |
| | | <!-- 数据表格 --> |
| | | <ETable |
| | | :showOverflowTooltip="false" |