소스 검색

验证增加

rui.jiang 1 년 전
부모
커밋
41121797a8
6개의 변경된 파일925개의 추가작업 그리고 661개의 파일을 삭제
  1. 21 17
      src/views/ledger/anemometer.vue
  2. 24 7
      src/views/ledger/component/windsitetolead.vue
  3. 426 223
      src/views/ledger/draught.vue
  4. 61 167
      src/views/ledger/enterprise.vue
  5. 362 226
      src/views/ledger/milltype.vue
  6. 31 21
      src/views/ledger/windsite.vue

+ 21 - 17
src/views/ledger/anemometer.vue

@@ -143,7 +143,6 @@
       :visible.sync="nuedialog"
       width="520px"
       @close="resetForm"
-      
     >
       <el-form
         :model="dynamicValidateForm"
@@ -306,10 +305,15 @@ export default {
       this.formInline.timeQuantum = [];
       this.endDate = "";
       this.startDate = "";
+      this.onSubmit()
     },
     // 重置
     resetForm() {
-     Object.assign(this.$data.dynamicValidateForm, this.$options.data().dynamicValidateForm);
+      this.dynamicValidateForm.anemometerName = "";
+      Object.assign(
+        this.$data.dynamicValidateForm,
+        this.$options.data().dynamicValidateForm
+      );
     },
     //打开新增
     newnuedialog() {
@@ -414,28 +418,30 @@ export default {
           longitude: this.dynamicValidateForm.longitude,
         };
 
+        let API;
         if (!this.isEdit) {
           paramsData.anemometerTowerHeightDtoList =
             this.dynamicValidateForm.anemometerTowerHeightDtoList;
-          createAnemometerTower(paramsData).then((res) => {
-            this.nuedialog = false;
-            this.$message.success("新增成功");
-            this.onSubmit();
-          });
+          API = createAnemometerTower(paramsData);
         } else {
           paramsData.anemometerTowerHeightListDtos =
             this.dynamicValidateForm.anemometerTowerHeightDtoList;
           paramsData.anemometerCode = this.detail.anemometerCode;
-          updateAnemometerTower(paramsData).then((res) => {
+          API = updateAnemometerTower(paramsData);
+        }
+
+        API.then((res) => {
+          this.nuedialog = false;
+          if (this.isEdit) {
             this.isEdit = false;
-            this.nuedialog = false;
-            this.onSubmit();
             this.$message.success("编辑成功");
-          });
-        }
+          } else {
+            this.$message.success("新增成功");
+          }
+          this.onSubmit();
+        }).catch((error) => {});
       });
     },
