Browse Source

feat:[试验管理][预填表单]复制表单

master
15881625488@163.com 1 week ago
parent
commit
4d9868f523
6 changed files with 147 additions and 145 deletions
  1. +20
    -0
      src/api/business/public/public.js
  2. +5
    -0
      src/lang/en/business/study/studyFormPre.js
  3. +5
    -0
      src/lang/zh/business/study/studyFormPre.js
  4. +0
    -125
      src/views/business/study/comp/sqbd/Gc.vue
  5. +1
    -11
      src/views/business/study/comp/sqbdList.vue
  6. +116
    -9
      src/views/business/study/comp/ytbdList.vue

+ 20
- 0
src/api/business/public/public.js View File

@ -17,3 +17,23 @@ export function public_templateList(query) {
params: query params: query
}) })
} }
// 查询试验列表
export function public_studyList(query) {
return request({
url: '/system/business/public/studyList',
method: 'get',
params: query
})
}
// 查询试验预填表单列表
export function public_studyFormPreList(query) {
return request({
url: '/system/business/public/studyFormPreList',
method: 'get',
params: query
})
}

+ 5
- 0
src/lang/en/business/study/studyFormPre.js View File

@ -24,5 +24,10 @@ export default {
jcgj:'稽查轨迹', jcgj:'稽查轨迹',
cjjl:'创建记录', cjjl:'创建记录',
xjbd:'新建表单', xjbd:'新建表单',
fzbdxz:'复制表单选择',
sssyfsy:'所属试验/非试验',
fzbd:'复制表单',
yulan:'预览',
fzbj:'复制编辑',
ts:'是否确定用该预填模板进行实际填报?', ts:'是否确定用该预填模板进行实际填报?',
} }

+ 5
- 0
src/lang/zh/business/study/studyFormPre.js View File

@ -24,5 +24,10 @@ export default {
jcgj:'稽查轨迹', jcgj:'稽查轨迹',
cjjl:'创建记录', cjjl:'创建记录',
xjbd:'新建表单', xjbd:'新建表单',
fzbdxz:'复制表单选择',
sssyfsy:'所属试验/非试验',
fzbd:'复制表单',
fzbj:'复制编辑',
yulan:'预览',
ts:'是否确定用该预填模板进行实际填报?', ts:'是否确定用该预填模板进行实际填报?',
} }

+ 0
- 125
src/views/business/study/comp/sqbd/Gc.vue View File

@ -1,125 +0,0 @@
G<template>
<div>
<el-dialog :title="$t('page.business.study.studyFormApply.guancha')" :visible.sync="open" width="500px"
append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item :label="$t('page.business.study.studyFormApply.szqk')" prop="qmyy">
<el-select v-model="form.qmyy" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-option label="良好" value="良好" />
<el-option label="中" value="中" />
<el-option label="差" value="差" />
</el-select>
</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.remark" :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="save">{{ $t('form.confirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { studyFormApply_gc } from "@/api/business/study/studyFormApply"
import { mapGetters } from 'vuex'
export default {
name: "Fz",
components: {},
data() {
return {
isBatch: false,
ids: [],
selectList: [],
open: false,
form: {},
rules: {
qmrmm: [{
required: true,
message: ' ',
trigger: 'blur'
}],
remark: [{
required: true,
message: ' ',
trigger: 'blur'
}],
qmyy: [{
required: true,
message: ' ',
trigger: 'blur'
}],
}
}
},
computed: {
...mapGetters([
'nickName'
]),
},
created() {
},
methods: {
cancel() {
this.open = false
},
reset() {
this.form = {
id: null,
qmyy: null,
remark: null,
qmrmm: null
}
this.resetForm("form")
},
show(row) {
this.reset()
this.form.id = row.id
this.open = true
},
save() {
this.$refs["form"].validate(valid => {
if (valid) {
this.$modal.loading()
studyFormApply_gc(this.form).then(response => {
this.open = false
this.$emit('callback')
this.$modal.closeLoading()
}).finally(() => {
this.$modal.closeLoading()
})
}
})
}
}
}
</script>

+ 1
- 11
src/views/business/study/comp/sqbdList.vue View File

@ -133,10 +133,6 @@
<el-button type="text" v-if="scope.row.bdzt === 9" @click="qrfz(scope.row)" <el-button type="text" v-if="scope.row.bdzt === 9" @click="qrfz(scope.row)"
v-hasPermi="['business:studyFormApply:qrfz']">{{ v-hasPermi="['business:studyFormApply:qrfz']">{{
$t('page.business.study.studyFormApply.qrfz') }}</el-button> $t('page.business.study.studyFormApply.qrfz') }}</el-button>
<!-- 观察 -->
<el-button type="text" v-if="scope.row.bdzt === 1" @click="gc(scope.row)"
v-hasPermi="['business:studyFormApply:gc']">{{
$t('page.business.study.studyFormApply.gc') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -159,8 +155,6 @@
<Qrfz key="Qrfz" ref="Qrfz" @callback="search" /> <Qrfz key="Qrfz" ref="Qrfz" @callback="search" />
<!-- 加签 --> <!-- 加签 -->
<Jq key="Jq" ref="Jq" @callback="search" /> <Jq key="Jq" ref="Jq" @callback="search" />
<!-- 观察 -->
<Gc key="Gc" ref="Gc" @callback="search" />
<!-- 更换归属人 --> <!-- 更换归属人 -->
<Ghgsr key="Ghgsr" ref="Ghgsr" @callback="search" /> <Ghgsr key="Ghgsr" ref="Ghgsr" @callback="search" />
<SelectDeptUserDialog ref="selectDeptUserDialog" @change="ghgsrChange" /> <SelectDeptUserDialog ref="selectDeptUserDialog" @change="ghgsrChange" />
@ -178,7 +172,6 @@ import Fh from "./sqbd/Fh";
import Qrfz from "./sqbd/Qrfz"; import Qrfz from "./sqbd/Qrfz";
import Jq from "./sqbd/Jq"; import Jq from "./sqbd/Jq";
import Ghgsr from "./sqbd/Ghgsr"; import Ghgsr from "./sqbd/Ghgsr";
import Gc from "./sqbd/Gc";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import SelectDeptUserDialog from '@/views/business/comps/select/SelectDeptUserDialog'; import SelectDeptUserDialog from '@/views/business/comps/select/SelectDeptUserDialog';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -210,7 +203,7 @@ export default {
deep: true deep: true
} }
}, },
components: { Ghgsr, Fh, Fz, Bj, Xq, Qrfz, Sy, Jq, Gc, SelectDeptUser, SelectDeptUserDialog },
components: { Ghgsr, Fh, Fz, Bj, Xq, Qrfz, Sy, Jq, SelectDeptUser, SelectDeptUserDialog },
data() { data() {
return { return {
leader: null, leader: null,
@ -256,9 +249,6 @@ export default {
qrfz(row) { qrfz(row) {
this.$refs.Qrfz.show(row) this.$refs.Qrfz.show(row)
}, },
gc(row) {
this.$refs.Gc.show(row)
},
fz(row) { fz(row) {
this.$refs.Fz.show(row) this.$refs.Fz.show(row)
}, },

+ 116
- 9
src/views/business/study/comp/ytbdList.vue View File

@ -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

Loading…
Cancel
Save