修改
This commit is contained in:
parent
901761fed6
commit
8e6ece0dce
@ -116,3 +116,12 @@ export function getCode(params:Rcode) {
|
|||||||
responseType:'blob'
|
responseType:'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//站点关停
|
||||||
|
export function stastop(id:any,data:any) {
|
||||||
|
return server.request({
|
||||||
|
url: `/cloud/battery/station/stop/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -90,6 +90,14 @@
|
|||||||
<div v-else-if="scope.row.status == 9">其它</div>
|
<div v-else-if="scope.row.status == 9">其它</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="站控锁定状态" min-width="120" align="center" prop="stop" :show-overflow-tooltip="true">
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-if="scope.row.stop && dytiem(scope.row.stopTime)">预锁定</div>
|
||||||
|
<div v-else-if="scope.row.stop">锁定</div>
|
||||||
|
<div v-else>放开</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="锁定时间" min-width="160" align="center" prop="stopTime" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="地址" min-width="400" align="center" prop="address" :show-overflow-tooltip="true" />
|
<el-table-column label="地址" min-width="400" align="center" prop="address" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="注册日期" min-width="120" align="center" prop="registerDate" :show-overflow-tooltip="true" />
|
<el-table-column label="注册日期" min-width="120" align="center" prop="registerDate" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="联系人" min-width="200" align="center" prop="contacts" :show-overflow-tooltip="true" />
|
<el-table-column label="联系人" min-width="200" align="center" prop="contacts" :show-overflow-tooltip="true" />
|
||||||
@ -112,9 +120,11 @@
|
|||||||
<span>{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}</span>
|
<span>{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="操作" align="center" width="100" fixed="right">
|
<el-table-column label="操作" align="center" width="150" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- <el-button link type="primary" icon="Edit" @click="showpop(2,scope.row)">查看 / 修改</el-button> -->
|
<!-- <el-button link type="primary" icon="Edit" @click="showpop(2,scope.row)">查看 / 修改</el-button> -->
|
||||||
|
<el-button v-if="scope.row.stop" link type="warning" icon="Unlock" @click="hdzstop(scope.row)">放开</el-button>
|
||||||
|
<el-button v-else link type="warning" icon="Lock" @click="hdzlock(scope.row)">锁定</el-button>
|
||||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -689,6 +699,31 @@
|
|||||||
/>
|
/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<!--锁定-->
|
||||||
|
<el-dialog
|
||||||
|
v-model="lockpop"
|
||||||
|
:title="`锁定${hdzname}`"
|
||||||
|
width="400"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-form ref="locksRef" :model="lockata" :rules="lockrules" label-width="110px">
|
||||||
|
<el-form-item label="延迟时间" prop="hour">
|
||||||
|
<el-select v-model="lockata.hour" placeholder="请选择时间">
|
||||||
|
<el-option v-for="n in 48" :label="`${n}小时后`" :value="n" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="lockhand">确 定</el-button>
|
||||||
|
<el-button @click="lockcancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -697,7 +732,8 @@
|
|||||||
addhdz,
|
addhdz,
|
||||||
update,
|
update,
|
||||||
delhdz,
|
delhdz,
|
||||||
getqrcode
|
getqrcode,
|
||||||
|
stastop
|
||||||
} from '@/api/swapstation/hdz'
|
} from '@/api/swapstation/hdz'
|
||||||
import {
|
import {
|
||||||
optionyyslist
|
optionyyslist
|
||||||
@ -726,6 +762,10 @@
|
|||||||
return new Date().getTime()
|
return new Date().getTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dytiem(date:any) {
|
||||||
|
return new Date(date).getTime() > new Date().getTime()
|
||||||
|
}
|
||||||
|
|
||||||
let search = ref(true)
|
let search = ref(true)
|
||||||
|
|
||||||
let queryParams = reactive({
|
let queryParams = reactive({
|
||||||
@ -1045,6 +1085,71 @@
|
|||||||
openpop.value = false
|
openpop.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//锁定
|
||||||
|
let lockpop = ref(false)
|
||||||
|
let hdzid = ref(0)
|
||||||
|
let hdzname = ref('')
|
||||||
|
let lockata = reactive<any>({
|
||||||
|
stop:true,
|
||||||
|
hour:''
|
||||||
|
})
|
||||||
|
let locksRef = ref()
|
||||||
|
const lockrules = {
|
||||||
|
hour:[
|
||||||
|
{ required: true, message: "请选择时间", trigger: "blur" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
function hdzlock(row:any) {
|
||||||
|
hdzname.value = row.name
|
||||||
|
hdzid.value = row.pkId
|
||||||
|
lockpop.value = true
|
||||||
|
lockata.hour = ''
|
||||||
|
querform.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function lockhand() {
|
||||||
|
locksRef.value?.validate((valid:Boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
stastop(hdzid.value,lockata).then(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '操作成功'
|
||||||
|
})
|
||||||
|
setTimeout(()=> {
|
||||||
|
lockpop.value = false
|
||||||
|
getyys()
|
||||||
|
},600)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function lockcancel() {
|
||||||
|
lockpop.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function hdzstop(row:any) {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
`确定${row.stop?'放开':'锁定'}换电站:${row.name}`,
|
||||||
|
'温馨提示',
|
||||||
|
{
|
||||||
|
// confirmButtonText: '',
|
||||||
|
// cancelButtonText: 'Cancel',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
stastop(row.pkId,{stop:false}).then(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '操作成功'
|
||||||
|
})
|
||||||
|
getyys()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
function handleDelete(row:any) {
|
function handleDelete(row:any) {
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user