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';
......
...@@ -44,20 +44,6 @@ ...@@ -44,20 +44,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(3, $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="list row bothSide" v-if="loading && list.length === 0"> <view class="list row bothSide" v-if="loading && list.length === 0">
<view class="box skeleton-box" v-for="i in 4" :key="i"> <view class="box skeleton-box" v-for="i in 4" :key="i">
...@@ -165,8 +151,6 @@ ...@@ -165,8 +151,6 @@
</view> </view>
<navigator class="btn-box row" :url="'/pages/tallyReceive/operate?stock_in_item_id=' + item.stock_in_item_id + <navigator class="btn-box row" :url="'/pages/tallyReceive/operate?stock_in_item_id=' + item.stock_in_item_id +
'&stock_in_id=' + item.stock_in_id + '&stock_in_id=' + item.stock_in_id +
'&container_id=' + searchParams.container_id +
'&container_name=' + searchParams.container_name +
'&flag=' + fastParams.flag + '&flag=' + fastParams.flag +
'&qty=' + fastParams.qty + '&qty=' + fastParams.qty +
'&batch=' + fastParams.batch + '&batch=' + fastParams.batch +
...@@ -186,7 +170,7 @@ ...@@ -186,7 +170,7 @@
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text> <text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
<text class="text">{{ filter_id.length == 0 ? '全选' : filter_id.length }}</text> <text class="text">{{ filter_id.length == 0 ? '全选' : filter_id.length }}</text>
</view> </view>
<view class="btn2 row rowCenter verCenter" @click="showDrawer()" :class="{ 'btn-disabled': !is_submit }">一键理货</view> <view class="btn2 row rowCenter verCenter" @click="showDrawer()">一键理货</view>
</view> </view>
<!-- 拆货提醒弹窗 --> <!-- 拆货提醒弹窗 -->
<uni-popup ref="apartPopup" type="center"> <uni-popup ref="apartPopup" type="center">
...@@ -290,17 +274,14 @@ ...@@ -290,17 +274,14 @@
img_upload_url: uni.getStorageSync('img_upload_url') || 'http://image.liexindev.net', //oss系统 img_upload_url: uni.getStorageSync('img_upload_url') || 'http://image.liexindev.net', //oss系统
is_focus: true, //获取焦点动态化 is_focus: true, //获取焦点动态化
timer: null, // 用于存储计时器 timer: null, // 用于存储计时器
is_submit: true,
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
print_flag: true, //是否打印 print_flag: true, //是否打印
input_flag: false, input_flag: false,
input_contaion: false,
company_id: uni.getStorageSync('company_id') || 1, //公司组织 company_id: uni.getStorageSync('company_id') || 1, //公司组织
all_flag: false, //全选标记 all_flag: false, //全选标记
page: 1, page: 1,
limit: 30, //分页限制数量 limit: 30, //分页限制数量
index: uni.getStorageSync('tallyReceiveIndex') || 0, //记录用户上一次的选择 index: uni.getStorageSync('tallyReceiveIndex') || 0, //记录用户上一次的选择
indexContainer: -1,
array: ['全量搜索', '入仓号', '箱号', 'FedEx', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'], array: ['全量搜索', '入仓号', '箱号', 'FedEx', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'],
list: [], list: [],
loading: true, //加载状态 loading: true, //加载状态
...@@ -319,15 +300,12 @@ ...@@ -319,15 +300,12 @@
searchParams: { searchParams: {
mobile_wait_tally_all_search: '', //全量搜索 mobile_wait_tally_all_search: '', //全量搜索
stock_in_with_stock_in_items_inhouse: '', //入仓单号 stock_in_with_stock_in_items_inhouse: '', //入仓单号
container_name: '', //容器编码
container_id: '', //容器id,
tracking_no: '', //fedex tracking_no: '', //fedex
goods_name: '', goods_name: '',
code_type: '', code_type: '',
box_sn: '' box_sn: ''
}, },
formParams: { formParams: {
container_id: '',
tally_remark: '', tally_remark: '',
image_ids: '', //理货照片集合 image_ids: '', //理货照片集合
is_print: 1, is_print: 1,
...@@ -446,24 +424,6 @@ ...@@ -446,24 +424,6 @@
} }
}, },
/** /**
*刷新容器
*/
createTallyContainer() {
this.request(API.createTallyContainer, 'GET', {}, true).then(res => {
if (res.code === 0) {
this.searchParams.container_name = res.data.container_sn; //赋值搜索参数容器名字
this.searchParams.container_id = res.data.id; //赋值搜索参数容器id
this.formParams.container_id = res.data.id; //赋值参数容器id
this.is_submit = true;
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 清空数据 1(全量搜索,入仓号,箱号, FedEx,DigiKey,Rochester,TME,Chip1stop) * 清空数据 1(全量搜索,入仓号,箱号, FedEx,DigiKey,Rochester,TME,Chip1stop)
* @param {Object} type * @param {Object} type
*/ */
...@@ -505,11 +465,6 @@ ...@@ -505,11 +465,6 @@
} }
this.input_flag = false; this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点 this.clearInputAndFocus(); //再次获取焦点
} else {
//容器以及一键理货里面的容器
this.input_contaion = false;
this.searchParams.container_name = '';
this.searchParams.container_id = '';
} }
this.getData(); this.getData();
}, },
...@@ -559,12 +514,6 @@ ...@@ -559,12 +514,6 @@
this.searchParams.box_sn = val; this.searchParams.box_sn = val;
this.input_flag = true; this.input_flag = true;
this.getData(); this.getData();
} else if (type == 3) {
//容器 && 一键理货的容器监听
this.searchParams.container_name = val;
this.input_contaion = true;
this.getTallyContainer();
//注意,此时不刷新列表,是给一键理货用的
} else if (type == 0) { } else if (type == 0) {
//选择了fedex //选择了fedex
this.resetChange(); this.resetChange();
...@@ -589,11 +538,6 @@ ...@@ -589,11 +538,6 @@
this.resetChange(); this.resetChange();
this.input_flag = false; this.input_flag = false;
this.getData(); this.getData();
} else if (type == 3) {
//容器为空的时候清除值
this.formParams.container_id = '';
this.searchParams.container_id = '';
this.input_contaion = false;
} }
} }
}, 500), }, 500),
...@@ -630,8 +574,6 @@ ...@@ -630,8 +574,6 @@
resetSearchParams() { resetSearchParams() {
this.searchParams.mobile_wait_tally_all_search = ''; this.searchParams.mobile_wait_tally_all_search = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
this.searchParams.container_name = '';
this.searchParams.container_id = '';
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.goods_name = ''; this.searchParams.goods_name = '';
this.searchParams.code_type = ''; this.searchParams.code_type = '';
...@@ -677,10 +619,9 @@ ...@@ -677,10 +619,9 @@
//如果搜索只有一个的情况 //如果搜索只有一个的情况
if (data.length == 1) { if (data.length == 1) {
const { stock_in_item_id, stock_in_id } = data[0]; const { stock_in_item_id, stock_in_id } = data[0];
const { container_id, container_name } = this.searchParams;
uni.navigateTo({ uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&container_id=' + container_id + '&container_name=' + container_name + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch
}) })
} }
} }
...@@ -689,20 +630,17 @@ ...@@ -689,20 +630,17 @@
} else { } else {
self.getData((data, type) => { self.getData((data, type) => {
setTimeout(() => { setTimeout(() => {
//如果搜索多个的情况
if (data.length > 0) { if (data.length > 0) {
const { qty, origin, batch } = res.data; const { qty, origin, batch } = res.data;
this.fastParams.flag = 'fast'; this.fastParams.flag = 'fast';
this.fastParams.qty = qty; this.fastParams.qty = qty;
this.fastParams.batch = batch; this.fastParams.batch = batch;
this.fastParams.origin = origin; this.fastParams.origin = origin;
//如果搜索只有一个的情况
if (data.length == 1) { if (data.length == 1) {
const { stock_in_item_id, stock_in_id } = data[0]; const { stock_in_item_id, stock_in_id } = data[0];
const { container_id, container_name } = this.searchParams;
uni.navigateTo({ uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&container_id=' + container_id + '&container_name=' + container_name + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch
}) })
} }
} }
...@@ -721,10 +659,9 @@ ...@@ -721,10 +659,9 @@
//如果搜索只有一个的情况 //如果搜索只有一个的情况
if (data.length == 1) { if (data.length == 1) {
const { stock_in_item_id, stock_in_id } = data[0]; const { stock_in_item_id, stock_in_id } = data[0];
const { container_id, container_name } = this.searchParams;
uni.navigateTo({ uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&container_id=' + container_id + '&container_name=' + container_name + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch
}) })
} }
} }
...@@ -741,63 +678,6 @@ ...@@ -741,63 +678,6 @@
}); });
} }
}, },
//设置默认的容器
getTallyContainerDefault() {
this.request(API.getTallyContainer, 'GET', {}, false).then(res => {
if (res.code === 0) {
let checked_id = res.data.checked_id;
let list = res.data.list;
let filter_arr = list.filter(function (item) {
if (item.id == checked_id) {
return item;
}
});
if (filter_arr.length > 0) {
//设置默认容器name和id
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 获取容器列表数据 && 验证容器是否输入正确
*/
getTallyContainer() {
this.request(API.getTallyContainer, 'GET', {}, true).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; //赋值正确的搜索容器id
this.formParams.container_id = id[0].id; //赋值正确的参数容器id
} else {
//如果容器检验错误,就清空搜索容器id和参数容器id
this.searchParams.container_id = '';
this.formParams.container_id = '';
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/** /**
* 获取列表数据 支持分页 * 获取列表数据 支持分页
*/ */
...@@ -845,7 +725,6 @@ ...@@ -845,7 +725,6 @@
return false; return false;
} }
} }
// 提交参数,排除container_id字段
var params = { var params = {
tally_remark: this.formParams.tally_remark, tally_remark: this.formParams.tally_remark,
image_ids: this.formParams.image_ids, image_ids: this.formParams.image_ids,
...@@ -879,14 +758,6 @@ ...@@ -879,14 +758,6 @@
* 打开一键理货弹窗 * 打开一键理货弹窗
*/ */
showDrawer() { showDrawer() {
// 验证一下容器是否输入正确
if (!this.is_submit) {
uni.showToast({
title: '请输入正确容器',
icon: 'error'
});
return false;
}
if (this.filter_id.length == 0) { if (this.filter_id.length == 0) {
uni.showToast({ uni.showToast({
title: '请选择货品', title: '请选择货品',
...@@ -938,8 +809,6 @@ ...@@ -938,8 +809,6 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + this.apartItem.stock_in_item_id + url: '/pages/tallyReceive/operate?stock_in_item_id=' + this.apartItem.stock_in_item_id +
'&stock_in_id=' + this.apartItem.stock_in_id + '&stock_in_id=' + this.apartItem.stock_in_id +
'&container_id=' + this.searchParams.container_id +
'&container_name=' + this.searchParams.container_name +
'&flag=' + this.fastParams.flag + '&flag=' + this.fastParams.flag +
'&qty=' + this.fastParams.qty + '&qty=' + this.fastParams.qty +
'&batch=' + this.fastParams.batch + '&batch=' + this.fastParams.batch +
......
...@@ -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