规则修改

This commit is contained in:
jiangyinzhi
2024-11-19 17:06:20 +08:00
parent 455c8b58da
commit 7f7ff91a5e
4 changed files with 108 additions and 10 deletions
@@ -57,11 +57,12 @@
<van-cell title="是否享受峰谷平电价" required is-link :value="showData.valleyElectricityPrices1" @click="showPicker3 = !showForm" /> <van-cell title="是否享受峰谷平电价" required is-link :value="showData.valleyElectricityPrices1" @click="showPicker3 = !showForm" />
<van-cell title="是否使用绿电交易" required is-link :value="showData.greenElectricityTrading1" @click="showPickerLd = !showForm" /> <van-cell title="是否使用绿电交易" required is-link :value="showData.greenElectricityTrading1" @click="showPickerLd = !showForm" />
<van-cell title="已使用清洁能源" required is-link :value="result1" @click="showPicker4 = !showForm" /> <van-cell title="已使用清洁能源" required is-link :value="result1" @click="showPicker4 = !showForm" />
<van-field v-model="formData.photovoltaicArea" required :rules="[{ required: gfShow == 1, message: '请填写光伏总建设面积' }]" label="光伏总建设面积(㎡)" placeholder="请输入" type="number" input-align="right" v-if="gfShow == 1"> <van-field v-model="formData.photovoltaicArea" required :rules="[{ required: gfShow == 1 }]" label="光伏总建设面积(㎡)" placeholder="请输入" type="number" input-align="right" v-if="gfShow == 1">
</van-field> </van-field>
<div class="tips" v-if="tips8 == true">光伏总建设面积+可利用屋面面积<总建筑面积</div> <div class="tips" v-if="tips8 == true&&gfShow == 1">光伏总建设面积+可利用屋面面积<总建筑面积</div>
<van-field v-model="formData.photovoltaicPhotovoltaic" required :rules="[{ required: gfShow == 1, message: '请填写总装机容量' }]" label="光伏总装机容量(kW)" placeholder="请输入" type="number" input-align="right" v-if="gfShow == 1"> <van-field v-model="formData.photovoltaicPhotovoltaic" required :rules="[{ required: gfShow == 1 }]" label="光伏总装机容量(kW)" placeholder="请输入" type="number" input-align="right" v-if="gfShow == 1">
</van-field> </van-field>
<div class="tips" v-if="tips9 == true&&gfShow == 1">50×光伏已建设面积/1000<光伏总装机容量<200×光伏已建设面积/1000</div>
<van-cell title="是否采用再生水" is-link :value="showData.reclaimedWater1" @click="showPicker5 = !showForm" /> <van-cell title="是否采用再生水" is-link :value="showData.reclaimedWater1" @click="showPicker5 = !showForm" />
<van-cell title="再生水类型" is-link :value="result222" @click="showPicker6 = !showForm" v-if="formData.reclaimedWater == 1" required :rules="[{ required: true}]" /> <van-cell title="再生水类型" is-link :value="result222" @click="showPicker6 = !showForm" v-if="formData.reclaimedWater == 1" required :rules="[{ required: true}]" />
<van-cell title="再生水类型" is-link title-style="color: #999" value="无" v-else /> <van-cell title="再生水类型" is-link title-style="color: #999" value="无" v-else />
@@ -670,6 +671,12 @@ export default {
return false return false
} }
return true return true
},
tips9(){
if(50*Number(this.formData.photovoltaicArea)/1000 < this.formData.photovoltaicPhotovoltaic && 200 * Number(this.formData.photovoltaicArea)/1000 > this.formData.photovoltaicPhotovoltaic){
return false
}
return true
} }
}, },
created() { created() {
@@ -1857,9 +1864,13 @@ export default {
// this.formData.enquireIds = this.aarr1.concat(this.aarr) // this.formData.enquireIds = this.aarr1.concat(this.aarr)
// } // }
// this.tips6 == true || // this.tips6 == true ||
if(this.tips0 == true || this.tips1 == true || this.tips2 == true || this.tips3 == true || this.tips4 == true || this.tips6 == true || this.tips7 == true|| this.tips8 == true){ if(this.tips0 == true || this.tips1 == true || this.tips2 == true || this.tips3 == true || this.tips4 == true || this.tips6 == true || this.tips7){
return; return;
} }
if(this.gfShow == 1&&(this.tips8||this.tips9)){
this.active=1
return
}
this.formData.enquireIds = this.newAnswer.join(); this.formData.enquireIds = this.newAnswer.join();
if (this.tidCid) { if (this.tidCid) {
this.formData.taskId = this.tidCid.taskId this.formData.taskId = this.tidCid.taskId
@@ -271,6 +271,7 @@ export default {
onConfirmYear(data) { onConfirmYear(data) {
this.currentTime.y = data.value this.currentTime.y = data.value
this.currentTime.time = new Date(data.value) this.currentTime.time = new Date(data.value)
this.page.pageNum = 1
this.getMonthData(); this.getMonthData();
this.datePopup = false; this.datePopup = false;
}, },
@@ -299,7 +300,7 @@ export default {
// 加载状态结束 // 加载状态结束
this.loading = false this.loading = false
// 数据全部加载完成 // 数据全部加载完成
if (this.monthList.length == this.page.total) { if (this.page.pageNum == res.data.pages ||this.monthList.length == this.page.total) {
this.immediateCheck = false this.immediateCheck = false
this.finished = true this.finished = true
return return
@@ -321,7 +322,7 @@ export default {
if (res.code == 0) { if (res.code == 0) {
this.monthList = res.data.list; this.monthList = res.data.list;
this.page.total = res.data.total this.page.total = res.data.total
if(this.monthList.length == this.page.total) { if(this.page.pageNum == res.data.pages || this.monthList.length == this.page.total) {
this.immediateCheck = false this.immediateCheck = false
this.finished = true this.finished = true
} else { } else {
+79 -4
View File
@@ -9,7 +9,7 @@
<van-field v-model="form.systemModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="型号" maxlength="20" placeholder="请输入型号"/> <van-field v-model="form.systemModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="型号" maxlength="20" placeholder="请输入型号"/>
<van-field v-input.numNo0 v-model="form.systemNum" type="number" required :rules="[{ required: true }]" label="台数(台)" placeholder="请输入台数" /> <van-field v-input.numNo0 v-model="form.systemNum" type="number" required :rules="[{ required: true }]" label="台数(台)" placeholder="请输入台数" />
<van-field v-input.numNo0 v-model="form.ratedCapacityValue" required :rules="[{ required: true }]" ltype="number" label="单台额定容量(kVA)" placeholder="请输入" @blur="handelChange('ratedCapacityValue',50,'单台额定容量')"/> <van-field v-input.numNo0 v-model="form.ratedCapacityValue" required :rules="[{ required: true }]" ltype="number" label="单台额定容量(kVA)" placeholder="请输入" @blur="handelChange('ratedCapacityValue',50,'单台额定容量')"/>
<van-field v-input.floatNo0 v-model="form.ratedVoltageValue" required :rules="[{ required: true }]" type="number" label="额定一次电压(kV)" placeholder="请输入" @blur="handelChange('ratedVoltageValue',10,'额定一次电压')"/> <van-field v-input.floatNo0 v-model="form.ratedVoltageValue" required :rules="[{ required: true }]" type="number" label="额定一次电压(kV)" input-align="right" is-link placeholder="请选择" readonly @click="levelShow = true"/>
<van-field v-input.num v-model="form.absoleteElecNum" type="number" label="淘汰电机数量" placeholder="请输入" /> <van-field v-input.num v-model="form.absoleteElecNum" type="number" label="淘汰电机数量" placeholder="请输入" />
<van-field v-input.num v-model="form.absoleteNum" type="number" label="淘汰变压器数量" placeholder="请输入" /> <van-field v-input.num v-model="form.absoleteNum" type="number" label="淘汰变压器数量" placeholder="请输入" />
<van-field v-input.floatNo0 v-model="form.loadRate" required :rules="[{ required: true }]" type="number" label="负载率(%)" placeholder="请输入" @input="handelChangeNumber('loadRate','负载率')" /> <van-field v-input.floatNo0 v-model="form.loadRate" required :rules="[{ required: true }]" type="number" label="负载率(%)" placeholder="请输入" @input="handelChangeNumber('loadRate','负载率')" />
@@ -33,6 +33,22 @@
</div> </div>
</van-overlay> </van-overlay>
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" /> <Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
<!-- 电压等级 -->
<VanPickerNew :show="levelShow">
<div class="content">
<div class="content-head">
<div @click="onCancelLe">取消</div>
<div @click="onConfirmLe">确认</div>
</div>
<div class="content-main">
<van-cell v-for="item in levelList" :key="item.value" clickable style="font-weight: 400 !important; font-size: 15px !important">
<van-checkbox :name="item" checked-color="#009999" v-model="item.checked" @click="clickCheckbox(item)">
{{ item.value }}kV
</van-checkbox>
</van-cell>
</div>
</div>
</VanPickerNew>
</div> </div>
</template> </template>
@@ -41,14 +57,26 @@ import { distributeAdd, distributeGetInfo, distributeEdit } from "@/api/universa
import { Notify } from "vant"; import { Notify } from "vant";
import mixin from '@/mixins/mixin' import mixin from '@/mixins/mixin'
import Year from '../facilityManage/common-vue/year.vue' import Year from '../facilityManage/common-vue/year.vue'
import VanPickerNew from '@/components/vanPickerNew'
export default { export default {
components: { components: {
// Header, // Header,
Year Year,
VanPickerNew
}, },
mixins: [mixin], mixins: [mixin],
data() { data() {
return { return {
levelShow: false,
levelList:[
{value:'10', checked: false},
{value:'35', checked: false},
{value:'110', checked: false},
{value:'220', checked: false},
{value:'330', checked: false},
],
//电压等级选中的数据
resultCheckboxLevel: [],
addeditId: '', // 新增修改提交id addeditId: '', // 新增修改提交id
title: '新增/修改', title: '新增/修改',
id: '', // 查详情时取的id id: '', // 查详情时取的id
@@ -95,10 +123,43 @@ export default {
this.getGetInfo() this.getGetInfo()
} }
}, },
mounted() { deactivated(){
this.levelList.forEach((v) => {
v.checked = false
})
this.levelShow = false
},
mounted() {
}, },
methods: { methods: {
/**
* 电压等级
*/
onCancelLe() {
this.levelList.forEach((v)=>{
this.resultCheckboxLevel.forEach((rv)=>{
if(v.value == rv.value) {
v.checked = true
}
})
})
this.levelShow = false
},
onConfirmLe() {
const leName = this.levelList.filter((ele) => ele.checked)
this.resultCheckboxLevel = leName
this.form.ratedVoltageValue = leName.map((ele)=> ele.value).join(',')
this.levelShow = false
},
clickCheckbox(item){
this.levelList.forEach((v) => {
v.checked = false
if (v.value == item.value) {
v.checked = true
}
})
},
handelChangeNumber (params,name) { handelChangeNumber (params,name) {
if(Number(this.form[params]) > 100) { if(Number(this.form[params]) > 100) {
Notify({ type: "danger", message: `${name}不可超过100%` }); Notify({ type: "danger", message: `${name}不可超过100%` });
@@ -148,6 +209,18 @@ export default {
if(res.code == 0) { if(res.code == 0) {
this.form = res.data this.form = res.data
this.show = false this.show = false
if (this.form.ratedVoltageValue) {
this.resultCheckboxLevel=[]
this.levelList.forEach((ele) => {
ele.checked = false
if (ele.value == this.form.ratedVoltageValue) {
ele.checked = true
this.resultCheckboxLevel.push(ele)
}
})
this.form.ratedVoltageValue = this.resultCheckboxLevel.map((ele) => ele.value).join(',')
}
}else { }else {
this.show = false this.show = false
} }
@@ -157,6 +230,8 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '../facilityManage/common-vue/common.less';
@import '../facilityManage/common-vue/checkbox.less';
.yearenergy { .yearenergy {
padding: 15px 10px; padding: 15px 10px;
.year-main { .year-main {
@@ -262,6 +262,7 @@
input-align="right" input-align="right"
:disabled="showForm" :disabled="showForm"
></van-field> ></van-field>
<!-- <div class="tips" v-if="tips2 == true">0<光伏实际年发电量/光伏已装机容量<2000</div> -->
<van-field <van-field
v-input.float v-input.float
label="年发电小时数(h)" label="年发电小时数(h)"
@@ -516,6 +517,13 @@ export default {
}, },
readOnly(){ readOnly(){
return this.yearForm.energyUnutilizedVO&&this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType!='01' return this.yearForm.energyUnutilizedVO&&this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType!='01'
},
tips2(){
let rate = Number(this.yearForm.actualPowerValue)/Number(this.yearForm.installedCapacityValue)
if(0 < rate && 2000 > rate){
return false
}
return true
} }
}, },
mounted() { mounted() {
@@ -763,6 +771,9 @@ export default {
if(this.tabName == 'c'&&this.tips0){ if(this.tabName == 'c'&&this.tips0){
return return
} }
if(this.yearForm.isPvInstallCondition == '1'&&this.tips2){
return
}
let params = Object.assign(this.customerInfo, this.yearForm) let params = Object.assign(this.customerInfo, this.yearForm)
params.taskId = this.tidCid.taskId params.taskId = this.tidCid.taskId
if(this.$route.query.id) { if(this.$route.query.id) {