| | |
| | | msgDeleteSuccess:'Successfully delete', |
| | | deleteConfirm:'Confirm order deletion?', |
| | | orderType:'Order Type', |
| | | processFlows:'Process flows:', |
| | | msgList:{ |
| | | checkOrder:'No order information is found. Please click Order first' |
| | | } |
| | | }, |
| | | craft:{ |
| | | glassAddress:'Glass Address', |
| | |
| | | msgDeleteSuccess:'删除成功', |
| | | deleteConfirm:'确认删除订单?', |
| | | orderType:'订单类型', |
| | | processFlows:'流程卡进度', |
| | | msgList:{ |
| | | checkOrder:'未查询到订单信息,请先单击订单' |
| | | } |
| | | |
| | | }, |
| | | craft:{ |
| | |
| | | <script setup> |
| | | |
| | | 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) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | |
| | | let props = defineProps({ |
| | | orderId:null |
| | | }) |
| | | onMounted(()=>{ |
| | | if(props.orderId===null || props.orderId===undefined || props.orderId===''){ |
| | | return |
| | | } |
| | | } |
| | | form.orderId = props.orderId |
| | | getWorkOrder() |
| | | }) |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | computeGrossArea: '', |
| | | processingNote: '', |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const columns = [ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: 'product_name', width: 150, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'glass_child',width: 130, title: '单片名称' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'order_type', width: 120,title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'process_id',width: 110, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'technology_number', width: 90,title: '标记',showOverflow:"ellipsis"}, |
| | | {field: 'quantity', width: 90,title: '数量'}, |
| | | {field: 'broken_num',width: 90, title: '次破数量'}, |
| | | {field: 'inventoryArea',width: 120, title: '入库面积'}, |
| | | ] |
| | | //需要合并的列 |
| | | let column = [1,3,8] |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | let inputVal = form.orderId |
| | | |
| | | request.post(`/processCard/flowCard/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/report/processCardProgress/${form.orderId}`,column).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | pageTotal.value = res.data.total |
| | | if(res.data.data.length===0){ |
| | | ElMessage.warning('未查询到此订单流程卡数据') |
| | | return |
| | | } |
| | | gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | res.data.title.forEach(item =>{ |
| | | let column = {slots: { default: 'quantitySum' }, width: 90,title: item.process} |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | }) |
| | | mergeCells.value = res.data.mergeCells |
| | | console.log(res.data.mergeCells) |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0 |
| | | if(reportWorkQuantity===reportWorkQuantityCount){ |
| | | return reportWorkQuantity |
| | | } |
| | | |
| | | return (reportWorkQuantity |
| | | +'(' |
| | | +reportWorkQuantityCount |
| | | +')' ) |
| | | //return |
| | | } |
| | | |
| | | |
| | |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {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: '入库面积'}, |
| | | ],//表头按钮 |
| | | columns:[],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | |
| | | }) |
| | | |
| | | const mergeCells = ref([ |
| | | { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 1, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 6, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 6, rowspan: 3, colspan: 0}, |
| | | |
| | | ]) |
| | | |
| | |
| | | <div class="main-div-customer" > |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 130px"></el-input> |
| | | <el-input |
| | | v-model="form.orderId" |
| | | clearable |
| | | :disabled="props.orderId" |
| | | :placeholder="$t('order.orderId')" |
| | | style="width: 130px"></el-input> |
| | | |
| | | <el-button |
| | | :disabled="props.orderId" |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <template #quantitySum="{ row,column }"> |
| | | <span>{{ quantitySum(row,column) }} </span> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | |
| | | import {ElMessage} from "element-plus" |
| | | import {VXETable} from "vxe-table" |
| | | import {useI18n} from "vue-i18n" |
| | | import {toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | |
| | | let rowClickIndex = ref(null) |
| | | const dialogTableVisible = ref(false) |
| | | let orderType = ref("2") |
| | | let selectDate = ref(["",""]) |
| | | let filterData = ref({}) |
| | | let orderList = ref([]) |
| | | let pageNum=ref(1) |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | }, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'getProcessList', name: t('searchOrder.processFlows'), prefixIcon: 'vxe-icon-file-txt', visible: true} |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | //表头参数 |
| | | columns:[ |
| | | {type:'expand',slots: { content:'content' },width: 50,fixed:"left",}, |
| | | {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left",}, |
| | |
| | | //{field: '14',width:120, title: '备注',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'deliveryAddress',width:120, title: t('order.deliveryAddress'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | |
| | | ],//表头按钮 |
| | | ], |
| | | |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | |
| | |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'checkList': { |
| | | if($grid.getCheckboxRecords().length==0){ |
| | | if($grid.getCheckboxRecords().length===0){ |
| | | VXETable.modal.message( t('searchOrder.msg')) |
| | | return |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | case 'getProcessList': { |
| | | if(rowClickIndex.value===null){ |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | | return |
| | | } |
| | | dialogTableVisible.value = true |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | cellClick({ row }){ |
| | | rowClickIndex.value = row |
| | | } |
| | | } |
| | | const dialogTableVisible = ref(false) |
| | | let orderType = ref("2") |
| | | let selectDate = ref(["",""]) |
| | | let filterData = ref({}) |
| | | let orderList = ref([]) |
| | | let pageNum=ref(1) |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | |
| | | //加载请求 |
| | | request.post(`/order/getOrderList/1/${total.pageSize}/${orderType.value}/${selectDate.value}`,filterData).then((res) => { |
| | | if(res.code==200){ |
| | |
| | | } |
| | | |
| | | //双击表格行 |
| | | const cellClickEvent =()=>{ |
| | | dialogTableVisible.value = true |
| | | } |
| | | |
| | | const selectOrderList = ()=>{ |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.pageSize}/${orderType.value}/${selectDate.value}` |
| | | ,filterData).then((res) => { |
| | |
| | | <el-button @click="changeDate" style="margin-top: -5px" id="searchButton" type="primary" :icon="Search">{{ $t('basicData.search') }}</el-button> |
| | | <vxe-grid |
| | | @filter-change="filterChanged" |
| | | @cell-dblclick="cellClickEvent" |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | |
| | | > |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | </template> |
| | | </vxe-grid> |
| | | |
| | | <el-dialog v-model="dialogTableVisible" title="流程卡进度" style="width: 80%;height:75% "> |
| | | <ProcessCardProgress style="width: 100%;height: 100%" /> |
| | | <el-dialog |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | | :title="$t('searchOrder.processFlows')" |
| | | style="width: 80%;height:75% "> |
| | | <ProcessCardProgress |
| | | :orderId="rowClickIndex.orderId" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="生产报表controller",tags={"生产报表操作接口"}) |
| | | @RequestMapping("/report") |
| | | public class ReportController { |
| | | @Autowired |
| | | ReportService reportService; |
| | | private final ReportService reportService; |
| | | |
| | | public ReportController(ReportService reportService) { |
| | | this.reportService = reportService; |
| | | } |
| | | |
| | | //流程卡进度 |
| | | @ApiOperation("流程卡进度") |
| | | @PostMapping ("/processCardProgress/{orderId}") |
| | | public Result processCardProgress( |
| | | @PathVariable String orderId, |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(reportService.processCardProgressSv(orderId,flowCard)); |
| | | public Result processCardProgress(@PathVariable String orderId, @RequestBody List<Integer> columns){ |
| | | return Result.seccess(reportService.processCardProgressSv(orderId,columns)); |
| | | } |
| | | |
| | | } |
| | |
| | | @Mapper |
| | | public interface ReportMapper { |
| | | |
| | | List<Map<String, String>> processCardProgressMp(String orderId, FlowCard flowCard); |
| | | List<Map<String, String>> processCardProgressMp(String orderId); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @DS("sd") |
| | |
| | | boolean insertOrderProcessDetail(@Param("processDetailList") List<OrderProcessDetail> processDetailList); |
| | | |
| | | void updateQuantity(String reportingWorkId,String process,String type); |
| | | |
| | | List<Map<String,String>> filterOrderProcess(String orderId); |
| | | |
| | | List<Map<String,Integer>> getGlassLRow(String orderId); |
| | | } |
| | |
| | | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.mapper.pp.ReportMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | @DS("pp") |
| | | public class ReportService { |
| | | @Autowired |
| | | ReportMapper reportMapper; |
| | | private final ReportMapper reportMapper; |
| | | |
| | | private final OrderProcessDetailMapper orderProcessDetailMapper; |
| | | |
| | | public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper) { |
| | | this.reportMapper = reportMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> processCardProgressSv(String orderId, FlowCard flowCard) { |
| | | public Map<String, Object> processCardProgressSv(String orderId, List<Integer> columns) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.processCardProgressMp(orderId, flowCard)); |
| | | map.put("data", reportMapper.processCardProgressMp(orderId)); |
| | | map.put("title", orderProcessDetailMapper.filterOrderProcess(orderId)); |
| | | List<Map<String,Integer>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId); |
| | | List<Map<String,Integer>> rowCount = new ArrayList<>(); |
| | | columns.forEach(col ->{ |
| | | getRowCount.forEach(row ->{ |
| | | Map<String,Integer> getRow = new HashMap<>(); |
| | | // { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | getRow.put("row",row.get("RowNum")); |
| | | getRow.put("col",col); |
| | | getRow.put("rowspan",row.get("rowCount")); |
| | | getRow.put("colspan",0); |
| | | rowCount.add(getRow); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | map.put("mergeCells",rowCount); |
| | | |
| | | return map; |
| | | } |
| | | } |
| | |
| | | |
| | | <!-- 流程卡进度--> |
| | | <select id="processCardProgressMp"> |
| | | select |
| | | a.product_name, |
| | | b.glass_child, |
| | | d.order_type, |
| | | concat(c.process_id,'/',c.technology_number) as process_id, |
| | | c.technology_number, |
| | | c.quantity, |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityCount, |
| | | e.broken_num, |
| | | round(ifnull(f.inventory,0)*a.area,2) as inventoryArea |
| | | |
| | | from |
| | | flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join ( |
| | | SELECT process_id, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num,"\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num_count,"\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | where a.order_id=#{orderId} |
| | | GROUP BY process_id,a.technology_number |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | |
| | | where a.order_id = #{orderId} |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | </update> |
| | | |
| | | <!--查询筛选后唯一的流程卡号--> |
| | | <select id="filterOrderProcess"> |
| | | select process |
| | | from order_process_detail |
| | | where order_id = #{orderId} |
| | | group by process |
| | | |
| | | </select> |
| | | <select id="getGlassLRow"> |
| | | select |
| | | max(a.technology_number) as rowCount, |
| | | RowNum |
| | | from order_process_detail as a |
| | | left join |
| | | (select min((@i:=@i+1)) AS RowNum,c.* |
| | | from sd.order_glass_detail as c, |
| | | (SELECT @i:=-1) as d |
| | | where order_id = #{orderId} |
| | | GROUP BY order_number |
| | | ) as b |
| | | on b.order_number = a.order_number |
| | | where a.order_id = #{orderId} |
| | | group by a.order_number |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | </update> |
| | | |
| | | <!--查询筛选后唯一的流程卡号--> |
| | | <select id="filterOrderProcess"> |
| | | select process |
| | | from order_process_detail |
| | | where order_id = #{orderId} |
| | | group by process |
| | | |
| | | </select> |
| | | <select id="getGlassLRow"> |
| | | select |
| | | max(a.technology_number) as rowCount, |
| | | RowNum |
| | | from order_process_detail as a |
| | | left join |
| | | (select min((@i:=@i+1)) AS RowNum,c.* |
| | | from sd.order_glass_detail as c, |
| | | (SELECT @i:=-1) as d |
| | | where order_id = #{orderId} |
| | | GROUP BY order_number |
| | | ) as b |
| | | on b.order_number = a.order_number |
| | | where a.order_id = #{orderId} |
| | | group by a.order_number |
| | | |
| | | </select> |
| | | |
| | | </mapper> |