|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-dialog v-model="visible" :title="titleMap[mode]" :width="680" @closed="$emit('closed', fileIsDel)">
|
|
|
+ <el-dialog v-model="visible" :title="titleMap[mode]" width="700" top="5vh" @closed="$emit('closed', fileIsDel)">
|
|
|
<el-form ref="formRef" :model="form" :rules="rules" :disabled="mode == 'detail'" label-width="110px">
|
|
|
<el-row>
|
|
|
<el-col v-if="form.id" :span="12">
|
|
|
@@ -76,6 +76,20 @@
|
|
|
<el-input v-model="form.abstractContent" type="textarea" :rows="4" placeholder="请输入项目概要"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="政策考核类别" prop="rewardType">
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-radio-group v-model="form.rewardType">
|
|
|
+ <el-collapse-item v-for="(item, key) in rewardTypeDic" :key="key" :name="key + 1">
|
|
|
+ <template #title>
|
|
|
+ <el-radio :label="item.label" :value="key + 1"></el-radio>
|
|
|
+ </template>
|
|
|
+ {{ item.value }}
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-collapse>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item :class="mode == 'detail' && 'no-upload-btn'" label="附件">
|
|
|
<yhUpload v-model="form.fileList" :limit="10" @updateTable="fileIsDel = true">
|
|
|
@@ -85,25 +99,27 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <explain-form v-if="mode == 'detail' && form.id" ref="explainForm" :rowData="form" :disabled="!isExplain" @success="visible = false"></explain-form>
|
|
|
+ <explain-form v-if="mode == 'detail' && form.id" ref="explainForm" :rowData="form" :disabled="!isExplain" @success="visible = false, $emit('success')"></explain-form>
|
|
|
|
|
|
<template #footer>
|
|
|
<template v-if="isExplain">
|
|
|
<el-button type="primary" @click="policyExplain">保存上报</el-button>
|
|
|
</template>
|
|
|
<template v-if="mode == 'add' || mode == 'edit'">
|
|
|
- <el-button type="primary" @click="validateForm(mode)">保 存</el-button>
|
|
|
- <el-button type="primary" @click="validateForm('saveApprove')">直接上报</el-button>
|
|
|
+ <el-button type="primary" @click="submit(mode)">保 存</el-button>
|
|
|
+ <el-button type="primary" @click="submit('saveApprove')">直接上报</el-button>
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import moment from "moment";
|
|
|
import Common from "@/api/common";
|
|
|
import API from "@/api/policy/strive";
|
|
|
import { useUserStore } from "@/store/user";
|
|
|
import { levelDic, typeDic } from "@/views/policyShare/main";
|
|
|
+import { rewardTypeDic } from "@/views/policyStrive/main";
|
|
|
import yhUpload from "@/components/Upload/index.vue";
|
|
|
import explainForm from "@/views/policyStrive/explain.vue";
|
|
|
|
|
|
@@ -122,7 +138,8 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
- levelDic, typeDic,
|
|
|
+ levelDic, typeDic, rewardTypeDic,
|
|
|
+ activeNames: [],
|
|
|
|
|
|
visible: false,
|
|
|
isExplain: false,
|
|
|
@@ -150,8 +167,10 @@ export default {
|
|
|
yjFinishTime: null,
|
|
|
yjStriveAmount: null,
|
|
|
abstractContent: null,
|
|
|
+ rewardType: null,
|
|
|
isLand: 0,
|
|
|
landAmount: null,
|
|
|
+ sjFinishTime: null,
|
|
|
partPersonArr: "[]", // [{name: }]
|
|
|
partPerson: null, // a1,a2
|
|
|
monthSituation: null,
|
|
|
@@ -168,7 +187,8 @@ export default {
|
|
|
directorName: [{ required: true, message: "请输入责任人" }],
|
|
|
yjFinishTime: [{ required: true, message: "请选择预计完成时间" }],
|
|
|
yjStriveAmount: [{ required: true, message: "请输入预计争取金额" }],
|
|
|
- abstractContent: [{ required: true, message: "请输入政策概要" }]
|
|
|
+ rewardType: [{ required: true, message: "请选择政策考核类别" }],
|
|
|
+ abstractContent: [{ required: true, message: "请输入政策概要" }],
|
|
|
},
|
|
|
|
|
|
fileIsDel: false,
|
|
|
@@ -197,7 +217,11 @@ export default {
|
|
|
} else if (key == "isLand") this.form.isLand = !!res.data[key] && res.data[key] || 0;
|
|
|
else this.form[key] = res.data[key] || null;
|
|
|
}
|
|
|
+ res.data["rewardType"] && this.activeNames.push(res.data["rewardType"]);
|
|
|
+ if (this.isExplain && !res.data["sjFinishTime"]) this.form.sjFinishTime = moment().format("YYYY-MM-DD");
|
|
|
this.form.partPerson = res.data["partPersonArr"] && JSON.parse(res.data["partPersonArr"]).map(item => item.name).join() || null;
|
|
|
+
|
|
|
+ this.$nextTick(() => this.isExplain && this.$refs.explainForm && this.$refs.explainForm.$el.scrollIntoView({ block: "center" }));
|
|
|
} else ElMessage.error(res.msg);
|
|
|
});
|
|
|
},
|
|
|
@@ -212,24 +236,22 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 表单提交方法
|
|
|
- async validateForm(mode) {
|
|
|
- const promiseArray = [this.$refs.formRef.validate()];
|
|
|
- this.isExplain && promiseArray.push(await this.$refs.explainForm.$refs.formRef.validate());
|
|
|
-
|
|
|
- return Promise.all(promiseArray).then(() => this.submit(mode)).catch(() => false);
|
|
|
- },
|
|
|
-
|
|
|
submit(mode) {
|
|
|
- console.log('submit',mode)
|
|
|
- const partPersonArr = this.form.partPerson && JSON.stringify(this.form.partPerson.split(",").map(name => ({ name }))) || "";
|
|
|
- API[mode]({ ...this.form, partPersonArr }).then(() => {
|
|
|
- ElMessage.success("操作成功");
|
|
|
- this.visible = false;
|
|
|
- this.fileIsDel = false;
|
|
|
- this.$emit("success", mode);
|
|
|
+ this.$refs.formRef.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const partPersonArr = this.form.partPerson && JSON.stringify(this.form.partPerson.split(",").map(name => ({ name }))) || "";
|
|
|
+ API[mode]({ ...this.form, partPersonArr }).then(() => {
|
|
|
+ ElMessage.success("操作成功");
|
|
|
+ this.visible = false;
|
|
|
+ this.fileIsDel = false;
|
|
|
+ this.$emit("success", mode);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
policyExplain() {
|
|
|
this.$refs.explainForm.submit();
|
|
|
}
|
|
|
@@ -259,4 +281,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.el-collapse .el-radio-group {
|
|
|
+ display: block;
|
|
|
+
|
|
|
+ .el-radio {
|
|
|
+ margin-right: 0;
|
|
|
+ text-align: left;
|
|
|
+
|
|
|
+ :deep(.el-radio__label) {
|
|
|
+ line-height: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|