-
     // xz
     addDomain() {
       this.dynamicValidateForm.anemometerTowerHeightDtoList.push({
@@ -449,12 +455,12 @@ export default {
 
     // 数字验证
     validateNumber(rule, value, callback) {
-      const numberRegex = /^\d{1,4}(\.\d{1,2})?$/; // 匹配不超过四位数且小数点后不超过二位数的数字
+      const numberRegex = /^\d{1,3}(\.\d{1,5})?$/; // 匹配不超过四位数且小数点后不超过二位数的数字
       if (!value) {
         callback(new Error("该项不能为空"));
       } else if (!numberRegex.test(value)) {
         callback(
-          new Error("该项必须为不超过四位数且小数点后不超过三位数的数字")
+          new Error("该项必须为不超过三位数且小数点后不超过五位数的数字")
         );
       } else {
         callback();
@@ -465,11 +471,9 @@ export default {
         (tower) => tower.anemometerHeight
       );
 
-    
       const isDuplicate =
         heights.filter((height) => height === value).length > 1;
 
-
       const isInvalidLength = value && value.toString().length > 3;
 
       if (isDuplicate) {

+ 24 - 7
src/views/ledger/component/windsitetolead.vue

@@ -110,6 +110,10 @@ export default {
     },
 
     handleClose() {
+      this.companyCode = "";
+      this.fileList = [];
+      this.globalFileList = null;
+      this.localtolead = false;
       this.$emit("handleClose", false, "tolead");
     },
     // 附件提交
@@ -120,15 +124,28 @@ export default {
       };
       if (filedata.file == undefined) {
         this.$message({
-          message: '请先上传附件',
-          type: 'warning'
+          message: "请先上传附件",
+          type: "warning",
         });
       } else {
-        windFieldImportData(filedata).then((res) => {
-          this.$message.success("上传成功");
-          this.$emit("handleClose", false, "tolead");
-          this.$emit("onSubmit");
-        });
+      
+        windFieldImportData(filedata)
+          .then((res) => {
+            if (res.code === -1) {
+              // Assuming -1 indicates success, adjust according to actual API response
+              this.$message.success(" 上传失败 ");
+            } else {
+              this.$message.error("上传成功");
+            }
+            this.$emit("handleClose", false, "tolead");
+            this.$emit("onSubmit");
+          })
+          .catch((error) => {
+            // this.$message.error("上传失败");
+            // console.error(error);
+            // this.$emit("handleClose", false, "tolead");
+            // this.$emit("onSubmit");
+          });
       }
     },
 

+ 426 - 223
src/views/ledger/draught.vue

@@ -3,15 +3,27 @@
     <div class="condition">
       <el-form :inline="true" :model="formInline" class="demo-form-inline">
         <el-form-item label="风机名称:">
-          <el-input v-model="formInline.engineName" placeholder="请输入风机名称" size="small"></el-input>
+          <el-input
+            v-model="formInline.engineName"
+            placeholder="请输入风机名称"
+            size="small"
+          ></el-input>
         </el-form-item>
         <el-form-item label="选择日期:" size="small">
-          <el-date-picker v-model="formInline.timeQuantum" type="daterange" range-separator="至" start-placeholder="开始日期"
-            end-placeholder="结束日期" @change="onDateChange">
+          <el-date-picker
+            v-model="formInline.timeQuantum"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            @change="onDateChange"
+          >
           </el-date-picker>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="onSubmit" size="small">查询</el-button>
+          <el-button type="primary" @click="onSubmit" size="small"
+            >查询</el-button
+          >
           <el-button @click="reset" size="small">重置</el-button>
         </el-form-item>
       </el-form>
@@ -20,13 +32,30 @@
     <div class="list-page">
       <div class="newly">
         <el-button @click="upfile" size="small">导入</el-button>
-        <el-button type="primary" @click="newnuedialog" size="small">新增</el-button>
+        <el-button type="primary" @click="newnuedialog" size="small"
+          >新增</el-button
+        >
       </div>
 
-      <el-table class="center-align-table" :data="tableData" border :cell-style="rowStyle">
-        <el-table-column align="center" fixed prop="engineCode" label="系统编号">
+      <el-table
+        class="center-align-table"
+        :data="tableData"
+        border
+        :cell-style="rowStyle"
+      >
+        <el-table-column
+          align="center"
+          fixed
+          prop="engineCode"
+          label="系统编号"
+        >
           <template slot-scope="scope">
-            <el-button @click="particulars(scope.row)" type="text" size="small">{{ scope.row.engineCode }}</el-button>
+            <el-button
+              @click="particulars(scope.row)"
+              type="text"
+              size="small"
+              >{{ scope.row.engineCode }}</el-button
+            >
           </template>
         </el-table-column>
         <el-table-column prop="engineName" align="center" label="风机名称">
@@ -34,60 +63,135 @@
 
         <el-table-column prop="fieldName" align="center" label="关联风场">
         </el-table-column>
-        <el-table-column prop="longitude" align="center" label="经度" width="100">
+        <el-table-column
+          prop="longitude"
+          align="center"
+          label="经度"
+          width="100"
+        >
         </el-table-column>
-        <el-table-column prop="latitude" align="center" label="纬度" width="100">
+        <el-table-column
+          prop="latitude"
+          align="center"
+          label="纬度"
+          width="100"
+        >
         </el-table-column>
 
-        <el-table-column prop="elevationHeight" align="center" label="海拔高度/米" width="100">
+        <el-table-column
+          prop="elevationHeight"
+          align="center"
+          label="海拔高度/米"
+          width="100"
+        >
         </el-table-column>
-        <el-table-column prop="sightcing" align="center" label="是否标杆" width="100">
+        <el-table-column
+          prop="sightcing"
+          align="center"
+          label="是否标杆"
+          width="100"
+        >
           <template slot-scope="{ row }">
-            {{ row.sightcing == 1 ? '是' : '否' }}
+            {{ row.sightcing == 1 ? "是" : "否" }}
           </template>
         </el-table-column>
         <el-table-column prop="state" align="center" label="状态" width="100">
           <template slot-scope="{ row }">
-            {{ row.state == 1 ? '启用' : '停用' }}
+            {{ row.state == 1 ? "启用" : "停用" }}
           </template>
         </el-table-column>
         <el-table-column prop="createTime" align="center" label="创建时间">
         </el-table-column>
 
-        <el-table-column prop="transition" align="center" fixed="right" label="操作" width="200">
+        <el-table-column
+          prop="transition"
+          align="center"
+          fixed="right"
+          label="操作"
+          width="200"
+        >
           <template slot-scope="scope">
-            <el-button @click="compile(scope.row)" type="text" size="small">编辑</el-button>
-
-            <el-button v-if="scope.row.state == 0" @click="start(scope.row, 1)" type="text" size="small">启用</el-button>
-            <el-button v-else style="color: #666" @click="start(scope.row, 0)" type="text" size="small">停用</el-button>
-            <el-button style="color: #f00" @click="deleted(scope.row)" type="text" size="small">删除</el-button>
+            <el-button @click="compile(scope.row)" type="text" size="small"
+              >编辑</el-button
+            >
+
+            <el-button
+              v-if="scope.row.state == 0"
+              @click="start(scope.row, 1)"
+              type="text"
+              size="small"
+              >启用</el-button
+            >
+            <el-button
+              v-else
+              style="color: #666"
+              @click="start(scope.row, 0)"
+              type="text"
+              size="small"
+              >停用</el-button
+            >
+            <el-button
+              style="color: #f00"
+              @click="deleted(scope.row)"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
       <div class="pagination-container">
-        <el-pagination @current-change="handleCurrentChange" :current-page.sync="formInline.pageNum"
-          layout="total, prev, pager, next" :page-size="formInline.pageSize" :total="formInline.totalSize">
+        <el-pagination
+          @current-change="handleCurrentChange"
+          :current-page.sync="formInline.pageNum"
+          layout="total, prev, pager, next"
+          :page-size="formInline.pageSize"
+          :total="formInline.totalSize"
+        >
         </el-pagination>
       </div>
     </div>
 
     <!-- 弹出层 -->
     <!-- 导入 -->
-    <el-dialog title="导入文件" :visible.sync="tolead" width="400px">
+    <el-dialog
+      title="导入文件"
+      :visible.sync="tolead"
+      width="400px"
+      @close="handleClose"
+    >
       <el-alert title="请点击模板下载文件附件" type="success" :closable="false">
       </el-alert>
       <p class="model-center" @click="download">模板下载</p>
       <div class="UPcondition">
         <p>所属风场:</p>
-        <el-select v-model="subordinate" placeholder="请选择" value-key="fieldCode">
-          <el-option v-for="item in subordinatedata" :key="item.fieldCode" :label="item.fieldName"
-            :value="item.fieldCode">
+        <el-select
+          v-model="subordinate"
+          placeholder="请选择"
+          value-key="fieldCode"
+        >
+          <el-option
+            v-for="item in subordinatedata"
+            :key="item.fieldCode"
+            :label="item.fieldName"
+            :value="item.fieldCode"
+          >
           </el-option>
         </el-select>
       </div>
 
-      <el-upload class="upload-demo" :file-list="fileList" drag action :multiple="false" :before-upload="beforeUpload"
-        :limit="1" :auto-upload="false" :on-change="handleOnChange" accept=".xlsx">
+      <el-upload
+        class="upload-demo"
+        :file-list="fileList"
+        drag
+        action
+        :multiple="false"
+        :before-upload="beforeUpload"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="handleOnChange"
+        accept=".xlsx"
+      >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip" slot="tip">
@@ -96,30 +200,60 @@
       </el-upload>
 
       <span slot="footer" class="dialog-footer">
-        <el-button @click="tolead = false" size="small">取 消</el-button>
-        <el-button type="primary" @click="UPsubmit" size="small">提交</el-button>
+        <el-button @click="handleClose" size="small">取 消</el-button>
+        <el-button type="primary" @click="UPsubmit" size="small"
+          >提交</el-button
+        >
       </span>
     </el-dialog>
     <!-- 新增 -->
-    <el-dialog :title="title" :visible.sync="nuedialog" width="1000px"       @close="resetForm('ruleForm')">
-      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+    <el-dialog
+      :title="title"
+      :visible.sync="nuedialog"
+      width="1000px"
+      @close="resetForm('ruleForm')"
+    >
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
         <div class="form-row">
           <el-form-item label="风机名称:" prop="engineName">
             <el-input v-model="ruleForm.engineName" size="small"></el-input>
           </el-form-item>
           <el-form-item label="关联风场:" prop="fieldCode">
-            <el-select v-model="ruleForm.fieldCode" filterable placeholder="请选择" size="small">
-              <el-option v-for="item in fieldCodeOptions" :key="item.fieldCode" :label="item.fieldName"
-                :value="item.fieldCode">
+            <el-select
+              v-model="ruleForm.fieldCode"
+              filterable
+              placeholder="请选择"
+              size="small"
+            >
+              <el-option
+                v-for="item in fieldCodeOptions"
+                :key="item.fieldCode"
+                :label="item.fieldName"
+                :value="item.fieldCode"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </div>
         <div class="form-row">
           <el-form-item label="机型编号:" prop="millTypeCode">
-            <el-select v-model="ruleForm.millTypeCode" placeholder="请选择" size="small">
-              <el-option v-for="item in millTypeCodeOptions" :key="item.millTypeCode" :label="item.machineTypeCode"
-                :value="item.millTypeCode">
+            <el-select
+              v-model="ruleForm.millTypeCode"
+              placeholder="请选择"
+              size="small"
+            >
+              <el-option
+                v-for="item in millTypeCodeOptions"
+                :key="item.millTypeCode"
+                :label="item.machineTypeCode"
+                :value="item.millTypeCode"
+              >
               </el-option>
             </el-select>
           </el-form-item>
@@ -129,7 +263,10 @@
         </div>
         <div class="form-row">
           <el-form-item label="海拔高度:" prop="elevationHeight">
-            <el-input v-model="ruleForm.elevationHeight" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.elevationHeight"
+              size="small"
+            ></el-input>
           </el-form-item>
           <el-form-item label="经度:" prop="longitude">
             <el-input v-model="ruleForm.longitude" size="small"></el-input>
@@ -145,26 +282,46 @@
         </div>
         <div class="form-row">
           <el-form-item label="是否标杆:" prop="sightcing">
-            <el-select v-model="ruleForm.sightcing" placeholder="请选择" size="small">
-              <el-option v-for="item in sightcingOptions" :key="item.value" :label="item.label" :value="item.value">
+            <el-select
+              v-model="ruleForm.sightcing"
+              placeholder="请选择"
+              size="small"
+            >
+              <el-option
+                v-for="item in sightcingOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
               </el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="额定风速:" prop="rated_wind_speed">
-            <el-input v-model="ruleForm.rated_wind_speed" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.rated_wind_speed"
+              size="small"
+            ></el-input>
           </el-form-item>
         </div>
         <div class="form-row">
           <el-form-item label="切入风速:" prop="ratedCutInWindspeed">
-            <el-input v-model="ruleForm.ratedCutInWindspeed" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.ratedCutInWindspeed"
+              size="small"
+            ></el-input>
           </el-form-item>
           <el-form-item label="切出风速:" prop="ratedCutOutWindspeed">
-            <el-input v-model="ruleForm.ratedCutOutWindspeed" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.ratedCutOutWindspeed"
+              size="small"
+            ></el-input>
           </el-form-item>
         </div>
       </el-form>
       <div class="form-buttons">
-        <el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
+        <el-button type="primary" @click="submitForm('ruleForm')"
+          >确定</el-button
+        >
         <el-button @click="resetForm('ruleForm')">取消</el-button>
       </div>
     </el-dialog>
@@ -209,17 +366,20 @@
         </div>
         <div class="condition">
           <p>额定风速:</p>
-          <span>{{ particularsdata.rated_wind_speed }}</span><span>(m/s)</span>
+          <span>{{ particularsdata.rated_wind_speed }}</span
+          ><span>(m/s)</span>
         </div>
 
         <div class="condition">
           <p>切入风速:</p>
-          <span>{{ particularsdata.ratedCutInWindspeed }}</span><span>(m/s)</span>
+          <span>{{ particularsdata.ratedCutInWindspeed }}</span
+          ><span>(m/s)</span>
         </div>
 
         <div class="condition">
           <p>切出风速:</p>
-          <span>{{ particularsdata.ratedCutOutWindspeed }}</span><span>(m/s)</span>
+          <span>{{ particularsdata.ratedCutOutWindspeed }}</span
+          ><span>(m/s)</span>
         </div>
 
         <div class="condition">
@@ -228,11 +388,11 @@
         </div>
         <div class="condition">
           <p>是否标杆:</p>
-          <span>{{ particularsdata.sightcing == 1 ? '是' : '否' }}</span>
+          <span>{{ particularsdata.sightcing == 1 ? "是" : "否" }}</span>
         </div>
         <div class="condition">
           <p>状态:</p>
-          <span>{{ particularsdata.state == 1 ? '启用' : '停用' }}</span>
+          <span>{{ particularsdata.state == 1 ? "启用" : "停用" }}</span>
         </div>
       </div>
     </el-dialog>
@@ -250,164 +410,173 @@ import {
   updateWindEngineGroup,
   windEngineGrouPage,
   getAllTemplate,
-  windEngineGroupImportData 
-} from '@/api/ledger.js'
+  windEngineGroupImportData,
+} from "@/api/ledger.js";
 export default {
   data() {
     return {
       formInline: {
-        fieldCode: '',
+        fieldCode: "",
         timeQuantum: [],
         pageNum: 1,
         pageSize: 10,
-        totalSize: 0
+        totalSize: 0,
       },
-      startDate: '',
-      endDate: '',
+      startDate: "",
+      endDate: "",
       tableData: [],
       particularsdata: [],
       ruleForm: {
-        fieldCode: '',
-        engineName: '',
-        airdensity: '',
-        millTypeCode: '',
-        ratedCapacity: '',
-        elevationHeight: '',
-        longitude: '',
-        latitude: '',
-        hubHeight: '',
-        sightcing: '',
-        rated_wind_speed: '',
-        ratedCutInWindspeed: '',
-        ratedCutOutWindspeed: ''
+        fieldCode: "",
+        engineName: "",
+        airdensity: "",
+        millTypeCode: "",
+        ratedCapacity: "",
+        elevationHeight: "",
+        longitude: "",
+        latitude: "",
+        hubHeight: "",
+        sightcing: "",
+        rated_wind_speed: "",
+        ratedCutInWindspeed: "",
+        ratedCutOutWindspeed: "",
       },
       fieldCodeOptions: [],
       millTypeCodeOptions: [],
       sightcingOptions: [
         {
           value: 1,
-          label: '是'
+          label: "是",
         },
         {
           value: 2,
-          label: '否'
-        }
+          label: "否",
+        },
       ],
       rules: {
         fieldCode: [
-          { required: true, message: '请选择关联风场', trigger: 'change' }
+          { required: true, message: "请选择关联风场", trigger: "change" },
         ],
         engineName: [
-          { required: true, message: '请输入风机名称', trigger: 'blur' }
+          { required: true, message: "请输入风机名称", trigger: "blur" },
         ],
         millTypeCode: [
-          { required: true, message: '请输入机型编号', trigger: 'blur' }
+          { required: true, message: "请输入机型编号", trigger: "blur" },
         ],
         ratedCapacity: [
-          { required: true, message: '请输入额定容量', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: 'blur' }
-        ],
-        elevationHeight: [
-          { required: true, message: '请输入海拔高度', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: 'blur' }
+          { required: true, message: "请输入额定容量", trigger: "blur" },
         ],
         longitude: [
-          { required: true, message: '请输入经度', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: 'blur' }
+          { required: true, message: "请输入经度", trigger: "blur" },
+          { validator: this.validateNumber, trigger: "blur" },
         ],
         latitude: [
-          { required: true, message: '请输入纬度', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: 'blur' }
+          { required: true, message: "请输入纬度", trigger: "blur" },
+          { validator: this.validateNumber, trigger: "blur" },
         ],
         hubHeight: [
-          { required: true, message: '请输入轮廓高度', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: 'blur' }
+          { required: true, message: "请输入轮廓高度", trigger: "blur" },
+          { validator: this.validateNumbertwo, trigger: "blur" },
+        ],
+        elevationHeight: [
+          { required: true, message: "请输入海拔高度", trigger: "blur" },
+          { validator: this.validateNumbertwo, trigger: "blur" },
         ],
         sightcing: [
-          { required: true, message: '请选择是否标杆', trigger: 'change' }
-        ]
+          { required: true, message: "请选择是否标杆", trigger: "change" },
+        ],
       },
       subordinatedata: [],
       subordinate: "",
       AllTemplateurl: "",
       // 新增信息
-      engineName: '',
-      airdensity: '',
-      fieldCode: '',
+      engineName: "",
+      airdensity: "",
+      fieldCode: "",
 
-      millTypeCode: '',
-      sheng: '',
+      millTypeCode: "",
+      sheng: "",
       shengOptions: [],
-      shi: '',
+      shi: "",
       shiOptions: [],
-      elevationHeight: '',
-      latitude: '',
-      sightcing: '',
+      elevationHeight: "",
+      latitude: "",
+      sightcing: "",
 
-      fileList: [
-
-      ],
+      fileList: [],
       globalFileList: [],
       nuedialog: false,
       unusualdialog: false,
       tolead: false,
       isEdit: false,
-      title: ''
-    }
+      title: "",
+    };
   },
   created() {
-    this.onSubmit()
-    this.windsite()
-    this.relevancy()
-    this.getAllTemplate()
+    this.onSubmit();
+    this.windsite();
+    this.relevancy();
+    this.getAllTemplate();
   },
   methods: {
     rowStyle() {
-      return 'text-align:center'
+      return "text-align:center";
     },
     onDateChange(date) {
       if (Array.isArray(date)) {
-        this.startDate = this.$formatDate(date[0])
-        this.endDate = this.$formatDate(date[1])
+        this.startDate = this.$formatDate(date[0]);
+        this.endDate = this.$formatDate(date[1]);
         if (this.endDate < this.startDate) {
-          this.endDate = this.startDate
+          this.endDate = this.startDate;
         }
       } else {
-        this.startDate = null
-        this.endDate = null
+        this.startDate = null;
+        this.endDate = null;
       }
     },
     //获取模板
     getAllTemplate() {
       getAllTemplate().then((res) => {
-        this.AllTemplateurl = res.data.draught
-      })
+        this.AllTemplateurl = res.data.draught;
+      });
     },
     // 下载模板
     download() {
       if (this.AllTemplateurl) {
-        const link = document.createElement('a')
-        link.href = this.AllTemplateurl
-        link.download = '' // 可以设置默认下载文件名
-        link.target = '_blank' // 新窗口打开
-        document.body.appendChild(link)
-        link.click()
-        document.body.removeChild(link)
+        const link = document.createElement("a");
+        link.href = this.AllTemplateurl;
+        link.download = ""; // 可以设置默认下载文件名
+        link.target = "_blank"; // 新窗口打开
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
       } else {
-        console.error('URL is not set')
+        console.error("URL is not set");
       }
     },
     // 数字验证
     validateNumber(rule, value, callback) {
-      const numberRegex = /^\d{1,3}(\.\d{1,5})?$/ // 匹配不超过四位数且小数点后不超过二位数的数字
+      const numberRegex = /^\d{1,3}(\.\d{1,5})?$/; // 匹配不超过四位数且小数点后不超过二位数的数字
       if (!value) {
-        callback(new Error('该项不能为空'))
+        callback(new Error("该项不能为空"));
       } else if (!numberRegex.test(value)) {
         callback(
-          new Error('该项必须为不超过三位数且小数点后不超过五位数的数字')
-        )
+          new Error("该项必须为不超过三位数且小数点后不超过五位数的数字")
+        );
       } else {
-        callback()
+        callback();
+      }
+    },
+    validateNumbertwo(rule, value, callback) {
+      const numberRegex = /^\d{1,4}(\.\d{1,2})?$/; // 匹配不超过四位数且小数点后不超过二位数的数字
+      if (!value) {
+        callback(new Error("该项不能为空"));
+      } else if (!numberRegex.test(value)) {
+        callback(
+          new Error("该项必须为不超过四位数且小数点后不超过两位数的数字")
+        );
+      } else {
+        callback();
       }
     },
     // 查询
@@ -417,36 +586,36 @@ export default {
         beginTime: this.startDate || undefined,
         endTime: this.endDate || undefined,
         pageNum: this.formInline.pageNum || 1,
-        pageSize: 10
-      }
+        pageSize: 10,
+      };
       windEngineGrouPage(paramsData).then((res) => {
-        this.tableData = res.data.list
-        this.formInline.totalSize = res.data.totalSize
-      })
+        this.tableData = res.data.list;
+        this.formInline.totalSize = res.data.totalSize;
+      });
     },
 
     // 停用
     start(row, type) {
       let objectval = {
         engineCode: row.engineCode,
-        state: type === 0 ? 0 : 1
-      }
+        state: type === 0 ? 0 : 1,
+      };
       updateStateWindEngineGroup(objectval).then((res) => {
         this.$message({
-          message: '状态已更新成功',
-          type: 'success'
-        })
+          message: "状态已更新成功",
+          type: "success",
+        });
         // this.$message(`${type === 1 ? '状态已更新成功' : '状态已更新成功'}`);
