| | |
| | | import {computed, nextTick, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {useRouter,useRoute} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {ElCheckbox, ElMessage} from "element-plus"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import domZIndex from 'dom-zindex' |
| | | import {indexOf} from "xe-utils"; |
| | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const user=userInfo() |
| | | //是否复合工序 |
| | | const laminating = ref(null) |
| | | |
| | | //定义表头数据 |
| | | const titleUploadData = ref({ |
| | | //是否合片工序 |
| | |
| | | classes: '', |
| | | //责任工序 |
| | | responsibleProcess: '', |
| | | //包装方式 |
| | | packagingMethod:'', |
| | | order: { |
| | | //客户编号 |
| | | customerId: '', |
| | |
| | | let technologicalProcess='' |
| | | let processName = ref([]) |
| | | |
| | | //隐藏全部完工序号 |
| | | let hiddenVal = ref(1) |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | deviceType: [], |
| | |
| | | |
| | | }) |
| | | |
| | | let btnValue=company.storageBtn |
| | | let teamsTypeValue=company.teamsType |
| | | //是否点击报工入库 |
| | | let storageBtn = ref(false) |
| | | //箱号 库位 备注 |
| | | const storageRegion = ref(null); |
| | | const container = ref(null); |
| | | const remark = ref(null); |
| | | |
| | | //包装方式 |
| | | const mannerPacking = ref(null) |
| | | const mannerPackingOp = [ |
| | | // { |
| | | // value: t('reportingWorks.early'), |
| | | // label: t('reportingWorks.early'), |
| | | // }, |
| | | // { |
| | | // value: t('reportingWorks.nightShift'), |
| | | // label: t('reportingWorks.nightShift'), |
| | | // }, |
| | | { |
| | | value: t('reportingWorks.woodenBox'), |
| | | label: t('reportingWorks.woodenBox'), |
| | | }, |
| | | { |
| | | value: t('reportingWorks.brandreth'), |
| | | label: t('reportingWorks.brandreth'), |
| | | }, |
| | | { |
| | | value: t('reportingWorks.tilting'), |
| | | label: t('reportingWorks.tilting'), |
| | | }, |
| | | ] |
| | | |
| | | |
| | | let inputDisabled = ref(false) |
| | |
| | | && titleUploadData.value.thisProcess!=null){ |
| | | getWork() |
| | | getQuantity() |
| | | |
| | | } |
| | | } |
| | | } |
| | | //route.query.reportingWorkId = 'BG2403150004' |
| | | //判断是否传入报工编号 |
| | | if(route.query.reportingWorkId !== '' && route.query.reportingWorkId!=null){ |
| | | gridOptions.loading = true |
| | | request.post(`reportingWork/selectUpdateReportingWork/${route.query.reportingWorkId}`).then(res=>{ |
| | | if(res.code === '200'){ |
| | | titleUploadData.value = res.data.reportingWork |
| | |
| | | code: 'update', |
| | | name: t('basicData.update'), |
| | | status: 'primary', |
| | | disabled:'false' |
| | | } |
| | | if(route.query.reviewStatus === "1"){ |
| | | button.name=t('basicData.review') |
| | | titleUploadData.value.qualityInspector=user.user.userName |
| | | } |
| | | gridOptions.toolbarConfig.buttons.push(button) |
| | | for (let i = 0; i < res.data.reportingWorkDetails.length; i++) { |
| | | if (res.data.reportingWorkDetails[i].patchStatusOther === '已补片') { |
| | | gridOptions.toolbarConfig.buttons[2].disabled=true |
| | | break |
| | | } |
| | | else{ |
| | | gridOptions.toolbarConfig.buttons[2].disabled=false |
| | | } |
| | | } |
| | | } |
| | | // getQuantity() |
| | | gridOptions.loading = false |
| | | inputDisabled.value = true |
| | | }) |
| | | } |
| | |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | // remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | }, |
| | | menuConfig: { |
| | | body: { |
| | | //右键菜单 |
| | | //右键菜单 |
| | | options: [ |
| | | [ |
| | | { |
| | |
| | | }, |
| | | { |
| | | code: 'SecondaryBreakage', |
| | | name: "序号次破相同", |
| | | name: t('reportingWorks.secondaryBreakage'), |
| | | prefixIcon: 'vxe-icon-indicator', |
| | | visible: true, |
| | | disabled: false |
| | | }, |
| | | { |
| | | code: 'checkedBreakage', |
| | | name: "选中次破相同", |
| | | name: t('reportingWorks.checkedBreakage'), |
| | | prefixIcon: 'vxe-icon-indicator', |
| | | visible: true, |
| | | disabled: false |
| | |
| | | editRules: { |
| | | completedQuantity: [ |
| | | { |
| | | validator ({ row }) { |
| | | validator ({ row ,cellValue }) { |
| | | const regex = /^[0-9]\d*$/ |
| | | const brokenNum = |
| | | (row.breakageQuantity === undefined || row.breakageQuantity===null) ? 0 : row.breakageQuantity |
| | | //整数验证 |
| | | if (row.completedQuantity && !regex.test(row.completedQuantity)) { |
| | | return new Error(t('reportingWorks.enterIntegerGreaterThanEqualTo')) |
| | | //完工+次破数量不能大于可完工数量 |
| | | }else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){ |
| | | return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`)) |
| | | return new Error(t('reportingWorks.pleaseNumber11')) |
| | | //本次完工数量不能大于完工数量 |
| | | }else if(row.quantity_card<row.completedQuantity){ |
| | | return new Error(t('reportingWorks.pleaseNumber10')) |
| | | } |
| | | const nextProcess = titleUploadData.value.nextProcess//下工序 |
| | | |
| | | const completedSum = Number(row.thisQuantitySum) //总完工数量 |
| | | let nextQuantitySum = '' |
| | | if (nextProcess!=''){ |
| | | nextQuantitySum = Number(row.nextQuantitySum) //总下工序完工数量 |
| | | }else { |
| | | nextQuantitySum = Number(row.received_quantity) //总下工序完工数量 |
| | | } |
| | | const totalQuantity = Number(row.quantity) //可完工数量 |
| | | const val = Number(cellValue) //输入值 |
| | | |
| | | //完工数 |
| | | const completedNum = |
| | | (row.completedQuantity === undefined || row.completedQuantity===null || row.completedQuantity==='') ? 0 : row.completedQuantity |
| | | if(titleUploadData.value.reportingWorkId!=null && completedNum>row.minQuantity){ |
| | | return new Error(`${t('reportingWorks.pleaseGreaterThanOrEqual1')} |
| | | ${row.minQuantity} |
| | | ${t('reportingWorks.pleaseGreaterThanOrEqual2')}`) |
| | | } |
| | | // |
| | | const okVal = completedSum - totalQuantity + row.breakageQuantity |
| | | |
| | | //当可操作数量为0,并且完工数量不等于可完工数量时 |
| | | if(row.minQuantity===0 && val!==(totalQuantity-row.breakageQuantity) ){ |
| | | return new Error(`${t('reportingWorks.pleaseNumber12')} ${okVal}+${val}=${okVal+val}\n |
| | | ${t('reportingWorks.pleaseNumber13')} ${nextQuantitySum}\n |
| | | ${t('reportingWorks.pleaseNumber14')} |
| | | `) |
| | | } |
| | | if(titleUploadData.value.reportingWorkId!=null){ |
| | | if (nextProcess!=''){//非最后一道工序 |
| | | if(row.completedQuantityComputed>=row.minQuantity ){ |
| | | if((val<(row.completedQuantityComputed-row.minQuantity || val>=row.completedQuantityComputed))){ |
| | | return new Error(`${row.completedQuantityComputed-row.minQuantity} |
| | | <=val<= |
| | | ${row.completedQuantityComputed}`) |
| | | } |
| | | }else{ |
| | | if((val>row.completedQuantityComputed)){ |
| | | return new Error(`val |
| | | <= |
| | | ${row.completedQuantityComputed}`) |
| | | } |
| | | } |
| | | }else {//最后一道工序 |
| | | if (val<row.completedQuantityComputed){ |
| | | //库存数量、已入库数量 |
| | | if (val>(row.inventory_quantity-row.received_quantity)){ |
| | | return new Error(`val |
| | | <= |
| | | ${row.inventory_quantity-row.received_quantity}`) |
| | | }else { |
| | | if (val < (row.inventory_quantity-row.received_quantity)){ |
| | | //完工总数、本次完工数、已入库数量 |
| | | if (completedSum-row.completedQuantityComputed <row.received_quantity){ |
| | | return new Error(`${t('reportingWorks.pleaseNumber15')}`) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | toolbarConfig: {//表头按钮 |
| | | buttons: [ |
| | | // {code: 'empty', name: '清空报工数量'}, |
| | | // {code: 'sameCompletion', name: '完工相同'}, |
| | | // {code: 'sameDamage', name: '次破相同'}, |
| | | // {code: 'sameOneCompletion', name: '完工一列相同'}, |
| | | // {code: 'sameOneDamage', name: '次破一列相同'}, |
| | | {code: 'saveReportingWork', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save',disabled:true}, |
| | | {code: 'saveReportingWorkReview', name: t('reportingWorks.saveAndReview'), status: 'primary', icon: 'vxe-icon-save',disabled:true}, |
| | | {code: 'saveWorkStorage', name: t('reportingWorks.saveWorkStorage'), status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | // slots: { |
| | | // tools: 'toolbar_buttons' |
| | | // }, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | |
| | | |
| | | break |
| | | } |
| | | case 'saveWorkStorage':{ |
| | | if(xGrid.value.getTableData().fullData.length===0){ |
| | | ElMessage.warning(t('reportingWorks.selectProcessCardData')) |
| | | return |
| | | } |
| | | const device = titleUploadData.value.deviceName |
| | | if(device === null || device === undefined || device === ''){ |
| | | ElMessage.error(t('reportingWorks.selectWorkReportingEquipment')) |
| | | return |
| | | } |
| | | const teamsGroupsName = titleUploadData.value.teamsGroupsName |
| | | if(teamsGroupsName === null || teamsGroupsName === undefined || teamsGroupsName === ''){ |
| | | ElMessage.error(t('reportingWorks.selectWorkReportingTeam')) |
| | | return |
| | | } |
| | | |
| | | if (mannerPacking.value === null || mannerPacking.value === undefined || mannerPacking.value === ''){ |
| | | ElMessage.error(t('reportingWorks.msgMannerPacking')) |
| | | return |
| | | } |
| | | const parts = technologicalProcess.split('->'); |
| | | const last = parts[parts.length - 1]; |
| | | let processId = titleUploadData.value.processId |
| | | //匹配“/”前后字符串 |
| | | const regex = /([^\/]+)\/([^\/]+)/; |
| | | //查找匹配的字符串 |
| | | const resultProcessId = processId.match(regex); |
| | | //流程卡号 |
| | | let processIdStr = resultProcessId[1]; |
| | | //层号 |
| | | let technologyStr = resultProcessId[2]; |
| | | if (last != titleUploadData.value.thisProcess){ |
| | | ElMessage.error(t('reportingWorks.pleaseNumber16')) |
| | | return |
| | | } |
| | | storageBtn.value = true |
| | | //报工新增 |
| | | saveReportingWork(0,'save') |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick (params) {//表格内容双击打开产品界面 |
| | | cellDblclick (params) {//表格内容双击打开次破界面 |
| | | const { row } = params |
| | | brokenRow.value = row |
| | | if(brokenRow.value.damageDetails=== undefined){ |
| | |
| | | const { rows, column, cell } = params; // 解构获取行、列和单元格信息 |
| | | //点击次破数量时打开明细界面 |
| | | if(column.field=="breakageQuantity"){ |
| | | if (row.patchStatusOther!="已补片"){ |
| | | // if (row.patchStatusOther!="已补片"){ |
| | | brokenVisible.value = true |
| | | } |
| | | //} |
| | | } |
| | | }, |
| | | menuClick({menu, row, column}) {//右键菜单 |
| | |
| | | }, |
| | | { |
| | | field: 'responsiblePersonnel', |
| | | title: '责任信息', |
| | | title: t('rework.responsibilityInformation'), |
| | | editRender: {name: 'input', attrs: {placeholder: ''}} |
| | | |
| | | }, |
| | |
| | | } |
| | | } |
| | | } |
| | | const openedBrokenTable = () => { |
| | | |
| | | const brokenGridKey = ref(0) |
| | | const openedBrokenTable = async () => { |
| | | brokenGridKey.value++ |
| | | await nextTick() |
| | | console.log('breakageType:', titleSelectJson.value.breakageType) |
| | | console.log('breakageReason:', titleSelectJson.value.breakageReason) |
| | | //addListener(brokenGrid.value,brokenGridOptions) |
| | | let damage =ref(brokenRow.value.damageDetails) |
| | | brokenGrid.value.reloadData(damage.value) |
| | |
| | | //第一次加载数据 |
| | | let groupChangeProcess = ref(false)//用于本班组显示问题 |
| | | const initTiltle = async () => { |
| | | hideButton() |
| | | await request.post(`/reportingWork/selectProcess/${user.user.userId}`).then((res) => { |
| | | if (res.code == 200) { |
| | | titleSelectJson.value.processType = res.data.process |
| | |
| | | return |
| | | } |
| | | |
| | | const reportingWorkTime = titleUploadData.value.reportingWorkTime |
| | | const currentTime = new Date() |
| | | const targetTime = new Date(reportingWorkTime) |
| | | //未来时间 |
| | | if (targetTime > currentTime) { |
| | | ElMessage.error(t('reportingWorks.futureTime')) |
| | | return |
| | | } |
| | | // 两个时间的毫秒差 |
| | | const diffMs = currentTime - targetTime |
| | | // 转换为天数 |
| | | const diffDays = diffMs / (1000 * 60 * 60 * 24) |
| | | if (diffDays > 396 && saveType!="update") { |
| | | ElMessage.error(t('reportingWorks.longTime')) |
| | | return |
| | | } |
| | | |
| | | const seenIds = {} |
| | | const uniqueByOrderNum = xGrid.value.getTableData().fullData.filter(item => { |
| | | // 检查item的id是否已经在seenIds中 |
| | |
| | | return false |
| | | } |
| | | } |
| | | |
| | | //包装方式 |
| | | titleUploadData.value.packagingMethod = mannerPacking.value |
| | | titleUploadData.value.creator = user.user.userName |
| | | titleUploadData.value.creatorId = user.user.userId |
| | | const requestDetailData = xGrid.value.getTableData().fullData.filter((row) => { |
| | |
| | | } |
| | | gridOptions.toolbarConfig.buttons[0].disabled=true |
| | | gridOptions.toolbarConfig.buttons[1].disabled=true |
| | | gridOptions.loading=true |
| | | //判断保存还是修改 |
| | | if(saveType==='save'){ |
| | | saveReportingWorkRequest(requestData) |
| | |
| | | request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{ |
| | | if (res.code == 200){ |
| | | ElMessage.success(t('reportingWorks.successfulJobApplication')) |
| | | //报工入库 |
| | | if(storageBtn.value == true){ |
| | | getStorageWork(); |
| | | } |
| | | gridOptions.loading=false |
| | | router.push({path:'/main/reportingWorks/AddReportingWork',query:{processId:titleUploadData.value.processId,random:Math.random()}}) |
| | | }else{ |
| | | const errorObj = JSON.parse(res.msg) |
| | |
| | | +t('reportingWorks.pleaseNumber3')+':'+errorObj.processNum+'<'+ |
| | | +t('reportingWorks.pleaseNumber4')+':'+errorObj.sumNum+'\n' |
| | | +t('reportingWorks.pleaseNumber5') |
| | | |
| | | gridOptions.loading=false |
| | | ElMessage.error(msg) |
| | | } |
| | | }).catch(err =>{ |
| | | ElMessage.error('提交失败,请刷新后重试') |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | gridOptions.loading=false |
| | | }).finally(()=>{ |
| | | |
| | | gridOptions.toolbarConfig.buttons[0].disabled=false |
| | | gridOptions.toolbarConfig.buttons[1].disabled=false |
| | | gridOptions.loading=false |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | //下拉款选择工序时查询 |
| | | const getWork = () => { |
| | | |
| | | let processId = titleUploadData.value.processId |
| | | if (processId == "" || processId == null) { |
| | | ElMessage.warning(t('reportingWorks.theProcessCardNumberCannotBeEmpty')) |
| | |
| | | //设备下拉框 |
| | | titleSelectJson.value.deviceType = res.data.device |
| | | //班组下拉框 |
| | | //titleSelectJson.value.teamsType = res.data.teams |
| | | if (teamsTypeValue==true){ |
| | | titleSelectJson.value.teamsType = res.data.teams |
| | | } |
| | | |
| | | //当前流程卡工序 |
| | | titleSelectJson.value.thisProcessType = res.data.thisProcess |
| | | //历史班组 |
| | |
| | | |
| | | //判断早晚班 |
| | | titleUploadData.value.classes=t('reportingWorks.early') |
| | | titleUploadData.value.reportingWorkTime = formatCurrentTime() |
| | | |
| | | //处理编号列 |
| | | //定义存放编号数组 |
| | | const s01Values = []; |
| | | for (let i = 0; i < res.data.Detail.length; i++) { |
| | | const s01Values = []; |
| | | // 遍历 detailList 数组,提取 S01 值到 s01Values 数组 |
| | | if (res.data.Detail[i].other_columns!=null|| res.data.Detail[i].other_columns!=undefined){ |
| | | res.data.Detail.forEach(element => { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | s01Values.push(s01Value || ''); // 如果 S01 值为空,添加空字符串或者其他默认值 |
| | | }); |
| | | |
| | | // 将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | res.data.Detail.forEach((detail, index) => { |
| | | detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 赋值给 s01Value 属性 |
| | | }); |
| | | } |
| | | |
| | | } |
| | | titleUploadData.value.reportingWorkTime = res.data.reportingWorkTiem |
| | | |
| | | |
| | | //绑定下方表格 |
| | | detail.value = res.data.Detail |
| | | |
| | | // 使用map方法来处理每个对象 |
| | | let modifiedCollection = detail.value.map(item => { |
| | | let modifiedCollection = res.data.Detail.map(item => { |
| | | if (item.reviewed_state === 1) { |
| | | return { ...item, reviewed_state: "已审核" }; |
| | | return { ...item, reviewed_state: t('productStock.approved') }; |
| | | } |
| | | else if (item.reviewed_state === 0) { |
| | | return { ...item, reviewed_state: "未审核" }; |
| | | return { ...item, reviewed_state: t('reportingWorks.unreviewed') }; |
| | | } |
| | | else { |
| | | // 其他情况保持不变 |
| | | return item; |
| | | } |
| | | }); |
| | | xGrid.value.reloadData(modifiedCollection) |
| | | detail.value = modifiedCollection |
| | | xGrid.value.reloadData(detail.value) |
| | | hideButton() |
| | | // nextTick(() => { |
| | | // hiddenCompletedOk() |
| | | // }) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | |
| | | //报工入库方法 |
| | | const getStorageWork = () => { |
| | | let processId = titleUploadData.value.processId |
| | | //匹配“/”前后字符串 |
| | | const regex = /([^\/]+)\/([^\/]+)/; |
| | | //查找匹配的字符串 |
| | | const resultProcessId = processId.match(regex); |
| | | //流程卡号 |
| | | let processIdStr = resultProcessId[1]; |
| | | //层号 |
| | | let technologyStr = resultProcessId[2]; |
| | | //开始处理入库需要的数据 |
| | | let rawData = xGrid.value.getTableData().fullData |
| | | const seen = new Set(); |
| | | const result = rawData.filter(item => { |
| | | // 1. 先把 completedQuantity 为 0 的剔除 |
| | | if (item.completedQuantity === 0 || item.completedQuantity =="0" || item.completedQuantity =="") { |
| | | return false; |
| | | } |
| | | // 2. 遇到相同 order_number,只保留第一次,后面都丢弃 |
| | | if (seen.has(item.order_number)) { |
| | | return false; |
| | | } |
| | | seen.add(item.order_number); |
| | | return true; |
| | | }); |
| | | |
| | | // 给每条记录追加 order 字段 |
| | | const resultData = result.map(item => ({ |
| | | ...item, |
| | | order: { |
| | | orderId: titleUploadData.value.orderId |
| | | }, |
| | | processId:processIdStr, |
| | | orderNumber:item.order_number, |
| | | inventoryQuantity:item.completedQuantity |
| | | })); |
| | | let flowData = ref({ |
| | | decValue:company.decValue, |
| | | userId: user.user.userId, |
| | | userName: user.user.userName, |
| | | storageRegion: storageRegion.value, |
| | | remark: remark.value, |
| | | container: container.value, |
| | | flowCard: resultData, |
| | | createTime: titleUploadData.value.reportingWorkTime |
| | | }) |
| | | //调用入库接口 |
| | | request.post("/finishedGoodsInventory/addSelectWarehousing",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('productStock.receivedSuccessfully')) |
| | | // router.push({path:'/maiggn/productStock/CreateProductStock',query:{random:Math.random()}}) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('basicData.msg.quantityError')) |
| | | }else if(res.data==="false2"){ |
| | | ElMessage.warning(t('basicData.msg.dataDoesNotExist')) |
| | | }else{ |
| | | ElMessage.warning(t('productStock.entryFailure')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | } |
| | | |
| | | const hideButton = () => { |
| | | // 获取最后一道工序 |
| | | const parts = technologicalProcess.split('->'); |
| | | let last = parts[parts.length - 1]; |
| | | if (last === '') { |
| | | last = null; |
| | | } |
| | | const els = document.querySelectorAll('.inventory_content'); |
| | | |
| | | // 是否显示报工入库相关按钮内容 |
| | | if (btnValue == false || last != titleUploadData.value.thisProcess) { |
| | | els.forEach(el => { |
| | | el.style.display = 'none'; |
| | | }); |
| | | } else { |
| | | els.forEach(el => { |
| | | el.style.display = ''; |
| | | }); |
| | | // 避免重复添加按钮 |
| | | const exists = gridOptions.toolbarConfig.buttons.some(btn => btn.code === 'saveWorkStorage'); |
| | | if (!exists) { |
| | | let buttons = { |
| | | code: 'saveWorkStorage', |
| | | name: t('reportingWorks.saveWorkStorage'), |
| | | status: 'primary', |
| | | icon: 'vxe-icon-save' |
| | | }; |
| | | gridOptions.toolbarConfig.buttons.push(buttons); |
| | | } |
| | | } |
| | | |
| | | // 过滤按钮,隐藏 saveWorkStorage 按钮时机 |
| | | gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => { |
| | | if ((btnValue == false || last != titleUploadData.value.thisProcess) && button.code === 'saveWorkStorage') { |
| | | return false; |
| | | } |
| | | return true; |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | const changeGroup = (value)=> { |
| | | //判断历史班组是否有此班组信息 |
| | | const exists = titleSelectJson.value.historyTeams.some(item => item.basic_name === value) |
| | | if(! exists){ |
| | | titleSelectJson.value.historyTeams.push({ |
| | | basic_name: value, |
| | | process: titleUploadData.value.thisProcess, |
| | | basic_type: 'teamsgroups', |
| | | id: 555 |
| | | }) |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | const onHiddenChange = (checked) => { |
| | | hiddenVal.value = checked ? 1 : 0 |
| | | hiddenCompletedOk() |
| | | } |
| | | |
| | | const hiddenCompletedOk = () => { |
| | | const $grid = xGrid.value |
| | | const data = $grid.getTableData().fullData |
| | | const laminating = titleUploadData.value.laminating |
| | | const filteredData = data.filter(row => { |
| | | return row.completedQuantity>0 //过滤可完工数量为0的 |
| | | }) |
| | | if (laminating == ''){ |
| | | if (hiddenVal.value == 1){ |
| | | // 重新加载过滤后的数据 |
| | | $grid.loadData(filteredData) |
| | | }else { |
| | | //原始数据 |
| | | $grid.loadData(detail.value); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | |
| | | <el-button :disabled="disabledFlag" :loading="loadingFlag" @click="reviewReportingWork" type="primary">{{$t('reportingWorks.passAudit')}} |
| | | </el-button> |
| | | |
| | | <span class="inventory_content"> |
| | | <el-select style="width: 100px" v-model="mannerPacking" class="processesSt" :placeholder="$t('reportingWorks.mannerPacking')"> |
| | | <el-option |
| | | v-for="item in mannerPackingOp" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-input style="width: 100px" v-model="container" class="m-2" :placeholder="$t('productStock.pleaseEnterTheBoxNumber')"> |
| | | </el-input> |
| | | <el-input style="width: 100px" v-model="storageRegion" class="m-2" :placeholder="$t('productStock.pleaseEnterTheStorageLocation')"> |
| | | </el-input> |
| | | <el-input style="width: 200px" v-model="remark" class="m-2" :placeholder="$t('productStock.pleaseEnterANote')"> |
| | | </el-input> |
| | | </span> |
| | | <!-- <el-button type="primary">审核不通过</el-button>--> |
| | | |
| | | <label>{{technologicalProcess}}</label> |
| | |
| | | <el-col :span="3"> |
| | | <el-select :disabled="groupChangeProcess" |
| | | v-model="titleUploadData.teamsGroupsName" |
| | | @change="changeGroup" |
| | | clearable |
| | | :placeholder="$t('reportingWorks.selectTeam')"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['teamsType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | :label="item.user_name" |
| | | :value="item.user_name" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #toolbar_buttons> |
| | | <el-checkbox |
| | | :model-value="hiddenVal === 1" |
| | | @change="onHiddenChange" |
| | | > |
| | | {{ t('reportingWorks.hiddenVal') }} |
| | | </el-checkbox> |
| | | |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | |
| | | +brokenRow.glass_child+'.'+brokenRow.order_number+'.'+brokenRow.technology_number" |
| | | style="width: 80%;height:75% "> |
| | | <vxe-grid |
| | | |
| | | :key="brokenGridKey" |
| | | height="400px" |
| | | ref="brokenGrid" |
| | | class="mytable-scrollbar" |
| | |
| | | </template> |
| | | <!-- 刺破类型breakageType --> |
| | | <template #breakageType="{ row }"> |
| | | <vxe-select v-model="row.breakageType " |
| | | <vxe-select v-model="row.breakageType" |
| | | clearable placeholder=" " allow-create filterable> |
| | | <vxe-option v-for="item in titleSelectJson.breakageType" :key="item.id" :label="item.basic_name" :value="item.basic_name"/> |
| | | </vxe-select> |
| | |
| | | |
| | | <!--次破原因--> |
| | | <template #breakageReason="{ row }"> |
| | | <vxe-select v-model="row.breakageReason " |
| | | <vxe-select v-model="row.breakageReason" |
| | | clearable placeholder=" " allow-create filterable> |
| | | <vxe-option v-for="item in titleSelectJson.breakageReason" :key="item.id" :label="item.basic_name" :value="item.basic_name"/> |
| | | </vxe-select> |
| | |
| | | } |
| | | |
| | | ::v-deep(.mytable-scrollbar .col-red) { |
| | | background-color: rgb(66,159,254); |
| | | color: #fff; |
| | | background-color: rgb(66,159,254)!important; |
| | | } |
| | | |
| | | |