| | |
| | | }) |
| | | |
| | | function getDeptList() { |
| | | listDept({}).then(response => { |
| | | listDept({safety: '1'}).then(response => { |
| | | state.deptList = proxy.handleTree(response.data, "deptId") |
| | | }); |
| | | } |
| | |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="deptList" :border="true" row-key="deptId" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
| | | <el-table-column prop="deptName" label="部门名称" align="center"></el-table-column> |
| | | <el-table-column prop="checkCount" label="检查状态" align="center"> |
| | | <el-table-column label="检查状态" align="center"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.checkCount > 0" type="success">已检查</el-tag> |
| | | <el-tag v-else type="danger">未检查</el-tag> |
| | | <el-tag v-if="scope.row.safety == '1' && scope.row.checkCount > 0" type="success">已检查</el-tag> |
| | | <el-tag v-if="scope.row.safety == '1' && scope.row.checkCount == 0" type="danger">未检查</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | |
| | | <!-- 添加或修改部门对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="600px" append-to-body> |
| | | <el-form ref="deptRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form ref="deptRef" :model="form" :rules="rules" label-width="110px"> |
| | | <el-row> |
| | | <el-col :span="24" v-if="form.parentId !== 0"> |
| | | <el-form-item label="上级部门" prop="parentId"> |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全检查统计"> |
| | | <el-radio-group v-model="form.safety"> |
| | | <el-radio key="1" label="1">是</el-radio> |
| | | <el-radio key="0" label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | deptName: [{ required: true, message: "部门名称不能为空", trigger: "blur" }], |
| | | orderNum: [{ required: true, message: "显示排序不能为空", trigger: "blur" }], |
| | | email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }], |
| | | phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }] |
| | | phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }], |
| | | safety: [{ required: true, message: "请选择是否安全检查统计", trigger: ["blur", "change"] }], |
| | | }, |
| | | }); |
| | | |
| | |
| | | leader: undefined, |
| | | phone: undefined, |
| | | email: undefined, |
| | | status: "0" |
| | | status: "0", |
| | | safety: '1' |
| | | }; |
| | | proxy.resetForm("deptRef"); |
| | | } |