Преглед изворни кода

Merge branch 'blueBranch' into allTestUrgent

qymljy пре 4 месеци
родитељ
комит
b8d46355cc

+ 3 - 36
src/HDrpManagement/contractManage/components/productClassList/addProduct.vue

@@ -16,41 +16,6 @@
             >
             <el-input size="small" style="width:200px;margin-bottom:10px" v-model="params.content.where.condition" :placeholder="`${$t(`编号`)}、${$t(`类别名称`)}、${$t(`品牌`)}`" @clear="getProductList(params.content.pageNumber = 1)" @keyup.native.enter="getProductList(params.content.pageNumber = 1)" clearable></el-input>
           </div>
-<!--          <Table :checkbox="true"  height="calc(100vh - 220px)" @selectionChange="selectArr" ref="table" id="itemclassid"  v-model="itemno" :layout="tablecols" :data="productList" :custom="true"   @upDateData="upDateData">-->
-<!--            <template v-slot:customcol="scope">-->
-<!--              <div v-if="scope.column.columnname == 'attinfos'">-->
-<!--                <previewImage-->
-<!--                    v-if="scope.column.data.attinfos[0]"-->
-<!--                    style="width:38px;height:38px;margin:0px"-->
-<!--                    class="image"-->
-<!--                    :image="scope.column.data.attinfos[0]"-->
-<!--                    :list="scope.column.data.attinfos"-->
-<!--                    :deletebtn="false"-->
-<!--                ></previewImage>-->
-<!--              </div>-->
-<!--              <div v-else-if="scope.column.columnname == 'brand'">-->
-<!--                {{scope.column.data[scope.column.columnname][0] ? $t(scope.column.data[scope.column.columnname])[0].brandname : '&#45;&#45;'}}-->
-<!--              </div>-->
-<!--              <div v-else>{{$t(scope.column.data[scope.column.columnname])}}</div>-->
-<!--              <span v-if="!scope.column.data[scope.column.columnname] && scope.column.data[scope.column.columnname] !== 0 && scope.column.columnname != 'operation'">&#45;&#45;</span>-->
-<!--            </template>-->
-<!--            <template v-slot:opreation="scope">-->
-<!--              <el-button type="text" size="mini" @click="addProduct(scope.data)">{{$t('添 加')}}</el-button>-->
-<!--            </template>-->
-<!--          </Table>-->
-<!--          <div style="display:flex;justify-content:space-between;align-items:center;margin-top:10px">-->
-<!--            &lt;!&ndash;            <el-pagination-->
-<!--                            style="display:inline-block"-->
-<!--                            background-->
-<!--                            small-->
-<!--                            @size-change="handleSizeChange"-->
-<!--                            @current-change="handleCurrentChange"-->
-<!--                            :current-page="params.content.pageNumber"-->
-<!--                            :page-sizes="[20, 50, 100, 200]"-->
-<!--                            layout="total, prev, pager, next, jumper"-->
-<!--                            :total="total">-->
-<!--                        </el-pagination>&ndash;&gt;-->
-<!--          </div>-->
           <treeTable ref="treeRef" :table-data="productList" @rowSelect="rowSelect"></treeTable>
         </div>
 
@@ -136,7 +101,9 @@ export default {
     async getProductList () {
       this.params.content.sa_contractid = this.$route.query.id
       let res = await this.$api.requested(this.params)
+      this.productList = res.data
       this.productList = this.createMenu(res.data);
+      console.log(this.productList,'productList')
       this.total = res.total
       // this.params.content.pageNumber = res.pageNumber
       // console.log(this)
@@ -151,7 +118,6 @@ export default {
           itemclassname: node["itemclassname"],
           itemclassnum:node["itemclassnum"],
           brandname:node["brandname"],
-          num:node["num"],
           isCheck:node["isCheck"],
           itemclassid:node['itemclassid'],
           selected:false,
@@ -164,6 +130,7 @@ export default {
             elNode.children.push(convertToElementTree(node.subitemclass[index]));
           }
         }
+        console.log(elNode,'elNode数据输出')
         return elNode;
       }
       array.forEach((element) => {

+ 9 - 14
src/components/treeTable/index.vue

@@ -8,23 +8,13 @@
         default-expand-all
         size="small"
         :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
-      <el-table-column
-          width="35">
-      </el-table-column>
-      <el-table-column width="35">
-        <template #header>
-          <span></span>
-        </template>
-        <template #default="{ row }">
-          <el-checkbox v-model="row.selected" :checked="row.selected" @change="onRowSelect(row)" :disabled="row.disabled"></el-checkbox>
-        </template>
-      </el-table-column>
       <el-table-column
           prop="itemclassname"
           show-overflow-tooltip
           :label="$t(`类别名称`)"
-          width="200">
+          width="300">
         <template slot-scope="scope">
+          <el-checkbox v-model="scope.row.selected" :checked="scope.row.selected" @change="onRowSelect(scope.row)" :disabled="scope.row.disabled" style="margin-right: 5px"></el-checkbox>
           <span style="color:#3874f6"><b>{{scope.row.itemclassname}}</b></span>
         </template>
       </el-table-column>
@@ -40,6 +30,11 @@
 export default {
   name: "index",
   props:["tableData"],
+  data(){
+    return {
+
+    }
+  },
   methods:{
     onRowSelect(row){
       this.$emit('rowSelect',row)
@@ -52,8 +47,8 @@ export default {
         })
       })
       this.$refs.table.clearSelection()
-    }
-  }
+    },
+  },
 }
 </script>