From b75fbc37cd8d963b984dde61d17388207a23e04c Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 21 Oct 2025 10:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E6=9C=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=90=AD=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- .env.production | 2 +- .prettierrc.json | 12 +- src/components/KeyInfoForm/index.vue | 4 +- src/components/PersonIdCardForm/index.vue | 34 ++ src/pages.json | 14 + src/pages/attendance/index.vue | 4 +- src/pages/login/index.vue | 3 +- .../components/bindSetting.vue | 295 ++++++++++++++++++ src/pages/machine-setting/index.vue | 257 +++++++++++++++ .../person-check/aptitude-query/index.vue | 2 +- src/pages/person-check/index.vue | 2 +- .../child-pages/addAndEditPerson.vue | 145 +++++---- src/pages/person-entry/index.vue | 4 +- src/pages/select-project/index.vue | 29 +- src/pages/work/index.vue | 11 +- src/services/machine-setting.js | 44 +++ src/services/person-entry.js | 11 +- src/static/image/work/machine-setting.png | Bin 0 -> 8818 bytes src/utils/http.js | 19 +- vite.config.js | 2 +- 21 files changed, 799 insertions(+), 99 deletions(-) create mode 100644 src/pages/machine-setting/components/bindSetting.vue create mode 100644 src/pages/machine-setting/index.vue create mode 100644 src/services/machine-setting.js create mode 100644 src/static/image/work/machine-setting.png 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 @@ + + + + + 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 @@ + + + + + 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 @@