| | |
| | | component: () => import('../views/pp/glassOptimize/OptimizeProject.vue'), |
| | | }, |
| | | { |
| | | path: '/glassInventory/:thickNess/:model', |
| | | name: 'glassInventory', |
| | | component: () => import('../views/pp/glassOptimize/OptimizeProject.vue'), |
| | | }, |
| | | { |
| | | path: '', |
| | | redirect:'/main/glassOptimize/optimizeProject' |
| | | } |
| | |
| | | requiresRow: true, |
| | | openFile: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | await router.replace({ |
| | | const thickness = row.thickness; |
| | | const glassType = row.glassType; |
| | | await router.push({ |
| | | name: 'projectDetail', |
| | | params: { |
| | | query: { |
| | | projectNo: projectNumber |
| | | } |
| | | }); |
| | | await router.push({ |
| | | name: 'glassInventory', |
| | | query: { |
| | | 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.query.thickNess); |
| | | const model = ref(route.query.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 { |
| | | console.error('返回数据格式不符合预期,不是有效的对象数组格式'); |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | console.error('请求获取库存失败,状态码:', res.code, ',错误信息:', res.msg); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | selectMaterialStore(); |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | |
| | | const route = useRoute(); |
| | | //工程号 |
| | | const projectNo = ref(route.params.projectNo); |
| | | const projectNo = ref(route.query.projectNo); |
| | | const projectName = ref(''); |
| | | console.log(projectNo.value); |
| | | |
| | | const fetchData = () => { |
| | | request.post(`/glassOptimize/projectInfo/${projectNo.value}`).then((res) => { |
| | |
| | | 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> |
| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | 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, |