From ef1c0d5baa9d766dfe81a5fa972a6f83225536da Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 30 八月 2023 18:06:25 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.110.209:9001/r/lims-before
---
src/views/laboratory/gather/index.vue | 10
src/api/inspection/commisioninspection.js | 21
src/views/laboratory/measure/index.vue | 50 +
src/views/experiment/inspectionApplication/index.vue | 190 ++++---
src/views/inspectionManagement/reportForInspection/index.vue | 172 +++---
src/views/laboratory/personnel/index.vue | 801 ++++++++++++++------------------
src/router/index.js | 8
src/views/inspectionManagement/commissionInspection/addCommision.vue | 26
src/utils/request.js | 5
.env.development | 2
src/views/laboratory/measure/Add.vue | 67 +-
src/views/laboratory/organizational/index.vue | 1
src/views/CNAS/satisfactionSurveys/index.vue | 4
src/layout/components/Sidebar/SidebarItem.vue | 3
src/views/experiment/inspectionApplication/Viewdetails/index.vue | 7
src/views/inspectionManagement/commissionInspection/index.vue | 17
16 files changed, 705 insertions(+), 679 deletions(-)
diff --git a/.env.development b/.env.development
index bee5b10..d00c942 100644
--- a/.env.development
+++ b/.env.development
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
-VUE_APP_BASE_API = 'http://192.168.137.116:1234/'
+VUE_APP_BASE_API = 'http://192.168.110.107:1234/'
diff --git a/src/api/inspection/commisioninspection.js b/src/api/inspection/commisioninspection.js
index 64b2717..95df195 100644
--- a/src/api/inspection/commisioninspection.js
+++ b/src/api/inspection/commisioninspection.js
@@ -25,6 +25,14 @@
})
}
+//
+export function getContractsSampleInfo(params){
+ return request({
+ url: 'link-basic/getContractsSampleInfo',
+ method: 'get',
+ params
+ })
+}
//瑙勬牸鍨嬪彿
export function getModelSpecification(params){
return request({
@@ -57,7 +65,6 @@
})
}
-
export function isIfViewUUID(params){
return request({
url: '/link-basic/isIfViewUUID',
@@ -74,9 +81,17 @@
})
}
-export function getContractsSampleInfo(params){
+export function delLink(params){
return request({
- url: '/link-basic/getContractsSampleInfo',
+ url: '/link-basic-table/delLink',
+ method: 'post',
+ params
+ })
+}
+
+export function getSpecificationsName(params){
+ return request({
+ url: '/link-basic-table/getSpecificationsName',
method: 'get',
params
})
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 3e5922c..ca1bccd 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -2,11 +2,10 @@
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
-
<el-menu-item v-if="onlyOneChild.meta.show==false ?onlyOneChild.meta.show: true" :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :show="onlyOneChild.meta.show" :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
<span v-if="onlyOneChild.meta.title==='涓婚〉'">涓婚〉</span>
- <span v-if="onlyOneChild.meta.title==='鍩虹鏁版嵁'">鍩虹鏁版嵁</span>
+ <span v-if="onlyOneChild.meta.title==='鍩虹鏁版嵁'">鍩虹鏁版嵁</span>
</el-menu-item>
</app-link>
</template>
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..58cf36d 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,8 @@
})
sessionStorage.removeItem("user")
sessionStorage.setItem("flushPage",1)
- this.$router.replace({path: '/login'});
- location.reload()
+ router.replace({path: '/login'});
+ // location.reload()
}
if(res.code===403){
Message({
diff --git a/src/views/CNAS/satisfactionSurveys/index.vue b/src/views/CNAS/satisfactionSurveys/index.vue
index 05f49fe..c89b437 100644
--- a/src/views/CNAS/satisfactionSurveys/index.vue
+++ b/src/views/CNAS/satisfactionSurveys/index.vue
@@ -224,7 +224,7 @@
otherSupplements: "鏃�",
improvementRequirements: "鏃�",
dialogVisible2: false,
- path: 'http://192.168.110.254:1234/cnasSatisfactionSurvey/uploadFile',
+ path: 'http://localhost:1234/cnasSatisfactionSurvey/uploadFile',
ruleForm: {
surveyDate: '',
userUnit: '',
@@ -263,7 +263,7 @@
}
},
created() {
-
+ // this.path=process.env.VUE_APP_BASE_API+"cnasSatisfactionSurvey/uploadFile"
},
mounted() {
this.getData()
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..53d5292 100644
--- a/src/views/experiment/inspectionApplication/index.vue
+++ b/src/views/experiment/inspectionApplication/index.vue
@@ -163,7 +163,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 +314,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 +434,7 @@
selectAll,
addInspect,
chooseVer,
- lookProByVer
+ lookProByVer,
} from '@/api/experiment/planAssignments'
export default {
data() {
@@ -460,7 +461,7 @@
amount: '',
checkdate: []
},
- selectedValue: 1,
+ selectedValue: {},
infoForm: {},
commisionSelection: {
entrust_coding: '',
@@ -510,8 +511,10 @@
tableData: [],
tableRow: {},
BANben: [],
- select_1: [],
- aa: {}
+ // select_1: [],
+ aa: {},
+ listdata:[],
+ ddd:{}
}
},
watch: {
@@ -529,6 +532,7 @@
if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
},
methods: {
+
async selectAll() {
const res = selectAll({
type: 0
@@ -570,6 +574,7 @@
this.aa = this.BANben[0]
this.lookProByVer()
},
+
//鏍囧噯搴�
async lookProByVer() {
const res = await lookProByVer({
@@ -663,6 +668,7 @@
},
handleRawMaterialSelection() {
this.infoForm = this.tmp
+ console.log(this.infoForm);
this.rawmaterialVisible = false
},
handleRadioChange() {
@@ -673,13 +679,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 +696,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 +738,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 +754,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 +778,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>
diff --git a/src/views/inspectionManagement/commissionInspection/addCommision.vue b/src/views/inspectionManagement/commissionInspection/addCommision.vue
index 42dbefa..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() {
@@ -315,6 +317,7 @@
this.viewId = this.$route.params.viewId
this.$store.commit('settings/SAVE_LINK', this.viewId)
this.getlink(this.$route.params.viewId)
+ this.getContractsSampleInfo(this.$route.params.viewId)
},
mounted() {
this.getSampleName()
@@ -335,6 +338,11 @@
} else {
this.getContractsSampleInfo()
}
+ })
+ },
+ async getContractsSampleInfo(viewId) {
+ let res = await getContractsSampleInfo({
+ viewId
})
},
async getSampleName() {
@@ -377,7 +385,8 @@
samplesNumber: '',
remarks: '',
experiment: [],
- addway: ''
+ addway: '',
+ speName: ''
}
},
async submitInspection() {
@@ -399,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) {
@@ -437,11 +447,17 @@
return item.name
})
})
+ this.model_sta_options.forEach(a=>{
+ if(a.key == val){
+ this.addPointerForm.speName = a.value
+ }
+ })
},
getContractsSampleInfo() {
getContractsSampleInfo({
viewId: this.viewId
}).then(res => {
+ if (res.data == null) return
this.infoForm = {
commisioncode: res.data.entrustCoding,
deadline: res.data.completionDeadline,
@@ -459,7 +475,7 @@
}
this.detectionInfo = res.data.linkDetectionList
})
- }
+ },
}
}
</script>
diff --git a/src/views/inspectionManagement/commissionInspection/index.vue b/src/views/inspectionManagement/commissionInspection/index.vue
index dadc02c..51c08b0 100644
--- a/src/views/inspectionManagement/commissionInspection/index.vue
+++ b/src/views/inspectionManagement/commissionInspection/index.vue
@@ -133,7 +133,8 @@
import {
getCommisionList,
getViewUUID,
- selectViewUUID
+ selectViewUUID,
+ delLink
} from '@/api/inspection/commisioninspection'
export default {
data() {
@@ -191,7 +192,6 @@
},
updated() {
if (this.$router.currentRoute.name === 'AddCommision') {
- // console.log(this.$router.currentRoute.name)
this.showDetail = true
}
},
@@ -203,7 +203,6 @@
})
this.commisionTable = res.data.row
this.total = res.data.total
- // console.log(res)
// 鑾峰彇鎵�鏈夌殑濮旀墭鍗曚綅鍚嶇О
const allDepartmentNames = [...new Set(this.commisionTable.map(item => item.entrusted))]
// 灏哸llDepartmentNames杞崲涓簅ptions闇�瑕佺殑鏍煎紡
@@ -235,7 +234,6 @@
inspectionStatus: this.radioValue
})
}
- // console.log(res)
this.commisionTable = res.data.row
this.total = res.data.total
},
@@ -252,7 +250,6 @@
},
async radioclick() {
// 澶勭悊鐐瑰嚮radio鐨勬椂闂�
- console.log('radioValue', this.radioValue)
if (this.radioValue === 0) {
this.getCommisionList()
} else {
@@ -261,7 +258,6 @@
pageSize: this.pageSize,
inspectionStatus: this.radioValue
})
- // console.log(res)
this.commisionTable = res.data.row
this.total = res.data.total
}
@@ -269,7 +265,6 @@
},
// 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
async handleSizeChange(val) {
- // console.log(`姣忛〉 ${val} 鏉)
this.currentPage = 1
this.pageSize = val
if (this.radioValue === 0) {
@@ -286,7 +281,6 @@
},
// 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤�
async handleCurrentChange(val) {
- // console.log(`褰撳墠椤�: ${val}`)
this.currentPage = val
if (this.radioValue === 0) {
this.getCommisionList()
@@ -329,7 +323,12 @@
}
},
handleClick(row){
- console.log(row);
+ delLink({
+ id: row.id
+ }).then(res=>{
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getCommisionList()
+ })
}
}
}
diff --git a/src/views/inspectionManagement/reportForInspection/index.vue b/src/views/inspectionManagement/reportForInspection/index.vue
index c70d2a6..09a6b65 100644
--- a/src/views/inspectionManagement/reportForInspection/index.vue
+++ b/src/views/inspectionManagement/reportForInspection/index.vue
@@ -602,86 +602,100 @@
</script>
<style scoped lang="scss">
-.content-main{
- height: 100%;
- .top-bar{
- margin: -25px -15px;
- background: #fff;
- display: flex;
- justify-content: space-between;
- padding: 24px 24px 0px 24px;
- .sermargin{
- margin-right: 60px;
- }
-}
-.rightBtn{
- background-color: rgb(1, 102, 226);
-}
-.library-table{
- background-color: #fff;
- flex: 1;
- margin: 0px -15px;
- margin-top: 40px;
- display: flex;
- flex-direction: column;
- .table-header{
- padding: 20px;
- display: flex;
- justify-content: space-between;
- .el-form-item{
- margin-bottom: 30px !important;
- }
- }
- .table-box{
- padding: 0px 20px;
- margin-top: 0px;
- flex: 1;
- background: #fff;
- /* padding: 20px 20px 10px 20px; */
- display: flex;
- flex-direction: column;
- .el-table {
- flex: 1;
- }
- >div:nth-child(2){
- display: flex;
- justify-content: end;
- margin: 10px 0;
- }
- }
- }
-.checked {
- color: green;
-}
+ .content-main {
+ height: 100%;
-.unchecked {
- color: red;
-}
+ .top-bar {
+ margin: -25px -15px;
+ background: #fff;
+ display: flex;
+ justify-content: space-between;
+ padding: 24px 24px 0px 24px;
-.newPage{
- margin: -25px -15px;
- .inspectionForm{
- background-color:#fff;
- .formwrapper{
- margin-left: 80px;
- padding:10px 0px;
- }
- }
- .inspectionProject{
- margin:10px 0px;
- .header{
- display:flex;
- justify-content: space-between;
- padding-top: -3px;
- padding-bottom: 3px;
- }
- .el-table{
- padding: 10px 10px;
- height: 65vh;
- overflow-y: auto;
- }
- }
-}
-}
+ .sermargin {
+ margin-right: 60px;
+ }
+ }
+ .rightBtn {
+ background-color: rgb(1, 102, 226);
+ }
+
+ .library-table {
+ background-color: #fff;
+ flex: 1;
+ margin: 0px -15px;
+ margin-top: 40px;
+ display: flex;
+ flex-direction: column;
+
+ .table-header {
+ padding: 20px;
+ display: flex;
+ justify-content: space-between;
+
+ .el-form-item {
+ margin-bottom: 30px !important;
+ }
+ }
+
+ .table-box {
+ padding: 0px 20px;
+ margin-top: 0px;
+ flex: 1;
+ background: #fff;
+ /* padding: 20px 20px 10px 20px; */
+ display: flex;
+ flex-direction: column;
+
+ .el-table {
+ flex: 1;
+ }
+
+ >div:nth-child(2) {
+ display: flex;
+ justify-content: end;
+ margin: 10px 0;
+ }
+ }
+ }
+
+ .checked {
+ color: green;
+ }
+
+ .unchecked {
+ color: red;
+ }
+
+ .newPage {
+ margin: -25px -15px;
+
+ .inspectionForm {
+ background-color: #fff;
+
+ .formwrapper {
+ margin-left: 80px;
+ padding: 10px 0px;
+ }
+ }
+
+ .inspectionProject {
+ margin: 10px 0px;
+
+ .header {
+ display: flex;
+ justify-content: space-between;
+ padding-top: -3px;
+ padding-bottom: 3px;
+ }
+
+ .el-table {
+ padding: 10px 10px;
+ height: 65vh;
+ overflow-y: auto;
+ }
+ }
+ }
+ }
</style>
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 => {
diff --git a/src/views/laboratory/organizational/index.vue b/src/views/laboratory/organizational/index.vue
index b44012b..3561611 100644
--- a/src/views/laboratory/organizational/index.vue
+++ b/src/views/laboratory/organizational/index.vue
@@ -12,6 +12,7 @@
:filter-node-method="filterNode"
ref="tree"
@node-click="handleNodeClick"
+ :expand-on-click-node="false"
>
</el-tree>
</div>
diff --git a/src/views/laboratory/personnel/index.vue b/src/views/laboratory/personnel/index.vue
index f4f4ee2..f469fa9 100644
--- a/src/views/laboratory/personnel/index.vue
+++ b/src/views/laboratory/personnel/index.vue
@@ -1,478 +1,393 @@
<template>
- <div class="personnel-main">
- <div class="page-header-search">
- <div class="search-bar">
- <el-form ref="form" :inline="true">
- <el-form-item>
- <el-input v-model="keyword" placeholder="璇疯緭鍏ヤ汉鍛樺悕绉�">
- <i slot="prefix" class="el-input__icon el-icon-search" />
- </el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getData()">鏌ヨ</el-button>
- <el-button type="primary" plain @click="resetData()"
- >閲嶇疆</el-button
- >
- <!-- <el-button type="text">楂樼骇鎼滅储<i class="el-icon-arrow-down el-icon--right" /></el-button> -->
- </el-form-item>
- </el-form>
- </div>
- <div class="serve-btn">
- <el-button
- type="primary"
- icon="el-icon-plus"
- @click="dialogFormVisible = true"
- >鏂板浜哄憳</el-button
- >
-
- <el-dialog
- :title="isUpdate == true ? '鏇存柊浜哄憳淇℃伅' : '鏂板浜哄憳'"
- :visible.sync="dialogFormVisible"
- width="30%"
- >
- <el-form :model="form" ref="form" :rules="rules">
- <el-form-item
- label="璐﹀彿"
- :label-width="formLabelWidth"
- prop="account"
- >
- <el-input v-model="form.account" />
- </el-form-item>
- <el-form-item label="骞撮緞" :label-width="formLabelWidth">
- <el-input v-model="form.age" />
- </el-form-item>
- <el-form-item
- label="閭"
- :label-width="formLabelWidth"
- prop="email"
- >
- <el-input v-model="form.email" />
- </el-form-item>
- <el-form-item
- label="鍚嶅瓧"
- :label-width="formLabelWidth"
- prop="name"
- >
- <el-input v-model="form.name" />
- </el-form-item>
- <el-form-item
- label="鐢佃瘽"
- :label-width="formLabelWidth"
- prop="phone"
- >
- <el-input v-model="form.phone" />
- </el-form-item>
-
- <el-form-item
- label="閮ㄩ棬"
- :label-width="formLabelWidth"
- required
- prop="organizationId"
- >
- <el-cascader
- style="width: 100%"
- :options="options"
- :props="myProp"
- v-model="form.organizationId"
- clearable
- ></el-cascader>
- </el-form-item>
-
- <el-form-item
- label="鏉冮檺"
- :label-width="formLabelWidth"
- prop="roleId"
- >
- <el-select
- v-model="form.roleId"
- clearable
- style="width: 100%"
- placeholder="璇烽�夋嫨鏉冮檺"
- >
- <el-option
- v-for="item in roleList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitForm()">{{
+ <div class="personnel-main">
+ <div class="page-header-search">
+ <div class="search-bar">
+ <el-form ref="form" :inline="true">
+ <el-form-item>
+ <el-input v-model="keyword" placeholder="璇疯緭鍏ヤ汉鍛樺悕绉�">
+ <i slot="prefix" class="el-input__icon el-icon-search" />
+ </el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="getData()">鏌ヨ</el-button>
+ <el-button type="primary" plain @click="resetData()">閲嶇疆</el-button>
+ <!-- <el-button type="text">楂樼骇鎼滅储<i class="el-icon-arrow-down el-icon--right" /></el-button> -->
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="serve-btn">
+ <el-button type="primary" icon="el-icon-plus" @click="dialogFormVisible = true">鏂板浜哄憳</el-button>
+ <el-dialog :title="isUpdate == true ? '鏇存柊浜哄憳淇℃伅' : '鏂板浜哄憳'" :visible.sync="dialogFormVisible" width="30%">
+ <el-form :model="form" ref="form" :rules="rules" style="padding-right: 50px;">
+ <el-form-item label="璐﹀彿" :label-width="formLabelWidth" prop="account">
+ <el-input v-model="form.account" />
+ </el-form-item>
+ <el-form-item label="骞撮緞" :label-width="formLabelWidth">
+ <el-input v-model="form.age" />
+ </el-form-item>
+ <el-form-item label="閭" :label-width="formLabelWidth" prop="email">
+ <el-input v-model="form.email" />
+ </el-form-item>
+ <el-form-item label="鍚嶅瓧" :label-width="formLabelWidth" prop="name">
+ <el-input v-model="form.name" />
+ </el-form-item>
+ <el-form-item label="鐢佃瘽" :label-width="formLabelWidth" prop="phone">
+ <el-input v-model="form.phone" />
+ </el-form-item>
+ <el-form-item label="閮ㄩ棬" :label-width="formLabelWidth" required prop="organizationId">
+ <el-cascader style="width: 100%" :options="options" :props="myProp" v-model="form.organizationId"
+ clearable></el-cascader>
+ </el-form-item>
+ <el-form-item label="鏉冮檺" :label-width="formLabelWidth" prop="roleId">
+ <el-select v-model="form.roleId" clearable style="width: 100%" placeholder="璇烽�夋嫨鏉冮檺">
+ <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm()">{{
isUpdate == true ? "鏇� 鏂�" : "纭� 瀹�"
}}</el-button>
- </div>
- </el-dialog>
- </div>
- </div>
- <div class="content-main">
- <div class="personner-table">
- <el-table
- ref="personnerlTable"
- height="calc(100vh - 240px)"
- border
- :cell-style="{ textAlign: 'center' }"
- :header-cell-style="{
+ </div>
+ </el-dialog>
+ </div>
+ </div>
+ <div class="content-main">
+ <div class="personner-table">
+ <el-table ref="personnerlTable" height="calc(100vh - 240px)" border :cell-style="{ textAlign: 'center' }"
+ :header-cell-style="{
border: '0px',
background: '#f5f7fa',
color: '#606266',
boxShadow: 'inset 0 1px 0 #ebeef5',
textAlign: 'center',
- }"
- @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" />
- <el-table-column prop="age" label="骞撮緞" min-width="150">
- <template scope="scope">
- {{
+ }" @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" />
+ <el-table-column prop="age" label="骞撮緞" min-width="150">
+ <template scope="scope">
+ {{
scope.row.age === "" ||
scope.row.age === null ||
scope.row.age == undefined
? "---"
: scope.row.age
}}
- </template>
- </el-table-column>
- <el-table-column prop="department" label="閮ㄩ棬" min-width="150" />
- <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" min-width="180" />
- <el-table-column prop="phone" label="鐢佃瘽" min-width="200">
- <template scope="scope">
- {{
+ </template>
+ </el-table-column>
+ <el-table-column prop="department" label="閮ㄩ棬" min-width="150" />
+ <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" min-width="180" />
+ <el-table-column prop="phone" label="鐢佃瘽" min-width="200">
+ <template scope="scope">
+ {{
scope.row.phone === "" || scope.row.phone === undefined
? "---"
: scope.row.phone
}}
- </template>
- </el-table-column>
- <el-table-column prop="email" label="閭" min-width="200">
- <template scope="scope">
- {{
+ </template>
+ </el-table-column>
+ <el-table-column prop="email" label="閭" min-width="200">
+ <template scope="scope">
+ {{
scope.row.email === "" || scope.row.email === undefined
? "---"
: scope.row.email
}}
- </template>
- </el-table-column>
- <el-table-column
- prop="jobState"
- label="鍦ㄨ亴鐘舵��"
- min-width="120"
- :filters="[
+ </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"
- >
- <template slot-scope="scope">
- <el-tag
- :type="scope.row.jobState === 0 ? 'danger' : 'success'"
- disable-transitions
- >{{ scope.row.jobState === 0 ? "绂诲矖" : "鍦ㄨ亴" }}</el-tag
- >
- </template>
- </el-table-column>
- <el-table-column label="鎿嶄綔" min-width="120">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- @click="handleClick(scope.row)"
- >缂栬緫</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div>
- <!-- 鍒嗛〉鍣� -->
- <el-pagination
- :current-page="currentPage"
- :page-sizes="[10, 15, 20, 25]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </div>
- </div>
- </div>
+ ]" 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>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" min-width="120">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" @click="handleClick(scope.row)">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div>
+ <!-- 鍒嗛〉鍣� -->
+ <el-pagination :current-page="currentPage" :page-sizes="[10, 15, 20, 25]" :page-size="pageSize"
+ layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange" />
+ </div>
+ </div>
+ </div>
+ </div>
</template>
<script>
-import { get, post, put } from "@/api/util/requestUtil";
-import urlInfo from "../../../api/urlEnum/personnel.js";
-import { getOrganizationalApi } from "@/api/laboratory/organizational";
-export default {
- data() {
- return {
- keyword: "",
- roleList: "",
- personnerlTable: [],
- filteredpersonnerlTable: [],
- currentindex: 1,
- currentPage: 1, // 褰撳墠椤电爜
- total: 0, // 鎬绘潯鏁�
- pageSize: 100, // 姣忛〉鐨勬暟鎹潯鏁�
- personData: [], // 鐢ㄦ潵瀛樻斁鎺ュ彛浼犺繃鏉ョ殑浜哄憳鍒楄〃鏁版嵁
- dialogFormVisible: false,
- form: {
- account: "",
- age: "",
- email: "",
- name: "",
- phone: "",
- organizationId: "",
- roleId: "",
- },
- myProp: {
- value: "id",
- label: "department",
- checkStrictly: true, //鍏佽閫夋嫨浠绘剰涓�鑺�
- },
- formLabelWidth: "100px",
- rules: {
- account: [
- {
- required: true,
- message: "璇疯緭鍏ヨ处鍙�",
- trigger: "blur",
- },
- ],
- name: [
- {
- required: true,
- message: "璇疯緭鍏ュ悕瀛�",
- trigger: "blur",
- },
- ],
- phone: [
- // { required: true, message: '璇疯緭鍏�11浣嶇數璇濆彿鐮�', trigger: 'blur' },
- {
- pattern: /^1[3456789]\d{9}$/,
- message: "闈炴硶鎵嬫満鍙风爜",
- trigger: ["blur", "change"],
- },
- ],
- email: [
- // { required: true, message: '璇疯緭鍏ラ偖绠卞湴鍧�', trigger: 'blur' },
- {
- type: "email",
- message: "闈炴硶閭鍦板潃",
- trigger: ["blur", "change"],
- },
- ],
- organizationId: [
- {
- required: true,
- type: "array",
- message: "璇烽�夋嫨閮ㄩ棬",
- trigger: "change",
- },
- ],
- roleId: [
- { required: true, message: "璇疯緭鍏ユ潈闄�(0鎴�1)", trigger: "blur" },
- ],
- },
- options: [],
- status: "",
- isUpdate: false,
- };
- },
- mounted() {
- this.getData();
- this.getTreeData();
- },
- methods: {
- // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
- handleSizeChange(val) {
- console.log(`姣忛〉 ${val} 鏉);
- this.currentPage = 1;
- this.pageSize = val;
- },
- filterTag(value) {
- this.status = "";
- this.status = value;
- return true;
- },
- // 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤�
- handleCurrentChange(val) {
- console.log(`褰撳墠椤�: ${val}`);
- this.currentPage = val;
- },
- async getData() {
- let data = {
- pageNo: 0,
- pageSize: 10,
- name: this.keyword,
- status: this.status,
- };
- let res = await get(urlInfo.url.list_new_personnel, data);
- this.personnerlTable = res.data.row;
- this.total = res.data.total;
- },
- searchData() {
- this.filteredpersonnerlTable = this.personnerlTable.filter((item) => {
- return item.username === this.keyword;
- });
- this.personnerlTable = this.filteredpersonnerlTable;
- },
- resetData() {
- this.personnerlTable = this.personData;
- this.keyword = "";
- this.status = "";
- this.getData();
- },
- // 鎻愪氦鏂板浜哄憳琛ㄥ崟
- submitForm() {
- this.$refs.form.validate((valid) => {
- if (valid) {
- let departmentId = this.form.organizationId;
- this.form.organizationId = departmentId[departmentId.length - 1];
- if (!this.isUpdate) {
- post("/user/add_new_personnel", this.form).then((response) => {
- this.$message({
- message: response.message,
- type: "success",
- });
- this.dialogFormVisible = false;
- this.getData();
- });
- } else {
- put("/user/update_new_personnel", this.form).then((res) => {
- this.$message({
- message: res.message,
- type: "success",
- });
- this.dialogFormVisible = false;
- this.getData();
- });
- }
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- // 娓呯┖Cascader绌虹櫧
- clearCascaderBlank(list) {
- list.forEach((i) => {
- if (i.children.length === 0) {
- i.children = undefined;
- } else {
- this.clearCascaderBlank(i.children);
- }
- });
- },
- fnFilterChangeInit() {
- this.personData = [];
- this.getData();
- },
- /*
- * @param list 鏁版嵁鍒楄〃
- * @param id 鍚庣杩斿洖鐨刬d
- **/
- getParentsById(list, id) {
- for (let i in list) {
- if (list[i].id == id) {
- return [list[i].id];
- }
- if (list[i].children) {
- let node = this.getParentsById(list[i].children, id);
- if (node !== undefined) {
- //鏌ヨ鍒版妸鐖惰妭鎶婄埗鑺傜偣鍔犲埌鏁扮粍鍓嶉潰
- node.unshift(list[i].id);
- return node;
- }
- }
- }
- },
+ import {
+ get,
+ post,
+ put
+ } from "@/api/util/requestUtil";
+ import urlInfo from "../../../api/urlEnum/personnel.js";
+ import {
+ getOrganizationalApi
+ } from "@/api/laboratory/organizational";
+ export default {
+ data() {
+ return {
+ keyword: "",
+ roleList: "",
+ personnerlTable: [],
+ filteredpersonnerlTable: [],
+ currentindex: 1,
+ currentPage: 1, // 褰撳墠椤电爜
+ total: 0, // 鎬绘潯鏁�
+ pageSize: 100, // 姣忛〉鐨勬暟鎹潯鏁�
+ personData: [], // 鐢ㄦ潵瀛樻斁鎺ュ彛浼犺繃鏉ョ殑浜哄憳鍒楄〃鏁版嵁
+ dialogFormVisible: false,
+ form: {
+ account: "",
+ age: "",
+ email: "",
+ name: "",
+ phone: "",
+ organizationId: "",
+ roleId: "",
+ },
+ myProp: {
+ value: "id",
+ label: "department",
+ checkStrictly: true, //鍏佽閫夋嫨浠绘剰涓�鑺�
+ },
+ formLabelWidth: "100px",
+ rules: {
+ account: [{
+ required: true,
+ message: "璇疯緭鍏ヨ处鍙�",
+ trigger: "blur",
+ }, ],
+ name: [{
+ required: true,
+ message: "璇疯緭鍏ュ悕瀛�",
+ trigger: "blur",
+ }, ],
+ phone: [
+ // { required: true, message: '璇疯緭鍏�11浣嶇數璇濆彿鐮�', trigger: 'blur' },
+ {
+ pattern: /^1[3456789]\d{9}$/,
+ message: "闈炴硶鎵嬫満鍙风爜",
+ trigger: ["blur", "change"],
+ },
+ ],
+ email: [
+ // { required: true, message: '璇疯緭鍏ラ偖绠卞湴鍧�', trigger: 'blur' },
+ {
+ type: "email",
+ message: "闈炴硶閭鍦板潃",
+ trigger: ["blur", "change"],
+ },
+ ],
+ organizationId: [{
+ required: true,
+ type: "array",
+ message: "璇烽�夋嫨閮ㄩ棬",
+ trigger: "change",
+ }, ],
+ roleId: [{
+ required: true,
+ message: "璇疯緭鍏ユ潈闄�(0鎴�1)",
+ trigger: "blur"
+ }, ],
+ },
+ options: [],
+ status: "",
+ isUpdate: false,
+ };
+ },
+ mounted() {
+ this.getData();
+ this.getTreeData();
+ },
+ methods: {
+ // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
+ handleSizeChange(val) {
+ this.currentPage = 1;
+ this.pageSize = val;
+ },
+ filterTag(value) {
+ this.status = "";
+ this.status = value;
+ return true;
+ },
+ // 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤�
+ handleCurrentChange(val) {
+ this.currentPage = val;
+ },
+ async getData() {
+ let data = {
+ pageNo: 0,
+ pageSize: 10,
+ name: this.keyword,
+ status: this.status,
+ };
+ let res = await get(urlInfo.url.list_new_personnel, data);
+ this.personnerlTable = res.data.row;
+ this.total = res.data.total;
+ },
+ searchData() {
+ this.filteredpersonnerlTable = this.personnerlTable.filter((item) => {
+ return item.username === this.keyword;
+ });
+ this.personnerlTable = this.filteredpersonnerlTable;
+ },
+ resetData() {
+ this.personnerlTable = this.personData;
+ this.keyword = "";
+ this.status = "";
+ this.getData();
+ },
+ // 鎻愪氦鏂板浜哄憳琛ㄥ崟
+ submitForm() {
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ let departmentId = this.form.organizationId;
+ this.form.organizationId = departmentId[departmentId.length - 1];
+ if (!this.isUpdate) {
+ post("/user/add_new_personnel", this.form).then((response) => {
+ this.$message({
+ message: response.message,
+ type: "success",
+ });
+ this.dialogFormVisible = false;
+ this.getData();
+ });
+ } else {
+ put("/user/update_new_personnel", this.form).then((res) => {
+ this.$message({
+ message: res.message,
+ type: "success",
+ });
+ this.dialogFormVisible = false;
+ this.getData();
+ });
+ }
+ } else {
+ return false;
+ }
+ });
+ },
+ // 娓呯┖Cascader绌虹櫧
+ clearCascaderBlank(list) {
+ list.forEach((i) => {
+ if (i.children.length === 0) {
+ i.children = undefined;
+ } else {
+ this.clearCascaderBlank(i.children);
+ }
+ });
+ },
+ fnFilterChangeInit() {
+ this.personData = [];
+ this.getData();
+ },
+ /*
+ * @param list 鏁版嵁鍒楄〃
+ * @param id 鍚庣杩斿洖鐨刬d
+ **/
+ getParentsById(list, id) {
+ for (let i in list) {
+ if (list[i].id == id) {
+ return [list[i].id];
+ }
+ if (list[i].children) {
+ let node = this.getParentsById(list[i].children, id);
+ if (node !== undefined) {
+ //鏌ヨ鍒版妸鐖惰妭鎶婄埗鑺傜偣鍔犲埌鏁扮粍鍓嶉潰
+ node.unshift(list[i].id);
+ return node;
+ }
+ }
+ }
+ },
- handleClick(row) {
- this.isUpdate = true;
- this.dialogFormVisible = true;
- this.form.name = row.username;
- this.form.roleName = row.roleName;
- this.form.phone = row.phone;
- this.form.id = row.id;
- this.form.email = row.email;
- this.form.organizationId = this.getParentsById(
- this.options,
- row.departmentId
- );
- this.form.roleId = row.roleName;
- this.form.age = row.age;
- this.form.account = row.account;
- },
- getTreeData() {
- getOrganizationalApi().then((res) => {
- this.options = res.data[0].children;
- this.clearCascaderBlank(this.options);
- });
- },
- getRoleList() {
- get("/user/list").then((res) => {
- console.log(`output->res`, res);
- this.roleList = res.data;
- });
- },
- },
- watch: {
- dialogFormVisible: {
- handler(newVal, oldVal) {
- if (newVal == false) {
- this.isUpdate = false;
- this.form = {};
- this.$refs.form.resetFields();
- } else {
- this.getRoleList();
- }
- },
- },
- },
-};
+ handleClick(row) {
+ this.isUpdate = true;
+ this.dialogFormVisible = true;
+ this.form.name = row.username;
+ this.form.roleName = row.roleName;
+ this.form.phone = row.phone;
+ this.form.id = row.id;
+ this.form.email = row.email;
+ this.form.organizationId = this.getParentsById(
+ this.options,
+ row.departmentId
+ );
+ this.form.roleId = row.roleName;
+ this.form.age = row.age;
+ this.form.account = row.account;
+ },
+ getTreeData() {
+ getOrganizationalApi().then((res) => {
+ this.options = res.data[0].children;
+ this.clearCascaderBlank(this.options);
+ });
+ },
+ getRoleList() {
+ get("/user/list").then((res) => {
+ this.roleList = res.data;
+ });
+ },
+ },
+ watch: {
+ dialogFormVisible: {
+ handler(newVal, oldVal) {
+ if (newVal == false) {
+ this.isUpdate = false;
+ this.form = {};
+ this.$refs.form.resetFields();
+ } else {
+ this.getRoleList();
+ }
+ },
+ },
+ },
+ };
</script>
<style lang="scss" scoped>
-.personnel-main {
- // width: 100%;
- // height: 100%;
- .page-header-search {
- background: #fff;
- display: flex;
- justify-content: space-between;
- padding: 0 24px 12px 24px;
+ .personnel-main {
- .search-bar {
- .el-form {
- .el-form-item {
- margin-bottom: 0px !important;
+ // width: 100%;
+ // height: 100%;
+ .page-header-search {
+ background: #fff;
+ display: flex;
+ justify-content: space-between;
+ padding: 20px 24px 12px 24px;
- .el-input {
- width: 360px;
- }
- }
- }
- }
- }
+ .search-bar {
+ .el-form {
+ .el-form-item {
+ margin-bottom: 0px !important;
- .personner-table {
- background: #fff;
- padding: 20px 20px 10px 20px;
+ .el-input {
+ width: 360px;
+ }
+ }
+ }
+ }
+ }
- > div:nth-child(2) {
- display: flex;
- justify-content: end;
- margin: 10px 0;
- }
- }
-}
-</style>
+ .personner-table {
+ background: #fff;
+ padding: 20px 20px 10px 20px;
+
+ >div:nth-child(2) {
+ display: flex;
+ justify-content: end;
+ margin: 10px 0;
+ }
+ }
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3