rui.jiang 10 ماه پیش
والد
کامیت
ec96593bff

+ 38 - 1
src/api/ledger.js

@@ -457,4 +457,41 @@ export function queryErrDescByEngine(data) {
     method: 'get',
     data
   })
-}
+}
+
+// 获取批量更改
+export function getWindEngineGroupListByFieldCode(data) {
+  return request({
+    url: '/energy-manage-service/api/wind/engine/group/getWindEngineGroupListByFieldCode',
+    method: 'post',
+    data
+  })
+}
+// 获取批量更改
+export function bathUpdateWindEngineGroup(data) {
+  return request({
+    url: '/energy-manage-service/api/wind/engine/group/bathUpdateWindEngineGroup',
+    method: 'post',
+    data
+  })
+}
+
+// 合同功率曲线
+export function getWindFieldContractByFieldCode(data) {
+  return request({
+    url: '/energy-manage-service/api/powerword/contract/getWindFieldContractByFieldCode',
+    method: 'post',
+    data
+  })
+}
+
+
+// 删除合同功率曲线
+export function delWindFieldContractById(data) {
+  return request({
+    url: '/energy-manage-service/api/powerword/contract/delWindFieldContractById',
+    method: 'post',
+    data
+  })
+}
+

+ 2 - 2
src/views/ledger/component/windsiteMessage.vue

@@ -49,9 +49,9 @@
           <span>{{ anemometerText }}</span>
         </div>
       </div>
-      <div class="attachment">
+      <!-- <div class="attachment">
         <p class="model-center" @click="download">合同功率曲线附件下载</p>
-      </div>
+      </div> -->
       <p>下载资源文件附件</p>
       <el-table
         :data="unusualdialogdata.windFieldResourceVos"

+ 1 - 1
src/views/ledger/component/windsitetower.vue

@@ -24,7 +24,7 @@
         <el-table-column
           prop="fieldCode"
           align="center"
-          label="风编号"
+          label="风编号"
           min-width="150"
         >
         </el-table-column>

+ 67 - 9
src/views/ledger/component/windsiteup.vue

@@ -8,7 +8,7 @@
     >
       <div class="UPcondition">
         <p>文件类型:</p>
-        <el-select v-model="superior" clearable placeholder="请选择">
+        <el-select v-model="superior" clearable  @change="handleSelectClick" placeholder="请选择">
           <el-option
             v-for="item in superiorOptions"
             :key="item.value"
@@ -18,6 +18,18 @@
           </el-option>
         </el-select>
       </div>
+      <div class="UPcondition" v-show="JXshow">
+        <p>机型信息:</p>
+        <el-select v-model="jixingval" clearable placeholder="请选择">
+          <el-option
+            v-for="item in millTypeCodeOptions"
+            :key="item.millTypeCode"
+            :label="item.machineTypeCode"
+            :value="item.millTypeCode"
+          >
+          </el-option>
+        </el-select>
+      </div>
       <div v-if="fileShow">
         <el-alert
           title="请点击模板下载文件附件"
@@ -83,6 +95,7 @@
 import {
   powerWordContractImportData,
   saveWindFieldResource,
+  getWindEngineMillList,
 } from "@/api/ledger.js";
 export default {
   props: {
@@ -128,6 +141,9 @@ export default {
       resourceShow: false,
       globalFileList: [],
       succeed: {},
+      jixingval: "",
+      millTypeCodeOptions: [],
+      JXshow:false
     };
   },
   watch: {
@@ -141,7 +157,9 @@ export default {
       }
     },
   },
-
+  created() {
+    this.relevancy();
+  },
   methods: {
     rowStyle() {
       return "text-align:center";
@@ -183,7 +201,12 @@ export default {
       let filedata = {
         fieldCode: this.rowdata.fieldCode,
         file: this.globalFileList,
+        millTypeCode: this.jixingval,
+        machineTypeCode: this.millTypeCodeOptions.find(
+          (option) => option.millTypeCode === this.jixingval
+        ).machineTypeCode,
       };
+
       if (
         !this.superior ||
         this.superior === "" ||
@@ -195,16 +218,31 @@ export default {
         });
         return;
       }
-      if (filedata.file == "") {
+      let contractPowerCurveOption = this.superiorOptions.find(
+        (opt) => opt.label === "合同功率曲线"
+      );
+      if (
+        contractPowerCurveOption &&
+        this.superior === contractPowerCurveOption.value &&
+        this.jixingval === ""
+      ) {
         this.$message({
-          message: "请先上传附件在点击提交",
+          message: "请选择机型信息",
+          type: "warning",
+        });
+        return;
+      }
+      if (!filedata.file || filedata.file.length === 0) {
+        this.$message({
+          message: "上传附件不能为空",
           type: "warning",
         });
         return;
       }
       powerWordContractImportData(filedata).then((res) => {
         this.$message.success("上传成功");
-        this.$emit("handleClose", false, "tolead");
+        // this.$emit("handleClose", false, "tolead");
+        this.$emit("handleClose", false, "uploadingPOP");
       });
     },
 
@@ -272,10 +310,30 @@ export default {
         });
         return;
       }