-        row.state = type === 1 ? 0 : 1
-        this.onSubmit()
-      })
+        row.state = type === 1 ? 0 : 1;
+        this.onSubmit();
+      });
     },
     //详情
     particulars(row) {
-      this.unusualdialog = true
+      this.unusualdialog = true;
       getWindEngineGroup({ engineCode: row.engineCode }).then((res) => {
-        this.particularsdata = res.data
-      })
+        this.particularsdata = res.data;
+      });
     },
     // 确认
     submitForm(formName) {
@@ -454,7 +623,6 @@ export default {
         const objData = {
           fieldCode: this.ruleForm.fieldCode,
           engineName: this.ruleForm.engineName,
-          // airdensity: this.ruleForm.airdensity,
           millTypeCode: this.ruleForm.millTypeCode,
           ratedCapacity: this.ruleForm.ratedCapacity,
           elevationHeight: this.ruleForm.elevationHeight,
@@ -464,160 +632,196 @@ export default {
           sightcing: this.ruleForm.sightcing,
           rated_wind_speed: this.ruleForm.rated_wind_speed,
           ratedCutInWindspeed: this.ruleForm.ratedCutInWindspeed,
-          ratedCutOutWindspeed: this.ruleForm.ratedCutOutWindspeed
-        }
-        // fieldCode
+          ratedCutOutWindspeed: this.ruleForm.ratedCutOutWindspeed,
+        };
+
         if (valid) {
           const API = this.isEdit
             ? updateWindEngineGroup(objData)
-            : createWindEngineGroup(objData)
+            : createWindEngineGroup(objData);
+
           API.then((res) => {
-            this.nuedialog = false
-            this.onSubmit()
-          })
+            if (res.code === -1) {
+              this.$message({
+                message: "操作成功 操作失败",
+                type: " error",
+              });
+            } else {
+              this.$message({
+                message: "操作成功",
+                type: "success",
+              });
+            }
+            this.nuedialog = false;
+            this.onSubmit();
+          }).catch((error) => {});
         } else {
-          console.log('表单验证失败')
-          return false
+          console.log("表单验证失败");
+          return false;
         }
