diff --git a/src/api/AssingWorkDetail.ts b/src/api/AssingWorkDetail.ts new file mode 100644 index 0000000..1ec912c --- /dev/null +++ b/src/api/AssingWorkDetail.ts @@ -0,0 +1,81 @@ +import { request } from '@/utils/request' + +// AssingWorkDetail 类型定义 +export interface AssingWorkDetail { + id?: number + + assingWorkId?: number + + userId?: number + + deviceId?: number + + num?: number + + source?: number + + createTime?: string + +} + +// AssingWorkDetail API +export const assingWorkDetailApi = { + // 分页查询 + page(params: { page: number; pageSize: number; id?: number }) { + return request({ url: '/biz/assingWorkDetail/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: string) { + return request({ url: `/biz/assingWorkDetail/${id}`, method: 'get' }) + }, + + // 新增 + create(data: AssingWorkDetail) { + return request({ url: '/biz/assingWorkDetail', method: 'post', data }) + }, + + // 修改 + update(data: AssingWorkDetail) { + return request({ url: '/biz/assingWorkDetail', method: 'put', data }) + }, + + // 删除 + delete(ids: string[]) { + return request({ url: `/biz/assingWorkDetail/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: string[]; id?: number }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + return request({ url: `/biz/assingWorkDetail/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/assingWorkDetail/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/assingWorkDetail/template`, method: 'get', responseType: 'blob' }) + }, + + + //根据派工id获取详情信息 + selectAssingWorkDetailListByAssingWorkId(assingWorkId:number) { + return request({ + url:`/biz/assingWorkDetail/getAssingWorkDetailList/${assingWorkId}`, + method:"get" + }) + } +} \ No newline at end of file diff --git a/src/api/basicProcessPlan.ts b/src/api/basicProcessPlan.ts new file mode 100644 index 0000000..fce885d --- /dev/null +++ b/src/api/basicProcessPlan.ts @@ -0,0 +1,94 @@ +import { request } from '@/utils/request' + +// 基础主数据--工序表 类型定义 +export interface BasicProcessPlan { + id?: number + + name?: string + + code?: string + + sort?: number + + procurement?: number + + outsource?: number + + qualityInspection?: number + + storageEntry?: number + + workCenterName?: string + + departmentName?: string + + operDescription?: string + + createBy?: number + + createTime?: string + +} + +// 基础主数据--工序表 API +export const basicProcessPlanApi = { + // 分页查询 + page(params: { page: number; pageSize: number; id?: number; name?: string }) { + return request({ url: '/biz/basicProcessPlan/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: string) { + return request({ url: `/biz/basicProcessPlan/${id}`, method: 'get' }) + }, + + // 新增 + create(data: BasicProcessPlan) { + return request({ url: '/biz/basicProcessPlan', method: 'post', data }) + }, + + // 修改 + update(data: BasicProcessPlan) { + return request({ url: '/biz/basicProcessPlan', method: 'put', data }) + }, + + // 删除 + delete(ids: string[]) { + return request({ url: `/biz/basicProcessPlan/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: string[]; id?: number; name?: string }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + if (params?.name !== undefined && params?.name !== null) p.name = params.name + return request({ url: `/biz/basicProcessPlan/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/basicProcessPlan/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/basicProcessPlan/template`, method: 'get', responseType: 'blob' }) + }, + + //获取分页列表 + list(params:any) { + return request({ + url:"/biz/basicProcessPlan/list", + method:"get", + params + }) + } +} \ No newline at end of file diff --git a/src/api/device.ts b/src/api/device.ts index ac2a6bb..98274c9 100644 --- a/src/api/device.ts +++ b/src/api/device.ts @@ -114,5 +114,12 @@ export const deviceApi = { responseType:"blob" }) + }, + getDeviceList(params:{sectionIds:any}){ + return request({ + url:"/biz/device/getDeviceList", + method:"get", + params + }) } } \ No newline at end of file diff --git a/src/api/orderProcessPlan.ts b/src/api/orderProcessPlan.ts index 35f9c32..c53c3e1 100644 --- a/src/api/orderProcessPlan.ts +++ b/src/api/orderProcessPlan.ts @@ -255,6 +255,8 @@ export function processItemToEntity( qualityInspection: item.qualityInspection, storageEntry: item.storageEntry, + + workCenterName:item.workCenterName } diff --git a/src/api/processRouteStep.ts b/src/api/processRouteStep.ts index bf1ae4b..8473fea 100644 --- a/src/api/processRouteStep.ts +++ b/src/api/processRouteStep.ts @@ -32,6 +32,8 @@ export interface ProcessRouteStep { changeTime?: string + isBind?: boolean + } // 工艺路线工序明细 API @@ -41,6 +43,7 @@ export const processRouteStepApi = { return request({ url: '/biz/processRouteStep/page', method: 'get', params }) }, + // 获取详情 detail(id: number) { return request({ url: `/biz/processRouteStep/${id}`, method: 'get' }) @@ -85,5 +88,13 @@ export const processRouteStepApi = { // 下载导入模板 downloadTemplate() { return request({ url: `/biz/processRouteStep/template`, method: 'get', responseType: 'blob' }) + }, + + list(params:{id:number}) { + return request({ + url:"/biz/processRouteStep/list", + method:'get', + params + }) } } diff --git a/src/api/production.ts b/src/api/production.ts index 00aca69..6949e0d 100644 --- a/src/api/production.ts +++ b/src/api/production.ts @@ -1,5 +1,32 @@ import { request } from '@/utils/request' +export interface AssingWork { + id:number, + processId:number, + processName:number, + userId:string, + quantity:number, + rework:number, + reworkNum:number, + completeQuantity:number, + completedTime:Date, + createTime:Date, + createBy:number, + status:number, + reason:string, + pauseTime:Date, + assingStatus:number, + assingCode:string, + parentId:number, + reworkSort:number, + workshopId:number, + sectionId:number, + deviceId:number, + traceId:number, + qcNum:number +} + + //派工列表 export function disworlist(params:any) { return request({ @@ -38,7 +65,7 @@ export function pauseresume(data:any) { } //我的派工任务 -export function mytasks(params:any) { +export function mytasks(params:{page:number,pageSize:number,processName:string}) { return request({ url: `/mes/dispatch/my-tasks`, method: 'get', diff --git a/src/api/qcItem.ts b/src/api/qcItem.ts new file mode 100644 index 0000000..9b8d4d2 --- /dev/null +++ b/src/api/qcItem.ts @@ -0,0 +1,116 @@ +import { request } from '@/utils/request' +import { any } from 'three/tsl' + +// 质检项表 类型定义 +export interface QcItem { + id?: number + + name?: string + + spec?: string + + plans?: string + + desc?: string + + createby?: number + + createTime?: string + + updateTime?: string + +} + +// 质检项表 API +export const qcItemApi = { + // 分页查询 + page(params: { page: number; pageSize: number; id?: number; name?: string }) { + return request({ url: '/biz/qcItem/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: string) { + return request({ url: `/biz/qcItem/${id}`, method: 'get' }) + }, + + // 新增 + create(data: QcItem) { + return request({ url: '/biz/qcItem', method: 'post', data }) + }, + + // 修改 + update(data: QcItem) { + return request({ url: '/biz/qcItem', method: 'put', data }) + }, + + // 删除 + delete(ids: string[]) { + return request({ url: `/biz/qcItem/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: string[]; id?: number; name?: string }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + if (params?.name !== undefined && params?.name !== null) p.name = params.name + return request({ url: `/biz/qcItem/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/qcItem/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/qcItem/template`, method: 'get', responseType: 'blob' }) + }, + + //上传文件 + uploadFile(file:File) { + const formData = new FormData() + formData.append("file",file) + return request({ + url:"/sys/file/upload", + method:"post", + data:formData + }) + }, + + + //查询文件列表 + getPlansFiles(data:{plans:string}) { + return request({ + url:"/biz/qcItem/getPlanFiles", + method:"post", + data:data + }) + }, + + //创建关联 + createQcProcessRelate(data:any) { + return request({ + url:"/biz/qcItem/createQcProcessRelate", + method:"post", + data + }) + }, + + + //显示质检项关联列表 + list(params:any) { + return request({ + url:"/biz/qcItem/list", + method:"get", + params + }) + } +} \ No newline at end of file diff --git a/src/api/qcitemProcess.ts b/src/api/qcitemProcess.ts new file mode 100644 index 0000000..f8f7a47 --- /dev/null +++ b/src/api/qcitemProcess.ts @@ -0,0 +1,71 @@ +import { request } from '@/utils/request' + +// 质检项和工序关联表 类型定义 +export interface QcitemProcess { + id?: number + + qcItemId?: number + + processId?: number + +} + +// 质检项和工序关联表 API +export const qcitemProcessApi = { + // 分页查询 + page(params: { page: number; pageSize: number; id?: number }) { + return request({ url: '/biz/qcitemProcess/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: number) { + return request({ url: `/biz/qcitemProcess/${id}`, method: 'get' }) + }, + + // 新增 + create(data: QcitemProcess) { + return request({ url: '/biz/qcitemProcess', method: 'post', data }) + }, + + //质检项关联 + qualityItemcreate(data: QcitemProcess) { + return request({ url: '/biz/qcitemProcess/create', method: 'post', data }) + }, + + // 修改 + update(data: QcitemProcess) { + return request({ url: '/biz/qcitemProcess', method: 'put', data }) + }, + + // 删除 + delete(ids: number[]) { + return request({ url: `/biz/qcitemProcess/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: number[]; id?: number }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + return request({ url: `/biz/qcitemProcess/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/qcitemProcess/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/qcitemProcess/template`, method: 'get', responseType: 'blob' }) + } + + +} \ No newline at end of file diff --git a/src/api/section.ts b/src/api/section.ts index 6dda158..52b7fa6 100644 --- a/src/api/section.ts +++ b/src/api/section.ts @@ -68,10 +68,11 @@ export const sectionApi = { }) }, - list() { + list(params:{sectionName:string}) { return request({ url:"/biz/section/list", - method:"get" + method:"get", + params }) } diff --git a/src/api/stationHandover.ts b/src/api/stationHandover.ts new file mode 100644 index 0000000..c4f388e --- /dev/null +++ b/src/api/stationHandover.ts @@ -0,0 +1,76 @@ +import { request } from '@/utils/request' + +// 工位交接记录表 类型定义 +export interface StationHandover { + id?: number + + deviceId?: number + + stationId?: number + + handoverPersonId?: number + + receiverPersonId?: number + + handoverTime?: string + + remark?: string + + createTime?: string + + createBy?: string + +} + +// 工位交接记录表 API +export const stationHandoverApi = { + // 分页查询 + page(params: { page: number; pageSize: number; deviceIds?: string }) { + return request({ url: '/biz/stationHandover/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: number) { + return request({ url: `/biz/stationHandover/${id}`, method: 'get' }) + }, + + // 新增 + create(data: StationHandover) { + return request({ url: '/biz/stationHandover', method: 'post', data }) + }, + + // 修改 + update(data: StationHandover) { + return request({ url: '/biz/stationHandover', method: 'put', data }) + }, + + // 删除 + delete(ids: number[]) { + return request({ url: `/biz/stationHandover/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: number[]; id?: number }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + return request({ url: `/biz/stationHandover/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/stationHandover/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/stationHandover/template`, method: 'get', responseType: 'blob' }) + } +} \ No newline at end of file diff --git a/src/api/system.ts b/src/api/system.ts index 282dc6d..be64535 100644 --- a/src/api/system.ts +++ b/src/api/system.ts @@ -134,7 +134,17 @@ export const userApi = { url:"sys/user/list", method:'get' }) + }, + + //获取设备负责人 + getEquipmentManager() { + return request({ + url:"/sys/user/getEquipmentManager", + method:"get" + }) } + + } // ==================== 角色管理 ==================== @@ -423,6 +433,13 @@ export const fileApi = { rename(id: number, newName: string): Promise { return request({ url: `/sys/file/${id}/rename`, method: 'put', data: { newName } }) + }, + downloadPlanFile(id:number) { + return request({ + url:`/sys/file/download/${id}`, + method:"get", + responseType: 'blob' + }) } } diff --git a/src/views/biz/basicProcessPlan/index.vue b/src/views/biz/basicProcessPlan/index.vue new file mode 100644 index 0000000..9035d62 --- /dev/null +++ b/src/views/biz/basicProcessPlan/index.vue @@ -0,0 +1,654 @@ + + + + + \ No newline at end of file diff --git a/src/views/biz/device/index.vue b/src/views/biz/device/index.vue index ced75dd..91ec2e7 100644 --- a/src/views/biz/device/index.vue +++ b/src/views/biz/device/index.vue @@ -52,13 +52,26 @@ :columns="columns" :data="tableData" :loading="loading" - :pagination="pagination" :row-key="(row) => row.id" :scroll-x="1200" - @update:page="handlePageChange" - @update:page-size="handlePageSizeChange" - @update:checked-row-keys="handleCheck" /> +
+ + + +
@@ -95,6 +108,17 @@ style="width: 200px" /> + + + + @@ -161,12 +185,15 @@ import { deviceApi, type Device } from '@/api/device' import { dictDataApi } from '@/api/org' import {sectionApi, type Section} from '@/api/section' - + import { SysUser, userApi } from '@/api/system' const message = useMessage() const dialog = useDialog() const router = useRouter() +//设备负责人列表 +const deviceManagerList = ref<{label:string,value:any}[]>([]) + let sectionList = reactive<{label:string,value:any}[]>([]) // 搜索表单 @@ -207,6 +234,7 @@ const defaultFormData: Device = { status:0, deviceFlag:'mes_equipment', synEquipId: null as number | null, + deviceManagerList: null as any | null } const formData = reactive({ ...defaultFormData }) @@ -218,6 +246,17 @@ const deviceFlagList = ref<{ label: string; value: any ;class:any}[]>([]) // 表单校验规则 const formRules = { + deviceName:[{ required: true, message: '请输入设备名称', trigger: 'blur' },], + sectionId:[{ + required: true, + validator(rule:any,value: any) { + if(!value){ + return new Error(`请选择所属工段`) + } + return true + }, + trigger: ['blur'] + }] } // 表格列 @@ -229,6 +268,7 @@ const columns: DataTableColumns = [ render: (row) => row.synEquipId ?? '-' }, { title: '设备类型', key: 'deviceType' }, + { title: '设备负责人', key: 'deviceManagerName' }, { title: '所属工段', key: 'sectionName' }, { title: '设备型号', key: 'spec' }, { title: '生产厂家', key: 'manufacturer' }, @@ -319,9 +359,12 @@ function goRealtimeBoard() { // 编辑 function handleEdit(row: Device) { - modalTitle.value = '编辑设备表' - Object.assign(formData, row) - modalVisible.value = true + + modalTitle.value = '编辑设备表' + Object.assign(formData, row) + console.log(formData); + + modalVisible.value = true } // 提交 @@ -329,6 +372,7 @@ async function handleSubmit() { await formRef.value?.validate() try { const submitData = { ...formData } as Device + if (typeof submitData.manufactureDate === 'number') { submitData.manufactureDate = new Date(submitData.manufactureDate).toISOString().slice(0, 19).replace('T', ' ') } @@ -463,8 +507,15 @@ async function loadSection() { sectionList = data.map((d:any)=> ({ label: d.sectionName, value: (Number(d.id) || d.id) })) } +//加载人员 +async function handleUser() { + const res = await userApi.getEquipmentManager() + deviceManagerList.value = res +} + onMounted(() => { loadData() + handleUser() loadSection() loadDictOptions() }) diff --git a/src/views/biz/orderProcessPlan/board.vue b/src/views/biz/orderProcessPlan/board.vue index 2f477b6..a2728f5 100644 --- a/src/views/biz/orderProcessPlan/board.vue +++ b/src/views/biz/orderProcessPlan/board.vue @@ -198,6 +198,7 @@ @assign="(p) => disphand(p, order)" @outsource="(p) => openOutsource(order, p)" @view-model="(p) => openPlmModel(order, p)" + @submit-detail = "(p) => openDetailModel(order,p)" /> @@ -205,8 +206,11 @@ + + +
+ + + + + + +
@@ -555,6 +568,9 @@ import ProcessCard from './components/ProcessCard.vue' import PlmModelDrawer from '@/components/PlmModelDrawer.vue' import type { PlmModelOpenContext } from '@/api/plmModel' import Pgitem from './pgitem.vue' +import { submitLogApi } from '@/api/submitLog.ts' + + const message = useMessage() const dialog = useDialog() @@ -593,14 +609,15 @@ const dispatchmodal = ref(false) const dispatchLoading = ref(false) const dispatchformRef = ref() const dispatchform = reactive({ - id: '', name: '', beginTime: '', endTime: '', quantity: '', - list: [{ sectionId:'',deviceId:'',userList: '', quantity: '' }], + id: '', name: '', beginTime: '', endTime: '', quantity: '',workCenterName:'', + list: [{ sectionId:'',deviceId:'', quantity: '' }], }) const dispatchrules = {} const importModalVisible = ref(false) const plmModelDrawerRef = ref | null>(null) + const outsourceModalVisible = ref(false) const outsourceOptionsLoading = ref(false) const outsourceSubmitLoading = ref(false) @@ -640,6 +657,18 @@ function openPlmModel(order: OrderProcessPlanVO, process?: ProcessPlanItemVO) { plmModelDrawerRef.value?.open(ctx) } +//汇报记录详情 +const submitLogModalVisible = ref(false) + + +//汇报详情 +function openDetailModel(order:ProcessPlanItemVO,procces?:OrderProcessPlanVO) { + + submitLogModalVisible.value = true + const processId = procces.planId + +} + const batchOptions = [ { label: '全部展开', key: 'expandAll' }, { label: '全部收起', key: 'collapseAll' }, @@ -1006,6 +1035,7 @@ async function handleSubmit() { function disphand(process: ProcessPlanItemVO, order?: OrderProcessPlanVO) { const entity = processItemToEntity(process, order?.orderItemId) + dispatchmodal.value = true dispatchformRef.value?.restoreValidation() dispatchform.id = entity.id @@ -1015,11 +1045,14 @@ function disphand(process: ProcessPlanItemVO, order?: OrderProcessPlanVO) { dispatchform.quantity = entity.quantity dispatchform.orderItemId = entity.orderItemId dispatchform.sort = entity.sort - dispatchform.list = [{ sectionId:'',deviceId:'',userList: '', quantity: '' }] + dispatchform.workCenterName = entity.workCenterName + dispatchform.list = [{ sectionId:'',deviceId:'', quantity: '' }] + + } function addpgnum() { - dispatchform.list.push({ sectionId:'',deviceId:'',userList: '', quantity: '' }) + dispatchform.list.push({ sectionId:'',deviceId:'', quantity: '' }) } function deletenum(index: number) { diff --git a/src/views/biz/orderProcessPlan/components/ProcessCard.vue b/src/views/biz/orderProcessPlan/components/ProcessCard.vue index 8dc7b7d..d4d0094 100644 --- a/src/views/biz/orderProcessPlan/components/ProcessCard.vue +++ b/src/views/biz/orderProcessPlan/components/ProcessCard.vue @@ -82,6 +82,12 @@ ghost @click="emit('outsource', process)" >委外 + 汇报 () const emit = defineEmits<{ @@ -115,6 +122,7 @@ const emit = defineEmits<{ assign: [process: ProcessPlanItemVO] viewModel: [process: ProcessPlanItemVO] outsource: [process: ProcessPlanItemVO] + submitDetail: [process: ProcessPlanItemVO] }>() const totalQty = computed(() => props.process.quantity ?? 0) diff --git a/src/views/biz/orderProcessPlan/pgitem.vue b/src/views/biz/orderProcessPlan/pgitem.vue index 9a04db1..10287b8 100644 --- a/src/views/biz/orderProcessPlan/pgitem.vue +++ b/src/views/biz/orderProcessPlan/pgitem.vue @@ -5,11 +5,6 @@ @@ -50,39 +44,6 @@ - - - - - - (), { obj:{} }) @@ -196,30 +156,40 @@ import { number } from 'echarts' //加载工段 async function loadSection() { - const data = await sectionApi.list() - sectionList =data.map((d:any)=>{ - return { - label:d.sectionName, - value:d.id+'' - } - }) - - } - - function searchSection(sectionId?:number){ - if(!sectionId) return - props.obj.deviceId = '' - deviceList.value = [] - deviceApi.list(sectionId).then(res=>{ - deviceList.value = res.map((n:any)=>{ + //根据section 进行匹配 + const res = await sectionApi.list({sectionName:props.section}) + const mesSection = res.MesSection; + const mesDevice = res.MesDevice + console.log(mesSection); + + sectionList.push({ + label:mesSection.sectionName, + value:mesSection.id + }) + props.obj.sectionId = mesSection.id + + deviceList.value = mesDevice.map((n:any)=>{ return { - label:n.name, + label:n.deviceName, value:n.id+'' } - }) - }) + }) } + // function searchSection(sectionId?:number){ + // if(!sectionId) return + // props.obj.deviceId = '' + // deviceList.value = [] + // deviceApi.list(sectionId).then(res=>{ + // deviceList.value = res.map((n:any)=>{ + // return { + // label:n.name, + // value:n.id+'' + // } + // }) + // }) + // } + loadSection() slehand() // handleDevice() diff --git a/src/views/biz/qualityItem/index.vue b/src/views/biz/qualityItem/index.vue new file mode 100644 index 0000000..5746540 --- /dev/null +++ b/src/views/biz/qualityItem/index.vue @@ -0,0 +1,810 @@ + + + + + \ No newline at end of file diff --git a/src/views/biz/station/index.vue b/src/views/biz/station/index.vue index 8c6b4ec..70dc536 100644 --- a/src/views/biz/station/index.vue +++ b/src/views/biz/station/index.vue @@ -49,13 +49,26 @@ :columns="columns" :data="tableData" :loading="loading" - :pagination="pagination" :row-key="(row) => row.id" :scroll-x="1200" - @update:page="handlePageChange" - @update:page-size="handlePageSizeChange" - @update:checked-row-keys="handleCheck" /> +
+ + + +
diff --git a/src/views/biz/stationhandover/index.vue b/src/views/biz/stationhandover/index.vue new file mode 100644 index 0000000..5e41844 --- /dev/null +++ b/src/views/biz/stationhandover/index.vue @@ -0,0 +1,492 @@ + + + + + + \ No newline at end of file diff --git a/src/views/production/componets/AssingWorkTreeTable.vue b/src/views/production/componets/AssingWorkTreeTable.vue new file mode 100644 index 0000000..7cac4f6 --- /dev/null +++ b/src/views/production/componets/AssingWorkTreeTable.vue @@ -0,0 +1,448 @@ + + + + + + \ No newline at end of file diff --git a/src/views/production/myassigtask/index.vue b/src/views/production/myassigtask/index.vue index f265286..11c7880 100644 --- a/src/views/production/myassigtask/index.vue +++ b/src/views/production/myassigtask/index.vue @@ -15,28 +15,6 @@ - - - @@ -54,34 +32,16 @@
- - - - - + - + - - + --> @@ -180,6 +140,54 @@ + + + + + + + + + + + + + + + + + + + + @@ -196,6 +204,7 @@ import { import { NButton, + NDropdown, NIcon, NSpace, NPagination, @@ -209,7 +218,9 @@ import { import { SearchOutline, - RefreshOutline + RefreshOutline, + SyncOutline, + EllipsisHorizontalOutline } from '@vicons/ionicons5' import { useUserStore } from '@/stores/user' @@ -224,6 +235,14 @@ import AssingWorkVue from '@/views/biz/flowingAround/assingWork.vue' import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting' import SumbitDetailCard from '@/components/SumbitDetailCard.vue' import { SubmitLog } from '@/api/submitLog' +import { + transfer +} from '@/api/production' +import { SysUser, userApi } from '@/api/system' +import AssingWorkTreeTable from '../componets/AssingWorkTreeTable.vue' + +const treeTableRef = ref>() + const dialog = useDialog() @@ -280,7 +299,7 @@ const columns = [ // type: 'selection', // minWidth:60 // }, - { + { align:"center", title:"物料名称", key:"materialName", @@ -314,6 +333,12 @@ const columns = [ key: 'processName', minWidth: 200 }, + { + align:'center', + title: '工序名称', + key: 'processCode', + minWidth: 200 + }, { align:'center', title: '派工状态', @@ -478,45 +503,65 @@ const columns = [ { default: () => '完工汇报'} )) } + buttons.push(h(NButton, { size: 'small', type: 'info', ghost: true, - onClick: () => openPlmModel(row), - }, { default: () => '模型' })) - - buttons.push(h(NButton, { - size: 'small', - type: 'info', - ghost: true, + disabled: row.cancelBtnDisable, onClick: ()=> cancelQuality(row) }, { default: () => '质检撤回' })) + + buttons.push( + h(NDropdown, { + trigger:'click', + options:[ + {label:"改派",key:'transfer'}, + {type: 'divider' }, // 分割线 + ], + onSelect:(key:string)=>{ + switch(key) { + case "transfer": + handlreass(row) + break + + } + } + },{ + // 下拉触发按钮:三点图标 / 更多文字 + default: () => h(NButton, { size: 'small', quaternary: true }, { + default: () => [h(NIcon, null, { default: () => h(EllipsisHorizontalOutline) })] + }) + }) + ) return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-' } } ] - +function dropdownIcon(icon: Component) { + return () => h(NIcon, null, { default: () => h(icon) }) +} //搜索数据 function search() { - pagination.page = 1 - searchForm.page = 1 - searchForm.pageSize = 20 - getlist() + treeTableRef.value?.loadTableData({...searchForm}) } //重置 function reset() { searchForm.processId ='' searchForm.processName = '' + treeTableRef.value?.loadTableData({...searchForm}) } //获取列表数据 function getlist() { + searchForm.page = pagination.page + searchForm.pageSize = pagination.pageSize mytasks(searchForm).then((rps:any) => { datalist.value = rps.records pagination.itemCount = rps.total @@ -527,15 +572,12 @@ function getlist() { function handlePageChange(page: number) { pagination.page = page - searchForm.page = page getlist() } function handlePageSizeChange(pageSize: number) { pagination.pageSize = pageSize pagination.page = 1 - searchForm.page = 1 - searchForm.pageSize = pageSize getlist() } @@ -764,8 +806,79 @@ async function cancelSubmit() { } } + +//改派 +//改派员工列 +const reassignEmployees = ref>([]) + +let reassLoading = ref(false) +let reassdisedbtn = ref(false) + +let reassignmodal = ref(false) + +const reassformRef = ref() + +let reassform = reactive({ + id:null, //派工id + reason:null, //改派原因 + userId:null //改派设备 +}) + + const reassrules = { + userid: [{ required: true, message: '请选择员工', trigger: 'blur' }] + } + +function handlreass(n:any) { + + gxobg.name = n.processName + gxobg.id = n.processId + + reassignmodal.value = true + reassLoading.value = false + reassdisedbtn.value = false + reassformRef.value?.restoreValidation() + reassform.id = n.id + reassform.reason = '' + reassform.userid = '' + +} + + + function reassSubmit() { + reassformRef.value?.validate((v:any) => { + if(!v){ + reassLoading.value = true + reassdisedbtn.value = true + transfer(reassform).then(() => { + message.success('操作成功!') + setTimeout(()=> { + reassignmodal.value = false + reassLoading.value = false + reassdisedbtn.value = false + getlist() + },1000) + }).catch(() => { + reassdisedbtn.value = false + reassLoading.value = false + }) + } + }) +} +//获取员工列 +async function getUserList() { + const res = await userApi.getPathList(); + + reassignEmployees.value = res.map((user:SysUser)=>( + { + label: user.username, + value: user.id + } + )) +} + onMounted(() => { getlist() + getUserList() loadDictOptions() })