spring
10 小时以前 5ae955a6e8445717bcabb55c944334f0944f3b49
fix: 库存管理合格库区分成品和其他成品
已修改1个文件
34 ■■■■ 文件已修改
src/views/inventoryManagement/stockManagement/Qualified.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/Qualified.vue
@@ -2,11 +2,16 @@
  <div class="app-container">
    <div class="search_form">
      <div>
        <span class="search_title ml10">产品大类:</span>
        <span class="search_title ml10">产品类型:</span>
        <el-radio-group v-model="productScope" class="qualified-product-scope" @change="onProductScopeChange">
          <el-radio-button label="成品">成品</el-radio-button>
          <el-radio-button label="其他产品">其他产品</el-radio-button>
        </el-radio-group>
        <!-- <span class="search_title ml10" style="margin-left: 20px">产品大类:</span>
        <el-input v-model="searchForm.productName"
                  style="width: 240px"
                  placeholder="请输入"
                  clearable/>
                  clearable/> -->
        <span class="search_title ml10" style="margin-left: 20px">规格型号:</span>
        <el-input v-model="searchForm.model"
                  style="width: 240px"
@@ -87,7 +92,7 @@
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
import { ref, reactive, toRefs, onMounted, getCurrentInstance, defineAsyncComponent } from 'vue'
import {ElMessage, ElMessageBox} from "element-plus";
import { getStockInventoryListPage } from "@/api/inventoryManagement/stockInventory.js";
const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue"));
@@ -124,6 +129,21 @@
})
const { searchForm } = toRefs(data)
// 成品(2) / 其他产品(原材料1、半成品3),与产品类型字典一致;分页接口需支持 productType 或 productTypes
const productScope = ref('成品')
const getProductScopeParams = () => {
  if (productScope.value === '成品') {
    return { productType: 2 }
  }
  return { productTypes: '1,3' }
}
const onProductScopeChange = () => {
  page.current = 1
  getList()
}
// 查询列表
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -137,7 +157,7 @@
}
const getList = () => {
  tableLoading.value = true
  getStockInventoryListPage({ ...searchForm.value, ...page }).then(res => {
  getStockInventoryListPage({ ...searchForm.value, ...page, ...getProductScopeParams() }).then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    total.value = res.data.total
@@ -207,7 +227,7 @@
    type: 'warning',
  }
  ).then(() => {
    proxy.download("/stockInventory/exportStockInventory", {}, '合格库存信息.xlsx')
    proxy.download("/stockInventory/exportStockInventory", { ...searchForm.value, ...getProductScopeParams() }, '合格库存信息.xlsx')
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
@@ -219,6 +239,10 @@
</script>
<style scoped lang="scss">
.qualified-product-scope {
  vertical-align: middle;
}
:deep(.row-low-stock td) {
  background-color: #fde2e2;
  color: #c45656;