From 01b53033db11aa30ed6d408f6b5c8f27cd851b17 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期五, 09 一月 2026 11:42:03 +0800
Subject: [PATCH] 1.基础数据-供应商黑名单,添加资质管理字段,可上传资质文件 2.采购管理-收货管理-添加入库数量输入和合格状态选择功能,实现采购异常记录的添加和更新接口 3.客户档案-分类功能,零售客户和进销商客户 4.添加采购审批页面,显示台账审批状态 5.固定资产核算界面,库存核算统计页面-移至军泰伟业
---
src/views/procurementManagement/procurementLedger/index.vue | 529 +++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 430 insertions(+), 99 deletions(-)
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 36ff34b..80e0cc7 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -39,7 +39,7 @@
<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 type="success" @click="openScanAddDialog">鎵爜鏂板</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
</div>
@@ -54,6 +54,7 @@
:summary-method="summarizeMainTable"
@expand-change="expandChange"
height="calc(100vh - 19em)"
+ :row-class-name="tableRowClassName"
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column type="expand">
@@ -110,12 +111,38 @@
prop="supplierName"
show-overflow-tooltip
/>
+ <el-table-column label="璁㈠崟鐘舵��" width="100" align="center">
+ <template #default="scope">
+ <el-tag v-if="scope.row.isInvalid" type="danger" size="small">澶辨晥</el-tag>
+ <el-tag v-else type="success" size="small">姝e父</el-tag>
+ </template>
+ </el-table-column>
<el-table-column
- label="椤圭洰鍚嶇О"
- prop="projectName"
- width="420"
- show-overflow-tooltip
+ label="椤圭洰鍚嶇О"
+ prop="projectName"
+ width="420"
+ show-overflow-tooltip
/>
+ <el-table-column
+ label="瀹℃壒鐘舵��"
+ prop="approvalStatus"
+ width="200"
+ show-overflow-tooltip
+ >
+ <template #default="scope">
+ <el-tag
+ size="small"
+ >
+ {{ approvalStatusText[scope.row.approvalStatus] || '鏈煡鐘舵��' }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="绛捐鏃ユ湡"
+ prop="executionDate"
+ width="100"
+ show-overflow-tooltip
+ />
<el-table-column
label="浠樻鏂瑰紡"
width="100"
@@ -132,7 +159,7 @@
<el-table-column
label="褰曞叆浜�"
prop="recorderName"
- width="100"
+ width="120"
show-overflow-tooltip
/>
<el-table-column
@@ -144,7 +171,7 @@
<el-table-column
fixed="right"
label="鎿嶄綔"
- min-width="100"
+ width="180"
align="center"
>
<template #default="scope">
@@ -154,6 +181,13 @@
size="small"
@click="openForm('edit', scope.row)"
>缂栬緫</el-button
+ >
+ <el-button
+ link
+ type="success"
+ size="small"
+ @click="showQRCode(scope.row)"
+ >鐢熸垚浜岀淮鐮�</el-button
>
<el-button
link
@@ -235,26 +269,26 @@
</el-select>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
+ <el-col :span="12">
+ <el-form-item label="椤圭洰鍚嶇О" prop="projectName">
<el-input
- v-model="form.projectName"
- placeholder="璇疯緭鍏�"
- clearable
+ v-model="form.projectName"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
+ </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-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
@@ -271,13 +305,26 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="褰曞叆浜猴細" prop="recorderId">
+ <el-form-item label="瀹℃壒浜猴細" prop="approverId">
<el-select
- v-model="form.recorderId"
- placeholder="璇烽�夋嫨"
- clearable
- disabled
- filterable
+ v-model="form.approverId"
+ placeholder="璇烽�夋嫨瀹℃壒浜�"
+ clearable
+ >
+ <el-option
+ v-for="item in userList"
+ :key="item.userId"
+ :label="item.nickName"
+ :value="item.userId"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="褰曞叆浜猴細" prop="recorderId" v-show="false">
+ <el-select
+ v-model="form.recorderId"
+ placeholder="璇烽�夋嫨"
+ clearable
+ disabled
>
<el-option
v-for="item in userList"
@@ -311,6 +358,37 @@
>鍒犻櫎</el-button
>
</el-form-item>
+ <div class="select-button-group" style="width: 220px; margin: 20px 0;" v-if="operationType === 'add'">
+ <el-select
+ filterable
+ allow-create
+ :reserve-keyword="true"
+ :default-first-option="false"
+ v-model="templateName"
+ :input-value="filterInputValue"
+ @filter-change="onTemplateFilterChange"
+ @change="onTemplateChange"
+ style="width: 180px; border-right: none; border-radius: 4px 0 0 4px;"
+ placeholder="璇烽�夋嫨"
+ class="no-arrow-select"
+ >
+ <el-option
+ v-for="item in templateList"
+ :key="item.value"
+ :label="item.templateName"
+ :value="item.templateName"
+ ></el-option>
+ </el-select>
+ <!-- 鎸夐挳锛氫笌 Select 楂樺害鍖归厤锛屽幓鎺夊乏渚ц竟妗嗭紝鏃犵紳琛旀帴 -->
+ <el-button
+ size="small"
+ style="height: 32px; border-radius: 0 4px 4px 0; margin-left: -1px;"
+ @click="handleButtonClick"
+ :disabled="!templateName || templateName.trim() === '' || isTemplateNameDuplicate"
+ >
+ 淇濆瓨
+ </el-button>
+ </div>
</el-row>
<el-table
:data="productData"
@@ -639,9 +717,9 @@
<el-col :span="12">
<el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
<el-input
- v-model="scanAddForm.projectName"
- placeholder="璇疯緭鍏�"
- clearable
+ v-model="scanAddForm.projectName"
+ placeholder="璇疯緭鍏�"
+ clearable
/>
</el-form-item>
</el-col>
@@ -792,11 +870,11 @@
</template>
<script setup>
-import { getToken } from "@/utils/auth";
+import {getToken} from "@/utils/auth";
import pagination from "@/components/PIMTable/Pagination.vue";
import { ref, onMounted, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
import { Search } from "@element-plus/icons-vue";
-import { ElMessageBox } from "element-plus";
+import { ElMessageBox,ElMessage } from "element-plus";
import { userListNoPage } from "@/api/system/user.js";
import FileList from "./fileList.vue";
import {
@@ -808,16 +886,20 @@
} from "@/api/salesManagement/salesLedger.js";
import {
addOrEditPurchase,
+ addPurchaseTemplate,
+ createPurchaseNo,
delPurchase,
getSalesNo,
purchaseListPage,
productList,
getPurchaseById,
getOptions,
- createPurchaseNo,
+ getPurchaseTemplateList
} from "@/api/procurementManagement/procurementLedger.js";
import useFormData from "@/hooks/useFormData.js";
import QRCode from "qrcode";
+
+
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const productData = ref([]);
@@ -844,6 +926,103 @@
// 浜岀淮鐮佺浉鍏冲彉閲�
const qrCodeDialogVisible = ref(false);
const qrCodeUrl = ref("");
+
+// 璁㈠崟瀹℃壒鐘舵�佹樉绀烘枃鏈�
+const approvalStatusText = {
+ 0: '瀹℃壒涓�',
+ 1: '瀹℃壒閫氳繃',
+ 2: '瀹℃壒澶辫触'
+};
+
+
+const templateName = ref('');
+const filterInputValue = ref('');
+const templateList = ref([]);
+const isTemplateNameDuplicate = ref(false); // 鏍囪妯℃澘鍚嶇О鏄惁閲嶅
+
+// 妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶�
+const checkTemplateNameDuplicate = (name) => {
+ if (!name || name.trim() === '') {
+ isTemplateNameDuplicate.value = false;
+ return false;
+ }
+ const isDuplicate = templateList.value.some(item => item.templateName === name.trim());
+ isTemplateNameDuplicate.value = isDuplicate;
+ return isDuplicate;
+};
+
+// 闃叉姈瀹氭椂鍣�
+let duplicateCheckTimer = null;
+const onTemplateFilterChange = (val) => {
+ filterInputValue.value = val ?? '';
+ // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒
+ if (duplicateCheckTimer) {
+ clearTimeout(duplicateCheckTimer);
+ }
+ // 瀹炴椂妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶嶏紙闃叉姈澶勭悊锛岄伩鍏嶉绻佹彁绀猴級
+ if (val && val.trim()) {
+ duplicateCheckTimer = setTimeout(() => {
+ const isDuplicate = checkTemplateNameDuplicate(val);
+ if (isDuplicate) {
+ ElMessage({
+ message: '妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�',
+ type: 'warning',
+ duration: 2000
+ });
+ }
+ }, 300); // 300ms 闃叉姈
+ } else {
+ isTemplateNameDuplicate.value = false;
+ }
+};
+
+// allow-create 鏃讹紝杈撳叆涓嶅瓨鍦ㄧ殑鍐呭浼氫綔涓� string 鍊艰繑鍥烇紱杩欓噷鍚屾鍥炶緭鍏ユ浠ョ‘淇濇枃瀛椾笉涓�
+const onTemplateChange = async (val) => {
+ if (typeof val === 'string') {
+ filterInputValue.value = val;
+ // 閫夋嫨鎴栬緭鍏ユ椂妫�鏌ラ噸澶�
+ checkTemplateNameDuplicate(val);
+ }
+
+ // 杩囨护鏁版嵁锛屾煡鎵惧尮閰嶇殑妯℃澘
+ const matchedTemplate = templateList.value.find(item => item.templateName === val);
+
+ if (matchedTemplate?.id) {
+ // 濡傛灉鎵惧埌妯℃澘锛屽姞杞芥ā鏉挎暟鎹�
+ form.value = {
+ ...form.value,
+ ...matchedTemplate,
+ };
+ productData.value = matchedTemplate.productData || [];
+ // 鐢熸垚鏂扮殑閲囪喘鍚堝悓鍙�
+ try {
+ const res = await createPurchaseNo();
+ if (res?.data) {
+ form.value.purchaseContractNumber = res.data;
+ }
+ } catch (error) {
+ console.error('鐢熸垚閲囪喘鍚堝悓鍙峰け璐�:', error);
+ }
+ } else {
+ // 濡傛灉娌℃湁鎵惧埌妯℃澘锛岄噸缃〃鍗曪紙淇濇寔褰撳墠琛ㄥ崟鐘舵�侊級
+ const currentFormData = { ...form.value };
+ const currentProductData = [...productData.value];
+
+ // 濡傛灉瀵硅瘽妗嗘湭鎵撳紑锛屽厛鎵撳紑
+ if (!dialogFormVisible.value) {
+ operationType.value = 'add';
+ dialogFormVisible.value = true;
+ }
+
+ // 绛夊緟涓嬩竴涓� tick 鍚庢仮澶嶆暟鎹�
+ await nextTick();
+ form.value = {
+ ...form.value,
+ ...currentFormData,
+ };
+ productData.value = currentProductData;
+ }
+};
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
@@ -874,14 +1053,21 @@
purchaseContractNumber: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- projectName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ approverId:[{ required: true, message: "璇烽�夋嫨瀹℃壒浜�", trigger: "change" }],
+ projectName:[{ required:true, message:"璇疯緭鍏ラ」鐩悕绉�", trigger:"blur"}],
supplierId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
},
});
const { form, rules } = toRefs(data);
-const { form: searchForm } = useFormData(data.searchForm);
+const { form: searchForm } = useFormData({
+ ...data.searchForm,
+ // 璁剧疆褰曞叆鏃ユ湡鑼冨洿涓哄綋澶�
+ entryDate: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')],
+ entryDateStart: dayjs().startOf('day').format('YYYY-MM-DD'),
+ entryDateEnd: dayjs().endOf('day').format('YYYY-MM-DD')
+});
// 浜у搧琛ㄥ崟寮规鏁版嵁
const productFormVisible = ref(false);
@@ -912,7 +1098,7 @@
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- warnNum: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
+ warnNum: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
taxInclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
@@ -950,6 +1136,83 @@
page.current = 1;
getList();
};
+
+// 淇濆瓨妯℃澘
+const handleButtonClick = async () => {
+ // 妫�鏌ユā鏉垮悕绉版槸鍚︿负绌�
+ if (!templateName.value || templateName.value.trim() === '') {
+ ElMessage({
+ message: '璇疯緭鍏ユā鏉垮悕绉�',
+ type: 'warning',
+ });
+ return;
+ }
+
+ // 妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶�
+ const isDuplicate = checkTemplateNameDuplicate(templateName.value);
+ if (isDuplicate) {
+ ElMessage({
+ message: '妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�',
+ type: 'warning',
+ });
+ return;
+ }
+
+ // 妫�鏌ヤ緵搴斿晢鏄惁閫夋嫨
+ if (!form.value.supplierId) {
+ ElMessage({
+ message: '璇峰厛閫夋嫨渚涘簲鍟�',
+ type: 'warning',
+ });
+ return;
+ }
+
+ // 妫�鏌ユ槸鍚︽湁浜у搧鏁版嵁
+ // if (!productData.value || productData.value.length === 0) {
+ // ElMessage({
+ // message: '璇峰厛娣诲姞浜у搧淇℃伅',
+ // type: 'warning',
+ // });
+ // return;
+ // }
+
+ try {
+ let params = {
+ productData: proxy.HaveJson(productData.value),
+ supplierId: form.value.supplierId,
+ paymentMethod: form.value.paymentMethod,
+ recorderId: form.value.recorderId,
+ approverId: form.value.approverId,
+ templateName: templateName.value.trim()
+ };
+ console.log(params);
+ let res = await addPurchaseTemplate(params);
+
+ if (res && res.code === 200) {
+ ElMessage({
+ message: '妯℃澘淇濆瓨鎴愬姛',
+ type: 'success',
+ });
+ // 淇濆瓨鎴愬姛鍚庨噸鏂拌幏鍙栨ā鏉垮垪琛�
+ await getTemplateList();
+ // 娓呯┖妯℃澘鍚嶇О杈撳叆
+ templateName.value = '';
+ filterInputValue.value = '';
+ isTemplateNameDuplicate.value = false;
+ } else {
+ ElMessage({
+ message: res?.msg || '妯℃澘淇濆瓨澶辫触',
+ type: 'error',
+ });
+ }
+ } catch (error) {
+ console.error('淇濆瓨妯℃澘澶辫触:', error);
+ ElMessage({
+ message: '妯℃澘淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯',
+ type: 'error',
+ });
+ }
+};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param) => {
return proxy.summarizeTable(
@@ -980,8 +1243,13 @@
purchaseListPage({ ...rest, ...page })
.then((res) => {
tableLoading.value = false;
- tableData.value = res.data.records;
- tableData.value.map((item) => {
+ // tableData.value = res.data.records;
+ tableData.value = res.data.records.map(record => ({
+ ...record,
+ isInvalid: record.isWhite === 1
+ }));
+ // 鍒濆鍖栧瓙鏁版嵁鏁扮粍
+ tableData.value.forEach((item) => {
item.children = [];
});
total.value = res.data.total;
@@ -1000,19 +1268,24 @@
};
const expandedRowKeys = ref([]);
// 灞曞紑琛�
-const expandChange = (row, expandedRows) => {
+const expandChange = async (row, expandedRows) => {
if (expandedRows.length > 0) {
expandedRowKeys.value = [];
try {
- productList({ salesLedgerId: row.id, type: 2 }).then((res) => {
- const index = tableData.value.findIndex((item) => item.id === row.id);
- if (index > -1) {
- tableData.value[index].children = res.data;
- }
+ const res = await productList({ salesLedgerId: row.id, type: 2 });
+ const index = tableData.value.findIndex((item) => item.id === row.id);
+ if (index > -1) {
+ tableData.value[index].children = res.data || [];
expandedRowKeys.value.push(row.id);
- });
+ }
} catch (error) {
- console.log(error);
+ console.error('鍔犺浇浜у搧鍒楄〃澶辫触:', error);
+ proxy.$modal.msgError('鍔犺浇浜у搧鍒楄〃澶辫触');
+ // 灞曞紑澶辫触鏃讹紝绉婚櫎灞曞紑鐘舵��
+ const index = expandedRows.findIndex(item => item.id === row.id);
+ if (index > -1) {
+ expandedRows.splice(index, 1);
+ }
}
} else {
expandedRowKeys.value = [];
@@ -1031,40 +1304,63 @@
]);
};
// 鎵撳紑寮规
-const openForm = (type, row) => {
+const openForm = async (type, row) => {
+ await getTemplateList()
operationType.value = type;
form.value = {};
productData.value = [];
fileList.value = [];
- if (operationType.value == "add") {
- createPurchaseNo().then((res) => {
- form.value.purchaseContractNumber = res.data;
- });
- }
- userListNoPage().then((res) => {
- userList.value = res.data;
- });
- getSalesNo().then((res) => {
- salesContractList.value = res;
- });
- getOptions().then((res) => {
- supplierList.value = res.data;
- });
- form.value.recorderId = userStore.id;
- form.value.entryDate = getCurrentDate();
- if (type === "edit") {
- currentId.value = row.id;
- getPurchaseById({ id: row.id, type: 2 }).then((res) => {
- form.value = { ...res };
- productData.value = form.value.productData;
- if (form.value.salesLedgerFiles) {
- fileList.value = form.value.salesLedgerFiles;
- } else {
- fileList.value = [];
+ templateName.value = '';
+ filterInputValue.value = '';
+ isTemplateNameDuplicate.value = false;
+ try {
+ // 骞惰鍔犺浇鍩虹鏁版嵁
+ const [userRes, salesRes, supplierRes] = await Promise.all([
+ userListNoPage(),
+ getSalesNo(),
+ getOptions()
+ ]);
+
+ userList.value = userRes.data || [];
+ salesContractList.value = salesRes || [];
+ // 渚涘簲鍟嗚繃婊ゅ嚭isWhite=0 鐨勬暟鎹�
+ supplierList.value = (supplierRes.data || []).filter((item) => item.isWhite === 0);
+
+ // 璁剧疆榛樿鍊�
+ form.value.recorderId = userStore.id;
+ form.value.entryDate = getCurrentDate();
+
+ if (type === "add") {
+ // 鏂板鏃剁敓鎴愰噰璐悎鍚屽彿
+ try {
+ const purchaseNoRes = await createPurchaseNo();
+ if (purchaseNoRes?.data) {
+ form.value.purchaseContractNumber = purchaseNoRes.data;
+ }
+ } catch (error) {
+ console.error('鐢熸垚閲囪喘鍚堝悓鍙峰け璐�:', error);
+ proxy.$modal.msgWarning('鐢熸垚閲囪喘鍚堝悓鍙峰け璐�');
}
- });
+ } else if (type === "edit" && row?.id) {
+ // 缂栬緫鏃跺姞杞芥暟鎹�
+ currentId.value = row.id;
+ try {
+ const purchaseRes = await getPurchaseById({ id: row.id, type: 2 });
+ form.value = { ...purchaseRes };
+ productData.value = purchaseRes.productData || [];
+ fileList.value = purchaseRes.salesLedgerFiles || [];
+ } catch (error) {
+ console.error('鍔犺浇閲囪喘鍙拌处鏁版嵁澶辫触:', error);
+ proxy.$modal.msgError('鍔犺浇鏁版嵁澶辫触');
+ return;
+ }
+ }
+
+ dialogFormVisible.value = true;
+ } catch (error) {
+ console.error('鎵撳紑琛ㄥ崟澶辫触:', error);
+ proxy.$modal.msgError('鍔犺浇鍩虹鏁版嵁澶辫触');
}
- dialogFormVisible.value = true;
};
// 涓婁紶鍓嶆牎妫�
function handleBeforeUpload(file) {
@@ -1093,18 +1389,24 @@
}
}
// 绉婚櫎鏂囦欢
-function handleRemove(file) {
+async function handleRemove(file) {
+ if (!file?.id) {
+ return;
+ }
console.log("handleRemove", file.id);
if (file.size > 1024 * 1024 * 10) {
// 浠呭墠绔竻鐞嗭紝涓嶈皟鐢ㄥ垹闄ゆ帴鍙e拰鎻愮ず
- return;
+ return;
}
- if (operationType.value === "edit") {
- let ids = [];
- ids.push(file.id);
- delLedgerFile(ids).then((res) => {
+
+ if (operationType.value === "edit" && file.id) {
+ try {
+ await delLedgerFile([file.id]);
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- });
+ } catch (error) {
+ console.error('鍒犻櫎鏂囦欢澶辫触:', error);
+ proxy.$modal.msgError("鍒犻櫎鏂囦欢澶辫触");
+ }
}
}
// 鎻愪氦琛ㄥ崟
@@ -1123,6 +1425,12 @@
}
form.value.tempFileIds = tempFileIds;
form.value.type = 2;
+
+ // 濡傛灉salesLedgerId涓虹┖锛屽垯涓嶄紶閫抯alesContractNo
+ if (!form.value.salesLedgerId) {
+ form.value.salesContractNo = ''
+ }
+
addOrEditPurchase(form.value).then((res) => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
@@ -1156,7 +1464,6 @@
const getModels = (value) => {
if (value) {
productForm.value.productCategory = findNodeById(productOptions.value, value) || "";
- productForm.value.productId = value;
modelList({ id: value }).then((res) => {
modelOptions.value = res;
});
@@ -1240,13 +1547,6 @@
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
return;
}
- // 淇濊瘉鑷冲皯淇濈暀涓�鏉′骇鍝佷俊鎭�
- const remainingCount =
- productData.value.length - productSelectedRows.value.length;
- if (remainingCount < 1) {
- proxy.$modal.msgWarning("鑷冲皯淇濈暀涓�鏉′骇鍝佷俊鎭紝鏃犳硶鍏ㄩ儴鍒犻櫎");
- return;
- }
if (operationType.value === "add") {
productSelectedRows.value.forEach((selectedRow) => {
const index = productData.value.findIndex(
@@ -1270,7 +1570,7 @@
delProduct(ids).then((res) => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
closeProductDia();
- getPurchaseById({ id: currentId.value, type: 2 }).then(
+ getSalesLedgerWithProducts({ id: currentId.value, type: 2 }).then(
(res) => {
productData.value = res.productData;
}
@@ -1408,7 +1708,6 @@
var index = salesContractList.value.findIndex((item) => item.id == row);
console.log("index", index);
if (index > -1) {
- form.value.projectName = salesContractList.value[index].projectName;
await querygProductInfoByContractNo();
}
};
@@ -1520,14 +1819,16 @@
if (!content) return;
// 妯℃嫙瑙f瀽浜岀淮鐮佸唴瀹癸紝杩欓噷鍙互鏍规嵁瀹為檯闇�姹傝皟鏁磋В鏋愰�昏緫
- // 鍋囪鎵爜鍐呭鏍煎紡涓猴細鍚堝悓鍙穦渚涘簲鍟唡椤圭洰|閲戦|浠樻鏂瑰紡
+ // 鍋囪鎵爜鍐呭鏍煎紡涓猴細鍚堝悓鍙穦渚涘簲鍟唡閲戦|浠樻鏂瑰紡
const parts = content.split('|');
- if (parts.length >= 3) {
+ if (parts.length >= 2) {
scanAddForm.purchaseContractNumber = parts[0] || "";
scanAddForm.supplierName = parts[1] || "";
- scanAddForm.projectName = parts[2] || "";
- scanAddForm.contractAmount = parts[3] || "";
- scanAddForm.paymentMethod = parts[4] || "";
+ scanAddForm.contractAmount = parts[2] || "";
+ scanAddForm.paymentMethod = parts[3] || "";
+ scanAddForm.projectName = parts[4] || "";
+ // scanAddForm.contractAmount = parts[3] || "";
+ // scanAddForm.paymentMethod = parts[4] || "";
}
};
@@ -1613,11 +1914,41 @@
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
+// 娣诲姞琛岀被鍚嶆柟娉�
+const tableRowClassName = ({ row }) => {
+ return row.isInvalid ? 'invalid-row' : '';
+};
+// 鑾峰彇妯℃澘淇℃伅
+const getTemplateList =async ()=>{
+ let res = await getPurchaseTemplateList()
+ if(res && res.code===200 && Array.isArray(res.data)){
+ templateList.value = res.data
+ }
+}
onMounted(() => {
getList();
+ getTemplateList();
+
});
</script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.invalid-row {
+ opacity: 0.6;
+ background-color: #f5f7fa;
+}
+.el-row{
+ justify-content: space-between;
+ align-items: center
+}
+.no-arrow-select {
+ --el-select-suffix-icon-color: transparent; /* 闅愯棌榛樿涓嬫媺绠ご */
+}
+.select-button-group {
+ display: flex;
+ align-items: center;
+}
+
+</style>
--
Gitblit v1.9.3