|
|
@ -11,37 +11,37 @@ |
|
|
|
<view>检验质检单</view> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="检验单编号" prop="batchNo"> |
|
|
|
<u-form-item label="检验单编号" prop="qaFormNo"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入检验单编号"/> |
|
|
|
<u-input v-model="form.qaFormNo" placeholder="请输入检验单编号"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="检验单名称" prop="batchNo"> |
|
|
|
<u-form-item label="检验单名称" prop="qaFormName"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入检验单名称"/> |
|
|
|
<u-input v-model="form.qaFormName" placeholder="请输入检验单名称"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="检验类型" prop="batchNo"> |
|
|
|
<u-form-item label="检验类型" prop="qaFormType"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入检验类型"/> |
|
|
|
<u-input v-model="form.qaFormType" type="select" @click="showQaFormType = true" placeholder="请选择检测类型"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="检验时间" prop="batchNo"> |
|
|
|
<u-form-item label="检验时间" prop="qaTimes"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入检验时间"/> |
|
|
|
<u-input v-model="form.qaTimes" type="select" @click="showQaTime = true" placeholder="请选择检验时间"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="备注" prop="batchNo"> |
|
|
|
<u-form-item label="备注" prop="remark"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入备注"/> |
|
|
|
<u-input v-model="form.remark" placeholder="请输入备注"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
@ -49,33 +49,36 @@ |
|
|
|
<view>检测信息</view> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="检测数量" prop="batchNo"> |
|
|
|
<u-form-item label="检测数量" prop="qaCount"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入检测数量"/> |
|
|
|
<u-input v-model="form.qaCount" @update:modelValue="calculatePass()" placeholder="请输入检测数量"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="合格数量" prop="batchNo"> |
|
|
|
<u-form-item label="合格数量" prop="qaCountPassed"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入合格数量"/> |
|
|
|
<u-input v-model="form.qaCountPassed" @update:modelValue="calculatePass()" placeholder="请输入合格数量"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="不合格数量" prop="batchNo"> |
|
|
|
<u-form-item label="不合格数量" prop="qaCountNotpassed"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" disabled placeholder="自动生成"/> |
|
|
|
<u-input v-model="form.qaCountNotpassed" disabled placeholder="自动生成"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="合格率" prop="batchNo"> |
|
|
|
<u-form-item label="合格率" prop="qaPassRate"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" disabled placeholder="自动生成"/> |
|
|
|
<u-input v-model="form.qaPassRate" disabled placeholder="自动生成"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
</view> |
|
|
|
<view > |
|
|
|
<u-button type="primary" @click="submitQaForm()">提交</u-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="current == '1'"> |
|
|
|
<view class="title"> |
|
|
@ -103,35 +106,27 @@ |
|
|
|
<view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>任务编号:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>任务名称:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>站点名称:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>{{ number }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>工艺路线:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>工序编号:</view> |
|
|
|
<view>{{ nodeCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>工序名称:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>领取人工号:</view> |
|
|
|
<view>{{ receivePerson }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>工序编号:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>领取工位:</view> |
|
|
|
<view>{{ receiveWorkstation }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>班组:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>工作设备:</view> |
|
|
|
<view>{{ receiveDevice }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>任务负责人:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>计划数量:</view> |
|
|
|
<view>{{ planCount }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -140,55 +135,52 @@ |
|
|
|
<view>工单信息</view> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>主计划编号:</view> |
|
|
|
<view>{{ data.planMasterCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>工单编号:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>工单名称:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>产品编号:</view> |
|
|
|
<view>{{ data.productCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>产品名称:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>{{ data.productName }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>产品编号:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>车间编号:</view> |
|
|
|
<view>{{ data.workroomCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>规格型号:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>产线编号:</view> |
|
|
|
<view>{{ data.lineCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>产品类型:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>工艺路线编码:</view> |
|
|
|
<view>{{ data.prouteCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>单位:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
<view>工单模式:</view> |
|
|
|
<view>{{ data.formType }}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>BOM:</view> |
|
|
|
<view>{{ data.schedulingCode }}</view> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-form-item label="批次号" prop="batchNo"> |
|
|
|
<view> |
|
|
|
<u-input v-model="form.batchNo" placeholder="请输入批次号"/> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
<view>批次号:</view> |
|
|
|
<view>{{ data.batchCode }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view > |
|
|
|
<u-button type="primary" @click="openQualityInspect()">提交</u-button> |
|
|
|
</view> |
|
|
|
</u-form> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-select v-model="showQaFormType" :list="qaFormTypeList" @confirm="selectQaFormType"></u-select> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<u-picker v-model="showQaTime" mode="time" :params="qaTimeParams" @confirm="selectReworkTime"></u-picker> |
|
|
|
</view> |
|
|
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|
|
|
</template> |
|
|
@ -204,38 +196,173 @@ import { |
|
|
|
} from 'vue' |
|
|
|
|
|
|
|
import * as workSchedulingListApi from '@/api/mes/workScheduling/index.ts' |
|
|
|
import * as qaFormApi from '@/api/mes/qaForm/index.ts' |
|
|
|
|
|
|
|
const {proxy} = getCurrentInstance() |
|
|
|
const number = ref('') |
|
|
|
const data = ref({}) |
|
|
|
const loading = ref(false) |
|
|
|
|
|
|
|
const tabsList = ref([{name:'质检信息'},{name:'报工信息'},{name:'任务信息'},{name:'工单信息'}]) |
|
|
|
const current = ref(0) |
|
|
|
|
|
|
|
const showQaFormType = ref(false) |
|
|
|
const qaFormTypeList = ref([{label:'首检',value: '1'},{label:'人工',value: '2'}]) |
|
|
|
const showQaTime = ref(false) |
|
|
|
const qaTimeParams =ref({ |
|
|
|
year: true, |
|
|
|
month: true, |
|
|
|
day: true, |
|
|
|
hour: true, |
|
|
|
minute: true, |
|
|
|
second: true, |
|
|
|
timestamp: true, |
|
|
|
}) |
|
|
|
|
|
|
|
//任务信息:job_mes_work_scheduling_detail |
|
|
|
const planCount = ref('0') |
|
|
|
const nodeCode = ref('') |
|
|
|
const receivePerson = ref('') |
|
|
|
const receiveWorkstation = ref('') |
|
|
|
const receiveDevice = ref('') |
|
|
|
|
|
|
|
//工单信息:job_mes_work_scheduling |
|
|
|
const schedulingId = ref('') |
|
|
|
|
|
|
|
const form = ref({ |
|
|
|
batchNo: '' |
|
|
|
batchNo: '', |
|
|
|
schedulingCode:'', |
|
|
|
nodeCode:'', |
|
|
|
qaFormNo:'', |
|
|
|
qaFormName:'', |
|
|
|
qaFormType:'', |
|
|
|
qaTimes:'', |
|
|
|
remark:'', |
|
|
|
qaCount:'', |
|
|
|
qaCountPassed:'', |
|
|
|
qaCountNotpassed:'', |
|
|
|
qaPassRate:'', |
|
|
|
qaStatus:'', |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
function selectQaFormType(index){ |
|
|
|
form.value.qaFormType = index[0].value |
|
|
|
form.value.qaFormType = index[0].label |
|
|
|
showQaFormType.value = false |
|
|
|
} |
|
|
|
|
|
|
|
function selectReworkTime(index){ |
|
|
|
const dateStr = `${index.year}-${index.month}-${index.day} ${index.hour}:${index.minute}:${index.second}` |
|
|
|
form.value.qaTimes = dateStr |
|
|
|
showQaTime.value = false |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getWorkSchedulingDetail() { |
|
|
|
workSchedulingListApi.getWorkSchedulingDetail(number.value).then((res) => { |
|
|
|
console.log(number.value) |
|
|
|
workSchedulingListApi.getWorkSchedulingInfo(schedulingId.value).then((res) => { |
|
|
|
console.log(res.data) |
|
|
|
data.value = res.data |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function calculatePass(){ |
|
|
|
const calculateQaCount = ref(0) |
|
|
|
const calculateQaCountPassed = ref(0) |
|
|
|
if(form.value.qaCount == ''){ |
|
|
|
calculateQaCount.value = 0 |
|
|
|
}else{ |
|
|
|
calculateQaCount.value = form.value.qaCount |
|
|
|
} |
|
|
|
if(form.value.qaCountPassed == ''){ |
|
|
|
calculateQaCountPassed.value = 0 |
|
|
|
}else{ |
|
|
|
calculateQaCountPassed.value = form.value.qaCountPassed |
|
|
|
} |
|
|
|
form.value.qaCountNotpassed = calculateQaCount.value - calculateQaCountPassed.value |
|
|
|
|
|
|
|
form.value.qaPassRate = ((calculateQaCountPassed.value / form.value.qaCount) * 100).toFixed(2) +"%" |
|
|
|
} |
|
|
|
|
|
|
|
function submitQaForm(){ |
|
|
|
if(form.value.qaFormNo == ''||form.value.qaFormName == ''||form.value.qaFormType == ''|| |
|
|
|
form.value.qaTime == ''||form.value.qaTimes == ''||form.value.qaCount == ''|| |
|
|
|
form.value.qaCountPassed == ''||form.value.qaCountNotpassed == ''||form.value.qaPassRate == '' |
|
|
|
){ |
|
|
|
proxy.$modal.alert("还有未填项"); |
|
|
|
return |
|
|
|
} |
|
|
|
if(/^\d+$/.test(form.value.qaCount.trim())){ |
|
|
|
console.log(/^\d+$/.test(form.value.qaCount.trim())) |
|
|
|
}else{ |
|
|
|
proxy.$modal.alert("检查数量请输入正确的数字"); |
|
|
|
return |
|
|
|
} |
|
|
|
if(/^\d+$/.test(form.value.qaCountPassed.trim())){ |
|
|
|
console.log(/^\d+$/.test(form.value.qaCountPassed.trim())) |
|
|
|
}else{ |
|
|
|
proxy.$modal.alert("合格数量请输入正确的数字"); |
|
|
|
return |
|
|
|
} |
|
|
|
if(form.value.qaCount > planCount.value){ |
|
|
|
proxy.$modal.alert("检查数量不能大于计划数量"); |
|
|
|
return |
|
|
|
} |
|
|
|
if(form.value.qaCountPassed > planCount.value){ |
|
|
|
proxy.$modal.alert("合格数量不能大于计划数量"); |
|
|
|
return |
|
|
|
} |
|
|
|
if(form.value.qaCountPassed > form.value.qaCount){ |
|
|
|
proxy.$modal.alert("合格数量不能大于检测数量数量"); |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
console.log(form.value) |
|
|
|
proxy.$modal.confirm("是否确认提交").then(()=>{ |
|
|
|
proxy.$modal.loading('加载中') |
|
|
|
loading.value = true |
|
|
|
//报工质检状态完成 |
|
|
|
form.value.qaStatus = '1' |
|
|
|
qaFormApi.create(form.value).then((res) => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
if (res.data) { |
|
|
|
proxy.$modal.showToast('成功') |
|
|
|
setTimeout(() => { |
|
|
|
proxy.$tab.navigateBack() |
|
|
|
loading.value = false |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
}, 1000) |
|
|
|
} else { |
|
|
|
proxy.$modal.showToast('失败') |
|
|
|
loading.value = false |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onLoad((option) => { |
|
|
|
console.log(JSON.parse(option.obj).schedulingCode) |
|
|
|
if (option.obj) { |
|
|
|
number.value = JSON.parse(option.obj).schedulingCode |
|
|
|
|
|
|
|
} |
|
|
|
console.log(JSON.parse(option.obj)) |
|
|
|
if (option.obj) { |
|
|
|
number.value = JSON.parse(option.obj).schedulingCode |
|
|
|
form.value.nodeCode = JSON.parse(option.obj).nodeCode |
|
|
|
form.value.schedulingCode = JSON.parse(option.obj).schedulingCode |
|
|
|
//任务信息 |
|
|
|
nodeCode.value = JSON.parse(option.obj).nodeCode |
|
|
|
planCount.value = JSON.parse(option.obj).planCount |
|
|
|
receivePerson.value = JSON.parse(option.obj).receivePerson |
|
|
|
receiveWorkstation.value = JSON.parse(option.obj).receiveWorkstation |
|
|
|
receiveDevice.value = JSON.parse(option.obj).receiveDevice |
|
|
|
//工单ID |
|
|
|
schedulingId.value = JSON.parse(option.obj).id |
|
|
|
} |
|
|
|
}) |
|
|
|
onShow(() => { |
|
|
|
//getWorkSchedulingDetail() |
|
|
|
getWorkSchedulingDetail() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|