From 9b69204868cacae4a67b119a9836be59c537a7ae Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期六, 26 八月 2023 17:30:20 +0800 Subject: [PATCH] 查看详情页 --- src/views/experiment/inspectionApplication/index.vue | 145 ++++++++++++++++++++++++++++-------------------- 1 files changed, 84 insertions(+), 61 deletions(-) diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue index 84990fe..3b08605 100644 --- a/src/views/experiment/inspectionApplication/index.vue +++ b/src/views/experiment/inspectionApplication/index.vue @@ -183,7 +183,7 @@ top="10vh" > <div class="check-box"> - <el-radio-group v-model="type" @change="handleRadioChange"> + <el-radio-group v-model="type" @click.native="handleRadioChange"> <el-radio :style="`background-color: ${type==0?'rgb(170, 236, 214)':'#fff'};border-radius: 10px;`" :label="0" border>鍘熸潗鏂欐楠�</el-radio> <el-radio :style="`background-color: ${type==1?'rgb(170, 236, 214)':'#fff'};border-radius: 10px;`" :label="1" border>濮旀墭妫�楠�</el-radio> <el-radio :style="`background-color: ${type==2?'rgb(170, 236, 214)':'#fff'};border-radius: 10px;`" :label="2" border>鎴愬搧妫�楠�</el-radio> @@ -379,21 +379,21 @@ <el-dialog title="鏍囧噯搴�" :visible.sync="Standardframe" - width="48%" - - > - <!-- <el-form :model="form"> - <el-form-item label="璇烽�夋嫨瀹℃牳缁撴灉:" :label-width="formLabelWidth"> - </el-form-item> - </el-form> --> - - <!-- <div slot="footer" class="dialog-footer"> --> + width="48%"> + <el-card> + <template slot-scope="scope" > + <span>鐗堟湰閫夋嫨锛�</span> + <el-select v-model="commisionTable" size="small" slot="append" style="width: 220px;"> + <el-option v-for="item in BANben" :key="item.id" :label="item.name" :value="item.name"></el-option> + </el-select> + </template> + </el-card> <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="name" border - height="calc(100vh - 250px)" + default-expand-all ref="multipleTable" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @@ -445,7 +445,11 @@ </template> </el-table-column> </el-table> - <!-- </div> --> + <span slot="footer" class="dialog-footer"> + <el-button @click="Standardframe = false">鍙� 娑�</el-button> + <el-button type="primary" @click="Standardframe = false">纭� 瀹�</el-button> + </span> + </el-dialog> <!-- 鍘熸潗鏂欐楠屾ā鎬佹 --> @@ -461,20 +465,19 @@ :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" :data="rawMaterialTable" style="width: 100%" - @selection-change="handleSelectionChange" + @selection-change="handleSelectionChange_0" > - <el-table-column + <el-table-column type="selection" - label="" min-width="10%" - /> + /> <el-table-column type="index" label="搴忓彿" min-width="8%" /> <el-table-column - prop="dateSurvey" + prop="createTime" label="鏉ユ枡鏃ユ湡" min-width="8%" /> @@ -519,12 +522,12 @@ min-width="8%" /> <el-table-column - prop="createTime" + prop="dateSurvey" label="妫�楠屾棩鏈�" min-width="8%" /> <el-table-column - prop="state" + prop="condition" label="鐘舵��" min-width="8%" > @@ -597,7 +600,7 @@ </template> <script> - import { selectInspectsList, selectAll, addInspect,getCommisionList} from '@/api/experiment/planAssignments' + import { selectInspectsList, selectAll, addInspect,getCommisionList,YANcailiso,chooseVer} from '@/api/experiment/planAssignments' export default { data() { return { @@ -607,34 +610,11 @@ type: '', state: '', }, + valu:{}, icode:'', inspectionTable: [], rawMaterialTable: [], - commisionTable: [{ - specifications_models: "GGXH-AAAAA", - inspectionTime: "2023-08-03", - id: 2, - samples_number: 0, - dateSurvey: "2023-08-03", - entrusted: "闃块噷宸村反", - completionDeadline: "2023-08-03", - contacts: "灏忛粦", - entrust_coding: "SL20230803000003", - sample_name: "鍙戝姩鏈�", - inspection_status: 1 - },{ - specifications_models: "GGXH-AAAAA", - inspectionTime: "2023-08-03", - id: 2, - samples_number: 0, - dateSurvey: "2023-08-03", - entrusted: "闃块噷宸村反", - completionDeadline: "2023-08-03", - contacts: "灏忛粦", - entrust_coding: "SL20230803000003", - sample_name: "鍙戝姩鏈�", - inspection_status: 1 - }], + commisionTable: [], finishedTable: { deliverydate: '', supplier: '', @@ -691,7 +671,10 @@ commisionVisible: false, tmp: '', Standardframe: false, - tableData: [] + tableData: [], + tableRow:{}, + BANben:[], + select_1: [] } }, watch: { @@ -706,7 +689,6 @@ }, created() { this.selectInspectsList() - // this.getCommisionList() }, updated() { if (this.$route.name === 'ForInspectionDetail') this.showDetail = true @@ -727,11 +709,27 @@ this.$router.push({name:'Viewdetails',query: {id:row.id}}); this.selectInspectsList() }, + //鐗堟湰搴� + async chooseVer() { + const res = await chooseVer ({ + mcode:this.commisionTable.entrust_coding, + name:this.commisionTable.entrusted, + scifications:this.commisionTable.specifications_models + }) + console.log(res); + this.BANben = res.data.row + }, //濮旀墭妫�楠� async getCommisionList() { const res = await getCommisionList({pageNo:1,pageSize:10 }) - this.commisionTable = res.data - console.log(this.commisionTable); + console.log(res); + this.commisionTable = res.data.row + }, + //鍘熸潗鏂� + async selecYANcailisotAllAPI() { + const res = await YANcailiso({pageNo:1,pageSize:10 }) + console.log(res); + this.rawMaterialTable = res.data.row }, async selectInspectsList() { // 鑾峰彇鍒嗛〉鍒楄〃 @@ -808,23 +806,30 @@ this.infoForm = this.tmp this.rawmaterialVisible = false }, - async handleRadioChange(){ - if(this.type === 0){ + handleRadioChange(){ + setTimeout(() => { + if(this.type === 0){ // 鍘熸潗鏂欐姤妫� this.rawmaterialVisible = true - const res = await selectAll({type: this.type}) - var data = res.data - data.forEach((item)=>{ - var checkdate = [] - checkdate.push(item['createTime']) - checkdate.push(item['updateTime']) - item['checkdate'] = checkdate // 妫�楠屾棩鏈� + YANcailiso({pageNo:1,pageSize:10}).then(res=>{ + // var data = res.data + // data.forEach((item)=>{ + // var checkdate = [] + // checkdate.push(item['createTime']) + // checkdate.push(item['updateTime']) + // item['checkdate'] = checkdate // 妫�楠屾棩鏈� + // }) + this.rawMaterialTable = res.data.row }) + // this.infoForm = res.data // this.$router.push({ name: 'ReportForInspection' }); }else if(this.type === 1){ this.commisionVisible = true - const res = await getCommisionList({pageNo:1,pageSize:10}) + getCommisionList({pageNo:1,pageSize:10}).then(res=>{ + // console.log(res); + this.commisionTable = res.data.row + }) // var data = res.data // data.forEach((item)=>{ // var checkdate = [] @@ -833,9 +838,9 @@ // item['checkdate_'] = item['startTime'] + '~' + item['endTime'] // item['checkdate'] = checkdate // 妫�楠屾棩鏈� // }) - this.commisionTable = res.data - // this.$router.push({ name: 'CommissionInspection' }); + } + }, 100); }, // 鏂板妫�楠� async addInspection(){ @@ -900,7 +905,25 @@ }, //纭畾璺宠浆 QUEding(){ + // this.tableRow = a this.Standardframe = true + chooseVer({mcode:this.select_1[0].materialCoding, + name:this.select_1[0].materialName, + scifications:this.select_1[0].specificationsModels}).then(res => { + this.BANben = res.data.row + console.log(this.BANben); + }) + + }, + handleSelectionChange_0(val){ + this.select_1 = [] + val.forEach(v => { + let obj = {} + obj.materialCoding = v.materialCoding + obj.materialName = v.materialName + obj.specificationsModels = v.specificationsModels + this.select_1.push(obj) + }) } } } -- Gitblit v1.9.3