jevononlie 5 months ago
parent db3edeb760
commit 2ce1594481

@ -2,7 +2,7 @@
* @Author: 王文杰
* @Date: 2024-01-04 12:54:56
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-05-11 17:16:10
* @LastEditTime: 2024-05-14 13:41:07
* @FilePath: /app-nx-personal/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -12,29 +12,29 @@ import { appUpdateApi } from '@/services/appUpdate'
onLaunch(async () => {
console.log('App Launch')
//#ifdef APP-PLUS
let appid = '', version = '';
let 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
}
});
console.log('App Show-----',version)
const params = { //
'appId': appid
appId: 'com.chanko.yunxi.mes.android'
}
const res = await appUpdateApi(params)
if (res.data.versionId !== version) {
console.log('App Show-----', res)
if (res.versionId !== version) {
uni.showModal({ //
title: '更新提示',
content: res.data.remark,
showCancel: false,
content: res.remark || '有新版本更新,请点击确定下载',
success: (res) => {
if (res.confirm) {
plus.runtime.openURL(res.data.url);
}
plus.runtime.openURL(res.url);
}
}
})
}
@ -42,6 +42,32 @@ onLaunch(async () => {
})
onShow(() => {
console.log('App Show')
let version = '';
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
if (wgtinfo.version) {
version = wgtinfo.version
} else {
version = plus.runtime.version
}
});
console.log('App Show-----',version)
const params = { //
appId: 'com.chanko.yunxi.mes.android'
}
const res = await appUpdateApi(params)
console.log('App Show-----', res)
if (res.versionId !== version) {
uni.showModal({ //
title: '更新提示',
showCancel: false,
content: res.remark || '有新版本更新,请点击确定下载',
success: (res) => {
if (res.confirm) {
plus.runtime.openURL(res.url);
}
}
})
}
})
onHide(() => {
console.log('App Hide')

@ -5,7 +5,7 @@ import { ref } from 'vue'
const isLoading = ref(false)
//
const onSubmit = async () => {
if (isLoading.value) {
if (isLoading.value || !listReport.value.length) {
return
}
isLoading.value = true
@ -14,16 +14,33 @@ const onSubmit = async () => {
const params = {
taskReportAssembleVOList: listReport.value,
}
console.log(params)
const res = await postSubmitAssembleReportApi(params)
isLoading.value = false
uni.showToast({
icon: 'none',
duration: 3000,
title: '提交成功',
})
listReport.value = []
} catch (error) {
isLoading.value = false
}
}
const onClear = async () => {
listReport.value.splice(0, listReport.value.length)
if (!listReport.value.length) {
return
}
uni.showModal({
content: '是否清空所有包装条形码,是否确定继续?',
confirmColor: '#3775F6',
success: async (res) => {
if (res.confirm) {
listReport.value.splice(0, listReport.value.length)
}
},
})
}
const onDel = async (idx) => {
uni.showModal({
@ -89,9 +106,11 @@ const handleList = ()=> {
</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 class="item-row">
<view class="procedureName label">报工工序: {{ item.procedureName }}</view>
<view class="code label">报工数量: {{ item.amount }}</view>
<view class="ownerName label">报工人: {{ item.ownerName }}</view>
</view>
</view>
</view>
<view class="foot">
@ -173,7 +192,7 @@ page {
background: #F6F9F3;
.index {
width: 40rpx;
background: #3AC33D;
background: #c1e2c2;
color: #015C03;
display: flex;
align-items: center;
@ -190,6 +209,11 @@ page {
width: 40rpx;
}
}
.item-row {
display: flex;
justify-content: space-between;
padding-right: 20rpx;
}
.label {
line-height: 60rpx;
font-size: 28rpx;

@ -2,9 +2,8 @@
import { getListAssembleReportApi } from '@/services/assembleReport'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { formatDate } from '@/utils/index'
import { useLoginStore } from '@/stores/modules/login'
//
const isLoading = ref(false)
const userStore = useLoginStore()
const userId = userStore.userInfo.userId
//
@ -17,10 +16,22 @@ const queryParams: Required<any> = {
onLoad(() => {
getData()
})
//
const isFinish = ref(false)
const isLoading = ref(false)
const dataList = ref([])
const getData = async () => {
try {
if (isLoading.value) return
if (isFinish.value === true) {
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
}
isLoading.value = true
const data = await getListAssembleReportApi(queryParams)
isLoading.value = false
data.list.forEach((e) => {
e.createTime = formatDate(e.createTime, 'YYYY-MM-DD')
})
//
dataList.value.push(...data.list)
//
@ -35,8 +46,6 @@ const getData = async () => {
isLoading.value = false
}
}
//
const isFinish = ref(false)
//
const isTriggered = ref(false)
//
@ -56,17 +65,20 @@ const onRefresherrefresh = async () => {
<template>
<view class="viewport">
<scroll-view enable-back-to-top scroll-y class="data-list" refresher-enabled :refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
@refresherrefresh="onRefresherrefresh" @scrolltolower="getData">
<view class="list-item" v-for="(item, index) in dataList" :key="item.dispatchId">
<view class="item-hd">
<view class="index">{{ dataList.length - index }}</view>
<view class="assembleCode">包装条形码{{ item.assembleCode}}</view>
</view>
<view class="time label">报工时间: {{ item.createTime }}</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 class="item-row">
<view class="procedureName label">报工工序: {{ item.procedureName }}</view>
<view class="code label">报工数量: {{ item.amount }}</view>
<view class="ownerName label">报工人: {{ item.ownerName }}</view>
</view>
</view>
<!-- 底部提示文字 -->
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
@ -136,7 +148,7 @@ page {
background: #F6F9F3;
.index {
width: 40rpx;
background: #3AC33D;
background: #c1e2c2;
color: #015C03;
display: flex;
align-items: center;
@ -153,6 +165,11 @@ page {
width: 40rpx;
}
}
.item-row {
display: flex;
justify-content: space-between;
padding-right: 20rpx;
}
.label {
line-height: 60rpx;
font-size: 28rpx;

@ -2,7 +2,7 @@
* @Author: 王文杰
* @Date: 2024-03-04 14:13:16
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-05-13 15:24:50
* @LastEditTime: 2024-05-14 11:08:27
* @FilePath: /app-nx-personal/src/pages/index/components/CategoryPanel.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -13,15 +13,6 @@ import { computed } from 'vue'
const props = defineProps<{
list: Object[]
}>()
const listZL = computed(() => {
const res = props.list.filter(e => e.path == 'unqualifiedNotification')
return res
})
const listSC = computed(() => {
const res = props.list.filter(e => e.path == 'productionReport' || e.path == 'assembleReport')
return res
})
const handleToBooking = (item: Object) => {
if (item.auth) {
const path = item.path
@ -36,18 +27,12 @@ const handleToBooking = (item: Object) => {
<template>
<view class="category">
<template v-if="list.length">
<view class="module" v-show="listZL.length">
<view class="module-title">质量模块</view>
<view class="category-item" hover-class="none" v-for="item in listZL" :key="item.path"
@click="handleToBooking(item)">
<image v-show="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
</view>
</view>
<view class="module" v-show="listSC.length">
<view class="module-title">生产模块</view>
<view class="category-item" hover-class="none" v-for="item in listSC" :key="item.path"
@click="handleToBooking(item)">
<image v-show="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
<view class="module" v-for="item in list">
<view class="module-title">{{ item.key=="quality" ? '质量模块' : '生产模块'}}</view>
<view class="category-item" hover-class="none" v-for="item2 in item.children" :key="item2.path"
@click="handleToBooking(item2)">
<image v-if="item2.auth" class="icon" :src="item2.imgUrl" mode="scaleToFill"></image>
<image v-else class="icon" :src="item2.defaultImgUrl" mode="scaleToFill"></image>
</view>
</view>
</template>

@ -10,25 +10,35 @@ import { getHomeCategoryAPI } from '@/services/home'
//
const categoryList = ref([
{
path: 'unqualifiedNotification',
name: '品质异常通知',
auth: false,
imgUrl: '/static/images/unqualifiedNotification.png',
defaultImgUrl: '/static/images/unqualifiedNotification-default.png',
key: 'quality',
children: [
{
path: 'unqualifiedNotification',
name: '品质异常通知',
auth: false,
imgUrl: '/static/images/unqualifiedNotification.png',
defaultImgUrl: '/static/images/unqualifiedNotification-default.png',
},
]
},
{
path: 'productionReport',
name: '生产报工',
auth: false,
imgUrl: '/static/images/productionReport.png',
defaultImgUrl: '/static/images/productionReport-default.png',
},
{
path: 'assembleReport',
name: '包装报工',
auth: false,
imgUrl: '/static/images/assembleReport.png',
defaultImgUrl: '/static/images/assembleReport-default.png',
key: 'product',
children: [
{
path: 'productionReport',
name: '生产报工',
auth: false,
imgUrl: '/static/images/productionReport.png',
defaultImgUrl: '/static/images/productionReport-default.png',
},
{
path: 'assembleReport',
name: '包装报工',
auth: false,
imgUrl: '/static/images/assembleReport.png',
defaultImgUrl: '/static/images/assembleReport-default.png',
}
]
}
])
const loginStore = useLoginStore()
@ -45,7 +55,9 @@ onShow(async() => {
await getHomeCategory()
} else {
categoryList.value.forEach((e) => {
e.auth = true
e.children.forEach(q => {
q.auth = true
})
})
}
})
@ -56,9 +68,12 @@ const getHomeCategory = async () => {
const menus = data?.menus.find((e) => e.path == '/applet')?.children || []
if (menus.length) {
const arr = []
categoryList.value.forEach((e) => {
const target = menus.find((q) => q.path == e.path)
e.auth = !!target
e.children.forEach(q => {
const target = menus.find((c) => c.path == q.path)
q.auth = !!target
})
})
}
if (loginStore.userInfo.userId) {
@ -74,7 +89,8 @@ const getHomeCategory = async () => {
<template>
<view class="viewport">
<template v-if="isLoading">
<PageSkeleton />
<!-- <PageSkeleton /> -->
<view class="loading-text">拼命加载中...</view>
</template>
<template v-else>
<CustomNavbar />
@ -100,6 +116,12 @@ page {
.cont {
//margin: 100rpx 0;
}
.loading-text {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
</style>

@ -122,9 +122,8 @@ defineExpose({ updateData })
<view class="label">类型<text class="blue">{{ item.type }}</text></view>
</view>
</view>
<view class="product-item">生产订单号<text class="blue">{{ item.projectId || '' }}</text></view>
<view class="product-item">产品信息<text class="blue">{{ item.projectCode || '' }} {{ ' ' +
item.procedureName }} {{ ' ' +
<view class="product-item">生产订单号<text class="blue">{{ item.projectCode || '' }}</text></view>
<view class="product-item">产品信息<text class="blue">{{ item.projectSubName + ' ' +
item.spec }}</text></view>
<view class="product-row">
<view class="row-item">

@ -62,7 +62,7 @@ const getProjectChildData = async (projectOrderId) => {
const arr = []
data.forEach(e => {
const obj = {
text: e.projectSubName + '/' + e.projectSubCode,
text: e.projectSubName,
value: e.id,
spec: e.spec
}
@ -174,9 +174,9 @@ const rules: UniHelper.UniFormsRules = {
procedureId: {
rules: [{ required: true, errorMessage: '请选择子责任工序' }],
},
// workshopId: {
// rules: [{ required: true, errorMessage: '' }],
// },
workshopId: {
rules: [{ required: true, errorMessage: '请选择子生产车间' }],
},
amount: {
rules: [{ required: true, errorMessage: '请输入异常常量' }],
},
@ -280,7 +280,7 @@ const selectConfirm = (val: string)=>{
<uni-forms-item label="规格/型号" name="">
<uni-easyinput type="text" disabled :value="valiFormData.spec" />
</uni-forms-item>
<uni-forms-item label="生产车间" name="workshopId">
<uni-forms-item label="生产车间" required name="workshopId">
<uni-data-select v-model="valiFormData.workshopId" :localdata="workshopsData"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="责任工序" required name="procedureId">
@ -314,7 +314,7 @@ const selectConfirm = (val: string)=>{
<style lang="scss" scoped>
//
.data-detail {
max-height: 60vh;
max-height: 90vh;
overflow: auto;
overflow: auto;
z-index: 9999;

@ -8,9 +8,10 @@
*/
import { http } from '@/utils/http'
export const appUpdateApi = () => {
export const appUpdateApi = (data: any) => {
return http<any[]>({
method: 'GET',
url: '/biz/app/latest',
data
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Loading…
Cancel
Save