-      saveWindFieldResource(filedata).then((res) => {
-        this.$message.success("上传成功");
-        this.$emit("handleClose", false, "tolead");
-      });
+      saveWindFieldResource(filedata)
+        .then((res) => {
+          this.$message.success("上传成功");
+          this.$emit("handleClose", false, "tolead");
+        })
+        .catch((error) => {});
+    },
+    handleSelectClick(value) {
+      const selectedOption = this.superiorOptions.find(option => option.value === value);
+      if (selectedOption && selectedOption.label === "合同功率曲线") {
+        this.JXshow = true;
+      } else {
+        this.JXshow = false;
+      }
+    },
+
+    // 选择机型
+    async relevancy() {
+      try {
+        const res = await getWindEngineMillList();
+        this.millTypeCodeOptions = res.data;
+      } catch (error) {
+        console.error("Error fetching wind engine mill list:", error);
+      }
     },
   },
 };

+ 201 - 5
src/views/ledger/windsite.vue

@@ -85,6 +85,19 @@
         </el-table-column>
 
         <el-table-column
+          align="center"
+          prop="contractNumber"
+          label="合同功率曲线数"
+          min-width="100"
+        >
+          <template slot-scope="scope">
+            <el-button @click="ONcurve(scope.row)" type="text" size="small">{{
+              scope.row.contractNumber
+            }}</el-button>
+          </template>
+        </el-table-column>
+
+        <el-table-column
           prop="provinceName"
           align="center"
           min-width="100"
@@ -122,7 +135,7 @@
           align="center"
           fixed="right"
           label="操作"
-          width="200"
+          width="220"
         >
           <template slot-scope="scope">
             <el-button @click="compile(scope.row)" type="text" size="small"
@@ -148,6 +161,14 @@
             >
             <el-button
               style="color: #f00"
+              @click="batch(scope.row)"
+              type="text"
+              size="small"
+              >批量更改</el-button
+            >
+
+            <el-button
+              style="color: #f00"
               @click="deleted(scope.row)"
               type="text"
               size="small"
@@ -345,6 +366,83 @@
       @handleClose="handleClose"
       @onSubmit="onSubmit"
     ></windsitetolead>
+
+    <!-- 功率曲线 -->
+
+    <el-dialog
+      title="批量修改"
+      :visible.sync="drawer"
+      width="85%"
+      :before-close="batchhandleClose"
+    >
+      <div
+        class="batch-processing"
+        v-for="(item, index) in batchList"
+        :key="index"
+      >
+        <p>
+          风机名称:
+          <span>
+            <el-input v-model="item.engineName" size="small"></el-input
+          ></span>
+        </p>
+        <p>
+          海拔高度:
+          <span>
+            <el-input v-model="item.hubHeight" size="small"></el-input
+          ></span>
+        </p>
+        <p>
+          额定容量:
+          <span>
+            <el-input v-model="item.ratedCapacity" size="small"></el-input
+          ></span>
+        </p>
+        <p>
+          经度:
+          <span>
+            <el-input v-model="item.longitude" size="small"></el-input
+          ></span>
+        </p>
+        <p>
+          维度:
+          <span>
+            <el-input v-model="item.latitude" size="small"></el-input
+          ></span>
+        </p>
+      </div>
+      <div style="height: 30px">
+        <el-button class="batch-submit" size="small" @click="ONbatch"
+          >提交</el-button
+        >
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      title="合同功率曲线"
+      :visible.sync="curve"
+      :before-close="GBhandleClose"
+      width="40%"
+    >
+      <el-table :data="curvelist" style="width: 100%">
+        <el-table-column type="index" width="50"> </el-table-column>
+
+        <el-table-column prop="machineTypeCode" label="机型名称" width="">
+        </el-table-column>
+        <el-table-column prop="createTime" label="上传时间" width="">
+        </el-table-column>
+        <el-table-column fixed="right" label="操作" width="150">
+          <template slot-scope="scope">
+            <el-button @click="handleClick(scope.row)" type="text" size="small"
+              >删除</el-button
+            >
+            <el-button @click="XZClick(scope.row)" type="text" size="small"
+              >下载</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -364,6 +462,10 @@ import {
   windFieldDto,
   getAllTemplate,
   delWindFieldResource,
+  getWindEngineGroupListByFieldCode,
+  bathUpdateWindEngineGroup,
+  getWindFieldContractByFieldCode,
+  delWindFieldContractById,
 } from "@/api/ledger.js";
 import selecttree from "../../components/selecttree";
 import WindsiteMessage from "./component/windsiteMessage.vue";
