二次确认

This commit is contained in:
2025-10-14 10:52:52 +08:00
parent 2deaf048e7
commit 734fe88f14
9 changed files with 153 additions and 72 deletions

View File

@@ -25,16 +25,6 @@
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-10">
<!-- <span class="filter_label">用料数量</span> -->
<span class="filter_label">{{$t('filter.material-use-number')}}</span>
</view>
<view class="zd-col-14">
<input type="number" v-model="val3" class="filter_input">
</view>
<view class="zd-col-2"><span class="filter_unit">{{unit}}</span></view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-10">
<!-- <span class="filter_label">叫料托盘数</span> -->
@@ -50,7 +40,7 @@
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_loading">确认</button> -->
<button class="zd-col-8 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
<button class="zd-col-14 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_loading">{{$t('button.confirm')}}</button>
<button class="zd-col-14 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm')}}</button>
</view>
</view>
</template>
@@ -58,6 +48,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import { confirmAction } from '@/utils/utils.js'
import {getRegionByPoint, selectMaterialByRegion, loading} from '@/utils/getData4.js'
export default {
components: {
@@ -69,8 +60,6 @@
title: '',
val1: '',
val2: '1',
val3: '',
unit: '',
currentData: {},
options: [],
pointCode: '',
@@ -106,12 +95,6 @@
url: '/pages/ftdl/mater-list-cxjl?title=查询物料'
})
},
// selectChange (e) {
// this.index = e
// let selobj = this.options.find(item => item.value === this.index)
// this.val3 = selobj.qty
// this.unit = selobj.measure_unit_id
// },
handleChange1 (e) {
if (e) {
this._getRegionByPoint(e)
@@ -138,14 +121,20 @@
this.val1 = ''
this.val2 = ''
this.pointCode = ''
this.currentData = {}
this.disabled = false
},
async handleConfirm() {
if (!this.val1 || !this.val2) {
return
}
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
if (isConfirmed) {
this._loading()
}
},
async _loading () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await loading(this.pointCode, this.val1, this.currentData.material_code, this.val2)
if (res.code === '200') {
@@ -159,8 +148,8 @@
title: res.message,
icon: 'none'
})
this.disabled = false
}
this.disabled = false
} catch (e) {
this.disabled = false
}