From 25cc86fd8a2fb3b2bb6b385cba0adaf89ff3dcdc Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 十二月 2025 16:39:32 +0800
Subject: [PATCH] 流程卡进度打印部分代码
---
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue | 893 +++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 740 insertions(+), 153 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
index 1c0ae6f..e4124a0 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -1,180 +1,767 @@
-<script lang="ts" setup>
-import { reactive } from 'vue'
-import { ref } from 'vue'
-const value = ref('')
-const defaultTime = ref<[Date, Date]>([
- new Date(2000, 1, 1, 0, 0, 0),
- new Date(2000, 2, 1, 23, 59, 59),
-])
-// do not use same name with ref
-const form = reactive({
- name: '',
- region: '',
- date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: '',
+<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 {Printer} from "@element-plus/icons-vue/global";
+import SelectProcessCardDetail from "@/components/pp/SelectProcessCardDetail.vue";
+import OrderProcessCollect from "@/components/sd/order/OrderProcessCollect.vue";
+
+//璇█鑾峰彇
+const {t} = useI18n()
+const userStore = useUserInfoStore()
+const user=userInfo()
+const orderInfo = useOrderInfoStore()
+
+let productGlassTypeStore = useProductGlassTypeStore()
+const dialogTableVisible = ref(false)
+const dialogProcess = ref(false)
+let router = useRouter()
+let props = defineProps({
+ rowIndex: {}
})
-const tableData = [
- {
- salesOrderNo: 'NG231201',
- productionOrderNo: 'NG231201A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
+let printRow = ref({
+ list: null,
+})
+const getTableRow = (row, type) => {
+ switch (type) {
+ case 'select' : {
+ router.push({path: '/main/processCard/SelectDetailProcessCard', query: {processId: row.processId}})
+ break
+ }
+ case 'delete': {
+ request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}/${user.user.userId}/${user.user.userName}`).then((res) => {
+ if (res.code == 200 && res.data === true) {
+ ElMessage.success(t('workOrder.deleteOk'))
+ router.push({path: '/main/processCard/SelectProcessCard', query: {random: Math.random()}})
+ } else {
+ ElMessage.warning(t('processCard.deleteNo'))
+ }
+ })
+
+ break
+ }
+ case 'rack' : {
+ dialogTableVisible.value = true
+ break
+ }
+ }
+}
+
+
+function padLeftZero(str) {
+ return ('00' + str).substr(str.length)
+}
+
+//瀹氫箟鍙橀噺
+const form = reactive({
+ date1: '',
+ getSelect:t('processCard.composingNo')
+})
+
+
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+ let count = 0
+ list.forEach(item => {
+ count += Number(item[field])
+ })
+ return count.toFixed(2)
+}
+
+//瀹氫箟婊氬姩鏉¢珮搴�
+let scrollTop = ref(null)
+let scrollHeight = ref(null)
+let clientHeight = ref(null)
+const scrollEvnt = (row) => {
+ // 鍐呭楂樺害
+ scrollTop.value = row.$event.target.scrollTop
+ scrollHeight.value = row.$event.target.scrollHeight
+ clientHeight.value = row.$event.target.clientHeight
+}
+//绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹�
+let filterData = ref({
+ order: {
+ project: ''
},
- {
- salesOrderNo: 'NG231201',
- productionOrderNo: 'NG231201B',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
+ orderDetail: {
+ productId: '',
+ productName: '',
+ computeGrossArea: '',
+ processingNote: '',
+ }
+
+})
+//娴佺▼鍗¤繘搴︾敤鍊�
+let processVal = ref({
+ orderId:null,
+ row: {},
+ processId:null//鐢ㄤ簬鍚庣鏁版嵁杩斿洖锛岀粨鏋滅瓫閫�
+})
+//瀹氫箟椤甸潰鎬婚〉鏁�
+let pageTotal = ref('')
+//瀹氫箟鏁版嵁杩斿洖缁撴灉
+let produceList = ref([])
+//瀹氫箟褰撳墠椤垫暟
+let pageNum = ref(1)
+let pageState = null
+
+let total = reactive({
+ pageTotal: 0,
+ dataTotal: 0,
+ pageSize: 100
+})
+
+const getFlowCardList = async () => {
+ gridOptions.loading = true
+//绗竴娆″姞杞芥暟鎹�
+ await request.post(`/processCard/flowCard/1/${total.pageSize}/${orderInfo.workOrderDate}`, filterData.value).then((res) => {
+
+ if (res.code == 200) {
+ total.dataTotal = res.data.total.total * 1
+ total.pageTotal = res.data.total.pageTotal
+ orderInfo.workOrderDate = res.data.selectDate
+ pageTotal.value = res.data.total
+ total.value = res.data.total
+ produceList.value = produceList.value.concat(deepClone(res.data.data))
+ produceList.value.forEach(item => {
+ switch (item.layoutStatus) {
+ case "0":
+ item.layoutStatus = t('processCard.composingNo');
+ break;
+ case "1":
+ item.layoutStatus = t('processCard.composingOk');
+ break;
+ case "2":
+ item.layoutStatus = t('processCard.typesetter');
+ break;
+ }
+ });
+ xGrid.value.loadData(produceList.value)
+ gridOptions.loading = false
+ } else {
+ ElMessage.warning(res.msg)
+ gridOptions.loading = false
+ }
+ })
+}
+onMounted(async () => {
+ filterData.value = orderInfo.selectProcessCardFilter.data
+ await getFlowCardList()
+ orderInfo.selectProcessCardFilter.list.forEach(item =>{
+ xGrid.value.getColumnByField(item.field).filters = item.column.filters
+ })
+})
+//椤佃剼缈婚〉鏌ヨ
+const selectPageList = () => {
+ gridOptions.loading = true
+ request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${orderInfo.workOrderDate}`, filterData.value).then((res) => {
+ if (res.code == 200) {
+
+ produceList.value = deepClone(res.data.data)
+ produceList.value.forEach(item => {
+ switch (item.layoutStatus) {
+ case "0":
+ item.layoutStatus = t('processCard.composingNo');
+ break;
+ case "1":
+ item.layoutStatus = t('processCard.composingOk');
+ break;
+ case "2":
+ item.layoutStatus = t('processCard.typesetter');
+ break;
+ }
+ });
+ xGrid.value.loadData(produceList.value)
+ gridOptions.loading = false
+ } else {
+ ElMessage.warning(res.msg)
+ gridOptions.loading = false
+ }
+ })
+}
+
+//鐐瑰嚮鏌ヨ
+const getWorkOrder = () => {
+ gridOptions.loading = true
+ request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${orderInfo.workOrderDate}`, filterData.value).then((res) => {
+ if (res.code == 200) {
+ total.dataTotal = res.data.total.total * 1
+ total.pageTotal = res.data.total.pageTotal
+ orderInfo.workOrderDate = res.data.selectDate
+ pageTotal.value = res.data.total
+ total.value = res.data.total
+ res.data.data.forEach(item => {
+ switch (item.layoutStatus) {
+ case "0":
+ item.layoutStatus = t('processCard.composingNo');
+ break;
+ case "1":
+ item.layoutStatus = t('processCard.composingOk');
+ break;
+ case "2":
+ item.layoutStatus = t('processCard.typesetter');
+ break;
+ }
+ });
+ xGrid.value.loadData(res.data.data)
+ gridOptions.loading = false
+ } else {
+ ElMessage.warning(res.msg)
+ gridOptions.loading = false
+ }
+ })
+}
+
+//椤佃剼璺宠浆
+const handlePageChange = ({currentPage, pageSize}) => {
+ pageNum.value = currentPage
+ total.pageTotal = pageSize
+ selectPageList()
+}
+
+/*浣跨敤绛涢�夛紝鍚庣鑾峰彇鏁版嵁*/
+const changeFilterEvent = (event, option, $panel,) => {
+ // 鎵嬪姩瑙﹀彂绛涢��
+ $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
+ }
+
+
+ request.post(`/processCard/flowCard/1/${total.pageSize}/${orderInfo.workOrderDate}`, filterData.value).then((res) => {
+ if (res.code == 200) {
+ total.dataTotal = res.data.total.total*1
+ total.pageTotal=parseInt(res.data.total)
+ pageNum.value=1
+ total.value = res.data.total
+ produceList.value = deepClone(res.data.data)
+ produceList.value.forEach(item => {
+ switch (item.layoutStatus) {
+ case "0":
+ item.layoutStatus = t('processCard.composingNo');
+ break;
+ case "1":
+ item.layoutStatus = t('processCard.composingOk');
+ break;
+ case "2":
+ item.layoutStatus = t('processCard.typesetter');
+ break;
+ }
+ });
+ xGrid.value.loadData(produceList.value)
+ gridOptions.loading=false
+ orderInfo.selectProcessCardFilter.list = xGrid.value.getCheckedFilters()
+ orderInfo.selectProcessCardFilter.data = filterData.value
+ } else {
+ ElMessage.warning(res.msg)
+ gridOptions.loading = false
+ }
+ })
+}
+
+/*鍚庣杩斿洖缁撴灉澶氬眰宓屽灞曠ず*/
+const hasDecimal = (value) => {
+ const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+ return regex.test(value); // 杩斿洖true/false
+}
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+const xGrid = ref()
+const gridOptions = reactive({
+ 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
},
- {
- salesOrderNo: 'NG231202',
- productionOrderNo: 'NG231202A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
+ filterConfig: { //绛涢�夐厤缃」
+ remote: true
},
- {
- salesOrderNo: 'NG231203',
- productionOrderNo: 'NG231203A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
+ customConfig: {
+ storage: true
},
- {
- salesOrderNo: 'NG231204',
- productionOrderNo: 'NG231204A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
+ editConfig: {
+ trigger: 'click',
+ mode: 'row',
+ showStatus: true
+ },//琛ㄥご鍙傛暟
+ 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: 90, 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: 'order.customerName', title: t('processCard.customerName'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
+ {field: 'order.batch', title: t('order.batch'), 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: 'computeGrossArea', title: t('order.area'),},
+ {field: 'founder', title: t('processCard.founder'),},
+ {field: 'orderDetail.processingNote', title: t('order.processingNote'),},
+ {field: 'order.createTime', title: t('report.orderTime'),width: 110},
+ {field: 'order.updateTime', title: t('productStock.approvedDate'),width: 110},
+ {field: 'layoutStatus',width:100, title: t('processCard.layoutStatus'), filters: [{data: ''}], slots: {filter: 'select_filter'}},
+ {field: 'merge',width:100, title: t('processCard.mergeState'), filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+ {field: 'rack',width:100, title:t('processCard.shelfNumber'), filters: [{data: ''}], slots: {filter: 'num1_filter'}}
+ ],//琛ㄥご鎸夐挳
+
+ toolbarConfig: {
+ buttons: [
+ {code: 'update', name: t('processCard.composing'), status: 'primary'},
+ {code: 'revoke', name: t('processCard.revoke'), status: 'primary'},
+ {code: 'delete', name: t('basicData.delete'), status: 'primary'},
+ {code: 'rack', name: t('processCard.combinedFrame'), status: 'primary'},
+ ],
+ slots: {
+ tools: 'toolbar_buttons'
+ },
+ import: false,
+ // export: true,
+ // print: true,
+ zoom: true,
+ custom: true
},
- {
- salesOrderNo: 'NG231205',
- productionOrderNo: 'NG231205A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
+ data: [],//table body瀹為檯鏁版嵁
+ //鑴氶儴姹傚拰
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ return[
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return t('basicData.total')
+ }
+ const List = ["quantity",'computeGrossArea']
+ if (List.includes(column.field)) {
+ //return footSum(data, column.field)
+ return total.value?.[column.field] ?? 0
+ }
+ return ''
+ })
+ ]
+ }
+
+})
+
+const sexOptions = ref([
+ {label: t('processCard.typesetter'), value: t('processCard.typesetter')},
+ {label: t('processCard.composingOk'), value: t('processCard.composingOk')},
+ {label: t('processCard.composingNo'), value: t('processCard.composingNo')}
+])
+
+//琛ㄦ牸鎸夐挳
+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 composingData = ref({
+ composing: selectRecords,
+ userId: user.user.userId,
+ userName:user.user.userName
+ })
+
+ //淇敼鎺掔増鐘舵��
+ request.post("/processCard/updateComposing", 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.saveFail'))
+
+ }
+ })
+
+ }
+ return;
+
+ }
+ case 'revoke': {
+ 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,
+ })
+ selectRecords.forEach(item => {
+ if (item.layoutStatus == t('processCard.typesetter')){
+ ElMessage.warning(t('processCard.notSelectTheOptionData'))
+ return;
+ }
+ });
+ //鎾ら攢鍙帓鐗堢姸鎬�
+ request.post("/processCard/revokeComposing", 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('processCard.msg.msg7'))
+
+ }
+ })
+
+ }
+ return;
+
+ }
+ case 'delete': {
+ const $table = xGrid.value
+ if ($table) {
+ const selectRecords = $table.getCheckboxRecords()
+ if (selectRecords.length == 0) {
+ ElMessage.warning(t('processCard.pleaseCheckTheRequiredData'))
+ return;
+ }
+ //绠�鍖栧嬀閫夌殑鍊�
+ const extractedData = selectRecords.map(item => ({
+ orderId: item.orderId,
+ processId: item.processId
+ }));
+ let composingData = ref({
+ composing: extractedData,
+ userId: user.user.userId,
+ userName:user.user.userName
+ })
+ //澶氶�夊垹闄ゆ祦绋嬪崱
+ request.post("/processCard/checkboxDelete", composingData.value).then((res) => {
+ if (res.code == 200 && res.data === true) {
+ ElMessage.success(t('basicData.msg.deleteSuccess'))
+ router.push({
+ path: '/main/processCard/SelectProcessCard',
+ query: {random: Math.random()}
+ })
+ } else {
+
+ ElMessage.warning(t('basicData.msg.deleteFail'))
+
+ }
+ })
+
+ }
+ return;
+
+ }
+ case 'rack': {
+ const $table = xGrid.value
+ if ($table) {
+ const selectRecords = $table.getCheckboxRecords()
+ if (selectRecords.length == 0) {
+ ElMessage.warning(t('processCard.pleaseCheckTheRequiredData'))
+ return;
+ }
+ let id = ""
+ for (let i = 0; i < selectRecords.length; i++) {
+ if (i + 1 === selectRecords.length) {
+ id += selectRecords[i].id
+ } else {
+ id += selectRecords[i].id + "|"
+ }
+ }
+ printRow.value.list = JSON.stringify(selectRecords)
+ dialogTableVisible.value = true
+
+ }
+ return;
+
+ }
+
+ }
+ }
+ }
+}
+const checkBoxConfig = {
+ checkMethod: ({row}) => {
+ if ( row['layoutStatus'] === t('processCard.typesetter')) {
+ return row.disable
+ } else {
+ return !row.disable
+ }
+
},
- {
- salesOrderNo: 'NG231206',
- productionOrderNo: 'NG231206A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
- },
- {
- salesOrderNo: 'NG231207',
- productionOrderNo: 'NG231207A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- Cases: '3',
- divider: 'xxx',
- processRequirements: '1)鎸変紒鏍�2)姣忕墖鐜荤拑鏍囩璐村澶栭潰銆傚唴鐗囩幓鐠冩墦鈥�3C鍟嗘爣鈥濓紝缁熶竴鎵撳湪鐜荤拑鈥滃搴︹�濇柟鍚戝彸涓嬭4)鎸夋壒娆″崟鐙惤鏋躲��',
- },
-]
+ reserve: true
+}
+
+function exportExcel(url, fileName,date) {
+ if(date===null){
+ ElMessage.warning(t('report.pleaseSelectADateFirst'))
+ return
+ }
+
+
+ const date1 = new Date(date[0]);
+ const date2 = new Date(date[1]);
+ const timeDiff = Math.abs(date2.getTime() - date1.getTime());
+ const daysDiff = timeDiff / (1000 * 3600 * 24);
+ if(Math.floor(daysDiff)>180){
+ ElMessage.warning(t('report.theFilteringTimeForExportCannotExceed180Days'))
+ return
+ }
+ let dataMp = ref({
+ date: date,
+ })
+ request.post(url,dataMp.value,{responseType :'blob'}).then(res => {
+ const blob = new Blob([res])
+ if ('download' in document.createElement('a')) { // 闈濱E涓嬭浇
+ const elink = document.createElement('a')
+ elink.download = `${fileName}.xlsx`
+ elink.style.display = 'none'
+ elink.href = URL.createObjectURL(blob)
+ document.body.appendChild(elink)
+ elink.click()
+ URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+ document.body.removeChild(elink)
+ } else { // IE10+涓嬭浇
+ navigator.msSaveBlob(blob, fileName)
+ }
+
+ })
+}
+
+const onCellDblClick = ({ row, column }) => {
+ processVal.value.orderId = row.orderId
+ processVal.value.processId = row.processId
+ dialogProcess.value = true
+};
</script>
<template>
- <div>
- <div id="selectForm" >
- <el-row :gutter="0">
-<!-- <el-input placeholder="閿�鍞崟鍙�" v-model="form.name" style="width: 200px"/>-->
-<!-- -->
-<!-- <el-input placeholder="椤圭洰鍚嶇О" v-model="form.name" style="width: 200px"/>-->
-
-<!-- -->
+ <div style="width: 100%;height: 100%">
+ <div class="head">
<el-date-picker
- v-model="value"
- type="daterange"
- start-placeholder="寮�濮嬫椂闂�"
- end-placeholder="缁撴潫鏃堕棿"
+ v-model="orderInfo.workOrderDate"
: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 type="primary" style="width: 80px">鏌ヨ</el-button>
- </el-row>
+ <el-button
+ id="select"
+ :icon="Search"
+ style="margin-top: -5px"
+ type="primary" @click="getWorkOrder">{{ $t('basicData.search') }}
+
+ </el-button>
</div>
- <el-table :data="tableData" border style="width: 100%" height="100%">
- <el-table-column fixed label="鎿嶄綔" width="140" >
- <el-button link type="primary" size="small">鍒犻櫎</el-button>
- <el-button link type="primary" size="small">鎺掔増</el-button>
- <el-button link type="primary" size="small">鎵撳嵃</el-button>
- </el-table-column>
- <el-table-column sortable prop="salesOrderNo" label="閿�鍞崟鍙�" width="110" >
- <template v-slot="scope">
- <router-link :to="{path:'ProcessCardDetails'}" >{{scope.row.salesOrderNo}}</router-link>
+ <div class="main-table">
+ <vxe-grid
+ ref="xGrid"
+ :checkbox-config="checkBoxConfig"
+ class="mytable-scrollbar"
+ height="100%"
+ v-bind="gridOptions"
+ v-on="gridEvents"
+ @filter-change="filterChanged"
+ @cell-dblclick="onCellDblClick"
+
+ >
+ <!-- @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>
- </el-table-column>
- <el-table-column prop="productionOrderNo" label="鐢熶骇璁㈠崟鍙�" width="125" />
- <el-table-column prop="productID" label="浜у搧缂栧彿" width="155" />
- <el-table-column prop="productName" label="浜у搧鍚嶇О" :show-overflow-tooltip='true' width="180" />
- <el-table-column prop="entryName" label="椤圭洰鍚嶇О" width="155" />
- <el-table-column prop="total" label="鎬荤墖鏁�" width="75" />
- <el-table-column prop="TotalArea" label="鎬婚潰绉�" width="100" />
- <el-table-column prop="Cases" label="绠辨暟" width="100" />
- <el-table-column prop="divider" label="鍒嗘灦鍛�" width="70" />
- <el-table-column prop="processRequirements" label="鍔犲伐瑕佹眰" :show-overflow-tooltip='true' width="350" />
- </el-table><!-- <h1>{{msg}}</h1> -->
+
+ <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+
+ <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"
+ @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 :title="$t('searchOrder.deleteConfirm')" @confirm="getTableRow(row,'delete')">-->
+ <!-- <template #reference>-->
+ <!-- <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
+ v-model="option.data"
+ @keyup.enter.native="$panel.confirmFilter()"
+ @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="$t('processCard.typesetter')" :label="$t('processCard.typesetter')"></option>
+ <option :value="$t('processCard.composingOk')" :label="$t('processCard.composingOk')"></option>
+ <option :value="$t('processCard.composingNo')" :label="$t('processCard.composingNo')"></option>
+ </select>
+ </div>
+ </div>
+ </template>
+ <template #pager>
+ <!--浣跨敤 pager 鎻掓Ы-->
+ <!-- 'PrevJump','NextJump', -->
+ <vxe-pager
+ 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 #toolbar_buttons>
+ <vxe-button style="margin-right: 0.5rem"
+ @click="exportExcel('/processCard/exportDateProcess',
+ t('order.processCard'),
+ orderInfo.workOrderDate)">
+ {{t('basicData.export')}}</vxe-button>
+ </template>
+
+ </vxe-grid>
+ </div>
+
+ <el-dialog
+ id="sizePrintCalrd"
+ v-model="dialogProcess"
+ :title="$t('order.processCardCollect')"
+ destroy-on-close
+ style="width: 75%;height:75% ">
+ <order-process-collect
+ :orderId="processVal.orderId"
+ :processId="processVal.processId"
+ :row="processVal.row"
+ style="width: 100%;height: 100%"
+ />
+ </el-dialog>
+
+ <el-dialog
+ id="sizePrintCalrd"
+ v-model="dialogTableVisible"
+ :title="$t('processCard.combinedFrame')"
+ destroy-on-close
+ style="width: 75%;height:75% ">
+ <select-process-card-detail
+ id="child"
+ :printList="printRow.list"
+ style="width: 100%;height: 100%"/>
+ </el-dialog>
</div>
</template>
<style scoped>
-*{
- margin: 0;
- padding:0;
+.head{
+ width: 100%;
+ height: 35px;
}
-a{
- color:#409eff;
+.main-table{
+ width: 100%;
+ height: calc(100% - 35px);
}
-#selectForm {
- width: 40%;
- height: 100%;
- text-align: center;
+:deep(.el-dialog__body){
+ height: 90%;
+ width: 100%;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0