|
@@ -200,45 +200,77 @@
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="0px">
|
|
|
<el-descriptions title="" :column="3" border>
|
|
|
<el-descriptions-item label="登记人部门">
|
|
|
- <el-form-item label="" prop="applicantDept">
|
|
|
- <el-input v-model="form.applicantDept" placeholder="请输入登记人部门" />
|
|
|
- </el-form-item>
|
|
|
+ <el-select
|
|
|
+ v-model="form.applicantDept"
|
|
|
+ @change="handleDeptOrTeamChange"
|
|
|
+ placeholder="请选择部门">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in applicantDeptOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="登记人班组">
|
|
|
- <el-form-item label="" prop="applicantTeam">
|
|
|
- <el-input v-model="form.applicantTeam" placeholder="请输入登记人班组" />
|
|
|
- </el-form-item>
|
|
|
+ <el-select
|
|
|
+ v-model="form.applicantTeam"
|
|
|
+ @change="handleDeptOrTeamChange"
|
|
|
+ :disabled="applicantTeamDisabled"
|
|
|
+ placeholder="请选择班组">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in applicantTeamOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="登记人">
|
|
|
- <el-form-item label="" prop="applicant">
|
|
|
- <el-input v-model="form.applicant" placeholder="请输入登记人" />
|
|
|
- </el-form-item>
|
|
|
+ <el-select
|
|
|
+ v-model="form.applicant"
|
|
|
+ placeholder="请选择登记人">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in applicantOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="问题描述" :span="3">
|
|
|
- <el-form-item label="" prop="description">
|
|
|
- <el-input v-model="form.description" placeholder="请输入问题描述" />
|
|
|
- </el-form-item>
|
|
|
+ <el-input v-model="form.description" placeholder="请输入问题描述" type="textarea" autosize/>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="附件" :span="3">
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="隐患" :span="3">
|
|
|
- <el-form-item label="" prop="unsafeStatus">
|
|
|
- <el-input v-model="form.unsafeStatus" placeholder="请输入不安全状态" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="" prop="unsafeAction">
|
|
|
- <el-input v-model="form.unsafeAction" placeholder="请输入不安全行为" />
|
|
|
- </el-form-item>
|
|
|
+ <el-radio v-model="unsafeChoice" label="1" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全状态</el-radio>
|
|
|
+ <el-select v-model="form.unsafeStatus" placeholder="请选择不安全状态" :disabled="unsafeStatusDisabled" style="margin-right: 20px;">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in unsafeStatusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-radio v-model="unsafeChoice" label="2" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全行为</el-radio>
|
|
|
+ <el-select v-model="form.unsafeAction" placeholder="请选择不安全行为" :disabled="unsafeActionDisabled">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in unsafeActionOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="记录日期">
|
|
|
- <el-form-item label="" prop="applyDate">
|
|
|
- <el-date-picker clearable size="small" style="width: 200px"
|
|
|
- v-model="form.applyDate"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="选择记录日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="form.applyDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择记录日期">
|
|
|
+ </el-date-picker>
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</el-form>
|
|
@@ -286,12 +318,13 @@
|
|
|
|
|
|
<script>
|
|
|
import { submitApply, listApply, getApply, delApply, addApply, updateApply, exportApply, importTemplate} from "@/api/production/apply";
|
|
|
-import { treeselect } from "@/api/system/dept";
|
|
|
+import { treeselect, listDept } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
|
|
|
import ProcessImg from '@/views/approve/processImg/index';
|
|
|
+import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
|
|
|
|
|
|
export default {
|
|
|
name: "Apply",
|
|
@@ -373,10 +406,28 @@ export default {
|
|
|
},
|
|
|
// 申请状态字典
|
|
|
applyStatusOptions: [],
|
|
|
+ // 登记人班组字典
|
|
|
+ applicantTeamOptions: [],
|
|
|
+ // 登记人部门列表
|
|
|
+ applicantDeptOptions: [],
|
|
|
+ // 登记人列表
|
|
|
+ applicantOptions: [],
|
|
|
+ // 不安全状态字典
|
|
|
+ unsafeStatusOptions: [],
|
|
|
+ // 不安全行为字典
|
|
|
+ unsafeActionOptions: [],
|
|
|
// 是否显示SAI开项申请详情对话框
|
|
|
saiApplyVisible: false,
|
|
|
// 是否显示流程图对话框
|
|
|
processImgVisible: null,
|
|
|
+ // 不安全状态/行为选项
|
|
|
+ unsafeChoice: '1',
|
|
|
+ // 是否禁用不安全状态下拉框
|
|
|
+ unsafeStatusDisabled: false,
|
|
|
+ // 是否禁用不安全行为下拉框
|
|
|
+ unsafeActionDisabled: true,
|
|
|
+ // 是否禁用班组下拉框
|
|
|
+ applicantTeamDisabled: false,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -396,8 +447,96 @@ export default {
|
|
|
this.getDicts("SAI_APPLY_STATUS").then(response => {
|
|
|
this.applyStatusOptions = response.data;
|
|
|
});
|
|
|
+ // 加载登记人班组字典
|
|
|
+ this.getDicts("TEAM_DIVIDE").then(response => {
|
|
|
+ this.applicantTeamOptions = response.data;
|
|
|
+ });
|
|
|
+ // 加载登记人部门列表
|
|
|
+ this.getApplicantDeptOptions();
|
|
|
+ // 加载登记人列表
|
|
|
+ this.listStaffmgrByDeptAndTeam(null, null);
|
|
|
+ // 加载不安全状态字典
|
|
|
+ this.getDicts("SAI_UNSAFE_STATUS").then(response => {
|
|
|
+ this.unsafeStatusOptions = response.data;
|
|
|
+ });
|
|
|
+ // 加载不安全行为字典
|
|
|
+ this.getDicts("SAI_UNSAFE_ACTION").then(response => {
|
|
|
+ this.unsafeActionOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 加载当前登录员工信息 */
|
|
|
+ getLoginStaffInfo() {
|
|
|
+ getLoginStaffInfo().then(response => {
|
|
|
+ let staff = response.data;
|
|
|
+ if (staff != null) {
|
|
|
+ this.form.applicantDept = staff.deptId;
|
|
|
+ if (staff.deptId == '103') {
|
|
|
+ this.form.applicantTeam = staff.team;
|
|
|
+ }
|
|
|
+ this.form.applicant = staff.staffid;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 加载登记人部门列表 */
|
|
|
+ getApplicantDeptOptions() {
|
|
|
+ listDept(null).then(response => {
|
|
|
+ let deptList = response.data;
|
|
|
+ this.applicantDeptOptions = [];
|
|
|
+ for (let i = 0; i < deptList.length; i++) {
|
|
|
+ if (deptList[i].ancestors.indexOf("100") != -1 || deptList[i].id == 100) {
|
|
|
+ this.applicantDeptOptions.push({
|
|
|
+ dictLabel: deptList[i].deptName,
|
|
|
+ dictValue: deptList[i].deptId
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 部门/班组值改变事件 */
|
|
|
+ handleDeptOrTeamChange() {
|
|
|
+ this.applicantOptions = [];
|
|
|
+ this.form.applicant = null;
|
|
|
+ let applicantDept = this.form.applicantDept;
|
|
|
+ if (applicantDept != '103') {
|
|
|
+ this.applicantTeamDisabled = true;
|
|
|
+ this.form.applicantTeam = null;
|
|
|
+ } else {
|
|
|
+ this.applicantTeamDisabled = false;
|
|
|
+ }
|
|
|
+ let applicantTeam = this.form.applicantTeam;
|
|
|
+ // 加载登记人列表
|
|
|
+ this.listStaffmgrByDeptAndTeam(applicantDept, applicantTeam);
|
|
|
+ },
|
|
|
+ /** 加载登记人列表 */
|
|
|
+ listStaffmgrByDeptAndTeam(applicantDept, applicantTeam) {
|
|
|
+ listStaffmgrByDeptAndTeam({
|
|
|
+ deptId: applicantDept,
|
|
|
+ team: applicantTeam
|
|
|
+ }).then(response => {
|
|
|
+ let staffList = response.rows;
|
|
|
+ this.applicantOptions = [];
|
|
|
+ for (let i = 0; i < staffList.length; i++) {
|
|
|
+ let staffOption = {
|
|
|
+ dictLabel: staffList[i].name,
|
|
|
+ dictValue: staffList[i].staffid
|
|
|
+ }
|
|
|
+ this.applicantOptions.push(staffOption);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 不安全行为/状态单选按钮值改变事件 */
|
|
|
+ handleUnsafeChoiceChange() {
|
|
|
+ if (this.unsafeChoice == '1') {
|
|
|
+ this.form.unsafeAction = null;
|
|
|
+ this.unsafeStatusDisabled = false;
|
|
|
+ this.unsafeActionDisabled = true;
|
|
|
+ } else if (this.unsafeChoice == '2') {
|
|
|
+ this.form.unsafeStatus = null;
|
|
|
+ this.unsafeStatusDisabled = true;
|
|
|
+ this.unsafeActionDisabled = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 流程图 */
|
|
|
processImg (processId) {
|
|
|
this.processImgVisible = true;
|
|
@@ -471,7 +610,7 @@ export default {
|
|
|
description: null,
|
|
|
unsafeStatus: null,
|
|
|
unsafeAction: null,
|
|
|
- applyDate: null,
|
|
|
+ applyDate: new Date(),
|
|
|
taskId: null,
|
|
|
handler: null,
|
|
|
taskName: null,
|
|
@@ -508,6 +647,8 @@ export default {
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.title = "添加SAI开项申请";
|
|
|
+ // 加载当前登录员工信息
|
|
|
+ this.getLoginStaffInfo();
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
@@ -515,6 +656,13 @@ export default {
|
|
|
const saiApplyId = row.saiApplyId || this.ids
|
|
|
getApply(saiApplyId).then(response => {
|
|
|
this.form = response.data;
|
|
|
+ this.form.applicantDept = Number(this.form.applicantDept);
|
|
|
+ if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {
|
|
|
+ this.form.unsafeStatus = this.form.unsafeStatus.toString();
|
|
|
+ }
|
|
|
+ if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
|
|
|
+ this.form.unsafeAction = this.form.unsafeAction.toString();
|
|
|
+ }
|
|
|
this.open = true;
|
|
|
this.title = "修改SAI开项申请";
|
|
|
});
|