From d96af1249dbd445707fecd8817d681525bad1dd6 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 28 十一月 2025 17:31:22 +0800
Subject: [PATCH] 海川开心,仓储物流展示字段修改
---
src/views/inventoryManagement/stockManagement/index.vue | 372 +++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 287 insertions(+), 85 deletions(-)
diff --git a/src/views/inventoryManagement/stockManagement/index.vue b/src/views/inventoryManagement/stockManagement/index.vue
index a93aadd..a2253ae 100644
--- a/src/views/inventoryManagement/stockManagement/index.vue
+++ b/src/views/inventoryManagement/stockManagement/index.vue
@@ -1,45 +1,170 @@
<template>
<div class="app-container">
- <div class="search_form">
- <div>
- <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>
- <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"
- clearable prefix-icon="Search" />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
- </div>
- <div>
- <!-- <el-button type="primary" @click="openForm('add')">鏂板</el-button> -->
- <el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
- </div>
- </div>
- <div class="table_list">
- <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
- :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
- :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
- <el-table-column align="center" type="selection" width="55" />
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="搴撳瓨鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被" prop="productCategory" width="100" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200" show-overflow-tooltip />
- <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
- <el-table-column label="搴撳瓨鏁伴噺" prop="inboundNum0" width="100" show-overflow-tooltip />
- <el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="100" show-overflow-tooltip />
- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
- <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
- <template #default="scope">
- <el-button link type="primary" size="small" @click="openForm('edit', scope.row);" :disabled="scope.row.createUser !== userStore.id">缂栬緫</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
- :page="page.current" :limit="page.size" @pagination="paginationChange" />
- </div>
+ <el-tabs v-model="activeTab" @tab-change="handleTabChange">
+ <el-tab-pane label="鐢熶骇鍏ュ簱" name="production">
+ <div class="search_form">
+ <div>
+<!-- <span class="search_title">瀹㈡埛鍚嶇О锛�</span>-->
+<!-- <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"-->
+<!-- clearable prefix-icon="Search" />-->
+ <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+ <el-date-picker
+ v-model="searchForm.timeStr"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ @change="handleQuery"
+ />
+ <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ </div>
+ <div>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
+ :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
+ :row-class-name="tableRowClassName"
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column label="鍏ュ簱鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
+<!-- <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" width="240" show-overflow-tooltip />-->
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
+ <el-table-column label="搴撳瓨鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="寰呭嚭搴撴暟閲�" prop="inboundNum0" width="100" show-overflow-tooltip />
+<!-- <el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="绋庣巼(%)" prop="taxRate" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />-->
+ <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current" :limit="page.size" @pagination="paginationChange" />
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="閲囪喘鍏ュ簱" name="purchase">
+ <div class="search_form">
+ <div>
+<!-- <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>-->
+<!-- <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"-->
+<!-- clearable prefix-icon="Search" />-->
+ <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+ <el-date-picker
+ v-model="searchForm.timeStr"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ @change="handleQuery"
+ />
+ <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ </div>
+ <div>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
+ :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
+ :row-class-name="tableRowClassName"
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column label="鍏ュ簱鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
+<!-- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />-->
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
+ <el-table-column label="搴撳瓨鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" show-overflow-tooltip />
+ <el-table-column label="寰呭嚭搴撴暟閲�" prop="inboundNum0" show-overflow-tooltip />
+ <el-table-column label="搴撳瓨棰勮鏁伴噺" prop="warnNum" width="130" show-overflow-tooltip />
+<!-- <el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="绋庣巼(%)" prop="taxRate" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />-->
+ <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current" :limit="page.size" @pagination="paginationChange" />
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="鑷畾涔夊叆搴�" name="manual">
+ <div class="search_form">
+ <div>
+<!-- <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>-->
+<!-- <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"-->
+<!-- clearable prefix-icon="Search" />-->
+ <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+ <el-date-picker
+ v-model="searchForm.timeStr"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ @change="handleQuery"
+ />
+ <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ </div>
+ <div>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
+ :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
+ :row-class-name="tableRowClassName"
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column label="鍏ュ簱鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
+<!-- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />-->
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" width="120" show-overflow-tooltip />
+ <el-table-column label="搴撳瓨鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="寰呭嚭搴撴暟閲�" prop="inboundNum0" width="100" show-overflow-tooltip />
+<!-- <el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="绋庣巼(%)" prop="taxRate" width="100" show-overflow-tooltip />-->
+<!-- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />-->
+ <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current" :limit="page.size" @pagination="paginationChange" />
+ </div>
+ </el-tab-pane>
+ </el-tabs>
<el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '鏂板搴撳瓨' : '缂栬緫搴撳瓨'" width="70%"
@close="closeDia">
<el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
@@ -51,7 +176,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="浜у搧澶х被锛�" prop="productId">
- <el-select disabled v-model="form.productCategory" placeholder="璇烽�夋嫨" clearable filterable @change="handleProductChange">
+ <el-select disabled v-model="form.productCategory" placeholder="璇烽�夋嫨" clearable filterable>
<el-option v-for="item in productList" :key="item.id" :label="item.productName"
:value="item.productName" />
</el-select>
@@ -61,8 +186,7 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="瑙勬牸鍨嬪彿锛�" prop="productManageId">
- <el-select disabled v-model="form.specificationModel" placeholder="璇峰厛閫夋嫨浜у搧澶х被" clearable filterable :disabled="!form.productCategory"
- @change="handleModelChange">
+ <el-select disabled v-model="form.specificationModel" placeholder="璇峰厛閫夋嫨浜у搧澶х被" clearable filterable :disabled="!form.productCategory">
<el-option v-for="item in productModelList" :key="item.id" :label="item.model"
:value="item.id" />
</el-select>
@@ -115,7 +239,6 @@
</el-col>
</el-row>
<el-row :gutter="30">
-
<el-col :span="12">
<el-form-item label="鍑哄簱浜猴細" prop="entryPerson">
<el-select v-model="form.createUser" placeholder="璇烽�夋嫨" clearable>
@@ -123,6 +246,11 @@
</el-select>
</el-form-item>
</el-col>
+<!-- <el-col :span="12">-->
+<!-- <el-form-item label="搴撳瓨棰勮鏁伴噺锛�" prop="warnNum">-->
+<!-- <el-input v-model="form.warnNum" placeholder="璇疯緭鍏ユ渶浣庡簱瀛�" clearable />-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
</el-row>
</el-form>
<template #footer>
@@ -137,20 +265,23 @@
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
-import { ref } from 'vue'
+import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import { userListNoPageByTenantId } from "@/api/system/user.js";
import { productTreeList,modelList } from "@/api/basicData/product.js"
import {
- getStockManagePage ,
- updateStockManage,
+ getStockManagePage,
+ getStockManagePageByProduction,
+ getStockManagePageByCustom,
delStockManage,
- exportStockManage
} from "@/api/inventoryManagement/stockManage.js";
import {
- updateManagement
+ updateManagement,updateStockIn
} from "@/api/inventoryManagement/stockIn.js";
+
+
+
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const tableData = ref([])
@@ -167,13 +298,16 @@
})
const total = ref(0)
const fileList = ref([])
-
+const loading = ref(false);
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref('')
const dialogFormVisible = ref(false)
+const activeTab = ref('production')
const data = reactive({
searchForm: {
supplierName: '',
+ customerName: '',
+ timeStr: getCurrentDate(),
},
form: {
supplierId: null,
@@ -194,6 +328,8 @@
inboundBatch: '',
stockQuantity: '',
boundTime: '',
+ warnNum: '', // 鏂板鏈�浣庡簱瀛樺瓧娈�
+ salesLedgerProductId: null,
},
rules: {
supplierName: [{ required: true, message: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О', trigger: 'blur' }],
@@ -207,7 +343,8 @@
taxExclusiveTotalPrice: [{ required: true, message: '璇疯緭鍏ヤ笉鍚◣鎬讳环', trigger: 'blur' }],
boundTime: [{ required: true, message: '璇烽�夋嫨搴撳瓨鏃堕棿', trigger: 'change' }],
inboundTime: [{ required: true, message: '璇烽�夋嫨鍏ュ簱鏃堕棿', trigger: 'change' }],
- inboundPerson: [{ required: true, message: '璇烽�夋嫨鍑哄簱浜�', trigger: 'change' }]
+ inboundPerson: [{ required: true, message: '璇烽�夋嫨鍑哄簱浜�', trigger: 'change' }],
+ warnNum: [{ required: true, message: '璇疯緭鍏ユ渶浣庡簱瀛�', trigger: 'blur' }],
}
})
const { searchForm, form, rules } = toRefs(data)
@@ -223,19 +360,49 @@
page.size = obj.limit;
getList()
}
+const buildQueryParams = () => {
+ const params = {
+ ...page,
+ timeStr: searchForm.value.timeStr,
+ }
+ if (activeTab.value === 'production') {
+ params.customerName = searchForm.value.customerName
+ } else {
+ params.supplierName = searchForm.value.supplierName
+ }
+ return params
+}
+
const getList = () => {
tableLoading.value = true
- getStockManagePage({ ...searchForm.value, ...page }).then(res => {
+ const params = buildQueryParams()
+ let apiCall
+ if (activeTab.value === 'production') {
+ apiCall = getStockManagePageByProduction(params)
+ } else if (activeTab.value === 'manual') {
+ apiCall = getStockManagePageByCustom(params)
+ } else {
+ apiCall = getStockManagePage(params)
+ }
+ apiCall.then(res => {
tableLoading.value = false
tableData.value = res.data.records
- console.log('res', res)
- // tableData.value.map(item => {
- // item.children = []
- // })
- // total.value = res.total
+ total.value = res.data.total
+ // 鏁版嵁鍔犺浇瀹屾垚鍚庢鏌ュ簱瀛�
+ // checkStockAndCreatePurchase();
}).catch(() => {
tableLoading.value = false
})
+}
+
+// 鍒囨崲 tab
+const handleTabChange = () => {
+ page.current = 1
+ searchForm.value.supplierName = ''
+ searchForm.value.customerName = ''
+ searchForm.value.timeStr = ''
+ selectedRows.value = []
+ getList()
}
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -252,6 +419,16 @@
return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']);
};
+// 琛ㄦ牸琛岀被鍚�
+const tableRowClassName = ({ row }) => {
+ const stock = Number(row?.inboundNum0 ?? 0);
+ const warn = Number(row?.warnNum ?? 0);
+ if (!Number.isFinite(stock) || !Number.isFinite(warn)) {
+ return '';
+ }
+ return stock < warn ? 'row-low-stock' : '';
+};
+
// 鎵撳紑寮规
const openForm = async (type, row) => {
operationType.value = type
@@ -259,11 +436,6 @@
productData.value = []
let userLists = await userListNoPageByTenantId()
userList.value = userLists.data
- // customerList().then(res => {
- // customerOption.value = res
- // })
- // console.log('userStore.id', userStore.id)
- // form.value.entryPerson = userStore.id
if (type === 'edit') {
form.value = { ...row }
productTreeList().then(res =>{
@@ -276,14 +448,6 @@
}
})
})
-
-
- // getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => {
-
- // form.value.entryPerson = Number(res.entryPerson)
- // productData.value = form.value.productData
- // fileList.value = form.value.salesLedgerFiles
- // })
}
form.value.entryDate = getCurrentDate() // 璁剧疆榛樿褰曞叆鏃ユ湡涓哄綋鍓嶆棩鏈�
dialogFormVisible.value = true
@@ -294,26 +458,39 @@
console.log(form.value)
proxy.$refs["formRef"].validate(valid => {
if (valid) {
- // if (productData.value.length > 0) {
- // form.value.productData = proxy.HaveJson(productData.value)
- // } else {
- // proxy.$modal.msgWarning('璇锋坊鍔犱骇鍝佷俊鎭�')
- // return
- // }
- // let tempFileIds = []
- // if (fileList.value.length > 0) {
- // tempFileIds = fileList.value.map(item => item.tempId)
- // }
- // form.value.tempFileIds = tempFileIds
- // form.value.type = 1
+
updateManagement(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
closeDia()
getList()
+ // 鎻愪氦鍚庢鏌ュ簱瀛樺苟灏濊瘯鍒涘缓璇疯喘鍗�
+ // checkStockAndCreatePurchase();
})
}
})
}
+// 妫�鏌ュ簱瀛樺苟鍒涘缓璇疯喘鍗�
+// const checkStockAndCreatePurchase = async () => {
+// const stockList = tableData.value;
+// // handList()
+// for (const item of stockList) {
+// if (item.inboundNum0 < item.warnNum) {
+// try {
+// const stockInData = {
+// id: item.id,
+// quantityStock: item.warnNum + item.totalInboundNum,// 浣跨敤鏂版牸寮忓寲鍑芥暟
+// };
+// loading.value = true
+// await updateStockIn(stockInData)
+// proxy.$modal.msgSuccess(`浜у搧 ${item.productCategory} 淇敼鍏ュ簱鎴愬姛`)
+// loading.value = false
+// } catch (error) {
+// proxy.$modal.msgError(`浜у搧 ${item.productCategory} 鐢熸垚璇疯喘鍗曞け璐ワ紝璇锋墜鍔ㄥ鐞哷);
+//
+// }
+// }
+// }
+// };
// 鍏抽棴寮规
const closeDia = () => {
proxy.resetForm("formRef")
@@ -330,7 +507,15 @@
type: 'warning',
}
).then(() => {
- proxy.download("/stockin/exportCopy", {}, '搴撳瓨淇℃伅.xlsx')
+ const exportParams = buildQueryParams()
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ let exportUrl = "/stockin/exportCopy"
+ if (activeTab.value === 'production') {
+ exportUrl = "/stockin/exportCopyOne"
+ } else if (activeTab.value === 'manual') {
+ exportUrl = "/stockin/exportCopyTwo"
+ }
+ proxy.download(exportUrl, exportParams, '搴撳瓨淇℃伅.xlsx')
}).catch(() => {
proxy.$modal.msg("宸插彇娑�")
})
@@ -340,7 +525,7 @@
let ids = []
if (selectedRows.value.length > 0) {
// 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.createUser !== userStore.id);
+ const unauthorizedData = selectedRows.value.filter(item => item.createBy !== userStore.nickName);
if (unauthorizedData.length > 0) {
proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
return;
@@ -376,7 +561,24 @@
}
onMounted(() => {
getList()
+ // checkStockAndCreatePurchase();
+ // 姣忓皬鏃舵鏌ヤ竴娆″簱瀛�
+ // const intervalId = setInterval(checkStockAndCreatePurchase, 60 * 60 * 1000);
+
+// onUnmounted(() => {
+// // 缁勪欢鍗歌浇鏃舵竻闄ゅ畾鏃跺櫒
+// clearInterval(intervalId);
+// });
})
</script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+:deep(.row-low-stock td) {
+ background-color: #fde2e2;
+ color: #c45656;
+}
+
+:deep(.row-low-stock:hover > td) {
+ background-color: #fcd4d4;
+}
+</style>
--
Gitblit v1.9.3