From 1f6c97aa5f23d09a04152038c7d53ce95721cf50 Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期五, 22 十二月 2023 16:29:51 +0800
Subject: [PATCH] pp、sd模块界面调整,添加vxetable组件和对应界面跳转
---
north-glass-erp/northglass-erp/src/views/sd/returns/SelectDeliveryList.vue | 262 ++++++++++++++++++++++++++++++++++++----------------
1 files changed, 181 insertions(+), 81 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/sd/returns/SelectDeliveryList.vue b/north-glass-erp/northglass-erp/src/views/sd/returns/SelectDeliveryList.vue
index cbc1217..615fdb4 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/returns/SelectDeliveryList.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/returns/SelectDeliveryList.vue
@@ -1,61 +1,158 @@
<script setup>
-import {CirclePlus, Search} from "@element-plus/icons-vue";
-import {useRouter} from 'vue-router'
+import {Search} from "@element-plus/icons-vue"
+import {useRouter} from "vue-router"
+import {reactive, ref} from "vue";
+const router = useRouter()
-let router = useRouter()
-let deliveryTitle = $ref([
- '搴忓彿',
- '鍙戣揣鍗曞彿',
- '瀹㈡埛缂栧彿',
- '瀹㈡埛鍚嶇О',
- '鎬绘暟閲�',
- '鍙敤搴撳瓨',
- '椤圭洰鍚嶇О',
- '鎵规',
- '鎬婚噾棰�',
- '缁撶畻鎬婚潰绉�',
- '鎶ヨ〃鏃ユ湡',
- '鍖呰鏂瑰紡',
- '璁㈠崟绫诲瀷',
- '閫佽揣鍦板潃',
- '涓氬姟鍛�'
-
-])
-
-let deliveryList =[
- {
- '0': '1',
- '1': 'NG23110101',
- '2': '11',
- '3': '涓缓',
- '4': '534',
- '5': '116',
- '6': '榛勭煶鏈夎建鐢佃溅',
- '7': '20鎵�',
- '8': '111100.02',
- '9': '1008.38',
- '10': '2023-10-30',
- '11': '鍙夎溅鏈ㄧ',
- '12': '鏅�氳鍗�',
- '13': '',
- '14': '鐜嬮緳'
+const getTableRow = (row,type) =>{
+ switch (type) {
+ case 'edit' :{
+ //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+ router.push({path: '/main/returns/createReturns', query: { deliveryID: 'JG24010101' }})
+ break
+ }
+ case 'delete':{
+ alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
+ break
+ }
}
-]
-
-let listName = $ref([
- '瀹℃牳','鍑哄簱'
-])
-
-function addReturns(){
- router.push({path:'/main/Returns/createReturns'})
}
+const xGrid = ref()
+const gridOptions = reactive({
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe:true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'OrderList',
+ 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:'expand',slots: { content:'content' },width: 50,fixed:"left"},
+ {title: '鎿嶄綔',slots: { default: 'button_slot' }, width: 80,fixed:"left"},
+ {type: 'seq', title: '鑷簭', width: 80 ,fixed:"left"},
+
+ {title: '瀹℃牳', width: 40, slots: { default: 'state' }},
+ {title: '鍑哄簱', width: 40, slots: { default: 'state' }},
+
+ {field: '1',width:120, title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '2',width:120, title: '瀹㈡埛缂栧彿',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '3',width:120, title: '瀹㈡埛鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '4',width:120, title: '鎬绘暟閲�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '5',width:120, title: '鍙敤搴撳瓨',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '6',width:120, title: '椤圭洰鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '7',width:120, title: '鎵规',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '8',width:120, title: '鎬婚噾棰�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '9',width:120, title: '缁撶畻鎬婚潰绉�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '10',width:120, title: '鎶ヨ〃鏃ユ湡',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '11',width:120, title: '鍖呰鏂瑰紡',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '12',width:120, title: '璁㈠崟绫诲瀷',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '13',width:120, title: '璁㈠崟绫诲瀷',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: '14',width:120, title: '璁㈠崟绫诲瀷',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}
+
+
+ ],//琛ㄥご鎸夐挳
+ toolbarConfig: {
+ buttons: [
+ ],
+ import: false,
+ export: true,
+ print: true,
+ zoom: true,
+ custom: true
+ },
+ data: [
+ {
+ '0': '1',
+ '1': 'NG23110102',
+ '2': '11',
+ '3': '涓缓',
+ '4': '534',
+ '5': '116',
+ '6': '榛勭煶鏈夎建鐢佃溅',
+ '7': '20鎵�',
+ '8': '111100.02',
+ '9': '1008.38',
+ '10': '2023-10-30',
+ '11': '鍙夎溅鏈ㄧ',
+ '12': '鏅�氳鍗�',
+ '13': '',
+ '14': '鐜嬮緳'
+ },
+ {
+ '0': '1',
+ '1': 'NG23110101',
+ '2': '11',
+ '3': '涓缓',
+ '4': '534',
+ '5': '116',
+ '6': '榛勭煶鏈夎建鐢佃溅',
+ '7': '20鎵�',
+ '8': '111100.02',
+ '9': '1008.38',
+ '10': '2023-10-30',
+ '11': '鍙夎溅鏈ㄧ',
+ '12': '鏅�氳鍗�',
+ '13': '',
+ '14': '鐜嬮緳'
+ }
+ ],//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 ''
+ })
+ ]
+ }
+
+})
+const gridEvents = {
+ toolbarButtonClick ({ code }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (code) {
+ case 'add': {
+ router.push({path: '/main/delivery/createDelivery', params: { orderID: 'NG24010101' }})
+ break
+ }
+ }
+ }
+ }
+}
+
</script>
<template>
- <div>
+ <div style="width: 100%;height: 100%">
<el-date-picker
v-model="value1"
type="daterange"
@@ -63,43 +160,46 @@
end-placeholder="缁撴潫鏃堕棿"
/>
<el-button style="margin-top: -5px" id="searchButton" type="primary" :icon="Search">鏌ヨ</el-button>
- <el-table
- :data="deliveryList"
- :header-cell-style="{ 'text-align': 'center' }"
- :cell-style="{ 'text-align': 'center' }"
- lazy
- border
- style="width: 99%;"
- max-height="80vh">
- <el-table-column type="expand" fixed>
- <template #default="props" >
- <div m="4">
- <p m="t-0 b-2">閫�璐х浉鍏充俊鎭�</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="閫夋嫨" fixed width="70" >
- <el-button @click="addReturns" link type="primary" size="small">閫�璐�</el-button>
- </el-table-column>
- <el-table-column v-for="item in listName" prop="" :label="item" width="40" >
+ <vxe-grid
+ max-height="97%"
+ class="mytable-scrollbar"
+ ref="xGrid"
+ v-bind="gridOptions"
+ v-on="gridEvents"
+
+ >
+ <template #state="{ row}">
<el-checkbox checked/>
- </el-table-column>
+ </template>
- <el-table-column
- :prop="index.toString()"
- :show-overflow-tooltip='true'
- width="100" v-for="(item,index) in deliveryTitle"
- :label="item" />
- </el-table>
+ <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+ <template #content="{ row}">
+ <ul class="expand-wrapper">
+ <li v-for="(item,key,index) in row">
+ <span style="font-weight: bold">{{key+': '}}</span>
+ <span>{{ item }}</span>
+ </li>
+ </ul>
+ </template>
+
+ <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+ <template #button_slot="{ row }">
+ <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">閫�璐�</el-button>
+ </template>
+
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+ </vxe-grid>
+
+
</div>
-
</template>
<style scoped>
-:deep(.el-table .el-input__wrapper) {
- box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
- cursor: default;
- border: none !important;
- background-color: transparent;
-}
+
</style>
\ No newline at end of file
--
Gitblit v1.8.0