From 24d7230413bd1f09d228412489fc5e41a4695e5e Mon Sep 17 00:00:00 2001
From: hailin <1356886193@qq.com>
Date: 星期四, 27 七月 2023 09:47:04 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/yuanchu_code/lims-front-end

---
 src/views/rawMaterials/reportForInspection/forInspectionDetail.vue |  138 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 136 insertions(+), 2 deletions(-)

diff --git a/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue b/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue
index 6e833d1..a032887 100644
--- a/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue
+++ b/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue
@@ -129,7 +129,7 @@
       <div class="demo-drawer__content">
         <el-form label-position="top" label-width="120px" :model="addSampleFrom">
           <el-form-item>
-            <el-button type="primary">閫夋嫨鐗╂枡</el-button>
+            <el-button type="primary" @click="chooseMaterialVisible = true">閫夋嫨鐗╂枡</el-button>
           </el-form-item>
           <div class="materialParams-card">
             <el-row class="materialParams-top">
@@ -238,6 +238,48 @@
         </el-form>
       </div>
     </el-drawer>
+    <el-dialog title="閫夋嫨鐗╂枡" :visible.sync="chooseMaterialVisible">
+      <div class="dialog-content">
+        <!-- Left side tree structure -->
+        <div class="tree-container">
+          <span class="all"> 鍏ㄩ儴</span>
+          <el-tree :data="treeData" @node-click="handleNodeClick" ></el-tree>
+        </div>
+        <!-- Right side material list -->
+        <div class="table-container">
+          <el-table
+            ref="todoListRef"
+            :data="selectedNodeMaterials"
+            style="width: 100%"
+            highlight-current-row
+            @row-click="handleSelectionChange"
+            :header-row-class-name="headerBg"
+            >
+            <el-table-column
+              label="鐗╂枡缂栧彿"
+              prop="number">
+              <template slot-scope="scope">
+                <el-radio v-model="radioSelected" :label="scope.row.number" @change.native='handleSelectionChange(scope.row)'>&nbsp;  </el-radio>
+              </template>
+            </el-table-column>
+            <el-table-column prop="name" label="鐗╂枡鍚嶇О"></el-table-column>
+        </el-table>
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="pageParams.pageNo"
+          :page-sizes="[10, 20, 30, 40]"
+          :page-size="pageParams.pageSize"
+          :total="pageParams.total"
+          layout="total, sizes, prev, pager, next, jumper"
+        />
+      </div>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="chooseMaterialVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" >纭畾閫夋嫨</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -252,14 +294,106 @@
         total: 3
       },
       addSampleVisible: false,
+      chooseMaterialVisible: false,
       direction: 'rtl',
-      addSampleFrom: {}
+      addSampleFrom: {},
+      treeData: [{
+        id: 1,
+        label: '涓�绾� 1',
+        children: [{
+          id: 4,
+          label: '浜岀骇 1-1',
+          children: [{
+            id: 9,
+            label: '涓夌骇 1-1-1'
+          }, {
+            id: 10,
+            label: '涓夌骇 1-1-2'
+          }]
+        }]
+      }, {
+        id: 2,
+        label: '涓�绾� 2',
+        children: [{
+          id: 4,
+          label: '浜岀骇 2-1',
+          children: [{
+            id: 9,
+            label: '涓夌骇 2-1-1'
+          }, {
+            id: 10,
+            label: '涓夌骇 2-1-2'
+          }]
+        }]
+
+      }],
+      selectedNodeMaterials: [
+        {
+          number: '12345',
+          name: '娴嬭瘯鏁版嵁1'
+        },
+        {
+          number: 'Y111111',
+          name: '娴嬭瘯鏁版嵁2'
+        }],
+      radioSelected: null,
+      multipleSelection: ''
+    }
+  },
+  methods: {
+    handleSelectionChange(val) {
+      console.log(val)
+      this.radioSelected = val.number // 閫変腑琛岀殑number
+      this.multipleSelection = val // 閫変腑鐨勪竴琛屾暟鎹�
+    },
+    handleSizeChange(pageSize) {
+      this.pageParams.pageSize = pageSize
+    },
+    handleCurrentChange(pageNo) {
+      this.pageParams.pageNo = pageNo
+    },
+    headerBg({ row, rowIndex }) {
+      console.log('rowIndex', rowIndex)
+      if (rowIndex === 0) {
+        return 'headerBgClass'
+      }
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.dialog-content{
+  display: flex;
+  .tree-container{
+    flex: 30%;
+    // background-color: #bfa;
+    margin-right: 12px;
+    margin-left: 12px;
+    .all{
+      display: block;
+      color: #0077DB;
+      padding: 5px;
+    }
+  }
+  .table-container{
+    flex: 70%;
+    // background-color: #0077DB;
+    margin-left: 12px;
+    .el-table{
+      .el-table__header_wrapper{
+        .has-gutter{
+          .headerBgClass{
+            background-color: #606266;
+          }
+        }
+      }
+    }
+    .el-pagination{
+      margin-top: 12px;
+    }
+  }
+}
 .forInspectionDetail-main{
     min-height: calc(100vh - 88px);
     display: flex;

--
Gitblit v1.9.3