| | |
| | | ref="xGridLeft" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | height="650px" |
| | | v-bind="gridLeftOptions" |
| | | v-on="gridEvents" |
| | | > |
| | |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | height="650px" |
| | | v-bind="gridOptions" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = ()=>{ |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | } |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/processCard/detailFlowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | |
| | | {field: 'order_id', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 }, |
| | | {field: 'process_id', width: 130, title: '流程卡号' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order_number', title: '订单序号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'technology_number', title: '小片顺序' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'quantity', title: '数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180}, |
| | | {field: 'area', title: '面积' ,showOverflow:"ellipsis"}, |
| | | {field: 'product_name', title: '产品名称', }, |
| | | {field: 'glass_child', title: '单片名称', }, |
| | | {field: 'founder', title: '分架员', }, |
| | | {field: 'splitFrame_time', title: '分架时间', }, |
| | | ],//表头按钮 |
| | |
| | | |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['quantity', 'computeGrossArea',] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import useProductGlassTypeStore from "@/stores/sd/product/productGlassType" |
| | | import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import GlassType from "@/components/sd/product/GlassType.vue" |
| | | import {useRouter} from 'vue-router' |
| | | import Sortable from 'sortablejs' |
| | | import BasicTable from '@/components/basic/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import { useI18n } from 'vue-i18n' |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | | project: '' |
| | | }, |
| | | orderDetail: { |
| | | productId: '', |
| | | productName: '', |
| | | computeGrossArea: '', |
| | | processingNote: '', |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | let inputVal = form.orderId |
| | | |
| | | request.post(`/processCard/flowCard/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: '1', width: 150, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 130, title: '单片名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 120,title: '订单类型', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 110, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 90,title: '标记', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 90,title: '数量', sortable: true}, |
| | | {field: '7',width: 90, title: '次破数量', sortable: true}, |
| | | {field: '8',width: 120, title: '切割', sortable: true}, |
| | | {field: '9',width: 120, title: '磨边', sortable: true}, |
| | | {field: '10',width: 120, title: '钢化', sortable: true}, |
| | | {field: '11',width: 120, title: '入库面积', sortable: true}, |
| | | {field: '1', width: 150, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: '2',width: 130, title: '单片名称' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: '3', width: 120,title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: '4',width: 110, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: '5', width: 90,title: '标记',showOverflow:"ellipsis"}, |
| | | {field: '6', width: 90,title: '数量'}, |
| | | {field: '7',width: 90, title: '次破数量'}, |
| | | |
| | | {field: '8',width: 120, title: '切割'}, |
| | | {field: '9',width: 120, title: '磨边'}, |
| | | {field: '10',width: 120, title: '钢化'}, |
| | | {field: '11',width: 120, title: '入库面积'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 2:'10mm超白UD60平钢(外)', |
| | | 3:'普通订单', |
| | | 4:'NG23052602A01/1', |
| | | 5:'1', |
| | | 6:'33', |
| | | 7:'1', |
| | | 8:'22', |
| | | 9:'22', |
| | | 10:'22', |
| | | 11:'314.13', |
| | | }, |
| | | { |
| | | 1:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 2:'10mm超白平钢+12Ar(结)', |
| | | 3:'普通订单', |
| | | 4:'NG23052602A01/2', |
| | | 5:'2', |
| | | 6:'33', |
| | | 7:'1', |
| | | 8:'22', |
| | | 9:'22', |
| | | 10:'22', |
| | | 11:'314.13', |
| | | }, |
| | | { |
| | | 1:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 2:'10mm超白平钢(内)', |
| | | 3:'普通订单', |
| | | 4:'NG23052602A01/3', |
| | | 5:'3', |
| | | 6:'33', |
| | | 7:'1', |
| | | 8:'22', |
| | | 9:'22', |
| | | 10:'22', |
| | | 11:'314.13', |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | // footerMethod ({ columns, data }) {//页脚函数 |
| | |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | orderId: '', |
| | | |
| | | }) |
| | | |
| | |
| | | <div class="main-div-customer" > |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-input placeholder="销售单号" v-model="form.name" value="NG23110102" style="width: 150px"/> |
| | | <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 130px"></el-input> |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | | |
| | | </el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | return Result.seccess(flowCardService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard)); |
| | | |
| | | } |
| | | //查询排产数据 |
| | | //流程卡明细查询 |
| | | @ApiOperation("流程卡明细查询接口") |
| | | @PostMapping ("/flowCardDetail/{processId}") |
| | | public Result flowCardDetail( |
New file |
| | |
| | | package com.example.erp.controller.pp; |
| | | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.ReportService; |
| | | import com.example.erp.service.pp.WorkOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="生产报表controller",tags={"生产报表操作接口"}) |
| | | @RequestMapping("/report") |
| | | public class ReportController { |
| | | @Autowired |
| | | ReportService reportService; |
| | | |
| | | //流程卡进度 |
| | | @ApiOperation("流程卡进度") |
| | | @PostMapping ("/processCardProgress/{orderId}") |
| | | public Result processCardProgress( |
| | | @PathVariable String orderId, |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(reportService.processCardProgressSv(orderId,flowCard)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface ReportMapper { |
| | | |
| | | List<Map<String, String>> processCardProgressMp(String orderId, FlowCard flowCard); |
| | | } |
New file |
| | |
| | | |
| | | package com.example.erp.service.pp; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.mapper.pp.ReportMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class ReportService { |
| | | @Autowired |
| | | ReportMapper reportMapper; |
| | | |
| | | |
| | | public Map<String, Object> processCardProgressSv(String orderId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.processCardProgressMp(orderId, flowCard)); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | select fc.order_id, |
| | | fc.process_id, |
| | | fc.order_number, |
| | | fc.technology_number, |
| | | fc.quantity, |
| | | round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area, |
| | | od.product_name, |
| | | ogd.glass_child, |
| | | fc.founder, |
| | | date(fc.splitFrame_time) as splitFrame_time |
| | | from flow_card as fc |
| | |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | where fc.process_id = #{processId} |
| | | GROUP BY fc.order_id, fc.process_id, fc.order_number |
| | | GROUP BY fc.order_id, fc.process_id, fc.order_number,fc.technology_number |
| | | order by fc.order_number,fc.technology_number |
| | | </select> |
| | | |
| | | <delete id="deleteReportingWork"> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.pp.ReportMapper"> |
| | | <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard"> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="process_Id" property="processId"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="layout_status" property="layoutStatus"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="customer_name" property="customerName"/> |
| | | <result column="batch" property="batch"/> |
| | | <result column="other_remarks" property="otherRemarks"/> |
| | | <result column="icon" property="icon"/> |
| | | <result column="order_type" property="orderType"/> |
| | | <result column="salesman" property="salesman"/> |
| | | <result column="processing_note" property="processingNote"/> |
| | | <result column="delivery_address" property="deliveryAddress"/> |
| | | </association> |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="compute_gross_area" property="computeGrossArea"/> |
| | | <result column="processing_note" property="processingNote"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="compute_gross_area" property="computeGrossArea"/> |
| | | <result column="perimeter" property="perimeter"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="shape" property="shape"/> |
| | | <result column="weight" property="weight"/> |
| | | </association> |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result column="production_id" property="productionId"/> |
| | | </association> |
| | | <association property="product" javaType="com.example.erp.entity.sd.Product"> |
| | | <result column="total_thickness" property="totalThickness"/> |
| | | <result column="thickness" property="thickness"/> |
| | | </association> |
| | | |
| | | <!--<result column="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- 流程卡进度--> |
| | | <select id="processCardProgressMp"> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | select fc.order_id, |
| | | fc.process_id, |
| | | fc.order_number, |
| | | fc.technology_number, |
| | | fc.quantity, |
| | | round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area, |
| | | od.product_name, |
| | | ogd.glass_child, |
| | | fc.founder, |
| | | date(fc.splitFrame_time) as splitFrame_time |
| | | from flow_card as fc |
| | |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | where fc.process_id = #{processId} |
| | | GROUP BY fc.order_id, fc.process_id, fc.order_number |
| | | GROUP BY fc.order_id, fc.process_id, fc.order_number,fc.technology_number |
| | | order by fc.order_number,fc.technology_number |
| | | </select> |
| | | |
| | | <delete id="deleteReportingWork"> |