Commit 5fce9aaf by liangjianmin

fix(app): 在生产环境检查应用更新并优化首页功能入口

- App.vue中添加ENV变量判断,只在生产环境执行版本检查逻辑
- index.vue中添加ENV变量判断,测试环境跳过更新检查,避免不必要请求
- 注释并隐藏首页“按容器上架”入口,优化UI布局
- 维护首页导航功能,更新版本检查逻辑,确保用户获取最新应用版本提示
- 优化版本检查流程,确保拉取版本信息后正确更新UI弹窗及提示
- 细节调整,提高代码健壮性及用户体验
parent 4dc9d3cc
<script> <script>
import { API } from '@/util/api.js'; import { API, ENV } from '@/util/api.js';
export default { export default {
onLaunch: function() { onLaunch: function() {
}, },
onShow: function() { onShow: function() {
if (ENV !== 'production') return;
var wms_version = uni.getStorageSync('wms_version') || ''; var wms_version = uni.getStorageSync('wms_version') || '';
this.request(API.getLatestAppInfo, 'POST', {}, false).then(res => { this.request(API.getLatestAppInfo, 'POST', {}, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
</view> </view>
<text class="text">理货</text> <text class="text">理货</text>
</navigator> </navigator>
<navigator class="box-li column rowCenter verCenter" url="/pages/putaway/pack" hover-class="none"> <!-- <navigator class="box-li column rowCenter verCenter" url="/pages/putaway/pack" hover-class="none">
<view class="box row rowCenter verCenter"> <view class="box row rowCenter verCenter">
<image src="/static/home/@2x(8).png"></image> <image src="/static/home/@2x(8).png"></image>
</view> </view>
<text class="text">按容器上架</text> <text class="text">按容器上架</text>
</navigator> </navigator> -->
<navigator class="box-li column rowCenter verCenter" url="/pages/putaway/index" hover-class="none"> <navigator class="box-li column rowCenter verCenter" url="/pages/putaway/index" hover-class="none">
<view class="box row rowCenter verCenter"> <view class="box row rowCenter verCenter">
<image src="/static/home/@2x(8).png"></image> <image src="/static/home/@2x(8).png"></image>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API, ENV } from '@/util/api.js';
import { compareVersion } from '@/util/util.js'; import { compareVersion } from '@/util/util.js';
import UpdateModal from '@/components/UpdateModal.vue'; import UpdateModal from '@/components/UpdateModal.vue';
...@@ -154,9 +154,13 @@ ...@@ -154,9 +154,13 @@
}); });
}, },
/** /**
* 检查应用更新 * 检查应用更新,测试环境跳过
*/ */
checkAppUpdate() { checkAppUpdate() {
if (ENV !== 'production') {
uni.stopPullDownRefresh();
return;
}
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, (info) => { plus.runtime.getProperty(plus.runtime.appid, (info) => {
var localVersion = info.version || '1.0.0'; var localVersion = info.version || '1.0.0';
......
...@@ -26,20 +26,6 @@ ...@@ -26,20 +26,6 @@
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text>
</view> </view>
</view> </view>
<!-- 容器选择 -->
<view class="search-box row bothSide verCenter" :class="{ 'error-style': !is_submit }">
<view class="text">容 器</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入容器编码" placeholder-style="color:#919399" v-model="searchParams.container_name" @input="handleInput(4, $event)" />
</view>
<view>
<text class="iconfont icon-juxing3" @click="createTallyContainer()"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_contaion"></text>
</view>
</view>
</view>
<!-- 详情 --> <!-- 详情 -->
<view class="section"> <view class="section">
<view class="field-item row" v-if="detail"> <view class="field-item row" v-if="detail">
...@@ -382,7 +368,7 @@ ...@@ -382,7 +368,7 @@
<text class="check-box-icon" :class="{ curr: is_batch_flag }"></text> <text class="check-box-icon" :class="{ curr: is_batch_flag }"></text>
<text class="text">按标准包装量分批</text> <text class="text">按标准包装量分批</text>
</view> </view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }" style="width: 30%;">理 货</view> <view class="btn2 row rowCenter verCenter" @click="createTallyReceive" style="width: 30%;">理 货</view>
</template> </template>
<!-- 无标准包装量 --> <!-- 无标准包装量 -->
<template v-else> <template v-else>
...@@ -398,7 +384,7 @@ ...@@ -398,7 +384,7 @@
</view> </view>
</picker> </picker>
</view> </view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }">理 货</view> <view class="btn2 row rowCenter verCenter" @click="createTallyReceive">理 货</view>
</template> </template>
</template> </template>
<!-- 非深圳自营- --> <!-- 非深圳自营- -->
...@@ -407,7 +393,7 @@ ...@@ -407,7 +393,7 @@
<text class="check-box-icon" :class="{ curr: print_flag }"></text> <text class="check-box-icon" :class="{ curr: print_flag }"></text>
<text class="text">打印入库标签</text> <text class="text">打印入库标签</text>
</view> </view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }" style="width: 60%;">理 货</view> <view class="btn2 row rowCenter verCenter" @click="createTallyReceive" style="width: 60%;">理 货</view>
</template> </template>
</view> </view>
</view> </view>
...@@ -427,7 +413,6 @@ ...@@ -427,7 +413,6 @@
is_print: false, //查询该销售单是否需要打印客户标签 is_print: false, //查询该销售单是否需要打印客户标签
coo: '', //产地 coo: '', //产地
cod: '', //COD cod: '', //COD
is_submit: true,
stock_in_item_id: '', stock_in_item_id: '',
stock_in_id: '', stock_in_id: '',
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
...@@ -435,7 +420,6 @@ ...@@ -435,7 +420,6 @@
pic_flag: false, //是否整单照片 pic_flag: false, //是否整单照片
is_batch_flag: false, //是否分批理货 is_batch_flag: false, //是否分批理货
input_flag: false, input_flag: false,
input_contaion: false,
company_id: uni.getStorageSync('company_id') || 1, //公司组织 company_id: uni.getStorageSync('company_id') || 1, //公司组织
page: 1, page: 1,
limit: 1, limit: 1,
...@@ -444,9 +428,7 @@ ...@@ -444,9 +428,7 @@
item: ['货品信息', '其他信息'], item: ['货品信息', '其他信息'],
print_style: ['基本样式', '不带D/C'], print_style: ['基本样式', '不带D/C'],
print_style_index: 0, print_style_index: 0,
indexContainer: -1,
array: ['物流单号', '入库单号', '入仓号'], array: ['物流单号', '入库单号', '入仓号'],
tallyContainer: [], //容器列表
detail: {}, //详情的数据 detail: {}, //详情的数据
image_list: [], //本地图片路径列表 image_list: [], //本地图片路径列表
server_image_list: [], //服务器图片路径列表 server_image_list: [], //服务器图片路径列表
...@@ -471,9 +453,7 @@ ...@@ -471,9 +453,7 @@
searchParams: { searchParams: {
stock_in_sn: '', //入库单号 stock_in_sn: '', //入库单号
tracking_no: '', //物流单号 tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '', //入仓单号 stock_in_with_stock_in_items_inhouse: '' //入仓单号
container_name: '', //容器编码
container_id: '' //容器id
}, },
date_code_format: '',//日期转DC格式 date_code_format: '',//日期转DC格式
formParams: { formParams: {
...@@ -495,8 +475,6 @@ ...@@ -495,8 +475,6 @@
onLoad(options) { onLoad(options) {
this.stock_in_item_id = options.stock_in_item_id || ''; this.stock_in_item_id = options.stock_in_item_id || '';
this.stock_in_id = options.stock_in_id || ''; this.stock_in_id = options.stock_in_id || '';
this.searchParams.container_name = options.container_name || '';
this.searchParams.container_id = options.container_id || '';
//快速扫描 //快速扫描
this.fastParams.flag = options.flag; this.fastParams.flag = options.flag;
this.fastParams.qty = Number(options.qty) || ''; this.fastParams.qty = Number(options.qty) || '';
...@@ -616,39 +594,10 @@ ...@@ -616,39 +594,10 @@
this.input_flag = false; this.input_flag = false;
this.stock_in_item_id = this.detail.stock_in_item_id; this.stock_in_item_id = this.detail.stock_in_item_id;
this.clearInputAndFocus(); //再次获取焦点 this.clearInputAndFocus(); //再次获取焦点
} else {
//容器以及一键理货里面的容器
this.input_contaion = false;
this.searchParams.container_name = '';
this.searchParams.container_id = '';
} }
this.getData(); this.getData();
}, },
/** /**
*刷新容器
*/
createTallyContainer(type) {
if (type == 1) {
var params = {
is_mac: 1
};
} else {
var params = {};
}
this.request(API.createTallyContainer, 'GET', params, false).then(res => {
if (res.code === 0) {
this.is_submit = true;
this.searchParams.container_name = res.data.container_sn;
this.searchParams.container_id = res.data.id;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 单号搜索 * 单号搜索
* @param {Object} event * @param {Object} event
*/ */
...@@ -682,18 +631,11 @@ ...@@ -682,18 +631,11 @@
this.searchParams.stock_in_with_stock_in_items_inhouse = val; this.searchParams.stock_in_with_stock_in_items_inhouse = val;
this.input_flag = true; this.input_flag = true;
this.getData(); this.getData();
} else if (type == 4) {
//容器
this.searchParams.container_name = val;
this.input_contaion = true;
this.getTallyContainer();
} }
} else { } else {
if (type == 1 || type == 2 || type == 3) { if (type == 1 || type == 2 || type == 3) {
this.input_flag = false; this.input_flag = false;
this.getData(); this.getData();
} else if (type == 4) {
this.input_contaion = false;
} }
} }
}, 500), }, 500),
...@@ -803,36 +745,6 @@ ...@@ -803,36 +745,6 @@
}); });
}, },
/** /**
* 获取容器列表数据
*/
getTallyContainer() {
this.request(API.getTallyContainer, 'GET', {}, false).then(res => {
if (res.code === 0) {
var name = this.searchParams.container_name;
this.is_submit = res.data.list.some(function (obj) {
return obj.name === name;
});
if (this.is_submit) {
var id = res.data.list.filter(function (item) {
if (item.name == name) {
return {
id: item.id
};
}
});
this.searchParams.container_id = id[0].id;
} else {
this.searchParams.container_id = '';
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 选择图片 * 选择图片
*/ */
chooseImageChange() { chooseImageChange() {
...@@ -942,15 +854,6 @@ ...@@ -942,15 +854,6 @@
* 理货提交 * 理货提交
*/ */
createTallyReceive() { createTallyReceive() {
// 现在需求是都去掉容器必填的验证
if (!this.is_submit) {
uni.showToast({
title: '请输入正确容器',
icon: 'error'
});
return false;
}
if (!this.formParams.tally_qty) { if (!this.formParams.tally_qty) {
uni.showModal({ uni.showModal({
itle: '提示', itle: '提示',
...@@ -1034,7 +937,6 @@ ...@@ -1034,7 +937,6 @@
} }
var params = { var params = {
container_id: this.searchParams.container_id,
stock_in_id: this.stock_in_id, stock_in_id: this.stock_in_id,
stock_in_item_id: this.stock_in_item_id, stock_in_item_id: this.stock_in_item_id,
tally_qty: this.formParams.tally_qty, tally_qty: this.formParams.tally_qty,
......
...@@ -465,5 +465,6 @@ const API = { ...@@ -465,5 +465,6 @@ const API = {
module.exports = { module.exports = {
API API,
ENV
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment