ソースを参照

feat: 物料监控功能

Ritchie 1 年間 前
コミット
dea522acf1

BIN
src/assets/device/operIcon/materialMonitor.png


+ 2 - 0
src/assets/language/en.json

@@ -334,6 +334,7 @@
     "IllThinkAboutItAgain": "Cancel",
     "restartSucceeded": "Restart succeeded",
     "deleteDeviceSucceed": "Delete device successfully",
+    "enableMaterialSucceed": "Enable material successfully",
     "sleepSuccessfully": "Sleep successfully",
     "open": "open",
     "close": "close",
@@ -470,6 +471,7 @@
       "batchPricePlace": "Please enter the batch price",
       "modifySubmit": "Modification submission"
     },
+    "materialMonitor": "materialMonitor",
     "customLogo": {
       "customLogo": "Custom Logo",
       "logoLabel": "modify logo",

+ 2 - 0
src/assets/language/zh.json

@@ -331,6 +331,7 @@
     "IllThinkAboutItAgain": "我再想想",
     "restartSucceeded": "重启成功",
     "deleteDeviceSucceed": "删除设备成功",
+    "enableMaterialSucceed": "启用物料监控成功",
     "sleepSuccessfully": "睡眠成功",
     "open": "开启",
     "close": "关闭",
@@ -470,6 +471,7 @@
       "batchPricePlace": "请输入批量价格",
       "modifySubmit": "修改提交"
     },
+    "materialMonitor": "物料监控",
     "showGoodsPage": {
       "title": "商品显示设置",
       "equipmentName": "设备名称"

+ 5 - 0
src/service/device/index.js

@@ -117,6 +117,11 @@ export function updateParameters(params) {
     return axios.post(`/SZWL-SERVER/tParameters/updateParameters`, params)
 }
 
+// 启用物料监控
+export function enableMaterial(params) {
+    return axios.post(`/SZWL-SERVER/tParameters/enableMaterial?${stringToUrl(params)}`)
+}
+
 // 分销人回显
 export function getProportion(params) {
     return axios.post(`/SZWL-SERVER/tProportion/getOne?${stringToUrl(params)}`)

+ 30 - 1
src/views/device/deviceOper.vue

@@ -14,6 +14,7 @@
     <van-icon name="cross" class="close" @click="show = false" />
     <div class="group4 flex-col"></div>
     <div class="operBox">
+      <!-- 重启炉头 -->
       <div class="operItem" @click="restartFurnace()">
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/restart.png" />
@@ -21,7 +22,7 @@
         <div v-if="device.machineType === '1'" class="operText">{{ $t("device.restart") }}</div>
         <div v-else class="operText">{{ $t("device.restartFurnaceHead") }}</div>
       </div>
-
+      <!-- 睡眠 -->
       <div class="operItem" @click="sleepEquipmentFun()">
         <div class="operIcon">
           <img v-if="sleepIcon === '0'" class="operImg" src="../../assets/device/operIcon/awake.png" />
@@ -108,6 +109,13 @@
         </div>
         <div class="operText">{{ $t("device.modifyPrice") }}</div>
       </div>
+      <!-- 物料监控 -->
+      <div class="operItem" @click="materialMonitorClk()">
+        <div class="operIcon">
+          <img class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
+        </div>
+        <div class="operText">{{ $t("device.materialMonitor") }}</div>
+      </div>
       <!-- 屏蔽/展示商品 -->
       <div class="operItem" @click="showGoodsClk()">
         <div class="operIcon">
@@ -189,6 +197,7 @@ import {
   openDoor,
   deviceTuoji,
   delOneDevice,
+  enableMaterial
 } from "../../service/device";
 import { showFailToast, showSuccessToast } from "vant";
 import { useRouter } from "vue-router";
@@ -312,6 +321,12 @@ export default {
     const paramSetPush = () => {
       router.push({ path: "paramsSet", query: { deviceId: device.value.id } });
     };
+
+    // 物料监控
+    const materialMonitorClk = () => {
+      operType.value = 7;
+      operCheckShow.value = true;
+    };
     // 跳转 - 添加分销人
     const saveProportionPush = () => {
       router.push({
@@ -425,6 +440,19 @@ export default {
           showFailToast(data.message);
         }
       }
+      // 启用物料监控
+      if (operType.value === 7) {
+        const { data } = await enableMaterial({
+          equipmentId: device.value.id,
+          // adminId: user.id,
+        });
+        if (data.code) {
+          showSuccessToast(t("device.enableMaterialSucceed"));
+          operCheckShow.value = false;
+        } else {
+          showFailToast(data.message);
+        }
+      }
       // 关闭弹窗
       show.value = false;
       // 触发操作完成回调
@@ -465,6 +493,7 @@ export default {
       // viewPosiClk,
       changePasswordClk,
       sleepIcon,
+      materialMonitorClk
     };
   },
   components: {},