-      })
+      });
     },
+
     // 取消
     resetForm(formName) {
-      this.$refs[formName].resetFields()
-      this.nuedialog = false
+      this.$refs[formName].resetFields();
+      this.nuedialog = false;
     },
     // 获取风场
     windsite() {
-      debugger
+      debugger;
       getWindFieldNames().then((res) => {
-        this.fieldCodeOptions = res.data
-        this.subordinatedata = res.data
-      })
+        this.fieldCodeOptions = res.data;
+        this.subordinatedata = res.data;
+      });
     },
     // 获取机型
     async relevancy() {
       try {
-        const res = await getWindEngineMillList()
-        this.millTypeCodeOptions = res.data
+        const res = await getWindEngineMillList();
+        this.millTypeCodeOptions = res.data;
       } catch (error) {
-        console.error('Error fetching wind engine mill list:', error)
+        console.error("Error fetching wind engine mill list:", error);
       }
     },
 
     //分页数据切换
     handleCurrentChange(val) {
-      this.formInline.pageNum = val
-      this.onSubmit()
+      this.formInline.pageNum = val;
+      this.onSubmit();
     },
     // 重置
-    reset() { },
+    reset() {
+      this.formInline.engineName = "";
+      this.formInline.timeQuantum = "";
+      this.onSubmit();
+    },
     //导入提交
     UPsubmit() {
-
       let filedata = {
         fieldCode: this.subordinate,
-        file: this.globalFileList
-      }
-      if(filedata.file==""){
+        file: this.globalFileList,
+      };
+      if (filedata.file == "") {
         this.$message({
-          message: '请先提交附件',
-          type: 'warning'
+          message: "请先提交附件",
+          type: "warning",
         });
-      }else{
-        windEngineGroupImportData(filedata).then((res) => {
-        console.log(res)
-        this.uploadingPOP = false
-        this.$message.success('上传成功')
-      })
+      } else {
+        windEngineGroupImportData(filedata)
+          .then((res) => {
+            console.log(res);
+            this.uploadingPOP = false;
+            if (res.code === -1) {
+              this.$message({
+                message: "上传失败",
+                type: "error",
+              });
+            } else {
+              this.tolead = false;
+              this.$message({
+                message: "上传成功",
+                type: "success",
+              });
+              this.onSubmit();
+            }
+          })
+          .catch((error) => {});
       }
-   
+
       console.log(filedata);
       // this.tolead = false
     },
     // 新增
     newly() {
-      this.nuedialog = false
+      this.nuedialog = false;
     },
 
     // 编辑
     compile(row) {
       getWindEngineGroup({ engineCode: row.engineCode }).then((res) => {
-        const item = JSON.parse(JSON.stringify(res.data))
-        this.detail = item
+        const item = JSON.parse(JSON.stringify(res.data));
+        this.detail = item;
         Object.keys(this.ruleForm).forEach((key) => {
-          this.ruleForm[key] = item[key]
-        })
-      })
-      this.nuedialog = true
-      this.title = '编辑'
-      this.isEdit = true
+          this.ruleForm[key] = item[key];
+        });
+      });
+      this.nuedialog = true;
+      this.title = "编辑";
+      this.isEdit = true;
     },
 
     // 删除
     deleted(row) {
-      console.log(row, 'row')
-      if (row.state == '1') {
+      console.log(row, "row");
+      if (row.state == "1") {
         this.$message({
-          type: 'error',
-          message: '该项处于启用状态,无法删除!'
-        })
-        return
+          type: "error",
+          message: "该项处于启用状态,无法删除!",
+        });
+        return;
       }
