//报警提示
|
const errorInfoFuntion = async (info) => {
|
let infoScancode=info;
|
ElMessageBox.confirm(
|
infoScancode,
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sureStart'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
}
|
|
//修改工作状态 【失败/正在工作/完工】
|
const workStatus = async (row, state) => {
|
let url;
|
if (state == "重发") {
|
url = "/deviceInteraction/tasking/loseMachineTask";
|
} else if (state == "正在工作") {
|
url = "/deviceInteraction/tasking/startMachineTask";
|
} else if (state == "完工") {
|
url = "/deviceInteraction/tasking/finishMachineTask";
|
} else {
|
return;
|
}
|
ElMessageBox.confirm(
|
t('functionState.tips'),
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sure'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
//开始修改
|
request.post(url,
|
{
|
"id": machineId
|
}).then((res) => { // 替换为你的API端点
|
if (res.code === 200) {
|
ElMessage.success(res.message);
|
} else {
|
ElMessage.warning(res.message)
|
}
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
|
}
|
|
//开工/暂停
|
const machineStatus = async (state) => {
|
ElMessageBox.confirm(
|
t('functionState.tips'),
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sure'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
//下线接口
|
request.post("/deviceInteraction/machine/updateMachineState",
|
{
|
"id": machineId,
|
"state": state
|
}).then((res) => { // 替换为你的API端点
|
if (res.code === 200) {
|
ElMessage.success(res.message);
|
} else {
|
ElMessage.warning(res.message)
|
}
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
}
|
//定制/标准
|
const machineMode = async (mode) => {
|
ElMessageBox.confirm(
|
t('functionState.tips'),
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sure'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
//下线接口
|
request.post("/deviceInteraction/machine/toggleModeMachine",
|
{
|
"id": machineId,
|
"mode": mode
|
}).then((res) => { // 替换为你的API端点
|
if (res.code === 200) {
|
ElMessage.success(res.message);
|
} else {
|
ElMessage.warning(res.message)
|
}
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
}
|
//破损
|
const damagedTask = async (row) => {
|
ElMessageBox.confirm(
|
t('functionState.tips'),
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sure'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
//下线接口
|
request.post("/deviceInteraction/tasking/damagedTask",
|
{
|
"glassId": row.glassId
|
}).then((res) => { // 替换为你的API端点
|
if (res.code === 200) {
|
ElMessage.success(res.message);
|
} else {
|
ElMessage.warning(res.message)
|
}
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
}
|
//下线(拿走)
|
const glassDownLine = async (row) => {
|
ElMessageBox.confirm(
|
t('functionState.tips'),
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sure'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
//下线接口
|
request.post("/deviceInteraction/tasking/glassDownLine",
|
{
|
"glassId": row.glassId,
|
}).then((res) => { // 替换为你的API端点
|
if (res.code === 200) {
|
ElMessage.success(res.message);
|
} else {
|
ElMessage.warning(res.message)
|
}
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
}
|
const topLineShow = async () => {
|
blind.value = true;
|
}
|
//上线
|
const topLine = async (row) => {
|
ElMessageBox.confirm(
|
t('functionState.tips'),
|
t('delivery.prompt'),
|
{
|
confirmButtonText: t('functionState.sure'),
|
cancelButtonText: t('functionState.cancel'),
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
//上线接口
|
request.post("/deviceInteraction/tasking/glassTopLine",
|
{
|
"glassId": row.glassId,
|
"lineConfigurationId": machineId
|
}).then((res) => { // 替换为你的API端点
|
if (res.code === 200) {
|
ElMessage.success(res.message);
|
} else {n
|
ElMessage.warning(res.message)
|
}
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: t('functionState.cancel'),
|
})
|
})
|
}
|
const handleDialogClose = () => {
|
|
}
|