From f761fc0f9428786d995b774543fea47b26a0d01b Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期一, 25 十二月 2023 11:51:44 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/mm/stockReport/SubsidiaryMonthReport.vue |  323 +++++++++++++++++++++++++++++++++++------------------
 1 files changed, 215 insertions(+), 108 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/mm/stockReport/SubsidiaryMonthReport.vue b/north-glass-erp/northglass-erp/src/views/mm/stockReport/SubsidiaryMonthReport.vue
index f87630b..5c6c1bb 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/stockReport/SubsidiaryMonthReport.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/stockReport/SubsidiaryMonthReport.vue
@@ -1,6 +1,6 @@
 <template>
   <el-container>
-    <el-header class="m-header" style="height: auto">
+    <el-header class="m-header">
       <el-row :gutter="10">
         <el-col :span="6">
           <el-date-picker
@@ -23,63 +23,47 @@
               :icon="Search"
               @click="autoAddRow">鏌ヨ
           </el-button>
-
         </el-col>
-
       </el-row>
     </el-header>
     <el-main style="padding-top: 5px">
-      <el-table :data="tableData" style="width: 100%" max-height="550" border show-summary sum-text=" "
-                empty-text="鏆傛棤鏁版嵁">
-        <el-table-column fixed="left" prop="rIndex" label="" width="50" align="center"></el-table-column>
+      <vxe-grid
+          max-height="600"
+          @filter-change="filterChanged"
+          class="mytable-scrollbar"
+          ref="xGrid"
+          v-bind="gridOptions"
+          @="gridEvents"
+      >
 
-        <el-table-column fixed="left" label="鎿嶄綔" width="120">
-          <template #default="scope">
-            <el-button
-                link
-                type="primary"
-                size="small"
-                @click.prevent="deleteRow(scope.$index)"
-            >
-              鍒犻櫎
-            </el-button>
-            <el-button
-                link
-                type="primary"
-                size="small"
-                @click.prevent="deleteRow(scope.$index)"
-            >
-              缂栬緫
-            </el-button>
-          </template>
-        </el-table-column>
+        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
+        <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+        <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>
+          <!--          <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</el-button>-->
+          <!--          <el-button @click="cellClickEvent" link type="primary" size="small">璇︽儏</el-button>-->
+        </template>
 
 
-        <el-table-column prop="name" label="搴撳瓨缁勭粐" width="150"/>
-        <el-table-column prop="wlNumber" label="鐗╂枡缂栫爜" width="150"/>
-        <el-table-column prop="state" label="鐗╂枡鍚嶇О" width="120"/>
-        <el-table-column prop="city" label="浜у湴" width="120"/>
-        <el-table-column prop="kcNumber" label="搴撳瓨缂栧彿" width="150"/>
-        <el-table-column prop="width" sortable label="瀹藉害" width="120"/>
-        <el-table-column prop="height" sortable label="楂樺害" width="120"/>
-        <el-table-column prop="thick" sortable label="鍘氬害" width="120"/>
-        <el-table-column prop="zip" label="涓诲崟浣�" width="120"/>
-        <el-table-column prop="number" label="瀹夊叏搴撳瓨" width="120"/>
-        <el-table-column prop="number" sortable label="搴撳瓨鏁�" width="120"/>
-        <el-table-column prop="number" label="鍙敤搴撳瓨" width="120" show-summary="ture"/>
-        <el-table-column prop="number" label="鏈鏁伴噺" width="120"/>
-        <el-table-column prop="zip" sortable label="鎬婚潰绉�" width="120"/>
-        <el-table-column prop="zip" label="鍗曠墖闈㈢Н" width="120"/>
-        <el-table-column prop="date" label="鐢熶骇鏃ユ湡" width="120"/>
-        <el-table-column prop="date" label="淇濊川鏈�" width="120"/>
-        <el-table-column prop="zip" label="搴撳瓨缂栧彿" width="120"/>
-        <el-table-column prop="zip" label="搴撳尯" width="120"/>
-        <el-table-column prop="zip" label="搴撲綅" width="120"/>
-        <el-table-column prop="zip" label="绉帇搴撳瓨" width="120"/>
-        <el-table-column prop="zip" label="澶囨敞" width="120"/>
+        <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>
     </el-main>
   </el-container>
 </template>