-      this.$confirm('此操作将永久删除该文件,是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
+      this.$confirm("此操作将永久删除该文件,是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
       })
         .then(() => {
           delWindEngineGroup({ engineCode: row.engineCode }).then((res) => {
-            this.onSubmit()
+            this.onSubmit();
             // 执行删除操作
             this.$message({
-              type: 'success',
-              message: '删除成功!'
-            })
-          })
+              type: "success",
+              message: "删除成功!",
+            });
+          });
         })
         .catch(() => {
           // 取消删除
           this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
-        })
+            type: "info",
+            message: "已取消删除",
+          });
+        });
     },
 
     // 导入
     upfile() {
-      this.tolead = true
+      this.tolead = true;
     },
     // 新增
     newnuedialog() {
-      this.nuedialog = true
-      this.title = '新增'
+      this.nuedialog = true;
+      this.title = "新增";
     },
 
     // 附件验证
     beforeUpload(fileList) {
       const isXLSX =
         fileList.type ===
-        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
       if (!isXLSX) {
-        this.$message.error('只能上传xlsx文件')
+        this.$message.error("只能上传xlsx文件");
       }
-      const isLt5MB = fileList.size / 1024 / 1024 < 5
+      const isLt5MB = fileList.size / 1024 / 1024 < 5;
       if (!isLt5MB) {
-        this.$message.error('文件大小不能超过5MB')
+        this.$message.error("文件大小不能超过5MB");
       }
-      console.log(fileList, 'fileList')
-      return isXLSX && isLt5MB
+      console.log(fileList, "fileList");
+      return isXLSX && isLt5MB;
     },
     handleOnChange(fileList) {
-      console.log(fileList)
-      this.globalFileList = fileList.raw
-    }
-  }
-}
+      console.log(fileList);
+      this.globalFileList = fileList.raw;
+    },
+
+    handleClose() {
+      this.subordinate = "";
+      this.fileList = [];
+      this.tolead = false;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -687,7 +891,6 @@ export default {
 }
 
 .demo-ruleForm {
-
   .el-select {
     width: 260px;
   }

+ 61 - 167
src/views/ledger/enterprise.vue

@@ -3,63 +3,37 @@
     <div class="condition">
       <el-form :inline="true" :model="formInline" class="demo-form-inline">
         <el-form-item label="单位名称:">
-          <el-input
-            v-model="formInline.companyName"
-            placeholder="请输入单位名称"
-            size="small"
-          ></el-input>
+          <el-input v-model="formInline.companyName" placeholder="请输入单位名称" size="small"></el-input>
         </el-form-item>
         <el-form-item label="状态:">
-          <el-select
-            v-model="formInline.state"
-            placeholder="选择状态"
-            size="small "
-          >
+          <el-select v-model="formInline.state" placeholder="选择状态" size="small ">
             <el-option label="启用" value="1"></el-option>
             <el-option label="停用" value="0"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="getTableList" size="small"
-            >查询</el-button
-          >
+          <el-button type="primary" @click="getTableList" size="small">查询</el-button>
           <el-button @click="reset" size="small">重置</el-button>
         </el-form-item>
       </el-form>
     </div>
     <div class="list-page">
       <div class="newly">
-        <el-button type="primary" @click="newnuedialog" size="small"
-          >新增</el-button
-        >
+        <el-button type="primary" @click="newnuedialog" size="small">新增</el-button>
         <el-button type="primary" @click="toggleExpandAll" size="small">{{
           defaultExpandAll ? "收起" : "展开"
         }}</el-button>
       </div>
 
-      <el-table
-        class="center-align-table"
-        ref="table"
-        :data="tableData"
-        border
-        :cell-style="rowStyle"
-        stripe
-        row-key="id"
-        default-expand-all
-        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-      >
+      <el-table class="center-align-table" ref="table" :data="tableData" border :cell-style="rowStyle" stripe
+        row-key="id" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
         <!-- Table Columns -->
         <el-table-column fixed prop="codeName" align="center" label="单位名称">
         </el-table-column>
         <el-table-column prop="companyCode" align="center" label="单位ID">
         </el-table-column>
 
-        <el-table-column
-          prop="fieldCount"
-          align="center"
-          label="风场数量"
-          width="200"
-        >
+        <el-table-column prop="fieldCount" align="center" label="风场数量" width="200">
           <template slot-scope="scope">
             <el-button @click="particulars(scope.row)" type="text" size="small">
               {{ scope.row.fieldCount }}
@@ -77,45 +51,13 @@
             {{ $formatDate(row.createTime) }}
           </template>
         </el-table-column>
-        <el-table-column
-          prop="state"
-          align="center"
-          fixed="right"
-          label="操作"
-          width="200"
-        >
+        <el-table-column prop="state" align="center" fixed="right" label="操作" width="200">
           <template slot-scope="scope">
-            <el-button @click="compile(scope.row)" type="text" size="small"
-              >编辑</el-button
-            >
-            <el-button
-              @click="newcomer(scope.row, 'addChild')"
-              type="text"
-              size="small"
-              >新增</el-button
-            >
-            <el-button
-              v-if="scope.row.state == 0"
-              @click="start(scope.row, 1)"
-              type="text"
-              size="small"
-              >启用</el-button
-            >
-            <el-button
-              v-else
-              style="color: #666"
-              @click="start(scope.row, 0)"
-              type="text"
-              size="small"
-              >停用</el-button
-            >
-            <el-button
-              style="color: #f00"
-              @click="deleted(scope.row)"
-              type="text"
-              size="small"
-              >删除</el-button
-            >
+            <el-button @click="compile(scope.row)" type="text" size="small">编辑</el-button>
+            <el-button @click="newcomer(scope.row, 'addChild')" type="text" size="small">新增</el-button>
+            <el-button v-if="scope.row.state == 0" @click="start(scope.row, 1)" type="text" size="small">启用</el-button>
+            <el-button v-else style="color: #666" @click="start(scope.row, 0)" type="text" size="small">停用</el-button>
+            <el-button style="color: #f00" @click="deleted(scope.row)" type="text" size="small">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -123,80 +65,34 @@
 
     <!-- 弹出层 -->
     <!-- 新增 -->
-    <el-dialog
-      :title="title"
-      :visible.sync="nuedialog"
-      width="380px"
-      @close="handleClose"
-    >
-      <el-form
-        ref="newform"
-        :rules="rules"
-        :model="newform"
-        label-width="90px"
-        class="form-margin"
-      >
+    <el-dialog :title="title" :visible.sync="nuedialog" width="380px" @close="handleClose">
+      <el-form ref="newform" :rules="rules" :model="newform" label-width="90px" class="form-margin">
         <el-form-item label="单位名称:" prop="companyName">
           <el-input v-model="newform.companyName" size="small"></el-input>
         </el-form-item>
         <el-form-item label="所属省:" prop="province">
-          <el-select
-            v-model="newform.province"
-            placeholder="请选择"
-            size="small"
-            value-key="areaId"
-            @change="fetchCities"
-          >
-            <el-option
-              v-for="item in shengdata"
-              :key="item.areaId"
-              :label="item.province"
-              :value="item"
-            ></el-option>
+          <el-select v-model="newform.province" placeholder="请选择" size="small" value-key="areaId" @change="fetchCities">
+            <el-option v-for="item in shengdata" :key="item.areaId" :label="item.province" :value="item"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="所属市:" prop="city">
-          <el-select
-            v-model="newform.city"
-            placeholder="请选择"
-            size="small"
-            value-key="areaId"
-            @change="$forceUpdate()"
-          >
-            <el-option
-              v-for="item in shidata"
-              :key="item.areaId"
-              :label="item.city"
-              :value="item"
-            ></el-option>
+          <el-select v-model="newform.city" placeholder="请选择" size="small" value-key="areaId" @change="$forceUpdate()">
+            <el-option v-for="item in shidata" :key="item.areaId" :label="item.city" :value="item"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="备注:">
-          <el-input
-            v-model="newform.described"
-            size="small"
-            type="textarea"
-          ></el-input>
+          <el-input v-model="newform.described" size="small" type="textarea"></el-input>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="nuedialog = false" size="small">取 消</el-button>
-        <el-button type="primary" @click="newly('newform')" size="small"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="newly('newform')" size="small">确 定</el-button>
       </span>
     </el-dialog>
 
     <!-- 风场数量 -->
     <el-dialog title="风场数量" :visible.sync="unusualdialog" width="1000px">
-      <el-table
-        class="center-align-table"
-        :data="FCtableData"
-        border
-        :cell-style="rowStyle"
-        stripe
-        max-height="500"
-      >
+      <el-table class="center-align-table" :data="FCtableData" border :cell-style="rowStyle" stripe max-height="500">
         <!-- Table Columns -->
         <el-table-column fixed prop="fieldName" align="center" label="风场名称">
         </el-table-column>
@@ -204,27 +100,13 @@
         </el-table-column>
         <el-table-column prop="cityName" align="center" label="所在市">
         </el-table-column>
-        <el-table-column
-          prop="elevationHeight"
-          align="center"
-          label="海拔高度"
-          width="80"
-        >
+        <el-table-column prop="elevationHeight" align="center" label="海拔高度" width="80">
         </el-table-column>
-        <el-table-column
-          prop="longitude"
-          align="center"
-          label="经度"
-          width="80"
-        >
+        <el-table-column prop="longitude" align="center" label="经度" width="80">
         </el-table-column>
         <el-table-column prop="latitude" align="center" label="纬度" width="80">
         </el-table-column>
-        <el-table-column
-          prop="ratedCapacityNumber"
-          align="center"
-          label="额定容量"
-        >
+        <el-table-column prop="ratedCapacityNumber" align="center" label="额定容量">
         </el-table-column>
       </el-table>
 
@@ -294,8 +176,8 @@ export default {
       warningShown: false,
       addPrarentCompanyCode: null,
       pageNum: 1,
-        pageSize: 10,
-        totalSize: 0,
+      pageSize: 10,
+      totalSize: 0,
     };
   },
   created() {
@@ -314,15 +196,9 @@ export default {
     },
   },
   methods: {
-  //   formatDate(timestamp) {
-  //   const date = new Date(timestamp);
-  //   const year = date.getFullYear();
-  //   const month = String(date.getMonth() + 1).padStart(2, '0');
-  //   const day = String(date.getDate()).padStart(2, '0');
-  //   return `${year}-${month}-${day}`;
-  // },
-
     handleClose() {
+      this.newform.province = "";
+      this.newform.city = "";
       Object.assign(this.$data.newform, this.$options.data().newform);
     },
 
@@ -403,28 +279,46 @@ export default {
         if (valid) {
           let objectval = {
             parentCode: this.addPrarentCompanyCode || 0, // 一级单位默认传0
-            companyName: this.newform?.companyName, //企业名称
-            provinceId: this.newform.province?.areaId, //省
+            companyName: this.newform?.companyName, // 企业名称
+            provinceId: this.newform.province?.areaId, // 
             provinceName: this.newform.province?.province,
-            cityId: this.newform.city?.areaId, //市
+            cityId: this.newform.city?.areaId, // 
             cityName: this.newform.city?.city,
-            described: this.newform?.described, //备注
+            described: this.newform?.described, // 备注
           };
+
+          let requestPromise;
           if (!this.isEdit) {
-            addCompany(objectval).then((res) => {
-              this.addPrarentCompanyCode = null;
-            });
+            requestPromise = addCompany(objectval);
           } else {
             objectval.companyCode = this.detail.companyCode;
             delete objectval.parentCode;
-            updateCompany(objectval).then((res) => {
+            requestPromise = updateCompany(objectval);
+          }
+
+          requestPromise
+            .then((res) => {
               this.addPrarentCompanyCode = null;
-              this.isEdit = false;
+              if (this.isEdit) {
+                this.isEdit = false;
+              }
+              if (res.code === -1) {
+                this.$message({
+                  message: "操作失败",
+                  type: "error",
+                });
+              } else {
+                this.$message({
+                  message: "新增成功",
+                  type: "success",
+                });
+              }
+              this.nuedialog = false;
+              this.getTableList();
+            })
+            .catch((error) => {
+              console.error(error);
             });
-          }
-          console.log(objectval);
-          this.nuedialog = false;
-          this.getTableList();
         } else {
           console.log("error submit!!");
           return false;
@@ -506,7 +400,7 @@ export default {
       // const arr = {
       //   companyCode: "arr",
       // };
-      getWindFieldVos({companyCode:row.companyCode}).then((res) => {
+      getWindFieldVos({ companyCode: row.companyCode }).then((res) => {
         this.FCtableData = res.data;
         this.totalSize = res.totalSize;
       });

+ 362 - 226
src/views/ledger/milltype.vue

@@ -3,38 +3,79 @@
     <div class="condition">
       <el-form :inline="true" :model="formInline" class="demo-form-inline">
         <el-form-item label="收资机型型号:">
-          <el-input v-model="formInline.machineTypeCode" placeholder="请输入机型型号" size="small"></el-input>
+          <el-input
+            v-model="formInline.machineTypeCode"
+            placeholder="请输入机型型号"
+            size="small"
+          ></el-input>
         </el-form-item>
         <el-form-item label="选择日期:" size="small">
-          <el-date-picker v-model="formInline.timeQuantum" type="daterange" range-separator="至" start-placeholder="开始日期"
-            end-placeholder="结束日期" @change="onDateChange">
+          <el-date-picker
+            v-model="formInline.timeQuantum"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            @change="onDateChange"
+          >
           </el-date-picker>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="onSubmit" size="small">查询</el-button>
+          <el-button type="primary" @click="onSubmit" size="small"
+            >查询</el-button
+          >
           <el-button @click="reset" size="small">重置</el-button>
         </el-form-item>
       </el-form>
     </div>
     <div class="list-page">
       <div class="newly">
-        <el-button type="primary" @click="newnuedialog" size="small">新增</el-button>
+        <el-button type="primary" @click="newnuedialog" size="small"
+          >新增</el-button
+        >
       </div>
 
-      <el-table class="center-align-table" :data="tableData" border :cell-style="rowStyle">
-        <el-table-column align="center" fixed prop="machineTypeCode" label="收资机型型号">
+      <el-table
+        class="center-align-table"
+        :data="tableData"
+        border
+        :cell-style="rowStyle"
+      >
+        <el-table-column
+          align="center"
+          fixed
+          prop="machineTypeCode"
+          label="收资机型型号"
+        >
           <template slot-scope="scope">
-            <el-button @click="particulars(scope.row)" type="text" size="small">{{ scope.row.machineTypeCode
-              }}</el-button>
+            <el-button
+              @click="particulars(scope.row)"
+              type="text"
+              size="small"
+              >{{ scope.row.machineTypeCode }}</el-button
+            >
           </template>
         </el-table-column>
-        <el-table-column prop="millTypeCode" align="center" label="系统机型编号">
+        <el-table-column
+          prop="millTypeCode"
+          align="center"
+          label="系统机型编号"
+        >
         </el-table-column>
 
-        <el-table-column prop="manufacturerCode" align="center" label="厂商编号">
+        <el-table-column
+          prop="manufacturerCode"
+          align="center"
+          label="厂商编号"
+        >
         </el-table-column>
 
-        <el-table-column prop="curvedMotionType" align="center" label="机型类型" width="120">
+        <el-table-column
+          prop="curvedMotionType"
+          align="center"
+          label="机型类型"
+          width="120"
+        >
           <template v-slot="scope">
             <!-- 假设 type 为 123 时显示特殊内容 -->
             <span v-if="scope.row.curvedMotionType == '1'">双馈</span>
@@ -42,49 +83,113 @@
             <span v-else-if="scope.row.curvedMotionType == '3'">半直曲</span>
           </template>
         </el-table-column>
-        <el-table-column prop="manufacturerName" align="center" label="厂商名称" width="200">
+        <el-table-column
+          prop="manufacturerName"
+          align="center"
+          label="厂商名称"
+          width="200"
+        >
         </el-table-column>
 
-        <el-table-column prop="brand" align="center" label="品牌名称" width="200">
+        <el-table-column
+          prop="brand"
+          align="center"
+          label="品牌名称"
+          width="200"
+        >
         </el-table-column>
         <el-table-column prop="state" align="center" label="状态" width="100">
           <template slot-scope="{ row }">
-            {{ row.state == 1 ? '启用' : '停用' }}
+            {{ row.state == 1 ? "启用" : "停用" }}
           </template>
         </el-table-column>
         <el-table-column prop="createTime" align="center" label="创建时间">
         </el-table-column>
-        <el-table-column prop="transition" align="center" fixed="right" label="操作" width="200">
+        <el-table-column
+          prop="transition"
+          align="center"
+          fixed="right"
+          label="操作"
+          width="200"
+        >
           <template slot-scope="scope">
-            <el-button @click="compile(scope.row)" type="text" size="small">编辑</el-button>
-            <el-button @click="uploading(scope.row)" type="text" size="small">上传</el-button>
-            <el-button v-if="scope.row.state == 0" @click="start(scope.row, 1)" type="text" size="small">启用</el-button>
-            <el-button v-else style="color: #666" @click="start(scope.row, 0)" type="text" size="small">停用</el-button>
-            <el-button style="color: #f00" @click="deleted(scope.row)" type="text" size="small">删除</el-button>
+            <el-button @click="compile(scope.row)" type="text" size="small"
+              >编辑</el-button
+            >
+            <el-button @click="uploading(scope.row)" type="text" size="small"
+              >上传</el-button
+            >
+            <el-button
+              v-if="scope.row.state == 0"
+              @click="start(scope.row, 1)"
+              type="text"
+              size="small"
+              >启用</el-button
+            >
+            <el-button
+              v-else
+              style="color: #666"
+              @click="start(scope.row, 0)"
+              type="text"
+              size="small"
+              >停用</el-button
+            >
+            <el-button
+              style="color: #f00"
+              @click="deleted(scope.row)"
+              type="text"
+              size="small"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
       <div class="pagination-container">
-        <el-pagination @current-change="handleCurrentChange" :current-page.sync="formInline.pageNum"
-          layout="total, prev, pager, next" :page-size="formInline.pageSize" :total="formInline.totalSize">
+        <el-pagination
+          @current-change="handleCurrentChange"
+          :current-page.sync="formInline.pageNum"
+          layout="total, prev, pager, next"
+          :page-size="formInline.pageSize"
+          :total="formInline.totalSize"
+        >
         </el-pagination>
       </div>
     </div>
 
     <!-- 新增 -->
-    <el-dialog :title="title" :visible.sync="nuedialog" :before-close="handleClose" width="800px">
-      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm form-grid">
+    <el-dialog
+      :title="title"
+      :visible.sync="nuedialog"
+      :before-close="handleClose"
+      width="800px"
+    >
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="120px"
+        class="demo-ruleForm form-grid"
+      >
         <div class="form-row">
           <el-form-item label="收资机型型号:" prop="machineTypeCode">
-            <el-input v-model="ruleForm.machineTypeCode" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.machineTypeCode"
+              size="small"
+            ></el-input>
           </el-form-item>
           <el-form-item label="厂商名称:" prop="manufacturerName">
-            <el-input v-model="ruleForm.manufacturerName" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.manufacturerName"
+              size="small"
+            ></el-input>
           </el-form-item>
         </div>
         <div class="form-row">
           <el-form-item label="厂商编号:" prop="manufacturerCode">
-            <el-input v-model="ruleForm.manufacturerCode" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.manufacturerCode"
+              size="small"
+            ></el-input>
           </el-form-item>
           <el-form-item label="品牌名称:" prop="brand">
             <el-input v-model="ruleForm.brand" size="small"></el-input>
@@ -92,10 +197,19 @@
         </div>
         <div class="form-row">
           <el-form-item label="驱动方式:" prop="curvedMotionType">
-            <el-select v-model="ruleForm.curvedMotionType" placeholder="请选择" value-key="contentsValue"
-              @change="handleSelectChange" size="small">
-              <el-option v-for="item in curvedMotionTypeOptions" :key="item.contentsValue" :label="item.contentsName"
-                :value="item.contentsValue"></el-option>
+            <el-select
+              v-model="ruleForm.curvedMotionType"
+              placeholder="请选择"
+              value-key="contentsValue"
+              @change="handleSelectChange"
+              size="small"
+            >
+              <el-option
+                v-for="item in curvedMotionTypeOptions"
+                :key="item.contentsValue"
+                :label="item.contentsName"
+                :value="item.contentsValue"
+              ></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="塔筒高度:" prop="towerHeight">
@@ -109,18 +223,20 @@
           <el-form-item label="叶轮直径:" prop="rotorDiameter">
             <el-input v-model="ruleForm.rotorDiameter" size="small"></el-input>
           </el-form-item>
-
         </div>
         <div class="form-row">
           <el-form-item label="传动比-转速比:" prop="rotationalSpeedRatio">
-            <el-input v-model="ruleForm.rotationalSpeedRatio" size="small"></el-input>
+            <el-input
+              v-model="ruleForm.rotationalSpeedRatio"
+              size="small"
+            ></el-input>
           </el-form-item>
-
-
         </div>
-
       </el-form>
-      <div class="form-actions"> <el-button type="primary" @click="submitForm('ruleForm')" size="small">提交</el-button>
+      <div class="form-actions">
+        <el-button type="primary" @click="submitForm('ruleForm')" size="small"
+          >提交</el-button
+        >
         <el-button @click="resetForm('ruleForm')" size="small">取消</el-button>
       </div>
     </el-dialog>
@@ -151,11 +267,14 @@
           <span>
             <span v-if="particularsdata.curvedMotionType === 1">双馈</span>
             <span v-else-if="particularsdata.curvedMotionType === 2">半驱</span>
-            <span v-else-if="particularsdata.curvedMotionType === 3">半直曲</span></span>
+            <span v-else-if="particularsdata.curvedMotionType === 3"
+              >半直曲</span
+            ></span
+          >
         </div>
         <div class="condition">
           <p>状态:</p>
-          <span>{{ particularsdata.state == 1 ? '启用' : '停用' }}</span>
+          <span>{{ particularsdata.state == 1 ? "启用" : "停用" }}</span>
         </div>
         <div class="condition">
           <p>塔筒高度:</p>
@@ -186,8 +305,18 @@
       </el-alert>
       <p class="model-center" @click="download">模板下载</p>
 
-      <el-upload class="upload-demo" :file-list="fileList" drag action :multiple="false" :before-upload="beforeUpload"
-        :limit="1" :auto-upload="false" :on-change="handleOnChange" accept=".xlsx">
+      <el-upload
+        class="upload-demo"
+        :file-list="fileList"
+        drag
+        action
+        :multiple="false"
+        :before-upload="beforeUpload"
+        :limit="1"
+        :auto-upload="false"
+        :on-change="handleOnChange"
+        accept=".xlsx"
+      >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip" slot="tip">
@@ -196,7 +325,9 @@
       </el-upload>
       <div slot="footer" class="dialog-footer">
         <el-button @click="uploadingPOP = false" size="small">取 消</el-button>
-        <el-button type="primary" @click="filesubmit" size="small">提交</el-button>
+        <el-button type="primary" @click="filesubmit" size="small"
+          >提交</el-button
+        >
       </div>
     </el-dialog>
   </div>
@@ -211,100 +342,98 @@ import {
   getWindEngineMillPageVo,
   powerWordCriterionImportData,
   updateWindEngineMill,
-  windEngineMillPage
-} from '@/api/ledger.js'
+  windEngineMillPage,
+} from "@/api/ledger.js";
 
 export default {
   data() {
     return {
       tableData: [],
       formInline: {
-        machineTypeCode: '',
+        machineTypeCode: "",
         timeQuantum: [],
         pageNum: 1,
         pageSize: 10,
-        totalSize: 0
+        totalSize: 0,
       },
-      startDate: '',
-      endDate: '',
+      startDate: "",
+      endDate: "",
       //新增
       ruleForm: {
-        machineTypeCode: '',
-        manufacturerName: '',
-        brand: '',
-        curvedMotionType: '',
-        towerHeight: '',
-        manufacturerCode: '',
-        vaneLong: '',
+        machineTypeCode: "",
+        manufacturerName: "",
+        brand: "",
+        curvedMotionType: "",
+        towerHeight: "",
+        manufacturerCode: "",
+        vaneLong: "",
         rotorDiameter: "",
         rotationalSpeedRatio: "",
       },
       curvedMotionTypeOptions: [],
       rules: {
         machineTypeCode: [
-          { required: true, message: '请输入机型型号', trigger: 'blur' }
+          { required: true, message: "请输入机型型号", trigger: "blur" },
         ],
         manufacturerName: [
-          { required: true, message: '请输入厂商名称', trigger: 'blur' }
+          { required: true, message: "请输入厂商名称", trigger: "blur" },
         ],
         manufacturerCode: [
-          { required: true, message: '请输入厂商编号', trigger: 'blur' }
+          { required: true, message: "请输入厂商编号", trigger: "blur" },
         ],
-        brand: [{ required: true, message: '请输入品牌名称', trigger: 'blur' }],
+        brand: [{ required: true, message: "请输入品牌名称", trigger: "blur" }],
         curvedMotionType: [
-          { required: true, message: '请选择驱动方式', trigger: 'change' }
+          { required: true, message: "请选择驱动方式", trigger: "change" },
         ],
         towerHeight: [
-          { required: true, message: '请输入塔筒高度', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: ['blur', 'change'] }
+          { required: true, message: "请输入塔筒高度", trigger: "blur" },
+          { validator: this.validateNumber, trigger: ["blur", "change"] },
         ],
         vaneLong: [
-          { required: true, message: '请输入叶片长度', trigger: 'blur' },
-          { validator: this.validateNumber, trigger: ['blur', 'change'] }
-        ]
+          { required: true, message: "请输入叶片长度", trigger: "blur" },
+          { validator: this.validateNumber, trigger: ["blur", "change"] },
+        ],
       },
       particularsdata: [],
       // 新增信息
-      superior: '',
+      superior: "",
       superiorOptions: [],
-      altitude: '',
+      altitude: "",
       fileList: [],
       globalFileList: [],
-      AllTemplateurl: '',
-      rowmillTypeCode: '',
-
+      AllTemplateurl: "",
+      rowmillTypeCode: "",
 
       nuedialog: false,
       unusualdialog: false,
       draught: false,
       uploadingPOP: false,
-      title: '新增',
+      title: "新增",
       detail: {},
-      isEdit: false
-    }
+      isEdit: false,
+    };
   },
   created() {
-    this.onSubmit()
-    this.Modeltype()
+    this.onSubmit();
+    this.Modeltype();
   },
   mounted() {
-    this.getAllTemplate()
+    this.getAllTemplate();
   },
   methods: {
-
     rowStyle() {
-      return 'text-align:center'
+      return "text-align:center";
     },
     onDateChange(date) {
       if (Array.isArray(date)) {
-        this.startDate = this.$formatDate(date[0])
-        this.endDate = this.$formatDate(date[1])
+        this.startDate = this.$formatDate(date[0]);
+        this.endDate = this.$formatDate(date[1]);
         if (this.endDate < this.startDate) {
-          this.endDate = this.startDate
+          this.endDate = this.startDate;
         }
       } else {
-        this.startDate = null
-        this.endDate = null
+        this.startDate = null;
+        this.endDate = null;
       }
     },
 
@@ -315,250 +444,257 @@ export default {
         beginTime: this.startDate || undefined,
         endTime: this.endDate || undefined,
         pageNum: this.formInline.pageNum || 1,
-        pageSize: 10
-      }
+        pageSize: 10,
+      };
       windEngineMillPage(paramsData).then((res) => {
-        this.tableData = res.data.list
-        this.formInline.totalSize = res.data.totalSize
-      })
+        this.tableData = res.data.list;
+        this.formInline.totalSize = res.data.totalSize;
+      });
     },
     // 停用
     start(row, type) {
       let objectval = {
         millTypeCode: row.millTypeCode,
-        state: type === 0 ? 0 : 1
-      }
+        state: type === 0 ? 0 : 1,
+      };
       updateWindEngineMill(objectval).then((res) => {
         this.$message({
-          message: '状态已更新成功',
-          type: 'success'
-        })
+          message: "状态已更新成功",
+          type: "success",
+        });
         // this.$message(`${type === 1 ? '状态已更新成功' : '状态已更新成功'}`);
-        row.state = type === 1 ? 0 : 1
-        this.onSubmit()
-      })
+        row.state = type === 1 ? 0 : 1;
+        this.onSubmit();
+      });
     },
     Modeltype() {
       getDictList({
-        dictType: 1
+        dictType: 1,
       }).then((res) => {
-        this.curvedMotionTypeOptions = res.data
-      })
+        this.curvedMotionTypeOptions = res.data;
+      });
     },
     handleSelectChange(value) {
-      console.log('Selected value:', value);
+      console.log("Selected value:", value);
     },
     // 新增提交
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
-        if (valid) {
-          let objectdata = {
-            machineTypeCode: this.ruleForm.machineTypeCode,
-            manufacturerName: this.ruleForm.manufacturerName,
-            manufacturerCode: this.ruleForm.manufacturerCode,
-            brand: this.ruleForm.brand,
-            curvedMotionType: this.ruleForm.curvedMotionType,
-            towerHeight: this.ruleForm.towerHeight,
-            vaneLong: this.ruleForm.vaneLong,
-            rotorDiameter: this.ruleForm.rotorDiameter,
-            rotationalSpeedRatio: this.ruleForm.rotationalSpeedRatio,
-          }
-
-          if (this.isEdit) {
-            objectdata.millTypeCode = this.detail.millTypeCode
-          }
-          const API = !this.isEdit
-            ? createEngineMill(objectdata)
-            : updateWindEngineMill(objectdata)
-          API.then((res) => {
-            this.nuedialog = false
-            this.onSubmit()
-            this.isEdit = false
-            this.$message.success(this.isEdit ? '新增成功' : '编辑成功')
-          })
-        } else {
-          return false
+        if (!valid) {
+          this.$message.error("请填写必填项");
+          return false;
         }
-      })
+
+        let objectdata = {
+          machineTypeCode: this.ruleForm.machineTypeCode,
+          manufacturerName: this.ruleForm.manufacturerName,
+          manufacturerCode: this.ruleForm.manufacturerCode,
+          brand: this.ruleForm.brand,
+          curvedMotionType: this.ruleForm.curvedMotionType,
+          towerHeight: this.ruleForm.towerHeight,
+          vaneLong: this.ruleForm.vaneLong,
+          rotorDiameter: this.ruleForm.rotorDiameter,
+          rotationalSpeedRatio: this.ruleForm.rotationalSpeedRatio,
+        };
+
+        if (this.isEdit) {
+          objectdata.millTypeCode = this.detail.millTypeCode;
+        }
+
+        const API = !this.isEdit
+          ? createEngineMill(objectdata)
+          : updateWindEngineMill(objectdata);
+
+        API.then((res) => {
+          this.nuedialog = false;
+          this.onSubmit();
+          this.$message.success(this.isEdit ? "编辑成功" : "新增成功");
+          this.isEdit = false;
+        }).catch((error) => {});
+      });
     },
