diff --git a/mes-ui/uni-app/src/App.vue b/mes-ui/uni-app/src/App.vue index 1733bfb2..273c01a3 100644 --- a/mes-ui/uni-app/src/App.vue +++ b/mes-ui/uni-app/src/App.vue @@ -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') diff --git a/mes-ui/uni-app/src/pages/assembleReport/assembleReport.vue b/mes-ui/uni-app/src/pages/assembleReport/assembleReport.vue index b80952bf..c0c51d94 100644 --- a/mes-ui/uni-app/src/pages/assembleReport/assembleReport.vue +++ b/mes-ui/uni-app/src/pages/assembleReport/assembleReport.vue @@ -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 = ()=> { 产品编码: {{ item.projectSubCode }} 产品名称: {{ item.projectSubName }} - 报工工序: {{ item.procedureName }} - 报工数量: {{ item.amount }} - 报工人: {{ item.ownerName }} + + 报工工序: {{ item.procedureName }} + 报工数量: {{ item.amount }} + 报工人: {{ item.ownerName }} + @@ -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; diff --git a/mes-ui/uni-app/src/pages/assembleReport/list.vue b/mes-ui/uni-app/src/pages/assembleReport/list.vue index 167e40ef..bece9931 100644 --- a/mes-ui/uni-app/src/pages/assembleReport/list.vue +++ b/mes-ui/uni-app/src/pages/assembleReport/list.vue @@ -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 = { 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 () => {