From 352ad5d8f7957bc7f84baf4ce4d8518619864b6e Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期五, 18 八月 2023 11:55:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/components/view/standard.vue | 74 ++++++++++++++++++++++++++++++-------
1 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index 0ee0fae..3a9c15a 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -12,7 +12,7 @@
margin-bottom: 10px;
padding: 0 20px;
}
-
+
.standard .title *{
font-size: 16px;
}
@@ -89,7 +89,7 @@
.standard .title .el-button * {
font-size: 14px;
}
-
+
.standard .title .el-button--default{
color: #004EA2;
}
@@ -111,7 +111,7 @@
<el-row>
<el-col :span="12" style="line-height: 32px;">鏍囧噯BOM</el-col>
<el-col :span="12" style="text-align: right;">
- <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;">鏂板</el-button>
+ <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;" @click="bomAddModelVisible= true">鏂板</el-button>
<el-button icon="el-icon-edit-outline">淇敼</el-button>
<el-button icon="el-icon-delete">鍒犻櫎</el-button>
</el-col>
@@ -136,18 +136,32 @@
<div class="choose">
<span>绫诲瀷锛�</span>
<el-select v-model="tableType" size="small" placeholder="璇烽�夋嫨" style="width: 224px;margin-right: 52px;">
- <el-option value="宸ヨ壓鏂囦欢"></el-option>
- <el-option value="鎶�鏈寚鏍�"></el-option>
+ <el-option :value="0" label="宸ヨ壓鏂囦欢"></el-option>
+ <el-option :value="1" label="鎶�鏈寚鏍�"></el-option>
</el-select>
- <span>{{tableType=='鎶�鏈寚鏍�'?'椤圭洰锛�':'宸ヨ壓鍚嶇О锛�'}}</span>
+ <span>{{tableType==1?'椤圭洰锛�':'宸ヨ壓鍚嶇О锛�'}}</span>
<el-input v-model="searchName" size="small" placeholder="璇疯緭鍏�" style="width: 224px;margin-right: 24px;" clearable></el-input>
- <el-button size="mini"><span>閲� 缃�</span></el-button>
- <el-button size="mini" type="primary" style="background: #004EA2;"><span>鏌� 璇�</span></el-button>
+ <el-button size="mini" @click="()=>{searchName='';selectProductTableData()}"><span>閲� 缃�</span></el-button>
+ <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectProductTableData"><span>鏌� 璇�</span></el-button>
</div>
<div class="table">
- <technology></technology>
+ <technology v-if="tableData.length!==0" :tableType="tableType" :tableData="tableData"></technology>
</div>
</div>
+ </div>
+ <div class="bom-add-model">
+ <el-dialog
+ title="BOM鏂板"
+ :visible.sync="bomAddModelVisible"
+ width="30%">
+ <el-form>
+
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="bomAddModelVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="bomAddModelVisible = false">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
</div>
</div>
</template>
@@ -158,6 +172,7 @@
components: {technology},
data() {
return {
+ // BOM鏍戞暟鎹粨鏋�
list: [{
id: 0,
name: "鍘熸潗鏂�",
@@ -175,13 +190,23 @@
children: []
}],
search: null,
- tableType: "鎶�鏈寚鏍�",
- searchName: ""
+ // 琛ㄦ牸绫诲瀷 1锛氭妧鏈寚鏍囷紝0锛氬伐鑹鸿矾绾�
+ tableType: 1,
+ // 鏌ヨ鏉′欢-鍚嶇О
+ searchName: "",
+ // 鐐瑰嚮閫変腑鏍戣妭鐐�
+ checkTreeNode: {},
+ tableData:[],
+ // 鎺у埗bom鏂板妯℃�佹鏄惁鏄剧ず
+ bomAddModelVisible: false
}
},
watch: {
search(val) {
this.$refs.tree.filter(val);
+ },
+ tableType(val){
+ this.selectProductTableData()
}
},
mounted() {
@@ -189,7 +214,9 @@
},
methods: {
handleNodeClick(data) {
- console.log(data);
+ this.checkTreeNode = data
+ // this.selectMaterialTree()
+ this.selectProductTableData()
},
filterNode(value, data) {
if (!value) return true;
@@ -221,10 +248,29 @@
this.$nextTick().then(() => {
const firstNode = document.querySelector('.el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node')
firstNode.click()
- // console.log(firstNode)
})
})
-
+
+ },
+ async selectProductTableData() {
+ switch (this.tableType) {
+ case 0:
+ const {data:technologyList} = await this.$axios.get(this.$api.url.selectTechnologyByMaterial,{params:{specificationId:this.checkTreeNode.id,technologyName:this.searchName}})
+ this.tableData = technologyList
+ break;
+ case 1:
+ const {data:productList} = await this.$axios.get(this.$api.url.selectProductByMaterial,{params:{specifications:this.checkTreeNode.id,project:this.searchName}})
+ productList.forEach((item,index)=>{
+ item.name = item.father
+ item.index = index+1
+ item.id = item.father
+ if(item.children.length===1){
+ productList[index] = {...item.children[0],index: index+1,name:item.father}
+ }
+ })
+ this.tableData = productList
+ break;
+ }
}
}
}
--
Gitblit v1.9.3