|
|
@ -118,22 +118,59 @@ |
|
|
<el-form ref="form" label-width="120px"> |
|
|
<el-form ref="form" label-width="120px"> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="24" style="text-align: center; margin-top: 50px;"> |
|
|
<el-col :span="24" style="text-align: center; margin-top: 50px;"> |
|
|
<el-button type="primary" style="width: 80%; height: 40px;" @click="add" plain icon="el-icon-circle-plus">创建新表单</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" style="width: 80%; height: 40px;" @click="add" plain |
|
|
|
|
|
icon="el-icon-circle-plus">创建新表单</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24" style="text-align: center; margin: 50px 0px;"> |
|
|
<el-col :span="24" style="text-align: center; margin: 50px 0px;"> |
|
|
<el-button type="primary" style="width: 80%;height: 40px;" @click="copy" plain icon="el-icon-document-copy">复制已有表单</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" style="width: 80%;height: 40px;" @click="copy" plain |
|
|
|
|
|
icon="el-icon-document-copy">复制已有表单</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="$t('page.business.study.studyFormPre.fzbdxz')" :visible.sync="openXz" width="500px" |
|
|
|
|
|
append-to-body :close-on-click-modal="false"> |
|
|
|
|
|
<el-form ref="formXz" :model="formXz" :rules="rulesXz" label-width="150px"> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<el-form-item :label="$t('page.business.study.studyFormPre.sssyfsy')" prop="studyId"> |
|
|
|
|
|
<el-select v-model="formXz.studyId" :placeholder="$t('form.placeholderSelect')" @change="studyChange"> |
|
|
|
|
|
<el-option :label="item.sn" :value="item.id" v-for="(item, index) in studyList" :key="index" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<el-form-item :label="$t('page.business.study.studyFormPre.fzbd')" prop="formPreId"> |
|
|
|
|
|
<el-select v-model="formXz.formPreId" :placeholder="$t('form.placeholderSelect')"> |
|
|
|
|
|
<el-option :label="item.bdbh" :value="item.id" v-for="(item, index) in formPreList" :key="index" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="primary" @click="previewFzbd" :disabled="!(formXz.formPreId)">预览</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="saveCopy">{{ $t('page.business.study.studyFormPre.fzbj') }}</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="$t('page.business.study.studyFormPre.yulan')" :visible.sync="openPreview" width="80%" |
|
|
|
|
|
append-to-body :close-on-click-modal="false"> |
|
|
|
|
|
<TemplateTable ref="templateTable" :sn="formPreview.templateSn" fillType="preFill" /> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
|
|
|
studyFormPre_list |
|
|
|
|
|
} from '@/api/business/study/studyFormPre' |
|
|
|
|
|
|
|
|
import { studyFormPre_list, studyFormPre_info } from '@/api/business/study/studyFormPre' |
|
|
|
|
|
import { public_studyList, public_studyFormPreList } from '@/api/business/public/public' |
|
|
|
|
|
import TemplateTable from '@/views/business/comps/template/TemplateTable'; |
|
|
import Bj from "./ytbd/Bj"; |
|
|
import Bj from "./ytbd/Bj"; |
|
|
import Xq from "./ytbd/Xq"; |
|
|
import Xq from "./ytbd/Xq"; |
|
|
import Sh from "./ytbd/Sh"; |
|
|
import Sh from "./ytbd/Sh"; |
|
|
@ -167,9 +204,14 @@ export default { |
|
|
deep: true |
|
|
deep: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components: { Bj, Xq, Sh, SelectDeptUser }, |
|
|
|
|
|
|
|
|
components: { Bj, Xq, Sh, SelectDeptUser, TemplateTable }, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
formPreview: { |
|
|
|
|
|
templateSn: null |
|
|
|
|
|
}, |
|
|
|
|
|
openPreview: false, |
|
|
|
|
|
openXz: false, |
|
|
open: false, |
|
|
open: false, |
|
|
leader: null, |
|
|
leader: null, |
|
|
showAudit: false, |
|
|
showAudit: false, |
|
|
@ -189,16 +231,81 @@ export default { |
|
|
startDate: '', |
|
|
startDate: '', |
|
|
endDate: '', |
|
|
endDate: '', |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
loading: false, |
|
|
loading: false, |
|
|
total: 0, |
|
|
total: 0, |
|
|
list: [], |
|
|
list: [], |
|
|
|
|
|
studyList: [], |
|
|
|
|
|
formPreList: [], |
|
|
|
|
|
formXz: { |
|
|
|
|
|
studyId: null, |
|
|
|
|
|
formPreId: null, |
|
|
|
|
|
}, |
|
|
|
|
|
rulesXz: { |
|
|
|
|
|
studyId: [{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
message: ' ', |
|
|
|
|
|
trigger: 'blur' |
|
|
|
|
|
}], |
|
|
|
|
|
formPreId: [{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
message: ' ', |
|
|
|
|
|
trigger: 'blur' |
|
|
|
|
|
}] |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { }, |
|
|
created() { }, |
|
|
methods: { |
|
|
methods: { |
|
|
copy(){ |
|
|
|
|
|
alert('todo') |
|
|
|
|
|
|
|
|
copy() { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
public_studyList().then(response => { |
|
|
|
|
|
this.studyList = response.data |
|
|
|
|
|
this.formXz.studyId = null |
|
|
|
|
|
this.formXz.formPreId = null |
|
|
|
|
|
this.open = false |
|
|
|
|
|
this.openXz = true |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
previewFzbd() { |
|
|
|
|
|
let that = this |
|
|
|
|
|
let _index = _.findIndex(this.formPreList, function (item) { |
|
|
|
|
|
return item.id = that.formXz.formPreId |
|
|
|
|
|
}) |
|
|
|
|
|
this.formPreview.templateSn = that.formPreList[_index].templateSn |
|
|
|
|
|
this.openPreview = true |
|
|
|
|
|
}, |
|
|
|
|
|
saveCopy() { |
|
|
|
|
|
let that = this |
|
|
|
|
|
this.$refs["formXz"].validate(valid => { |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
studyFormPre_info({ id: that.formXz.formPreId }).then(response => { |
|
|
|
|
|
let tmp = response.data |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
this.openXz = false |
|
|
|
|
|
this.openPreview = false |
|
|
|
|
|
this.showEdit = true |
|
|
|
|
|
this.$emit('showDetail', this.showEdit) |
|
|
|
|
|
this.$refs.Bj.edit({ templateId: tmp.templateId,templateMc: tmp.templateMc,templateSn:tmp.templateSn ,bdmc: tmp.bdmc, bdnr: tmp.bdnr }) |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
studyChange() { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
public_studyFormPreList({ studyId: this.formXz.studyId }).then(response => { |
|
|
|
|
|
this.formXz.formPre = null |
|
|
|
|
|
this.formPreList = response.data |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
showAdd() { |
|
|
showAdd() { |
|
|
this.open = true |
|
|
this.open = true |
|
|
|