From 169cca41bc6ecd139f09ae87f19784f1dc119fca Mon Sep 17 00:00:00 2001
From: CD配唱片 <CD配唱片>
Date: 星期五, 25 四月 2025 13:17:08 +0800
Subject: [PATCH] 提交气柜管路产能规划页面查询与保存页面和接口联调

---
 src/views/mainPlan/gasPlanning/index.vue       |  574 ++++++++++++++++++++++++++++++++++++++++++++-------
 src/components/HxlhTable/index.vue             |    7 
 src/api/mainPlan/gasPlanning.js                |   19 +
 src/views/mainPlan/platePlanList/index.vue     |   15 
 src/views/mainPlan/gasProduceStatics/index.vue |    0 
 5 files changed, 527 insertions(+), 88 deletions(-)

diff --git a/src/api/mainPlan/gasPlanning.js b/src/api/mainPlan/gasPlanning.js
new file mode 100644
index 0000000..3160704
--- /dev/null
+++ b/src/api/mainPlan/gasPlanning.js
@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 姘斾綋绠¤矾浜ц兘瑙勫垝鍒楄〃
+export function listGasPlan(query) {
+  return request({
+    url: '/aps/gasPipelineCapacityPlan/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 鏌ヨ閽i噾璁″垝绠$悊璇︾粏
+export function getGasPlanSave(data) {
+  return request({
+    url: '/aps/gasPipelineCapacityPlan',
+    method: 'post',
+    data: data
+  })
+}
diff --git a/src/components/HxlhTable/index.vue b/src/components/HxlhTable/index.vue
index 7f2e9dd..dfe0172 100644
--- a/src/components/HxlhTable/index.vue
+++ b/src/components/HxlhTable/index.vue
@@ -32,6 +32,7 @@
       :tree-config="treeConfig"
       :row-style="rowStyle"
       :virtualYConfig="virtualYConfig"
+      :edit-config="editConfig"
       @sort-change="sortChange"
       @page-change="pagerChange"
       @form-submit="findList"
@@ -181,6 +182,12 @@
     default: () => {
       return {};
     },
+  },
+  editConfig:{
+    type: Object,
+    default: () => {
+      return {};
+    },
   }
 });
 
diff --git a/src/views/mainPlan/gasPlanning/index.vue b/src/views/mainPlan/gasPlanning/index.vue
index 3f10796..ac4186d 100644
--- a/src/views/mainPlan/gasPlanning/index.vue
+++ b/src/views/mainPlan/gasPlanning/index.vue
@@ -1,89 +1,497 @@
 <template>
-    <HxlhTable
-      style="width: 100%"
-      :columns="columns"
-      :data="gasPlanList"
-      :loading="loading"
-      :height="height"
+  <div class="app-container">
+    <el-form
+      class="responsive-form"
+      :model="queryParams"
+      ref="queryRef"
+      :inline="true"
+      label-width="68px"
     >
