Merge branch 'master' of http://bore.pub:10439/r/ERP_override
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"; |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | let selectRecords = ref(null) |
| | | let router = useRouter() |
| | | let props = defineProps({ |
| | | processId:null, |
| | | technologyNumber:null |
| | | }) |
| | | |
| | | //定义数据返回结果 |
| | | 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/printFlowCardDetails/${props.processId}/${props.technologyNumber}`,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: 'click', |
| | | 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/printSort", 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 = xGrid.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 = xGrid.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; |
| | | } |
| | | </style> |
| | |
| | | component: () => import('../views/pp/processCard/SelectPrintProject.vue'), |
| | | }, |
| | | { |
| | | path: 'selectSortDetailProcessCard', |
| | | name: 'selectSortDetailProcessCard', |
| | | component: () => import('../components/pp/SelectSortDetailProcessCard.vue'), |
| | | }, |
| | | { |
| | | path: '', |
| | | redirect:'/main/processCard/SelectProcessCard' |
| | | } |
| | |
| | | let technologyNumberMerge = printMerge.split('').join(','); |
| | | console.log(technologyNumberMerge) |
| | | produceList.value[0].detail[0].technologyNumberMerge = technologyNumberMerge |
| | | console.log(produceList.value[0].detail[0]) |
| | | const s01Values = []; |
| | | // 遍历 res.data.numberList 数组,获取每个元素的 S01 值并存储到 s01Values 数组中 |
| | | produceList.value[0].detailList.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 < produceList.value.length; i++) { |
| | | const s01Values = []; |
| | | |
| | | if (produceList.value[i].detailList[0].other_columns!=null |
| | | || produceList.value[i].detailList[0].other_columns!=undefined){ |
| | | produceList.value[i].detailList.forEach(element => { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | s01Values.push(s01Value || ''); // 如果 S01 值为空,添加空字符串或者其他默认值 |
| | | }); |
| | | |
| | | // 将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | produceList.value[i].detailList.forEach((detail, index) => { |
| | | detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 赋值给 s01Value 属性 |
| | | }); |
| | | } |
| | | }); |
| | | // 遍历 res.data.Detail 数组,将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | produceList.value[0].detailList.forEach((detail, index) => { |
| | | if (index < s01Values.length) { |
| | | detail.s01Value = s01Values[index]; // 添加一个名为 s01Value 的新属性,存储对应的 S01 值 |
| | | } else { |
| | | detail.s01Value = ''; // 如果 s01Values 中的值不足,可以添加默认值或者不进行赋值处理 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | import PrintProcess from '@/views/pp/processCard/PrintProcess.vue' |
| | | import PrintLabel from '@/views/pp/processCard/PrintLabel.vue' |
| | | import PrintCustomLabel from '@/views/pp/processCard/PrintCustomLabel.vue' |
| | | import SortDetail from '@/components/pp/SelectSortDetailProcessCard.vue' |
| | | import footSum from "@/hook/footSum" |
| | | import companyInfo from "@/stores/sd/companyInfo" |
| | | |
| | |
| | | const xGrid = ref(null) |
| | | const xGridDetail =ref(null) |
| | | |
| | | let editRow = ref({ |
| | | processId:null, |
| | | technologyNumber:null |
| | | }) |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | const getTableRow = (row,type) => { |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | request.post(`/processCard/printFlowCardDetails/${row.process_id}/${row.technology_number}`,filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | case 'edit' : { |
| | | editRow.value.processId = row.process_id |
| | | editRow.value.technologyNumber = row.technology_number |
| | | printVisible.value = true |
| | | |
| | | produceDetailList.value = (res.data.data) |
| | | printVisible.value=true |
| | | |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }) |
| | | // router.push({path: '/sort-detail', query: {processId: row.process_id,technologyNumber:row.technology_number}}) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | |
| | |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'print': { |
| | | console.log(selectRecords) |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | | return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | 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: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | 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')) |
| | | |
| | | } |
| | | }} |
| | | ], |
| | | }, |
| | | menuConfig: { |
| | | 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 |
| | | }, |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'sort', name: t('processCard.sorting'), 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 = { |
| | | menuClick({menu, row, column}) { |
| | | const $grid = xGridDetail.value |
| | | if ($grid) { |
| | | 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 = xGrid.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 = xGrid.value.getTableData().visibleData |
| | | let val = dataList[result.start][result.cell] |
| | | dataList.forEach((item, index) => { |
| | | if (index >= result.start && index <= result.end) { |
| | | console.log(item) |
| | | item[result.cell] = val |
| | | val=val*1+1 |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | break |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | const openedTable = () => { |
| | | let detail =ref(produceDetailList.value) |
| | | xGridDetail.value.reloadData(detail.value) |
| | |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | @opened="openedTable" |
| | | id="sizeCheck" |
| | | v-model="printVisible" |
| | | :title="$t('processCard.processCardDetails')" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | destroy-on-close |
| | | style="width: 80%;height:75% "> |
| | | <vxe-grid |
| | | ref="xGridDetail" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | height="550px" |
| | | 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> |
| | | <sort-detail id="child" :processId="editRow.processId" :technologyNumber="editRow.technologyNumber" /> |
| | | </el-dialog> |
| | | |
| | | |
| | |
| | | user-select: none; |
| | | } |
| | | |
| | | :deep(#sizeCheck .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | /deep/ .vxe-menu { |
| | | position: absolute; |
| | | z-index: 9999 !important; |
| | | } |
| | | </style> |
| | |
| | | |
| | | request.post(`/processCard/getSelectPrinting`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | produceList.value = deepClone(res.data.data) |
| | | //处理合并打印 |
| | | if (printMerge !== null && printMerge !== undefined && printMerge !== "") { |
| | | |
| | | produceList.value.forEach(item => { |
| | | item.detail[0].technologyNumber = printMerge; |
| | | }); |
| | | |
| | | produceList.value.forEach(item =>{ |
| | | let technologyNumberMerge = printMerge.split('').join(','); |
| | | item.detail[0].technologyNumberMerge = technologyNumberMerge |
| | | }) |
| | | |
| | | //合并打印工艺流程处理 |
| | | let process = produceList.value[0].detail[0].process |
| | | let indexOfJiaJiao = process.indexOf('夹胶'); |
| | | if (indexOfJiaJiao !== -1) { |
| | | // 使用 substring 截取 "夹胶" 后面的部分,包括 "夹胶" 本身 |
| | | let afterJiaJiao = process.substring(indexOfJiaJiao).trim(); |
| | | produceList.value.forEach(item =>{ |
| | | item.detail[0].process = afterJiaJiao |
| | | }) |
| | | } |
| | | |
| | | let indexOfProceList=produceList.value[0].processList |
| | | let getProceList = indexOfProceList.findIndex(item => item.process === '夹胶'); |
| | | |
| | | if (getProceList !== -1) { |
| | | // 使用 filter 方法过滤出 "夹胶" 及其之后的对象 |
| | | produceList.value[0].processList = indexOfProceList.filter((item, index) => index >= getProceList); |
| | | } |
| | | } |
| | | produceList.value.forEach(item =>{ |
| | | let technologyNumberMerge = printMerge.split('').join(','); |
| | | item.detail[0].technologyNumberMerge = technologyNumberMerge |
| | | }) |
| | | |
| | | //处理编号列 |
| | | //定义存放编号数组 |
| | | const s01Values = []; |
| | | // 遍历 res.data.numberList 数组,获取每个元素的 S01 值并存储到 s01Values 数组中 |
| | | produceList.value[0].detailList.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 解析错误或其他异常情况 |
| | | } |
| | | }); |
| | | // 遍历 res.data.Detail 数组,将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | produceList.value[0].detailList.forEach((detail, index) => { |
| | | if (index < s01Values.length) { |
| | | detail.s01Value = s01Values[index]; // 添加一个名为 s01Value 的新属性,存储对应的 S01 值 |
| | | } else { |
| | | detail.s01Value = ''; // 如果 s01Values 中的值不足,可以添加默认值或者不进行赋值处理 |
| | | } |
| | | }); |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | const s01Values = []; |
| | | // 遍历 detailList 数组,提取 S01 值到 s01Values 数组 |
| | | if (produceList.value[i].detailList[0].other_columns!=null |
| | | || produceList.value[i].detailList[0].other_columns!=undefined){ |
| | | produceList.value[i].detailList.forEach(element => { |
| | | const otherColumnsObject = JSON.parse(element.other_columns); |
| | | const s01Value = otherColumnsObject.S01; |
| | | s01Values.push(s01Value || ''); // 如果 S01 值为空,添加空字符串或者其他默认值 |
| | | }); |
| | | |
| | | // 将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 |
| | | produceList.value[i].detailList.forEach((detail, index) => { |
| | | detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 赋值给 s01Value 属性 |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | handleGetQRCode() |
| | |
| | | <td rowspan='2'>半径</td> |
| | | <td rowspan='2'>备注</td> |
| | | <td v-for="(itemPr,index) in item.processList" :key="index" colspan="2">{{ itemPr.process }}</td> |
| | | <!-- <td colspan='2'>切割</td>--> |
| | | <!-- <td colspan='2'>磨边</td>--> |
| | | <!-- <td colspan='2'>钢化</td>--> |
| | | <!-- <td colspan='2'>中空</td>--> |
| | | <!-- <td colspan='2'>包装</td>--> |
| | | <!-- <td colspan='2'></td>--> |
| | | <!-- <td colspan='2'></td>--> |
| | | <!-- <td colspan='2'></td>--> |
| | | </tr> |
| | | <tr> |
| | | |
| | |
| | | <el-text class="customClass"></el-text> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-text>{{$t('order.project')}}:</el-text> |
| | | <el-text >{{$t('order.project')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-text wrap-text="false">{{ titleUploadData.order.project }}</el-text> |
| | | <el-input :readonly="true" v-model="titleUploadData.order.project"/> |
| | | <!-- <el-text style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ titleUploadData.order.project }}</el-text>--> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | //流程卡表头表尾数据 |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | itemmap.put("numberList", flowCardMapper.getGlassNumber(flowCard.getTechnologyNumber(),flowCard.getProcessId())); |
| | | |
| | | |
| | | //流程卡明细数据 |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | List<Map<String, Object>> glassList = flowCardMapper.getGlassNumber(flowCard.getTechnologyNumber(),flowCard.getProcessId()); |
| | | // 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); |
| | | itemmap.put("processList", processList); |
| | | // itemmap.put("numberList", numberList); |
| | | list.add(itemmap); |
| | | |
| | | } |
| | |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(od.processing_note,od.remarks) as remarks |
| | | concat(od.processing_note,od.remarks) as remarks, |
| | | od.other_columns |
| | | 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 |