Browse Source

feat: update 1、搜索框不生效问题。2、待报工和待质检增加验证

master
TengXF 6 months ago
parent
commit
8996eadcd3
  1. 17
      src/pages/mes/workScheduling/waitQuality.vue
  2. 76
      src/pages/mes/workScheduling/waitReport.vue
  3. 58
      src/pages/mes/workScheduling/workScheduling.vue

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

@ -126,6 +126,23 @@
// //
function handleSubmit(){ function handleSubmit(){
if(saveData.value.personSelected.length == 0 ){
proxy.$modal.showToast('生产人员不能为空')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1000)
return;
}
if(saveData.value.checkPerson == ''){
proxy.$modal.showToast('质检人员不能为空')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1000)
return;
}
proxy.$modal.confirm('确定提交处理吗').then(() => { proxy.$modal.confirm('确定提交处理吗').then(() => {
submitData() submitData()
}) })

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

@ -9,14 +9,19 @@
<view class="dec"> <view class="dec">
<view class="dec-item"> <view class="dec-item">
<view>报工人员</view> <view>报工人员</view>
<view><u-input v-model="formData.reportPersonName" type="select" @click="showWorker = true" placeholder="请选择人员"/></view> <view><u-input v-model="formData.reportPersonName" type="select" @click="showWorker = true" placeholder="请选择人员"/></view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>报工数量</view> <view>报工数量</view>
<view> <view>
<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-number-box v-model="formData.reportCount" @update:modelValue="changeReportCount()" style="width:120px" :key="rekey" ></u-number-box>
<!-- <u</u-form-item>-input v-model="formData.reportCount" type="number" @update:modelValue="calculatePass()" placeholder="请输入数量" /> -->
</view> </view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>报工工时</view> <view>报工工时</view>
@ -34,17 +39,18 @@
<view class="dec-item"> <view class="dec-item">
<view>合格数量</view> <view>合格数量</view>
<view> <view>
<u-number-box :disabled="!formData.checkFlag" @update:modelValue="calculatePass()" v-model="formData.qualified" :max="planCount"></u-number-box> <u-number-box v-model="formData.qualified" @update:modelValue="changeQualified()" :key="Quakey" :disabled="!formData.checkFlag" ></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" style="width:120px"></u-number-box> <u-number-box disabled="true" v-model="formData.unqualified" :key="rekey" 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>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
@ -87,15 +93,18 @@
planDayCode:'PO20240430-0011', planDayCode:'PO20240430-0011',
processCode:'QD_CY_01' processCode:'QD_CY_01'
}) })
const rekey=ref(0) //
const Quakey = ref(0)
const maxQualified = ref(0)
const reportPersonList = ref([]) const reportPersonList = ref([])
const formData = ref({ const formData = ref({
checkFlag:false, checkFlag:false,
reportCount:'', reportCount:0,
qualified:'', qualified:0,
unqualified:'', unqualified:0,
reportPerson:'', reportPerson:'',
reportPersonName:'', reportPersonName:'',
workTerm:'' workTerm:0
}) })
const planCount = ref(100) const planCount = ref(100)
const saveData = ref({ const saveData = ref({
@ -115,15 +124,23 @@
formData.value.unqualified = 0 formData.value.unqualified = 0
} }
} }
function calculatePass(){ function changeReportCount(){
rekey.value++
console.log(1)
if(formData.value.reportCount> planCount.value){
formData.value.reportCount = planCount.value
}
if(formData.value.checkFlag){
formData.value.qualified = formData.value.reportCount
formData.value.unqualified = 0
}
}
function changeQualified(){
Quakey.value++
if(formData.value.qualified>formData.value.reportCount){
formData.value.qualified = formData.value.reportCount
}
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
} }
} }
@ -143,7 +160,7 @@
} }
}).catch(() => { }).catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
}) })
} }
function handleData(){ function handleData(){
@ -186,21 +203,21 @@
// //
function handleSubmit(){ function handleSubmit(){
if(formData.value.checkFlag){ if(reportPersonList.value.length == 0 ){
console.log(formData.value.unqualified) proxy.$modal.showToast('报工人员不能为空')
console.log(formData.value.qualified) setTimeout(() => {
if(formData.value.reportCount != (formData.value.unqualified + formData.value.qualified)){
proxy.$modal.showToast('数量填写有问题,请检查')
setTimeout(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
}, 1500) }, 1000)
return; return;
} }
if(formData.value.workTerm == 0){
proxy.$modal.showToast('报工工时不能为空')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1000)
return;
} }
const Rcount = formData.value.unqualified + formData.value.qualified
// calculatePass()
proxy.$modal.confirm('确定提交处理吗').then(() => { proxy.$modal.confirm('确定提交处理吗').then(() => {
submitData() submitData()
}) })
@ -213,6 +230,7 @@
saveData.value.processCode = paramData.value.nodeCode saveData.value.processCode = paramData.value.nodeCode
saveData.value.schedulingCode = paramData.value.schedulingCode saveData.value.schedulingCode = paramData.value.schedulingCode
planCount.value = paramData.value.planCount planCount.value = paramData.value.planCount
maxQualified.value = paramData.value.planCount
formData.value.reportCount = paramData.value.planCount formData.value.reportCount = paramData.value.planCount
} }
}) })

58
src/pages/mes/workScheduling/workScheduling.vue

