| <template> | 
|   <div class="app-container"> | 
|     <el-form | 
|       class="responsive-form" | 
|       :model="queryParams" | 
|       ref="queryRef" | 
|       :inline="true" | 
|       label-width="100px" | 
|       label-position="left" | 
|     > | 
|       <el-row type="flex" justify="left"> | 
|         <el-col :span="6"> | 
|           <el-form-item :label="$t('plan.query.selectMonth')" prop="description"> | 
|             <el-date-picker | 
|               clearable | 
|               v-model="queryParams.date" | 
|               type="month" | 
|               value-format="YYYY-MM" | 
|               :placeholder="$t('plan.query.selectMonth')" | 
|             > | 
|             </el-date-picker> | 
|           </el-form-item> | 
|         </el-col> | 
|         <el-col :span="18" style="text-align: right"> | 
|           <el-form-item class="column-with-margin"> | 
|             <el-button type="primary" icon="Search" @click="handleQuery" | 
|               >{{$t("common.common.query")}}</el-button | 
|             > | 
|             <el-button icon="Refresh" @click="resetQuery">{{$t("common.common.reset")}}</el-button> | 
|           </el-form-item> | 
|         </el-col> | 
|       </el-row> | 
|     </el-form> | 
|     <div class="box_container"> | 
|       <el-row> | 
|         <el-col :span="!clickedTableRef?22:20"> | 
|           <div class="title_text">{{$t('plan.title.pipePlanCapacity')}}</div> | 
|         </el-col> | 
|         <el-col :span="1" v-if="!clickedTableRef"> | 
|           <el-button  | 
|             class="title_btn" | 
|             type="default" | 
|             @click="editRowEvent" >{{$t("common.common.edit")}}</el-button> | 
|         </el-col> | 
|         <el-col :span="1.8" v-if="clickedTableRef"> | 
|           <el-button | 
|             class="title_btn" | 
|             type="primary" | 
|             @click="saveRowEvent" | 
|             v-hasPermi="['aps:gasPipelineCapacityPlan:add']" | 
|           > | 
|             {{$t("common.common.save")}} | 
|           </el-button> | 
|         </el-col> | 
|         <el-col :span="1" v-if="clickedTableRef">  | 
|           <el-button  | 
|             class="title_btn ml20" | 
|             type="default" | 
|             @click="handleCancleStaus">{{$t("common.common.cancel")}}</el-button> | 
|         </el-col> | 
|       </el-row> | 
|   | 
|       <div class="tabel_container"> | 
|         <!-- <HxlhTable | 
|           style="width: 100%" | 
|           :columns="columns" | 
|           :data="routePlanList" | 
|           :loading="loading" | 
|           :height="height" | 
|           :editConfig="editConfig" | 
|         > | 
|           <template #edit_role="{ row }"> | 
|             <vxe-select | 
|               v-model="row.dayProduceType" | 
|               :options="dayProduceTypeOptions" | 
|               filterable | 
|             ></vxe-select> | 
|           </template> | 
|         </HxlhTable> --> | 
|         <vxe-table | 
|           border | 
|           ref="tableRef" | 
|           show-overflow | 
|           :loading="loading" | 
|           :height="height" | 
|           :column-config="{ resizable: true, useKey: true }" | 
|           :data="routePlanList" | 
|           size="small" | 
|         > | 
|           <vxe-column field="processName" :width="locale === 'zh' ? '150px' : '200px'" :title="$t('plan.table.satndardProcessName')" fixed="left"> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '150px' : '200px'" | 
|             field="dayProduceType" | 
|             :title="$t('plan.table.dayProduceType')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-select | 
|                 clearable | 
|                 v-model="row.dayProduceType" | 
|                 style="width: 140px" | 
|               > | 
|                 <el-option | 
|                   v-for="type in dayProduceTypeOptions" | 
|                   :key="type.value" | 
|                   :label="type.label" | 
|                   :value="type.value" | 
|                 > | 
|                 </el-option> | 
|               </el-select> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ formatTypeLabel([row.dayProduceType]) }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-select | 
|                   clearable | 
|                   v-model="row.dayProduceType" | 
|                   style="width: 140px" | 
|                   @change="handlechangeDayproduceType($event,row)" | 
|                 > | 
|                   <el-option | 
|                     v-for="type in dayProduceTypeOptions" | 
|                     :key="type.value" | 
|                     :label="type.label" | 
|                     :value="type.value" | 
|                   > | 
|                   </el-option> | 
|                 </el-select> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="dayProduceNum" | 
|            :title="$t('plan.table.dayProduceNum')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.dayProduceNum" size="mini" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.dayProduceNum }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number @change="cellClickEvent($event,row)" v-model="row.dayProduceNum" size="mini" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '150px' : '200px'" | 
|             field="dayProduceUnit" | 
|             :title="$t('plan.table.dayProduceUnit')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input v-model="row.dayProduceUnit" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.dayProduceUnit }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input v-model="row.dayProduceUnit" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="personnelNumber" | 
|             :title="$t('plan.table.personnelNumber')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.personnelNumber" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.personnelNumber }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number @change="cellClickEvent($event,row)" v-model="row.personnelNumber" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="dayProduceAllNum" | 
|             :title="$t('plan.table.dayProduceAllNum')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.dayProduceAllNum" disabled /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.dayProduceAllNum }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number v-model="row.dayProduceAllNum" disabled /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="days" | 
|            :title="$t('plan.table.days')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.days" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.days }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number @change="cellClickEvent($event,row)" v-model="row.days" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="monthProduceAllNum" | 
|             :title="$t('plan.table.monthProduceAllNum')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.monthProduceAllNum" disabled /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.monthProduceAllNum }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number v-model="row.monthProduceAllNum" disabled/> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '150px' : '200px'" | 
|             field="remark" | 
|             :title="$t('plan.table.remark')" | 
|           > | 
|           <!-- :edit-render="{ autoFocus: 'input' }" --> | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input | 
|                 type="text" | 
|                 v-model="row.remark" | 
|               /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRef"> | 
|                 <span>{{ row.remark }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input | 
|                   type="text" | 
|                   v-model="row.remark" | 
|                 /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <!-- <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="cancelRowEvent()">取消</el-button> | 
|               </template> | 
|               <template v-else> | 
|                 <el-button @click="editRowEvent(row)">编辑</el-button> | 
|               </template> | 
|             </template> | 
|           </vxe-column> --> | 
|         </vxe-table> | 
|       </div> | 
|     </div> | 
|     <div class="box_container"> | 
|       <el-row> | 
|         <el-col :span="!clickedTableRefGas?22:20"> | 
|           <div class="title_text">{{$t("plan.title.gasPlanCapacity")}}</div> | 
|         </el-col> | 
|         <el-col :span="1" v-if="!clickedTableRefGas"> | 
|           <el-button  | 
|             class="title_btn" | 
|             type="default" | 
|             @click="editRowEventGas" >{{$t("common.common.edit")}}</el-button> | 
|         </el-col> | 
|         <el-col :span="1.8" v-if="clickedTableRefGas"> | 
|           <el-button | 
|             class="title_btn" | 
|             type="primary" | 
|             @click="saveRowEvent1" | 
|             v-hasPermi="['aps:gasPipelineCapacityPlan:add']" | 
|           > | 
|             {{$t("common.common.save")}} | 
|           </el-button> | 
|         </el-col> | 
|         <el-col :span="1" v-if="clickedTableRefGas">  | 
|           <el-button  | 
|             class="title_btn ml20" | 
|             type="default" | 
|             @click="handleCancleStausGas">{{$t("common.common.cancel")}}</el-button> | 
|         </el-col> | 
|       </el-row> | 
|       <div class="tabel_container"> | 
|         <!-- <HxlhTable | 
|           style="width: 100%" | 
|           :columns="columns" | 
|           :data="gasPlanList" | 
|           :loading="loading" | 
|           :height="height" | 
|         > | 
|         </HxlhTable> --> | 
|         <vxe-table | 
|           border | 
|           ref="tableRef1" | 
|           show-overflow | 
|           size="small" | 
|           :loading="loading2" | 
|           :height="height" | 
|           :column-config="{ resizable: true, useKey: true }" | 
|           :data="gasPlanList" | 
|         > | 
|           <vxe-column :width="locale === 'zh' ? '150px' : '200px'" field="processName" :title="$t('plan.table.satndardProcessName')" fixed="left"> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '150px' : '200px'" | 
|             field="dayProduceType" | 
|             :title="$t('plan.table.dayProduceType')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-select | 
|                 clearable | 
|                 v-model="row.dayProduceType" | 
|                 style="width: 140px" | 
|               > | 
|                 <el-option | 
|                   v-for="type in dayProduceTypeOptions" | 
|                   :key="type.value" | 
|                   :label="type.label" | 
|                   :value="type.value" | 
|                 > | 
|                 </el-option> | 
|               </el-select> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ formatTypeLabel([row.dayProduceType]) }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-select | 
|                   clearable | 
|                   v-model="row.dayProduceType" | 
|                   style="width: 140px" | 
|                   @change="handlechangeDayproduceType($event,row)" | 
|                 > | 
|                   <el-option | 
|                     v-for="type in dayProduceTypeOptions" | 
|                     :key="type.value" | 
|                     :label="type.label" | 
|                     :value="type.value" | 
|                   > | 
|                   </el-option> | 
|                 </el-select> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="dayProduceNum" | 
|            :title="$t('plan.table.dayProduceNum')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.dayProduceNum" size="mini" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.dayProduceNum }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number @change="cellClickEvent($event,row)" v-model="row.dayProduceNum" size="mini" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '150px' : '200px'" | 
|             field="dayProduceUnit" | 
|             :title="$t('plan.table.dayProduceUnit')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input v-model="row.dayProduceUnit" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.dayProduceUnit }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input v-model="row.dayProduceUnit" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="personnelNumber" | 
|             :title="$t('plan.table.personnelNumber')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.personnelNumber" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.personnelNumber }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number @change="cellClickEvent($event,row)" v-model="row.personnelNumber" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="dayProduceAllNum" | 
|             :title="$t('plan.table.dayProduceAllNum')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.dayProduceAllNum" disabled /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.dayProduceAllNum }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number v-model="row.dayProduceAllNum" disabled /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="days" | 
|             :title="$t('plan.table.days')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.days" /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.days }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number @change="cellClickEvent($event,row)" v-model="row.days" /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '180px' : '200px'" | 
|             field="monthProduceAllNum" | 
|             :title="$t('plan.table.monthProduceAllNum')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input-number v-model="row.monthProduceAllNum" disabled /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.monthProduceAllNum }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input-number v-model="row.monthProduceAllNum" disabled/> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <vxe-column | 
|             :width="locale === 'zh' ? '150px' : '200px'" | 
|             field="remark" | 
|             :title="$t('plan.table.remark')" | 
|           > | 
|             <!-- <template #edit="{ row }"> | 
|               <el-input | 
|                 type="text" | 
|                 v-model="row.remark" | 
|               /> | 
|             </template> --> | 
|             <template #default="{ row }"> | 
|               <div v-if="!clickedTableRefGas"> | 
|                 <span>{{ row.remark }}</span> | 
|               </div> | 
|               <div v-else> | 
|                 <el-input | 
|                   type="text" | 
|                   v-model="row.remark" | 
|                 /> | 
|               </div> | 
|             </template> | 
|           </vxe-column> | 
|           <!-- <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="cancelRowEvent1()">取消</el-button> | 
|               </template> | 
|               <template v-else> | 
|                 <el-button @click="editRowEvent1(row)">编辑</el-button> | 
|               </template> | 
|             </template> | 
|           </vxe-column> --> | 
|         </vxe-table> | 
|         <!-- <div class="btn_center"> | 
|           <el-button type="primary" @click="handleSave2">保存</el-button> | 
|         </div> --> | 
|       </div> | 
|     </div> | 
|   </div> | 
| </template> | 
| <script setup name="gasPlanning"> | 
| // import { ElMessage } from "element-plus"; | 
| import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning"; | 
| const height = ref(document.documentElement.clientHeight - 400 + "px;"); | 
| import { useI18n } from "vue-i18n"; //要在js中使用国际化 | 
| const { t, locale } = useI18n(); | 
| const loading = ref(false); | 
| const loading2 = ref(false); | 
| const clickedQuery = ref(false); | 
| const clickedQuery2 = ref(false); | 
| const data = reactive({ | 
|   queryParams: { | 
|     date: "", | 
|   }, | 
| }); | 
| const tableRef = ref(); | 
| const tableRef1 = ref(); | 
| const { queryParams } = toRefs(data); | 
| const gasPlanList = ref([]); | 
| const routePlanList = ref([]); | 
| const dayProduceTypeOptions = ref([ | 
|   { label: "单人日产出", value: "1" }, | 
|   { label: "固定日产出", value: "2" }, | 
| ]); | 
| const clickedTableRef = ref(false); | 
| const clickedTableRefGas = ref(false); | 
| const formatTypeLabel = (list) => { | 
|   if (list) { | 
|     return list | 
|       .map((type) => { | 
|         const item = dayProduceTypeOptions.value.find( | 
|           (item) => item.value === type | 
|         ); | 
|         return item ? item.label : type; | 
|       }) | 
|       .join(""); | 
|   } | 
|   return ""; | 
| }; | 
| // 表格配置 | 
| // const columns = ref([ | 
| //   // { | 
| //   //   title: "规划年份", | 
| //   //   field: "year", | 
| //   //   width: 150, | 
| //   // }, | 
| //   // { | 
| //   //   title: "规划月份", | 
| //   //   field: "month", | 
| //   // }, | 
| //   // { | 
| //   //   title: "专业", | 
| //   //   field: "major", | 
| //   //   width: 100, | 
| //   // }, | 
| //   { | 
| //     title: "标准工序名称", | 
| //     field: "processName", | 
| //     width: 100, | 
| //   }, | 
| //   { | 
| //     title: "日产出类型", | 
| //     field: "dayProduceType", | 
| //     width: 140, | 
| //     editRender: {}, | 
| //     slots: { edit: "edit_role", default: "default_role" }, | 
| //   }, | 
| //   { | 
| //     title: "日产出数量", | 
| //     field: "dayProduceNum", | 
| //     width: 140, | 
| //     // editRender: { autoFocus: "input" }, | 
| //     // slots: { edit: "edit_name", default: "default_name" }, | 
| //   }, | 
| //   { | 
| //     title: "日产出数量单位", | 
| //     field: "dayProduceUnit", | 
| //     width: 140, | 
| //   }, | 
| //   { | 
| //     title: "人员数量", | 
| //     field: "personnelNumber", | 
| //     width: 140, | 
| //     type: "html", | 
| //   }, | 
| //   { | 
| //     title: "日产出总数量", | 
| //     field: "dayProduceAllNum", | 
| //     width: 140, | 
| //     type: "html", | 
| //   }, | 
| //   { | 
| //     title: "天数", | 
| //     field: "days", | 
| //     width: 120, | 
| //     // format: 'YYYY-MM-DD' | 
| //   }, | 
| //   { | 
| //     title: "月产出总数量", | 
| //     field: "monthProduceAllNum", | 
| //     width: 140, | 
| //     type: "html", | 
| //   }, | 
| //   { | 
| //     title: "备注", | 
| //     field: "remark", | 
| //     width: 140, | 
| //     type: "html", | 
| //   }, | 
| // ]); | 
| // const hasEditStatus = (row) => { | 
| //   const $table = tableRef.value; | 
| //   if ($table) { | 
| //     return $table.isEditByRow(row); | 
| //   } | 
| // }; | 
| const editRowEvent = () => { | 
|   clickedTableRef.value = true; | 
| }; | 
| const editRowEventGas = () => { | 
|   clickedTableRefGas.value = true; | 
| }; | 
| const saveRowEvent = (row) => { | 
|   if (!queryParams.value.date) { | 
|     ElMessage({ | 
|       message: "请选择年月", | 
|       type: "error", | 
|     }); | 
|     return; | 
|   } | 
|   const $table = tableRef.value; | 
|   if ($table) { | 
|     $table.clearEdit().then(() => { | 
|       loading.value = true | 
|       // setTimeout(() => { | 
|       //   loading.value = false | 
|       //   VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' }) | 
|       // }, 300) | 
|       handleSave("管路"); | 
|       clickedTableRef.value = false; | 
|     }); | 
|   } | 
| }; | 
| const handleCancelAllStatus = ()=>{ | 
|   handleCancleStaus(); | 
|   handleCancleStausGas(); | 
| } | 
| const handleCancleStaus = () => { | 
|   clickedTableRef.value = false; | 
|   if(!clickedQuery.value){ | 
|     return | 
|   } | 
|   const year = queryParams.value.date.split("-")[0]; | 
|   const month = parseInt(queryParams.value.date.split("-")[1]); | 
|   getRouteList(year, month); | 
| }; | 
| const handleCancleStausGas = () => { | 
|   clickedTableRefGas.value = false; | 
|   if(!clickedQuery2.value){ | 
|     return | 
|   } | 
|   const year = queryParams.value.date.split("-")[0]; | 
|   const month = parseInt(queryParams.value.date.split("-")[1]); | 
|   getGasList(year, month); | 
| } | 
| // 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) => { | 
|   if (!queryParams.value.date) { | 
|     ElMessage({ | 
|       message: "请选择年月", | 
|       type: "error", | 
|     }); | 
|     return; | 
|   } | 
|   const $table = tableRef1.value; | 
|   if ($table) { | 
|     $table.clearEdit().then(() => { | 
|       // loading.value = true | 
|       // setTimeout(() => { | 
|       //   loading.value = false | 
|       //   VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' }) | 
|       // }, 300) | 
|       handleSave("气柜"); | 
|       clickedTableRefGas.value = false; | 
|     }); | 
|   } | 
| }; | 
| // const cancelRowEvent1 = () => { | 
| //   const $table = tableRef1.value; | 
| //   if ($table) { | 
| //     $table.clearEdit(); | 
| //   } | 
| // }; | 
| async function getRouteList(year, month) { | 
|   loading.value = true; | 
|   const res = await listGasPlan({ | 
|     major: "管路", | 
|     year, | 
|     month, | 
|   }); | 
|   routePlanList.value = res.rows; | 
|   routePlanList.value = routePlanList.value.map((item, index) => { | 
|     return { | 
|       ...item, | 
|       dayProduceType: | 
|         item.dayProduceType == null ? "1" : item.dayProduceType, | 
|       dayProduceNum: item.dayProduceNum == null ? "0" : item.dayProduceNum, | 
|       dayProduceUnit: | 
|         item.dayProduceUnit == null ? "小时" : item.dayProduceUnit, | 
|       personnelNumber: | 
|         item.personnelNumber == null ? "1" : item.personnelNumber, | 
|       dayProduceAllNum: | 
|         item.dayProduceAllNum == null | 
|           ? "0" | 
|           : item.dayProduceNum * item.personnelNumber, | 
|       days: item.days == null ? "22" : item.days, | 
|       monthProduceAllNum: | 
|         item.monthProduceAllNum == null | 
|           ? "0" | 
|           : item.dayProduceAllNum * item.days, | 
|     }; | 
|   }); | 
|   loading.value = false; | 
| } | 
| async function getGasList(year, month) { | 
|   loading2.value = true; | 
|   const res = await listGasPlan({ | 
|     major: "气柜", | 
|     year, | 
|     month, | 
|   }); | 
|   gasPlanList.value = res.rows; | 
|   gasPlanList.value = gasPlanList.value.map((item, index) => { | 
|     return { | 
|       ...item, | 
|       dayProduceType: | 
|         item.dayProduceType == null ? "1" : item.dayProduceType, | 
|       dayProduceNum: item.dayProduceNum == null ? "0" : item.dayProduceNum, | 
|       dayProduceUnit: | 
|         item.dayProduceUnit == null ? "小时" : item.dayProduceUnit, | 
|       personnelNumber: | 
|         item.personnelNumber == null ? "1" : item.personnelNumber, | 
|       dayProduceAllNum: | 
|         item.dayProduceAllNum == null | 
|           ? "0" | 
|           : item.dayProduceNum * item.personnelNumber, | 
|       days: item.days == null ? "22" : item.days, | 
|       monthProduceAllNum: | 
|         item.monthProduceAllNum == null | 
|           ? "0" | 
|           : item.dayProduceAllNum * item.days, | 
|     }; | 
|   }); | 
|   loading2.value = false; | 
| } | 
| // function cellClickEvent({ row, column }) { | 
| //   console.log(row,column,"cellClickEvent") | 
| //   if(row.dayProduceType==="1"){ | 
| //     row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber; | 
| //   }else{ | 
|      | 
| //     row.dayProduceAllNum = row.dayProduceNum | 
| //   } | 
| //   row.monthProduceAllNum = row.dayProduceAllNum * row.days; | 
| // } | 
| function cellClickEvent(e, row) { | 
|   if(row.dayProduceType==="1"){ | 
|     row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber; | 
|   }else{ | 
|      | 
|     row.dayProduceAllNum = row.dayProduceNum | 
|   } | 
|   row.monthProduceAllNum = row.dayProduceAllNum * row.days; | 
| } | 
| function handlechangeDayproduceType(e,row){ | 
|   row.dayProduceAllNum = "0"; | 
|   row.monthProduceAllNum = "0"; | 
|   if(e=="1"){ | 
|     row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber; | 
|   }else if(e=="2"){ | 
|     row.dayProduceAllNum = row.dayProduceNum | 
|   } | 
|   row.monthProduceAllNum = row.dayProduceAllNum * row.days; | 
| } | 
| function handleQuery() { | 
|   if (!queryParams.value.date) { | 
|     ElMessage({ | 
|       message: "请选择年月", | 
|       type: "error", | 
|     }); | 
|     return; | 
|   } | 
|   const year = queryParams.value.date.split("-")[0]; | 
|   const month = parseInt(queryParams.value.date.split("-")[1]); | 
|   getRouteList(year, month); | 
|   getGasList(year, month); | 
|   clickedQuery.value = true; | 
|   clickedQuery2.value = true | 
| } | 
| function resetQuery() { | 
|   queryParams.value.date = ""; | 
|   clickedQuery.value = false; | 
|   clickedQuery2.value = false; | 
|   gasPlanList.value = []; | 
|   routePlanList.value = []; | 
| } | 
| async function handleSave(major) { | 
|   const year = queryParams.value.date.split("-")[0]; | 
|   const month = parseInt(queryParams.value.date.split("-")[1]); | 
|   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", | 
|   }); | 
|   loading.value = false; | 
|   loading2.value = false; | 
|   handleQuery(); | 
| } | 
| // async function handleSave2(row) { | 
| //   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, | 
| //     }, | 
| //   ]); | 
| //   ElMessage({ | 
| //     message: "数据保存成功", | 
| //     type: "success", | 
| //   }); | 
| //   handleQuery(); | 
| //   console.log(res, "akiwjciwj"); | 
| // } | 
| </script> | 
| <style lang="scss" scoped> | 
| .box_container { | 
|   width: 100%; | 
|   margin: 20px auto; | 
|   background: #fff; | 
|   border-radius: 5px; | 
|   box-shadow: 1px 1px 1px 4px#f1f1f1; | 
|   .title_text { | 
|     padding-top: 20px; | 
|     margin-left: 20px; | 
|   } | 
|   .title_btn { | 
|     margin-top: 20px; | 
|     &.ml20{ | 
|       margin-left:20px; | 
|     } | 
|   } | 
|   .tabel_container { | 
|     width: 98%; | 
|     margin: 20px auto; | 
|   } | 
| } | 
| .btn_center { | 
|   display: flex; | 
|   justify-content: center; | 
|   align-items: center; | 
|   margin-top: 20px; | 
|   padding-bottom: 20px; | 
| } | 
| </style> |