This commit is contained in:
2024-03-19 10:07:38 +08:00
parent 455d1b96e2
commit fd049136f2
4 changed files with 21 additions and 11 deletions

View File

@@ -53,7 +53,7 @@
<span class="filter_label">物料数量</span> <span class="filter_label">物料数量</span>
</view> </view>
<view class="zd-col-19"> <view class="zd-col-19">
<input type="text" class="filter_input" v-model="data.material_qty" disabled> <input type="text" class="filter_input" v-model="val5" disabled>
</view> </view>
</view> </view>
<view class="zd-row border-bottom"> <view class="zd-row border-bottom">
@@ -76,8 +76,8 @@
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap="clearUp">清空</button> <button class="zd-col-7 button-default" @tap="clearUp">清空</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !val2 ||!val4}" :disabled="disabled1" @tap="_fullVehicleOutConfirm">出库确认</button> <button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !val2 || val4 === ''}" :disabled="disabled1" @tap="_fullVehicleOutConfirm">出库确认</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !val2 ||!val4}" :disabled="disabled2" @tap="_vehicleGoBack">回库</button> <button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !val2 || val4 === ''}" :disabled="disabled2" @tap="_vehicleGoBack">回库</button>
</view> </view>
</view> </view>
</template> </template>
@@ -97,6 +97,7 @@
val1: '', val1: '',
val2: '', val2: '',
val3: '', val3: '',
val5: '',
data: {}, data: {},
title: '', title: '',
disabled1: false, disabled1: false,
@@ -106,8 +107,8 @@
computed: { computed: {
val4 () { val4 () {
let res = '' let res = ''
if (JSON.stringify(this.data) !== '{}') { if (this.val5 !== '') {
res = accSubtract(this.data.material_qty, this.val3) res = accSubtract(this.val5, this.val3)
} }
return res return res
} }
@@ -123,10 +124,13 @@
let res = await queryGroupInfoByVehicle(e) let res = await queryGroupInfoByVehicle(e)
this.data = res this.data = res
this.val2 = this.data.point_code this.val2 = this.data.point_code
if (this.data.material_qty) {
this.val5 = this.data.material_qty
}
}, },
async _fullVehicleOutConfirm () { async _fullVehicleOutConfirm () {
this.disabled1 = true this.disabled1 = true
if (!this.val1 || !this.val2 || !this.val4) { if (!this.val1 || !this.val2 || this.val4 === '') {
this.disabled1 = false this.disabled1 = false
return return
} }
@@ -143,7 +147,7 @@
}, },
async _vehicleGoBack () { async _vehicleGoBack () {
this.disabled2 = true this.disabled2 = true
if (!this.val1 || !this.val2 || !this.val4) { if (!this.val1 || !this.val2 || this.val4 === '') {
this.disabled2 = false this.disabled2 = false
return return
} }

View File

@@ -103,7 +103,11 @@
return return
} }
try { try {
let res = await unbindVehicle(this.val1, this.options1[this.index1].value, this.val2) let type = ''
if (this.index1 !== '') {
type = this.options1[this.index1].value
}
let res = await unbindVehicle(this.val1, type, this.val2)
this.clearUp() this.clearUp()
uni.showToast({ uni.showToast({
title: res.message, title: res.message,

View File

@@ -43,6 +43,7 @@ const request = (params) => {
// } // }
}) })
.then(res => { // 成功 .then(res => { // 成功
uni.hideLoading()
if (res.length === 1) { if (res.length === 1) {
uni.showModal({ uni.showModal({
content: 'request:fail', content: 'request:fail',
@@ -113,6 +114,7 @@ const request = (params) => {
} }
}) })
.catch(err => { // 错误 .catch(err => { // 错误
uni.hideLoading()
reject(err) reject(err)
}) })
.finally(() => { .finally(() => {

View File

@@ -1,8 +1,8 @@
import * as types from '../types' import * as types from '../types'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010' const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8011' : 'http://192.168.81.162:8011'
const acsUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010' const acsUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010'
const printUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010' const printUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010'
const state = { const state = {
baseUrl: uni.getStorageSync('baseUrl') || baseUrl, baseUrl: uni.getStorageSync('baseUrl') || baseUrl,
acsUrl: uni.getStorageSync('acsUrl') || acsUrl, acsUrl: uni.getStorageSync('acsUrl') || acsUrl,