Merge branch 'master' of http://192.168.110.209:9001/r/lims-before
| | |
| | | params |
| | | }) |
| | | } |
| | | //原材料检验列表 |
| | | export function YANcailiso(params) { |
| | | return request({ |
| | | url: '/raw-material/selectAll', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | //版本号 |
| | | export function chooseVer(params) { |
| | | return request({ |
| | | url: '/inspection/chooseVer', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | |
| | | |
| | | const Api = { |
| | | getOrganizational: "/organizational/list", // 四级树 |
| | | getTableInitialization: "/organizational/table", // 表格数据接口 |
| | | organizationalAdd: "/organizational/add", // 添加部门 |
| | | organizationalUpdate: "/organizational/add", // 修改部门 |
| | | organizationalDelete: "/organizational/delete", // 删除部门 |
| | | } |
| | | export function getOrganizationalApi() { |
| | | return request({ |
| | | url: Api.getOrganizational, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function getTableInitializationApi(departmentId) { |
| | | return request({ |
| | | url: Api.getTableInitialization, |
| | | method: 'get', |
| | | params: { |
| | | departmentId |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export function organizationalAddApi(formData){ |
| | | return request({ |
| | | url: Api.organizationalAdd, |
| | | method: 'post', |
| | | data: formData |
| | | }) |
| | | } |
| | | |
| | | export function organizationalUpdateApi(formData){ |
| | | return request({ |
| | | url: Api.organizationalUpdate + '?id=' + formData.id, |
| | | method: 'put', |
| | | data: formData |
| | | }) |
| | | } |
| | | |
| | | export function organizationalDeleteApi(id){ |
| | | return request({ |
| | | url: Api.organizationalDelete, |
| | | method: 'delete', |
| | | params: { |
| | | ids: id.toString() |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export function put(path, data) { |
| | | return request({ |
| | | url: path, |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function wpost(path, params) { |
| | | return request({ |
| | | url: path, |
| | |
| | | ref="multipleTable" |
| | | @select="selectTr" |
| | | @select-all="selectAll" |
| | | @selection-change="handleSelectionChange" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column type="selection" label="序号"> </el-table-column> |
| | |
| | | this.isAllSelect = !this.isAllSelect; |
| | | let data = this.tableData; |
| | | this.toggleSelect(data, this.isAllSelect, "all"); |
| | | // 自定义 |
| | | if (this.isAllSelect) { |
| | | val.forEach((i) => { |
| | | if (i.id !== undefined) { |
| | | this.deleteList.push(i.id); |
| | | } else { |
| | | i.children.forEach((c) => { |
| | | this.deleteList.push(c.id); |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | this.deleteList.splice(0, this.deleteList.length); |
| | | } |
| | | }, |
| | | //选择某行 |
| | | selectTr(selection, row) { |
| | |
| | | this.isAllSelect = row.isChecked; |
| | | this.toggleSelect(row, row.isChecked, "tr"); |
| | | }); |
| | | |
| | | if (row.isChecked === true) { |
| | | if (row.children !== undefined) { |
| | | row.children.forEach((i) => { |
| | | this.deleteList.push(i.id); |
| | | }); |
| | | } else { |
| | | this.deleteList.push(row.id); |
| | | } |
| | | } else if (row.isChecked === false) { |
| | | if (row.children !== undefined) { |
| | | row.children.forEach((i) => { |
| | | this.deleteList.findIndex((c, index) => { |
| | | if (c === i.id) { |
| | | this.deleteList.splice(index, 1); |
| | | return; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | this.deleteList.findIndex((c, index) => { |
| | | if (c === row.id) { |
| | | this.deleteList.splice(index, 1); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | //递归子级 |
| | | toggleSelect(data, flag, type) { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.deleteList = [] |
| | | val.forEach((v) => { |
| | | if(v.id !== undefined) { |
| | | this.deleteList.push(v.id) |
| | | } |
| | | }) |
| | | console.log(`output->this.deleteList`,this.deleteList) |
| | | }, |
| | | // 表格树全部选中配置 结束 |
| | | deleteListClick() { |
| | | deleteListApi(this.deleteList).then((res) => { |
| | |
| | | <el-form :model="commisionSelection" ref="commisionTable" class="checkTypeForm" label-position="top" label-width="200px" size="mini"> |
| | | <el-row :gutter="100"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="来料日期:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.formTime" placeholder="请输入来料日期" autocomplete="off" /> |
| | | <el-form-item label="委托编号"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.entrust_coding" placeholder="请输入来料日期" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="供应商名称:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.supplier" placeholder="请输入委托单位" autocomplete="off" /> |
| | | <el-form-item label="委托单位"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.entrusted" placeholder="请输入委托单位" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="100"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="委托编号:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.mcode" placeholder="请输入样品编号" autocomplete="off" /> |
| | | <el-form-item label="样品编号"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.samples_number" placeholder="请输入样品编号" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="委托名称:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.name" placeholder="请输入样品名称" autocomplete="off" /> |
| | | <el-form-item label="样品名称"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.sample_name" placeholder="请输入样品名称" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="100"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="规格型号:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.specifications" placeholder="请输入型号规格" autocomplete="off" /> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.specifications_models" placeholder="请输入型号规格" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="单位:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.unit" placeholder="请输入单位" autocomplete="off" /> |
| | | <el-form-item label="送达时间"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.dateSurvey" placeholder="请输入单位" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="100"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="数量:"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.num" placeholder="请输入数量" autocomplete="off" /> |
| | | <el-form-item label="完成期限"> |
| | | <el-input style="width: 300px" type="text" :value="commisionSelection.completionDeadline" placeholder="请输入数量" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | |
| | | <el-dialog |
| | | title="标准库" |
| | | :visible.sync="Standardframe" |
| | | width="48%" |
| | | |
| | | > |
| | | <!-- <el-form :model="form"> |
| | | <el-form-item label="请选择审核结果:" :label-width="formLabelWidth"> |
| | | </el-form-item> |
| | | </el-form> --> |
| | | |
| | | <!-- <div slot="footer" class="dialog-footer"> --> |
| | | width="48%"> |
| | | <el-card> |
| | | <template slot-scope="scope" > |
| | | <span>版本选择:</span> |
| | | <el-select v-model="commisionTable" size="small" slot="append" style="width: 220px;"> |
| | | <el-option v-for="item in BANben" :key="item.id" :label="item.name" :value="item.name"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-card> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%; margin-bottom: 20px" |
| | | row-key="name" |
| | | border |
| | | height="calc(100vh - 250px)" |
| | | |
| | | default-expand-all |
| | | ref="multipleTable" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- </div> --> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="Standardframe = false">取 消</el-button> |
| | | <el-button type="primary" @click="Standardframe = false">确 定</el-button> |
| | | </span> |
| | | |
| | | </el-dialog> |
| | | |
| | | <!-- 原材料检验模态框 --> |
| | |
| | | :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" |
| | | :data="rawMaterialTable" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | @selection-change="handleSelectionChange_0" |
| | | > |
| | | <el-table-column |
| | | <el-table-column |
| | | type="selection" |
| | | label="" |
| | | min-width="10%" |
| | | /> |
| | | <el-table-column |
| | |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="dateSurvey" |
| | | prop="createTime" |
| | | label="来料日期" |
| | | min-width="8%" |
| | | /> |
| | |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="createTime" |
| | | prop="dateSurvey" |
| | | label="检验日期" |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="state" |
| | | prop="condition" |
| | | label="状态" |
| | | min-width="8%" |
| | | > |
| | |
| | | @selection-change="handleSelectionChange" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | min-width="10%" |
| | | /> |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | min-width="10%" |
| | | /> |
| | | <el-table-column |
| | | prop="formTime" |
| | | label="委托bian'ha" |
| | | min-width="10%" |
| | | /> |
| | | <el-table-column |
| | | prop="supplier" |
| | | label="供应商名称" |
| | | min-width="12%" |
| | | /> |
| | | <el-table-column |
| | | prop="mcode" |
| | | label="材料编码" |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="specifications" |
| | | label="规格型号" |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="unit" |
| | | label="单位" |
| | | min-width="12%" |
| | | /> |
| | | <el-table-column |
| | | prop="num" |
| | | label="数量" |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="checkdate_" |
| | | label="检验日期" |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column type="selection" min-width="10%" /> |
| | | <el-table-column type="index" label="序号" min-width="10%" /> |
| | | <el-table-column prop="entrust_coding" label="委托编号" min-width="10%" /> |
| | | <el-table-column prop="entrusted" label="委托单位" min-width="12%" /> |
| | | <el-table-column prop="samples_number" label="样品编号" min-width="8%" /> |
| | | <el-table-column prop="sample_name" label="样品名称" min-width="8%" /> |
| | | <el-table-column prop="specifications_models" label="规格型号" min-width="12%" /> |
| | | <el-table-column prop="dateSurvey" label="送达时间" min-width="8%" /> |
| | | <el-table-column prop="completionDeadline" label="完成期限" min-width="8%" /> |
| | | <el-table-column prop="contacts" label="委托编制人" min-width="8%" /> |
| | | <el-table-column prop="inspectionTime" label="检验日期" min-width="8%" /> |
| | | <el-table-column prop="inspection_status" label="状态" min-width="8%"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.inspection_status === 1"> |
| | | <span style="color: green;">已检测</span> |
| | | </div> |
| | | <div v-else> |
| | | <span style="color: red;">待检测</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" min-width="8%"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="commisionVisible = false">取 消</el-button> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { selectInspectsList, selectAll, addInspect,getCommisionList} from '@/api/experiment/planAssignments' |
| | | import { selectInspectsList, selectAll, addInspect,getCommisionList,YANcailiso,chooseVer} from '@/api/experiment/planAssignments' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | type: '', |
| | | state: '', |
| | | }, |
| | | valu:{}, |
| | | icode:'', |
| | | inspectionTable: [], |
| | | rawMaterialTable: [], |
| | | commisionTable: [{ |
| | | specifications_models: "GGXH-AAAAA", |
| | | inspectionTime: "2023-08-03", |
| | | id: 2, |
| | | samples_number: 0, |
| | | dateSurvey: "2023-08-03", |
| | | entrusted: "阿里巴巴", |
| | | completionDeadline: "2023-08-03", |
| | | contacts: "小黑", |
| | | entrust_coding: "SL20230803000003", |
| | | sample_name: "发动机", |
| | | inspection_status: 1 |
| | | },{ |
| | | specifications_models: "GGXH-AAAAA", |
| | | inspectionTime: "2023-08-03", |
| | | id: 2, |
| | | samples_number: 0, |
| | | dateSurvey: "2023-08-03", |
| | | entrusted: "阿里巴巴", |
| | | completionDeadline: "2023-08-03", |
| | | contacts: "小黑", |
| | | entrust_coding: "SL20230803000003", |
| | | sample_name: "发动机", |
| | | inspection_status: 1 |
| | | }], |
| | | commisionTable: [], |
| | | finishedTable: { |
| | | deliverydate: '', |
| | | supplier: '', |
| | |
| | | commisionVisible: false, |
| | | tmp: '', |
| | | Standardframe: false, |
| | | tableData: [] |
| | | tableData: [], |
| | | tableRow:{}, |
| | | BANben:[], |
| | | select_1: [] |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.$router.push({name:'Viewdetails',query: {id:row.id}}); |
| | | this.selectInspectsList() |
| | | }, |
| | | //版本库 |
| | | async chooseVer() { |
| | | const res = await chooseVer ({ |
| | | mcode:this.commisionTable.entrust_coding, |
| | | name:this.commisionTable.entrusted, |
| | | scifications:this.commisionTable.specifications_models |
| | | }) |
| | | console.log(res); |
| | | this.BANben = res.data.row |
| | | }, |
| | | //委托检验 |
| | | async getCommisionList() { |
| | | const res = await getCommisionList({pageNo:1,pageSize:10 }) |
| | | console.log(res); |
| | | this.commisionTable = res.data |
| | | console.log(this.commisionTable); |
| | | }, |
| | | //原材料 |
| | | async selecYANcailisotAllAPI() { |
| | | const res = await YANcailiso({pageNo:1,pageSize:10 }) |
| | | console.log(res); |
| | | this.rawMaterialTable = res.data.row |
| | | }, |
| | | async selectInspectsList() { |
| | | // 获取分页列表 |
| | |
| | | // this.$router.push({ name: 'ReportForInspection' }); |
| | | }else if(this.type === 1){ |
| | | this.commisionVisible = true |
| | | getCommisionList({pageNo:1,pageSize:10}).then(res=>{ |
| | | this.commisionTable = res.data |
| | | }) |
| | | getCnList({pageNo:1,pageSize:10}).then(res=>{ |
| | | // consommisioole.log(res); |
| | | this.commisionTable = res.data.row |
| | | }) |
| | | } |
| | | },100) |
| | | }, |
| | |
| | | }, |
| | | //确定跳转 |
| | | QUEding(){ |
| | | // this.tableRow = a |
| | | this.Standardframe = true |
| | | chooseVer({mcode:this.select_1[0].materialCoding, |
| | | name:this.select_1[0].materialName, |
| | | scifications:this.select_1[0].specificationsModels}).then(res => { |
| | | this.BANben = res.data.row |
| | | console.log(this.BANben); |
| | | }) |
| | | |
| | | }, |
| | | handleSelectionChange_0(val){ |
| | | this.select_1 = [] |
| | | val.forEach(v => { |
| | | let obj = {} |
| | | obj.materialCoding = v.materialCoding |
| | | obj.materialName = v.materialName |
| | | obj.specificationsModels = v.specificationsModels |
| | | this.select_1.push(obj) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="dialogVisible = true" |
| | | >新增</el-button |
| | | > |
| | | <el-button size="small" icon="el-icon-delete-solid">删除</el-button> |
| | | <el-button |
| | | size="small" |
| | | icon="el-icon-delete-solid" |
| | | @click="listDeleteClick" |
| | | >删除</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | <div class="table-main-div"> |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column label="日期" width="120"> |
| | | <template slot-scope="scope">{{ scope.row.date }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="姓名" width="120"> |
| | | </el-table-column> |
| | | <el-table-column prop="address" label="地址" show-overflow-tooltip> |
| | | <el-table-column |
| | | label="序号" |
| | | type="index" |
| | | width="70" |
| | | ></el-table-column> |
| | | <el-table-column prop="department" label="部门"> </el-table-column> |
| | | <el-table-column label="操作"> |
| | | <template scope="scope"> |
| | | <el-button type="text" size="mini" @click="updateClick(scope)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button type="text" size="mini" @click="deleteClick(scope)" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | :title="isUpdate ? '更新部门名称' : '新增部门'" |
| | | :visible.sync="dialogVisible" |
| | | width="30%" |
| | | > |
| | | <el-form |
| | | :model="formData" |
| | | :rules="rules" |
| | | ref="ruleForm" |
| | | class="elFormClass" |
| | | > |
| | | <el-form-item label="上级部门:" prop="name" style="padding-left: 10px"> |
| | | <el-input |
| | | v-model="treeNodeData.department" |
| | | :disabled="true" |
| | | style="width: 81.3%" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="部门名称:" |
| | | prop="department" |
| | | style="padding-top: 20px" |
| | | > |
| | | <el-input |
| | | placeholder="请输入部门名称" |
| | | v-model="formData.department" |
| | | clearable |
| | | style="width: 80%" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="saveForm">{{ |
| | | isUpdate ? "更 新" : "新 增" |
| | | }}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getOrganizationalApi } from "@/api/laboratory/organizational"; |
| | | import { |
| | | getOrganizationalApi, |
| | | getTableInitializationApi, |
| | | organizationalAddApi, |
| | | organizationalUpdateApi, |
| | | organizationalDeleteApi, |
| | | } from "@/api/laboratory/organizational"; |
| | | export default { |
| | | name: "Organizational", |
| | | data() { |
| | | return { |
| | | filterText: "", |
| | | dialogVisible: false, |
| | | msg: "", |
| | | isUpdate: false, |
| | | data: [], |
| | | // tree树默认值配置 |
| | | defaultProps: { |
| | |
| | | label: "department", |
| | | id: "id", |
| | | }, |
| | | tableData: [ |
| | | { |
| | | date: "2016-05-02", |
| | | name: "王小虎", |
| | | address: "上海市普陀区金沙江路 1518 弄", |
| | | }, |
| | | { |
| | | date: "2016-05-04", |
| | | name: "王小虎", |
| | | address: "上海市普陀区金沙江路 1517 弄", |
| | | }, |
| | | { |
| | | date: "2016-05-01", |
| | | name: "王小虎", |
| | | address: "上海市普陀区金沙江路 1519 弄", |
| | | }, |
| | | { |
| | | date: "2016-05-03", |
| | | name: "王小虎", |
| | | address: "上海市普陀区金沙江路 1516 弄", |
| | | }, |
| | | ], |
| | | formData: { |
| | | fatherId: "", |
| | | department: "", |
| | | }, |
| | | // 新增按钮里面禁止输入框数据 |
| | | disabledInputShow: "", |
| | | // 保存点击节点数据 |
| | | treeNodeData: {}, |
| | | // 多选删除 |
| | | listDelete: [], |
| | | // 表格数据 |
| | | tableData: [], |
| | | rules: { |
| | | department: [ |
| | | { required: true, message: "请输入活动名称", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "长度在 1 到 5 个字符", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | treeInitialization() { |
| | | getOrganizationalApi().then((res) => { |
| | | this.data = res.data; |
| | | // 初始化默认msg提示路径为第一节点名称 |
| | | this.msg = res.data[0].department; |
| | | // 初始化调用表格接口 |
| | | this.tableInitialization(res.data[0].id); |
| | | // 初始化保存第一节点数据 |
| | | this.treeNodeData.department = res.data[0].department; |
| | | this.treeNodeData.id = res.data[0].id; |
| | | }); |
| | | }, |
| | | // 获取树路径 |
| | |
| | | // 点击树节点 |
| | | handleNodeClick(data, node, element) { |
| | | this.getParentData(node.parent, node.data.department); |
| | | console.log(`output->this.msg`, this.msg); |
| | | console.log(`output->data`, data); |
| | | console.log(`output->node`, node); |
| | | console.log(`output->element`, element); |
| | | // 由于点击第一节点无法触发getParentData里面的判断,只能额外判断 |
| | | if (node.data.id === 0) { |
| | | this.msg = node.data.department; |
| | | } |
| | | // 点击节点数据存储下来 |
| | | this.treeNodeData = node.data; |
| | | // 点击触发该函数,更新表格数据 |
| | | this.tableInitialization(node.data.id); |
| | | }, |
| | | // 改变多选框状态 |
| | | toggleSelection(rows) { |
| | |
| | | }, |
| | | // 点击多选框以后的操作 |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val; |
| | | this.listDelete = [] |
| | | val.forEach((v) => { |
| | | this.listDelete.push(v.id); |
| | | }); |
| | | }, |
| | | // 初始化表格数据 |
| | | tableInitialization(departmentId) { |
| | | getTableInitializationApi(departmentId).then((res) => { |
| | | this.tableData = res.data; |
| | | }); |
| | | }, |
| | | // 更新与新增表单 |
| | | saveForm() { |
| | | this.formData.fatherId = this.treeNodeData.id; |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | if (valid) { |
| | | if (!this.isUpdate) { |
| | | organizationalAddApi(this.formData).then((res) => { |
| | | this.$message({ |
| | | message: res.message, |
| | | type: "success", |
| | | }); |
| | | this.treeInitialization(); |
| | | this.dialogVisible = false; |
| | | }); |
| | | } else { |
| | | organizationalUpdateApi(this.formData).then((res) => { |
| | | this.$message({ |
| | | message: res.message, |
| | | type: "success", |
| | | }); |
| | | this.treeInitialization(); |
| | | this.dialogVisible = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 点击编辑触发 |
| | | updateClick(scope) { |
| | | this.dialogVisible = true; |
| | | this.isUpdate = true; |
| | | this.formData.id = scope.row.id; |
| | | this.formData.fatherId = this.treeNodeData.id; |
| | | this.formData.department = scope.row.department; |
| | | }, |
| | | // 表格中的删除按钮 |
| | | deleteClick(scope) { |
| | | organizationalDeleteApi(scope.row.id).then((res) => { |
| | | this.$message({ |
| | | message: res.message, |
| | | type: "success", |
| | | }); |
| | | this.treeInitialization(); |
| | | }); |
| | | }, |
| | | // 头部多选删除 |
| | | listDeleteClick() { |
| | | organizationalDeleteApi(this.listDelete).then((res) => { |
| | | this.$message({ |
| | | message: res.message, |
| | | type: "success", |
| | | }); |
| | | this.treeInitialization(); |
| | | }); |
| | | }, |
| | | }, |
| | | mounted() { |
| | |
| | | watch: { |
| | | filterText(val) { |
| | | this.$refs.tree.filter(val); |
| | | }, |
| | | dialogVisible: { |
| | | handler(newVal, oldVal) { |
| | | if (newVal == false) { |
| | | this.isUpdate = false; |
| | | this.formData = {}; |
| | | this.$refs.ruleForm.resetFields(); |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | font-weight: 500; |
| | | color: #999999; |
| | | } |
| | | .elFormClass .el-form-item__error { |
| | | padding-left: 90px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="personnel-main "> |
| | | <div class="personnel-main"> |
| | | <div class="page-header-search"> |
| | | <div class="search-bar"> |
| | | <el-form ref="form" :inline="true"> |
| | |
| | | </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="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 |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="dialogFormVisible = true" |
| | | >新增人员</el-button |
| | | > |
| | | |
| | | <el-dialog title="新增人员" :visible.sync="dialogFormVisible" width="30%"> |
| | | <el-form :model="form" :rules="rules"> |
| | | <el-form-item label="账号" :label-width="formLabelWidth" prop="account"> |
| | | <el-input v-model="form.account" autocomplete="off" /> |
| | | <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" autocomplete="off" /> |
| | | <el-input v-model="form.age" /> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱" :label-width="formLabelWidth" prop="email"> |
| | | <el-input v-model="form.email" autocomplete="off" /> |
| | | <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" autocomplete="off" /> |
| | | <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" autocomplete="off" /> |
| | | <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" prop="role_id"> |
| | | <el-input v-model="form.role_id" autocomplete="off" /> |
| | | <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="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()">确 定</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" :max-height="700" :cell-style="{ textAlign: 'center' }" |
| | | :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" |
| | | :data="personnerlTable" style="width: 100%"> |
| | | <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" /> |
| | | <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" /> |
| | | <el-table-column prop="email" label="邮箱" min-width="200" /> |
| | | <el-table-column prop="jobState" label="在职状态" min-width="120" |
| | | :filters="[{ text: 0, value: 0 }, { text: 1, value: 1 }]" :filter-method="filterTag" |
| | | filter-placement="bottom-end"> |
| | | <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"> |
| | | {{ |
| | | scope.row.email === "" || scope.row.email === undefined |
| | | ? "---" |
| | | : scope.row.email |
| | | }} |
| | | </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> |
| | | <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> |
| | | <!-- <el-button type="text" size="small">编辑</el-button> --> |
| | | <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="[100, 200, 300, 400]" :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" :total="this.personnerlTable.length" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange" /> |
| | | <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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { get, post } from '@/api/util/requestUtil'; |
| | | import urlInfo from '../../../api/urlEnum/personnel.js' |
| | | 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: '', |
| | | personnerlTable: [ |
| | | |
| | | ], |
| | | keyword: "", |
| | | roleList: "", |
| | | personnerlTable: [], |
| | | filteredpersonnerlTable: [], |
| | | currentindex: 1, |
| | | currentPage: 1, // 当前页码 |
| | |
| | | personData: [], // 用来存放接口传过来的人员列表数据 |
| | | dialogFormVisible: false, |
| | | form: { |
| | | account: '', |
| | | age: '', |
| | | email: '', |
| | | name: '', |
| | | phone: '', |
| | | role_id: '' |
| | | account: "", |
| | | age: "", |
| | | email: "", |
| | | name: "", |
| | | phone: "", |
| | | organizationId: "", |
| | | roleId: "", |
| | | }, |
| | | formLabelWidth: '100px', |
| | | myProp: { |
| | | value: "id", |
| | | label: "department", |
| | | checkStrictly: true, //允许选择任意一节 |
| | | }, |
| | | formLabelWidth: "100px", |
| | | rules: { |
| | | account: [ |
| | | { |
| | | required: true, message: '请输入账号', trigger: 'blur' |
| | | } |
| | | required: true, |
| | | message: "请输入账号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | name: [{ |
| | | required: true, message: '请输入名字', trigger: 'blur' |
| | | }], |
| | | name: [ |
| | | { |
| | | required: true, |
| | | message: "请输入名字", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | phone: [ |
| | | // { required: true, message: '请输入11位电话号码', trigger: 'blur' }, |
| | | { pattern: /^1[34578]\d{9}$/, message: '非法手机号码', trigger: 'blur' } |
| | | { |
| | | pattern: /^1[3456789]\d{9}$/, |
| | | message: "非法手机号码", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | email: [ |
| | | // { required: true, message: '请输入邮箱地址', trigger: 'blur' }, |
| | | { type: 'email', message: '非法邮箱地址', trigger: ['blur', 'change'] } |
| | | { |
| | | type: "email", |
| | | message: "非法邮箱地址", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | role_id: [ |
| | | { required: true, message: '请输入权限(0或1)', trigger: 'blur' } |
| | | |
| | | ] |
| | | } |
| | | } |
| | | organizationId: [ |
| | | { |
| | | required: true, |
| | | type: "array", |
| | | message: "请选择部门", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | roleId: [ |
| | | { required: true, message: "请输入权限(0或1)", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | options: [], |
| | | status: "", |
| | | isUpdate: false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.getData() |
| | | this.getData(); |
| | | this.getTreeData(); |
| | | }, |
| | | methods: { |
| | | // 每页条数改变时触发 选择一页显示多少行 |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`) |
| | | this.currentPage = 1 |
| | | this.pageSize = val |
| | | console.log(`每页 ${val} 条`); |
| | | this.currentPage = 1; |
| | | this.pageSize = val; |
| | | }, |
| | | filterTag() { |
| | | console.log(11); |
| | | filterTag(value) { |
| | | this.status = ""; |
| | | this.status = value; |
| | | return true; |
| | | }, |
| | | // 当前页改变时触发 跳转其他页 |
| | | handleCurrentChange(val) { |
| | | console.log(`当前页: ${val}`) |
| | | this.currentPage = val |
| | | console.log(`当前页: ${val}`); |
| | | this.currentPage = val; |
| | | }, |
| | | async getData() { |
| | | let data = { |
| | | pageNo: 0, |
| | | pageSize: 20, |
| | | name: this.keyword |
| | | } |
| | | 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 |
| | | 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 |
| | | return item.username === this.keyword; |
| | | }); |
| | | this.personnerlTable = this.filteredpersonnerlTable; |
| | | }, |
| | | resetData() { |
| | | // console.log("111111") |
| | | this.personnerlTable = this.personData |
| | | this.keyword = '' |
| | | this.personnerlTable = this.personData; |
| | | this.keyword = ""; |
| | | this.status = ""; |
| | | this.getData(); |
| | | }, |
| | | // 提交新增人员表单 |
| | | submitForm() { |
| | | // Handle form submission here |
| | | // console.log(this.form); |
| | | // POST请求 |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.dialogFormVisible = false |
| | | axios.post('/user/add_new_personnel', this.form) |
| | | .then(response => { |
| | | console.log(response) |
| | | // this.dialogVisible = false; |
| | | }) |
| | | .catch(error => { |
| | | console.error(error) |
| | | }) |
| | | 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 |
| | | 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 后端返回的id |
| | | **/ |
| | | 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(); |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .personnel-main { |
| | | |
| | | // width: 100%; |
| | | // height: 100%; |
| | | .page-header-search { |
| | |
| | | background: #fff; |
| | | padding: 20px 20px 10px 20px; |
| | | |
| | | >div:nth-child(2) { |
| | | > div:nth-child(2) { |
| | | display: flex; |
| | | justify-content: end; |
| | | margin: 10px 0; |
| | |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%; margin-bottom: 20px" |
| | | row-key="name" |
| | | row-key="id" |
| | | border |
| | | height="calc(100vh - 250px)" |
| | | default-expand-all |
| | | ref="multipleTable" |
| | | @select="selectTr" |
| | | @select-all="selectAll" |
| | | @selection-change="handleSelectionChange" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column type="selection" label="序号"> </el-table-column> |
| | |
| | | this.$message.error("添加失败"); |
| | | } |
| | | |
| | | console.log(res); |
| | | this.$message.success("添加成功"); |
| | | this.addTreeForm = { |
| | | addTypeArr: [], |
| | |
| | | this.isAllSelect = !this.isAllSelect; |
| | | let data = this.tableData; |
| | | this.toggleSelect(data, this.isAllSelect, "all"); |
| | | // 自定义 |
| | | if (this.isAllSelect) { |
| | | val.forEach((i) => { |
| | | if (i.id !== undefined) { |
| | | this.deleteList.push(i.id); |
| | | } else { |
| | | i.children.forEach((c) => { |
| | | this.deleteList.push(c.id); |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | this.deleteList.splice(0, this.deleteList.length); |
| | | } |
| | | }, |
| | | //选择某行 |
| | | selectTr(selection, row) { |
| | |
| | | this.isAllSelect = row.isChecked; |
| | | this.toggleSelect(row, row.isChecked, "tr"); |
| | | }); |
| | | |
| | | if (row.isChecked === true) { |
| | | if (row.children !== undefined) { |
| | | row.children.forEach((i) => { |
| | | this.deleteList.push(i.id); |
| | | }); |
| | | } else { |
| | | this.deleteList.push(row.id); |
| | | } |
| | | } else if (row.isChecked === false) { |
| | | if (row.children !== undefined) { |
| | | row.children.forEach((i) => { |
| | | this.deleteList.findIndex((c, index) => { |
| | | if (c === i.id) { |
| | | this.deleteList.splice(index, 1); |
| | | return; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | this.deleteList.findIndex((c, index) => { |
| | | if (c === row.id) { |
| | | this.deleteList.splice(index, 1); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | //递归子级 |
| | | toggleSelect(data, flag, type) { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.deleteList = [] |
| | | val.forEach((v) => { |
| | | if(v.id !== undefined){ |
| | | this.deleteList.push(v.id) |
| | | } |
| | | }) |
| | | console.log(`output->this.deleteList`,this.deleteList) |
| | | }, |
| | | // 表格树全部选中配置 结束 |
| | | deleteListClick() { |
| | | deleteListApi(this.deleteList).then((res) => { |