|
@@ -118,12 +118,12 @@
|
|
|
<!-- 物料监控 -->
|
|
|
<div class="operItem" @click="materialMonitorClk()" v-if="device.equimentType != 'SI320'">
|
|
|
<div class="operIcon">
|
|
|
- <!-- <img v-if="materialIcon === '0'" class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
|
|
|
- <img v-else class="operImg" src="../../assets/device/operIcon/materialMonitorOff.png" /> -->
|
|
|
- <img class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
|
|
|
+ <img v-if="materialIcon === '0'" class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
|
|
|
+ <img v-else class="operImg" src="../../assets/device/operIcon/materialMonitorOff.png" />
|
|
|
+ <!-- <img class="operImg" src="../../assets/device/operIcon/materialMonitor.png" /> -->
|
|
|
</div>
|
|
|
- <div class="operText">{{ $t("device.materialMonitor") }}</div>
|
|
|
- <!-- <div class="operText">{{ materialTitle }}</div> -->
|
|
|
+ <!-- <div class="operText">{{ $t("device.materialMonitor") }}</div> -->
|
|
|
+ <div class="operText">{{ materialTitle }}</div>
|
|
|
</div>
|
|
|
<!-- 屏蔽/展示商品 -->
|
|
|
<div class="operItem" @click="showGoodsClk()" v-if="device.equimentType != 'SI320'">
|
|
@@ -252,12 +252,14 @@ export default {
|
|
|
const operCheckShow = ref(false);
|
|
|
const device = ref({});
|
|
|
const operType = ref("");
|
|
|
- // 休眠按钮
|
|
|
+ // 睡眠按钮文字
|
|
|
const sleepTitle = ref(t("device.turnOnSleep"));
|
|
|
+ // 物料监控按钮文字
|
|
|
+ const materialTitle = ref(t("device.materialMonitorOn"));
|
|
|
// 睡眠图标
|
|
|
const sleepIcon = ref('0');
|
|
|
- // 启用物料监控图标
|
|
|
- // const materialIcon = ref('0');
|
|
|
+ // 物料监控图标
|
|
|
+ const materialIcon = ref('0');
|
|
|
|
|
|
// 初始化页面获取列表
|
|
|
onMounted(async () => {
|
|
@@ -277,13 +279,14 @@ export default {
|
|
|
sleepIcon.value = '0';
|
|
|
}
|
|
|
// 物料监控
|
|
|
- // if (device.value.materialMonitor) {
|
|
|
- // materialTitle.value = t("device.materialMonitorOn");
|
|
|
- // materialIcon.value = '1';
|
|
|
- // } else {
|
|
|
- // materialTitle.value = t("device.materialMonitorOff");
|
|
|
- // materialIcon.value = '0';
|
|
|
- // }
|
|
|
+ // isMaterialUse = "1"时,物料监控已开启
|
|
|
+ if (device.value.isMaterialUse === '1') {
|
|
|
+ materialTitle.value = t("device.materialMonitorOn");
|
|
|
+ materialIcon.value = '0';
|
|
|
+ } else {
|
|
|
+ materialTitle.value = t("device.materialMonitorOff");
|
|
|
+ materialIcon.value = '1';
|
|
|
+ }
|
|
|
};
|
|
|
const closeOper = () => {
|
|
|
show.value = false;
|
|
@@ -355,7 +358,7 @@ export default {
|
|
|
query: { deviceId: device.value.id, clientId: device.value.clientId },
|
|
|
});
|
|
|
};
|
|
|
- // 系统脱机✓
|
|
|
+ // 系统脱机
|
|
|
const tuojiEquipmentFun = () => {
|
|
|
operType.value = 5;
|
|
|
operCheckShow.value = true;
|
|
@@ -459,7 +462,7 @@ export default {
|
|
|
showFailToast(data.message);
|
|
|
}
|
|
|
}
|
|
|
- // 删除设备✓
|
|
|
+ // 删除设备
|
|
|
if (operType.value === 6) {
|
|
|
const { data } = await delOneDevice({
|
|
|
equipmentId: device.value.id,
|
|
@@ -474,8 +477,15 @@ export default {
|
|
|
}
|
|
|
// 启用物料监控
|
|
|
if (operType.value === 7) {
|
|
|
+
|
|
|
+ let materialMonitorStatus = 0; // 0默认是未开启
|
|
|
+ // isMaterialUse是1时,物料监控已启用,按钮是关闭功能
|
|
|
+ if (device.value.isMaterialUse === "1") {
|
|
|
+ materialMonitorStatus = 1; // 1代表已开启
|
|
|
+ }
|
|
|
const { data } = await enableMaterial({
|
|
|
equipmentId: device.value.id,
|
|
|
+ materialMonitorStatus
|
|
|
});
|
|
|
if (data.code === '00000') {
|
|
|
showSuccessToast(t("device.enableMaterialSucceed"));
|
|
@@ -534,13 +544,15 @@ export default {
|
|
|
showGoodsClk,
|
|
|
diyFlowerClk,
|
|
|
sleepTitle,
|
|
|
+ materialTitle,
|
|
|
viewLogs,
|
|
|
deleteDevice,
|
|
|
lockDevice,
|
|
|
// viewPosiClk,
|
|
|
changePasswordClk,
|
|
|
sleepIcon,
|
|
|
- materialMonitorClk
|
|
|
+ materialIcon,
|
|
|
+ materialMonitorClk,
|
|
|
};
|
|
|
},
|
|
|
components: {},
|