diff --git a/jwtech-admin-page/src/views/project/proposal/index.vue b/jwtech-admin-page/src/views/project/proposal/index.vue index 426ec1ef..84fc117c 100644 --- a/jwtech-admin-page/src/views/project/proposal/index.vue +++ b/jwtech-admin-page/src/views/project/proposal/index.vue @@ -204,7 +204,7 @@ {{ scope.row.projectContent || "-" }} --> - + /> --> + + - + + + + + + - + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + @@ -572,10 +621,19 @@ {{ this.reportMsg.approvalTime }} + + + {{ this.reportMsg.approvalDepartment }} + + + + {{ this.reportMsg.approvalNo }} + {{ this.reportMsg.approvalOpinion }} + {{ this.reportMsg.projectContent }} @@ -639,6 +697,7 @@ import { getFileStream } from "@/api/system/upload"; import { getToken } from "@/utils/auth"; import { getAreasData } from "@/api/areas/index"; import { regionData, codeToText, TextToCode } from "element-china-area-data"; +import { v4 as uuidv4 } from "uuid"; export default { name: "Feasibility", @@ -711,7 +770,7 @@ export default { compilingUnit: null, projectContent: null, projectInvestmentEstimate: null, - isBelongPlanning: null, + isApproval: null, relationProjectProposal: null, feasibilityReportFile: null, feasibilityReportAttachment: null, @@ -740,6 +799,34 @@ export default { form: {}, // 表单校验 rules: { + isApproval: [ + { + required: true, + message: "请选择是否有建议书审批", + trigger: "blur", + }, + ], + projectCode: [ + { + required: true, + message: "请输入项目编码", + trigger: "blur", + }, + ], + projectType: [ + { + required: true, + message: "请选择项目类型", + trigger: "blur", + }, + ], + adcd: [ + { + required: true, + message: "请选择行政区划", + trigger: "blur", + }, + ], reportTime: [ { trigger: "blur", @@ -752,6 +839,22 @@ export default { validator: this.compareTime, }, ], + approvalDepartment: [ + { + required: true, + message: "请输入批复部门", + trigger: "blur", + }, + { max: 250, message: "字符长度最大为250", trigger: "blur" }, + ], + approvalNo: [ + { + required: true, + message: "请输入批复文号", + trigger: "blur", + }, + { max: 250, message: "字符长度最大为250", trigger: "blur" }, + ], compilingUnit: [ { max: 250, message: "字符长度最大为250", trigger: "blur" }, ], @@ -768,10 +871,10 @@ export default { }, ], approvalOpinion: [ - { max: 1000, message: "字符长度最大为1000", trigger: "blur" }, + { max: 65500, message: "字符长度最大为65500", trigger: "blur" }, ], projectContent: [ - { max: 1000, message: "字符长度最大为1000", trigger: "blur" }, + { max: 65500, message: "字符长度最大为65500", trigger: "blur" }, ], }, projectType: "", @@ -781,8 +884,9 @@ export default { // projectCode: "", viewTitle: "", reportMsg: {}, - //是否属于规划内字典 - isBelongPlanningOptions: [], + //是否又建议书审批字典 + isApprovalOptions: [], + isEdit: false, }; }, created() { @@ -792,10 +896,20 @@ export default { this.projectTypeOptions = response.data; }); this.getDicts("whether").then((response) => { - this.isBelongPlanningOptions = response.data; + this.isApprovalOptions = response.data; }); }, methods: { + getId(res) { + // console.log(res) + getProposal(res.id).then((response) => { + // console.log(response.data) + this.form.projectType = response.data.projectType; + this.form.proNo = response.data.proNo; + this.form.adcd = response.data.adcd; + this.form.projectCode = response.data.projectCode; + }); + }, compareTime(rule, value, callback) { if (this.form.reportTime && this.form.approvalTime) { // dateStr = dateStr.substring(0,19); @@ -809,6 +923,8 @@ export default { } else { callback(new Error("上报时间不能晚于审批时间")); } + } else { + callback(); } }, formatAdcd(row) { @@ -866,18 +982,18 @@ export default { console.log("value", value); } }, - getId(res) { - // console.log(res) - getProposal(res.id).then((response) => { - // console.log(response.data); - this.projectType = response.data.projectType; - this.proNo = response.data.proNo; - // console.log("this.proNo ", this.proNo); - this.projectCode = response.data.projectCode; - this.form.adcd = response.data.adcd; - // console.log(55555555, this.form.adcd); - }); - }, + // getId(res) { + // // console.log(res) + // getProposal(res.id).then((response) => { + // // console.log(response.data); + // this.projectType = response.data.projectType; + // this.proNo = response.data.proNo; + // // console.log("this.proNo ", this.proNo); + // this.projectCode = response.data.projectCode; + // this.form.adcd = response.data.adcd; + // // console.log(55555555, this.form.adcd); + // }); + // }, clear() { this.fileList = []; this.attachmentList = []; @@ -890,12 +1006,9 @@ export default { // projectNameFormat(row) { // return row.projectName.slice(0, row.projectName.indexOf("[")); // }, - // 是否属于规划内字典翻译 - isBelongPlanningFormat(row, column) { - return this.selectDictLabel( - this.isBelongPlanningOptions, - row.isBelongPlanning - ); + // 是否有建议书审批字典翻译 + isApprovalFormat(row, column) { + return this.selectDictLabel(this.isApprovalOptions, row.isApproval); }, /** 查询可行性研究报告列表 */ getList() { @@ -920,7 +1033,7 @@ export default { compilingUnit: null, projectContent: null, projectInvestmentEstimate: null, - isBelongPlanning: null, + isApproval: null, relationProjectProposal: null, feasibilityReportFile: null, feasibilityReportAttachment: null, @@ -950,7 +1063,7 @@ export default { compilingUnit: null, projectContent: null, projectInvestmentEstimate: null, - isBelongPlanning: null, + isApproval: null, relationProjectProposal: null, feasibilityReportFile: null, feasibilityReportAttachment: null, @@ -991,6 +1104,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.isEdit = false; this.form = {}; this.fileList = []; this.attachmentList = []; @@ -1004,7 +1118,7 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - + this.isEdit = true; // listProjectinfo(this.queryParams).then((response)=>{ // this.projectNameOptions = response.records; // }) @@ -1039,23 +1153,15 @@ export default { }, /** 提交按钮 */ submitForm() { + console.log("0000", this.$refs["form"]); this.$refs["form"].validate((valid) => { + console.log(11111); if (valid) { // 附件 this.form.feasibilityReportFile = JSON.stringify(this.fileList); this.form.feasibilityReportAttachment = JSON.stringify( this.attachmentList ); - - if (this.proNo) { - this.form.proNo = this.proNo; - } - if (this.projectCode) { - this.form.projectCode = this.projectCode; - } - if (this.projectType) { - this.form.projectType = this.projectType; - } if ( this.form.projectName && this.form.projectName.indexOf("[") != -1 @@ -1074,6 +1180,10 @@ export default { } }); } else { + if (this.form.isApproval == "0") { + // console.log("uuidv4()", uuidv4()); + this.form.proNo = uuidv4(); + } addFeasibility(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("新增成功"); diff --git a/jwtech-admin-page/src/views/project/special/options/basePage.vue b/jwtech-admin-page/src/views/project/special/options/basePage.vue index c8bde690..899bf91a 100644 --- a/jwtech-admin-page/src/views/project/special/options/basePage.vue +++ b/jwtech-admin-page/src/views/project/special/options/basePage.vue @@ -325,6 +325,8 @@ export default { } else { callback(new Error("规划基准年时间要小于规划水平年")); } + } else { + callback(); } }, // 获取某一项的所有父节点的label值 list为树形结构的数据 id为回显节点的标识