纸管绑定

This commit is contained in:
2025-05-28 17:45:53 +08:00
parent c2470f8c23
commit 9a4956ef5d
4 changed files with 41 additions and 16 deletions

View File

@@ -14,7 +14,7 @@
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">点位</span>
<span class="filter_label">管芯编码</span>
</view>
<view class="filter_input_wraper">
<search-box v-model="val3" />
@@ -27,11 +27,9 @@
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">数量</span>
</view>
<view class="filter_label">列数</view>
<view class="filter_input_wraper">
<input type="number" class="filter_input" v-model="val2">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
<view class="filter_item">
@@ -44,8 +42,8 @@
</view>
<view class="zd-row submitbar">
<button class="zd-col-5 btn-submit btn-default" @tap="clearUp">清空</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2 || !index || !index1 || !val3}" :disabled="disabled" @tap="_operateIvt('1')">绑定</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2 || !index || !index1 || !val3}" :disabled="disabled" @tap="_operateIvt('2')">清除</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !index || !index1 || !index2 || !val3}" :disabled="disabled" @tap="_operateIvt('1')">绑定</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !index || !index1 || !index2 || !val3}" :disabled="disabled" @tap="_operateIvt('2')">清除</button>
</view>
</view>
</template>
@@ -67,7 +65,8 @@
val3: '',
options1: [{value: '1', text: '1'}, {value: '2', text: '2'}, {value: '3', text: '3'}, {value: '4', text: '4'}, {value: '5', text: '5'}],
index1: '',
val2: '',
options2: [{value: '1', text: '1'}, {value: '2', text: '2'}, {value: '3', text: '3'}, {value: '4', text: '4'}, {value: '5', text: '5'}],
index2: '',
options: [],
index: '',
newoptions: [],
@@ -91,6 +90,9 @@
selectChange1 (e) {
this.index1 = e
},
selectChange2 (e) {
this.index2 = e
},
selectChange (e) {
this.index = e
},
@@ -117,12 +119,12 @@
},
async _operateIvt (type) {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index || !this.index1 || !this.val3) {
if (!this.val1 || !this.index || !this.index1 || !this.index2 || !this.val3) {
this.disabled = false
return
}
try {
let res = await operateIvt(type, this.val1, this.index1, this.val2, this.index, this.val3)
let res = await operateIvt(type, this.val1, this.index1, this.index2, this.index, this.val3)
uni.showToast({
title: res.message,
icon: 'none'
@@ -135,9 +137,9 @@
clearUp () {
this.val1 = ''
this.val3 = ''
this.val2 = ''
this.index = ''
this.index1 = ''
this.index2 = ''
}
}
}

View File

@@ -26,6 +26,7 @@
<button class="zd-col-5 btn-submit btn-default" @tap="clearUp">清空</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled" @tap="_doStockAreaBinding">绑定</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="disabled" @tap="_doStockAreaUnbinding">解绑</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled" @tap="_instorStock">管芯入库</button>
</view>
</view>
</template>
@@ -33,7 +34,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {doStockAreaBinding, doStockAreaUnbinding} from '@/utils/getData3.js'
import {doStockAreaBinding, doStockAreaUnbinding, instorStock} from '@/utils/getData3.js'
export default {
components: {
NavBar,
@@ -85,6 +86,23 @@
this.disabled = false
}
},
async _instorStock () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await instorStock(this.val1, this.val2, '1')
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.val1 = ''
this.val2 = ''