|
@@ -5,45 +5,45 @@
|
|
|
<el-form-item label="编码" prop="id">
|
|
|
<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="status">
|
|
|
- <el-input placeholder="请输入" class="inputs" v-model.trim="form.status" 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">
|
|
|
<el-form-item label="风机名称" prop="name">
|
|
|
<el-input placeholder="请输入" class="inputs" v-model="form.name" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="首次并网时间" prop="firstintegratedtime">
|
|
|
- <el-date-picker style="width: 200px" v-model="form.firstintegratedtime" type="date" placeholder="选择日期">
|
|
|
+ <el-form-item label="首次并网时间" prop="firstIntegratedTime">
|
|
|
+ <el-date-picker style="width: 200px" v-model="form.firstIntegratedTime" type="date" placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="lists">
|
|
|
- <el-form-item label="风场编号" prop="windpowerstationid">
|
|
|
- <!-- <el-select v-model="form.windpowerstationid" placeholder="请选择" clearable>
|
|
|
+ <el-form-item label="风场编号" prop="windpowerstationId">
|
|
|
+ <!-- <el-select 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
|
|
|
- @change="windpowerstationidChange"
|
|
|
+ @change="windpowerstationIdChange"
|
|
|
placeholder="请选择"
|
|
|
- v-model="form.windpowerstationid"
|
|
|
- :options="windpowerstationid_options"
|
|
|
+ v-model="form.windpowerstationId"
|
|
|
+ :options="windpowerstationId_options"
|
|
|
style="width: 200px"
|
|
|
:props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children'}"
|
|
|
clearable />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="工程编号" prop="projectid">
|
|
|
- <el-input placeholder="请输入" class="inputs" v-model.trim="form.projectid" autocomplete="off"></el-input>
|
|
|
+ <el-form-item label="工程编号" prop="projectId">
|
|
|
+ <el-input placeholder="请输入" class="inputs" v-model.trim="form.projectId" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="lists">
|
|
|
- <el-form-item label="线路编号" prop="lineid">
|
|
|
- <!-- <el-input class="inputs" v-model.trim="form.lineid" autocomplete="off"></el-input> -->
|
|
|
+ <el-form-item label="线路编号" prop="lineId">
|
|
|
+ <!-- <el-input class="inputs" v-model.trim="form.lineId" autocomplete="off"></el-input> -->
|
|
|
<el-cascader
|
|
|
placeholder="请选择"
|
|
|
- v-model="form.lineid"
|
|
|
- :options="lineid_options"
|
|
|
+ v-model="form.lineId"
|
|
|
+ :options="lineId_options"
|
|
|
style="width: 200px"
|
|
|
:props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children'}"
|
|
|
clearable />
|
|
@@ -56,8 +56,16 @@
|
|
|
<el-form-item label="地球经度" prop="longitude">
|
|
|
<el-input placeholder="请输入" class="inputs" v-model="form.longitude" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="机型" prop="modelid">
|
|
|
- <el-input placeholder="请输入" class="inputs" v-model.trim="form.modelid" autocomplete="off"></el-input>
|
|
|
+ <el-form-item label="机型" prop="equipmentCategory">
|
|
|
+ <!-- <el-input placeholder="请输入" class="inputs" v-model.trim="form.equipmentCategory" autocomplete="off"></el-input> -->
|
|
|
+ <el-select v-model="form.equipmentCategory" placeholder="请选择" style="width:200px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in equipmentCategoryOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="lists">
|
|
@@ -65,9 +73,9 @@
|
|
|
<el-input placeholder="请输入" class="inputs" v-model="form.photo" autocomplete="off">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="标杆风机" prop="standardid">
|
|
|
+ <!-- <el-form-item label="标杆风机" prop="standardid">
|
|
|
<el-input placeholder="请输入" class="inputs" v-model.trim="form.standardid" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -79,6 +87,7 @@
|
|
|
|
|
|
<script>
|
|
|
import api from '@/api/station'
|
|
|
+import apis from '@/api/table'
|
|
|
import dayjs from "dayjs";
|
|
|
import { recursionTree, recursionTreeChildren } from '@/utils/deepTree'
|
|
|
|
|
@@ -96,9 +105,15 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 0:风机;1:集中;2:组串
|
|
|
+ equipmentCategoryOptions: [
|
|
|
+ {id: 0, name: "风机"},
|
|
|
+ {id: 1, name: "集中"},
|
|
|
+ {id: 2, name: "组串"},
|
|
|
+ ],
|
|
|
optionsAll: [],
|
|
|
- windpowerstationid_options: [],
|
|
|
- lineid_options: [],
|
|
|
+ windpowerstationId_options: [],
|
|
|
+ lineId_options: [],
|
|
|
form: {
|
|
|
id: '',
|
|
|
name: '',
|
|
@@ -107,14 +122,14 @@ export default {
|
|
|
rules: {
|
|
|
id: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
name: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
- status: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
- firstintegratedtime: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
- windpowerstationid: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
- projectid: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
- lineid: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ firstIntegratedTime: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ windpowerstationId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ projectId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ lineId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
latitude: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
longitude: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
- modelid: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ equipmentCategory: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
photo: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
standardid: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
},
|
|
@@ -126,20 +141,21 @@ export default {
|
|
|
created() {
|
|
|
},
|
|
|
methods: {
|
|
|
- windpowerstationidChange(data){
|
|
|
+ windpowerstationIdChange(data){
|
|
|
if(data){
|
|
|
- this.lineid_options = recursionTreeChildren(data[data.length - 1], this.optionsAll)
|
|
|
+ this.lineId_options = recursionTreeChildren(data[data.length - 1], this.optionsAll)
|
|
|
}
|
|
|
},
|
|
|
getTree() {
|
|
|
- api.newtreeTreels({tag:2}).then(res => {
|
|
|
+ apis.newtreeTreels({tag:2}).then(res => {
|
|
|
if (res.data) {
|
|
|
- this.windpowerstationid_options = res.data
|
|
|
+ this.windpowerstationId_options = res.data
|
|
|
}
|
|
|
})
|
|
|
- api.newtreeTreels({tag:4}).then(res => {
|
|
|
+ apis.newtreeTreels({tag:4}).then(res => {
|
|
|
if (res.data) {
|
|
|
this.optionsAll = res.data
|
|
|
+ this.lineId_options = recursionTreeChildren(this.form.windpowerstationId, this.optionsAll)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -152,7 +168,6 @@ export default {
|
|
|
this.title = '编辑'
|
|
|
this.idAdd = false
|
|
|
this.form = Object.assign({}, row)
|
|
|
- // this.lineid_options = recursionTreeChildren(this.form.windpowerstationid, this.optionsAll)
|
|
|
}
|
|
|
this.dialogFormVisible = true
|
|
|
},
|
|
@@ -165,9 +180,15 @@ export default {
|
|
|
save() {
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- this.form.windpowerstationid = this.form.windpowerstationid[this.form.windpowerstationid.length - 1]
|
|
|
- this.form.lineid = this.form.lineid[this.form.lineid.length - 1]
|
|
|
- this.form.firstintegratedtime = dayjs(this.form.firstintegratedtime).format("YYYY-MM-DD")
|
|
|
+ if(Array.isArray(this.form.windpowerstationId)) {
|
|
|
+ this.form.windpowerstationId = this.form.windpowerstationId[this.form.windpowerstationId.length - 1]
|
|
|
+ }
|
|
|
+ if(Array.isArray(this.form.lineId)) {
|
|
|
+ this.form.lineId = this.form.lineId[this.form.lineId.length - 1]
|
|
|
+ }
|
|
|
+ // this.form.windpowerstationId = this.form.windpowerstationId[this.form.windpowerstationId.length - 1]
|
|
|
+ // this.form.lineId = this.form.lineId[this.form.lineId.length - 1]
|
|
|
+ this.form.firstIntegratedTime = dayjs(this.form.firstIntegratedTime).format("YYYY-MM-DD")
|
|
|
api.addWindturbine(this.form).then(res => {
|
|
|
if (res.data) {
|
|
|
this.$message({
|