From 2e81832f31ee2533df57293a7197f358ab67b833 Mon Sep 17 00:00:00 2001 From: chenshuichuan <1154693969@qq.com> Date: Fri, 12 Jul 2024 14:56:33 +0800 Subject: [PATCH] add report --- src/api/mes/plan.js | 8 +- src/api/mes/report.js | 43 ++++++-- src/manifest.json | 49 ++++++++- src/page_record/reportForm.vue | 178 +++++++++++++++++++++++++++++++++ src/page_report/addSite.vue | 173 ++++++++++++++++++++++++++++++++ src/page_report/index.vue | 139 +++++++++++++++++++++++++ src/pages.json | 23 ++++- src/pages/index.vue | 48 +++++---- src/pages/report.vue | 121 ++++++++++++++++++++++ src/store/modules/user.ts | 2 +- src/utils/request.ts | 17 ++-- 11 files changed, 753 insertions(+), 48 deletions(-) create mode 100644 src/page_record/reportForm.vue create mode 100644 src/page_report/addSite.vue create mode 100644 src/page_report/index.vue create mode 100644 src/pages/report.vue diff --git a/src/api/mes/plan.js b/src/api/mes/plan.js index 7fb2306..8ac31b6 100644 --- a/src/api/mes/plan.js +++ b/src/api/mes/plan.js @@ -19,7 +19,7 @@ export function create(data) { return request({ url: '/admin-api/mes/plan/create', method: 'post', - params: data + data: data }) } // 更新 @@ -27,7 +27,7 @@ export function update(data) { return request({ url: '/admin-api/mes/plan/update', method: 'put', - params: data + data: data }) } @@ -36,7 +36,7 @@ export function paigong(data) { return request({ url: '/admin-api/mes/plan/paigong', method: 'put', - params: data + data: data }) } // 更改状态:开工、暂停 @@ -44,7 +44,7 @@ export function updateStatus(data) { return request({ url: '/admin-api/mes/plan/updateStatus', method: 'put', - params: data + data: data }) } diff --git a/src/api/mes/report.js b/src/api/mes/report.js index 1416b55..ea0fef9 100644 --- a/src/api/mes/report.js +++ b/src/api/mes/report.js @@ -1,34 +1,61 @@ -import upload from '@/utils/upload' import request from '@/utils/request' // 查询分页 -export function getPage() { +export function getMyList() { return request({ - url: '/admin-api/mes/plan/page', + url: '/admin-api/mes/produce-report/getMyList', + method: 'get' + }) +} +// 查询分页 +export function getOtherList() { + return request({ + url: '/admin-api/mes/produce-report/getOtherList', method: 'get' }) } // 查询详情 export function getById(id) { return request({ - url: '/admin-api/mes/plan/get?id='+id, + url: '/admin-api/mes/produce-report/get?id='+id, method: 'get' }) } // 创建 export function create(data) { return request({ - url: '/admin-api/mes/plan/create', + url: '/admin-api/mes/produce-report/create', method: 'post', - params: data + data: data }) } // 更新 export function update(data) { return request({ - url: '/admin-api/mes/plan/update', + url: '/admin-api/mes/produce-report/update', method: 'put', - params: data + data: data + }) +} +// 提交\审核报工单 +export function updateStatus(id,status) { + return request({ + url: '/admin-api/mes/produce-report/updateStatus?id='+id+'&status='+status, + method: 'get' }) } +// 查询详情 +export function getDetailByReportId(id) { + return request({ + url: '/admin-api/mes/produce-report/produce-report-detail/list-by-report-id?reportId='+id, + method: 'get' + }) +} +// 查询详情 +export function deleteByReportId(id) { + return request({ + url: '/admin-api/mes/produce-report/delete?id='+id, + method: 'delete' + }) +} diff --git a/src/manifest.json b/src/manifest.json index b6206f2..2b1c18b 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,12 +1,17 @@ { - "name" : "ruoyi-vue3", - "appid" : "__UNI__3DD118D", + "name" : "必硕生管系统", + "appid" : "__UNI__AED03F6", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { + "compatible" : { + "ignoreVersion" : true, + "runtimeVersion" : "4.15", //根据实际情况填写 + "compilerVersion" : "4.15" //根据实际情况填写 + }, "usingComponents" : true, "nvueStyleCompiler" : "uni-app", "compilerVersion" : 3, @@ -41,9 +46,45 @@ ] }, /* ios打包配置 */ - "ios" : {}, + "ios" : { + "dSYMs" : false + }, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs" : { + "ad" : {} + }, + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + } } }, /* 快应用特有相关 */ diff --git a/src/page_record/reportForm.vue b/src/page_record/reportForm.vue new file mode 100644 index 0000000..210f08c --- /dev/null +++ b/src/page_record/reportForm.vue @@ -0,0 +1,178 @@ + + + + + + + {{userStore.name}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{warningInfo}} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/page_report/addSite.vue b/src/page_report/addSite.vue new file mode 100644 index 0000000..0d6c653 --- /dev/null +++ b/src/page_report/addSite.vue @@ -0,0 +1,173 @@ + + + + + 收货人 + + + + 手机号码 + + + + 所在地区 + + + + 详细地址 + + + + + + + 标签 + + 家 + 公司 + 学校 + + + + + + 设置默认地址 + 提醒:每次下单会默认推荐该地址 + + + + + + + + + + + diff --git a/src/page_report/index.vue b/src/page_report/index.vue new file mode 100644 index 0000000..4d145f5 --- /dev/null +++ b/src/page_report/index.vue @@ -0,0 +1,139 @@ + + + + + {{ res.name }} + {{ res.phone }} + + {{ item.tagText }} + + + + 广东省深圳市宝安区 自由路66号 + + + + + + 新建收货地址 + + + + + + + + diff --git a/src/pages.json b/src/pages.json index faba0cd..f3e42e7 100644 --- a/src/pages.json +++ b/src/pages.json @@ -15,8 +15,7 @@ { "path": "pages/index", "style": { - "navigationBarTitleText": "生管系统", - "navigationStyle": "custom" + "navigationBarTitleText": "生产计划" } }, { @@ -40,7 +39,7 @@ { "path": "pages/mine", "style": { - "navigationBarTitleText": "我的" + "navigationBarTitleText": "个人中心" } }, { @@ -54,9 +53,23 @@ "style": { "navigationBarTitleText": "浏览文本" } + }, + { + "path": "pages/report", + "style": { + "navigationBarTitleText": "生产报工" + } } ], "subPackages": [ + { + "root": "page_record", + "pages": [ + { + "path": "reportForm" + } + ] + }, { "root": "pages_mine/pages", "pages": [ @@ -254,7 +267,7 @@ "text": "计划" }, { - "pagePath": "pages/work", + "pagePath": "pages/report", "iconPath": "static/images/tabbar/work.png", "selectedIconPath": "static/images/tabbar/work_.png", "text": "报工" @@ -281,7 +294,7 @@ }, "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "RuoYi", + "navigationBarTitleText": "BESURE", "navigationBarBackgroundColor": "#FFFFFF" } } diff --git a/src/pages/index.vue b/src/pages/index.vue index d301844..7f4699c 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -16,8 +16,8 @@ 计划数:{{ item.planNumber }} - - 完工 + + 完工 @@ -27,8 +27,8 @@ 入库数:{{ item.finishNumber }} - - 暂停 + + 暂停 @@ -50,8 +50,8 @@ 计划数:{{ item.planNumber }} - - 开工 + + 开工 @@ -77,7 +77,7 @@ 计划数:{{ item.planNumber }} - + 派工 @@ -104,8 +104,8 @@ 计划数:{{ item.planNumber }} - - 完工 + + 完工 @@ -115,8 +115,8 @@ 入库数:{{ item.finishNumber }} - - 开工 + + 开工 @@ -134,13 +134,14 @@ import useUserStore from '@/store/modules/user' import {getPage, getById, paigong, updateStatus, getByStatus} from "@/api/mes/plan" import {timestampToTime} from "@/utils/dateUtil"; import {Tickets} from "@element-plus/icons-vue"; - +import modal from "@/plugins/modal"; +import {showConfirm} from "@/utils/common"; +import auth from "@/plugins/auth"; const userStore = useUserStore() const startList = ref([]); const paigongList = ref([]); const pauseList = ref([]); const planList = ref([]); - const chartData = ref({}); onMounted(() => { @@ -180,16 +181,25 @@ function getPlanList() { getByStatus(3).then(response => { pauseList.value = response.data }) + } /** 开工 */ -function updatePlan(id, code){ - - const data = {id, code} - updateStatus(data).then(response => { - pauseList.value = response.data +function updatePlan(id, planCode, type){ + let content = '确定[' + if(type==='start')content= content+'开工]' + planCode +'?' + else if(type==='end')content= content+'完工]'+ planCode +'?' + else if(type==='pause')content= content+'暂停]'+ planCode +'?' + showConfirm(content).then(res => { + if (res.confirm) { + const data = {'id':id, 'code':type} + updateStatus(data).then(response => { + console.log(response) + getPlanList() + }) + modal.msgSuccess("操作成功") + } }) - getPlanList() } diff --git a/src/pages/report.vue b/src/pages/report.vue new file mode 100644 index 0000000..612fbfd --- /dev/null +++ b/src/pages/report.vue @@ -0,0 +1,121 @@ + + + + + + + + {{timestampToTime(item.reportDate)}} + / + {{item.userName}} + / + {{item.orgName}} + + + + + + + + + + + + + + + + + + + + + diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index c090738..b44c1cd 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -58,10 +58,10 @@ const useUserStore = defineStore("user", { if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 this.roles = res.data.roles; - this.permissions = res.data.permissions; } else { this.roles = ["ROLE_DEFAULT"]; } + this.permissions = res.data.permissions; this.name = user.nickname; this.userId = user.id; this.avatar = avatar; diff --git a/src/utils/request.ts b/src/utils/request.ts index 803cd45..30648a6 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -43,14 +43,17 @@ const request = (config: RequestConfig): Promise> => { // @ts-ignore const msg: string = errorCode[code] || data.msg || errorCode['default'] if (code === 401) { - showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { - if (res.confirm) { - useUserStore().logOut().then(res => { - uni.reLaunch({ url: '/pages/login' }) - }) - } - }) + // showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { + // if (res.confirm) { + // useUserStore().logOut().then(res => { + // uni.reLaunch({ url: '/pages/login' }) + // }) + // } + // }) reject('无效的会话,或者会话已过期,请重新登录。') + useUserStore().logOut().then(res => { + uni.reLaunch({ url: '/pages/login' }) + }) } else if (code === 500) { toast(msg) reject('500')