| | |
| | | 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 {useI18n} from 'vue-i18n' |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import {toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const {t} = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | let router = useRouter() |
| | | let props = defineProps({ |
| | | rowIndex:{} |
| | | rowIndex: {} |
| | | }) |
| | | const getTableRow = (row, type) => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | switch (type) { |
| | | case 'select' : { |
| | | router.push({path: '/main/processCard/SelectDetailProcessCard', query: { processId: row.processId }}) |
| | | router.push({path: '/main/processCard/SelectDetailProcessCard', query: {processId: row.processId}}) |
| | | break |
| | | } |
| | | case 'delete': { |
| | | request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => { |
| | | if (res.code == 200 && res.data===true) { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('workOrder.deleteOk')) |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random: Math.random()}}) |
| | | } else { |
| | | ElMessage.warning('删除失败,检查流程卡是否已报工') |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | function padLeftZero(str) { |
| | | return ('00' + str).substr(str.length) |
| | | } |
| | | |
| | | //定义时间 |
| | | //定义变量 |
| | | const form = reactive({ |
| | | date1: '', |
| | | getSelect:'不可排版' |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | //表尾求和 |
| | |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum=ref(1) |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 7) |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0,10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime()+3600 * 1000 * 24) |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0,10)//默认结束时间当前时间 |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1=getNowTime() |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = ()=>{ |
| | | 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){ |
| | | 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{ |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | |
| | | let endTime = form.date1[1] |
| | | request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | if (column.property.indexOf('.')>-1){ |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | [columnArr[1]]:value |
| | | } |
| | | } else { |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | loading: true, |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {title: t('basicData.operate'), width: 100, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 }, |
| | | {field: 'orderId', title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 110 }, |
| | | {field: 'processId', width: 140, title: t('processCard.processId') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId', title: t('order.productId') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'orderDetail.productName', title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180}, |
| | | {field: 'order.project', title: t('order.project') ,showOverflow:"ellipsis"}, |
| | | {field: 'quantity', title: t('order.quantity'), }, |
| | | {field: 'orderDetail.computeGrossArea', title: t('order.area'), }, |
| | | {field: 'founder', title: t('processCard.founder'), }, |
| | | {field: 'orderDetail.processingNote', title: t('order.processingNote'), }, |
| | | {field: 'layoutStatus', title: t('processCard.layoutStatus'), } |
| | | {title: t('basicData.operate'), width: 100, slots: {default: 'button_slot'}, fixed: "left"}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | {field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110}, |
| | | { |
| | | field: 'processId', |
| | | width: 140, |
| | | title: t('processCard.processId'), |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'orderDetail.productId', |
| | | title: t('order.productId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | }, |
| | | { |
| | | field: 'orderDetail.productName', |
| | | title: t('order.product'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | width: 180 |
| | | }, |
| | | {field: 'order.project', title: t('order.project'), showOverflow: "ellipsis"}, |
| | | {field: 'quantity', title: t('order.quantity'),}, |
| | | {field: 'orderDetail.computeGrossArea', title: t('order.area'),}, |
| | | {field: 'founder', title: t('processCard.founder'),}, |
| | | {field: 'orderDetail.processingNote', title: t('order.processingNote'),}, |
| | | |
| | | {field: 'layoutStatus',width:100, title: t('processCard.layoutStatus'), filters: [{data: ''}], slots: {filter: 'select_filter'}} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['', '',] |
| | |
| | | } |
| | | |
| | | }) |
| | | |
| | | const sexOptions = ref([ |
| | | {label: '已排版', value: '已排版'}, |
| | | {label: '可排版', value: '可排版'}, |
| | | {label: '不可排版', value: '不可排版'} |
| | | ]) |
| | | |
| | | //表格按钮 |
| | | const gridEvents = { |
| | |
| | | |
| | | //修改排版状态 |
| | | request.post("/processCard/updateComposing", composingData.value).then((res) => { |
| | | if (res.code == 200 && res.data===true) { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success("修改成功") |
| | | router.push({ |
| | | path: '/main/processCard/SelectProcessCard', |
| | |
| | | } |
| | | } |
| | | const checkBoxConfig = { |
| | | checkMethod: ({ row }) => { |
| | | if (row['layoutStatus']==='可排版'||row['layoutStatus']==='已排版'){ |
| | | checkMethod: ({row}) => { |
| | | if (row['layoutStatus'] === '可排版' || row['layoutStatus'] === '已排版') { |
| | | return row.disable |
| | | }else{ |
| | | } else { |
| | | return !row.disable |
| | | } |
| | | |
| | | }, |
| | | reserve:true |
| | | reserve: true |
| | | } |
| | | |
| | | |
| | |
| | | <el-row :gutter="0"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | :default-time="defaultTime" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | format="YYYY/MM/DD" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | |
| | | /> |
| | | |
| | | <el-button |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | | :icon="Search" |
| | | type="primary" @click="getWorkOrder">{{ $t('basicData.search') }} |
| | | |
| | | </el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | :checkbox-config="checkBoxConfig" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :checkbox-config="checkBoxConfig" |
| | | @filter-change="filterChanged" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | |
| | | <template #button_slot="{ row }" > |
| | | <!-- <el-button @click="getTableRow(row,'select')" link type="primary" size="small">{{$t('basicData.edit')}}--> |
| | | <!-- </el-button>--> |
| | | <el-button @click="getTableRow(row,'select')" |
| | | v-if="userStore.user.permissions.indexOf('SelectProcessCard.edit') > -1" |
| | | <template #button_slot="{ row }"> |
| | | <!-- <el-button @click="getTableRow(row,'select')" link type="primary" size="small">{{$t('basicData.edit')}}--> |
| | | <!-- </el-button>--> |
| | | <el-button v-if="userStore.user.permissions.indexOf('SelectProcessCard.edit') > -1" |
| | | link |
| | | size="small" |
| | | type="primary" |
| | | size="small"> |
| | | @click="getTableRow(row,'select')"> |
| | | {{ $t('basicData.edit') }} |
| | | </el-button> |
| | | <!-- <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button>--> |
| | | <!-- <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button>--> |
| | | <!-- <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button>--> |
| | | <!-- <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>--> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <!-- <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button>--> |
| | | <!-- <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button>--> |
| | | <!-- <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button>--> |
| | | <!-- <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>--> |
| | | <el-popconfirm :title="$t('searchOrder.deleteConfirm')" @confirm="getTableRow(row,'delete')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | <el-button link size="small" type="primary">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </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)"/> |
| | | <input v-model="option.data" type="text" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template #select_filter="{ column, $panel }"> |
| | | <div> |
| | | |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <select v-model="option.data" @change="changeFilterEvent($event, option, $panel)" style="width: 100%"> |
| | | <option value="已排版" label="已排版"></option> |
| | | <option value="可排版" label="可排版"></option> |
| | | <option value="不可排版" label="不可排版"></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <!--使用 pager 插槽--> |
| | | <!-- 'PrevJump','NextJump', --> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | :total="total.dataTotal" |
| | | @page-change="handlePageChange" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 40%; |
| | | text-align: center; |