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/order/SelectOrder.vue |  264 ++++++++++++++++++++++++++++++++++------------------
 1 files changed, 170 insertions(+), 94 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
index 0f15532..5581944 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -1,38 +1,153 @@
 <script setup>
   import {Search} from "@element-plus/icons-vue"
   import {useRouter} from "vue-router"
+  import {reactive} from "vue";
   const router = useRouter()
 
-  let orderList = $ref([
-    {
-      '1':'NG23120701',
-      '2':'1',
-      '3':'涓北甯備簯闀滃灞呮湁闄愬叕鍙�',
-      '4':'澶ф澘闀�',
-      '5':'涓�鎵�1',
-      '6':'999999.99',
-      '7':'99999',
-      '8':'99999.99',
-      '9':'99999.99',
-      '10':'2023-12-07',
-      '11':'瑁呯',
-      '12':'鏅�氳鍗�',
-      '13':'寮犱笁',
-      '14':'绗簩鎵�',
-      '15':'2023-12-30',
+  const getTableRow = (row,type) =>{
+    switch (type) {
+      case 'edit' :{
+        //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+        router.push({path: '/main/order/createOrder', query: { orderID: 'NG24010101' }})
+        break
+      }
+      case 'delete':{
+        alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
+        break
+      }
     }
-  ])
-  let listName = $ref([
-      '涓嬪崟','宸ヨ壓','瀹℃牳','鐢熶骇','浜ゆ帴','涓嬭揪','鍏ュ簱','鍙戣揣'
-  ])
-
-  function openCraft(){
-    router.push({name:'updateOrderCraft'})
   }
+
+  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: '鎿嶄綔', width: 110, slots: { default: 'button_slot' },fixed:"left",},
+      {type: 'seq', title: '鑷簭', width: 80 ,fixed:"left",},
+
+      {title: '涓嬪崟', width: 40, slots: { default: 'state' }},
+      {title: '宸ヨ壓', width: 40, slots: { default: 'state' }},
+      {title: '瀹℃牳', width: 40, slots: { default: 'state' }},
+      {title: '鐢熶骇', width: 40, slots: { default: 'state' }},
+      {title: '浜ゆ帴', width: 40, slots: { default: 'state' }},
+      {title: '涓嬭揪', width: 40, slots: { default: 'state' }},
+      {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 ''
+        })
+      ]
+    }
+
+  })
+
+
+
+
+
+
 </script>
 
 <template>
-  <div >
+  <div  style="width: 100%;height: 100%">
     <el-date-picker
         v-model="value1"
         type="daterange"
@@ -40,85 +155,46 @@
         end-placeholder="缁撴潫鏃堕棿"
     />
     <el-button style="margin-top: -5px"  id="searchButton" type="primary" :icon="Search">鏌ヨ</el-button>
-    <el-table
-        :data="orderList"
-        :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">
+    <vxe-grid
+        max-height="97%"
+        class="mytable-scrollbar"
+        ref="xGrid"
+        v-bind="gridOptions"
 
-            <p m="t-0 b-2">缂栧彿: {{ props.row.prodID }}</p>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column label="鎿嶄綔" fixed width="110"  >
-<!--        <el-button @click="openCraft" 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   label="搴忓彿" width="40"  />
+    >
+      <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+      <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>
 
-      <el-table-column v-for="item in listName" prop="" :label="item" width="40"   >
-<!--        <el-table-column prop="1" >-->
-<!--          <template #header>-->
-<!--            <el-button type="primary" size="small" style="width: 10px;height: 10px"></el-button>-->
-<!--          </template>-->
-
-<!--          <el-checkbox checked/>-->
-<!--        </el-table-column>-->
+      <template #state="{ row}">
         <el-checkbox checked/>
+      </template>
 
-      </el-table-column>
+      <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+      <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>
 
-      <el-table-column  prop="1" width="110" label="閿�鍞崟鍙�"    />
-
-      <el-table-column  prop="2" width="55" label="瀹㈡埛缂栧彿"    />
-
-      <el-table-column  prop="3" width="120" label="瀹㈡埛鍚嶇О"    />
-
-      <el-table-column  prop="4" width="120" label="椤圭洰鍚嶇О"   />
-
-      <el-table-column  prop="5" label="鎵规"     />
-
-      <el-table-column  prop="6" width="100" label="鎬婚噾棰�"     />
-
-      <el-table-column  prop="7" label="鏁伴噺"     />
-
-      <el-table-column  prop="8" width="100" label="缁撶畻闈㈢Н"    />
-
-      <el-table-column  prop="9" width="100" label="瀹為檯闈㈢Н"    />
-
-      <el-table-column  prop="10" width="100" label="鎶ヨ〃鏃ユ湡" />
-
-      <el-table-column  prop="11" width="100" label="鍖呰鏂瑰紡" />
-
-      <el-table-column  prop="12" width="100" label="璁㈠崟绫诲瀷" />
-
-      <el-table-column  prop="13" label="涓氬姟鍛�" />
-
-      <el-table-column  prop="14" width="100" label="瀹㈡埛鎵规" />
-
-      <el-table-column  prop="15" width="100" label="浜よ揣鏃ユ湡" />
+      <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>
 
 
-
-    </el-table>
   </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