Commit ebe9c6f4 authored by 张伯涛's avatar 张伯涛

一键启停代码修改

parent c0d04b6f
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<p v-show="isStop">倒计时{{countDown}}</p> <p v-show="isStop">倒计时{{countDown}}</p>
</div> </div>
<el-dialog v-model="dialogFormVisible" width="30%" title="请选择进行一键启动的循环泵:" center> <el-dialog @close="onClose" :close-on-click-modal="false" v-model="dialogFormVisible" width="30%" title="请选择进行一键启动的循环泵:" center>
<div style="display: flex;justify-content: center;align-items: center; height: 150px;"> <div style="display: flex;justify-content: center;align-items: center; height: 150px;">
<el-button type="primary" :loading="isLoading" @click="OneKeyStart(1)" style="margin-right: 50px;">一号循环泵</el-button> <el-button type="primary" :loading="isLoading" @click="OneKeyStart(1)" style="margin-right: 50px;">一号循环泵</el-button>
<el-button type="primary" :loading="isLoading" @click="OneKeyStart(2)">二号循环泵</el-button> <el-button type="primary" :loading="isLoading" @click="OneKeyStart(2)">二号循环泵</el-button>
...@@ -684,7 +684,7 @@ async function TransferOpen() { ...@@ -684,7 +684,7 @@ async function TransferOpen() {
await new Promise(resolve => setTimeout(resolve, 1000)); await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 7; activeStep.value = 7;
handleSetOneStartStop(stationId.value,transferId.value,false,undefined,8,undefined) handleSetOneStartStopTwo(stationId.value,transferId.value,false,undefined,8,undefined)
dialogFormVisible.value = true; dialogFormVisible.value = true;
} else { } else {
scheduledTasks() // 定时查询 scheduledTasks() // 定时查询
...@@ -728,10 +728,13 @@ function TransferClose() { ...@@ -728,10 +728,13 @@ function TransferClose() {
}); });
} }
async function onClose() {
async function OneKeyStart(num) {
dialogFormVisible.value = false; dialogFormVisible.value = false;
scheduledTasks() // 定时查询 scheduledTasks() // 定时查询
}
async function OneKeyStart(num) {
console.log('timerQuery',timerQuery)
dialogFormVisible.value = false;
isLoading.value = true; isLoading.value = true;
try { try {
const userId = userInfo.userId; const userId = userInfo.userId;
...@@ -741,10 +744,10 @@ async function OneKeyStart(num) { ...@@ -741,10 +744,10 @@ async function OneKeyStart(num) {
if (result.success) { if (result.success) {
activeStep.value = 8; activeStep.value = 8;
startPercent[7].color = "rgb(103 194 58)"; startPercent[7].color = "rgb(103 194 58)";
await handleSetOneStartStop(stationId.value, transferId.value, true, undefined, 8, undefined) await handleSetOneStartStopTwo(stationId.value, transferId.value, true, undefined, 8, undefined)
} else { } else {
startPercent[7].color = "rgb(176 63 63)"; startPercent[7].color = "rgb(176 63 63)";
await handleSetOneStartStop(stationId.value, transferId.value, false, undefined, 8, undefined) await handleSetOneStartStopTwo(stationId.value, transferId.value, false, undefined, 8, undefined)
} }
ElMessage.success(result.message); ElMessage.success(result.message);
} else { } else {
...@@ -809,6 +812,18 @@ async function handleSetOneStartStop( stationId,unitId,runStepsFlag,stopStepsFla ...@@ -809,6 +812,18 @@ async function handleSetOneStartStop( stationId,unitId,runStepsFlag,stopStepsFla
scheduledTasks() // 定时查询 scheduledTasks() // 定时查询
}) })
} }
async function handleSetOneStartStopTwo( stationId,unitId,runStepsFlag,stopStepsFlag,runSteps,stopSteps) {
const params = {
stationId: stationId,
unitId: unitId,
runStepsFlag: runStepsFlag,
stopStepsFlag: stopStepsFlag,
runSteps: runSteps,
stopSteps: stopSteps,
}
setOneStartStop(params).then(res => {
})
}
async function OnekeyStopEnd() { async function OnekeyStopEnd() {
stationId.value = options[0].children[0].children.find(item => item.value === transferId.value).stationId stationId.value = options[0].children[0].children.find(item => item.value === transferId.value).stationId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment