| | |
| | | |
| | | //获取GlassInventory的值(查询库存) |
| | | const sendDataGlassInventory = ref() |
| | | const handleInventoyData = (selectedLabel1,selectedLabel2) => { |
| | | const handleInventoyData = (selectedLabel1,selectedLabel2,type) => { |
| | | sendDataGlassInventory.value = { |
| | | selectedLabel1, selectedLabel2 |
| | | selectedLabel1, selectedLabel2,type |
| | | }; |
| | | }; |
| | | |
| | |
| | | <script setup> |
| | | import {defineEmits, ref} from "vue"; |
| | | |
| | | |
| | | const value1 = ref('') |
| | | const value2 = ref('') |
| | | |
| | |
| | | |
| | | const emit = defineEmits(['send-data-inventory',]); |
| | | const props = defineProps({ |
| | | closeDialog: Function |
| | | closeDialog: Function, |
| | | thickNess:null, |
| | | model:null |
| | | }); |
| | | |
| | | value1.value=props.thickNess |
| | | value2.value=props.model |
| | | |
| | | const CheckInventory = () => { |
| | | const selectedLabel1 = options1.find((option) => option.value === value1.value)?.label || ''; |
| | | const selectedLabel2 = options2.find((option) => option.value === value2.value)?.label || ''; |
| | | const selectedLabel1 = value1.value; |
| | | const selectedLabel2 = value2.value; |
| | | // 判断两个值是否都被选择了,如果有一个为空字符串,则提示并返回,不执行后续操作 |
| | | if (!selectedLabel1 ||!selectedLabel2) { |
| | | window.alert('请选择相关选项'); |
| | | if (selectedLabel1==="" || selectedLabel2==="") { |
| | | window.alert('请输入'); |
| | | return; |
| | | } |
| | | props.closeDialog(1); |
| | |
| | | <template> |
| | | <div id="box"> |
| | | <div> |
| | | <span>厚度(mm):</span> |
| | | <el-select v-model="value1" clearable style="width: 240px"> |
| | | <el-option |
| | | v-for="item in options1" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <span>厚度(mm):</span> |
| | | <el-input v-model="value1" style="width: 140px"></el-input> |
| | | </div> |
| | | |
| | | <div style="margin-top: 30px"> |
| | | <span>玻璃类型:</span> |
| | | <el-select v-model="value2" clearable style="width: 240px; margin-left: 23px"> |
| | | <el-option |
| | | v-for="item in options2" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <span>玻璃类型 :</span> |
| | | <el-input v-model="value2" style="width: 140px"> |
| | | |
| | | </el-input> |
| | | </div> |
| | | |
| | | <div style="float: right; margin:-55px 35px 0 0;"> |
| | |
| | | const thickness = ref(route.params.thickNess); |
| | | const model = ref(route.params.model); |
| | | let projectNo = ref(null); |
| | | let type = ref(1); |
| | | |
| | | const selectMaterialStore = async () =>{ |
| | | request.post(`/glassOptimize/materialStore/${thickness.value}/${model.value}/${projectNo}`).then((res) => { |
| | | request.get(`/glassOptimize/materialStore/${thickness.value}/${model.value}/${projectNo}?type=${type.value}`).then((res) => { |
| | | if (Number(res.code) === 200) { |
| | | const rawData = res.data.data; |
| | | const edgeTrimming = res.data.edgeTrimming; |
| | |
| | | if (newInventoryData) { |
| | | thickness.value = newInventoryData.selectedLabel1; |
| | | model.value = newInventoryData.selectedLabel2; |
| | | type.value=newInventoryData.type |
| | | // 由于 thickness 和 model 的值改变了,更新表格,调用 selectMaterialStore 重新获取数据 |
| | | selectMaterialStore(); |
| | | } |
| | |
| | | properties: { |
| | | selectedLabel1: { type: String }, |
| | | selectedLabel2: { type: String }, |
| | | type: { type: String } |
| | | } |
| | | } |
| | | }); |
| | |
| | | await emit('changeDialog', command) |
| | | } |
| | | |
| | | let originalFilm=ref(true) |
| | | let surplusMaterial=ref(false) |
| | | |
| | | //优化计算 |
| | | const dialogVisible = ref({}); |
| | | const openDialog = (index) => { |
| | |
| | | //工程号 |
| | | const projectNo = ref(route.params.projectNo); |
| | | const projectName = ref(''); |
| | | const thickNess = ref(route.params.thickNess); |
| | | const model = ref(route.params.model); |
| | | onBeforeUnmount(() => { |
| | | localStorage.setItem('projectNo', projectNo.value); |
| | | }); |
| | |
| | | |
| | | //中转站接受CheckInventory的值(查询库存) |
| | | const handleInventory = (selectedLabel1, selectedLabel2) => { |
| | | emit('send-inventory-to-op', selectedLabel1, selectedLabel2); |
| | | let type=0; |
| | | if(originalFilm.value===true&&surplusMaterial.value===true){ |
| | | type=3 |
| | | }else if(originalFilm.value===true&&surplusMaterial.value===false){ |
| | | type=1 |
| | | }else if(originalFilm.value===false&&surplusMaterial.value===true){ |
| | | type=2 |
| | | }else{ |
| | | type=1 |
| | | } |
| | | emit('send-inventory-to-op', selectedLabel1, selectedLabel2,type); |
| | | } |
| | | |
| | | </script> |
| | |
| | | <span>工程编号:</span> |
| | | <el-input readonly placeholder="" style="width: 150px" v-model="projectNo"></el-input> |
| | | <span>工程名称:</span> |
| | | <el-input readonly placeholder="" style="width: 150px; margin-right: 340px;" v-model="projectName" ></el-input> |
| | | <el-input readonly placeholder="" style="width: 150px; margin-right: 140px;" v-model="projectName" ></el-input> |
| | | 原片<el-checkbox v-model="originalFilm" ></el-checkbox> |
| | | 余料<el-checkbox v-model="surplusMaterial" ></el-checkbox> |
| | | <el-button id="checkinventory" type="primary" @click="openDialog(1)">查询库存</el-button> |
| | | <el-dialog v-model="dialogVisible[1]" title="查询库存" destroy-on-close style="width: 35%;height:35%;"> |
| | | <check-inventory :closeDialog="closeDialog" @send-data-inventory="handleInventory"/> |
| | | <check-inventory :closeDialog="closeDialog" :thickNess="thickNess" :model="model" |
| | | @send-data-inventory="handleInventory"/> |
| | | </el-dialog> |
| | | <el-button id="button" type="primary" @click="openDialog(2)">设置磨量</el-button> |
| | | <el-dialog v-model="dialogVisible[2]" title="设置磨量(mm)" destroy-on-close |
| | |
| | | |
| | | //库存信息 |
| | | @ApiOperation("库存信息接口") |
| | | @PostMapping ("/materialStore/{thickness}/{model}/{projectNumber}") |
| | | @GetMapping ("/materialStore/{thickness}/{model}/{projectNumber}") |
| | | public Result materialStore( |
| | | @PathVariable String thickness, |
| | | @PathVariable String model,@PathVariable String projectNumber ){ |
| | | return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model,projectNumber)); |
| | | @PathVariable String model,@PathVariable String projectNumber, |
| | | @RequestParam(name = "type", required = false) Integer type ){ |
| | | return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model,projectNumber,type)); |
| | | } |
| | | |
| | | |
| | |
| | | //库存信息 |
| | | List<Map<String, Object>> materialStoreMp(String thickness, String model); |
| | | |
| | | List<Map<String, Object>> surplusMaterialsMp(String thickness, String model); |
| | | |
| | | List<Map<String, Object>> materialStoreSurplusMp(String thickness, String model); |
| | | |
| | | List<Map<String, Object>> materialStoreOptimizeUse(String projectNumber); |
| | | |
| | | //工单管理查询未转工单数据 |
| | |
| | | } |
| | | |
| | | //库存信息 |
| | | public Map<String, Object> materialStoreSv(String thickness, String model, String projectNumber) { |
| | | public Map<String, Object> materialStoreSv(String thickness, String model, String projectNumber,Integer type) { |
| | | Map<String, Object> stringObjectMap = glassOptimizeMapper.selectProjectCount(projectNumber); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(Integer.parseInt(stringObjectMap.get("state").toString())<10){ |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | if(type==1){ |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | }else if(type==2){ |
| | | map.put("data", glassOptimizeMapper.surplusMaterialsMp(thickness,model)); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.materialStoreSurplusMp(thickness,model)); |
| | | } |
| | | map.put("edgeTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | }else if(Integer.parseInt(stringObjectMap.get("state").toString())==10){ |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | if(type==1){ |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | }else if(type==2){ |
| | | map.put("data", glassOptimizeMapper.surplusMaterialsMp(thickness,model)); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.materialStoreSurplusMp(thickness,model)); |
| | | } |
| | | map.put("edgeTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.materialStoreOptimizeUse(projectNumber)); |
| | |
| | | `i`.`available_quantity` DESC ; |
| | | </select> |
| | | |
| | | <!--余料信息--> |
| | | <select id="surplusMaterialsMp"> |
| | | SELECT |
| | | i.id AS id, |
| | | '' AS producer, |
| | | i.quantity AS available_quantity, |
| | | i.width, |
| | | i.height, |
| | | i.thickness, |
| | | i.colour AS name, |
| | | i.colour |
| | | FROM mm.surplus_materials as i |
| | | WHERE |
| | | i.quantity>0 and i.colour=#{model} and i.thickness=#{thickness} |
| | | ORDER BY |
| | | i.quantity DESC ; |
| | | </select> |
| | | |
| | | <!--库存余料信息--> |
| | | <select id="materialStoreSurplusMp"> |
| | | (SELECT |
| | | i.id AS id, |
| | | i.producer AS producer, |
| | | i.available_quantity-i.plan_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`-i.plan_quantity > 0) |
| | | AND JSON_EXTRACT(s.json, '$.thickness') = #{thickness} |
| | | AND JSON_EXTRACT(s.json, '$.model') = #{model} |
| | | ) |
| | | ORDER BY |
| | | `i`.`available_quantity` DESC) union |
| | | (SELECT |
| | | i.id AS id, |
| | | '' AS producer, |
| | | i.quantity AS available_quantity, |
| | | i.width, |
| | | i.height, |
| | | i.thickness, |
| | | i.colour AS name, |
| | | i.colour |
| | | FROM mm.surplus_materials as i |
| | | WHERE |
| | | i.quantity>0 and i.colour=#{model} and i.thickness=#{thickness} |
| | | ORDER BY |
| | | i.quantity DESC ); |
| | | </select> |
| | | |
| | | |
| | | <select id="materialStoreOptimizeUse"> |
| | | select ms.id AS id, |