-    </HxlhTable>
+      <el-row type="flex" justify="left">
+        <el-col :span="6">
+          <el-form-item label="閫夋嫨鏈堜唤" prop="description">
+            <el-date-picker
+              clearable
+              v-model="queryParams.date"
+              type="month"
+              value-format="YYYY-MM"
+              placeholder="閫夋嫨鏈堜唤"
+            >
+            </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"
+              >鏌ヨ</el-button
+            >
+            <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div class="box_container">
+      <div class="title_text">绠¤矾瑙勫垝浜ц兘</div>
+      <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="xTable"
+          show-overflow
+          :loading="loading"
+          :height="height"
+          :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
+          :data="gasPlanList"
+          @cell-click="cellClickEvent"
+        >
+          <vxe-column field="processName" title="鏍囧噯宸ュ簭鍚嶇О" min-width="150">
+          </vxe-column>
+          <!--             :edit-render="sexEditRender" -->
+          <vxe-column
+            field="dayProduceType"
+            title="鏃ヤ骇鍑虹被鍨�"
+            min-width="160"
+            :edit-render="{ }"
+          >
+            <template #edit="{ row }">
+              <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select>
+            </template>
+            <template #default="{ row }">
+              <span>{{ formatTypeLabel([row.dayProduceType]) }}</span>
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="dayProduceNum"
+            title="鏃ヤ骇鍑烘暟閲�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number
+                v-model="row.dayProduceNum"
+                size="mini"
+              />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="dayProduceUnit"
+            title="鏃ヤ骇鍑哄崟浣�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input v-model="row.dayProduceUnit" />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="personnelNumber"
+            title="浜哄憳鏁伴噺"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number
+                v-model="row.personnelNumber"
+              />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="dayProduceAllNum"
+            title="鏃ヤ骇鍑烘�绘暟閲�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number
+                v-model="row.dayProduceAllNum"
+                disabled
+              />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="days"
+            title="澶╂暟"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number v-model="row.days" />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="monthProduceAllNum"
+            title="鏈堜骇鍑烘暟閲�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number v-model="row.monthProduceAllNum" disabled/>
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="remark"
+            title="澶囨敞"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input type="textarea" v-model="row.remark" />
+            </template>
+          </vxe-column>
+        </vxe-table>
+      </div>
+    </div>
+    <div class="box_container">
+      <div class="title_text">姘斾綋瑙勫垝浜ц兘</div>
+      <div class="tabel_container">
+        <!-- <HxlhTable
+          style="width: 100%"
+          :columns="columns"
+          :data="gasPlanList"
+          :loading="loading"
+          :height="height"
+        >
+        </HxlhTable> -->
+         <vxe-table
+          border
+          ref="xTable"
+          show-overflow
+          :loading="loading"
+          :height="height"
+          :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
+          :data="gasPlanList"
+          @cell-click="cellClickEvent"
+        >
+          <vxe-column field="processName" title="鏍囧噯宸ュ簭鍚嶇О" min-width="150">
+          </vxe-column>
+          <!--             :edit-render="sexEditRender" -->
+          <vxe-column
+            field="dayProduceType"
+            title="鏃ヤ骇鍑虹被鍨�"
+            min-width="160"
+            :edit-render="{ }"
+          >
+            <template #edit="{ row }">
+              <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select>
+            </template>
+            <template #default="{ row }">
+              <span>{{ formatTypeLabel([row.dayProduceType]) }}</span>
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="dayProduceNum"
+            title="鏃ヤ骇鍑烘暟閲�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number
+                v-model="row.dayProduceNum"
+                size="mini"
+              />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="dayProduceUnit"
+            title="鏃ヤ骇鍑哄崟浣�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input v-model="row.dayProduceUnit" />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="personnelNumber"
+            title="浜哄憳鏁伴噺"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number
+                v-model="row.personnelNumber"
+              />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="dayProduceAllNum"
+            title="鏃ヤ骇鍑烘�绘暟閲�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number
+                v-model="row.dayProduceAllNum"
+              />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="days"
+            title="澶╂暟"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number v-model="row.days"  />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="monthProduceAllNum"
+            title="鏈堜骇鍑烘暟閲�"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input-number v-model="row.monthProduceAllNum" />
+            </template>
+          </vxe-column>
+          <vxe-column
+            field="remark"
+            title="澶囨敞"
+            min-width="200"
+            :edit-render="{ autoFocus: 'input' }"
+          >
+            <template #edit="{ row }">
+              <el-input type="textarea" v-model="row.remark" />
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <div class="btn_center">
+          <el-button type="primary" @click="handleSave">淇濆瓨</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+
+  <!--  -->
 </template>
 <script setup>
-const height = ref(document.documentElement.clientHeight - 270 + "px;");
-const loading = ref(true);
+import HxlhTable from "@/components/HxlhTable";
+import { ElInputNumber } from "element-plus";
+import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning";
+const height = ref(document.documentElement.clientHeight - 400 + "px;");
+const loading = ref(false);
+const data = reactive({
+  queryParams: {
+    date: "",
+  },
+});
+const { queryParams } = toRefs(data);
 const gasPlanList = ref([]);
