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/SelectReturns.vue |  227 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 147 insertions(+), 80 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/sd/returns/SelectReturns.vue b/north-glass-erp/northglass-erp/src/views/sd/returns/SelectReturns.vue
index 59cdfda..2344cb6 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/returns/SelectReturns.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/returns/SelectReturns.vue
@@ -1,54 +1,120 @@
 <script setup>
 import {Search} from "@element-plus/icons-vue";
+import {reactive} from "vue";
+import {useRouter} from "vue-router"
+const router = useRouter()
 
-let deliveryTitle = $ref([
-  '搴忓彿',
-  '瀹℃牳',
-  '鍑哄簱',
-  '閫�璐у崟鍙�',
-  '閫�璐у憳',
-  '閫�璐ф棩鏈�',
-  '瀹㈡埛缂栫爜',
-  '瀹㈡埛鍚嶇О',
-  '鎵规',
-  '椤圭洰鍚嶇О',
-  '鍙戣揣鍗曞彿',
-  '閫�璐ф柟寮�',
-  '浠樻鏂瑰紡',
-  '鎬绘暟閲�',
-  '鎬婚潰绉�',
-  '鎬婚噾棰�',
-  '鎶ヨ〃鏃ユ湡',
-  '涓氬姟鍛�',
-  '閫佽揣鏃ユ湡',
-  '鏀舵鏃堕棿'
 
-])
 
-let deliveryList =[
-  {
-    '0': '1',
-    '1': '',
-    '2': '',
-    '3': 'TH23120801',
-    '4': '閮戠強鐝�',
-    '5': '2023-12-08',
-    '6': '310',
-    '7': '涓婃捣閲岃寤虹瓚宸ョ▼鏈夐檺鍏徃',
-    '8': '琛�1-2',
-    '9': '瀹胯縼鏌愭煇椤圭洰',
-    '10': 'JG23112304',
-    '11': '瀹炵墿閫�璐�',
-    '12': '',
-    '13': '8',
-    '14': '15.68',
-    '15': '11912.05',
-    '16': '2023-11-24',
-    '17': '鐜嬮緳',
-    '18': '',
-    '19': '2023-12-08'
+
+const getTableRow = (row,type) =>{
+  switch (type) {
+    case 'edit' :{
+      //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+      router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }})
+      break
+    }
+    case 'delete':{
+      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
+      break
+    }
   }
-]
+}
+
+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},
+    {title: '鎿嶄綔', width: 110, slots: { default: 'button_slot' }},
+    {type: 'seq', title: '鑷簭', width: 80 },
+
+    {title: '瀹℃牳', width: 40, slots: { default: 'state' }},
+    {title: '鍏ュ簱', width: 40, slots: { default: 'state' }},
+
+    {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},
+    {field: '15',width:120,  title: '鎶ヨ〃鏃ユ湡',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+    {field: '16',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': '',
+      '2': '',
+      '3': 'TH23120801',
+      '4': '閮戠強鐝�',
+      '5': '2023-12-08',
+      '6': '310',
+      '7': '涓婃捣閲岃寤虹瓚宸ョ▼鏈夐檺鍏徃',
+      '8': '琛�1-2',
+      '9': '瀹胯縼鏌愭煇椤圭洰',
+      '10': 'JG23112304',
+      '11': '瀹炵墿閫�璐�',
+      '12': '8',
+      '13': '15.68',
+      '14': '11912.05',
+      '15': '2023-11-24',
+      '16': '鐜嬮緳'
+    }
+  ],//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 ''
+      })
+    ]
+  }
+})
 </script>
 
 <template>
@@ -60,45 +126,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>
+
+
+    <vxe-grid
+        max-height="97%"
+        class="mytable-scrollbar"
+        ref="xGrid"
+        v-bind="gridOptions"
+
+    >
+      <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+      <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 #state="{ row}">
+        <el-checkbox checked/>
+      </template>
+
+      <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+      <template #button_slot="{ row }">
+        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">缂栬緫</el-button>
+        <el-button @click="getTableRow(row,'delete')" 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>
-        </template>
-      </el-table-column>
-      <el-table-column label="鎿嶄綔" fixed width="110"  >
-        <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
-          :prop="index.toString()"
-          :show-overflow-tooltip='true'
-          width="100" v-for="(item,index) in deliveryTitle"
-          :label="item" >
-        <el-checkbox v-if="index>0 && index<3" checked/>
-      </el-table-column>
-
-
-    </el-table>
+        </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