二次确认

This commit is contained in:
2025-07-09 11:07:10 +08:00
parent 19359cf43a
commit 145807f859
9 changed files with 175 additions and 83 deletions

View File

@@ -4,7 +4,7 @@
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_item is-required">
<view class="filter_label_wraper">
<span class="filter_label">{{$t('grid.point-code')}}</span>
</view>
@@ -12,7 +12,7 @@
<search-box v-model="val1" @handleChange="handleChange1"/>
</view>
</view>
<view class="filter_item">
<view class="filter_item is-required">
<view class="filter_label_wraper">
<span class="filter_label">{{$t('filter.mother-roll')}}</span>
</view>
@@ -20,7 +20,7 @@
<search-box v-model="val2" />
</view>
</view>
<view class="filter_item">
<view class="filter_item is-required">
<view class="filter_label">{{$t('filter.temperature')}}</view>
<view class="filter_input_wraper">
<!-- <input type="number" class="filter_input" v-model="val3"> -->
@@ -32,7 +32,7 @@
/>
</view>
</view>
<view class="filter_item">
<view class="filter_item is-required">
<view class="filter_label">{{$t('filter.time')}}({{$t('unit.minute')}})</view>
<view class="filter_input_wraper">
<!-- <input type="number" class="filter_input" v-model="val4"> -->
@@ -47,8 +47,8 @@
</view>
<view class="zd-row submitbar">
<button class="zd-col-4 btn-submit btn-default" @tap="clearUp">{{$t('button.clear')}}</button>
<button class="zd-col-6 btn-submit btn-success" :class="{'btn-info': !val1 || !val2 || !val3 || !val4}" :disabled="disabled" @tap="_ovenInAndOut1('1')">{{$t('button.enter-box')}}</button>
<button class="zd-col-6 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="disabled" @tap="_ovenInAndOut2('2')">{{$t('button.out-box')}}</button>
<button class="zd-col-6 btn-submit btn-success" :class="{'btn-info': !val1 || !val2 || !val3 || !val4}" :disabled="disabled" @tap="handleConfirm('1')">{{$t('button.enter-box')}}</button>
<button class="zd-col-6 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="disabled" @tap="handleConfirm('2')">{{$t('button.out-box')}}</button>
<button class="zd-col-6 btn-submit btn-success" :disabled="disabled" @click="_inHotByPoint">定点入箱</button>
</view>
<view class="msg_wrapper" :class="active ? 'popshow' : 'pophide'" style="height: auto">
@@ -115,6 +115,7 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import NumberInput from '@/components/NumberInput.vue'
import { confirmAction } from '@/utils/utils.js'
import {ovenInAndOut, bakingquery, inHotByPoint} from '@/utils/getData1.js'
export default {
components: {
@@ -153,12 +154,26 @@
let res = await bakingquery(val1)
this.val2 = res.data.container_name
},
async _ovenInAndOut1 (type) {
this.disabled = true
if (!this.val1 || !this.val2 ||!this.val3 || !this.val4) {
async handleConfirm(type) {
if ((!this.val1 || !this.val2 ||!this.val3 || !this.val4) && type === '1') {
this.disabled = false
return
}
if (!this.val1 && type === '2') {
return
}
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
if (isConfirmed) {
if (type === '1') {
this._ovenInAndOut1()
}
if (type === '2') {
this._ovenInAndOut2()
}
}
},
async _ovenInAndOut1 (type) {
this.disabled = true
try {
let res = await ovenInAndOut(this.val1, this.val2,this.val3, this.val4, type)
uni.showToast({
@@ -172,10 +187,6 @@
},
async _ovenInAndOut2 (type) {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await ovenInAndOut(this.val1, '','', '', type)
uni.showToast({