From 6c496684e92d7d0d90b50de55f77e3ee93bbabe1 Mon Sep 17 00:00:00 2001 From: yuyu <1981343953@qq.com> Date: 星期四, 10 八月 2023 15:37:46 +0800 Subject: [PATCH] 委托检验和新增检验8.10提交 --- src/utils/request.js | 3 src/api/inspection/commisioninspection.js | 25 +++ src/views/experiment/inspectionApplication/index.vue | 40 +++++ src/layout/components/AppMain.vue | 3 src/router/index.js | 2 src/store/modules/settings.js | 6 src/views/inspectionManagement/commissionInspection/addCommision.vue | 326 +++++++++++++++++++++++++++++++++++++++------- src/views/inspectionManagement/commissionInspection/index.vue | 2 8 files changed, 347 insertions(+), 60 deletions(-) diff --git a/src/api/inspection/commisioninspection.js b/src/api/inspection/commisioninspection.js index 2564e17..ce4a93f 100644 --- a/src/api/inspection/commisioninspection.js +++ b/src/api/inspection/commisioninspection.js @@ -15,4 +15,29 @@ method:'get', params }) +} + +export function getSampleName(params){ + return request({ + url: '/link-basic/material', + method: 'get', + params + }) + +} + +export function getModelSpecification(params){ + return request({ + url: '/link-basic/specification', + method: 'get', + params + }) +} +// 娣诲姞妫�楠岀敵璇峰崟 +export function addInspection(data){ + return request({ + url: '/link-basic/addInspection', + method: 'post', + data + }) } \ No newline at end of file diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index c21454f..8d3654a 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -45,4 +45,7 @@ padding-right: 15px; } } +.el-menu--popup{ + width: 120px; +} </style> diff --git a/src/router/index.js b/src/router/index.js index d0203a4..e1261b7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -194,7 +194,7 @@ path: 'inspectionApplication', name: 'InspectionApplication', component: () => import('@/views/experiment/inspectionApplication/index'), - meta: { title: '妫�楠岀敵璇�', icon: 'tree' } + meta: { title: '鏂板妫�楠�', icon: 'tree' } }, { path: 'planAssignments', diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index b3f33f8..d1367d6 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -5,7 +5,8 @@ const state = { showSettings: showSettings, fixedHeader: fixedHeader, - sidebarLogo: sidebarLogo + sidebarLogo: sidebarLogo, + link:'' } const mutations = { @@ -14,6 +15,9 @@ if (state.hasOwnProperty(key)) { state[key] = value } + }, + SAVE_LINK(state,link){ + state.link = link } } diff --git a/src/utils/request.js b/src/utils/request.js index 2a4647d..a814e44 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -21,7 +21,8 @@ // please modify it according to the actual situation config.headers['X-Token'] = getToken() } - console.log('config' ,config) + config.headers['link'] = store.state.settings.link + // console.log('config' ,config) return config }, error => { diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue index 7303bda..b53ff7c 100644 --- a/src/views/experiment/inspectionApplication/index.vue +++ b/src/views/experiment/inspectionApplication/index.vue @@ -4,14 +4,35 @@ <div class="content-main"> <div class="top-bar"> <el-form ref="form" :inline="true" :model="searchData"> - <el-form-item> + <el-form-item label="鐢宠鍗曞彿:"> <el-input - v-model="searchData.keyword" + v-model="searchData.applicationnumber" class="input-form" - placeholder="璇疯緭鍏ョ敵璇峰崟鍙�/妫�楠屽璞�/瀵硅薄浣嶇疆/瀵硅薄鍚嶇О" + placeholder="璇疯緭鍏ョ敵璇峰崟鍙�" + style="width: 200px; margin-right: 20px;" > - <i slot="prefix" class="el-input__icon el-icon-search" /> + <i slot="prefix" class="el-input__icon el-icon-search" /> </el-input> + </el-form-item> + <el-form-item label="妫�楠岀被鍨�:"> + <el-select v-model="searchData.type" placeholder="鍏ㄩ儴" style="width: 100px;margin-right: 20px;"> + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="妫�楠岀姸鎬�:" style="margin-right: 20px;"> + <el-select v-model="searchData.state" placeholder="鍏ㄩ儴" style="width: 100px;margin-right: 20px;"> + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> </el-form-item> <el-form-item> <el-button type="primary">鏌ヨ</el-button> @@ -268,7 +289,9 @@ return { showDetail: false, searchData: { - keyword: '' + applicationnumber: '', + type: '', + state: '' }, inspectionTable: [{ applicationnum: 'QC22-09155', @@ -349,6 +372,13 @@ amount: '', checkdate: '' }, + options:[{ + value: '0', + label: '閫夐」1' + },{ + value:'1', + label: '閫夐」2' + }], currentPage: 1, total: 20, // 鎬绘潯鏁� pageSize: 10, // 姣忛〉鐨勬暟鎹潯鏁� diff --git a/src/views/inspectionManagement/commissionInspection/addCommision.vue b/src/views/inspectionManagement/commissionInspection/addCommision.vue index 9d65ee3..cd441b4 100644 --- a/src/views/inspectionManagement/commissionInspection/addCommision.vue +++ b/src/views/inspectionManagement/commissionInspection/addCommision.vue @@ -1,10 +1,11 @@ <template> + <div v-if="!showDetail"> <div class="content-main"> <div class="firstBox"> <div class="title">妫�娴嬩俊鎭�</div> <div class="tableBox"> <div class="tableBox-header"> - <el-button class="split" type="primary" size="small" style="background-color: rgb(1, 102, 226);">娣诲姞鏍峰搧</el-button> + <el-button class="split" @click="dialogueFormVisible = true" type="primary" size="small" style="background-color: rgb(1, 102, 226);">娣诲姞鏍峰搧</el-button> <el-input v-model="searchData" class="input-form split" @@ -29,17 +30,17 @@ min-width="10%" /> <el-table-column - prop="sampleid" + prop="sampleNumber" label="鏍峰搧缂栧彿" min-width="8%" /> <el-table-column - prop="samplename" + prop="sampleName" label="鏍峰搧鍚嶇О" min-width="10%" /> <el-table-column - prop="modelandspecification" + prop="specificationsModels" label="瑙勬牸鍨嬪彿" min-width="10%" /> @@ -49,7 +50,7 @@ min-width="8%" /> <el-table-column - prop="amount" + prop="samplesNumber" label="鏁伴噺" min-width="8%" /> @@ -58,10 +59,13 @@ label="娣诲姞鏂瑰紡" min-width="8%"> <template slot-scope="scope"> - <el-tag - :type="scope.row.addway === 0 ? 'success' : 'primary'" - disable-transitions - >{{ scope.row.addway === 0 ? '鎵弿' : '褰曞叆' }}</el-tag> + <div v-if="scope.row.addway === 0"> + <el-tag :type= 'success' disable-transitions>鎵弿</el-tag> + </div> + <div v-if="scope.row.addway === 1"> + <el-tag :type= 'primary' disable-transitions>褰曞叆</el-tag> + </div> + <div v-else></div> </template> </el-table-column> <el-table-column @@ -70,7 +74,7 @@ min-width="8%" /> <el-table-column - prop="other" + prop="remarks" label="澶囨敞" min-width="8%" /> @@ -80,7 +84,7 @@ > <template slot-scope="scope"> <el-button type="text" size="small">淇敼</el-button> - <el-button type="text" size="small" @click="handleClick(scope.row)">鍒犻櫎</el-button> + <el-button type="text" size="small" @click="deleteRow(scope.row)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -100,15 +104,15 @@ </div> <div class="secondBox"> <el-row class="header"> - <el-col :span="12">鍩烘湰淇℃伅</el-col> - <el-col :span="12" style="text-align: right;"> - <!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false --> - <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">鎵撳嵃濮旀墭鍗�</el-button> - </el-col> - </el-row> - <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px" size="mini" > - <div class="formwrapper"> - <el-row :gutter="200"> + <el-col :span="12">鍩烘湰淇℃伅</el-col> + <el-col :span="12" style="text-align: right;"> + <!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false --> + <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">鎵撳嵃濮旀墭鍗�</el-button> + </el-col> + </el-row> + <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px" size="mini" > + <div class="formwrapper"> + <el-row :gutter="200"> <el-col :span="5"> <el-form-item label="濮旀墭缂栧彿锛�"> <el-input style="width: 160px" type="text" :value="infoForm.commisioncode" readonly disabled="true" autocomplete="off" /> @@ -116,36 +120,24 @@ </el-col> <el-col :span="5"> <el-form-item label="濮旀墭鍗曚綅锛�"> - <el-select style="width: 160px;" v-model="infoForm.department" size="small" placeholder="璇烽�夋嫨浜у搧鍚嶇О"> - <el-option value="閫夐」1"></el-option> - <el-option value="閫夐」2"></el-option> - </el-select> + <el-input style="width: 160px" v-model="infoForm.department" placeholder="璇疯緭鍏ュ鎵樺崟浣�" /> </el-form-item> </el-col> <el-col :span="5"> <el-form-item label="鑱旂郴浜猴細"> - <el-select style="width: 160px;" v-model="infoForm.contacter" size="small" placeholder="璇烽�夋嫨浜у搧鍚嶇О"> - <el-option value="閫夐」1"></el-option> - <el-option value="閫夐」2"></el-option> - </el-select> + <el-input style="width: 160px" v-model="infoForm.contacter" placeholder="璇疯緭鍏ュ鎵樺崟浣�" /> </el-form-item> </el-col> <el-col :span="5"> <el-form-item label="鑱旂郴鐢佃瘽锛�"> - <el-select style="width: 160px;" v-model="infoForm.tel" size="small" placeholder="璇烽�夋嫨浜у搧鍚嶇О"> - <el-option value="閫夐」1"></el-option> - <el-option value="閫夐」2"></el-option> - </el-select> + <el-input style="width: 160px" v-model="infoForm.tel" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" /> </el-form-item> </el-col> </el-row> <el-row :gutter="200"> <el-col :span="5"> <el-form-item label="鑱旂郴鍦板潃锛�" > - <el-select style="width: 160px;" v-model="infoForm.address" size="small" placeholder="璇烽�夋嫨浜у搧鍚嶇О"> - <el-option value="閫夐」1"></el-option> - <el-option value="閫夐」2"></el-option> - </el-select> + <el-input style="width: 160px;" v-model="infoForm.address" placeholder="璇疯緭鍏ヨ仈绯诲湴鍧�" autocomplete="off" /> </el-form-item> </el-col> <el-col :span="5"> @@ -171,8 +163,7 @@ <el-col :span="5"> <el-form-item label="閫佹牱鏂瑰紡锛�"> <el-select style="width: 160px;" v-model="infoForm.way" size="small" placeholder="閫佹牱"> - <el-option value="閫夐」1"></el-option> - <el-option value="閫夐」2"></el-option> + <el-option v-for="options in sampleDeliveryMode" :key="options.key" :value="options.value">{{ options.value }}</el-option> </el-select> </el-form-item> </el-col> @@ -201,22 +192,92 @@ </el-row> </div> <div class="submitBtn"> - <el-button type="primary" size="small" style="background-color: rgb(1, 102, 226);">鎻愪氦</el-button> + <el-button type="primary" size="small" @click="submitInspection" style="background-color: rgb(1, 102, 226);">鎻愪氦</el-button> </div> </el-form> </div> </div> + <div class="checkType"> + <el-dialog + title="娣诲姞鎸囨爣" + :visible.sync="dialogueFormVisible" + width="40%" + > + <el-form :model="addPointerForm" ref="addPointerForm" class="addPointerForm" label-position="right" label-width="100px" size="mini"> + <el-row :gutter="50"> + <el-col :span="10"> + <el-form-item label="鏍峰搧缂栧彿锛�"> + <el-select style="width: 160px;" v-model="addPointerForm.sampleNumber" size="small" placeholder="璇烽�夋嫨鏍峰搧缂栧彿"> + <el-option v-for="options in samplecodeoptions" :value="options.value" :key="options.key" >{{ options.value }}</el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="10"> + <el-form-item label="鏍峰搧鍚嶇О锛�"> + <el-select style="width: 160px;" v-model="addPointerForm.sampleName" size="small" placeholder="璇烽�夋嫨鏍峰搧鍚嶇О"> + <el-option v-for="options in sampleoptions" :value="options.value" :key="options.key">{{ options.value }}</el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="50"> + <el-col :span="10"> + <el-form-item label="瑙勬牸鍨嬪彿锛�"> + <el-select style="width: 160px;" v-model="addPointerForm.specificationsModels" size="small" placeholder="璇烽�夋嫨鏍峰搧鍚嶇О"> + <el-option v-for="options in model_spe_options" :value="options.value" :key="options.key">{{ options.value }}</el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="10"> + <el-form-item label="鏍峰搧鍗曚綅锛�"> + <el-input style="width: 160px" type="text" v-model="addPointerForm.unit" placeholder="璇疯緭鍏ュ崟浣�" autocomplete="off" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="50"> + <el-col :span="10"> + <el-form-item label="鏍峰搧鏁伴噺锛�"> + <el-input style="width: 160px" type="text" v-model="addPointerForm.samplesNumber" placeholder="璇疯緭鍏ユ暟閲�" autocomplete="off" /> + </el-form-item> + </el-col> + <el-col :span="10"> + <el-form-item label="澶囨敞锛�"> + <el-input style="width: 160px" type="text" v-model="addPointerForm.remarks" placeholder="璇疯緭鍏ュ娉�" autocomplete="off" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="50"> + <el-col :span="10"> + <el-form-item label="娣诲姞瀹為獙锛�"> + <el-checkbox-group v-model="addPointerForm.experiment" style="display: flex; flex-direction: column;"> + <el-checkbox v-for="expers in experList" :label="expers.label" :key="expers.key">{{ expers.label }}</el-checkbox> + </el-checkbox-group> + </el-form-item> + </el-col> + </el-row> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="addInspection">娣诲姞</el-button> + <el-button @click="dialogueFormVisible = false">鍙� 娑�</el-button> + </span> + </el-dialog> + </div> </div> +</div> +<div v-else> + <router-view></router-view> +</div> </template> <script> +import {getSampleName, getModelSpecification, getlink, addInspection} from '@/api/inspection/commisioninspection' export default { data() { return { currentPage: 0, searchData: '', infoForm: { - commisioncode: 'ST9162324', + commisioncode: '', department: '', contacter: '', tel: '', @@ -229,25 +290,188 @@ num: '', other: '' }, - detectionInfo: [{ - sampleid: 'GW31478631', - samplename: '缁濈紭鏉�', - modelandspecification: 'JLHA/G1A-185/30-26/7', - unit: '鏍�', - amount: '40', - addway: 0, - experiment: '浜ゆ祦鑰愬帇璇曢獙', - other: '123', - opertion: '', - }] + detectionInfo: [], + addPointerForm:{ + sampleNumber: '', + sampleName: '', + specificationsModels: '', + unit: '', + samplesNumber: '', + remarks: '', + experiment: [], + addway: '' + }, + experList:[{ + key: '1', + label: '澶栬妫�鏌�' + },{ + key: '2', + label: '鍔ㄤ綔鐢靛帇璇曢獙' + },{ + key: '3', + label: '鐢甸樆绠℃硠婕忕數娴佽瘯楠�' + },{ + key: '4', + label: '缁濈紭閮ㄥ垎浜ゆ祦鑰愬帇璇曢獙' + }], + sampleoptions:[{ + key:'1', + value: '閫夐」1' + },{ + key:'2', + value: '閫夐」2' + }], + samplecodeoptions:[{ + key:'1', + value: '' + }], + model_spe_options:[{ + key:'1', + value: '閫夐」1' + },{ + key: '2', + value: '閫夐」2' + }], + sampleDeliveryMode:[{ + key: '1', + value: '閫佹牱' + },{ + key: '2', + value: '涓婇棬' + }], + dialogueFormVisible: false, + showDetail: false } }, + created(){ + this.getlink() + }, + mounted(){ + this.getSampleName() + this.getModelSpecification() + }, methods: { + // 鑾峰彇閾炬帴link + getlink(){ + getlink().then((result)=>{ + this.$store.commit('settings/SAVE_LINK',result.data) + console.log(this.$store.state.settings.link) + }) + }, + async getSampleName(){ + const res = await getSampleName() + // console.log('res',res.data) + this.sampleoptions = res.data.map((item)=>{ + return{ + key:item.id.toString(), + value:item.name + } + }) + this.samplecodeoptions = res.data.map((item)=>{ + return{ + key:item.id.toString(), + value:item.code + } + }) + }, + async getModelSpecification(){ + const res = await getModelSpecification({materialId: '1'}) + // console.log(res) + this.model_spe_options = res.data.map((item)=>{ + return{ + key:item.specificationsId, + value:item.specificationsName + } + }) + }, + addInspection(){ + let exper = this.addPointerForm.experiment[0] + this.addPointerForm.addway = 1 + for(let i=1;i<this.addPointerForm.experiment.length;i++){ + exper += ',' + this.addPointerForm.experiment[i] + } + // console.log(exper) + this.addPointerForm.experiment = exper + let tmp = this.addPointerForm + this.detectionInfo.push(tmp) + this.dialogueFormVisible = false + this.addPointerForm ={ + sampleNumber: '', + sampleName: '', + specificationsModels: '', + unit: '', + samplesNumber: '', + remarks: '', + experiment: [], + addway: '' + } + }, + async submitInspection(){ + let sampledeliveryway + if(this.infoForm.way === '閫佹牱'){ + sampledeliveryway = 1 + }else{ + sampledeliveryway = 2 + } + const res = await addInspection({completionDeadline: this.infoForm.deadline, + contactAddress: this.infoForm.address, + contactNumber: this.infoForm.tel, + contacts: this.infoForm.contacter, + entrustRemarks: this.infoForm.other, + entrusted: this.infoForm.department, + inspectionTime: this.infoForm.time, + linkDetectionList: this.detectionInfo, + reportNumber: parseInt(this.infoForm.num), + sampleDeliveryMode: sampledeliveryway, + sampleDeliveryPhone: this.infoForm.sendertel, + sampleSender: this.infoForm.sender}) +// const res = await addInspection({ +// completionDeadline: "2023-08-03", +// contactAddress: "姹熻嫃鍗楅��", +// contactNumber: "12321423432", +// contacts: "灏忛粦", +// entrustRemarks: "濮旀墭澶囨敞YPBH123456789YPBH123456789YPBH123456789", +// entrusted: "闃块噷宸村反", +// inspectionTime: "2023-08-03", +// linkDetectionList: [ +// { +// "experiment": "鍋氭ⅵ", +// "remarks": "閫氳繃浜�", +// "sampleName": "鍙戝姩鏈�", +// "sampleNumber": "YPBH123456789", +// "samplesNumber": 20, +// "specificationsModels": "GGXH-AAAAA", +// "unit": "鐧惧害" +// } +// ], +// reportNumber: 23, +// sampleDeliveryMode: 1, +// sampleDeliveryPhone: "123456789676", +// sampleSender: "灏忕櫧" +// }) + // console.log(res) + this.infoForm.commisioncode = res.data + if(res.data){ + this.$message({ + message: '鎭枩浣�!', + type: 'success' + }) + // 璺宠浆椤甸潰 + this.$router.push('/inspectionManagement/commissionInspection') + this.showDetail = true + }else{ + this.$message.error(res.message) + } + }, handleSizeChange(pageSize) { this.pageParams.pageSize = pageSize }, handleCurrentChange(pageNo) { this.pageParams.pageNo = pageNo + }, + deleteRow(row){ + console.log(row) + row = null } } } diff --git a/src/views/inspectionManagement/commissionInspection/index.vue b/src/views/inspectionManagement/commissionInspection/index.vue index a34af7c..e45b68d 100644 --- a/src/views/inspectionManagement/commissionInspection/index.vue +++ b/src/views/inspectionManagement/commissionInspection/index.vue @@ -160,7 +160,7 @@ </template> <script> -import { getCommisionList, getlink } from '@/api/inspection/commisioninspection' +import { getCommisionList } from '@/api/inspection/commisioninspection' export default { data() { return { -- Gitblit v1.9.3