| 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('processCard.shelfNumber'), 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('processCard.combinedFrame'), status: 'primary'}, |
| | | {code: 'save', name: t('basicData.save'), status: 'primary'}, |
| | | {code: 'clear', name: t('basicData.empty'), status: 'primary'}, |
| | | ], |
| | | |
| | | }, |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | |
| | | |
| | | }) |
| | | const arr=[] |
| | | |
| | | //表格按钮 |
| | | 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; |
| | | } |
| | | let a |
| | | selectRecords.forEach((item) => { |
| | | if(arr.length===0){ |
| | | a='A1' |
| | | item.rack=a |
| | | |
| | | }else{ |
| | | if(item.rack==null){ |
| | | a='A'+(arr.length+1) |
| | | item.rack=a |
| | | } |
| | | } |
| | | }) |
| | | if(!arr.includes(a)){ |
| | | arr.push(a) |
| | | } |
| | | |
| | | } |
| | | return; |
| | | |
| | | } |
| | | case 'clear': { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | $table.getTableData().fullData.forEach((item) => { |
| | | item.rack=null |
| | | }) |
| | | } |
| | | return; |
| | | |
| | | } |
| | | case 'save': { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('processCard.pleaseCheckTheRequiredData')) |
| | | return; |
| | | } |
| | | |
| | | let composingData = ref({ |
| | | composing: selectRecords, |
| | | }) |
| | | |
| | | request.post("/processCard/updateProcessCardRack", composingData.value).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | | path: '/main/processCard/SelectProcessCard', |
| | | query: {random: Math.random()} |
| | | }) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.deleteFail')) |
| | | |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | const checkBoxConfig = ({ records, row }) => { |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | ref="xGrid" |
| | | @checkbox-change="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: 540px; |
| | | } |
| | | </style> |