@@ -87,75 +71,198 @@
 
 <script setup>
 
-import {ref} from 'vue'
-import dayjs from 'dayjs'
+import {ref} from "vue";
+import {reactive} from "vue";
+import {useRouter} from 'vue-router'
+import {Search} from "@element-plus/icons-vue";
+import dayjs from "dayjs";
+import {VXETable} from "vxe-table";
+let router = useRouter()
 
-const now = new Date()
+//缁勪欢鎺ユ敹鍙傛暟
+const gridOptions = reactive({
+  border: "full",//琛ㄦ牸鍔犺竟妗�
+  keepSource: true,//淇濇寔婧愭暟鎹�
+  align: 'center',//鏂囧瓧灞呬腑
+  stripe: true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true, height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'CustomerList',
+  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: [
+    /* {title: '鎿嶄綔', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},*/
+    {type: 'seq', fixed: "left", title: ' ', width: 50},
+    /*{ type: 'checkbox',fixed:"left", title: '', width: 50 },*/
+    {type: 'expand', title:'璇︽儏', fixed: "left", slots: {content: 'content'}, width: 50},
+    {field: 'cgdh', width: '10%', title: '搴撳瓨缁勭粐', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'cgzt', width: '10%', title: '鐗╂枡缂栫爜', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'gys', width: '10%',title: '鐗╂枡鍚嶇О', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'wlbh', width: '10%',title: '浜у湴', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'wlmc', width: '10%', title: '搴撳瓨缂栧彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'w', width: '8%',title: '瀹藉害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'g', width: '8%',title: '楂樺害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'h', width: '8%',title: '鍘氬害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'xh', width: '8%',title: '涓诲崟浣�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'dw', width: '8%',title: '瀹夊叏搴撳瓨', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: '6', width: '12%',title: '搴撳瓨鏁�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'sl', width: '8%',title: '鍙敤搴撳瓨', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'sl', width: '12%',title: '鏈鏁伴噺', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'je', width: '8%',title: '鎬婚潰绉�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'je', width: '12%',title: '鍗曠墖闈㈢Н', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: '6', width: '8%',title: '鐢熶骇鏃ユ湡', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'sl', width: '8%',title: '淇濊川鏈�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'yl', width: '10%',title: '搴撳瓨缂栧彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'yl', width: '10%',title: '搴撳尯', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'cgzt', width: '10%',title: '搴撲綅', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'xsdh', width: '10%',title: '绉帇搴撳瓨', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: '6', width: '10%',title: '澶囨敞', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
+  ],//琛ㄥご鍙傛暟
+  toolbarConfig: {
+    buttons: [{type:'text'},{type:'text',name:'杈呮枡鏈堢粨鎶ヨ〃'}],
+    import: false,
+    export: true,
+    print: true,
+    zoom: true,
+    custom: true,
+    style: 'paddling-left:10px'
+  },//琛ㄥご鎸夐挳
+  data: [
+    {},{},{},{},{},{},{},{},{},{},{},
+  ],//table body瀹為檯鏁版嵁
+  mergeFooterItems: [
+    {row: 0, col: 0, rowspan: 1, colspan: 2}
+  ],//鍚堝苟鑴�
+  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 getTableRow = (row, type) => {
+  switch (type) {
+    case 'edit' : {
+      //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+      router.push({path: '/main/purchaseOrder/CreatePurchaseOrder', query: {id: row.id}})
+      break
+    }
+    case 'delete': {
 
-const tableData = ref([
 
-])
 
-const autoAddRow = () => {
-  for (let i = 0; i < 10; i++) {
-    const randomKCInt = Math.floor(Math.random() * 9999) + 10000;
-    const randomInt = Math.floor(Math.random() * 999) + 1000;
-    const randomZZInt = Math.floor(Math.random() * 99) + 100;
-    const randomSumInt = Math.floor(Math.random() * 99) + 10;
-    const kcThick = i % 3 === 0 ? 5 : i % 4 === 0 ? 6 : i % 5 === 0 ? 8 : 10;
-    now.setDate(now.getDate() + 1)
-    tableData.value.push({
-      date: dayjs(now).format('YYYY-MM-DD'),
-      name: '鐗╂枡缁勭粐' + randomZZInt,
-      state: '鐗╂枡' + randomSumInt,
-      city: '浜у湴' + (randomSumInt * 6),
-      address: 'No. 189, Grove St, Los Angeles',
-      zip: 'CA 90036',
-      number: 666 + 66 * i,
-      width: '3660',
-      height: '2440',
-      rIndex: tableData.value.length + 1,
-      wlNumber: 'NGWL1000' + randomInt,
-      kcNumber: 'NGKC100' + randomKCInt,
-      thick: kcThick
-    })
+      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅'+row.id)
+      break
+    }
   }
+}
+const xGrid = ref()
+const gridEvents = {
+  toolbarButtonClick({code}) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (code) {
+        case 'Add': {//鏂板
+          router.push({path: '/main/purchaseOrder/CreatePurchaseOrder'})
+          break
+        }
+        case 'Storage': {//鍏ュ簱
+          if ($grid.getCheckboxRecords().length === 0) {
+            openAlert({type: 'message', content: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�', status: 'warning'})
+            //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+            return
+          } else {
+            const type = VXETable.modal.confirm('鎮ㄩ�夋嫨浜�' + $grid.getCheckboxRecords().length + '鏉℃暟鎹紒,鏄惁纭鍏ュ簱锛�');
+            //openAlert({type:'alert', content: '鎴愬姛鍏ュ簱'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success' })
+            //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+            return
+          }
+          break
+        }
+        case 'Return': {//閫�搴�
+          if ($grid.getCheckboxRecords().length === 0) {
+            openAlert({type: 'message', content: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�', status: 'warning'})
+            //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+            return
+          } else {
+            /*            async ()=>{
+              const type = await.VXETable.modal.confirm('鎮ㄩ�夋嫨浜�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒,鏄惁纭閫�搴擄紵');
+            }*/
+            const type = VXETable.modal.confirm('鎮ㄩ�夋嫨浜�' + $grid.getCheckboxRecords().length + '鏉℃暟鎹紒,鏄惁纭閫�搴擄紵');
+
+
+            /* if(VXETable.modal.confirm('鎮ㄩ�夋嫨浜�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒,鏄惁纭閫�搴擄紵' )){
+              //openAlert({type:'message', content: '鎴愬姛閫�搴�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success',lockView: false, mask: false })
+
+
+            }*/
+
+            /* if(type==='confirm'){
+              openAlert({type:'message', content: '鎴愬姛閫�搴�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success' })
+            }
+
+*/
+            //openAlert({type:'alert', content: '鎴愬姛閫�搴�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success' })
+            //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+            return
+          }
+          break
+        }
+      }
+    }
+  },
+  toolbarToolClick({code}) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (code) {
+        case 'myPrint': {
+          $grid.print()
+          break
+        }
+      }
+    }
+  },
+}
+
+const openAlert = (options) => {
+  if(options.type==='message'){
+    VXETable.modal.message(options)
+  }else{
+    VXETable.modal.alert(options)
+  }
+
 }
 
 </script>
 
 
 <style scoped>
-.el-row {
-  margin-bottom: 20px;
-}
-
-.el-row:last-child {
-  margin-bottom: 0;
-}
-
-.el-col {
-  border-radius: 4px;
-}
-
 .m-header {
-  height: 32px;
-}
-
-#main {
-  width: 100%;
-  height: 100%;
-}
-
-#div-title {
-  height: 5%;
-  width: 100%;
-  padding-left: 20px;
-}
-
-#main-body {
-  width: 100%;
-  height: 64%;
-  margin-top: 1%;
+  height: auto
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0