Merge branch 'master' of http://bore.pub:10439/r/ERP_override
| | |
| | | component: () => import('../views/pp/glassOptimize/OptimizePrint.vue'), |
| | | }, |
| | | { |
| | | path: '/projectDetail/:projectNo', |
| | | name: 'projectDetail', |
| | | component: () => import('../views/pp/glassOptimize/OptimizeProject.vue'), |
| | | path: '/optimizeProject/:projectNo/:thickNess/:model', |
| | | name: 'optimizeInfo', |
| | | component: () => import('../views/pp/glassOptimize/OptimizeProject.vue') |
| | | }, |
| | | { |
| | | path: '', |
| | |
| | | requiresRow: true, |
| | | openFile: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | await router.replace({ |
| | | name: 'projectDetail', |
| | | const thickness = row.thickness; |
| | | const glassType = row.glassType; |
| | | await router.push({ |
| | | name: 'optimizeInfo', |
| | | params: { |
| | | projectNo: projectNumber |
| | | projectNo: projectNumber, |
| | | thickNess: thickness, |
| | | model: glassType |
| | | } |
| | | }); |
| | | } |
| | |
| | | <script setup> |
| | | import {reactive, ref} from "vue"; |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {useRoute} from "vue-router"; |
| | | const { t } = useI18n() |
| | | |
| | | const xGrid = ref() |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | /*formConfig: { |
| | | data: { |
| | | width: '', |
| | | height: '', |
| | | quantity: '' |
| | | }, |
| | | items: [ |
| | | { field: 'width', title: t('order.width')+':', itemRender: { name: 'VxeInput' } }, |
| | | { field: 'height', title: t('order.height')+':', itemRender: { name: 'VxeInput' } }, |
| | | { field: 'quantity', title: t('order.quantity')+':', itemRender: { name: 'VxeInput' } }, |
| | | { |
| | | itemRender: { |
| | | name: 'VxeButtonGroup', |
| | | options: [ |
| | | { type: 'submit', content: t('craft.sure'), status: 'primary' }, |
| | | { type: 'reset', content: t('product.msg.reset') } |
| | | ] |
| | | } |
| | | } |
| | | ] |
| | | },*/ |
| | | |
| | | columns:[ |
| | | {title: '选择', type:'radio', width: 70}, |
| | | {type:'seq',fixed:"left", title:' ', width: 50}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {field: 'id', title: '物料编码',}, |
| | | {field:'state',title: t('order.width'),}, |
| | | {type: 'seq',title: t('order.height')}, |
| | | {field: 'id', title: t('order.totalThickness'),}, |
| | | {field: 'id', title: t('warehouseBasicData.type'),}, |
| | | {field: 'id', title: '左修边',}, |
| | | {field: 'id', title: '下修边',}, |
| | | {field: 'id', title: '右修边',}, |
| | | {field: 'id', title: '上修边',}, |
| | | {field: 'id', title: '库存数量',}, |
| | | {field: 'id', title: '加工数量',}, |
| | | {field: 'id', title: '名称',}, |
| | | {field: 'id', title: '供应商',} |
| | | {field:'width',title: t('order.width'),}, |
| | | {field: 'height',title: t('order.height')}, |
| | | {field: 'thickness', title: t('order.totalThickness'),}, |
| | | {field: 'model', title: t('warehouseBasicData.type'),}, |
| | | {field: 'leftTrim', title: '左修边',}, |
| | | {field: 'downTrim', title: '下修边',}, |
| | | {field: 'rigthTrim', title: '右修边',}, |
| | | {field: 'upTrim', title: '上修边',}, |
| | | {field: 'available_quantity', title: '库存数量',}, |
| | | {field: '', title: '加工数量',}, |
| | | {field: 'name', title: '名称',}, |
| | | {field: 'producer', title: '供应商',} |
| | | ],//表头参数 |
| | | data:null,//表格数据 |
| | | toolbarConfig: { |
| | |
| | | buttons: "toolbar_buttons" |
| | | }, |
| | | }, |
| | | |
| | | }) |
| | | |
| | | const route = useRoute(); |
| | | |
| | | const thickness = ref(route.params.thickNess); |
| | | const model = ref(route.params.model); |
| | | |
| | | |
| | | const selectMaterialStore = () =>{ |
| | | request.post(`/glassOptimize/materialStore/${thickness.value}/${model.value}`).then((res) => { |
| | | if (Number(res.code) === 200) { |
| | | const rawData = res.data.data; |
| | | if (Array.isArray(rawData) && rawData.length > 0) { |
| | | const formattedData = rawData.map(item => { |
| | | const formattedItem = {}; |
| | | for (const key in item) { |
| | | if (typeof item[key] === 'string') { |
| | | //去除字符串属性值开头和结尾的双引号 |
| | | formattedItem[key] = item[key].replace(/^\"|\"$/g, ''); |
| | | } else { |
| | | formattedItem[key] = item[key]; |
| | | } |
| | | } |
| | | return formattedItem; |
| | | }); |
| | | const data = formattedData; |
| | | data.forEach(item => { |
| | | item.leftTrim = 0; |
| | | item.downTrim = 0; |
| | | item.rigthTrim = 0; |
| | | item.upTrim = 0; |
| | | }); |
| | | xGrid.value.loadData(formattedData); |
| | | } else { |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | console.error('请求获取库存失败,状态码:', res.code, ',错误信息:', res.msg); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | selectMaterialStore(); |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {nextTick, onMounted, reactive, ref} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Folder, Plus, Setting, Operation,} from "@element-plus/icons-vue"; |
| | | import OptimizeCompute from "@/views/pp/glassOptimize/page/OptimizeCompute.vue"; |
| | |
| | | dialogVisible.value[index] = true; |
| | | }; |
| | | |
| | | const closeDialog = (index) => { |
| | | dialogVisible.value[index] = false; |
| | | }; |
| | | |
| | | const route = useRoute(); |
| | | //工程号 |
| | | const projectNo = ref(route.params.projectNo); |
| | | const projectName = ref(''); |
| | | console.log(projectNo.value); |
| | | |
| | | const fetchData = () => { |
| | | request.post(`/glassOptimize/projectInfo/${projectNo.value}`).then((res) => { |
| | |
| | | item.shelf_number = 0; |
| | | }); |
| | | xGrid.value.loadData(res.data.data); |
| | | gridOptions.data = res.data.data; |
| | | projectName.value = res.data.data[0].project_name; |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | |
| | | title="查询库存" |
| | | destroy-on-close |
| | | style="width: 35%;height:35%;"> |
| | | <check-inventory/> |
| | | <check-inventory /> |
| | | </el-dialog> |
| | | |
| | | <el-button id="button" type="primary" @click="openDialog(2)">设置磨量</el-button> |
| | |
| | | title="设置磨量" |
| | | destroy-on-close |
| | | style="width: 35%;height:80%;margin-top: 3vh;"> |
| | | <set-amount/> |
| | | <set-amount :closeDialog="closeDialog" @set-amount="Amount"/> |
| | | </el-dialog> |
| | | |
| | | <el-button id="button" type="primary" @click="openDialog(3)">设置修边</el-button> |
| | |
| | | delete item._X_ROW_KEY |
| | | $grid.insert(item) |
| | | |
| | | |
| | | } |
| | | |
| | | $gridLeft.remove(item) |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | let leftDataList = $gridLeft.getTableData().fullData; |
| | | let baseProcessId = productionId; // 固定的前缀 |
| | | |
| | | // 统计所有不重复的 processId |
| | | let uniqueProcessIds = new Set(leftDataList.map(item => item.processId)); |
| | | // 不重复的 processId 的总个数 |
| | | let totalUniqueCount = uniqueProcessIds.size; |
| | | // 用于记录已经分配的 processId |
| | | let usedProcessIds = new Set(); |
| | | |
| | | leftDataList.forEach((item) => { |
| | | let newProcessId; |
| | | // 如果该 processId 是第一次出现,使用递减的编号生成新的 processId |
| | | if (!usedProcessIds.has(item.processId)) { |
| | | newProcessId = `${baseProcessId}${(totalUniqueCount).toString().padStart(3, '0')}`; |
| | | usedProcessIds.add(item.processId); // 标记该 processId 已使用 |
| | | totalUniqueCount--; // 递减 |
| | | |
| | | } else { |
| | | // 如果该 processId 已经使用过,继续使用已分配的编号 |
| | | newProcessId = `${baseProcessId}${(totalUniqueCount + 1).toString().padStart(3, '0')}`; |
| | | |
| | | } |
| | | // 更新 item.processId |
| | | item.processId = newProcessId; |
| | | }); |
| | | |
| | | //清除两边复选框 |
| | | $gridLeft.clearCheckboxRow() |
| | | $grid.clearCheckboxRow() |
| | | |
| | | } catch (e) { |
| | | ElMessage.warning(e.message) |
| | | } |
| | |
| | | gridLeftOptions.toolbarConfig.buttons[0].disabled=false |
| | | return; |
| | | } |
| | | // if (leftData.length!=selectRecords.length){ |
| | | // ElMessage.warning('请勾选所有数据进行保存') |
| | | // gridLeftOptions.toolbarConfig.buttons[0].disabled=false |
| | | // return; |
| | | // } |
| | | let flowCardData = ref({ |
| | | flowCard: selectRecords, |
| | | userName: username, |
| | |
| | | GlassOptimizeService glassOptimizeService; |
| | | |
| | | //工程信息 |
| | | @ApiOperation("创建工程查询流程卡接口") |
| | | @ApiOperation("工程信息接口") |
| | | @PostMapping ("/projectInfo/{projectNo}") |
| | | public Result projectInfo( |
| | | @PathVariable String projectNo){ |
| | | return Result.seccess(glassOptimizeService.projectInfoSv(projectNo)); |
| | | } |
| | | |
| | | //库存信息 |
| | | @ApiOperation("库存信息接口") |
| | | @PostMapping ("/materialStore/{thickness}/{model}") |
| | | public Result materialStore( |
| | | @PathVariable String thickness, |
| | | @PathVariable String model ){ |
| | | return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model)); |
| | | } |
| | | |
| | | |
| | | //工程查询流程卡 |
| | | @ApiOperation("创建工程查询流程卡接口") |
| | |
| | | //工程信息 |
| | | List<Map<String, Object>> projectInfoMp(String projectNo); |
| | | |
| | | //库存信息 |
| | | List<Map<String, Object>> materialStoreMp(String thickness, String model); |
| | | |
| | | //工单管理查询未转工单数据 |
| | | List<OrderGlassDetail> selectWordOrder(Date selectTime1, Date selectTime2, OrderGlassDetail orderGlassDetail); |
| | |
| | | |
| | | |
| | | |
| | | Integer getMaximum(); |
| | | String getMaximum(); |
| | | |
| | | Boolean insertReplenish(@Param("patchLog") PatchLog patchLog , @Param("oddNumber") String oddNumber); |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | //库存信息 |
| | | public Map<String, Object> materialStoreSv(String thickness, String model) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | //工程查询流程卡 |
| | | public Map<String, Object> getFlowCardList(String optionVal, Integer radio) { |
| | |
| | | if(Objects.equals(type, "补片")){ |
| | | alias="BP"; |
| | | } |
| | | //查询当天的最大数量 |
| | | Integer maximum=patchMapper.getMaximum(); |
| | | //查询当天最新的编号 |
| | | String str=patchMapper.getMaximum(); |
| | | if (str == null){ |
| | | str="00"; |
| | | } |
| | | String maximum = str.substring(str.length() - 2); |
| | | int lastTwoInteger = Integer.parseInt(maximum); |
| | | //设置两位不够补0 |
| | | String formattedNumber = String.format("%02d", maximum+1); |
| | | String formattedNumber = String.format("%02d", lastTwoInteger+1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); |
| | |
| | | f.order_number; |
| | | </select> |
| | | |
| | | <!--库存信息--> |
| | | <select id="materialStoreMp"> |
| | | SELECT |
| | | i.id AS id, |
| | | i.producer AS producer, |
| | | i.available_quantity AS available_quantity, |
| | | JSON_EXTRACT(s.json, '$.width') AS width, |
| | | JSON_EXTRACT(s.json, '$.height') AS height, |
| | | JSON_EXTRACT(s.json, '$.thickness') AS thickness, |
| | | JSON_EXTRACT(s.json, '$.name') AS name, |
| | | JSON_EXTRACT(s.json, '$.model') AS model |
| | | FROM mm.material_inventory as `i` |
| | | LEFT JOIN mm.material_store as s ON ( |
| | | ( |
| | | `i`.`material_code` = `s`.`id` |
| | | ) |
| | | ) |
| | | WHERE |
| | | ( |
| | | (`s`.`type` = '原片') |
| | | AND (`i`.`optimize_state` = 1) |
| | | AND (`i`.`available_quantity` > 0) |
| | | AND JSON_EXTRACT(s.json, '$.thickness') = #{thickness} |
| | | AND JSON_EXTRACT(s.json, '$.model') = #{model} |
| | | ) |
| | | ORDER BY |
| | | `i`.`available_quantity` DESC ; |
| | | </select> |
| | | |
| | | <select id="selectWordOrder" resultMap="wordOrderMap"> |
| | | select |
| | | o.order_id, |
| | |
| | | r.quality_inspector, |
| | | r.patch_processes, |
| | | r.reviewer, |
| | | date(r.create_time) as create_time, |
| | | r.create_time as create_time, |
| | | date(r.update_time) as update_time, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS glassNumber |
| | | from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number |
| | |
| | | |
| | | |
| | | <select id="getMaximum" > |
| | | select count(*) from pp.patch_log where date(create_time)=CURDATE() |
| | | SELECT IFNULL(patch_id,'00') |
| | | FROM patch_log |
| | | WHERE DATE(create_time) = CURDATE() |
| | | ORDER BY create_time DESC |
| | | LIMIT 1; |
| | | </select> |
| | | |
| | | |
| | |
| | | |
| | | <select id="productionScheduleMp"> |
| | | select a.order_number, |
| | | if(od.shape='' || ISNULL(od.shape),'普形',if(od.shape = 1, '普形', if(od.shape = 2, '异形', ''))) as shape, |
| | | if(a.shape='' || ISNULL(a.shape),'普形',if(a.shape = 1, '普形', if(a.shape = 2, '异形', ''))) as shape, |
| | | a.product_name, |
| | | b.child_width, |
| | | b.child_height, |