From 9b26870265cbbc75bcd32529e46b229a49ec30a0 Mon Sep 17 00:00:00 2001 From: value <z1292839451@163.com> Date: 星期二, 05 九月 2023 11:29:23 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/experiment/passRateStatistics/index.vue | 8 src/views/experiment/reportAuditing/index.vue | 26 - src/views/laboratory/measure/index.vue | 14 src/views/experiment/inspectionApplication/index.vue | 15 src/views/standardLibrary/index.vue | 6 src/views/CNAS/nonConformanceManage/index.vue | 4 src/views/laboratory/role/index.vue | 10 src/views/inspectionManagement/reportForInspection/index.vue | 203 +++++++++++-------- src/views/experiment/nonConformanceReview/index.vue | 4 src/views/experiment/nonConformingFeedback/index.vue | 4 src/views/laboratory/personnel/index.vue | 64 ++++- src/views/CNAS/reviewAnnualPlan/index.vue | 4 src/utils/GlobalClickMixin.js | 14 .env.development | 2 .env.production | 2 src/views/laboratory/ledger/index.vue | 91 ++++---- src/views/message/toDo/index.vue | 4 src/views/laboratory/organizational/index.vue | 6 src/views/CNAS/satisfactionSurveys/index.vue | 4 src/views/experiment/checkTheReport/index.vue | 28 +- src/views/experiment/inspectionApplication/Viewdetails/index.vue | 4 src/views/inspectionManagement/commissionInspection/index.vue | 51 +++- 22 files changed, 328 insertions(+), 240 deletions(-) diff --git a/.env.development b/.env.development index f67d7cb..ab9be2d 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,4 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://192.168.73.111:1234/' +VUE_APP_BASE_API = 'http://localhost:1234/' diff --git a/.env.production b/.env.production index b1d6aa4..dd72fa5 100644 --- a/.env.production +++ b/.env.production @@ -3,5 +3,5 @@ # base api # VUE_APP_BASE_API = '/prod-api' -VUE_APP_BASE_API = 'http://192.168.137.138:1234/' +VUE_APP_BASE_API = 'http://localhost:1234/' diff --git a/src/utils/GlobalClickMixin.js b/src/utils/GlobalClickMixin.js index 1d5f8aa..6b7752f 100644 --- a/src/utils/GlobalClickMixin.js +++ b/src/utils/GlobalClickMixin.js @@ -10,13 +10,13 @@ methods: { $_handleGlobalClick(event) { if (event.target.tagName === 'SPAN'||event.target.tagName==='BUTTON') { - if(sessionStorage.getItem('user')===undefined&&sessionStorage.getItem('user')===null){ - return; - } - let user=JSON.parse(sessionStorage.getItem('user')); - if(user.account === 'admin'&&user.sessionLayerId === 'f5c8bcb7d5a0fd27e2323280f7e98cad'){ - return; - } + // if(sessionStorage.getItem('user')===undefined&&sessionStorage.getItem('user')===null){ + // return; + // } + // let user=JSON.parse(sessionStorage.getItem('user')); + // if(user.account === 'admin'&&user.sessionLayerId === 'f5c8bcb7d5a0fd27e2323280f7e98cad'){ + // return; + // } // console.log(this.$router.currentRoute); // console.log(user.role.roleMenuList); // console.log(event.target.innerText); diff --git a/src/views/CNAS/nonConformanceManage/index.vue b/src/views/CNAS/nonConformanceManage/index.vue index 18c1c72..45b5388 100644 --- a/src/views/CNAS/nonConformanceManage/index.vue +++ b/src/views/CNAS/nonConformanceManage/index.vue @@ -56,8 +56,8 @@ <el-table ref="recordTable" :max-height="800" - :cell-style="{textAlign: 'center'}" - :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" + :cell-style="{textAlign: 'left'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" :data="recordTable" style="width: 100%" > diff --git a/src/views/CNAS/reviewAnnualPlan/index.vue b/src/views/CNAS/reviewAnnualPlan/index.vue index e99d7f6..8e7a09c 100644 --- a/src/views/CNAS/reviewAnnualPlan/index.vue +++ b/src/views/CNAS/reviewAnnualPlan/index.vue @@ -279,13 +279,13 @@ ref="auditTable" border :max-height="800" - :cell-style="{ textAlign: 'center' }" + :cell-style="{ textAlign: 'left' }" :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', - textAlign: 'center', + textAlign: 'left', }" :data="auditTable" style="width: 100%" diff --git a/src/views/CNAS/satisfactionSurveys/index.vue b/src/views/CNAS/satisfactionSurveys/index.vue index c89b437..98bf3c6 100644 --- a/src/views/CNAS/satisfactionSurveys/index.vue +++ b/src/views/CNAS/satisfactionSurveys/index.vue @@ -33,8 +33,8 @@ </div> <div class="library-table"> <div class="table-box"> - <el-table ref="tableData" :max-height="800" :cell-style="{ textAlign: 'center' }" - :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" + <el-table ref="tableData" :max-height="800" :cell-style="{ textAlign: 'left' }" + :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }" :data="tableData" style="width: 100%"> <el-table-column prop="id" type="index" label="搴忓彿" min-width="20%"/> <el-table-column prop="surveyDate" label="璋冩煡鏃ユ湡" min-width="10%" /> diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue index 9552c34..97a2491 100644 --- a/src/views/experiment/checkTheReport/index.vue +++ b/src/views/experiment/checkTheReport/index.vue @@ -26,10 +26,9 @@ <div class="search-bar"> <el-radio-group v-model="checkStatus" @change="handleRadioChange"> <el-radio-button>鍏ㄩ儴</el-radio-button> - <el-radio-button label="0">寰呮彁浜�</el-radio-button> - <el-radio-button label="1">寰呭鏍�</el-radio-button> - <el-radio-button label="2">寰呯瀛�</el-radio-button> - <el-radio-button label="3">宸插畬鎴�</el-radio-button> + <el-radio-button label="0">寰呭鏍�</el-radio-button> + <el-radio-button label="1">寰呯瀛�</el-radio-button> + <el-radio-button label="2">宸插畬鎴�</el-radio-button> </el-radio-group> <el-checkbox v-model="checked" style="margin-left: 20px">浠呯湅鎴戠殑</el-checkbox> </div> @@ -44,12 +43,12 @@ </div> </el-dialog> <div class="table-box"> - <el-table ref="reportTable" :max-height="800" :cell-style="{ textAlign: 'center' }" :header-cell-style="{ + <el-table ref="reportTable" :max-height="800" :cell-style="{ textAlign: 'left' }" :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', - textAlign: 'center', + textAlign: 'left', }" :data="reportTable" @selection-change="handleSelectionChange" style="width: 100%"> <el-table-column type="selection" min-width="5%" /> <el-table-column prop="type" label="鎶ュ憡绫诲瀷" min-width="5%"> @@ -86,15 +85,14 @@ <el-table-column prop="status" label="瀹℃壒鐘舵��" min-width="8%"> <template slot-scope="scope"> <span> - <el-tag type="info">{{ - scope.row.status == 0 - ? "寰呮彁浜�" - : scope.row.status == 1 - ? "寰呭鏍�" - : scope.row.status == 2 - ? "浠g瀛�" - : "宸插畬鎴�" - }}</el-tag> + <el-tag type="info"> + {{ + scope.row.status == 0 + ? "寰呭鏍�" + : scope.row.status == 1 + ? "浠g瀛�" : "宸插畬鎴�" + }} + </el-tag> </span> </template></el-table-column> <el-table-column prop="conclusion" label="妫�楠岀粨璁�" min-width="8%"> diff --git a/src/views/experiment/inspectionApplication/Viewdetails/index.vue b/src/views/experiment/inspectionApplication/Viewdetails/index.vue index 4799074..9be8f3f 100644 --- a/src/views/experiment/inspectionApplication/Viewdetails/index.vue +++ b/src/views/experiment/inspectionApplication/Viewdetails/index.vue @@ -174,7 +174,7 @@ id: row.id, userProId: val }).then(res => { - if (res.data) this.$message.success('璐d换浜哄垎閰嶆垚鍔�') + this.$message.success('璐d换浜哄垎閰嶆垚鍔�') }) }, chooseEquipment(val, row) { @@ -182,7 +182,7 @@ id: row.id, equipmentId: val[2] }).then(res => { - if (res.data) this.$message.success('璁惧鍒嗛厤鎴愬姛') + this.$message.success('璁惧鍒嗛厤鎴愬姛') }) } } diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue index be7fb86..5f63b6c 100644 --- a/src/views/experiment/inspectionApplication/index.vue +++ b/src/views/experiment/inspectionApplication/index.vue @@ -41,8 +41,8 @@ <div class="library-table"> <div class="table-box"> <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'}" + :cell-style="{textAlign: 'left'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" :data="inspectionTable"> <el-table-column type="selection" min-width="30px" /> <el-table-column prop="icode" label="鐢宠鍗曞彿" min-width="160px" /> @@ -338,10 +338,8 @@ <el-table-column prop="surveyor" label="妫�楠屼汉" min-width="8%" /> <el-table-column prop="startTime" label="妫�楠屾棩鏈�" min-width="8%" /> <el-table-column prop="type" label="鐘舵��" min-width="8%"> - <template slot-scope="scope"> - <span :style="{ color: scope.row.state === type ? 'green' : 'red' }"> - {{ scope.row.state===1 ? '宸叉娴�':'寰呮娴�' }} - </span> + <template> + <span style="color: red">寰呮楠�</span> </template> </el-table-column> </el-table> @@ -649,7 +647,10 @@ checkdate.push(item['updateTime']) item['checkdate'] = checkdate // 妫�楠屾棩鏈� }) - this.rawMaterialTable = res.data + let arr = res.data.filter((val)=>{ + return val.type === 0; + }) + this.rawMaterialTable = arr }) } else if (this.type === 1) { this.commisionVisible = true diff --git a/src/views/experiment/nonConformanceReview/index.vue b/src/views/experiment/nonConformanceReview/index.vue index 5eab166..5a8bf92 100644 --- a/src/views/experiment/nonConformanceReview/index.vue +++ b/src/views/experiment/nonConformanceReview/index.vue @@ -41,8 +41,8 @@ </div> <div class="library-table"> <div class="table-box"> - <el-table ref="tableData" :max-height="800" :cell-style="{ textAlign: 'center' }" - :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" + <el-table ref="tableData" :max-height="800" :cell-style="{ textAlign: 'left' }" + :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }" :data="tableData" style="width: 100%"> <el-table-column type="selection" label="" min-width="5%" /> <el-table-column label="鏍峰搧缂栧彿" min-width="10%"> diff --git a/src/views/experiment/nonConformingFeedback/index.vue b/src/views/experiment/nonConformingFeedback/index.vue index 2c58565..c59f54c 100644 --- a/src/views/experiment/nonConformingFeedback/index.vue +++ b/src/views/experiment/nonConformingFeedback/index.vue @@ -41,8 +41,8 @@ </div> <div class="library-table"> <div class="table-box"> - <el-table ref="tableData" :max-height="800" :cell-style="{ textAlign: 'center' }" - :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" + <el-table ref="tableData" :max-height="800" :cell-style="{ textAlign: 'left' }" + :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }" :data="tableData" style="width: 100%"> <el-table-column type="selection" label="" min-width="5%" /> <el-table-column label="鏍峰搧缂栧彿" min-width="10%"> diff --git a/src/views/experiment/passRateStatistics/index.vue b/src/views/experiment/passRateStatistics/index.vue index bf2c28a..ce5fd7a 100644 --- a/src/views/experiment/passRateStatistics/index.vue +++ b/src/views/experiment/passRateStatistics/index.vue @@ -29,7 +29,7 @@ </el-form-item> <div class="rightBtn"> <el-form-item> - <el-button type="primary" plain size="mini">娓呯┖</el-button> + <el-button type="primary" @click="clear" plain size="mini">娓呯┖</el-button> <el-button type="primary" @click="search" size="mini">鏌ヨ</el-button> </el-form-item> </div> @@ -160,6 +160,12 @@ console.log("涓荤嚎绋�"+index); } }, + clear(){ + this.searchData.date=[] + this.searchData.type=null + this.searchData.supplier=null + this.searchData.code=null + }, async search() { this.testSampleStatistics = null this.supplierNoPassStatistics = null diff --git a/src/views/experiment/reportAuditing/index.vue b/src/views/experiment/reportAuditing/index.vue index cfe3239..fab1979 100644 --- a/src/views/experiment/reportAuditing/index.vue +++ b/src/views/experiment/reportAuditing/index.vue @@ -14,14 +14,6 @@ <el-button type="primary" @click="getData()">鏌ヨ</el-button> <el-button type="primary" plain @click="resetData()">閲嶇疆</el-button> </el-form-item> - <el-dropdown> - <span class="el-dropdown-link"> - 楂樼骇鎼滅储<i class="el-icon-arrow-down el-icon--right"></i> - </span> - <el-dropdown-menu slot="dropdown"> - <el-dropdown-item>楂樼骇鎼滅储</el-dropdown-item> - </el-dropdown-menu> - </el-dropdown> </el-form> </div> <div class="library-table"> @@ -41,13 +33,13 @@ <el-table ref="reportTable" :max-height="800" - :cell-style="{ textAlign: 'center' }" + :cell-style="{ textAlign: 'left' }" :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', - textAlign: 'center', + textAlign: 'left', }" :data="reportTable" style="width: 100%" @@ -79,9 +71,9 @@ <el-table-column prop="status" label="瀹℃壒鐘舵��" min-width="8%" v-model="Auditconclusion"> <template slot-scope="scope"> <span> - <el-tag :color="scope.row.status == 0 ? '' : 'rgb(187, 237, 221)'" type="warning">{{ - scope.row.status == 0 ? "寰呴�氳繃" : "閫氳繃" - }}</el-tag> + <el-tag type="warning" v-if="scope.row.status === 0">寰呴�氳繃</el-tag> + <el-tag type="success" v-else-if="scope.row.status === 1">閫氳繃</el-tag> + <el-tag type="danger" v-else>涓嶉�氳繃</el-tag> </span> </template></el-table-column > @@ -192,7 +184,7 @@ async checkskip(row) { console.log(this.tableRow); this.reportTable[this.tableRow.$index].status=1 - this.transmitData(this.tableRow.row.id) + this.transmitData(this.tableRow.row.id,1) this.checkskipvisible= false this.$message({ message: '閫氳繃鎴愬姛', @@ -204,7 +196,7 @@ async nocheckskip(row) { console.log(this.tableRow); this.reportTable[this.tableRow.$index].status=0 - this.transmitData(this.tableRow.row.id) + this.transmitData(this.tableRow.row.id,2) this.checkskipvisible= false this.$message({ message: '寰呴�氳繃', @@ -213,8 +205,8 @@ }, //瀹℃牳 - async transmitData(id) { - let param={"id":id,"result":2} + async transmitData(id, result) { + let param={"id":id,"result":result} let data = await checkApi(param) }, // 鏌ヨ鍒楄〃 diff --git a/src/views/inspectionManagement/commissionInspection/index.vue b/src/views/inspectionManagement/commissionInspection/index.vue index 783bb85..cf60294 100644 --- a/src/views/inspectionManagement/commissionInspection/index.vue +++ b/src/views/inspectionManagement/commissionInspection/index.vue @@ -1,6 +1,6 @@ <template> <div> - <div v-if="!showDetail"> + <div> <div class="content-main"> <div class="top-bar"> <el-form ref="form" :inline="true" :model="searchData"> @@ -24,19 +24,19 @@ </el-form-item> </el-form> <el-form> - <el-popover placement="left" width="350" trigger="click"> + <el-popover placement="left" width="400" trigger="click"> <div class="vue_qr_div"> <el-row> <el-col> <el-input v-model="view" readonly size="medium" style="width: 250px;margin-right: 10px;"></el-input> - <el-button size="small" type="primary" v-if="viewId==null" @click="viewDia=true">鐢熸垚</el-button> - <el-button size="small" type="primary" v-else-if="viewId!=null" @click="copy">澶嶅埗</el-button> + <el-button size="small" type="primary" @click="viewDia=true">鐢熸垚</el-button> + <el-button size="small" type="primary" @click="copy">澶嶅埗</el-button> </el-col> </el-row> <el-row style="margin-top: 10px;"> <el-col v-if="viewId==null">褰撳墠閾炬帴宸茶繃鏈燂紝璇风偣鍑荤敓鎴愭寜閽噸鏂扮敓鎴�</el-col> <el-col - v-else-if="viewId!=null">褰撳墠閾炬帴灏嗗湪{{(parseInt(viewTime)/60/60)>1?(parseInt(viewTime)/60/60).toFixed(1)+'灏忔椂':Math.round(parseInt(viewTime)/60)+'鍒嗛挓'}}鍚庤繃鏈�</el-col> + v-else-if="viewId!=null">褰撳墠閾炬帴灏嗗湪{{(parseInt(viewTime2)/60/60)>1?(parseInt(viewTime2)/60/60).toFixed(1)+'灏忔椂':Math.round(parseInt(viewTime2)/60)+'鍒嗛挓'}}鍚庤繃鏈�</el-col> </el-row> </div> <el-button slot="reference" class="rightBtn" type="primary" @click="goToaddCommision">鏂板濮旀墭</el-button> @@ -58,8 +58,8 @@ </div> </div> <div class="table-box"> - <el-table ref="commisionTable" :max-height="800" :cell-style="{textAlign: 'center'}" - :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" + <el-table ref="commisionTable" :max-height="800" :cell-style="{textAlign: 'left'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" :data="commisionTable" @selection-change="handleSelectionChange" style="width: 100%"> <el-table-column type="selection" :selectable="checkSelect" min-width="10%" /> <el-table-column type="index" label="搴忓彿" min-width="10%" /> @@ -97,9 +97,6 @@ </div> </div> </div> - </div> - <div v-else> - <router-view /> </div> <el-dialog title="閾炬帴鏃堕暱璁剧疆" :visible.sync="viewDia" width="30%"> <div> @@ -228,7 +225,15 @@ view: null, viewId: null, viewTime: 1, + viewTime2: 1, viewDia: false + } + }, + watch:{ + addReportDialog(newVal){ + if(newVal === false){ + this.resetForm("addInspectionForm"); + } } }, created() { @@ -254,11 +259,13 @@ }, handleSelectionChange(val) { if (val.length > 1) { + let data = val.pop(); this.$refs.commisionTable.clearSelection(); - this.$refs.commisionTable.toggleRowSelection(val.pop()) + this.$refs.commisionTable.toggleRowSelection(data); + this.checkData = data; + }else{ + this.checkData = val; } - this.checkData = val; - console.log(this.checkData); }, //鐢熸垚鎶ユ鍗曠‘璁ゆ寜閽� confirmBtn(formName) { @@ -288,10 +295,13 @@ }, //鐢熸垚鎶ユ鍗曡姹� async createReport(param) { - let res = await addInspect(param); - if(res.data==null)return - this.$message.success('鎶ユ鎴愬姛') - this.$router.push(`/experiment/Viewdetails/${res.data}`) + await addInspect(param).then(res =>{ + this.search(); + this.$message.success('鎶ユ鎴愬姛') + this.$router.push(`/experiment/Viewdetails/${res.data}`) + }).catch(()=>{ + this.$message.error('鎶ユ澶辫触') + }); }, //鐢熸垚鎶ユ鍗曟寜閽� addReportBtn() { @@ -328,7 +338,10 @@ specifications : specifications, version: version }).then((res)=>{ - console.log(res); + var data = res.data; + for(var i=0;i<data.length;i++){ + data[i].id = "0" + i; + } vm.standardLibraryData = res.data; }) }, @@ -463,7 +476,7 @@ }).then(res => { this.view = `${this.vueIp}addCommision/${res.data.id}` this.viewId = res.data.id - this.viewTime = res.data.time + this.viewTime2 = res.data.time }) }, getViewId() { diff --git a/src/views/inspectionManagement/reportForInspection/index.vue b/src/views/inspectionManagement/reportForInspection/index.vue index f89e215..c8db94d 100644 --- a/src/views/inspectionManagement/reportForInspection/index.vue +++ b/src/views/inspectionManagement/reportForInspection/index.vue @@ -8,7 +8,7 @@ </el-input> </el-form-item> <el-form-item label="鏉愭枡鍚嶇О:" class="sermargin"> - <el-input v-model="searchData.name" class="input-form" placeholder="璇疯緭鍏�"> + <el-input v-model="searchData.name" class="input-form" placeholder="璇疯緭鍏ユ潗鏂欏悕绉�"> </el-input> </el-form-item> <el-form-item label="鐘舵��:" class="sermargin"> @@ -18,8 +18,8 @@ </el-select> </el-form-item> <el-form-item label="鏉ユ枡鏃ユ湡:" style="margin-right: 20px;"> - <el-input v-model="searchData.date" class="input-form" placeholder="璇疯緭鍏�"> - </el-input> + <el-date-picker value-format="yyyy-MM-dd" v-model="searchData.date" class="input-form" placeholder="璇烽�夋嫨鏉ユ枡鏃ユ湡"> + </el-date-picker> </el-form-item> <el-form-item> <el-button type="primary" @click="search">鏌ヨ</el-button> @@ -48,13 +48,13 @@ </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> + :props="{label: 'Name', value: 'Id'}" 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-input type="number" min="0" v-model="insertData.num"/> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> @@ -70,9 +70,11 @@ </div> </div> <div class="table-box"> - <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 ref="inspectionTable" :max-height="450" :cell-style="{textAlign: 'left'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" + :data="inspectionTable" style="width: 100%" @selection-change="handleSelectionChange" + :default-sort = "{prop: 'createTime', order: 'descending'}" + > <el-table-column type="selection" :selectable="checkSelect" min-width="5%"></el-table-column> <el-table-column type="index" label="搴忓彿" min-width="8%" /> <el-table-column prop="dateSurvey" label="鏉ユ枡鏃ユ湡" min-width="8%" /> @@ -83,6 +85,7 @@ <el-table-column prop="unit" label="鍗曚綅" min-width="5%" /> <el-table-column prop="quantity" label="鏁伴噺" min-width="5%" /> <el-table-column prop="inspectionDate" label="鎶ユ鏃ユ湡" min-width="8%" /> + <el-table-column v-if="1===0" prop="createTime" label="鏃ユ湡" min-width="8%" /> <el-table-column prop="surveyor" label="妫�楠屼汉" min-width="8%" /> <el-table-column prop="type" label="鐘舵��" min-width="8%"> <template slot-scope="scope"> @@ -153,6 +156,7 @@ getChooseVersion, lookProByVer } from '@/api/inspection/rawmaterial' +import ItemVue from '@/layout/components/Sidebar/Item.vue' export default { data() { return { @@ -275,6 +279,13 @@ mounted() { this.getMaterielName(); }, + watch:{ + addReportDialog(newVal){ + if(newVal === false){ + this.resetForm("addInspectionForm"); + } + } + }, methods: { handleChange() { @@ -311,11 +322,14 @@ } }, handleSelectionChange(val) { - if (val.length > 1) { + if (val.length > 1) { + let data = val.pop(); this.$refs.inspectionTable.clearSelection(); - this.$refs.inspectionTable.toggleRowSelection(val.pop()) + this.$refs.inspectionTable.toggleRowSelection(data); + this.checkData = new Array(data); + }else{ + this.checkData = val; } - this.checkData = val; }, //鐢熸垚鎶ユ鍗曟寜閽� addReportBtn() { @@ -325,86 +339,95 @@ if (this.checkData.length > 1) { this.$message.error("鏈�澶氶�夋嫨涓�鏉℃暟鎹�!"); } else { - let mcode = this.checkData[0].materialCoding; - let name = this.checkData[0].materialName; - let specifications = this.checkData[0].specificationsModels; - this.getChooseVersionFun(mcode,name,specifications); + let mcode = this.checkData[0].materialCoding; + let name = this.checkData[0].materialName; + let speId = this.checkData[0].specificationsId; + this.getChooseVersionFun(mcode,name,speId); this.addReportDialog = true; } } }, - changeVersionFun(){ - let mCode = this.checkData[0].materialCoding; - let name = this.checkData[0].materialName; - let specifications = this.checkData[0].specificationsModels; - let version = this.addInspectionForm.version; - this.getProByVersion(mCode,name,specifications,version); - }, - //鑾峰彇鐗堟湰涓嬬殑鏍囧噯搴撴暟鎹� - async getProByVersion(mCode,name,specifications,version){ - var vm = this; - await lookProByVer({ - mcode : mCode, - name : name, - specifications : specifications, - version: version - }).then((res)=>{ - vm.standardLibraryData = res.data; - }) - - }, - //鑾峰彇鐗堟湰鍒楄〃 - async getChooseVersionFun(mCode,name,specifications){ - var vm = this; - this.chooseVersion = []; - await getChooseVersion({ - mcode : mCode, - name : name, - specifications : specifications - }).then((res)=>{ - vm.getProByVersion(mCode,name,specifications,res.data[0]) - for(let i=0;i<res.data.length;i++){ - vm.chooseVersion.push({ - value: res.data[i], - label: "V"+res.data[i] - }); - } - vm.addInspectionForm.version = res.data[0]; - }); - }, + changeVersionFun(){ + let mCode = this.checkData[0].materialCoding; + let name = this.checkData[0].materialName; + let specifications = this.checkData[0].specificationsModels; + let version = this.addInspectionForm.version; + this.getProByVersion(mCode,name,specifications,version); + }, + //鑾峰彇鐗堟湰涓嬬殑鏍囧噯搴撴暟鎹� + async getProByVersion(mCode,name,specifications,version){ + var vm = this; + await lookProByVer({ + mcode : mCode, + name : name, + specifications : specifications, + version: version + }).then((res)=>{ + var arr = res.data; + for(var i=0;i<arr.length;i++){ + arr[i].id = "0" + i; + } + vm.standardLibraryData = arr; + }) + + }, + //鑾峰彇鐗堟湰鍒楄〃 + async getChooseVersionFun(mCode,name,specifications){ + var vm = this; + this.chooseVersion = []; + await getChooseVersion({ + mcode : mCode, + name : name, + specifications : specifications + }).then((res)=>{ + vm.getProByVersion(mCode,name,specifications,res.data[0]) + for(let i=0;i<res.data.length;i++){ + vm.chooseVersion.push({ + value: res.data[i], + label: "V"+res.data[i] + }); + } + vm.addInspectionForm.version = res.data[0]; + }); + }, //鐢熸垚鎶ユ鍗曠‘璁ゆ寜閽� confirmBtn(formName) { - this.$refs[formName].validate((valid=>{ - if(valid){ - 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": this.addInspectionForm.version - } - this.createReport(obj); - this.addReportDialog = false; - } - })); + this.$refs[formName].validate((valid=>{ + if(valid){ + 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, + "specificationsId": val.specificationsId, + "startTime": dateArr[0], + "supplier": val.supplierName, + "type": val.type, + "unit": val.unit, + "version": this.addInspectionForm.version + } + // this.createReport(obj); + console.log("obj---",obj); + this.addReportDialog = false; + } + })); }, //鐢熸垚鎶ユ鍗� async createReport(param) { - let res = await addInspect(param); - if(res.data==null)return - this.$message.success('鎶ユ鎴愬姛') - this.$router.push(`/experiment/Viewdetails/${res.data}`) + await addInspect(param).then(res =>{ + this.search(); + this.$message.success('鎶ユ鎴愬姛') + this.$router.push(`/experiment/Viewdetails/${res.data}`) + }).catch(error =>{ + this.$message.error('鎶ユ澶辫触') + }); }, // 鑾峰彇鍒嗛〉鍒楄〃鏁版嵁 async getRawMaterialList() { @@ -458,13 +481,25 @@ insert() { this.$refs['addMaterialForm'].validate((valid) => { if (valid) { + console.log(this.childrenOptions); + console.log(this.insertData); + let f=this.childrenOptions.filter(item=>{ + return item.Id===this.insertData.specificationsNumber[0] + })[0] + console.log(f); + let fatherName=f.Name; + let c=f.children.filter(item=>{ + return item.Id===this.insertData.specificationsNumber[1] + })[0] + let sonName=c.Name + let specificationsId=c.Id; 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], + "specificationsModels": fatherName+ '-' + sonName, + "specificationsId": specificationsId, "supplierName": this.insertData.supplierName, "type": 0, "unit": this.insertData.unit diff --git a/src/views/laboratory/ledger/index.vue b/src/views/laboratory/ledger/index.vue index 131718c..fc09600 100644 --- a/src/views/laboratory/ledger/index.vue +++ b/src/views/laboratory/ledger/index.vue @@ -25,7 +25,7 @@ <div class="bom-item-search"> <el-row> <el-col :span="19"> - <el-input v-model="filterText" placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" /> + <el-input v-model="filterText" clearable placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" /> </el-col> <el-col :span="5"> <el-button type="primary" size="small" @click="addClassVisible = true"><i @@ -33,7 +33,7 @@ </el-col> </el-row> </div> - <el-tree ref="classTree" :data="classTree" :props="defaultProps" :default-expand-all="true" + <el-tree highlight-current="true" ref="classTree" :data="classTree" :props="defaultProps" :default-expand-all="true" :filter-node-method="filterNode" @node-click="nodeClickHandler" /> </div> <div class="library-table"> @@ -52,8 +52,8 @@ </div> </div> <div class="table-box"> - <el-table ref="equipmentTable" node-key="father_name" :cell-style="{ textAlign: 'center' }" - :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" + <el-table ref="equipmentTable" node-key="father_name" :cell-style="{ textAlign: 'left' }" + :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }" :data="equipmentTable" style="width: 100%;"> <el-table-column type="index" label="搴忓彿" min-width="90" /> <el-table-column prop="equipment_code" label="浠櫒璁惧缂栧彿" min-width="200" /> @@ -63,8 +63,11 @@ <el-table-column prop="termValidity" label="璁¢噺鎴鏈夋晥鏈�" min-width="200" /> <el-table-column prop="conditions" label="璁惧鐘舵��" min-width="120"> <template slot-scope="scope"> - <el-tag :type="scope.row.conditions === 0 ? 'primary' : 'success'" disable-transitions>{{ - scope.row.conditions | conditionsFilter }}</el-tag> + <el-tag v-if="scope.row.conditions === 1" type="success" disable-transitions>杩愯</el-tag> + <el-tag v-if="scope.row.conditions === 2" type="danger" disable-transitions>鏁呴殰</el-tag> + <el-tag v-if="scope.row.conditions === 3" type="warning" disable-transitions>鎶ヤ慨</el-tag> + <el-tag v-if="scope.row.conditions === 4" type="warning" disable-transitions>妫�淇�</el-tag> + <el-tag v-if="scope.row.conditions === 5" disable-transitions>寰呮満</el-tag> </template> </el-table-column> <el-table-column prop="storage_place" label="瀛樻斁鍦�" min-width="200" /> @@ -151,7 +154,7 @@ <span><i class="el-icon-edit" />楠屾敹鏃ユ湡锛歿{ equipmentDetail.acceptanceDate }}</span> </div> <div class="message-item"> - <span><i class="el-icon-edit" />淇濈浜猴細{{ equipmentDetail.userId }}</span> + <span><i class="el-icon-edit" />淇濈浜猴細{{ equipmentDetail.userName }}</span> </div> <div class="message-item"> <span><i class="el-icon-edit" />鏄惁鏀寔鏁伴噰锛歿{ equipmentDetail.whetherDataAcquisition == 1 ? '鏀寔' : '涓嶆敮鎸�' @@ -247,7 +250,7 @@ <el-row :gutter="50"> <el-col :span="11"> <el-form-item label="鎵�灞炲垎绫伙細" prop="classifyId" label-width="80" :rules="[ - { required: true, message: '璇烽�夋嫨鎵�灞炲垎绫�', trigger: 'change' } + { required: true, message: '璇烽�夋嫨鎵�灞炲垎绫�', trigger: 'blur' } ]"> <el-cascader style="width: 100%;" v-model="equipmentform.classifyId" :options="classTree" :show-all-levels="false" /> </el-form-item> @@ -268,7 +271,7 @@ </el-col> <el-col :span="11"> <el-form-item label="鐘舵�侊細" prop="conditions" - :rules="[{ required: true, message: '璇烽�夋嫨浠櫒璁惧鐘舵��', trigger: 'change' }]" label-width="80"> + :rules="[{ required: true, message: '璇烽�夋嫨浠櫒璁惧鐘舵��', trigger: 'blur' }]" label-width="80"> <el-select v-model="equipmentform.conditions" clearable filterable :allow-create="true" placeholder="璇烽�夋嫨浠櫒璁惧鐘舵��" style="width:100%"> <el-option v-for="item in conditionsOptions" :key="item.value" :label="item.label" @@ -310,7 +313,7 @@ </el-col> <el-col :span="11"> <el-form-item label="鍒拌揣鏃ユ湡锛�" label-width="80"> - <el-date-picker v-model="equipmentform.arrivalDate" type="date" placeholder="璇烽�夋嫨鍒拌揣鏃ユ湡" + <el-date-picker value-format="yyyy-MM-dd" v-model="equipmentform.arrivalDate" type="date" placeholder="璇烽�夋嫨鍒拌揣鏃ユ湡" style="width:100%" /> </el-form-item> </el-col> @@ -318,7 +321,7 @@ <el-row :gutter="50"> <el-col :span="11"> <el-form-item label="楠屾敹鏃ユ湡锛�" label-width="80"> - <el-date-picker v-model="equipmentform.acceptanceDate" type="date" placeholder="璇烽�夋嫨楠屾敹鏃ユ湡" + <el-date-picker value-format="yyyy-MM-dd" v-model="equipmentform.acceptanceDate" type="date" placeholder="璇烽�夋嫨楠屾敹鏃ユ湡" style="width:100%" /> </el-form-item> </el-col> @@ -348,7 +351,7 @@ <el-row v-show="equipmentform.equipmentMeasurement === 1" :gutter="50"> <el-col :span="12"> <el-form-item label="璁¢噺鎴鏈夋晥鏈燂細" label-width="80"> - <el-input v-model="equipmentform.termValidity" placeholder="璇峰~鍐欒閲忔湁鏁堟湡" type="number" /> + <el-input min="0" v-model="equipmentform.termValidity" placeholder="璇峰~鍐欒閲忔湁鏁堟湡" type="number" /> </el-form-item> </el-col> </el-row> @@ -372,7 +375,7 @@ <el-form label-position="top" ref="addmeasureForm" :model="measureForm"> <el-row :gutter="20"> <el-col :span="12"> - <el-form-item label="璐熻矗浜�" prop="userId" :rules="[{ required: true, message: '璇烽�夋嫨璐熻矗浜�', trigger: 'change' }]"> + <el-form-item label="璐熻矗浜�" prop="userId" :rules="[{ required: true, message: '璇烽�夋嫨璐熻矗浜�', trigger: 'blur' }]"> <el-select v-model="measureForm.userId" clearable filterable :allow-create="true" placeholder="璐熻矗浜�" style="width:100%"> <el-option v-for="item in userOpetions" :key="item.id" :label="item.label" :value="item.value" /> @@ -388,7 +391,7 @@ </el-row> <el-row :gutter="20"> <el-col :span="24"> - <el-form-item label="妫�瀹氭湁鏁堟湡" prop="date" :rules="[{ required: true, message: '璇烽�夋嫨妫�瀹氭湁鏁堟湡', trigger: 'change' }]"> + <el-form-item label="妫�瀹氭湁鏁堟湡" prop="date" :rules="[{ required: true, message: '璇烽�夋嫨妫�瀹氭湁鏁堟湡', trigger: 'blur' }]"> <el-date-picker v-model="measureForm.date" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" /> </el-form-item> @@ -402,7 +405,7 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="缁撴灉" prop="result" :rules="[{ required: true, message: '璇烽�夋嫨缁撴灉', trigger: 'change' }]"> + <el-form-item label="缁撴灉" prop="result" :rules="[{ required: true, message: '璇烽�夋嫨缁撴灉', trigger: 'blur' }]"> <el-select v-model="measureForm.result" clearable filterable :allow-create="true" placeholder="璇烽�夋嫨缁撴灉" style="width:100%"> <el-option v-for="item in resultOptions" :key="item.id" :label="item.label" :value="item.value" /> @@ -427,7 +430,7 @@ <el-row :gutter="20"> <el-col :span="24"> <el-form-item label=""> - <el-upload class="upload-demo" action="#" :on-change="handleUpload" :auto-upload="false"> + <el-upload ref="upload" class="upload-demo" action="#" :on-change="handleUpload" :auto-upload="false"> <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> </el-upload> </el-form-item> @@ -460,29 +463,7 @@ } from '@/api/laboratory/ledger' import { parseTime } from '@/utils/index' export default { - filters: { - conditionsFilter(value) { - let returnValue = null - switch (+value) { - case 1: - returnValue = '杩愯' - break - case 2: - returnValue = '鏁呴殰' - break - case 3: - returnValue = '鎶ヤ慨' - break - case 4: - returnValue = '妫�淇�' - break - case 5: - returnValue = '寰呮満' - break - } - return returnValue - } - }, + filters: {}, data() { return { // 鐢ㄦ埛涓嬫媺妗嗛厤缃」 @@ -627,6 +608,12 @@ watch: { filterText(val) { this.$refs.classTree.filter(val) + }, + measureFormVisible(newVal){ + if(newVal === false){ + this.measureForm.file = null; + this.$refs['upload'].clearFiles(); + } } }, created() { @@ -681,7 +668,7 @@ // 鑺傜偣鐐瑰嚮澶勭悊 nodeClickHandler(data, node, element) { this.nodeclicked = data - // console.log(data) + console.log(data) // 鍙湁鏁版嵁涓惡甯d鎵嶈兘鍙戦�佹煡璇㈣姹� if (data.id) { this.getEquipmentTable({ classifyId: data.id, pageSize: this.pageSize, pageNo: this.currentPage, whetherWhether: this.isOut }) @@ -786,6 +773,8 @@ this.$message.error('娣诲姞澶辫触') } this.$message.success('娣诲姞鎴愬姛') + let d = this.nodeclicked; + this.nodeClickHandler(d); this.addDrawerVisible = false this.equipmentform = {} return @@ -794,6 +783,8 @@ try { const res = await changeInstrument(this.equipmentform) this.$message.success('淇敼鎴愬姛') + let d = this.nodeclicked; + this.nodeClickHandler(d); this.addDrawerVisible = false this.detailDrawer = false } catch (error) { @@ -801,13 +792,15 @@ } }, cancelAddEq() { + this.resetForm('addDrawer') this.addDrawerVisible = false - // this.resetForm('addNewEquipment') }, resetForm(formName) { this.$refs[formName].resetFields(); }, cancelAddMeasure() { + this.$refs['upload'].clearFiles(); + this.measureForm.file = null; this.measureFormVisible = false this.resetForm('addmeasureForm') }, @@ -845,12 +838,16 @@ } catch (error) { this.$message.error('娣诲姞澶辫触') } + this.measureForm.file = null; + this.$refs['upload'].clearFiles(); }, // 鍏抽棴璁惧璇︽儏鎶藉眽 closeDetailDrawer() { this.equipmentDetail = {} this.codePointsTable = [] this.measureTable = [] + this.measureForm.file = null; + this.$refs['upload'].clearFiles(); }, // 鍏抽棴娣诲姞淇敼璁惧鎶藉眽 closeAddOrChangeDrawer() { @@ -946,15 +943,13 @@ this.deletedialogVisible = true }, async deleteInstrument() { - let up = await deleteInstrument({ instrumentId: this.instrumentId }) - if (up.data) { - this.$message({ - message: '鎿嶄綔鎴愬姛锛�', - type: 'success' - }); + await deleteInstrument({ instrumentId: this.instrumentId }).then(res=>{ + this.$message.success('鍒犻櫎鎴愬姛锛�'); let d = this.nodeclicked this.nodeClickHandler(d); - } + }).catch(()=>{ + this.$message.error('鍒犻櫎澶辫触锛�'); + }); this.deletedialogVisible = false }, async submitTreeForm(formName) { diff --git a/src/views/laboratory/measure/index.vue b/src/views/laboratory/measure/index.vue index 1bb43b8..427e4d7 100644 --- a/src/views/laboratory/measure/index.vue +++ b/src/views/laboratory/measure/index.vue @@ -42,8 +42,8 @@ </div> </div> <div class="table-box"> - <el-table v-if="this.radioValue == 0" :max-height="800" :cell-style="{ textAlign: 'center' }" - :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" + <el-table v-if="this.radioValue == 0" :max-height="500" :cell-style="{ textAlign: 'left' }" + :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }" :data="measureLedgerTable" style="width: 100%"> <el-table-column type="index" min-width="10%" /> <el-table-column prop="equipmentCode" label="浠櫒璁惧缂栧彿" min-width="10%" /> @@ -81,7 +81,7 @@ </template> </el-table-column> </el-table> - <el-table v-show="this.radioValue == 1" :max-height="800" :cell-style="{ textAlign: 'center' }" + <el-table v-show="this.radioValue == 1" :max-height="500" :cell-style="{ textAlign: 'center' }" :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" :data="measurePlanTable" style="width: 100%"> <el-table-column type="index" min-width="10%" /> @@ -114,7 +114,7 @@ <!-- 鍒嗛〉鍣� --> <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" + :current-page="currentPage" :page-sizes="[10, 20, 30]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> </div> @@ -328,10 +328,10 @@ measureLedgerTable: [], measurePlanTable: [], currentPage: 1, - pageSize: 5, + pageSize: 10, total: 0, currentPagePlan: 1, - pageSizePlan: 5, + pageSizePlan: 10, totalPlan: 0, direction: 'rtl', lookVisible: false, @@ -520,6 +520,7 @@ this.reset() }, async getPlanPageList() { + console.log(111); let param = { currentPage: this.currentPage, pageSize: this.pageSize, @@ -531,6 +532,7 @@ }) this.measurePlanTable = res.data.list this.total = res.data.total + console.log(333); }, async lookMeasurement(code) { }, diff --git a/src/views/laboratory/organizational/index.vue b/src/views/laboratory/organizational/index.vue index 3561611..aa83bc1 100644 --- a/src/views/laboratory/organizational/index.vue +++ b/src/views/laboratory/organizational/index.vue @@ -92,7 +92,6 @@ <el-input placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" v-model="formData.department" - clearable style="width: 80%" > </el-input> @@ -281,7 +280,10 @@ handler(newVal, oldVal) { if (newVal == false) { this.isUpdate = false; - this.formData = {}; + this.formData = { + fatherId: "", + department: "", + }; this.$refs.ruleForm.resetFields(); } }, diff --git a/src/views/laboratory/personnel/index.vue b/src/views/laboratory/personnel/index.vue index f469fa9..f523436 100644 --- a/src/views/laboratory/personnel/index.vue +++ b/src/views/laboratory/personnel/index.vue @@ -44,6 +44,12 @@ </el-option> </el-select> </el-form-item> + <el-form-item label="鍦ㄨ亴鐘舵��" v-if="isUpdate" :label-width="formLabelWidth" prop="jobState"> + <el-select v-model="form.jobState" clearable style="width: 100%" placeholder="璇烽�夋嫨鍦ㄨ亴鐘舵��"> + <el-option v-for="(item,index) in jobList" :key="index" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button> @@ -56,13 +62,13 @@ </div> <div class="content-main"> <div class="personner-table"> - <el-table ref="personnerlTable" height="calc(100vh - 240px)" border :cell-style="{ textAlign: 'center' }" + <el-table ref="personnerlTable" height="calc(100vh - 240px)" border :cell-style="{ textAlign: 'left' }" :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', - textAlign: 'center', + textAlign: 'left', }" @filter-change="fnFilterChangeInit" :data="personnerlTable" style="width: 100%"> <el-table-column prop="username" label="瑙掕壊鍚嶇О" min-width="120" /> <el-table-column prop="roleName" label="瑙掕壊鏉冮檺" min-width="120" /> @@ -97,10 +103,8 @@ }} </template> </el-table-column> - <el-table-column prop="jobState" label="鍦ㄨ亴鐘舵��" min-width="120" :filters="[ - { text: '鍦ㄨ亴', value: 1 }, - { text: '绂诲矖', value: 0 }, - ]" column-key="status" :filter-method="filterTag" filter-placement="bottom-end"> + <el-table-column prop="jobState" label="鍦ㄨ亴鐘舵��" min-width="120" :filters="[{ text: '鍦ㄨ亴', value: 1 },{ text: '绂诲矖', value: 0 },]" + column-key="status" :filter-method="filterTag" filter-placement="bottom-end"> <template slot-scope="scope"> <el-tag :type="scope.row.jobState === 0 ? 'danger' : 'success'" disable-transitions>{{ scope.row.jobState === 0 ? "绂诲矖" : "鍦ㄨ亴" }}</el-tag> @@ -147,6 +151,7 @@ personData: [], // 鐢ㄦ潵瀛樻斁鎺ュ彛浼犺繃鏉ョ殑浜哄憳鍒楄〃鏁版嵁 dialogFormVisible: false, form: { + id: "", account: "", age: "", email: "", @@ -154,7 +159,9 @@ phone: "", organizationId: "", roleId: "", + jobState: "", }, + jobList:[{ label: '鍦ㄨ亴', value: 1 },{ label: '绂诲矖', value: 0 }], myProp: { value: "id", label: "department", @@ -215,10 +222,11 @@ this.currentPage = 1; this.pageSize = val; }, - filterTag(value) { - this.status = ""; - this.status = value; - return true; + filterTag(value,row) { + // console.log("filterTag--",value); + // this.status = ""; + // this.status = value; + return row.jobState === value; }, // 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤� handleCurrentChange(val) { @@ -252,24 +260,38 @@ this.$refs.form.validate((valid) => { if (valid) { let departmentId = this.form.organizationId; - this.form.organizationId = departmentId[departmentId.length - 1]; + let form = { + id: this.form.id, + account: this.form.account, + age: this.form.age, + email: this.form.email, + name: this.form.name, + phone: this.form.phone, + organizationId: departmentId[departmentId.length - 1], + roleId: this.form.roleId, + jobState: this.form.jobState + } if (!this.isUpdate) { - post("/user/add_new_personnel", this.form).then((response) => { + post("/user/add_new_personnel", form).then((response) => { this.$message({ message: response.message, type: "success", }); this.dialogFormVisible = false; this.getData(); + }).catch((error)=>{ + this.$message.error(error.message); }); } else { - put("/user/update_new_personnel", this.form).then((res) => { + put("/user/update_new_personnel", form).then((res) => { this.$message({ message: res.message, type: "success", }); this.dialogFormVisible = false; this.getData(); + }).catch((error)=>{ + this.$message.error(error.message); }); } } else { @@ -312,6 +334,7 @@ }, handleClick(row) { + console.log(row); this.isUpdate = true; this.dialogFormVisible = true; this.form.name = row.username; @@ -319,11 +342,12 @@ this.form.phone = row.phone; this.form.id = row.id; this.form.email = row.email; + this.form.jobState = row.jobState; this.form.organizationId = this.getParentsById( this.options, row.departmentId ); - this.form.roleId = row.roleName; + this.form.roleId = row.roleId; this.form.age = row.age; this.form.account = row.account; }, @@ -344,7 +368,17 @@ handler(newVal, oldVal) { if (newVal == false) { this.isUpdate = false; - this.form = {}; + this.form = { + id: "", + account: "", + age: "", + email: "", + name: "", + phone: "", + organizationId: "", + roleId: "", + jobState: "", + }; this.$refs.form.resetFields(); } else { this.getRoleList(); diff --git a/src/views/laboratory/role/index.vue b/src/views/laboratory/role/index.vue index 26da055..c91733a 100644 --- a/src/views/laboratory/role/index.vue +++ b/src/views/laboratory/role/index.vue @@ -10,7 +10,7 @@ <el-form-item class="rightBtn"> <el-col> <el-button type="primary" @click="searchRole">鏌ヨ</el-button> - <el-button type="primary" plain>閲嶇疆</el-button> + <el-button type="primary" @click="clear()" plain>閲嶇疆</el-button> </el-col> </el-form-item> </el-form> @@ -22,8 +22,8 @@ </div> <div class="library-table"> <div class="table-box"> - <el-table :max-height="800" :cell-style="{ textAlign: 'center' }" - :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" + <el-table :max-height="800" :cell-style="{ textAlign: 'left' }" + :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }" :data="roleTable" style="width: 100%"> <el-table-column type="index" min-width="8%" /> <el-table-column prop="roleName" label="瑙掕壊鍚嶇О" min-width="20%" /> @@ -287,6 +287,10 @@ searchRole() { this.start() }, + clear(){ + this.searchData.roleName='' + this.start() + }, clearUPAll() { this.updateRole = { roleId: null, diff --git a/src/views/message/toDo/index.vue b/src/views/message/toDo/index.vue index ca3ef41..7af1f63 100644 --- a/src/views/message/toDo/index.vue +++ b/src/views/message/toDo/index.vue @@ -40,8 +40,8 @@ <el-table ref="toDoTable" :max-height="800" - :cell-style="{textAlign: 'center'}" - :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" + :cell-style="{textAlign: 'left'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" :data="toDoTable" @selection-change="handleSelectionChange" style="width: 100%" diff --git a/src/views/standardLibrary/index.vue b/src/views/standardLibrary/index.vue index 3b65eea..d476cc5 100644 --- a/src/views/standardLibrary/index.vue +++ b/src/views/standardLibrary/index.vue @@ -360,6 +360,8 @@ this.addTreeFormVisible = false; this.getStandardTree(); this.getTableByClick(this.selectData, this.versionValue); + this.addTreeForm=null + this.addTreeForm.addTypeArr=[] }, changeCascader(data) { this.addTreeForm.addTypeArr = data; @@ -380,14 +382,18 @@ }); }, selectDataList() { + let i=0 this.tableData.forEach((a) => { + a.id="0"+i a.code = "[1]"; + i++; if (a.children != undefined) { a.children.forEach((b) => { b.code = "[2]"; }); } }); + console.log(this.tableData); }, // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 // 鍏ㄩ��/鍙栨秷閫夋搷浣� -- Gitblit v1.9.3