Merge branch 'yanyan_dev' into shenzhen-dev

This commit is contained in:
yjl 2022-12-17 09:24:37 +08:00
commit eab68abe7f
4 changed files with 233 additions and 139 deletions

View File

@ -49,8 +49,8 @@
<el-dialog title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px">
<el-form-item label="设备名称:">
<el-select v-model="equipmentName" placeholder="请选择" style="width:350px" @change="changeEquipmentType($event)">
<el-option v-for="item in EquipmentList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
<el-select v-model="equipmentId" placeholder="请选择" style="width:350px">
<el-option v-for="item in EquipmentList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="加油量:">
@ -58,15 +58,15 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleAdd = false"> </el-button>
<el-button @click="noAdd"> </el-button>
<el-button type="primary" @click="okAdd"> </el-button>
</span>
</el-dialog>
<el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px">
<el-form-item label="设备名称:">
<el-select v-model="equipmentName" placeholder="请选择" style="width:350px" @change="changeEquipmentType($event)">
<el-option v-for="item in EquipmentList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
<el-select v-model="equipmentId" placeholder="请选择" style="width:350px">
<el-option v-for="item in EquipmentList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="加油量:">
@ -82,7 +82,13 @@
</div>
</template>
<script>
import { getRefuelingRecordList,addRefuelingRecord,editRefuelingRecord,deleteRefuelingRecord,getAllRefuelingRecordList } from '@/assets/js/api/gantryCrane'
import {
getRefuelingRecordList,
addRefuelingRecord,
editRefuelingRecord,
deleteRefuelingRecord,
getAllRefuelingRecordList
} from '@/assets/js/api/gantryCrane'
export default {
components: {
@ -111,20 +117,20 @@ export default {
dialogVisibleEdit: false,
form: {
name: '',
plateNumber: '',
plateNumber: ''
},
editForm: {
name: '',
plateNumber: '',
plateNumber: ''
},
valueFuel: '',
valueEquipment: '',
fuelTypeId:'',
equipmentId:'',
editId:'',
EquipmentList:[],
equipmentName:'',
fuel:''
equipmentId: '',
editId: '',
EquipmentList: [],
devId: '',
fuel: ''
}
},
created() {
@ -132,36 +138,24 @@ export default {
this.getListData()
},
methods: {
openAdd(){
openAdd() {
this.dialogVisibleAdd = true
this.getEquipmentList()
},
getEquipmentList(){
getAllRefuelingRecordList().then((res) => {
getEquipmentList() {
getAllRefuelingRecordList({ projectSn: this.projectSn }).then(res => {
this.EquipmentList = res.result
})
},
changeFuelType(val){
this.fuelType.forEach((item,index,array) => {
if (item.typeName == val) {
this.fuelTypeId = item.id
}
})
},
changeEquipmentType(val){
console.log(val);
console.log(this.EquipmentList);
this.EquipmentList.forEach((item,index,array) => {
if (item.name == val) {
this.equipmentId = item.id
}
})
noAdd(){
this.dialogVisibleAdd = false
this.equipmentId = ''
this.fuel = ''
},
okAdd() {
let data = {
devId: Number(this.equipmentId),
fuelType: this.fuelTypeId,
fuelCharge: Number(this.fuel),
devId: this.equipmentId,
fuelCharge: Number(this.fuel),
projectSn: this.projectSn
}
addRefuelingRecord(data).then(res => {
@ -169,6 +163,8 @@ export default {
this.$message.success('新增成功!')
this.getListData()
this.dialogVisibleAdd = false
this.equipmentId = ''
this.fuel = ''
} else {
this.$message.success('新增失败!')
}
@ -176,12 +172,12 @@ export default {
},
okEdit() {
this.dialogVisibleEdit = false
this.EquipmentList
let data = {
devId: Number(this.equipmentId),
fuelType: this.fuelTypeId,
fuelCharge: Number(this.fuel),
devId: this.equipmentId,
fuelCharge: this.fuel,
projectSn: this.projectSn,
id:this.editId
id: this.editId
}
editRefuelingRecord(data).then(res => {
if (res.code == 200) {
@ -205,6 +201,7 @@ export default {
pageSize: this.pageSize
}
getRefuelingRecordList(data).then(res => {
console.log('加油记录', res)
this.tableList = res.result.records
this.total = res.result.total
})
@ -225,27 +222,40 @@ export default {
},
//
editBtn(val) {
console.log(val);
console.log(val)
this.editForm = { ...val }
this.dialogVisibleEdit = true
this.editId = val.id
this.equipmentName = val.devName
this.fuel = val.fuelCharge
this.getEquipmentList()
this.dialogVisibleEdit = true
this.equipmentId = val.devId
this.fuel = val.fuelCharge
},
//
deleteBtn(val) {
let data = {
id: val.id
}
deleteRefuelingRecord(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
let data = {
id: val.id
}
deleteRefuelingRecord(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
//
handleSizeChange(val) {

View File

@ -75,7 +75,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleAdd = false"> </el-button>
<el-button @click="noAdd"> </el-button>
<el-button type="primary" @click="okAdd"> </el-button>
</span>
</el-dialog>
@ -136,11 +136,11 @@ export default {
dialogVisibleEdit: false,
form: {
name: '',
plateNumber: '',
plateNumber: ''
},
editForm: {
name: '',
plateNumber: '',
plateNumber: ''
},
fuelType: [
{ id: 1, typeName: '柴油' },
@ -152,9 +152,9 @@ export default {
],
valueFuel: '',
valueEquipment: '',
fuelTypeId:'',
equipmentTypeId:'',
editId:''
fuelTypeId: '',
equipmentTypeId: '',
editId: ''
}
},
created() {
@ -162,20 +162,29 @@ export default {
this.getListData()
},
methods: {
changeFuelType(val){
this.fuelType.forEach((item,index,array) => {
changeFuelType(val) {
this.fuelType.forEach((item, index, array) => {
if (item.typeName == val) {
this.fuelTypeId = item.id
}
})
},
changeEquipmentType(val){
this.equipmentType.forEach((item,index,array) => {
changeEquipmentType(val) {
this.equipmentType.forEach((item, index, array) => {
if (item.typeName == val) {
this.equipmentTypeId = item.id
}
})
},
noAdd() {
this.dialogVisibleAdd = false
this.form = {
name: '',
plateNumber: ''
}
this.valueFuel = ''
this.valueEquipment = ''
},
okAdd() {
this.dialogVisibleAdd = false
let data = {
@ -189,6 +198,12 @@ export default {
if (res.code == 200) {
this.$message.success('新增成功!')
this.getListData()
this.form = {
name: '',
plateNumber: ''
}
this.valueFuel = ''
this.valueEquipment = ''
} else {
this.$message.success('新增失败!')
}
@ -198,11 +213,11 @@ export default {
this.dialogVisibleEdit = false
let data = {
name: this.editForm.name,
fuelType:this.fuelTypeId,
fuelType: this.fuelTypeId,
plateNumber: this.editForm.plateNumber,
type: this.equipmentTypeId,
projectSn: this.projectSn,
id:this.editId
id: this.editId
}
editBicarbon(data).then(res => {
if (res.code == 200) {
@ -246,7 +261,7 @@ export default {
},
//
editBtn(val) {
console.log(val);
console.log(val)
this.editForm = { ...val }
this.dialogVisibleEdit = true
this.editId = val.id
@ -255,17 +270,30 @@ export default {
},
//
deleteBtn(val) {
let data = {
id: val.id
}
deleteBicarbon(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
let data = {
id: val.id
}
deleteBicarbon(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
//
handleSizeChange(val) {

View File

@ -65,10 +65,10 @@
<el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px">
<el-form-item label="设备名称:">
<el-select v-model="value" placeholder="请选择" style="width:350px" @change="changeName($event)">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.name"> </el-option>
</el-select>
</el-form-item>
<el-select v-model="value" placeholder="请选择" style="width:350px" @change="changeName($event)">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.name"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="发电量(度)">
<el-input v-model="editForm.generatingCapacity" style="width:350px"></el-input>
</el-form-item>
@ -117,7 +117,7 @@ export default {
},
options: [],
value: '',
editId:''
editId: ''
}
},
created() {
@ -128,12 +128,12 @@ export default {
changeName(val) {
this.options.forEach((item, index, array) => {
if (item.name == val) {
console.log(item);
console.log(item)
this.form.devId = item.id
this.editForm.devId = item.id
}
})
console.log(this.editForm.devId);
console.log(this.editForm.devId)
},
openAdd() {
this.dialogVisibleAdd = true
@ -143,6 +143,7 @@ export default {
},
noAdd() {
this.dialogVisibleAdd = false
this.value = ''
this.form = {
devId: '',
generatingCapacity: ''
@ -172,7 +173,7 @@ export default {
okEdit() {
this.dialogVisibleEdit = false
let data = {
id:this.editId,
id: this.editId,
devId: this.editForm.devId,
generatingCapacity: this.editForm.generatingCapacity,
projectSn: this.projectSn
@ -219,7 +220,7 @@ export default {
},
//
editBtn(val) {
console.log(val);
console.log(val)
this.editForm = { ...val }
this.value = val.devName
this.dialogVisibleEdit = true
@ -230,17 +231,30 @@ export default {
},
//
deleteBtn(val) {
let data = {
id: val.id
}
deleteRealTimPhotovoltaoc(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
let data = {
id: val.id
}
deleteRealTimPhotovoltaoc(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
//
handleSizeChange(val) {

View File

@ -92,7 +92,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleAdd = false"> </el-button>
<el-button @click="noAdd"> </el-button>
<el-button type="primary" @click="okAdd"> </el-button>
</span>
</el-dialog>
@ -164,27 +164,27 @@ export default {
attenuationRate: '',
name: '',
hourGeneratingCapacity: '',
isc:'',
modelNumber:'',
ocv:'',
size:'',
specification:'',
standardOperatingCurrent:'',
standardOperatingVoltage:'',
standardPower:'',
isc: '',
modelNumber: '',
ocv: '',
size: '',
specification: '',
standardOperatingCurrent: '',
standardOperatingVoltage: '',
standardPower: ''
},
editForm: {
attenuationRate: '',
name: '',
hourGeneratingCapacity: '',
isc:'',
modelNumber:'',
ocv:'',
size:'',
specification:'',
standardOperatingCurrent:'',
standardOperatingVoltage:'',
standardPower:'',
isc: '',
modelNumber: '',
ocv: '',
size: '',
specification: '',
standardOperatingCurrent: '',
standardOperatingVoltage: '',
standardPower: ''
}
}
},
@ -193,6 +193,22 @@ export default {
this.getListData()
},
methods: {
noAdd(){
this.dialogVisibleAdd = false
this.form = {
attenuationRate: '',
name: '',
hourGeneratingCapacity: '',
isc: '',
modelNumber: '',
ocv: '',
size: '',
specification: '',
standardOperatingCurrent: '',
standardOperatingVoltage: '',
standardPower: ''
}
},
okAdd() {
this.dialogVisibleAdd = false
let data = {
@ -201,19 +217,32 @@ export default {
attenuationRate: this.form.attenuationRate,
hourGeneratingCapacity: this.form.hourGeneratingCapacity,
id: this.form.id,
isc:this.form.isc,
modelNumber:this.form.modelNumber,
ocv:this.form.ocv,
size:this.form.size,
specification:this.form.specification,
standardOperatingCurrent:this.form.standardOperatingCurrent,
standardOperatingVoltage:this.form.standardOperatingVoltage,
standardPower:this.form.standardPower,
isc: this.form.isc,
modelNumber: this.form.modelNumber,
ocv: this.form.ocv,
size: this.form.size,
specification: this.form.specification,
standardOperatingCurrent: this.form.standardOperatingCurrent,
standardOperatingVoltage: this.form.standardOperatingVoltage,
standardPower: this.form.standardPower
}
addPhotovoltaoc(data).then(res => {
if (res.code == 200) {
this.$message.success('新增成功!')
this.getListData()
this.form = {
attenuationRate: '',
name: '',
hourGeneratingCapacity: '',
isc: '',
modelNumber: '',
ocv: '',
size: '',
specification: '',
standardOperatingCurrent: '',
standardOperatingVoltage: '',
standardPower: ''
}
} else {
this.$message.success('新增失败!')
}
@ -227,14 +256,14 @@ export default {
attenuationRate: this.editForm.attenuationRate,
hourGeneratingCapacity: this.editForm.hourGeneratingCapacity,
id: this.editForm.id,
isc:this.editForm.isc,
modelNumber:this.editForm.modelNumber,
ocv:this.editForm.ocv,
size:this.editForm.size,
specification:this.editForm.specification,
standardOperatingCurrent:this.editForm.standardOperatingCurrent,
standardOperatingVoltage:this.editForm.standardOperatingVoltage,
standardPower:this.editForm.standardPower,
isc: this.editForm.isc,
modelNumber: this.editForm.modelNumber,
ocv: this.editForm.ocv,
size: this.editForm.size,
specification: this.editForm.specification,
standardOperatingCurrent: this.editForm.standardOperatingCurrent,
standardOperatingVoltage: this.editForm.standardOperatingVoltage,
standardPower: this.editForm.standardPower
}
editPhotovoltaoc(data).then(res => {
if (res.code == 200) {
@ -255,7 +284,7 @@ export default {
name: this.formInline.buildName,
projectSn: this.projectSn,
current: this.current,
pageSize: this.pageSize,
pageSize: this.pageSize
}
getPhotovoltaocList(data).then(res => {
this.tableList = res.result.records
@ -284,17 +313,30 @@ export default {
},
//
deleteBtn(val) {
let data = {
id: val.id
}
deletePhotovoltaoc(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
let data = {
id: val.id
}
deletePhotovoltaoc(data).then(res => {
if (res.code == 200) {
this.$message.success('删除成功!')
this.getListData()
} else {
this.$message.success('删除失败!')
}
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
//
handleSizeChange(val) {