From f3867fda6adc7d5ab6b32f61981d87e080a39f8c Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期六, 28 三月 2026 13:44:32 +0800
Subject: [PATCH] Merge branch 'dev_HXSJ' of http://114.132.189.42:9002/r/product-inventory-management into dev_HXSJ
---
src/api/financialManagement/fixedAssets.js | 43 ++++
src/views/procurementManagement/procurementLedger/index.vue | 128 ++++++++++++++
src/views/financialManagement/fixedAssets/index.vue | 313 ++++++++++++++++++++++++++++++++++
src/views/salesManagement/salesLedger/index.vue | 2
src/views/procurementManagement/advancedPriceManagement/index.vue | 11 -
5 files changed, 486 insertions(+), 11 deletions(-)
diff --git a/src/api/financialManagement/fixedAssets.js b/src/api/financialManagement/fixedAssets.js
new file mode 100644
index 0000000..309b183
--- /dev/null
+++ b/src/api/financialManagement/fixedAssets.js
@@ -0,0 +1,43 @@
+import request from "@/utils/request";
+// 鍒嗛〉鏌ヨ鍥哄畾璧勪骇鍒楄〃
+export const listPage = (params) => {
+ return request({
+ url: "/enterpriseFixedAssets/listPage",
+ method: "get",
+ params,
+ });
+};
+// 鏂板鍥哄畾璧勪骇
+export function add(data) {
+ return request({
+ url: "/enterpriseFixedAssets/add",
+ method: "post",
+ data: data,
+ });
+}
+// 鏇存柊鍥哄畾璧勪骇
+export function update(data) {
+ return request({
+ url: "/enterpriseFixedAssets/update",
+ method: "post",
+ data: data,
+ });
+}
+// 鍒犻櫎鍥哄畾璧勪骇
+export const delFixedAssets = (query) => {
+ return request({
+ url: `/enterpriseFixedAssets/delete`,
+ method: "delete",
+ data: query,
+ });
+};
+
+// 瀵煎嚭鍥哄畾璧勪骇
+export const exportFixedAssets = (query) => {
+ return request({
+ url: "/financial/fixedAssets/export",
+ method: "post",
+ data: query,
+ responseType: "blob",
+ });
+};
diff --git a/src/views/financialManagement/fixedAssets/index.vue b/src/views/financialManagement/fixedAssets/index.vue
new file mode 100644
index 0000000..6cf8824
--- /dev/null
+++ b/src/views/financialManagement/fixedAssets/index.vue
@@ -0,0 +1,313 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <div>
+ <span class="search_title">璧勪骇鍚嶇О锛�</span>
+ <el-input v-model="searchForm.name"
+ 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 type="danger"
+ plain
+ @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData"
+ border
+ v-loading="tableLoading"
+ @selection-change="handleSelectionChange"
+ style="width: 100%"
+ 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="name"
+ show-overflow-tooltip />
+ <el-table-column label="鍨嬪彿"
+ prop="model"
+ show-overflow-tooltip />
+ <el-table-column label="浠锋牸"
+ prop="price"
+ show-overflow-tooltip>
+ <template #default="{ row }">
+ 楼{{ row.price ? row.price.toFixed(2) : '0.00' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="浣嶇疆"
+ prop="address"
+ show-overflow-tooltip />
+ <el-table-column label="鍒涘缓鏃堕棿"
+ prop="createTime"
+ show-overflow-tooltip>
+ <template #default="{ row }">
+ {{ row.createTime ? dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') : '-' }}
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right"
+ label="鎿嶄綔"
+ min-width="100"
+ align="center">
+ <template #default="scope">
+ <el-button link
+ type="primary"
+ size="small"
+ @click="openForm('edit', scope.row);">缂栬緫</el-button>
+ <el-button link
+ type="danger"
+ size="small"
+ @click="handleDeleteSolo(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-dialog v-model="dialogFormVisible"
+ :title="operationType === 'add' ? '鏂板鍥哄畾璧勪骇' : '缂栬緫鍥哄畾璧勪骇'"
+ width="600px"
+ @close="closeDia">
+ <el-form :model="form"
+ label-width="100px"
+ :rules="rules"
+ ref="formRef">
+ <el-form-item label="璧勪骇鍚嶇О"
+ prop="name">
+ <el-input v-model="form.name"
+ placeholder="璇疯緭鍏ヨ祫浜у悕绉�"
+ clearable />
+ </el-form-item>
+ <el-form-item label="鍨嬪彿"
+ prop="model">
+ <el-input v-model="form.model"
+ placeholder="璇疯緭鍏ュ瀷鍙�"
+ clearable />
+ </el-form-item>
+ <el-form-item label="浠锋牸"
+ prop="price">
+ <el-input-number v-model="form.price"
+ :min="0"
+ :precision="2"
+ :step="0.01"
+ style="width: 100%"
+ placeholder="璇疯緭鍏ヤ环鏍�" />
+ </el-form-item>
+ <el-form-item label="浣嶇疆"
+ prop="address">
+ <el-input v-model="form.address"
+ type="textarea"
+ :rows="3"
+ placeholder="璇疯緭鍏ヤ綅缃�" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary"
+ @click="submitForm">纭</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+ import pagination from "@/components/PIMTable/Pagination.vue";
+ import { ref, reactive, toRefs, onMounted, getCurrentInstance } from "vue";
+ import { ElMessageBox } from "element-plus";
+ import useUserStore from "@/store/modules/user";
+ import {
+ listPage,
+ add,
+ update,
+ delFixedAssets,
+ } from "@/api/financialManagement/fixedAssets.js";
+ import dayjs from "dayjs";
+
+ const userStore = useUserStore();
+ const { proxy } = getCurrentInstance();
+
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const loading = ref(false);
+
+ const page = reactive({
+ current: 1,
+ size: 100,
+ });
+ const total = ref(0);
+
+ const operationType = ref("");
+ const dialogFormVisible = ref(false);
+ const data = reactive({
+ searchForm: {
+ name: "",
+ },
+ form: {
+ id: null,
+ name: "",
+ model: "",
+ price: 0,
+ address: "",
+ },
+ rules: {
+ name: [{ required: true, message: "璇疯緭鍏ヨ祫浜у悕绉�", trigger: "blur" }],
+ model: [{ required: true, message: "璇疯緭鍏ュ瀷鍙�", trigger: "blur" }],
+ price: [{ required: true, message: "璇疯緭鍏ヤ环鏍�", trigger: "blur" }],
+ address: [{ required: true, message: "璇疯緭鍏ヤ綅缃�", trigger: "blur" }],
+ },
+ });
+ const { searchForm, form, rules } = toRefs(data);
+
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+
+ const paginationChange = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+
+ const getList = () => {
+ tableLoading.value = true;
+ listPage({ ...searchForm.value, ...page })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+ };
+
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+
+ const openForm = async (type, row) => {
+ operationType.value = type;
+ dialogFormVisible.value = true;
+
+ if (type === "add") {
+ form.value = {
+ id: null,
+ name: "",
+ model: "",
+ price: 0,
+ address: "",
+ };
+ } else {
+ form.value = {
+ id: row.id,
+ name: row.name,
+ model: row.model,
+ price: row.price,
+ address: row.address,
+ };
+ }
+ };
+
+ const submitForm = async () => {
+ try {
+ await proxy.$refs.formRef.validate();
+ loading.value = true;
+
+ if (operationType.value === "add") {
+ await add(form.value);
+ proxy.$modal.msgSuccess("鏂板璧勪骇鎴愬姛");
+ } else {
+ await update(form.value);
+ proxy.$modal.msgSuccess("淇敼璧勪骇鎴愬姛");
+ }
+ closeDia();
+ getList();
+ } catch (error) {
+ console.error("鎻愪氦澶辫触:", error);
+ if (!error.errors) {
+ proxy.$modal.msgError("鎿嶄綔澶辫触锛岃閲嶈瘯");
+ }
+ } finally {
+ loading.value = false;
+ }
+ };
+
+ const closeDia = () => {
+ proxy.$refs.formRef.resetFields();
+ dialogFormVisible.value = false;
+ };
+ const handleDeleteSolo = row => {
+ ElMessageBox.confirm("璇ヨ祫浜у皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ const ids = [row.id];
+ delFixedAssets(ids)
+ .then(res => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ })
+ .catch(() => {
+ proxy.$modal.msgError("鍒犻櫎澶辫触");
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ const handleDelete = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ const ids = selectedRows.value.map(item => item.id);
+ delFixedAssets(ids)
+ .then(res => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ })
+ .catch(() => {
+ proxy.$modal.msgError("鍒犻櫎澶辫触");
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ onMounted(() => {
+ getList();
+ });
+</script>
+
+<style scoped lang="scss"></style>
diff --git a/src/views/procurementManagement/advancedPriceManagement/index.vue b/src/views/procurementManagement/advancedPriceManagement/index.vue
index 37855d4..5af8311 100644
--- a/src/views/procurementManagement/advancedPriceManagement/index.vue
+++ b/src/views/procurementManagement/advancedPriceManagement/index.vue
@@ -8,7 +8,7 @@
</el-form-item>
<el-form-item label="渚涘簲鍟嗭細">
<el-select v-model="searchForm.supplierId" placeholder="璇烽�夋嫨渚涘簲鍟�" clearable style="width: 200px">
- <el-option v-for="supplier in supplierList" :key="supplier.id" :label="supplier.name" :value="supplier.id" />
+ <el-option v-for="supplier in supplierList" :key="supplier.id" :label="supplier.supplierName" :value="supplier.id" />
</el-select>
</el-form-item>
<el-form-item>
@@ -454,15 +454,6 @@
});
const supplierList = ref([
- { id: 1, name: '浼樿川浜旈噾渚涘簲鍟�' },
- { id: 2, name: '閽㈡潗璐告槗鍏徃' },
- { id: 3, name: '寤烘潗鎵瑰彂鍟�' }
-])
-
-const productList = ref([
- { id: 1, name: '楂樺己搴﹁灪鏍�' },
- { id: 2, name: '涓嶉攬閽㈢' },
- { id: 3, name: '閾濆悎閲戝瀷鏉�' }
])
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index e4117b4..400f061 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -552,6 +552,11 @@
</el-select>
</el-form-item>
</el-col>
+ <el-col :span="24">
+ <el-form-item label=" ">
+ <el-button type="warning" :disabled="!(productForm.productId && productForm.productModelId && productForm.taxRate)" @click="showPriceReference" icon="Search">鏌ョ湅鍘嗗彶閲囪喘浠锋牸鍙傝��</el-button>
+ </el-form-item>
+ </el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
@@ -636,6 +641,62 @@
<el-button type="primary" @click="submitProduct">纭</el-button>
<el-button @click="closeProductDia">鍙栨秷</el-button>
</div>
+ </template>
+ </el-dialog>
+
+ <!-- 鍘嗗彶閲囪喘浠锋牸鍙傝�冨脊绐� -->
+ <el-dialog
+ v-model="priceReferenceVisible"
+ title="鍘嗗彶閲囪喘浠锋牸鍙傝��"
+ width="1000px"
+ append-to-body
+ >
+ <el-table
+ v-loading="priceReferenceLoading"
+ :data="priceReferenceData"
+ border
+ style="width: 100%"
+ >
+ <el-table-column label="鍟嗗搧鍚嶇О" prop="productName" min-width="150" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specification" width="150" show-overflow-tooltip />
+ <el-table-column label="渚涘簲鍟�" prop="supplierName" width="200" show-overflow-tooltip />
+ <el-table-column label="鍩虹浠锋牸" width="120" align="right">
+ <template #default="{ row }">
+ <span style="color: #f56c6c; font-weight: bold;">楼{{ row.basePrice }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎶樻墸淇℃伅" width="120" align="center">
+ <template #default="{ row }">
+ <el-tag v-if="row.discountType === 'percentage'" type="success">
+ {{ row.discountValue }}%
+ </el-tag>
+ <el-tag v-else-if="row.discountType === 'fixed'" type="warning">
+ -楼{{ row.discountValue }}
+ </el-tag>
+ <span v-else>鏃犳姌鎵�</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐢熸晥鏃堕棿" prop="effectiveTime" width="180" align="center" />
+ <el-table-column label="鎿嶄綔" width="100" align="center" fixed="right">
+ <template #default="{ row }">
+ <el-button type="primary" link @click="selectPriceReference(row)">閫夋嫨</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <div class="pagination-container" style="margin-top: 20px; display: flex; justify-content: flex-end;">
+ <el-pagination
+ v-model:current-page="priceReferencePagination.current"
+ v-model:page-size="priceReferencePagination.size"
+ :page-sizes="[10, 20, 50]"
+ :total="priceReferenceTotal"
+ layout="total, sizes, prev, pager, next"
+ @size-change="handlePriceReferenceSizeChange"
+ @current-change="handlePriceReferenceCurrentChange"
+ />
+ </div>
+ <template #footer>
+ <el-button @click="priceReferenceVisible = false">鍏抽棴</el-button>
</template>
</el-dialog>
@@ -903,6 +964,7 @@
let nextApproverId = 2;
import useUserStore from "@/store/modules/user";
import { modelList, productTreeList } from "@/api/basicData/product.js";
+import { listPage as listAdvancedPrice } from "@/api/procurementManagement/advancedPriceManagement.js";
import dayjs from "dayjs";
const userStore = useUserStore();
@@ -996,6 +1058,72 @@
},
});
const { productForm, productRules } = toRefs(productFormData);
+
+// 閲囪喘浠锋牸绠$悊鍙傝�冨脊绐�
+const priceReferenceVisible = ref(false);
+const priceReferenceLoading = ref(false);
+const priceReferenceData = ref([]);
+const priceReferenceTotal = ref(0);
+const priceReferencePagination = reactive({
+ current: 1,
+ size: 10
+});
+
+const showPriceReference = () => {
+ priceReferenceVisible.value = true;
+ handlePriceReferenceSearch();
+};
+
+const handlePriceReferenceSearch = () => {
+ priceReferenceLoading.value = true;
+ // 妯℃嫙鎼滅储鍙傛暟锛歱roductId 鏄犲皠涓� productName 鎴� ID锛岃繖閲屾牴鎹� advancedPriceManagement 鐨� API 纭畾鍙傛暟
+ // 鍋囪楂樼骇浠锋牸绠$悊鐨� listPage 鎺ユ敹 productId
+ const query = {
+ productId: productForm.value.productId,
+ specificationId: productForm.value.productModelId,
+ current: priceReferencePagination.current,
+ size: priceReferencePagination.size
+ };
+ listAdvancedPrice(query).then(res => {
+ priceReferenceData.value = res.data.records;
+ priceReferenceTotal.value = res.data.total;
+ priceReferenceLoading.value = false;
+ }).catch(() => {
+ priceReferenceLoading.value = false;
+ });
+};
+
+const handlePriceReferenceSizeChange = (size) => {
+ priceReferencePagination.size = size;
+ handlePriceReferenceSearch();
+};
+
+const handlePriceReferenceCurrentChange = (page) => {
+ priceReferencePagination.current = page;
+ handlePriceReferenceSearch();
+};
+
+const selectPriceReference = (row) => {
+ // 璁$畻瀹為檯浠锋牸锛氬熀纭�浠锋牸 - 鎶樻墸
+ let actualPrice = row.basePrice;
+ if (row.discountType === 'percentage') {
+ actualPrice = row.basePrice * (1 - row.discountValue / 100);
+ } else if (row.discountType === 'fixed') {
+ actualPrice = row.basePrice - row.discountValue;
+ }
+
+ // 濉厖鍚◣鍗曚环锛屼繚鐣欎袱浣嶅皬鏁�
+ productForm.value.taxInclusiveUnitPrice = Number(Math.max(actualPrice, 0)).toFixed(2);
+
+ // 濡傛灉宸茬粡杈撳叆浜嗘暟閲忥紝鍒欒嚜鍔ㄨ绠楁�讳环
+ if (productForm.value.quantity) {
+ mathNum();
+ }
+
+ priceReferenceVisible.value = false;
+ proxy.$modal.msgSuccess("宸插紩鐢ㄥ巻鍙蹭环鏍�");
+ };
+
const upload = reactive({
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 7b45b73..dec0aae 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -1669,7 +1669,7 @@
};
deliveryFormVisible.value = true;
}).catch(err => {
- ElMessage.error(err.msg);
+ // ElMessage.error(err);
});
};
--
Gitblit v1.9.3