diff --git a/src/api/nccode.ts b/src/api/nccode.ts index d34fb1e..1fc8a1b 100644 --- a/src/api/nccode.ts +++ b/src/api/nccode.ts @@ -106,7 +106,7 @@ export function exportNccode(params:any) { export function loadAllNcCode(deviceId?: string | number) { const id = deviceId != null && deviceId !== '' ? `/${deviceId}` : '' return request({ - url: `/biz/ncCode/loadAllNcCode${id}`, + url: `/biz/ncCode/loadAllNcCode/${id}`, method: 'get' }) } diff --git a/src/api/orderProcessPlan.ts b/src/api/orderProcessPlan.ts index 98cd2d8..13a0ff1 100644 --- a/src/api/orderProcessPlan.ts +++ b/src/api/orderProcessPlan.ts @@ -199,6 +199,7 @@ export interface OrderProcessPlanVO { processList?: ProcessPlanItemVO[] + planId?:number } diff --git a/src/api/qcitemProcess.ts b/src/api/qcitemProcess.ts index c223391..6a38d7c 100644 --- a/src/api/qcitemProcess.ts +++ b/src/api/qcitemProcess.ts @@ -8,6 +8,8 @@ export interface QcitemProcess { processId?: number + qualityItemId?:[] + page?:number pageSize?:number diff --git a/src/api/qualityTesting.ts b/src/api/qualityTesting.ts index 1ccf030..b11556f 100644 --- a/src/api/qualityTesting.ts +++ b/src/api/qualityTesting.ts @@ -44,7 +44,7 @@ export interface QualityTesting { // 质检单表 API export const qualityTestingApi = { // 分页查询 - page(params: { page: number; pageSize: number; qcNo?: string; status?: number }) { + page(params: { page: number; pageSize: number; qcNo?: string; status?: number; assingCode?:string }) { return request({ url: '/mes/qc/list', method: 'get', params }) }, diff --git a/src/api/station.ts b/src/api/station.ts deleted file mode 100644 index 44be854..0000000 --- a/src/api/station.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { request } from "@/utils/request"; -import { update } from "three/examples/jsm/libs/tween.module.js"; - -export interface Station{ - id?: number, - stationCode?:string, - stationName?:string, - workshopId?:number, - sectionId?:number, - remark?:string, - status?:number, - createTime?:string, - updateTime?:string -} - - -export const stationApi = { - - page(params:{ - page:number, - pageSize:number, - stationCode:any - }){ - return request({ - url:"biz/station/page", - method:"get", - params - }) - }, - - create(data:Station){ - return request({ - url:"biz/station/add", - method:"post", - data - }) - }, - update(data:Station) { - return request({ - url:"biz/station/update", - method:"put", - data - }) - }, - delete(ids:any) { - return request({ - url:`/biz/station/${ids.join(",")}`, - method:"delete" - }) - }, - export(params?:{ - ids?:string[], - stationCode:any - }){ - const p:Record = {} - if(params?.ids?.length) p.ids = params.ids.join(",") - if(params?.stationCode != undefined && params?.stationCode !== null) - console.log(params); - console.log(1111); - - return request({ - url:`/biz/station/export`, - method:"get", - params:p, - responseType:"blob" - }) - } - -} \ No newline at end of file diff --git a/src/api/submitLog.ts b/src/api/submitLog.ts index 56f486e..80f2ffe 100644 --- a/src/api/submitLog.ts +++ b/src/api/submitLog.ts @@ -104,7 +104,6 @@ export const submitLogApi = { //加载汇报列表 loadSumbitLog(params:{assingId:number,page?:number,pageSize?:number}){ - console.log(params) return request({url:`/mes/report/loadSumbitLog`,method:'get',params}) } } diff --git a/src/views/NCcode/index.vue b/src/views/NCcode/index.vue index 978b75f..1c78c49 100644 --- a/src/views/NCcode/index.vue +++ b/src/views/NCcode/index.vue @@ -358,7 +358,7 @@ import { NGrid, useMessage, useDialog, - NDropdown, NTag, type DataTableColumns, + NTag, type DataTableColumns, } from 'naive-ui' import { @@ -366,7 +366,6 @@ import { RefreshOutline, AddOutline, ArrowDownCircleOutline, - EllipsisHorizontalOutline, CloudUploadOutline } from '@vicons/ionicons5' @@ -388,9 +387,8 @@ import { multifilelist } from '@/api/illustrated' -import {DeviceDocumentConnection, deviceDocumentConnectionApi} from "@/api/deviceDocumentConnection.ts"; +import {deviceDocumentConnectionApi} from "@/api/deviceDocumentConnection.ts"; import {Device, deviceApi} from "@/api/device.ts"; -import {RowData} from "naive-ui/es/data-table/src/interface"; const dialog = useDialog() @@ -405,11 +403,6 @@ const TOKEN = userStore.token // 权限检查 const hasPermission = (permission: string) => userStore.hasPermission(permission) -//const ncDispatchRecords = ref([]) - -//派工状态字典 -//const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([]) - // ==================== 搜索表单 ==================== const searchForm = reactive({ page: 1, @@ -458,28 +451,6 @@ const columns = [ key:"ncContent", minWidth:150 }, - - // { - // align:"center", - // title:"工作中心", - // key:"workCenter", - // minWidth:150 - // }, - - // { - // align:"center", - // title:"设备ID", - // key:"deviceId", - // minWidth:150 - // }, - - // { - // align:"center", - // title:"设备名称", - // key:"deviceName", - // minWidth:150 - // }, - { align:"center", title:"状态", @@ -654,18 +625,6 @@ function handlePageSizeChange(pageSize: number) { getlist() } - - -// // 加载字典选项 -// async function loadDictOptions() { -// //qcCancelLoading = true -// try { -// const data = await dictDataApi.listByType('assing_status') -// qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass })) -// }catch {} -// } - - //新增 let addModel = ref(false) @@ -681,23 +640,11 @@ let formData = reactive({ deviceName:'', //设备名称 fileId:'', status:1, //状态:1-启用 0-禁用 - // isIssued:1, //是否已下发:1-已下发 0-未下发 - // issueTime:null, //下发时间 - // issueBy:'', //下发人 remark:'' //备注 }) const addrules = { ncCode: [ { required: true, message: '请输入NC代码编号', trigger: 'blur' }, - // { - // validator(rule:any,value: any) { - // if(value > pauseform.qcNum){ - // return new Error(`报检数量最大为${pauseform.qcNum}`) - // } - // return true - // }, - // trigger: ['blur'] - // } ], ncName:[ { required: true, message: '请输入NC代码名称', trigger: 'blur' } @@ -743,9 +690,6 @@ function addhand(type:any,row?:any) { formData.deviceName = row.deviceName formData.status = row.status formData.fileId = row.fileId+',' - // formData.isIssued = row.isIssued - // formData.issueTime = row.issueTime - // formData.issueBy = row.issueBy formData.remark = row.remark if(type == 2){ formData.ncCode = row.ncCode @@ -756,13 +700,6 @@ function addhand(type:any,row?:any) { flist.value.splice(0) multifilelist(row.fileId).then(rps => { if(rps && rps.length > 0){ - - // flist.value.push({ - // id: rps.id, - // name: rps.originalName, - // status: 'finished', // 关键:状态设为 'finished' 表示上传完成 - // url: rps.url, // 用于预览 - // }) flist.value = rps.map((n:any) => { return { id: n.id, @@ -783,10 +720,7 @@ function addhand(type:any,row?:any) { formData.workCenter = '' formData.deviceId = '' formData.deviceName = '' - formData.status = 1 - // formData.isIssued = '' - // formData.issueTime = '' - // formData.issueBy = '' + formData.status = 1 formData.remark = '' formData.fileId = '' flist.value.splice(0) @@ -839,23 +773,6 @@ function handleCheck(v:any) { console.log(v) } -//删除 -function delhand() { - if(chearr.value.length > 0){ - batchIssue(chearr.value).then(() => { - message.success('操作成功') - }) - }else{ - message.error('请勾选设备') - } - -} - -//下发任务列表 -//let isstasklist = ref([]) - -//下发设备列表 -//let issequiplist = ref([]) let treeData:any = [] let xfsbvalue = ref>([]) @@ -867,7 +784,6 @@ function flattenTree(list: undefined | any[]) { const result: any[] = [] function flatten(_list: any[] = []) { _list.forEach((item) => { - //result.push(item) if(item.childList){ flatten(item.childList) }else{ @@ -882,23 +798,6 @@ function flattenTree(list: undefined | any[]) { //下发 let issueModel = ref(false) -// let issformData = reactive({ -// taskid:'', -// equis:'' -// }) -// const issaddrules = { -// taskid:[ -// { required: true, message: '请选择下发任务', trigger: 'blur' } -// ], -// equis:[ -// { required: true, message: '请选择下发设备', trigger: 'blur' } -// ] - -// } - - - - let issarr:any[] = [] let ncCode = ref('') function tranupdate(v:any) { @@ -924,7 +823,6 @@ function issuehand(row:any) { function isssavehand() { if(issarr.length > 0){ batchIssue({ - //ncCode:ncid, id:ncid, ncCodeList:issarr }).then(() => { @@ -940,10 +838,7 @@ function isssavehand() { } //导出 -//let selectedIds = ref([]) function handleExport() { - - exportNccode({}).then(rps => { const url = window.URL.createObjectURL(rps) const link = document.createElement('a') @@ -997,9 +892,6 @@ const handleAllCheck = (val:boolean) => { isAllCheck.value = val } -// function rowKey(row:RowData){ -// return row.id -// } const handleUpateCheck = async (keys:Array,)=>{ selectedDeviceIds.value = keys loadCreateApi() diff --git a/src/views/biz/basicProcessPlan/index.vue b/src/views/biz/basicProcessPlan/index.vue index a10e4a2..a276c4d 100644 --- a/src/views/biz/basicProcessPlan/index.vue +++ b/src/views/biz/basicProcessPlan/index.vue @@ -33,10 +33,6 @@ 导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }} - @@ -45,8 +41,10 @@ :columns="columns" :data="tableData" :loading="loading" - :row-key="(row) => row.id" - :scroll-x="1200" + :row-key="(row:any) => row.id" + size="small" + :scroll-x="1500" + :single-line="true" v-model:checked-row-keys="selectedIds" /> @@ -227,8 +225,11 @@ diff --git a/src/views/production/dispatchwork/index.vue b/src/views/production/dispatchwork/index.vue index 2a13a94..ea1ee8f 100644 --- a/src/views/production/dispatchwork/index.vue +++ b/src/views/production/dispatchwork/index.vue @@ -9,46 +9,18 @@ label-placement="left" > - - - 搜索 - 重置 @@ -56,27 +28,6 @@ - - - - - @@ -129,11 +80,6 @@ class="modal-form" > - @@ -160,11 +106,6 @@ - @@ -365,7 +306,6 @@ import { NGi, NTag, useMessage, - //useDialog, type FormInst, } from 'naive-ui' import { @@ -378,15 +318,13 @@ import { disworlist, editdiswor, transfer, - pauseresume, - //workload + pauseresume } from '@/api/production' import { submitLogApi } from '@/api/submitLog' import { SysUser, userApi } from '@/api/system' -//const dialog = useDialog() const message = useMessage() @@ -457,11 +395,6 @@ const pagination = reactive({ const columns = [ - // { - // type: 'selection', - // minWidth:60 - // }, - { align:"center", title:"物料名称", @@ -508,12 +441,6 @@ const columns = [ }, minWidth:80 }, - // { - // align:'center', - // title:"追溯码/批次号", - // key:"traceCode", - // minWidth:200 - // }, { align:'center', title: '派工状态', diff --git a/src/views/production/myassigtask/index.vue b/src/views/production/myassigtask/index.vue index 329d5d0..b1fab46 100644 --- a/src/views/production/myassigtask/index.vue +++ b/src/views/production/myassigtask/index.vue @@ -4,192 +4,175 @@
- - - - - - - - - - - - - - - - - - - - - - 搜索 - - - - 重置 - - - - - + + + + + + + + + + + + + + + + + + + + + 搜索 + + + + 重置 + + + + +
- -
- + - + - + - + + - + - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + @@ -202,48 +185,42 @@ import { ref, reactive, h, - onMounted, - watch, Component, + onMounted } from 'vue' -import { - NButton, +import { + NButton, NDropdown, - NIcon, - NSpace, - NPagination, - NGrid, - // NGi, + NIcon, + NSpace, + NGrid, NTag, useMessage, - useDialog, - //type FormInst, + useDialog } from 'naive-ui' -import { - SearchOutline, +import { + SearchOutline, RefreshOutline, - SyncOutline, EllipsisHorizontalOutline } from '@vicons/ionicons5' -import { useUserStore } from '@/stores/user' -import { dictDataApi } from '@/api/org' -import { - mytasks, - inspectio +import {useUserStore} from '@/stores/user' +import {dictDataApi} from '@/api/org' +import { + inspectio } from '@/api/production' import PlmModelDrawer from '@/components/PlmModelDrawer.vue' -import AssingWorkVue from '@/views/biz/flowingAround/assingWork.vue' -import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting' +import AssingWorkVue from '@/views/biz/flowingAround/assingWork.vue' +import {qualityTestingApi} from '@/api/qualityTesting' import SumbitDetailCard from '@/components/SumbitDetailCard.vue' -import { SubmitLog } from '@/api/submitLog' -import { +import {SubmitLog} from '@/api/submitLog' +import { transfer } from '@/api/production' -import { SysUser, userApi } from '@/api/system' +import {SysUser, userApi} from '@/api/system' import AssingWorkTreeTable from '../componets/AssingWorkTreeTable.vue' const treeTableRef = ref>() @@ -260,24 +237,22 @@ const hasPermission = (permission: string) => userStore.hasPermission(permission //派工状态字典 -const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([]) +const qcAssingStatusOptions = ref<{ label: string; value: any; class: any }[]>([]) // ==================== 搜索表单 ==================== const searchForm = reactive({ page: 1, pageSize: 20, - processId:'', - processName:'', - assingCode:'', - materialCode:'', - materialName:'', - workOrderCode:'' + processId: '', + processName: '', + assingCode: '', + materialCode: '', + materialName: '', + workOrderCode: '' }) - // ==================== 表格 ==================== -const datalist = ref([]) const loading = ref(false) //分页 @@ -291,211 +266,207 @@ const plmModelDrawerRef = ref | null>(null) const columns = [ - // { - // type: 'selection', - // minWidth:60 - // }, { - align:"center", - title:"物料名称", - key:"materialName", - minWidth:150, - render(row:any) { - var opt = row.materialName - if(opt) return opt - return '-' - } - }, - { - align:"center", - title:"物料编码", - key:"materialCode", - minWidth:150, - render(row:any) { - var opt = row.materialCode - if(opt) return opt - return '-' - } - }, - { - align:"center", - title:"派工编号", - key:"assingCode", - minWidth:150 - }, - { - align:'center', - title: '工序名称', - key: 'processName', - minWidth: 200 - }, - { - align:'center', - title: '工序名称', - key: 'processCode', - minWidth: 200 - }, - { - align:'center', - title: '派工状态', - key: 'assingStatus', + align: "center", + title: "物料名称", + key: "materialName", minWidth: 150, - render(row:any) { + render(row: any) { + var opt = row.materialName + if (opt) return opt + return '-' + } + }, + { + align: "center", + title: "物料编码", + key: "materialCode", + minWidth: 150, + render(row: any) { + var opt = row.materialCode + if (opt) return opt + return '-' + } + }, + { + align: "center", + title: "派工编号", + key: "assingCode", + minWidth: 150 + }, + { + align: 'center', + title: '工序名称', + key: 'processName', + minWidth: 200 + }, + { + align: 'center', + title: '工序名称', + key: 'processCode', + minWidth: 200 + }, + { + align: 'center', + title: '派工状态', + key: 'assingStatus', + minWidth: 150, + render(row: any) { const val = row.assingStatus const opt = qcAssingStatusOptions.value.find(o => o.value === val || String(o.value) === String(val)) if (!opt) return val ?? '-' - - return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label }) + + return h(NTag, {type: opt.class, size: 'small'}, {default: () => opt.label}) } //派工状态0待执行 1执行中 2质检中+3已汇报一4已关闭 }, - { - align:'center', + { + align: 'center', title: '车间名称', - key: 'workshopName', - minWidth: 200 + key: 'workshopName', + minWidth: 200 }, - { - align:'center', + { + align: 'center', title: '工段名称', - key: 'sectionName', - minWidth: 200 + key: 'sectionName', + minWidth: 200 }, - { - align:'center', + { + align: 'center', title: '工位名称', - key: 'deviceName', - minWidth: 200 + key: 'deviceName', + minWidth: 200 }, - { - align:'center', + { + align: 'center', title: '工人名称', - key: 'userName', - minWidth: 200 + key: 'userName', + minWidth: 200 }, - { - align:'center', - title: '数量', - minWidth: 100, + { + align: 'center', + title: '数量', + minWidth: 100, key: 'quantity' }, - { - align:'center', - title: '完成数量', - key: 'completedQuantity', + { + align: 'center', + title: '完成数量', + key: 'completedQuantity', minWidth: 150 }, - { - align:'center', - title: '完成时间', - key: 'completedTime', + { + align: 'center', + title: '完成时间', + key: 'completedTime', minWidth: 180 }, - { - align:'center', - title: '创建人', - key: 'createBy', + { + align: 'center', + title: '创建人', + key: 'createBy', minWidth: 150 }, - { - align:'center', - title: '工序状态', - key: 'status', + { + align: 'center', + title: '工序状态', + key: 'status', minWidth: 100, - render(row:any) { - if(row.status == 0){ + render(row: any) { + if (row.status == 0) { return h(NTag, { - type:'success', - size: 'small' - }, - { - default: () => '启用' - } + type: 'success', + size: 'small' + }, + { + default: () => '启用' + } ) } - if(row.status == 1){ + if (row.status == 1) { return h(NTag, { - type:'warning', - size: 'small' - }, - { - default: () => '已暂停' - } + type: 'warning', + size: 'small' + }, + { + default: () => '已暂停' + } ) } - if(row.status == 2){ + if (row.status == 2) { return h(NTag, { - type:'warning', - size: 'small' - }, - { - default: () => '已改派' - } + type: 'warning', + size: 'small' + }, + { + default: () => '已改派' + } ) } return '-' } }, { - align:'center', + align: 'center', title: '操作', key: 'actions', width: 250, fixed: 'right', - render(row:any) { - const buttons:any = [] - - if(hasPermission('biz:assingWork:edit')){ - buttons.push(h(NButton, { - size: 'small', - type:'primary', - ghost:true, - onClick: () => { handlpause(row) } }, - { default: () => '完工汇报'} - )) - } - - buttons.push(h(NButton, { - size: 'small', - type: 'info', - ghost: true, - disabled: row.cancelBtnDisable, - onClick: ()=> cancelQuality(row) - }, { default: () => '质检撤回' })) - + render(row: any) { + const buttons: any = [] - buttons.push( - h(NDropdown, { - trigger:'click', - options:[ - {label:"改派",key:'transfer'}, - {type: 'divider' }, // 分割线 + if (hasPermission('biz:assingWork:edit')) { + buttons.push(h(NButton, { + size: 'small', + type: 'primary', + ghost: true, + onClick: () => { + handlpause(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) { + onSelect: (key: string) => { + switch (key) { case "transfer": handlreass(row) - break - + break + } } - },{ + }, { // 下拉触发按钮:三点图标 / 更多文字 - default: () => h(NButton, { size: 'small', quaternary: true }, { - default: () => [h(NIcon, null, { default: () => h(EllipsisHorizontalOutline) })] + default: () => h(NButton, {size: 'small', quaternary: true}, { + default: () => [h(NIcon, null, {default: () => h(EllipsisHorizontalOutline)})] }) }) - ) - return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-' + ) + return buttons.length > 0 ? h(NSpace, {justify: 'center'}, {default: () => buttons}) : '-' } } ] - - - //搜索数据 function search() { treeTableRef.value?.loadTableData({ @@ -503,7 +474,7 @@ function search() { assingCode: searchForm.assingCode, materialCode: searchForm.materialCode, materialName: searchForm.materialName, - workOrderCode:searchForm.workOrderCode + workOrderCode: searchForm.workOrderCode }) } @@ -529,87 +500,54 @@ function getlist() { }) } - - -function handlePageChange(page: number) { - pagination.page = page - getlist() -} - -function handlePageSizeChange(pageSize: number) { - pagination.pageSize = pageSize - pagination.page = 1 - getlist() -} - - let gxobg = reactive({}) //报检 -let pausemodal = ref(false) +let pausemodal = ref(false) let pauseform = reactive({ - id:'', - qcNum:'', - okData:{ - id:undefined, - qcId:undefined, - resultType:undefined, - qty:0, - traceCode:undefined, - defectCode:undefined, - handleAction:undefined, - actionStatus:undefined, - remark:undefined, + id: '', + qcNum: '', + okData: { + id: undefined, + qcId: undefined, + resultType: undefined, + qty: 0, + traceCode: undefined, + defectCode: undefined, + handleAction: undefined, + actionStatus: undefined, + remark: undefined, }, - scrapData:{ - id:undefined, - qcId:undefined, - resultType:undefined, - qty:0, - traceCode:undefined, - defectCode:undefined, - handleAction:undefined, - actionStatus:undefined, - remark:undefined, + scrapData: { + id: undefined, + qcId: undefined, + resultType: undefined, + qty: 0, + traceCode: undefined, + defectCode: undefined, + handleAction: undefined, + actionStatus: undefined, + remark: undefined, } -}) -const pauseformRef = ref() +}) +const pauseformRef = ref() -const pauserules = { - qcNum: [ - { required: true, message: '请输报检数量', trigger: 'blur' }, - { - validator(rule:any,value: any) { - if(value > pauseform.qcNum){ - return new Error(`报检数量最大为${pauseform.qcNum}`) - } - return true - }, - trigger: ['blur'] - } - ] -} - -// watch(()=>pauseform.qcNum,v => { -// pauseform.qcNum = v.replace(/[^\d]/g,'') -// }) - - let pauseLoading = ref(false) - let pauseisedbtn = ref(false) +let pauseLoading = ref(false) +let pauseisedbtn = ref(false) // 质检撤回 const qcCancelModel = ref(false) const qcCancelFormData = ref({ - assingWorkId:undefined, - remark:undefined + assingWorkId: undefined, + remark: undefined }) let qcCancelLoading = ref(false) let qcDisabledBtn = ref(false) -function handlpause(n:any) { +function handlpause(n: any) { gxobg.id = n.id gxobg.name = n.name @@ -622,42 +560,42 @@ function handlpause(n:any) { // pauseform.qcNum = n.quantity-(n.completedQuantity ?? 0) } -function checkPauseSumbit():boolean { - if(pauseform.id == null) { +function checkPauseSumbit(): boolean { + if (pauseform.id == null) { message.error("参数id为空") return false } - - if(pauseform.qcNum == null || pauseform.qcNum == '') { + + if (pauseform.qcNum == null || pauseform.qcNum == '') { message.error("质检数量不能为空") return false } - if(pauseform.okData == null || pauseform.okData == '' ) { - pauseform.okData={ - id:undefined, - qcId:undefined, - resultType:undefined, - qty:0, - traceCode:undefined, - defectCode:undefined, - handleAction:undefined, - actionStatus:undefined, - remark:undefined, + if (pauseform.okData == null || pauseform.okData == '') { + pauseform.okData = { + id: undefined, + qcId: undefined, + resultType: undefined, + qty: 0, + traceCode: undefined, + defectCode: undefined, + handleAction: undefined, + actionStatus: undefined, + remark: undefined, } } - if(pauseform.scrapData == null || pauseform.scrapData == '' ) { - pauseform.scrapData={ - id:undefined, - qcId:undefined, - resultType:undefined, - qty:0, - traceCode:undefined, - defectCode:undefined, - handleAction:undefined, - actionStatus:undefined, - remark:undefined, + if (pauseform.scrapData == null || pauseform.scrapData == '') { + pauseform.scrapData = { + id: undefined, + qcId: undefined, + resultType: undefined, + qty: 0, + traceCode: undefined, + defectCode: undefined, + handleAction: undefined, + actionStatus: undefined, + remark: undefined, } } @@ -665,8 +603,8 @@ function checkPauseSumbit():boolean { const okQty = pauseform.okData?.qty ?? 0 const scrapQty = pauseform.scrapData?.qty ?? 0 const checkNum = okQty + scrapQty - - if(checkNum != pauseform.qcNum) { + + if (checkNum != pauseform.qcNum) { message.error("汇报数量总和不等于提交数量") return false } @@ -674,39 +612,38 @@ function checkPauseSumbit():boolean { } function pauseSubmit() { - - var pass = checkPauseSumbit(); - + + var pass = checkPauseSumbit(); + console.log(pass); - - if(!pass) return + + if (!pass) return pauseLoading.value = true - pauseisedbtn.value = true - inspectio(Object.assign({},pauseform,{qcNum:pauseform.qcNum*1})).then(() => { - message.success('操作成功!') - setTimeout(()=> { - pausemodal.value = false - pauseLoading.value = false - pauseisedbtn.value = false - getlist() - },1000) - }).catch(() => { - pauseLoading.value = false - pauseisedbtn.value = false + pauseisedbtn.value = true + inspectio(Object.assign({}, pauseform, {qcNum: pauseform.qcNum * 1})).then(() => { + message.success('操作成功!') + setTimeout(() => { + pausemodal.value = false + pauseLoading.value = false + pauseisedbtn.value = false + getlist() + }, 1000) + }).catch(() => { + pauseLoading.value = false + pauseisedbtn.value = false }) } -function handleUpdateQcNum(qcNum:number) { - pauseform.qcNum = qcNum +function handleUpdateQcNum(qcNum: number) { + pauseform.qcNum = qcNum } -function handleSubmitDetail(submitDetail:any){ - pauseform.okData = submitDetail.okData - pauseform.scrapData = submitDetail.scrapData +function handleSubmitDetail(submitDetail: any) { + pauseform.okData = submitDetail.okData + pauseform.scrapData = submitDetail.scrapData + - - } // 加载字典选项 @@ -714,63 +651,41 @@ async function loadDictOptions() { qcCancelLoading = true try { const data = await dictDataApi.listByType('assing_status') - qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass })) - }catch {} + qcAssingStatusOptions.value = data.map(d => ({ + label: d.dictLabel, + value: (Number(d.dictValue) || d.dictValue), + class: d.listClass + })) + } catch { + } } -// function zantqy(row:any) { -// dialog.warning({ -// title: '温馨提示', -// content: `确定要暂停"${row.processName}"吗?`, -// positiveText: '确定', -// negativeText: '取消', -// onPositiveClick: () => { -// pauseresume({}).then(() => { -// message.success('操作成功!') -// getlist() -// }) -// } -// }) -// } - -function cancelQuality(row:any) { +function cancelQuality(row: any) { qcCancelModel.value = true qcCancelFormData.value.assingWorkId = row.id qcCancelLoading.value = true qcDisabledBtn.value = true - // dialog.warning({ - // title: '提示', - // content: '确定要撤回质检记录吗?', - // positiveText: '确定', - // negativeText: '取消', - // onPositiveClick: async () => { - // try { - // await qualityTestingApi.cancel(row.id) - // message.success('撤回成功') - // getlist() - // } catch (error) { - // console.log("撤回失败"+error) - // } - // } - // }) } async function cancelSubmit() { - try{ - await qualityTestingApi.cancel({"assingId":qcCancelFormData.value.assingWorkId,"remark":qcCancelFormData.value.remark}) + try { + await qualityTestingApi.cancel({ + assingId: qcCancelFormData.value.assingWorkId, + remark: qcCancelFormData.value.remark + }) message.success('撤回成功') qcCancelModel.value = false getlist() - }catch(error) { - console.log("撤回失败"+error); + } catch (error) { + console.log("撤回失败" + error); } } //改派 //改派员工列 -const reassignEmployees = ref>([]) +const reassignEmployees = ref>([]) let reassLoading = ref(false) let reassdisedbtn = ref(false) @@ -780,16 +695,16 @@ let reassignmodal = ref(false) const reassformRef = ref() let reassform = reactive({ - id:null, //派工id - reason:null, //改派原因 - userId:null //改派设备 + id: null, //派工id + reason: null, //改派原因 + userId: null //改派设备 }) - const reassrules = { - userid: [{ required: true, message: '请选择员工', trigger: 'blur' }] - } +const reassrules = { + userid: [{required: true, message: '请选择员工', trigger: 'blur'}] +} -function handlreass(n:any) { +function handlreass(n: any) { gxobg.name = n.processName gxobg.id = n.processId @@ -801,23 +716,23 @@ function handlreass(n:any) { reassform.id = n.id reassform.reason = '' reassform.userid = '' - + } - function reassSubmit() { - reassformRef.value?.validate((v:any) => { - if(!v){ +function reassSubmit() { + reassformRef.value?.validate((v: any) => { + if (!v) { reassLoading.value = true reassdisedbtn.value = true transfer(reassform).then(() => { message.success('操作成功!') - setTimeout(()=> { + setTimeout(() => { reassignmodal.value = false reassLoading.value = false reassdisedbtn.value = false getlist() - },1000) + }, 1000) }).catch(() => { reassdisedbtn.value = false reassLoading.value = false @@ -825,22 +740,23 @@ function handlreass(n:any) { } }) } + //获取员工列 async function getUserList() { - const res = await userApi.getPathList(); + const res = await userApi.getPathList(); - reassignEmployees.value = res.map((user:SysUser)=>( + reassignEmployees.value = res.map((user: SysUser) => ( { - label: user.username, - value: user.id - } + label: user.username, + value: user.id + } )) } onMounted(() => { getlist() - getUserList() - loadDictOptions() + getUserList() + loadDictOptions() })