From 298a75f485465ad049c1d5922a94026f81ca40d1 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 14 九月 2026 11:15:03 +0800
Subject: [PATCH] feat: 优化下单-检验
---
src/views/standard/standardLibrary/index.vue | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/src/views/standard/standardLibrary/index.vue b/src/views/standard/standardLibrary/index.vue
index 7f57755..16b01f8 100644
--- a/src/views/standard/standardLibrary/index.vue
+++ b/src/views/standard/standardLibrary/index.vue
@@ -56,6 +56,17 @@
</pane>
<!--鐢ㄦ埛鏁版嵁-->
<pane size="88">
+ <el-card v-if="selected.isLeaf" shadow="never" class="template-binding-card">
+ <div slot="header"><span>鍘熷璁板綍妯℃澘</span><el-button v-if="checkPermi(['standard:standardLibrary:upStandardProduct'])" type="primary" size="mini" style="float:right" @click="saveBindings">淇濆瓨缁戝畾</el-button></div>
+ <p v-if="!templateBindings.length" class="binding-tip">璇蜂负褰撳墠鏍囧噯缁戝畾鍘熷璁板綍妯℃澘锛涙ā鏉夸腑椤讳娇鐢ㄢ�滄楠岄」鈥濇爣璁般��</p>
+ <el-table :data="templateBindings" border size="small">
+ <el-table-column type="index" label="椤哄簭" width="70" /><el-table-column label="妯℃澘缂栧彿" prop="number" width="180" /><el-table-column label="妯℃澘鍚嶇О" prop="name" /><el-table-column label="妫�娴嬩緷鎹紙妯℃澘澶囨敞锛�" prop="remark" />
+ <el-table-column v-if="checkPermi(['standard:standardLibrary:upStandardProduct'])" label="鎿嶄綔" width="150"><template slot-scope="scope"><el-button type="text" :disabled="scope.$index === 0" @click="moveBinding(scope.$index, -1)">涓婄Щ</el-button><el-button type="text" :disabled="scope.$index === templateBindings.length - 1" @click="moveBinding(scope.$index, 1)">涓嬬Щ</el-button><el-button type="text" @click="removeBinding(scope.$index)">绉婚櫎</el-button></template></el-table-column>
+ </el-table>
+ <el-select v-if="checkPermi(['standard:standardLibrary:upStandardProduct'])" v-model="templateToBind" filterable placeholder="閫夋嫨鍘熷璁板綍妯℃澘" size="small" style="width:320px;margin-top:16px" @change="addBinding"><el-option v-for="template in templateList.filter(item => !templateBindings.some(binding => binding.templateId === item.id))" :key="template.id" :label="template.number ? template.number + ' - ' + template.name : template.name" :value="template.id" /></el-select>
+ </el-card>
+ <el-empty v-else description="璇烽�夋嫨浜岀骇鏍囧噯锛岀淮鎶ゅ叾鍘熷璁板綍妯℃澘" />
+ <div v-if="false">
<div class="search_form">
<div style="height:37px">
<p style="font-size: 14px; color: #999;margin-left: 10px">{{ selectTree }}</p>
@@ -192,6 +203,7 @@
<p style="text-align: right;margin-right: 20px;color: #333;">鍏眥{ total }}鏉�</p>
</el-row>
</el-col>
+ </div>
</pane>
</splitpanes>
</el-row>
@@ -321,6 +333,8 @@
selectStandardProductListByMethodId,
updateSection,
getStandardTemplate,
+ selectTemplateBindings,
+ saveTemplateBindings,
} from "@/api/standard/standardLibrary";
import bindSupplierDensityDialogAsk from "./components/bindSupplierDensityDialogAsk.vue";
import BatchCopy from "./components/BatchCopy.vue";
@@ -391,6 +405,8 @@
sectionRow: null,
sectionList: [],
templateList: [],
+ templateBindings: [],
+ templateToBind: null,
total: 0,
currentPage: 1,
standardId: 0,
@@ -495,6 +511,7 @@
this.currentPage = 1;
this.selectTree = buildSelectTree(node, "null");
this.selected = {
+ id: val.id,
label: val.label,
tree: this.selectTree,
isLeaf: leaf,
@@ -504,10 +521,11 @@
this.standardList = [];
this.productList = [];
if (leaf) {
- this.selectsStandardMethodByFLSSM();
+ this.loadTemplateBindings(val.id);
} else {
this.standardId = 0;
this.syncSortable();
+ this.templateBindings = [];
}
},
remove(node, data) {
@@ -965,6 +983,35 @@
this.templateList = res.data;
});
},
+ loadTemplateBindings(standardTreeId) {
+ selectTemplateBindings({ standardTreeId }).then((res) => {
+ this.templateBindings = res.data || [];
+ this.templateToBind = null;
+ });
+ },
+ addBinding(templateId) {
+ const template = this.templateList.find((item) => item.id === templateId);
+ if (template && !this.templateBindings.some((item) => item.templateId === templateId)) {
+ this.templateBindings.push({ ...template, templateId, sort: this.templateBindings.length });
+ }
+ this.templateToBind = null;
+ },
+ removeBinding(index) {
+ this.templateBindings.splice(index, 1);
+ },
+ moveBinding(index, offset) {
+ const target = index + offset;
+ const item = this.templateBindings.splice(index, 1)[0];
+ this.templateBindings.splice(target, 0, item);
+ },
+ saveBindings() {
+ saveTemplateBindings({ standardTreeId: this.selected.id,
+ templates: this.templateBindings.map((item, index) => ({ templateId: item.templateId, sort: index }))
+ }).then(() => {
+ this.$message.success("妯℃澘缁戝畾宸蹭繚瀛�");
+ this.loadTemplateBindings(this.selected.id);
+ });
+ },
handleCurrentChange(val) {
this.currentPage = val;
this.tableLoad2 = true;
--
Gitblit v1.9.3