diff --git a/src/api/mes/workScheduling/index.ts b/src/api/mes/workScheduling/index.ts
index 7df13e502..d8cbe4a9e 100644
--- a/src/api/mes/workScheduling/index.ts
+++ b/src/api/mes/workScheduling/index.ts
@@ -52,10 +52,14 @@ export const importTemplate = () => {
export const completeHandle = async (data) => {
return await request.post({ url: `/mes/workScheduling/completeHandle`, data })
}
-//报工
+//工序报工
export const reportWorkByProcess = async (data) => {
return await request.post({ url: `/mes/work-scheduling-detail/reportWorkByProcess`, data })
}
+//批量报工
+export const reportWorkByTask = async (data) => {
+ return await request.post({ url: `/mes/workScheduling/reportForAll`, data })
+}
//检查当前节点是否可以完工
export const getNodePosition = async (params) => {
return await request.get({ url: `/mes/workScheduling/getNodePosition`, params })
diff --git a/src/api/mes/workSchedulingDetail/index.ts b/src/api/mes/workSchedulingDetail/index.ts
index f39e63513..122291bcc 100644
--- a/src/api/mes/workSchedulingDetail/index.ts
+++ b/src/api/mes/workSchedulingDetail/index.ts
@@ -63,3 +63,7 @@ export const exportWorkSchedulingDetail = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/mes/work-scheduling-detail/get-import-template' })
}
+//工序报工
+export const reportWorkByProcess = async (data) => {
+ return await request.post({ url: `/mes/work-scheduling-detail/reportWorkByProcess`, data })
+}
\ No newline at end of file
diff --git a/src/views/mes/workScheduling/components/Detail.vue b/src/views/mes/workScheduling/components/Detail.vue
index dc9f96206..e3929c93c 100644
--- a/src/views/mes/workScheduling/components/Detail.vue
+++ b/src/views/mes/workScheduling/components/Detail.vue
@@ -72,7 +72,7 @@
-->
-
- {{ item }}
-
+
-
+ 完工
+ 报工
+ 质检
-
-
-
+
+ dddddddddd
-
+ -->
+
0) {
tabsList.value.unshift({
@@ -554,7 +548,9 @@ const masterParmas = ref({
// 列表头部按钮
const HeadButttondata = ref()
// 列表-操作按钮
-const buttondata = ref()
+const buttondata = ref(
+
+)
/** 表格弹窗 */
const initModel = (schema: FormSchema[], formModel: Recordable) => {
const model: Recordable = { ...formModel }
@@ -585,10 +581,13 @@ const searchTableFormType = ref('') // 表单的类型:create - 新增;updat
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
+const planDayCode=ref()
const count = ref(0)
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
+
+ planDayCode.value=row.planMasterCode
remarksData.data = {
tableId: row.id,
tableName: tableName
@@ -658,12 +657,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
})
]
}
-
- if(row.status == '1'){
- props.buttondataTable[0].hide = false
- }else{
- props.buttondataTable[0].hide = true
- }
+ //console.log("props.buttondataTable-663",props.buttondataTable);
buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable]
} finally {
detailLoading.value = false
@@ -671,7 +665,6 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
}
defineExpose({ openDetail, formRef }) // 提供 open 方法,用于打开弹窗
-
// 获取备注列表
const getRemarkList = async () => {
detailLoading.value = true
@@ -833,14 +826,23 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'delete') {
// 删除
handleDelete(row.id)
- } else if (val == 'pfinished') {
-
- WorkSchedulingDetailApi.processFinished(row.id)
- getList()
- }else {
+ } 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)
+}
+getList()
+}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
diff --git a/src/views/mes/workScheduling/components/report.vue b/src/views/mes/workScheduling/components/report.vue
index 2adaf1dbe..0ac97305d 100644
--- a/src/views/mes/workScheduling/components/report.vue
+++ b/src/views/mes/workScheduling/components/report.vue
@@ -4,71 +4,20 @@
v-model="dialogVisible"
:close-on-click-modal="true"
:vLoading="formLoading"
- width="fit-content"
+ width="600px"
>
{{ dialogTitle }}
- 添加
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{scope.row.unqualified= scope.row.reportCount -scope.row.qualified}}
-
-
-
-
- 删除
-
-
-
-
+
关闭
@@ -101,19 +50,11 @@ import dayjs from 'dayjs'
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
const rowData = ref()
-const openDetail = async (row: any, titleName: any) => {
- rowData.value = row
- dialogVisible.value = true
- dialogTitle.value = titleName
- getProcessList(row)
-
-}
const dialogVisible = ref(false)
const dialogTitle = ref()
const formLoading = ref(false)
-const processOption = ref([])
const personOption=ref([])
-const processCodeSelected = ref()
+const processCode = ref()
const personSelected = ref()
const checkFlag = ref(false)
const unqualified = ref()
@@ -121,37 +62,24 @@ const reportCount = ref()
const qualified = ref()
const workTerm = ref()
const saveFlag=ref(false)
-const tableData=ref([{}])
-const addRow=()=>{
- tableData.value.push({
- processCode:processCodeSelected.value,
- processName:processOption.value?.find(item=>item.processCode==processCodeSelected.value)?.processName,
- reportName:personOption.value?.find(item=>item.workerCode==personSelected.value)?.workerName,
- reportCount:reportCount.value,
- workTerm:workTerm.value,
- checkFlag:checkFlag.value})
-
-}
-const deleteRow = (index: number) => {
- tableData.value.splice(index, 1)
-}
-//获取工序列表
-const getProcessList=async(row)=>{
- let params={
- planDayCode:row.planMasterCode,
- schedulingCode:row.schedulingCode
- }
- processOption.value=await workschedulingApi.getProcessList(params)
-}
-const processChange=(val:any)=>{
- //console.log("processChange-81",val)
- getCurrentWorkerList(val)
+const planDayCode=ref()
+const formRef=ref()
+const openDetail = async (row: any, titleName: any,code:string) => {
+ rowData.value = row
+ //console.log('row-68',row)
+ dialogVisible.value = true
+ dialogTitle.value = titleName
+ processCode.value=row.nodeCode
+ planDayCode.value=code
+ getCurrentWorkerList(processCode.value)
+
}
+
//获取工序人员
const getCurrentWorkerList = async (val) => {
-//console.log("personOption-91",val)
+
let params = {
- planDayCode: rowData.value.planMasterCode,
+ planDayCode: planDayCode.value,
processCode: val
}
personOption.value = await workschedulingApi.getCurrentWorkerList(params)
@@ -160,45 +88,53 @@ const getCurrentWorkerList = async (val) => {
const count = ref(0)
const qcount = ref(1)
//报工数量处理
-const handleCount = (row) => {
- if (row.reportCount > rowData.value.planCount) {
+const handleCount = (val) => {
+
+ if (reportCount.value> rowData.value.planCount) {
message.alert('报工数量不能超出计划数量!计划数【'+rowData.value.planCount+'】')
- row.reportCount =rowData.value.planCount
+ reportCount.value =rowData.value.planCount
//tableData.value[index].reportCount =rowData.value.planCount
count.value++
return
}
//message.alert(row.checkFlag==true?'1':'2')
- if (row.checkFlag) {
- if (row.reportCount < row.qualified) {
+ if (checkFlag.value) {
+ if (reportCount.value < qualified.value) {
message.alert('合格数不能超出报工数!')
- row.qualified=row.reportCount
+ qualified.value=reportCount.value
qcount.value++
return
}
- if (row.qualified == undefined || row.qualified == 0) {
- row.qualified = row.reportCount
+ if (qualified.value == undefined || qualified.value == 0) {
+ qualified.val = reportCount.value
qcount.value++
}
- row.unqualified= row.reportCount- row.qualified
+ unqualified.value= reportCount.value- qualified.value
}
}
//提交报工
const saveReport = async() => {
+ if (count.value > 0) {
+ message.alert('报工数量不能超出计划数量!')
+ return
+ }
+ let listSub=[{}]
+ personSelected.value.forEach((item) => {
+ let data={
+ reportCount: formRef.value.reportCounte,
+ workTerm: formRef.value.workTerm,
+ reportPerson: formRef.value.item,
+ qualified: formRef.value.qualified,
+ unqualified: formRef.value.unqualified
+ }
+ listSub.push(data)
+ })
let data = {
reportDate: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
schedulingCode: rowData.value.schedulingCode,
- processCode: processCodeSelected.value,
- list: [
- {
- reportCount: reportCount.value,
- workTerm: workTerm.value,
- reportPerson: personSelected.value,
- qualified: qualified.value,
- unqualified: unqualified.value
- }
- ]
+ processCode: processCode.value,
+ list: listSub
}
saveFlag.value = true
try {
@@ -214,6 +150,6 @@ const saveReport = async() => {
}
// 传递给父类
const emit = defineEmits(['success', 'close'])
-
+defineOptions({ name: 'reportProcess' })
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗
diff --git a/src/views/mes/workScheduling/components/reportAll.vue b/src/views/mes/workScheduling/components/reportAll.vue
new file mode 100644
index 000000000..085008f86
--- /dev/null
+++ b/src/views/mes/workScheduling/components/reportAll.vue
@@ -0,0 +1,185 @@
+
+
+
+
diff --git a/src/views/mes/workScheduling/index.vue b/src/views/mes/workScheduling/index.vue
index 748959db6..2427223e9 100644
--- a/src/views/mes/workScheduling/index.vue
+++ b/src/views/mes/workScheduling/index.vue
@@ -68,7 +68,7 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
-
+
@@ -83,7 +83,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from './components/Detail.vue'
-import Report from './components/report.vue'
+import ReportAll from './components/reportAll.vue'
import Finish from './components/finish.vue'
@@ -96,17 +96,7 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(WorkScheduling.allSchemas.tableColumns)
-// 详情 table 操作扩展 按钮
-const buttondataTable = ref([{
- label: '完工',
- name: 'pfinished',
- hide: false,
- type: 'primary',
- icon: '',
- color: '',
- hasPermi: '',
- link: true, // 文本展现按钮
- }])
+
// 查看 Bom 按钮回调事件
const tableFormButton = async (val , row) => {
getList()
@@ -191,8 +181,8 @@ const butttondata=(row) =>{ return [
defaultButtons.mainListHandleBtn({label:"暂停",name:'pause',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
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,['4'] ),hasPermi:'mes:workScheduling:update'}),
- defaultButtons.mainListHandleBtn({label:"质检",name:'check',hide: isShowMainButton(row,['5'] ),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:'finish',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
//defaultButtons.mainListHandleBtn({label:"叫料",name:'callMaterial',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
@@ -228,7 +218,7 @@ const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
-//完工报工
+//完工
const finishReport=async(row)=>{
let params={
id:row.id,
@@ -238,7 +228,8 @@ const finishReport=async(row)=>{
//console.log("workscheduling-finishReport-213",row)
let res=await WorkSchedulingApi.getNodePosition(params)
if(res==='end'){
- reportFinishRef.value.openDetail(row,"完工")
+ //reportFinishRef.value.openDetail(row,"完工")
+ WorkSchedulingApi.completeHandle(params)
}else{
message.alert("当前工序不是完工工序,不能进行完工操作!")
}