Browse Source

peter

master
peter 3 years ago
parent
commit
81342ba30d
  1. 117
      src/components/hm-crf/followUp.vue
  2. 18
      src/components/hm-crf/index.vue
  3. 4
      src/components/hm-crf/tinymce/icons/icons.js
  4. 7
      src/components/hm-crf/tinymce/plugins/hm_button/plugin.js
  5. 7
      src/components/hm-crf/tinymce/plugins/hm_upload/index.js
  6. 254
      src/components/hm-crf/tinymce/plugins/hm_upload/plugin.js
  7. 10
      src/page-subspecialty/views/main-sidebar.vue
  8. 16
      src/page-subspecialty/views/modules/patientManagement/index.vue
  9. 8
      src/page-subspecialty/views/modules/patientManagement/patient-add-or-update.vue
  10. 1610
      src/page-subspecialty/views/modules/seeDoctor/follow-up/1.vue
  11. 13
      src/page-subspecialty/views/modules/seeDoctor/follow-up/add-follow-record.vue
  12. 30
      src/page-subspecialty/views/modules/seeDoctor/follow-up/index.vue
  13. 15
      src/page-subspecialty/views/modules/seeDoctor/index.vue
  14. 24
      src/page-subspecialty/views/modules/seeDoctor/patient-form/index.vue
  15. 29
      src/page-subspecialty/views/modules/setManagement/add-or-update.vue
  16. 5
      src/page-subspecialty/views/modules/setManagement/index.vue
  17. 12
      src/page-subspecialty/views/modules/team/team-add-or-update.vue
  18. 12
      src/page-subspecialty/views/pages/login.vue
  19. 3
      src/utils/confirm.js
  20. 48
      static/css/hmcrf.css
  21. 100
      static/js/hmcrf.js

117
src/components/hm-crf/followUp.vue

