123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622 |
- <template>
- <div>
- <el-dialog title="透析下机" class="newDialog" :visible.sync="visible" width="854px"
- :modal = 'false' :close-on-click-modal="false"
- >
- <!-- <div class="txsj">
- </div> -->
- <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
- <el-form :model="form" label-width="100px" ref="form">
- <el-form-item label="下机护士" >
- <el-select v-model="form.nurse_id" :disabled="!(dialysis_order.id != 0)">
- <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
- </el-select>
- </el-form-item>
-
- <el-form-item label="下机时间 :" :prop="isName('下机时间')"
- :rules="isCheckmust('下机时间')" style="width:275px">
- <el-date-picker
- type="datetime"
- format="yyyy-MM-dd HH:mm"
- value-format="yyyy-MM-dd HH:mm"
- placeholder="选择时间"
- v-model="end_time"
- style="width:100%;"
- ></el-date-picker>
- </el-form-item>
-
- <el-form-item label="穿刺处血肿:" :prop="isName('穿刺处血肿')"
- :rules="isCheckmust('穿刺处血肿')" v-if="isShowFiled('穿刺处血肿')" :label-width="150">
- <el-radio-group v-model="form.puncture_point_haematoma">
- <el-radio :label="1">有</el-radio>
- <el-radio :label="2">无</el-radio>
- </el-radio-group>
- </el-form-item>
-
- <el-form-item label="内瘘: " :prop="isName('内瘘')"
- :rules="isCheckmust('内瘘')" v-if="isShowFiled('内瘘')">
- <el-input v-model="form.internal_fistula" readonly @focus="showInnerDialog('7')" style="width:200px"></el-input>
- </el-form-item>
-
- <el-form-item label="导管: " :prop="isName('导管')"
- :rules="isCheckmust('导管')" v-if="isShowFiled('导管')">
- <el-input v-model="form.catheter" @focus="showInnerDialog('4')" style="width:200px"></el-input>
- </el-form-item>
-
- <el-form-item label="透析器凝血: " :prop="isName('透析器凝血')"
- :rules="isCheckmust('透析器凝血')" v-if="isShowFiled('透析器凝血')">
- <el-input
- style="width:200px"
- v-model="form.cruor"
- readonly
- @focus="showInnerDialog('1')"
- ></el-input>
- </el-form-item>
-
- <el-form-item label="宣教知识:" :prop="isName('宣教知识')"
- :rules="isCheckmust('宣教知识')" v-if="isShowFiled('宣教知识')">
- <el-select @change="dialysisAfterTeachSelectChange" v-model="form.mission_id">
- <el-option
- v-for="(item, index) in education"
- :label="item.text"
- :value="item.value"
- :key="index"
- ></el-option>
- </el-select>
- </el-form-item>
-
- <el-row :gutter="20">
- <el-col v-if="isShowFiled('宣教知识')">
- <el-form-item :prop="isName('宣教知识')"
- :rules="isCheckmust('宣教知识')">
- <el-input
- type="textarea"
- v-model="form.mission"
- :rows="4"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
-
-
-
- <el-form-item>
- <el-button v-if="(dialysis_order.id != 0 && dialysis_order.stage == 1)" @click="submit('form')" :loading="loading"
- type="primary">执行下机
- </el-button>
- <el-button
- v-if="dialysis_order.stage == 2 "
- type="primary" @click="modifyFinish('form')">修改下机
- </el-button>
- </el-form-item>
-
-
-
- </el-form>
- </el-dialog>
-
- <multi-select-box
- :propsForm="InnerDialogProps"
- v-on:dialog-comfirm="innerDialogComfirm"
- v-on:dialog-cancle="innerDialogCancle"
- ></multi-select-box>
-
-
- <el-dialog
- title="提示"
- :visible.sync="infoDialogVisible"
- width="30%">
- <span>
- <el-form>
- <el-row>
- <span>申请日期:</span>
- <span>
- <el-date-picker
- type="datetime"
- format="yyyy-MM-dd HH:mm"
- value-format="yyyy-MM-dd HH:mm"
- placeholder="选择时间"
- v-model="selected_date"
- ></el-date-picker>
- </span>
- </el-row>
- <el-row>
- <span>备注:</span>
- <span>
- <el-input v-model="remark" style="width:200px"></el-input>
- </span>
- </el-row>
- </el-form>
-
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="infoDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveInformation">确 定</el-button>
- </span>
- </el-dialog>
-
- </div>
- </template>
-
- <script>
- import axios from 'axios'
- import { finishDialysis,PostModifyFinishDialysis } from '@/api/dialysis_record'
- import { saveInformation } from '@/api/dialysis'
- import { parseTime } from '@/utils'
- import multiSelectBox from './MultiSelectBox'
- import request from '@/utils/request'
- import store from "@/store";
- import { getDataConfig } from '@/utils/data'
- export default {
- components: {
- multiSelectBox
- },
- name: 'FinishDialog',
- data() {
- return {
- showTxt:'',
- hasPermission:true,
- visible: false,
- loading: false,
- creator: 0,
- patient_id: 0,
- schedule_date: 0,
- isPremission:false,
- end_time: '',
- isVisibility: false,
- form: {
- nurse_id: 0,
- puncture_point_haematoma:2,
- internal_fistula:"",
- catheter:"",
- cruor:"",
- mission:"",
- mission_id:"",
- },
- internal_fistula: [],
- InnerDialogProps: {
- values: [],
- visibility: false,
- isShowTextArea: true,
- customContent: '',
- titles: '',
- type: '' // 不同弹框类型,用来匹配数据
- },
- catheter: [],
- cruorOptions: [],
- required:false,
- education:[],
- infoDialogVisible:false,
- selected_date:"",
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now()
- }
- },
- remark:"",
- infoDialogVisible:false,
- selected_date:"",
- }
- },
- props: {
- prescription: { // 透析处方
- type: Object,
- },
- dialysis_order: {
- type: Object
- },
- schedule: {
- type: Object
- },
- admins: {
- type: Array
- }, special_premission: {
- type: Array,
- },
- patient:{
- type: Object
- }
- },
- created() {
- this.education = getDataConfig('education', 'education')
- this.internal_fistula = getDataConfig('hemodialysis', 'internal_fistula')
- this.catheter = getDataConfig('hemodialysis', 'catheter')
- this.cruorOptions = getDataConfig('hemodialysis', 'cruor')
- },
- watch: {
- 'dialysis_order.id': function() {
- if (this.dialysis_order.id == 0) {
- this.form.nurse_id = 0
- } else if (this.dialysis_order.stage == 1) {
- this.form.nurse_id = this.$store.getters.xt_user.user.id
- } else {
- console.log("orde32332323232332",this.dialysis_order)
- this.form.nurse_id = this.dialysis_order.finish_nurse
- this.form.catheter = this.dialysis_order.catheter
- this.form.cruor = this.dialysis_order.cruor
- this.form.internal_fistula = this.dialysis_order.blood_access_internal_fistula
- this.form.puncture_point_haematoma = this.dialysis_order.puncture_point_haematoma
- this.form.mission = this.dialysis_order.mission
- }
- },
- patient:{
- handler(newVal){
- this.patient_id = newVal.id
- },
- deep:true
- }
- },
- methods: {
- isName(name) {
- let filedList = store.getters.xt_user.fileds;
- for (let i = 0; i < filedList.length; i++) {
- if (filedList[i].module == 9 && filedList[i].filed_name_cn == name) {
- return filedList[i].filed_name;
- }
- }
- },
-
- isCheckmust(name) {
- let filedList = store.getters.xt_user.fileds;
- for (let i = 0; i < filedList.length; i++) {
- if (
- filedList[i].module == 9 &&
- filedList[i].filed_name_cn == name &&
- filedList[i].is_write == 1
- ) {
-
- return [{ required: true ,message:`请输入${name}` }];
- }
- }
- },
- dialysisAfterTeachSelectChange: function(values) {
- if (this.form.mission == '') {
- this.form.mission = values
- } else {
- if (this.form.mission.indexOf(values) == -1) {
- if (
- this.form.mission
- .charAt(this.form.mission.length - 1)
- .indexOf('。') == -1
- ) {
- this.form.mission =
- this.form.mission + ',' + values
- } else {
- this.form.mission =
- this.form.mission + values
- }
- }
- }
- },
- isShowFiled(name) {
- var filedList = store.getters.xt_user.fileds
- for (let i = 0; i < filedList.length; i++) {
- if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
- return true
- }
- if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_write!=undefined && filedList[i].is_write == 1) {
- this.required = true
- }
- }
- this.required = false
- return false
- },
- isWrite(name){
- var filedList = store.getters.xt_user.fileds
- for (let i = 0; i < filedList.length; i++) {
- if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_write == 1) {
- return true
- }
- }
-
- return false
- },
- show: function(record) {
- this.record = record
- console.log("下机",record)
- this.getPermission()
- this.visible = true
- var nowDate = new Date()
- var nowYear = nowDate.getFullYear()
- var nowMonth = nowDate.getMonth() + 1
- var nowDay = nowDate.getDate()
- var nowHours = nowDate.getHours()
- var nowMinutes = nowDate.getMinutes()
- var time =
- nowYear +
- '-' +
- (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
- '-' +
- (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
- if(this.$route.query.patient_id){
- this.patient_id = this.$route.query.patient_id
- }
-
- this.schedule_date = this.$route.query.date
-
- if (this.dialysis_order.id == 0) {
- this.form.nurse_id = 0
- } else if (this.dialysis_order.stage == 1) {
- this.form.nurse_id = this.$store.getters.xt_user.user.id
- } else {
- this.form.nurse_id = this.dialysis_order.finish_nurse
- }
-
-
- if (this.dialysis_order.finish_creator > 0) {
- for (let i = 0; i < this.special_premission.length; i++) {
- if (this.$store.getters.xt_user.user.id == this.special_premission[i].admin_user_id) {
- this.isPremission = true
- }
- }
- }
-
- if (this.dialysis_order.finish_creator > 0) {
- this.creator = this.dialysis_order.finish_creator
- }
-
-
- if (this.dialysis_order.id == "") {
- //没有上下机记录
- this.end_time = this.dialysis_order.finish_creator == 0 ? time : this.getTime(this.dialysis_order.end_time, '{y}-{m}-{d} {h}:{i}')
-
- } else {
- if (this.dialysis_order.start_time > 0) {
- if (this.prescription.id != "") {
- let endTime = 0;
- endTime =
- this.dialysis_order.start_time +
- this.prescription.dialysis_duration_hour * 3600 +
- this.prescription.dialysis_duration_minute * 60;
- this.end_time = parseTime(endTime, "{y}-{m}-{d} {h}:{i}");
- } else {
- this.end_time =
- parseTime(Date.parse(new Date()) / 1000, "{y}-{m}-{d} {h}:{i}")
- }
- if (this.dialysis_order.end_time > 0) {
- this.end_time =
- parseTime(this.dialysis_order.end_time, "{y}-{m}-{d} {h}:{i}");
- }
- } else {
- this.end_time = this.dialysis_order.finish_creator == 0 ? time : this.getTime(this.dialysis_order.end_time, '{y}-{m}-{d} {h}:{i}')
-
- }
- }
-
-
- },
- hide: function() {
- this.visible = false
- },
- modifyFinish:function(formName){
- this.$refs[formName].validate(valid=>{
- if(valid){
- if(this.isWrite("穿刺处血肿") == true && this.form.puncture_point_haematoma == ""){
- this.$message.error("请选择穿刺处血肿")
- return
- }
- if(this.isWrite("内瘘") == true && this.form.internal_fistula == ""){
- this.$message.error("请选择内瘘")
- return
- }
- if(this.isWrite("导管") == true && this.form.catheter == ""){
- this.$message.error("请选择导管")
- return
- }
- if(this.isWrite("透析器凝血") == true && this.form.cruor == ""){
- this.$message.error("请选择透析器凝血")
- return
- }
- let ParamsQuery = {};
- ParamsQuery["id"] = this.dialysis_order.id;
- ParamsQuery["nurse"] = this.form.nurse_id;
- ParamsQuery["end_time"] = this.end_time;
- ParamsQuery["mode"] = "2"
- ParamsQuery["puncture_point_haematoma"] = parseInt(this.form.puncture_point_haematoma)
- ParamsQuery["internal_fistula"] = this.form.internal_fistula
- ParamsQuery["catheter"] = this.form.catheter
- ParamsQuery["cruor"] = this.form.cruor
- ParamsQuery["mission"] = this.form.mission
- ParamsQuery["mission_id"] = this.form.mission_id
- if(this.dialysis_order.finish_creator != this.$store.getters.xt_user.user.id){
- ParamsQuery["mode"] = "3"
- }
- PostModifyFinishDialysis(ParamsQuery).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- if(response.data.code == 600000008){
- this.infoDialogVisible = true
- }
- return false;
- } else {
- this.$message.success("修改成功")
- var record = this.dialysis_order;
- for (const key in response.data.data.dialysis_order) {
- this.$set(record, key, response.data.data.dialysis_order[key]);
- }
- console.log(response.data.data.after)
- this.$emit('assessmentAfterDislysis', response.data.data.after)
- }
- });
- }
- })
- },
- submit: function(formName) {
-
- this.$refs[formName].validate(valid=>{
- if(valid){
- if(this.isWrite("穿刺处血肿") == true && this.form.puncture_point_haematoma == ""){
- this.$message.error("请选择穿刺处血肿")
- return
- }
- if(this.isWrite("内瘘") == true && this.form.internal_fistula == ""){
- this.$message.error("请选择内瘘")
- return
- }
- if(this.isWrite("导管") == true && this.form.catheter == ""){
- this.$message.error("请选择导管")
- return
- }
- if(this.isWrite("透析器凝血") == true && this.form.cruor == ""){
- this.$message.error("请选择透析器凝血")
- return
- }
- this.loading = true
- let mode = "1"
- console.log("fomr",this.form.mission_id)
-
- finishDialysis(this.patient_id,this.schedule_date ? parseTime(this.schedule_date, '{y}-{m}-{d}') : parseTime(new Date(), '{y}-{m}-{d}'), this.end_time, this.form.nurse_id,mode,parseInt(this.form.puncture_point_haematoma),this.form.internal_fistula,this.form.catheter,this.form.cruor,this.form.mission,this.form.mission_id).then(rs => {
- this.loading = false
- var resp = rs.data
- if (resp.state == 1) {
- var dialysis_order = resp.data.dialysis_order
- var this_order = this.dialysis_order
- for (const key in dialysis_order) {
- this.$set(this_order, key, dialysis_order[key])
- }
- let orgId = parseInt(sessionStorage.getItem("org_id"));
- this.hide()
- this.$emit('assessmentAfterDislysis', resp.data.assessmentAfterDislysis)
-
- } else {
- this.$message.error(resp.msg)
- if(response.code == 600000008){
- this.infoDialogVisible = true
- }
- }
- })
- }else{
- return false
- }
- })
-
- }, getTime(value, temp) {
- if (value != undefined) {
- return parseTime(value, temp)
- }
- return ''
- },
- getPermission(){
- request.get("/api/func_per/get",{
- params:{
- create_url:"/api/dialysis/finish?mode=1",
- modify_url:"/api/finish_dialysis/modify?mode=2",
- modify_other_url:"/api/finish_dialysis/modify?mode=3",
- module:6
- }
- }).then(res => {
- if(res.data.state == 0){
- this.hasPermission = false
- }else if(res.data.state == 1){
- if(this.record.id != "" && this.record.creater != 0){//有数据
- if(this.record.creater == this.$store.getters.xt_user.user.id){//创建人是自己
- if(res.data.data.is_has_modify == false){
- this.hasPermission = false
- this.showTxt = "你没有修改执行下机权限"
- }
- }else{//创建人不是自己
- if(res.data.data.is_has_modify_other == false){
- this.hasPermission = false
- this.showTxt = "你没有修改他人执行下机权限"
- }
- }
- }else if(this.record.id == "" || this.record.creater == 0){
- if(res.data.data.is_has_create == false){
- this.hasPermission = false
- this.showTxt = "你没有执行下机权限"
- }
- }
- }
- })
- },
- showInnerDialog: function(val) {
- this.InnerDialogProps.visibility = true
- switch (val) {
- case '7': // 内瘘
- this.InnerDialogProps.values = this.internal_fistula
- this.InnerDialogProps.titles = '内瘘'
- this.InnerDialogProps.type = 'internal_fistula'
- this.InnerDialogProps.selected = this.form.internal_fistula
- this.InnerDialogProps.isShowTextArea = false
- break
- case '4': // 导管
- this.InnerDialogProps.values = this.catheter
- this.InnerDialogProps.titles = '导管'
- this.InnerDialogProps.type = 'catheter'
- this.InnerDialogProps.selected = this.form.catheter
- this.InnerDialogProps.isShowTextArea = false
- break
- case '1':
- this.InnerDialogProps.values = this.cruorOptions
- this.InnerDialogProps.titles = '凝血'
- this.InnerDialogProps.type = 'cruor'
- this.InnerDialogProps.selected = this.form.cruor
- this.InnerDialogProps.isShowTextArea = false
- break
-
- }
- },
- innerDialogComfirm: function(val) {
- this.InnerDialogProps.visibility = false
- switch (val.type) {
- case 'internal_fistula':
- this.form.internal_fistula = val.value.join(',')
- break
- case 'catheter':
- this.form.catheter = val.value.join(',')
- break
- case 'cruor':
- this.form.cruor = val.value.join(',')
- break
- }
- },
- innerDialogCancle: function() {
- this.InnerDialogProps.visibility = false
- },
-
- saveInformation(){
- var params = {
- selected_date:this.selected_date,
- patient_id:this.$route.query.patient_id,
- record_date:this.$route.query.date,
- module:8,
- remark:this.remark,
- }
-
- saveInformation(params).then(response=>{
- if(response.data.state == 1){
- var information = response.data.data.information
- this.$message.success("提交成功!")
- this.infoDialogVisible = false
- }
- })
- }
- }
- }
- </script>
-
-
- <style scoped>
- .txsj {
- text-align: center;
- margin-bottom: 20px;
- }
- .warnTxt{
- text-align: center;
- margin: 0 auto;
- background: #faa331;
- max-width: 240px;
- padding: 10px 20px;
- border-radius: 4px;
- margin-bottom: 10px;
- color:#fff;
- }
- </style>
- <style lang="scss">
- .newDialog{
- .el-dialog__body{
- padding: 10px 20px 30px;
- }
- }
- </style>
|