From 7e0bbfe08dc695261179823ca5190532b7784b85 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 07 五月 2026 13:38:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_NEW_pro
---
src/views/productionManagement/productionProcess/index.vue | 50
multiple/config.json | 2
src/components/ProcessParamListDialog.vue | 6
src/views/basicData/parameterMaintenance/index.vue | 3
src/views/salesManagement/salesLedger/index.vue | 9
src/views/tool/build/CodeTypeDialog.vue | 2
src/components/ProjectManagement/ProgressReportDialog.vue | 2
src/views/basicData/customerFile/index.vue | 50
src/views/salesManagement/returnOrder/components/formDia.vue | 4
vite.config.js | 4
src/views/collaborativeApproval/attendanceManagement/index.vue | 2
src/views/collaborativeApproval/enterpriseBook/index.vue | 2
src/views/example/DynamicTableExample.vue | 2
src/views/equipmentManagement/spareParts/index.vue | 2
src/views/oaSystem/projectManagement/index.vue | 2
src/api/basicData/customerFile.js | 118 --
src/views/equipmentManagement/defectManagement/index.vue | 2
src/views/basicData/customerFileOpenSea/index.vue | 55
src/utils/generator/html.js | 4
src/views/salesManagement/salesQuotation/index.vue | 28
src/views/equipmentManagement/brand/index.vue | 2
src/api/basicData/customer.js | 75 +
src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue | 2
src/views/oaSystem/projectManagement/components/taskTree.vue | 2
src/views/procurementManagement/procurementLedger/index.vue | 2338 +++++++++++++++++++++++++------------------------
src/views/collaborativeApproval/notificationManagement/index.vue | 2
src/views/oaSystem/projectManagement/components/milestoneList.vue | 2
src/views/productionPlan/productionPlan/index.vue | 8
src/views/collaborativeApproval/rpaManagement/index.vue | 2
src/views/reportAnalysis/dataDashboard/index0.vue | 2
src/views/oaSystem/projectManagement/projectDetail.vue | 4
31 files changed, 1,397 insertions(+), 1,391 deletions(-)
diff --git a/multiple/config.json b/multiple/config.json
index 318b235..565ad80 100644
--- a/multiple/config.json
+++ b/multiple/config.json
@@ -26,4 +26,4 @@
},
"logo": "/src/assets/logo/logo.png",
"favicon": "/public/favicon.ico"
-}
+}
\ No newline at end of file
diff --git a/src/api/basicData/customer.js b/src/api/basicData/customer.js
new file mode 100644
index 0000000..28f2eab
--- /dev/null
+++ b/src/api/basicData/customer.js
@@ -0,0 +1,75 @@
+import request from '@/utils/request'
+
+export function listCustomer(query) {
+ return request({
+ url: '/basic/customer/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 鍒嗛厤瀹㈡埛
+export function assignCustomer(data) {
+ return request({
+ url: '/basic/customer/assignCustomer',
+ method: 'post',
+ data
+ })
+}
+
+// 鍥炴敹瀹㈡埛
+export function recycleCustomer(data) {
+ return request({
+ url: '/basic/customer/recycleCustomer',
+ method: 'post',
+ data
+ })
+}
+
+export function shareCustomer(data) {
+ return request({
+ url: '/basic/customer/together',
+ method: 'post',
+ data: data
+ })
+}
+
+export function getCustomer(id) {
+ return request({
+ url: '/basic/customer/' + id,
+ method: 'get'
+ })
+}
+
+export function addCustomer(data) {
+ return request({
+ url: '/basic/customer/addCustomer',
+ method: 'post',
+ data: data
+ })
+}
+
+export function updateCustomer(data) {
+ return request({
+ url: '/basic/customer/updateCustomer',
+ method: 'post',
+ data: data
+ })
+}
+
+export function exportCustomer(query) {
+ return request({
+ url: '/basic/customer/export',
+ method: 'get',
+ params: query,
+ responseType: 'blob'
+ })
+}
+
+export function delCustomer(ids) {
+ return request({
+ url: '/basic/customer/delCustomer',
+ method: 'delete',
+ data: ids
+ })
+}
diff --git a/src/api/basicData/customerFile.js b/src/api/basicData/customerFile.js
index 7b6d7c6..6602ddc 100644
--- a/src/api/basicData/customerFile.js
+++ b/src/api/basicData/customerFile.js
@@ -1,123 +1,5 @@
import request from '@/utils/request'
-export function listCustomer(query) {
- return request({
- url: '/basic/customer/list',
- method: 'get',
- params: query
- })
-}
-
-// 瀹㈡埛妗f绉佹捣鏌ヨ
-export function listCustomerPrivatePool(query) {
- return request({
- url: '/customerPrivatePool/listPage',
- method: 'get',
- params: query
- })
-}
-
-export function addCustomerPrivatePool(data) {
- return request({
- url: '/customerPrivatePool/add',
- method: 'post',
- data: data
- })
-}
-
-export function addCustomerPrivate(data) {
- return request({
- url: '/customerPrivate/add',
- method: 'post',
- data: data
- })
-}
-
-export function delCustomerPrivate(ids) {
- return request({
- url: '/customerPrivate/delete',
- method: 'delete',
- data: ids
- })
-}
-
-export function delCustomerPrivatePool(id) {
- return request({
- url: '/customerPrivatePool/delete/' + id,
- method: 'delete',
- })
-}
-
-export function shareCustomer(data) {
- return request({
- url: '/customerPrivatePool/together',
- method: 'post',
- data: data
- })
-}
-
-export function getCustomer(id) {
- return request({
- url: '/basic/customer/' + id,
- method: 'get'
- })
-}
-
-export function getCustomerPrivatePoolById(id) {
- return request({
- url: '/customerPrivatePool/getbyId/' + id,
- method: 'get'
- })
-}
-
-export function getCustomerPrivatePoolInfo(id) {
- return request({
- url: '/customerPrivatePool/info/' + id,
- method: 'get'
- })
-}
-
-export function addCustomer(data) {
- return request({
- url: '/basic/customer/addCustomer',
- method: 'post',
- data: data
- })
-}
-
-export function updateCustomer(data) {
- return request({
- url: '/basic/customer/updateCustomer',
- method: 'post',
- data: data
- })
-}
-
-export function updateCustomerPrivatePool(data) {
- return request({
- url: '/customerPrivatePool/update',
- method: 'put',
- data: data
- })
-}
-
-export function exportCustomer(query) {
- return request({
- url: '/basic/customer/export',
- method: 'get',
- params: query,
- responseType: 'blob'
- })
-}
-
-export function delCustomer(ids) {
- return request({
- url: '/basic/customer/delCustomer',
- method: 'delete',
- data: ids
- })
-}
-
export function addCustomerFollow(data) {
return request({
url: '/basic/customer-follow/add',
diff --git a/src/components/ProcessParamListDialog.vue b/src/components/ProcessParamListDialog.vue
index 898abb0..38e892d 100644
--- a/src/components/ProcessParamListDialog.vue
+++ b/src/components/ProcessParamListDialog.vue
@@ -144,9 +144,8 @@
</div>
</div>
<template #footer>
+ <el-button type="primary" @click="handleParamSelectSubmit">纭畾</el-button>
<el-button @click="selectParamDialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary"
- @click="handleParamSelectSubmit">纭畾</el-button>
</template>
</el-dialog>
<!-- 缂栬緫鍙傛暟瀵硅瘽妗� -->
@@ -179,9 +178,8 @@
</el-form-item>
</el-form>
<template #footer>
+ <el-button type="primary" @click="handleEditParamSubmit">纭畾</el-button>
<el-button @click="editParamDialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary"
- @click="handleEditParamSubmit">纭畾</el-button>
</template>
</el-dialog>
</el-dialog>
diff --git a/src/components/ProjectManagement/ProgressReportDialog.vue b/src/components/ProjectManagement/ProgressReportDialog.vue
index 51ebdf7..dc6afe7 100644
--- a/src/components/ProjectManagement/ProgressReportDialog.vue
+++ b/src/components/ProjectManagement/ProgressReportDialog.vue
@@ -122,8 +122,8 @@
<template #footer>
<div class="dialog-footer">
- <el-button @click="visible = false">鍙栨秷</el-button>
<el-button type="primary" @click="submit">纭畾</el-button>
+ <el-button @click="visible = false">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
diff --git a/src/utils/generator/html.js b/src/utils/generator/html.js
index 4b29841..eacb48e 100644
--- a/src/utils/generator/html.js
+++ b/src/utils/generator/html.js
@@ -8,8 +8,8 @@
return `<el-dialog v-model="dialogVisible" @open="onOpen" @close="onClose" title="Dialog Titile">
${str}
<template #footer>
- <el-button @click="close">鍙栨秷</el-button>
- <el-button type="primary" @click="handelConfirm">纭畾</el-button>
+ <el-button type="primary" @click="handelConfirm">纭畾</el-button>
+ <el-button @click="close">鍙栨秷</el-button>
</template>
</el-dialog>`
}
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index a3a3dcf..a080bd9 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -211,7 +211,8 @@
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :action="upload.url"
+ :data="upload.data"
:disabled="upload.isUploading"
:before-upload="upload.beforeUpload"
:on-progress="upload.onProgress"
@@ -612,19 +613,13 @@
import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
import {
- addCustomerPrivate,
- delCustomerPrivate,
- getCustomer,
- getCustomerPrivatePoolById,
- getCustomerPrivatePoolInfo,
- listCustomerPrivatePool,
- updateCustomerPrivatePool,
addCustomerFollow,
updateCustomerFollow,
delCustomerFollow,
addReturnVisit,
getReturnVisit,
} from "@/api/basicData/customerFile.js";
+ import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer} from "@/api/basicData/customer.js";
import { ElMessageBox } from "element-plus";
import { userListNoPage } from "@/api/system/user.js";
import useUserStore from "@/store/modules/user";
@@ -656,7 +651,7 @@
const negotiationFormRef = ref();
const negotiationForm = reactive({
customerName: "",
- customerPrivatePoolId: "",
+ customerId: "",
followUpMethod: "",
followUpLevel: "",
followUpTime: "",
@@ -857,6 +852,7 @@
searchForm: {
customerName: "",
customerType: "",
+ type: 0
},
form: {
customerName: "",
@@ -871,6 +867,7 @@
bankAccount: "",
bankCode: "",
customerType: "",
+ type: 0
},
rules: {
customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -901,7 +898,10 @@
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/customerPrivate/importData",
+ url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+ data: {
+ type: 0
+ },
// 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
beforeUpload: file => {
console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -972,7 +972,7 @@
};
const getList = () => {
tableLoading.value = true;
- listCustomerPrivatePool({ ...searchForm.value, ...page }).then(res => {
+ listCustomer({ ...searchForm.value, ...page }).then(res => {
tableLoading.value = false;
tableData.value = res.data.records;
page.total = res.data.total;
@@ -994,7 +994,7 @@
}
/** 涓嬭浇妯℃澘 */
function importTemplate() {
- proxy.download("/customerPrivate/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
+ proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
}
// 鎵撳紑寮规
const openForm = (type, row) => {
@@ -1007,12 +1007,13 @@
contactPhone: "",
},
];
+ form.value.type = 0;
form.value.maintenanceTime = getCurrentDate();
userListNoPage().then(res => {
userList.value = res.data;
});
if (type === "edit") {
- getCustomerPrivatePoolById(row.id).then(res => {
+ getCustomer(row.id).then(res => {
form.value = { ...res.data };
formYYs.value.contactList = res.data.contactPerson
.split(",")
@@ -1049,7 +1050,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- addCustomerPrivate(form.value).then(res => {
+ addCustomer(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1063,7 +1064,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- updateCustomerPrivatePool(form.value).then(res => {
+ updateCustomer(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1082,7 +1083,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/customerPrivate/export", {}, "瀹㈡埛妗f.xlsx");
+ proxy.download("/basic/customer/export", {type: 0}, "瀹㈡埛妗f.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -1111,7 +1112,7 @@
})
.then(() => {
tableLoading.value = true;
- delCustomerPrivate(ids)
+ delCustomer(ids)
.then(() => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
@@ -1165,8 +1166,7 @@
if (reminderForm.id) {
submitvalue.value = {
id: reminderForm.id,
- customerPrivatePoolId: reminderForm.id,
- customerPrivatePoolId: currentCustomerId.value,
+ customerId: currentCustomerId.value,
isEnabled: reminderForm.reminderSwitch ? 1 : 0,
content: reminderForm.reminderContent,
reminderTime: reminderForm.reminderTime,
@@ -1174,7 +1174,7 @@
};
} else {
submitvalue.value = {
- customerPrivatePoolId: currentCustomerId.value,
+ customerId: currentCustomerId.value,
isEnabled: reminderForm.reminderSwitch ? 1 : 0,
content: reminderForm.reminderContent,
reminderTime: reminderForm.reminderTime,
@@ -1203,7 +1203,7 @@
// 鎵撳紑娲借皥杩涘害寮圭獥
const openNegotiationDialog = row => {
negotiationForm.customerName = row.customerName;
- negotiationForm.customerPrivatePoolId = row.id;
+ negotiationForm.customerId = row.id;
negotiationForm.followUpMethod = "";
negotiationForm.followUpLevel = "";
negotiationForm.followUpTime = "";
@@ -1232,7 +1232,7 @@
// 淇敼鎿嶄綔
updateCustomerFollow(negotiationForm).then(res => {
// 鏇存柊鏈湴鏁版嵁
- getCustomer(negotiationForm.customerPrivatePoolId).then(res => {
+ getCustomer(negotiationForm.customerId).then(res => {
// 鏇存柊鏈湴鏁版嵁
negotiationRecords.value = res.data.followUpList || [];
});
@@ -1264,7 +1264,7 @@
// 鎵撳紑璇︽儏寮圭獥
const openDetailDialog = row => {
- getCustomerPrivatePoolInfo(row.id).then(res => {
+ getCustomer(row.id).then(res => {
// 濉厖瀹㈡埛鍩烘湰淇℃伅
Object.assign(detailForm, res.data);
@@ -1285,7 +1285,7 @@
// 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
Object.assign(negotiationForm, {
customerName: row.customerName,
- customerPrivatePoolId: row.customerPrivatePoolId,
+ customerId: row.customerId,
followUpMethod: row.followUpMethod,
followUpLevel: row.followUpLevel,
followUpTime: row.followUpTime,
@@ -1313,7 +1313,7 @@
// });
delCustomerFollow(row.id).then(() => {
// 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
- getCustomer(row.customerPrivatePoolId).then(res => {
+ getCustomer(row.customerId).then(res => {
// 鏇存柊鏈湴鏁版嵁
negotiationRecords.value = res.data.followUpList || [];
});
diff --git a/src/views/basicData/customerFileOpenSea/index.vue b/src/views/basicData/customerFileOpenSea/index.vue
index 8bc8f6f..2598f48 100644
--- a/src/views/basicData/customerFileOpenSea/index.vue
+++ b/src/views/basicData/customerFileOpenSea/index.vue
@@ -280,7 +280,8 @@
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :action="upload.url"
+ :data="upload.data"
:disabled="upload.isUploading"
:before-upload="upload.beforeUpload"
:on-progress="upload.onProgress"
@@ -681,20 +682,23 @@
import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
import {
- addCustomer,
- addCustomerPrivatePool,
- delCustomerPrivatePool,
- delCustomer,
- getCustomer,
- shareCustomer,
- listCustomer,
- updateCustomer,
addCustomerFollow,
updateCustomerFollow,
delCustomerFollow,
addReturnVisit,
getReturnVisit,
} from "@/api/basicData/customerFile.js";
+ import {
+ listCustomer,
+ addCustomer,
+ delCustomer,
+ updateCustomer,
+ getCustomer,
+ assignCustomer,
+ recycleCustomer,
+ shareCustomer,
+ } from "@/api/basicData/customer.js";
+
import { ElMessageBox } from "element-plus";
import { userListNoPage } from "@/api/system/user.js";
import useUserStore from "@/store/modules/user";
@@ -915,7 +919,7 @@
type: "text",
showHide: row => row.usageStatus == 1,
clickFun: row => {
- recycleCustomer(row);
+ recycle(row);
},
},
{
@@ -970,6 +974,7 @@
searchForm: {
customerName: "",
customerType: "",
+ type: 1
},
form: {
customerName: "",
@@ -984,6 +989,7 @@
bankAccount: "",
bankCode: "",
customerType: "",
+ type: 1
},
rules: {
customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -1015,6 +1021,9 @@
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+ data: {
+ type: 1
+ },
// 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
beforeUpload: file => {
console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -1122,6 +1131,7 @@
},
];
form.value.maintenanceTime = getCurrentDate();
+ form.value.type = 1;
userListNoPage().then(res => {
userList.value = res.data;
});
@@ -1214,7 +1224,7 @@
const openShareDialog = row => {
shareForm.id = row.id;
shareForm.customerName = row.customerName;
- shareForm.boundIds = [];
+ shareForm.boundIds = row.userIds || [];
ensureUserList().then(() => {
shareDialogVisible.value = true;
});
@@ -1231,9 +1241,9 @@
if (!valid) {
return;
}
- addCustomerPrivatePool({
- customerId: assignForm.id,
- boundId: assignForm.boundId,
+ assignCustomer({
+ id: assignForm.id,
+ usageUser: assignForm.boundId,
}).then(() => {
proxy.$modal.msgSuccess("鍒嗛厤鎴愬姛");
closeAssignDialog();
@@ -1247,8 +1257,8 @@
return;
}
shareCustomer({
- customerId: shareForm.id,
- boundIds: shareForm.boundIds,
+ id: shareForm.id,
+ userIds: shareForm.boundIds,
}).then(() => {
proxy.$modal.msgSuccess("鍏变韩鎴愬姛");
closeShareDialog();
@@ -1256,18 +1266,17 @@
});
});
};
- const recycleCustomer = row => {
+ const recycle = row => {
ElMessageBox.confirm("纭鍥炴敹瀹㈡埛鈥�" + row.customerName + "鈥濆悧锛�", "鍥炴敹鎻愮ず", {
confirmButtonText: "纭",
cancelButtonText: "鍙栨秷",
type: "warning",
})
.then(() => {
- return delCustomerPrivatePool(row.id);
- })
- .then(() => {
- proxy.$modal.msgSuccess("鍥炴敹鎴愬姛");
- getList();
+ return recycleCustomer({id: row.id}).then(() => {
+ proxy.$modal.msgSuccess("鍥炴敹鎴愬姛");
+ getList();
+ })
})
.catch(error => {
if (error === "cancel" || error === "close") {
@@ -1283,7 +1292,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+ proxy.download("/basic/customer/export", {type: 1}, "瀹㈡埛妗f.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
diff --git a/src/views/basicData/parameterMaintenance/index.vue b/src/views/basicData/parameterMaintenance/index.vue
index 5681c2b..2dbf5df 100644
--- a/src/views/basicData/parameterMaintenance/index.vue
+++ b/src/views/basicData/parameterMaintenance/index.vue
@@ -142,9 +142,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭畾</el-button>
<el-button @click="dialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary"
- @click="handleSubmit">纭畾</el-button>
</span>
</template>
</el-dialog>
diff --git a/src/views/collaborativeApproval/attendanceManagement/index.vue b/src/views/collaborativeApproval/attendanceManagement/index.vue
index f6a3e3c..1f5f956 100644
--- a/src/views/collaborativeApproval/attendanceManagement/index.vue
+++ b/src/views/collaborativeApproval/attendanceManagement/index.vue
@@ -303,8 +303,8 @@
<template #footer>
<span class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
<el-button type="primary" @click="submitForm">纭畾</el-button>
+ <el-button @click="dialogVisible = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
diff --git a/src/views/collaborativeApproval/enterpriseBook/index.vue b/src/views/collaborativeApproval/enterpriseBook/index.vue
index fa9fa5c..8239811 100644
--- a/src/views/collaborativeApproval/enterpriseBook/index.vue
+++ b/src/views/collaborativeApproval/enterpriseBook/index.vue
@@ -275,8 +275,8 @@
</el-form-item>
</el-form>
<template #footer>
- <el-button @click="showAddContactDialog = false">鍙栨秷</el-button>
<el-button type="primary" @click="addContact">纭畾</el-button>
+ <el-button @click="showAddContactDialog = false">鍙栨秷</el-button>
</template>
</el-dialog>
</div>
diff --git a/src/views/collaborativeApproval/notificationManagement/index.vue b/src/views/collaborativeApproval/notificationManagement/index.vue
index fb3f7a8..fa02f47 100644
--- a/src/views/collaborativeApproval/notificationManagement/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/index.vue
@@ -131,8 +131,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
<el-button type="primary" @click="submitForm">纭畾</el-button>
+ <el-button @click="dialogVisible = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
diff --git a/src/views/collaborativeApproval/rpaManagement/index.vue b/src/views/collaborativeApproval/rpaManagement/index.vue
index 9e5b504..c734b28 100644
--- a/src/views/collaborativeApproval/rpaManagement/index.vue
+++ b/src/views/collaborativeApproval/rpaManagement/index.vue
@@ -80,8 +80,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
<el-button type="primary" @click="submitForm">纭畾</el-button>
+ <el-button @click="dialogVisible = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
diff --git a/src/views/equipmentManagement/brand/index.vue b/src/views/equipmentManagement/brand/index.vue
index 6607cc8..f93518a 100644
--- a/src/views/equipmentManagement/brand/index.vue
+++ b/src/views/equipmentManagement/brand/index.vue
@@ -60,8 +60,8 @@
</el-form-item>
</el-form>
<template #footer>
- <el-button @click="visible = false">鍙栨秷</el-button>
<el-button type="primary" @click="handleSubmit">纭畾</el-button>
+ <el-button @click="visible = false">鍙栨秷</el-button>
</template>
</el-dialog>
</div>
diff --git a/src/views/equipmentManagement/defectManagement/index.vue b/src/views/equipmentManagement/defectManagement/index.vue
index f35454f..8673000 100644
--- a/src/views/equipmentManagement/defectManagement/index.vue
+++ b/src/views/equipmentManagement/defectManagement/index.vue
@@ -65,8 +65,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="showRegisterDialog = false">鍙栨秷</el-button>
<el-button type="primary" @click="submitDefectForm">纭畾</el-button>
+ <el-button @click="showRegisterDialog = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
diff --git a/src/views/equipmentManagement/spareParts/index.vue b/src/views/equipmentManagement/spareParts/index.vue
index 45e0157..8abe35d 100644
--- a/src/views/equipmentManagement/spareParts/index.vue
+++ b/src/views/equipmentManagement/spareParts/index.vue
@@ -88,8 +88,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="dialogVisible = false" :disabled="formLoading">鍙栨秷</el-button>
<el-button type="primary" @click="submitForm" :loading="formLoading">纭畾</el-button>
+ <el-button @click="dialogVisible = false" :disabled="formLoading">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
diff --git a/src/views/example/DynamicTableExample.vue b/src/views/example/DynamicTableExample.vue
index 038cd43..14dfc92 100644
--- a/src/views/example/DynamicTableExample.vue
+++ b/src/views/example/DynamicTableExample.vue
@@ -94,8 +94,8 @@
<template #footer>
<div class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
<el-button type="primary" @click="handleSubmit">纭畾</el-button>
+ <el-button @click="dialogVisible = false">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
diff --git a/src/views/oaSystem/projectManagement/components/milestoneList.vue b/src/views/oaSystem/projectManagement/components/milestoneList.vue
index 47b0027..ed31772 100644
--- a/src/views/oaSystem/projectManagement/components/milestoneList.vue
+++ b/src/views/oaSystem/projectManagement/components/milestoneList.vue
@@ -84,8 +84,8 @@
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
<el-button type="primary" @click="submitEditForm">纭畾</el-button>
+ <el-button @click="dialogVisible = false">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
diff --git a/src/views/oaSystem/projectManagement/components/taskTree.vue b/src/views/oaSystem/projectManagement/components/taskTree.vue
index 11e3ae8..03a1a15 100644
--- a/src/views/oaSystem/projectManagement/components/taskTree.vue
+++ b/src/views/oaSystem/projectManagement/components/taskTree.vue
@@ -164,8 +164,8 @@
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button @click="dialogOpen = false">鍙栨秷</el-button>
<el-button type="primary" @click="submitTaskForm">纭畾</el-button>
+ <el-button @click="dialogOpen = false">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
diff --git a/src/views/oaSystem/projectManagement/index.vue b/src/views/oaSystem/projectManagement/index.vue
index 2a0ec3a..79fbe7f 100644
--- a/src/views/oaSystem/projectManagement/index.vue
+++ b/src/views/oaSystem/projectManagement/index.vue
@@ -188,8 +188,8 @@
/>
<template #footer>
<div class="dialog-footer">
- <el-button @click="cancel">鍙栨秷</el-button>
<el-button type="primary" @click="submitForm">纭畾</el-button>
+ <el-button @click="cancel">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
diff --git a/src/views/oaSystem/projectManagement/projectDetail.vue b/src/views/oaSystem/projectManagement/projectDetail.vue
index c3b0779..578f76e 100644
--- a/src/views/oaSystem/projectManagement/projectDetail.vue
+++ b/src/views/oaSystem/projectManagement/projectDetail.vue
@@ -137,8 +137,8 @@
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button @click="cancel">鍙栨秷</el-button>
<el-button type="primary" @click="submitForm">纭畾</el-button>
+ <el-button @click="cancel">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
@@ -239,8 +239,8 @@
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button @click="cancelGoal">鍙栨秷</el-button>
<el-button type="primary" @click="submitGoalForm">纭畾</el-button>
+ <el-button @click="cancelGoal">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 7c8cb89..cffdcc6 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -9,7 +9,7 @@
placeholder="璇疯緭鍏�"
clearable
prefix-icon="Search"
- @change="handleQuery"/>
+ @change="handleQuery" />
</el-form-item>
<el-form-item label="閲囪喘鍚堝悓鍙凤細">
<el-input v-model="searchForm.purchaseContractNumber"
@@ -17,21 +17,21 @@
placeholder="璇疯緭鍏�"
@change="handleQuery"
clearable
- :prefix-icon="Search"/>
+ :prefix-icon="Search" />
</el-form-item>
<el-form-item label="閿�鍞悎鍚屽彿锛�">
<el-input v-model="searchForm.salesContractNo"
placeholder="璇疯緭鍏�"
clearable
prefix-icon="Search"
- @change="handleQuery"/>
+ @change="handleQuery" />
</el-form-item>
<el-form-item label="椤圭洰鍚嶇О锛�">
<el-input v-model="searchForm.projectName"
placeholder="璇疯緭鍏�"
clearable
prefix-icon="Search"
- @change="handleQuery"/>
+ @change="handleQuery" />
</el-form-item>
<el-form-item label="褰曞叆鏃ユ湡锛�">
<el-date-picker v-model="searchForm.entryDate"
@@ -40,7 +40,7 @@
type="daterange"
placeholder="璇烽�夋嫨"
clearable
- @change="changeDaterange"/>
+ @change="changeDaterange" />
</el-form-item>
<el-form-item>
<el-button type="primary"
@@ -54,7 +54,9 @@
<div style="display: flex;justify-content: flex-end;margin-bottom: 20px;">
<el-button type="primary"
@click="openForm('add')">鏂板鍙拌处</el-button>
- <el-button type="primary" plain @click="handleImport">瀵煎叆</el-button>
+ <el-button type="primary"
+ plain
+ @click="handleImport">瀵煎叆</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger"
plain
@@ -73,7 +75,7 @@
height="calc(100vh - 21.5em)">
<el-table-column align="center"
type="selection"
- width="55"/>
+ width="55" />
<el-table-column type="expand">
<template #default="props">
<el-table :data="props.row.children"
@@ -83,62 +85,60 @@
<el-table-column align="center"
label="搴忓彿"
type="index"
- width="60"/>
+ width="60" />
<el-table-column label="浜у搧澶х被"
- prop="productCategory"/>
+ prop="productCategory" />
<el-table-column label="瑙勬牸鍨嬪彿"
- prop="specificationModel"/>
+ prop="specificationModel" />
<el-table-column label="鍗曚綅"
- prop="unit"/>
+ prop="unit" />
<el-table-column label="鏁伴噺"
- prop="quantity"/>
+ prop="quantity" />
<el-table-column label="鍙敤鏁伴噺"
- prop="availableQuality"/>
+ prop="availableQuality" />
<el-table-column label="閫�璐ф暟閲�"
- prop="returnQuality"/>
-
+ prop="returnQuality" />
<el-table-column label="绋庣巼(%)"
- prop="taxRate"/>
+ prop="taxRate" />
<el-table-column label="鍚◣鍗曚环(鍏�)"
prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"/>
+ :formatter="formattedNumber" />
<el-table-column label="鍚◣鎬讳环(鍏�)"
prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"/>
+ :formatter="formattedNumber" />
<el-table-column label="涓嶅惈绋庢�讳环(鍏�)"
prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"/>
+ :formatter="formattedNumber" />
</el-table>
</template>
</el-table-column>
<el-table-column align="center"
label="搴忓彿"
type="index"
- width="60"/>
+ width="60" />
<el-table-column label="閲囪喘鍚堝悓鍙�"
prop="purchaseContractNumber"
width="160"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="閿�鍞悎鍚屽彿"
prop="salesContractNo"
width="160"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="渚涘簲鍟嗗悕绉�"
prop="supplierName"
width="160"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="椤圭洰鍚嶇О"
prop="projectName"
width="320"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="瀹℃壒鐘舵��"
prop="approvalStatus"
width="100"
show-overflow-tooltip>
<template #default="scope">
- <el-tag
- :type="getApprovalStatusType(scope.row.approvalStatus)"
- size="small">
+ <el-tag :type="getApprovalStatusType(scope.row.approvalStatus)"
+ size="small">
{{ approvalStatusText[scope.row.approvalStatus] || '鏈煡鐘舵��' }}
</el-tag>
</template>
@@ -146,28 +146,28 @@
<el-table-column label="绛捐鏃ユ湡"
prop="executionDate"
width="100"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="浠樻鏂瑰紡"
width="100"
prop="paymentMethod"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="鍚堝悓閲戦(鍏�)"
prop="contractAmount"
width="200"
show-overflow-tooltip
- :formatter="formattedNumber"/>
+ :formatter="formattedNumber" />
<el-table-column label="褰曞叆浜�"
prop="recorderName"
width="120"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="褰曞叆鏃ユ湡"
prop="entryDate"
width="100"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="澶囨敞"
prop="remarks"
width="200"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column fixed="right"
label="鎿嶄綔"
width="120"
@@ -189,7 +189,7 @@
layout="total, sizes, prev, pager, next, jumper"
:page="page.current"
:limit="page.size"
- @pagination="paginationChange"/>
+ @pagination="paginationChange" />
</div>
<FormDialog v-model="dialogFormVisible"
:title="operationType === 'add' ? '鏂板閲囪喘鍙拌处椤甸潰' : '缂栬緫閲囪喘鍙拌处椤甸潰'"
@@ -209,7 +209,7 @@
prop="purchaseContractNumber">
<el-input v-model="form.purchaseContractNumber"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -223,7 +223,7 @@
<el-option v-for="item in salesContractList"
:key="item.id"
:label="item.salesContractNo"
- :value="item.id"/>
+ :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -249,7 +249,7 @@
prop="projectName">
<el-input v-model="form.projectName"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
</el-row>
@@ -258,7 +258,7 @@
<el-form-item label="浠樻鏂瑰紡">
<el-input v-model="form.paymentMethod"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -270,7 +270,7 @@
format="YYYY-MM-DD"
type="date"
placeholder="璇烽�夋嫨"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
</el-row>
@@ -278,7 +278,15 @@
<el-col :span="12">
<el-form-item label="褰曞叆浜猴細"
prop="recorderId">
- <el-input v-model="form.recorderName" placeholder="鑷姩濉厖" disabled/>
+ <el-select v-model="form.recorderId"
+ placeholder="璇烽�夋嫨"
+ clearable
+ filterable>
+ <el-option v-for="item in userList"
+ :key="item.userId"
+ :label="item.nickName"
+ :value="item.userId" />
+ </el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -290,7 +298,7 @@
format="YYYY-MM-DD"
type="date"
placeholder="璇烽�夋嫨"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
</el-row>
@@ -327,12 +335,11 @@
:value="item.templateName">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>{{ item.templateName }}</span>
- <el-icon
- v-if="item.id"
- class="delete-icon"
- @click.stop="handleDeleteTemplate(item)"
- style="cursor: pointer; color: #f56c6c; font-size: 14px; margin-left: 8px;">
- <Delete/>
+ <el-icon v-if="item.id"
+ class="delete-icon"
+ @click.stop="handleDeleteTemplate(item)"
+ style="cursor: pointer; color: #f56c6c; font-size: 14px; margin-left: 8px;">
+ <Delete />
</el-icon>
</div>
</el-option>
@@ -353,40 +360,40 @@
:summary-method="summarizeProTable">
<el-table-column align="center"
type="selection"
- width="55"/>
+ width="55" />
<el-table-column align="center"
label="搴忓彿"
type="index"
- width="60"/>
+ width="60" />
<el-table-column label="浜у搧澶х被"
- prop="productCategory"/>
+ prop="productCategory" />
<el-table-column label="瑙勬牸鍨嬪彿"
- prop="specificationModel"/>
+ prop="specificationModel" />
<el-table-column label="鍗曚綅"
prop="unit"
- width="70"/>
+ width="70" />
<el-table-column label="鏁伴噺"
prop="quantity"
- width="70"/>
+ width="70" />
<el-table-column label="搴撳瓨棰勮鏁伴噺"
prop="warnNum"
width="120"
- show-overflow-tooltip/>
+ show-overflow-tooltip />
<el-table-column label="绋庣巼(%)"
prop="taxRate"
- width="80"/>
+ width="80" />
<el-table-column label="鍚◣鍗曚环(鍏�)"
prop="taxInclusiveUnitPrice"
:formatter="formattedNumber"
- width="150"/>
+ width="150" />
<el-table-column label="鍚◣鎬讳环(鍏�)"
prop="taxInclusiveTotalPrice"
:formatter="formattedNumber"
- width="150"/>
+ width="150" />
<el-table-column label="涓嶅惈绋庢�讳环(鍏�)"
prop="taxExclusiveTotalPrice"
:formatter="formattedNumber"
- width="150"/>
+ width="150" />
<el-table-column label="鏄惁璐ㄦ"
prop="isChecked"
width="150">
@@ -416,7 +423,7 @@
placeholder="璇疯緭鍏�"
clearable
type="textarea"
- :rows="2"/>
+ :rows="2" />
</el-form-item>
</el-col>
</el-row>
@@ -424,35 +431,31 @@
<el-col :span="24">
<el-form-item label="闄勪欢鏉愭枡锛�"
prop="purchaseLedgerFiles">
- <FileUpload v-model:file-list="fileList"/>
+ <FileUpload v-model:file-list="fileList" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</FormDialog>
<!-- 瀵煎叆寮圭獥 -->
- <FormDialog
- v-model="importUpload.open"
- :title="importUpload.title"
- :width="'600px'"
- @close="importUpload.open = false"
- @confirm="submitImportFile"
- @cancel="importUpload.open = false"
- >
- <el-upload
- ref="importUploadRef"
- :limit="1"
- accept=".xlsx,.xls"
- :action="importUpload.url"
- :headers="importUpload.headers"
- :before-upload="importUpload.beforeUpload"
- :on-success="importUpload.onSuccess"
- :on-error="importUpload.onError"
- :on-progress="importUpload.onProgress"
- :on-change="importUpload.onChange"
- :auto-upload="false"
- drag
- >
+ <FormDialog v-model="importUpload.open"
+ :title="importUpload.title"
+ :width="'600px'"
+ @close="importUpload.open = false"
+ @confirm="submitImportFile"
+ @cancel="importUpload.open = false">
+ <el-upload ref="importUploadRef"
+ :limit="1"
+ accept=".xlsx,.xls"
+ :action="importUpload.url"
+ :headers="importUpload.headers"
+ :before-upload="importUpload.beforeUpload"
+ :on-success="importUpload.onSuccess"
+ :on-error="importUpload.onError"
+ :on-progress="importUpload.onProgress"
+ :on-change="importUpload.onChange"
+ :auto-upload="false"
+ drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em>
@@ -460,7 +463,9 @@
<template #tip>
<div class="el-upload__tip">
浠呮敮鎸� xls/xlsx锛屽ぇ灏忎笉瓒呰繃 10MB銆�
- <el-button link type="primary" @click="downloadTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
+ <el-button link
+ type="primary"
+ @click="downloadTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
</div>
</template>
</el-upload>
@@ -489,7 +494,7 @@
@change="getModels"
:data="productOptions"
:render-after-expand="false"
- style="width: 100%"/>
+ style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
@@ -505,7 +510,7 @@
<el-option v-for="item in modelOptions"
:key="item.id"
:label="item.model"
- :value="item.id"/>
+ :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -516,7 +521,7 @@
prop="unit">
<el-input v-model="productForm.unit"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -526,12 +531,10 @@
placeholder="璇烽�夋嫨"
clearable
@change="mathNum">
- <el-option
- v-for="dict in tax_rate"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
+ <el-option v-for="dict in tax_rate"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
@@ -546,7 +549,7 @@
:min="0"
clearable
style="width: 100%"
- @change="mathNum"/>
+ @change="mathNum" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -559,7 +562,7 @@
style="width: 100%"
v-model="productForm.quantity"
placeholder="璇疯緭鍏�"
- @change="mathNum"/>
+ @change="mathNum" />
</el-form-item>
</el-col>
</el-row>
@@ -573,7 +576,7 @@
:min="0"
clearable
style="width: 100%"
- @change="reverseMathNum('taxInclusiveTotalPrice')"/>
+ @change="reverseMathNum('taxInclusiveTotalPrice')" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -585,7 +588,7 @@
:min="0"
clearable
style="width: 100%"
- @change="reverseMathNum('taxExclusiveTotalPrice')"/>
+ @change="reverseMathNum('taxExclusiveTotalPrice')" />
</el-form-item>
</el-col>
</el-row>
@@ -597,9 +600,9 @@
placeholder="璇烽�夋嫨"
clearable>
<el-option label="澧炴櫘绁�"
- value="澧炴櫘绁�"/>
+ value="澧炴櫘绁�" />
<el-option label="澧炰笓绁�"
- value="澧炰笓绁�"/>
+ value="澧炰笓绁�" />
</el-select>
</el-form-item>
</el-col>
@@ -611,7 +614,7 @@
:step="0.1"
:min="0"
clearable
- style="width: 100%"/>
+ style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
@@ -621,22 +624,25 @@
prop="isChecked">
<el-radio-group v-model="productForm.isChecked">
<el-radio label="鏄�"
- :value="true"/>
+ :value="true" />
<el-radio label="鍚�"
- :value="false"/>
+ :value="false" />
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
</FormDialog>
- <FileList v-if="fileListDialogVisible" v-model:visible="fileListDialogVisible" record-type="purchase_ledger" :record-id="recordId" />
+ <FileList v-if="fileListDialogVisible"
+ v-model:visible="fileListDialogVisible"
+ record-type="purchase_ledger"
+ :record-id="recordId" />
</div>
</template>
<script setup>
-import FormDialog from '@/components/Dialog/FormDialog.vue';
-import FileListDialog from '@/components/Dialog/FileListDialog.vue';
+ import FormDialog from "@/components/Dialog/FormDialog.vue";
+ import FileListDialog from "@/components/Dialog/FileListDialog.vue";
import { getToken } from "@/utils/auth";
import pagination from "@/components/PIMTable/Pagination.vue";
import {
@@ -649,6 +655,7 @@
} from "vue";
import { Search, Delete } from "@element-plus/icons-vue";
import { ElMessageBox, ElMessage } from "element-plus";
+ import { userListNoPage } from "@/api/system/user.js";
import {
addOrUpdateSalesLedgerProduct,
delProduct,
@@ -670,435 +677,446 @@
delPurchaseTemplate,
} from "@/api/procurementManagement/procurementLedger.js";
import useFormData from "@/hooks/useFormData.js";
- const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
+ const FileList = defineAsyncComponent(() =>
+ import("@/components/Dialog/FileList.vue")
+ );
-const {proxy} = getCurrentInstance();
-const { tax_rate } = proxy.useDict("tax_rate");
-const tableData = ref([]);
-const productData = ref([]);
-const selectedRows = ref([]);
-const productSelectedRows = ref([]);
-const modelOptions = ref([]);
-const productOptions = ref([]);
-const salesContractList = ref([]);
-const supplierList = ref([]);
-const tableLoading = ref(false);
-const fileListDialogVisible = ref(false)
-const page = reactive({
- current: 1,
- size: 100,
-});
-const total = ref(0);
-const fileList = ref([]);
-import useUserStore from "@/store/modules/user";
-import {modelList, productTreeList} from "@/api/basicData/product.js";
-import dayjs from "dayjs";
-import FileUpload from "@/components/AttachmentUpload/file/index.vue";
+ const { proxy } = getCurrentInstance();
+ const { tax_rate } = proxy.useDict("tax_rate");
+ const tableData = ref([]);
+ const productData = ref([]);
+ const selectedRows = ref([]);
+ const productSelectedRows = ref([]);
+ const modelOptions = ref([]);
+ const userList = ref([]);
+ const productOptions = ref([]);
+ const salesContractList = ref([]);
+ const supplierList = ref([]);
+ const tableLoading = ref(false);
+ const fileListDialogVisible = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ });
+ const total = ref(0);
+ const fileList = ref([]);
+ import useUserStore from "@/store/modules/user";
+ import { modelList, productTreeList } from "@/api/basicData/product.js";
+ import dayjs from "dayjs";
+ import FileUpload from "@/components/AttachmentUpload/file/index.vue";
-const userStore = useUserStore();
+ const userStore = useUserStore();
-// 璁㈠崟瀹℃壒鐘舵�佹樉绀烘枃鏈�
-const approvalStatusText = {
- 1: "寰呭鏍�",
- 2: "瀹℃壒涓�",
- 3: "瀹℃壒閫氳繃",
- 4: "瀹℃壒澶辫触",
-};
-
-// 鑾峰彇瀹℃壒鐘舵�佹爣绛剧被鍨�
-const getApprovalStatusType = (status) => {
- const typeMap = {
- 1: "info", // 寰呭鏍� - 鐏拌壊
- 2: "warning", // 瀹℃壒涓� - 姗欒壊
- 3: "success", // 瀹℃壒閫氳繃 - 缁胯壊
- 4: "danger", // 瀹℃壒澶辫触 - 绾㈣壊
+ // 璁㈠崟瀹℃壒鐘舵�佹樉绀烘枃鏈�
+ const approvalStatusText = {
+ 1: "寰呭鏍�",
+ 2: "瀹℃壒涓�",
+ 3: "瀹℃壒閫氳繃",
+ 4: "瀹℃壒澶辫触",
};
- return typeMap[status] || "";
-};
-const templateName = ref("");
-const filterInputValue = ref("");
-const templateList = ref([]);
-const isTemplateNameDuplicate = ref(false); // 鏍囪妯℃澘鍚嶇О鏄惁閲嶅
-// 褰撳墠閫変腑鐨勬ā鏉縄D锛堢敤浜庡尯鍒嗘柊澧炴ā鏉胯繕鏄洿鏂版ā鏉匡級
-const currentTemplateId = ref(null);
-
-// 妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶�
-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) {
- // 璁板綍褰撳墠閫変腑鐨勬ā鏉縄D锛屽悗缁繚瀛樻椂杩涜鏇存柊鎿嶄綔
- currentTemplateId.value = matchedTemplate.id;
- // 閫変腑宸叉湁妯℃澘鏃讹紝涓嶅簲瑙嗕负鈥滄ā鏉垮悕绉伴噸澶嶅鑷翠笉鍙繚瀛樷��
- isTemplateNameDuplicate.value = false;
- // 濡傛灉鎵惧埌妯℃澘锛屽彧璧嬪�间緵搴斿晢銆侀」鐩悕绉般�佷粯娆炬柟寮忓拰浜у搧淇℃伅
- if (matchedTemplate.supplierId) {
- form.value.supplierId = matchedTemplate.supplierId;
- }
- if (matchedTemplate.supplierName) {
- form.value.supplierName = matchedTemplate.supplierName;
- }
- if (matchedTemplate.projectName) {
- form.value.projectName = matchedTemplate.projectName;
- }
- if (matchedTemplate.paymentMethod) {
- form.value.paymentMethod = matchedTemplate.paymentMethod;
- }
- // 妯℃澘鏁版嵁涓殑浜у搧瀛楁鏄� productList锛岄渶瑕佽浆鎹负 productData
- productData.value = matchedTemplate.productList || matchedTemplate.productData || [];
- } else {
- // 鏈尮閰嶅埌宸叉湁妯℃澘锛岃涓烘柊妯℃澘
- currentTemplateId.value = null;
- // 濡傛灉娌℃湁鎵惧埌妯℃澘锛岄噸缃〃鍗曪紙淇濇寔褰撳墠琛ㄥ崟鐘舵�侊級
- 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,
+ // 鑾峰彇瀹℃壒鐘舵�佹爣绛剧被鍨�
+ const getApprovalStatusType = status => {
+ const typeMap = {
+ 1: "info", // 寰呭鏍� - 鐏拌壊
+ 2: "warning", // 瀹℃壒涓� - 姗欒壊
+ 3: "success", // 瀹℃壒閫氳繃 - 缁胯壊
+ 4: "danger", // 瀹℃壒澶辫触 - 绾㈣壊
};
- productData.value = currentProductData;
- }
-};
+ return typeMap[status] || "";
+ };
-// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
-const operationType = ref("");
-const dialogFormVisible = ref(false);
-const data = reactive({
- searchForm: {
- supplierName: "", // 渚涘簲鍟嗗悕绉�
- purchaseContractNumber: "", // 閲囪喘鍚堝悓缂栧彿
- salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
- projectName: "", // 椤圭洰鍚嶇О
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
- form: {
- purchaseContractNumber: "",
- salesLedgerId: "",
- projectName: "",
- recorderId: "",
- recorderName: "",
- entryDate: "",
- productData: [],
- supplierName: "",
- supplierId: "",
- paymentMethod: "",
- executionDate: "",
- isChecked: false,
- },
- rules: {
- purchaseContractNumber: [
- {required: true, message: "璇疯緭鍏�", trigger: "blur"},
- ],
- 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,
- // 璁剧疆褰曞叆鏃ユ湡鑼冨洿涓哄綋澶�
- 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 templateName = ref("");
+ const filterInputValue = ref("");
+ const templateList = ref([]);
+ const isTemplateNameDuplicate = ref(false); // 鏍囪妯℃澘鍚嶇О鏄惁閲嶅
+ // 褰撳墠閫変腑鐨勬ā鏉縄D锛堢敤浜庡尯鍒嗘柊澧炴ā鏉胯繕鏄洿鏂版ā鏉匡級
+ const currentTemplateId = ref(null);
-// 浜у搧琛ㄥ崟寮规鏁版嵁
-const productFormVisible = ref(false);
-const productOperationType = ref("");
-const productOperationIndex = ref("");
-const currentId = ref("");
-const productFormData = reactive({
- productForm: {
- productId: "",
- productCategory: "",
- productModelId: "",
- specificationModel: "",
- unit: "",
- quantity: "",
- taxInclusiveUnitPrice: "",
- taxRate: "",
- taxInclusiveTotalPrice: "",
- taxExclusiveTotalPrice: "",
- invoiceType: "",
- warnNum: "",
- isChecked: false,
- },
- productRules: {
- productId: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- productModelId: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- unit: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
- quantity: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
- taxInclusiveUnitPrice: [
- {required: true, message: "璇疯緭鍏�", trigger: "blur"},
- ],
- taxRate: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- warnNum: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- taxInclusiveTotalPrice: [
- {required: true, message: "璇疯緭鍏�", trigger: "blur"},
- ],
- taxExclusiveTotalPrice: [
- {required: true, message: "璇疯緭鍏�", trigger: "blur"},
- ],
- invoiceType: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- isChecked: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- },
-});
-const {productForm, productRules} = toRefs(productFormData);
-const upload = reactive({
- // 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
- // 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: {Authorization: "Bearer " + getToken()},
-});
-
-// 瀵煎叆鐩稿叧
-const importUploadRef = ref(null);
-const importUpload = reactive({
- title: "瀵煎叆閲囪喘鍙拌处",
- open: false,
- url: import.meta.env.VITE_APP_BASE_API + "/purchase/ledger/import",
- headers: {Authorization: "Bearer " + getToken()},
- isUploading: false,
- beforeUpload: (file) => {
- const isExcel = file.name.endsWith(".xlsx") || file.name.endsWith(".xls");
- const isLt10M = file.size / 1024 / 1024 < 10;
- if (!isExcel) {
- proxy.$modal.msgError("涓婁紶鏂囦欢鍙兘鏄� xlsx/xls 鏍煎紡!");
+ // 妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶�
+ const checkTemplateNameDuplicate = name => {
+ if (!name || name.trim() === "") {
+ isTemplateNameDuplicate.value = false;
return false;
}
- if (!isLt10M) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 10MB!");
- 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);
}
- return true;
- },
- onChange: (file, fileList) => {
- // noop
- },
- onProgress: (event, file, fileList) => {
- // noop
- },
- onSuccess: (response, file, fileList) => {
- importUpload.isUploading = false;
- if (response?.code === 200) {
- proxy.$modal.msgSuccess("瀵煎叆鎴愬姛");
- importUpload.open = false;
- if (importUploadRef.value) {
- importUploadRef.value.clearFiles?.();
- }
- getList();
+ // 瀹炴椂妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶嶏紙闃叉姈澶勭悊锛岄伩鍏嶉绻佹彁绀猴級
+ if (val && val.trim()) {
+ duplicateCheckTimer = setTimeout(() => {
+ const isDuplicate = checkTemplateNameDuplicate(val);
+ if (isDuplicate) {
+ ElMessage({
+ message: "妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�",
+ type: "warning",
+ duration: 2000,
+ });
+ }
+ }, 300); // 300ms 闃叉姈
} else {
- proxy.$modal.msgError(response?.msg || "瀵煎叆澶辫触");
+ isTemplateNameDuplicate.value = false;
}
- },
- onError: () => {
+ };
+
+ // 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) {
+ // 璁板綍褰撳墠閫変腑鐨勬ā鏉縄D锛屽悗缁繚瀛樻椂杩涜鏇存柊鎿嶄綔
+ currentTemplateId.value = matchedTemplate.id;
+ // 閫変腑宸叉湁妯℃澘鏃讹紝涓嶅簲瑙嗕负鈥滄ā鏉垮悕绉伴噸澶嶅鑷翠笉鍙繚瀛樷��
+ isTemplateNameDuplicate.value = false;
+ // 濡傛灉鎵惧埌妯℃澘锛屽彧璧嬪�间緵搴斿晢銆侀」鐩悕绉般�佷粯娆炬柟寮忓拰浜у搧淇℃伅
+ if (matchedTemplate.supplierId) {
+ form.value.supplierId = matchedTemplate.supplierId;
+ }
+ if (matchedTemplate.supplierName) {
+ form.value.supplierName = matchedTemplate.supplierName;
+ }
+ if (matchedTemplate.projectName) {
+ form.value.projectName = matchedTemplate.projectName;
+ }
+ if (matchedTemplate.paymentMethod) {
+ form.value.paymentMethod = matchedTemplate.paymentMethod;
+ }
+ // 妯℃澘鏁版嵁涓殑浜у搧瀛楁鏄� productList锛岄渶瑕佽浆鎹负 productData
+ productData.value =
+ matchedTemplate.productList || matchedTemplate.productData || [];
+ } else {
+ // 鏈尮閰嶅埌宸叉湁妯℃澘锛岃涓烘柊妯℃澘
+ currentTemplateId.value = null;
+ // 濡傛灉娌℃湁鎵惧埌妯℃澘锛岄噸缃〃鍗曪紙淇濇寔褰撳墠琛ㄥ崟鐘舵�侊級
+ 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("");
+ const dialogFormVisible = ref(false);
+ const data = reactive({
+ searchForm: {
+ supplierName: "", // 渚涘簲鍟嗗悕绉�
+ purchaseContractNumber: "", // 閲囪喘鍚堝悓缂栧彿
+ salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
+ projectName: "", // 椤圭洰鍚嶇О
+ entryDate: null, // 褰曞叆鏃ユ湡
+ entryDateStart: undefined,
+ entryDateEnd: undefined,
+ },
+ form: {
+ purchaseContractNumber: "",
+ salesLedgerId: "",
+ projectName: "",
+ recorderId: "",
+ entryDate: "",
+ productData: [],
+ supplierName: "",
+ supplierId: "",
+ paymentMethod: "",
+ executionDate: "",
+ isChecked: false,
+ },
+ rules: {
+ purchaseContractNumber: [
+ { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ ],
+ 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,
+ // 璁剧疆褰曞叆鏃ユ湡鑼冨洿涓哄綋澶�
+ 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);
+ const productOperationType = ref("");
+ const productOperationIndex = ref("");
+ const currentId = ref("");
+ const productFormData = reactive({
+ productForm: {
+ productId: "",
+ productCategory: "",
+ productModelId: "",
+ specificationModel: "",
+ unit: "",
+ quantity: "",
+ taxInclusiveUnitPrice: "",
+ taxRate: "",
+ taxInclusiveTotalPrice: "",
+ taxExclusiveTotalPrice: "",
+ invoiceType: "",
+ warnNum: "",
+ isChecked: false,
+ },
+ productRules: {
+ productId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ productModelId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ taxInclusiveUnitPrice: [
+ { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ ],
+ taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ warnNum: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ taxInclusiveTotalPrice: [
+ { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ ],
+ taxExclusiveTotalPrice: [
+ { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ ],
+ invoiceType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ isChecked: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ },
+ });
+ const { productForm, productRules } = toRefs(productFormData);
+ const upload = reactive({
+ // 涓婁紶鐨勫湴鍧�
+ url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
+ // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+ headers: { Authorization: "Bearer " + getToken() },
+ });
+
+ // 瀵煎叆鐩稿叧
+ const importUploadRef = ref(null);
+ const importUpload = reactive({
+ title: "瀵煎叆閲囪喘鍙拌处",
+ open: false,
+ url: import.meta.env.VITE_APP_BASE_API + "/purchase/ledger/import",
+ headers: { Authorization: "Bearer " + getToken() },
+ isUploading: false,
+ beforeUpload: file => {
+ const isExcel = file.name.endsWith(".xlsx") || file.name.endsWith(".xls");
+ const isLt10M = file.size / 1024 / 1024 < 10;
+ if (!isExcel) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢鍙兘鏄� xlsx/xls 鏍煎紡!");
+ return false;
+ }
+ if (!isLt10M) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 10MB!");
+ return false;
+ }
+ return true;
+ },
+ onChange: (file, fileList) => {
+ // noop
+ },
+ onProgress: (event, file, fileList) => {
+ // noop
+ },
+ onSuccess: (response, file, fileList) => {
+ importUpload.isUploading = false;
+ if (response?.code === 200) {
+ proxy.$modal.msgSuccess("瀵煎叆鎴愬姛");
+ importUpload.open = false;
+ if (importUploadRef.value) {
+ importUploadRef.value.clearFiles?.();
+ }
+ getList();
+ } else {
+ proxy.$modal.msgError(response?.msg || "瀵煎叆澶辫触");
+ }
+ },
+ onError: () => {
+ importUpload.isUploading = false;
+ proxy.$modal.msgError("瀵煎叆澶辫触锛岃閲嶈瘯");
+ },
+ });
+
+ const handleImport = () => {
+ importUpload.title = "瀵煎叆閲囪喘鍙拌处";
+ importUpload.open = true;
importUpload.isUploading = false;
- proxy.$modal.msgError("瀵煎叆澶辫触锛岃閲嶈瘯");
- },
-});
+ if (importUploadRef.value) {
+ importUploadRef.value.clearFiles?.();
+ }
+ };
-const handleImport = () => {
- importUpload.title = "瀵煎叆閲囪喘鍙拌处";
- importUpload.open = true;
- importUpload.isUploading = false;
- if (importUploadRef.value) {
- importUploadRef.value.clearFiles?.();
- }
-};
+ // 涓嬭浇瀵煎叆妯℃澘锛堝鍚庣璺緞涓嶅悓锛屽彲鍦ㄦ澶勮皟鏁达級
+ const downloadTemplate = () => {
+ proxy.download(
+ "/purchase/ledger/exportTemplate",
+ {},
+ "閲囪喘鍙拌处瀵煎叆妯℃澘.xlsx"
+ );
+ };
-// 涓嬭浇瀵煎叆妯℃澘锛堝鍚庣璺緞涓嶅悓锛屽彲鍦ㄦ澶勮皟鏁达級
-const downloadTemplate = () => {
- proxy.download("/purchase/ledger/exportTemplate", {}, "閲囪喘鍙拌处瀵煎叆妯℃澘.xlsx");
-};
+ const submitImportFile = () => {
+ importUpload.isUploading = true;
+ proxy.$refs["importUploadRef"]?.submit?.();
+ };
-const submitImportFile = () => {
- importUpload.isUploading = true;
- proxy.$refs["importUploadRef"]?.submit?.();
-};
+ const changeDaterange = value => {
+ if (value) {
+ searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+ } else {
+ searchForm.entryDateStart = undefined;
+ searchForm.entryDateEnd = undefined;
+ }
+ handleQuery();
+ };
-const changeDaterange = value => {
- if (value) {
- searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
- searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
- } else {
- searchForm.entryDateStart = undefined;
- searchForm.entryDateEnd = undefined;
- }
- handleQuery();
-};
+ const formattedNumber = (row, column, cellValue) => {
+ return parseFloat(cellValue).toFixed(2);
+ };
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
-const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
-};
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-
-// 淇濆瓨妯℃澘
-const handleButtonClick = async () => {
- // 妫�鏌ユā鏉垮悕绉版槸鍚︿负绌�
- if (!templateName.value || templateName.value.trim() === "") {
- ElMessage({
- message: "璇疯緭鍏ユā鏉垮悕绉�",
- type: "warning",
- });
- return;
- }
-
- // 濡傛灉鏄�滄柊澧炴ā鏉库�濓紙娌℃湁閫変腑宸叉湁妯℃澘锛夛紝鎵嶉渶瑕佸仛閲嶅悕鏍¢獙锛�
- // 鑻ユ槸閫変腑宸叉湁妯℃澘鍚庝慨鏀癸紝鍒欏厑璁镐娇鐢ㄥ師鍚嶇О锛堣涓烘洿鏂帮級
- if (!currentTemplateId.value) {
- const isDuplicate = checkTemplateNameDuplicate(templateName.value);
- if (isDuplicate) {
+ // 淇濆瓨妯℃澘
+ const handleButtonClick = async () => {
+ // 妫�鏌ユā鏉垮悕绉版槸鍚︿负绌�
+ if (!templateName.value || templateName.value.trim() === "") {
ElMessage({
- message: "妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�",
+ 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,
- recorderName: form.value.recorderName,
- projectName: form.value.projectName,
- templateName: templateName.value.trim(),
- };
- console.log("template params ===>", params, "currentTemplateId:", currentTemplateId.value);
-
- // 濡傛灉 currentTemplateId 鏈夊�硷紝璇存槑褰撳墠鏄�滅紪杈戝凡鏈夋ā鏉库�� 鈫� 璋冪敤鏇存柊鎺ュ彛
- // 鍚﹀垯涓衡�滄柊寤烘ā鏉库�� 鈫� 璋冪敤鏂板鎺ュ彛
- let res;
- if (currentTemplateId.value) {
- res = await updatePurchaseTemplate({
- id: currentTemplateId.value,
- ...params,
- });
- } else {
- res = await addPurchaseTemplate(params);
+ // 濡傛灉鏄�滄柊澧炴ā鏉库�濓紙娌℃湁閫変腑宸叉湁妯℃澘锛夛紝鎵嶉渶瑕佸仛閲嶅悕鏍¢獙锛�
+ // 鑻ユ槸閫変腑宸叉湁妯℃澘鍚庝慨鏀癸紝鍒欏厑璁镐娇鐢ㄥ師鍚嶇О锛堣涓烘洿鏂帮級
+ if (!currentTemplateId.value) {
+ const isDuplicate = checkTemplateNameDuplicate(templateName.value);
+ if (isDuplicate) {
+ ElMessage({
+ message: "妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�",
+ type: "warning",
+ });
+ return;
+ }
}
- if (res && res.code === 200) {
+ // 妫�鏌ヤ緵搴斿晢鏄惁閫夋嫨
+ if (!form.value.supplierId) {
ElMessage({
- message: currentTemplateId.value ? "妯℃澘鏇存柊鎴愬姛" : "妯℃澘淇濆瓨鎴愬姛",
- type: "success",
+ message: "璇峰厛閫夋嫨渚涘簲鍟�",
+ type: "warning",
});
- // 淇濆瓨鎴愬姛鍚庨噸鏂拌幏鍙栨ā鏉垮垪琛�
- await getTemplateList();
- // 娓呯┖妯℃澘鍚嶇О杈撳叆
- templateName.value = "";
- filterInputValue.value = "";
- isTemplateNameDuplicate.value = false;
- // 淇濆瓨/鏇存柊瀹屾垚鍚庯紝閲嶇疆褰撳墠妯℃澘ID
- currentTemplateId.value = null;
- } else {
+ return;
+ }
+
+ // 妫�鏌ユ槸鍚︽湁浜у搧鏁版嵁
+ if (!productData.value || productData.value.length === 0) {
ElMessage({
- message: res?.msg || "妯℃澘淇濆瓨澶辫触",
+ message: "璇峰厛娣诲姞浜у搧淇℃伅",
+ type: "warning",
+ });
+ return;
+ }
+
+ try {
+ let params = {
+ productData: proxy.HaveJson(productData.value),
+ supplierId: form.value.supplierId,
+ paymentMethod: form.value.paymentMethod,
+ recorderId: form.value.recorderId,
+ projectName: form.value.projectName,
+ templateName: templateName.value.trim(),
+ };
+ console.log(
+ "template params ===>",
+ params,
+ "currentTemplateId:",
+ currentTemplateId.value
+ );
+
+ // 濡傛灉 currentTemplateId 鏈夊�硷紝璇存槑褰撳墠鏄�滅紪杈戝凡鏈夋ā鏉库�� 鈫� 璋冪敤鏇存柊鎺ュ彛
+ // 鍚﹀垯涓衡�滄柊寤烘ā鏉库�� 鈫� 璋冪敤鏂板鎺ュ彛
+ let res;
+ if (currentTemplateId.value) {
+ res = await updatePurchaseTemplate({
+ id: currentTemplateId.value,
+ ...params,
+ });
+ } else {
+ res = await addPurchaseTemplate(params);
+ }
+
+ if (res && res.code === 200) {
+ ElMessage({
+ message: currentTemplateId.value ? "妯℃澘鏇存柊鎴愬姛" : "妯℃澘淇濆瓨鎴愬姛",
+ type: "success",
+ });
+ // 淇濆瓨鎴愬姛鍚庨噸鏂拌幏鍙栨ā鏉垮垪琛�
+ await getTemplateList();
+ // 娓呯┖妯℃澘鍚嶇О杈撳叆
+ templateName.value = "";
+ filterInputValue.value = "";
+ isTemplateNameDuplicate.value = false;
+ // 淇濆瓨/鏇存柊瀹屾垚鍚庯紝閲嶇疆褰撳墠妯℃澘ID
+ currentTemplateId.value = null;
+ } else {
+ ElMessage({
+ message: res?.msg || "妯℃澘淇濆瓨澶辫触",
+ type: "error",
+ });
+ }
+ } catch (error) {
+ console.error("淇濆瓨妯℃澘澶辫触:", error);
+ ElMessage({
+ message: "妯℃澘淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯",
type: "error",
});
}
- } catch (error) {
- console.error("淇濆瓨妯℃澘澶辫触:", error);
- ElMessage({
- message: "妯℃澘淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯",
- type: "error",
- });
- }
-};
-// 瀛愯〃鍚堣鏂规硶
-const summarizeChildrenTable = param => {
- return proxy.summarizeTable(
+ };
+ // 瀛愯〃鍚堣鏂规硶
+ const summarizeChildrenTable = param => {
+ return proxy.summarizeTable(
param,
[
"taxInclusiveUnitPrice",
@@ -1110,20 +1128,20 @@
"futureTicketsAmount",
],
{
- ticketsNum: {noDecimal: true}, // 涓嶄繚鐣欏皬鏁�
- futureTickets: {noDecimal: true}, // 涓嶄繚鐣欏皬鏁�
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
}
- );
-};
-const paginationChange = obj => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- const {entryDate, ...rest} = searchForm;
- purchaseListPage({...rest, ...page})
+ );
+ };
+ const paginationChange = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ const { entryDate, ...rest } = searchForm;
+ purchaseListPage({ ...rest, ...page })
.then(res => {
tableLoading.value = false;
// tableData.value = res.data.records;
@@ -1140,461 +1158,471 @@
.catch(() => {
tableLoading.value = false;
});
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = selection => {
- selectedRows.value = selection;
-};
-const productSelected = selectedRows => {
- productSelectedRows.value = selectedRows;
-};
-const expandedRowKeys = ref([]);
-// 灞曞紑琛�
-const expandChange = async (row, expandedRows) => {
- if (expandedRows.length > 0) {
- expandedRowKeys.value = [];
- try {
- 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);
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+ const productSelected = selectedRows => {
+ productSelectedRows.value = selectedRows;
+ };
+ const expandedRowKeys = ref([]);
+ // 灞曞紑琛�
+ const expandChange = async (row, expandedRows) => {
+ if (expandedRows.length > 0) {
+ expandedRowKeys.value = [];
+ try {
+ 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.error("鍔犺浇浜у搧鍒楄〃澶辫触:", error);
+ proxy.$modal.msgError("鍔犺浇浜у搧鍒楄〃澶辫触");
+ // 灞曞紑澶辫触鏃讹紝绉婚櫎灞曞紑鐘舵��
+ const index = expandedRows.findIndex(item => item.id === row.id);
+ if (index > -1) {
+ expandedRows.splice(index, 1);
+ }
}
- } catch (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 = [];
+ }
+ };
+ // 涓昏〃鍚堣鏂规硶
+ const summarizeMainTable = param => {
+ return proxy.summarizeTable(param, ["contractAmount"]);
+ };
+ // 瀛愯〃鍚堣鏂规硶
+ const summarizeProTable = param => {
+ return proxy.summarizeTable(param, [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ ]);
+ };
+ // 鎵撳紑寮规
+ const openForm = async (type, row) => {
+ // 缂栬緫鏃舵鏌ュ鏍哥姸鎬侊紝鍙湁寰呭鏍�(1)鍜屽鎵瑰け璐�(4)鎵嶈兘缂栬緫
+ if (type === "edit" && row) {
+ if (row.approvalStatus !== 1 && row.approvalStatus !== 4) {
+ proxy.$modal.msgWarning("鍙湁寰呭鏍稿拰瀹℃壒澶辫触鐘舵�佺殑璁板綍鎵嶈兘缂栬緫");
+ return;
}
}
- } else {
- expandedRowKeys.value = [];
+
+ await getTemplateList();
+ await userListNoPage().then(res => {
+ userList.value = res.data;
+ });
+ operationType.value = type;
+ form.value = {};
+ productData.value = [];
+ fileList.value = [];
+ templateName.value = "";
+ filterInputValue.value = "";
+ isTemplateNameDuplicate.value = false;
+ try {
+ // 骞惰鍔犺浇鍩虹鏁版嵁
+ const [salesRes, supplierRes] = await Promise.all([
+ getSalesNo(),
+ getOptions(),
+ ]);
+
+ salesContractList.value = salesRes || [];
+ // 渚涘簲鍟嗚繃婊ゅ嚭isWhite=0 鐨勬暟鎹�
+ supplierList.value = (supplierRes.data || []).filter(
+ item => item.isWhite === 0
+ );
+
+ 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.storageBlobVOS || [];
+ } catch (error) {
+ console.error("鍔犺浇閲囪喘鍙拌处鏁版嵁澶辫触:", error);
+ proxy.$modal.msgError("鍔犺浇鏁版嵁澶辫触");
+ return;
+ }
+ }
+
+ if (form.value.salesLedgerId == -1) {
+ form.value.salesLedgerId = null;
+ }
+ console.log(form.value, "form.value===========");
+ dialogFormVisible.value = true;
+ } catch (error) {
+ console.error("鎵撳紑琛ㄥ崟澶辫触:", error);
+ proxy.$modal.msgError("鍔犺浇鍩虹鏁版嵁澶辫触");
+ }
+ };
+
+ // 涓婁紶鍓嶆牎妫�
+ function handleBeforeUpload(file) {
+ // 鏍℃鏂囦欢澶у皬
+ if (file.size > 1024 * 1024 * 10) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
+ return false;
+ }
+ proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
+ return true;
}
-};
-// 涓昏〃鍚堣鏂规硶
-const summarizeMainTable = param => {
- return proxy.summarizeTable(param, ["contractAmount"]);
-};
-// 瀛愯〃鍚堣鏂规硶
-const summarizeProTable = param => {
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- ]);
-};
-// 鎵撳紑寮规
-const openForm = async (type, row) => {
- // 缂栬緫鏃舵鏌ュ鏍哥姸鎬侊紝鍙湁寰呭鏍�(1)鍜屽鎵瑰け璐�(4)鎵嶈兘缂栬緫
- if (type === "edit" && row) {
- if (row.approvalStatus !== 1 && row.approvalStatus !== 4) {
- proxy.$modal.msgWarning("鍙湁寰呭鏍稿拰瀹℃壒澶辫触鐘舵�佺殑璁板綍鎵嶈兘缂栬緫");
+
+ // 涓婁紶澶辫触
+ function handleUploadError(err) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
+ proxy.$modal.closeLoading();
+ }
+
+ // 涓婁紶鎴愬姛鍥炶皟
+ function handleUploadSuccess(res, file, uploadFiles) {
+ proxy.$modal.closeLoading();
+ if (res.code === 200) {
+ file.tempId = res.data.tempId;
+ proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
+ } else {
+ proxy.$modal.msgError(res.msg);
+ proxy.$refs.fileUpload.handleRemove(file);
+ }
+ }
+
+ // 绉婚櫎鏂囦欢
+ async function handleRemove(file) {
+ if (!file?.id) {
return;
}
+ console.log("handleRemove", file.id);
+ if (file.size > 1024 * 1024 * 10) {
+ // 浠呭墠绔竻鐞嗭紝涓嶈皟鐢ㄥ垹闄ゆ帴鍙e拰鎻愮ず
+ return;
+ }
+
+ if (operationType.value === "edit" && file.id) {
+ try {
+ await delLedgerFile([file.id]);
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ } catch (error) {
+ console.error("鍒犻櫎鏂囦欢澶辫触:", error);
+ proxy.$modal.msgError("鍒犻櫎鏂囦欢澶辫触");
+ }
+ }
}
- await getTemplateList();
- operationType.value = type;
- form.value = {};
- productData.value = [];
- fileList.value = [];
- templateName.value = "";
- filterInputValue.value = "";
- isTemplateNameDuplicate.value = false;
- try {
- // 骞惰鍔犺浇鍩虹鏁版嵁
- const [salesRes, supplierRes] = await Promise.all([
- getSalesNo(),
- getOptions(),
- ]);
+ // 鎻愪氦琛ㄥ崟
+ const submitForm = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ if (productData.value.length > 0) {
+ // 鏂板鏃讹紝闇�瑕佷粠姣忎釜浜у搧瀵硅薄涓垹闄� id 瀛楁
+ let processedProductData = productData.value;
+ if (operationType.value === "add") {
+ processedProductData = productData.value.map(product => {
+ const { id, ...rest } = product;
+ return rest;
+ });
+ }
+ form.value.productData = proxy.HaveJson(processedProductData);
+ } else {
+ proxy.$modal.msgWarning("璇锋坊鍔犱骇鍝佷俊鎭�");
+ return;
+ }
+ form.value.storageBlobDTOS = fileList.value;
+ form.value.type = 2;
- salesContractList.value = salesRes || [];
- // 渚涘簲鍟嗚繃婊ゅ嚭isWhite=0 鐨勬暟鎹�
- supplierList.value = (supplierRes.data || []).filter(
- item => item.isWhite === 0
- );
+ // 濡傛灉salesLedgerId涓虹┖锛屽垯涓嶄紶閫抯alesContractNo
+ if (!form.value.salesLedgerId) {
+ form.value.salesContractNo = "";
+ }
- // 璁剧疆榛樿鍊�
- form.value.recorderName = userStore.nickName;
- form.value.entryDate = getCurrentDate();
+ // 鏂板鏃朵笉浼犻�抜d
+ const submitData = { ...form.value };
+ if (operationType.value === "add") {
+ delete submitData.id;
+ }
+
+ addOrEditPurchase(submitData).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
+ }
+ });
+ };
+ // 鍏抽棴寮规
+ const closeDia = () => {
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
+ };
+ // 鎵撳紑浜у搧寮规
+ const openProductForm = async (type, row, index) => {
+ productOperationType.value = type;
+ productOperationIndex.value = index;
+ productForm.value = {};
+ proxy.resetForm("productFormRef");
+ productFormVisible.value = true;
+
+ // 鍏堣幏鍙栦骇鍝侀�夐」锛岀‘淇濇暟鎹姞杞藉畬鎴�
+ await getProductOptions();
+
+ // 绛夊緟 DOM 鏇存柊
+ await nextTick();
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.storageBlobVOS || [];
- } catch (error) {
- console.error("鍔犺浇閲囪喘鍙拌处鏁版嵁澶辫触:", error);
- proxy.$modal.msgError("鍔犺浇鏁版嵁澶辫触");
- return;
- }
+ productForm.value.isChecked = false;
}
- if (form.value.salesLedgerId == -1) {
- form.value.salesLedgerId = null;
- }
- console.log(form.value, "form.value===========");
- dialogFormVisible.value = true;
- } catch (error) {
- console.error("鎵撳紑琛ㄥ崟澶辫触:", error);
- proxy.$modal.msgError("鍔犺浇鍩虹鏁版嵁澶辫触");
- }
-};
+ if (type === "edit") {
+ // 澶嶅埗琛屾暟鎹�
+ productForm.value = { ...row };
-// 涓婁紶鍓嶆牎妫�
-function handleBeforeUpload(file) {
- // 鏍℃鏂囦欢澶у皬
- if (file.size > 1024 * 1024 * 10) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
- return false;
- }
- proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
- return true;
-}
-
-// 涓婁紶澶辫触
-function handleUploadError(err) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
- proxy.$modal.closeLoading();
-}
-
-// 涓婁紶鎴愬姛鍥炶皟
-function handleUploadSuccess(res, file, uploadFiles) {
- proxy.$modal.closeLoading();
- if (res.code === 200) {
- file.tempId = res.data.tempId;
- proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
- } else {
- proxy.$modal.msgError(res.msg);
- proxy.$refs.fileUpload.handleRemove(file);
- }
-}
-
-// 绉婚櫎鏂囦欢
-async function handleRemove(file) {
- if (!file?.id) {
- return;
- }
- console.log("handleRemove", file.id);
- if (file.size > 1024 * 1024 * 10) {
- // 浠呭墠绔竻鐞嗭紝涓嶈皟鐢ㄥ垹闄ゆ帴鍙e拰鎻愮ず
- return;
- }
-
- if (operationType.value === "edit" && file.id) {
- try {
- await delLedgerFile([file.id]);
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- } catch (error) {
- console.error("鍒犻櫎鏂囦欢澶辫触:", error);
- proxy.$modal.msgError("鍒犻櫎鏂囦欢澶辫触");
- }
- }
-}
-
-// 鎻愪氦琛ㄥ崟
-const submitForm = () => {
- proxy.$refs["formRef"].validate(valid => {
- if (valid) {
- if (productData.value.length > 0) {
- // 鏂板鏃讹紝闇�瑕佷粠姣忎釜浜у搧瀵硅薄涓垹闄� id 瀛楁
- let processedProductData = productData.value;
- if (operationType.value === "add") {
- processedProductData = productData.value.map(product => {
- const {id, ...rest} = product;
- return rest;
- });
- }
- form.value.productData = proxy.HaveJson(processedProductData);
- } else {
- proxy.$modal.msgWarning("璇锋坊鍔犱骇鍝佷俊鎭�");
- return;
- }
- form.value.storageBlobDTOS = fileList.value;
- form.value.type = 2;
-
- // 濡傛灉salesLedgerId涓虹┖锛屽垯涓嶄紶閫抯alesContractNo
- if (!form.value.salesLedgerId) {
- form.value.salesContractNo = "";
- }
-
- // 鏂板鏃朵笉浼犻�抜d
- const submitData = {...form.value};
- if (operationType.value === "add") {
- delete submitData.id;
- }
-
- addOrEditPurchase(submitData).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- });
- }
- });
-};
-// 鍏抽棴寮规
-const closeDia = () => {
- proxy.resetForm("formRef");
- dialogFormVisible.value = false;
-};
-// 鎵撳紑浜у搧寮规
-const openProductForm = async (type, row, index) => {
- productOperationType.value = type;
- productOperationIndex.value = index;
- productForm.value = {};
- proxy.resetForm("productFormRef");
- productFormVisible.value = true;
-
- // 鍏堣幏鍙栦骇鍝侀�夐」锛岀‘淇濇暟鎹姞杞藉畬鎴�
- await getProductOptions();
-
- // 绛夊緟 DOM 鏇存柊
- await nextTick();
-
- if (type === "add") {
- productForm.value.isChecked = false;
- }
-
- if (type === "edit") {
- // 澶嶅埗琛屾暟鎹�
- productForm.value = {...row};
-
- // 濡傛灉鏄粠妯℃澘鍔犺浇鐨勬暟鎹紝鍙兘娌℃湁 productId 鍜� productModelId
- // 闇�瑕佹牴鎹� productCategory 鍜� specificationModel 鏉ユ煡鎵惧搴旂殑 ID
- if (!productForm.value.productId && productForm.value.productCategory) {
- // 鏍规嵁 productCategory 鏌ユ壘 productId
- const findProductIdByCategory = (nodes, categoryName) => {
- for (let i = 0; i < nodes.length; i++) {
- if (nodes[i].label === categoryName) {
- return nodes[i].value;
+ // 濡傛灉鏄粠妯℃澘鍔犺浇鐨勬暟鎹紝鍙兘娌℃湁 productId 鍜� productModelId
+ // 闇�瑕佹牴鎹� productCategory 鍜� specificationModel 鏉ユ煡鎵惧搴旂殑 ID
+ if (!productForm.value.productId && productForm.value.productCategory) {
+ // 鏍规嵁 productCategory 鏌ユ壘 productId
+ const findProductIdByCategory = (nodes, categoryName) => {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].label === categoryName) {
+ return nodes[i].value;
+ }
+ if (nodes[i].children && nodes[i].children.length > 0) {
+ const found = findProductIdByCategory(
+ nodes[i].children,
+ categoryName
+ );
+ if (found) return found;
+ }
}
- if (nodes[i].children && nodes[i].children.length > 0) {
- const found = findProductIdByCategory(nodes[i].children, categoryName);
- if (found) return found;
+ return null;
+ };
+
+ const productId = findProductIdByCategory(
+ productOptions.value,
+ productForm.value.productCategory
+ );
+ if (productId) {
+ productForm.value.productId = productId;
+ // 鑾峰彇鍨嬪彿鍒楄〃骞剁瓑寰呭畬鎴�
+ const modelRes = await modelList({ id: productId });
+ modelOptions.value = modelRes;
+
+ // 绛夊緟 DOM 鏇存柊
+ await nextTick();
+
+ // 鏍规嵁 specificationModel 鏌ユ壘 productModelId
+ if (
+ productForm.value.specificationModel &&
+ modelOptions.value.length > 0
+ ) {
+ const modelItem = modelOptions.value.find(
+ item => item.model === productForm.value.specificationModel
+ );
+ if (modelItem) {
+ productForm.value.productModelId = modelItem.id;
+ // 璁剧疆瑙勬牸鍨嬪彿鍜屽崟浣�
+ getProductModel(modelItem.id);
+ }
}
}
- return null;
- };
-
- const productId = findProductIdByCategory(productOptions.value, productForm.value.productCategory);
- if (productId) {
- productForm.value.productId = productId;
- // 鑾峰彇鍨嬪彿鍒楄〃骞剁瓑寰呭畬鎴�
- const modelRes = await modelList({id: productId});
- modelOptions.value = modelRes;
+ } else if (productForm.value.productId) {
+ // 濡傛灉鏈� productId锛屾甯稿姞杞藉瀷鍙峰垪琛�
+ await getModels(productForm.value.productId);
// 绛夊緟 DOM 鏇存柊
await nextTick();
- // 鏍规嵁 specificationModel 鏌ユ壘 productModelId
- if (productForm.value.specificationModel && modelOptions.value.length > 0) {
- const modelItem = modelOptions.value.find(
- item => item.model === productForm.value.specificationModel
- );
- if (modelItem) {
- productForm.value.productModelId = modelItem.id;
- // 璁剧疆瑙勬牸鍨嬪彿鍜屽崟浣�
- getProductModel(modelItem.id);
- }
+ if (productForm.value.productModelId) {
+ getProductModel(productForm.value.productModelId);
}
}
- } else if (productForm.value.productId) {
- // 濡傛灉鏈� productId锛屾甯稿姞杞藉瀷鍙峰垪琛�
- await getModels(productForm.value.productId);
- // 绛夊緟 DOM 鏇存柊
+ // 鏈�鍚庡啀绛夊緟涓�娆� DOM 鏇存柊锛岀‘淇濇墍鏈夋暟鎹兘宸茶缃�
await nextTick();
-
- if (productForm.value.productModelId) {
- getProductModel(productForm.value.productModelId);
- }
}
-
- // 鏈�鍚庡啀绛夊緟涓�娆� DOM 鏇存柊锛岀‘淇濇墍鏈夋暟鎹兘宸茶缃�
- await nextTick();
- }
-};
-const getProductOptions = () => {
- return productTreeList().then(res => {
- productOptions.value = convertIdToValue(res);
- return res;
- });
-};
-const getModels = value => {
- if (value) {
- productForm.value.productCategory =
- findNodeById(productOptions.value, value) || "";
- return modelList({id: value}).then(res => {
- modelOptions.value = res;
+ };
+ const getProductOptions = () => {
+ return productTreeList().then(res => {
+ productOptions.value = convertIdToValue(res);
return res;
});
- } else {
- productForm.value.productCategory = "";
- modelOptions.value = [];
- return Promise.resolve([]);
- }
-};
-const getProductModel = value => {
- const index = modelOptions.value.findIndex(item => item.id === value);
- if (index !== -1) {
- productForm.value.specificationModel = modelOptions.value[index].model;
- productForm.value.unit = modelOptions.value[index].unit;
- } else {
- productForm.value.specificationModel = null;
- productForm.value.unit = null;
- }
-};
-const findNodeById = (nodes, productId) => {
- for (let i = 0; i < nodes.length; i++) {
- if (nodes[i].value === productId) {
- return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣鐨刲abel
+ };
+ const getModels = value => {
+ if (value) {
+ productForm.value.productCategory =
+ findNodeById(productOptions.value, value) || "";
+ return modelList({ id: value }).then(res => {
+ modelOptions.value = res;
+ return res;
+ });
+ } else {
+ productForm.value.productCategory = "";
+ modelOptions.value = [];
+ return Promise.resolve([]);
}
- if (nodes[i].children && nodes[i].children.length > 0) {
- const foundNode = findNodeById(nodes[i].children, productId);
- if (foundNode) {
- return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝鐩存帴杩斿洖锛堝凡缁忔槸label瀛楃涓诧級
+ };
+ const getProductModel = value => {
+ const index = modelOptions.value.findIndex(item => item.id === value);
+ if (index !== -1) {
+ productForm.value.specificationModel = modelOptions.value[index].model;
+ productForm.value.unit = modelOptions.value[index].unit;
+ } else {
+ productForm.value.specificationModel = null;
+ productForm.value.unit = null;
+ }
+ };
+ const findNodeById = (nodes, productId) => {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].value === productId) {
+ return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣鐨刲abel
}
- }
- }
- return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
-};
-
-function convertIdToValue(data) {
- return data.map(item => {
- const {id, children, ...rest} = item;
- const newItem = {
- ...rest,
- value: id, // 灏� id 鏀逛负 value
- };
- if (children && children.length > 0) {
- newItem.children = convertIdToValue(children);
- }
-
- return newItem;
- });
-}
-
-// 鎻愪氦浜у搧琛ㄥ崟
-const submitProduct = () => {
- proxy.$refs["productFormRef"].validate(valid => {
- if (valid) {
- if (operationType.value === "edit") {
- submitProductEdit();
- } else {
- if (productOperationType.value === "add") {
- productData.value.push({...productForm.value});
- console.log("productData.value---", productData.value);
- } else {
- productData.value[productOperationIndex.value] = {
- ...productForm.value,
- };
+ if (nodes[i].children && nodes[i].children.length > 0) {
+ const foundNode = findNodeById(nodes[i].children, productId);
+ if (foundNode) {
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝鐩存帴杩斿洖锛堝凡缁忔槸label瀛楃涓诧級
}
- closeProductDia();
}
}
- });
-};
-const submitProductEdit = () => {
- productForm.value.salesLedgerId = currentId.value;
- productForm.value.type = 2;
- addOrUpdateSalesLedgerProduct(productForm.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeProductDia();
- getPurchaseById({id: currentId.value, type: 2}).then(res => {
- productData.value = res.productData;
+ return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+ };
+
+ function convertIdToValue(data) {
+ return data.map(item => {
+ const { id, children, ...rest } = item;
+ const newItem = {
+ ...rest,
+ value: id, // 灏� id 鏀逛负 value
+ };
+ if (children && children.length > 0) {
+ newItem.children = convertIdToValue(children);
+ }
+
+ return newItem;
});
- });
-};
-// 鍒犻櫎浜у搧
-const deleteProduct = () => {
- if (productSelectedRows.value.length === 0) {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
}
- if (operationType.value === "add") {
- productSelectedRows.value.forEach(selectedRow => {
- const index = productData.value.findIndex(
- product => product.id === selectedRow.id
- );
- if (index !== -1) {
- productData.value.splice(index, 1);
+
+ // 鎻愪氦浜у搧琛ㄥ崟
+ const submitProduct = () => {
+ proxy.$refs["productFormRef"].validate(valid => {
+ if (valid) {
+ if (operationType.value === "edit") {
+ submitProductEdit();
+ } else {
+ if (productOperationType.value === "add") {
+ productData.value.push({ ...productForm.value });
+ console.log("productData.value---", productData.value);
+ } else {
+ productData.value[productOperationIndex.value] = {
+ ...productForm.value,
+ };
+ }
+ closeProductDia();
+ }
}
});
- } else {
- let ids = [];
- if (productSelectedRows.value.length > 0) {
- ids = productSelectedRows.value.map(item => item.id);
+ };
+ const submitProductEdit = () => {
+ productForm.value.salesLedgerId = currentId.value;
+ productForm.value.type = 2;
+ addOrUpdateSalesLedgerProduct(productForm.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeProductDia();
+ getPurchaseById({ id: currentId.value, type: 2 }).then(res => {
+ productData.value = res.productData;
+ });
+ });
+ };
+ // 鍒犻櫎浜у搧
+ const deleteProduct = () => {
+ if (productSelectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
}
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ if (operationType.value === "add") {
+ productSelectedRows.value.forEach(selectedRow => {
+ const index = productData.value.findIndex(
+ product => product.id === selectedRow.id
+ );
+ if (index !== -1) {
+ productData.value.splice(index, 1);
+ }
+ });
+ } else {
+ let ids = [];
+ if (productSelectedRows.value.length > 0) {
+ ids = productSelectedRows.value.map(item => item.id);
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
delProduct(ids).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
closeProductDia();
- getPurchaseById({id: currentId.value, type: 2}).then(
- res => {
- productData.value = res.productData;
- }
- );
+ getPurchaseById({ id: currentId.value, type: 2 }).then(res => {
+ productData.value = res.productData;
+ });
});
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
- }
-};
-// 鍏抽棴浜у搧寮规
-const closeProductDia = () => {
- proxy.resetForm("productFormRef");
- productFormVisible.value = false;
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ }
+ };
+ // 鍏抽棴浜у搧寮规
+ const closeProductDia = () => {
+ proxy.resetForm("productFormRef");
+ productFormVisible.value = false;
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
proxy.download("/purchase/ledger/export", {}, "閲囪喘鍙拌处.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-// 鍒犻櫎
-const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value.filter(item => item.salesLedgerId === null).map(item => item.id);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ };
+ // 鍒犻櫎
+ const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value
+ .filter(item => item.salesLedgerId === null)
+ .map(item => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
delPurchase(ids).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
@@ -1604,172 +1632,172 @@
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
+ };
-// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
-function getCurrentDate() {
- const today = new Date();
- const year = today.getFullYear();
- const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
- const day = String(today.getDate()).padStart(2, "0");
- return `${year}-${month}-${day}`;
-}
+ // 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+ function getCurrentDate() {
+ const today = new Date();
+ const year = today.getFullYear();
+ const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+ const day = String(today.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day}`;
+ }
-const mathNum = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
- if (!productForm.value.taxInclusiveUnitPrice) {
- return;
- }
- if (!productForm.value.quantity) {
- return;
- }
- // 鍚◣鎬讳环璁$畻
- productForm.value.taxInclusiveTotalPrice =
- proxy.calculateTaxIncludeTotalPrice(
- productForm.value.taxInclusiveUnitPrice,
- productForm.value.quantity
- );
- 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 (
- field === "taxInclusiveTotalPrice" ||
- field === "taxExclusiveTotalPrice"
- ) {
- const value = Number(productForm.value[field]);
- if (value < 0) {
- productForm.value[field] = "0";
- proxy.$modal.msgWarning("鍊间笉鑳藉皬浜�0");
+ const mathNum = () => {
+ if (!productForm.value.taxRate) {
+ proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
return;
}
- }
+ if (!productForm.value.taxInclusiveUnitPrice) {
+ return;
+ }
+ if (!productForm.value.quantity) {
+ return;
+ }
+ // 鍚◣鎬讳环璁$畻
+ productForm.value.taxInclusiveTotalPrice =
+ proxy.calculateTaxIncludeTotalPrice(
+ productForm.value.taxInclusiveUnitPrice,
+ productForm.value.quantity
+ );
+ 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 (field === "taxInclusiveTotalPrice") {
- // 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
- if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice = (
+ // 纭繚杈撳叆鍊间笉涓鸿礋鏁�
+ if (
+ field === "taxInclusiveTotalPrice" ||
+ field === "taxExclusiveTotalPrice"
+ ) {
+ const value = Number(productForm.value[field]);
+ if (value < 0) {
+ productForm.value[field] = "0";
+ proxy.$modal.msgWarning("鍊间笉鑳藉皬浜�0");
+ return;
+ }
+ }
+
+ if (field === "taxInclusiveTotalPrice") {
+ // 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
+ if (productForm.value.quantity) {
+ productForm.value.taxInclusiveUnitPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
- productForm.value.taxInclusiveUnitPrice = "0";
+ ).toFixed(2);
+ // 纭繚缁撴灉涓嶄负璐熸暟
+ if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
+ productForm.value.taxInclusiveUnitPrice = "0";
+ }
}
- }
- // 宸茬煡鍚◣鎬讳环鍜屽惈绋庡崟浠凤紝鍙嶇畻鏁伴噺
- else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity = (
+ // 宸茬煡鍚◣鎬讳环鍜屽惈绋庡崟浠凤紝鍙嶇畻鏁伴噺
+ else if (productForm.value.taxInclusiveUnitPrice) {
+ productForm.value.quantity = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.taxInclusiveUnitPrice)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.quantity) < 0) {
- productForm.value.quantity = "0";
+ ).toFixed(2);
+ // 纭繚缁撴灉涓嶄负璐熸暟
+ if (Number(productForm.value.quantity) < 0) {
+ productForm.value.quantity = "0";
+ }
}
- }
- // 鍙嶇畻涓嶅惈绋庢�讳环
- productForm.value.taxExclusiveTotalPrice = (
+ // 鍙嶇畻涓嶅惈绋庢�讳环
+ productForm.value.taxExclusiveTotalPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
(1 + taxRate / 100)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxExclusiveTotalPrice) < 0) {
- productForm.value.taxExclusiveTotalPrice = "0";
- }
- } else if (field === "taxExclusiveTotalPrice") {
- // 鍙嶇畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice = (
+ ).toFixed(2);
+ // 纭繚缁撴灉涓嶄负璐熸暟
+ if (Number(productForm.value.taxExclusiveTotalPrice) < 0) {
+ productForm.value.taxExclusiveTotalPrice = "0";
+ }
+ } else if (field === "taxExclusiveTotalPrice") {
+ // 鍙嶇畻鍚◣鎬讳环
+ productForm.value.taxInclusiveTotalPrice = (
Number(productForm.value.taxExclusiveTotalPrice) *
(1 + taxRate / 100)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxInclusiveTotalPrice) < 0) {
- productForm.value.taxInclusiveTotalPrice = "0";
- }
- // 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
- if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice = (
+ ).toFixed(2);
+ // 纭繚缁撴灉涓嶄负璐熸暟
+ if (Number(productForm.value.taxInclusiveTotalPrice) < 0) {
+ productForm.value.taxInclusiveTotalPrice = "0";
+ }
+ // 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
+ if (productForm.value.quantity) {
+ productForm.value.taxInclusiveUnitPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
- productForm.value.taxInclusiveUnitPrice = "0";
+ ).toFixed(2);
+ // 纭繚缁撴灉涓嶄负璐熸暟
+ if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
+ productForm.value.taxInclusiveUnitPrice = "0";
+ }
}
- }
- // 宸茬煡鍚◣鍗曚环锛屽弽绠楁暟閲�
- else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity = (
+ // 宸茬煡鍚◣鍗曚环锛屽弽绠楁暟閲�
+ else if (productForm.value.taxInclusiveUnitPrice) {
+ productForm.value.quantity = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.taxInclusiveUnitPrice)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.quantity) < 0) {
- productForm.value.quantity = "0";
+ ).toFixed(2);
+ // 纭繚缁撴灉涓嶄负璐熸暟
+ if (Number(productForm.value.quantity) < 0) {
+ productForm.value.quantity = "0";
+ }
}
}
- }
-};
-// 閿�鍞悎鍚岄�夋嫨鏀瑰彉鏂规硶
-const salesLedgerChange = async row => {
- console.log("row", row);
- var index = salesContractList.value.findIndex(item => item.id == row);
- console.log("index", index);
- if (index > -1) {
- await querygProductInfoByContractNo();
- }
-};
+ };
+ // 閿�鍞悎鍚岄�夋嫨鏀瑰彉鏂规硶
+ const salesLedgerChange = async row => {
+ console.log("row", row);
+ var index = salesContractList.value.findIndex(item => item.id == row);
+ console.log("index", index);
+ if (index > -1) {
+ await querygProductInfoByContractNo();
+ }
+ };
-const querygProductInfoByContractNo = async () => {
- const {code, data} = await getProductInfoByContractNo({
- contractNo: form.value.salesLedgerId,
- });
- if (code == 200) {
- productData.value = data;
- }
-};
+ const querygProductInfoByContractNo = async () => {
+ const { code, data } = await getProductInfoByContractNo({
+ contractNo: form.value.salesLedgerId,
+ });
+ if (code == 200) {
+ productData.value = data;
+ }
+ };
-// 鑾峰彇妯℃澘淇℃伅
-const getTemplateList = async () => {
- let res = await getPurchaseTemplateList();
- if (res && res.code === 200 && Array.isArray(res.data)) {
- templateList.value = res.data;
- }
-};
+ // 鑾峰彇妯℃澘淇℃伅
+ const getTemplateList = async () => {
+ let res = await getPurchaseTemplateList();
+ if (res && res.code === 200 && Array.isArray(res.data)) {
+ templateList.value = res.data;
+ }
+ };
-// 鎵撳紑闄勪欢寮规
-const openFileDialog = async (row) => {
- recordId.value = row.id
- fileListDialogVisible.value = true
-}
+ // 鎵撳紑闄勪欢寮规
+ const openFileDialog = async row => {
+ recordId.value = row.id;
+ fileListDialogVisible.value = true;
+ };
-// 鍒犻櫎妯℃澘
-const handleDeleteTemplate = async (item) => {
- if (!item.id) {
- proxy.$modal.msgWarning("鏃犳硶鍒犻櫎璇ユā鏉�");
- return;
- }
+ // 鍒犻櫎妯℃澘
+ const handleDeleteTemplate = async item => {
+ if (!item.id) {
+ proxy.$modal.msgWarning("鏃犳硶鍒犻櫎璇ユā鏉�");
+ return;
+ }
- try {
- await ElMessageBox.confirm(
+ try {
+ await ElMessageBox.confirm(
`纭畾瑕佸垹闄ゆā鏉�"${item.templateName}"鍚楋紵`,
"鍒犻櫎纭",
{
@@ -1777,122 +1805,122 @@
cancelButtonText: "鍙栨秷",
type: "warning",
}
- );
+ );
- const res = await delPurchaseTemplate([item.id]);
- if (res && res.code === 200) {
- ElMessage({
- message: "鍒犻櫎鎴愬姛",
- type: "success",
- });
- // 濡傛灉鍒犻櫎鐨勬槸褰撳墠閫変腑鐨勬ā鏉匡紝娓呯┖閫夋嫨
- if (templateName.value === item.templateName) {
- templateName.value = "";
- filterInputValue.value = "";
+ const res = await delPurchaseTemplate([item.id]);
+ if (res && res.code === 200) {
+ ElMessage({
+ message: "鍒犻櫎鎴愬姛",
+ type: "success",
+ });
+ // 濡傛灉鍒犻櫎鐨勬槸褰撳墠閫変腑鐨勬ā鏉匡紝娓呯┖閫夋嫨
+ if (templateName.value === item.templateName) {
+ templateName.value = "";
+ filterInputValue.value = "";
+ }
+ // 閲嶆柊鑾峰彇妯℃澘鍒楄〃
+ await getTemplateList();
+ } else {
+ ElMessage({
+ message: res?.msg || "鍒犻櫎澶辫触",
+ type: "error",
+ });
}
- // 閲嶆柊鑾峰彇妯℃澘鍒楄〃
- await getTemplateList();
- } else {
- ElMessage({
- message: res?.msg || "鍒犻櫎澶辫触",
- type: "error",
- });
+ } catch (error) {
+ if (error !== "cancel") {
+ console.error("鍒犻櫎妯℃澘澶辫触:", error);
+ ElMessage({
+ message: "鍒犻櫎澶辫触锛岃绋嶅悗閲嶈瘯",
+ type: "error",
+ });
+ }
}
- } catch (error) {
- if (error !== "cancel") {
- console.error("鍒犻櫎妯℃澘澶辫触:", error);
- ElMessage({
- message: "鍒犻櫎澶辫触锛岃绋嶅悗閲嶈瘯",
- type: "error",
- });
- }
- }
-};
+ };
-onMounted(() => {
- getList();
- getTemplateList();
-});
+ onMounted(() => {
+ getList();
+ getTemplateList();
+ });
</script>
<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;
-}
-
-// 瀹℃壒浜鸿妭鐐瑰鍣ㄦ牱寮�
-.approver-nodes-container {
- display: flex;
- flex-wrap: wrap;
- gap: 16px;
- padding: 16px;
- background-color: #f8f9fa;
- border-radius: 4px;
- border: 1px solid #e4e7ed;
-}
-
-.approver-node-item {
- flex: 0 0 calc(33.333% - 12px);
- min-width: 200px;
- padding: 12px;
- background-color: #fff;
- border-radius: 4px;
- border: 1px solid #dcdfe6;
- transition: all 0.3s;
-
- &:hover {
- border-color: #409eff;
- box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
+ .invalid-row {
+ opacity: 0.6;
+ background-color: #f5f7fa;
}
-}
-.approver-node-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8px;
-}
+ .el-row {
+ justify-content: space-between;
+ align-items: center;
+ }
-.approver-node-label {
- font-size: 13px;
- font-weight: 500;
- color: #606266;
-}
+ .no-arrow-select {
+ --el-select-suffix-icon-color: transparent; /* 闅愯棌榛樿涓嬫媺绠ご */
+ }
-@media (max-width: 1200px) {
+ .select-button-group {
+ display: flex;
+ align-items: center;
+ }
+
+ // 瀹℃壒浜鸿妭鐐瑰鍣ㄦ牱寮�
+ .approver-nodes-container {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16px;
+ padding: 16px;
+ background-color: #f8f9fa;
+ border-radius: 4px;
+ border: 1px solid #e4e7ed;
+ }
+
.approver-node-item {
- flex: 0 0 calc(50% - 8px);
- }
-}
+ flex: 0 0 calc(33.333% - 12px);
+ min-width: 200px;
+ padding: 12px;
+ background-color: #fff;
+ border-radius: 4px;
+ border: 1px solid #dcdfe6;
+ transition: all 0.3s;
-@media (max-width: 768px) {
- .approver-node-item {
- flex: 0 0 100%;
+ &:hover {
+ border-color: #409eff;
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
+ }
}
-}
-// 鍒犻櫎鍥炬爣鏍峰紡
-.delete-icon {
- transition: all 0.3s;
-
- &:hover {
- color: #f56c6c !important;
- transform: scale(1.2);
+ .approver-node-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 8px;
}
-}
+
+ .approver-node-label {
+ font-size: 13px;
+ font-weight: 500;
+ color: #606266;
+ }
+
+ @media (max-width: 1200px) {
+ .approver-node-item {
+ flex: 0 0 calc(50% - 8px);
+ }
+ }
+
+ @media (max-width: 768px) {
+ .approver-node-item {
+ flex: 0 0 100%;
+ }
+ }
+
+ // 鍒犻櫎鍥炬爣鏍峰紡
+ .delete-icon {
+ transition: all 0.3s;
+
+ &:hover {
+ color: #f56c6c !important;
+ transform: scale(1.2);
+ }
+ }
</style>
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index 9668853..216e73b 100644
--- a/src/views/productionManagement/productionProcess/index.vue
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -162,9 +162,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
+ <el-button type="primary" @click="handleProcessSubmit">纭畾</el-button>
<el-button @click="processDialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary"
- @click="handleProcessSubmit">纭畾</el-button>
</span>
</template>
</el-dialog>
@@ -252,10 +251,8 @@
</div>
<template #footer>
<span class="dialog-footer">
+ <el-button type="primary" :disabled="!selectedParam" @click="handleParamSubmit">纭畾</el-button>
<el-button @click="paramDialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary"
- :disabled="!selectedParam"
- @click="handleParamSubmit">纭畾</el-button>
</span>
</template>
</el-dialog>
@@ -288,7 +285,7 @@
</template>
<script setup>
- import { ref, reactive, onMounted } from "vue";
+ import { ref, reactive, computed, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { Plus, Edit, Delete, Search } from "@element-plus/icons-vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
@@ -313,8 +310,19 @@
const processLoading = ref(false);
const deviceOptions = ref([]);
- // 鍙傛暟鍒楄〃鏁版嵁
- const paramList = ref([]);
+ // 宸ュ簭宸查�夊弬鏁拌〃鏍煎垎椤碉紙鎺ュ彛涓�娆¤繑鍥炲叏閲忥級
+ const paramPage2 = ref({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+ const paramListRaw = ref([]);
+ const paramList = computed(() => {
+ const all = paramListRaw.value;
+ const { current, size } = paramPage2.value;
+ const start = (current - 1) * size;
+ return all.slice(start, start + size);
+ });
const paramLoading = ref(false);
// 鏁版嵁瀛楀吀
@@ -485,21 +493,21 @@
}
};
- const paramPage2 = ref({
- current: 1,
- size: 10,
- total: 0,
- });
-
// 鑾峰彇鍙傛暟鍒楄〃
const getParamList = processId => {
paramLoading.value = true;
- console.log(paramPage2.value, "paramPage2.value");
getProcessParamList({ technologyOperationId: processId })
.then(res => {
- console.log(res, "res");
- paramList.value = res.data || [];
- paramPage2.value.total = 0;
+ const list = res.data || [];
+ paramListRaw.value = Array.isArray(list) ? list : [];
+ paramPage2.value.total = paramListRaw.value.length;
+ const maxPage = Math.max(
+ 1,
+ Math.ceil(paramPage2.value.total / paramPage2.value.size) || 1
+ );
+ if (paramPage2.value.current > maxPage) {
+ paramPage2.value.current = maxPage;
+ }
})
.catch(() => {
ElMessage.error("鑾峰彇鍙傛暟鍒楄〃澶辫触");
@@ -512,6 +520,7 @@
// 閫夋嫨宸ュ簭
const selectProcess = process => {
selectedProcess.value = process;
+ paramPage2.value.current = 1;
getParamList(process.id);
};
@@ -556,7 +565,8 @@
getProcessList();
if (selectedProcess.value?.id === process.id) {
selectedProcess.value = null;
- paramList.value = [];
+ paramListRaw.value = [];
+ paramPage2.value.total = 0;
}
})
.catch(() => {
@@ -744,10 +754,8 @@
};
const handleParamPagination = obj => {
- console.log(obj, "obj");
paramPage2.value.current = obj.page;
paramPage2.value.size = obj.limit;
- getParamList(selectedProcess.value.id);
};
// 鑾峰彇鏁版嵁瀛楀吀
diff --git a/src/views/productionPlan/productionPlan/index.vue b/src/views/productionPlan/productionPlan/index.vue
index 757eef7..46d0548 100644
--- a/src/views/productionPlan/productionPlan/index.vue
+++ b/src/views/productionPlan/productionPlan/index.vue
@@ -134,9 +134,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
+ <el-button type="primary" @click="handleMergeSubmit">纭畾涓嬪彂</el-button>
<el-button @click="isShowNewModal = false">鍙栨秷</el-button>
- <el-button type="primary"
- @click="handleMergeSubmit">纭畾涓嬪彂</el-button>
</span>
</template>
</el-dialog>
@@ -228,9 +227,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭畾</el-button>
<el-button @click="dialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary"
- @click="handleSubmit">纭畾</el-button>
</span>
</template>
</el-dialog>
@@ -407,7 +405,7 @@
type: "primary",
link: true,
showHide: row => {
- return row.status == 0;
+ return row.status == 0 && row.source != "閿�鍞�";
},
clickFun: row => {
handleEdit(row);
diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue b/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue
index da736e1..58c83d8 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/left-bottom.vue
@@ -45,7 +45,7 @@
import PanelHeader from '../PanelHeader.vue'
import DateTypeSwitch from '../DateTypeSwitch.vue'
import { customerRevenueAnalysis } from '@/api/viewIndex.js'
-import { listCustomer } from '@/api/basicData/customerFile.js'
+import { listCustomer } from '@/api/basicData/customer.js'
const dateType = ref(1) // 1=鍛� 2=鏈� 3=瀛e害
const customerValue = ref(null)
diff --git a/src/views/reportAnalysis/dataDashboard/index0.vue b/src/views/reportAnalysis/dataDashboard/index0.vue
index 5c318c8..a89a174 100644
--- a/src/views/reportAnalysis/dataDashboard/index0.vue
+++ b/src/views/reportAnalysis/dataDashboard/index0.vue
@@ -316,7 +316,7 @@
getWorkInProcessTurnover
} from "@/api/viewIndex.js";
import {staffOnJobListPage} from "@/api/personnelManagement/employeeRecord.js";
-import {listCustomer} from "@/api/basicData/customerFile.js";
+import { listCustomer } from '@/api/basicData/customer.js'
import {listSupplier} from "@/api/basicData/supplierManageFile.js";
import {getLedgerPage} from "@/api/equipmentManagement/ledger.js";
import {getRepairPage} from "@/api/equipmentManagement/repair.js";
diff --git a/src/views/salesManagement/returnOrder/components/formDia.vue b/src/views/salesManagement/returnOrder/components/formDia.vue
index 6ee63a8..7a35ea9 100644
--- a/src/views/salesManagement/returnOrder/components/formDia.vue
+++ b/src/views/salesManagement/returnOrder/components/formDia.vue
@@ -171,7 +171,7 @@
import useUserStore from "@/store/modules/user.js";
import { userListNoPageByTenantId } from "@/api/system/user.js";
import { listProject } from "@/api/oaSystem/projectManagement.js";
-import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
+import {listCustomer} from "@/api/basicData/customer.js";
const { proxy } = getCurrentInstance();
const emit = defineEmits(['close'])
@@ -354,7 +354,7 @@
};
const initCustomers = async () => {
- listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+ listCustomer({current: -1,size:-1, type: 0}).then((res) => {
customerNameOptions.value = res.data.records.map(item => ({
label: item.customerName,
value: item.customerName, // Keep value as name if needed for other logic, but request says customerId
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index c6184c8..5340d99 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -985,10 +985,9 @@
import {modelList, productTreeList} from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
import dayjs from "dayjs";
-import {getCurrentDate} from "@/utils/index.js";
-import {useRouter, useRoute} from "vue-router";
-import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
import FileUpload from "@/components/AttachmentUpload/file/index.vue";
+import { getCurrentDate } from "@/utils/index.js";
+import {listCustomer} from "@/api/basicData/customer.js";
const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
@@ -1497,7 +1496,7 @@
selectedQuotation.value = null;
let userLists = await userListNoPage();
userList.value = userLists.data;
- listCustomerPrivatePool({current: -1, size: -1}).then(res => {
+ listCustomer({current: -1, size: -1}).then(res => {
customerOption.value = res.data.records;
});
form.value.entryPerson = userStore.id;
@@ -1534,7 +1533,7 @@
// 鍏堢‘淇濆鎴峰垪琛ㄥ凡鍔犺浇锛屼究浜庡悗缁洖濉� customerId
if (!customerOption.value || customerOption.value.length === 0) {
try {
- listCustomerPrivatePool({current: -1, size: -1}).then(res => {
+ listCustomer({current: -1, size: -1}).then(res => {
customerOption.value = res.data.records;
});
} catch (e) {
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index ee93e46..2237b72 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -16,8 +16,8 @@
</el-input>
</el-col>
<el-col :span="8">
- <el-select v-model="searchForm.customer" placeholder="璇烽�夋嫨瀹㈡埛" clearable>
- <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.customerName">
+ <el-select v-model="searchForm.customerId" placeholder="璇烽�夋嫨瀹㈡埛" clearable>
+ <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id">
{{
item.customerName + "鈥斺��" + item.taxpayerIdentificationNumber
}}
@@ -102,8 +102,8 @@
<div class="form-content">
<el-row :gutter="24">
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О" prop="customer">
- <el-select v-model="form.customer" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%" clearable filterable>
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="customerId">
+ <el-select v-model="form.customerId" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%" clearable filterable>
<el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
</el-select>
</el-form-item>
@@ -300,23 +300,22 @@
import Pagination from '@/components/PIMTable/Pagination.vue'
import FormDialog from '@/components/Dialog/FormDialog.vue'
import {getQuotationList,addQuotation,updateQuotation,deleteQuotation} from '@/api/salesManagement/salesQuotation.js'
-import {customerList} from "@/api/salesManagement/salesLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
-import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
+import {listCustomer} from "@/api/basicData/customer.js";
import { userListNoPage } from "@/api/system/user.js";
// 鍝嶅簲寮忔暟鎹�
const loading = ref(false)
const searchForm = reactive({
quotationNo: '',
- customer: '',
+ customerId: '',
status: ''
})
const quotationList = ref([])
const userList = ref([])
const productOptions = ref([]);
-const modelOptions = ref([]);
+const modelOptions = ref([]);
const pagination = reactive({
total: 3,
currentPage: 1,
@@ -328,6 +327,7 @@
const dialogTitle = ref('鏂板鎶ヤ环')
const form = reactive({
quotationNo: '',
+ customerId: undefined,
customer: '',
salesperson: '',
quotationDate: '',
@@ -407,7 +407,12 @@
resetForm()
dialogVisible.value = true
getProductOptions();
- listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+ fetchCustomerOptions()
+}
+
+const fetchCustomerOptions = () => {
+ if (customerOption.value.length > 0) return
+ listCustomer({current: -1,size:-1, type: 0}).then((res) => {
customerOption.value = res.data.records;
});
}
@@ -537,10 +542,12 @@
form.id = row.id || form.id || null
// 鍏堝姞杞戒骇鍝佹爲鏁版嵁锛屽惁鍒� el-tree-select 鏃犳硶鍙嶆樉浜у搧鍚嶇О
await getProductOptions()
+ await fetchCustomerOptions()
// 鍙鍒堕渶瑕佺殑瀛楁锛岄伩鍏嶅皢缁勪欢寮曠敤鏀惧叆鍝嶅簲寮忓璞�
form.quotationNo = row.quotationNo || ''
form.customer = row.customer || ''
+ form.customerId = row.customerId || undefined
form.salesperson = row.salesperson || ''
form.quotationDate = row.quotationDate || ''
form.validDate = row.validDate || ''
@@ -686,6 +693,7 @@
return sum + price
}, 0)
+ form.customer = customerOption.value.find(item => item.id === form.customerId)?.customerName || ''
if (isEdit.value) {
// 缂栬緫
const index = quotationList.value.findIndex(item => item.id === editId.value)
@@ -735,6 +743,7 @@
id: item.id,
quotationNo: item.quotationNo || '',
customer: item.customer || '',
+ customerId: item.customerId || undefined,
salesperson: item.salesperson || '',
quotationDate: item.quotationDate || '',
validDate: item.validDate || '',
@@ -781,6 +790,7 @@
onMounted(()=>{
getUserList()
handleSearch()
+ fetchCustomerOptions()
})
</script>
diff --git a/src/views/tool/build/CodeTypeDialog.vue b/src/views/tool/build/CodeTypeDialog.vue
index de0beb7..1a75789 100644
--- a/src/views/tool/build/CodeTypeDialog.vue
+++ b/src/views/tool/build/CodeTypeDialog.vue
@@ -14,8 +14,8 @@
</el-form>
<template #footer>
- <el-button @click="onClose">鍙栨秷</el-button>
<el-button type="primary" @click="handelConfirm">纭畾</el-button>
+ <el-button @click="onClose">鍙栨秷</el-button>
</template>
</el-dialog>
</template>
diff --git a/vite.config.js b/vite.config.js
index dc687a8..03311be 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -8,11 +8,11 @@
const { VITE_APP_ENV } = env;
const baseUrl =
env.VITE_APP_ENV === "development"
- ? "http://1.15.17.182:9003"
+ ? "http://1.15.17.182:9048"
: env.VITE_BASE_API;
const javaUrl =
env.VITE_APP_ENV === "development"
- ? "http://1.15.17.182:9002"
+ ? "http://1.15.17.182:9049"
: env.VITE_JAVA_API;
return {
define:{
--
Gitblit v1.9.3