From c2b88a03f3d0d5ebe92949e64d17ee4d0ac3f6b7 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 09 九月 2025 15:14:00 +0800
Subject: [PATCH] 发货清空缓存站点

---
 zy-asrs-admin/src/views/loc/locDetl/index.vue |  122 ++++++++++++++++++++++++++++++++++------
 1 files changed, 103 insertions(+), 19 deletions(-)

diff --git a/zy-asrs-admin/src/views/loc/locDetl/index.vue b/zy-asrs-admin/src/views/loc/locDetl/index.vue
index 3bd47b6..2857c42 100644
--- a/zy-asrs-admin/src/views/loc/locDetl/index.vue
+++ b/zy-asrs-admin/src/views/loc/locDetl/index.vue
@@ -8,22 +8,23 @@
 import { formatMessage } from '@/utils/localeUtils.js';
 import useTableSearch from '@/utils/tableUtils.jsx';
 const context = getCurrentInstance()?.appContext.config.globalProperties;
-
 const router = useRouter();
 
 const TABLE_KEY = 'table-locDetl';
 let currentPage = 1;
 let pageSize = 10;
+let allQty = 0;
 const searchInput = ref("")
+const orderBy = ref({});
 const searchParam = ref({
   locNo: null,
   matnr: null,
   orderNo: null,
   batch: null,
   tagId: null,
+  orderType: null,
 })
 const editChild = ref(null)
