| | |
| | | @change="(value) => handleCoalSelectChange(row, value)" |
| | | filterable |
| | | :key="`coalId-select-${$index}-${weekList.length}`" |
| | | :disabled="isViewMode" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) of weekList" |
| | |
| | | placeholder="请输入生产数量" |
| | | type="number" |
| | | @input="handleInput('productionQuantity', $index, $event)" |
| | | :disabled="isViewMode" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | placeholder="请输入人工成本" |
| | | type="number" |
| | | @input="handleInput('laborCost', $index, $event)" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template #suffix> |
| | | <i style="font-style: normal">元</i> |
| | |
| | | |
| | | <el-table-column label="能耗成本" min-width="120"> |
| | | <template #default="{ row, $index }"> |
| | | <!-- 不能为负数 --> |
| | | <el-input |
| | | v-model="row.energyConsumptionCost" |
| | | placeholder="请输入能耗成本" |
| | | type="number" |
| | | min="0" |
| | | step="0.01" |
| | | @input="handleInput('energyConsumptionCost', $index, $event)" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template #suffix> |
| | | <i style="font-style: normal">元</i> |
| | |
| | | placeholder="请输入设备折旧" |
| | | type="number" |
| | | @input="handleInput('equipmentDepreciation', $index, $event)" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template #suffix> |
| | | <i style="font-style: normal">元</i> |
| | |
| | | placeholder="请输入采购单价" |
| | | type="number" |
| | | @input="handleInput('purchasePrice', $index, $event)" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template #suffix> |
| | | <i style="font-style: normal">元</i> |
| | |
| | | type="number" |
| | | :readonly="autoCalculate" |
| | | @input="handleInput('totalCost', $index, $event)" |
| | | |
| | | > |
| | | <template #suffix> |
| | | <i style="font-style: normal">元</i> |
| | |
| | | @change="(value) => handleUserSelectChange(row, value)" |
| | | filterable |
| | | :key="`producer-select-${$index}-${userList.length}`" |
| | | :disabled="isViewMode" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) of userList" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="showOperations" |
| | | label="操作" |
| | | width="120" |
| | | fixed="right" |
| | | v-if="dialogType !== 'viewRow'" |
| | | > |
| | | <template #default="{ $index }"> |
| | | <el-button |
| | |
| | | <script setup name="ProductionDetailsTable"> |
| | | import {ref, computed, watch, onMounted, nextTick} from "vue"; |
| | | import {Delete} from "@element-plus/icons-vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {getCoalFieldList} from "@/api/basicInformation/coalQualityMaintenance"; |
| | | import {getCoalInfoList} from "@/api/production"; |
| | | import {userListAll} from "@/api/publicApi"; |
| | |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | dialogType:{ |
| | | type: String, |
| | | default:'add' |
| | | } |
| | | }); |
| | | |
| | | const isViewMode = computed(() => props.dialogType === "viewRow"); |
| | | const emit = defineEmits(["update:modelValue", "input-change", "delete-row"]); |
| | | |
| | | // 使用 v-model 进行双向绑定 |
| | |
| | | |
| | | // 处理输入变化 |
| | | const handleInput = (field, index, value) => { |
| | | // 确保输入值是数字或空字符串而且非负数 |
| | | if (!/^\d*\.?\d*$/.test(value) && value !== "") { |
| | | ElMessage.error("请输入有效的数字"); |
| | | return; |
| | | } |
| | | const newData = [...tableData.value]; |
| | | newData[index][field] = value; |
| | | |