@@ -440,9 +542,9 @@ export default {
           { required: true, message: "请输入纬度", trigger: "blur" },
           { validator: this.validateNumber, trigger: "blur" },
         ],
-        anemometerTowerRelationDtos: [
-          { required: true, message: "请选择测风塔", trigger: "change" },
-        ],
+        // anemometerTowerRelationDtos: [
+        //   { required: true, message: "请选择测风塔", trigger: "change" },
+        // ],
       },
       provinceNameOptions: [],
       cityNameOptions: [],
@@ -471,6 +573,15 @@ export default {
       isEdit: false,
       title: "新增",
       detail: {},
+      drawer: false,
+      batchVal1: "",
+      batchVal2: "",
+      batchVal3: "",
+      batchVal4: "",
+      batchVal5: "",
+      batchList: [],
+      curve: false,
+      curvelist: [],
     };
   },
   created() {
@@ -692,7 +803,40 @@ export default {
         this.anemometerdialog = true;
       });
     },
-
+    // 合同曲线数
+    ONcurve(row) {
+      this.curve = true;
+      getWindFieldContractByFieldCode({ fieldCode: row.fieldCode }).then(
+        (res) => {
+          this.curvelist = res.data;
+        }
+      );
+    },
+    handleClick(row) {
+      delWindFieldContractById({ windFieldContractId: row.id })
+        .then((res) => {
+          this.$message({
+            message: "删除成功",
+            type: "success",
+          });
+          this.curvelist = this.curvelist.filter((item) => item.id !== row.id);
+        })
+        .catch((error) => {});
+    },
+    // 下载附件
+    XZClick(row) {
+      const link = document.createElement("a");
+      link.href = row.contractSource;
+      link.download = ""; // 可以设置默认下载文件名
+      link.target = "_blank"; // 新窗口打开
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    },
+    GBhandleClose() {
+      this.curve = false;
+      this.onSubmit();
+    },
     // 编辑
 
     compile(row) {
@@ -844,6 +988,39 @@ export default {
           };
       }
     },
+    batch(row) {
+      if (row.contractNumber != 0) {
+        getWindEngineGroupListByFieldCode({ fieldCode: row.fieldCode }).then(
+          (res) => {
+            this.batchList = res.data;
+          }
+        );
+        this.drawer = true;
+      } else {
+        this.$message({
+          message: "暂无风机无法批量更改",
+          type: "warning",
+        });
+      }
+    },
+    ONbatch() {
+      bathUpdateWindEngineGroup({
+        windEngineGroupUpdateDtoList: this.batchList,
+      })
+        .then((res) => {
+          this.drawer = false;
+          this.$message({
+            title: "成功",
+            message: "风机组信息更新成功",
+            type: "success",
+          });
+        })
+        .catch((error) => {});
+    },
+    batchhandleClose(done) {
+      this.batchList = [];
+      done();
+    },
   },
 };
 </script>
@@ -896,4 +1073,23 @@ export default {
   height: 40px;
   font-size: 14px;
 }
+.batch-processing {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 20px;
+  p {
+    .el-input {
+      width: 200px;
+    }
+  }
+}
+.batch-submit {
+  float: right;
+}
+.batch-name {
+  margin-left: 20px;
+  .el-input {
+    width: 200px;
+  }
+}
 </style>

+ 2 - 2
vue.config.js

@@ -65,9 +65,9 @@ module.exports = {
     proxy: {
       "/api": {
         // target: "http://192.168.5.4:16200", // 石月
-        target: "http://192.168.50.235:16200", //内网
+        // target: "http://192.168.50.235:16200", //内网
         // target: "http://192.168.5.15:16200",
-        // target: "http://106.120.102.238:16600", //外网
+        target: "http://106.120.102.238:16600", //外网
         changeOrigin: true,
         pathRewrite: {
           "^/api": "", // 需要regit write重写的,