Commit 1f13500e authored by 刘怀志's avatar 刘怀志

挂号管理药品相关

parent 1a3c2bf8
...@@ -99,3 +99,26 @@ export function drugList(params) { ...@@ -99,3 +99,26 @@ export function drugList(params) {
params params
}) })
} }
// 编辑药品
export function updateDrug(data) {
return request({
url: '/finance/stock/outbound',
method: 'put',
data
})
}
// 新增药品
export function addDrug(data) {
return request({
url: '/finance/stock/outbound',
method: 'post',
data
})
}
// 删除药品
export function deleteDrug(id) {
return request({
url: '/finance/stock/outbound/{id}' + id,
method: 'delete'
})
}
...@@ -448,47 +448,102 @@ color: #333333;" ...@@ -448,47 +448,102 @@ color: #333333;"
class="fourWordsBtn" class="fourWordsBtn"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
size="mini" size="mini"
@click="handleAdd('petProtect')" @click="handleAdd('stockDispenseOutboundList')"
>新增用药 >新增用药
</el-button> </el-button>
</div> </div>
<!-- 内部信息 --> <!-- 内部信息 -->
<div class="table-content"> <div class="table-content">
<el-form ref="drugForm" :model="drugForm" hide-required-asterisk :rules="drugRules" class="demo-ruleForm" label-width="0"> <el-form ref="drugForm" :model="drugForm" hide-required-asterisk :rules="drugRules" class="demo-ruleForm" label-width="0">
<el-table :data="petProtect" :header-cell-style="{ background:'#F4F4F4'}" border> <el-table :data="stockDispenseOutboundList" :header-cell-style="{ background:'#F4F4F4'}" border>
<el-table-column align="center" label="药品名称" prop="protectName"> <el-table-column align="center" label="药品名称" prop="drugName">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
v-if="scope.row.inputShow" v-if="scope.row.inputShow"
:prop="'tableData.'+scope.$index+'.protectName'" :prop="'tableData.'+scope.$index+'.drugName'"
:rules="drugRules.protectName" :rules="drugRules.drugName"
> >
<el-select <el-select
v-model="scope.row.protectName" v-model="scope.row.drugId"
clearable clearable
:placeholder="isEdit? '请选择药品名称' : '暂无数据'" :placeholder="isEdit? '请选择药品名称' : '暂无数据'"
style="width: 100%"
@change="setDrugOthers(scope.row,drugOptions)"
> >
<el-option <el-option
v-for="(item, index) in drugList" v-for="item in drugOptions"
:key="index" :key="item.drugId"
:label="item.dictLabel" :label="item.drugName"
:value="String(item.dictCode)" :value="item.drugId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<span <span
v-else v-else
>{{ >{{
scope.row.protectName === '' || scope.row.protectName === null ? '-' : scope.row.protectName scope.row.drugName === '' || scope.row.drugName === null ? '-' : scope.row.drugName
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="开药日期" prop="date" >
<el-table-column align="center" label="规格" prop="type" /> <template slot-scope="scope">
<el-table-column align="center" label="数量" prop="date" /> <span v-if="scope.row.inputShow">-</span>
<el-table-column align="center" label="用法" prop="date" /> <span v-else>
<el-table-column align="center" label="开药日期" prop="date" /> {{ scope.row.checkStartTime ? scope.row.checkStartTime : '-' }}
<el-table-column align="center" label="缴费状态" prop="date" /> </span>
</template>
</el-table-column>
<el-table-column align="center" label="处方数量" prop="recipelNum" >
<template slot-scope="scope">
<el-form-item
v-if="scope.row.inputShow"
:prop="'tableData.'+scope.$index+'.recipelNum'"
:rules="drugRules.recipelNum"
>
<el-input
v-model="scope.row.recipelNum"
/>
</el-form-item>
<span v-else>
{{ scope.row.recipelNum ? scope.row.recipelNum : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="用法" prop="remark" >
<template slot-scope="scope">
<el-form-item
v-if="scope.row.inputShow"
:prop="'tableData.'+scope.$index+'.remark'"
:rules="drugRules.remark"
>
<el-input
v-model="scope.row.remark"
/>
</el-form-item>
<span v-else>
{{ scope.row.remark ? scope.row.remark : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="取药状态" prop="checkSchedule">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<span v-else>
{{ scope.row.checkStatus ? (scope.row.checkStatus === '3' ? '已取药' : '待取药') : '-' }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="缴费状态" prop="payType">
<template slot-scope="scope">
<span v-if="scope.row.inputShow">-</span>
<dict-tag
v-else
:options="dict.type.payment_status"
:value="scope.row.paymentStatus"
class="content-style"
/>
</template>
</el-table-column>
<el-table-column <el-table-column
v-if="isEdit" v-if="isEdit"
align="center" align="center"
...@@ -499,47 +554,43 @@ color: #333333;" ...@@ -499,47 +554,43 @@ color: #333333;"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="!isEdit || (scope.row.payType !== '0' && !scope.row.isAdd)" v-if="!isEdit || (scope.row.paymentStatus !== '0' && !scope.row.isAdd)"
v-hasPermi="['business:record:edit']"
icon="el-icon-document" icon="el-icon-document"
plain plain
size="mini" size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);" style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success" type="success"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row, 'stockDispenseOutboundList')"
>查看 >查看
</el-button> </el-button>
<el-button <el-button
v-if="isEdit && scope.row.payType === '0' && !scope.row.inputShow" v-if="isEdit && scope.row.paymentStatus === '0' && !scope.row.inputShow"
v-hasPermi="['business:record:edit']"
icon="el-icon-edit" icon="el-icon-edit"
plain plain
size="mini" size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);" style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary" type="primary"
@click="handleUpdate(scope.$index,'petProtect')" @click="handleUpdate(scope.$index,'stockDispenseOutboundList')"
>编辑 >编辑
</el-button> </el-button>
<el-button <el-button
v-if="isEdit && (scope.row.payType === '0'|| scope.row.isAdd ) && scope.row.inputShow" v-if="isEdit && (scope.row.paymentStatus === '0'|| scope.row.isAdd ) && scope.row.inputShow"
v-hasPermi="['business:case:save']"
icon="el-icon-edit" icon="el-icon-edit"
plain plain
size="mini" size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);" style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary" type="primary"
@click="handleSave('drugForm','petProtect', scope.$index)" @click="handleSave('checkForm','stockDispenseOutboundList', scope.$index)"
>保存 >保存
</el-button> </el-button>
<el-button <el-button
v-if="isEdit && scope.row.payType === '0' && !scope.row.inputShow" v-if="isEdit && scope.row.paymentStatus === '0' && !scope.row.inputShow"
v-hasPermi="['business:record:edit']"
icon="el-icon-document" icon="el-icon-document"
plain plain
size="mini" size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(155,0,65);" style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(155,0,65);"
type="danger" type="danger"
@click="handleDetail(scope.row)" @click="handleDelRow(scope.row, 'stockDispenseOutboundList')"
>删除 >删除
</el-button> </el-button>
</template> </template>
...@@ -1155,7 +1206,7 @@ import { ...@@ -1155,7 +1206,7 @@ import {
getRecord, getRecord,
getTreatOptions, getTreatOptions,
listByType, listByType,
updateCheck, editRecord, getRecordPayment updateCheck, editRecord, getRecordPayment, drugList, updateDrug, deleteDrug, addDrug
} from '@/api/business/mdeicalRecord' } from '@/api/business/mdeicalRecord'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { addHospital, delHospital, listHospital, updateHospitalRecord } from '@/api/business/inHospital' import { addHospital, delHospital, listHospital, updateHospitalRecord } from '@/api/business/inHospital'
...@@ -1170,6 +1221,7 @@ export default { ...@@ -1170,6 +1221,7 @@ export default {
}, },
data() { data() {
return { return {
drugOptions: [], // 药品列表
// 是否显示检查弹窗flag // 是否显示检查弹窗flag
isShowCheckReport: false, isShowCheckReport: false,
// 报告链接 // 报告链接
...@@ -1235,6 +1287,15 @@ export default { ...@@ -1235,6 +1287,15 @@ export default {
{ required: true, message: '请选择检查类型', trigger: 'change' } { required: true, message: '请选择检查类型', trigger: 'change' }
] ]
}, },
// 检查信息表单校验
drugRules: {
drugName: [
{ required: true, message: '请选择药品', trigger: 'change' }
],
recipelNum: [
{ required: true, message: '请输入药品数量', trigger: 'blur' }
]
},
// 进度 // 进度
scheduleKey: { checkSchedule: '', diagnosisTime: '', registrationTime: '', reportTime: '', recipelTime: '' }, scheduleKey: { checkSchedule: '', diagnosisTime: '', registrationTime: '', reportTime: '', recipelTime: '' },
// 宠物出生日期校验 // 宠物出生日期校验
...@@ -1247,16 +1308,17 @@ export default { ...@@ -1247,16 +1308,17 @@ export default {
treatItemOptions: [], // 治疗项目选项列表 treatItemOptions: [], // 治疗项目选项列表
checkManageBos: [], // 检查列表数据 checkManageBos: [], // 检查列表数据
treatManageBo: [], // 治疗列表数据 treatManageBo: [], // 治疗列表数据
stockDispenseOutboundList: [], // 药品列表数据
editCunt: { editCunt: {
petProtect: 0, petProtect: 0,
checkManageBos: 0, checkManageBos: 0,
treatManageBo: 0, treatManageBo: 0,
inHospitalBos: 0 inHospitalBos: 0,
stockDispenseOutboundList: 0
}, },
drugList: [], // 药品列表 drugList: [], // 药品列表
map: {}, map: {},
drugForm: {}, // 用药管理table编辑 drugForm: {}, // 用药管理table编辑
drugRules: {},
checkForm: {}, // 检查table编辑 checkForm: {}, // 检查table编辑
treatForm: {}, // 治疗table编辑 treatForm: {}, // 治疗table编辑
treatRules: {}, treatRules: {},
...@@ -1381,32 +1443,53 @@ export default { ...@@ -1381,32 +1443,53 @@ export default {
this.getDetail() this.getDetail()
this.getTreatItemOptions() this.getTreatItemOptions()
this.getPaymentList() this.getPaymentList()
this.getDrugList()
}, },
methods: { methods: {
getDrugList() {
drugList({ status: '1' }).then(res => {
console.log('drugList', res)
this.drugOptions = res.data.map(item => {
return {
drugName: item.name,
drugId: item.id,
brand: item.brand,
giveWay: item.giveWay,
sallUnit: item.smallSallNormsUnit,
sallNum: item.smallSallNormsNum,
standardAmount: item.sellingPrice,
paymentStatus: '0'
}
})
console.log('drugOptions!!!!!!!!!!!!!', this.drugOptions)
}).catch(err => {
console.log('drugListERR', err)
})
},
/** /**
* @Description: 关闭报告弹窗 * @Description: 关闭报告弹窗
* @Author: 刘 * @Author: 刘
* @Date: 2023-07-06 16:54:22 * @Date: 2023-07-06 16:54:22
*/ */
closeReportModle() { closeReportModle() {
this.isShowCheckReport = false this.isShowCheckReport = false
this.checkReportUrl = '' this.checkReportUrl = ''
}, },
/** /**
* @Description: 显示报告弹出框 * @Description: 显示报告弹出框
* @Author: 刘 * @Author: 刘
* @Date: 2023-07-06 16:42:47 * @Date: 2023-07-06 16:42:47
*/ */
showShadowReport(url) { showShadowReport(url) {
console.log(url) console.log(url)
this.isShowCheckReport = true this.isShowCheckReport = true
this.checkReportUrl = process.env.VUE_APP_TEST_API + url this.checkReportUrl = process.env.VUE_APP_TEST_API + url
}, },
/** /**
* @Description: 查看详情 * @Description: 查看详情
* @Author: 刘 * @Author: 刘
* @Date: 2023-07-06 14:46:32 * @Date: 2023-07-06 14:46:32
*/ */
handleDetail(row, type) { handleDetail(row, type) {
if (type === 'checkManageBos') { if (type === 'checkManageBos') {
this.$router.push({ this.$router.push({
...@@ -1521,6 +1604,22 @@ export default { ...@@ -1521,6 +1604,22 @@ export default {
} }
}) })
}, },
// 设置当前行药品其余属性
setDrugOthers(rowData, options) {
console.log('setDrugOthers', rowData, options)
options.forEach(item => {
if (item.drugId.toString() === rowData.drugId) {
rowData['drugName'] = item.drugName
rowData['brand'] = item.brand
rowData['giveWay'] = item.giveWay
rowData['sallUnit'] = item.sallUnit
rowData['sallNum'] = item.sallNum
rowData['standardAmount'] = item.standardAmount
rowData['paymentStatus'] = item.paymentStatus
}
})
console.log('finishSetDrugOthers', rowData)
},
// 设置当前行治疗名称 // 设置当前行治疗名称
setTreatItemsName(rowData, options) { setTreatItemsName(rowData, options) {
console.log('setTreatItemsName', rowData, options) console.log('setTreatItemsName', rowData, options)
...@@ -1568,7 +1667,7 @@ export default { ...@@ -1568,7 +1667,7 @@ export default {
getDetail(type = 'usual') { getDetail(type = 'usual') {
getRecord(this.$route.params.id).then(response => { getRecord(this.$route.params.id).then(response => {
console.log('这是病历管理的详情内容,我要调取!', response) console.log('这是病历管理的详情内容,我要调取!', response)
this.recordDetail = response.data this.recordDetail = JSON.parse(JSON.stringify(response.data))
// 主键 // 主键
this.scheduleKey.checkSchedule = response.data.checkSchedule this.scheduleKey.checkSchedule = response.data.checkSchedule
// 挂号时间 // 挂号时间
...@@ -1589,10 +1688,19 @@ export default { ...@@ -1589,10 +1688,19 @@ export default {
item['inputShow'] = false item['inputShow'] = false
item['isAdd'] = false item['isAdd'] = false
}) })
if (response.data.stockDispenseOutboundList) {
response.data.stockDispenseOutboundList.forEach(item => {
item['inputShow'] = false
item['isAdd'] = false
})
}
this.checkManageBos = [] this.checkManageBos = []
this.treatManageBo = [] this.treatManageBo = []
this.stockDispenseOutboundList = []
this.checkManageBos.push(...response.data.checkManageBos) this.checkManageBos.push(...response.data.checkManageBos)
this.treatManageBo.push(...response.data.treatManageBo) this.treatManageBo.push(...response.data.treatManageBo)
this.stockDispenseOutboundList.push(...response.data.stockDispenseOutboundList)
// this.stockDispenseOutboundList = [{ 'inputShow': false, 'isAdd': false, 'drugName': '红霉素3', 'brand': '康恩贝', 'drugId': 11, 'giveWay': '1', 'sallUnit': null, 'sallNum': null, 'standardAmount': 19, 'paymentStatus': '0', 'recipelNum': 1, 'remarks': '2' }, { 'inputShow': false, 'isAdd': false, 'drugName': '红霉素2', 'brand': '康恩贝', 'drugId': 10, 'giveWay': '1', 'sallUnit': null, 'sallNum': null, 'standardAmount': 19, 'paymentStatus': '0', 'recipelNum': 2, 'remarks': '3' }]
if (type !== 'update') { if (type !== 'update') {
this.petInfo = { ...response.data } this.petInfo = { ...response.data }
this.detailInfo = { ...response.data } this.detailInfo = { ...response.data }
...@@ -1648,6 +1756,14 @@ export default { ...@@ -1648,6 +1756,14 @@ export default {
}) })
this.getDetail('update') this.getDetail('update')
}) })
} else if (tableName === 'stockDispenseOutboundList') {
deleteDrug(rowData.id).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getDetail('update')
})
} }
}).catch(() => { }).catch(() => {
}) })
...@@ -1681,6 +1797,21 @@ export default { ...@@ -1681,6 +1797,21 @@ export default {
inputShow: true, inputShow: true,
isAdd: true isAdd: true
}) })
} else if (tableName === 'stockDispenseOutboundList') {
this[tableName].unshift({
drugName: '',
brand: '',
drugId: '',
giveWay: '',
sallUnit: '',
sallNum: '',
standardAmount: '',
paymentStatus: '',
recipelNum: '',
remark: '',
inputShow: true,
isAdd: true
})
} }
this.editCunt[tableName] += 1 this.editCunt[tableName] += 1
} else { } else {
...@@ -1789,6 +1920,38 @@ export default { ...@@ -1789,6 +1920,38 @@ export default {
this.getDetail('update') this.getDetail('update')
}) })
} }
} else if (listName === 'stockDispenseOutboundList') {
// 治疗信息保存-- 新增保存 编辑保存
if (this[listName][index].isAdd) { // 新增保存
const temp = {
id: rowData.id,
drugId: rowData.drugId,
recipelNum: rowData.recipelNum,
remark: rowData.remark,
registId: this.petInfo.registId,
medicalRecordId: this.petInfo.id
}
addDrug(temp).then(() => {
this.$message.success('保存成功')
// 刷新治疗信息列表
// this.getTreatList()
this.getDetail('update')
})
} else {
const temp = {
id: rowData.id,
drugId: rowData.drugId,
recipelNum: rowData.recipelNum,
remark: rowData.remark
}
// 编辑保存
updateDrug(temp).then(() => {
this.$message.success('保存成功')
// 刷新治疗信息列表
// this.getTreatList()
this.getDetail('update')
})
}
} }
this[listName][index].inputShow = false this[listName][index].inputShow = false
this.editCunt[listName] -= 1 this.editCunt[listName] -= 1
...@@ -2070,7 +2233,7 @@ export default { ...@@ -2070,7 +2233,7 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
} }
.el-form-item.petBreed { .el-form-item.petBreed {
......
...@@ -203,6 +203,7 @@ ...@@ -203,6 +203,7 @@
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
>详情 >详情
</el-button> </el-button>
<!-- :disabled="checkRole(['pt-admin']) || scope.row.isUpdate === '1'"-->
<el-button <el-button
v-hasPermi="['business:record:edit']" v-hasPermi="['business:record:edit']"
:disabled="checkRole(['pt-admin']) || scope.row.isUpdate === '1'" :disabled="checkRole(['pt-admin']) || scope.row.isUpdate === '1'"
......
...@@ -171,9 +171,9 @@ ...@@ -171,9 +171,9 @@
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
<el-form-item label="sig" prop="remarks "> <el-form-item label="sig" prop="remark">
<el-input <el-input
v-model="singleItem.remarks " v-model="singleItem.remark"
placeholder="请输入具体用法" placeholder="请输入具体用法"
/> />
</el-form-item> </el-form-item>
...@@ -402,7 +402,7 @@ export default { ...@@ -402,7 +402,7 @@ export default {
standardAmount: '', standardAmount: '',
paymentStatus: '', paymentStatus: '',
recipelNum: '', recipelNum: '',
remarks: '' remark: ''
} }
], ],
inspect: [ inspect: [
...@@ -695,7 +695,7 @@ export default { ...@@ -695,7 +695,7 @@ export default {
standardAmount: '', standardAmount: '',
paymentStatus: '', paymentStatus: '',
recipelNum: '', recipelNum: '',
remarks: '' remark: ''
} }
break break
case 'inspect': case 'inspect':
......
...@@ -199,6 +199,7 @@ ...@@ -199,6 +199,7 @@
<el-button <el-button
icon="el-icon-paperclip" icon="el-icon-paperclip"
plain plain
:disabled="scope.row.isAdd === '1'"
size="mini" size="mini"
style="width: 70px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(255,157,78);" style="width: 70px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(255,157,78);"
type="warning" type="warning"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment