From 60a702a3dbcbe6e16a26faab49e66d710d1f8656 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 28 十一月 2025 14:57:36 +0800
Subject: [PATCH] 湟水峡-销售台账/采购台账,有可能同一个公司不同单子,但是开票登记的时候会一起,一对多或者多对一
---
src/views/inventoryManagement/issueManagement/index.vue | 111 +++++++++++++++++++------------------------------------
1 files changed, 38 insertions(+), 73 deletions(-)
diff --git a/src/views/inventoryManagement/issueManagement/index.vue b/src/views/inventoryManagement/issueManagement/index.vue
index 859dc94..dec04a5 100644
--- a/src/views/inventoryManagement/issueManagement/index.vue
+++ b/src/views/inventoryManagement/issueManagement/index.vue
@@ -5,12 +5,20 @@
<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 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">
@@ -21,12 +29,11 @@
<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="inboundBatches" width="160" show-overflow-tooltip />
- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" 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="160" 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="inboundNum" width="90" show-overflow-tooltip />
- <el-table-column label="搴撳瓨鏁伴噺" prop="inboundNum0" 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 />
@@ -44,7 +51,7 @@
<el-dialog v-model="dialogFormVisible" :title="'鏂板鍑哄簱'" width="40%" @close="closeDia">
<el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
<el-form-item label="鍑哄簱鏁伴噺锛�" prop="salesContractNo">
- <el-input v-model="form.inboundQuantity" placeholder="璇疯緭鍏�" clearable />
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inboundQuantity" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
<el-form-item label="鍑哄簱鏃ユ湡锛�" prop="projectName">
<el-date-picker style="width: 100%" v-model="form.inboundTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
@@ -68,17 +75,15 @@
<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 {
- getStockInPage
+ getStockInPage,
} from "@/api/inventoryManagement/stockIn.js";
import {
- getStockManagePage,
- delStockManage,
- stockOut,
+ stockOut,
} from "@/api/inventoryManagement/stockManage.js";
const userStore = useUserStore()
@@ -92,17 +97,13 @@
size: 100,
})
const total = ref(0)
-const fileList = ref([])
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const dialogFormVisible = ref(false)
const data = reactive({
searchForm: {
supplierName: '',
- inboundQuantity:'',
- inboundTime:'',
- nickName: '',
- userId: '',
+ timeStr: '',
},
form: {
productrecordId: '',
@@ -128,34 +129,24 @@
}
const getList = () => {
tableLoading.value = true
- getStockInPage({ ...searchForm.value, ...page }).then(res => {
+ const params = {
+ ...page,
+ supplierName: searchForm.value.supplierName,
+ timeStr: searchForm.value.timeStr
+ }
+
+ getStockInPage(params).then(res => {
tableLoading.value = false
tableData.value = res.data.records
- console.log('res', res.data.records)
+ total.value = res.data.total
}).catch(() => {
tableLoading.value = false
})
}
-const findNodeById = (nodes, productId) => {
- for (let i = 0; i < nodes.length; i++) {
- if (nodes[i].value === productId) {
- return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
- }
- if (nodes[i].children && nodes[i].children.length > 0) {
- const foundNode = findNodeById(nodes[i].children, productId);
- if (foundNode) {
- return foundNode.label; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
- }
- }
- }
- return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
-};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
- // 杩囨护鎺夊瓙鏁版嵁
selectedRows.value = selection.filter(item => item.id);
- console.log('selection', selectedRows.value)
}
const expandedRowKeys = ref([])
@@ -163,8 +154,7 @@
const summarizeMainTable = (param) => {
return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']);
};
-const currentRowId = ref(null) // 鏂板锛氬瓨鍌ㄥ綋鍓嶆搷浣滅殑琛孖D
-
+const currentRowId = ref(null)
const currentRowNum = ref(0)
const salesLedgerProductId = ref(null);
@@ -175,14 +165,12 @@
currentRowNum.value = row.inboundNum0
salesLedgerProductId.value = row.salesLedgerProductId
form.value = {}
- // 鍒濆鍖栬〃鍗曟暟鎹�
form.value = {
productrecordId: '',
- inboundQuantity: '', // 鍑哄簱鏁伴噺娓呯┖
- inboundTime: getCurrentDate(), // 榛樿褰撳墠鏃ユ湡
- nickName: '', // 榛樿褰撳墠鐢ㄦ埛
+ inboundQuantity: '',
+ inboundTime: getCurrentDate(),
+ nickName: '',
}
- console.log('form',form.value)
// 鍔犺浇鐢ㄦ埛鍒楄〃
try {
const userLists = await userListNoPageByTenantId()
@@ -195,19 +183,19 @@
// 鎻愪氦琛ㄥ崟
const submitForm = () => {
let num = Number(form.value.inboundQuantity)
- if(num < 1 || num > currentRowNum.value){
+ if(num <= 0 || num > currentRowNum.value){
return proxy.$modal.msgWarning("璇峰~鍏ユ湁鏁堟暟瀛�")
}
proxy.$refs["formRef"].validate(valid => {
if (valid && currentRowId.value) {
const outData = {
- id: currentRowId.value, // 鍘熷璁板綍ID
+ id: currentRowId.value,
salesLedgerProductId: salesLedgerProductId.value,
- quantity: form.value.inboundQuantity, // 鍑哄簱鏁伴噺
- time: form.value.inboundTime, // 鍑哄簱鏃堕棿
- userId: form.value.nickName // 鎿嶄綔浜�
+ quantity: form.value.inboundQuantity,
+ time: form.value.inboundTime,
+ userId: form.value.nickName,
+ type: 1 // 閲囪喘鍑哄簱
}
- console.log(outData)
stockOut(outData).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
@@ -219,6 +207,7 @@
}
})
}
+
// 鍏抽棴寮规
const closeDia = () => {
proxy.resetForm("formRef")
@@ -240,36 +229,12 @@
proxy.$modal.msg("宸插彇娑�")
})
}
-// 鍒犻櫎
-const handleDelete = () => {
- let ids = []
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value.map(item => item.id);
- } else {
- proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
- return
- }
- ElMessageBox.confirm(
- '閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�',
- '瀵煎嚭', {
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- delStockManage(ids).then(res => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
- getList()
- })
- }).catch(() => {
- proxy.$modal.msg("宸插彇娑�")
- })
-}
+
// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
function getCurrentDate() {
const today = new Date();
const year = today.getFullYear();
- const month = String(today.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮�
+ const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
--
Gitblit v1.9.3