From 0d452c10ee16e40a3ca3d176e5ebebcb4bd16a87 Mon Sep 17 00:00:00 2001 From: yuyu <1981343953@qq.com> Date: 星期二, 08 八月 2023 14:36:23 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/yuanchu_code/lims-front-end --- src/views/rawMaterials/reportForInspection/forInspectionDetail.vue | 217 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 188 insertions(+), 29 deletions(-) diff --git a/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue b/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue index 6e833d1..28d5f75 100644 --- a/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue +++ b/src/views/rawMaterials/reportForInspection/forInspectionDetail.vue @@ -26,14 +26,18 @@ </div> --> </div> <div class="message"> - <div class="message-item"><span><i class="el-icon-edit" />璇曢獙鏂规硶锛�</span></div> + <!-- <div class="message-item"><span><i class="el-icon-edit" />璇曢獙鏂规硶锛�</span></div> --> <div class="message-item"> - <span><i class="el-icon-edit" />椤圭洰鍒嗙被锛�</span> + <span><i class="el-icon-edit" />妫�楠岀被鍨嬶細 + <span v-if="inspectionDetail.type===0">鍘熸潗鏂欐楠�</span> + <span v-else-if="inspectionDetail.type===1">鍗婃垚鍝佹楠�</span> + <span v-else-if="inspectionDetail.type===2">鎴愬搧妫�楠�</span> + </span> </div> <div class="message-item"> - <span><i class="el-icon-edit" />鏇存柊浜猴細</span></div> + <span><i class="el-icon-edit" />鐧昏浜猴細<el-tag>{{ inspectionDetail.userName }}</el-tag></span></div> <div class="message-item"> - <span><i class="el-icon-edit" />鏇存柊鏃堕棿锛�</span></div> + <span><i class="el-icon-edit" />鐧昏鏃ユ湡锛歿{ inspectionDetail.createTime }}</span></div> </div> </div> <div class="card-main sample-list"> @@ -57,53 +61,58 @@ style="width: 100%" > <el-table-column - prop="applicationOrdernumber" - label="鐢宠鍗曞彿" + prop="materialNum" + label="鐗╂枡缂栧彿" min-width="200" /> <el-table-column - prop="typeofInspection" - label="妫�楠岀被鍨�" + prop="materialName" + label="鐗╂枡鍚嶇О" min-width="200" /> <el-table-column prop="objectofInspection" - label="妫�楠屽璞�" + label="鐗╂枡灞炴��" min-width="200" /> <el-table-column - prop="palceofObject" - label="瀵硅薄浣嶇疆" + prop="materialBatch" + label="鎵规" min-width="200" /> <el-table-column - prop="name" - label="瀵硅薄鍚嶇О" + prop="materialReelNumber" + label="鐩樺彿" min-width="200" /> <el-table-column - prop="date" - label="鐧昏鏃ユ湡" + prop="specificationsSerialNumber" + label="鍨嬪彿" min-width="200" /> <el-table-column prop="registrant" - label="鐧昏浜�" + label="瑙勬牸" min-width="200" /> <el-table-column prop="applicationTime" - label="鐢宠鏃堕棿" + label="鍏ュ簱鏁伴噺" + min-width="200" + /> + <el-table-column + prop="materialNum" + label="閫佹牱鏁伴噺" min-width="200" /> <el-table-column label="鎿嶄綔" min-width="200" - :fixed="true" + fixed="right" > <template slot-scope="scope"> - <el-button type="text" size="small" @click="handleClick(scope.row)">鏌ョ湅</el-button> - <el-button type="text" size="small">浣滃簾</el-button> + <el-button type="text" size="small" @click="openChangeMaterial(scope.row)">缂栬緫</el-button> + <el-button type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -129,7 +138,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"> @@ -165,7 +174,7 @@ </el-col> </el-row> </div> - <el-row gutter="100" :style="{marginTop:'24px'}"> + <el-row :gutter="100" :style="{marginTop:'24px'}"> <el-col :span="12"> <el-form-item label="鎵规"> <el-input placeholder="" /> @@ -177,7 +186,7 @@ </el-form-item> </el-col> </el-row> - <el-row gutter="100"> + <el-row :gutter="100"> <el-col :span="12"> <el-form-item label="鐩樺彿"> <el-input placeholder="" /> @@ -189,7 +198,7 @@ </el-form-item> </el-col> </el-row> - <el-row gutter="100"> + <el-row :gutter="100"> <el-col :span="12"> <el-form-item label="瑙勬牸/鍨嬪彿鍚嶇О"> <el-input placeholder="" /> @@ -201,7 +210,7 @@ </el-form-item> </el-col> </el-row> - <el-row gutter="100"> + <el-row :gutter="100"> <el-col :span="12"> <el-form-item label="鐢熶骇鎸囦护鍙�"> <el-input placeholder="" /> @@ -213,14 +222,14 @@ </el-form-item> </el-col> </el-row> - <el-row gutter="100"> + <el-row :gutter="100"> <el-col :span="12"> <el-form-item label="鐢靛帇绛夌骇"> <el-input placeholder="" /> </el-form-item> </el-col> </el-row> - <el-row gutter="100" :style="{flex:'1'}"> + <el-row :gutter="100" :style="{flex:'1'}"> <el-col :span="24"> <el-form-item label="澶囨敞"> <el-input @@ -232,16 +241,60 @@ </el-col> </el-row> <el-form-item> - <el-button type="primary" @click="onSubmit">绔嬪嵆鍒涘缓</el-button> + <el-button type="primary">绔嬪嵆鍒涘缓</el-button> <el-button>鍙栨秷</el-button> </el-form-item> </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" /> + </div> + <!-- Right side material list --> + <div class="table-container"> + <el-table + ref="todoListRef" + :data="selectedNodeMaterials" + style="width: 100%" + highlight-current-row + :header-row-class-name="headerBg" + @row-click="handleSelectionChange" + > + <el-table-column + label="鐗╂枡缂栧彿" + prop="number" + > + <template slot-scope="scope"> + <el-radio v-model="radioSelected" :label="scope.row.number" @change.native="handleSelectionChange(scope.row)"> </el-radio> + </template> + </el-table-column> + <el-table-column prop="name" label="鐗╂枡鍚嶇О" /> + </el-table> + <el-pagination + :current-page="pageParams.pageNo" + :page-sizes="[10, 20, 30, 40]" + :page-size="pageParams.pageSize" + :total="pageParams.total" + layout="total, sizes, prev, pager, next, jumper" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + /> + </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> <script> +import { getInspectionMaterialListById } from '@/api/rawMaterials/reportForInspection' export default { data() { return { @@ -252,14 +305,120 @@ 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: '', + inspectionDetail: {} + } + }, + created() { + // console.log(this.$route.query) 浼犻�掔殑鐢宠鍗曞璞¤鎯� + this.inspectionDetail = JSON.parse(this.$route.query.inspectionDetail) + this.getMaterialList() + }, + methods: { + openChangeMaterial(row) { + console.log(row) + }, + async getMaterialList() { + const res = await getInspectionMaterialListById({ inspectionId: this.inspectionDetail.id }) + // console.log(res) + this.sampleTable = res.data + }, + 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