Browse Source

feat: update 增加数量限制

master
TengXF 6 months ago
parent
commit
09b98f613a
  1. 16
      src/pages/mes/workScheduling/waitQuality.vue
  2. 30
      src/pages/mes/workScheduling/waitReport.vue
  3. 2
      src/pages/mes/workScheduling/workScheduling.vue

16
src/pages/mes/workScheduling/waitQuality.vue

@ -17,11 +17,17 @@
</view>
<view class="dec-item">
<view>合格数量</view>
<view><u-input v-model="saveData.qualified" type="number" placeholder="请输入合格数量" /></view>
<view>
<u-number-box v-model="saveData.qualified" style="width:120px" :max="planCount" @change="valChange"></u-number-box>
<!-- <u-input v-model="saveData.qualified" type="number" placeholder="请输入合格数量" /> -->
</view>
</view>
<view class="dec-item">
<view>不合格数量</view>
<view><u-input v-model="saveData.unqualified" type="number" placeholder="请输入不合格数量" /></view>
<view>
<u-number-box v-model="saveData.unqualified" style="width:120px" disabled="true"></u-number-box>
<!-- <u-input v-model="saveData.unqualified" type="number" placeholder="请输入不合格数量" /> -->
</view>
</view>
<view class="dec-item">
<view>不合格原因</view>
@ -69,6 +75,7 @@
planDayCode:'PO20240430-0011',
processCode:'QD_CY_01'
})
const planCount = ref(100)
const saveData = ref({
id:'0',
planDayCode:'',
@ -100,6 +107,9 @@
})
}
function valChange(){
saveData.value.unqualified = planCount.value - saveData.value.qualified
}
//
function confirmSelectWorker(val){
if(!saveData.value.personSelected.includes(val[0].value)){
@ -128,6 +138,8 @@
saveData.value.processCode = paramData.value.nodeCode
saveData.value.planDayCode = paramData.value.planNoDay
saveData.value.id = paramData.value.id
planCount.value = paramData.value.planCount
saveData.value.qualified = paramData.value.planCount
}
})
onShow(() => {

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

@ -13,11 +13,17 @@
</view>
<view class="dec-item">
<view>报工数量</view>
<view><u-input v-model="formData.reportCount" type="number" @update:modelValue="calculatePass()" placeholder="请输入数量" /></view>
<view>
<u-number-box v-model="formData.reportCount" @change="calculatePass()" style="width:120px" :max="planCount"></u-number-box>
<!-- <u-input v-model="formData.reportCount" type="number" @update:modelValue="calculatePass()" placeholder="请输入数量" /> -->
</view>
</view>
<view class="dec-item">
<view>报工工时</view>
<view><u-input v-model="formData.workTerm" type="number" placeholder="请输入工时" /></view>
<view>
<!-- <u-input v-model="formData.workTerm" type="number" placeholder="请输入工时" /> -->
<u-number-box v-model="formData.workTerm" @change="valChange" style="width:120px"></u-number-box>
</view>
</view>
<view class="dec-item">
<view>是否质检</view>
@ -27,11 +33,17 @@
</view>
<view class="dec-item">
<view>合格数量</view>
<view><u-input :disabled="!formData.checkFlag" v-model="formData.qualified" type="number" placeholder="请输入合格数量" @update:modelValue="calculatePass()" /></view>
<view>
<u-number-box :disabled="!formData.checkFlag" v-model="formData.qualified" @change="calculatePass()" style="width:120px" :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-input v-model="formData.unqualified" type="number" disabled="true"/></view>
<view>
<u-number-box disabled="true" v-model="formData.unqualified" @change="calculatePass()" style="width:120px"></u-number-box>
<!-- <u-input v-model="formData.unqualified" type="number" disabled="true"/> -->
</view>
</view>
</view>
</view>
@ -85,6 +97,7 @@
reportPersonName:'',
workTerm:''
})
const planCount = ref(100)
const saveData = ref({
processCode:'',
reportDate:'',
@ -94,11 +107,12 @@
function changeStatus(){
if(formData.value.checkFlag){
formData.value.qualified = formData.value.reportCount
}
else
{
formData.value.qualified = ''
formData.value.unqualified = ''
formData.value.qualified = 0
formData.value.unqualified = 0
}
}
function calculatePass(){
@ -144,7 +158,6 @@
const formattedTime = currentDate.toTimeString().split(' ')[0]; // HH:mm:ss
// reportDate
saveData.value.reportDate = `${formattedDate} ${formattedTime}`;
console.log(saveData.value)
}
@ -177,6 +190,8 @@
nodeInfo.value.processCode = paramData.value.nodeCode
saveData.value.processCode = paramData.value.nodeCode
saveData.value.schedulingCode = paramData.value.schedulingCode
planCount.value = paramData.value.planCount
formData.value.reportCount = paramData.value.planCount
}
})
onShow(() => {
@ -194,7 +209,6 @@
}
//
function transList(data) {
console.log(data)
const list = data.map(item => {
return {
"label": item.workerName,

2
src/pages/mes/workScheduling/workScheduling.vue

@ -317,7 +317,7 @@
//
function nodeCodeFinish(item) {
console.log(item)
proxy.$modal.confirm("是否确认完成工序").then(() => {
proxy.$modal.loading('加载中')
workSchedulingListApi.getWorkSchedulingProcessFinished(item.id).then((res) => {

Loading…
Cancel
Save