| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <el-form v-if="disabled && form.monthSituation || !disabled" ref="formRef" :model="form" :rules="rules" :disabled="disabled" label-width="110px">
- <div class="dialog-title">月度争取情况说明</div>
- <el-row>
- <el-col :span="12">
- <el-form-item label="是否已落地" prop="isLand">
- <el-radio-group v-model="form.isLand" @change="form.landAmount = null, form.partPerson = null, form.partPersonArr = '[]'">
- <el-radio v-for="(label, key) in whetherDic" :key="key" :label="label" :value="parseInt(key)"></el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <template v-if="form.isLand == 1">
- <el-col :span="12">
- <el-form-item label="落地金额" prop="landAmount">
- <el-input-number v-model="form.landAmount" :min="0" :step="0.1" :precision="2" controls-position="right" placeholder="请输入落地金额"></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="参与人" prop="partPerson">
- <el-input v-model="form.partPerson" type="textarea" :rows="4" placeholder="请输入参与人(以英文 , 分割)"></el-input>
- </el-form-item>
- </el-col>
- </template>
- <el-col :span="24">
- <el-form-item class="label-column-2" label="月度争取情况说明" prop="monthSituation" label-width="80px">
- <el-input v-model="form.monthSituation" type="textarea" :rows="4" placeholder="请输入月度争取情况说明"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </template>
- <script>
- import API from "@/api/policy/strive";
- import { whetherDic } from "@/views/policyShare/main";
- export default {
- props: {
- isMaster: { type: Boolean, default: false },
- disabled: { type: Boolean, default: true },
- rowData: { type: Object, default: () => {} }
- },
- data() {
- return {
- whetherDic,
- form: {
- isLand: 0,
- landAmount: null,
- partPersonArr: "[]", // [{name: }]
- partPerson: null, // a1,a2
- monthSituation: null,
- },
- rules: {
- isLand: [{ required: true }],
- landAmount: [{ required: true, message: "请输入落地金额" }],
- partPerson: [{ required: true, message: "请输入参与人(以英文 , 分割)" }],
- monthSituation: [{ required: true, message: "请输入月度争取情况" }]
- },
- }
- },
- watch: {
- rowData: {
- deep: true,
- handler(value) {
- if (value.id) {
- this.form = Object.assign({}, this.rowData);
- }
- }
- }
- },
- mounted() {
- this.form = Object.assign({}, this.rowData);
- },
- methods: {
- submit() {
- this.$refs.formRef.validate(valid => {
- if (valid) {
- const partPersonArr = this.form.partPerson && JSON.stringify(this.form.partPerson.split(",").map(name => ({ name }))) || "";
- API.explain({ ...this.form, partPersonArr }).then(() => {
- ElMessage.success("操作成功");
- this.visible = false;
- this.$emit("success");
- });
- } else {
- return false;
- }
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .dialog-title {
- margin-bottom: 15px;
- font-size: 15px;
- font-weight: 600;
- color: var(--el-text-color-primary);
- }
- .el-input-number {
- width: 100%;
- :deep(.el-input) .el-input__wrapper {
- padding: 1px 11px;
- .el-input__inner {
- text-align: unset;
- }
- }
- }
- .label-column-2 :deep(.el-form-item__label) {
- margin-left: 30px;
- }
- </style>
|