+
     resetForm(formName) {
-      this.$refs[formName].resetFields()
-      this.nuedialog = false
+      this.$refs[formName].resetFields();
+      this.nuedialog = false;
     },
     handleClose(done) {
       this.$refs.ruleForm.resetFields();
-      this.nuedialog = false
+      this.nuedialog = false;
       done();
     },
 
     // 数字验证
     validateNumber(rule, value, callback) {
-      const numberRegex = /^\d{1,4}(\.\d{1,2})?$/ // 匹配不超过四位数且小数点后不超过二位数的数字
+      const numberRegex = /^\d{1,4}(\.\d{1,2})?$/; // 匹配不超过四位数且小数点后不超过二位数的数字
       if (!value) {
-        callback(new Error('该项不能为空'))
+        callback(new Error("该项不能为空"));
       } else if (!numberRegex.test(value)) {
         callback(
-          new Error('该项必须为不超过四位数且小数点后不超过三位数的数字')
-        )
+          new Error("该项必须为不超过四位数且小数点后不超过三位数的数字")
+        );
       } else {
-        callback()
+        callback();
       }
     },
 
     // 删除
     deleted(row) {
-      console.log(row, 'row')
-      if (row.state == '1') {
+      console.log(row, "row");
+      if (row.state == "1") {
         this.$message({
-          type: 'error',
-          message: '该项处于启用状态,无法删除!'
-        })
-        return
+          type: "error",
+          message: "该项处于启用状态,无法删除!",
+        });
+        return;
       }
