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 | 171 ++++++++++++++++++++++++++++++++------------------------- 1 files changed, 96 insertions(+), 75 deletions(-) diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue index 1e9deeb..3b08605 100644 --- a/src/views/experiment/inspectionApplication/index.vue +++ b/src/views/experiment/inspectionApplication/index.vue @@ -180,16 +180,17 @@ title="鏂板妫�楠屽崟" :visible.sync="checkTypeVisible" width="50%" + top="10vh" > <div class="check-box"> - <el-radio-group v-model="type" @change="handleRadioChange"> - <el-radio style="background-color: rgb(170, 236, 214);border-radius: 10px;" :label="0" border >鍘熸潗鏂欐楠�</el-radio> - <el-radio style="background-color: rgb(170, 236, 214);border-radius: 10px;" :label="1" border>濮旀墭妫�楠�</el-radio> - <el-radio style="background-color: rgb(170, 236, 214);border-radius: 10px;" :label="2" border>鎴愬搧妫�楠�</el-radio> + <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> </el-radio-group> </div> - <div v-if="type === 0 || type === ''"> - <el-form :model="infoForm" ref="infoForm" class="checkTypeForm" label-position="top" label-width="200px" size="mini"> + <div v-if="type === 0"> + <el-form :model="infoForm" ref="infoForm" class="checkTypeForm" label-position="top" label-width="200px" size="medium"> <el-row :gutter="100"> <el-col :span="10"> <el-form-item label="鏉ユ枡鏃ユ湡锛�"> @@ -378,25 +379,23 @@ <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" - @select="selectTr" - @select-all="selectAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" > <el-table-column type="selection" label="搴忓彿"> </el-table-column> @@ -446,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> <!-- 鍘熸潗鏂欐楠屾ā鎬佹 --> @@ -462,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%" /> @@ -520,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%" > @@ -593,13 +595,12 @@ </template> <template v-else> <router-view /> - </template> </div> </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 { @@ -609,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: '', @@ -647,7 +625,7 @@ amount: '', checkdate: [] }, - infoForm:'', + infoForm:{}, commisionSelection:{ entrust_coding: '', entrusted: '', @@ -688,11 +666,15 @@ pageSize: 8, // 姣忛〉鐨勬暟鎹潯鏁� radioValue: '鍏ㄩ儴', checkTypeVisible: false, - type: '', // 榛樿涓嶉�変腑鐨勭姸鎬� + type: 0, // 榛樿涓嶉�変腑鐨勭姸鎬� rawmaterialVisible: false, commisionVisible: false, tmp: '', - Standardframe: false + Standardframe: false, + tableData: [], + tableRow:{}, + BANben:[], + select_1: [] } }, watch: { @@ -707,7 +689,6 @@ }, created() { this.selectInspectsList() - // this.getCommisionList() }, updated() { if (this.$route.name === 'ForInspectionDetail') this.showDetail = true @@ -728,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() { // 鑾峰彇鍒嗛〉鍒楄〃 @@ -809,24 +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 = [] @@ -835,9 +838,9 @@ // item['checkdate_'] = item['startTime'] + '~' + item['endTime'] // item['checkdate'] = checkdate // 妫�楠屾棩鏈� // }) - this.commisionTable = res.data - // this.$router.push({ name: 'CommissionInspection' }); + } + }, 100); }, // 鏂板妫�楠� async addInspection(){ @@ -880,7 +883,7 @@ type: this.type, unit: this.finishedTable.unit }) } - this.type = '' + this.type = 0 this.checkTypeVisible = false this.$message({ message: '娣诲姞鎴愬姛锛�', @@ -902,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) + }) } } } @@ -927,7 +948,7 @@ } height: auto; font-size: 22px !important; - padding: 20px 40px !important; + padding: 40px 50px !important; ::v-deep .el-radio__label{ font-size: 22px !important; padding-left: 0px !important; -- Gitblit v1.9.3