二次确认

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

@@ -11,9 +11,9 @@
</view>
</view>
<view class="zd-row jccenter mgt20">
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="val1 && type === '2' && disabled4" style="margin-right: 15px" @tap="_rawScrollDowm('2')">{{$t('button.upper-axis')}}</button>
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="val1 && type === '4' && disabled4" @tap="_rawScrollDowm('4')">{{$t('button.lower-axis')}}</button>
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="disabled2" @tap="_confirmBlanking">{{$t('button.ready-to-go')}}</button>
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="val1 && type === '2' && disabled2" style="margin-right: 15px" @tap="handleConfirm1('2')">{{$t('button.upper-axis')}}</button>
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="val1 && type === '4' && disabled2" @tap="handleConfirm1('4')">{{$t('button.lower-axis')}}</button>
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="disabled1" @tap="handleConfirm2('5')">{{$t('button.ready-to-go')}}</button>
</view>
</view>
<view class="zd_wrapper">
@@ -23,7 +23,7 @@
<uni-data-select v-model="index" :placeholder="$t('uni.dataSelect.placeholder')" :emptyTips="$t('uni.dataSelect.emptyTips')" :localdata="options"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_item is-required">
<view class="filter_label">{{$t('filter.mother-roll')}}</view>
<view class="zd-row">
<view class="zd-col-21 filter_input_wraper">
@@ -32,7 +32,9 @@
<button class="btn-search-icon" style="text-align: right;" size="mini" @tap="searchList"><uni-icons type="search" size="24" color="#272727"></uni-icons></button>
</view>
</view>
<view class="zd-row jccenter mgt20">
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled1" @tap="handleConfirm2('6')">{{$t('button.add-order')}}</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
@@ -75,8 +77,8 @@
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="zd-row submitbar">
<button class="zd-col-11 btn-submit btn-success" :class="{'btn-info': !pkId}" :disabled="type === '1' && disabled4" @tap="_rawScrollDowm('1')">{{$t('button.roll-down')}}</button>
<button class="zd-col-11 btn-submit btn-success" :class="{'btn-info': !pkId}" :disabled="type === '3' && disabled4" @tap="_rawScrollDowm('3')">{{$t('button.single-volume')}}</button>
<button class="zd-col-11 btn-submit btn-success" :class="{'btn-info': !pkId}" :disabled="type === '1' && disabled2" @tap="handleConfirm1('1')">{{$t('button.roll-down')}}</button>
<button class="zd-col-11 btn-submit btn-success" :class="{'btn-info': !pkId}" :disabled="type === '3' && disabled2" @tap="handleConfirm1('3')">{{$t('button.single-volume')}}</button>
</view>
<up-top ref="UT" :scrollTop="top"></up-top>
</view>
@@ -86,6 +88,7 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import UpTop from '@/components/upTop.vue'
import { confirmAction } from '@/utils/utils.js'
import {queryProductArea, queryRawFoilList, createOrder, confirmBlanking, rawScrollDowm} from '@/utils/getData1.js'
export default {
components: {
@@ -106,9 +109,6 @@
pkObj: {},
disabled1: false,
disabled2: false,
disabled3: false,
disabled4: false,
disabled5: false,
reload: false,
status: 'more',
contentText: {
@@ -171,16 +171,29 @@
this.status = 'noMore'
}
},
// 准备就绪
async _confirmBlanking () {
this.disabled2 = true
if (!this.val1) {
this.disabled2 = false
// 准备就绪/新增工单
async handleConfirm2(type) {
if (!this.val1 && type === '5') {
return
}
if ((!this.val1 || !this.val2) && type === '6') {
return
}
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
if (isConfirmed) {
if (type === '5') {
this._confirmBlanking()
}
if (type === '6') {
this._createOrder()
}
}
},
async _confirmBlanking () {
this.disabled1 = true
try {
let res = await confirmBlanking(this.val1)
this.disabled2 = false
this.disabled1 = false
this.pkId = ''
this.pkObj = {}
this.searchList()
@@ -189,26 +202,47 @@
icon: 'none'
})
} catch (e) {
this.disabled2 = false
this.disabled1 = false
}
},
// 正常下卷/单下卷/单上轴/单下轴
async _rawScrollDowm (type) {
this.disabled4 = true
async _createOrder () {
this.disabled1 = true
try {
let res = await createOrder(this.val1, this.val2)
this.disabled1 = false
this.pkId = ''
this.pkObj = {}
this.searchList()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
},
async handleConfirm1(type) {
this.type = type
if (!this.pkId && (type === '1' || type === '3')) {
this.disabled4 = false
this.type = ''
return
}
if (!this.val1 && (type === '2' || type === '4')) {
this.disabled4 = false
this.type = ''
return
}
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
if (isConfirmed) {
this._rawScrollDowm(type)
}
},
// 正常下卷/单下卷/单上轴/单下轴
async _rawScrollDowm (type) {
this.disabled2 = true
try {
let res = await rawScrollDowm(this.pkObj, type, this.val1)
this.disabled4 = false
this.disabled2 = false
this.type = ''
this.pkId = ''
this.pkObj = {}
@@ -218,7 +252,7 @@
icon: 'none'
})
} catch (e) {
this.disabled4 = false
this.disabled2 = false
this.type = ''
}
},