diff --git a/pages/zw/jb-lower-mater.vue b/pages/zw/jb-lower-mater.vue index 4b2428d..645f2c5 100644 --- a/pages/zw/jb-lower-mater.vue +++ b/pages/zw/jb-lower-mater.vue @@ -26,7 +26,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -145,6 +145,34 @@ this._regionList() }, methods: { + handleBlur (e) { + if (this.val3) { + if (this.val3 < 0) { + this.val3 = 0 + } else { + // 1. 过滤非法字符 + // this.val3 = this.val3.replace(/[^0-9]/g, '') + // this.val3 = this.val3.replace(/^0+/, '') || '0' + // this.val3 = this.val3.replace(/^0+/, '') + // 4. 处理多个0开头的情况 + if (/^0+[1-9]/.test(this.val3)) { + // 如果0后面跟着非零数字,去掉前导零 + this.val3 = this.val3.replace(/^0+/, ''); + } else if (/^0+$/.test(this.val3)) { + // 如果全是0,只保留一个0 + this.val3 = '0'; + } else if (/^0+\./.test(this.val3)) { + // 处理0.xxx的情况,去掉整数部分多余的0 + this.val3 = '0.' + this.val3.replace(/^0+\./, ''); + } + } + } else { + // uni.showToast({ + // title: '数量必填', + // icon: 'none' + // }) + } + }, async _regionList () { try { let res = await regionList() @@ -238,7 +266,10 @@ } let res = await getWeight(this.index2, this.pkId) if (res.code === '200') { - console.log(11111) + uni.showToast({ + title: res.message, + icon: 'none' + }) this.val3 = res.data.weight this.flag = res.data.flag this.dupWeight = res.data.weight diff --git a/pages/zw/jb-return-mater.vue b/pages/zw/jb-return-mater.vue index 136ebff..608f03f 100644 --- a/pages/zw/jb-return-mater.vue +++ b/pages/zw/jb-return-mater.vue @@ -60,7 +60,7 @@ - + diff --git a/pages/zw/jb-up-mater.vue b/pages/zw/jb-up-mater.vue index dc54ebc..03e1471 100644 --- a/pages/zw/jb-up-mater.vue +++ b/pages/zw/jb-up-mater.vue @@ -56,7 +56,7 @@ - + @@ -197,10 +197,13 @@ clearUp () { this.pkId = '' this.pkObj = {} + this.index = '' + this.index2 = '' + this.dataList = [] }, async _callMaterial () { this.disabled = true - if (!index2 || !pkId) { + if (!this.index2 || !this.pkId) { this.disabled = false return } diff --git a/pages/zw/ll-instore.vue b/pages/zw/ll-instore.vue index 3ab7e2c..010303e 100644 --- a/pages/zw/ll-instore.vue +++ b/pages/zw/ll-instore.vue @@ -202,7 +202,7 @@ }, async _zwConfirmIn () { this.disabled = true - if (!index || !dataList.length) { + if (!this.index || !this.dataList.length) { this.disabled = false return } diff --git a/pages/zw/mancar-safe.vue b/pages/zw/mancar-safe.vue index e83c9c5..bd93acb 100644 --- a/pages/zw/mancar-safe.vue +++ b/pages/zw/mancar-safe.vue @@ -33,7 +33,7 @@ - + @@ -149,7 +149,7 @@ }, async _intoRegion () { this.disabled = true - if (!index) { + if (!this.index) { this.disabled = false return } @@ -174,7 +174,7 @@ }, async _outRegion () { this.disabled2 = true - if (!index) { + if (!this.index) { this.disabled2 = false return } diff --git a/vuex/modules/user.js b/vuex/modules/user.js index 1399f57..58943b1 100644 --- a/vuex/modules/user.js +++ b/vuex/modules/user.js @@ -1,6 +1,6 @@ import * as types from '../types' -const baseUrl = process.env.NODE_ENV === 'development' ? 'http://172.18.51.221:8011' : 'http://172.18.51.221:8011' +const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.10.71:8099' : 'http://192.168.10.71:8099' const acsUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.18.250:8012' : 'http://192.168.18.250:8012' const printUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010' const state = {