diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/mini_program/client-mp/package-lock.json b/mini_program/client-mp/package-lock.json index f13c6d9..2f9736e 100644 --- a/mini_program/client-mp/package-lock.json +++ b/mini_program/client-mp/package-lock.json @@ -960,9 +960,8 @@ }, "node_modules/@dcloudio/uni-ui": { "version": "1.5.11", - "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz", - "integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw==", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz", + "integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw==" }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", diff --git a/mini_program/client-mp/src/api/acceptance.ts b/mini_program/client-mp/src/api/acceptance.ts index 1f23d10..1d2ac60 100644 --- a/mini_program/client-mp/src/api/acceptance.ts +++ b/mini_program/client-mp/src/api/acceptance.ts @@ -1,5 +1,6 @@ import { request } from '@/utils/request'; -import type { IAcceptance, IAcceptanceDetail } from '@/types/acceptance'; +import type { IAcceptance, IAcceptanceDetail, IAcceptanceUpdateData } from '@/types/acceptance'; +import type { ResponseData } from '@/types/request'; // 获取验收列表 export const fetchAcceptanceList = async (): Promise => { @@ -7,7 +8,7 @@ export const fetchAcceptanceList = async (): Promise => { const res = await request({ url: '/acceptance/list', method: 'GET' - }); + }) as ResponseData; return res.data; } catch (error) { console.error('获取验收列表失败:', error); @@ -21,7 +22,7 @@ export const fetchAcceptanceDetail = async (acceptanceId: string): Promise; return res.data; } catch (error) { console.error('获取验收详情失败:', error); @@ -41,10 +42,52 @@ export const submitAcceptance = async (data: { url: '/acceptance/submit', method: 'POST', data - }); + }) as ResponseData; return res.data; } catch (error) { console.error('提交验收结果失败:', error); throw error; } +}; + +// 更新验收结果 +export const updateAcceptance = async ( + acceptanceId: string, + data: IAcceptanceUpdateData +): Promise => { + try { + const res = await request({ + url: `/acceptance/${acceptanceId}/update`, + method: 'PUT', + data + }) as ResponseData; + return res.data; + } catch (error) { + console.error('更新验收结果失败:', error); + throw error; + } +}; + +// 获取验收统计数据 +export const fetchAcceptanceStats = async (): Promise<{ + total: number; + passed: number; + failed: number; + pending: number; +}> => { + try { + const res = await request({ + url: '/acceptance/stats', + method: 'GET' + }) as ResponseData<{ + total: number; + passed: number; + failed: number; + pending: number; + }>; + return res.data; + } catch (error) { + console.error('获取验收统计数据失败:', error); + throw error; + } }; \ No newline at end of file diff --git a/mini_program/client-mp/src/manifest.json b/mini_program/client-mp/src/manifest.json index a836d85..5fddbeb 100644 --- a/mini_program/client-mp/src/manifest.json +++ b/mini_program/client-mp/src/manifest.json @@ -1,84 +1,81 @@ { - "name": "活牛采购-客户端", - "appid": "", - "description": "活牛采购智能数字化系统客户端小程序", - "versionName": "1.0.0", - "versionCode": "100", - "transformPx": false, - "app-plus": { - "usingComponents": true, - "nvueStyleCompiler": "uni-app", - "compilerVersion": 3, - "splashscreen": { - "alwaysShowBeforeRender": true, - "waiting": true, - "autoclose": true, - "delay": 0 - }, - "modules": {}, - "distribute": { - "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "ios": { - "dSYMs": false, - "privacyDescription": { - "NSLocationWhenInUseUsageDescription": "此应用需要访问您的位置信息,以便提供运输跟踪服务", - "NSCameraUsageDescription": "此应用需要访问您的相机,以便上传照片和视频", - "NSPhotoLibraryUsageDescription": "此应用需要访问您的相册,以便选择照片和视频", - "NSMicrophoneUsageDescription": "此应用需要访问您的麦克风,以便录制视频" + "name" : "活牛采购-客户端", + "appid" : "__UNI__D79EE30", + "description" : "活牛采购智能数字化系统客户端小程序", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + "modules" : {}, + "distribute" : { + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios" : { + "dSYMs" : false, + "privacyDescription" : { + "NSLocationWhenInUseUsageDescription" : "此应用需要访问您的位置信息,以便提供运输跟踪服务", + "NSCameraUsageDescription" : "此应用需要访问您的相机,以便上传照片和视频", + "NSPhotoLibraryUsageDescription" : "此应用需要访问您的相册,以便选择照片和视频", + "NSMicrophoneUsageDescription" : "此应用需要访问您的麦克风,以便录制视频" + } + } + } + }, + "mp-weixin" : { + "appid" : "wx0123456789abcdef", + "setting" : { + "urlCheck" : false, + "es6" : true, + "postcss" : true, + "minified" : true + }, + "usingComponents" : true, + "permission" : { + "scope.userLocation" : { + "desc" : "您的位置信息将用于运输跟踪服务" + } + }, + "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ] + }, + "mp-alipay" : { + "usingComponents" : true, + "appid" : "2021000000000000" + }, + "vueVersion" : "3", + "h5" : { + "router" : { + "mode" : "hash", + "base" : "/" + }, + "title" : "活牛采购-客户端", + "optimization" : { + "treeShaking" : { + "enable" : true + } } - } } - }, - "mp-weixin": { - "appid": "wx0123456789abcdef", - "setting": { - "urlCheck": false, - "es6": true, - "postcss": true, - "minified": true - }, - "usingComponents": true, - "permission": { - "scope.userLocation": { - "desc": "您的位置信息将用于运输跟踪服务" - } - }, - "requiredPrivateInfos": [ - "getLocation", - "chooseLocation" - ] - }, - "mp-alipay": { - "usingComponents": true, - "appid": "2021000000000000" - }, - "vueVersion": "3", - "h5": { - "router": { - "mode": "hash", - "base": "/" - }, - "title": "活牛采购-客户端", - "optimization": { - "treeShaking": { - "enable": true - } - } - } -} \ No newline at end of file +} diff --git a/mini_program/client-mp/src/pages/acceptance/acceptance-detail.vue b/mini_program/client-mp/src/pages/acceptance/acceptance-detail.vue index df62ee1..89b5b9e 100644 --- a/mini_program/client-mp/src/pages/acceptance/acceptance-detail.vue +++ b/mini_program/client-mp/src/pages/acceptance/acceptance-detail.vue @@ -1,18 +1,90 @@ \ No newline at end of file diff --git a/mini_program/client-mp/src/pages/acceptance/acceptance-list.vue b/mini_program/client-mp/src/pages/acceptance/acceptance-list.vue index 3734a0b..d6772cb 100644 --- a/mini_program/client-mp/src/pages/acceptance/acceptance-list.vue +++ b/mini_program/client-mp/src/pages/acceptance/acceptance-list.vue @@ -1,23 +1,83 @@