chenxinlei 2 年 前
コミット
c9a568ba7e

+ 31 - 29
src/views/stationConfiguration/period/components/TableEdit.vue

@@ -6,8 +6,8 @@
           <el-input placeholder="请输入" class="inputs" v-model="form.id" autocomplete="off" :disabled="!idAdd?true:false">
           </el-input>
         </el-form-item>
-        <el-form-item label="编号" prop="code">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.code" autocomplete="off"></el-input>
+        <el-form-item label="编号" prop="nemCode">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.nemCode" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
@@ -24,25 +24,25 @@
             @blur="onBlur(form.capacity,'number')">
           </el-input>
         </el-form-item>
-        <el-form-item label="容量单位" prop="capacityunit">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.capacityunit" autocomplete="off"></el-input>
+        <el-form-item label="容量单位" prop="capacityUnit">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.capacityUnit" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="投产日期" prop="commissiondate">
-          <el-date-picker style="width:200px" v-model="form.commissiondate" type="date" placeholder="选择日期">
+        <el-form-item label="投产日期" prop="commissionDate">
+          <el-date-picker style="width:200px" v-model="form.commissionDate" type="date" placeholder="选择日期">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="主控电话" prop="masterphone">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.masterphone" autocomplete="off"></el-input>
+        <el-form-item label="主控电话" prop="masterPhone">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.masterPhone" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
         <el-form-item label="机型" prop="model">
           <el-input placeholder="请输入" class="inputs" v-model="form.model" autocomplete="off"></el-input>
         </el-form-item>
-        <el-form-item label="顺序" prop="ordernum">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.ordernum" autocomplete="off"></el-input>
+        <el-form-item label="顺序" prop="orderNum">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.orderNum" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
@@ -51,22 +51,22 @@
             @blur="onBlur(form.quantity,'quantity')">
           </el-input>
         </el-form-item>
-        <el-form-item label="值长" prop="shiftforeman">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.shiftforeman" autocomplete="off"></el-input>
+        <el-form-item label="值长" prop="shiftforeMan">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.shiftforeMan" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="值长电话" prop="shiftforemanphone">
-          <el-input placeholder="请输入" class="inputs" v-model.number="form.shiftforemanphone" autocomplete="off"
-            @blur="onBlur(form.shiftforemanphone,'shiftforemanphone')">
+        <el-form-item label="值长电话" prop="shiftforeManPhone">
+          <el-input placeholder="请输入" class="inputs" v-model.number="form.shiftforeManPhone" autocomplete="off"
+            @blur="onBlur(form.shiftforeManPhone,'shiftforeManPhone')">
           </el-input>
         </el-form-item>
-        <el-form-item label="风场编号" prop="windpowerstationid">
+        <el-form-item label="风场编号" prop="windpowerstationId">
           <!-- <el-select style="width:200px" v-model="form.windpowerstationid" placeholder="请选择" clearable>
             <el-option v-for="item in stationList" :key="item.id" :label="item.name" :value="item.id">
             </el-option>
           </el-select> -->
-          <el-cascader placeholder="请选择" v-model="form.windpowerstationid" :options="options" style="width: 200px"
+          <el-cascader placeholder="请选择" v-model="form.windpowerstationId" :options="options" style="width: 200px"
             :props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children'}" clearable />
         </el-form-item>
       </div>
@@ -94,23 +94,23 @@ export default {
       form: {
         id: '',
         name: '',
-        code: '',
+        nemCode: '',
       },
       rules: {
         id: [{ required: true, trigger: 'blur', message: '请输入' }],
         name: [{ required: true, trigger: 'blur', message: '请输入' }],
-        code: [{ required: true, trigger: 'blur', message: '请输入' }],
+        nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
         aname: [{ required: true, trigger: 'blur', message: '请输入' }],
         capacity: [{ required: true, trigger: 'blur', message: '请输入' }],
-        capacityunit: [{ required: true, trigger: 'blur', message: '请输入' }],
-        commissiondate: [{ required: true, trigger: 'blur', message: '请输入' }],
-        masterphone: [{ required: true, trigger: 'blur', message: '请输入' }],
+        capacityUnit: [{ required: true, trigger: 'blur', message: '请输入' }],
+        commissionDate: [{ required: true, trigger: 'blur', message: '请输入' }],
+        masterPhone: [{ required: true, trigger: 'blur', message: '请输入' }],
         model: [{ required: true, trigger: 'blur', message: '请输入' }],
-        ordernum: [{ required: true, trigger: 'blur', message: '请输入' }],
+        orderNum: [{ required: true, trigger: 'blur', message: '请输入' }],
         quantity: [{ required: true, trigger: 'blur', message: '请输入' }],
-        shiftforeman: [{ required: true, trigger: 'blur', message: '请输入' }],
-        shiftforemanphone: [{ required: true, trigger: 'blur', message: '请输入' }],
-        windpowerstationid: [{ required: true, trigger: 'blur', message: '请输入' }],
+        shiftforeMan: [{ required: true, trigger: 'blur', message: '请输入' }],
+        shiftforeManPhone: [{ required: true, trigger: 'blur', message: '请输入' }],
+        windpowerstationId: [{ required: true, trigger: 'blur', message: '请输入' }],
       },
       title: '',
       dialogFormVisible: false,
@@ -127,7 +127,7 @@ export default {
         this.title = '编辑'
         this.idAdd = false
         this.form = Object.assign({}, row)
-        // this.form.windpowerstationid = this.form.windpowerstationid.split(",")
+        this.form.windpowerstationId = this.form.windpowerstationId
       }
       this.dialogFormVisible = true
     },
@@ -140,8 +140,10 @@ export default {
     save() {
       this.$refs['form'].validate(async (valid) => {
         if (valid) {
-          this.form.windpowerstationid = this.form.windpowerstationid[this.form.windpowerstationid.length - 1]
-          this.form.commissiondate = dayjs(this.form.commissiondate).format("YYYY-MM-DD")
+          if(Array.isArray(this.form.windpowerstationId)) {
+            this.form.windpowerstationId = this.form.windpowerstationId[this.form.windpowerstationId.length - 1]
+          }
+          this.form.commissionDate = dayjs(this.form.commissionDate).format("YYYY-MM-DD")
           api.addProject(this.form).then(res => {
             if (res.data) {
               this.$message({

+ 3 - 2
src/views/stationConfiguration/period/index.vue

@@ -36,14 +36,15 @@
         header-cell-class-name="table_header_style" border :height="height" @selection-change="setSelectRows">
         <el-table-column show-overflow-tooltip type="selection" width="55" align="center"></el-table-column>
         <el-table-column show-overflow-tooltip label="编码" prop="id" align="center" sortable></el-table-column>
+        <el-table-column show-overflow-tooltip label="编号" prop="nemCode" align="center" sortable></el-table-column>
         <el-table-column width="120" show-overflow-tooltip label="工程名称" prop="name" align="left" sortable>
         </el-table-column>
         <el-table-column show-overflow-tooltip label="别称" prop="aname" align="left" sortable></el-table-column>
         <el-table-column width="120" show-overflow-tooltip label="风场编号" prop="windpowerstationId" align="center"
           sortable>
         </el-table-column>
-        <el-table-column width="120" show-overflow-tooltip label="变电所编号" prop="windsubStationId" align="center"
-          sortable>
+        <!-- <el-table-column width="120" show-overflow-tooltip label="变电所编号" prop="windsubStationId" align="center"
+          sortable> -->
         </el-table-column>
         <el-table-column width="120" show-overflow-tooltip label="装机容量" prop="capacity" align="center" sortable>
         </el-table-column>