-// 琛ㄦ牸閰嶇疆
-const columns = ref([
-  {
-    title: "涓讳欢鏂欏彿",
-    field: "mainPartNumber",
-    width: 150,
-  },
-  {
-    title: "涓氬姟绫诲瀷",
-    field: "businessType",
-  },
-  {
-    title: "鍗曟嵁鍙�",
-    field: "documentNumber",
-    width: 100,
-  },
-  {
-    title: "褰撳墠宸ュ簭鍙�",
-    field: "currentProcessNumberTxt",
-    width: 100,
-  },
-  {
-    title: "闇�姹傚垎绫�",
-    field: "requirementType",
-    width: 80,
-  },
-  {
-    title: "鍗曟嵁鐘舵��",
-    field: "documentStatus",
-    width: 80,
-  },
-  {
-    title: "褰撳墠宸ュ簭",
-    field: "workCenter",
-    width: 80,
-  },
-  {
-    title: "璁″垝寮�宸ユ棩",
-    field: "processPlanStartDaytxt",
-    width: 140,
-    type: "html",
-  },
-  {
-    title: "鏂欏彿",
-    field: "itemNumber",
-    width: 140,
-    type: "html",
-  },
-  {
-    title: "鍥惧彿",
-    field: "drawingNo",
-    width: 120,
-    // format: 'YYYY-MM-DD'
-  },
-  {
-    title: "鐗堟湰鍙�",
-    field: "versionNumber",
-    width: 140,
-    type: "html",
-  },
-  {
-    title: "鐢熶骇鏁伴噺",
-    field: "productionQuantity",
-    width: 140,
-    type: "html",
-  },
-  {
-    title: "璁″垝瀹屽伐鏃�",
-    field: "planEndDay",
-    width: 140,
-    format: "YYYY-MM-DD hh:mm:ss",
-  },
+const routePlanList = ref([]);
+const dayProduceTypeOptions = ref([
+  { label: "鍗曚汉鏃ヤ骇鍑�", value: "1" },
+  { label: "鍥哄畾鏃ヤ骇鍑�", value: "2" },
 ]);
-
-</script>
\ No newline at end of file
+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",
+//   },
+// ]);
+async function getRouteList(year, month) {
+  const res = await listGasPlan({
+    major: "绠¤矾",
+    year,
+    month,
+  });
+  console.log(res.rows, "getList");
+  routePlanList.value = res.rows;
+  routePlanList.value = routePlanList.value.map((item, index) => {
+    return {
+      ...item,
+      dayProduceType: item.dayProduceType == null ? "" : 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) {
+  const res = await listGasPlan({
+    major: "姘斾綋",
+    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,
+      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;
+}
+function cellClickEvent ({ row, column }){
+  console.log(column,row)
+  row.dayProduceAllNum = row.dayProduceNum*row.personnelNumber
+  row.monthProduceAllNum = row.dayProduceAllNum*row.days
+}
+function handleQuery() {
+  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);
+}
+async function handleSave() {
+  const year = queryParams.value.date.split("-")[0];
+  const month = parseInt(queryParams.value.date.split("-")[1]);
+  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([
+  ...gasPlanList.value,
+  ...routePlanList.value
+ ])
+ proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
+ console.log(res,"akiwjciwj")
+}
+onMounted(() => {
+  // getRouteList();
+  // getGasList();
+});
+</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;
+  }
+  .tabel_container {
+    width: 98%;
+    margin: 20px auto;
+  }
+}
+.btn_center{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-top:20px;
+  padding-bottom:20px;
+}
+</style>
diff --git a/src/views/mainPlan/gasProduceStatics/index.vue b/src/views/mainPlan/gasProduceStatics/index.vue
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/views/mainPlan/gasProduceStatics/index.vue
diff --git a/src/views/mainPlan/platePlanList/index.vue b/src/views/mainPlan/platePlanList/index.vue
index 9a41267..7de7210 100644
--- a/src/views/mainPlan/platePlanList/index.vue
+++ b/src/views/mainPlan/platePlanList/index.vue
@@ -171,11 +171,11 @@
     field: "documentNumber",
     width: 200,
   },
-  {
-    title: "褰撳墠宸ュ簭鍙�",
-    field: "currentProcessNumberTxt",
-    width: 150,
-  },
+  // {
+  //   title: "褰撳墠宸ュ簭鍙�",
+  //   field: "currentProcessNumberTxt",
+  //   width: 150,
+  // },
   {
     title: "闇�姹傚垎绫�",
     field: "requirementType",
@@ -187,6 +187,11 @@
     width: 100,
   },
   {
+    title: "瀹℃牳鏃堕棿",
+    field: "documentStatus",
+    width: 100,
+  },
+  {
     title: "褰撳墠宸ュ簭",
     field: "workCenter",
     width: 200,

--
Gitblit v1.9.3