From fe631515b71782a10a750874f6d4582fe027cd22 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 09:32:49 +0800
Subject: [PATCH] 公司-所有的表格添加斑马纹
---
src/views/inventoryManagement/receiptManagement/index.vue | 69 ++++++++++++++++++++++++----------
1 files changed, 48 insertions(+), 21 deletions(-)
diff --git a/src/views/inventoryManagement/receiptManagement/index.vue b/src/views/inventoryManagement/receiptManagement/index.vue
index 734d9e7..238f3fd 100644
--- a/src/views/inventoryManagement/receiptManagement/index.vue
+++ b/src/views/inventoryManagement/receiptManagement/index.vue
@@ -16,24 +16,24 @@
<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)">
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)" stripe>
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="鍏ュ簱鏃堕棿" prop="inboundTime" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鎵规" prop="inboundBatch" width="160" show-overflow-tooltip />
- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="160" show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被" prop="productName" width="100" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="model" width="160" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏃堕棿" prop="createTime" width="100" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鎵规" prop="inboundBatches" width="160" 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="70" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundQuantity" width="90" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="90" 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="80" show-overflow-tooltip />
<el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱浜�" prop="nickName" width="80" 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>
+ <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>
@@ -66,6 +66,7 @@
border
v-loading="loadingProducts"
@selection-change="handleSelectionChange"
+ stripe
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column
@@ -80,9 +81,9 @@
<el-table-column label="渚涘簲鍟�" prop="supplierName" width="100" />
<el-table-column label="閲囪喘鏁伴噺" prop="quantity" width="100" />
<el-table-column label="寰呭叆搴撴暟閲�" prop="quantity0" width="100" />
- <el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="120">
+ <el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="150">
<template #default="scope">
- <el-input v-model="scope.row.quantityStock" type="number" :min="0" :max="scope.row.quantity0" />
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" :max="scope.row.quantity0" />
</template>
</el-table-column>
<el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
@@ -240,6 +241,7 @@
const openForm = async (type, row) => {
operationType.value = type
dialogFormVisible.value = true
+ selectedRows.value = []
if (type === 'add') {
// 鏂板鏃跺垵濮嬪寲琛ㄥ崟
@@ -261,12 +263,17 @@
try {
loadingProducts.value = true
// 鏍规嵁鍚堝悓鍙峰姞杞藉搴旂殑浜у搧鍒楄〃锛堝亣璁� getProductByContract 鏄彲鐢ㄦ帴鍙o級
- const res = await getProductRecordByhetong(form.value.purchaseContractNumber)
+ const res = await selectProductRecordListByPuechaserId({
+ purchaseContractNumber: form.value.purchaseContractNumber,
+ id: row.id
+ });
productList.value = res.data.map(item => ({
...item,
- quantityStock: item.quantityStock || 0 // 濡傛灉宸叉湁鍏ュ簱鏁伴噺鍒欎繚鐣�
+ quantityStock: row.inboundNum // 濡傛灉宸叉湁鍏ュ簱鏁伴噺鍒欎繚鐣�
}))
+ selectedRows.value = productList.value
} catch (error) {
+ console.error('鍔犺浇浜у搧澶辫触:', error)
proxy.$modal.msgError('鍔犺浇浜у搧澶辫触')
productList.value = []
} finally {
@@ -275,18 +282,32 @@
}
}
+ const updatePro = async () => {
+ // 鍑嗗鎻愪氦鏁版嵁
+ // 鍑嗗鎻愪氦鏁版嵁 - 淇敼涓哄悗绔渶瑕佺殑鏍煎紡
+ const stockInData = {
+ id: selectedRows.value[0].recordId,
+ quantityStock: Number(selectedRows.value[0].quantityStock),// 浣跨敤鏂版牸寮忓寲鍑芥暟
+ };
+ await updateStockIn(stockInData)
+ proxy.$modal.msgSuccess('淇敼鍏ュ簱鎴愬姛')
+ closeDia()
+ getList() // 鍒锋柊鍒楄〃
+ }
// 鎻愪氦琛ㄥ崟
const submitForm = async () => {
+ // 楠岃瘉鑷冲皯閫夋嫨浜嗕竴涓骇鍝�
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgError('璇峰厛鏌ヨ骞堕�夋嫨浜у搧')
+ return
+ }
+ if(operationType.value !== 'add'){
+ await updatePro()
+ return
+ }
try {
await proxy.$refs.formRef.validate()
-
- // 楠岃瘉鑷冲皯閫夋嫨浜嗕竴涓骇鍝�
- if (selectedRows.value.length === 0) {
- proxy.$modal.msgError('璇峰厛鏌ヨ骞堕�夋嫨浜у搧')
- return
- }
-
// 楠岃瘉鍏ュ簱鏁伴噺
const invalidProducts = selectedRows.value.filter(
product => product.quantityStock <= 0 || product.quantityStock > product.quantity0
@@ -367,6 +388,12 @@
const handleDelete = () => {
let ids = []
if (selectedRows.value.length > 0) {
+ // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
+ const unauthorizedData = selectedRows.value.filter(item => item.createUser !== userStore.id);
+ if (unauthorizedData.length > 0) {
+ proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+ return;
+ }
ids = selectedRows.value.map(item => item.id);
} else {
proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
@@ -380,7 +407,7 @@
type: 'warning',
}
).then(() => {
- delStockIn(ids).then(res => {
+ delStockIn({ids:ids}).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
getList()
})
--
Gitblit v1.9.3