Browse Source

feat: update 数量问题

master
TengXF 7 months ago
parent
commit
2e590c4f5f
  1. 28
      src/pages/mes/workScheduling/waitReport.vue

28
src/pages/mes/workScheduling/waitReport.vue

@ -14,7 +14,7 @@
<view class="dec-item"> <view class="dec-item">
<view>报工数量</view> <view>报工数量</view>
<view> <view>
<u-number-box v-model="formData.reportCount" @change="calculatePass()" style="width:120px" :max="planCount"></u-number-box> <u-number-box v-model="formData.reportCount" @update:modelValue="calculatePass()" style="width:120px" :max="planCount"></u-number-box>
<!-- <u-input v-model="formData.reportCount" type="number" @update:modelValue="calculatePass()" placeholder="请输入数量" /> --> <!-- <u-input v-model="formData.reportCount" type="number" @update:modelValue="calculatePass()" placeholder="请输入数量" /> -->
</view> </view>
</view> </view>
@ -34,14 +34,14 @@
<view class="dec-item"> <view class="dec-item">
<view>合格数量</view> <view>合格数量</view>
<view> <view>
<u-number-box :disabled="!formData.checkFlag" v-model="formData.qualified" @change="calculatePass()" style="width:120px" :max="planCount"></u-number-box> <u-number-box :disabled="!formData.checkFlag" @update:modelValue="calculatePass()" v-model="formData.qualified" :max="planCount"></u-number-box>
<!-- <u-input :disabled="!formData.checkFlag" v-model="formData.qualified" type="number" placeholder="请输入合格数量" @update:modelValue="calculatePass()" /> --> <!-- <u-input :disabled="!formData.checkFlag" v-model="formData.qualified" type="number" placeholder="请输入合格数量" @update:modelValue="calculatePass()" /> -->
</view> </view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>不合格数量</view> <view>不合格数量</view>
<view> <view>
<u-number-box disabled="true" v-model="formData.unqualified" @change="calculatePass()" style="width:120px"></u-number-box> <u-number-box disabled="true" v-model="formData.unqualified" style="width:120px"></u-number-box>
<!-- <u-input v-model="formData.unqualified" type="number" disabled="true"/> --> <!-- <u-input v-model="formData.unqualified" type="number" disabled="true"/> -->
</view> </view>
</view> </view>
@ -117,6 +117,13 @@
} }
function calculatePass(){ function calculatePass(){
if(formData.value.checkFlag){ if(formData.value.checkFlag){
console.log(formData.value.qualified)
console.log(formData.value.reportCount)
console.log(formData.value.qualified > formData.value.reportCount)
if(formData.value.qualified>formData.value.reportCount){
formData.value.qualified = formData.value.reportCount
}
formData.value.unqualified = formData.value.reportCount - formData.value.qualified formData.value.unqualified = formData.value.reportCount - formData.value.qualified
} }
} }
@ -179,6 +186,21 @@
// //
function handleSubmit(){ function handleSubmit(){
if(formData.value.checkFlag){
console.log(formData.value.unqualified)
console.log(formData.value.qualified)
if(formData.value.reportCount != (formData.value.unqualified + formData.value.qualified)){
proxy.$modal.showToast('数量填写有问题,请检查')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1500)
return;
}
}
const Rcount = formData.value.unqualified + formData.value.qualified
// calculatePass()
proxy.$modal.confirm('确定提交处理吗').then(() => { proxy.$modal.confirm('确定提交处理吗').then(() => {
submitData() submitData()
}) })

Loading…
Cancel
Save