From f7ac35468cd9048a93b89a7c39dacac4f5d1748c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 19 一月 2026 17:11:35 +0800
Subject: [PATCH] 湟水峡 1.下拉框加筛选 2.销售模块不要客户合同号、项目名称 3.客户档案、供应商档案不要和银行有关的字段 4.只需要填客户类型、不需要选择具体的客户针对客户类型产生三种不同的报价、需要绑定产品(比如零售商30、经销商25) 5.客户档案添加客户类型字段
---
src/views/procurementManagement/procurementLedger/index.vue | 396 ++++++++++++-------------------------------------------
1 files changed, 90 insertions(+), 306 deletions(-)
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index b93ed18..aaab9df 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -39,7 +39,6 @@
<div class="table_list">
<div style="display: flex;justify-content: flex-end;margin-bottom: 20px;">
<el-button type="primary" @click="openForm('add')">鏂板鍙拌处</el-button>
- <el-button type="success" @click="openScanAddDialog">鎵爜鏂板</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
</div>
@@ -53,7 +52,7 @@
show-summary
:summary-method="summarizeMainTable"
@expand-change="expandChange"
- height="calc(100vh - 18.5em)"
+ height="calc(100vh - 19em)"
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column type="expand">
@@ -146,7 +145,7 @@
<el-table-column
fixed="right"
label="鎿嶄綔"
- min-width="150"
+ width="100"
align="center"
>
<template #default="scope">
@@ -157,13 +156,6 @@
@click="openForm('edit', scope.row)"
:disabled="scope.row.receiptPaymentAmount>0 || scope.row.recorderName !== userStore.nickName"
>缂栬緫</el-button
- >
- <el-button
- link
- type="success"
- size="small"
- @click="showQRCode(scope.row)"
- >鐢熸垚浜岀淮鐮�</el-button
>
</template>
@@ -225,6 +217,7 @@
<el-select
v-model="form.supplierId"
placeholder="璇烽�夋嫨"
+ filterable
clearable
>
<el-option
@@ -246,6 +239,30 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="浠樻鏂瑰紡">
+ <el-input
+ v-model="form.paymentMethod"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绛捐鏃ユ湡锛�" prop="executionDate">
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.executionDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="褰曞叆浜猴細" prop="recorderId">
@@ -277,15 +294,12 @@
/>
</el-form-item>
</el-col>
- </el-row>
- <el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡">
- <el-input
- v-model="form.paymentMethod"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="鏄惁寮�绁�" prop="isInvoice">
+ <el-select v-model="form.isInvoice" placeholder="璇烽�夋嫨" clearable>
+ <el-option label="鏄�" value="1" />
+ <el-option label="鍚�" value="2" />
+ </el-select>
</el-form-item>
</el-col>
</el-row>
@@ -461,22 +475,24 @@
</el-col>
<el-col :span="12">
<el-form-item label="绋庣巼(%)锛�" prop="taxRate">
- <el-select
- v-model="productForm.taxRate"
- placeholder="璇烽�夋嫨"
- clearable
- @change="mathNum"
- >
- <el-option label="1" value="1" />
- <el-option label="6" value="6" />
- <el-option label="13" value="13" />
- </el-select>
+<!-- <el-select-->
+<!-- v-model="productForm.taxRate"-->
+<!-- placeholder="璇烽�夋嫨"-->
+<!-- clearable-->
+<!-- @change="mathNum"-->
+<!-- >-->
+<!-- <el-option label="1" value="1" />-->
+<!-- <el-option label="6" value="6" />-->
+<!-- <el-option label="13" value="13" />-->
+<!-- </el-select>-->
+ <el-input-number :step="1" :min="0" v-model="productForm.taxRate" style="width: 100%"
+ placeholder="璇疯緭鍏�" clearable @change="calculateFromTaxRate" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="鍚◣鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
+ <el-form-item label="鍚◣/涓嶅惈绋庡崟浠�(鍏�)锛�" prop="taxInclusiveUnitPrice">
<el-input-number
v-model="productForm.taxInclusiveUnitPrice"
:precision="2"
@@ -519,7 +535,7 @@
label="涓嶅惈绋庢�讳环(鍏�)锛�"
prop="taxExclusiveTotalPrice"
>
- <el-input
+ <el-input
v-model="productForm.taxExclusiveTotalPrice"
@change="reverseMathNum('taxExclusiveTotalPrice')"
/>
@@ -556,129 +572,6 @@
<div class="dialog-footer">
<el-button type="primary" @click="submitProduct">纭</el-button>
<el-button @click="closeProductDia">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
-
- <!-- 浜岀淮鐮佹樉绀哄璇濇 -->
- <el-dialog
- v-model="qrCodeDialogVisible"
- title="閲囪喘鍚堝悓鍙蜂簩缁寸爜"
- width="400px"
- center
- >
- <div style="text-align: center;">
- <img :src="qrCodeUrl" alt="浜岀淮鐮�" style="width:200px;height:200px;" />
- <div style="margin: 20px;">
- <el-button type="primary" @click="downloadQRCode">涓嬭浇浜岀淮鐮佸浘鐗�</el-button>
- </div>
- </div>
- </el-dialog>
-
- <!-- 鎵爜鏂板瀵硅瘽妗� -->
- <el-dialog
- v-model="scanAddDialogVisible"
- title="鎵爜鏂板閲囪喘鍙拌处"
- width="70%"
- @close="closeScanAddDialog"
- >
- <el-form
- :model="scanAddForm"
- label-width="140px"
- label-position="top"
- :rules="scanAddRules"
- ref="scanAddFormRef"
- >
- <el-row :gutter="20">
- <el-col :span="24">
- <el-form-item label="鎵爜鍐呭锛�">
- <el-input
- v-model="scanAddForm.scanContent"
- type="textarea"
- :rows="3"
- placeholder="璇锋壂鎻忎簩缁寸爜鎴栨墜鍔ㄨ緭鍏ラ噰璐悎鍚屼俊鎭�"
- @input="parseScanContent"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="閲囪喘鍚堝悓鍙凤細" prop="purchaseContractNumber">
- <el-input
- v-model="scanAddForm.purchaseContractNumber"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="渚涘簲鍟嗗悕绉帮細" prop="supplierName">
- <el-input
- v-model="scanAddForm.supplierName"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input
- v-model="scanAddForm.projectName"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍚堝悓閲戦(鍏�)锛�" prop="contractAmount">
- <el-input-number
- v-model="scanAddForm.contractAmount"
- :precision="2"
- :step="0.1"
- clearable
- style="width: 100%"
- placeholder="璇疯緭鍏�"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡锛�">
- <el-input
- v-model="scanAddForm.paymentMethod"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="褰曞叆浜猴細">
- <el-input v-model="scanAddForm.recorderName" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="24">
- <el-form-item label="澶囨敞锛�">
- <el-input
- v-model="scanAddForm.remark"
- type="textarea"
- :rows="2"
- placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�"
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitScanAdd">纭鏂板</el-button>
- <el-button @click="closeScanAddDialog">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
@@ -826,10 +719,6 @@
const userStore = useUserStore();
-// 浜岀淮鐮佺浉鍏冲彉閲�
-const qrCodeDialogVisible = ref(false);
-const qrCodeUrl = ref("");
-
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
const dialogFormVisible = ref(false);
@@ -853,6 +742,8 @@
supplierName: "",
supplierId: "",
paymentMethod: "",
+ executionDate: "",
+ isInvoice: "",
},
rules: {
purchaseContractNumber: [
@@ -860,6 +751,9 @@
],
projectName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
supplierId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ isInvoice: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
},
});
const { form, rules } = toRefs(data);
@@ -893,7 +787,7 @@
taxInclusiveUnitPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ // taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
warnNum: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
taxInclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
@@ -901,7 +795,7 @@
taxExclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- invoiceType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ // invoiceType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
},
});
const { productForm, productRules } = toRefs(productFormData);
@@ -1077,9 +971,9 @@
// 绉婚櫎鏂囦欢
function handleRemove(file) {
console.log("handleRemove", file.id);
- if (file.size > 1024 * 1024 * 10) {
+ if (file.size > 1024 * 1024 * 10) {
// 浠呭墠绔竻鐞嗭紝涓嶈皟鐢ㄥ垹闄ゆ帴鍙e拰鎻愮ず
- return;
+ return;
}
if (operationType.value === "edit") {
let ids = [];
@@ -1136,10 +1030,15 @@
});
};
const getModels = (value) => {
- productForm.value.productCategory = findNodeById(productOptions.value, value);
- modelList({ id: value }).then((res) => {
- modelOptions.value = res;
- });
+ if (value) {
+ productForm.value.productCategory = findNodeById(productOptions.value, value) || "";
+ modelList({ id: value }).then((res) => {
+ modelOptions.value = res;
+ });
+ } else {
+ productForm.value.productCategory = "";
+ modelOptions.value = [];
+ }
};
const getProductModel = (value) => {
const index = modelOptions.value.findIndex((item) => item.id === value);
@@ -1154,12 +1053,12 @@
const findNodeById = (nodes, productId) => {
for (let i = 0; i < nodes.length; i++) {
if (nodes[i].value === productId) {
- return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
+ return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣鐨刲abel
}
if (nodes[i].children && nodes[i].children.length > 0) {
const foundNode = findNodeById(nodes[i].children, productId);
if (foundNode) {
- return foundNode.label; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝鐩存帴杩斿洖锛堝凡缁忔槸label瀛楃涓诧級
}
}
}
@@ -1309,10 +1208,10 @@
return `${year}-${month}-${day}`;
}
const mathNum = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
+ // if (!productForm.value.taxRate) {
+ // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ // return;
+ // }
if (!productForm.value.taxInclusiveUnitPrice) {
return;
}
@@ -1325,48 +1224,54 @@
productForm.value.taxInclusiveUnitPrice,
productForm.value.quantity
);
- if (productForm.value.taxRate) {
// 涓嶅惈绋庢�讳环璁$畻
productForm.value.taxExclusiveTotalPrice =
proxy.calculateTaxExclusiveTotalPrice(
productForm.value.taxInclusiveTotalPrice,
productForm.value.taxRate
);
- }
+ // if (productForm.value.taxRate) {
+ // // 涓嶅惈绋庢�讳环璁$畻
+ // productForm.value.taxExclusiveTotalPrice =
+ // proxy.calculateTaxExclusiveTotalPrice(
+ // productForm.value.taxInclusiveTotalPrice,
+ // productForm.value.taxRate
+ // );
+ // }
};
const reverseMathNum = (field) => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
- const taxRate = Number(productForm.value.taxRate);
- if (!taxRate) return;
+ // if (!productForm.value.taxRate) {
+ // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ // return;
+ // }
+ const taxRate = productForm.value.taxRate?Number(productForm.value.taxRate):0;
+ // if (!taxRate) return;
if (field === 'taxInclusiveTotalPrice') {
// 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice =
+ productForm.value.taxInclusiveUnitPrice =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
}
// 宸茬煡鍚◣鎬讳环鍜屽惈绋庡崟浠凤紝鍙嶇畻鏁伴噺
else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity =
+ productForm.value.quantity =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
}
// 鍙嶇畻涓嶅惈绋庢�讳环
- productForm.value.taxExclusiveTotalPrice =
+ productForm.value.taxExclusiveTotalPrice =
(Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)).toFixed(2);
} else if (field === 'taxExclusiveTotalPrice') {
// 鍙嶇畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice =
+ productForm.value.taxInclusiveTotalPrice =
(Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(2);
// 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice =
+ productForm.value.taxInclusiveUnitPrice =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
}
// 宸茬煡鍚◣鍗曚环锛屽弽绠楁暟閲�
else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity =
+ productForm.value.quantity =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
}
}
@@ -1391,65 +1296,6 @@
}
};
-// 鏄剧ず浜岀淮鐮�
-const showQRCode = async (row) => {
- try {
- // 鏋勫缓浜岀淮鐮佸唴瀹癸紝鍙寘鍚噰璐悎鍚屽彿锛堢函鏂囨湰锛�
- const qrContent = row.purchaseContractNumber || '';
- // 妫�鏌ュ唴瀹规槸鍚︿负绌�
- if (!qrContent || qrContent.trim() === '') {
- proxy.$modal.msgWarning("璇ヨ娌℃湁閲囪喘鍚堝悓鍙凤紝鏃犳硶鐢熸垚浜岀淮鐮�");
- return;
- }
- qrCodeUrl.value = await QRCode.toDataURL(qrContent, {
- width: 200,
- margin: 2,
- color: {
- dark: '#000000',
- light: '#FFFFFF'
- }
- });
- qrCodeDialogVisible.value = true;
- } catch (error) {
- console.error('鐢熸垚浜岀淮鐮佸け璐�:', error);
- proxy.$modal.msgError("鐢熸垚浜岀淮鐮佸け璐ワ細" + error.message);
- }
-};
-
-// 涓嬭浇浜岀淮鐮�
-const downloadQRCode = () => {
- if (!qrCodeUrl.value) {
- proxy.$modal.msgWarning("浜岀淮鐮佹湭鐢熸垚");
- return;
- }
-
- const a = document.createElement('a');
- a.href = qrCodeUrl.value;
- a.download = `閲囪喘鍚堝悓鍙蜂簩缁寸爜_${new Date().getTime()}.png`;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- proxy.$modal.msgSuccess("涓嬭浇鎴愬姛");
-};
-
-// 鎵爜鏂板瀵硅瘽妗嗙浉鍏冲彉閲�
-const scanAddDialogVisible = ref(false);
-const scanAddForm = reactive({
- scanContent: "",
- purchaseContractNumber: "",
- supplierName: "",
- projectName: "",
- contractAmount: "",
- paymentMethod: "",
- recorderName: "",
- scanRemark: "",
-});
-const scanAddRules = {
- purchaseContractNumber: [{ required: true, message: "璇疯緭鍏ラ噰璐悎鍚屽彿", trigger: "blur" }],
- supplierName: [{ required: true, message: "璇疯緭鍏ヤ緵搴斿晢鍚嶇О", trigger: "blur" }],
- projectName: [{ required: true, message: "璇疯緭鍏ラ」鐩悕绉�", trigger: "blur" }],
-};
-
// 鎵爜鐧昏瀵硅瘽妗嗙浉鍏冲彉閲�
const scanDialogVisible = ref(false);
const scanForm = reactive({
@@ -1465,68 +1311,6 @@
scanRemark: [{ required: true, message: "璇疯緭鍏ユ壂鐮佸娉�", trigger: "blur" }],
};
const scanRecords = ref([]);
-
-// 鎵撳紑鎵爜鏂板瀵硅瘽妗�
-const openScanAddDialog = () => {
- scanAddForm.scanContent = "";
- scanAddForm.purchaseContractNumber = "";
- scanAddForm.supplierName = "";
- scanAddForm.projectName = "";
- scanAddForm.contractAmount = "";
- scanAddForm.paymentMethod = "";
- scanAddForm.recorderName = userStore.nickName;
- scanAddForm.scanRemark = "";
- scanAddDialogVisible.value = true;
-};
-
-// 瑙f瀽鎵爜鍐呭锛堟ā鎷熻В鏋愪簩缁寸爜鏁版嵁锛�
-const parseScanContent = (content) => {
- if (!content) return;
-
- // 妯℃嫙瑙f瀽浜岀淮鐮佸唴瀹癸紝杩欓噷鍙互鏍规嵁瀹為檯闇�姹傝皟鏁磋В鏋愰�昏緫
- // 鍋囪鎵爜鍐呭鏍煎紡涓猴細鍚堝悓鍙穦渚涘簲鍟唡椤圭洰|閲戦|浠樻鏂瑰紡
- const parts = content.split('|');
- if (parts.length >= 3) {
- scanAddForm.purchaseContractNumber = parts[0] || "";
- scanAddForm.supplierName = parts[1] || "";
- scanAddForm.projectName = parts[2] || "";
- scanAddForm.contractAmount = parts[3] || "";
- scanAddForm.paymentMethod = parts[4] || "";
- }
-};
-
-// 鍏抽棴鎵爜鏂板瀵硅瘽妗�
-const closeScanAddDialog = () => {
- scanAddDialogVisible.value = false;
- proxy.resetForm("scanAddFormRef");
-};
-
-// 鎻愪氦鎵爜鏂板
-const submitScanAdd = () => {
- proxy.$refs["scanAddFormRef"].validate((valid) => {
- if (valid) {
- // 鏋勫缓鏂板鏁版嵁
- const newData = {
- purchaseContractNumber: scanAddForm.purchaseContractNumber,
- supplierName: scanAddForm.supplierName,
- projectName: scanAddForm.projectName,
- contractAmount: scanAddForm.contractAmount,
- paymentMethod: scanAddForm.paymentMethod,
- recorderName: scanAddForm.recorderName,
- entryDate: getCurrentDate(),
- remark: scanAddForm.scanRemark,
- type: 2
- };
-
- // 妯℃嫙鏂板鎴愬姛
- proxy.$modal.msgSuccess("鎵爜鏂板鎴愬姛锛�");
- closeScanAddDialog();
-
- // 鍙互閫夋嫨鏄惁鍒锋柊鍒楄〃
- // getList();
- }
- });
-};
// 鎵撳紑鎵爜鐧昏瀵硅瘽妗�
const openScanDialog = (row) => {
--
Gitblit v1.9.3