美乐嘉-安卓

dev
jevononlie 5 months ago
parent 76f3045b7e
commit 66b15b22c4

@ -1,17 +1,44 @@
<!-- <!--
* @Author: 王文杰 * @Author: 王文杰
* @Date: 2024-01-04 12:54:56 * @Date: 2024-01-04 12:54:56
* @LastEditors: 王文杰 * @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-03-26 14:34:58 * @LastEditTime: 2024-05-11 17:16:10
* @FilePath: /app-nx-personal/src/App.vue * @FilePath: /app-nx-personal/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<script setup lang="ts"> <script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app' import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { updateManager } from '@/utils/index' import { appUpdateApi } from '@/services/appUpdate'
onLaunch(() => { onLaunch(async () => {
console.log('App Launch') console.log('App Launch')
updateManager() //#ifdef APP-PLUS
let appid = '', version = '';
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
if (wgtinfo.version) {
appid = wgtinfo.appid
version = wgtinfo.version
} else {
appid = plus.runtime.appid
version = plus.runtime.version
}
});
const params = { //
'appId': appid
}
const res = await appUpdateApi(params)
if (res.data.versionId !== version) {
uni.showModal({ //
title: '更新提示',
content: res.data.remark,
success: (res) => {
if (res.confirm) {
plus.runtime.openURL(res.data.url);
}
}
})
}
//#endif
}) })
onShow(() => { onShow(() => {
console.log('App Show') console.log('App Show')

@ -0,0 +1,3 @@
{
"prompt" : "none"
}

@ -1,9 +1,9 @@
{ {
"name" : "高效生产", "name" : "高效生产",
"appid" : "__UNI__C3D5591", "appid" : "__UNI__1AFEDCC",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1",
"versionCode" : "100", "versionCode" : 1,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@ -54,38 +54,45 @@
}, },
"icons" : { "icons" : {
"android" : { "android" : {
"hdpi" : "unpackage/res/icons/72x72.png", "hdpi" : "",
"xhdpi" : "unpackage/res/icons/96x96.png", "xhdpi" : "",
"xxhdpi" : "unpackage/res/icons/144x144.png", "xxhdpi" : "",
"xxxhdpi" : "unpackage/res/icons/192x192.png" "xxxhdpi" : ""
}, },
"ios" : { "ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png", "appstore" : "",
"ipad" : { "ipad" : {
"app" : "unpackage/res/icons/76x76.png", "app" : "",
"app@2x" : "unpackage/res/icons/152x152.png", "app@2x" : "",
"notification" : "unpackage/res/icons/20x20.png", "notification" : "",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x" : "",
"proapp@2x" : "unpackage/res/icons/167x167.png", "proapp@2x" : "",
"settings" : "unpackage/res/icons/29x29.png", "settings" : "",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x" : "",
"spotlight" : "unpackage/res/icons/40x40.png", "spotlight" : "",
"spotlight@2x" : "unpackage/res/icons/80x80.png" "spotlight@2x" : ""
}, },
"iphone" : { "iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png", "app@2x" : "",
"app@3x" : "unpackage/res/icons/180x180.png", "app@3x" : "",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x" : "",
"notification@3x" : "unpackage/res/icons/60x60.png", "notification@3x" : "",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x" : "",
"settings@3x" : "unpackage/res/icons/87x87.png", "settings@3x" : "",
"spotlight@2x" : "unpackage/res/icons/80x80.png", "spotlight@2x" : "",
"spotlight@3x" : "unpackage/res/icons/120x120.png" "spotlight@3x" : ""
} }
} }
}, },
"splashscreen" : { "splashscreen" : {
"androidStyle" : "default" "androidStyle" : "common",
"android" : {
"xhdpi" : "",
"xxhdpi" : "src/static/images/login.9.png",
"hdpi" : ""
},
"iosStyle" : "common",
"useOriginalMsgbox" : false
} }
} }
}, },
@ -127,5 +134,6 @@
"enable" : false "enable" : false
}, },
"vueVersion" : "3", "vueVersion" : "3",
"fallbackLocale" : "zh-Hans" "fallbackLocale" : "zh-Hans",
"locale" : "zh-Hans"
} }

