From 0ba75db34c554959c6bc566a38a22db34913c797 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期三, 06 九月 2023 17:38:49 +0800 Subject: [PATCH] modified: src/views/CNAS/nonConformanceManage/index.vue modified: src/views/CNAS/reviewAnnualPlan/index.vue modified: src/views/CNAS/satisfactionSurveys/index.vue modified: src/views/basicData/index.vue modified: src/views/chart/work/index.vue modified: src/views/experiment/checkTheReport/index.vue modified: src/views/experiment/inspectionApplication/index.vue modified: src/views/experiment/nonConformingFeedback/index.vue modified: src/views/experiment/passRateStatistics/index.vue modified: src/views/experiment/planAssignments/plan.vue modified: src/views/experiment/reportAuditing/index.vue modified: src/views/inspectionManagement/commissionInspection/index.vue modified: src/views/inspectionManagement/reportForInspection/index.vue modified: src/views/laboratory/gather/index.vue modified: src/views/laboratory/ledger/index.vue modified: src/views/laboratory/measure/index.vue modified: src/views/laboratory/personnel/index.vue modified: src/views/laboratory/role/index.vue modified: src/views/message/toDo/index.vue modified: src/views/standardLibrary/index.vue --- src/views/laboratory/personnel/index.vue | 70 ++++++++++++++++++++++++++--------- 1 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/views/laboratory/personnel/index.vue b/src/views/laboratory/personnel/index.vue index ac88585..577f115 100644 --- a/src/views/laboratory/personnel/index.vue +++ b/src/views/laboratory/personnel/index.vue @@ -4,19 +4,19 @@ <div class="search-bar"> <el-form ref="form" :inline="true"> <el-form-item> - <el-input v-model="keyword" placeholder="璇疯緭鍏ヤ汉鍛樺悕绉�"> + <el-input size="small" 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 size="small" type="primary" @click="getData()">鏌ヨ</el-button> + <el-button size="small" 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-button size="small" 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"> @@ -41,6 +41,12 @@ <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-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> @@ -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", @@ -196,7 +203,7 @@ }, ], roleId: [{ required: true, - message: "璇疯緭鍏ユ潈闄�(0鎴�1)", + message: "璇烽�夋嫨浜哄憳鏉冮檺", trigger: "blur" }, ], }, @@ -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(); -- Gitblit v1.9.3