diff --git a/.env.development b/.env.development
index 13ba143..665f142 100644
--- a/.env.development
+++ b/.env.development
@@ -1,4 +1,4 @@
# VITE_API_BASE_URL = http://112.29.103.165:1616
-# VITE_API_BASE_URL = /api
+VITE_API_BASE_URL = /api
# VITE_API_BASE_URL = http://192.168.0.14:1999/hd-realname/prod-api
-VITE_API_BASE_URL = http://192.168.0.234:38080
+# VITE_API_BASE_URL = http://192.168.0.234:38080
diff --git a/.env.production b/.env.production
index 8bedfa4..12a4c28 100644
--- a/.env.production
+++ b/.env.production
@@ -1 +1 @@
-VITE_API_BASE_URL = http://192.168.0.14:1999/hd-realname/prod-api
\ No newline at end of file
+VITE_API_BASE_URL = https://sh.cygrxt.com:19999/hd-realname/prod-api
\ No newline at end of file
diff --git a/.prettierrc.json b/.prettierrc.json
index ad0351a..16f70fa 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,8 +1,8 @@
{
- "tabWidth": 4,
- "singleQuote": true,
- "semi": false,
- "printWidth": 100,
- "trailingComma": "all",
- "endOfLine": "auto"
+ "tabWidth": 4,
+ "singleQuote": true,
+ "semi": false,
+ "printWidth": 100,
+ "trailingComma": "all",
+ "endOfLine": "auto"
}
diff --git a/src/components/KeyInfoForm/index.vue b/src/components/KeyInfoForm/index.vue
index 422f5a4..c2cae12 100644
--- a/src/components/KeyInfoForm/index.vue
+++ b/src/components/KeyInfoForm/index.vue
@@ -368,7 +368,7 @@ const afterRead = (e) => {
// keyInfoForm.value.photoIds = data.data
photoIds.value = data.data
} else {
- uni.$u.toast('上传失败:' + data.msg)
+ uni.$u.toast('上传失败')
}
},
fail: (err) => {
@@ -376,7 +376,7 @@ const afterRead = (e) => {
},
})
} else {
- uni.$u.toast('人脸识别失败:' + data?.msg)
+ uni.$u.toast('人脸识别失败')
keyInfoForm.value.faceImg = []
}
},
diff --git a/src/components/PersonIdCardForm/index.vue b/src/components/PersonIdCardForm/index.vue
index 67db76c..0e90887 100644
--- a/src/components/PersonIdCardForm/index.vue
+++ b/src/components/PersonIdCardForm/index.vue
@@ -157,6 +157,7 @@ import { ref, watch } from 'vue'
import { pathToBase64 } from 'image-tools'
import { useMemberStore } from '@/stores'
import dayjs from 'dayjs'
+import { getShanghaiProByIdNumberAPI } from '@/services/person-entry'
const memberStore = useMemberStore()
const idCardFormRef = ref(null) // 身份证表单ref
@@ -278,6 +279,35 @@ const onBlurIdNumber = (val) => {
idCardModel.value.birthday =
birthday?.slice(0, 4) + '-' + birthday.slice(4, 6) + '-' + birthday.slice(6, 8)
idCardModel.value.sex = sex % 2 === 0 ? '女' : '男'
+
+ console.log(props.formType, 'props.formType')
+
+ if (props.formType == 1) {
+ checkShanghaiPro()
+ }
+}
+
+// 校验身份证号
+const checkShanghaiPro = async () => {
+ const { data: res } = await getShanghaiProByIdNumberAPI({
+ idNumber: idCardModel.value.idNumber,
+ })
+ // return res
+
+ if (res && Object.keys(res).length > 0 && res.isShanghai == 1) {
+ uni.$u.toast('当前人员已经入场上海工程,可通过后台进行多工程设置...')
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1000)
+ }
+ if (res && Object.keys(res).length > 0 && (res.isShanghai == 0 || res.isShanghai == null)) {
+ uni.$u.toast('当前人员已经存在,可直接编辑')
+ setTimeout(() => {
+ uni.navigateTo({
+ url: 'pages/person-entry/child-pages/editPerson',
+ })
+ }, 1000)
+ }
}
// 日期格式化
@@ -474,6 +504,10 @@ const props = defineProps({
type: Object,
default: () => {},
},
+ formType: {
+ type: [Number, String],
+ default: 1,
+ },
})
// 增加监听
diff --git a/src/pages.json b/src/pages.json
index cae4be5..ed91632 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -169,6 +169,20 @@
"navigationBarTitleText": "custom",
"navigationStyle": "custom"
}
+ },
+ // 考勤机设置
+ {
+ "path": "pages/machine-setting/index",
+ "style": {
+ "navigationBarTitleText": "考勤机设置"
+ }
+ },
+ // 考勤机设置 ---- 绑定设置
+ {
+ "path": "pages/machine-setting/components/bindSetting",
+ "style": {
+ "navigationBarTitleText": "考勤机设置"
+ }
}
],
"globalStyle": {
diff --git a/src/pages/attendance/index.vue b/src/pages/attendance/index.vue
index be1538f..c358a54 100644
--- a/src/pages/attendance/index.vue
+++ b/src/pages/attendance/index.vue
@@ -147,11 +147,11 @@ const onAttendanceHandle = () => {
}
},
fail: (err) => {
- uni.$u.toast('打卡失败:' + err.msg)
+ uni.$u.toast('打卡失败:' + (err?.msg || ''))
},
})
} else {
- uni.$u.toast('人脸识别失败,请重新识别' + data?.msg)
+ uni.$u.toast('人脸识别失败,请重新识别' + data.msg === null ? '' : data.msg)
}
},
fail: (err) => {
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index 52d9d93..3f501e2 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -175,6 +175,7 @@ const onHandleCodeImg = async () => {
// 登录按钮
const onSubmitLogin = debounce(() => {
+ // uni.navigateTo({ url: '/pages/select-project/index' })
sendLoading.value = true
loginModelRef.value
.validate()
@@ -182,7 +183,6 @@ const onSubmitLogin = debounce(() => {
if (valid) {
try {
const res = await loginApi(opinionModel.value)
-
sendLoading.value = false
if (res.code === 200) {
memberStore.setToken(res.data.access_token)
@@ -199,7 +199,6 @@ const onSubmitLogin = debounce(() => {
uni.removeStorageSync('userInfo')
}
}
-
getUserInfo()
} else {
sendLoading.value = false
diff --git a/src/pages/machine-setting/components/bindSetting.vue b/src/pages/machine-setting/components/bindSetting.vue
new file mode 100644
index 0000000..2d807da
--- /dev/null
+++ b/src/pages/machine-setting/components/bindSetting.vue
@@ -0,0 +1,295 @@
+
+
+
+
+
+
+ 考勤机编码
+ {{ machineInfo.deviceCode }}
+
+
+
+
+ 考勤机名称
+ {{ machineInfo.deviceName }}
+
+
+
+
+ 点击选择绑定数据
+
+
+
+
+ 工程名称
+ {{ machineInfo.proName }}
+
+
+
+
+ 分包商名称
+
+
+ {{ machineInfo.subName || '点击选择' }}
+
+
+
+
+
+
+
+ 班组名称
+
+
+ {{ machineInfo.teamName || '点击选择' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/machine-setting/index.vue b/src/pages/machine-setting/index.vue
new file mode 100644
index 0000000..4134e72
--- /dev/null
+++ b/src/pages/machine-setting/index.vue
@@ -0,0 +1,257 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 名称
+ {{ item.deviceName }}
+
+
+
+
+
+
+
+
+ 所在工程
+ {{ item.proName }}
+
+
+ 所属分包
+ {{ item.subName }}
+
+
+ 所在班组
+ {{ item.teamName }}
+
+
+
+
+
+ {{ !hasMore ? '没有更多数据了~' : '正在加载...' }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/person-check/aptitude-query/index.vue b/src/pages/person-check/aptitude-query/index.vue
index 4e89c04..9e55dc0 100644
--- a/src/pages/person-check/aptitude-query/index.vue
+++ b/src/pages/person-check/aptitude-query/index.vue
@@ -79,7 +79,7 @@ const queryParams = ref({
pageNum: 1,
pageSize: 12,
workerName: '',
- proName: commonStore?.activeProjectName,
+ // proName: commonStore?.activeProjectName,
})
// 获取人员列表
diff --git a/src/pages/person-check/index.vue b/src/pages/person-check/index.vue
index a0202c4..70a8a8b 100644
--- a/src/pages/person-check/index.vue
+++ b/src/pages/person-check/index.vue
@@ -61,7 +61,7 @@ const onFaceRecognition = () => {
})
}, 500)
} else {
- uni.$u.toast('人脸识别失败,请重新识别' + data?.msg)
+ uni.$u.toast('人脸识别失败,请重新识别' + data.msg === null ? '' : data.msg)
}
},
fail: (err) => {
diff --git a/src/pages/person-entry/child-pages/addAndEditPerson.vue b/src/pages/person-entry/child-pages/addAndEditPerson.vue
index 4bdcac0..572bea8 100644
--- a/src/pages/person-entry/child-pages/addAndEditPerson.vue
+++ b/src/pages/person-entry/child-pages/addAndEditPerson.vue
@@ -1,73 +1,81 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
@@ -76,9 +84,12 @@ import { useCommonStore } from '@/stores'
import { pathToBase64 } from 'image-tools'
import { onLoad } from '@dcloudio/uni-app'
import { ref, onMounted, nextTick } from 'vue'
-import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm'
-import { getPersonInfoByIdAPI, updatePersonLightStatusApi } from '@/services/person-entry'
-import { addPersonEntryApi, editPersonEntryApi } from '@/services/person-entry'
+import {
+ getPersonInfoByIdAPI,
+ updatePersonLightStatusApi,
+ addPersonEntryApi,
+ editPersonEntryApi,
+} from '@/services/person-entry'
import PersonIdCardForm from '@/components/PersonIdCardForm/index.vue'
import KeyInfoForm from '@/components/KeyInfoForm/index.vue'
@@ -341,7 +352,7 @@ const getButtonHeight = () => {
// 获取人员信息
const getPersonInfoByIdFun = async (id) => {
- const res = await getPersonInfoByIdAPI({ id })
+ const res = await getPersonInfoByIdAPI({ id, proId: commonStore?.activeProjectId })
if (res.code === 200) {
const {
diff --git a/src/pages/person-entry/index.vue b/src/pages/person-entry/index.vue
index ebe534b..5c26cf8 100644
--- a/src/pages/person-entry/index.vue
+++ b/src/pages/person-entry/index.vue
@@ -96,7 +96,9 @@ const handleTapPersonEntry = (item) => {
})
}, 500)
} else {
- uni.$u.toast('人脸识别失败,请重新识别' + data?.msg)
+ uni.$u.toast(
+ '人脸识别失败,请重新识别' + data.msg === null ? '' : data.msg,
+ )
}
},
fail: (err) => {
diff --git a/src/pages/select-project/index.vue b/src/pages/select-project/index.vue
index 839ab51..869fb28 100644
--- a/src/pages/select-project/index.vue
+++ b/src/pages/select-project/index.vue
@@ -11,7 +11,7 @@
-
+
+
+
+
+
+
@@ -70,6 +75,11 @@ const getProjectList = async () => {
})
}
+// 跳转首页
+const onJumpHome = () => {
+ uni.switchTab({ url: '/pages/home/index' })
+}
+
onMounted(() => {
getProjectList()
})
@@ -110,5 +120,22 @@ onMounted(() => {
color: #333;
}
}
+
+ .empty-container {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ margin-top: 20rpx;
+ .up-empty {
+ margin-bottom: 20rpx;
+ }
+ .up-button {
+ width: 95%;
+ margin: 0 auto;
+ margin-bottom: 30rpx;
+ }
+ }
}
diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue
index ff5b4d3..60e32d4 100644
--- a/src/pages/work/index.vue
+++ b/src/pages/work/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -17,6 +17,7 @@ import EntryIcon from '@/static/image/work/entry.png'
import ExitIcon from '@/static/image/work/exit.png'
import CheckIcon from '@/static/image/work/check.png'
import CountIcon from '@/static/image/work/count.png'
+import MachineSettingIcon from '@/static/image/work/machine-setting.png'
const workList = [
{
@@ -51,6 +52,14 @@ const workList = [
icon: CountIcon,
url: '/pages/att-count/index',
},
+ {
+ name: 'machineSetting',
+ title: '考勤机设置',
+ icon: 'machineSetting',
+ bgc_color: '#eaf4d9',
+ icon: MachineSettingIcon,
+ url: '/pages/machine-setting/index',
+ },
]
// 点击跳转
diff --git a/src/services/machine-setting.js b/src/services/machine-setting.js
new file mode 100644
index 0000000..f1ca2fb
--- /dev/null
+++ b/src/services/machine-setting.js
@@ -0,0 +1,44 @@
+import { http } from '@/utils/http'
+
+// 获取考勤机列表
+export const getMachineListAPI = (data) => {
+ return http({
+ method: 'GET',
+ url: `bmw/pmAttDevice/list`,
+ data,
+ })
+}
+// 考勤机解除绑定
+export const getMachineUnbindAPI = (data) => {
+ return http({
+ method: 'GET',
+ url: `/bmw/worker/**`,
+ data,
+ })
+}
+// 考勤机确认绑定
+export const getMachineConfirmBindAPI = (data) => {
+ return http({
+ method: 'GET',
+ url: `/bmw/worker/**`,
+ data,
+ })
+}
+
+// 根据工程ID获取分包商
+export const getSubcontractorListAPI = (data) => {
+ return http({
+ method: 'GET',
+ url: 'bmw/pmSub/getSublistByProId',
+ data,
+ })
+}
+
+// 根据工程ID和分包商ID获取班组
+export const getSubTeamContractListAPI = (data) => {
+ return http({
+ method: 'GET',
+ url: `/bmw/subTeamContract/getSubTeamContractList`,
+ data,
+ })
+}
diff --git a/src/services/person-entry.js b/src/services/person-entry.js
index ff08214..ee0050f 100644
--- a/src/services/person-entry.js
+++ b/src/services/person-entry.js
@@ -13,7 +13,7 @@ export const getPersonListAPI = (data) => {
export const getPersonInfoByIdAPI = (data) => {
return http({
method: 'POST',
- url: '/bmw/worker/select/' + data?.id,
+ url: `/bmw/worker/select/${data?.id}/${data.proId}`,
data,
})
}
@@ -55,3 +55,12 @@ export const editPersonEntryExitApi = (data) => {
data,
})
}
+
+// 获取上海工程人员信息
+export const getShanghaiProByIdNumberAPI = (data) => {
+ return http({
+ url: `/bmw/worker/selectByIdNumber/${data.idNumber}`,
+ method: 'POST',
+ data,
+ })
+}
diff --git a/src/static/image/work/machine-setting.png b/src/static/image/work/machine-setting.png
new file mode 100644
index 0000000..d778c81
Binary files /dev/null and b/src/static/image/work/machine-setting.png differ
diff --git a/src/utils/http.js b/src/utils/http.js
index 71b1477..b3f8a07 100644
--- a/src/utils/http.js
+++ b/src/utils/http.js
@@ -70,28 +70,32 @@ const httpInterceptor = {
const commonStore = useCommonStore() // 请求配置
const requestConfig = commonStore.requestConfig // 请求配置
+ const env = import.meta.env.MODE
// 5. 增加请求配置
// 入参加密
- options.header['encryptRequest'] = requestConfig.encryptRequest
+ options.header['encryptRequest'] =
+ import.meta.env.MODE === 'development' ? false : requestConfig.encryptRequest
// 数据完整性校验
- options.header['checkIntegrity'] = requestConfig.checkIntegrity
+ options.header['checkIntegrity'] =
+ import.meta.env.MODE === 'development' ? false : requestConfig.checkIntegrity
//回参是否加密
- options.header['encryptResponse'] = requestConfig.encryptResponse
+ options.header['encryptResponse'] =
+ import.meta.env.MODE === 'development' ? false : requestConfig.encryptResponse
const queryData =
options.data instanceof Object ? JSON.stringify(options.data) : options.data
if (typeof queryData !== 'undefined' && options.method.toUpperCase() === 'POST') {
// 加密数据
- if (requestConfig.encryptRequest) {
+ if (requestConfig.encryptRequest && env !== 'development') {
options.data = encryptWithSM4(queryData + '|' + hashWithSM3AndSalt(queryData))
}
}
if (options.data instanceof Object && options.method.toUpperCase() === 'GET') {
// 加密数据
- if (requestConfig.encryptRequest) {
+ if (requestConfig.encryptRequest && env !== 'development') {
const url =
options.url + '?' + tansParams(options.data, requestConfig.encryptRequest)
@@ -99,8 +103,6 @@ const httpInterceptor = {
options.url = url
}
}
-
- console.log(options, 'options--**----')
}
},
}
@@ -117,7 +119,6 @@ export const http = (options) => {
success(res) {
console.log(res, '请求拦截器处解密后的返回值')
const currentEnv = getCurrentEnv()
- console.log(currentEnv, 'currentEnv')
// 判断是H5 还是App环境
let isEncryptResponse = ''
if (currentEnv === 'windows') {
@@ -127,8 +128,6 @@ export const http = (options) => {
}
if (res.header[isEncryptResponse]) {
- console.log(JSON.parse(decryptWithSM4(res.data)), '解密后')
-
res.data = JSON.parse(decryptWithSM4(res.data))
}
diff --git a/vite.config.js b/vite.config.js
index 1d5b3db..4d78d89 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -10,7 +10,7 @@ export default defineConfig({
'/api': {
// target: 'http://112.29.103.165:1616', // 测试环境
// target: 'http://192.168.0.133:58080', // 梁超
- target: 'http://192.168.0.14:1999/hd-realname/prod-api', // 测试环境
+ target: 'http://192.168.0.14:1999/hd-real-name', // 测试环境
// target: 'http://192.168.0.234:38080', // 方亮
changeOrigin: true,
rewrite: (path) => {