@ -45,7 +45,17 @@
{ {
"path": "pages/assembleReport/assembleReport", "path": "pages/assembleReport/assembleReport",
"style": { "style": {
"navigationBarTitleText": "包装报工" "navigationBarTitleText": "包装报工",
"navigationStyle":"custom"
/* "app-plus": {
"titleNView": false
} */
}
},
{
"path": "pages/assembleReport/list",
"style": {
"navigationBarTitleText": "报工历史"
} }
}, },
{ {

@ -55,9 +55,28 @@ const onScan = async () => {
} }
}); });
} }
const handleBack = ()=> {
uni.switchTab({
url: '/pages/index/index'
})
}
const handleList = ()=> {
uni.navigateTo({
url: '/pages/assembleReport/list'
})
}
</script> </script>
<template> <template>
<view class="viewport"> <view class="viewport">
<view class="status_bar">
<!-- 这里是状态栏 -->
</view>
<!-- 自定义状态栏 -->
<view class="status_title">
<uni-icons type="left" size="30" @click="handleBack"></uni-icons>
<view class="status_center">包装报工</view>
<view class="status_right" @click="handleList"></view>
</view>
<view class="hd" @tap="onScan"> <view class="hd" @tap="onScan">
<image src="/static/images/scan-report.png" class="img" mode="'aspectFit'"></image> <image src="/static/images/scan-report.png" class="img" mode="'aspectFit'"></image>
</view> </view>
@ -66,7 +85,7 @@ const onScan = async () => {
<view class="item-hd"> <view class="item-hd">
<view class="index">{{ index + 1 }}</view> <view class="index">{{ index + 1 }}</view>
<view class="assembleCode">包装条形码{{ item.assembleCode}}</view> <view class="assembleCode">包装条形码{{ item.assembleCode}}</view>
<view class="del" @tap="onDel(index)"><uni-icons type="trash" size="26"></uni-icons></view> <view class="del" @tap="onDel(index)"><uni-icons type="trash" size="26"></uni-icons></view>
</view> </view>
<view class="code label">产品编码: {{ item.projectSubCode }}</view> <view class="code label">产品编码: {{ item.projectSubCode }}</view>
<view class="name label">产品名称: {{ item.projectSubName }}</view> <view class="name label">产品名称: {{ item.projectSubName }}</view>
@ -93,6 +112,34 @@ page {
height: 100%; height: 100%;
justify-content: space-between; justify-content: space-between;
background: #F0F6FC; background: #F0F6FC;
.status_bar {
height: var(--status-bar-height);
width: 100%;
}
/* 自定义导航栏 */
.status_title {
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 44px;
padding: 0 16px;
background-color: #FFFFFF;
}
.status_left {
width: 18px !important;
}
.status_center {
font-size: 17px;
font-weight: 700;
}
.status_right {
color: #356899;
}
.hd { .hd {
width: 100%; width: 100%;
background: #fff; background: #fff;

@ -0,0 +1,170 @@
<script setup lang="ts">
import { getListAssembleReportApi } from '@/services/assembleReport'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { useLoginStore } from '@/stores/modules/login'
//
const isLoading = ref(false)
const userStore = useLoginStore()
const userId = userStore.userInfo.userId
//
const queryParams: Required<any> = {
pageNo: 1,
pageSize: 5,
owner: userId,
type: 'ASSEMBLE'
}
onLoad(() => {
getData()
})
const dataList = ref([])
const getData = async () => {
try {
const data = await getListAssembleReportApi(queryParams)
//
dataList.value.push(...data.list)
//
if (queryParams.pageNo < data.totalPages) {
//
queryParams.pageNo++
} else {
//
isFinish.value = true
}
} catch (error) {
isLoading.value = false
}
}
//
const isFinish = ref(false)
//
const isTriggered = ref(false)
//
const onRefresherrefresh = async () => {
//
isTriggered.value = true
//
queryParams.pageNo = 1
dataList.value = []
isFinish.value = false
//
await getData()
//
isTriggered.value = false
}
</script>
<template>
<view class="viewport">
<scroll-view enable-back-to-top scroll-y class="data-list" refresher-enabled :refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
<view class="list-item" v-for="(item, index) in dataList" :key="item.dispatchId">
<view class="item-hd">
<view class="index">{{ index + 1 }}</view>
<view class="assembleCode">包装条形码{{ item.assembleCode}}</view>
<view class="del" @tap="onDel(index)"><uni-icons type="trash" size="26"></uni-icons></view>
</view>
<view class="code label">产品编码: {{ item.projectSubCode }}</view>
<view class="name label">产品名称: {{ item.projectSubName }}</view>
<view class="procedureName label">报工工序: {{ item.procedureName }}</view>
<view class="code label">报工数量: {{ item.amount }}</view>
<view class="ownerName label">报工人: {{ item.ownerName }}</view>
</view>
<!-- 底部提示文字 -->
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
{{ isFinish ? '没有更多数据~' : '正在加载...' }}
</view>
</scroll-view>
</view>
</template>
<style lang="scss">
page {
height: 100%;
}
.viewport {
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
background: #F0F6FC;
.status_bar {
height: var(--status-bar-height);
width: 100%;
}
/* 自定义导航栏 */
.status_title {
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 44px;
padding: 0 16px;
background-color: #FFFFFF;
}
.status_left {
width: 18px !important;
}
.status_center {
font-size: 17px;
font-weight: 700;
}
.status_right {
color: #356899;
}
.data-list {
padding: 20rpx 0rpx;
overflow: auto;
.list-item {
background-color: #fff;
margin: 20rpx 0;
color: #737D88;
font-size: 32rpx;
padding: 10rpx 20rpx;
.item-hd {
display: flex;
margin: 20rpx 0;
padding: 10rpx 0;
padding-right: 40rpx;
justify-content: space-between;
align-items: center;
border-bottom: 2rpx solid #F2F2F2;
background: #F6F9F3;
.index {
width: 40rpx;
background: #3AC33D;
color: #015C03;
display: flex;
align-items: center;
justify-content: center;
}
.assembleCode {
flex: 1;
text-align: left;
color: #0D0D26;
font-size: 30rpx;
padding-left: 10rpx;
}
.del {
width: 40rpx;
}
}
.label {
line-height: 60rpx;
font-size: 28rpx;
}
}
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
}
}
</style>

@ -50,7 +50,6 @@ const handleToBooking = (item: Object) => {
<image v-if="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image> <image v-if="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
</view> </view>
</view> </view>
</template> </template>
<view v-else class="empty-data"> <view v-else class="empty-data">
<image class="icon" src="/static/images/home-empty.png" mode="aspectFit"></image> <image class="icon" src="/static/images/home-empty.png" mode="aspectFit"></image>

@ -4,6 +4,7 @@
border-radius: 4rpx; border-radius: 4rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
min-height: 80vh;
.module { .module {
width: 100%; width: 100%;
margin: 10rpx 0; margin: 10rpx 0;

@ -4,6 +4,7 @@
border-radius: 4rpx; border-radius: 4rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
min-height: 80vh;
} }
.category .module { .category .module {

@ -51,7 +51,7 @@ const getListData = async () => {
// //
dataList.value.push(...data.list) dataList.value.push(...data.list)
// //
if (queryParams.pageNo < data.total) { if (queryParams.pageNo < data.totalPages) {
// //
queryParams.pageNo++ queryParams.pageNo++
} else { } else {

@ -318,7 +318,7 @@ const handleStop = async () => {
.product-status { .product-status {
width: 140rpx; width: 140rpx;
border-raduis: 10rpx; border-radius: 10rpx;
text-align: center; text-align: center;
padding: 8rpx 12rpx; padding: 8rpx 12rpx;
&.had { &.had {

@ -56,7 +56,7 @@ const getListData = async () => {
// //
dataList.value.push(...data.list) dataList.value.push(...data.list)
// //
if (queryParams.pageNo < data.total) { if (queryParams.pageNo < data.totalPages) {
// //
queryParams.pageNo++ queryParams.pageNo++
} else { } else {

@ -0,0 +1,16 @@
/*
* @Author:
* @Date: 2024-01-04 12:54:56
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-05-11 09:11:41
* @FilePath: /app-nx-personal/src/services/home.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http } from '@/utils/http'
export const appUpdateApi = () => {
return http<any[]>({
method: 'GET',
url: '/biz/app/latest',
})
}

@ -2,7 +2,7 @@
* @Author: * @Author:
* @Date: 2024-01-04 12:54:56 * @Date: 2024-01-04 12:54:56
* @LastEditors: jevononlie 728254585@qq.com * @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-05-10 16:59:03 * @LastEditTime: 2024-05-11 17:50:07
* @FilePath: /app-nx-personal/src/services/home.ts * @FilePath: /app-nx-personal/src/services/home.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -23,3 +23,11 @@ export const postSubmitAssembleReportApi = (data: Object) => {
data, data,
}) })
} }
// 报工记录分页查询
export const getListAssembleReportApi = (data: Object) => {
return http<any[]>({
method: 'GET',
url: '/biz/task-report/page',
data,
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

@ -13,7 +13,6 @@
import { useLoginStore } from '@/stores/modules/login' import { useLoginStore } from '@/stores/modules/login'
import { serviceDomain } from '@/services/constants' import { serviceDomain } from '@/services/constants'
const baseURL = serviceDomain + '/admin-api' const baseURL = serviceDomain + '/admin-api'
const loginStore = useLoginStore()
// 添加拦截器 // 添加拦截器
const httpInterceptor = { const httpInterceptor = {
// 拦截前触发 // 拦截前触发
@ -32,9 +31,9 @@ const httpInterceptor = {
'tenant-id': 2, 'tenant-id': 2,
} }
// 4. 添加 token 请求头标识 // 4. 添加 token 请求头标识
const userStore = useLoginStore()
const storage_token = uni.getStorageSync('storage_loginInfo')?.accessToken const storage_token = uni.getStorageSync('storage_loginInfo')?.accessToken
const token = loginStore.userInfo?.accessToken || storage_token const token = userStore.userInfo?.accessToken || storage_token
if (token) { if (token) {
options.header.Authorization = token options.header.Authorization = token
} }
@ -69,8 +68,8 @@ function ajaxError(data) {
icon: 'none', icon: 'none',
complete() { complete() {
if (data.code === 600 || data.code === 601 || data.code === 602) { if (data.code === 600 || data.code === 601 || data.code === 602) {
const memberStore = useMemberStore() const loginStore = useLoginStore()
memberStore.clearProfile() loginStore.clearProfile()
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}) })
@ -82,6 +81,7 @@ function ajaxError(data) {
export const http = <T>(options: UniApp.RequestOptions) => { export const http = <T>(options: UniApp.RequestOptions) => {
// 1. 返回 Promise 对象 // 1. 返回 Promise 对象
return new Promise<Data<T>>((resolve, reject) => { return new Promise<Data<T>>((resolve, reject) => {
const loginStore = useLoginStore()
uni.request({ uni.request({
...options, ...options,
// 响应成功 // 响应成功

@ -2,7 +2,7 @@
* @Author: * @Author:
* @Date: 2024-01-04 12:54:56 * @Date: 2024-01-04 12:54:56
* @LastEditors: jevononlie 728254585@qq.com * @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-04-07 09:36:33 * @LastEditTime: 2024-05-11 09:13:18
* @FilePath: /app-nx-personal/src/utils/index.ts * @FilePath: /app-nx-personal/src/utils/index.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -30,40 +30,44 @@ export const formatDate = (datePramas: Date, format = 'YYYY-MM-DD HH:mm:ss') =>
.replace('mm', minutes) .replace('mm', minutes)
.replace('ss', seconds) .replace('ss', seconds)
} }
import { serviceDomain } from '@/services/constants'
/** /**
* *
* *
* @return {[type]} [return description] * @return {[type]} [return description]
*/ */
export const updateManager = () => { export const updateManager = () => {
// const updateManager = uni.getUpdateManager() // 小程序版本更新管理器 const baseURL = serviceDomain + '/admin-api'
// updateManager.onCheckForUpdate((res) => { // #ifdef MP-WEIXIN
// // 检测新版本后的回调 const updateManager = uni.getUpdateManager() // 小程序版本更新管理器
// if (res.hasUpdate) { updateManager.onCheckForUpdate((res) => {
// // 如果有新版本提醒并进行强制升级 // 检测新版本后的回调
// uni.showModal({ if (res.hasUpdate) {
// content: '新版本已经准备好,是否重启应用?', // 如果有新版本提醒并进行强制升级
// showCancel: false, uni.showModal({
// confirmText: '确定', content: '新版本已经准备好,是否重启应用?',
// success: (res) => { showCancel: false,
// if (res.confirm) { confirmText: '确定',
// updateManager.onUpdateReady((res) => { success: (res) => {
// // 新版本下载完成的回调 if (res.confirm) {
// updateManager.applyUpdate() // 强制当前小程序应用上新版本并重启 updateManager.onUpdateReady((res) => {
// }) // 新版本下载完成的回调
updateManager.applyUpdate() // 强制当前小程序应用上新版本并重启
})
// updateManager.onUpdateFailed((res) => { updateManager.onUpdateFailed((res) => {
// // 新版本下载失败的回调 // 新版本下载失败的回调
// // 新版本下载失败,提示用户删除后通过冷启动重新打开 // 新版本下载失败,提示用户删除后通过冷启动重新打开
// uni.showModal({ uni.showModal({
// content: '下载失败,请删除当前小程序后重新打开', content: '下载失败,请删除当前小程序后重新打开',
// showCancel: false, showCancel: false,
// confirmText: '知道了', confirmText: '知道了',
// }) })
// }) })
// } }
// }, },
// }) })
// } }
// }) })
// #endif
} }

Loading…
Cancel
Save