From 46bf33053daa5f2bfe163822ce4f793f669024f8 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期一, 10 三月 2025 08:28:13 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue | 291 ++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 234 insertions(+), 57 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
index 244880a..35635da 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
@@ -1,72 +1,249 @@
-<script lang="ts" setup>
-import { reactive } from 'vue'
-import {ArrowLeftBold} from "@element-plus/icons-vue";
-import {useRouter} from "vue-router";
+<script setup>
-// do not use same name with ref
-const form = reactive({
- name: '',
- region: '',
- date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: '',
+import request from "@/utils/request"
+import deepClone from "@/utils/deepClone"
+import {ElDatePicker, ElMessage} from "element-plus"
+import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
+import {useRouter} from 'vue-router'
+import {useI18n} from 'vue-i18n'
+import {changeFilterEvent, filterChanged} from "@/hook"
+import useUserInfoStore from '@/stores/userInfo'
+import footSum from "@/hook/footSum"
+//璇█鑾峰彇
+const {t} = useI18n()
+const userStore = useUserInfoStore()
+let router = useRouter()
+const getTableRow = (row, type) => {
+ switch (type) {
+ case 'edit' : {
+ //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+ router.push({
+ path: '/main/processCard/AddProcessCard',
+ query: {orderId: row.order_id, productionId: row.production_id, quantity:row.quantity}
+ })
+ break
+ }
+ }
+}
+
+//瀹氫箟婊氬姩鏉¢珮搴�
+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({
+
+ orderGlassDetail: {
+ productionId: '',
+ },
+ orderDetail: {
+ orderId: '',
+ productId: '',
+ productName: '',
+ }
+
+
})
-const router = useRouter()
+//瀹氫箟椤甸潰鎬婚〉鏁�
+let pageTotal = ref('')
+//瀹氫箟鏁版嵁杩斿洖缁撴灉
+let produceList = ref([])
+//瀹氫箟褰撳墠椤垫暟
+let pageNum = $ref(1)
+let pageState = null
-const tableData = [
- {
- salesOrderNo: 'NG231201',
- productionOrderNo: 'NG231201A',
- productID: '9001010203000008',
- productName: '5mm鐧界幓骞抽挗(澶�)+0.76PVB閫忔槑+5mm鐧界幓骞抽挗(鍐�)',
- total: '169',
- TotalArea: '175.31',
- perimeter: '99.84',
+const {currentRoute} = useRouter()
+const route = currentRoute.value
+let id = route.query.orderId
+
+// 绗竴娆″姞杞芥煡璇�
+request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => {
+
+ if (res.code == 200) {
+ produceList = produceList.value.concat(deepClone(res.data.data))
+ xGrid.value.reloadData(produceList)
+ gridOptions.loading = false
+ } else {
+ ElMessage.warning(res.msg)
+ }
+})
+
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+ let count = 0
+ list.forEach(item => {
+ count += Number(item[field])
+ })
+ return count.toFixed(2)
+}
+
+
+const hasDecimal = (value) => {
+ const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+ 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: 'SplittingDetails',
+ showFooter: true,//鏄剧ず鑴�
+ printConfig: {},
+ importConfig: {},
+ exportConfig: {},
+ scrollX: {enabled: true},
+ scrollY: {enabled: true, gt: 0},//寮�鍚櫄鎷熸粴鍔�
+ showOverflow: true,
+ columnConfig: {
+ resizable: true,
+ useKey: true
},
- {
- salesOrderNo: 'NG231201',
- productionOrderNo: 'NG231201B',
- productID: '9001010208000018',
- productName: '6mm鍙挗LOW-E-85骞抽挗(澶�)+12A(缁�)+6mm鐧界幓骞抽挗(鍐�)',
- total: '169',
- TotalArea: '175.31',
- perimeter: '99.84',
+ filterConfig: { //绛涢�夐厤缃」
+ // remote: true
},
- {
- salesOrderNo: 'NG231201',
- productionOrderNo: 'NG231201C',
- productID: '9001010203000021',
- productName: '6mm瓒呯櫧UD60骞抽挗(澶�)+12A(缁�)+6mm瓒呯櫧骞抽挗(鍐�)',
- total: '169',
- TotalArea: '175.31',
- perimeter: '99.84',
+ customConfig: {
+ storage: true
},
-]
+ editConfig: {
+ trigger: 'click',
+ mode: 'row',
+ showStatus: true
+ },//琛ㄥご鍙傛暟
+ columns: [
+ {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
+ {title: t('basicData.operate'), width: 80, slots: {default: 'button_slot'}, fixed: "left"},
+ {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
+ {
+ field: 'order_id',
+ title: t('order.orderId'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'production_id',
+ title: t('workOrder.productionId'),
+ showOverflow: "ellipsis",
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'product_id',
+ title: t('order.productId'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'product_name',
+ title: t('order.product'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {field: 'quantity', title: t('order.quantity'), showOverflow: "ellipsis"},
+ {field: 'compute_gross_area', title: t('order.area'),},
+ {field: 'perimeter', title: t('workOrder.perimeter'),},
+ ],//琛ㄥご鎸夐挳
+
+ toolbarConfig: {
+ // buttons: [
+ // {code: 'editCheckbox', name: t('basicData.edit'), status: 'primary'},
+ // ],
+ zoom: true,
+ custom: true
+ },
+ data: null,//琛ㄦ牸鏁版嵁
+ //鑴氶儴姹傚拰
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ return[
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return t('basicData.total')
+ }
+ const List = ["quantity",'compute_gross_area','perimeter']
+ if (List.includes(column.field)) {
+ return footSum(data, column.field)
+ }
+ return ''
+ })
+ ]
+ }
+
+})
+
+
</script>
<template>
- <div>
+ <div class="main-div-customer">
+ <vxe-grid
+ ref="xGrid"
+ class="mytable-scrollbar"
+ height="100%"
+ v-bind="gridOptions"
- <el-table :data="tableData" border style="width: 100%" height="100%">
- <el-table-column sortable prop="salesOrderNo" label="閿�鍞崟鍙�" width="110" >
- <template v-slot="scope">
- <router-link :to="{path:'AddProcessCard'}" >{{scope.row.salesOrderNo}}</router-link>
- </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="total" label="鎬绘暟閲�" width="75" />
- <el-table-column prop="TotalArea" label="鎬婚潰绉�" width="100" />
- <el-table-column prop="perimeter" label="鍛ㄩ暱" width="75" />
- </el-table><!-- <h1>{{msg}}</h1> -->
+
+ >
+ <!-- @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 #button_slot="{ row }">
+<!-- <el-button link size="small" type="primary" @click="getTableRow(row,'edit')">{{ $t('basicData.edit') }}-->
+<!-- </el-button>-->
+ <el-button @click="getTableRow(row,'edit')"
+ v-if="userStore.user.permissions.indexOf('splittingDetails.edit') > -1"
+ link
+ type="primary"
+ size="small">
+ {{ $t('basicData.edit') }}
+ </el-button>
+ </template>
+
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input type="text"
+ v-model="option.data"
+ @keyup.enter.native="$panel.confirmFilter()"
+ @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+
+
+ </vxe-grid>
</div>
</template>
<style scoped>
-
-
+.main-div-customer {
+ width: 99%;
+ height: 100%;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0