New file |
| | |
| | | <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/sd/product/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import {toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import footSum from "@/hook/footSum" |
| | | import userInfo from "@/stores/userInfo" |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo" |
| | | import {changeFilterEvent} from "@/hook"; |
| | | |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | const user=userInfo() |
| | | const orderInfo = useOrderInfoStore() |
| | | |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | let router = useRouter() |
| | | |
| | | |
| | | let props = defineProps({ |
| | | printList: null, |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const data = ref({ |
| | | printList: [] |
| | | }) |
| | | |
| | | |
| | | data.value.printList = JSON.parse(props.printList) |
| | | //第一次加载数据 |
| | | request.post(`/processCard/flowCardDetail`, data.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | let newDataCollection = []; |
| | | for (let i = 0; i < res.data.data.length; i++) { |
| | | res.data.data[i].detail.forEach((item) => { |
| | | newDataCollection.push(item); |
| | | }) |
| | | } |
| | | xGrid.value.reloadData(newDataCollection) |
| | | 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({ |
| | | loading: true, |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'SelectProcessCard', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | {field: 'order_id', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110}, |
| | | {field: 'customer_name', title: t('processCard.customerName'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110}, |
| | | { |
| | | field: 'process_id', |
| | | width: 140, |
| | | title: t('processCard.processId'), |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | {field: 'rack',width:100, title: t('架号'), editRender: {name: 'input', attrs: {placeholder: ''}}, slots: {filter: 'num1_filter'}}, |
| | | {field: 'technology_number', title: t('processCard.technologyNumber'),}, |
| | | { |
| | | field: 'product_id', |
| | | title: t('order.productId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | }, |
| | | { |
| | | field: 'product_name', |
| | | title: t('order.product'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | width: 180 |
| | | }, |
| | | {field: 'project', title: t('order.project'), showOverflow: "ellipsis"}, |
| | | {field: 'quantity', title: t('order.quantity'),}, |
| | | {field: 'compute_gross_area', title: t('order.area'),}, |
| | | {field: 'processing_note', title: t('order.processingNote'),}, |
| | | |
| | | {field: 'merge',width:100, title: t('processCard.mergeState'), filters: [{data: ''}], slots: {filter: 'num1_filter'}} |
| | | |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'update', name: t('合架'), status: 'primary'}, |
| | | ], |
| | | |
| | | }, |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | |
| | | |
| | | }) |
| | | |
| | | |
| | | //表格按钮 |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'update': { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning(t('processCard.pleaseCheckTheRequiredData')) |
| | | return; |
| | | } |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | console.log(selectRecords[i]) |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | return; |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | ref="xGrid" |
| | | :checkbox-config="checkBoxConfig" |
| | | class="mytable-scrollbar" |
| | | height="100%" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input v-model="option.data" |
| | | type="text" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .head{ |
| | | width: 100%; |
| | | height: 35px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: 600px; |
| | | } |
| | | </style> |
| | |
| | | import footSum from "@/hook/footSum" |
| | | import userInfo from "@/stores/userInfo" |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo" |
| | | import {Printer} from "@element-plus/icons-vue/global"; |
| | | import SelectProcessCardDetail from "@/components/pp/SelectProcessCardDetail.vue"; |
| | | |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | |
| | | const orderInfo = useOrderInfoStore() |
| | | |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | const dialogTableVisible = ref(false) |
| | | let router = useRouter() |
| | | let props = defineProps({ |
| | | rowIndex: {} |
| | | }) |
| | | let printRow = ref({ |
| | | list: null, |
| | | }) |
| | | const getTableRow = (row, type) => { |
| | | let startTime = form.date1[0] |
| | |
| | | } |
| | | }) |
| | | |
| | | break |
| | | } |
| | | case 'rack' : { |
| | | dialogTableVisible.value = true |
| | | break |
| | | } |
| | | } |
| | |
| | | {field: 'orderDetail.processingNote', title: t('order.processingNote'),}, |
| | | |
| | | {field: 'layoutStatus',width:100, title: t('processCard.layoutStatus'), filters: [{data: ''}], slots: {filter: 'select_filter'}}, |
| | | {field: 'merge',width:100, title: t('processCard.mergeState'), filters: [{data: ''}], slots: {filter: 'num1_filter'}} |
| | | {field: 'merge',width:100, title: t('processCard.mergeState'), filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'rack',width:100, title: t('架号'), filters: [{data: ''}], slots: {filter: 'num1_filter'}} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'update', name: t('processCard.composing'), status: 'primary'}, |
| | | {code: 'delete', name: t('basicData.delete'), status: 'primary'}, |
| | | {code: 'rack', name: t('合架'), status: 'primary'}, |
| | | ], |
| | | import: false, |
| | | // export: true, |
| | |
| | | |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | |
| | | } |
| | | case 'rack': { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning(t('processCard.pleaseCheckTheRequiredData')) |
| | | return; |
| | | } |
| | | let id = "" |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | printRow.value.list = JSON.stringify(selectRecords) |
| | | dialogTableVisible.value = true |
| | | |
| | | } |
| | | return; |
| | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | id="sizePrintCalrd" |
| | | v-model="dialogTableVisible" |
| | | :title="$t('流程卡合架')" |
| | | destroy-on-close |
| | | style="width: 75%;height:75% "> |
| | | <select-process-card-detail |
| | | id="child" |
| | | :printList="printRow.list" |
| | | style="width: 100%;height: 100%"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | public Result updateProjectProcessPrintCount(@PathVariable String projectNo){ |
| | | return Result.seccess(flowCardService.updateProjectProcessPrintCount(projectNo)); |
| | | } |
| | | |
| | | @ApiOperation("流程卡合架") |
| | | @PostMapping("/flowCardDetail") |
| | | public Result flowCardDetail( |
| | | @RequestBody Map<String, Object> object) { |
| | | return Result.seccess(flowCardService.flowCardDetail(object)); |
| | | } |
| | | } |
| | |
| | | private LocalDate splitFrameTime; |
| | | //排序 |
| | | private Integer sort; |
| | | //架号 |
| | | private String rack; |
| | | //建立时间 |
| | | private LocalDate createTime; |
| | | //修改时间 |
| | |
| | | Integer selectProjectProcessPrintCount(String projectNo); |
| | | |
| | | int flowCardToOptimizeCount(String orderId); |
| | | |
| | | List<Map<String, Object>> getFlowCardDetail(String processId); |
| | | } |
| | |
| | | flowCardMapper.updateProjectProcessPrintCount(projectNo); |
| | | return flowCardMapper.selectProjectProcessPrintCount(projectNo); |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> flowCardDetail(Map<String, Object> object) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("detail", flowCardMapper.getFlowCardDetail(flowCard.getProcessId())); |
| | | list.add(itemmap); |
| | | |
| | | } |
| | | } |
| | | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="layout_status" property="layoutStatus"/> |
| | | <result column="merge" property="merge"/> |
| | | <result column="rack" property="rack"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | |
| | | c.processing_note, |
| | | b.customer_name, |
| | | if(a.layout_status=0,'不可排版',if(a.layout_status=1,'可排版','已排版')) as layout_status, |
| | | a.merge |
| | | from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge from flow_card |
| | | a.merge, |
| | | a.rack |
| | | from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge,rack from flow_card |
| | | group by process_Id,order_number) as a |
| | | left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | |
| | | </if> |
| | | <if test="flowCard.merge != null"> |
| | | and a.merge regexp #{flowCard.merge} |
| | | </if> |
| | | <if test="flowCard.rack != null and flowCard.rack != ''"> |
| | | and a.rack regexp #{flowCard.rack} |
| | | </if> |
| | | <if test="flowCard.order.customerName != null and flowCard.order.customerName!= ''"> |
| | | and b.customer_name regexp #{flowCard.order.customerName} |
| | |
| | | <select id="flowCardToOptimizeCount"> |
| | | select count(*) from pp.flow_card where order_id = #{orderId} and engineering_occupancy=1 |
| | | </select> |
| | | |
| | | <select id="getFlowCardDetail" > |
| | | select |
| | | a.order_id, |
| | | a.process_id, |
| | | a.technology_number, |
| | | c.product_id, |
| | | c.product_name, |
| | | b.project, |
| | | sum(a.quantity) as quantity, |
| | | sum(c.compute_gross_area) as compute_gross_area, |
| | | a.founder, |
| | | c.processing_note, |
| | | b.customer_name, |
| | | a.merge, |
| | | a.rack |
| | | from pp.flow_card a |
| | | left join sd.`order` as b on a.order_id=b.order_id |
| | | left join sd.order_detail as c on a.order_id=c.order_id and a.order_number=c.order_number |
| | | where |
| | | a.process_id regexp #{processId} |
| | | group by a.process_id,a.technology_number |
| | | |
| | | </select> |
| | | </mapper> |