123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680 |
- <template>
- <div class="app-container">
- <div v-show="type == 1">
- <el-table border :data="dueList">
- <!-- <el-table-column type="selection" width="55" align="center" /> -->
- <el-table-column
- label="尽调名称"
- align="center"
- prop="investigateName"
- />
- <el-table-column
- label="尽调人员"
- align="center"
- prop="investigatePerson"
- />
- <el-table-column
- label="尽调费用(元)"
- align="center"
- prop="investigateCost"
- />
- <el-table-column label="描述" align="center" prop="describe" />
- <el-table-column label="备注" align="center" prop="remark" />
- <el-table-column label="创建时间" align="center" prop="createTime" />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="220"
- >
- <template slot-scope="scope">
- <el-button
- class="custom-blue-color"
- size="mini"
- type="text"
- icon="el-icon-search"
- @click="handleLook(scope.row)"
- >查看尽调报告</el-button
- >
- <el-button
- v-show="scope.row.investigatePersonId.indexOf(user.userId) > -1"
- size="mini"
- type="text"
- icon="el-icon-upload2"
- @click="handleSurvey('3', scope.row, scope.row)"
- >上传尽调报告</el-button
- >
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- >修改</el-button
- >
- <el-button
- class="custom-red-color"
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- <!-- 添加或修改尽调申请 -->
- <el-dialog
- :title="dueDiligenceTit"
- :visible.sync="dueDiligenceOpen"
- width="1000px"
- append-to-body
- >
- <el-form
- ref="dueForm"
- class="special-el-form"
- :model="dueForm"
- :rules="dueRules"
- label-width="120px"
- >
- <el-form-item label="尽调名称" prop="investigateName">
- <el-input
- :disabled="dueDiligenceType === '3'"
- v-model="dueForm.investigateName"
- placeholder="请输入尽调名称"
- />
- </el-form-item>
- <el-form-item label="项目名称" prop="projectName">
- <el-input disabled v-model="dueForm.projectName" />
- </el-form-item>
- <el-form-item label="尽调人员" prop="investigatePerson">
- <div
- class="el-input__inner inputSimulation"
- @click="handleSelectPeople"
- :class="{ show_disabled: dueDiligenceType === '3' }"
- >
- {{
- dueForm.investigatePerson
- ? dueForm.investigatePerson
- : "请选择尽调人员"
- }}
- </div>
- </el-form-item>
- <el-form-item label="尽调费用(元)" prop="investigateCost">
- <el-input
- :disabled="dueDiligenceType === '3'"
- v-model="dueForm.investigateCost"
- placeholder="请输入尽调费用"
- onkeyup="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3').replace(/-/g, '')"
- />
- </el-form-item>
- <el-form-item label="文件" prop="file" class="special-el-form-item">
- <fileItem
- :class="{ show_disabled: dueDiligenceType === '3' }"
- ref="fileItems"
- :id="dueForm.id"
- @getFileList="getFileList"
- ></fileItem>
- </el-form-item>
- <el-form-item
- label="描述"
- prop="describe"
- class="special-el-form-item"
- >
- <el-input
- :disabled="dueDiligenceType === '3'"
- rows="4"
- v-model="dueForm.describe"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <el-form-item
- label="备注"
- prop="remark"
- class="special-el-form-item"
- >
- <el-input
- :disabled="dueDiligenceType === '3'"
- rows="4"
- type="textarea"
- v-model="dueForm.remark"
- placeholder="请输入备注"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitDueForm" v-preventReClick
- >确 定</el-button
- >
- <el-button @click="cancelDueForm">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 添加或修改尽调报告 -->
- <el-dialog
- :title="dueDiligenceTit1"
- :visible.sync="dueDiligenceOpen1"
- width="1000px"
- append-to-body
- >
- <h3>尽调申请详情</h3>
- <el-divider></el-divider>
- <el-form
- ref="duePeportForm"
- class="special-el-form"
- :model="duePeportForm"
- :rules="dueRules1"
- label-width="100px"
- >
- <el-form-item label="尽调名称">
- <el-input
- disabled
- v-model="dueForm.investigateName"
- placeholder="请输入尽调名称"
- />
- </el-form-item>
- <el-form-item label="项目名称">
- <el-input disabled v-model="dueForm.projectName" />
- </el-form-item>
- <el-form-item label="尽调人员">
- <el-input disabled v-model="dueForm.investigatePerson" />
- </el-form-item>
- <el-form-item label="尽调费用(元)">
- <el-input disabled v-model="dueForm.investigateCost" />
- </el-form-item>
- <el-form-item label="文件" class="special-el-form-item">
- <!-- class="show_disabled" -->
- <fileItem
- ref="fileItems1"
- :id="dueForm.id"
- @getFileList="getFileList"
- ></fileItem>
- </el-form-item>
- <el-form-item label="描述" class="special-el-form-item">
- <el-input
- disabled
- rows="4"
- v-model="dueForm.describe"
- type="textarea"
- />
- </el-form-item>
- <el-form-item label="备注" class="special-el-form-item">
- <el-input
- disabled
- rows="4"
- type="textarea"
- v-model="dueForm.remark"
- />
- </el-form-item>
- <h3>尽调报告</h3>
- <el-divider></el-divider>
- <el-form-item
- label="文件"
- prop="listFile"
- class="special-el-form-item"
- >
- <fileItem
- ref="reportFileItems"
- :id="duePeportForm.id"
- @getFileList="getreportFileList"
- ></fileItem>
- </el-form-item>
- <el-form-item
- label="备注"
- prop="remark"
- class="special-el-form-item"
- >
- <el-input
- rows="4"
- type="textarea"
- v-model="duePeportForm.remark"
- placeholder="请输入备注"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="submitduePeportForm"
- v-preventReClick
- >确 定</el-button
- >
- <el-button @click="cancelduePeportForm">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 查看该申请下的所有尽调报告 -->
- <el-dialog
- title="尽调报告"
- :visible.sync="dueDiligenceOpen2"
- width="1000px"
- append-to-body
- class="examineDialog"
- >
- <div v-if="dueAllPeportList.length > 0">
- <el-form
- v-for="(item, index) in dueAllPeportList"
- :key="index"
- class="special-el-form"
- :model="item"
- label-width="100px"
- >
- <el-form-item label="尽调人员" class="special-el-form-item">
- <el-input disabled v-model="item.investigatePerson" />
- </el-form-item>
- <el-form-item label="文件" class="special-el-form-item">
- <!-- class="show_disabled" -->
- <fileItem
- ref="dueAllreportFileItems"
- :id="item.id"
- @getFileList="getreportFileList"
- ></fileItem>
- </el-form-item>
- <el-form-item label="备注" class="special-el-form-item">
- <el-input
- disabled
- rows="4"
- type="textarea"
- v-model="item.remark"
- placeholder="请输入备注"
- />
- </el-form-item>
- <el-divider></el-divider>
- </el-form>
- </div>
- <div
- v-else
- class="public-flex-center public-padded-t-20"
- style="color: #909399"
- >
- 暂无数据
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="dueDiligenceOpen2 = false"
- >确 定</el-button
- >
- <el-button @click="dueDiligenceOpen2 = false">取 消</el-button>
- </div>
- </el-dialog>
- </el-table>
- </div>
- <!--选择人员-->
- <selecUser
- ref="flowUser"
- :checkType="checkType"
- :selectValues="selectValues"
- :selectNameValues="selectNameValues"
- @handleUserSelect="handleUserSelect"
- ></selecUser>
- </div>
- </template>
- <script>
- import {
- getInvestigatelist,
- getlistProjectPoolId,
- delInvestigate,
- updateInvestigate,
- addInvestigatePerson,
- addInvestigate,
- getProjectInvestigateId,
- dueAllPeportList,
- } from "@/api/invest/pool";
- import projectItem from "./projectItem";
- import fileItem from "./fileItem";
- import selecDept from "./selecDept";
- import selecUser from "./selecUser";
- export default {
- props: {
- projectId: {
- type: String,
- },
- projectName: {
- type: String,
- default: null,
- required: false,
- },
- type: {
- type: Number, //1显示表格 2不显示
- },
- },
- dicts: ["up_way", "project_stage"],
- components: { projectItem, fileItem, selecDept, selecUser },
- data() {
- const validateLogo = (rule, value, callback) => {
- if (this.reportFileList.length <= 0) {
- callback(new Error("请上传文件"));
- } else {
- callback();
- }
- };
- return {
- // 人员选择器
- checkType: "multiple",
- // 数据回显
- selectValues: null,
- selectNameValues: null,
- userVisible: false,
- dueList: [],
- total: null,
- user: {
- userId: null,
- nickName: null,
- },
- dueDiligenceTit: "",
- dueDiligenceOpen: false,
- dueDiligenceTit1: "",
- dueDiligenceOpen1: false,
- dueDiligenceOpen2: false,
- duePeportForm: {
- createBy: null,
- createTime: null,
- deptId: null,
- deptName: null,
- id: null,
- investigatePerson: null,
- investigatePersonId: null,
- listFile: null,
- projectInvestigateId: null,
- remark: null,
- updateBy: null,
- updateTime: null,
- },
- dueForm: {
- id: null,
- investigateName: null,
- investigateCode: null,
- projectPoolId: null,
- investigatePerson: null,
- investigatePersonId: null,
- investigateCost: null,
- describe: null,
- remark: null,
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- projectPoolId: null,
- projectName: null,
- },
- dueAllPeportList: [],
- dueRules1: {
- listFile: [{ required: true, validator: validateLogo }],
- remark: [{ required: true, trigger: "blur", message: "请输入" }],
- },
- dueRules: {
- investigateName: [
- { required: true, trigger: "blur", message: "请输入" },
- ],
- projectName: [{ required: true, trigger: "blur", message: "请输入" }],
- investigatePerson: [
- { required: true, trigger: "blur", message: "请选择" },
- ],
- investigateCost: [
- { required: true, trigger: "blur", message: "请输入" },
- ],
- describe: [{ required: true, trigger: "blur", message: "请输入" }],
- },
- fileList: [],
- reportFileList: [],
- dueDiligenceType: "0",
- };
- },
- watch: {
- dueDiligenceOpen: function (newValue, oldValue) {
- if (newValue === false) {
- this.selectValues = null;
- this.selectNameValues = null;
- }
- },
- },
- mounted() {
- this.user = this.$store.getters.user;
- this.user.userId = this.user.userId.toString();
- this.getList();
- },
- methods: {
- // getProjectName(projectName) {
- // this.projectName = projectName;
- // },
- /** 查询文件资料列表 */
- getList() {
- // this.loading = true;
- getInvestigatelist(this.projectId).then((response) => {
- this.dueList = response.rows;
- this.total = response.total;
- // this.loading = false;
- });
- },
- handleSelectPeople() {
- this.$refs.flowUser.handleUserVisible(true);
- },
- // 查看尽调报告
- handleLook(row) {
- let that = this;
- dueAllPeportList(row.id).then((response) => {
- let rows = response.rows;
- this.dueAllPeportList = rows;
- this.dueDiligenceOpen2 = true;
- if (rows && rows.length > 0) {
- for (let i in rows) {
- setTimeout(() => {
- this.$refs.dueAllreportFileItems[i].handleButton();
- this.$refs.dueAllreportFileItems[i].getListFileBusinessId(
- rows[i].id
- );
- }, 300);
- }
- }
- });
- },
- // 修改尽调申请
- handleUpdate(row) {
- let that = this;
- this.resetDueForm();
- const id = row.projectPoolId || row.id;
- getlistProjectPoolId(id).then((response) => {
- if (response.tProjectInvestigate) {
- this.dueForm = response.tProjectInvestigate;
- this.dueForm.projectName = this.projectName;
- this.selectValues = response.tProjectInvestigate.investigatePersonId;
- this.selectNameValues =
- response.tProjectInvestigate.investigatePerson;
- this.dueDiligenceTit = "修改尽调申请";
- this.dueDiligenceOpen = true;
- setTimeout(() => {
- that.$refs.fileItems.fileList = [];
- that.$refs.fileItems.getListFileBusinessId(this.dueForm.id);
- }, 300);
- }
- });
- },
- /*用户选中赋值*/
- checkUserComplete() {
- this.userVisible = false;
- // this.checkType = "";
- },
- // 获取fileList
- getFileList(fileList) {
- this.fileList = fileList;
- },
- getreportFileList(fileList) {
- this.reportFileList = fileList;
- },
- // 用户选中数据
- 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);
- this.dueForm.investigatePerson = nickName.join(",");
- this.dueForm.investigatePersonId = userIds.join(",");
- this.selectNameValues = nickName.join(",");
- this.selectValues = userIds.join(",");
- } else {
- this.dueForm.investigatePerson = selection.nickName;
- this.dueForm.investigatePersonId = selection.userId;
- this.selectNameValues = selection.nickName;
- this.selectValues = selection.userId;
- }
- this.$refs.dueForm.clearValidate(["investigatePerson"]);
- }
- },
- // 发起尽调申请
- handleSurvey(type, row, transmitForm) {
- // console.log(type, row, transmitForm);
- let that = this;
- this.dueDiligenceType = type;
- //type 1=发起 2=修改 3=上传
- if (type === "1") {
- this.resetDueForm();
- setTimeout(() => {
- that.$refs.fileItems.fileList = [];
- }, 300);
- this.dueDiligenceTit = "发起尽调申请";
- this.dueDiligenceOpen = true;
- } else if (type === "2") {
- this.handleUpdate(row);
- } else if (type === "3") {
- this.dueForm = transmitForm;
- this.dueForm.projectName = this.projectName;
- this.duePeportForm.projectInvestigateId = this.dueForm.id;
- setTimeout(() => {
- that.$refs.fileItems1.handleButton();
- that.$refs.fileItems1.getListFileBusinessId(this.dueForm.id);
- }, 300);
- this.dueDiligenceTit1 = "上传尽调报告";
- getProjectInvestigateId(this.dueForm.id).then((response) => {
- if (response.data) {
- this.duePeportForm = response.data;
- setTimeout(() => {
- that.$refs.reportFileItems.fileList = [];
- that.$refs.reportFileItems.getListFileBusinessId(
- this.duePeportForm.id
- );
- }, 300);
- }
- this.dueDiligenceOpen1 = true;
- });
- }
- this.dueForm.projectName = row.projectName;
- // this.dueForm.projectPoolId = row.id;
- this.dueForm.projectPoolId = this.projectId;
- },
- // 尽调报告
- submitduePeportForm() {
- this.$refs["duePeportForm"].validate((valid) => {
- if (valid) {
- this.duePeportForm.projectPoolId = this.dueForm.projectPoolId;
- this.duePeportForm.listFile = this.reportFileList;
- addInvestigatePerson(this.duePeportForm).then((response) => {
- this.$modal.msgSuccess("操作成功");
- this.dueDiligenceOpen1 = false;
- });
- }
- });
- },
- cancelduePeportForm() {
- this.dueDiligenceOpen1 = false;
- this.resetduePeportForm();
- },
- resetduePeportForm() {
- this.duePeportForm = {
- createBy: null,
- createTime: null,
- deptId: null,
- deptName: null,
- id: null,
- investigatePerson: null,
- investigatePersonId: null,
- listFile: null,
- remark: null,
- updateBy: null,
- updateTime: null,
- projectInvestigateId: this.dueForm.id,
- };
- },
- // 尽调申请
- submitDueForm() {
- this.$refs["dueForm"].validate((valid) => {
- if (valid) {
- this.dueForm.listFile = this.fileList;
- this.dueForm.investigateCost = this.dueForm.investigateCost.replace(
- /-/g,
- ""
- );
- if (this.dueForm.id != null) {
- updateInvestigate(this.dueForm).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.dueDiligenceOpen = false;
- this.getList();
- });
- } else {
- addInvestigate(this.dueForm).then((response) => {
- this.$modal.msgSuccess("新增成功");
- this.dueDiligenceOpen = false;
- this.getList();
- });
- }
- this.getList();
- }
- });
- },
- cancelDueForm() {
- this.dueDiligenceOpen = false;
- this.resetDueForm();
- },
- // 表单重置
- resetDueForm() {
- this.dueForm = {
- id: null,
- investigateName: null,
- investigateCode: null,
- projectPoolId: null,
- investigatePerson: null,
- investigatePersonId: null,
- investigateCost: null,
- describe: null,
- remark: null,
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- projectPoolId: null,
- projectName: null,
- };
- this.resetForm("dueForm");
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- const investigateName = row.investigateName
- ? row.investigateName
- : "此项";
- this.$modal
- .confirm('是否确认删除"' + investigateName + '"?')
- .then(function () {
- return delInvestigate(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- },
- };
- </script>
- <style lang="scss">
- .examineDialog {
- .el-input.is-disabled .el-input__inner,
- .el-textarea.is-disabled .el-textarea__inner {
- background-color: #fff;
- color: #333;
- }
- }
- </style>
|