From 53de04f28e81d70e7bdf21a7dd657abf58177582 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 13 一月 2026 15:01:03 +0800
Subject: [PATCH] 删除重复的物料属性下拉列表
---
src/views/standard/standardLibrary/components/BatchCopy.vue | 447 ++++++++++++-------------------------------------------
1 files changed, 97 insertions(+), 350 deletions(-)
diff --git a/src/views/standard/standardLibrary/components/BatchCopy.vue b/src/views/standard/standardLibrary/components/BatchCopy.vue
index 7ea84b4..cbf23d6 100644
--- a/src/views/standard/standardLibrary/components/BatchCopy.vue
+++ b/src/views/standard/standardLibrary/components/BatchCopy.vue
@@ -1,243 +1,94 @@
<template>
<div>
- <el-dialog
- :visible.sync="batchCopyDia"
- class="more-edit"
- title="鎵归噺缂栬緫"
- width="90%"
- >
+ <el-dialog :visible.sync="batchCopyDia" class="more-edit" title="鎵归噺缂栬緫" width="90%" @closed="$emit('close')">
<el-row>
<el-col :span="6" class="search_thing">
<div class="search_label">鏍峰搧鍚嶇О锛�</div>
<div class="search_input">
<el-input v-model="sample" disabled size="small">
- <template slot="append"
- ><el-button
- slot="append"
- icon="el-icon-search"
- @click="selectStandardTree = true"
- ></el-button
- ></template>
+ <template slot="append"><el-button slot="append" icon="el-icon-search"
+ @click="selectStandardTree = true"></el-button></template>
</el-input>
</div>
</el-col>
<el-col :span="6" class="search_thing">
<div class="search_label">妫�楠屾爣鍑嗭細</div>
<div class="search_input">
- <el-select
- v-model="standardMethodListId"
- :loading="methodLoad"
- clearable
- placeholder="璇疯緭鍏�"
- size="small"
- @change="changeStandardMethodListId"
- @focus="methodFocus"
- >
- <el-option
- v-for="item in methods"
- :key="item.id"
- :label="item.code"
- :value="item.id"
- >
+ <el-select v-model="standardMethodListId" :loading="methodLoad" clearable placeholder="璇疯緭鍏�" size="small"
+ @change="changeStandardMethodListId" @focus="methodFocus">
+ <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="12" style="text-align: right">
- <el-button size="small" type="primary" @click="sortCopy"
- >鎺掑簭澶嶅埗</el-button
- >
- <el-button size="small" type="primary" @click="compareAlone"
- >鍗曠嫭瀵规瘮</el-button
- >
- <el-button size="small" type="primary" @click="compare"
- >澶嶅埗</el-button
- >
+ <el-button size="small" type="primary" @click="sortCopy">鎺掑簭澶嶅埗</el-button>
+ <el-button size="small" type="primary" @click="compareAlone">鍗曠嫭瀵规瘮</el-button>
+ <el-button size="small" type="primary" @click="compare">澶嶅埗</el-button>
</el-col>
</el-row>
- <div
- class="body"
- style="display: flex; flex-direction: row; height: 80vh"
- >
+ <div class="body" style="display: flex; flex-direction: row; height: 80vh">
<div v-loading="productTableLoading1" style="width: 50%">
<div>闇�瑕佸鍒剁殑妫�楠岄」</div>
- <el-table
- ref="productTable1"
- :data="productList1"
- :fit="true"
- :row-key="(row) => row.id"
- border
- header-row-class-name="header-class"
- height="90%"
- highlight-current-row
- stripe
- style="width: 98%"
- tooltip-effect="dark"
- @select="handleSelectionChange1"
- @select-all="handleSelectAll1"
- >
+ <el-table ref="productTable1" :data="productList1" :fit="true" :row-key="(row) => row.id" border
+ header-row-class-name="header-class" height="90%" highlight-current-row stripe style="width: 98%"
+ tooltip-effect="dark" @select="handleSelectionChange1" @select-all="handleSelectAll1">
<el-table-column type="selection" width="50"> </el-table-column>
- <el-table-column
- label="浜у搧"
- min-width="100"
- prop="sample"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="鍨嬪彿"
- min-width="100"
- prop="model"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="妫�楠岄」鍒嗙被"
- min-width="140"
- prop="inspectionItemClass"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- column-key="inspectionItem"
- label="妫�楠岄」"
- min-width="140"
- prop="inspectionItem"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- column-key="inspectionItemSubclass"
- label="妫�楠岄」瀛愰」"
- min-width="140"
- prop="inspectionItemSubclass"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="瑕佹眰鍊�"
- min-width="200px"
- prop="ask"
- ></el-table-column>
- <el-table-column
- label="瑕佹眰鎻忚堪"
- min-width="220px"
- prop="tell"
- ></el-table-column>
+ <el-table-column label="浜у搧" min-width="100" prop="sample" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鍨嬪彿" min-width="100" prop="model" show-overflow-tooltip></el-table-column>
+ <el-table-column label="妫�楠岄」鍒嗙被" min-width="140" prop="inspectionItemClass"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column column-key="inspectionItem" label="妫�楠岄」" min-width="140" prop="inspectionItem"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column column-key="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140"
+ prop="inspectionItemSubclass" show-overflow-tooltip></el-table-column>
+ <el-table-column label="瑕佹眰鍊�" min-width="200px" prop="ask"></el-table-column>
+ <el-table-column label="瑕佹眰鎻忚堪" min-width="220px" prop="tell"></el-table-column>
</el-table>
</div>
<div v-loading="productTableLoading0" style="width: 50%">
<div>褰撳墠妫�楠岄」</div>
- <el-table
- ref="productTable0"
- :data="productList0"
- :fit="true"
- :row-key="(row) => row.id"
- border
- header-row-class-name="header-class"
- height="90%"
- highlight-current-row
- stripe
- style="width: 98%"
- tooltip-effect="dark"
- @select="handleSelectionChange0"
- @select-all="handleSelectAll0"
- >
+ <el-table ref="productTable0" :data="productList0" :fit="true" :row-key="(row) => row.id" border
+ header-row-class-name="header-class" height="90%" highlight-current-row stripe style="width: 98%"
+ tooltip-effect="dark" @select="handleSelectionChange0" @select-all="handleSelectAll0">
<el-table-column type="selection" width="50"> </el-table-column>
- <el-table-column
- label="浜у搧"
- min-width="100"
- prop="sample"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="鍨嬪彿"
- min-width="100"
- prop="model"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="妫�楠岄」鍒嗙被"
- min-width="140"
- prop="inspectionItemClass"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- column-key="inspectionItem"
- label="妫�楠岄」"
- min-width="140"
- prop="inspectionItem"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- column-key="inspectionItemSubclass"
- label="妫�楠岄」瀛愰」"
- min-width="140"
- prop="inspectionItemSubclass"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="瑕佹眰鍊�"
- min-width="200px"
- prop="ask"
- ></el-table-column>
- <el-table-column
- label="瑕佹眰鎻忚堪"
- min-width="220px"
- prop="tell"
- ></el-table-column>
+ <el-table-column label="浜у搧" min-width="100" prop="sample" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鍨嬪彿" min-width="100" prop="model" show-overflow-tooltip></el-table-column>
+ <el-table-column label="妫�楠岄」鍒嗙被" min-width="140" prop="inspectionItemClass"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column column-key="inspectionItem" label="妫�楠岄」" min-width="140" prop="inspectionItem"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column column-key="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140"
+ prop="inspectionItemSubclass" show-overflow-tooltip></el-table-column>
+ <el-table-column label="瑕佹眰鍊�" min-width="200px" prop="ask"></el-table-column>
+ <el-table-column label="瑕佹眰鎻忚堪" min-width="220px" prop="tell"></el-table-column>
</el-table>
</div>
</div>
</el-dialog>
- <el-dialog
- :visible.sync="selectStandardTree"
- title="閫夋嫨鏍峰搧"
- width="500px"
- >
- <div
- v-if="selectStandardTree"
- v-loading="selectStandardTreeLoading"
- class="body"
- style="height: 60vh; overflow-y: auto; user-select: none"
- >
+ <el-dialog :visible.sync="selectStandardTree" title="閫夋嫨鏍峰搧" width="500px">
+ <div v-if="selectStandardTree" v-loading="selectStandardTreeLoading" class="body"
+ style="height: 60vh; overflow-y: auto; user-select: none">
<el-row>
<el-col :span="24">
- <el-input
- v-model="search"
- clearable
- placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�"
- size="small"
- style="margin-bottom: 5px"
- suffix-icon="el-icon-search"
- @blur="searchFilter"
- @clear="searchFilter"
- @keyup.enter.native="searchFilter"
- ></el-input>
+ <el-input v-model="search" clearable placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�" size="small" style="margin-bottom: 5px"
+ suffix-icon="el-icon-search" @blur="searchFilter" @clear="searchFilter"
+ @keyup.enter.native="searchFilter"></el-input>
</el-col>
</el-row>
- <el-tree
- ref="tree"
- :data="list"
- :default-expanded-keys="expandedKeys"
- :filter-node-method="filterNode"
- :props="{ children: 'children', label: 'label' }"
- highlight-current
- node-key="label"
- @node-click="handleNodeClick"
- @node-expand="nodeOpen"
- @node-collapse="nodeClose"
- >
+ <el-tree ref="tree" :data="list" :default-expanded-keys="expandedKeys" :filter-node-method="filterNode"
+ :props="{ children: 'children', label: 'label' }" highlight-current node-key="label"
+ @node-click="handleNodeClick" @node-expand="nodeOpen" @node-collapse="nodeClose">
<div slot-scope="{ node, data }" class="custom-tree-node">
<el-row>
<el-col :span="24">
- <span
- ><i
- :class="`node_i ${
- data.children != undefined
- ? data.code === '[1]'
- ? 'el-icon-folder-opened'
- : 'el-icon-folder'
- : 'el-icon-tickets'
- }`"
- ></i>
- {{ data.code }} {{ data.label }}</span
- >
+ <span><i :class="`node_i ${data.children != undefined
+ ? data.code === '[1]'
+ ? 'el-icon-folder-opened'
+ : 'el-icon-folder'
+ : 'el-icon-tickets'
+ }`"></i>
+ {{ data.code }} {{ data.label }}</span>
</el-col>
</el-row>
</div>
@@ -250,196 +101,91 @@
</el-dialog>
<el-dialog :visible.sync="compareDia" title="纭澶嶅埗淇℃伅" width="80%">
<div style="width: 100%">
- <el-table
- ref="compareList"
- :data="compareList"
- :fit="true"
- :row-key="(row) => row.id"
- border
- header-row-class-name="header-class"
- height="90%"
- highlight-current-row
- stripe
- style="width: 98%"
- tooltip-effect="dark"
- >
- <el-table-column
- label="浜у搧"
- min-width="100"
- prop="sample"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="鍨嬪彿"
- min-width="100"
- prop="model"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- label="妫�楠岄」鍒嗙被"
- min-width="140"
- prop="inspectionItemClass"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- column-key="inspectionItem"
- label="妫�楠岄」"
- min-width="140"
- prop="inspectionItem"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- column-key="inspectionItemSubclass"
- label="妫�楠岄」瀛愰」"
- min-width="140"
- prop="inspectionItemSubclass"
- show-overflow-tooltip
- ></el-table-column>
+ <el-table ref="compareList" :data="compareList" :fit="true" :row-key="(row) => row.id" border
+ header-row-class-name="header-class" height="90%" highlight-current-row stripe style="width: 98%"
+ tooltip-effect="dark">
+ <el-table-column label="浜у搧" min-width="100" prop="sample" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鍨嬪彿" min-width="100" prop="model" show-overflow-tooltip></el-table-column>
+ <el-table-column label="妫�楠岄」鍒嗙被" min-width="140" prop="inspectionItemClass"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column column-key="inspectionItem" label="妫�楠岄」" min-width="140" prop="inspectionItem"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column column-key="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140"
+ prop="inspectionItemSubclass" show-overflow-tooltip></el-table-column>
<el-table-column label="瑕佹眰鍊�" min-width="200px" prop="ask">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.ask"
- :autosize="{ minRows: 1, maxRows: 3 }"
- clearable
- placeholder="瑕佹眰鍊�"
- size="small"
- type="textarea"
- ></el-input>
+ <el-input v-model="scope.row.ask" :autosize="{ minRows: 1, maxRows: 3 }" clearable placeholder="瑕佹眰鍊�"
+ size="small" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column label="瑕佹眰鎻忚堪" min-width="220px" prop="tell">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.tell"
- :autosize="{ minRows: 1, maxRows: 3 }"
- clearable
- placeholder="瑕佹眰鎻忚堪"
- size="small"
- type="textarea"
- ></el-input>
+ <el-input v-model="scope.row.tell" :autosize="{ minRows: 1, maxRows: 3 }" clearable placeholder="瑕佹眰鎻忚堪"
+ size="small" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" prop="section" width="160">
<template slot-scope="scope">
- <el-button type="text" @click="sectionUp(scope.row)"
- >鍖洪棿璁剧疆</el-button
- >
+ <el-button type="text" @click="sectionUp(scope.row)">鍖洪棿璁剧疆</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="compareDia = false">鍙� 娑�</el-button>
- <el-button
- :loading="handleCompareLoading"
- size="small"
- type="primary"
- @click="handleCompare"
- >纭� 瀹�</el-button
- >
+ <el-button :loading="handleCompareLoading" size="small" type="primary" @click="handleCompare">纭� 瀹�</el-button>
</span>
</div>
</el-dialog>
- <el-dialog
- :close-on-click-modal="false"
- :visible.sync="sectionUpDia"
- title="鍖洪棿璁剧疆"
- width="80%"
- >
+ <el-dialog :close-on-click-modal="false" :visible.sync="sectionUpDia" title="鍖洪棿璁剧疆" width="80%">
<div class="body" style="padding: 5px 0">
<el-table :data="sectionList" border height="350px" style="width: 100%">
<el-table-column align="center" label="搴忓彿" type="index" width="70">
</el-table-column>
<el-table-column align="center" label="鍖洪棿">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.thing"
- clearable
- placeholder="鍖洪棿"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.thing" clearable placeholder="鍖洪棿" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="鑺暟">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.cores"
- clearable
- placeholder="鑺暟"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.cores" clearable placeholder="鑺暟" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="瑕佹眰鍊�">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.ask"
- clearable
- placeholder="瑕佹眰鍊�"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.ask" clearable placeholder="瑕佹眰鍊�" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="瑕佹眰鎻忚堪">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.tell"
- :autosize="{ minRows: 1, maxRows: 2 }"
- clearable
- placeholder="瑕佹眰鎻忚堪"
- size="small"
- type="textarea"
- ></el-input>
+ <el-input v-model="scope.row.tell" :autosize="{ minRows: 1, maxRows: 2 }" clearable placeholder="瑕佹眰鎻忚堪"
+ size="small" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="瀵间綋鏉愯川">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.conductorMaterial"
- clearable
- placeholder="瀵间綋鏉愯川"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.conductorMaterial" clearable placeholder="瀵间綋鏉愯川" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="瀵间綋绫诲瀷">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.conductorType"
- clearable
- placeholder="瀵间綋绫诲瀷"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.conductorType" clearable placeholder="瀵间綋绫诲瀷" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="鍗曚环" width="120">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.price"
- clearable
- placeholder="鍗曚环"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.price" clearable placeholder="鍗曚环" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="宸ユ椂绯绘暟" width="120">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.manHour"
- clearable
- placeholder="宸ユ椂绯绘暟"
- size="small"
- ></el-input>
+ <el-input v-model="scope.row.manHour" clearable placeholder="宸ユ椂绯绘暟" size="small"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="鎿嶄綔" width="70">
<template slot-scope="scope">
- <el-button
- circle
- icon="el-icon-minus"
- size="mini"
- type="danger"
- @click="sectionList.splice(scope.$index, 1)"
- ></el-button>
+ <el-button circle icon="el-icon-minus" size="mini" type="danger"
+ @click="sectionList.splice(scope.$index, 1)"></el-button>
</template>
</el-table-column>
</el-table>
@@ -447,11 +193,8 @@
<span slot="footer" class="dialog-footer">
<el-button @click="sectionUpDia = false">鍙� 娑�</el-button>
<el-button type="primary" @click="sectionLoadAdd">淇� 瀛�</el-button>
- <el-button
- icon="el-icon-plus"
- type="primary"
- @click="sectionList.push({ thing: '', price: '', manHour: '' })"
- ></el-button>
+ <el-button icon="el-icon-plus" type="primary"
+ @click="sectionList.push({ thing: '', price: '', manHour: '' })"></el-button>
</span>
</el-dialog>
</div>
@@ -459,7 +202,7 @@
<script>
import {
- selectStandardProductListByMethodId,
+ buildStandardProductListNoDrag,
copyStandardProductSort,
copyStandardProductOne,
copyStandardProductList,
@@ -520,7 +263,7 @@
getList() {
this.batchCopyDia = true;
this.productTableLoading0 = true;
- selectStandardProductListByMethodId({
+ buildStandardProductListNoDrag({
id: this.standardId,
tree: this.selectTree1,
page: 1,
@@ -559,6 +302,7 @@
oldStandardProductList: this.oldStandardProductList,
newStandardProductList: this.newStandardProductList,
};
+
// 璋冨彇姣旇緝宸﹀彸瑕佹眰鍊肩殑鎺ュ彛
copyStandardProductList(params).then((res) => {
this.compareDia = true;
@@ -714,17 +458,15 @@
let data = this.selectTree.split(" - ");
let data2 = "";
for (let index = data.length - 1; index >= 0; index--) {
- data2 += " - " + data[index];
+ if (data[index] && data[index] !== 'null') {
+ data2 += " - " + data[index];
+ }
}
this.selectTree = data2.replace(" - ", "");
},
getNodeParent(val) {
if (val.parent != null) {
- if (val.data.children === null) {
- this.selectTree += " - " + val.label + " - " + "null";
- } else {
- this.selectTree += " - " + val.label;
- }
+ this.selectTree += " - " + val.label;
this.getNodeParent(val.parent);
}
},
@@ -734,7 +476,7 @@
},
getRightList() {
this.productTableLoading1 = true;
- selectStandardProductListByMethodId({
+ buildStandardProductListNoDrag({
id: this.standardMethodListId,
tree: this.selectTree,
page: 1,
@@ -771,7 +513,7 @@
} else {
this.methods = res.data.standardMethodList;
}
- } catch (e) {}
+ } catch (e) { }
});
},
activeStandardTree() {
@@ -785,6 +527,9 @@
} else {
this.sample = trees[3];
}
+ this.standardMethodListId = null;
+ this.productList1 = [];
+ this.methods = [];
this.selectStandardTree = false;
},
handleSelectionChange0(val) {
@@ -846,10 +591,12 @@
.search_input {
width: calc(100% - 80px);
}
+
.node_i {
color: orange;
font-size: 18px;
}
+
.dialog-footer {
display: flex;
justify-content: flex-end;
--
Gitblit v1.9.3