-
 const state = reactive({
   selectedRowKeys: [],
   loading: false,
@@ -33,7 +34,7 @@
 let tableData = ref([]);
 getColumns();
 getPage();
-
+getTotalQty();
 const {
   getColumnSearchProps,
   handleResizeColumn,
@@ -54,6 +55,19 @@
   state.selectedRowKeys = selectedRowKeys;
 };
 
+
+const handleTableChange = (pagination, filters, sorter) => {
+  if (sorter != null) {
+    if (sorter?.order == "ascend") {
+      orderBy.__v_raw = { order: "asc", field: "createTime" }
+    } else if (sorter?.order == "descend") {
+      orderBy.__v_raw = { order: "desc", field: "createTime" }
+    }
+  }
+
+  getPage()
+}
+
 state.columns = [
   // {
   //   title: formatMessage('db.man_loc_detl.loc_id', '搴撲綅'),
@@ -68,6 +82,13 @@
     width: 140,
     ellipsis: true,
     ...getColumnSearchProps('locNo'),
+  },
+  {
+    title: formatMessage('db.man_loc_detl.loc_type', '搴撲綅绫诲瀷'),
+    dataIndex: 'type$',
+    width: 140,
+    ellipsis: true,
+    ...getColumnSearchProps('type$'),
   },
   {
     title: formatMessage('db.man_loc_detl.matnr', '鍟嗗搧缂栧彿'),
@@ -98,10 +119,39 @@
     ...getColumnSearchProps('model'),
   },
   {
+    title: formatMessage('db.man_loc_detl.matnr', '鍝佺被'),
+    dataIndex: 'tagId$',
+    width: 140,
+    ellipsis: true,
+    ...getColumnSearchProps('tagId$'),
+  },
+  {
+    title: formatMessage('db.man_loc_detl.maktx', '棰滆壊'),
+    dataIndex: 'color',
+    width: 140,
+    ellipsis: true,
+    ...getColumnSearchProps('color'),
+  },
+  {
+    title: formatMessage('db.man_loc_detl.model', '鍝佺墝'),
+    dataIndex: 'brand',
+    width: 140,
+    ellipsis: true,
+    ...getColumnSearchProps('brand'),
+  },
+  {
+    title: formatMessage('db.man_loc_detl.model', '浜у湴'),
+    dataIndex: 'origin',
+    width: 140,
+    ellipsis: true,
+    ...getColumnSearchProps('origin'),
+  },
+  {
     title: formatMessage('db.man_loc_detl.dewell', '鍏ュ簱鏃堕棿'),
     dataIndex: 'dewell$',
     width: 140,
     ellipsis: true,
+    sorter: true,
     ...getColumnSearchProps('dewell$'),
   },
   {
@@ -125,13 +175,13 @@
     ellipsis: true,
     ...getColumnSearchProps('anfme'),
   },
-  // {
-  //   title: formatMessage('db.man_loc_detl.freeze', '鏄惁鍐荤粨'),
-  //   dataIndex: 'freeze$',
-  //   width: 140,
-  //   ellipsis: true,
-  //   ...getColumnSearchProps('freeze$'),
-  // },
+  {
+    title: formatMessage('db.man_loc_detl.freeze', '鏄惁鍐荤粨'),
+    dataIndex: 'freeze$',
+    width: 140,
+    ellipsis: true,
+    ...getColumnSearchProps('freeze$'),
+  },
   {
     title: formatMessage('db.man_loc_detl.status', '鐘舵��'),
     dataIndex: 'status$',
@@ -199,9 +249,30 @@
   }
 }
 
+
+function getTotalQty() {
+  state.loading = true;
+  post('/api/locDetl/all/Qty').then((resp) => {
+    let result = resp.data;
+    if (result.code == 200) {
+      let {data} = result;
+      console.log("------------=======>");
+      allQty = data?.allQty;
+      state.loading = false;
+    } else if (result.code === 401) {
+      message.error(result.msg);
+      logout()
+    } else {
+      message.error(result.msg);
+    }
+  })
+}
+
+
 function getPage() {
   state.loading = true;
   post('/api/locDetl/page', {
+    orderBy: orderBy.__v_raw,
     current: currentPage,
     pageSize: pageSize,
     condition: searchInput.value,
@@ -211,7 +282,6 @@
     if (result.code == 200) {
       let data = result.data;
       tableData.value = data;
-
       state.loading = false;
     } else if (result.code === 401) {
       message.error(result.msg);
@@ -226,8 +296,8 @@
   let content = "鏄惁纭鐢熸垚-->鍑哄簱浠诲姟锛侊紒"
   let type = 2
   if (item?.locNo.indexOf("B") >= 0 || item?.locNo.indexOf("C") >= 0) {
-      content = "鏄惁纭鐢熸垚-->鎷h揣鍗曪紒锛�"
-      type = 1
+    content = "鏄惁纭鐢熸垚-->鎷h揣鍗曪紒锛�"
+    type = 1
   }
   Modal.confirm({
     title: formatMessage('page.delete', '鍑哄簱'),
@@ -243,10 +313,9 @@
         post('/api/out/locs/stock', params).then(resp => {
           let result = resp.data;
           if (result.code === 200) {
-            console.log(result);
             message.success(result.msg);
           } else {
-            message.error(result.msg);    
+            message.error(result.msg);
           }
           getPage()
           hide()
@@ -299,7 +368,7 @@
 };
 
 const onSearch = () => {
-  // console.log('search');
+  currentPage = 1;
   getPage()
 }
 
@@ -313,12 +382,15 @@
   getPage()
 }
 
+const total = computed(() => tableData.value?.records?.reduce((sum, item) => sum + item.anfme, 0))
+
 </script>
 
 <script>
 export default {
-  name: '搴撳瓨鏄庣粏'
+  name: '搴撳瓨鏄庣粏',
 }
+
 </script>
 
 <template>
@@ -337,6 +409,11 @@
           style="width: 140px;margin-right: 10px;" />
         <a-input v-model:value="searchParam.batch" :placeholder="formatMessage('page.locDetl.batch.input', '璇疯緭鍏ユ壒鍙�')"
           style="width: 140px;margin-right: 10px;" />
+        <a-select v-model:value="searchParam.orderType"
+          :placeholder="formatMessage('page.locDetl.orderNo.input', '浠撳簱绫诲瀷')" :options="[
+            { label: '鍏ㄩ儴', value: null }, { label: '绔嬪簱', value: 1 }, { label: '骞冲簱', value: 2 }]"
+          style="width: 140px;margin-right: 10px;">
+        </a-select>
         <a-select v-model:value="searchParam.tagId" :placeholder="formatMessage('page.locDetl.orderNo.input', '璇烽�夋嫨鍝佺被')"
           :options="[
             { label: '榛樿鍒嗙被', value: 10 }, { label: '鏈烘补', value: 11 }, { label: '鍙橀�熺娌�', value: 17 }, { label: '鐏姳濉�', value: 18 },
@@ -355,17 +432,24 @@
     </div>
     <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
       :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
-      :pagination="{ total: tableData.total, onChange: onPageChange }"
+      :pagination="{ total: tableData.total, onChange: onPageChange }" @change="handleTableChange"
       :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="state.columns" @resizeColumn="handleResizeColumn"
       :loading="state.loading">
       <template #bodyCell="{ column, text, record }">
         <template v-if="column.dataIndex === 'oper'">
           <div style="display: flex;justify-content: space-evenly;">
-            <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '鎵嬪姩鍑哄簱') }}</a-button>
+            <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '鎵嬪姩鍑哄簱')
+            }}</a-button>
             <!-- <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '鍒犻櫎')}}</a-button> -->
           </div>
         </template>
       </template>
+      <template #footer>
+        <div style="display: 'flex';">
+          <span>鎬诲簱瀛橈細{{ allQty }} </span>
+          <span>锛� 褰撳墠椤垫�婚噺锛歿{ total }}</span>
+        </div>
+      </template>
     </a-table>
   </div>
 </template>

--
Gitblit v1.9.1