|
@@ -2,16 +2,16 @@
|
|
|
<div class="formwrap">
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
<el-tab-pane label="用户管理" name="customerEdit">
|
|
|
- <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="140px">
|
|
|
+ <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="140px">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="病人姓名" prop="named">
|
|
|
- <el-input v-model="formmodel.named" clearable placeholder="请输入姓名" :maxlength="20"></el-input>
|
|
|
+ <el-input v-model="formmodel.named" clearable placeholder="请输入姓名" :maxlength="20" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="病人编号">
|
|
|
- <el-input v-model="formmodel.card_no" clearable placeholder="请输入病人编号" :maxlength="20"></el-input>
|
|
|
+ <el-input v-model="formmodel.card_no" clearable placeholder="请输入病人编号" :maxlength="20" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
@@ -53,31 +53,31 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="证件号">
|
|
|
- <el-input v-model="formmodel.id_no" clearable placeholder="请输入证件号" :maxlength="20"></el-input>
|
|
|
+ <el-input v-model="formmodel.id_no" clearable placeholder="请输入证件号" :maxlength="20" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="入院日期" prop="in_date">
|
|
|
<el-date-picker
|
|
|
- v-model="formmodel.in_date"
|
|
|
- type="date"
|
|
|
- :editable="false"
|
|
|
- value-format="timestamp"
|
|
|
- placeholder="选择入院日期"
|
|
|
- :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}">
|
|
|
- </el-date-picker>
|
|
|
+ v-model="formmodel.in_date"
|
|
|
+ type="date"
|
|
|
+ :editable="false"
|
|
|
+ value-format="timestamp"
|
|
|
+ placeholder="选择入院日期"
|
|
|
+ :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="出院日期" prop="out_date">
|
|
|
<el-date-picker
|
|
|
- v-model="formmodel.out_date"
|
|
|
- type="date"
|
|
|
- :editable="false"
|
|
|
- value-format="timestamp"
|
|
|
- placeholder="选择出院日期"
|
|
|
- :picker-options="{disabledDate(time) { return time.getTime() < Date.now() }}">
|
|
|
- </el-date-picker>
|
|
|
+ v-model="formmodel.out_date"
|
|
|
+ type="date"
|
|
|
+ :editable="false"
|
|
|
+ value-format="timestamp"
|
|
|
+ placeholder="选择出院日期"
|
|
|
+ :picker-options="{disabledDate(time) { return time.getTime() < Date.now() }}"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -85,22 +85,22 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="责任医生">
|
|
|
- <el-select placeholder="请选择医生" v-model="formmodel.doctor_id" @change="doctorChange(1)">
|
|
|
- <el-option :label="item.clerk_name" :key="index" v-for="(item,index) in doctors" :value="item.clerk_id"></el-option>
|
|
|
+ <el-select v-model="formmodel.doctor_id" placeholder="请选择医生" @change="doctorChange(1)">
|
|
|
+ <el-option v-for="(item,index) in doctors" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="责任护士">
|
|
|
- <el-select placeholder="请选择护士" v-model="formmodel.nurse_id" @change="doctorChange(2)">
|
|
|
- <el-option :label="item.clerk_name" :key="index" v-for="(item,index) in nurses" :value="item.clerk_id"></el-option>
|
|
|
+ <el-select v-model="formmodel.nurse_id" placeholder="请选择护士" @change="doctorChange(2)">
|
|
|
+ <el-option v-for="(item,index) in nurses" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="责任护工">
|
|
|
- <el-select placeholder="请选择护工" v-model="formmodel.worker_id" @change="doctorChange(3)">
|
|
|
- <el-option :label="item.clerk_name" :key="index" v-for="(item,index) in workrs" :value="item.clerk_id"></el-option>
|
|
|
+ <el-select v-model="formmodel.worker_id" placeholder="请选择护工" @change="doctorChange(3)">
|
|
|
+ <el-option v-for="(item,index) in workrs" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -109,7 +109,7 @@
|
|
|
<el-row v-if="nurseData.length > 0">
|
|
|
<el-col v-for="(item, index) in nurseList" :key="index" :span="24 / nurseList.length">
|
|
|
<el-form-item :label="item[0]">
|
|
|
- <el-select :placeholder="'请选择'+item[0]" v-model="nurseData[index].nurse_level" @change="changeNurseData(index)">
|
|
|
+ <el-select v-model="nurseData[index].nurse_level" :placeholder="'请选择'+item[0]" @change="changeNurseData(index)">
|
|
|
<el-option v-for="(t,i) in item[1]" :key="i" :label="t.option_name" :value="t.id">
|
|
|
<span style="float: left">{{ t.option_name }}</span>
|
|
|
<span :style="'float: right; background-color: #'+t.color_rgb+';color: #'+t.color_rgb">颜色</span>
|
|
@@ -123,88 +123,89 @@
|
|
|
<el-col :span="16">
|
|
|
<el-form-item label="病况描述">
|
|
|
<el-input
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 2, maxRows: 4}"
|
|
|
- :minlength="2"
|
|
|
- :maxlength="50"
|
|
|
- :placeholder="'请输入文本内容,长度2~50'"
|
|
|
- v-model="formmodel.illness_desc">
|
|
|
- </el-input>
|
|
|
+ v-model="formmodel.illness_desc"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2, maxRows: 4}"
|
|
|
+ :minlength="2"
|
|
|
+ :maxlength="50"
|
|
|
+ :placeholder="'请输入文本内容,长度2~50'"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-form-item style="margin-top:15px;">
|
|
|
- <el-button type="primary" @click="handlerSubmit('editForm')" :disabled="isDisabled" class="save">保存修改</el-button>
|
|
|
+ <el-button type="primary" :disabled="isDisabled" class="save" @click="handlerSubmit('editForm')">保存修改</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<el-card v-if="this.customerId != 0" style="maring:15px">
|
|
|
<div>
|
|
|
- <div style="float: left"><h4 >用户备注</h4></div>
|
|
|
+ <div style="float: left"><h4>用户备注</h4></div>
|
|
|
<div style="float: right">
|
|
|
<el-button type="success" @click="dialogAddVisible = true">添加备注</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="clear:both">
|
|
|
- <div >
|
|
|
+ <div>
|
|
|
<el-card v-for="(item, index) in tableData" :key="index">
|
|
|
<div>
|
|
|
- <span style="margin-left: 20px;font-weight:bold">标签内容:</span><span style="line-height:1.5">{{item.content}}</span>
|
|
|
+ <span style="margin-left: 20px;font-weight:bold">标签内容:</span><span style="line-height:1.5">{{ item.content }}</span>
|
|
|
</div>
|
|
|
<div style="margin: 10px">
|
|
|
<div style="float: left">
|
|
|
- <span v-if="item.file_name">
|
|
|
- <el-link href="https://imgm.gmw.cn/attachement/jpg/site215/20210309/4101699327084478802.jpg" icon="el-icon-folder" type="success" target="_blank" :download="item.file_name">{{item.file_name}}</el-link>
|
|
|
- </span>
|
|
|
+ <span v-if="item.file_name">
|
|
|
+ <el-link href="https://imgm.gmw.cn/attachement/jpg/site215/20210309/4101699327084478802.jpg" icon="el-icon-folder" type="success" target="_blank" :download="item.file_name">{{ item.file_name }}</el-link>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div style="float: right">
|
|
|
<p>
|
|
|
- <span style="font-weight:bold">创建时间:</span>{{forDate(item.create_time)}}
|
|
|
- <span style="font-weight:bold;margin-left: 10px;">创建人:</span>{{item.create_name}}
|
|
|
+ <span style="font-weight:bold">创建时间:</span>{{ forDate(item.create_time) }}
|
|
|
+ <span style="font-weight:bold;margin-left: 10px;">创建人:</span>{{ item.create_name }}
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
<!--翻页-->
|
|
|
<el-pagination
|
|
|
- slot="pagination"
|
|
|
- v-if="pageData"
|
|
|
- :current-page="pageData.page_no"
|
|
|
- :page-sizes="[10, 30, 50, 100]"
|
|
|
- :page-size="pageData.page_size"
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
- @current-change="handlePageCurrentChange"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="pageData.data_total">
|
|
|
- </el-pagination>
|
|
|
+ v-if="pageData"
|
|
|
+ slot="pagination"
|
|
|
+ :current-page="pageData.page_no"
|
|
|
+ :page-sizes="[10, 30, 50, 100]"
|
|
|
+ :page-size="pageData.page_size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="pageData.data_total"
|
|
|
+ @size-change="handlePageSizeChange"
|
|
|
+ @current-change="handlePageCurrentChange"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
<el-dialog title="添加用户备注" :visible.sync="dialogAddVisible" :append-to-body="true" width="80%">
|
|
|
- <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="140px">
|
|
|
+ <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="140px">
|
|
|
<el-form-item label="内容">
|
|
|
<el-input
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 2, maxRows: 6}"
|
|
|
- :minlength="2"
|
|
|
- :maxlength="300"
|
|
|
- show-word-limit
|
|
|
- :placeholder="'请输入文本内容,长度300'"
|
|
|
- v-model="content">
|
|
|
- </el-input>
|
|
|
+ v-model="content"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2, maxRows: 6}"
|
|
|
+ :minlength="2"
|
|
|
+ :maxlength="300"
|
|
|
+ show-word-limit
|
|
|
+ :placeholder="'请输入文本内容,长度300'"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="复件">
|
|
|
- <el-upload v-if="!fileName"
|
|
|
- class="avatar-uploader"
|
|
|
- :action="`${uploadServer}/ncs/remark/upload`"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="uploaded"
|
|
|
- :before-upload="handleShopLogoBefore"
|
|
|
+ <el-upload
|
|
|
+ v-if="!fileName"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="`${uploadServer}/ncs/remark/upload`"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="uploaded"
|
|
|
+ :before-upload="handleShopLogoBefore"
|
|
|
>
|
|
|
<i class="el-icon-plus avatar-uploader-icon" />
|
|
|
</el-upload>
|
|
|
- <span v-if="fileName">{{fileName}}</span>
|
|
|
+ <span v-if="fileName">{{ fileName }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="addRemark">立即添加</el-button>
|
|
@@ -214,7 +215,7 @@
|
|
|
</el-dialog>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane v-if="customerId != 0" label="病人亲属" name="customer-relative">
|
|
|
- <customer-relative :member-id="memberId"></customer-relative>
|
|
|
+ <customer-relative :member-id="memberId" />
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
@@ -223,334 +224,333 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import * as customer_API from '@/api/ncs_customer'
|
|
|
- import * as clerk_API from '@/api/ncs_clerk'
|
|
|
- import * as NurseConfig_API from '@/api/ncs_nurseConfig'
|
|
|
- import * as remark_API from '@/api/ncs_remark'
|
|
|
- import * as RegExp from '@/utils/RegExp'
|
|
|
- import { unixToDate } from '@/utils/Foundation'
|
|
|
- import { serverUrl } from '@/utils/domain'
|
|
|
- import customerRelative from '@/views/customer/customer_relative'
|
|
|
+import * as customer_API from '@/api/ncs_customer'
|
|
|
+import * as clerk_API from '@/api/ncs_clerk'
|
|
|
+import * as NurseConfig_API from '@/api/ncs_nurseConfig'
|
|
|
+import * as remark_API from '@/api/ncs_remark'
|
|
|
+import * as RegExp from '@/utils/RegExp'
|
|
|
+import { unixToDate } from '@/utils/Foundation'
|
|
|
+import { serverUrl } from '@/utils/domain'
|
|
|
+import customerRelative from '@/views/customer/customer_relative'
|
|
|
|
|
|
- export default {
|
|
|
- components: { customerRelative },
|
|
|
- name: 'patientInfoEdit',
|
|
|
- props: {
|
|
|
- customerId: {
|
|
|
- type: Number,
|
|
|
- default: 0
|
|
|
- },
|
|
|
- frameId: {
|
|
|
- type: Number,
|
|
|
- default: 0
|
|
|
- }
|
|
|
+export default {
|
|
|
+ name: 'PatientInfoEdit',
|
|
|
+ components: { customerRelative },
|
|
|
+ props: {
|
|
|
+ customerId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
},
|
|
|
- data: function() {
|
|
|
- return {
|
|
|
- formmodel: {
|
|
|
- sex: 1,
|
|
|
- status: 0,
|
|
|
- age_unit: '岁',
|
|
|
- id_type: '身份证',
|
|
|
- part_id: this.$store.getters.partId
|
|
|
- },
|
|
|
- nurseList: [],
|
|
|
- nurseData: [],
|
|
|
- nurseConfigDtos: [],
|
|
|
- rules: {
|
|
|
- named: [
|
|
|
- this.MixinRequired('请输入真实姓名!'),
|
|
|
- { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
|
|
- {
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- if (!RegExp.userName.test(value)) {
|
|
|
- callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
+ frameId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ formmodel: {
|
|
|
+ sex: 1,
|
|
|
+ status: 0,
|
|
|
+ age_unit: '岁',
|
|
|
+ id_type: '身份证',
|
|
|
+ part_id: this.$store.getters.partId
|
|
|
+ },
|
|
|
+ nurseList: [],
|
|
|
+ nurseData: [],
|
|
|
+ nurseConfigDtos: [],
|
|
|
+ rules: {
|
|
|
+ named: [
|
|
|
+ this.MixinRequired('请输入真实姓名!'),
|
|
|
+ { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (!RegExp.userName.test(value)) {
|
|
|
+ callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
}
|
|
|
}
|
|
|
- ],
|
|
|
- age: [{
|
|
|
- required: true, message: '请输入年龄', trigger: 'blur'
|
|
|
- }],
|
|
|
- content: [{
|
|
|
- required: true, message: '请输入备注内容', trigger: 'blur'
|
|
|
- }],
|
|
|
- },
|
|
|
- isDisabled: false,
|
|
|
- doctors: [],
|
|
|
- nurses: [],
|
|
|
- workrs: [],
|
|
|
- doctor_mapping_id: false,
|
|
|
- nurse_Mapping_id: false,
|
|
|
- worker_mapping_id: false,
|
|
|
- params: {
|
|
|
- page_size: 10,
|
|
|
- page_no: 1,
|
|
|
- sort: 'create_time',
|
|
|
- dir: 'desc'
|
|
|
- },
|
|
|
- tableData: [],
|
|
|
- pageData: [],
|
|
|
- dialogAddVisible: false,
|
|
|
- fileName: null,
|
|
|
- filePath: null,
|
|
|
- uploadServer: serverUrl,
|
|
|
- userInfo: JSON.parse(this.$store.getters.userInfo),
|
|
|
- content: null,
|
|
|
- activeName: 'customerEdit',
|
|
|
- memberId: null
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getEmployees()
|
|
|
- if (this.nurseList.length === 0) {
|
|
|
- this.getNurseConfigs()
|
|
|
- this.hasCustomerId()
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- frameId: function(newval) {
|
|
|
- this.getNurseConfigs()
|
|
|
- this.hasCustomerId()
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- getEmployees() {
|
|
|
- let _this = this
|
|
|
- clerk_API.listByPartRoleId({partId: this.$store.getters.partId}).then(res => {
|
|
|
- const groupBy = (arr, func) =>
|
|
|
- arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
|
|
|
- acc[val] = (acc[val] || []).concat(arr[i]);
|
|
|
- return acc;
|
|
|
- }, {});
|
|
|
- let groupData = groupBy(res, item => item.role_name)
|
|
|
- if (Object.entries(groupData).length > 0) {
|
|
|
- Object.entries(groupData).forEach(item=> {
|
|
|
- if (item[0] === '医生') {
|
|
|
- _this.doctors = item[1]
|
|
|
- } else if (item[0] === '护士') {
|
|
|
- _this.nurses = item[1]
|
|
|
- } else if (item[0] === '护工'){
|
|
|
- _this.workrs = item[1]
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
- })
|
|
|
+ ],
|
|
|
+ age: [{
|
|
|
+ required: true, message: '请输入年龄', trigger: 'blur'
|
|
|
+ }],
|
|
|
+ content: [{
|
|
|
+ required: true, message: '请输入备注内容', trigger: 'blur'
|
|
|
+ }]
|
|
|
},
|
|
|
- getNurseConfigs() {
|
|
|
- this.nurseData = []
|
|
|
- let _this = this
|
|
|
- NurseConfig_API.listByPartId({partId: this.$store.getters.partId}).then(res => {
|
|
|
- const groupBy = (arr, func) =>
|
|
|
- arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
|
|
|
- acc[val] = (acc[val] || []).concat(arr[i]);
|
|
|
- return acc;
|
|
|
- }, {});
|
|
|
- // 以参数名称来分组
|
|
|
- let groupData = groupBy(res, item => item.config_name)
|
|
|
- _this.nurseList = Object.entries(groupData)
|
|
|
- console.log(_this.nurseList)
|
|
|
- if (_this.nurseList.length > 0) {
|
|
|
- _this.nurseList.forEach((item, index)=> {
|
|
|
- _this.nurseData.push({nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id})
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
+ isDisabled: false,
|
|
|
+ doctors: [],
|
|
|
+ nurses: [],
|
|
|
+ workrs: [],
|
|
|
+ doctor_mapping_id: false,
|
|
|
+ nurse_Mapping_id: false,
|
|
|
+ worker_mapping_id: false,
|
|
|
+ params: {
|
|
|
+ page_size: 10,
|
|
|
+ page_no: 1,
|
|
|
+ sort: 'create_time',
|
|
|
+ dir: 'desc'
|
|
|
},
|
|
|
- hasCustomerId() {
|
|
|
- this.clearForm()
|
|
|
- if (this.customerId !== 0) {
|
|
|
- let _this = this
|
|
|
- customer_API.getCustomerInfo(this.customerId).then(res => {
|
|
|
- _this.formmodel = res
|
|
|
- _this.doctor_mapping_id = res.doctor_mapping_id
|
|
|
- _this.nurse_Mapping_id = res.nurse_Mapping_id
|
|
|
- _this.worker_mapping_id = res.worker_mapping_id
|
|
|
- _this.formmodel.doctor_mapping_id = null
|
|
|
- _this.formmodel.nurse_Mapping_id = null
|
|
|
- _this.formmodel.worker_mapping_id = null
|
|
|
- _this.getRemarks()
|
|
|
- if (res.list !== null) {
|
|
|
- _this.nurseData.forEach((item, index)=> {
|
|
|
- res.list.forEach((t, i)=> { // 为护理项赋值
|
|
|
- if (item.nurse_config === t.nurse_config) {
|
|
|
- item.nurse_level = t.nurse_level
|
|
|
- item.id = t.id
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ tableData: [],
|
|
|
+ pageData: [],
|
|
|
+ dialogAddVisible: false,
|
|
|
+ fileName: null,
|
|
|
+ filePath: null,
|
|
|
+ uploadServer: serverUrl,
|
|
|
+ userInfo: JSON.parse(this.$store.getters.userInfo),
|
|
|
+ content: null,
|
|
|
+ activeName: 'customerEdit',
|
|
|
+ memberId: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ frameId: function(newval) {
|
|
|
+ this.getNurseConfigs()
|
|
|
+ this.hasCustomerId()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getEmployees()
|
|
|
+ if (this.nurseList.length === 0) {
|
|
|
+ this.getNurseConfigs()
|
|
|
+ this.hasCustomerId()
|
|
|
+ }
|
|
|
+ console.log('params',this.params)
|
|
|
+ },
|
|
|
|
|
|
+ methods: {
|
|
|
+ getEmployees() {
|
|
|
+ const _this = this
|
|
|
+ clerk_API.listByPartRoleId({ partId: this.$store.getters.partId }).then(res => {
|
|
|
+ const groupBy = (arr, func) =>
|
|
|
+ arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
|
|
|
+ acc[val] = (acc[val] || []).concat(arr[i])
|
|
|
+ return acc
|
|
|
+ }, {})
|
|
|
+ const groupData = groupBy(res, item => item.role_name)
|
|
|
+ if (Object.entries(groupData).length > 0) {
|
|
|
+ Object.entries(groupData).forEach(item => {
|
|
|
+ if (item[0] === '医生') {
|
|
|
+ _this.doctors = item[1]
|
|
|
+ } else if (item[0] === '护士') {
|
|
|
+ _this.nurses = item[1]
|
|
|
+ } else if (item[0] === '护工') {
|
|
|
+ _this.workrs = item[1]
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- },
|
|
|
- doctorChange(type) {
|
|
|
- if (this.customerId !== 0) {
|
|
|
- if (type === 1) {
|
|
|
- if (this.doctor_mapping_id === null) {
|
|
|
- this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
|
|
|
- } else {
|
|
|
- this.formmodel.doctor_mapping_id = this.doctor_mapping_id
|
|
|
- }
|
|
|
- } else if (type === 2) {
|
|
|
- if (this.nurse_Mapping_id === null) {
|
|
|
- this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
|
|
|
- } else {
|
|
|
- this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (this.worker_mapping_id === null) {
|
|
|
- this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
|
|
|
- } else {
|
|
|
- this.formmodel.worker_mapping_id = this.worker_mapping_id
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getNurseConfigs() {
|
|
|
+ this.nurseData = []
|
|
|
+ const _this = this
|
|
|
+ NurseConfig_API.listByPartId({ partId: this.$store.getters.partId }).then(res => {
|
|
|
+ const groupBy = (arr, func) =>
|
|
|
+ arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
|
|
|
+ acc[val] = (acc[val] || []).concat(arr[i])
|
|
|
+ return acc
|
|
|
+ }, {})
|
|
|
+ // 以参数名称来分组
|
|
|
+ const groupData = groupBy(res, item => item.config_name)
|
|
|
+ _this.nurseList = Object.entries(groupData)
|
|
|
+ console.log(_this.nurseList)
|
|
|
+ if (_this.nurseList.length > 0) {
|
|
|
+ _this.nurseList.forEach((item, index) => {
|
|
|
+ _this.nurseData.push({ nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id })
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- /** 保存按钮处理事件 */
|
|
|
- handlerSubmit(formName) {
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.isDisabled = true
|
|
|
- if (this.customerId === 0) {
|
|
|
- this.formmodel.frame_id = this.frameId
|
|
|
- this.formmodel.list = this.nurseConfigDtos
|
|
|
- customer_API.addAll(this.formmodel).then(res => {
|
|
|
- this.$message.success('添加成功!')
|
|
|
- this.clearForm()
|
|
|
- this.$emit('saved')
|
|
|
- }).catch( e =>{
|
|
|
- this.isDisabled = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.formmodel.list = this.nurseConfigDtos
|
|
|
- customer_API.updateAll(this.formmodel).then(res => {
|
|
|
- this.$message.success('修改成功!')
|
|
|
- this.isDisabled = false
|
|
|
- this.$emit('saved')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ hasCustomerId() {
|
|
|
+ this.clearForm()
|
|
|
+ if (this.customerId !== 0) {
|
|
|
+ const _this = this
|
|
|
+ customer_API.getCustomerInfo(this.customerId).then(res => {
|
|
|
+ _this.formmodel = res
|
|
|
+ _this.doctor_mapping_id = res.doctor_mapping_id
|
|
|
+ _this.nurse_Mapping_id = res.nurse_Mapping_id
|
|
|
+ _this.worker_mapping_id = res.worker_mapping_id
|
|
|
+ _this.formmodel.doctor_mapping_id = null
|
|
|
+ _this.formmodel.nurse_Mapping_id = null
|
|
|
+ _this.formmodel.worker_mapping_id = null
|
|
|
+ _this.getRemarks()
|
|
|
+ if (res.list !== null) {
|
|
|
+ _this.nurseData.forEach((item, index) => {
|
|
|
+ res.list.forEach((t, i) => { // 为护理项赋值
|
|
|
+ if (item.nurse_config === t.nurse_config) {
|
|
|
+ item.nurse_level = t.nurse_level
|
|
|
+ item.id = t.id
|
|
|
+ }
|
|
|
})
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$message.error('表单填写有误,请检查!')
|
|
|
- return false
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
- clearForm() {
|
|
|
- this.activeName = 'customerEdit'
|
|
|
- this.formmodel = {
|
|
|
- sex: 1,
|
|
|
- status: 0,
|
|
|
- age_unit: '岁',
|
|
|
- id_type: '身份证',
|
|
|
- part_id: this.$store.getters.partId,
|
|
|
- named: null,
|
|
|
- card_no: null,
|
|
|
- id_no: null,
|
|
|
- in_date: null,
|
|
|
- out_date: null,
|
|
|
- doctor_id: null,
|
|
|
- nurse_id: null,
|
|
|
- worker_id: null,
|
|
|
- illness_desc: null
|
|
|
- }
|
|
|
- this.isDisabled = false
|
|
|
- this.nurseConfigDtos = []
|
|
|
- },
|
|
|
- // 选择了护理项
|
|
|
- changeNurseData(index) {
|
|
|
- let i = this.nurseConfigDtos.findIndex(item => {
|
|
|
- return item.nurse_level === this.nurseData[index].nurse_level;
|
|
|
- })
|
|
|
- if (i !== -1) {
|
|
|
- this.nurseConfigDtos.splice(i,1)
|
|
|
- }
|
|
|
- this.nurseConfigDtos.push(this.nurseData[index])
|
|
|
- },
|
|
|
- getRemarks() {
|
|
|
- console.log('this.formmodel.member_id=', this.formmodel.member_id)
|
|
|
- let _this = this
|
|
|
- this.params.fixedCondition = ' part_id=' + this.$store.getters.partId + ' and type=1 and member_id = '+ this.formmodel.member_id
|
|
|
- remark_API.getRemarks(this.params).then(res=> {
|
|
|
- _this.tableData = res.data
|
|
|
- _this.pageData = {
|
|
|
- page_no: res.page_no,
|
|
|
- page_size: res.page_size,
|
|
|
- data_total: res.data_total
|
|
|
+ }
|
|
|
+ },
|
|
|
+ doctorChange(type) {
|
|
|
+ if (this.customerId !== 0) {
|
|
|
+ if (type === 1) {
|
|
|
+ if (this.doctor_mapping_id === null) {
|
|
|
+ this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
|
|
|
+ } else {
|
|
|
+ this.formmodel.doctor_mapping_id = this.doctor_mapping_id
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- /** 分页大小发生改变 */
|
|
|
- handlePageSizeChange(size) {
|
|
|
- this.params.page_size = size
|
|
|
- this.getRemarks()
|
|
|
- },
|
|
|
- /** 分页页数发生改变 */
|
|
|
- handlePageCurrentChange(page) {
|
|
|
- this.params.page_no = page
|
|
|
- this.getRemarks()
|
|
|
- },
|
|
|
- forDate(date) {
|
|
|
- return unixToDate(date)
|
|
|
- },
|
|
|
- /** 上传成功后的钩子 更换图片 置空存储数组*/
|
|
|
- uploaded(res) {
|
|
|
- this.filePath = serverUrl + '/' + res.file_path
|
|
|
- this.fileName = res.file_name
|
|
|
- },
|
|
|
- /** 图片上传之前的校验 */
|
|
|
- handleShopLogoBefore(file) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- let hz = file.name
|
|
|
- let index = hz .lastIndexOf(".");
|
|
|
- hz = hz .substring(index + 1, hz .length);
|
|
|
- console.log(hz)
|
|
|
- const isImg = hz === 'jpeg' || hz === 'png' || hz === 'jpg' || hz === 'txt' || hz === 'doc' || hz === 'docx' || hz === 'xls' || hz === 'xlsx'
|
|
|
- const isLt5M = file.size / 1024 / 1024 < 5
|
|
|
- if (!isImg) {
|
|
|
- this.$message.error('上传复件只能是txt,doc,docx,xls,xlsx,jpg,png,jpeg格式!')
|
|
|
- reject()
|
|
|
+ } else if (type === 2) {
|
|
|
+ if (this.nurse_Mapping_id === null) {
|
|
|
+ this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
|
|
|
+ } else {
|
|
|
+ this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
|
|
|
}
|
|
|
- if (!isLt5M) {
|
|
|
- this.$message.error('上传复件大小不能超过 5MB!')
|
|
|
- reject()
|
|
|
+ } else {
|
|
|
+ if (this.worker_mapping_id === null) {
|
|
|
+ this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
|
|
|
+ } else {
|
|
|
+ this.formmodel.worker_mapping_id = this.worker_mapping_id
|
|
|
}
|
|
|
- resolve()
|
|
|
- })
|
|
|
- },
|
|
|
- addRemark() {
|
|
|
- const data = {
|
|
|
- partId: this.$store.getters.partId,
|
|
|
- type: 1,
|
|
|
- memberId: this.formmodel.member_id,
|
|
|
- createName: this.userInfo.username,
|
|
|
- content: this.content,
|
|
|
- filePath: this.filePath,
|
|
|
- fileName: this.fileName
|
|
|
}
|
|
|
- let _this = this
|
|
|
- remark_API.save(data).then(res=> {
|
|
|
- _this.$message.success('添加成功!')
|
|
|
- _this.getRemarks()
|
|
|
- _this.quxiao()
|
|
|
- })
|
|
|
- },
|
|
|
- quxiao(){
|
|
|
- this.dialogAddVisible = false
|
|
|
- this.content = null
|
|
|
- this.fileName = null
|
|
|
- this.filePath = null
|
|
|
- },
|
|
|
- handleClick(tab) {
|
|
|
- this.memberId = this.formmodel.member_id
|
|
|
}
|
|
|
+ },
|
|
|
+ /** 保存按钮处理事件 */
|
|
|
+ handlerSubmit(formName) {
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.isDisabled = true
|
|
|
+ if (this.customerId === 0) {
|
|
|
+ this.formmodel.frame_id = this.frameId
|
|
|
+ this.formmodel.list = this.nurseConfigDtos
|
|
|
+ customer_API.addAll(this.formmodel).then(res => {
|
|
|
+ this.$message.success('添加成功!')
|
|
|
+ this.clearForm()
|
|
|
+ this.$emit('saved')
|
|
|
+ }).catch(e => {
|
|
|
+ this.isDisabled = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.formmodel.list = this.nurseConfigDtos
|
|
|
+ customer_API.updateAll(this.formmodel).then(res => {
|
|
|
+ this.$message.success('修改成功!')
|
|
|
+ this.isDisabled = false
|
|
|
+ this.$emit('saved')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error('表单填写有误,请检查!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ clearForm() {
|
|
|
+ this.activeName = 'customerEdit'
|
|
|
+ this.formmodel = {
|
|
|
+ sex: 1,
|
|
|
+ status: 0,
|
|
|
+ age_unit: '岁',
|
|
|
+ id_type: '身份证',
|
|
|
+ part_id: this.$store.getters.partId,
|
|
|
+ named: null,
|
|
|
+ card_no: null,
|
|
|
+ id_no: null,
|
|
|
+ in_date: null,
|
|
|
+ out_date: null,
|
|
|
+ doctor_id: null,
|
|
|
+ nurse_id: null,
|
|
|
+ worker_id: null,
|
|
|
+ illness_desc: null
|
|
|
+ }
|
|
|
+ this.isDisabled = false
|
|
|
+ this.nurseConfigDtos = []
|
|
|
+ },
|
|
|
+ // 选择了护理项
|
|
|
+ changeNurseData(index) {
|
|
|
+ const i = this.nurseConfigDtos.findIndex(item => {
|
|
|
+ return item.nurse_level === this.nurseData[index].nurse_level
|
|
|
+ })
|
|
|
+ if (i !== -1) {
|
|
|
+ this.nurseConfigDtos.splice(i, 1)
|
|
|
+ }
|
|
|
+ this.nurseConfigDtos.push(this.nurseData[index])
|
|
|
+ },
|
|
|
+ getRemarks() {
|
|
|
+ console.log('this.formmodel.member_id=', this.formmodel.member_id)
|
|
|
+ const _this = this
|
|
|
+ console.log('this',_this.params)
|
|
|
+ this.params.fixedCondition = ' part_id=' + this.$store.getters.partId + ' and type=1 and member_id = ' + this.formmodel.member_id
|
|
|
+ remark_API.getRemarks(this.params).then(res => {
|
|
|
+ _this.tableData = res.data
|
|
|
+ _this.pageData = {
|
|
|
+ page_no: res.page_no,
|
|
|
+ page_size: res.page_size,
|
|
|
+ data_total: res.data_total
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 分页大小发生改变 */
|
|
|
+ handlePageSizeChange(size) {
|
|
|
+ this.params.page_size = size
|
|
|
+ this.getRemarks()
|
|
|
+ },
|
|
|
+ /** 分页页数发生改变 */
|
|
|
+ handlePageCurrentChange(page) {
|
|
|
+ this.params.page_no = page
|
|
|
+ this.getRemarks()
|
|
|
+ },
|
|
|
+ forDate(date) {
|
|
|
+ return unixToDate(date)
|
|
|
+ },
|
|
|
+ /** 上传成功后的钩子 更换图片 置空存储数组*/
|
|
|
+ uploaded(res) {
|
|
|
+ this.filePath = serverUrl + '/' + res.file_path
|
|
|
+ this.fileName = res.file_name
|
|
|
+ },
|
|
|
+ /** 图片上传之前的校验 */
|
|
|
+ handleShopLogoBefore(file) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let hz = file.name
|
|
|
+ const index = hz.lastIndexOf('.')
|
|
|
+ hz = hz.substring(index + 1, hz.length)
|
|
|
+ console.log(hz)
|
|
|
+ const isImg = hz === 'jpeg' || hz === 'png' || hz === 'jpg' || hz === 'txt' || hz === 'doc' || hz === 'docx' || hz === 'xls' || hz === 'xlsx'
|
|
|
+ const isLt5M = file.size / 1024 / 1024 < 5
|
|
|
+ if (!isImg) {
|
|
|
+ this.$message.error('上传复件只能是txt,doc,docx,xls,xlsx,jpg,png,jpeg格式!')
|
|
|
+ reject()
|
|
|
+ }
|
|
|
+ if (!isLt5M) {
|
|
|
+ this.$message.error('上传复件大小不能超过 5MB!')
|
|
|
+ reject()
|
|
|
+ }
|
|
|
+ resolve()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addRemark() {
|
|
|
+ const data = {
|
|
|
+ partId: this.$store.getters.partId,
|
|
|
+ type: 1,
|
|
|
+ memberId: this.formmodel.member_id,
|
|
|
+ createName: this.userInfo.username,
|
|
|
+ content: this.content,
|
|
|
+ filePath: this.filePath,
|
|
|
+ fileName: this.fileName
|
|
|
+ }
|
|
|
+ const _this = this
|
|
|
+ remark_API.save(data).then(res => {
|
|
|
+ _this.$message.success('添加成功!')
|
|
|
+ _this.getRemarks()
|
|
|
+ _this.quxiao()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ quxiao() {
|
|
|
+ this.dialogAddVisible = false
|
|
|
+ this.content = null
|
|
|
+ this.fileName = null
|
|
|
+ this.filePath = null
|
|
|
+ },
|
|
|
+ handleClick(tab) {
|
|
|
+ this.memberId = this.formmodel.member_id
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style type="text/scss" scoped>
|