From c06d6952c55a5b34b08527c9f61117afd0b6e97a Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期五, 08 九月 2023 17:13:41 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before --- src/components/view/standard.vue | 98 ++++++++++++++++++++++-------------------------- 1 files changed, 45 insertions(+), 53 deletions(-) diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue index 731daef..0d1f689 100644 --- a/src/components/view/standard.vue +++ b/src/components/view/standard.vue @@ -42,7 +42,7 @@ <span>{{ tableType == 1 ? '椤圭洰锛�' : '宸ヨ壓鍚嶇О锛�' }}</span> <el-input v-model="searchName" size="small" placeholder="璇疯緭鍏�" style="width: 224px;margin-right: 24px;" clearable></el-input> - <span>{{ tableType == 1 ? '鐗堟湰锛�' : '宸ヨ壓鍚嶇О锛�' }}</span> + <span>{{ tableType == 1 ? '鐗堟湰锛�' : '鐗堟湰锛�' }}</span> <el-select v-model="VER" @change="verevent" style="width: 280px;" placeholder="璇烽�夋嫨"> <el-option v-for="item in version" :key="item" :label="item" :value="item"> </el-option> @@ -52,40 +52,24 @@ 璇�</span></el-button> </div> - <div> - <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="name" border - @selection-change="handleSelectionChange" default-expand-all - :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> - <el-table-column type="selection" width="55"> - </el-table-column> - <el-table-column type="index" width="50" label="搴忓彿"> - </el-table-column> - <el-table-column prop="name" label="宸ュ簭" sortable width="300px"> - <!-- <template slot-scope="scope"> - <el-tag> - <div class="firstDiv" :style="`color: ${scope.row.children? '#16a7ff' : '#58c173'}`"> - {{ scope.row.children ? "01" : "02" }} - </div> - </el-tag> - <span style="color: black">{{ scope.row.name }}</span> - - </template> --> - </el-table-column> - <el-table-column prop="" sortable label="宸ヨ壓鍚嶇О"> - </el-table-column> - <el-table-column prop="" label="鎸囨爣鍚嶇О"> - </el-table-column> - <el-table-column prop="" label="鍗曚綅"> - </el-table-column> - <el-table-column prop="" label="鍐呮帶鍊�"> - </el-table-column> - <el-table-column prop="unit" label="鏍囧噯鍊�"> - </el-table-column> - </el-table> + <div v-if="this.typeselect == 0"> + <technology :tableType="tableType" :tableData="tableData"></technology> </div> - <div class="table"> + <div v-if="this.typeselect == 1"> + 鎶�鏈寚鏍� + </div> + <div v-if="this.typeselect == 2"> + <material :tableType="tableType" :tableData="tableData"></material> + </div> + <div v-if="this.typeselect == 3"> + 鐢熶骇宸ヨ壓 + </div> + <!-- <div class="table"> <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology> - </div> + </div> --> + <!-- <div class="table"> + <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology> + </div> --> </div> </div> @@ -93,7 +77,7 @@ <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> @@ -106,8 +90,10 @@ <script> import technology from "./standard-table/technology.vue" +import material from "./standard-table/material.vue" export default { - components: { technology }, + components: { technology,material }, + data() { return { // BOM鏍戞暟鎹粨鏋� @@ -119,12 +105,14 @@ tableData: [], bomAddModelVisible: false,// 鎺у埗bom鏂板妯℃�佹鏄惁鏄剧ず list: [], - typeselect: {}, - returntree: {}, + typeselect: 0, + returntree: { + id:28, + }, version: {}, VER: {}, verdata: {}, - character: '', + character: 0, } }, // watch: { @@ -137,6 +125,8 @@ // }, mounted() { this.selectMaterialTree() + this.selectAll() + this.selectVersion() }, methods: { handleSelectionChange() { @@ -145,14 +135,15 @@ TYPE(val) {//绫诲瀷.鏁版嵁 console.log(val); this.typeselect = val - console.log(this.typeselect); + + // console.log(this.typeselect); this.selectVersion() }, handleNodeClick(val) {//鏍戠殑鍊� console.log(val); this.returntree = val }, - selectVersion() { + selectVersion() {//鐗堟湰 this.$axios.get(this.$api.url.selectVersion, { params: { specificationsId: this.returntree.id, @@ -166,6 +157,20 @@ console.log(this.verdata); }) }, + //鍙充晶鏁版嵁 + selectAll() { + console.log(this.$axios.get(this.$api.url.selectAll)); + this.$axios.get(this.$api.url.selectAll, { + params: { + specificationsId: this.returntree.id,//tree鐨勭偣鍑诲弽棣� + type: this.typeselect,//绫诲瀷 + version: this.character,//鐗堟湰 + } + }).then(res => { + console.log(res.data); + this.tableData = res.data + }) + }, verevent(val) { console.log(val); let cc = val.replace('v', '') @@ -175,19 +180,6 @@ // const { v, ...newObj } = val; // delete newObj.v // console.log(newObj); - }, - //鍙充晶鏁版嵁 - selectAll() { - console.log(this.$axios.get(this.$api.url.selectAll)); - this.$axios.get(this.$api.url.selectAll, { - params: { - specificationsId: this.returntree.id, - type: this.typeselect, - version: this.character, - } - }).then(res => { - this.tableData = res.data - }) }, //浜旂骇鏍� selectMaterialTree() { -- Gitblit v1.9.3