Bladeren bron

fix: 修改文件名大小写

huangyan 1 maand geleden
bovenliggende
commit
ba94ce826e

File diff suppressed because it is too large
+ 798 - 32
package-lock.json


+ 2 - 2
package.json

@@ -17,7 +17,7 @@
     "dayjs": "^1.11.7",
     "echarts": "^5.4.3",
     "el-table-infinite-scroll": "^3.0.1",
-    "element-plus": "^2.3.4",
+    "element-plus": "^2.9.4",
     "js-md5": "^0.7.3",
     "nprogress": "^0.2.0",
     "pinia": "^2.0.33",
@@ -42,7 +42,7 @@
     "eslint-plugin-vue": "^9.9.0",
     "prettier": "^2.8.4",
     "rollup-plugin-visualizer": "^5.9.0",
-    "sass": "^1.59.3",
+    "sass": "^1.84.0",
     "typescript": "^4.9.3",
     "unplugin-auto-import": "^0.15.1",
     "unplugin-vue-components": "^0.24.1",

+ 1 - 5
src/App.vue

@@ -1,14 +1,10 @@
 <script setup lang="ts">
 import { ElConfigProvider } from 'element-plus'
-import zh from 'element-plus/lib/locale/lang/zh-cn'
-
+import zh from 'element-plus/es/locale/lang/zh-cn';
 import { provide } from "vue";
 import * as echarts from 'echarts'
 provide('echarts ',echarts )
 
-
-
-
 </script>
 
 <template>

+ 1 - 1
src/api/apiMapList.ts

@@ -1 +1 @@
-export const mapList = ["/salary/Reimburse/Add","/salary/Reimburse/Edit"]
+export const mapList = ["/salary/Reimburse/Add","/salary/Reimburse/Edit","/storage/vaildationTool/add","/storage/vaildationTool/update"]

+ 6 - 1
src/api/storehouse/index.ts

