浏览代码

feat:"设备列表增加地区筛选,优化物料监控功能"

soobin 1 月之前
父节点
当前提交
5a74a146a6

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "shenze-vue3-app",
-  "version": "1.5.714",
+  "version": "1.5.723",
   "private": true,
   "scripts": {
     "start": "vue-cli-service serve",

+ 2 - 2
public/version.json

@@ -1,5 +1,5 @@
 {
-  "version": "1.5.714",
-  "timestamp": "2025-07-14T10:37:59.707",
+  "version": "1.5.723",
+  "timestamp": "2025-07-23T09:29:41.838",
   "commitHash": "dev-build"
 }

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

@@ -416,6 +416,8 @@
     "equipmentStatus": "Status",
     "pleaseSelectTheDeviceStatus": "Select status",
     "plzSelectDeviceGroup": "Select group",
+    "isAbroad": "Region",
+    "isAbroadPlaceholder": "Select region",
     "emptyingConditions": "Reset Filters",
     "clickSearch": "Search",
     "spunSugar": "Cotton Candy",
@@ -556,6 +558,7 @@
     "enterProductName": "Enter product name",
     "enterProductPrice": "Enter product price",
     "materialMonitor": "Material Monitoring",
+    "openRemindMaterial": "Toggle material monitoring?",
     "showGoodsPage": {
       "title": "Product Display",
       "equipmentName": "Machine Name"
@@ -625,6 +628,8 @@
     "J01": "Fruit Jam (1)",
     "J02": "Fruit Jam (2)",
     "J03": "Fruit Jam (3)",
+    "sweet": "Sweet Corn",
+    "salty": "Salted Corn",
     "sentSuccessfully": "Sent",
     "turnOffSleep": "Sleep Mode",
     "turnOnSleep": "Active",

+ 5 - 0
src/assets/language/es.json

@@ -416,6 +416,8 @@
         "equipmentStatus": "Estado",
         "pleaseSelectTheDeviceStatus": "Seleccionar",
         "plzSelectDeviceGroup": "Seleccionar grupo",
+        "isAbroad": "Región",
+        "isAbroadPlaceholder": "Seleccione región",
         "emptyingConditions": "Vaciar criterios",
         "clickSearch": "Buscar",
         "spunSugar": "Algodón azúcar",
@@ -556,6 +558,7 @@
         "enterProductName": "Introduzca el nombre del producto",
         "enterProductPrice": "Introduzca el precio del producto",
         "materialMonitor": "Control inventario",
+        "openRemindMaterial": "¿Cambiar monitoreo de materiales?",
         "showGoodsPage": {
             "title": "Config. productos",
             "equipmentName": "Equipo"
@@ -625,6 +628,8 @@
         "J01": "Mermelada (1)",
         "J02": "Mermelada (2)",
         "J03": "Mermelada (3)",
+        "sweet": "Maíz Dulce",
+        "salty": "Maíz Salado",
         "sentSuccessfully": "Solicitud enviada",
         "turnOffSleep": "Modo descanso",
         "turnOnSleep": "Modo activo",

+ 5 - 0
src/assets/language/fr.json

@@ -416,6 +416,8 @@
         "equipmentStatus": "État",
         "pleaseSelectTheDeviceStatus": "Sélectionner état",
         "plzSelectDeviceGroup": "Choisir groupe",
+        "isAbroad": "Région",
+        "isAbroadPlaceholder": "Sélectionnez une région",
         "emptyingConditions": "Réinitialiser filtres",
         "clickSearch": "Rechercher",
         "spunSugar": "Barbe à papa",
@@ -556,6 +558,7 @@
         "enterProductName": "Saisir le nom du produit",
         "enterProductPrice": "Saisir le prix du produit",
         "materialMonitor": "Surveillance matières",
+        "openRemindMaterial": "Basculer le suivi des matières?",
         "showGoodsPage": {
             "title": "Affichage produits",
             "equipmentName": "Nom appareil"
@@ -625,6 +628,8 @@
         "J01": "Confiture (1)",
         "J02": "Confiture (2)",
         "J03": "Confiture (3)",
+        "sweet": "Maïs Sucré",
+        "salty": "Maïs Salé",
         "sentSuccessfully": "Envoyé",
         "turnOffSleep": "Veille activée",
         "turnOnSleep": "Veille désactivée",

+ 5 - 0
src/assets/language/ja.json

@@ -411,6 +411,8 @@
         "deviceGrouping": "デバイスパケット",
         "emptyingConditions": "条件をクリア",
         "plzSelectDeviceGroup": "デバイスグループを選択してください",
+        "isAbroad": "地域",
+        "isAbroadPlaceholder": "地域を選択",
         "clickSearch": "クリックして検索",
         "spunSugar": "綿菓子",
         "popcorn": "ポップコーン",
@@ -550,6 +552,7 @@
         "enterProductName": "商品名を入力",
         "enterProductPrice": "価格を入力",
         "materialMonitor": "材料監視",
+        "openRemindMaterial": "材料監視モードを切り替えますか?",
         "showGoodsPage": {
             "title": "商品表示設定",
             "equipmentName": "装置名"
@@ -619,6 +622,8 @@
         "J01": "フルーツジャム (1)",
         "J02": "フルーツジャム (2)",
         "J03": "フルーツジャム (3)",
+        "sweet": "スイートコーン",
+        "salty": "塩味コーン",
         "sentSuccessfully": "リクエスト送信完了",
         "turnOffSleep": "スリープ中",
         "turnOnSleep": "スリープしていない",

+ 5 - 0
src/assets/language/pt.json

@@ -416,6 +416,8 @@
         "equipmentStatus": "Status",
         "pleaseSelectTheDeviceStatus": "Selecione",
         "plzSelectDeviceGroup": "Selecione grupo",
+        "isAbroad": "Região",
+        "isAbroadPlaceholder": "Selecione a região",
         "emptyingConditions": "Limpar Filtros",
         "clickSearch": "Buscar",
         "spunSugar": "Máquina Algodão Doce",
@@ -556,6 +558,7 @@
         "enterProductName": "Digite o nome do produto",
         "enterProductPrice": "Digite o preço do produto",
         "materialMonitor": "Monitor de Insumos",
+        "openRemindMaterial": "Alternar monitoramento de materiais?",
         "showGoodsPage": {
             "title": "Configurar Exibição",
             "equipmentName": "Equipamento"
@@ -625,6 +628,8 @@
         "J01": "Geleia (1)",
         "J02": "Geleia (2)",
         "J03": "Geleia (3)",
+        "sweet": "Milho Doce",
+        "salty": "Milho Salgado",
         "sentSuccessfully": "Comando Enviado",
         "turnOffSleep": "Modo Repouso Ativo",
         "turnOnSleep": "Modo Repouso Inativo",

+ 5 - 0
src/assets/language/ru.json

@@ -416,6 +416,8 @@
         "equipmentStatus": "Статус",
         "pleaseSelectTheDeviceStatus": "Статус устройства",
         "plzSelectDeviceGroup": "Группа устройств",
+        "isAbroad": "Регион",
+        "isAbroadPlaceholder": "Выберите регион",
         "emptyingConditions": "Очистка",
         "clickSearch": "Поиск",
         "spunSugar": "Сахар.вата",
@@ -556,6 +558,7 @@
         "enterProductName": "Введите название товара",
         "enterProductPrice": "Введите цену товара",
         "materialMonitor": "Контроль мат.",
+        "openRemindMaterial": "Переключить мониторинг материалов?",
         "showGoodsPage": {
             "title": "Отображение товаров",
             "equipmentName": "Устройство"
@@ -625,6 +628,8 @@
         "J01": "Фруктовый джем (1)",
         "J02": "Фруктовый джем (2)",
         "J03": "Фруктовый джем (3)",
+        "sweet": "Сладкая кукуруза",
+        "salty": "Солёная кукуруза",
         "sentSuccessfully": "Отправлено",
         "turnOffSleep": "Сон zzZ",
         "turnOnSleep": "Активно",

+ 5 - 0
src/assets/language/uk.json

@@ -416,6 +416,8 @@
         "equipmentStatus": "Стан",
         "pleaseSelectTheDeviceStatus": "Обрати стан",
         "plzSelectDeviceGroup": "Обрати групу",
+        "isAbroad": "Регіон",
+        "isAbroadPlaceholder": "Оберіть регіон",
         "emptyingConditions": "Очищення",
         "clickSearch": "Пошук",
         "spunSugar": "Цукерки",
@@ -556,6 +558,7 @@
         "enterProductName": "Введіть назву товару",
         "enterProductPrice": "Введіть ціну товару",
         "materialMonitor": "Моніторинг матеріалів",
+        "openRemindMaterial": "Перемкнути моніторинг матеріалів?",
         "showGoodsPage": {
             "title": "Налаштування відображення",
             "equipmentName": "Пристрій"
@@ -625,6 +628,8 @@
         "J01": "Фруктовий джем (1)",
         "J02": "Фруктовий джем (2)",
         "J03": "Фруктовий джем (3)",
+        "sweet": "Солодка кукурудза",
+        "salty": "Солона кукурудза",
         "sentSuccessfully": "Запит відправлено",
         "turnOffSleep": "Сон zzZ",
         "turnOnSleep": "Не спить",

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

@@ -425,6 +425,8 @@
     "equipmentStatus": "设备状态",
     "pleaseSelectTheDeviceStatus": "请选择设备状态",
     "plzSelectDeviceGroup": "请选择设备分组",
+    "isAbroad": "地区",
+    "isAbroadPlaceholder": "请选择地区",
     "emptyingConditions": "清空条件",
     "clickSearch": "点击搜索",
     "spunSugar": "棉花糖",
@@ -565,6 +567,7 @@
     "enterProductName": "请输入商品名称",
     "enterProductPrice": "请输入商品价格",
     "materialMonitor": "物料监控",
+    "openRemindMaterial": "是否切换物料监控开关?",
     "showGoodsPage": {
       "title": "商品显示设置",
       "equipmentName": "设备名称"
@@ -634,6 +637,8 @@
     "J01": "果酱(1)",
     "J02": "果酱(2)",
     "J03": "果酱(3)",
+    "sweet": "甜玉米",
+    "salty": "咸玉米",
     "sentSuccessfully": "发送请求成功",
     "turnOffSleep": "睡眠中zzZ",
     "turnOnSleep": "未睡眠",

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

@@ -9,6 +9,11 @@ export function getDeviceList(params) {
   );
 }
 
+// 获取机器列表
+export function getMachineList(params) {
+  return axios.post(`/SZWL-SERVER/tEquipment/list`, params);
+}
+
 // 获取设备详情
 export function getDeviceDetal(params) {
   return axios.post(
@@ -214,6 +219,11 @@ export function enableMaterial(params) {
   return axios.post(`/SZWL-SERVER/tParameters/enableMaterial`, params);
 }
 
+// 新物料监控开关
+export function changeMaterial(params) {
+  return axios.post(`/SZWL-SERVER/tEquipment/material`, params);
+}
+
 // 分销人回显
 export function getProportion(params) {
   return axios.post(`/SZWL-SERVER/tProportion/getOne?${stringToUrl(params)}`);

+ 39 - 83
src/views/bindWechat.vue

@@ -1,15 +1,15 @@
 <template>
   <div class="bindWechat">
     <s-header :name="$t('wechat.headerName')" :noback="false" />
-    
+
     <!-- 内容区域 -->
     <div class="content">
       <!-- 欢迎标题 -->
       <div class="welcome">
-        <h2 class="title">{{ $t('bindWechat.welcomeTitle') }}</h2>
-        <p class="subtitle">{{ $t('bindWechat.welcomeSubtitle') }}</p>
+        <h2 class="title">{{ $t("bindWechat.welcomeTitle") }}</h2>
+        <p class="subtitle">{{ $t("bindWechat.welcomeSubtitle") }}</p>
       </div>
-      
+
       <!-- 微信头像卡片 -->
       <div class="avatar-card">
         <div class="avatar-container">
@@ -21,26 +21,26 @@
             radius="50%"
             class="avatar-image"
           />
-          <div class="avatar-ring"></div>
         </div>
       </div>
-      
+
       <!-- 底部按钮区域 -->
       <div class="action-buttons">
-        <van-button 
+        <van-button
           v-if="wechatInfo.avatarUrl !== ''"
-          round 
+          round
+          size="normal"
           class="cancel-btn"
           @click="unbindClick"
         >
-          <van-icon name="close" class="btn-icon"  size="20px" />
+          <van-icon name="close" class="btn-icon" size="20px" />
           {{ $t("bindWechat.unbind") }}
         </van-button>
-        
+
         <van-button
-        v-if="wechatInfo.avatarUrl === ''"
-          round 
-          type="primary" 
+          v-if="wechatInfo.avatarUrl === ''"
+          round
+          type="primary"
           class="bind-btn"
           @click="onSubmit"
         >
@@ -54,7 +54,6 @@
 
 <script>
 import { onMounted, reactive, ref } from "vue";
-// import {Toast} from "vant";
 import { showSuccessToast, showFailToast, showConfirmDialog } from "vant";
 import { bindWechat, getAvatar, unbindWechat } from "@/service/bindWechat";
 import {
@@ -98,9 +97,9 @@ export default {
         title: t("user.tips"),
         message: t("bindWechat.unbindTips"),
       })
-        .then(async() => {
-          const { data } = await unbindWechat({adminId: user.id});
-          if (data.code === '00000') {
+        .then(async () => {
+          const { data } = await unbindWechat({ adminId: user.id });
+          if (data.code === "00000") {
             showSuccessToast(t("bindWechat.unbindSuccess"));
             setTimeout(() => {
               router.go(0);
@@ -177,32 +176,31 @@ export default {
 .bindWechat {
   display: flex;
   flex-direction: column;
-  min-height: 100vh;
+  height: 100vh;
+  width: 100%;
   background: @bg-color;
-  position: relative;
 }
 
 .content {
   flex: 1;
-  padding: 30px 20px 40px;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
+  overflow: auto;
+  overflow-x: hidden;
+  width: 100%;
 }
 
 .welcome {
   text-align: center;
   margin-bottom: 40px;
-  
+
   .title {
     font-size: 24px;
     font-weight: 600;
     color: @text-dark;
     margin-bottom: 12px;
     position: relative;
-    
+
     &::after {
-      content: '';
+      content: "";
       position: absolute;
       bottom: -8px;
       left: 50%;
@@ -213,7 +211,7 @@ export default {
       border-radius: 2px;
     }
   }
-  
+
   .subtitle {
     font-size: 15px;
     color: @text-gray;
@@ -225,82 +223,50 @@ export default {
 
 .avatar-card {
   display: flex;
-  flex-direction: column;
-  align-items: center;
-  width: 100%;
-  max-width: 350px;
+  justify-content: center;
   margin-bottom: 20px;
-  position: relative;
 }
 
 .avatar-container {
-  position: relative;
   margin-bottom: 25px;
-  
+
   .avatar-image {
     border: 3px solid white;
     box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
   }
-  
-  .avatar-ring {
-    position: absolute;
-    top: -10px;
-    left: -10px;
-    right: -10px;
-    bottom: -10px;
-    border: 4px solid;
-    border-image-slice: 1;
-    border-image-source: linear-gradient(to right, @light-cyan, @light-blue);
-    border-radius: 50%;
-    z-index: -1;
-    animation: pulse-ring 3s infinite ease-in-out;
-  }
-}
-
-@keyframes pulse-ring {
-  0% {
-    opacity: 0.8;
-    transform: scale(0.9);
-  }
-  50% {
-    opacity: 0.3;
-    transform: scale(1.1);
-  }
-  100% {
-    opacity: 0.8;
-    transform: scale(0.9);
-  }
 }
 
 .action-buttons {
-  
+  display: flex;
+  justify-content: center;
+
   .cancel-btn {
     border: 1px solid @border-color;
     background: #fb725f;
     color: #f5f7ff;
     transition: all 0.3s ease;
-    padding: 0 50px;
-    
+    padding: 0 55px;
+
     .btn-icon {
       margin-right: 5px;
     }
-    
+
     &:active {
       background: #f5f7ff;
     }
   }
-  
+
   .bind-btn {
     background: linear-gradient(to right, @light-cyan, @light-blue);
     border: none;
     box-shadow: 0 5px 15px rgba(91, 134, 229, 0.4);
     transition: all 0.3s ease;
-    padding: 0 50px;
-    
+    padding: 0 55px;
+
     .btn-icon {
       margin-right: 5px;
     }
-    
+
     &:active {
       transform: translateY(2px);
       box-shadow: 0 3px 10px rgba(91, 134, 229, 0.4);
@@ -310,31 +276,21 @@ export default {
 
 // 响应式设计
 @media (max-width: 480px) {
-  .content {
-    padding: 20px 15px 30px;
-  }
-  
   .welcome {
     .title {
       font-size: 22px;
     }
-    
+
     .subtitle {
       font-size: 14px;
     }
   }
-  
+
   .avatar-container {
     .avatar-image {
       width: 100px;
       height: 100px;
     }
   }
-  
-  .action-buttons {
-    .cancel-btn, .bind-btn {
-      width: 100%;
-    }
-  }
 }
 </style>

+ 2 - 2
src/views/device/deviceOper.vue

@@ -371,7 +371,7 @@
         </div>
       </div>
       <!-- 物料监控 -->
-      <div
+      <!-- <div
         v-if="controlList.includes('C12')"
         class="operation-item"
         @click="materialMonitorClk()"
@@ -393,7 +393,7 @@
         <div class="text-wrapper">
           <span class="operation-text">{{ materialTitle }}</span>
         </div>
-      </div>
+      </div> -->
       <!-- 屏蔽/展示商品 -->
       <div
         v-if="controlList.includes('C13')"

+ 74 - 26
src/views/device/deviceSearch.vue

@@ -31,25 +31,49 @@
           />
           <!-- 公司平台 -->
           <div v-if="isShowCompany()">
-            <van-field
-              label-width="86"
-              v-model="companyTypeText"
-              is-link
-              readonly
-              :label="$t('device.companyTypeLabel')"
-              :placeholder="$t('device.companyTypePlaceholder')"
-              @click="companyTypeShow = true"
-              class="field"
-            />
-            <van-popup v-model:show="companyTypeShow" round position="bottom">
-              <van-cascader
-                v-model="companyType"
-                :title="$t('device.companyTypePlaceholder')"
-                :options="companyTypeOptions"
-                @close="companyTypeShow = false"
-                @finish="companyTypeFinish"
-              />
-            </van-popup>
+            <van-row>
+              <van-col span="12"> 
+                <van-field
+                  label-width="66"
+                  v-model="companyTypeText"
+                  is-link
+                  readonly
+                  :label="$t('device.companyTypeLabel')"
+                  :placeholder="$t('device.companyTypePlaceholder')"
+                  @click="companyTypeShow = true"
+                  class="field"
+                />
+                <van-popup v-model:show="companyTypeShow" round position="bottom">
+                  <van-cascader
+                    v-model="companyType"
+                    :title="$t('device.companyTypePlaceholder')"
+                    :options="companyTypeOptions"
+                    @close="companyTypeShow = false"
+                    @finish="companyTypeFinish"
+                  />
+                </van-popup>
+              </van-col>
+              <van-col span="12"> 
+                <van-field
+                  label-width="66"
+                  v-model="vText"
+                  is-link
+                  readonly
+                  :label="$t('device.isAbroad')"
+                  :placeholder="$t('device.isAbroadPlaceholder')"
+                  @click="isAbroadShow = true"
+                />
+                <van-popup v-model:show="isAbroadShow" round position="bottom"> 
+                  <van-cascader
+                    v-model="isAbroad"
+                    :title="$t('device.isAbroadPlaceholder')"
+                    :options="isAbroadOptions"
+                    @close="isAbroadShow = false"
+                    @finish="isAbroadFinish"
+                  />
+                </van-popup>
+              </van-col>
+            </van-row>
           </div>
           <!-- <van-field
             v-model="areaName"
@@ -198,8 +222,11 @@ export default {
     const machineTypeShow = ref(false); // 设备类型级联状态
     const companyType = ref(""); // 公司平台
     const deviceGroup = ref(""); // 设备分组
+    const isAbroad = ref(null); // 设备所在地
     const companyTypeText = ref(""); // 公司平台 - 页面显示
     const deviceGroupText = ref(""); // 设备分组 - 页面显示
+    const isAbroadText = ref(""); // 设备所在地_页面显示
+    const isAbroadShow = ref(false); // 设备所在地级联状态
     const companyTypeShow = ref(false); // 公司平台级联状态
     const deviceGroupShow = ref(false); // 设备分组级联状态
     const user = getLoginUser(); // 获取登录用户
@@ -230,6 +257,17 @@ export default {
       },
     ]);
 
+    const isAbroadOptions = ref([
+      {
+        text: t("register.chinese"),
+        value: false,
+      },
+      {
+        text: t("register.other"),
+        value: true,
+      },
+    ]);
+
     const deviceGroupOptions = ref([]);
 
     const machineTypeFinish = ({ selectedOptions }) => {
@@ -293,13 +331,12 @@ export default {
         .join("/");
     }; // 公司平台级联选择
 
-    // const deviceGroupFinish = async ({ selectedOptions }) => {
-    //   const selectedLabel = selectedOptions[selectedOptions.length - 1];
-    //   labelId.value = selectedLabel.value;
-    //   // console.log("labelId >>>", labelId.value);
-    //   deviceGroupShow.value = false;
-    //   deviceGroupText.value = selectedOptions.map((option) => option.text).join('/');
-    // }; // 设备分组级联选择
+    const isAbroadFinish = ({ selectedOptions }) => { 
+      isAbroadShow.value = false;
+      isAbroadText.value = selectedOptions
+        .map((option) => option.text)
+        .join("/");
+    }; // 设备所在地级联选择
 
     const equimentType = ref(""); // 设备机型
     const equimentTypeText = ref(""); // 设备机型 - 页面显示
@@ -448,6 +485,8 @@ export default {
         isUsing: isUsing.value,
         payType: payType.value,
         channel: channel.value,
+        isAbroad: isAbroad.value,
+
         // labelId: labelId.value,
       };
       context.emit("search", searchParam);
@@ -463,6 +502,8 @@ export default {
       machineTypeText.value = "";
       companyType.value = "";
       companyTypeText.value = "";
+      isAbroad.value = null;
+      isAbroadText.value = "";
       deviceGroup.value = "";
       deviceGroupText.value = "";
       equimentType.value = "";
@@ -568,6 +609,13 @@ export default {
       companyTypeOptions,
       companyTypeFinish,
 
+      isAbroad,
+      isAbroadText,
+      isAbroadShow,
+      isAbroadOptions,
+      isAbroadFinish,
+
+
       deviceGroup,
       deviceGroupText,
       deviceGroupShow,

+ 46 - 7
src/views/device/index.vue

@@ -164,7 +164,7 @@
                         }}
                       </span>
                       <span
-                        v-if="item.equimentType != 'P10'"
+                        v-if="item.equimentType === 'P30'"
                         class="temperature"
                       >
                         {{
@@ -182,7 +182,7 @@
                           $t("device.cupQuantity") + ":" + item.furnaceTm
                         }}</span
                       >
-                      <span v-if="item.furnaceSp" class="humidity">
+                      <span v-if="item.equimentType === 'P30'" class="humidity">
                         {{
                           $t("device.bucketWeight") +
                           ":" +
@@ -381,7 +381,8 @@
                       class="detail-section material-usage"
                       v-if="item.machineType === '1'"
                     >
-                      <div class="material-group">
+                      <!-- 爆米花P30物料-->
+                      <div class="material-group" v-if="item.equimentType === 'P30'">
                         <div class="material-grid">
                           <div
                             v-for="(poporn, index) in popornTypes"
@@ -408,6 +409,35 @@
                           </div>
                         </div>
                       </div>
+
+                      <!-- 爆米花SBM10物料-->
+                      <div class="material-group" v-if="item.equimentType === 'SBM10'">
+                        <div class="material-grid">
+                          <div
+                            v-for="(poporn, index) in poporn10Types"
+                            :key="index"
+                            class="material-item"
+                          >
+                            <van-icon
+                              :name="poporn.icon"
+                              class="material-icon"
+                              size="25px"
+                              :style="{ color: poporn.color }"
+                            />
+                            <div class="material-info">
+                              <span class="material-label">{{
+                                $t(`device.${poporn.type}`)
+                              }}</span>
+                              <span class="material-value"
+                                >{{
+                                  Format_calcuDecial(item[poporn.code])
+                                }}
+                                g</span
+                              >
+                            </div>
+                          </div>
+                        </div>
+                      </div>
                     </div>
                     <!-- 冰淇淋物料 -->
                     <div
@@ -564,12 +594,13 @@ import {
 import sHeader from "../../components/SimpleHeader";
 import { getLoginUser, Format_calcuDecial } from "../../common/js/utils";
 import {
-  getDeviceList,
+  // getDeviceList,
   eliminate,
   Api_getReplenishment,
   changeSleepDesc,
   setFurnace,
   sleepEquipment,
+  getMachineList,
 } from "../../service/device/index";
 import deviceSearch from "./deviceSearch";
 import deviceOper from "./deviceOper";
@@ -606,7 +637,7 @@ export default {
       { type: "wasteWater", icon: "weapp-nav", color: "#666" },
     ]);
 
-    // 爆米花物料
+    // 爆米花P30物料
     const popornTypes = ref([
       { code: "whiteSugar", type: "chocolate", icon: "stop", color: "#5C3317" },
       { code: "redSugar", type: "cheese", icon: "stop", color: "#fcdd8d" },
@@ -614,6 +645,12 @@ export default {
       { code: "blueSugar", type: "caramel", icon: "stop", color: "#D2691E" },
     ]);
 
+    // 爆米花P10物料
+    const poporn10Types = ref([
+      { code: "redSugar", type: "sweet", icon: "stop", color: "#FFC0CB" },
+      { code: "whiteSugar", type: "salty", icon: "stop", color: "#fcdd8d" },
+    ]);
+
     // 冰淇淋物料
     const iceTypes = ref([
       { code: "whiteSugar", type: "C01", icon: "stop", color: "#5C3317" },
@@ -621,7 +658,7 @@ export default {
       { code: "yellowSugar", type: "J01", icon: "stop", color: "#ff4d4f" },
       { code: "blueSugar", type: "J02", icon: "stop", color: "#1890ff" },
       { code: "stick", type: "J03", icon: "stop", color: "#f8ff3b" },
-    ])
+    ]);
 
     // 创建容器引用
     const scrollContainer = ref(null);
@@ -732,7 +769,7 @@ export default {
     // 获取设备列表数据
     const getList = async () => {
       finished.value = false;
-      const { data } = await getDeviceList(Object.assign({}, searchParams));
+      const { data } = await getMachineList(Object.assign({}, searchParams));
       if (data.code === "00000") {
         if (searchParams.current === 0) {
           list.value = [];
@@ -1092,6 +1129,8 @@ export default {
       popornTypes,
       iceTypes,
 
+      poporn10Types,
+
       scrollContainer,
       scrollTop,
       handleScroll,

+ 48 - 3
src/views/device/openDoor.vue

@@ -51,7 +51,6 @@
       <!-- 内部门控制 -->
       <div class="door-item" v-if="machineType == '0' || machineType == null">
         <div class="door-info">
-          <!-- <van-icon name="door" class="door-icon" /> -->
           <div class="door-detail">
             <h3 class="door-title">{{ $t("device.inDoor") }}</h3>
             <p class="door-status">
@@ -81,8 +80,34 @@
         />
       </div>
 
+      <!-- 物料监控开关 -->
+      <div class="door-item">
+        <div class="door-info">
+          <div class="door-detail">
+            <h3 class="door-title">{{ $t("device.materialMonitor") }}</h3>
+            <p class="door-status">
+              {{ $t("device.status") }}:
+              <span
+                :class="deviceDetal.isMaterialUse == '1' ? 'status-open' : 'status-closed'"
+              >
+                {{
+                  deviceDetal.isMaterialUse == '1' ? $t("device.open") : $t("device.closed")
+                }}
+              </span>
+            </p>
+          </div>
+        </div>
+        <van-switch
+          :model-value="deviceDetal.isMaterialUse"
+          @update:model-value="materialChg"
+          size="24px"
+          active-color="#4d6add"
+          inactive-color="#dcdee0"
+        />
+      </div>
+
       <!-- 纸币器禁能开关 -->
-      <div class="door-item" v-if="(machineType == '0' || machineType == '1') && (user.ifForegin == '1' || user.type == '0')">
+      <div class="door-item" v-if="(machineType == '0' || deviceDetal.equimentType	 == 'P30') && (user.ifForegin == '1' || user.type == '0')">
         <div class="door-info">
           <div class="door-detail">
             <h3 class="door-title">{{ $t("device.banPaper") }}</h3>
@@ -114,7 +139,7 @@
 import { onMounted, ref } from "vue";
 import sHeader from "@/components/SimpleHeader";
 import { useRoute } from "vue-router";
-import { getDeviceDetal, Api_openDoor, banMoney } from "@/service/device";
+import { getDeviceDetal, Api_openDoor, banMoney, enableMaterial, changeMaterial } from "@/service/device";
 import { showFailToast, showToast, showConfirmDialog } from "vant";
 import { useI18n } from "vue-i18n";
 import { getLoginUser } from "../../common/js/utils";
@@ -216,11 +241,31 @@ export default {
       });
     };
 
+    const materialChg = (isMaterialUse) => { 
+      showConfirmDialog({
+        title: t("device.openRemind"),
+        message: t("device.openRemindMaterial"),
+      }).then(() => {
+        deviceDetal.value.equimentType == 'SBM10' ? changeMaterial : enableMaterial({
+          equipmentId: deviceDetal.value.id,
+          isMaterialUse: isMaterialUse ? "1" : "0",
+        }).then((res) => {
+          if (res.data.code == "00000") {
+            showToast(t("device.sentSuccessfully"));
+          }
+          setTimeout(() => {
+            getDeviceDetalFun();
+          }, 1500);
+        });
+      })
+    };
+
     return {
       deviceDetal,
       outDoorChg,
       inDoorChg,
       banPaperChg,
+      materialChg,
       machineType,
       user,
     };

+ 0 - 1
src/views/login.vue

@@ -288,7 +288,6 @@ export default {
 </script>
 
 <style lang="less" scoped>
-// @import "../common/style/mixin";
 @theme-color: #4d6add;
 
 .login-container {