Просмотр исходного кода

归还入库时传递仓库id,校验勾选的设备是否属于改仓库

ZhangJunQuan 2 месяцев назад
Родитель
Сommit
1f68b00be9
5 измененных файлов с 39 добавлено и 27 удалено
  1. 2 2
      src/api/stockIn.js
  2. 17 12
      src/hardware/GateOperate.js
  3. 14 9
      src/login/UserHome.vue
  4. 1 1
      src/login/UserLogin.vue
  5. 5 3
      src/stock-in/InConfirm.vue

+ 2 - 2
src/api/stockIn.js

@@ -10,9 +10,9 @@ export function cfStockIn(params) {
 }
 
 // 闸机外侧确认生成入库单
-export function createStockIn(params) {
+export function createStockIn(params, warehouseId) {
     return request({
-        url: '/api/stockInResource/generateCFStockIn',
+        url: '/api/stockInResource/generateCFStockIn?warehouseId=' + warehouseId,
         method: 'post',
         data: params,
     });

+ 17 - 12
src/hardware/GateOperate.js

@@ -9,17 +9,22 @@ import { LIGHT_NORMAL, LIGHT_OPEN, LIGHT_CLOSE, LIGHT_ALARM, LIGHT_RESTART } fro
 
 const photo = async () => {
     try {
-        $.ajax({
-            url: 'http://127.0.0.1:10088/api/AGVResource/cancelTask',
-            method: 'GET',
-            contentType: 'application/json',
-            success: function (response) {
-                console.log('控制拍照成功:', response);
-            },
-            error: function (error) {
-                console.error('控制拍照失败:', error);
-            },
-        });
+        const loginInfo = localStorage.getItem('#LoginInfo');
+        if (loginInfo) {
+            const loginInfoObj = JSON.parse(loginInfo);
+            $.ajax({
+                url: 'http://127.0.0.1:9001/camera/snapshot?name='+loginInfoObj.userName,
+                method: 'GET',
+                success: function (response) {
+                    console.log('控制拍照成功:', response);
+                },
+                error: function (error) {
+                    console.error('控制拍照失败:', error);
+                },
+            });
+        }else {
+            console.warn('No login information found in localStorage');
+        }
     } catch (error) {
         console.error('拍照失败:', error);
     }
@@ -43,7 +48,7 @@ const gateController = command => {
 
             //开门拍照
             photo();
-           
+
         } else if (command === 'CLOSE') {
             // 关门命令:控制灯光显示关门状态(红灯常亮)
             plugin.gateConfig.controlLight(JSON.stringify(LIGHT_CLOSE));

+ 14 - 9
src/login/UserHome.vue

@@ -44,7 +44,7 @@
               <i class="fas fa-door-open mr-2" />
               <span>闸机控制</span>
             </div>
-            <div v-if="isAdmin" class="dropdown-item" @click="updatePassward">
+            <div v-if="username !== '未登录'" class="dropdown-item" @click="updatePassward">
               <i class="fas fa-key mr-2" />
               <span>修改密码</span>
             </div>
@@ -571,17 +571,17 @@ const goToAbnormalArea = () => {
 
 // 外侧屏幕操作按钮
 const outButtons = reactive([
-    { label: '领料', action: 'materialReturn', desc: '点击领取生产辅料', colorClass: 'card-blue', bgImage: lingliaoImg },
-    { label: '归还', action: 'materialIn', desc: '点击归还已使用物料', colorClass: 'card-green', bgImage: guihuanImg },
-    { label: '成品入库', action: 'finishedProductIn', desc: '完成生产成品入库登记', colorClass: 'card-orange', bgImage: rukuImg },
+    { label: '领料', action: 'materialReturn', desc: '点击领用工装设备', colorClass: 'card-blue', bgImage: lingliaoImg },
+    { label: '归还', action: 'materialIn', desc: '点击归还工装设备', colorClass: 'card-green', bgImage: guihuanImg },
+    { label: '成品入库', action: 'finishedProductIn', desc: '办理成品入库登记', colorClass: 'card-orange', bgImage: rukuImg },
     { label: '大件运输', action: 'bigProductTransport', desc: '安排大型设备安全运输', colorClass: 'card-slate', bgImage: yunshuImg },
 ]);
 
 // 内侧屏幕操作按钮
 const inButtons = reactive([
-    { label: '借用', action: 'materialOutLeave', desc: '申请临时借用生产工具', colorClass: 'card-purple', bgImage: jieyongImg },
+    { label: '借用', action: 'materialOutLeave', desc: '申请借用工装设备', colorClass: 'card-purple', bgImage: jieyongImg },
     { label: '还料离开', action: 'outboundLeave', desc: '完成还料后离开现场', colorClass: 'card-cyan', bgImage: huanliaoImg },
-    { label: '成品出库', action: 'finishedProductOut', desc: '办理成品发货出库手续', colorClass: 'card-red', bgImage: chukuImg },
+    { label: '成品出库', action: 'finishedProductOut', desc: '办理成品出库手续', colorClass: 'card-red', bgImage: chukuImg },
     { label: '大件运输', action: 'bigProductTransport', desc: '安排大型设备安全运输', colorClass: 'card-slate', bgImage: yunshuImg },
 ]);
 
@@ -877,10 +877,15 @@ const checkPasswordReminder = async () => {
         if (res.errorCode === 0) {
             if (res.data === true) {
                 setTimeout(() => {
-                    showErrorDialog(res.errorMessage);
-                    // 显示修改密码弹窗
                     isUpdatePassword.value = true;
-                }, 4000);
+                    // showErrorDialog(res.errorMessage);
+                    // 显示修改密码弹窗
+                    //让用户点击确认后再显示修改密码弹窗,避免弹窗和提示框同时出现导致界面混乱
+                    // showErrorDialog(res.errorMessage).then(() => {
+                    //     isUpdatePassword.value = true;
+                    // });
+                    
+                }, 1000);
             }
         } else {
             showErrorDialog(res.errorMessage);

+ 1 - 1
src/login/UserLogin.vue

@@ -291,7 +291,7 @@ const checkPasswordReminder = async () => {
             if (res.data === true) {
                 setTimeout(() => {
                     showErrorDialog(res.errorMessage);
-                }, 4000);
+                }, 2000);
             }
         } else {
             showErrorDialog(res.errorMessage);

+ 5 - 3
src/stock-in/InConfirm.vue

@@ -168,6 +168,8 @@ const pagination = reactive({
     total: 0,
 });
 
+const warehouseId = ref(localStorage.getItem('#warehouseId'));
+
 // 计算不在库的数量
 const validStockCount = computed(() => {
     return materialList.value.filter(item => item.remarks === '不在库' && item.selected === true).length;
@@ -309,7 +311,7 @@ const getList = async () => {
 const generateCFStockIn = async params => {
     loading.value = true;
     try {
-        const res = await createStockIn(params);
+        const res = await createStockIn(params,warehouseId.value);
 
         if (res.errorCode === 0) {
 
@@ -375,7 +377,7 @@ onMounted(() => {
         // 执行获取列表
 
         // addEpc([ { 'epc': 'EEE000000640804317955613' }, { 'epc': 'FFF000000000000000000001' }, { 'epc': 'AAA000000000000000000002' }]);
-
+        addEpc([ { 'epc': 'EEE000000640804317954120'}]);
         getList();
     }, 1000);
 });
@@ -688,7 +690,7 @@ const enterConfirm = () => {
 .card-status-section {
   padding: 12px 15px;
   border-top: 1px solid rgba(30, 144, 255, 0.3);
-  background: rgba(9, 61, 140, 0.3);
+  background: rgba(8, 84, 198, 0.3);
   min-height: 50px;
   display: flex;
   align-items: center;