|
|
@@ -0,0 +1,244 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 添加或修改尽调申请 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="approveDiligenceTit"
|
|
|
+ :visible.sync="approveDiligenceOpen"
|
|
|
+ width="700px"
|
|
|
+ append-to-body
|
|
|
+ class="custom-dialog"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="approveForm"
|
|
|
+ :model="approveForm"
|
|
|
+ :rules="approveRules"
|
|
|
+ label-width="170px"
|
|
|
+ >
|
|
|
+ <el-form-item label="尽调审核人员" prop="investigatePerson">
|
|
|
+ <el-select v-model="approveForm.investigatePerson" placeholder="全部" style="width: 400px;"
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ :created-text="(input) => input"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in approveList"
|
|
|
+ :key="item.userId"
|
|
|
+ :label="item.nickName"
|
|
|
+ :value="item.userId"
|
|
|
+ />
|
|
|
+ <el-option
|
|
|
+ label="无"
|
|
|
+ value="-1"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelApproveForm">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitApproveForm(true)" v-preventReClick>提 交</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!--选择人员-->
|
|
|
+ <selecUser
|
|
|
+ ref="flowUser"
|
|
|
+ :checkType="checkType"
|
|
|
+ :selectValues="selectValues"
|
|
|
+ :selectNameValues="selectNameValues"
|
|
|
+ @handleUserSelect="handleUserSelect"
|
|
|
+ ></selecUser>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+
|
|
|
+import {findApproveUser,saveApproveUser} from "@/api/project/investigate/pool";
|
|
|
+import { listUserNew } from "@/api/system/user";
|
|
|
+import projectItem from "./projectItem";
|
|
|
+import fileItem from "../../invest/components/fileItem";
|
|
|
+import selecDept from "../../invest/components/selecDept";
|
|
|
+import selecUser from "../../invest/components/selecUser";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
+
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ projectId: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ dicts: ["up_way", "project_stage"],
|
|
|
+ components: { projectItem, fileItem, selecDept, selecUser },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pageType: null,
|
|
|
+ // 人员选择器
|
|
|
+ checkType: "multiple",
|
|
|
+ // 数据回显
|
|
|
+ selectValues: null,
|
|
|
+ selectNameValues: null,
|
|
|
+ userVisible: false,
|
|
|
+ approveList: [],
|
|
|
+ total: null,
|
|
|
+ approveDiligenceTit: "",
|
|
|
+ approveDiligenceOpen: false,
|
|
|
+ approveForm: {
|
|
|
+ id: null,
|
|
|
+ userId: null,
|
|
|
+ loginId: null,
|
|
|
+ investigatePerson:[],
|
|
|
+ },
|
|
|
+ approveRules: {
|
|
|
+ investigatePerson: [
|
|
|
+ { required: true, trigger: "blur", message: "请选择" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ showProjectItem: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["user"]),
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ approveDiligenceOpen: function (newValue, oldValue) {
|
|
|
+ if (newValue === false) {
|
|
|
+ this.selectValues = null;
|
|
|
+ this.selectNameValues = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // this.getList();
|
|
|
+ // 人员
|
|
|
+ listUserNew({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ }).then((response) => {
|
|
|
+ this.approveList = response.rows;
|
|
|
+ });
|
|
|
+ this.queryApproveUser();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //展示人员
|
|
|
+ /*handleProjectItem() {
|
|
|
+ this.$refs.projectItem.showProjectItem = true;
|
|
|
+ // 2. 调用子组件的刷新方法,重新加载项目列表
|
|
|
+ // 确保子组件已加载且存在刷新方法
|
|
|
+ if (this.$refs.projectItem && typeof this.$refs.projectItem.refreshProjectList === 'function') {
|
|
|
+ this.$refs.projectItem.refreshProjectList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSelectPeople() {
|
|
|
+ this.$refs.flowUser.handleUserVisible(true);
|
|
|
+ },*/
|
|
|
+ /*用户选中赋值*/
|
|
|
+ /* checkUserComplete() {
|
|
|
+ this.userVisible = false;
|
|
|
+ },*/
|
|
|
+
|
|
|
+ // 用户选中数据
|
|
|
+ handleUserSelect(selection) {
|
|
|
+ const that = this;
|
|
|
+ if (selection) {
|
|
|
+ if (selection instanceof Array) {
|
|
|
+ const userIds = selection.map((item) => item.userId);
|
|
|
+ const nickName = selection.map((item) => item.nickName);
|
|
|
+ const userName = selection.map((item) => item.userName);
|
|
|
+ const deptId = selection.map((item) => item.deptId);
|
|
|
+ const deptName = selection.map((item) => item.deptName);
|
|
|
+ this.approveForm.investigatePerson = nickName.join(",");
|
|
|
+ this.approveForm.userId = userIds.join(",");
|
|
|
+ this.approveForm.loginId = userName.join(",");
|
|
|
+ this.approveForm.deptId = deptId.join(",");
|
|
|
+ this.approveForm.deptName = deptName.join(",");
|
|
|
+ this.selectNameValues = nickName.join(",");
|
|
|
+ this.selectValues = userIds.join(",");
|
|
|
+ } else {
|
|
|
+ this.approveForm.investigatePerson = selection.nickName;
|
|
|
+ this.approveForm.investigatePersonId = selection.userId;
|
|
|
+ this.selectNameValues = selection.nickName;
|
|
|
+ this.selectValues = selection.userId;
|
|
|
+ }
|
|
|
+ this.$refs.approveForm.clearValidate(["investigatePerson"]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询已设置的背调审批人员
|
|
|
+ queryApproveUser(){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ console.log(this.approveList.length);
|
|
|
+
|
|
|
+ findApproveUser().then((response) => {
|
|
|
+ console.log(this.approveList)
|
|
|
+ const approveIds = Array.from(response.rows).map(userId => Number(userId));
|
|
|
+ console.log("选中值格式:", approveIds);
|
|
|
+ this.approveForm.investigatePerson = approveIds;
|
|
|
+
|
|
|
+ // 关键:数据更新后,等待 DOM 渲染完成,再触发 Chosen 更新
|
|
|
+ /*this.$nextTick(() => {
|
|
|
+ // 通过 $refs 获取元素,触发 chosen:updated 事件
|
|
|
+ $(this.$refs.investigatePerson).trigger("chosen:updated");
|
|
|
+ });*/
|
|
|
+ /*alert(this.approveForm.investigatePerson);
|
|
|
+ console.log(approveIds);*/
|
|
|
+ });
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 设置背调审批人员
|
|
|
+ handleShowApplyPop() {
|
|
|
+ let that = this;
|
|
|
+ this.resetApproveForm();
|
|
|
+ this.approveDiligenceTit = "指定审批人员";
|
|
|
+ this.approveDiligenceOpen = true;
|
|
|
+ },
|
|
|
+ // 尽调申请-提交
|
|
|
+ submitApproveForm(flag) {
|
|
|
+ this.$refs["approveForm"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ try {
|
|
|
+ saveApproveUser(this.approveForm).then((response) => {
|
|
|
+ this.$modal.msgSuccess(response.msg);
|
|
|
+ this.approveDiligenceOpen = false;
|
|
|
+ this.$emit("getList");
|
|
|
+ });
|
|
|
+ } catch (err) {
|
|
|
+ // 捕获重复提交错误
|
|
|
+ this.$message.error(err.message);
|
|
|
+ }
|
|
|
+ //this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancelApproveForm() {
|
|
|
+ this.approveDiligenceOpen = false;
|
|
|
+ this.resetApproveForm();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ resetApproveForm() {
|
|
|
+ this.approveForm = {
|
|
|
+ id: null,
|
|
|
+ investigateName: null,
|
|
|
+ investigateCode: null,
|
|
|
+ investigatePerson: null,
|
|
|
+ investigatePersonId: null,
|
|
|
+ investigateCost: null,
|
|
|
+ };
|
|
|
+ this.resetForm("approveForm");
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss">
|
|
|
+.examineDialog {
|
|
|
+ .el-input.is-disabled .el-input__inner,
|
|
|
+ .el-textarea.is-disabled .el-textarea__inner {
|
|
|
+ background-color: #fff;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+}
|
|
|
+/* 控制对话框标题居中 */
|
|
|
+.custom-dialog .el-dialog__header {
|
|
|
+ text-align: center; /* 使标题文字水平居中 */
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|