-      this.$confirm('此操作将永久删除该文件,是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
+      this.$confirm("此操作将永久删除该文件,是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
       })
         .then(() => {
           delWindEngineMill({ millTypeCode: row.millTypeCode }).then((res) => {
-            this.onSubmit()
+            this.onSubmit();
             // 执行删除操作
             this.$message({
-              type: 'success',
-              message: '删除成功!'
-            })
-          })
+              type: "success",
+              message: "删除成功!",
+            });
+          });
         })
         .catch(() => {
           // 取消删除
           this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
-        })
+            type: "info",
+            message: "已取消删除",
+          });
+        });
     },
 
     //机型详情
     particulars(row) {
       getWindEngineMillPageVo({ millTypeCode: row.millTypeCode }).then(
         (res) => {
-          this.unusualdialog = true
-          this.particularsdata = res.data
+          this.unusualdialog = true;
+          this.particularsdata = res.data;
         }
-      )
+      );
     },
     //分页数据切换
     handleCurrentChange(val) {
-      this.formInline.pageNum = val
-      this.onSubmit()
+      this.formInline.pageNum = val;
+      this.onSubmit();
     },
 
     // 重置
-    reset() { },
+    reset() {
+      this.formInline.machineTypeCode=""
+      this.formInline.timeQuantum=""
+      this.onSubmit();
+    },
 
     // 新增
     newly() {
-      this.nuedialog = false
+      this.nuedialog = false;
     },
 
     // 编辑
     compile(row) {
       getWindEngineMillPageVo({ millTypeCode: row.millTypeCode }).then(
         (res) => {
-          const item = JSON.parse(JSON.stringify(res.data))
-          this.detail = item
+          const item = JSON.parse(JSON.stringify(res.data));
+          this.detail = item;
           Object.keys(this.ruleForm).forEach((key) => {
-            this.ruleForm[key] = item[key]
-          })
-          console.log(res)
+            this.ruleForm[key] = item[key];
+          });
+          console.log(res);
         }
