This commit is contained in:
2022-10-15 17:51:07 +08:00
parent df6cbe6616
commit a0439bb2d8
2 changed files with 7 additions and 6 deletions

View File

@@ -34,8 +34,8 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_pointOperate">绑定</button> <button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_pointOperate('1')">绑定</button>
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_pointOperate">解绑</button> <button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_pointOperate('2')">解绑</button>
</view> </view>
</view> </view>
</template> </template>
@@ -71,14 +71,14 @@
this.val2 = res.data.container_name this.val2 = res.data.container_name
this.val3 = res.data.have_goods this.val3 = res.data.have_goods
}, },
async _pointOperate () { async _pointOperate (type) {
this.disabled = true this.disabled = true
if (!this.val1 || !this.val2) { if (!this.val1 || !this.val2) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await pointOperate(this.val1, this.val2) let res = await pointOperate(this.val1, this.val2, type)
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
icon: 'none' icon: 'none'

View File

@@ -69,11 +69,12 @@ export const ovenInAndOut = (pcode, cname, temp, hours, option) => request({
// 点位管理 // 点位管理
// 1.1点位解绑绑定 // 1.1点位解绑绑定
export const pointOperate = (pcode, cname) => request({ export const pointOperate = (pcode, cname, option) => request({
url: 'api/pda/point/pointOperate', url: 'api/pda/point/pointOperate',
data: { data: {
point_code: pcode, point_code: pcode,
container_name: cname container_name: cname,
option: option
} }
}) })
// 1.2点位状态查询 // 1.2点位状态查询