G<template>
|
|
<div>
|
|
<div class="edit-container">
|
|
<div class="edit-top">
|
|
<div class="left-top">
|
|
<img src="@/assets/images/back.png" @click="cancel()" />
|
|
<div class="left-title"></div>
|
|
</div>
|
|
<div class="center-top">
|
|
<div>
|
|
<div :class="showIndex == 1 ? 'el-step__icon is-text is-finish' : 'el-step__icon is-text is-info'">
|
|
<div class="el-step__icon-inner">1</div>
|
|
</div>
|
|
{{ $t('page.business.study.studyFormPre.jcsz') }}
|
|
</div>
|
|
<div class="line"></div>
|
|
<div>
|
|
<div :class="showIndex == 2 ? 'el-step__icon is-text is-finish' : 'el-step__icon is-text is-info'">
|
|
<div class="el-step__icon-inner">2</div>
|
|
</div>
|
|
{{ $t('page.business.study.studyFormPre.bdsj') }}
|
|
</div>
|
|
</div>
|
|
<div class="right-top">
|
|
<el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
|
|
<template v-if="showIndex == 1">
|
|
<el-button @click="save">{{ $t('page.business.study.studyFormPre.zc') }}</el-button>
|
|
<el-button type="primary" @click="next">{{ $t('page.business.study.studyFormPre.next') }}</el-button>
|
|
</template>
|
|
<template v-else>
|
|
<el-button @click="saveNext">{{ $t('page.business.study.studyFormPre.save') }}</el-button>
|
|
<el-button type="primary" @click="showtj">{{ $t('page.business.study.studyFormPre.submit')
|
|
}}</el-button>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
<div class="edit-content">
|
|
<div class="content" style="width:60%" v-show="showIndex == 1">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('page.business.form.xtmbmc')" prop="templateId">
|
|
<SelectTemplate v-model="form.templateId" :name="form.templateMc" @change="selectTemplateChange" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('page.business.form.bdmc')" prop="bdmc">
|
|
<el-input type="text" v-model="form.bdmc" maxlength="50" :placeholder="$t('form.placeholderInput')" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('page.business.study.studyFormPre.bdsm')" prop="bdsm">
|
|
<el-input type="textarea" v-model="form.bdsm" :rows="5" maxlength="500"
|
|
:placeholder="$t('form.placeholderInput')">
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</div>
|
|
<div class="content" v-show="showIndex == 2">
|
|
<TemplateTable ref="templateTable" :sn="form.templateSn" fillType="preFill" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-dialog :title="$t('page.business.study.studyFormPre.tjysb')" :visible.sync="openSubmit" width="500px"
|
|
append-to-body :close-on-click-modal="false">
|
|
<el-form ref="formSubmit" :model="form" :rules="rulesApprove" label-width="120px">
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('page.business.study.studyFormPre.shryId')" prop="shryId">
|
|
<SelectDeptUser v-model="form.shryId" :name="form.shryMc" key="shryId" @change="selectDeptUserChange" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('page.business.study.studyFormPre.fzrsh')" prop="fzrsh">
|
|
<el-radio-group v-model="form.fzrsh">
|
|
<el-radio :label="10">是</el-radio>
|
|
<el-radio :label="1">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
|
|
<el-input type="text" :value="form.qmyy" maxlength="50" disabled
|
|
:placeholder="$t('form.placeholderInput')" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('form.remark')" prop="remark">
|
|
<el-input type="textarea" v-model="form.getReason" :rows="5" maxlength="500"
|
|
:placeholder="$t('form.placeholderInput')">
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('form.signer')">
|
|
<el-input type="text" v-model="nickName" maxlength="50" disabled
|
|
:placeholder="$t('form.placeholderInput')" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item :label="$t('form.password')" prop="qmrmm">
|
|
<el-input type="password" v-model="form.qmrmm" maxlength="20"
|
|
:placeholder="$t('form.placeholderInput')" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="tj">{{ $t('form.confirm') }}</el-button>
|
|
<el-button @click="openSubmit = false">{{ $t('form.cancel') }}</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { studyFormPre_bc, studyFormPre_tj, studyFormPre_info } from "@/api/business/study/studyFormPre"
|
|
import { mapGetters } from 'vuex'
|
|
import SelectTemplate from "@/views/business/comps/select/SelectTemplate";
|
|
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
|
|
import TemplateTable from '@/views/business/comps/template/TemplateTable';
|
|
|
|
export default {
|
|
name: "Bj",
|
|
components: { SelectTemplate, SelectDeptUser, TemplateTable },
|
|
data() {
|
|
return {
|
|
open: false,
|
|
showIndex: 1,
|
|
form: {},
|
|
openSubmit: false,
|
|
rulesApprove: {
|
|
qmrmm: [{
|
|
required: true,
|
|
message: ' ',
|
|
trigger: 'blur'
|
|
}],
|
|
fzrsh: [{
|
|
required: true,
|
|
message: ' ',
|
|
trigger: 'blur'
|
|
}],
|
|
shryId: [{
|
|
required: true,
|
|
message: ' ',
|
|
trigger: 'blur'
|
|
}]
|
|
},
|
|
rules: {
|
|
bdmc: [{
|
|
required: true,
|
|
message: ' ',
|
|
trigger: 'blur'
|
|
}],
|
|
templateId: [{
|
|
required: true,
|
|
message: ' ',
|
|
trigger: 'blur'
|
|
}]
|
|
|
|
},
|
|
}
|
|
},
|
|
computed: {
|
|
...mapGetters([
|
|
'nickName'
|
|
]),
|
|
},
|
|
created() {
|
|
},
|
|
methods: {
|
|
next() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
this.showIndex = 2
|
|
}
|
|
})
|
|
},
|
|
selectTemplateChange(val) {
|
|
this.form.bdnr = val.content
|
|
this.form.templateMc = val.name
|
|
this.form.templateSn = val.sn
|
|
},
|
|
cancel() {
|
|
this.$emit('close')
|
|
},
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
studyId: null,
|
|
bdbh: null,
|
|
bdmc: null,
|
|
bdsm: null,
|
|
templateId: null,
|
|
templateMc: null,
|
|
bdnr: null,
|
|
fzrsh: null,
|
|
shryId: null,
|
|
shryMc: null,
|
|
}
|
|
this.resetForm("form")
|
|
},
|
|
selectDeptUserChange(val) {
|
|
this.form.shryMc = val.name
|
|
},
|
|
edit(row) {
|
|
this.reset()
|
|
this.showIndex = 1
|
|
if (row && row.id) {
|
|
this.$modal.loading()
|
|
studyFormPre_info({ id: row.id }).then(response => {
|
|
this.form = response.data
|
|
this.form.qmyy = '制作提交预制表单'
|
|
this.open = true
|
|
this.$modal.closeLoading()
|
|
}).finally(() => {
|
|
this.$modal.closeLoading()
|
|
})
|
|
} else {
|
|
this.form = _.merge({}, this.form, row)
|
|
this.open = true
|
|
}
|
|
|
|
},
|
|
save() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
this.$modal.loading()
|
|
studyFormPre_bc(this.form).then(response => {
|
|
this.$emit('close')
|
|
this.$modal.closeLoading()
|
|
}).finally(() => {
|
|
this.$modal.closeLoading()
|
|
})
|
|
}
|
|
})
|
|
},
|
|
async saveNext() {
|
|
let content = await this.$refs.templateTable.getFormData()
|
|
this.form.bdnr = JSON.stringify(content)
|
|
this.$modal.loading()
|
|
studyFormPre_bc(this.form).then(response => {
|
|
this.$emit('close')
|
|
this.$modal.closeLoading()
|
|
}).finally(() => {
|
|
this.$modal.closeLoading()
|
|
})
|
|
},
|
|
async showtj() {
|
|
await this.$refs.templateTable.getFormData()
|
|
this.openSubmit = true
|
|
},
|
|
tj() {
|
|
this.$refs["formSubmit"].validate(valid => {
|
|
if (valid) {
|
|
this.dotj()
|
|
}
|
|
})
|
|
},
|
|
async dotj() {
|
|
let content = await this.$refs.templateTable.getFormData()
|
|
this.form.bdnr = JSON.stringify(content)
|
|
this.$modal.loading()
|
|
studyFormPre_tj(this.form).then(response => {
|
|
this.$emit('close')
|
|
this.openSubmit = false
|
|
this.$modal.closeLoading()
|
|
}).finally(() => {
|
|
this.$modal.closeLoading()
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|