Browse Source

MES——> 报工检查 更新

master
gaojs 7 months ago
parent
commit
2188dbd264
  1. 8
      src/api/mes/qaForm/index.ts
  2. 4
      src/api/mes/workScheduling/index.ts
  3. 273
      src/pages/mes/workScheduling/reportWorkQualityInspection.vue
  4. 6
      src/pages/mes/workScheduling/workScheduling.vue
  5. 219
      src/pages/mes/workScheduling/workSchedulingDetail.vue

8
src/api/mes/qaForm/index.ts

@ -0,0 +1,8 @@
import http from '../../http'
export function create(data) {
return http.post('/mes/work-scheduling-qaform/create',data)
}

4
src/api/mes/workScheduling/index.ts

@ -32,6 +32,10 @@ export function getWorkSchedulingPage(params) {
return http.get('/mes/workScheduling/page', {params})
}
export function getWorkSchedulingInfo(number) {
return http.get('/mes/workScheduling/get?id=' + number)
}
export function getWorkSchedulingDetail(number) {
//return http.get('/eam/item-apply-request-main/appGetByNumber?number=' + number)
return http.get('/mes/work-scheduling-detail/get-info?schedulingCode=' + number)

273
src/pages/mes/workScheduling/reportWorkQualityInspection.vue

@ -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>

6
src/pages/mes/workScheduling/workScheduling.vue

@ -13,14 +13,14 @@
<view class="item" v-for="(item, index) in list" :key="index" @click="openDetail(item)">
<view class="title">
<view class="title-txt">
{{item.planMaserCode}}
{{item.planMasterCode}}
</view>
<view class="time">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
<view class="dec">
<view>日计划单号</view><view>{{ item.planMaserCode }}</view>
<view>日计划单号</view><view>{{ item.planMasterCode }}</view>
</view>
<view class="dec">
<view>任务工单号</view><view>{{ item.schedulingCode }}</view>
@ -206,7 +206,7 @@ onReachBottom(() => {
//
function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/workSchedulingDetail?schedulingCode=${item.schedulingCode}`)
proxy.$tab.navigateTo(`/pages/mes/workScheduling/workSchedulingDetail?obj=${JSON.stringify(item)}`)
}
//Bom

219
src/pages/mes/workScheduling/workSchedulingDetail.vue

@ -4,91 +4,100 @@
<!-- <view>
<u-subsection :list="tabsList" v-model="current" @change="tabsChange"></u-subsection>
</view> -->
<view class="info">
<view class="title">
<view>生产工序任务明细</view>
</view>
<view class="dec">
<view class="dec-item">
<view>工单号</view>
<view>{{ data.schedulingCode }}</view>
</view>
<view class="dec-item">
<view>状态</view>
<view>{{ data.status }}</view>
</view>
<view class="dec-item">
<view>工序编号</view>
<view>{{ data.nodeCode }}</view>
</view>
<view class="dec-item">
<view>工位验证编码组</view>
<view>{{ data.workstationValidate }}</view>
</view>
<view class="dec-item">
<view>设备验证编码组</view>
<view>{{ data.deviceValidate }}</view>
</view>
<view class="dec-item">
<view>人员验证组</view>
<view>{{ data.personValidate }}</view>
<view class="item" v-for="(item, index) in list" :key="index" @click="openDetail(item)">
<view class="info">
<view class="title">
<view>生产工序任务明细</view>
</view>
<view class="dec">
<view class="dec-item">
<view>工单号</view>
<view>{{ item.schedulingCode }}</view>
</view>
<view class="dec-item">
<view>状态</view>
<view>{{ item.status }}</view>
</view>
<view class="dec-item">
<view>工序编号</view>
<view>{{ item.nodeCode }}</view>
</view>
<view class="dec-item">
<view>工位验证编码组</view>
<view>{{ item.workstationValidate }}</view>
</view>
<view class="dec-item">
<view>设备验证编码组</view>
<view>{{ item.deviceValidate }}</view>
</view>
<view class="dec-item">
<view>人员验证组</view>
<view>{{ item.personValidate }}</view>
</view>
<view class="dec-item">
<view>物料验证组</view>
<view>{{ item.materialValidate }}</view>
</view>
<view class="dec-item">
<view>计划数量</view>
<view>{{ item.planCount }}</view>
</view>
<view class="dec-item">
<view>报工人编号</view>
<view>{{ item.reportPerson }}</view>
</view>
<view class="dec-item">
<view>领取人工号</view>
<view>{{ item.receivePerson }}</view>
</view>
<view class="dec-item">
<view>报工数量</view>
<view>{{ item.reportCount }}</view>
</view>
<view class="dec-item">
<view>报工类型</view>
<view>{{ item.reportType }}</view>
</view>
<view class="dec-item">
<view>合格数量</view>
<view>{{ item.qualifiedCount }}</view>
</view>
<view class="dec-item">
<view>不合格数量</view>
<view>{{ item.unqualifiedCount }}</view>
</view><view class="dec-item">
<view>领取工位</view>
<view>{{ item.receiveWorkstation }}</view>
</view>
<view class="dec-item">
<view>工作设备编码</view>
<view>{{ item.receiveDevice }}</view>
</view>
<view class="dec-item">
<view>报工质检状态</view>
<view>{{ item.qaStatus }}</view>
</view>
<!-- </view><view class="dec-item">
<view>紧前工序编码</view>
<view>{{ data.preNodeCode }}</view>
</view>
<view class="dec-item">
<view>紧后工序编码</view>
<view>{{ data.nextNodeCode }}</view>
</view> -->
<view class="dec-item">
<view>创建时间</view>
<view>{{ `${$time.formatDate(item.createTime)}` }}</view>
</view>
</view>
<view v-if="item.qaStatus!=1" >
<u-button type="primary" @click="openQualityInspect(item)">报工质检</u-button>
</view>
<view v-if="item.qaStatus==1" >
<u-button type="primary" @click="openQualityInspect(item)">报工</u-button>
</view>
</view>
<view class="dec-item">
<view>物料验证组</view>
<view>{{ data.materialValidate }}</view>
</view>
<view class="dec-item">
<view>计划数量</view>
<view>{{ data.planCount }}</view>
</view>
<view class="dec-item">
<view>报工人编号</view>
<view>{{ data.reportPerson }}</view>
</view>
<view class="dec-item">
<view>领取人工号</view>
<view>{{ data.receivePerson }}</view>
</view>
<view class="dec-item">
<view>报工数量</view>
<view>{{ data.reportCount }}</view>
</view>
<view class="dec-item">
<view>报工类型</view>
<view>{{ data.reportType }}</view>
</view>
<view class="dec-item">
<view>合格数量</view>
<view>{{ data.qualifiedCount }}</view>
</view>
<view class="dec-item">
<view>不合格数量</view>
<view>{{ data.unqualifiedCount }}</view>
</view><view class="dec-item">
<view>领取工位</view>
<view>{{ data.receiveWorkstation }}</view>
</view>
<view class="dec-item">
<view>工作设备编码</view>
<view>{{ data.receiveDevice }}</view>
</view>
<!-- </view><view class="dec-item">
<view>紧前工序编码</view>
<view>{{ data.preNodeCode }}</view>
</view>
<view class="dec-item">
<view>紧后工序编码</view>
<view>{{ data.nextNodeCode }}</view>
</view> -->
<view class="dec-item">
<view>创建时间</view>
<view>{{ `${$time.formatDate(data.createTime)}` }}</view>
</view>
</view>
<view >
<u-button type="primary" @click="openQualityInspect()">报工质检</u-button>
</view>
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
@ -96,7 +105,8 @@
<script setup lang="ts">
import {
onLoad,
onShow
onShow,
onReachBottom
} from '@dcloudio/uni-app'
import {
ref,
@ -111,32 +121,45 @@ const data = ref({})
const loading = ref(false)
const from = ref()//13
const type = ref()
const list = ref([])
const tabsList = ref([{name:'工单明细'},{name:'工序任务'}])
const current = ref(0)
const schedulingId = ref('')
function getWorkSchedulingDetail() {
workSchedulingListApi.getWorkSchedulingDetail(number.value).then((res) => {
console.log(number.value)
data.value = res.data
}).catch(() => {
})
list.value = []
proxy.$modal.loading('加载中')
workSchedulingListApi.getWorkSchedulingDetail(number.value).then((res) => {
proxy.$modal.closeLoading()
data.value = res.data
if (res.data.length > 0) {
list.value = list.value.concat(res.data)
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
function openQualityInspect() {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/reportWorkQualityInspection?obj=${JSON.stringify(data.value)}`)
}
function openQualityInspect(item) {
item.id = schedulingId.value
proxy.$tab.navigateTo(`/pages/mes/workScheduling/reportWorkQualityInspection?obj=${JSON.stringify(item)}`)
}
//
onReachBottom(() => {
getWorkSchedulingDetail()
})
onLoad((option) => {
if (option.type) type.value = option.type
if (option.from) from.value = option.from
if (option.schedulingCode) {
number.value = option.schedulingCode
}
console.log(JSON.parse(option.obj))
if (option.obj) {
number.value = JSON.parse(option.obj).schedulingCode
schedulingId.value = JSON.parse(option.obj).id
}
})
onShow(() => {
getWorkSchedulingDetail()

Loading…
Cancel
Save