添加流程卡打印数量可编辑,订单一键排序功能,修改编号显示不正确问题
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 footSum from "@/hook/footSum" |
| | | 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 useUserInfoStore from '@/stores/userInfo' |
| | | import {useI18n} from "vue-i18n"; |
| | | import {filterChanged} from "@/hook"; |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove" |
| | | import domZindex from 'dom-zindex' |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | let selectRecords = ref(null) |
| | | let router = useRouter() |
| | | let props = defineProps({ |
| | | orderId:null, |
| | | }) |
| | | domZindex.setCurrent(3000) |
| | | |
| | | //定义数据返回结果 |
| | | let produceDetailList = ref([]) |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | | project: '' |
| | | }, |
| | | orderDetail: { |
| | | productId: '', |
| | | productName: '', |
| | | computeGrossArea: '', |
| | | processingNote: '', |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const {currentRoute} = useRouter() |
| | | const route = currentRoute.value |
| | | |
| | | onMounted(() => { |
| | | //启用表格拖动选中 |
| | | addListener(xGridDetail.value, detailGridOptions) |
| | | |
| | | }) |
| | | |
| | | //第一次加载数据 |
| | | request.post(`/processCard/printFlowCardOrderSort/${props.orderId}`,filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | produceDetailList.value = (res.data.data) |
| | | xGridDetail.value.reloadData(produceDetailList.value) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGridDetail = ref() |
| | | const detailGridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'printFlowCard_2', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollX: {enabled: true}, |
| | | scrollY: {enabled: true, gt: 0},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | mouseConfig:{selected: true},//鼠标选中 |
| | | keyboardConfig:{ |
| | | isArrow: true, |
| | | isDel: true, |
| | | isEnter: true, |
| | | isTab: true, |
| | | isEdit: true, |
| | | isChecked: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'dblclick', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | //右键菜单 |
| | | menuConfig: { |
| | | className: 'my-menus', |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { |
| | | code: 'copyChecked', |
| | | name: t('basicData.selectSame'), |
| | | prefixIcon: 'vxe-icon-copy', |
| | | visible: true, |
| | | disabled: false |
| | | }, |
| | | { |
| | | code: 'copyAll', |
| | | name: t('basicData.sameAfterwards'), |
| | | prefixIcon: 'vxe-icon-feedback', |
| | | visible: true, |
| | | disabled: false |
| | | }, |
| | | { |
| | | code: 'clearChecked', |
| | | name: t('basicData.clearSelection'), |
| | | prefixIcon: 'vxe-icon-indicator', |
| | | visible: true, |
| | | disabled: false |
| | | }, |
| | | { |
| | | code: 'addAutomatically', |
| | | name: t('processCard.addAutomatically'), |
| | | prefixIcon: 'vxe-icon-indicator', |
| | | visible: true, |
| | | disabled: false |
| | | }, |
| | | { |
| | | code: 'selectFill', |
| | | name: t('processCard.selectFill'), |
| | | prefixIcon: 'vxe-icon-indicator', |
| | | visible: true, |
| | | disabled: false |
| | | }, |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | { |
| | | field: 'sort', |
| | | width: 80, |
| | | editRender: {name: 'input', attrs: {placeholder: ''}}, |
| | | title: t('processCard.sorting'), |
| | | }, |
| | | { |
| | | field: 'process_id', |
| | | title: t('processCard.processId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'order_number', |
| | | title: t('order.OrderNum'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'technology_number', |
| | | title: t('processCard.technologyNumber'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'glass_address', |
| | | title: t('processCard.glassAddress'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | title: t('order.quantity'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'child_width', |
| | | title: t('order.width'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged, |
| | | sortable: true, |
| | | }, |
| | | { |
| | | field: 'child_height', |
| | | title: t('order.height'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged, |
| | | sortable: true, |
| | | }, |
| | | { |
| | | field: 'area', |
| | | title: t('order.area'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | |
| | | ], |
| | | //表单验证 |
| | | editRules: { |
| | | sort: [ |
| | | //type: 'number', min: 0, message: '请输入大于等于0的数值' , |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^[1-9]\d*$/ |
| | | if (!regex.test(cellValue)) { |
| | | return new Error(t('basicData.msg.greater0')) |
| | | |
| | | } |
| | | }} |
| | | ], |
| | | }, |
| | | |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'sort', name: t('basicData.save'), status: 'primary'}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | | //print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: null,//表格数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | const List = ["quantity",'area',] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | }) |
| | | const gridEventsDetail = { |
| | | toolbarButtonClick ({ code}) { |
| | | const $grid = xGridDetail.value |
| | | selectRecords = $grid.getCheckboxRecords() |
| | | selectRecords.forEach(obj => { |
| | | delete obj.print_status; |
| | | }); |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'sort': { |
| | | const $table = xGridDetail.value |
| | | let data = $table.getTableData().fullData |
| | | let flowCardData = ref({ |
| | | flowCard: data, |
| | | }) |
| | | for (let i = 0; i < flowCardData.value.flowCard.length; i++) { |
| | | const regex = /^[1-9]\d*$/ |
| | | if (!regex.test(flowCardData.value.flowCard[i].sort)) { |
| | | ElMessage.warning(t('basicData.msg.greater0')) |
| | | return; // 如果有一个不是整数 |
| | | } |
| | | } |
| | | request.post("/processCard/printOrderSort", flowCardData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success(t('processCard.sortingSuccessful')) |
| | | router.push({ |
| | | path: '/main/processCard/PrintFlowCard', |
| | | query: {orderId: orderId,random: Math.random()} |
| | | }) |
| | | |
| | | //location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | menuClick({menu, row, column}) { |
| | | const $grids = xGridDetail.value |
| | | if ($grids) { |
| | | switch (menu.code) { |
| | | case 'copyChecked' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort"){ |
| | | if (result) { |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | const val = dataList[result.start][result.cell] |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | | item[result.cell] = val |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | break |
| | | } |
| | | case 'copyAll' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort" ) { |
| | | if (result) { |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | const val = dataList[result.start][result.cell] |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start) { |
| | | item[result.cell] = val |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | break |
| | | } |
| | | case 'clearChecked' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort" ) { |
| | | if (result) { |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | | item[result.cell] = '' |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | break |
| | | } |
| | | case 'addAutomatically' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort" ) { |
| | | if (result) { |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | let val = 1 |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | | item[result.cell] = val |
| | | val=val*1+1 |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | break |
| | | } |
| | | case 'selectFill' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort" ) { |
| | | if (result) { |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | let val = dataList[result.start][result.cell] |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | | item[result.cell] = val |
| | | val=val*1+1 |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer" style="width: 100%;height: 100%"> |
| | | |
| | | <vxe-grid |
| | | ref="xGridDetail" |
| | | class="mytable-scrollbar" |
| | | height="100%" |
| | | size="small" |
| | | v-bind="detailGridOptions" |
| | | v-on="gridEventsDetail"> |
| | | |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in detailGridOptions.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 type="text" |
| | | v-model="option.data" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | #selectForm { |
| | | width: 40%; |
| | | text-align: center; |
| | | } |
| | | |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | :deep(.my-menus) { |
| | | z-index: 9999 !important; |
| | | } |
| | | </style> |
| | |
| | | request.post(`/processCard/getSelectPrinting`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | produceList.value = deepClone(res.data.data) |
| | | //处理单片厚度 |
| | | |
| | | for (let j = 0; j < produceList.value.length; j++) { |
| | | let sumWeight = 0 |
| | | produceList.value[j].detailList.forEach((item, index) => { |
| | | // 解析 separation 字段的 JSON 字符串 |
| | | let separationObj = JSON.parse(item.separation); |
| | | |
| | | // 获取 thickness 的原始值 |
| | | let thicknessValue = separationObj.thickness; |
| | | |
| | | // 去除 'mm' 单位 |
| | | let thicknessWithoutUnit = thicknessValue.replace('mm', ''); |
| | | |
| | | item.separation=thicknessWithoutUnit |
| | | |
| | | sumWeight += item.width*item.height*item.quantity/1000000*item.separation*2.5*1; |
| | | |
| | | }); |
| | | produceList.value[j].detail[0].weight=sumWeight |
| | | } |
| | | //处理合并打印 |
| | | if (printMerge !== null && printMerge !== undefined && printMerge !== "") { |
| | | |
| | |
| | | |
| | | //根据输入的数量重新汇总 |
| | | const handleSummary = () => { |
| | | console.log(produceList.value) |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | //数量 |
| | | let totalQuantity = 0; |
| | |
| | | let totalWeight = 0; |
| | | // 对每个集合中的 detailList 进行计算 |
| | | produceList.value[i].detailList.forEach(collection => { |
| | | // 使用 reduce 方法计算每个 detailList 中的总数量 |
| | | totalQuantity += collection.quantity*1; |
| | | totalArea += collection.area*1; |
| | | //每个序号面积 |
| | | collection.total_area=parseFloat((collection.width*collection.height*collection.quantity/1000000).toFixed(2)) |
| | | totalArea += collection.total_area*1; |
| | | totalWeight += collection.width*collection.height*collection.quantity/1000000*collection.separation*2.5*1; |
| | | //每个序号周长 |
| | | collection.perimeter= (collection.width*2+collection.height*2)*collection.quantity/1000 |
| | | }); |
| | | // 输出每个集合中的总数量 |
| | | console.log(`produceList.value[${i}] 中的总数量:`, totalQuantity); |
| | | produceList.value[i].detail[0].quantity=totalQuantity |
| | | produceList.value[i].detail[0].gross_area=totalArea |
| | | produceList.value[i].detail[0].weight=totalWeight |
| | | } |
| | | } |
| | | |
| | | // 监听打印完成事件 |
| | | window.addEventListener('afterprint', function() { |
| | | //修改打印 |
| | | let printState=1 |
| | | request.post(`/processCard/updatePrintState/${printState}`, data.value).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | } else { |
| | | |
| | | ElMessage.warning(t('basicData.msg.saveFail')) |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <thead> |
| | | <tr v-for="(itemFlow,index) in item.detail" :key="index"> |
| | | <td colspan="24"> |
| | | <div style="float: left;"><input style="border: none;font-size: 28px;width: 40px "/></div> |
| | | <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> |
| | | <div>{{company.companyName}}</div> |
| | | <div>生产流程卡</div> |
| | |
| | | isChecked: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | trigger: 'dblclick', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort" ) { |
| | | if (result) { |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | let val = 1 |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "sort" ) { |
| | | if (result) { |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | const dataList = xGridDetail.value.getTableData().visibleData |
| | | let val = dataList[result.start][result.cell] |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | |
| | | halfProductLabel:'半品标签', |
| | | pleaseSelectCustomPrintLabelStyle:'请选择自定义打印标签样式', |
| | | mergePrinting:'合并打印', |
| | | printStatus:'打印状态', |
| | | printStatus:'打印次数', |
| | | labelPrinting2:'标签打印2', |
| | | addAutomatically:'自动填充', |
| | | selectFill:'选中填充' |
| | |
| | | const printVisible= ref(false) |
| | | let selectRecords = ref(null) |
| | | |
| | | const selectRecordsData = ref({ |
| | | printList: [] |
| | | }) |
| | | |
| | | const xGrid = ref(null) |
| | | const xGridDetail =ref(null) |
| | | |
| | |
| | | list:null, |
| | | printMergeVal:null |
| | | }) |
| | | |
| | | |
| | | |
| | | const getTableRow = (row,type) => { |
| | | switch (type) { |
| | |
| | | if (res.code == 200) { |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.dataType = res.data.type |
| | | produceList.forEach(item => { |
| | | if(item.print_status == 1){ |
| | | item.print_status='已打印' |
| | | } |
| | | else if (item.print_status == 0){ |
| | | item.print_status='未打印' |
| | | } |
| | | }); |
| | | // produceList.forEach(item => { |
| | | // if(item.print_status == 1){ |
| | | // item.print_status='已打印' |
| | | // } |
| | | // else if (item.print_status == 0){ |
| | | // item.print_status='未打印' |
| | | // } |
| | | // }); |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | hideButton() |
| | |
| | | toolbarButtonClick ({ code}) { |
| | | const $grid = xGrid.value |
| | | selectRecords = $grid.getCheckboxRecords() |
| | | selectRecords.forEach(obj => { |
| | | delete obj.print_status; |
| | | }); |
| | | // selectRecords.forEach(obj => { |
| | | // delete obj.print_status; |
| | | // }); |
| | | let type=printType.value |
| | | let faceOrientation=stateValue.value |
| | | let lableTypes=lableType.value |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 监听打印完成事件 |
| | | const printNumber = () =>{ |
| | | |
| | | selectRecordsData.value.printList=selectRecords |
| | | let printState=0 |
| | | request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | } else { |
| | | |
| | | ElMessage.warning(t('basicData.msg.saveFail')) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | destroy-on-close |
| | | style="width: 75%;height:75% "> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-button v-print="printContent" :icon="Printer" circle /> |
| | | <el-button v-print="printContent" @click="printNumber" :icon="Printer" circle /> |
| | | </template> |
| | | <print-process id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal" |
| | | style="width: 100%;height: 100%" /> |
| | |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import footSum from "@/hook/footSum" |
| | | import TagStyle from "@/components/pp/TagStyle.vue" |
| | | import OrderSortDetail from '@/components/pp/OrderSortDetail.vue' |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | |
| | | let router = useRouter() |
| | | const printVisible= ref(false) |
| | | |
| | | |
| | | //排序 |
| | | let editRow = ref({ |
| | | orderId:null, |
| | | }) |
| | | |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | router.push({path: '/main/processCard/PrintFlowCard', query: { orderId: row.order_id }}) |
| | | break |
| | | } |
| | | case 'sort' :{ |
| | | editRow.value.orderId = row.order_id |
| | | printVisible.value = true |
| | | break |
| | | } |
| | | } |
| | |
| | | }, |
| | | |
| | | editConfig: { |
| | | trigger: 'click', |
| | | trigger: 'dblclick', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | //表头参数 |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {title: t('basicData.operate'), width: 80, slots: { default: 'button_slot' },fixed:"left"}, |
| | | {title: t('basicData.operate'), width: 100, slots: { default: 'button_slot' },fixed:"left"}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | { |
| | | field: 'order_id', |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button> |
| | | <el-button @click="getTableRow(row,'sort')" link type="primary" size="small">{{$t('processCard.sorting')}}</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | |
| | | v-model="titleStyleVisible"> |
| | | <tag-style style="width: 100%;height: 100%"/> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | id="sizeCheck" |
| | | v-model="printVisible" |
| | | :title="$t('processCard.processCardDetails')" |
| | | destroy-on-close |
| | | style="width: 80%;height:75% "> |
| | | <order-sort-detail id="child" :orderId="editRow.orderId" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | width: 100%; |
| | | } |
| | | |
| | | :deep(#sizeCheck .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | |
| | | </style> |
| | |
| | | layer= res.data.layer |
| | | |
| | | const s01Values = []; |
| | | // 遍历 res.data.numberList 数组,获取每个元素的 S01 值并存储到 s01Values 数组中 |
| | | res.data.numberList.forEach(element => { |
| | | try { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | if (s01Value) { |
| | | s01Values.push(s01Value); |
| | | } else { |
| | | // 如果 S01 值为空,可以选择添加默认值或者忽略这个元素 |
| | | s01Values.push(''); // 例如添加空字符串 |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error parsing JSON or accessing S01 value:', error); |
| | | // 处理 JSON 解析错误或其他异常情况 |
| | | for (let i = 0; i < res.data.reportingWorkDetails.length; i++) { |
| | | const s01Values = []; |
| | | // 遍历 detailList 数组,提取 S01 值到 s01Values 数组 |
| | | if (res.data.reportingWorkDetails[i].other_columns!=null|| res.data.reportingWorkDetails[i].other_columns!=undefined){ |
| | | res.data.reportingWorkDetails.forEach(element => { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | s01Values.push(s01Value || ''); // 如果 S01 值为空,添加空字符串或者其他默认值 |
| | | }); |
| | | |
| | | // 将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | res.data.reportingWorkDetails.forEach((detail, index) => { |
| | | detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 赋值给 s01Value 属性 |
| | | }); |
| | | } |
| | | }); |
| | | // 遍历 res.data.Detail 数组,将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | res.data.reportingWorkDetails.forEach((detail, index) => { |
| | | if (index < s01Values.length) { |
| | | detail.s01Value = s01Values[index]; // 添加一个名为 s01Value 的新属性,存储对应的 S01 值 |
| | | } else { |
| | | detail.s01Value = ''; // 如果 s01Values 中的值不足,可以添加默认值或者不进行赋值处理 |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | //titleUploadData.value.processId=titleUploadData.value.processId+'/'+layer |
| | | xGrid.value.reloadData(res.data.reportingWorkDetails) |
| | | let button = { |
| | |
| | | titleUploadData.value.classes=t('reportingWorks.early') |
| | | titleUploadData.value.reportingWorkTime = formatCurrentTime() |
| | | |
| | | // 声明一个空数组,用于存储每个订单的 S01 值 |
| | | //处理编号列 |
| | | //定义存放编号数组 |
| | | const s01Values = []; |
| | | for (let i = 0; i < res.data.Detail.length; i++) { |
| | | const s01Values = []; |
| | | // 遍历 detailList 数组,提取 S01 值到 s01Values 数组 |
| | | if (res.data.Detail[i].other_columns!=null|| res.data.Detail[i].other_columns!=undefined){ |
| | | res.data.Detail.forEach(element => { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | s01Values.push(s01Value || ''); // 如果 S01 值为空,添加空字符串或者其他默认值 |
| | | }); |
| | | |
| | | // 遍历 res.data.numberList 数组,获取每个元素的 S01 值并存储到 s01Values 数组中 |
| | | res.data.numberList.forEach(element => { |
| | | try { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | if (s01Value) { |
| | | s01Values.push(s01Value); |
| | | } else { |
| | | // 如果 S01 值为空,可以选择添加默认值或者忽略这个元素 |
| | | s01Values.push(''); // 例如添加空字符串 |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error parsing JSON or accessing S01 value:', error); |
| | | // 处理 JSON 解析错误或其他异常情况 |
| | | // 将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | res.data.Detail.forEach((detail, index) => { |
| | | detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 赋值给 s01Value 属性 |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 遍历 res.data.Detail 数组,将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | res.data.Detail.forEach((detail, index) => { |
| | | if (index < s01Values.length) { |
| | | detail.s01Value = s01Values[index]; // 添加一个名为 s01Value 的新属性,存储对应的 S01 值 |
| | | } else { |
| | | detail.s01Value = ''; // 如果 s01Values 中的值不足,可以添加默认值或者不进行赋值处理 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | //绑定下方表格 |
| | |
| | | |
| | | return Result.seccess(flowCardService.updatePrintStateSv(printState,object)); |
| | | } |
| | | |
| | | @ApiOperation("流程卡打印订单数据排序查询接口") |
| | | @PostMapping("/printFlowCardOrderSort/{orderId}") |
| | | public Result printFlowCardOrderSort(@PathVariable String orderId, |
| | | @RequestBody FlowCard flowCard) { |
| | | return Result.seccess(flowCardService.printFlowCardOrderSortSv(orderId, flowCard)); |
| | | } |
| | | |
| | | @ApiOperation("保存打印订单排序接口") |
| | | @PostMapping("/printOrderSort") |
| | | public Result printOrderSort(@RequestBody Map<String, Object> object) { |
| | | if (flowCardService.printOrderSort(object)) { |
| | | return Result.seccess(); |
| | | } else { |
| | | throw new ServiceException(Constants.Code_500, "保存失败"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Map<String, Object>> getGlassNumber(Integer technologyNumber, String processId); |
| | | |
| | | Boolean updatePrintStateMp(Integer printState, String processId, Integer technologyNumber); |
| | | |
| | | List<Map<String, String>> printFlowCardOrderSortMp(String orderId, FlowCard flowCard); |
| | | |
| | | Boolean printOrderSortMp(String processId, Integer orderNumber, Integer technologyNumber, Integer sort); |
| | | } |
| | |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | //流程卡表头表尾数据 |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | |
| | | |
| | | //流程卡明细数据 |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | // List<Map<String, Object>> numberList = flowCardMapper.getGlassNumber(flowCard.getTechnologyNumber(),flowCard.getProcessId()); |
| | | //工艺流程 |
| | | List<Map<String, Object>> processList = flowCardMapper.getProcessList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | itemmap.put("detailList", detailList); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> printFlowCardOrderSortSv(String orderId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.printFlowCardOrderSortMp(orderId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean printOrderSort(Map<String, Object> object) { |
| | | List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class); |
| | | if (!FlowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : FlowCardList) { |
| | | flowCardMapper.printOrderSortMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getTechnologyNumber(),flowCard.getSort()); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(od.processing_note,od.remarks) as remarks, |
| | | od.other_columns |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.product_detail as pd on pd.prod_id=od.product_id and pd.glass_sort=ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and fc.technology_number = #{technologyNumber} |
| | | group by fc.process_id, fc.order_number |
| | |
| | | |
| | | <update id="updatePrintStateMp"> |
| | | update pp.flow_card |
| | | set print_status = #{printState} |
| | | set print_status = print_status+1 |
| | | where process_id = #{processId} and technology_number = #{technologyNumber} |
| | | </update> |
| | | |
| | | <select id="printFlowCardOrderSortMp"> |
| | | SELECT fc.process_id, |
| | | fc.order_number, |
| | | fc.technology_number, |
| | | ogd.glass_address, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | fc.quantity, |
| | | ROUND(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area, |
| | | fc.sort |
| | | FROM flow_card AS fc |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON fc.order_id = ogd.order_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | where fc.order_id=#{orderId} |
| | | order by IF(fc.sort != NULL || fc.sort != '', fc.sort, fc.technology_number) |
| | | </select> |
| | | |
| | | <update id="printOrderSortMp"> |
| | | update flow_card |
| | | set sort = #{sort} |
| | | where process_id = #{processId} |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | </update> |
| | | </mapper> |
| | |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num as completedQuantity, |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | od.other_columns |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group`, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | od.other_columns |
| | | |
| | | FROM |
| | | sd.order_detail AS od |
| | |
| | | ifnull(a.breakage_quantity,0) as 'breakageQuantity', -- 破损数 |
| | | ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 本工序完工和 |
| | | if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag, |
| | | e.other_columns, |
| | | <if test="nextProcess != null and nextProcess != ''"> -- 非最后一道工序 |
| | | ifnull(g.completed_quantity,0) as nextQuantitySum, -- 后工序已完成 |
| | | if((f.completed_quantity |