联调修改

This commit is contained in:
蔡玲
2024-09-13 15:31:19 +08:00
parent ecd0ab12d8
commit 390c223a01
11 changed files with 185 additions and 137 deletions

View File

@@ -3,16 +3,6 @@
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">管芯规格</span>
@@ -21,19 +11,19 @@
<zxz-uni-data-select v-model="index" filterable :localdata="options"></zxz-uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">管芯数量</span>
</view>
<view class="zd-col-19">
<input v-model=" val2" type="number" class="filter_input" @blur="handleBlur">
<input v-model=" val1" type="number" class="filter_input" @blur="handleBlur">
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val2 || index === ''}" :disabled="disabled" @tap="_gxconfirmedInStorage">确认入库</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || index === ''}" :disabled="disabled" @tap="_gxconfirmedInStorage">确认入库</button>
</view>
</view>
</template>
@@ -53,7 +43,6 @@
index: '',
options: [],
val1: '',
val2: '',
qty: '',
disabled: false
};
@@ -70,40 +59,45 @@
async _gxremainingQty () {
let res = await gxremainingQty()
this.qty = res.qty
if (Number(this.val2) > Number(this.qty)) {
if (Number(this.val1) > Number(this.qty)) {
uni.showToast({
title: '管芯库空位不足!',
icon: 'none'
})
this.val2 = ''
this.val1 = ''
}
},
handleBlur () {
if (this.val2 !== '') {
if (this.val1 !== '') {
this._gxremainingQty()
} else if (Number(this.val2) > 5) {
} else if (Number(this.val1) > 5) {
uni.showToast({
title: '一次性最多只能入5根管芯',
icon: 'none'
})
this.val2 = ''
this.val1 = ''
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.qty = ''
this.disabled = false
},
async _gxconfirmedInStorage () {
this.disabled = true
if (!this.val1 || !this.val2 || this.index === '') {
if (!this.val1 || this.index === '') {
this.disabled = false
return
}
let material_spec = ''
this.options.map(el => {
if (el.value === this.index) {
material_spec = el.text
}
})
try {
let res = await gxconfirmedInStorage(this.val2, this.val1, this.index)
let res = await gxconfirmedInStorage(this.val1, this.index, material_spec)
this.clearUp()
uni.showToast({
title: res.message,