Commit 98199c04 by LJM

供应链后台--新增app更新管理页面

parent b3029fd9
<script> <script>
export default { import { API } from '@/util/api.js';
onLaunch: function() { export default {
console.log('App Launch'); onLaunch: function() {
}, console.log('App Launch');
onShow: function() { },
console.log('App Show'); onShow: function() {
}, // #ifdef APP-PLUS
onHide: function() { var wms_version = uni.getStorageSync('wms_version') || '';
console.log('App Hide'); this.request(API.getAppLatestVersion, 'POST', {}, false).then(res => {
} if (res.err_code === 0) {
}; //判断是否跟线上版本一样
if (wms_version != res.data.version) {
uni.showModal({
title: '更新提示',
content: res.data.remark,
confirmText: '确定更新',
cancelText: '取消更新',
success: data => {
if (data.confirm) {
uni.setStorageSync('wms_version', res.data.version); //更新本地存储最新版本号
this.downloadApk(res.data.download_url); //开始下载apk文件
console.log('用户点击确定');
} else if (data.cancel) {}
}
});
}
}
});
// #endif
},
onHide: function() {
console.log('App Hide');
},
methods: {
//下载apk文件
downloadApk(url) {
uni.showLoading({
title: '下载安装文件',
mask: true
});
let dtask = plus.downloader.createDownload(url, {}, (d, status) => {
if (status == 200) {
uni.hideLoading();
//下载成功后调用安装方法
this.installApk(d.filename);
} else {
uni.showToast({
title: '下载失败',
icon: 'error'
});
console.log('下载失败');
}
});
dtask.start();
},
//安装apk文件
installApk(filePath) {
plus.runtime.install(
filePath, {},
() => {
console.log('更新成功');
},
e => {
console.log('安装失败:' + JSON.stringify(e));
}
);
}
}
};
</script> </script>
<style> <style>
@import './assets/css/font.css'; @import './assets/css/font.css';
page {
height: 100%; page {
background: #f1f4f6; height: 100%;
} background: #f1f4f6;
</style> }
</style>
\ No newline at end of file
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<!-- 左侧 --> <!-- 左侧 -->
<view class="bar" style="width: 60%;"> <view class="bar" style="width: 60%;">
<template v-if="curr == 3"> <template v-if="curr == 3">
<view class="t1 mb16">{{item.abnormal_batch}}{{item.sync_status_cn}} {{item.tally_status_cn || ''}}</view> <view class="t1 mb16" style="white-space: nowrap;">{{item.abnormal_batch}}{{item.sync_status_cn}} {{item.tally_status_cn || ''}}</view>
</template> </template>
<template v-else> <template v-else>
<view class="t1 mb16">{{item.abnormal_batch}}</view> <view class="t1 mb16">{{item.abnormal_batch}}</view>
...@@ -358,8 +358,8 @@ ...@@ -358,8 +358,8 @@
* 异常型号装箱 1装箱 0去除 * 异常型号装箱 1装箱 0去除
*/ */
submitAbnormalBox(type, wstydl_id, item) { submitAbnormalBox(type, wstydl_id, item) {
//装箱的时候验证
if (type == 1) { if (type == 1) {
//装箱的时候验证
if (!this.box_sn) { if (!this.box_sn) {
uni.showModal({ uni.showModal({
title: '', title: '',
...@@ -369,11 +369,10 @@ ...@@ -369,11 +369,10 @@
return false; return false;
} }
} else if (type == 0) { } else if (type == 0) {
//取出 //取出逻辑
//明细为未推送、推送失败:该箱已封箱,是否确认取出?确认后,则将该物料从箱子中剔除,回到异常待装箱中 //明细为未推送、推送失败:该箱已封箱,是否确认取出?确认后,则将该物料从箱子中剔除,回到异常待装箱中
if (item.tally_status == 2 && (item.sync_status == 1 || item.sync_status == 4)) { if (item.tally_status == 2 && (item.sync_status == 1 || item.sync_status == 4)) {
uni.showModal({ uni.showModal({
title: '',
content: '该箱已封箱,是否确认取出?确认后,则将该物料从箱子中剔除,回到异常待装箱中', content: '该箱已封箱,是否确认取出?确认后,则将该物料从箱子中剔除,回到异常待装箱中',
confirmText: '确认取出', confirmText: '确认取出',
success: (res) => { success: (res) => {
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</template> </template>
<view class="pb16 row"> <view class="pb16 row">
<text class="t3 w130">订单备注:</text> <text class="t3 w130">订单备注:</text>
<text class="desc">{{item.order_remark || '这是订单备注这是订单备注这是订单备注这是订单备注这是订单备注'}}</text> <text class="desc">{{item.order_remark}}</text>
</view> </view>
<view class="pb16 row verCenter"> <view class="pb16 row verCenter">
<!-- 已入库数量 --> <!-- 已入库数量 -->
......
...@@ -321,7 +321,11 @@ const API = { ...@@ -321,7 +321,11 @@ const API = {
/** /**
* 获取货品 * 获取货品
*/ */
getBoxData: API_BASE + '/supplywechatwms/getBoxData' getBoxData: API_BASE + '/supplywechatwms/getBoxData',
/**
* 获取app版本
*/
getAppLatestVersion: API_BASE + '/supplywechatwms/getAppLatestVersion'
} }
......
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