guoyujia 9 月之前
父節點
當前提交
3e1a5c13a5
共有 4 個文件被更改,包括 151 次插入9 次删除
  1. 7 1
      src/api/business/taksStockLot.js
  2. 101 0
      src/components/PaginationMax/index.vue
  3. 3 0
      src/main.js
  4. 40 8
      src/views/business/inventoryCheck/form.vue

+ 7 - 1
src/api/business/taksStockLot.js

@@ -17,7 +17,13 @@ export function getTaksStockLot(id) {
     method: 'get'
   })
 }
-
+export function updateNoStartLot(data) {
+  return request({
+    url:baseUrl + '/business/taksStockLot/updateNoStartLot',
+    method: 'post',
+    data: data
+  })
+}
 // 新增盘点批次信息
 export function addTaksStockLot(data) {
   return request({

+ 101 - 0
src/components/PaginationMax/index.vue

@@ -0,0 +1,101 @@
+<template>
+  <div :class="{ 'hidden': hidden }" class="pagination-container">
+    <el-pagination
+      :background="background"
+      v-model:current-page="currentPage"
+      v-model:page-size="pageSize"
+      :layout="layout"
+      :page-sizes="pageSizes"
+      :pager-count="pagerCount"
+      :total="total"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+    />
+  </div>
+</template>
+
+<script setup>
+import { scrollTo } from '@/utils/scroll-to'
+
+const props = defineProps({
+  total: {
+    required: true,
+    type: Number
+  },
+  page: {
+    type: Number,
+    default: 1
+  },
+  limit: {
+    type: Number,
+    default: 20
+  },
+  pageSizes: {
+    type: Array,
+    default() {
+      return [50, 100, 200]
+    }
+  },
+  // 移动端页码按钮的数量端默认值5
+  pagerCount: {
+    type: Number,
+    default: document.body.clientWidth < 992 ? 5 : 7
+  },
+  layout: {
+    type: String,
+    default: 'total, sizes, prev, pager, next, jumper'
+  },
+  background: {
+    type: Boolean,
+    default: true
+  },
+  autoScroll: {
+    type: Boolean,
+    default: true
+  },
+  hidden: {
+    type: Boolean,
+    default: false
+  }
+})
+
+const emit = defineEmits();
+const currentPage = computed({
+  get() {
+    return props.page
+  },
+  set(val) {
+    emit('update:page', val)
+  }
+})
+const pageSize = computed({
+  get() {
+    return props.limit
+  },
+  set(val){
+    emit('update:limit', val)
+  }
+})
+function handleSizeChange(val) {
+  if (currentPage.value * val > props.total) {
+    currentPage.value = 1
+  }
+  emit('pagination', { page: currentPage.value, limit: val })
+  if (props.autoScroll) {
+    scrollTo(0, 800)
+  }
+}
+function handleCurrentChange(val) {
+  emit('pagination', { page: val, limit: pageSize.value })
+  if (props.autoScroll) {
+    scrollTo(0, 800)
+  }
+}
+
+</script>
+
+<style scoped>
+.pagination-container.hidden {
+  display: none;
+}
+</style>

+ 3 - 0
src/main.js

@@ -41,6 +41,8 @@ import { deepClone } from '@/utils/index'
 
 // 分页组件
 import Pagination from '@/components/Pagination'
+// 分页组件
+import PaginationMax from '@/components/PaginationMax'
 // 自定义表格工具组件
 import RightToolbar from '@/components/RightToolbar'
 // 文件上传组件
@@ -78,6 +80,7 @@ app.config.globalProperties.echarts = echarts
 // 全局组件挂载
 app.component('DictTag', DictTag)
 app.component('Pagination', Pagination)
+app.component('PaginationMax', PaginationMax)
 app.component('TreeSelect', TreeSelect)
 app.component('FileUpload', FileUpload)
 app.component('ImageUpload', ImageUpload)

+ 40 - 8
src/views/business/inventoryCheck/form.vue

@@ -62,15 +62,31 @@
                 <el-form-item style="margin-left: 0">
                     <el-button type="info" icon="Search" @click="handleQuery">搜索
                     </el-button>
+                    <el-button :disabled="queryParams.deptId == null || queryParams.deptId == '0'" type="primary" icon="Check" @click="handleTaksLot">一键盘点未开始批次
+                    </el-button>
                 </el-form-item>
             </el-form>
       <div class="el-table-container">
         <div class="el-table-inner-container">
           <el-table v-loading="loading" :data="dataList" size="small" border height="100%">
             <el-table-column label="行号" type="index" align="center" width="48" />
-            <el-table-column label="计划单号" align="center" prop="productionPlanNo" width="104" />
-            <el-table-column label="批次号" align="center" prop="lotCode" width="104" />
+            <el-table-column
+            label="批次号"
+            prop="lotCode"
+            align="center"
+            width="120px"
+          >
+            <template #default="scope">
+              <el-button
+                link
+                type="primary"
+                @click="handleColumnClick(scope.row.lotCode)"
+                ><span>{{ scope.row.lotCode }}</span></el-button
+              >
+            </template>
+          </el-table-column>
             <el-table-column label="产品描述" align="center" prop="productDescription"  />
+            <el-table-column label="箱号" align="center" prop="carrierName" width="120" />
             <el-table-column label="生产状态" prop="isProductStatus" width="90" align="center" >
                             <template #default="scope">
                                 <dict-tag :options="inventory_production_status" :value="scope.row.isProductStatus" />
@@ -169,17 +185,18 @@
       
       </div>
              <!-- 分页 -->
-             <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
-                v-model:limit="queryParams.pageSize" @pagination="getList" />
+             <paginationMax v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                v-model:limit="queryParams.pageSize"  @pagination="getList" />
     </div>
   </el-drawer>
 </template>
 <script setup>
 import {
-  listTaksStockLot,updateTaksStockLot
+  listTaksStockLot,updateTaksStockLot,updateNoStartLot
 } from "@/api/business/taksStockLot";
 import { getDeptList } from "@/api/business/planDetailSubDetail.js";
 import { ref } from "vue";
+import router from "@/router";
 const { proxy } = getCurrentInstance();
 /** 字典 */
 const { is_identification } = proxy.useDict("is_identification");
@@ -197,7 +214,7 @@ const dataList = ref([])
 /** 查询对象 */
 const queryParams = ref({
   pageNum: 1,
-  pageSize: 10,
+  pageSize: 50,
   productDescription: "",
   lotCode: "",
   deptId: null,
@@ -214,7 +231,6 @@ const open = (row) => {
   getDeptList().then((response) => {
         deptList.value = response.data.rows;
         isDispatch.value = response.data.others.isDispatch;
-        loading.value = false;
         if (isDispatch.value) {
             deptList.value.unshift({ label: "全部", value: "0" });
         } 
@@ -224,6 +240,7 @@ const open = (row) => {
     });
 }
 function getList() {
+  loading.value = true
   listTaksStockLot(queryParams.value).then(res =>{
     res.rows.forEach(element => {
       element.isTaksStock = element.isTaksStock +""
@@ -231,6 +248,7 @@ function getList() {
     });
     dataList.value = res.rows;
     total.value = res.total;
+    loading.value = false
   })
 }
 function handleEdit(row,index) {
@@ -241,6 +259,16 @@ function handleEdit(row,index) {
   }
   console.log(row)
 }
+//一键盘点
+function handleTaksLot() {
+  console.log(queryParams.value.deptId)
+  updateNoStartLot({takeStockPeriodId:queryParams.value.takeStockPeriodId,deptId:queryParams.value.deptId}).then(res =>{
+    if(res.code == 200){
+      proxy.$modal.msgSuccess("盘点成功");
+      getList()
+    }
+  })
+}
 function handleSave(row) {
   updateTaksStockLot(row).then(res =>{
     if(res.code == 200){
@@ -249,6 +277,10 @@ function handleSave(row) {
     }
   })
 }
+/** 打开批次详情页 */
+function handleColumnClick(lotCode) {
+  router.push({ path: "/reviseBath/lotFormParticulars/" + lotCode });
+}
 function handleChangeTaksStock(value,row,index) {
 if(value == 0) {
   dataList.value[index].taksStockNum = 0
@@ -276,7 +308,7 @@ const cancel = () => {
 const reset = () => {
   queryParams.value = {
   pageNum: 1,
-  pageSize: 10,
+  pageSize: 50,
   productDescription: "",
   lotCode: "",
   deptId: null,