-      )
-      this.title = '编辑'
-      this.nuedialog = true
-      this.isEdit = true
+      );
+      this.title = "编辑";
+      this.nuedialog = true;
+      this.isEdit = true;
     },
     // 上传附件
     uploading(row) {
-      this.rowmillTypeCode = row.millTypeCode
+      this.rowmillTypeCode = row.millTypeCode;
 
-      this.uploadingPOP = true
+      this.uploadingPOP = true;
     },
     // 附件提交
     filesubmit() {
-      console.log(this.globalFileList)
+      console.log(this.globalFileList);
       let filedata = {
         millTypeCode: this.rowmillTypeCode,
-        file: this.globalFileList
-      }
+        file: this.globalFileList,
+      };
       powerWordCriterionImportData(filedata).then((res) => {
-        console.log(res)
-        this.uploadingPOP = false
-        this.$message.success('上传成功')
-      })
+        console.log(res);
+        this.uploadingPOP = false;
+        this.$message.success("上传成功");
+      });
     },
 
     // 删除附件
     deleteRow(row) {
-      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
+      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
       })
         .then(() => {
           this.$message({
-            type: 'success',
-            message: '删除成功!'
-          })
+            type: "success",
+            message: "删除成功!",
+          });
         })
         .catch(() => {
           this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
-        })
+            type: "info",
+            message: "已取消删除",
+          });
+        });
     },
 
     // 新增
     newnuedialog() {
-      this.nuedialog = true
-      this.title = '新增'
+      this.nuedialog = true;
+      this.title = "新增";
     },
     // 下载模板
     download() {
       if (this.AllTemplateurl) {
-        const link = document.createElement('a')
-        link.href = this.AllTemplateurl
-        link.download = '' // 可以设置默认下载文件名
-        link.target = '_blank' // 新窗口打开
-        document.body.appendChild(link)
-        link.click()
-        document.body.removeChild(link)
+        const link = document.createElement("a");
+        link.href = this.AllTemplateurl;
+        link.download = ""; // 可以设置默认下载文件名
+        link.target = "_blank"; // 新窗口打开
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
       } else {
-        console.error('URL is not set')
+        console.error("URL is not set");
       }
     },
     getAllTemplate() {
       getAllTemplate().then((res) => {
-        this.AllTemplateurl = res.data.bzPower
-      })
+        this.AllTemplateurl = res.data.bzPower;
+      });
     },
     // 下载附件
     downloadfile() {
       if (this.particularsdata.powerCriterionUrl) {
-        const link = document.createElement('a')
-        link.href = this.particularsdata.powerCriterionUrl
-        link.download = '' // 可以设置默认下载文件名
-        link.target = '_blank' // 新窗口打开
-        document.body.appendChild(link)
-        link.click()
-        document.body.removeChild(link)
+        const link = document.createElement("a");
+        link.href = this.particularsdata.powerCriterionUrl;
+        link.download = ""; // 可以设置默认下载文件名
+        link.target = "_blank"; // 新窗口打开
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
       } else {
         this.$message({
           showClose: true,
-          message: '当前未上传附件无法下载,请先上传附件!!!',
-          type: 'warning'
-
+          message: "当前未上传附件无法下载,请先上传附件!!!",
+          type: "warning",
         });
       }
     },
@@ -566,23 +702,23 @@ export default {
     beforeUpload(fileList) {
       const isXLSX =
         fileList.type ===
-        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
       if (!isXLSX) {
-        this.$message.error('只能上传xlsx文件')
+        this.$message.error("只能上传xlsx文件");
       }
-      const isLt5MB = fileList.size / 1024 / 1024 < 5
+      const isLt5MB = fileList.size / 1024 / 1024 < 5;
       if (!isLt5MB) {
-        this.$message.error('文件大小不能超过5MB')
+        this.$message.error("文件大小不能超过5MB");
       }
-      console.log(fileList, 'fileList')
-      return isXLSX && isLt5MB
+      console.log(fileList, "fileList");
+      return isXLSX && isLt5MB;
     },
     handleOnChange(fileList) {
-      console.log(fileList)
-      this.globalFileList = fileList.raw
-    }
-  }
-}
+      console.log(fileList);
+      this.globalFileList = fileList.raw;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -692,7 +828,7 @@ export default {
   justify-content: center;
   margin-top: 20px;
 }
-.dialog-footer{
+.dialog-footer {
   display: flex;
   justify-content: center;
 }

+ 31 - 21
src/views/ledger/windsite.vue

@@ -42,7 +42,7 @@
         border
         :cell-style="rowStyle"
       >
-        <el-table-column align="center" fixed prop="" label="单位名称">
+        <el-table-column align="center" fixed prop="" label="风场名称">
           <template slot-scope="scope">
             <el-button
               @click="particulars(scope.row)"
@@ -99,9 +99,6 @@
         >
         </el-table-column>
 
-        <!-- <el-table-column prop="ratedCapacityNumber" align="center" label="总额定容量" width="100">
-        </el-table-column> -->
-
         <el-table-column prop="createTime" align="center" label="创建时间">
         </el-table-column>
 
@@ -621,7 +618,11 @@ export default {
       });
     },
     // 重置
-    reset() {},
+    reset() {
+      this.formInline.fieldName = "";
+      this.formInline.timeQuantum = "";
+      this.onSubmit();
+    },
     //导入提交
     UPsubmit() {
       this.tolead = false;
@@ -659,27 +660,36 @@ export default {
     },
 
     // 编辑
+
     compile(row) {
       getWindFieldVo({
         fieldCode: row.fieldCode,
-      }).then((res) => {
-        this.filetableData = res.data.windFieldResourceVos;
-        const item = JSON.parse(JSON.stringify(res.data));
-        this.detail = item;
-        Object.keys(this.form).forEach((key) => {
-          this.form[key] = item[key];
-        });
-        this.form.anemometerTowerRelationDtos =
-          item?.anemometerTowerByFieldVos.map((element) => {
-            return element.anemometerCode;
+      })
+        .then((res) => {
+          this.filetableData = res.data.windFieldResourceVos;
+          const item = JSON.parse(JSON.stringify(res.data));
+          this.detail = item;
+
+          Object.keys(this.form).forEach((key) => {
+            this.form[key] = item[key];
           });
-        this.detail = row;
-        this.nuedialog = true;
-        this.listedfiles = true;
-        this.title = "编辑";
-        this.isEdit = true;
-      });
+
+          this.form.anemometerTowerRelationDtos = item.anemometerTowerByFieldVos
+            ? item.anemometerTowerByFieldVos.map(
+                (element) => element.anemometerCode
+              )
+            : [];
+          this.detail = row;
+          this.nuedialog = true;
+          this.listedfiles = true;
+          this.title = "编辑";
+          this.isEdit = true;
+        })
+        .catch((error) => {
+          console.error("Error fetching wind field data:", error);
+        });
     },
+
     // 上传附件
     uploading(row) {
       this.uploadingPOP = true;