Browse Source

2024-05-14 增加工序质检;报工功能优化

master_hella_20240701
zhousq 6 months ago
parent
commit
dd6bc39208
  1. 4
      src/api/mes/workScheduling/index.ts
  2. 3
      src/views/mes/orderDay/components/schedule.vue
  3. 2
      src/views/mes/orderDay/index.vue
  4. 71
      src/views/mes/workScheduling/components/Detail.vue
  5. 127
      src/views/mes/workScheduling/components/qualifiedCheck.vue
  6. 25
      src/views/mes/workScheduling/components/report.vue
  7. 6
      src/views/mes/workScheduling/index.vue

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

@ -72,5 +72,9 @@ export const getCurrentWorkerList = async (params) => {
export const getProcessList = async (params) => { export const getProcessList = async (params) => {
return await request.get({ url: `/mes/workScheduling/getProcessList`, params }) return await request.get({ url: `/mes/workScheduling/getProcessList`, params })
} }
//工序质检
export const processQualified = async (data) => {
return await request.post({ url: `/mes/work-scheduling-detail/processQualified`, data })
}

3
src/views/mes/orderDay/components/schedule.vue

@ -482,8 +482,9 @@ const publishPlan=()=>{
try{formLoading.value=true try{formLoading.value=true
doPublishPlan() }finally{ doPublishPlan() }finally{
formLoading.value=false; formLoading.value=false;
}
handleClose() handleClose()
}
}).catch(() => { }).catch(() => {
message.info("已取消发布") message.info("已取消发布")
}) })

2
src/views/mes/orderDay/index.vue

@ -201,9 +201,7 @@ const buttonBaseClick = (val, item) => {
} }
const publishClosed=()=>{ const publishClosed=()=>{
//console.log('orderday-publishClosed-200') //console.log('orderday-publishClosed-200')
nextTick(() => {
getList() getList()
})
} }
// //

71
src/views/mes/workScheduling/components/Detail.vue

