| | |
| | | </el-row> |
| | | </el-form> |
| | | <div class="box_container"> |
| | | <div class="title_text">管路规划产能</div> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <div class="title_text">管路规划产能</div> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-button |
| | | class="title_btn" |
| | | type="primary" |
| | | @click="saveRowEvent" |
| | | v-hasPermi="['aps:gasPipelineCapacityPlan:add']" |
| | | > |
| | | 保存 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <div class="tabel_container"> |
| | | <!-- <HxlhTable |
| | | style="width: 100%" |
| | |
| | | show-overflow |
| | | :loading="loading" |
| | | :height="height" |
| | | :edit-config="{ trigger: 'manual', mode: 'row', showStatus: true }" |
| | | :edit-config="{ trigger: 'click', mode: 'row', showStatus: true }" |
| | | :data="routePlanList" |
| | | size="small" |
| | | @cell-click="cellClickEvent" |
| | |
| | | <el-input type="textarea" v-model="row.remark" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column title="操作" width="200" fixed="right"> |
| | | <!-- <template #default="{ row }"> |
| | | <vxe-button @click="handleSave(row)" :loading="row.loading" |
| | | >保存</vxe-button |
| | | > --> |
| | | <!-- <vxe-column title="操作" width="200" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <template v-if="hasEditStatus(row)"> |
| | | <el-button @click="saveRowEvent(row)" v-hasPermi="['aps:gasPipelineCapacityPlan:add']">保存</el-button> |
| | | <el-button |
| | | @click="saveRowEvent(row)" |
| | | v-hasPermi="['aps:gasPipelineCapacityPlan:add']" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="cancelRowEvent()">取消</el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button @click="editRowEvent(row)">编辑</el-button> |
| | | </template> |
| | | </template> |
| | | <!-- </template> --> |
| | | </vxe-column> |
| | | </vxe-column> --> |
| | | </vxe-table> |
| | | </div> |
| | | </div> |
| | | <div class="box_container"> |
| | | <div class="title_text">气柜规划产能</div> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <div class="title_text">气柜规划产能</div> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-button |
| | | class="title_btn" |
| | | type="primary" |
| | | @click="saveRowEvent1" |
| | | v-hasPermi="['aps:gasPipelineCapacityPlan:add']" |
| | | > |
| | | 保存 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="tabel_container"> |
| | | <!-- <HxlhTable |
| | | style="width: 100%" |
| | |
| | | <el-input type="textarea" v-model="row.remark" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column title="操作" width="200" fixed="right"> |
| | | <!-- <template #default="{ row }"> |
| | | <el-button @click="handleSave(row)" :loading="row.loading" |
| | | >保存</el-button |
| | | > --> |
| | | <!-- <vxe-column title="操作" width="200" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <template v-if="hasEditStatus1(row)"> |
| | | <el-button @click="saveRowEvent1(row)" v-hasPermi="['aps:gasPipelineCapacityPlan:add']">保存</el-button> |
| | | <el-button |
| | | @click="saveRowEvent1(row)" |
| | | v-hasPermi="['aps:gasPipelineCapacityPlan:add']" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="cancelRowEvent1()">取消</el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button @click="editRowEvent1(row)">编辑</el-button> |
| | | </template> |
| | | </template> |
| | | <!-- </template> --> |
| | | </vxe-column> |
| | | </vxe-column> --> |
| | | </vxe-table> |
| | | <!-- <div class="btn_center"> |
| | | <el-button type="primary" @click="handleSave2">保存</el-button> |
| | |
| | | date: "", |
| | | }, |
| | | }); |
| | | const tableRef = ref() |
| | | const tableRef1 = ref() |
| | | const tableRef = ref(); |
| | | const tableRef1 = ref(); |
| | | const { queryParams } = toRefs(data); |
| | | const gasPlanList = ref([]); |
| | | const routePlanList = ref([]); |
| | |
| | | // type: "html", |
| | | // }, |
| | | // ]); |
| | | const hasEditStatus = (row) => { |
| | | const $table = tableRef.value |
| | | if ($table) { |
| | | return $table.isEditByRow(row) |
| | | } |
| | | } |
| | | const editRowEvent = (row) => { |
| | | const $table = tableRef.value |
| | | if ($table) { |
| | | $table.setEditRow(row) |
| | | } |
| | | } |
| | | // const hasEditStatus = (row) => { |
| | | // const $table = tableRef.value; |
| | | // if ($table) { |
| | | // return $table.isEditByRow(row); |
| | | // } |
| | | // }; |
| | | // const editRowEvent = (row) => { |
| | | // const $table = tableRef.value; |
| | | // if ($table) { |
| | | // $table.setEditRow(row); |
| | | // } |
| | | // }; |
| | | const saveRowEvent = (row) => { |
| | | const $table = tableRef.value |
| | | if (!queryParams.value.date) { |
| | | ElMessage({ |
| | | message: "请选择年月", |
| | | type: "error", |
| | | }); |
| | | return; |
| | | } |
| | | const $table = tableRef.value; |
| | | if ($table) { |
| | | $table.clearEdit().then(() => { |
| | | // loading.value = true |
| | |
| | | // loading.value = false |
| | | // VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' }) |
| | | // }, 300) |
| | | handleSave(row) |
| | | }) |
| | | handleSave("管路"); |
| | | }); |
| | | } |
| | | } |
| | | const cancelRowEvent = () => { |
| | | const $table = tableRef.value |
| | | if ($table) { |
| | | $table.clearEdit() |
| | | } |
| | | } |
| | | const hasEditStatus1 = (row) => { |
| | | const $table = tableRef1.value |
| | | if ($table) { |
| | | return $table.isEditByRow(row) |
| | | } |
| | | } |
| | | const editRowEvent1 = (row) => { |
| | | const $table = tableRef1.value |
| | | if ($table) { |
| | | $table.setEditRow(row) |
| | | } |
| | | } |
| | | }; |
| | | // const cancelRowEvent = () => { |
| | | // const $table = tableRef.value; |
| | | // if ($table) { |
| | | // $table.clearEdit(); |
| | | // } |
| | | // }; |
| | | // const hasEditStatus1 = (row) => { |
| | | // const $table = tableRef1.value; |
| | | // if ($table) { |
| | | // return $table.isEditByRow(row); |
| | | // } |
| | | // }; |
| | | // const editRowEvent1 = (row) => { |
| | | // const $table = tableRef1.value; |
| | | // if ($table) { |
| | | // $table.setEditRow(row); |
| | | // } |
| | | // }; |
| | | const saveRowEvent1 = (row) => { |
| | | const $table = tableRef1.value |
| | | if (!queryParams.value.date) { |
| | | ElMessage({ |
| | | message: "请选择年月", |
| | | type: "error", |
| | | }); |
| | | return; |
| | | } |
| | | const $table = tableRef1.value; |
| | | if ($table) { |
| | | $table.clearEdit().then(() => { |
| | | // loading.value = true |
| | |
| | | // loading.value = false |
| | | // VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' }) |
| | | // }, 300) |
| | | handleSave2(row) |
| | | }) |
| | | handleSave("气柜"); |
| | | }); |
| | | } |
| | | } |
| | | const cancelRowEvent1 = () => { |
| | | const $table = tableRef1.value |
| | | if ($table) { |
| | | $table.clearEdit() |
| | | } |
| | | } |
| | | }; |
| | | // const cancelRowEvent1 = () => { |
| | | // const $table = tableRef1.value; |
| | | // if ($table) { |
| | | // $table.clearEdit(); |
| | | // } |
| | | // }; |
| | | async function getRouteList(year, month) { |
| | | const res = await listGasPlan({ |
| | | major: "管路", |
| | |
| | | routePlanList.value = routePlanList.value.map((item, index) => { |
| | | return { |
| | | ...item, |
| | | dayProduceType: item.dayProduceType == null ? "" : item.dayProduceType, |
| | | dayProduceType: |
| | | item.dayProduceType == null ? "单人日产出" : item.dayProduceType, |
| | | dayProduceNum: item.dayProduceNum == null ? "0" : item.dayProduceNum, |
| | | dayProduceUnit: item.dayProduceUnit == null ? "个" : item.dayProduceUnit, |
| | | dayProduceUnit: |
| | | item.dayProduceUnit == null ? "小时" : item.dayProduceUnit, |
| | | personnelNumber: |
| | | item.personnelNumber == null ? "1" : item.personnelNumber, |
| | | dayProduceAllNum: |
| | |
| | | year, |
| | | month, |
| | | }); |
| | | console.log(res.rows, "getList"); |
| | | gasPlanList.value = res.rows; |
| | | gasPlanList.value = gasPlanList.value.map((item, index) => { |
| | | return { |
| | | ...item, |
| | | dayProduceType: item.dayProduceType == null ? "" : item.dayProduceType, |
| | | dayProduceType: |
| | | item.dayProduceType == null ? "单人日产出" : item.dayProduceType, |
| | | dayProduceNum: item.dayProduceNum == null ? "0" : item.dayProduceNum, |
| | | dayProduceUnit: item.dayProduceUnit == null ? "个" : item.dayProduceUnit, |
| | | dayProduceUnit: |
| | | item.dayProduceUnit == null ? "小时" : item.dayProduceUnit, |
| | | personnelNumber: |
| | | item.personnelNumber == null ? "1" : item.personnelNumber, |
| | | dayProduceAllNum: |
| | |
| | | row.monthProduceAllNum = row.dayProduceAllNum * row.days; |
| | | } |
| | | function handleQuery() { |
| | | if(!queryParams.value.date){ |
| | | if (!queryParams.value.date) { |
| | | ElMessage({ |
| | | message: "请选择年月", |
| | | type: "error", |
| | | }); |
| | | return; |
| | | } |
| | | console.log(queryParams.value.date, "scsciciisc"); |
| | | const year = queryParams.value.date.split("-")[0]; |
| | | const month = parseInt(queryParams.value.date.split("-")[1]); |
| | | getRouteList(year, month); |
| | | getGasList(year, month); |
| | | } |
| | | function resetQuery() { |
| | | queryParams.value.date = "" |
| | | queryParams.value.date = ""; |
| | | } |
| | | async function handleSave(row) { |
| | | async function handleSave(major) { |
| | | const year = queryParams.value.date.split("-")[0]; |
| | | const month = parseInt(queryParams.value.date.split("-")[1]); |
| | | console.log(row, "baocun"); |
| | | // gasPlanList.value = gasPlanList.value.map((item) => { |
| | | // return { |
| | | // ...item, |
| | | // major: "气体", |
| | | // year, |
| | | // month, |
| | | // }; |
| | | // }); |
| | | // routePlanList.value = routePlanList.value.map((item) => { |
| | | // return { |
| | | // ...item, |
| | | // major: "管路", |
| | | // year, |
| | | // month, |
| | | // }; |
| | | // }); |
| | | const res = await getGasPlanSave([ |
| | | { |
| | | ...row, |
| | | major: "管路", |
| | | year, |
| | | month, |
| | | }, |
| | | ]); |
| | | if (major === "管路") { |
| | | routePlanList.value = routePlanList.value.map((item) => { |
| | | return { |
| | | ...item, |
| | | major: "管路", |
| | | year, |
| | | month, |
| | | }; |
| | | }); |
| | | await getGasPlanSave([...routePlanList.value]); |
| | | } else { |
| | | gasPlanList.value = gasPlanList.value.map((item) => { |
| | | return { |
| | | ...item, |
| | | major: "气柜", |
| | | year, |
| | | month, |
| | | }; |
| | | }); |
| | | await getGasPlanSave([...gasPlanList.value]); |
| | | } |
| | | |
| | | ElMessage({ |
| | | message: "数据保存成功", |
| | | type: "success", |
| | | }); |
| | | handleQuery(); |
| | | console.log(res, "akiwjciwj"); |
| | | } |
| | | async function handleSave2(row) { |
| | | const year = queryParams.value.date.split("-")[0]; |
| | |
| | | padding-top: 20px; |
| | | margin-left: 20px; |
| | | } |
| | | .title_btn { |
| | | margin-top: 20px; |
| | | } |
| | | .tabel_container { |
| | | width: 98%; |
| | | margin: 20px auto; |