From 5df6d6cd93ed5655065652a008189d1630fbfeab Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 29 十月 2026 16:34:34 +0800
Subject: [PATCH] change
---
src/views/salesManagement/salesLedger/index.vue | 265 ++++++++++++++++++++++++----------------------------
1 files changed, 123 insertions(+), 142 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 0c25737..bc5c55a 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -80,7 +80,7 @@
width="55"
fixed="left"
/>
- <el-table-column type="expand" width="60" fixed="left">
+ <el-table-column v-if="false" type="expand" width="60" fixed="left">
<template #default="props">
<el-table
:data="props.row.children"
@@ -225,43 +225,19 @@
:formatter="formattedNumber"
/>
<el-table-column
- label="瀹為檯鍚堝悓閲戦(鍏�)"
- prop="netContractAmount"
- width="220"
- show-overflow-tooltip
- :formatter="formattedNumber"
- />
- <el-table-column
label="褰曞叆浜�"
prop="entryPersonName"
width="100"
show-overflow-tooltip
/>
- <el-table-column
- label="褰曞叆鏃ユ湡"
- prop="entryDate"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- label="绛捐鏃ユ湡"
- prop="executionDate"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- label="浜や粯鏃ユ湡"
- prop="deliveryDate"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- label="澶囨敞"
- prop="remarks"
- width="200"
- show-overflow-tooltip
- />
- <el-table-column fixed="right" label="鎿嶄綔" width="320" align="center">
+ <el-table-column label="涓氬姟瀹℃壒" width="120" align="center">
+ <template #default="scope">
+ <el-tag :type="businessStatusType(scope.row.businessApprovalStatus)">
+ {{ businessStatusText(scope.row.businessApprovalStatus) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="500" align="center">
<template #default="scope">
<el-button link type="primary" @click="openForm('view', scope.row)"
>璇︽儏
@@ -294,6 +270,40 @@
<el-button link type="primary" @click="openFileDialog(scope.row)"
>闄勪欢
</el-button>
+ <el-button
+ v-if="scope.row.projectManagementInfoId"
+ link
+ type="primary"
+ @click="openProjectProgress(scope.row)"
+ >鏌ョ湅椤圭洰杩涘害
+ </el-button>
+ <el-button
+ v-if="![1, 2].includes(scope.row.businessApprovalStatus)"
+ v-hasPermi="['business:approval:submit']"
+ link
+ type="warning"
+ :loading="businessActionId === scope.row.id"
+ @click="submitBusiness(scope.row)"
+ >鎻愪氦瀹℃壒
+ </el-button>
+ <el-button
+ v-if="scope.row.businessApprovalStatus === 1"
+ v-hasPermi="['business:approval:review']"
+ link
+ type="success"
+ :loading="businessActionId === scope.row.id"
+ @click="reviewBusiness(scope.row, true)"
+ >閫氳繃
+ </el-button>
+ <el-button
+ v-if="scope.row.businessApprovalStatus === 1"
+ v-hasPermi="['business:approval:review']"
+ link
+ type="danger"
+ :loading="businessActionId === scope.row.id"
+ @click="reviewBusiness(scope.row, false)"
+ >閫�鍥�
+ </el-button>
</template>
</el-table-column>
</el-table>
@@ -310,10 +320,10 @@
v-model="dialogFormVisible"
:title="
operationType === 'add'
- ? '鏂板閿�鍞彴璐﹂〉闈�'
+ ? '鏂板涓氬姟鍙拌处'
: operationType === 'edit'
- ? '缂栬緫閿�鍞彴璐﹂〉闈�'
- : '閿�鍞彴璐﹁鎯�'
+ ? '缂栬緫涓氬姟鍙拌处'
+ : '涓氬姟鍙拌处璇︽儏'
"
:width="'70%'"
:operation-type="operationType"
@@ -328,14 +338,6 @@
:rules="rules"
ref="formRef"
>
- <!-- 鎶ヤ环鍗曞鍏ュ叆鍙o細鏀惧湪琛ㄥ崟椤堕儴锛岄�夋嫨鍚庡弽鏄惧鎴�/涓氬姟鍛樼瓑 -->
- <el-row v-if="operationType === 'add'" style="margin-bottom: 10px">
- <el-col :span="24" style="text-align: right">
- <el-button type="primary" plain @click="openQuotationDialog">
- 浠庨攢鍞姤浠峰鍏�
- </el-button>
- </el-col>
- </el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍚堝悓绫诲瀷锛�" prop="contractType">
@@ -461,6 +463,20 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
+ <el-form-item label="鍚堝悓閲戦(鍏�)锛�" prop="contractAmount">
+ <el-input-number
+ v-model="form.contractAmount"
+ :min="0"
+ :precision="2"
+ controls-position="right"
+ style="width: 100%"
+ :disabled="operationType === 'view'"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
<el-form-item label="褰曞叆浜猴細" prop="entryPerson">
<el-select
v-model="form.entryPerson"
@@ -512,89 +528,6 @@
</el-form-item>
</el-col>
</el-row>
- <el-row>
- <el-form-item label="浜у搧淇℃伅锛�" prop="entryDate">
- <el-button
- v-if="operationType !== 'view'"
- type="primary"
- @click="openProductForm('add')"
- >娣诲姞
- </el-button>
- <el-button
- v-if="operationType !== 'view'"
- plain
- type="danger"
- @click="deleteProduct"
- >鍒犻櫎
- </el-button>
- </el-form-item>
- </el-row>
- <el-table
- :data="productData"
- border
- @selection-change="productSelected"
- show-summary
- :summary-method="summarizeMainTable"
- >
- <el-table-column
- align="center"
- type="selection"
- width="55"
- v-if="operationType !== 'view'"
- :selectable="(row) => !isProductShipped(row)"
- />
- <el-table-column
- align="center"
- label="搴忓彿"
- type="index"
- width="60"
- />
- <el-table-column label="浜у搧澶х被" prop="productCategory" />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
- <el-table-column label="鍗曚綅" prop="unit" />
- <el-table-column label="鏁伴噺" prop="quantity" />
- <el-table-column label="绋庣巼(%)" prop="taxRate" />
- <el-table-column
- label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"
- />
- <el-table-column label="鏄惁鐢熶骇" prop="isProduction" width="150">
- <template #default="scope">
- <el-tag :type="scope.row.isProduction ? 'success' : 'info'">
- {{ scope.row.isProduction ? "鏄�" : "鍚�" }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- label="鎿嶄綔"
- min-width="60"
- align="center"
- v-if="operationType !== 'view'"
- >
- <template #default="scope">
- <el-button
- link
- type="primary"
- size="small"
- :disabled="isProductShipped(scope.row)"
- @click="openProductForm('edit', scope.row, scope.$index)"
- >缂栬緫
- </el-button>
- </template>
- </el-table-column>
- </el-table>
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="澶囨敞锛�" prop="remarks">
@@ -1501,6 +1434,8 @@
createFrameworkOrder,
listFrameworkOrders,
frameworkContractShippedQuantity,
+ submitBusinessApproval,
+ reviewBusinessApproval,
} from "@/api/salesManagement/salesLedger.js";
import { getStockInventoryByModelId } from "@/api/inventoryManagement/stockInventory.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
@@ -1539,6 +1474,7 @@
size: 100,
});
const total = ref(0);
+const businessActionId = ref(null);
const fileList = ref([]);
const deliveryFileList = ref([]);
@@ -1857,6 +1793,55 @@
.catch(() => {
tableLoading.value = false;
});
+};
+const businessStatusText = (status) =>
+ ({ 0: "鑽夌", 1: "寰呭鎵�", 2: "宸查�氳繃", 3: "宸查��鍥�" }[status ?? 0] || "鑽夌");
+const businessStatusType = (status) =>
+ ({ 0: "info", 1: "warning", 2: "success", 3: "danger" }[status ?? 0] || "info");
+const submitBusiness = async (row) => {
+ try {
+ await ElMessageBox.confirm(
+ `纭畾鎻愪氦鈥�${row.projectName || row.salesContractNo}鈥濊繘琛岀鐞嗗鎵瑰悧锛焋,
+ "鎻愪氦涓氬姟瀹℃壒",
+ { type: "warning", confirmButtonText: "纭鎻愪氦", cancelButtonText: "鍙栨秷" }
+ );
+ businessActionId.value = row.id;
+ await submitBusinessApproval(row.id);
+ proxy.$modal.msgSuccess("宸叉彁浜ゅ鎵�");
+ await getList();
+ } catch (error) {
+ if (error !== "cancel" && error !== "close") throw error;
+ } finally {
+ businessActionId.value = null;
+ }
+};
+const reviewBusiness = async (row, approved) => {
+ try {
+ let remark = "";
+ if (!approved) {
+ const result = await ElMessageBox.prompt("璇疯緭鍏ラ��鍥炲師鍥�", "閫�鍥炰笟鍔�", {
+ inputValidator: (value) => Boolean(value?.trim()) || "璇疯緭鍏ラ��鍥炲師鍥�",
+ confirmButtonText: "纭閫�鍥�",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ });
+ remark = result.value.trim();
+ } else {
+ await ElMessageBox.confirm(
+ "瀹℃壒閫氳繃灏嗚嚜鍔ㄥ垱寤洪」鐩紝鏄惁缁х画锛�",
+ "閫氳繃涓氬姟瀹℃壒",
+ { type: "success", confirmButtonText: "閫氳繃骞跺缓椤�", cancelButtonText: "鍙栨秷" }
+ );
+ }
+ businessActionId.value = row.id;
+ await reviewBusinessApproval({ salesLedgerId: row.id, approved, remark });
+ proxy.$modal.msgSuccess(approved ? "瀹℃壒閫氳繃锛岄」鐩凡鑷姩寤虹珛" : "宸查��鍥�");
+ await getList();
+ } catch (error) {
+ if (error !== "cancel" && error !== "close") throw error;
+ } finally {
+ businessActionId.value = null;
+ }
};
// 鑾峰彇浜у搧澶х被tree鏁版嵁
const getProductOptions = () => {
@@ -2228,23 +2213,9 @@
const submitForm = () => {
proxy.$refs["formRef"].validate((valid) => {
if (valid) {
- console.log("productData.value--", productData.value);
- if (productData.value !== null && productData.value.length > 0) {
- form.value.productData = proxy.HaveJson(productData.value);
- } else {
- proxy.$modal.msgWarning("璇锋坊鍔犱骇鍝佷俊鎭�");
- return;
- }
+ form.value.productData = proxy.HaveJson(productData.value || []);
form.value.storageBlobDTOs = fileList;
form.value.type = 1;
- if (isFrameworkContract.value) {
- form.value.productData = form.value.productData.map((item) => ({
- ...item,
- quantity: null,
- deliveryDate: null,
- isProduction: false,
- }));
- }
if (form.value.autoGenerateContractNo) {
form.value.salesContractNo = "";
}
@@ -3171,6 +3142,16 @@
fileDialogVisible.value = true;
};
+// 鏌ョ湅椤圭洰杩涘害锛堣烦杞」鐩鎯咃紝鍙煡鐪嬮樁娈佃繘灞曚笌璧勬枡鏂囦欢锛�
+const openProjectProgress = (row) => {
+ const projectId = row.projectManagementInfoId || row.projectId;
+ if (!projectId) {
+ proxy.$modal.msgWarning("璇ヤ笟鍔℃殏鏈叧鑱旈」鐩�");
+ return;
+ }
+ router.push(`/projectManagement/Management/detail/${projectId}`);
+};
+
// 鎵撳紑鍙戣揣寮规
const openDeliveryForm = async (row) => {
// 瀹℃壒涓椂鎻愮ず鐢ㄦ埛宸叉湁寰呭鎵圭殑鍙戣揣璁板綍
--
Gitblit v1.9.3