luojie 4 weeks ago
parent
commit
dd38ea2cdd
13 changed files with 132 additions and 56 deletions
  1. +2
    -0
      src/layout/components/Sidebar/index.vue
  2. +46
    -28
      src/utils/ruoyi.js
  3. +6
    -4
      src/views/business/comps/template/comps/gsp/MJYLQSQD.vue
  4. +11
    -1
      src/views/business/form/drug/list.vue
  5. +11
    -1
      src/views/business/form/nonTrial/list.vue
  6. +4
    -1
      src/views/business/study/comp/jhbd/Bj.vue
  7. +2
    -1
      src/views/business/study/comp/jhbdList.vue
  8. +9
    -8
      src/views/business/study/comp/tbbd/Bj.vue
  9. +9
    -4
      src/views/business/study/comp/tbbd/Jq.vue
  10. +1
    -0
      src/views/business/study/comp/tbbdList.vue
  11. +6
    -1
      src/views/business/study/comp/ytbd/Bj.vue
  12. +15
    -6
      src/views/business/study/comp/ytbd/Sh.vue
  13. +10
    -1
      src/views/business/study/list.vue

+ 2
- 0
src/layout/components/Sidebar/index.vue View File

@ -14,6 +14,8 @@
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
overflowY: 'auto',
overflowX: 'hidden',
height: 'calc(100vh - 100px)'
}"
mode="vertical"

+ 46
- 28
src/utils/ruoyi.js View File

