|
|
@ -14,7 +14,7 @@ |
|
|
|
<view class="dec-item"> |
|
|
|
<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="请输入数量" /> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -34,14 +34,14 @@ |
|
|
|
<view class="dec-item"> |
|
|
|
<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()" /> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<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"/> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -117,6 +117,13 @@ |
|
|
|
} |
|
|
|
function calculatePass(){ |
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
@ -179,6 +186,21 @@ |
|
|
|
|
|
|
|
// 提交处理请求函数 |
|
|
|
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(() => { |
|
|
|
submitData() |
|
|
|
}) |
|
|
|