@ -181,7 +181,8 @@
</el-drawer> </el-drawer>
<!-- 表格弹窗 --> <!-- 表格弹窗 -->
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" /> <SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" />
<reportProcess ref="refreport" ></reportProcess> <reportProcess ref="refreport" ></reportProcess>\
<QualifiedCheck ref="qualifiedCheck" @close="handleClose"></QualifiedCheck>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="formRef" ref="formRef"
@ -216,7 +217,7 @@ import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' import QualifiedCheck from '@/views/mes/workScheduling/components/qualifiedCheck.vue'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import * as WorkSchedulingDetailApi from '@/api/mes/workSchedulingDetail' import * as WorkSchedulingDetailApi from '@/api/mes/workSchedulingDetail'
import reportProcess from '@/views/mes/workScheduling/components/report.vue' import reportProcess from '@/views/mes/workScheduling/components/report.vue'
@ -230,7 +231,7 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const updateKey = ref(0) const updateKey = ref(0)
const qualifiedCheck=ref()
const props = defineProps({ const props = defineProps({
// //
tabs: { tabs: {
@ -800,46 +801,44 @@ const opensearchTable = (
// } // }
// - // -
const buttonTableClick = async (val, row) => { // const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
// // //
if (props.isOpenSearchTable) { // if (props.isOpenSearchTable) {
searchTableFormType.value = 'update' // searchTableFormType.value = 'update'
if (row?.id || row?.masterId) { // if (row?.id || row?.masterId) {
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row) // searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row)
} // }
const item = props.detailAllSchemas.formSchema[0] // const item = props.detailAllSchemas.formSchema[0]
opensearchTable( // opensearchTable(
item.field, // item.field,
item?.componentProps?.searchField, // item?.componentProps?.searchField,
item?.componentProps?.searchTitle, // item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas, // item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage, // item?.componentProps?.searchPage,
item?.componentProps?.searchCondition, // item?.componentProps?.searchCondition,
item?.componentProps?.multiple, // item?.componentProps?.multiple,
undefined, // undefined,
undefined // undefined
) // )
} else { // } else {
openForm('update', row) // openForm('update', row)
} // }
} else if (val == 'delete') { // } else if (val == 'delete') {
// // //
handleDelete(row.id) // handleDelete(row.id)
} else { // } else {
emit('tableFormButton', val, row) // emit('tableFormButton', val, row)
} // }
} // }
const buttonClick=(type,row)=>{ const buttonClick=(type,row)=>{
if (type == 'pfinished') { if (type == 'pfinished') {
WorkSchedulingDetailApi.processFinished(row.id) WorkSchedulingDetailApi.processFinished(row.id)
getList() getList()
}else if (type == 'reprotProcess') { }else if (type == 'reprotProcess') {
refreport.value.openDetail(row,"工序报工", planDayCode.value) refreport.value.openDetail(row,"工序报工", planDayCode.value)
//
}else if (type == 'checkProcess') { }else if (type == 'checkProcess') {
//WorkSchedulingDetailApi.processFinished(row.id) qualifiedCheck.value.openDetail(row,"质检",planDayCode.value)
} }
getList() getList()
} }

127
src/views/mes/workScheduling/components/qualifiedCheck.vue

@ -0,0 +1,127 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:close-on-click-modal="true"
:vLoading="formLoading"
width="600px"
>
<template #title>{{ dialogTitle }} </template>
<el-form :model="form">
<el-form-item label="工序">
<el-input v-model="form.processCode" disabled />
</el-form-item>
<el-form-item label="生产人员">
<el-select v-model="form.personSelected" multiple>
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" />
</el-select>
</el-form-item>
<el-form-item label="质检人员">
<el-input v-model="form.checkPerson" />
</el-form-item>
<el-form-item label="合格数量" @change="handleCount" :key="qcount">
<el-input-number
v-model="form.qualified"
@change="handleCount"
></el-input-number>
</el-form-item>
<el-form-item label="不合格数量">
<el-input-number v-model="form.unqualified" @change="handleCount" :key="qcount"></el-input-number>
</el-form-item>
<el-form-item label="不合格原因">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" :disabled="saveFlag" @click="saveReport">保存</el-button>
</template> </Dialog
>
</template>
<script lang="ts" setup>
import { Dialog } from '@/components/Dialog'
import * as workschedulingApi from '@/api/mes/workScheduling'
const message = useMessage() //
const { t } = useI18n() //
const rowData = ref()
const dialogVisible = ref(false)
const dialogTitle = ref()
const formLoading = ref(false)
const personOption=ref([])
const saveFlag=ref(false)
const planDayCode=ref()
const form = reactive({
id:0,
planDayCode: "",
processCode:"",
personSelected:[],
qualified:0,
unqualified:0,
remark:"",
checkPerson:""
})
const openDetail = async (row: any, titleName: any,code:string) => {
rowData.value = row
//console.log('row-68',row)
dialogVisible.value = true
dialogTitle.value = titleName
form.processCode=row.nodeCode
form.personSelected=[]
form.planDayCode=code
form.personSelected=[]
form.qualified=0
form.unqualified=0
form.id=row.id
planDayCode.value=code
getCurrentWorkerList(row.nodeCode)
}
//
const getCurrentWorkerList = async (val) => {
let params = {
planDayCode: planDayCode.value,
processCode: val
}
personOption.value = await workschedulingApi.getCurrentWorkerList(params)
}
const qcount=ref(0)
//
const handleCount = () => {
qcount.value++
if (form.qualified> rowData.value.planCount - form.unqualified) {
message.alert('合格数量超限!计划总数【'+rowData.value.planCount+'】')
form.qualified =rowData.value.planCount - form.unqualified
return
}
if (form.unqualified> rowData.value.planCount -form.qualified ) {
message.alert('不合格数量超限!')
form.unqualified =rowData.value.planCount-form.qualified
return
}
}
//
const saveReport = async() => {
saveFlag.value = true
try {
await workschedulingApi.processQualified(form)
}finally{
saveFlag.value = false
dialogVisible.value = false
emit('close')
}
//console.log("report-saveReport-82",data)
//await workschedulingApi.reportWorkByProcess(data)
}
//
const emit = defineEmits(['success', 'close'])
defineOptions({ name: 'qualifiedCheck' })
defineExpose({ openDetail }) // open
</script>

25
src/views/mes/workScheduling/components/report.vue

@ -11,21 +11,21 @@
<el-form-item label="工序"> <el-form-item label="工序">
<el-input v-model="form.processCode" disabled /> <el-input v-model="form.processCode" disabled />
</el-form-item> </el-form-item>
<el-form-item label="选择人员"> <el-form-item label="选择人员" required="true">
<el-select v-model="form.personSelected" multiple > <el-select v-model="form.personSelected" multiple >
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" /> <el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报工数量"> <el-form-item label="报工数量" required="true">
<el-input-number v-model="form.reportCount" @change="handleCount" :key="count"></el-input-number> <el-input-number v-model="form.reportCount" @change="handleCount" ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="工时"> <el-form-item label="工时" required="true">
<el-input-number v-model="form.workTerm"></el-input-number> <el-input-number v-model="form.workTerm"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="是否已质检"> <el-form-item label="是否已质检">
<el-switch v-model="form.checkFlag" active-value="true"> </el-switch> <el-switch v-model="form.checkFlag" active-value="true"> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="合格数量" @change="handleCount" :key="qcount"> <el-form-item label="合格数量" @change="handleCount" >
<el-input-number <el-input-number
v-model="form.qualified" v-model="form.qualified"
:disabled="!form.checkFlag" :disabled="!form.checkFlag"
@ -121,7 +121,18 @@ const handleCount = () => {
} }
// //
const saveReport = async() => { const saveReport = async() => {
if(form.reportCount<1){
message.alert('报工数量不能小于1!')
return
}
if(form.personSelected.length<1){
message.alert('必须选择一个报工人')
return
}
if(form.workTerm<0){
message.alert('工时数量不能小于0!')
return
}
let listSub=[]; let listSub=[];
form.personSelected.forEach((item) => { form.personSelected.forEach((item) => {
let data={ let data={
@ -141,7 +152,7 @@ const saveReport = async() => {
processCode: form.processCode, processCode: form.processCode,
list: listSub list: listSub
} }
console.log("report-saveReport-137",data) //console.log("report-saveReport-137",data)
saveFlag.value = true saveFlag.value = true
try { try {
await workschedulingApi.reportWorkByProcess(data) await workschedulingApi.reportWorkByProcess(data)

6
src/views/mes/workScheduling/index.vue

@ -70,6 +70,8 @@
/> />
<ReportAll ref="reportRef" @close="handleClose"></ReportAll> <ReportAll ref="reportRef" @close="handleClose"></ReportAll>
<Finish ref="reportFinishRef" @close="handleClose"></Finish> <Finish ref="reportFinishRef" @close="handleClose"></Finish>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/work-scheduling/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/mes/work-scheduling/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
@ -87,6 +89,7 @@ import ReportAll from './components/reportAll.vue'
import Finish from './components/finish.vue' import Finish from './components/finish.vue'
defineOptions({ name: 'MesWorkScheduling' }) defineOptions({ name: 'MesWorkScheduling' })
const message = useMessage() // const message = useMessage() //
@ -189,6 +192,7 @@ const butttondata=(row) =>{ return [
]} ]}
const reportRef=ref() const reportRef=ref()
const reportFinishRef=ref() const reportFinishRef=ref()
const qualifiedCheck=ref()
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
@ -204,7 +208,7 @@ const buttonTableClick = async (val, row) => {
}else if(val=='report'){ }else if(val=='report'){
reportRef.value.openDetail(row,"报工") reportRef.value.openDetail(row,"报工")
}else if(val=='check'){ }else if(val=='check'){
//reportRef.value.openDetail(row,"") //qualifiedCheck.value.openDetail(row,"")
}else if(val=='finish'){ }else if(val=='finish'){
finishReport(row) finishReport(row)
} else if(val=='callMaterial'){ } else if(val=='callMaterial'){

Loading…
Cancel
Save