| | |
| | | |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import {ElDatePicker, ElMessage, ElMessageBox} 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/basic/BasicTable.vue' |
| | | import BasicTable from '@/components/sd/product/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import {useI18n} from "vue-i18n"; |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | let router = useRouter() |
| | | let props = defineProps({ |
| | | rowIndex:{} |
| | |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = ()=>{ |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | } |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/processCard/detailFlowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | id: 'SelectDetailProcessCard', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'order_id', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 }, |
| | | {field: 'process_id', width: 130, title: '流程卡号' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order_number', title: '订单序号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'quantity', title: '数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180}, |
| | | {field: 'area', title: '面积' ,showOverflow:"ellipsis"}, |
| | | {field: 'product_name', title: '产品名称', }, |
| | | {field: 'founder', title: '分架员', }, |
| | | {field: 'splitFrame_time', title: '分架时间', }, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 }, |
| | | {field: 'order_id', title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 }, |
| | | {field: 'process_id', width: 140, title: t('processCard.processId') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order_number', title: t('order.OrderNum') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'technology_number', title: t('processCard.technologyNumber') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'quantity', title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 80}, |
| | | {field: 'child_width', title: t('order.width'), }, |
| | | {field: 'child_height', title: t('order.height'), }, |
| | | {field: 'area', title: t('order.area') ,showOverflow:"ellipsis"}, |
| | | {field: 'product_name', title: t('order.product'), }, |
| | | {field: 'glass_child', title: t('reportingWorks.glassChild'), }, |
| | | {field: 'founder', title: t('processCard.founder'), }, |
| | | {field: 'splitFrame_time', title: t('processCard.splitFrameTime'), }, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | buttons: [ |
| | | {'code': 'add', 'name': "合并",status: 'primary'} |
| | | ], |
| | | import: false, |
| | | // export: true, |
| | | // print: true, |
| | |
| | | |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | // footerMethod ({ columns, data }) {//页脚函数 |
| | | // return[ |
| | | // columns.map((column, columnIndex) => { |
| | | // if (columnIndex === 0) { |
| | | // return '合计:' |
| | | // } |
| | | // // if (props.tableProp.footList.includes(column.field)) { |
| | | // // return sumNum(data, column.field) |
| | | // // } |
| | | // return '' |
| | | // }) |
| | | // ] |
| | | // } |
| | | |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return t('basicData.total') |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | const List = ["quantity",'area'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | const selectRecords = $grid.getTableData().visibleData |
| | | let flowData = ref({ |
| | | flowCard: selectRecords |
| | | |
| | | }) |
| | | ElMessageBox.confirm( |
| | | "是否合并?", |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | distinguishCancelAndClose: true, |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | request.post("/processCard/mergeFlowCard", flowData.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.saveFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | |
| | | }) |
| | | break |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |