Parcourir la source

切换项目更新

ZaiZai il y a 11 mois
Parent
commit
7cb65bdee2
1 fichiers modifiés avec 17 ajouts et 2 suppressions
  1. 17 2
      src/views/tentative/material/modules/testSample/flow.vue

+ 17 - 2
src/views/tentative/material/modules/testSample/flow.vue

@@ -14,7 +14,7 @@
             </div>
         </template>
         <template #extra>
-            <el-button type="primary">手动入库</el-button>
+            <el-button type="primary" :disabled="tableCheckedKeys.length <= 0" @click="manualStorageClick">手动入库</el-button>
         </template>
         <hc-table
             :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }"
@@ -30,7 +30,7 @@
 import { onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { getErtractInfo } from '~api/other'
-import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
+import { arrToId, getArrValue, getObjValue, isNullES } from 'js-fast-way'
 import mainApi from '~api/tentative/material/testSample'
 
 //参数
@@ -151,4 +151,19 @@ const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
+
+//手动入库
+const manualStorageClick = async () => {
+    const rows = tableCheckedKeys.value
+    //判断是否满足条件
+    const result = rows.every(({ rfId }) => {
+        return !isNullES(rfId)
+    })
+    if (!result) {
+        window.$message?.warning('存在材料未使用RFID,无法手动入库')
+        return
+    }
+    const ids = arrToId(rows)
+    console.log(ids)
+}
 </script>