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">
<!-- 已入库数量 --> <!-- 已入库数量 -->
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="btn1 row rowCenter verCenter" @click="closeBox()">重新封箱</view> <view class="btn1 row rowCenter verCenter" @click="closeBox()">重新封箱</view>
</template> </template>
<template v-else> <template v-else>
<view class="btn row rowCenter verCenter" @click="unboxing()">开 箱</view> <view class="btn row rowCenter verCenter" @click="unboxing()" v-if="box_sn && tallyData.detail && tallyData.detail.length > 0">开 箱</view>
</template> </template>
</view> </view>
</view> </view>
...@@ -64,33 +64,12 @@ ...@@ -64,33 +64,12 @@
<text class="t3 w130">金额:</text> <text class="t3 w130">金额:</text>
<text class="t4">{{item.total_price}}</text> <text class="t4">{{item.total_price}}</text>
</view> </view>
<!-- 完全理货 --> <view class="pb16 row">
<template v-if="item.tally_status == 3"> <text class="t3 w130">总数量:</text>
<view class="pb16 row"> <text class="t4">{{item.order_numbers}}</text>
<text class="t3 w130">总数量:</text> </view>
<text class="t4">{{item.order_numbers}}</text>
</view>
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<view class="pb16 row">
<text class="t3 w130">待收数量:</text>
<text class="t4">{{item.wait_tally_num}}</text>
</view>
<view class="pb16 row">
<text class="t3 w130">总数量:</text>
<text class="t4">{{item.order_numbers}}</text>
</view>
</template>
<view class="pb16 row verCenter"> <view class="pb16 row verCenter">
<!-- 完全理货 --> <text class="t3 w130">已入库数量:</text>
<template v-if="item.tally_status == 3">
<text class="t3 w130">已入库数量:</text>
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<text class="t3 w130">入库数量:</text>
</template>
<view class="input-text"> <view class="input-text">
<input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="numeric" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].tally_num" /> <input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="numeric" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].tally_num" />
</view> </view>
...@@ -98,31 +77,19 @@ ...@@ -98,31 +77,19 @@
<view class="pb16 row verCenter"> <view class="pb16 row verCenter">
<text class="t3 w130">原产地:</text> <text class="t3 w130">原产地:</text>
<view class="input-text"> <view class="input-text">
<!-- 完全理货 --> <input class="uni-input" placeholder="选择产地" placeholder-style="color:#000;font-weight: bold;" disabled="" v-model="form[index].origin" />
<template v-if="item.tally_status == 3">
<input class="uni-input" placeholder="选择产地" placeholder-style="color:#000;font-weight: bold;" disabled="" v-model="form[index].origin" />
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<input class="uni-input" placeholder="选择产地" placeholder-style="color:#000;font-weight: bold;" disabled="" @click="open(index)" v-model="form[index].origin" />
</template>
</view> </view>
</view> </view>
<view class="pb16 row verCenter"> <view class="pb16 row verCenter">
<text class="t3 w130">净重:</text> <text class="t3 w130">净重:</text>
<view class="input-text"> <view class="input-text">
<input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="decimal" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].net_weight" /> <input class="uni-input" disabled="true" type="number" inputmode="decimal" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].net_weight" />
</view> </view>
</view> </view>
<view class="pb16 row verCenter"> <view class="pb16 row verCenter">
<text class="t3 w130">备注:</text> <text class="t3 w130">备注:</text>
<view class="input-text"> <view class="input-text">
<template v-if="item.tally_status == 3"> <input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" @click="viewChange(form[index].remark)" />
<input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" @click="viewChange(form[index].remark)" />
</template>
<template v-else>
<input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" />
</template>
</view> </view>
</view> </view>
<view class="pb16 row verCenter"> <view class="pb16 row verCenter">
...@@ -131,28 +98,13 @@ ...@@ -131,28 +98,13 @@
<template v-if="image_list.length > 0"> <template v-if="image_list.length > 0">
<view class="pic-box" v-for="(v, i) in image_list[index]" :key="i"> <view class="pic-box" v-for="(v, i) in image_list[index]" :key="i">
<image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(image_list[index], i)"></image> <image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(image_list[index], i)"></image>
<template v-if="item.tally_status != 3">
<view class="delete row rowCenter verCenter" @click="deletePic(index,i)"><text class="iconfont icon-shanchu"></text></view>
</template>
</view> </view>
</template> </template>
<template v-if="item.tally_status == 3"> <view class="default row rowCenter verCenter" v-if="image_list[index].length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
<view class="default row rowCenter verCenter" v-if="image_list[index].length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</template>
<template v-else>
<view class="default row rowCenter verCenter" @click="chooseImageChange(index)" v-if="image_list[index].length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</template>
</view> </view>
</view> </view>
<view class="row" style="justify-content: flex-end;"> <view class="row" style="justify-content: flex-end;">
<!-- 完全理货 --> <view class="btn row rowCenter verCenter disabled" @click="cancelTallyDetail(index)">取消理货</view>
<template v-if="item.tally_status == 3">
<view class="btn row rowCenter verCenter disabled" @click="cancelTallyDetail(index)">取消理货</view>
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<view class="btn row rowCenter verCenter" @click="submitTallyDetail(index)">提 交</view>
</template>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -647,7 +599,7 @@ ...@@ -647,7 +599,7 @@
if (res.err_code === 0) { if (res.err_code === 0) {
this.tallyData = res.data; this.tallyData = res.data;
if (res.data.detail.length > 0) { if (res.data.detail.length > 0) {
this.getOriginCn(); //获取产地 // this.getOriginCn(); //获取产地
// 使用 map 方法生成表单数组 // 使用 map 方法生成表单数组
this.form = res.data.detail.map((item) => ({ this.form = res.data.detail.map((item) => ({
...@@ -770,8 +722,32 @@ ...@@ -770,8 +722,32 @@
* 理货明细撤销 * 理货明细撤销
*/ */
cancelTallyDetail(index) { cancelTallyDetail(index) {
//若该箱状态为“已封箱”则,则需校验该物料明细的推送状态
//A、若该箱状态为“理货中”则,直接取消成功。
if (this.tallyData.tally_status == 1) {
//执行关单封箱弹窗毛重填写
this.$refs.canelInputDialog.open();
this.formIndex = index;
return false;
}
//B、若该箱状态为“已封箱”则,则需校验该物料明细的推送状态
if (this.tallyData.tally_status == 2) { if (this.tallyData.tally_status == 2) {
//明细为推送成功、推送中:该物料已推送金蝶,请联系关务取消推送再进行取出
if (this.form[index].sync_status == 2 || this.form[index].sync_status == 3) {
uni.showModal({
content: '该物料已推送金蝶,请联系关务取消推送再进行取出',
success: (res) => {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
return false;
}
//明细为未推送、推送失败:则提示该箱已封箱,是否确认取出?确认后,则将该物料从箱子中剔除,回到异常待装箱中
if (this.form[index].sync_status == 1 || this.form[index].sync_status == 4) { if (this.form[index].sync_status == 1 || this.form[index].sync_status == 4) {
uni.showModal({ uni.showModal({
title: '', title: '',
...@@ -779,6 +755,7 @@ ...@@ -779,6 +755,7 @@
confirmText: '确认取出', confirmText: '确认取出',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
//执行关单封箱弹窗毛重填写
this.$refs.canelInputDialog.open(); this.$refs.canelInputDialog.open();
this.formIndex = index; this.formIndex = index;
} else if (res.cancel) { } else if (res.cancel) {
...@@ -790,15 +767,19 @@ ...@@ -790,15 +767,19 @@
} }
} }
//推送状态为 未推送,推送失败 //C、若校验箱状态为“已装板”时,则提示:该箱已装板,请先取消装板
if (this.form[index].sync_status == 1 || this.form[index].sync_status == 4) { if (this.tallyData.tally_status == 3) {
this.$refs.canelInputDialog.open(); uni.showModal({
this.formIndex = index; content: '该箱已装板,请先取消装板',
} else { success: (res) => {
uni.showToast({ if (res.confirm) {
title: '该状态不可取消理货',
icon: 'none' } else if (res.cancel) {
console.log('用户点击取消');
}
}
}); });
return false;
} }
}, },
/** /**
......
...@@ -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