@@ -116,6 +116,12 @@ export const Storehouse_Contract_Out_List = (params: any) => $http.post('/storag
  */
 // 设备列表
 export const Storehouse_Device_List = (params: any) => $http.post('/storage/Device/List', params)
+export const validation_List = (params: any) => $http.post('/storage/vaildationTool/list', params)
+export const validation_add = (params: any) => $http.post('/storage/vaildationTool/add', params,{headers: {'Content-Type': 'application/json'}})  //借出验证工具
+export const validation_del = (params: any) => $http.post('/storage/vaildationTool/del', params,)
+export const validation_update = (params: any) => $http.post('/storage/vaildationTool/update', params,)  //借出验证工具
+export const readvaildation = (params: any) => $http.post('/storage/vaildationTool/readvaildation', params,)
+export const updatevaildation = (params: any) => $http.post('/storage/vaildationTool/updatevaildation', params,)
 
 /**
  * 入库
@@ -199,4 +205,3 @@ export const Storehouse_VerifyContract_Del = (params: any) => $http.post('/stora
 export const Storehouse_VerifyContract_Recover_List = (params: any) =>
   $http.post('/storage/RecoveriesContract/List', params)
 
-  

+ 1 - 0
src/components/Drawer/index.vue

@@ -9,6 +9,7 @@ interface drawerProps {
   size?: string
   handleClose?: (params: Fn) => void
   openDrawer?: (params: Fn) => void
+	openValidation?: (params: Fn) => void
   direction?: string
 }
 

+ 7 - 9
src/components/upImg/upimg.vue

@@ -48,7 +48,9 @@ const uploadData = {
 }
 const globalStore = GlobalStore()
 const showModel = ref(false)
-const emits = defineEmits()
+const emits = defineEmits<{
+  (e: 'update:upImg', value: string): void
+}>()
 const files = ref()
 const dialogVisible = ref(false)
 const changesFun = async (e: any) => {
@@ -70,23 +72,19 @@ const clickToken = async () => {
 
 }
 
-//函数
 const QiniuYun = async () => {
-    var config = {
+    const config = {
         useCdnDomain: false, //表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
         region: qiniu.region.z2,
         domain: "https://up-z2.qiniup.com", //配置好的七牛云域名  如   https://cdn.qniyun.com/
         chunkSize: 1000, //每个分片的大小,单位mb,默认值3
-        forceDirect: false //直传还是断点续传方式,true为直传
     };
-    var putExtra: any = {
+    const putExtra: any = {
         fname: files.value.name, //文件原始文件名
         params: {},
-        mimeType: [] || null
     };
-    var observable = qiniu.upload(files.value, uploadData.key, uploadData.token, putExtra, config);
-    //   设置实例的监听对象
-    var observer = {
+    const observable = qiniu.upload(files.value, uploadData.key, uploadData.token, putExtra, config);
+    const observer = {
         next(res: any) {
             console.log('实例监听对象', res)
         },

+ 1 - 1
src/styles/index.scss

@@ -1,6 +1,6 @@
 @use 'element-plus/theme-chalk/src/dark/css-vars.scss' as *;
 
-@import './element/dark.scss';
+@use './element/dark.scss';
 
 $--color-primary: #0078d7;
 $--color-success: #107c10;

+ 56 - 27
src/views/Login.vue

@@ -34,36 +34,65 @@ const rules = reactive<FormRules>({
 const submitForm = (formEl: FormInstance | undefined) => {
   if (!formEl) return
   console.log('验证')
-  formEl.validate(async valid => {
-    if (valid) {
-      try {
-        loading.value = true
-        const res: any = await Login_verification({
-          bzd_username: ruleForm.username,
-          bzd_password: fnMd5(ruleForm.password)
-        })
+  // formEl.validate(async valid => {
+  //   if (valid) {
+  //     try {
+  //       loading.value = true
+  //       const res: any = await Login_verification({
+  //         bzd_username: ruleForm.username,
+  //         bzd_password: fnMd5(ruleForm.password)
+  //       })
 
-        if (res.Code === 200) {
-          sessionStorage.setItem('User_tokey', res.Data)
-          globalStore.SET_User_Tokey(res.Data)
-          router.replace('/')
-          ElNotification.success({
-            title: '登录成功',
-            message: '欢迎进入宝智达ERP系统!',
-            position: 'bottom-right'
+  //       if (res.Code === 200) {
+  //         sessionStorage.setItem('User_tokey', res.Data)
+  //         globalStore.SET_User_Tokey(res.Data)
+  //         router.replace('/')
+  //         ElNotification.success({
+  //           title: '登录成功',
+  //           message: '欢迎进入宝智达ERP系统!',
+  //           position: 'bottom-right'
+  //         })
+  //         setTimeout(() => {
+  //           loading.value = false
+  //         }, 1000)
+  //       }
+  //     } catch (error: any) {
+  //       // if (error.Code === 202) {
+  //       //   loading.value = false
+  //       // }
+  //       loading.value = false
+  //     }
+  //   } else {
+  //     return false
+  //   }
+  // })
+    formEl.validate(valid => {
+    if (valid) {
+      (async () => {
+        try {
+          loading.value = true
+          const res: any = await Login_verification({
+            bzd_username: ruleForm.username,
+            bzd_password: fnMd5(ruleForm.password)
           })
-          setTimeout(() => {
-            loading.value = false
-          }, 1000)
+  
+          if (res.Code === 200) {
+            sessionStorage.setItem('User_tokey', res.Data)
+            globalStore.SET_User_Tokey(res.Data)
+            router.replace('/')
+            ElNotification.success({
+              title: '登录成功',
+              message: '欢迎进入宝智达ERP系统!',
+              position: 'bottom-right'
+            })
+            setTimeout(() => {
+              loading.value = false
+            }, 1000)
+          }
+        } catch (error: any) {
+          loading.value = false
         }
-      } catch (error: any) {
-        // if (error.Code === 202) {
-        //   loading.value = false
-        // }
-        loading.value = false
-      }
-    } else {
-      return false
+      })()
     }
   })
 }

+ 0 - 2
src/views/account/roles/Roles.vue

@@ -163,8 +163,6 @@ const AddUserName = (formEl: FormInstance | undefined) => {
           isNew.value = true
         })
       }
-    } else {
-      return false
     }
   })
 }

+ 1 - 1
src/views/account/users/components/DrawerFrom.vue

@@ -113,7 +113,7 @@ const AddUser = (formEl: FormInstance | undefined) => {
         })
       }
     } else {
-      return false
+      return
     }
   })
 }

+ 6 - 2
src/views/home/User.vue

@@ -58,7 +58,11 @@ const validatePass = (rule: any, value: any, callback: any) => {
   } else {
     if (ruleForm.checkPass !== '') {
       if (!ruleFormRef.value) return
-      ruleFormRef.value.validateField('checkPass', () => null)
+      ruleFormRef.value.validateField('checkPass', (errorMessage) => {
+        if (errorMessage) {
+          console.error(errorMessage);
+        }
+      })
     }
     callback()
   }
@@ -89,7 +93,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
         logOut()
       }
     } else {
-      return false
+      return
     }
   })
 }

+ 2 - 2
src/views/project/ProjectDetail.vue

@@ -50,7 +50,7 @@ const deleteProjectDetail = (id: string) => {
 }
 const addProjectDetail = (formEl: FormInstance | undefined) => {
   if (!formEl) return
-  formEl.validate(async valid => {
+  formEl.validate(valid => {
     if (valid) {
       if (isNew.value) {
         tableData.value.push({ ...form.value, id: generateRandom() })
@@ -64,7 +64,7 @@ const addProjectDetail = (formEl: FormInstance | undefined) => {
         drawerRef.value?.closeDrawer()
         resetForm(ruleFormRef.value)
       })
-    } else return false
+    }
   })
 }
 const emit = defineEmits<{ (event: 'onPlanning', value: any): void }>()

+ 1 - 1
src/views/project/ProjectForm.vue

@@ -73,7 +73,7 @@ const addProject = (formEl: FormInstance | undefined) => {
           resetForm(ruleFormRef.value)
         })
       }
-    } else return false
+    }
   })
 }
 

+ 2 - 3
src/views/salary/ReimburseMy.vue

@@ -173,11 +173,11 @@ import {
 } from '@/api/ReimburseMy/index'
 import { computed, reactive, ref,watch } from "vue";
 import { ElMessage, ElMessageBox } from 'element-plus'
+import { GlobalStore } from '@/stores/index'
+import upImg from '@/components/upImg/upimg.vue'
 const dialogImageUrl = ref('')
 const dialogVisible = ref(false)
-import { GlobalStore } from '@/stores/index'
 
-import upImg from '@/components/upImg/upimg.vue'
 
 // import dataList from '@/plugins/reimbursemyData.js'
 
@@ -477,7 +477,6 @@ const newAdd = () => {
 }
 //删除任务
 const newDel = (e: any) => {
-
     data.fromData.ReimburseDetails.splice(e.$index, 1)
     console.log('e', data.fromData.ReimburseDetails)
 }

+ 50 - 23
src/views/salary/salary/SalaryFrom.vue

@@ -32,30 +32,57 @@ const resetForm = (formEl: FormInstance | undefined) => {
   formEl.resetFields()
 }
 const formLabelWidth = ref('10rem')
-const submitSalary = (formEl: FormInstance | undefined) => {
-  if (!formEl) return
-  if (!props.T_uuid) {
-    ElMessage.warning('请选择员工!!!')
-    return
-  }
-  formEl.validate(async valid => {
-    if (valid) {
-      const T_date = props.year + '-' + props.month
-      const res: any = await Salary_Post({ ...form.value, T_uuid: props.T_uuid, T_date })
-      if (res.Code === 200) {
-        ElNotification({
-          title: '提交成功',
-          message: '薪资已添加!!!',
-          type: 'success'
-        })
-        resetForm(formRef.value)
-      }
-    } else {
-      return false
+// const submitSalary = (formEl: FormInstance | undefined) => {
+//   if (!formEl) return
+//   if (!props.T_uuid) {
+//     ElMessage.warning('请选择员工!!!')
+//     return
+//   }
+//   formEl.validate(async valid => {
+//     if (valid) {
+//       const T_date = props.year + '-' + props.month
+//       const res: any = await Salary_Post({ ...form.value, T_uuid: props.T_uuid, T_date })
+//       if (res.Code === 200) {
+//         ElNotification({
+//           title: '提交成功',
+//           message: '薪资已添加!!!',
+//           type: 'success'
+//         })
+//         resetForm(formRef.value)
+//       }
+//     } else {
+//       return false
+//     }
+//   })
+// }
+  const submitSalary = (formEl: FormInstance | undefined) => {
+    if (!formEl || !props.T_uuid) {
+      !props.T_uuid && ElMessage.warning('请选择员工!!!')
+      return
     }
-  })
-}
-
+  
+    formEl.validate((valid) => {  // 移除 async 声明
+      if (valid) {
+        const handleSubmit = async () => {  // 内部声明异步函数
+          const T_date = `${props.year}-${props.month}`
+          const res: any = await Salary_Post({ 
+            ...form.value, 
+            T_uuid: props.T_uuid, 
+            T_date 
+          })
+          
+          if (res.Code === 200) {
+            ElNotification.success({
+              title: '提交成功',
+              message: '薪资已添加!!!'
+            })
+            resetForm(formRef.value)
+          }
+        }
+        handleSubmit()
+      }
+    })
+  }
 const DataEcho = (data: any) => {
   form.value = { ...data }
 }

+ 59 - 28
src/views/storehouse/Classify.vue

@@ -53,36 +53,67 @@ const openDrawer = (type: string, row?: any) => {
   drawerRef.value?.openDrawer()
 }
 
-const AddUserName = (formEl: FormInstance | undefined) => {
-  if (!formEl) return
-  formEl.validate(async valid => {
-    if (valid) {
-      let res: any = {}
-      if (isNew.value) {
-        res = await Storehouse_ProductClass_Add({ User_tokey: globalStore.GET_User_tokey, T_name: form.name })
-      } else {
-        res = await Storehouse_ProductClass_Edit({
-          User_tokey: globalStore.GET_User_tokey,
-          T_name: form.name,
-          T_id: form.id
-        })
-      }
-      if (res.Code === 200) {
-        ElMessage.success('产品分类添加成功!!')
-        nextTick(() => {
-          updateOnTableList(TableRef.value)
-          resetForm(ruleFormRef.value)
-          isNew.value = true
-          drawerRef.value?.closeDrawer()
-        })
-      }
-    } else {
-      return false
-    }
-  })
-}
+// const AddUserName = (formEl: FormInstance | undefined) => {
+//   if (!formEl) return
+//   formEl.validate(async valid => {
+//     if (valid) {
+//       let res: any = {}
+//       if (isNew.value) {
+//         res = await Storehouse_ProductClass_Add({ User_tokey: globalStore.GET_User_tokey, T_name: form.name })
+//       } else {
+//         res = await Storehouse_ProductClass_Edit({
+//           User_tokey: globalStore.GET_User_tokey,
+//           T_name: form.name,
+//           T_id: form.id
+//         })
+//       }
+//       if (res.Code === 200) {
+//         ElMessage.success('产品分类添加成功!!')
+//         nextTick(() => {
+//           updateOnTableList(TableRef.value)
+//           resetForm(ruleFormRef.value)
+//           isNew.value = true
+//           drawerRef.value?.closeDrawer()
+//         })
+//       }
+//     } else {
+//       return false
+//     }
+//   })
+// }
 
 // 删除
+  const AddUserName = (formEl: FormInstance | undefined) => {
+    if (!formEl) return
+    formEl.validate((valid) => {
+      if (!valid) return
+      ;(async () => {
+        try {
+          let res: any = {}
+          if (isNew.value) {
+            res = await Storehouse_ProductClass_Add({ 
+              User_tokey: globalStore.GET_User_tokey, 
+              T_name: form.name 
+            })
+          } else {
+            res = await Storehouse_ProductClass_Edit({
+              User_tokey: globalStore.GET_User_tokey,
+              T_name: form.name,
+              T_id: form.id
+            })
+          }
+          if (res.Code === 200) {
+            ElMessage.success(`产品分类${isNew.value ? '添加' : '修改'}成功!`)
+            updateOnTableList(TableRef.value)
+            resetForm(ruleFormRef.value)
+            drawerRef.value?.closeDrawer()
+          }
+        } catch (error) {
+          console.error('操作失败:', error)
+        }
+      })()
+    })
+  }
 const UserDelete = (row: any) => {
   ElMessageBox.confirm('您确定要删除产品分类吗?', '警告', {
     confirmButtonText: '确定',

+ 23 - 23
src/views/storehouse/IoTNetworkCard.vue

@@ -77,30 +77,30 @@ const resetForm = (formEl: FormInstance | undefined) => {
 
 const AddUserName = (formEl: FormInstance | undefined) => {
   if (!formEl) return
-  formEl.validate(async valid => {
-    if (valid) {
-      let res: any = {}
-      if (isNew.value) {
-        res = await Storehouse_IotCard_Add({ User_tokey: globalStore.GET_User_tokey, ...form })
-      } else {
-        res = await Storehouse_IotCard_Edit({
-          User_tokey: globalStore.GET_User_tokey,
-          ...form
-        })
+  formEl.validate((valid: boolean) => {
+      if (valid) {
+        (async () => {
+          let res: any = {}
+          if (isNew.value) {
+            res = await Storehouse_IotCard_Add({ User_tokey: globalStore.GET_User_tokey, ...form })
+          } else {
+            res = await Storehouse_IotCard_Edit({
+              User_tokey: globalStore.GET_User_tokey,
+              ...form
+            })
+          }
+          if (res.Code === 200) {
+            ElMessage.success(`${isNew.value ? '添加' : '修改'}物联网卡成功!!`)
+            nextTick(() => {
+              drawerRef.value?.closeDrawer()
+              TableRef.value?.getTableList()
+              resetForm(ruleFormRef.value)
+              isNew.value = true
+            })
+          }
+        })()
       }
-      if (res.Code === 200) {
-        ElMessage.success(`${isNew.value ? '添加' : '修改'}物联网卡成功!!`)
-        nextTick(() => {
-          drawerRef.value?.closeDrawer()
-          TableRef.value?.getTableList()
-          resetForm(ruleFormRef.value)
-          isNew.value = true
-        })
-      }
-    } else {
-      return false
-    }
-  })
+    })
 }
 
 // 删除

+ 48 - 22
src/views/storehouse/List.vue

@@ -46,30 +46,56 @@ const openDrawer = (type: string, row?: any) => {
   })
   drawerRef.value?.openDrawer()
 }
-const AddUserName = (formEl: FormInstance | undefined) => {
-  if (!formEl) return
-  formEl.validate(async valid => {
-    if (valid) {
-      let res: any = {}
-      if (isNew.value) {
-        res = await Storehouse_Depot_Add({ User_tokey: globalStore.GET_User_tokey, T_name: form.name })
-      } else {
-        res = await Storehouse_Depot_Edit({ User_tokey: globalStore.GET_User_tokey, T_name: form.name, T_id: form.id })
-      }
-      if (res.Code === 200) {
-        ElMessage.success('添加仓库名称成功!!')
-        nextTick(() => {
-          drawerRef.value?.closeDrawer()
-          updateOnTableList(TableRef.value)
-          resetForm(ruleFormRef.value)
-          isNew.value = true
+// const AddUserName = (formEl: FormInstance | undefined) => {
+//   if (!formEl) return
+//   formEl.validate(async valid => {
+//     if (valid) {
+//       let res: any = {}
+//       if (isNew.value) {
+//         res = await Storehouse_Depot_Add({ User_tokey: globalStore.GET_User_tokey, T_name: form.name })
+//       } else {
+//         res = await Storehouse_Depot_Edit({ User_tokey: globalStore.GET_User_tokey, T_name: form.name, T_id: form.id })
+//       }
+//       if (res.Code === 200) {
+//         ElMessage.success('添加仓库名称成功!!')
+//         nextTick(() => {
+//           drawerRef.value?.closeDrawer()
+//           updateOnTableList(TableRef.value)
+//           resetForm(ruleFormRef.value)
+//           isNew.value = true
+//         })
+//       }
+//     } else {
+//       return false
+//     }
+//   })
+// }
+    const AddUserName = (formEl: FormInstance | undefined) => {
+      if (!formEl) return
+      formEl.validate((valid) => {
+        if (!valid) return // 此处直接返回,不返回boolean
+        
+        const apiParams = isNew.value
+          ? { User_tokey: globalStore.GET_User_tokey, T_name: form.name }
+          : { User_tokey: globalStore.GET_User_tokey, T_name: form.name, T_id: form.id }
+          
+        const request = isNew.value 
+          ? Storehouse_Depot_Add(apiParams)
+          : Storehouse_Depot_Edit(apiParams)
+    
+        request.then(res => {
+          if (res.Code === '200') {
+            ElMessage.success(`${isNew.value ? '添加' : '修改'}成功!`)
+            drawerRef.value?.closeDrawer()
+            updateOnTableList(TableRef.value)
+            resetForm(ruleFormRef.value)
+            isNew.value = true
+          }
+        }).catch(err => {
+          console.error('操作失败:', err)
         })
-      }
-    } else {
-      return false
+      })
     }
-  })
-}
 const UserDelete = (row: any) => {
   ElMessageBox.confirm('您确定要删除该仓库吗?', '警告', {
     confirmButtonText: '确定',

+ 0 - 2
src/views/storehouse/ProductionList.vue

@@ -92,8 +92,6 @@ const AddProduction = (formEl: FormInstance | undefined) => {
           isNew.value = true
         })
       }
-    } else {
-      return false
     }
   })
 }

+ 0 - 11
src/views/storehouse/ValidationTool/invalidationfrom.vue

@@ -1,11 +0,0 @@
-<script setup lang="ts">
-
-</script>
-
-<template>
-  $END$
-</template>
-
-<style scoped lang="scss">
-
-</style>

+ 511 - 2
src/views/storehouse/ValidationTool/validation.vue

@@ -1,11 +1,520 @@
 <script setup lang="ts">
+import {validation_add, validation_del, validation_List,readvaildation,updatevaildation,validation_update } from '@/api/storehouse'
+import TableBase from '@/components/TableBase/index.vue'
+import { computed, reactive, ref } from 'vue'
+import { GlobalStore } from '@/stores'
+import type { ColumnProps } from '@/components/TableBase/interface'
+import { Delete, Edit } from '@element-plus/icons-vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import type { FormInstance } from 'element-plus'
+// import { pa } from 'element-plus/es/locale'
 
-</script>
+const globalStore = GlobalStore()
+const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
 
-<template>
+const initParam = reactive({
+  User_tokey: globalStore.GET_User_tokey,
+  Validationnumber: '',
+  T_state: '',
+  T_sn: '',
+  T_imei: '',
+  T_iccid: '',
+  LendUser:'',
+  T_project: '',
+})
+const columns: ColumnProps[] = [
+  { type: 'index', label: '序号', width: 80 },
+  { prop: 'Validationnumber', label: '设备编号', ellipsis: true },
+  { prop: 'T_sn', label: '设备SN', ellipsis: true },
+  { prop: 'T_sn', label: '设备SN', ellipsis: true },
+  { prop: 'T_imei', label: '模组imei', ellipsis: true },
+  { prop: 'T_iccid', label: '物联网卡号', ellipsis: true },
+  { prop: 'T_state', label: '状态', name: 'T_state'  },
+  { prop: 'LendUser', label: '借出人', ellipsis: true },
+  { prop: 'T_project', label: '借出项目', ellipsis: true },
+  { prop: 'T_remark', label: '备注', name: 'T_remark', ellipsis: true },
+  { prop: 'operation', label: '操作', width: 260, fixed: 'right' }
+]
+// 搜索
+const options = reactive([
+  { name: '已出库', id: 1 },
+  { name: '未出库', id: 2 },
+  { name: '已损坏', id: 3 }
+])
+const searchHandle = () => {
+  TableRef.value?.searchTable()
+}
+/**
+ * 删除
+ */
+const deleteFun = (row: any) => {
+  ElMessageBox.confirm('删除操作,是否立即删除?', '删除', {
+    confirmButtonText: '立即删除',
+    cancelButtonText: '取消',
+    type: 'warning',
+    center: true
+  })
+    .then(async () => {
+      const result: any = await validation_del({ t_sn: row })
+      if (result.Code == 200) {
+        ElMessage.success('删除成功')
+        TableRef.value?.searchTable()
+      }
+    })
+	  // eslint-disable-next-line @typescript-eslint/no-empty-function
+    .catch(() => {})
+}
+
+const showInStorageForm = ref(false)
+
+const inStorageFormRef = ref<FormInstance | null>(null)
+const inStorageForm = reactive({
+  T_sn: '',
+  Validationnumber: '',
+  T_remark: ''
+})
+interface InStorageItem {
+  T_sn: string;
+  Validationnumber: string;
+  T_remark: string;
+}
+
+const pendingItems = ref<InStorageItem[]>([])
+const pageSize = ref(8)
+const currentPage = ref(1)
+
+const paginatedPendingItems = computed(() => {
+  const start = (currentPage.value - 1) * pageSize.value
+  const end = start + pageSize.value
+  return pendingItems.value.slice(start, end)
+})
+const rules = reactive({
+  T_sn: [{ required: true, message: '请输入SN', trigger: 'blur' }],
+  Validationnumber: [{ required: true, message: '请输入设备编号', trigger: 'blur' }]
+})
+
+const extractSN = (fullSN: string): string => {
+  if (fullSN.length === 24 && fullSN.startsWith('03') && fullSN.endsWith('000001')) {
+    return fullSN.substring(2, 18)
+  }
+  return fullSN
+}
+
+const submitInStorageForm = () => {
+  inStorageFormRef.value?.validate((valid: boolean) => {
+    if (valid) {
+      const extractedSN = extractSN(inStorageForm.T_sn)
+      if (pendingItems.value.some((item: any) => item.T_sn === extractedSN)) {
+        ElMessage.warning('已存在相同的SN,不能添加')
+        return
+      }
+      pendingItems.value.push({ ...inStorageForm, T_sn: extractedSN })
+      inStorageForm.T_sn = ''
+      inStorageForm.Validationnumber = ''
+      inStorageForm.T_remark = ''
+      ElMessage.success('已添加到待提交列表')
+    }
+  })
+}
+
+const removePendingItem = (index: number) => {
+  pendingItems.value.splice(index, 1)
+  ElMessage.success('已从待提交列表中移除')
+}
+
+const submitInStoragePendingItems = async () => {
+  if (pendingItems.value.length === 0) {
+    ElMessage.warning('暂无数据可提交');
+    return;
+  }
+
+  const rest=JSON.parse(JSON.stringify(pendingItems.value));
+  console.log("待提交的数据:", rest);
+  try {
+    const result:any = await validation_add(rest);
+    if (result.Code === 200) {
+      ElMessage.success('提交成功');
+      pendingItems.value = [];
+      inStorageForm.T_sn = '';
+      inStorageForm.Validationnumber = '';
+      inStorageForm.T_remark = '';
+      searchHandle();
+    } else {
+      ElMessage.error('提交失败');
+    }
+  } catch (error) {
+    ElMessage.error('提交失败,请检查网络连接');
+  }
+};
+const handlePageChange = (page: number) => {
+  currentPage.value = page
+}
+
+const showLendForm = ref(false)
+const lendFormRef = ref<FormInstance | null>(null)
+const lendForm = reactive({
+  T_sn: '',
+  Validationnumber: '',
+  T_remark: '',
+  LendUser: '',
+  T_project: ''
+})
+interface LendItem {
+  T_sn: string;
+  Validationnumber: string;
+  T_remark: string;
+  LendUser: string;
+  T_project: string;
+}
+
+const pendingLendItems = ref<LendItem[]>([])
+const lendPageSize = ref(8)
+const lendCurrentPage = ref(1)
 
+const paginatedPendingLendItems = computed(() => {
+  const start = (lendCurrentPage.value - 1) * lendPageSize.value
+  const end = start + lendPageSize.value
+  return pendingLendItems.value.slice(start, end)
+})
+
+const lendRules = reactive({
+  T_sn: [{ required: true, message: '请输入SN', trigger: 'blur' }],
+  Validationnumber: [{ required: true, message: '请输入设备编号', trigger: 'blur' }],
+  LendUser: [{ required: true, message: '请输入借出人', trigger: 'blur' }],
+  T_project: [{ required: true, message: '请输入借出项目', trigger: 'blur' }]
+})
+
+const submitLendForm = () => {
+  lendFormRef.value?.validate((valid: boolean): void => {
+    if (valid) {
+      const extractedSN = extractSN(lendForm.T_sn)
+      if (pendingLendItems.value.some((item: any) => item.T_sn === extractedSN)) {
+        ElMessage.warning('已存在相同的SN,不能添加')
+        return
+      }
+      pendingLendItems.value.push({
+        T_sn: extractedSN,
+        Validationnumber: lendForm.Validationnumber,
+        T_remark: lendForm.T_remark,
+        LendUser: lendForm.LendUser,
+        T_project: lendForm.T_project
+      })
+      lendForm.T_sn = ''
+      lendForm.Validationnumber = ''
+      lendForm.T_remark = ''
+      lendForm.LendUser = ''
+      lendForm.T_project = ''
+      ElMessage.success('已添加到待提交列表')
+    } else {
+    }
+  })
+}
+
+const removePendingLendItem = (index: number) => {
+  pendingLendItems.value.splice(index, 1)
+  ElMessage.success('已从待提交列表中移除')
+}
+
+const submitLendPendingItems = async () => {
+  if (pendingLendItems.value.length === 0) {
+    ElMessage.warning('暂无数据可提交')
+    return
+  }
+  // 封装成数组对象以 JSON 的方式提交
+  // const requestData = JSON.stringify(pendingLendItems.value)
+  // 假设有一个API用于提交待借出的数据
+  // console.log(requestData)
+  const rest=JSON.parse(JSON.stringify(pendingLendItems.value));
+
+  const result:any = await validation_update(rest)
+  if (result.Code == 200) {
+    ElMessage.success('提交成功')
+    pendingLendItems.value = []
+    lendForm.T_sn = ''
+    lendForm.T_remark = ''
+    lendForm.LendUser = ''
+    lendForm.T_project = ''
+    searchHandle()
+  } else {
+    ElMessage.error('提交失败')
+  }
+}
+
+const handleLendPageChange = (page: number) => {
+  lendCurrentPage.value = page
+}
+
+const showEditForm = ref(false)
+const editFormRef = ref<FormInstance | null>(null)
+const editForm = reactive({
+  T_sn: '',
+  Validationnumber: '',
+  T_remark: '',
+	T_state:'',
+})
+
+const previewEdit = async (row: any) => {
+  showEditForm.value = true
+  const result: any = await readvaildation({ sn: row.T_sn })
+  if (result.Code === 200) {
+    Object.assign(editForm, result.Data)
+  } else {
+    ElMessage.error('获取数据失败')
+  }
+}
+
+const submitEditForm = () => {
+  editFormRef.value?.validate(async (valid: boolean): Promise<void> => {
+    if (valid) {
+		console.log("editForm",editForm)
+      const result:any = await updatevaildation(editForm)
+      if (result.Code === 200) {
+        ElMessage.success('编辑成功')
+        showEditForm.value = false
+        searchHandle()
+      } else {
+        ElMessage.error('编辑失败')
+      }
+    } else {
+      // do nothing
+    }
+  })
+}
+
+</script>
+<template>
+  <div class="list">
+  <TableBase ref="TableRef" :columns="columns" :requestApi="validation_List" :initParam="initParam" :pagination="true">
+    <template #table-header>
+      <div class="input-suffix">
+        <el-row :gutter="20" style="margin-bottom: 0">
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">设备编号:</span>
+            <el-input
+              v-model="initParam.Validationnumber"
+              class="w-50 m-2"
+              type="text"
+              placeholder="设备编号搜索"
+              clearable
+              @change="searchHandle"
+            />
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">状态:</span>
+            <el-select v-model="initParam.T_state" class="w-50 m-2" clearable placeholder="请选择状态~">
+              <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">SN:</span>
+            <el-input
+              class="w-50 m-2"
+              v-model="initParam.T_sn"
+              type="text"
+              placeholder="按SN搜索"
+              clearable
+              @change="searchHandle"
+            />
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">模组imei:</span>
+            <el-input
+              class="w-50 m-2"
+              v-model="initParam.T_imei"
+              type="text"
+              placeholder="按模组imei搜索"
+              clearable
+              @change="searchHandle"
+            />
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">借出人</span>
+            <el-input
+              class="w-50 m-2"
+              v-model="initParam.LendUser"
+              type="text"
+              placeholder="按借出人搜索"
+              clearable
+              @change="searchHandle"
+            />
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">借出项目</span>
+            <el-input
+              class="w-50 m-2"
+              v-model="initParam.T_project"
+              type="text"
+              placeholder="按借出项目搜索"
+              clearable
+              @change="searchHandle"
+            />
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6">
+            <span class="inline-flex items-center">物联网卡号:</span>
+            <el-input
+              class="w-50 m-2"
+              v-model="initParam.T_iccid"
+              type="text"
+              placeholder="按物联网卡号搜索"
+              clearable
+              @change="searchHandle"
+            />   
+          </el-col>
+          <el-col :xl="6" :lg="6" :md="6" style="margin-top: auto;">
+            <el-button type="primary" @click="searchHandle">搜索</el-button>
+            <el-button type="primary" @click="showInStorageForm = true">入库</el-button>
+            <el-button type="primary" @click="showLendForm = true">借出</el-button>
+          </el-col>
+        </el-row>
+      </div>
+    </template>
+    <template #T_state="{ row }">
+      <el-tag v-if="row.T_state == 1" type="success" effect="dark"> 已出库</el-tag>
+      <el-tag v-if="row.T_state == 2" effect="dark">未出库</el-tag>
+      <el-tag v-if="row.T_state == 3" effect="dark" type="danger">已损坏</el-tag>
+    </template>
+    <template #right="{ row }">
+      <el-button link type="success" size="small" :icon="Edit" @click="previewEdit(row)">编辑</el-button>
+      <el-button link type="danger" size="small" :icon="Delete" @click="deleteFun(row.T_sn)">删除</el-button>
+    </template>
+  </TableBase>
+</div>
+  <!-- <InStorageForm ref="InStorageFormRef" :options="options" @onUpdateList="searchHandle" /> -->
+  <!-- <InStorageEdit ref="InStorageRef" :options="options" @onUpdateList="searchHandle" /> -->
+  <!-- 新增入库表单 -->
+  <el-dialog title="入库" v-model="showInStorageForm" width="50%">
+    <el-form :model="inStorageForm" :rules="rules" ref="inStorageFormRef">
+      <el-form-item label="SN" prop="T_sn">
+        <el-input v-model="inStorageForm.T_sn" placeholder="请输入SN"></el-input>
+      </el-form-item>
+      <el-form-item label="设备编号" prop="Validationnumber">
+        <el-input v-model="inStorageForm.Validationnumber" placeholder="请输入设备编号"></el-input>
+      </el-form-item>
+      <el-form-item label="备注">
+        <el-input v-model="inStorageForm.T_remark" type="textarea" placeholder="请输入备注"></el-input>
+      </el-form-item>
+    </el-form>
+    <!-- 新增数据条数提示 -->
+    <div style="margin: 10px 0">
+      <span>当前待提交数据条数: {{ pendingItems.length }}</span>
+    </div>
+    <el-table :data="paginatedPendingItems" style="width: 100%; margin-top: 20px">
+      <el-table-column type="index" label="序号" width="80"></el-table-column>
+      <!-- 添加序号列 -->
+      <el-table-column prop="T_sn" label="SN"></el-table-column>
+      <el-table-column prop="Validationnumber" label="设备编号"></el-table-column>
+      <el-table-column prop="T_remark" label="备注"></el-table-column>
+      <el-table-column label="操作" width="180">
+        <template #default="scope">
+          <el-button type="danger" size="small" @click="removePendingItem(scope.$index)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      background
+      layout="prev, pager, next"
+      :total="pendingItems.length"
+      :page-size="pageSize"
+      :current-page="currentPage"
+      @current-change="handlePageChange"
+      style="margin-top: 20px; text-align: right"
+    />
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="showInStorageForm = false">取消</el-button>
+        <el-button type="primary" @click="submitInStorageForm">添加到暂存</el-button>
+        <!-- 新增提交按钮 -->
+        <el-button type="primary" @click="submitInStoragePendingItems">提交</el-button>
+      </span>
+    </template>
+  </el-dialog>
+  <!-- 新增借出表单 -->
+  <el-dialog title="借出" v-model="showLendForm" width="50%">
+    <el-form :model="lendForm" :rules="lendRules" ref="lendFormRef">
+      <el-form-item label="SN" prop="T_sn">
+        <el-input v-model="lendForm.T_sn" placeholder="请输入SN"></el-input>
+      </el-form-item>
+      <el-form-item label="备注">
+        <el-input v-model="lendForm.T_remark" type="textarea" placeholder="请输入备注"></el-input>
+      </el-form-item>
+      <!-- 新增借出人和借出项目 -->
+      <el-form-item label="借出人" prop="borrower">
+        <el-input v-model="lendForm.LendUser" placeholder="请输入借出人"></el-input>
+      </el-form-item>
+      <el-form-item label="借出项目" prop="project">
+        <el-input v-model="lendForm.T_project" placeholder="请输入借出项目"></el-input>
+      </el-form-item>
+    </el-form>
+    <!-- 新增数据条数提示 -->
+    <div style="margin: 10px 0">
+      <span>当前待提交数据条数: {{ pendingLendItems.length }}</span>
+    </div>
+    <el-table :data="paginatedPendingLendItems" style="width: 100%; margin-top: 20px">
+      <el-table-column type="index" label="序号" width="80"></el-table-column>
+      <!-- 添加序号列 -->
+      <el-table-column prop="T_sn" label="SN"></el-table-column>
+      <el-table-column prop="Validationnumber" label="设备编号"></el-table-column>
+      <el-table-column prop="T_remark" label="备注"></el-table-column>
+      <el-table-column label="操作" width="180">
+        <template #default="scope">
+          <el-button type="danger" size="small" @click="removePendingLendItem(scope.$index)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      background
+      layout="prev, pager, next"
+      :total="pendingLendItems.length"
+      :page-size="lendPageSize"
+      :current-page="lendCurrentPage"
+      @current-change="handleLendPageChange"
+      style="margin-top: 20px; text-align: right"
+    />
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="showLendForm = false">取消</el-button>
+        <el-button type="primary" @click="submitLendForm">添加到暂存</el-button>
+        <!-- 新增提交按钮 -->
+        <el-button type="primary" @click="submitLendPendingItems">提交</el-button>
+      </span>
+    </template>
+  </el-dialog>
+  <el-dialog title="编辑" v-model="showEditForm" width="50%">
+    <el-form :model="editForm" ref="editFormRef">
+      <el-form-item label="SN" prop="T_sn">
+        <el-input v-model="editForm.T_sn" placeholder="请输入SN"></el-input>
+      </el-form-item>
+      <el-form-item label="设备编号" prop="Validationnumber">
+        <el-input v-model="editForm.Validationnumber" placeholder="请输入设备编号"></el-input>
+      </el-form-item>
+		<el-form-item label="状态">
+			<el-select v-model="editForm.T_state" class="w-50 m-2" clearable placeholder="请选择状态~">
+				<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
+			</el-select>
+		</el-form-item>
+      <el-form-item label="备注">
+        <el-input v-model="editForm.T_remark" type="textarea" placeholder="请输入备注"></el-input>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="showEditForm = false">取消</el-button>
+        <el-button type="primary" @click="submitEditForm">提交</el-button>
+      </span>
+    </template>
+  </el-dialog>
 </template>
 
 <style scoped lang="scss">
+@import '@/styles/var.scss';
 
+.list {
+  @include f-direction;
+}
+// .input-suffix {
+//   width: 100%;
+//   .w-50 {
+//     width: 33.33%;
+//   }
+// }
 </style>

+ 18 - 18
src/views/storehouse/sales/Recoveries.vue

@@ -105,25 +105,25 @@ const rules = reactive<FormRules>({
 })
 const AddContract = (formEl: FormInstance | undefined) => {
   if (!formEl) return
-  formEl.validate(async valid => {
+  formEl.validate((valid: boolean) => {
     if (valid) {
-      let res: any = {}
-      if (isNew.value) {
-        res = await Storehouse_VerifyContract_Add_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
-      } else {
-        res = await Storehouse_VerifyContract_Update_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
-      }
-      if (res.Code === 200) {
-        ElMessage.success('添加客户成功!!')
-        nextTick(() => {
-          updateOnTableList(TableRef.value)
-          isNew.value = true
-          resetForm(ruleFormRef.value)
-          drawerRef.value?.closeDrawer()
-        })
-      }
-    } else {
-      return false
+      (async () => {
+        let res: any = {}
+        if (isNew.value) {
+          res = await Storehouse_VerifyContract_Add_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
+        } else {
+          res = await Storehouse_VerifyContract_Update_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
+        }
+        if (res.Code === 200) {
+          ElMessage.success('添加客户成功!!')
+          nextTick(() => {
+            updateOnTableList(TableRef.value)
+            isNew.value = true
+            resetForm(ruleFormRef.value)
+            drawerRef.value?.closeDrawer()
+          })
+        }
+      })()
     }
   })
 }

+ 18 - 18
src/views/storehouse/sales/VerifyContract.vue

@@ -62,25 +62,25 @@ const rules = reactive<FormRules>({
 })
 const AddContract = (formEl: FormInstance | undefined) => {
   if (!formEl) return
-  formEl.validate(async valid => {
+  formEl.validate(valid => {
     if (valid) {
-      let res: any = {}
-      if (isNew.value) {
-        res = await Storehouse_VerifyContract_Add_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
-      } else {
-        res = await Storehouse_VerifyContract_Update_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
-      }
-      if (res.Code === 200) {
-        ElMessage.success('添加客户成功!!')
-        nextTick(() => {
-          updateOnTableList(TableRef.value)
-          isNew.value = true
-          resetForm(ruleFormRef.value)
-          drawerRef.value?.closeDrawer()
-        })
-      }
-    } else {
-      return false
+      (async () => {
+        let res: any = {}
+        if (isNew.value) {
+          res = await Storehouse_VerifyContract_Add_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
+        } else {
+          res = await Storehouse_VerifyContract_Update_Customer({ User_tokey: globalStore.GET_User_tokey, ...form.value })
+        }
+        if (res.Code === 200) {
+          ElMessage.success('添加客户成功!!')
+          nextTick(() => {
+            updateOnTableList(TableRef.value)
+            isNew.value = true
+            resetForm(ruleFormRef.value)
+            drawerRef.value?.closeDrawer()
+          })
+        }
+      })()
     }
   })
 }

+ 1 - 3
src/views/storehouse/verifyItem.vue

@@ -62,7 +62,7 @@ const openDrawer = (type: string, row?: any) => {
 
 const AddProduction = (formEl: FormInstance | undefined) => {
   if (!formEl) return
-  formEl.validate(async valid => {
+  formEl.validate(async (valid: boolean) => {
     if (valid) {
       let res: any = {}
       if (isNew.value) {//新增
@@ -82,8 +82,6 @@ const AddProduction = (formEl: FormInstance | undefined) => {
           isNew.value = true
         })
       }
-    } else {
-      return false
     }
   })
 }

+ 1 - 1
src/views/workAttendance/MyLeave.vue

@@ -98,7 +98,7 @@ const AddLeave = (formEl: FormInstance | undefined) => {
         })
       }
     } else {
-      return false
+      return
     }
   })
 }

+ 2 - 2
src/views/workAttendance/MyOvertime.vue

@@ -127,7 +127,7 @@ const OvertimeDelete = (row: any) => {
             ElMessage.warning('取消成功!')
         })
 }
-const AddOvertime = (formEl: FormInstance | undefined) => {
+const AddOvertime = async (formEl: FormInstance | undefined) => {
     if (!formEl) return
     formEl.validate(async valid => {
         if (valid) {
@@ -157,7 +157,7 @@ const AddOvertime = (formEl: FormInstance | undefined) => {
                 })
             }
         } else {
-            return false
+            return
         }
     })
 }

+ 6 - 0
vite.config.ts

@@ -19,6 +19,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
         '@assets': path.resolve(__dirname, './assets/images')
       }
     },
+    define: {
+      'process.env.NODE_ENV': '"production"'
+    },
     css: {
       preprocessorOptions: {
         scss: {
@@ -65,6 +68,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
         resolvers: [ElementPlusResolver()]
       })
     ],
+	  optimizeDeps: {
+		  include: ['element-plus/es/locale/lang/zh-cn'],
+	  },
     // * 打包去除 console.log && debugger
     esbuild: {
       pure: env.VITE_DROP_CONSOLE ? ['console.log', 'debugger'] : []

Some files were not shown because too many files changed in this diff