فهرست منبع

3.0.71 修改表格

liuyanpeng 2 سال پیش
والد
کامیت
95535d192d

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-eam-v3",
   "description": "Leanwo Prodog Client",
-  "version": "3.0.69",
+  "version": "3.0.71",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 1 - 1
src/api/printer/printer.js

@@ -63,7 +63,7 @@ export default {
   connectNodeRed: function (resolve, reject, commandStr) {
     const _self = this;
     let printers = null;
-    let socketUrl = 'ws://192.168.1.129:10092';
+    let socketUrl = 'ws://127.0.0.1:10092';
 
     _self.webSocket = new WebSocket(socketUrl);
     _self.webSocket.onopen = function (event) {

+ 10 - 0
src/common/utils.js

@@ -0,0 +1,10 @@
+// 防抖函数
+export const debounce = (fn, wait = 1000) => {
+  let timer;
+  return function (...args) {
+    clearTimeout(timer);
+    timer = setTimeout(() => {
+      fn.call(this, args);
+    }, wait);
+  };
+};

+ 7 - 1
src/components/customer/InventoryDataProcessing.vue

@@ -81,7 +81,6 @@ export default {
     width: 100%;
     /*视口被均分为 100 单位的 vh 占据整个窗口,扣掉顶部 topNav 的距离后,计算得到 responseOrganizationSelect 的高度*/
     height: calc(100vh - 130px);
-    margin-top: 10px;
   }
 
   .grid-item-1 {
@@ -111,4 +110,11 @@ export default {
   .div-form {
     margin-bottom: 10px;
   }
+  #step-container{
+    margin: 0 !important;
+  }
+  .ant-divider-horizontal {
+    margin: 8px 0;
+  }
+
 </style>

+ 31 - 15
src/components/customer/InventoryDataProcessingStep4.vue

@@ -2,18 +2,27 @@
   <div>
     <div>
       <label>单据号</label>
-      <a-input v-model:value="searchParams.documentNo" class="common" @press-enter="searchChange" />
+      <a-input
+        v-model:value="searchParams.documentNo"
+        class="common"
+        @press-enter="searchChange"
+      />
       <label class="common">单据名称</label>
-      <a-input v-model:value="searchParams.documentName" class="common" @press-enter="searchChange" />
+      <a-input
+        v-model:value="searchParams.documentName"
+        class="common"
+        @press-enter="searchChange"
+      />
       <a-button class="common" type="primary" @click="searchChange">
         查询
       </a-button>
     </div>
     <CommonTable
+      ref="table"
       :columns="columns"
       :data-source="dataSource"
       :total="total"
-      @get-page="getPageParams"
+      @get-pager="getPageParams"
     >
       <template #bodyCell="{ column, record }">
         <template v-if="column.key === 'processed'">
@@ -36,13 +45,17 @@
           >
             关闭
           </a-button>
-          <a-button v-if="record.processed === true" type="primary" @click="operate(record)">
+          <a-button
+            v-if="record.processed === true"
+            type="primary"
+            @click="operate(record)"
+          >
             打开
           </a-button>
         </template>
       </template>
     </CommonTable>
-    <a-button style="margin-top: 20px" type="primary" @click="previous">
+    <a-button class="previousBtn" type="primary" @click="previous">
       上一步
     </a-button>
   </div>
@@ -51,11 +64,11 @@
 import Common from '../../common/Common';
 import { SqlApi, Notify } from 'pc-component-v3';
 import { ref, reactive, defineEmits, onMounted, createVNode } from 'vue';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../../common/CommonTable.vue';
 import { Modal } from 'ant-design-vue';
 import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import AssetInventoryResource from '../../api/asset/AssetInventoryResource.js';
-
+import { debounce } from '../../common/utils.js';
 // 查询参数
 const searchParams = reactive({
   documentNo: '',
@@ -76,13 +89,13 @@ const columns = reactive(
       title: '单据号',
       key: 'documentNo',
       dataIndex: 'documentNo',
-      width:200,
+      width: 200,
     },
     {
       title: '单据名称',
       key: 'name',
       dataIndex: 'name',
-      width:200,
+      width: 200,
     },
     {
       title: '盘点状态',
@@ -108,13 +121,13 @@ const columns = reactive(
       title: '操作',
       key: 'operation',
       dataIndex: 'operation',
-      fixed:'right',
+      fixed: 'right',
     },
   ].map(item => ({ ...item, align: 'center' })),
 );
 const dataSource = ref([]);
 const total = ref(0); // 数据总数
-
+const table = ref();
 // 打开关闭盘点单操作
 const operate = record => {
   Modal.confirm({
@@ -145,10 +158,9 @@ const operate = record => {
 };
 
 // 查询按钮功能
-const searchChange = () => {
-  searchParams.offset = 0;
-  queryAssetDiscovery();
-};
+const searchChange = debounce(() => {
+  table.value.backFirstPage();
+}, 500);
 
 const emits = defineEmits(['previous']);
 // const amisWindowNo = '20220516_164216';
@@ -193,4 +205,8 @@ input {
 .common {
   margin-left: 8px;
 }
+.previousBtn {
+    position: fixed;
+    top: 93%;
+  }
 </style>

+ 1 - 1
src/components/customer/ManuallyConfirmCountingDataStep1.vue

@@ -78,7 +78,7 @@ import { SqlApi, Notify, Uuid } from 'pc-component-v3';
 import { ref, reactive, defineEmits, onMounted } from 'vue';
 import { useRouter } from 'vue-router';
 import CommonTable from '../../common/CommonTable.vue';
-import { debounce } from '../rfidRecord/configDatas';
+import { debounce } from '../../common/utils.js';
 
 const emits = defineEmits(['changeStep']);
 const router = useRouter();

+ 17 - 9
src/components/customer/PerformInventoryTasks.vue

@@ -22,7 +22,7 @@
               type="text"
               class="common form-control"
               placeholder="资产名称"
-              @keyup.enter="getAssetInventoryLine(false)"
+              @keyup.enter="searchDatas"
             />
           </div>
           <div class="form-group">
@@ -34,7 +34,7 @@
               type="text"
               class="common form-control"
               placeholder="资产编号"
-              @keyup.enter="getAssetInventoryLine(false)"
+              @keyup.enter="searchDatas"
             />
           </div>
           <div class="form-group">
@@ -46,13 +46,13 @@
               type="text"
               class="common form-control"
               placeholder="卡片编号"
-              @keyup.enter="getAssetInventoryLine()"
+              @keyup.enter="searchDatas"
             />
           </div>
           <a-button
             type="primary"
             class="common"
-            @click="getAssetInventoryLine()"
+            @click="searchDatas"
           >
             查询
           </a-button>
@@ -64,10 +64,11 @@
     </div>
 
     <CommonTable
+      ref="table"
       :columns="columns"
       :data-source="dataSource"
       :total="pagination.total"
-      @get-page="getPageParams"
+      @get-pager="getPageParams"
     >
       <template #bodyCell="{ column, record, index }">
         <template v-if="column.key == 'useStatusId'">
@@ -112,7 +113,7 @@
       </template>
     </CommonTable>
     <div>
-      <a-button v-if="currentStep == 1" type="primary" @click="previous">
+      <a-button v-if="currentStep == 1" type="primary" class="previousBtn" @click="previous">
         上一步
       </a-button>
     </div>
@@ -152,7 +153,7 @@ import AssetInventoryLineResource from '../../api/asset/AssetInventoryLineResour
 import { Notify, Uuid } from 'pc-component-v3';
 import { SqlApi } from 'pc-component-v3';
 import UseStatusResource from '../../api/asset/UseStatusResource.js';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../../common/CommonTable.vue';
 
 export default {
   components: {
@@ -339,6 +340,9 @@ export default {
       this.pagination.per_page = length;
       this.getAssetInventoryLine();
     },
+    searchDatas: function () {
+      this.$refs.table.backFirstPage();
+    },
 
     /**
      * 查询盘点单DTO,
@@ -370,7 +374,7 @@ export default {
      */
     getAssetInventoryLine: function () {
       var _self = this;
-      _self.pagination.current_page = 1;
+      // _self.pagination.current_page = 1;
 
       // if (!isPageChange) {
       //   _self.pagination.current_page = 1;
@@ -464,7 +468,7 @@ export default {
       this.assetName = null;
       this.assetNo = null;
       this.cardNo = null;
-      this.getAssetInventoryLine();
+      this.searchDatas();
     },
 
     /**
@@ -655,4 +659,8 @@ table.fixed-table td {
 :deep(.ant-table-pagination.ant-pagination) {
   margin: 4px 0;
 }
+.previousBtn {
+  position: fixed;
+  top: 90%;
+}
 </style>