@ -2,8 +2,8 @@
<view class="container"> <view class="container">
<view class="list"> <view class="list">
<view> <view>
<u-search :show-action="true" v-model="searchValue" action-text="搜索" input-align="left" height="65" <u-search :show-action="true" v-model="tabParams.planMasterCode" action-text="搜索" input-align="left" height="65"
border-color=#5599FF @search="searchTable()"> border-color=#5599FF @search="searchTable()" @custom="searchTable()" placeholder="请输入计划号">
</u-search> </u-search>
<u-tabs :list="list1" :is-scroll="true" active-color="#5599FF" v-model="current" <u-tabs :list="list1" :is-scroll="true" active-color="#5599FF" v-model="current"
@change="tabsChange"></u-tabs> @change="tabsChange"></u-tabs>
@ -43,6 +43,10 @@
<view v-if="current!=4" class="item" v-for="(item, index) in list" :key="index"> <view v-if="current!=4" class="item" v-for="(item, index) in list" :key="index">
<view class="dec">
<view>ID 测试用</view>
<view>{{ item.id }}</view>
</view>
<view class="dec"> <view class="dec">
<view>计划号</view> <view>计划号</view>
<view>{{ item.planMasterCode }}</view> <view>{{ item.planMasterCode }}</view>
@ -130,7 +134,7 @@
</view> </view>
<view> <view>
<u-button type="success" v-if="item.status==-1" size="mini" class="btn" <u-button type="success" v-if="item.status==-1" size="mini" class="btn"
@click="openInspectItem(item)">齐套检查</u-button> @click="openInspectItem(item)">齐套</u-button>
<u-button type="success" v-if="item.status==0" size="mini" class="btn" <u-button type="success" v-if="item.status==0" size="mini" class="btn"
@click="kaigong(item)">开工</u-button> @click="kaigong(item)">开工</u-button>
<u-button type="success" size="mini" @click="SOP(item)" class="btn" <u-button type="success" size="mini" @click="SOP(item)" class="btn"
@ -139,9 +143,7 @@
@click="callBasicItem(item)" class="btn">叫料</u-button> @click="callBasicItem(item)" class="btn">叫料</u-button>
<u-button v-if="item.flagDo==0 && item.status==1" type="error" size="mini" <u-button v-if="item.flagDo==0 && item.status==1" type="error" size="mini"
@click="addBasicItem(item)" class="btn">补料</u-button> @click="addBasicItem(item)" class="btn">补料</u-button>
<!-- <u-button v-if="(current==3||current==0) && item.status==1" type="success" size="mini" <u-button v-if="item.status==1 && item.workingNode =='endNode'" type="success" size="mini"
@click="finished(item)" class="btn">完工</u-button> -->
<u-button v-if="item.status==1 && item.workingNode =='endNode'" type="success" size="mini"
@click="finished(item)" class="btn">完工</u-button> @click="finished(item)" class="btn">完工</u-button>
<u-button v-if="(current==3||current==0) && item.status==1" type="success" size="mini" <u-button v-if="(current==3||current==0) && item.status==1" type="success" size="mini"
style="background-color:#888888" style="background-color:#888888"
@ -161,7 +163,6 @@
import { getCurrentInstance, ref } from "vue" import { getCurrentInstance, ref } from "vue"
import * as workSchedulingListApi from "@/api/mes/workScheduling/index.ts" import * as workSchedulingListApi from "@/api/mes/workScheduling/index.ts"
import * as workSchedulingApi from "@/api/mes/workScheduling"
import { _toast } from "@/utils/common" import { _toast } from "@/utils/common"
const list1 = ref([ const list1 = ref([
@ -227,20 +228,38 @@
}) })
falg.value = 'view' falg.value = 'view'
} }
function getFormattedDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0+1
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
const now = new Date();
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
const twoDaysAgo = new Date(today);
twoDaysAgo.setDate(today.getDate() - 2);
const tabParams = ref({ const tabParams = ref({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
status: '', status: '',
flag: null, flag: null,
flagDo: '' flagDo: '',
planMasterCode:'',
// createTime: [getFormattedDate(twoDaysAgo), getFormattedDate(today)]
}) })
async function getTabsList() { function getTabsList() {
console.log(tabParams.value)
if (status.value == 'nomore') return if (status.value == 'nomore') return
status.value = 'loading' status.value = 'loading'
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await workSchedulingListApi.getWorkSchedulingPDAPage(tabParams.value).then((res) => { workSchedulingListApi.getWorkSchedulingPDAPage(tabParams.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list) list.value = list.value.concat(res.data.list)
@ -379,6 +398,7 @@
switch (index) { switch (index) {
case 0: case 0:
tabParams.value.status = ''; tabParams.value.status = '';
tabParams.value.planMasterCode = ''
break; break;
case 1: case 1:
tabParams.value.status = '-1'; tabParams.value.status = '-1';
@ -429,13 +449,19 @@
}) })
async function searchTable() { async function searchTable() {
console.log(searchValue.value)
// tabParams.value.planMasterCode = searchValue.value
list.value = [] list.value = []
searchTableParams.value.planNoDay = this.searchValue tabParams.value.pageNo = 1
await workSchedulingListApi.getWorkSchedulingPDAPage(searchTableParams.value).then((res) => { getTabsList()
if (res.data.list.length > 0) { // list.value = []
list.value = list.value.concat(res.data.list) // searchTableParams.value.planNoDay = this.searchValue
} // console.log(searchTableParams.value)
}) // await workSchedulingListApi.getWorkSchedulingPDAPage(searchTableParams.value).then((res) => {
// if (res.data.list.length > 0) {
// list.value = list.value.concat(res.data.list)
// }
// })
} }
// -> // ->
function finished(item) { function finished(item) {

Loading…
Cancel
Save