jevononlie 5 months ago
parent db3edeb760
commit 2ce1594481

@ -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-11 17:16:10 * @LastEditTime: 2024-05-14 13:41:07
* @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
--> -->
@ -12,29 +12,29 @@ import { appUpdateApi } from '@/services/appUpdate'
onLaunch(async () => { onLaunch(async () => {
console.log('App Launch') console.log('App Launch')
//#ifdef APP-PLUS //#ifdef APP-PLUS
let version = '';
let appid = '', version = '';
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) { plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
if (wgtinfo.version) { if (wgtinfo.version) {
appid = wgtinfo.appid
version = wgtinfo.version version = wgtinfo.version
} else { } else {
appid = plus.runtime.appid
version = plus.runtime.version version = plus.runtime.version
} }
}); });
console.log('App Show-----',version)
const params = { // const params = { //
'appId': appid appId: 'com.chanko.yunxi.mes.android'
} }
const res = await appUpdateApi(params) const res = await appUpdateApi(params)
if (res.data.versionId !== version) { console.log('App Show-----', res)
if (res.versionId !== version) {
uni.showModal({ // uni.showModal({ //
title: '更新提示', title: '更新提示',
content: res.data.remark, showCancel: false,
content: res.remark || '有新版本更新,请点击确定下载',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
plus.runtime.openURL(res.data.url); plus.runtime.openURL(res.url);
} }
} }
}) })
} }
@ -42,6 +42,32 @@ onLaunch(async () => {
}) })
onShow(() => { onShow(() => {
console.log('App Show') 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(() => { onHide(() => {
console.log('App Hide') console.log('App Hide')

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

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

@ -2,7 +2,7 @@
* @Author: 王文杰 * @Author: 王文杰
* @Date: 2024-03-04 14:13:16 * @Date: 2024-03-04 14:13:16
* @LastEditors: jevononlie 728254585@qq.com * @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 * @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 * @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<{ const props = defineProps<{
list: Object[] 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) => { const handleToBooking = (item: Object) => {
if (item.auth) { if (item.auth) {
const path = item.path const path = item.path
@ -36,18 +27,12 @@ const handleToBooking = (item: Object) => {
<template> <template>
<view class="category"> <view class="category">
<template v-if="list.length"> <template v-if="list.length">
<view class="module" v-show="listZL.length"> <view class="module" v-for="item in list">
<view class="module-title">质量模块</view> <view class="module-title">{{ item.key=="quality" ? '质量模块' : '生产模块'}}</view>
<view class="category-item" hover-class="none" v-for="item in listZL" :key="item.path" <view class="category-item" hover-class="none" v-for="item2 in item.children" :key="item2.path"
@click="handleToBooking(item)"> @click="handleToBooking(item2)">
<image v-show="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image> <image v-if="item2.auth" class="icon" :src="item2.imgUrl" mode="scaleToFill"></image>
</view> <image v-else class="icon" :src="item2.defaultImgUrl" mode="scaleToFill"></image>
</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> </view>
</view> </view>
</template> </template>

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

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

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

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