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. 27
      src/views/mes/workScheduling/components/report.vue
  7. 8
      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) => {
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
doPublishPlan() }finally{
formLoading.value=false;
handleClose()
}
handleClose()
}).catch(() => {
message.info("已取消发布")
})

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

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

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

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

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

@ -11,21 +11,21 @@
<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-form-item label="选择人员" required="true">
<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-number v-model="form.reportCount" @change="handleCount" :key="count"></el-input-number>
<el-form-item label="报工数量" required="true">
<el-input-number v-model="form.reportCount" @change="handleCount" ></el-input-number>
</el-form-item>
<el-form-item label="工时">
<el-form-item label="工时" required="true">
<el-input-number v-model="form.workTerm"></el-input-number>
</el-form-item>
<el-form-item label="是否已质检">
<el-switch v-model="form.checkFlag" active-value="true"> </el-switch>
</el-form-item>
<el-form-item label="合格数量" @change="handleCount" :key="qcount">
<el-form-item label="合格数量" @change="handleCount" >
<el-input-number
v-model="form.qualified"
:disabled="!form.checkFlag"
@ -121,7 +121,18 @@ const handleCount = () => {
}
//
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=[];
form.personSelected.forEach((item) => {
let data={
@ -141,7 +152,7 @@ const saveReport = async() => {
processCode: form.processCode,
list: listSub
}
console.log("report-saveReport-137",data)
//console.log("report-saveReport-137",data)
saveFlag.value = true
try {
await workschedulingApi.reportWorkByProcess(data)

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

@ -70,6 +70,8 @@
/>
<ReportAll ref="reportRef" @close="handleClose"></ReportAll>
<Finish ref="reportFinishRef" @close="handleClose"></Finish>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/work-scheduling/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
@ -87,6 +89,7 @@ import ReportAll from './components/reportAll.vue'
import Finish from './components/finish.vue'
defineOptions({ name: 'MesWorkScheduling' })
const message = useMessage() //
@ -182,13 +185,14 @@ const butttondata=(row) =>{ return [
defaultButtons.mainListHandleBtn({label:"恢复",name:'resume',hide: isShowMainButton(row,['3']),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"开工",name:'start',hide: isShowMainButton(row,['-1','0']),hasPermi:'mes:workScheduling:update'}),
// defaultButtons.mainListHandleBtn({label:"",name:'report',hide: isShowMainButton(row,['3','1'] ),hasPermi:'mes:workScheduling:update'}),
// defaultButtons.mainListHandleBtn({label:"",name:'check',hide: isShowMainButton(row,['5'] ),hasPermi:'mes:workScheduling:update'}),
//defaultButtons.mainListHandleBtn({label:"",name:'check',hide: isShowMainButton(row,['5'] ),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"完工",name:'finish',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
//defaultButtons.mainListHandleBtn({label:"",name:'callMaterial',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
]}
const reportRef=ref()
const reportFinishRef=ref()
const qualifiedCheck=ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
@ -204,7 +208,7 @@ const buttonTableClick = async (val, row) => {
}else if(val=='report'){
reportRef.value.openDetail(row,"报工")
}else if(val=='check'){
//reportRef.value.openDetail(row,"")
//qualifiedCheck.value.openDetail(row,"")
}else if(val=='finish'){
finishReport(row)
} else if(val=='callMaterial'){

Loading…
Cancel
Save