@ -15,8 +15,10 @@
</div>
</div>
<template slot="footer">
<el-button v-if="crfType > 1 && crfFormType != '8'" @click="handlePage(1)">上一页</el-button>
<el-button v-if="crfType < 7 && crfFormType != '8'" @click="handlePage(2)">下一页</el-button>
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="submit">{{ $t('confirm') }}</el-button>
<el-button type="primary" @click="submit(2)">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
@ -31,7 +33,7 @@ export default {
components: { crf },
mixins: [qgyCRFData],
props: {
crfFormType: {
centreId: {
type: String,
default: ''
},
@ -46,8 +48,9 @@ export default {
crfVisible: false,
jsArr: [],
inputDate: formatDate(new Date(), 'yyyy-MM-dd'),
centreId: '',
patientIdNumber: '',
manageId: '',
crfFormType: '',
crfType: 1,
// CRF
content: '',
// item.valuev-modeliframe
@ -60,8 +63,6 @@ export default {
}
},
created() {
const userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
this.centreId = userInfo.centreId
},
mounted() {
},
@ -73,14 +74,39 @@ export default {
if (this.crfFormType == '8') {
this.queryFollowForm()
} else {
this.crfType = Number(this.crfFormType)
this.queryPatientForm()
}
})
},
handlePage(type) {
this.$confirm('确定保存数据么?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.submit(1).then(()=>{
this.setPage(type)
})
}).catch(() => {
this.setPage(type)
})
},
setPage(type) {
if (type === 1) {
if (this.crfType < 1) return
this.crfType--
this.queryForm(this.crfType)
} else {
if (this.crfType > 7) return
this.crfType++
this.queryForm(this.crfType)
}
},
queryPatientForm() {
this.$http.get('/renmin_crf/crf/form/info/getForm', {
params: {
patientIdNumber: this.patientIdNumber,
manageId: this.manageId,
centreId: this.centreId,
crfFormType: this.crfFormType
}})
@ -95,6 +121,27 @@ export default {
}
}).catch(() => {})
},
async queryForm(crfFormType) {
this.crfVisible = false
this.crfFormType = crfFormType
await this.$http.get('/renmin_crf/crf/form/info/getForm', {
params: {
manageId: this.manageId,
centreId: this.centreId,
crfFormType: crfFormType
}})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data) {
this.crfVisible = true
this.dataForm = { ...res.data }
this.content = Base64.decode(res.data.formContent)
this.$forceUpdate()
}
}).catch(() => {})
},
queryFollowForm() {
this.$http.get('/renmin_crf/crf/form/info/getFlowForm', {
params: {
@ -120,7 +167,7 @@ export default {
crfDataContent: Base64.encode(this.getCrfcontent()),
crfFormId: this.dataForm.formId,
centreId: this.centreId,
patientIdNumber: this.patientIdNumber,
manageId: this.manageId,
crfFormType: this.crfFormType
}).then(({ data: res }) => {
if (res.code !== 0) {
@ -137,58 +184,38 @@ export default {
return crfContent
},
//
submit() {
this.$http.post('/renmin_crf/crf/form/info/writeForm', {
async submit(type) {
await this.$http.post('/renmin_crf/crf/form/info/writeForm', {
formContent: Base64.encode(this.getCrfcontent()),
formId: this.dataForm.formId,
crfTemplateId: this.dataForm.crfTemplateId,
formName: this.dataForm.formName,
patientCentreId: this.centreId,
patientIdNumber: this.patientIdNumber,
manageId: this.manageId,
crfFormType: this.crfFormType
}).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (this.crfFormType != '8') {
this.dataForm.formId = res.data.formId
this.addFormData()
this.dataForm.formId = res.data.formId
this.addFormData()
if (type === 2) {
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList', this.dataForm.formId)
}
})
} else {
this.$emit('refreshDataList')
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList', this.dataForm.formId)
}
})
})
},
closeDialog() {
this.visible = false
},
// 访
setRealVisitFun(ifrDoc) {
const wuxiao_hmradio = ifrDoc.getElementsByClassName('hmradio')
Array.from(wuxiao_hmradio).forEach(async item => {
// 012
const type = item.id === 'empty-number' ? '0' : item.id === 'reject' ? '1' : item.id === 'missed' ? '2' : ''
console.log(item.id)
if (item.checked) {
console.log(123)
console.log(this.id)
const { data: res } = await this.$http.get('/flow/addPhoneInvalid', {
params: {
flowId: this.id,
type: type
}
})
if (res.code !== 0) {
this.$message.error(res.msg)
}
}
})
}
}
}

18
src/components/hm-crf/index.vue

@ -33,7 +33,7 @@ import './tinymce/plugins/hm_input'
import './tinymce/plugins/hm_checkbox'
import './tinymce/plugins/hm_radio'
import './tinymce/plugins/hm_button'
// import './tinymce/plugins/hm_select'
import './tinymce/plugins/hm_upload'
import './tinymce/plugins/hm_select_DDDs'
import { isInclude } from './tinymce/plugins/hm_utils'
@ -59,12 +59,12 @@ export default {
},
plugins: {
type: [String, Array],
default: 'hminput hmcheckbox hmradio hmbutton hmselect quickbars print hmpreview lists image table code letterspacing '// paste contextmenu colorpicker textcolor
default: 'hminput hmcheckbox hmradio hmupload hmselect quickbars print hmpreview lists image table code letterspacing '// paste contextmenu colorpicker textcolor
},
toolbar: {
type: [String, Array],
default:
`hminput hmcheckbox hmradio hmbutton hmselect | hmpreview print |
`hminput hmcheckbox hmradio hmupload hmselect | hmpreview print |
image table |
code | letterspacing | formatselect | fontsizeselect |
bold italic forecolor backcolor |
@ -74,7 +74,7 @@ export default {
},
contextmenu: {
type: [String, Array],
default: 'hminput hmcheckbox hmradio hmbutton hmselect image imagetools table spellchecker lists'
default: 'hminput hmcheckbox hmradio hmupload hmselect image imagetools table spellchecker lists'
},
// P
isP: {
@ -196,16 +196,6 @@ export default {
this.isP ? '' : this.init.forced_root_block = ''
},
mounted() {
// Cookies.set('yzk-token', '9def6f4db676363e9f01990d56e62929')
// this.$http.get(`/table/dict/getTableDictTreeForCRF`).then(({ data: res }) => {
// if (res.code === 0) {
// const data = res.data
// window.localStorage.setItem('dictField', JSON.stringify(data))
// }
// })
this.$nextTick(() => {
})
},
methods: {
// => https://github.com/tinymce/tinymce-vue => All available events

4
src/components/hm-crf/tinymce/icons/icons.js

@ -6,6 +6,8 @@ tinymce.IconManager.add('custom', {
'radio': '<svg t="1623292373056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5458" width="16" height="16"><path d="M512 256c-143.36 0-256 112.64-256 256S368.64 768 512 768 768 655.36 768 512 655.36 256 512 256zM512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512S793.6 0 512 0z m0 921.6c-225.28 0-409.6-184.32-409.6-409.6S286.72 102.4 512 102.4s409.6 184.32 409.6 409.6-184.32 409.6-409.6 409.6z" p-id="5459"></path></svg>',
'checkbox': '<svg t="1623292420789" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5717" width="16" height="16"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z" p-id="5718"></path></svg>',
'textarea': '<svg t="1623773458085" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4996" width="40" height="24"><path d="M29.866667 85.333333v853.333334h968.533333V85.333333H29.866667z m883.2 597.333334L768 827.733333H110.933333V196.266667h802.133334V682.666667z" p-id="4997"></path><path d="M196.266667 337.066667c8.533333-29.866667 8.533333-29.866667 42.666666-29.866667V469.333333h-38.4v46.933334h136.533334V469.333333H298.666667V307.2h12.8c21.333333 0 25.6 0 29.866666 29.866667v17.066666l42.666667-8.533333v-25.6c0-17.066667-4.266667-38.4 0-51.2v-21.333333h-38.4L341.333333 256H196.266667l-4.266667-8.533333h-38.4v21.333333c0 17.066667 0 38.4-4.266667 59.733333v21.333334h42.666667l4.266667-12.8z m473.6 409.6l179.2-179.2 29.866666 29.866666-179.2 179.2-29.866666-29.866666z" p-id="4998"></path></svg>',
'button': '<svg t="1644572388809" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2279" width="26" height="26"><path d="M800 256h-64a32 32 0 0 0-31.84-32H159.84C142.4 224 128 238.432 128 256.224v415.552A32 32 0 0 0 159.84 704H160v64H128c-35.328 0-64-28.48-64-63.904V223.904C64 188.608 92.864 160 128 160h608c35.328 0 64 28.48 64 63.904V256zM192 351.84A64 64 0 0 1 256.16 288h639.68A64 64 0 0 1 960 351.84v448.32A64 64 0 0 1 895.84 864H256.16A64 64 0 0 1 192 800.16v-448.32z m64 32.384v383.552A31.968 31.968 0 0 0 287.744 800h576.512c17.184 0 31.744-14.4 31.744-32.224V384.224A31.968 31.968 0 0 0 864.256 352H287.744C270.56 352 256 366.4 256 384.224z m219.232 238.4c0 12.16-1.92 23.168-5.76 32.96-3.808 9.792-9.12 18.048-15.872 24.8-6.752 6.72-14.592 11.904-23.52 15.488a76.064 76.064 0 0 1-28.576 5.344H320V448h72.384c8.576 0 16.64 1.6 24.192 4.768 7.552 3.2 14.24 7.616 20.128 13.28 5.856 5.696 10.464 12.704 13.856 21.056a73.824 73.824 0 0 1 3.872 39.872c-0.768 4.256-1.92 8.288-3.36 12.128-1.472 3.84-3.328 7.328-5.6 10.496a27.776 27.776 0 0 1-7.776 7.552c4.512 1.6 9.024 4.48 13.536 8.736 4.48 4.224 8.576 9.28 12.16 15.072a80.736 80.736 0 0 1 11.84 41.664z m-50.72 0c0-11.104-3.264-19.36-9.824-24.8a33.568 33.568 0 0 0-21.984-8.128h-25.024v65.472h25.024c4.064 0 8-0.64 11.84-1.984a29.184 29.184 0 0 0 10.144-5.952 29.28 29.28 0 0 0 7.104-10.112c1.824-4.096 2.72-8.928 2.72-14.496z m-16.576-103.584c0-9.28-2.432-15.872-7.264-19.84a25.216 25.216 0 0 0-16.416-5.952h-16.576v51.2h16.576c6.08 0 11.552-1.92 16.416-5.76 4.832-3.84 7.264-10.368 7.264-19.648z m166.528-21.824v204h-52.064v-204.384h-65.28V448h182.304v49.216h-64.96zM792.16 704l-78.336-143.424v140.64H661.44V448h42.272l75.904 128v-128H832v256h-39.84z" fill="#333333" p-id="2280"></path></svg>'
'button': '<svg t="1644572388809" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2279" width="26" height="26"><path d="M800 256h-64a32 32 0 0 0-31.84-32H159.84C142.4 224 128 238.432 128 256.224v415.552A32 32 0 0 0 159.84 704H160v64H128c-35.328 0-64-28.48-64-63.904V223.904C64 188.608 92.864 160 128 160h608c35.328 0 64 28.48 64 63.904V256zM192 351.84A64 64 0 0 1 256.16 288h639.68A64 64 0 0 1 960 351.84v448.32A64 64 0 0 1 895.84 864H256.16A64 64 0 0 1 192 800.16v-448.32z m64 32.384v383.552A31.968 31.968 0 0 0 287.744 800h576.512c17.184 0 31.744-14.4 31.744-32.224V384.224A31.968 31.968 0 0 0 864.256 352H287.744C270.56 352 256 366.4 256 384.224z m219.232 238.4c0 12.16-1.92 23.168-5.76 32.96-3.808 9.792-9.12 18.048-15.872 24.8-6.752 6.72-14.592 11.904-23.52 15.488a76.064 76.064 0 0 1-28.576 5.344H320V448h72.384c8.576 0 16.64 1.6 24.192 4.768 7.552 3.2 14.24 7.616 20.128 13.28 5.856 5.696 10.464 12.704 13.856 21.056a73.824 73.824 0 0 1 3.872 39.872c-0.768 4.256-1.92 8.288-3.36 12.128-1.472 3.84-3.328 7.328-5.6 10.496a27.776 27.776 0 0 1-7.776 7.552c4.512 1.6 9.024 4.48 13.536 8.736 4.48 4.224 8.576 9.28 12.16 15.072a80.736 80.736 0 0 1 11.84 41.664z m-50.72 0c0-11.104-3.264-19.36-9.824-24.8a33.568 33.568 0 0 0-21.984-8.128h-25.024v65.472h25.024c4.064 0 8-0.64 11.84-1.984a29.184 29.184 0 0 0 10.144-5.952 29.28 29.28 0 0 0 7.104-10.112c1.824-4.096 2.72-8.928 2.72-14.496z m-16.576-103.584c0-9.28-2.432-15.872-7.264-19.84a25.216 25.216 0 0 0-16.416-5.952h-16.576v51.2h16.576c6.08 0 11.552-1.92 16.416-5.76 4.832-3.84 7.264-10.368 7.264-19.648z m166.528-21.824v204h-52.064v-204.384h-65.28V448h182.304v49.216h-64.96zM792.16 704l-78.336-143.424v140.64H661.44V448h42.272l75.904 128v-128H832v256h-39.84z" fill="#333333" p-id="2280"></path></svg>',
'select': '<svg t="1649389105432" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2578" width="26" height="26"><path d="M839.68 445.44H614.4l112.64 122.88z" fill="#515151" p-id="2579"></path><path d="M957.44 194.56H81.92c-10.24 0-20.48 10.24-20.48 25.6V742.4c0 10.24 10.24 20.48 25.6 20.48h875.52c10.24 0 25.6-10.24 25.6-20.48V220.16c-5.12-15.36-15.36-25.6-30.72-25.6z m-51.2 471.04c0 10.24-10.24 15.36-20.48 15.36H158.72c-10.24 0-20.48-5.12-20.48-15.36V291.84c0-10.24 10.24-15.36 20.48-15.36h727.04c10.24 0 20.48 5.12 20.48 15.36V665.6z" fill="#515151" p-id="2580"></path></svg>',
'addRow': '<svg t="1649404990557" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1926" width="26" height="26"><path d="M828.02 196.518C743.477 112.384 631.108 66.05 511.546 66.05c-119.558 0-231.954 46.333-316.5 130.467-84.578 84.162-131.17 196.112-131.17 315.195 0 119.112 46.592 231.028 131.135 315.189 84.548 84.133 196.946 130.467 316.507 130.467 119.56 0 231.96-46.334 316.474-130.467 84.611-84.19 131.198-196.14 131.169-315.222 0.03-119.086-46.529-231-131.141-315.162z m-92.63 347.167H543.525v191.863c0 17.683-14.326 31.975-31.98 31.975-17.646 0-31.973-14.292-31.973-31.975V543.685H287.711c-17.648 0-31.972-14.324-31.972-31.972 0-17.653 14.324-31.98 31.972-31.98h191.863v-191.86c0-17.649 14.326-31.975 31.973-31.975 17.654 0 31.98 14.326 31.98 31.974v191.861h191.862c17.682 0 31.973 14.327 31.973 31.98 0 17.648-14.291 31.972-31.973 31.972z m0 0" fill="#1296db" p-id="1927"></path></svg>'
}
})

7
src/components/hm-crf/tinymce/plugins/hm_button/plugin.js

@ -12,8 +12,7 @@ import {
// elmToDataForm,
// hasElm
}
from '../hm_utils/index'
from '../hm_utils/index'
(function() {
'use strict'
@ -164,14 +163,12 @@ import {
const customClass = dataForm['class']
// const spacing = dataForm['spacing']
const win = editor.contentWindow
const domStr_button = `<input type="submit" id="${ID}" class="${className} ${customClass}" data-hm_type="${hmType}" data-hm_id="${name}" value="${name}"></input>`
// const domStr_img = ``
const domStr_button = `<input type="file" id="${ID}" class="${className} ${customClass}" data-hm_type="${hmType}" data-hm_id="${name}" value="${name}"></input>`
// const divs = `<div id="div-${ID}" class="div-buttons" style="margin-top:${spacing}px;">${domStr_button}</div>`
editor.insertContent(domStr_button)
// 渲染控件
renderElm(doc, win, id, dataForm['data-hm_type'])
}
const updateElm = function(editor, ele_button, ele_img, dataForm, changeHandler) {
console.log(123, dataForm['data-hm_id'])
const name = dataForm['data-hm_id']

7
src/components/hm-crf/tinymce/plugins/hm_upload/index.js

@ -0,0 +1,7 @@
// Exports the "anchor" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/anchor')
// ES2015:
// import 'tinymce/plugins/anchor'
require('./plugin.js')

254
src/components/hm-crf/tinymce/plugins/hm_upload/plugin.js

@ -0,0 +1,254 @@
import {
loadJS_ifrEditArea,
loadCSS_ifrEditArea,
isPlugin,
// updateElm,
updateAttrib,
getIdByClassName,
__assign,
isElm
// dataFormToElmPartStr,
// elmToDataForm,
// hasElm
}
from '../hm_utils/index'
(function() {
'use strict'
const pluginOptions = {
jsArr: [],
cssArr: [],
name: 'hmupload',
className: 'hmupload', // 判断依据,建议和name值一致
cmdName: 'cmdhmupload',
editName: 'hmupload_edit',
dataForm: {
'data-hm_id': '',
'data-hm_type': 'upload',
'img': '',
'value': '',
'style.marginTop': ''
}
}
const global = tinymce.util.Tools.resolve('tinymce.PluginManager')
// 初始设置
const setup = function(editor) {
// 编辑器初始化后执行
editor.on('init', function() {
loadJS_ifrEditArea(editor, pluginOptions.jsArr)
loadCSS_ifrEditArea(editor, pluginOptions.cssArr)
})
// 右键菜单,选定目标
editor.on('contextmenu', function(evt) {
const elm = evt.target
editor.selection.select(elm)
}, true)
}
const open = function(editor) {
editor.windowManager.open({
title: '新增按钮',
size: 'normal', // 'normal', 'medium' or 'large'
body: {
type: 'panel',
items: [
{
type: 'input',
name: 'data-hm_id',
label: '名称',
placeholder: '按钮名称'
},
{
type: 'input',
name: 'id',
label: '唯一ID',
placeholder: '唯一ID'
},
{
type: 'input',
name: 'class',
label: '样式名',
placeholder: '样式名'
}
// {
// type: 'input',
// name: 'spacing',
// label: '间距',
// placeholder: '距离顶部的间距'
// }
]
},
initialData: elmToDataForm(editor, pluginOptions.dataForm, pluginOptions.className),
buttons: [
{
type: 'cancel',
name: 'cancel',
text: '取消'
},
{
type: 'submit',
name: 'save',
text: '确定',
primary: true
}
],
onSubmit: function(api) {
const dataForm = api.getData()
// console.log(dataForm)
dataForm['data-hm_type'] = pluginOptions.dataForm['data-hm_type']
const hmType = dataForm['data-hm_type']
const className = pluginOptions.className
const elm = editor.selection.getNode()
let ele_upload, elm_img
if (elm.className.indexOf(className + '-img') >= 0) {
ele_upload = isElm(elm.previousElementSibling, 'data-hm_type', hmType) ? elm.previousElementSibling : undefined
elm_img = elm
} else if (elm.className.indexOf(className) >= 0 && isElm(elm, 'data-hm_type', hmType)) {
ele_upload = elm
elm_img = isElm(elm, 'data-hm_type', hmType) ? elm.nextElementSibling : undefined
}
if (elm && isPlugin(elm, className)) {
// console.log('更新', elm)
// 更新
updateElm(editor, ele_upload, elm_img, dataForm, changeHandler)
api.close()
} else {
// 插入
// console.log('插入', dataForm)
insertElm(editor, dataForm)
api.close()
}
}
})
}
// 右击编辑弹框回显
const elmToDataForm = function(editor, initDataForm, pluginClassName) {
const elm = editor.selection.getNode()
const dataForm = __assign({}, initDataForm)
// console.log(dataForm)
const hmType = initDataForm['data-hm_type']
if (isPlugin(elm, pluginClassName)) {
let ele_upload, elm_img
if (elm.className.indexOf(pluginClassName + '-img') >= 0) {
ele_upload = isElm(elm.previousElementSibling, 'data-hm_type', hmType) ? elm.previousElementSibling : undefined
elm_img = elm
} else if (elm.className.indexOf(pluginClassName) >= 0 && isElm(elm, 'data-hm_type', hmType)) {
ele_upload = elm
elm_img = isElm(elm, 'data-hm_type', hmType) ? elm.nextElementSibling : undefined
}
// console.log(elm_img)
// console.log(ele_upload)
dataForm['data-hm_id'] = ele_upload.getAttribute('data-hm_id')
dataForm['id'] = ele_upload.getAttribute('id')
// dataForm['class'] = ele_upload.getAttribute('class') ? ele_upload.getAttribute('class').split(' ')[1] : ''
// dataForm['spacing'] = elm.parentNode.style ? elm.parentNode.style.marginTop.replace('px', '') : ''
}
return dataForm
}
const insertElm = function(editor, dataForm) {
// console.log(dataForm)
const doc = editor.contentDocument || editor.contentWindow.document
const className = pluginOptions.className
const id = getIdByClassName(doc, className)
const name = dataForm['data-hm_id']
const hmType = dataForm['data-hm_type']
const ID = dataForm['id']
// const customClass = dataForm['class']
// const imgList = dataForm['imgList']
// const spacing = dataForm['spacing']
const win = editor.contentWindow
// const domStr_upload = `<input type="file" multiple="multiple" id="${ID}" class="${className}" data-hm_type="${hmType}" data-hm_id="${name}" value="${name}"></input>`
const domStr_upload = `<div class="uploadBtn" id="${ID}" data-hm_type="${hmType}" data-hm_id="${name}"><img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjQ5OTg4MDMxMTU5IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjMzMDMiIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+QGZvbnQtZmFjZSB7IGZvbnQtZmFtaWx5OiBmZWVkYmFjay1pY29uZm9udDsgc3JjOiB1cmwoIi8vYXQuYWxpY2RuLmNvbS90L2ZvbnRfMTAzMTE1OF91Njl3OHloeGR1LndvZmYyP3Q9MTYzMDAzMzc1OTk0NCIpIGZvcm1hdCgid29mZjIiKSwgdXJsKCIvL2F0LmFsaWNkbi5jb20vdC9mb250XzEwMzExNThfdTY5dzh5aHhkdS53b2ZmP3Q9MTYzMDAzMzc1OTk0NCIpIGZvcm1hdCgid29mZiIpLCB1cmwoIi8vYXQuYWxpY2RuLmNvbS90L2ZvbnRfMTAzMTE1OF91Njl3OHloeGR1LnR0Zj90PTE2MzAwMzM3NTk5NDQiKSBmb3JtYXQoInRydWV0eXBlIik7IH0KPC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTUxNC4zNTM1NTMgMjAzLjEyMTgxNWM0MS43NDk5NzUgMCA4Mi4xNjk2ODEgOC4xODYyNyAxMjAuMjM1ODM1IDI0LjI1MTgyNCAzNi44MzgyMTMgMTUuNTUzOTEyIDY5Ljg5MDI3NyAzNy44NjE0OTcgOTguMjM1MjM1IDY2LjMwODc4NCAyOC40NDcyODcgMjguNDQ3Mjg3IDUwLjY1MjU0MyA2MS40OTkzNSA2Ni4zMDg3ODQgOTguMjM1MjM1IDE2LjA2NTU1NCAzOC4wNjYxNTQgMjQuMjUxODI0IDc4LjQ4NTg2IDI0LjI1MTgyNCAxMjAuMjM1ODM1cy04LjE4NjI3IDgyLjE2OTY4MS0yNC4yNTE4MjQgMTIwLjIzNTgzNWMtMTUuNTUzOTEyIDM2LjgzODIxMy0zNy44NjE0OTcgNjkuODkwMjc3LTY2LjMwODc4NCA5OC4yMzUyMzUtMjguNDQ3Mjg3IDI4LjQ0NzI4Ny02MS40OTkzNSA1MC42NTI1NDMtOTguMjM1MjM1IDY2LjMwODc4NC0zOC4wNjYxNTQgMTYuMDY1NTU0LTc4LjQ4NTg2IDI0LjI1MTgyNC0xMjAuMjM1ODM1IDI0LjI1MTgyNHMtODIuMTY5NjgxLTguMTg2MjctMTIwLjIzNTgzNS0yNC4yNTE4MjRjLTM2LjgzODIxMy0xNS41NTM5MTItNjkuODkwMjc3LTM3Ljg2MTQ5Ny05OC4yMzUyMzUtNjYuMzA4Nzg0LTI4LjQ0NzI4Ny0yOC40NDcyODctNTAuNjUyNTQzLTYxLjQ5OTM1LTY2LjMwODc4NC05OC4yMzUyMzUtMTYuMDY1NTU0LTM4LjA2NjE1NC0yNC4yNTE4MjQtNzguNDg1ODYtMjQuMjUxODI0LTEyMC4yMzU4MzVzOC4xODYyNy04Mi4xNjk2ODEgMjQuMjUxODI0LTEyMC4yMzU4MzVjMTUuNTUzOTEyLTM2LjgzODIxMyAzNy44NjE0OTctNjkuODkwMjc3IDY2LjMwODc4NC05OC4yMzUyMzUgMjguNDQ3Mjg3LTI4LjQ0NzI4NyA2MS40OTkzNS01MC42NTI1NDMgOTguMjM1MjM1LTY2LjMwODc4NEM0MzIuMTgzODcxIDIxMS4zMDgwODQgNDcyLjYwMzU3NyAyMDMuMTIxODE1IDUxNC4zNTM1NTMgMjAzLjEyMTgxNU01MTQuMzUzNTUzIDEyOS40NDUzODhjLTIxMS40MTA0MTMgMC0zODIuNzA4MTA0IDE3MS4yOTc2OTItMzgyLjcwODEwNCAzODIuNzA4MTA0czE3MS4yOTc2OTIgMzgyLjcwODEwNCAzODIuNzA4MTA0IDM4Mi43MDgxMDQgMzgyLjcwODEwNC0xNzEuMjk3NjkyIDM4Mi43MDgxMDQtMzgyLjcwODEwNFM3MjUuNzYzOTY1IDEyOS40NDUzODggNTE0LjM1MzU1MyAxMjkuNDQ1Mzg4TDUxNC4zNTM1NTMgMTI5LjQ0NTM4OHoiIHAtaWQ9IjMzMDQiIGZpbGw9IiMxMjk2ZGIiPjwvcGF0aD48cGF0aCBkPSJNNTE1Ljk5MDgwNiA3MjYuMDE5Nzg2Yy0yMC4zNjMzNDYgMC0zNi44MzgyMTMtMTYuNDc0ODY4LTM2LjgzODIxMy0zNi44MzgyMTNMNDc5LjE1MjU5MyAzMzYuOTY3MzIzYzAtMjAuMzYzMzQ2IDE2LjQ3NDg2OC0zNi44MzgyMTMgMzYuODM4MjEzLTM2LjgzODIxMyAyMC4zNjMzNDYgMCAzNi44MzgyMTMgMTYuNDc0ODY4IDM2LjgzODIxMyAzNi44MzgyMTNsMCAzNTIuMjE0MjVDNTUyLjgyOTAyIDcwOS41NDQ5MTkgNTM2LjM1NDE1MiA3MjYuMDE5Nzg2IDUxNS45OTA4MDYgNzI2LjAxOTc4NnoiIHAtaWQ9IjMzMDUiIGZpbGw9IiMxMjk2ZGIiPjwvcGF0aD48cGF0aCBkPSJNNjkxLjE3Njk3NiA1NTIuODgwMTg0bC0zNTAuOTg2MzEgMGMtMjAuMzYzMzQ2IDAtMzYuODM4MjEzLTE2LjQ3NDg2OC0zNi44MzgyMTMtMzYuODM4MjEzczE2LjQ3NDg2OC0zNi44MzgyMTMgMzYuODM4MjEzLTM2LjgzODIxM2wzNTAuOTg2MzEgMGMyMC4zNjMzNDYgMCAzNi44MzgyMTMgMTYuNDc0ODY4IDM2LjgzODIxMyAzNi44MzgyMTNTNzExLjU0MDMyMiA1NTIuODgwMTg0IDY5MS4xNzY5NzYgNTUyLjg4MDE4NHoiIHAtaWQ9IjMzMDYiIGZpbGw9IiMxMjk2ZGIiPjwvcGF0aD48L3N2Zz4=" alt=""><input type="file" multiple="multiple" id="${ID}" class="${className}" data-hm_type="${hmType}" data-hm_id="${name}" value="${name}"></input></div>`
const divs = `<div class="div-uploads" style="margin-top:5px;"><ul id="div-${name}"></ul></div>`
editor.insertContent(domStr_upload + divs)
// 渲染控件
renderElm(doc, win, id, dataForm['data-hm_type'])
}
const updateElm = function(editor, ele_upload, ele_img, dataForm, changeHandler) {
console.log(123, dataForm['data-hm_id'])
const name = dataForm['data-hm_id']
const ID = dataForm['id']
// const spacing = dataForm['spacing']
const className = pluginOptions.className
const customClass = dataForm['class']
if (ele_upload) {
updateAttrib(ele_upload, 'data-hm_id', name)
updateAttrib(ele_upload, 'id', ID)
updateAttrib(ele_upload, 'value', name)
updateAttrib(ele_upload, 'class', `${className} ${customClass}`)
// ele_upload.parentNode.style.marginTop = spacing + 'px'
}
}
// 编辑控件状态后,触发处理逻辑
const changeHandler = function(editor, elm, dataForm) {
const doc = editor.contentDocument || editor.contentWindow.document
const win = editor.contentWindow
const id = editor.dom.getAttrib(elm, 'id')
renderElm(doc, win, id, dataForm['data-hm_type'])
}
const renderElm = function(doc, win, id, type) {
}
const register = function(editor) {
editor.addCommand(pluginOptions.cmdName, function() {
open(editor)
})
}
const register$1 = function(editor) {
// 工具栏
editor.ui.registry.addButton(pluginOptions.name, {
icon: 'upload',
title: '上传',
tooltip: '上传',
onAction: function() {
open(editor)
},
onSetup: function(uploadApi) {
}
})
// 菜单栏
editor.ui.registry.addMenuItem(pluginOptions.name, {
icon: 'upload',
text: '上传',
onAction: function() {
open(editor)
}
})
// 菜单栏(编辑)
editor.ui.registry.addMenuItem(pluginOptions.editName, {
icon: 'upload',
text: '编辑',
onAction: function() {
open(editor)
}
})
editor.ui.registry.addContextMenu(pluginOptions.name, {
update: function(elm) {
return isPlugin(elm, pluginOptions.className) ? [pluginOptions.editName] : []
}
})
}
function Plugin() {
global.add(pluginOptions.name, function(editor) {
setup(editor)
register(editor)
register$1(editor)
})
}
Plugin()
}())

10
src/page-subspecialty/views/main-sidebar.vue

@ -22,15 +22,15 @@
<svg-icon icon-class="icon-peoples" />
<span style="margin-left: 6px;">患者管理</span>
</el-menu-item>
<el-menu-item index="2" @click="goTo('/centerManagement',2)" v-if="userInfo.employeeId === 'admin'">
<el-menu-item index="2" @click="goTo('/centerManagement',2)" v-if="loginInfo.superAdmin === 1">
<svg-icon icon-class="icon-tree" />
<span style="margin-left: 6px;">中心管理</span>
</el-menu-item>
<el-menu-item index="3" @click="goTo('/teamManagement',3)" v-if="userInfo.employeeId === 'admin'">
<el-menu-item index="3" @click="goTo('/teamManagement',3)" v-if="loginInfo.superAdmin === 1 || loginInfo.superCentreAdmin === 1">
<svg-icon icon-class="icon-user" />
<span style="margin-left: 6px;">用户管理</span>
</el-menu-item>
<el-menu-item index="4" @click="goTo('/setManagement',4)" v-if="userInfo.employeeId === 'admin'">
<el-menu-item index="4" @click="goTo('/setManagement',4)" v-if="loginInfo.superAdmin === 1">
<svg-icon icon-class="icon-edit" />
<span style="margin-left: 6px;">设置管理</span>
</el-menu-item>
@ -43,7 +43,7 @@
export default {
data() {
return {
userInfo: {}
loginInfo: {}
// activeIndex: '1'
// fileHref: '',
// wordData: {
@ -64,7 +64,7 @@ export default {
}
},
created() {
this.userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
this.loginInfo = JSON.parse(window.localStorage.getItem('loginInfo'))
},
mounted() {

16
src/page-subspecialty/views/modules/patientManagement/index.vue

@ -149,7 +149,6 @@ export default {
//
editHandle(item) {
this.addOrUpdateVisible = true
this.patientIdNumber = item.patientIdNumber
this.$nextTick(() => {
this.$refs.addOrUpdate.title = '编辑患者'
this.$refs.addOrUpdate.dataForm.id = item.id
@ -158,13 +157,12 @@ export default {
},
//
async deleteHandle(item) {
this.patientIdNumber = item.patientIdNumber
const patientIdNumberList = []
patientIdNumberList.push(this.patientIdNumber)
const manageIdList = []
manageIdList.push(item.id)
this.$confirmFun('你确定要删除该患者吗?').then(async() => {
const { data: res } = await this.$http.post('/renmin_crf/patient/manage/delete', {
centreId: this.dataForm.centreId,
patientIdNumberList: patientIdNumberList
manageIdList: manageIdList
})
if (res.code === 0) {
this.$message({
@ -186,21 +184,21 @@ export default {
path: '/seeDoctor',
query: {
info: this.$Base64.encode(JSON.stringify({
patientIdNumber: scopeRow.patientIdNumber
manageId: scopeRow.id
}))
}
})
},
//
async exportHandle() {
const patientIdNumberList = []
const manageIds = []
this.currentTableList.forEach(item =>{
patientIdNumberList.push(item.patientIdNumber)
manageIds.push(item.id)
})
const token = Cookies.get('token')
// const baseUrl = 'http://192.168.0.32:8023'
const baseUrl = 'http://47.110.224.240:8023'
const url = `${baseUrl}/renmin_crf/patient/manage/exportExcel?centreId=${this.dataForm.centreId}&patientIdNumbers=${patientIdNumberList}&token=${token}`
const url = `${baseUrl}/renmin_crf/patient/manage/exportExcel?manageIds=${manageIds}&token=${token}`
window.location.href = url
},
//

8
src/page-subspecialty/views/modules/patientManagement/patient-add-or-update.vue

@ -75,8 +75,8 @@ export default {
patientName: [
{ required: true, message: '请输入患者姓名', trigger: 'blur' }
],
patientIdNumber: [
{ required: true, message: '请输入身份证号', trigger: 'blur' }
caseId: [
{ required: true, message: '请输入病案号', trigger: 'blur' }
],
patientPhone: [
{ validator: validataMobile, trigger: 'blur' }
@ -93,7 +93,7 @@ export default {
this.visible = true
this.$nextTick(() => {
this.$refs.dataForm.resetFields() //
if (this.dataForm.id && this.patientIdNumber) {
if (this.dataForm.id) {
this.getInfo()
}
})
@ -101,7 +101,7 @@ export default {
//
getInfo() {
this.$http.post('/renmin_crf/patient/manage/getPatientInfo', {
patientIdNumber: this.patientIdNumber
manageId: this.dataForm.id
}).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

1610
src/page-subspecialty/views/modules/seeDoctor/follow-up/1.vue

File diff suppressed because it is too large

13
src/page-subspecialty/views/modules/seeDoctor/follow-up/add-follow-record.vue

@ -26,11 +26,7 @@
import debounce from 'lodash/debounce'
export default {
props: {
patientIdNumber: {
type: String,
default: ''
},
patientId: {
centreId: {
type: String,
default: ''
},
@ -46,7 +42,7 @@ export default {
data() {
return {
visible: false,
centreId: '',
manageId: '',
creatorId: '',
dataForm: {
visitTime: null
@ -63,8 +59,6 @@ export default {
}
},
created() {
const userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
this.centreId = userInfo.centreId
},
methods: {
init() {
@ -85,8 +79,7 @@ export default {
createUserId: this.creatorId,
crfId: this.crfTemplateId,
formId: this.formId,
patientId: this.patientId,
patientIdNumber: this.patientIdNumber,
manageId: this.manageId,
visitTime: this.dataForm.visitTime + ' 00:00:00',
visitType: 8
}).then(({ data: res }) => {

30
src/page-subspecialty/views/modules/seeDoctor/follow-up/index.vue

@ -1,8 +1,8 @@
<template>
<div class="follow-up">
<!-- 随访记录 -->
<head-template head-left="随访记录">
<el-button type="primary" size="small" @click="addOrUpdateHandle()">修改</el-button>
<head-template head-left="随访记录" v-if="timeAxisData.length">
<el-button type="primary" size="small" @click="addOrUpdateHandle">修改</el-button>
<el-button type="danger" plain size="small" @click="deleteHandle">删除</el-button>
<button class="printer" @click="printerHandle">打印</button>
</head-template>
@ -36,9 +36,9 @@
</div>
</div>
<!-- 新增随访记录 -->
<add-follow-record v-if="followRecordVisible" ref="followRecordRef" :patientId="patientId" :patient-id-number="patientIdNumber" :crfTemplateId="crfTemplateId" :formId="formId" @refreshDataList="initData()" />
<add-follow-record v-if="followRecordVisible" ref="followRecordRef" :centreId="centreId" :crfTemplateId="crfTemplateId" :formId="formId" @refreshDataList="initData()" />
<!-- 弹窗, 新增 / 修改 -->
<follow-up v-if="followUpVisible" ref="followUp" crfFormType="8" :formId="formId" @refreshDataList="queryFollowForm" />
<follow-up v-if="followUpVisible" ref="followUp" :centreId="centreId" :formId="formId" @refreshDataList="queryFollowForm" />
</div>
</template>
<script>
@ -59,11 +59,11 @@ export default {
},
mixins: [qgyCRFData],
props: {
patientIdNumber: {
manageId: {
type: String,
default: ''
},
patientId: {
centreId: {
type: String,
default: ''
}
@ -77,7 +77,6 @@ export default {
jsArr: [],
crfContent: '',
dataForm: {},
centreId: '',
formId: '',
crfTemplateId: '',
realVisitType: '',
@ -85,8 +84,6 @@ export default {
}
},
created() {
const userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
this.centreId = userInfo.centreId
this.queryForm()
this.initData()
},
@ -99,6 +96,7 @@ export default {
addFollowHandle() {
this.followRecordVisible = true
this.$nextTick(() => {
this.$refs.followRecordRef.manageId = this.manageId
this.$refs.followRecordRef.init()
})
},
@ -106,7 +104,7 @@ export default {
queryForm() {
this.$http.get('/renmin_crf/crf/form/info/getForm', {
params: {
patientIdNumber: this.patientIdNumber,
manageId: this.manageId,
centreId: this.centreId,
crfFormType: 8
}
@ -123,16 +121,16 @@ export default {
},
queryFollowForm(formId) {
this.crfVisible = false
this.formId = formId
this.$http.get('/renmin_crf/crf/form/info/getFlowForm', {
params: {
formId: this.formId
formId: formId
}
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.formId = res.data.id
this.crfContent = res.data.formContent ? Base64.decode(res.data.formContent) : ''
}
this.crfVisible = true
@ -140,11 +138,13 @@ export default {
},
// 访
initData() {
window.sessionStorage.setItem('itemListIndex', 0)
window.sessionStorage.setItem('itemCurrentIndex', 0)
this.userId = JSON.parse(window.localStorage.getItem('userInfo')).id
this.$http.get('/renmin_crf/sf/findCycle360', {
params: {
centreId: this.centreId,
patientIdNumber: this.patientIdNumber
manageId: this.manageId
}
})
.then(({ data: res }) => {
@ -166,8 +166,10 @@ export default {
//
addOrUpdateHandle() {
this.followUpVisible = true
console.log(this.formId);
this.$nextTick(() => {
this.$refs.followUp.patientIdNumber = this.patientIdNumber
this.$refs.followUp.manageId = this.manageId
this.$refs.followUp.crfFormType = '8'
this.$refs.followUp.init()
})
},

15
src/page-subspecialty/views/modules/seeDoctor/index.vue

@ -83,10 +83,10 @@
<div class="see-docto-right">
<el-tabs v-model="activeName" type="card" @tab-click="selectForm">
<el-tab-pane label="基线" name="firstVisit">
<patient-form :crf-id="patientInfoObj.crfVoS" :patient-id-number="patientIdNumber" />
<patient-form v-if="baseFlag" :centre-id="patientInfoObj.centreId" :manageId="manageId" />
</el-tab-pane>
<el-tab-pane label="随访" name="followUp">
<follow-up ref="followUp" v-if="refreshFollowShow" :patient-id-number="patientIdNumber" :patient-id="patientInfoObj.patientId" @refreshFollow="refreshFollow" />
<follow-up ref="followUp" v-if="refreshFollowShow" :manageId="manageId" :patient-id="patientInfoObj.patientId" :centre-id="patientInfoObj.centreId" @refreshFollow="refreshFollow" />
</el-tab-pane>
</el-tabs>
</div>
@ -106,14 +106,15 @@ export default {
doctorList: [],
patientInfoObj: {},
activeName: 'firstVisit',
baseFlag: false,
referralVisible: false,
recordFlag: false,
followUnitVisitVisible: false,
patientIdNumber: '',
manageId: '',
detailId: '',
referralList: [],
followUnitVisitTitle: '修改随访周期',
refreshFollowShow: true,
refreshFollowShow: false,
pageParams: {}
}
},
@ -121,7 +122,7 @@ export default {
},
created() {
this.pageParams = JSON.parse(this.$Base64.decode(this.$route.query.info))
this.patientIdNumber = this.pageParams.patientIdNumber
this.manageId = this.pageParams.manageId
this.getPatientInfo()
},
methods: {
@ -140,12 +141,14 @@ export default {
//
async getPatientInfo() {
this.$http.post('/renmin_crf/patient/manage/getPatientInfo', {
patientIdNumber: this.patientIdNumber
manageId: this.manageId
}).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.patientInfoObj = res.data
this.baseFlag = true
this.refreshFollowShow = true
}).catch(() => {})
},
//

24
src/page-subspecialty/views/modules/seeDoctor/patient-form/index.vue

@ -1,7 +1,7 @@
<template>
<div class="patient-form">
<head-template head-left="">
<el-button type="primary" size="small" @click="editForm">修改</el-button>
<el-button type="primary" size="small" @click="editForm()">修改</el-button>
<el-button type="danger" plain size="small" @click="deleteHandle">删除</el-button>
<button class="printer" @click="printerHandle">打印</button>
</head-template>
@ -24,9 +24,9 @@
:body-style-show="true"
/>
</div>
</div>
</div>+
<!-- 弹窗, 新增 / 修改 -->
<follow-up v-if="followUpVisible" ref="followUp" :crfFormType="crfFormType" @refreshDataList="queryForm" />
<follow-up v-if="followUpVisible" ref="followUp" :centreId="centreId" :formId="formId" @refreshDataList="queryForm" />
</div>
</template>
<script>
@ -43,13 +43,11 @@ export default {
},
mixins: [qgyCRFData],
props: {
crfVoS: {
type: Object,
default: () => {
return {}
}
centreId: {
type: String,
default: ''
},
patientIdNumber: {
manageId: {
type: String,
default: ''
}
@ -92,13 +90,10 @@ export default {
jsArr: [],
crfContent: '',
crfFormType: '1',
centreId: '',
formId: ''
}
},
created() {
const userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
this.centreId = userInfo.centreId
this.queryForm()
},
methods: {
@ -113,7 +108,7 @@ export default {
this.crfVisible = false
this.$http.get('/renmin_crf/crf/form/info/getForm', {
params: {
patientIdNumber: this.patientIdNumber,
manageId: this.manageId,
centreId: this.centreId,
crfFormType: this.crfFormType
}
@ -133,7 +128,8 @@ export default {
editForm() {
this.followUpVisible = true
this.$nextTick(() => {
this.$refs.followUp.patientIdNumber = this.patientIdNumber
this.$refs.followUp.manageId = this.manageId
this.$refs.followUp.crfFormType = this.crfFormType
this.$refs.followUp.init()
})
},

29
src/page-subspecialty/views/modules/setManagement/add-or-update.vue

@ -21,7 +21,17 @@
size="small"
/>
</el-form-item>
<el-form-item prop="content" :label="'表单'" style="margin-top:20px;">
<el-form-item prop="templateCentreId" label="所属医院">
<el-select v-model="dataForm.templateCentreId" placeholder="请选择">
<el-option
v-for="item in centerList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item prop="content" label="表单" style="margin-top:20px;">
<crf-editor ref="crf" v-model="dataForm.content" :height="height" :is-p="true" />
</el-form-item>
<el-form-item prop="description" :label="'描述'">
@ -55,6 +65,7 @@ export default {
visible: false,
height: 'calc(100vh - 300px)',
title: '',
centerList: [],
dataForm: {
id: '',
templateCentreId: '',
@ -76,19 +87,19 @@ export default {
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
templateCentreId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
content: [
{ required: true, validator: validate_content, trigger: 'change' }
]
}
}
},
created() {
const userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
this.dataForm.templateCentreId = userInfo.centreId
},
methods: {
init() {
this.visible = true
this.getCenterList()
this.$nextTick(() => {
this.$refs.dataForm.resetFields()
if (this.dataForm.id) {
@ -98,6 +109,13 @@ export default {
}
})
},
//
async getCenterList() {
const { data: res } = await this.$http.get('/renmin_crf/sys/centre/list')
if (res.code === 0) {
this.centerList = res.data
}
},
//
getInfo() {
this.$http.get('/renmin_crf/crf/template/get', { params: { id: this.dataForm.id }}).then(({ data: res }) => {
@ -106,6 +124,7 @@ export default {
}
if (res.data) {
this.dataForm.name = res.data.name
this.dataForm.templateCentreId = res.data.templateCentreId
this.dataForm.content = Base64.decode(res.data.content)
this.dataForm.remark = res.data.remark
this.$refs['crf'].renderContent()

5
src/page-subspecialty/views/modules/setManagement/index.vue

@ -80,6 +80,10 @@ export default {
this.queryFormList()
},
methods: {
pageCurrentChangeHandle(num){
this.dataForm.page = num
this.queryFormList()
},
async queryFormList() {
const { data: res } = await this.$http.get('/renmin_crf/crf/template/page', {
params: this.dataForm
@ -92,6 +96,7 @@ export default {
this.$message.error(res.msg)
}
},
addHandle() {
this.addOrUpdateVisible = true
this.$nextTick(() => {

12
src/page-subspecialty/views/modules/team/team-add-or-update.vue

@ -1,14 +1,14 @@
<template>
<el-dialog class="teamDialog" :visible.sync="visible" width="30%" :title="!dataForm.id ? '新增人员' : '修改人员'" @close="closeDialog">
<el-form ref="dataForm" :model="dataForm" :rules="dataRule">
<el-form-item label="工号:" label-width="90px" prop="employeeId">
<el-input v-model="dataForm.employeeId" placeholder="请输入工号" />
<el-form-item label="用户名:" label-width="90px" prop="username">
<el-input v-model="dataForm.username" placeholder="请输入用户名" />
</el-form-item>
<el-form-item label="姓名:" label-width="90px" prop="realName">
<el-input v-model="dataForm.realName" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="登录账号:" label-width="90px" prop="username">
<el-input v-model="dataForm.username" placeholder="请输入登录账号" />
<el-form-item label="登录账号:" label-width="90px" prop="employeeId">
<el-input v-model="dataForm.employeeId" placeholder="请输入登录账号" />
</el-form-item>
<el-form-item v-if="!dataForm.id" label="登录密码:" label-width="90px" prop="password">
<el-input v-model="dataForm.password" placeholder="请输入密码" />
@ -106,13 +106,13 @@ export default {
}
return {
employeeId: [
{ required: true, message: '请输入医生工号', trigger: 'blur' }
{ required: true, message: '请输入登录账号', trigger: 'blur' }
],
realName: [
{ required: true, message: '请输入医生姓名', trigger: 'blur' }
],
username: [
{ required: true, message: '请输入登录账号', trigger: 'blur' }
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }

12
src/page-subspecialty/views/pages/login.vue

@ -20,8 +20,8 @@
@keyup.enter.native="dataFormSubmitHandle()"
>
<!-- 用户名 -->
<el-form-item prop="phoneNumber">
<el-input v-model="dataForm.doctorId" placeholder="手机号" clearable />
<el-form-item prop="doctorId">
<el-input v-model="dataForm.doctorId" placeholder="登录账号" clearable />
</el-form-item>
<!-- 密码 -->
<el-form-item v-if="logintitle=='密码登录' || !codePasswordShow" prop="password">
@ -74,7 +74,7 @@ export default {
captchaPath: '',
dataForm: {
doctorId: '',
password: '',
password: ''
},
codeTitleShow: true,
codeCount: 60,
@ -110,10 +110,10 @@ export default {
}
return {
doctorId: [
{ required: true, validator: validataMobile, trigger: 'blur' }
{ required: true, trigger: 'blur', message: '请输入登陆账号' }
],
password: [
{ required: false, trigger: 'blur' }
{ required: true, trigger: 'blur', message: '请输入密码' }
]
}
}
@ -224,6 +224,8 @@ export default {
}
clearLoginInfo()
Cookies.set('token', res.data.token)
window.localStorage.setItem('token', JSON.stringify(res.data.token))
window.localStorage.setItem('loginInfo', JSON.stringify(res.data))
window.localStorage.setItem('userInfo', JSON.stringify(res.data.userInfo))
window.localStorage.setItem('activeIndex', 1)
this.$router.push({ name: 'patientManagement' })

3
src/utils/confirm.js

@ -10,7 +10,8 @@ export const confirm = (text) => {
}).then((res) => {
resolve(res)
}).catch(() => {
Message.info('已取消删除')
// Message.info('已取消删除')
callback()
})
})
}

48
static/css/hmcrf.css

@ -61,6 +61,54 @@
border: 1px solid #d9d9d9;
border-radius: 4px;
}
.uploadBtn{
display: inline-block;
position: relative;
cursor: pointer;
}
.hmupload{
width: 32px;
height: 32px;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
}
.div-uploads{
display: inline-block;
}
.div-uploads ul li{
position: relative;
list-style: none;
overflow: hidden;
background-color: #fff;
border: 1px solid #c0ccda;
border-radius: 6px;
box-sizing: border-box;
margin-top: 10px;
margin-right: 10px;
padding: 10px 24px 10px 10px
}
.div-uploads .closeImg{
position: absolute;
right: 2px;
top: -5px;
cursor: pointer;
opacity: .75;
color: #606266;
font-size: 20px;
}
.closeFile{
position: absolute;
right: 2px;
top: -5px;
cursor: pointer;
opacity: .75;
color: #606266;
font-size: 20px;
}
#work-unit {
max-width: 500px !important;
}

100
static/js/hmcrf.js

@ -1,4 +1,4 @@
$(document).ready(function(){
$(document).ready(function(){
$('.hminput ,.hmtextarea').on('change focusout keydown', function() {
this.setAttribute('value', this.value)
})
@ -6,8 +6,19 @@
$(elm).text(elm.getAttribute('value') || '')
})
const initCRF = function() {
// const doc = window.document
const laydate = window.laydate
// 删除上传的图片
$("body").on('click','.closeImg', function(){
const url = $(this).prev().prop('src')
deleteFile(url)
$(this)[0].parentNode.remove()
});
// 删除上传的文件
$("body").on('click','.closeFile', function(){
const url = $(this).prev().prop('href')
deleteFile(url)
$(this)[0].parentNode.remove()
});
$('.hminput').each(function() {
const elm = this
const hmDataType = elm.getAttribute('data-hm_type')
@ -44,6 +55,41 @@
if (item.value !== this.value) { item.removeAttribute('selected') }
})
})
// 上传
$('.hmupload').on('change', function() {
let self = this
let xhr, formData;
const file = this.files[0];//转化为易于理解的file对象
console.log(file);
xhr = new XMLHttpRequest();
xhr.withCredentials = false;
console.log(JSON.parse(window.localStorage.getItem('token')));
const baseUrl = 'http://192.168.0.32:8023'
xhr.open('POST', `${baseUrl}/renmin_crf/upload/uploadFiles`);
xhr.setRequestHeader("token", JSON.parse(window.localStorage.getItem('token')));
xhr.onload = function () {
let json = JSON.parse(xhr.responseText);
if (xhr.status == 200) {
if (json.code == 0) {
const data = json.data
const filePathList = data.filePath || []
const url = filePathList[0].url
const id = self.getAttribute('data-hm_id')
const ul = document.getElementById('div-' + id)
let li = window.document.createElement("li");
if (file.type === "application/pdf") {
li.innerHTML = `<input id="" style="display: none" value="${url}" data-hm_id="${id}" data-hm_type="uploadUrl"><a href="${url}">${file.name}</a><span id="" class="closeFile">×</span>`
} else {
li.innerHTML = `<input id="" style="display: none" value="${url}" data-hm_id="${id}" data-hm_type="uploadUrl"><img src="${url}" alt="" style="width: 70px;height: 70px"><span id="" class="closeImg">×</span>`;
}
ul.appendChild(li)
}
}
};
formData = new FormData();
formData.append('files', file);//此处与源文档不一样
xhr.send(formData);
})
$('.hmcheckbox').on('change', function() {
$(this).attr('checked', this.checked)
@ -69,41 +115,19 @@
initCRF()
})
function deleteFile(url) {
const baseUrl = 'http://192.168.0.32:8023'
$.ajax({
type:"POST",
headers: {
'token': JSON.parse(window.localStorage.getItem('token'))
},
contentType:'application/json',
data: JSON.stringify({url: url}),
dataType:'json',
url:`${baseUrl}/renmin_crf/upload/deleteFilesByFilePaths`,
success:function(msg){
/**
const demo = {
both: null,
id: '4',
name: '眼压',
od: '20.3',
os: '16',
recId: '9379374',
time: '2013-04-15 13:27:14'
}
*/
function dataFill(itemList){
console.log(itemList)
itemList ? itemList.forEach(item => {
const eyeType=item.both ? '' : ''
// data-hm_bd_id--字典表/table/dict/getTableDictTreeForCRF--id
// 根据字典表id填充数据
// console.log(item.id);
// console.log( $(`[data-hm_bd_id='${item.id}']`));
$(`[data-hm_bd_id='${item.id}']`).each(function(index,elm){
// console.log(elm);
if(elm.getAttribute("data-hm_bd_eye_type") === 'od'){
$(elm).attr('value',item.od || '')
} else if(elm.getAttribute("data-hm_bd_eye_type")==='os'){
$(elm).attr('value',item.os || '')
} else {
$('textarea').each(function(index,elm){
$(elm).text(elm.getAttribute('value') || '')
$(elm).width(elm.getAttribute('value') ? (elm.getAttribute('value').length * 16) + 'px' : '450px')
})
$(elm).attr('value',item.value || '')
}
})
}): $('textarea').each(function(index,elm){
$(elm).width(elm.getAttribute('value') ? (elm.getAttribute('value').length * 16) + 'px' : '450px')
})
}
});
}

Loading…
Cancel
Save