| | |
| | | "name" : "中扬WMS", |
| | | "appid" : "__UNI__DA5854D", |
| | | "description" : "", |
| | | "versionName" : "9.0.0", |
| | | "versionName" : "8.0.0", |
| | | "versionCode" : "100", |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | |
| | | <view> |
| | | <scroll-view scroll-y class="page"> |
| | | <view class="nav-list"> |
| | | <navigator hover-class='none' :url="'/pages/component/' + item.name" class="nav-li" navigateTo :class="'bg-'+item.color" |
| | | <navigator hover-class='none' :url="'/pages' + item.url" class="nav-li" navigateTo :class="'bg-'+item.color" |
| | | :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]" v-for="(item,index) in elements" :key="index"> |
| | | <view class="nav-title">{{item.title}}</view> |
| | | <view class="nav-name">{{item.name}}</view> |
| | |
| | | data() { |
| | | return { |
| | | elements: [{ |
| | | title: '操作条', |
| | | name: 'bar', |
| | | title: '组托入库', |
| | | name: 'pakin', |
| | | color: 'purple', |
| | | cuIcon: 'vipcard' |
| | | cuIcon: 'vipcard', |
| | | url: '/pakin/pakin' |
| | | }, |
| | | { |
| | | title: '导航栏 ', |
| | |
| | | let that = this; |
| | | uni.getSystemInfo({ |
| | | success: (res) => { |
| | | console.log(res.platform); |
| | | if (res.platform == "android") { |
| | | that.AndroidCheckUpdate(); |
| | | } |
| | |
| | | let that = this; |
| | | plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { |
| | | that.version = wgtinfo.version //客户端版本号 |
| | | console.log('当前app版本信息:' + that.version); |
| | | }) |
| | | setTimeout(()=>{ |
| | | that.getUpdateVersion() |
| | | },1000) |
| | | },100) |
| | | }, |
| | | // 校验版本 |
| | | getUpdateVersion() { |
| | | console.log(this.version); |
| | | let that = this |
| | | let type = 0 |
| | | if (that.baseUrl == 'http://undefined:undefined/undefined') { |
| | | return |
| | | } |
| | | console.log(2); |
| | | |
| | | let url = that.baseUrl + '/appVersion/checkUpdate/' + that.version + '/' + type |
| | | console.log(url); |
| | | uni.request({ |
| | | url: url, |
| | | method: 'GET', |
| | |
| | | downWgt() { |
| | | let that = this; |
| | | const downloadUrl = that.baseUrl + "/appVersion/downloadApp/" + that.filename |
| | | console.log(downloadUrl); |
| | | uni.showLoading({ |
| | | title: '更新中……' |
| | | }) |
| | | console.log('*************************************'); |
| | | const downloadTask = uni.downloadFile({ //执行下载 |
| | | url: downloadUrl, //下载地址 |
| | | timeout: 1000 * 30, //30秒超时时间 |
| | | success: downloadResult => { //下载成功 |
| | | console.log(downloadResult); |
| | | // that.showdownLine = false |
| | | that.showdownLine = false |
| | | uni.hideLoading(); |
| | | console.log('downloadResult.statusCode' + downloadResult.statusCode) |
| | | if (downloadResult.statusCode == 200) { |
| | | console.log('更新中') |
| | | uni.showModal({ |
| | | title: '', |
| | | content: '更新成功,确定现在重启吗?', |
| | |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | uni.hideLoading(); |
| | | that.showdownLine = false |
| | | uni.showToast({ |
| | | title:'请先上传安装包', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | }, |
| | | fail: err => { |
| | | uni.hideLoading(); |
| | | that.showdownLine = false |
| | | that.$u.toast(err.errMsg) |
| | | console.log(err) |
| | | that.$u.toast(downloadResult.errMsg) |
| | | }, |
| | | complete: com => { |
| | | |
| | | console.log(com) |
| | | } |
| | | }); |
| | |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="form-item-desc"><text>商品编码</text></view> |
| | | <view class="form-item-content"><text>{{4561234}}</text></view> |
| | | <view class="form-item-content"><text>{{mat.matnr}}</text></view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item-desc"><text>商品名称</text></view> |
| | | <view class="form-item-content"><text>{{"45681asda"}}</text></view> |
| | | <view class="form-item-content"><text>{{mat.maktx}}</text></view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item-desc"><text>规格</text></view> |
| | | <view class="form-item-content"><text>{{"45681asda"}}</text></view> |
| | | <view class="form-item-content"><text>{{mat.specs}}</text></view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item-desc"><text>批号</text></view> |
| | |
| | | </view> |
| | | <!-- 底部操作按钮 --> |
| | | <view class="buttom"> |
| | | <button size="mini" type="primary">提取</button> |
| | | <button size="mini" type="primary" @click="back()">提取</button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | mat: { |
| | | matnr: null, |
| | | maktx: null, |
| | | specs: null, |
| | | batch: null, |
| | | anfme: null, |
| | | }, |
| | | baseIP:'', |
| | | basePORT:'', |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | let that = this |
| | | // #ifdef APP-NVUE |
| | | const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE |
| | | // #endif |
| | | // #ifndef APP-NVUE |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | // #endif |
| | | |
| | | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
| | | eventChannel.on('mat', function(data) { |
| | | console.log(data); |
| | | that.mat = data.data |
| | | that.mat.anfme = 0 |
| | | }) |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | blur() { |
| | | |
| | | }, |
| | | focus() { |
| | | |
| | | }, |
| | | changeValue(value) { |
| | | this.mat.anfme = value |
| | | }, |
| | | back() { |
| | | if (this.mat.anfme === 0) { |
| | | uni.showToast({title: '请输入数量', icon: "none", position: 'top'}); |
| | | return; |
| | | } |
| | | this.getOpenerEventChannel().emit('matList', {data: this.mat}); |
| | | uni.vibrateShort(); |
| | | uni.navigateBack({ |
| | | |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | |
| | | <view class="code"> |
| | | <view class="item"> |
| | | <view class="code-decs">托盘码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入"> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus" @confirm="barcodeInput()"> |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">物料码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入"> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="findMat()"> |
| | | <view class="item-right"> |
| | | <button></button> |
| | | <text style="text-align: right;color: #409EFF;">提取+</text> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataList: |
| | | [ |
| | | { |
| | | matnr: "whycq19950222222-232321111", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "100" |
| | | }, { |
| | | matnr: "whycq19950520", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "12" |
| | | },{ |
| | | matnr: "whycq19950520", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "12" |
| | | },{ |
| | | matnr: "whycq19950520", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "12" |
| | | },{ |
| | | matnr: "whycq19950520", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "12" |
| | | },{ |
| | | matnr: "whycq19950520", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "12" |
| | | },{ |
| | | matnr: "whycq19950520", |
| | | maktx: "wusuowei", |
| | | specs: "个", |
| | | batch: "批号", |
| | | anfme: "12" |
| | | } |
| | | ], |
| | | baseUrl: '', |
| | | token: '', |
| | | barcode: '', |
| | | dataList: [], |
| | | count: 0, |
| | | rowNum: '', |
| | | matnr: '', |
| | |
| | | messageText: '', |
| | | title: '', |
| | | content: '', |
| | | barcodeFocus: true, |
| | | matFocus: false, |
| | | matData: '' |
| | | |
| | | } |
| | | }, |
| | | onLoad() { |
| | | |
| | | }, |
| | | onShow() { |
| | | this.baseUrl = uni.getStorageSync('baseUrl'); |
| | | this.token = uni.getStorageSync('token'); |
| | | }, |
| | | methods: { |
| | | messageToggle(type) { |
| | | this.msgType1 = type |
| | | this.$refs.message.open() |
| | | }, |
| | | // barcode input 事件 |
| | | barcodeInput() { |
| | | // 不设置定时器 会出现扫入的字符串不全 |
| | | setTimeout(()=>{ |
| | | var len = this.barcode.length |
| | | if (len != 8) { |
| | | uni.showToast({title: '托盘码有误请重试', icon: "none", position: 'top'}); |
| | | this.barcodeFocuss() |
| | | return; |
| | | } |
| | | this.focuss() |
| | | },200) |
| | | }, |
| | | // 托盘码有误重置 |
| | | barcodeFocuss() { |
| | | let that = this; |
| | | that.barcodeFocus = false; |
| | | setTimeout(()=>{ |
| | | that.barcode = ''; |
| | | that.barcodeFocus = true; |
| | | }, 100); |
| | | }, |
| | | // 商品光标清空重置 |
| | | focuss() { |
| | | // #ifdef APP |
| | | let that = this; |
| | | that.focus = false; |
| | | setTimeout(()=>{ |
| | | that.matnr = ''; |
| | | that.focus = true; |
| | | }, 100); |
| | | // #endif |
| | | }, |
| | | // 搜索物料 |
| | | findMat() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/mat/auth', |
| | | data: { |
| | | matnr:that.matnr |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | result = result.data |
| | | if (result.code === 200 && result.data) { |
| | | that.matData = result.data |
| | | that.matnr = '' |
| | | that.matData['batch'] = '' |
| | | uni.navigateTo({ |
| | | url: "../mat/matSelected", |
| | | // 通过eventChannel向被打开页面传送数据 |
| | | success: function(res) { |
| | | res.eventChannel.emit('mat', { data: result.data }) |
| | | }, |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | events: { |
| | | dataList: function(data) { |
| | | that.checkMat(data.data) |
| | | // that.matList.push(data.data) |
| | | }, |
| | | }, |
| | | }); |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | console.log(res); |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | checkMat(mat) { |
| | | var len = this.dataList.length |
| | | var add = true |
| | | for (var i = 0; i < len; i++) { |
| | | if (mat.matnr == this.dataList[i].matnr) { |
| | | this.dataList[i].anfme += mat.anfme |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |
| | | } |
| | | } |
| | | if (add) { |
| | | this.dataList.unshift(mat) |
| | | } |
| | | }, |
| | | // 修改批号 |
| | | revise(item,i) { |
| | | this.matnr = this.dataList[i].matnr |