From e28bc4fced1c347a48326dcfbb944fdbd6e4660a Mon Sep 17 00:00:00 2001 From: yuyu <1981343953@qq.com> Date: 星期四, 31 八月 2023 09:19:40 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.110.209:9001/r/lims-before --- src/utils/request.js | 4 src/views/laboratory/gather/index.vue | 10 src/api/inspection/commisioninspection.js | 8 src/views/chart/work/index.vue | 20 - src/views/laboratory/measure/Add.vue | 67 ++- src/views/laboratory/measure/index.vue | 50 ++- src/views/experiment/inspectionApplication/index.vue | 202 ++++++++------ src/views/inspectionManagement/reportForInspection/index.vue | 347 +++++++++++++++++++----- src/api/inspection/rawmaterial.js | 54 +++ src/router/index.js | 8 src/views/experiment/inspectionApplication/Viewdetails/index.vue | 7 src/views/inspectionManagement/commissionInspection/addCommision.vue | 20 + 12 files changed, 562 insertions(+), 235 deletions(-) diff --git a/src/api/inspection/commisioninspection.js b/src/api/inspection/commisioninspection.js index d986bb3..95df195 100644 --- a/src/api/inspection/commisioninspection.js +++ b/src/api/inspection/commisioninspection.js @@ -88,3 +88,11 @@ params }) } + +export function getSpecificationsName(params){ + return request({ + url: '/link-basic-table/getSpecificationsName', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/api/inspection/rawmaterial.js b/src/api/inspection/rawmaterial.js index 9b975ce..2bbf039 100644 --- a/src/api/inspection/rawmaterial.js +++ b/src/api/inspection/rawmaterial.js @@ -9,6 +9,7 @@ }) } +//鏂板鎶ユ鍗� export function addInspect(data){ return request({ url: '/inspection/addInspect', @@ -17,10 +18,63 @@ }) } +//鏍规嵁妫�楠屽崟id鏌ヨ妫�楠屽崟璇︽儏 export function selectInspectsListById(params){ return request({ url: '/inspection/selectInspectsListById', method: 'get', params }) +} + +//鏌ヨ鎵�鏈夌敤鎴� +export function selectUser(params){ + return request({ + url: '/inspection/selectUser', + method: 'get', + params + }) +} + +//鏌ヨ鎵�鏈夎澶� +export function selectEquipment(params){ + return request({ + url: '/inspection/selectEquipment', + method: 'get', + params + }) +} + +//鏂板鍘熸潗鏂欐姤妫� +export function addMaterial(data){ + return request({ + url: '/raw-material/add', + method: 'post', + data + }) +} + +//鍒犻櫎鍘熸潗鏂欐姤妫� +export function deleteMaterial(data){ + return request({ + url: '/raw-material/delete', + method: 'post', + data + }) +} + +export function getMaterielName(data){ + return request({ + url: '/raw-material/getMaterielName', + method: 'get', + data + }) +} + +export function getSpecification(params){ + return request({ + url: '/raw-material/specification', + method: 'get', + params + }) } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 458100d..cfa384f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -533,9 +533,11 @@ let menuFather = baseRouter const dataMenuFather = fn3(menuFather) role.roleMenuList.forEach((r) => { - dataMenuFather.push(Routees.filter(item => { - return item.path === r.menuUrl - })[0]) + if(r.menuName!='棣栭〉'){ + dataMenuFather.push(Routees.filter(item => { + return item.path === r.menuUrl + })[0]) + } }) let eqChildren = []; role.roleMenuList.forEach((r) => { diff --git a/src/utils/request.js b/src/utils/request.js index 4218d62..5933e2d 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,4 +1,5 @@ import axios from 'axios' +import router from '../router/index' import { MessageBox, Message } from 'element-ui' import store from '@/store' import { getToken } from '@/utils/auth' @@ -63,8 +64,7 @@ }) sessionStorage.removeItem("user") sessionStorage.setItem("flushPage",1) - this.$router.replace({path: '/login'}); - location.reload() + router.replace({path: '/login'}); } if(res.code===403){ Message({ diff --git a/src/views/chart/work/index.vue b/src/views/chart/work/index.vue index d958e62..9689a03 100644 --- a/src/views/chart/work/index.vue +++ b/src/views/chart/work/index.vue @@ -6,8 +6,7 @@ <el-card> <el-form :rules="rules" ref="formInline" :inline="true" :model="formInline" class="demo-form-inline"> - <el-form-item prop="date"> - <p><span>*</span>妫�娴嬫棩鏈�:</p> + <el-form-item prop="date" label="妫�娴嬫棩鏈�:"> <el-date-picker v-model="formInline.date" format="yyyy-MM-dd" @@ -18,8 +17,7 @@ end-placeholder="缁撴潫鏃ユ湡"> </el-date-picker> </el-form-item> - <el-form-item prop="type"> - <p><span>*</span>妫�楠岀被鍨�:</p> + <el-form-item prop="type" label="妫�楠岀被鍨�:"> <el-select v-model="formInline.type" placeholder="閲囪喘鍏ュ簱"> <el-option label="鍘熸潗鏂�" value="0"></el-option> <el-option label="鎴愬搧" value="1"></el-option> @@ -501,24 +499,14 @@ z-index: 10; .demo-form-inline{ margin: 0px 10px; - p{ - margin: 0; - font-size: 16px; - font-weight: bold; - span{ - font-size: 16px; - font-weight: bold; - color: red; - } - } .buttons{ - margin: 40px 0px 0px 50%; + margin-left: 10%; } } } .work-center{ margin: 0px 0px 150px 10px; - padding: 18vh 0px 5px 0px; + padding: 13vh 0px 5px 0px; .el-card{ margin: 5px 0px; height:500px; diff --git a/src/views/experiment/inspectionApplication/Viewdetails/index.vue b/src/views/experiment/inspectionApplication/Viewdetails/index.vue index 244a2d7..04d49ea 100644 --- a/src/views/experiment/inspectionApplication/Viewdetails/index.vue +++ b/src/views/experiment/inspectionApplication/Viewdetails/index.vue @@ -185,12 +185,7 @@ this.ZERENren = res.data console.log(this.ZERENren); }, - //璁惧 - // getDevices() { - // get(this.$url.chooseinstum).then(res => { - // this.devices = res.data - // }) - // }, + async chooseinstum(){ const res = await chooseinstum() this.getDevices = res.data diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue index 94664a1..4d98974 100644 --- a/src/views/experiment/inspectionApplication/index.vue +++ b/src/views/experiment/inspectionApplication/index.vue @@ -50,8 +50,7 @@ </div> </div> <div class="table-box"> - <el-table ref="inspectionTable" style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)" - max-height="calc(100% - 50px)" :cell-style="{textAlign: 'center'}" + <el-table ref="inspectionTable" style="width: 100%;overflow-y: auto;max-height: 600px;" :height="600" :cell-style="{textAlign: 'center'}" :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" :data="inspectionTable"> <el-table-column type="selection" min-width="30px" /> @@ -63,9 +62,9 @@ <div v-if="scope.row.type === 2"><span>鎴愬搧妫�楠�</span></div> </template> </el-table-column> - <el-table-column prop="formTime" label="鏉ユ枡鏃ユ湡" min-width="80px" /> - <el-table-column prop="supplier" label="渚涘簲鍟嗗悕绉�" min-width="150px" /> - <el-table-column prop="mcode" label="鍘熸潗鏂欑紪鐮�" min-width="150px" /> + <el-table-column prop="formTime" label="鏉ユ枡鏃ユ湡" min-width="90px" /> + <el-table-column prop="supplier" label="渚涘簲鍟嗗悕绉�" min-width="150px" show-overflow-tooltip/> + <el-table-column prop="mcode" label="鍘熸潗鏂欑紪鐮�" min-width="170px"/> <el-table-column prop="name" label="鍘熸潗鏂欏悕绉�" min-width="80px" /> <el-table-column prop="specifications" label="瑙勬牸鍨嬪彿" min-width="160px" /> <el-table-column prop="unit" label="鍗曚綅" min-width="50px" /> @@ -78,7 +77,7 @@ </template> </el-table-column> <el-table-column prop="userName" label="鐧昏浜�" min-width="80px" /> - <el-table-column prop="checkdate" label="妫�楠屾棩鏈�" min-width="150px" /> + <el-table-column prop="checkdate" label="妫�楠屾棩鏈�" min-width="160px" /> <el-table-column label="鎿嶄綔" min-width="150" fixed="right"> <template slot-scope="scope"> <el-button type="text" size="small" @click="handleClick(scope.row)">鏌ョ湅</el-button> @@ -163,7 +162,7 @@ </el-col> <el-col :span="10"> <el-form-item label="妫�楠屾椂闂达細"> - <el-date-picker v-model="infoForm.endTime" type="daterange" range-separator="鑷�" + <el-date-picker v-model="infoForm.checkdate" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" style="width: 300px;"> </el-date-picker> </el-form-item> @@ -314,36 +313,37 @@ </template> </el-card> <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="id" border - height="calc(80vh - 250px)" default-expand-all ref="multipleTable" - :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> - <el-table-column type="selection" label="搴忓彿"> </el-table-column> - <el-table-column type="index" width="50px" label="搴忓彿"></el-table-column> - <el-table-column label="椤圭洰鍚嶇О" sortable> - <template scope="scope"> - <el-tag> - <div class="firstDiv" :style="`color: ${ - scope.row.code == '[1]' ? '#16a7ff' : '#58c173' - }`"> - {{ scope.row.code == "[1]" ? "01" : "02" }} - </div> - <span style="color: black">{{ scope.row.name }}</span> - </el-tag> - </template> - </el-table-column> - <el-table-column prop="unit" label="鍗曚綅" sortable></el-table-column> - <el-table-column label="鏍囧噯鍊�" sortable> - <template scope="scope"> - <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)" - v-model="scope.row.required" placeholder="璇疯緭鍏ユ爣鍑嗗��"></el-input> - </template> - </el-table-column> - <el-table-column prop="internal" label="鍐呮帶鍊�" sortable> - <template scope="scope"> - <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)" - v-model="scope.row.internal" placeholder="璇疯緭鍏ュ唴鎺у��"></el-input> - </template> - </el-table-column> - </el-table> + height="calc(80vh - 250px)" default-expand-all ref="multipleTable" + @select-all="selectAll" @selection-change="handleSelectionChange" + :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> + <!-- <el-table-column type="selection" label="搴忓彿"> </el-table-column> --> + <el-table-column type="index" width="50px" label="搴忓彿"></el-table-column> + <el-table-column label="椤圭洰鍚嶇О" sortable> + <template scope="scope"> + <el-tag> + <div class="firstDiv" :style="`color: ${ + scope.row.code == '[1]' ? '#16a7ff' : '#58c173' + }`"> + {{ scope.row.code == "[1]" ? "01" : "02" }} + </div> + <span style="color: black">{{ scope.row.name }}</span> + </el-tag> + </template> + </el-table-column> + <el-table-column prop="unit" label="鍗曚綅" sortable></el-table-column> + <el-table-column label="鏍囧噯鍊�" sortable> + <template scope="scope"> + <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)" + v-model="scope.row.required" placeholder="璇疯緭鍏ユ爣鍑嗗��"></el-input> + </template> + </el-table-column> + <el-table-column prop="internal" label="鍐呮帶鍊�" sortable> + <template scope="scope"> + <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)" + v-model="scope.row.internal" placeholder="璇疯緭鍏ュ唴鎺у��"></el-input> + </template> + </el-table-column> + </el-table> <span slot="footer" class="dialog-footer"> <el-button @click="Standardframe = false">鍙� 娑�</el-button> <el-button type="primary" @click="GOfrom">纭� 瀹�</el-button> @@ -433,7 +433,7 @@ selectAll, addInspect, chooseVer, - lookProByVer + lookProByVer, } from '@/api/experiment/planAssignments' export default { data() { @@ -460,7 +460,7 @@ amount: '', checkdate: [] }, - selectedValue: 1, + selectedValue: {}, infoForm: {}, commisionSelection: { entrust_coding: '', @@ -510,8 +510,10 @@ tableData: [], tableRow: {}, BANben: [], - select_1: [], - aa: {} + // select_1: [], + aa: {}, + listdata:[], + ddd:{} } }, watch: { @@ -529,6 +531,7 @@ if (this.$route.name === 'ForInspectionDetail') this.showDetail = true }, methods: { + async selectAll() { const res = selectAll({ type: 0 @@ -570,6 +573,7 @@ this.aa = this.BANben[0] this.lookProByVer() }, + //鏍囧噯搴� async lookProByVer() { const res = await lookProByVer({ @@ -663,6 +667,7 @@ }, handleRawMaterialSelection() { this.infoForm = this.tmp + console.log(this.infoForm); this.rawmaterialVisible = false }, handleRadioChange() { @@ -673,13 +678,13 @@ selectAll({ type: 0 }).then(res => { - // var data = res.data - // data.forEach((item)=>{ - // var checkdate = [] - // checkdate.push(item['createTime']) - // checkdate.push(item['updateTime']) - // item['checkdate'] = checkdate // 妫�楠屾棩鏈� - // }) + var data = res.data + data.forEach((item)=>{ + var checkdate = [] + checkdate.push(item['createTime']) + checkdate.push(item['updateTime']) + item['checkdate'] = checkdate // 妫�楠屾棩鏈� + }) this.rawMaterialTable = res.data }) @@ -690,26 +695,35 @@ selectAll({ type: 2 }).then(res => { - + var data = res.data + data.forEach((item)=>{ + var checkdate = [] + checkdate.push(item['createTime']) + checkdate.push(item['updateTime']) + item['checkdate'] = checkdate // 妫�楠屾棩鏈� + }) this.commisionTable = res.data }) } }, 100) }, // 鏂板妫�楠� - async addInspection() { + async addInspection() { if (this.type === 0) { - await addInspect({ + addInspect({ endTime: this.infoForm.checkdate[1], - formTime: this.infoForm.dateSurvey, - mcode: this.infoForm.materialCoding, - name: this.infoForm.materialName, - num: this.infoForm.quantity, - specifications: this.infoForm.specificationsModels, + formTime: this.infoForm.formTime, + mcode: this.infoForm.mcode, + name: this.infoForm.name, + num: this.infoForm.num, + specifications: this.infoForm.specifications, startTime: this.infoForm.checkdate[0], - supplier: this.infoForm.supplierName, + supplier: this.infoForm.supplier, type: this.type, - unit: this.infoForm.unit + unit: this.infoForm.unit, + version:this.BANben[1] + }).then(res=>{ + }) } if (this.type === 1) { @@ -723,7 +737,9 @@ startTime: this.commisionSelection.checkdate[0], supplier: this.commisionSelection.supplier, type: this.type, - unit: this.commisionSelection.unit + unit: this.commisionSelection.unit, + version:this.aa + }) } if (this.type === 2) { @@ -737,15 +753,18 @@ startTime: '2023-08-14', supplier: this.finishedTable.supplier, type: this.type, - unit: this.finishedTable.unit + unit: this.finishedTable.unit, + version:this.aa + }) } this.type = 0 this.checkTypeVisible = false - this.$message({ - message: '娣诲姞鎴愬姛锛�', - type: 'success' - }); + // this.$message({ + // message: '娣诲姞鎴愬姛锛�', + // type: 'success' + // }); + // this.$router.push({name: 'Viewdetails'}) }, // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣 handleSizeChange(val) { @@ -758,33 +777,45 @@ this.currentPage = val this.selectInspectsList() }, + // //琛ㄥ崟鏍¢獙 + // validateForm(infoForm){ + // console.log(this.infoForm); + + // if (infoForm.checkdate == undefined) { + // alert('璇疯緭鍏ユ楠屾椂闂�'); + // return false; + // } + // // 鏍¢獙閫氳繃 + // return true; + // }, //纭畾璺宠浆 QUEding() { - // this.tableRow = a - + if (this.infoForm.checkdate[0] == undefined||this.infoForm.checkdate[1] == undefined) { + this.$message({ + message: '璇烽�夋嫨妫�楠屾椂闂�', + type: 'warning' + }); + return; + } this.Standardframe = true - + this.skipshow() this.chooseVer() - + }, + //鏂板鐨勬暟鎹� + skipshow() { + const data = this.inspectionTable.at(-1) + this.listdata = data }, //纰哄畾瑭虫儏闋� - GOfrom() { - this.Standardframe = false - // const data = { - // // mcode : this.tmp.mcode, - // // name:this.tmp.name, - // // specifications:this.tmp.specifications, - // version:this.tmp.id - // } - - this.$router.push({ - name: 'Viewdetails', - query: { - id: this.tmp.id - } - }) - - }, + async GOfrom() { + // this.addInspect() + this.addInspection() + // this.kk = res.data + console.log(this.kk) + // this.$router.push({name: 'Viewdetails',query: {id: res.data}}) + // console.log(res); + + } } } </script> @@ -920,7 +951,6 @@ .pagination { display: flex; - margin-top: 20px; justify-content: end; } diff --git a/src/views/inspectionManagement/commissionInspection/addCommision.vue b/src/views/inspectionManagement/commissionInspection/addCommision.vue index cbb7408..00c25ea 100644 --- a/src/views/inspectionManagement/commissionInspection/addCommision.vue +++ b/src/views/inspectionManagement/commissionInspection/addCommision.vue @@ -22,7 +22,8 @@ <el-table-column type="index" label="搴忓彿" min-width="10%" /> <el-table-column prop="sampleNumber" label="鏍峰搧缂栧彿" min-width="8%" /> <el-table-column prop="sampleName" label="鏍峰搧鍚嶇О" min-width="10%" /> - <el-table-column prop="specificationsModels" label="瑙勬牸鍨嬪彿" min-width="10%" /> + <el-table-column prop="speName" label="瑙勬牸鍨嬪彿" min-width="10%" > + </el-table-column> <el-table-column prop="unit" label="鍗曚綅" min-width="8%" /> <el-table-column prop="samplesNumber" label="鏁伴噺" min-width="8%" /> <!-- <el-table-column prop="addway" label="娣诲姞鏂瑰紡" min-width="8%"> @@ -228,7 +229,8 @@ addInspection, isIfViewUUID, getProductList, - getContractsSampleInfo + getContractsSampleInfo, + getSpecificationsName } from '@/api/inspection/commisioninspection' export default { data() { @@ -342,7 +344,6 @@ let res = await getContractsSampleInfo({ viewId }) - console.log(res.data); }, async getSampleName() { const res = await getSampleName() @@ -384,7 +385,8 @@ samplesNumber: '', remarks: '', experiment: [], - addway: '' + addway: '', + speName: '' } }, async submitInspection() { @@ -406,7 +408,8 @@ reportNumber: parseInt(this.infoForm.num), sampleDeliveryMode: sampledeliveryway, sampleDeliveryPhone: this.infoForm.sendertel, - sampleSender: this.infoForm.sender + sampleSender: this.infoForm.sender, + speName: this.infoForm.speName }) this.infoForm.commisioncode = res.data if (res.data) { @@ -444,6 +447,11 @@ return item.name }) }) + this.model_sta_options.forEach(a=>{ + if(a.key == val){ + this.addPointerForm.speName = a.value + } + }) }, getContractsSampleInfo() { getContractsSampleInfo({ @@ -467,7 +475,7 @@ } this.detectionInfo = res.data.linkDetectionList }) - } + }, } } </script> diff --git a/src/views/inspectionManagement/reportForInspection/index.vue b/src/views/inspectionManagement/reportForInspection/index.vue index b6a1fdb..c2cbe46 100644 --- a/src/views/inspectionManagement/reportForInspection/index.vue +++ b/src/views/inspectionManagement/reportForInspection/index.vue @@ -29,18 +29,32 @@ </el-form> </div> <el-dialog title="鏂板鍘熸潗鏂欐姤妫�" :visible.sync="addReportVisible" width="40%"> - <el-form v-model="insertData" label-position="left" label-width="80px"> - <el-form-item label="鏍囧噯绫诲瀷"> - <el-input v-model="insertData.materialName" /> + <el-form ref="addMaterialForm" :rules="insertRule" :model="insertData" :inline="true" label-position="right" + label-width="80px"> + <el-form-item label="鏉ユ枡鏃ユ湡:" prop="fromDate"> + <el-date-picker v-model="insertData.fromDate" type="date" value-format="yyyy-MM-dd"></el-date-picker> </el-form-item> - <el-form-item label="鐗╂枡鍚嶇О"> - <el-input v-model="insertData.materialName" /> + <el-form-item label="渚涜揣鍟嗗悕绉�:" prop="supplierName"> + <el-input v-model="insertData.supplierName" /> </el-form-item> - <el-form-item label="鎵ц鏍囧噯"> - <el-input v-model="insertData.standardName" /> + <el-form-item label="鏉愭枡鍚嶇О:" prop="mName"> + <el-select v-model="insertData.mName" placeholder="璇烽�夋嫨鏉愭枡鍚嶇О" @change="(val)=>{getSpecification(val)}"> + <el-option v-for="(item,index) in materialList" :key="index" :label="item.name" + :value="item.id"></el-option> + </el-select> </el-form-item> - <el-form-item label="瑙勬牸鍨嬪彿"> - <el-input v-model="insertData.specificationsName" /> + <el-form-item label="鏉愭枡缂栫爜:" prop="mCode"> + <el-input disabled v-model="insertData.mCode" /> + </el-form-item> + <el-form-item label="瑙勬牸鍨嬪彿:" prop="specificationsNumber"> + <el-cascader v-model="insertData.specificationsNumber" :options="childrenOptions" + :props="{label: 'Name', value: 'Name'}" separator="-"></el-cascader> + </el-form-item> + <el-form-item label="鍗曚綅:" prop="unit"> + <el-input type="text" v-model="insertData.unit" /> + </el-form-item> + <el-form-item label="鏁伴噺:" prop="num"> + <el-input type="number" v-model="insertData.num"/> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> @@ -60,10 +74,9 @@ <el-button @click="addReportBtn" type="primary" size="mini" icon="el-icon-document" style="background-color: rgb(1, 102, 226);">鐢熸垚鎶ユ鍗�</el-button> </div> - </div> <div class="table-box"> - <el-table ref="inspectionTable" :max-height="800" :cell-style="{textAlign: 'center'}" + <el-table ref="inspectionTable" :max-height="600" :cell-style="{textAlign: 'center'}" :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" :data="inspectionTable" style="width: 100%" @selection-change="handleSelectionChange"> <el-table-column type="selection" :selectable="checkSelect" min-width="5%"> @@ -88,26 +101,44 @@ </el-table-column> <el-table-column label="鎿嶄綔" min-width="8%"> <template slot-scope="scope"> - <el-button type="text" size="small" @click="removeFun(scope.row)">鍒犻櫎</el-button> + <el-button type="text" size="small" @click="removeFun(scope.row,scope.$index)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> <!-- 鍒嗛〉鍣� --> <div> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" - :current-page="currentPage" :page-sizes="[5, 10, 15, 20]" :page-size="pageSize" + :current-page="currentPage" :page-sizes="[10, 15, 20,30]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> </div> </div> </div> </div> + <el-dialog title="閫夋嫨鏃ユ湡" :visible.sync="addReportDialog" width="30%"> + <el-form :model="addInspectionForm" :rules="addInspectionFormRules" rule="addInspectionForm"> + <el-form-item label="妫�楠屾棩鏈�" label-width="100px" prop="inspectionDate"> + <el-date-picker v-model="addInspectionForm.inspectionDate" type="daterange" value-format="yyyy-MM-dd" + range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"> + </el-date-picker> + </el-form-item> + <el-form-item label="鐗堟湰" label-width="100px" prop="version"> + <el-select v-model="addInspectionForm.version" placeholder="璇烽�夋嫨鐗堟湰"> + <el-option v-for="(item,index) in 5" :key="index" :value="item" :label="item"></el-option> + </el-select> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button @click="resetForm('addInspectionForm')">鍙� 娑�</el-button> + <el-button type="primary" @click="confirmBtn('addInspectionForm')">纭� 瀹�</el-button> + </div> + </el-dialog> <!-- 鐢熸垚鎶ユ鍗� --> <div class="newPage" v-if="showNewPage"> <!-- 鏂板椤甸潰 --> <div class="inspectionForm"> - <el-form :model="inspectionForm" ref="inspectionForm" label-position="right" label-width="100px" size="mini"> + <el-form :model="inspectionForm" label-position="right" label-width="100px" size="mini"> <div class="formwrapper"> <el-row> <el-col :span="8"> @@ -182,17 +213,19 @@ <el-table-column prop="testValue" label="妫�楠屽��" width="125"></el-table-column> <el-table-column prop="userName" label="妫�楠屼汉"> <template slot-scope="scope"> - <el-select v-model="scope.row.checker" size="small" slot="append" style="width: 260px;"> - <el-option v-for="(item,index) in checkeroptions" :key="index" :value="item.value" - :label="item.label">{{ item.label }}</el-option> + <el-select @blur="blurOptions(scope.row)" v-model="scope.row.check" size="small" slot="append" + style="width: 260px;"> + <el-option v-for="(item,index) in checkeroptions" :key="index" :value="item.id" + :label="item.name"></el-option> </el-select> </template> </el-table-column> <el-table-column prop="device" label="璇曢獙璁惧"> <template slot-scope="scope"> - <el-select v-model="scope.row.device" size="small" slot="append" style="width: 260px;"> - <el-option v-for="(item,index) in deviceoptions" :key="index" :value="item.value" - :label="item.label">{{ item.label }}</el-option> + <el-select @blur="blurOptions(scope.row)" v-model="scope.row.device" size="small" slot="append" + style="width: 260px;"> + <el-option v-for="(item,index) in deviceoptions" :key="index" :value="item.id" + :label="item.equipmentName"></el-option> </el-select> </template> </el-table-column> @@ -206,14 +239,32 @@ import { getRawMaterialList, addInspect, - selectInspectsListById + selectInspectsListById, + selectUser, + selectEquipment, + deleteMaterial, + addMaterial, + getMaterielName, + getSpecification } from '@/api/inspection/rawmaterial' export default { data() { return { - insertData: { - + userName: "", + devices: "", + addInspectionForm: { + inspectionDate: ['2023-08-01', '2023-08-31'], + version: 5 }, + addInspectionFormRules: { + inspectionDate: [{ + required: true, + message: '璇烽�夋嫨鏃ユ湡鍖洪棿', + trigger: 'change' + }], + }, + addReportDialog: false, + insertData: {}, addReportVisible: false, checked: false, resultData: {}, @@ -225,15 +276,36 @@ state: '', date: '' }, + childrenOptions: [{ + value: 'zhinan', + label: '鎸囧崡', + children: [{ + value: 'shejiyuanze', + label: '璁捐鍘熷垯', + children: [{ + value: 'yizhi', + label: '涓�鑷�' + }, { + value: 'fankui', + label: '鍙嶉' + }, { + value: 'xiaolv', + label: '鏁堢巼' + }, { + value: 'kekong', + label: '鍙帶' + }] + }] + }], options: [{ - value: 0, + value: null, label: '鍏ㄩ儴' }, { value: 1, - label: '宸叉楠�' + label: '宸叉姤妫�' }, { - value: 2, - label: '寰呮楠�' + value: 0, + label: '鏈姤妫�' }], deviceoptions: [{ value: 0, @@ -251,15 +323,15 @@ }], radioOptions: [{ label: '鍏ㄩ儴', - value: 0 + value: null }, { value: 1, - label: '宸叉楠�' + label: '宸叉姤妫�' }, { - value: 2, - label: '寰呮楠�' + value: 0, + label: '鏈姤妫�' }], - radioValue: 0, + radioValue: null, inspectionTable: [{ createTime: '2023-07-28', supplier_name: '鍥界綉灞变笢鐪佺數鍔涙湁闄愬叕鍙�', @@ -274,28 +346,103 @@ condition: 1 }], currentPage: 1, - pageSize: 5, + pageSize: 10, total: 20, data: '', showNewPage: false, inspectionForm: {}, - inspectionItems: [] + inspectionItems: [{ + index: 1, + name: "aaa", + unit: "KB", + required: "1", + internal: "2", + testValue: "3", + userName: "", + device: "" + }], + insertRule: { + fromDate: [{ + required: true, + message: '璇烽�夋嫨鏉ユ枡鏃ユ湡', + trigger: 'blur' + }], + supplierName: [{ + required: true, + message: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О', + trigger: 'blur' + }], + mName: [{ + required: true, + message: '璇烽�夋嫨鐗╂枡鍚嶇О', + trigger: 'blur' + }], + mCode: [{ + required: true, + message: '璇烽�夋嫨鐗╂枡', + trigger: 'blur' + }], + specificationsNumber: [{ + required: true, + message: '璇烽�夋嫨瑙勬牸鍨嬪彿', + trigger: 'blur' + }], + unit: [{ + required: true, + message: '璇疯緭鍏ュ崟浣�', + trigger: 'blur' + }], + num: [{ + required: true, + message: '璇疯緭鍏ユ姤妫�鏁伴噺', + trigger: 'blur' + }] + }, + materialList: [] } }, created() { this.getRawMaterialList() }, + mounted() { + this.getMaterielName() + }, methods: { - removeFun(row) { + handleChange() { + + }, + async deleteMaterialFun(row, index) { + let formData = new FormData(); + formData.append("deleteId", row.id) + await deleteMaterial(formData).then(() => { + this.inspectionTable.splice(index, 1); + this.$message.success("鍒犻櫎鎴愬姛"); + }).catch(error => { + this.$message.error(error.message); + }); + }, + blurOptions(row) { + console.log("鏇存柊", row); + }, + async initNewSelection() { + const res = await selectUser(); + const res2 = await selectEquipment(); + this.checkeroptions = res.data; + this.deviceoptions = res2.data; + }, + resetForm(formName) { + // this.addInspectionForm.inspectionDate = [], + // this.$refs[formName].resetFields(); + this.addReportDialog = false + }, + removeFun(row, index) { this.$confirm('纭鍒犻櫎璇ユ暟鎹悧?', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - this.$message({ - type: 'success', - message: '鍒犻櫎鎴愬姛!' - }); + console.log(row.id); + this.deleteMaterialFun(row, index); }).catch(() => {}); }, checkSelect(row, index) { @@ -310,40 +457,46 @@ }, //鐢熸垚鎶ユ鍗曟寜閽� addReportBtn() { - let arr = this.checkData; - if (arr.length < 1) { + if (this.checkData.length < 1) { this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�!"); } else { - if (arr.length > 1) { + if (this.checkData.length > 1) { this.$message.error("鏈�澶氶�夋嫨涓�鏉℃暟鎹�!"); } else { - //娣诲姞鎶ユ鍗� - let val = arr[0]; - let obj = { - "endTime": val.dateSurvey, - "experiment": "", - "formTime": val.createTime, - "id": val.id, - "mcode": val.materialCoding, - "name": val.materialName, - "num": val.quantity, - "specifications": val.specificationsModels, - "startTime": val.inspectionDate, - "supplier": val.supplierName, - "type": val.type, - "unit": val.unit, - "version": val.version - } - this.createReport(obj); - this.showNewPage = true; + this.addReportDialog = true; } } }, + //鐢熸垚鎶ユ鍗曠‘璁ゆ寜閽� + confirmBtn(formName) { + let dateArr = this.addInspectionForm.inspectionDate; + //娣诲姞鎶ユ鍗� + let val = this.checkData[0]; + let obj = { + "endTime": dateArr[1], + "experiment": "", + "formTime": val.createTime, + "id": val.id, + "mcode": val.materialCoding, + "name": val.materialName, + "num": val.quantity, + "specifications": val.specificationsModels, + "startTime": dateArr[0], + "supplier": val.supplierName, + "type": val.type, + "unit": val.unit, + "version": val.version + } + // this.createReport(obj); + this.addReportDialog = false; + this.initNewSelection(); + this.showNewPage = true; + }, //鐢熸垚鎶ヤ环鍗� async createReport(param) { - await addInspect(param); + let res = await addInspect(param); const res2 = await selectInspectsListById({ - id: 59 + id: res.data }); this.resultData = res2.data; this.inspectionForm = res2.data; @@ -363,7 +516,7 @@ async search() { this.radioValue = this.searchData.state const res = await getRawMaterialList({ - condition: this.searchData.state, + type: this.searchData.state, createTime: this.searchData.date, materialCoding: this.searchData.code, materialName: this.searchData.name, @@ -384,14 +537,19 @@ this.getRawMaterialList() }, radioclick() { - this.searchData.state = this.radioValue - this.inspectionTable = this.data.filter((item) => { - return item.condition === this.radioValue - }) + console.log(this.inspectionTable); if (this.radioValue === 0) { - this.inspectionTable = this.data + } - this.total = this.inspectionTable.length + }, + getAllTableData() { + this.getRawMaterialList() + }, + getCheckData() { + + }, + getUnCheckData() { + }, // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣 handleSizeChange(val) { @@ -407,6 +565,53 @@ this.getRawMaterialList({ pageNo: this.currentPage, pageSize: this.pageSize + }) + }, + insert() { + this.$refs['addMaterialForm'].validate((valid) => { + if (valid) { + var str = { + "dateSurvey": this.insertData.fromDate, + "materialCoding": this.insertData.mCode, + "materialName": this.insertData.mName, + "quantity": this.insertData.num, + "specificationsModels": this.insertData.specificationsNumber[0] + '-' + this.insertData + .specificationsNumber[1], + "supplierName": this.insertData.supplierName, + "type": 0, + "unit": this.insertData.unit + } + this.materialList.forEach(a => { + if (a.id == str.materialName) { + str.materialName = a.name + } + }) + addMaterial(str).then(res => { + this.$message.success('娣诲姞鎴愬姛') + this.addReportVisible = false + this.getRawMaterialList() + }) + } else { + return false; + } + }); + }, + getMaterielName() { + getMaterielName().then(res => { + this.materialList = res.data + }) + }, + getSpecification(val) { + this.materialList.forEach(a => { + if (a.id == val) { + this.insertData.mCode = a.code + } + }) + getSpecification({ + materialId: val + }).then(res => { + this.childrenOptions = JSON.parse(JSON.stringify(res.data).replaceAll('specifications', '').replaceAll( + 'model', '')) }) } } @@ -510,4 +715,4 @@ } } } -</style> +</style> \ No newline at end of file diff --git a/src/views/laboratory/gather/index.vue b/src/views/laboratory/gather/index.vue index cccf8cc..c7e421a 100644 --- a/src/views/laboratory/gather/index.vue +++ b/src/views/laboratory/gather/index.vue @@ -17,7 +17,7 @@ </el-form> </div> <div class="library-table"> - <el-card v-for="item in device" :key="index" class="box-card" style="width: 22.8%;"> + <el-card v-for="(item,index) in device" :key="index" class="box-card" style="width: 22.8%;"> <div class="header"> <div style="display: flex;justify-content: start; width: 100%;"> <div class="el-icon-set-up" style="font-size: 25px;color: rgb(103, 194, 58);line-height: 55px ;"></div> @@ -76,6 +76,14 @@ ] } }, + methods:{ + searchInspections(){ + + }, + reset(){ + + } + } } </script> diff --git a/src/views/laboratory/measure/Add.vue b/src/views/laboratory/measure/Add.vue index 0533251..889c813 100644 --- a/src/views/laboratory/measure/Add.vue +++ b/src/views/laboratory/measure/Add.vue @@ -5,26 +5,30 @@ </el-col> <el-col> <el-form :model="planAddInfo" style="padding-left: 150px;"> - <el-form-item> + <el-col> <el-col :span="6" style="display: flex;justify-content: space-around;"> - <span>璐熻矗浜猴細</span> - <el-select v-model="planAddInfo.measurePerson" placeholder="璇烽�夋嫨璐熻矗浜�"> - <el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value"> - </el-option> - </el-select> + <el-form-item label="璐熻矗浜猴細" :rules="[{ required: true, message: '璇烽�夋嫨璐熻矗浜�', trigger: 'change' }]"> + <el-select v-model="planAddInfo.measurePerson" placeholder="璇烽�夋嫨璐熻矗浜�"> + <el-option v-for="item in userList" :key="item.value" :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> </el-col> <el-col :span="8" style="display: flex;justify-content: space-around;"> - <span>璁″垝鏃堕棿锛�</span> - <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="鑷�" - start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"> - </el-date-picker> + <el-form-item label="璁″垝鏃堕棿锛�" :rules="[{ required: true, message: '璇烽�夋嫨璁″垝鏃堕棿', trigger: 'change' }]"> + <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="鑷�" + start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"> + </el-date-picker> + </el-form-item> </el-col> <el-col :span="5"></el-col> <el-col :span="5" style="display: flex;justify-content: space-around;"> - <span>璁¢噺鍗曚綅锛�</span> - <el-input style="width: 150px;" v-model="planAddInfo.unit" placeholder=""></el-input> + <el-form-item label="璁¢噺鍗曚綅锛�"> + <el-input style="width: 150px;" v-model="planAddInfo.unit" placeholder=""></el-input> + </el-form-item> </el-col> - </el-form-item> + </el-col> </el-form> </el-col> <el-col> @@ -47,7 +51,8 @@ <el-table-column prop="equipmentPointName" label="浠櫒璁惧" min-width="150"> <template slot-scope="scope"> <span v-show="!codePointesTableStatus">{{ scope.row.equipmentPointName }}</span> - <el-select @change="insListChange(scope.row.equipmentPointName,scope)" v-model="scope.row.equipmentPointName" placeholder="璇烽�夋嫨浠櫒璁惧"> + <el-select @change="insListChange(scope.row.equipmentPointName, scope)" + v-model="scope.row.equipmentPointName" placeholder="璇烽�夋嫨浠櫒璁惧"> <el-option v-for="item in insList" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> @@ -95,6 +100,7 @@ getListUserAndListIns, addPlanAndMeasure } from '@/api/laboratory/measure' import { dateFormat } from "../../../utils/dateUtil"; +import { MessageBox, Message } from 'element-ui' export default { data() { return { @@ -125,7 +131,7 @@ }], userList: [], insList: [], - instrumentList:[], + instrumentList: [], // 鐮佺偣琛ㄦ牸鐨勭姸鎬侊細鏁版嵁灞曠ずfalse/鏂板杈撳叆true codePointesTableStatus: false, } @@ -136,7 +142,7 @@ res.data.userList.forEach(element => { this.userList.push({ label: element.name, value: element.id }) }); - this.instrumentList=res.data.instrumentList + this.instrumentList = res.data.instrumentList res.data.instrumentList.forEach(item => { this.insList.push({ label: item.equipmentName, value: item.id }) }) @@ -161,21 +167,28 @@ }) }, async add() { - console.log(111111); + if (this.planAddInfo.measurePerson == null || this.planAddInfo.measurePerson == ''||this.planAddInfo.planDate[0]==null||this.planAddInfo.planDate[0]=='') { + Message({ + message: "璐熻矗浜哄拰璁″垝鏃ユ湡涓嶈兘涓虹┖锛�", + type: 'warning', + duration: 2 * 1000 + }) + return false + } this.planAddInfo.startTime = dateFormat(this.planAddInfo.planDate[0]) this.planAddInfo.endTime = dateFormat(this.planAddInfo.planDate[1]) console.log(this.planAddInfo); this.planAddInfo.planDate = null this.codePointsTable.forEach(item => { - if(item.endDate!=null&&item.endDate!=''){ + if (item.endDate != null && item.endDate != '') { item.endDate = dateFormat(item.endDate) } }) - console.log(this.codePointsTable); + console.log(this.codePointsTable); let data = {} - this.codePointsTable.length>0?data = { measureList: this.codePointsTable, plan: this.planAddInfo }:data = {plan: this.planAddInfo } + this.codePointsTable.length > 0 ? data = { measureList: this.codePointsTable, plan: this.planAddInfo } : data = { plan: this.planAddInfo } let add = await addPlanAndMeasure(data) - this.planAddInfo={ + this.planAddInfo = { plannedOrderNumber: '', measurePerson: '', planDate: "", @@ -183,17 +196,17 @@ createPerson: '', createTime: '' } - this.codePointsTable=[] + this.codePointsTable = [] return add.data }, - insListChange(i,s){ + insListChange(i, s) { console.log(i); console.log(s.$index); - let ins= this.instrumentList.filter(item=>{ - return item.id==i + let ins = this.instrumentList.filter(item => { + return item.id == i })[0] - this.codePointsTable[s.$index].measuringRange=ins.measuringRange - this.codePointsTable[s.$index].termValidity=ins.termValidity+'鏈�' + this.codePointsTable[s.$index].measuringRange = ins.measuringRange + this.codePointsTable[s.$index].termValidity = ins.termValidity + '鏈�' } } } diff --git a/src/views/laboratory/measure/index.vue b/src/views/laboratory/measure/index.vue index d70dd9c..1bb43b8 100644 --- a/src/views/laboratory/measure/index.vue +++ b/src/views/laboratory/measure/index.vue @@ -7,6 +7,9 @@ <el-input v-model="searchData.code" @blur="blurSearch()" class="input-form" placeholder="璇疯緭鍏�"> </el-input> </el-form-item> + <el-form-item v-if="this.radioValue === 1"> + <el-button type="primary" @click="searchPlan">鏌ヨ</el-button> + </el-form-item> <el-form-item v-if="this.radioValue === 0" :label="this.radioValue === 0 ? '浠櫒璁惧鍚嶇О:' : '璁惧鍚嶇О'" class="sermargin"> <el-input v-model="searchData.name" class="input-form" placeholder="璇疯緭鍏�"> @@ -70,10 +73,10 @@ <el-table-column prop="name" label="璐熻矗浜�" min-width="10%" /> <el-table-column prop="createTime" label="鍒涘缓鏃ユ湡" min-width="10%" /> <el-table-column prop="name" label="鍒涘缓浜�" min-width="8%" /> - <el-table-column prop="code" label="璁¢噺缂栧彿" min-width="8%" /> + <el-table-column prop="code" label="璁¢噺缂栧彿" min-width="12%" /> <el-table-column label="鎿嶄綔" min-width="15%"> <template slot-scope="scope"> - <el-button type="text" @click="lookMeasurement(scope.row.equipmentCode)" size="small">鏌ョ湅璁¢噺灞ュ巻</el-button> + <!-- <el-button type="text" @click="lookMeasurement(scope.row.equipmentCode)" size="small">鏌ョ湅璁¢噺灞ュ巻</el-button> --> <el-button type="text" size="small">鏌ョ湅闄勪欢</el-button> </template> </el-table-column> @@ -109,7 +112,7 @@ </el-table-column> </el-table> <!-- 鍒嗛〉鍣� --> - <div style="display: flex;justify-content: end;"> + <div style="display: flex;justify-content: end;padding: 10px 0;"> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5, 10, 20]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> @@ -118,9 +121,12 @@ </div> </div> <div> - <el-button v-if="selectInfoBtn" @click="combackLookPlan" style="position: fixed;top: 43px;right: 14px; z-index: 1000;" type="primary" icon="el-icon-refresh-left" size="mini" plain >杩斿洖</el-button> - <div v-if="addBtn" style="display: flex;justify-content: center;width: 10%;position: fixed;top: 43px;right: 14px; z-index: 1000;"> - <el-button @click="addTop = -82;addBtn=false" size="mini" style="width: 60px;" >杩斿洖</el-button> + <el-button v-if="selectInfoBtn" @click="combackLookPlan" + style="position: fixed;top: 43px;right: 14px; z-index: 1000;" type="primary" icon="el-icon-refresh-left" + size="mini" plain>杩斿洖</el-button> + <div v-if="addBtn" + style="display: flex;justify-content: center;width: 10%;position: fixed;top: 43px;right: 14px; z-index: 1000;"> + <el-button @click="addTop = -82; addBtn = false" size="mini" style="width: 60px;">杩斿洖</el-button> <el-button size="mini" @click="measureAdd" style="width: 60px;" type="primary">淇濆瓨</el-button> </div> </div> @@ -378,13 +384,19 @@ this.measureUpInfo.remarks = scope.row.remarks this.measureUpInfo.termValidity = scope.row.termValidity }, - measureAdd() { + async measureAdd() { + let res = await this.$refs.add.add() + if (!res) { + return + } this.addTop = -82 - this.$message({ - message: '鎿嶄綔鎴愬姛锛�', - type: 'success' - }); - this.lookVisible = false + this.$message({ + message: '鎿嶄綔鎴愬姛锛�', + type: 'success' + }); + this.lookVisible = false + this.addBtn = false + this.limitGetPlanMeasureInstrument() }, async handleSizeChangePlan(num) { this.pageSizePlan = num @@ -399,7 +411,7 @@ this.addTop = 2 this.lookVisible = true this.$parent.mainShowAdd() - this.addBtn=true + this.addBtn = true }, async limitGetPlanMeasureInstrument() { let param = { @@ -418,7 +430,7 @@ this.getPlanAndInfoAndIns(id) this.lookVisible = true this.mymodelTop = 2 - this.selectInfoBtn=true + this.selectInfoBtn = true this.$parent.triggerMainBtnPlan() }, async getPlanAndInfoAndIns(id) { @@ -440,7 +452,7 @@ combackLookPlan() { this.lookVisible = false this.mymodelTop = -1000 - this.selectInfoBtn=false + this.selectInfoBtn = false }, blurSearch() { if (this.radioValue === 1) { @@ -495,6 +507,9 @@ search() { this.getStandingPageList() }, + searchPlan(){ + this.getPlanPageList() + }, reset(formName) { this.searchData.name = '' this.searchData.code = '' @@ -506,8 +521,9 @@ }, async getPlanPageList() { let param = { - currentPage: this.currentPage, pageSize: this.pageSize, - code: this.searchData.code, name: this.searchData.name, unit: this.searchData.measureunit + currentPage: this.currentPage, + pageSize: this.pageSize, + plannedOrderNumber: this.searchData.code } const res = await getPlanPageList(param) res.data.list.forEach(item => { -- Gitblit v1.9.3