@ -13,12 +13,15 @@ export function parseTime(time, pattern) {
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '')
time = time
.replace(new RegExp(/-/gm), '/')
.replace('T', ' ')
.replace(new RegExp(/\.[\d]{3}/gm), '')
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000
}
date = new Date(time)
@ -35,7 +38,9 @@ export function parseTime(time, pattern) {
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
@ -46,17 +51,24 @@ export function parseTime(time, pattern) {
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields()
}
setTimeout(() => {
if (this.$refs[refName]) {
this.$refs[refName].resetFields()
}
}, 100)
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
let search = params
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}
search.params =
typeof search.params === 'object' &&
search.params !== null &&
!Array.isArray(search.params)
? search.params
: {}
dateRange = Array.isArray(dateRange) ? dateRange : []
if (typeof (propName) === 'undefined') {
if (typeof propName === 'undefined') {
search.params['beginTime'] = dateRange[0]
search.params['endTime'] = dateRange[1]
} else {
@ -69,11 +81,11 @@ export function addDateRange(params, dateRange, propName) {
// 回显数据字典
export function selectDictLabel(datas, value) {
if (value === undefined) {
return ""
return ''
}
var actions = []
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + value)) {
if (datas[key].value == '' + value) {
actions.push(datas[key].label)
return true
}
@ -86,19 +98,19 @@ export function selectDictLabel(datas, value) {
// 回显数据字典(字符串、数组)
export function selectDictLabels(datas, value, separator) {
if (value === undefined || value.length ===0) {
return ""
if (value === undefined || value.length === 0) {
return ''
}
if (Array.isArray(value)) {
value = value.join(",")
value = value.join(',')
}
var actions = []
var currentSeparator = undefined === separator ? "," : separator
var currentSeparator = undefined === separator ? ',' : separator
var temp = value.split(currentSeparator)
Object.keys(value.split(currentSeparator)).some((val) => {
var match = false
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + temp[val])) {
if (datas[key].value == '' + temp[val]) {
actions.push(datas[key].label + currentSeparator)
match = true
}
@ -112,7 +124,9 @@ export function selectDictLabels(datas, value, separator) {
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1
var args = arguments,
flag = true,
i = 1
str = str.replace(/%s/g, function () {
var arg = args[i++]
if (typeof arg === 'undefined') {
@ -126,8 +140,8 @@ export function sprintf(str) {
// 转换字符串,undefined,null等转化为""
export function parseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return ""
if (!str || str == 'undefined' || str == 'null') {
return ''
}
return str
}
@ -185,25 +199,29 @@ export function handleTree(data, id, parentId, children) {
}
/**
* 参数处理
* @param {*} params 参数
*/
* 参数处理
* @param {*} params 参数
*/
export function tansParams(params) {
let result = ''
for (const propName of Object.keys(params)) {
const value = params[propName]
var part = encodeURIComponent(propName) + "="
if (value !== null && value !== "" && typeof (value) !== "undefined") {
var part = encodeURIComponent(propName) + '='
if (value !== null && value !== '' && typeof value !== 'undefined') {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
if (
value[key] !== null &&
value[key] !== '' &&
typeof value[key] !== 'undefined'
) {
let params = propName + '[' + key + ']'
var subPart = encodeURIComponent(params) + "="
result += subPart + encodeURIComponent(value[key]) + "&"
var subPart = encodeURIComponent(params) + '='
result += subPart + encodeURIComponent(value[key]) + '&'
}
}
} else {
result += part + encodeURIComponent(value) + "&"
result += part + encodeURIComponent(value) + '&'
}
}
}

+ 6
- 4
src/views/business/comps/template/comps/gsp/MJYLQSQD.vue View File

@ -2,7 +2,8 @@
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<LineLabel label="template.gsp.MJYLQSQD.jbxx" />
@ -120,7 +121,8 @@ export default {
},
xyl: {
label: "template.gsp.MJYLQSQD.xyl",
type: "inputNumber",
maxlength: 50,
type: "input",
fillType: "actFill",
},
xysj: {
@ -225,10 +227,10 @@ export default {
},
//sywzmcgyjl
onSelectBlur(val) {
if (val.key == 'sywzmc' && ((!this.formData.sywzmc||this.formData.sywzmc=='') || val.type == 'save')) {
if (val.key == 'sywzmc' && ((!this.formData.sywzmc || this.formData.sywzmc == '') || val.type == 'save')) {
this.filterGyjl(val, true)
}
if (val.key == 'gyjl' && ((!this.formData.gyjl||this.formData.gyjl=='') || val.type == 'save')) {
if (val.key == 'gyjl' && ((!this.formData.gyjl || this.formData.gyjl == '') || val.type == 'save')) {
this.filterGynd(val, true)
}
},

+ 11
- 1
src/views/business/form/drug/list.vue View File

@ -240,7 +240,17 @@ export default {
},
enter(row){
this.saveSimpleLog({name:row.name+'('+row.sn+')',nameEn:row.name+'('+row.sn+')',jcmc:'进入麻精药表单',jcmcEn:'Enter Controlled Drug'})
this.$tab.openPage(" ", '/drug/enter/' + row.id+'/ytbd')
// this.$tab.openPage(" ", '/drug/enter/' + row.id+'/ytbd')
let path = '/drug/enter/' + row.id+'/ytbd'
let index = _.findIndex(this.$store.state.tagsView.visitedViews, (tab) => {
return tab.path === path
})
if (index > -1) {
this.$tab.refreshPage(this.$store.state.tagsView.visitedViews[index]);
} else {
this.$tab.openPage(" ", path)
}
// this.showType = 'enter'
// this.$refs.enter.show(row)
},

+ 11
- 1
src/views/business/form/nonTrial/list.vue View File

@ -240,7 +240,17 @@ export default {
},
enter(row){
this.saveSimpleLog({name:row.name+'('+row.sn+')',nameEn:row.name+'('+row.sn+')',jcmc:'进入非试验表单',jcmcEn:'Enter Non-study'})
this.$tab.openPage(" ", '/nonTrial/enter/' + row.id+'/ytbd')
// this.$tab.openPage(" ", '/nonTrial/enter/' + row.id+'/ytbd')
let path = '/nonTrial/enter/' + row.id+'/ytbd'
let index = _.findIndex(this.$store.state.tagsView.visitedViews, (tab) => {
return tab.path === path
})
if (index > -1) {
this.$tab.refreshPage(this.$store.state.tagsView.visitedViews[index]);
} else {
this.$tab.openPage(" ", path)
}
// this.showType = 'enter'
// this.$refs.enter.show(row)
},

+ 4
- 1
src/views/business/study/comp/jhbd/Bj.vue View File

@ -261,6 +261,7 @@ export default {
bdbh: null,
bdmc: this.$i18n.locale === 'zh_CN'?'试验物质配制计划表':'试验物质配制计划表',
bdsm: null,
qmyy:this.$t('page.business.study.studyFormFill.txbtjjl'),
templateId: 1,
templateMc: this.$i18n.locale === 'zh_CN'?'试验物质配制计划表':'试验物质配制计划表',
templateSn: 'SYWZPZJHB',
@ -278,7 +279,7 @@ export default {
this.reset()
this.studyType = row.studyType || null
this.studyFormType = row.studyFormType || 10
this.form.qmyy = this.$t('page.business.study.studyFormPlan.cjjl')
if (row && row.id) {
this.showIndex = 2
this.$modal.loading()
@ -287,6 +288,7 @@ export default {
this.templateData = deepClone(this.form)
this.saveSimpleLog({ jcmc: '计划表单编辑', jcmcEn: 'Plan Table Edit', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' })
this.open = true
this.form.qmyy = this.$t('page.business.study.studyFormFill.txbtjjl')
}).finally(() => {
this.$modal.closeLoading()
})
@ -297,6 +299,7 @@ export default {
let name = this.studyType == 1 ? '试验' : (this.studyType == 5 ? '非试验表单' : '麻精药表单')
let nameEn = this.studyType == 1 ? 'Study' : (this.studyType == 5 ? 'Non-study' : 'ontrolled Drug')
this.saveSimpleLog({ jcmc: '计划表单新增', jcmcEn: 'Plan Table Create', name: name, nameEn: nameEn })
this.form.qmyy = this.$t('page.business.study.studyFormFill.txbtjjl')
this.open = true
}
},

+ 2
- 1
src/views/business/study/comp/jhbdList.vue View File

@ -70,7 +70,7 @@
$t('page.business.study.studyFormPlan.fh') }}</el-button>
<!-- 更换归属人 -->
<el-button type="text"
v-if="(scope.row.bdzt === 1 || scope.row.bdzt === 3 || scope.row.bdzt === 5) && id == scope.row.subjectLeader"
v-if="(scope.row.bdzt === 1 || scope.row.bdzt === 3 || scope.row.bdzt === 5) && id == leader"
@click="ghgsr(scope.row)" v-hasPermi="['business:studyFormPlan:ghgsr']">{{
$t('page.business.study.studyFormPlan.ghgsr') }}</el-button>
<!-- 审阅 -->
@ -162,6 +162,7 @@ export default {
bdmc: '',
studySn: '',
studyMc: '',
leader: '',
userId: '',
userMc: '',
cjsjjs: '',

+ 9
- 8
src/views/business/study/comp/tbbd/Bj.vue View File

@ -63,7 +63,7 @@
<el-row>
<el-col :span="24">
<el-form-item :label="$t('page.business.study.studyFormFill.sfbl')" prop="sfbl">
<el-select v-model="form.sfbl" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-select v-model="form.sfbl" :placeholder="$t('form.placeholderSelect')" style="width: 100%;" @change="validForm">
<el-option :label="$t('page.business.study.studyFormFill.yes')" value="是" />
<el-option :label="$t('page.business.study.studyFormFill.no')" value="否" />
</el-select>
@ -563,6 +563,11 @@ export default {
this.getCcwz()
},
methods: {
validForm() {
this.$refs["form"].validate(valid => {
if (valid) { }
})
},
getCcwz() {
listData({
pageNum: 1,
@ -889,13 +894,9 @@ export default {
cancelSave() {
try {
// 1510
if (this.form.studyType == 1) {
EventBus.$emit('onRefreshStudyTbbdList', {});
} else if (this.form.studyType == 5) {
EventBus.$emit('onRefreshNonTrialTbbdList', {});
} else if (this.form.studyType == 10) {
EventBus.$emit('onRefreshDrugTbbdList', {});
}
EventBus.$emit('onRefreshStudyTbbdList', {});
EventBus.$emit('onRefreshNonTrialTbbdList', {});
EventBus.$emit('onRefreshDrugTbbdList', {});
let key = caesarDecipher(this.$route.params.key)
let data = JSON.parse(key)
if (data && data != undefined && data != '') {

+ 9
- 4
src/views/business/study/comp/tbbd/Jq.vue View File

@ -3,11 +3,11 @@
<el-dialog :title="$t('page.business.study.studyFormFill.jiaqian')" :visible.sync="open" width="500px"
append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" v-if="open">
<div class="sbzdtcma"> <input type="text"> <input type="password" show-password > </div>
<div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-select v-model="form.qmyy" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-select v-model="form.qmyy" :placeholder="$t('form.placeholderSelect')" style="width: 100%;" @change="validForm">
<el-option :label="$t('page.business.study.studyFormFill.ksxcfh')" value="开始现场复核" />
<el-option :label="$t('page.business.study.studyFormFill.jsxcfh')" value="结束现场复核" />
<el-option :label="$t('page.business.study.studyFormFill.smxz')" value="申明协作" />
@ -36,7 +36,7 @@
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.password')" prop="qmrmm">
<el-input type="password" show-password v-model="form.qmrmm" maxlength="20"
<el-input type="password" show-password v-model="form.qmrmm" maxlength="20"
:placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
@ -85,7 +85,7 @@ export default {
},
computed: {
...mapGetters([
'nickName','name'
'nickName', 'name'
]),
},
created() {
@ -108,6 +108,11 @@ export default {
this.form.id = row.id
this.open = true
},
validForm() {
this.$refs["form"].validate(valid => {
if (valid) { }
})
},
save() {
this.$refs["form"].validate(valid => {
if (valid) {

+ 1
- 0
src/views/business/study/comp/tbbdList.vue View File

@ -228,6 +228,7 @@ export default {
},
mounted() {
EventBus.$on('onRefreshStudyTbbdList', (data) => {
debugger
this.getList()
});
},

+ 6
- 1
src/views/business/study/comp/ytbd/Bj.vue View File

@ -89,7 +89,7 @@
<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-group v-model="form.fzrsh" @change="validFormSubmit">
<el-radio :label="$t('page.business.study.studyFormPre.yes')">{{
$t('page.business.study.studyFormPre.yes')
}}</el-radio>
@ -204,6 +204,11 @@ export default {
created() {
},
methods: {
validFormSubmit() {
this.$refs["formSubmit"].validate(valid => {
if (valid) { }
})
},
onPreCallback(data) {
console.log("data:" + JSON.stringify(data))
console.log("formdata:" + JSON.stringify(this.$refs.templateTable.getFilledFormData()))

+ 15
- 6
src/views/business/study/comp/ytbd/Sh.vue View File

@ -67,7 +67,7 @@
<!-- 拒绝 -->
<el-dialog :title="$t('page.business.study.studyFormPre.shjj')" :visible.sync="openReject" width="500px"
append-to-body :close-on-click-modal="false">
<el-form ref="formReject" :model="formReject" :rules="rulesReject" label-width="120px">
<el-form ref="formReject" :model="formReject" :rules="rulesReject" label-width="120px" v-if="openReject">
<div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
<el-row>
<el-col :span="24">
@ -184,18 +184,25 @@ export default {
this.$emit('close')
this.open = false
},
reset() {
this.form = {
resetApprove() {
this.formApprove = {
id: null,
studyId: null,
qmyy: null,
remark: null,
qmrmm: null
}
this.resetForm("form")
this.resetForm("formApprove")
},
resetReject() {
this.formReject = {
id: null,
qmyy: null,
remark: null,
qmrmm: null
}
this.resetForm("formReject")
},
show(row) {
this.reset()
this.$modal.loading()
studyFormPre_info({ id: row.id }).then(response => {
this.form = response.data
@ -207,6 +214,7 @@ export default {
})
},
showApprove() {
this.resetApprove()
this.formApprove.id = this.form.id
this.openApprove = true
},
@ -226,6 +234,7 @@ export default {
})
},
showReject() {
this.resetReject()
this.formReject.id = this.form.id
this.openReject = true
},

+ 10
- 1
src/views/business/study/list.vue View File

@ -239,7 +239,16 @@ export default {
},
enter(row){
this.saveSimpleLog({name:row.name+'('+row.sn+')',nameEn:row.name+'('+row.sn+')',jcmc:'进入试验',jcmcEn:'Enter Study'})
this.$tab.openPage(" ", '/study/enter/' + row.id+'/ytbd')
// this.$tab.openPage(" ", '/study/enter/' + row.id+'/ytbd')
let path = '/study/enter/' + row.id+'/ytbd'
let index = _.findIndex(this.$store.state.tagsView.visitedViews, (tab) => {
return tab.path === path
})
if (index > -1) {
this.$tab.refreshPage(this.$store.state.tagsView.visitedViews[index]);
} else {
this.$tab.openPage(" ", path)
}
// this.showType = 'enter'
// this.$refs.enter.show(row)

Loading…
Cancel
Save