From df888da7f2736a5fa383c3333b5605486eb51136 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 29 一月 2026 14:33:37 +0800
Subject: [PATCH] 进销存升级 1.用印管理查看时,申请编号显示不一致 2.知识库页面页码展示有误 3.新增的销售报价记录点击编辑后,产品规格型号信息不回显
---
src/views/collaborativeApproval/knowledgeBase/index.vue | 105 +++++++++++++++++++++++++++++++++++++---------------
1 files changed, 75 insertions(+), 30 deletions(-)
diff --git a/src/views/collaborativeApproval/knowledgeBase/index.vue b/src/views/collaborativeApproval/knowledgeBase/index.vue
index aeb1ba4..f7a1ef3 100644
--- a/src/views/collaborativeApproval/knowledgeBase/index.vue
+++ b/src/views/collaborativeApproval/knowledgeBase/index.vue
@@ -46,11 +46,13 @@
</div>
<!-- 鏂板/缂栬緫鐭ヨ瘑寮圭獥 -->
- <el-dialog
+ <FormDialog
v-model="dialogVisible"
:title="dialogTitle"
- width="800px"
- :close-on-click-modal="false"
+ :width="'800px'"
+ @close="closeKnowledgeDialog"
+ @confirm="submitForm"
+ @cancel="closeKnowledgeDialog"
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-row :gutter="20">
@@ -115,7 +117,14 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="鍒涘缓浜�" prop="creator">
- <el-input v-model="form.creator" placeholder="璇疯緭鍏ュ垱寤轰汉" />
+ <el-select v-model="form.creator" placeholder="璇烽�夋嫨鍒涘缓浜�" style="width: 100%" filterable>
+ <el-option
+ v-for="user in userList"
+ :key="user.userId"
+ :label="user.nickName"
+ :value="user.nickName"
+ />
+ </el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -125,20 +134,16 @@
</el-col>
</el-row>
</el-form>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary" @click="submitForm">纭畾</el-button>
- </span>
- </template>
- </el-dialog>
+ </FormDialog>
<!-- 鏌ョ湅鐭ヨ瘑璇︽儏寮圭獥 -->
- <el-dialog
+ <FormDialog
v-model="viewDialogVisible"
title="鐭ヨ瘑璇︽儏"
- width="900px"
- :close-on-click-modal="false"
+ :width="'900px'"
+ @close="closeViewDialog"
+ @confirm="handleViewDialogConfirm"
+ @cancel="closeViewDialog"
>
<div class="knowledge-detail">
<el-descriptions :column="2" border>
@@ -183,7 +188,7 @@
<h4>鍏抽敭瑕佺偣</h4>
<div class="key-points">
<el-tag
- v-for="(point, index) in currentKnowledge.keyPoints.split(',')"
+ v-for="(point, index) in currentKnowledge.keyPoints?.split(',') || []"
:key="index"
type="success"
style="margin-right: 8px; margin-bottom: 8px;"
@@ -219,24 +224,19 @@
</div>
</div>
</div>
-
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="viewDialogVisible = false">鍏抽棴</el-button>
- <el-button type="primary" @click="copyKnowledge">澶嶅埗鐭ヨ瘑</el-button>
- <!-- <el-button type="success" @click="markAsFavorite">鏀惰棌@</el-button> -->
- </span>
- </template>
- </el-dialog>
+ </FormDialog>
</div>
</template>
<script setup>
import { Search } from "@element-plus/icons-vue";
-import { onMounted, ref, reactive, toRefs, getCurrentInstance, computed } from "vue";
+import { onMounted, ref, reactive, toRefs, getCurrentInstance, computed, watch } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
+import FormDialog from '@/components/Dialog/FormDialog.vue';
import { listKnowledgeBase, delKnowledgeBase,addKnowledgeBase,updateKnowledgeBase } from "@/api/collaborativeApproval/knowledgeBase.js";
+import useUserStore from '@/store/modules/user';
+import { userListNoPageByTenantId } from '@/api/system/user.js';
// 琛ㄥ崟楠岃瘉瑙勫垯
const rules = {
@@ -302,6 +302,9 @@
// 琛ㄥ崟寮曠敤
const formRef = ref();
+// 鐢ㄦ埛鐩稿叧
+const userStore = useUserStore();
+const userList = ref([]);
// 琛ㄦ牸鍒楅厤缃�
const tableColumn = ref([
@@ -389,6 +392,15 @@
}
]);
+// 鐩戝惉瀵硅瘽妗嗘墦寮�锛岃幏鍙栫敤鎴峰垪琛�
+watch(dialogVisible, (newVal) => {
+ if (newVal) {
+ userListNoPageByTenantId().then((res) => {
+ userList.value = res.data || [];
+ });
+ }
+});
+
// 鐢熷懡鍛ㄦ湡
onMounted(() => {
getList();
@@ -414,7 +426,7 @@
.then(res => {
tableLoading.value = false;
tableData.value = res.data.records
- page.total = res.data.total;
+ page.value.total = res.data.total;
}).catch(err => {
tableLoading.value = false;
})
@@ -437,7 +449,7 @@
dialogType.value = type;
if (type === "add") {
dialogTitle.value = "鏂板鐭ヨ瘑";
- // 閲嶇疆琛ㄥ崟
+ // 閲嶇疆琛ㄥ崟锛岄粯璁ゅ垱寤轰汉涓哄綋鍓嶇敤鎴�
Object.assign(form.value, {
title: "",
type: "",
@@ -446,7 +458,7 @@
problem: "",
solution: "",
keyPoints: "",
- creator: "",
+ creator: userStore.nickName || "",
usageCount: 0
});
} else if (type === "edit" && row) {
@@ -550,6 +562,39 @@
});
};
+// 鍏抽棴鐭ヨ瘑琛ㄥ崟瀵硅瘽妗�
+const closeKnowledgeDialog = () => {
+ // 娓呯┖琛ㄥ崟鏁版嵁锛岄粯璁ゅ垱寤轰汉涓哄綋鍓嶇敤鎴�
+ Object.assign(form.value, {
+ id: undefined,
+ title: "",
+ type: "",
+ scenario: "",
+ efficiency: "",
+ problem: "",
+ solution: "",
+ keyPoints: "",
+ creator: userStore.nickName || "",
+ usageCount: 0
+ });
+ // 娓呴櫎琛ㄥ崟楠岃瘉鐘舵��
+ if (formRef.value) {
+ formRef.value.clearValidate();
+ }
+ dialogVisible.value = false;
+};
+
+// 鍏抽棴鏌ョ湅璇︽儏瀵硅瘽妗�
+const closeViewDialog = () => {
+ viewDialogVisible.value = false;
+};
+
+// 澶勭悊鏌ョ湅璇︽儏瀵硅瘽妗嗙‘璁わ紙鎵ц澶嶅埗鎿嶄綔锛�
+const handleViewDialogConfirm = () => {
+ copyKnowledge();
+ closeViewDialog();
+};
+
// 鎻愪氦鐭ヨ瘑琛ㄥ崟
const submitForm = async () => {
try {
@@ -559,7 +604,7 @@
addKnowledgeBase({...form.value}).then(res => {
if(res.code == 200){
ElMessage.success("娣诲姞鎴愬姛");
- dialogVisible.value = false;
+ closeKnowledgeDialog();
getList();
}
}).catch(err => {
@@ -569,7 +614,7 @@
updateKnowledgeBase({...form.value}).then(res => {
if(res.code == 200){
ElMessage.success("鏇存柊鎴愬姛");
- dialogVisible.value = false;
+ closeKnowledgeDialog();
getList();
}
}).catch(err => {
--
Gitblit v1.9.3