From faa1b4e58a3b9ff41e446687b2d3a31e6709bd4b Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期一, 23 三月 2026 16:01:12 +0800
Subject: [PATCH] feat(productionProcess): 添加工序机台选择功能到编辑表单
---
src/views/salesManagement/salesLedger/index.vue | 84 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 74 insertions(+), 10 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 8b7b17c..5c2b9bb 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -118,9 +118,11 @@
<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 fixed="right" label="鎿嶄綔" min-width="100" align="center">
+ <el-table-column label="鍏跺畠璇存槑浜嬮」" prop="remarks" width="200" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="200" 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.isEdit">缂栬緫</el-button>
+ <el-button link type="primary" size="small" @click="exportSalesContracts(scope.row)">瀵煎嚭閿�鍞悎鍚�</el-button>
<!-- <el-button link type="primary" size="small" @click="openForm('view', scope.row)">璇︽儏</el-button>-->
<el-button link type="primary" size="small" @click="downLoadFile(scope.row)">闄勪欢</el-button>
<!-- <el-button link type="primary" size="small" @click="openDeliveryForm(scope.row)">鍙戣揣</el-button>-->
@@ -212,6 +214,11 @@
type="date" placeholder="璇烽�夋嫨" clearable />
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="绛捐鍦扮偣锛�" prop="placeOfSinging">
+ <el-input v-model="form.placeOfSinging" placeholder="璇疯緭鍏�" clearable :disabled="operationType === 'view'" />
+ </el-form-item>
+ </el-col>
</el-row>
<el-row>
<el-form-item label="浜у搧淇℃伅锛�" prop="entryDate">
@@ -242,14 +249,14 @@
</el-table>
<el-row :gutter="30">
<el-col :span="24">
- <el-form-item label="澶囨敞路锛�" prop="remark">
- <el-input v-model="form.remark" placeholder="璇疯緭鍏�" clearable type="textarea" :rows="2" :disabled="operationType === 'view'" />
+ <el-form-item label="鍏跺畠璇存槑浜嬮」锛�" prop="remarks">
+ <el-input v-model="form.remarks" placeholder="璇疯緭鍏�" clearable type="textarea" :rows="2" :disabled="operationType === 'view'" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="24">
- <el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
+ <el-form-item label="闄勪欢鏉愭枡锛�" prop="salesLedgerFiles">
<el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload
:headers="upload.headers" :before-upload="handleBeforeUpload" :on-error="handleUploadError"
:on-success="handleUploadSuccess" :on-remove="handleRemove">
@@ -317,6 +324,15 @@
</template>
</el-table-column>
</el-table>
+
+ <pagination
+ v-show="quotationPage.total > 0"
+ :total="quotationPage.total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="quotationPage.current"
+ :limit="quotationPage.size"
+ @pagination="quotationPaginationChange"
+ />
<template #footer>
<el-button @click="quotationDialogVisible = false">鍏抽棴</el-button>
@@ -471,7 +487,7 @@
<div v-for="(item, index) in printData" :key="index" class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">闃冲厜鍗板埛鏈夐檺璐d换鍏徃</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -665,6 +681,7 @@
addOrUpdateSalesLedgerProduct,
delProduct,
delLedgerFile, getProductInventory,
+ exportSalesContract
} from "@/api/salesManagement/salesLedger.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
@@ -718,6 +735,7 @@
entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
deliveryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ placeOfSinging: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
},
});
const { form, rules } = toRefs(data);
@@ -779,6 +797,12 @@
const quotationSearchForm = reactive({
quotationNo: "",
customer: "",
+});
+// 鎶ヤ环鍗曞脊妗嗗垎椤�
+const quotationPage = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
});
const selectedQuotation = ref(null);
@@ -1004,6 +1028,7 @@
// 娣诲姞琛ㄨ绫诲悕鏂规硶
const tableRowClassName = ({ row }) => {
+ if (!row.deliveryDate) return '';
if (row.isFh) return '';
const diff = row.deliveryDaysDiff;
@@ -1073,6 +1098,8 @@
const openQuotationDialog = async () => {
if (operationType.value === "view") return;
quotationDialogVisible.value = true;
+ // 鎵撳紑寮圭獥鏃堕噸缃垎椤靛埌绗竴椤�
+ quotationPage.current = 1;
// 鍏堢‘淇濆鎴峰垪琛ㄥ凡鍔犺浇锛屼究浜庡悗缁洖濉� customerId
if (!customerOption.value || customerOption.value.length === 0) {
try {
@@ -1089,14 +1116,15 @@
quotationLoading.value = true;
try {
const params = {
- // 鍏煎鍚庣鍒嗛〉瀛楁锛氳繖閲屾部鐢ㄦ姤浠烽〉闈㈠凡鏈夊彲鐢ㄧ殑瀛楁鍛藉悕
- currentPage: 1,
- pageSize: 100,
+ // 鍚庣鍒嗛〉瀛楁锛歝urrent / size
+ current: quotationPage.current,
+ size: quotationPage.size,
...quotationSearchForm,
status: "閫氳繃",
};
const res = await getQuotationList(params);
quotationList.value = res?.data?.records || [];
+ quotationPage.total = res?.data?.total || 0;
} finally {
quotationLoading.value = false;
}
@@ -1105,7 +1133,15 @@
const resetQuotationSearch = async () => {
quotationSearchForm.quotationNo = "";
quotationSearchForm.customer = "";
+ quotationPage.current = 1;
await fetchQuotationList();
+};
+
+// 鎶ヤ环鍗曞脊妗嗗垎椤靛垏鎹�
+const quotationPaginationChange = (obj) => {
+ quotationPage.current = obj.page;
+ quotationPage.size = obj.limit;
+ fetchQuotationList();
};
// 閫変腑鎶ヤ环鍗曞悗鍥炲~鍒板彴璐﹁〃鍗�
@@ -1642,7 +1678,7 @@
<div class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">闃冲厜褰╁嵃鏈夐檺璐d换鍏徃</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -2064,6 +2100,34 @@
};
/**
+ * 瀵煎嚭閿�鍞悎鍚�
+ *
+ * @param row 瀵煎嚭閿�鍞悎鍚岀殑鐩稿叧淇℃伅瀵硅薄
+ */
+const exportSalesContracts = (row) => {
+ exportSalesContract({ id: row.id }).then((res) => {
+ if (res) {
+ const downloadUrl = window.URL.createObjectURL(res);
+ const link = document.createElement('a');
+ link.href = downloadUrl;
+ console.log(row.executionDate)
+ link.download = row.projectName+row.executionDate + "閿�鍞悎鍚�.docx"; // 璁剧疆涓嬭浇鏂囦欢鍚�
+ link.style.display = 'none'; // 闅愯棌a鏍囩
+ document.body.appendChild(link);
+ link.click(); // 瑙﹀彂鐐瑰嚮涓嬭浇
+ // 4. 娓呯悊璧勬簮锛堥伩鍏嶅唴瀛樻硠婕忥級
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(downloadUrl);
+
+ // 5. 鎻愮ず瀵煎嚭鎴愬姛
+ proxy.$modal.msgSuccess("瀵煎嚭閿�鍞悎鍚屾垚鍔�");
+ } else {
+ proxy.$modal.msgError(res.msg || "瀵煎嚭閿�鍞悎鍚屽け璐�");
+ }
+ });
+}
+
+/**
* 涓嬭浇鏂囦欢
*
* @param row 涓嬭浇鏂囦欢鐨勭浉鍏充俊鎭璞�
--
Gitblit v1.9.3