dev
This commit is contained in:
parent
99e7985ab9
commit
51c11beda3
|
|
@ -0,0 +1,215 @@
|
||||||
|
<template>
|
||||||
|
<Mask :top="50" :height="650" :width="900" :is-show="show">
|
||||||
|
<CloseBtn @click="show = false"></CloseBtn>
|
||||||
|
<el-card>
|
||||||
|
<template #header>
|
||||||
|
<div class="header">追溯码采集</div>
|
||||||
|
</template>
|
||||||
|
<div class="detail">
|
||||||
|
<el-input placeholder="请输入追溯码" v-model="inputIdCode" clearable @keydown.enter="openAssociationIdCode()">
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon>
|
||||||
|
<Monitor/>
|
||||||
|
</el-icon>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
<div class="list">
|
||||||
|
<table class="simple-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>发药项目</th>
|
||||||
|
<th>产品标识码</th>
|
||||||
|
<th>发药数量</th>
|
||||||
|
<th>已采/应采</th>
|
||||||
|
<th>追溯码</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(item,index) in list" :key="index">
|
||||||
|
<td>{{ item.name }}</td>
|
||||||
|
<td>
|
||||||
|
<IdCodeListShow :idCodeList="item.idCode" v-if="item.idCode.length>0"/>
|
||||||
|
<div v-else>未关联</div>
|
||||||
|
</td>
|
||||||
|
<td>{{ item.retailNumber }}{{ item.selectedUnit }}</td>
|
||||||
|
<td>{{ item.gatherNumber }}/{{ item.retailNumber }}</td>
|
||||||
|
<td>
|
||||||
|
<TraceabilityCodeAdd :item="item"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="bottom-btn">
|
||||||
|
<el-button @click="saveRetail()" type="primary">确定</el-button>
|
||||||
|
<el-button @click="show = false">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-card>
|
||||||
|
<AssociationIdCode ref="associationIdCodeRef" @addIdCode="cleanInputIdCode"></AssociationIdCode>
|
||||||
|
</Mask>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import Mask from "@/components/Mask.vue";
|
||||||
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
import {nextTick, ref} from "vue";
|
||||||
|
import IdCodeListShow from "@/components/retail/IdCodeListShow.vue";
|
||||||
|
import AssociationIdCode from "@/components/retail/AssociationIdCode.vue";
|
||||||
|
import TraceabilityCodeAdd from "@/components/retail/TraceabilityCodeAdd.vue";
|
||||||
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
|
import {post} from "@/utils/request.ts";
|
||||||
|
|
||||||
|
|
||||||
|
const show = ref(false)
|
||||||
|
const list = ref()
|
||||||
|
const orderInfo = ref()
|
||||||
|
const init = (data: any) => {
|
||||||
|
list.value = data
|
||||||
|
console.log(list)
|
||||||
|
show.value = true
|
||||||
|
}
|
||||||
|
const close = () => {
|
||||||
|
show.value = false
|
||||||
|
}
|
||||||
|
defineExpose({init, close})
|
||||||
|
const emit = defineEmits(['confirm'])
|
||||||
|
const saveRetail = () => {
|
||||||
|
if (!checkTraceCode()) {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
`追溯码采集未完成是否继续?`,
|
||||||
|
'Warning',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}).then(() => {
|
||||||
|
emit('confirm')
|
||||||
|
})
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
emit('confirm')
|
||||||
|
}
|
||||||
|
const checkTraceCode = () => {
|
||||||
|
for (let i = 0; i < list.value.length; i++) {
|
||||||
|
const item = list.value[i];
|
||||||
|
if (item.gatherNumber !== item.retailNumber) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const inputIdCode = ref()
|
||||||
|
const associationIdCodeRef = ref()
|
||||||
|
const openAssociationIdCode = () => {
|
||||||
|
if (addTraceAbilityCode()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nextTick(() => {
|
||||||
|
associationIdCodeRef.value.init(inputIdCode.value, list.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const addTraceAbilityCode = () => {
|
||||||
|
for (let i = 0; i < list.value.length; i++) {
|
||||||
|
let item = list.value[i];
|
||||||
|
let idCode = inputIdCode.value.slice(0, 7);
|
||||||
|
if (item.idCode.includes(idCode)) {
|
||||||
|
addTraceabilityCodeDo(item);
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const addTraceabilityCodeDo = (item: any) => {
|
||||||
|
if (!item.traceAbilityCodeList) {
|
||||||
|
item.traceAbilityCodeList = []
|
||||||
|
}
|
||||||
|
if (item.retailNumber == item.gatherNumber) {
|
||||||
|
ElMessage({
|
||||||
|
message: '采集数量已满',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const index = item.traceAbilityCodeList.findIndex((codeObj: any) => codeObj.code === inputIdCode.value);
|
||||||
|
if (index == -1 && item.selectedUnit == item.packagingUnit) {
|
||||||
|
item.traceAbilityCodeList.push({
|
||||||
|
code: inputIdCode.value,
|
||||||
|
number: 1
|
||||||
|
})
|
||||||
|
cleanInputIdCode()
|
||||||
|
getGatherNumber(item)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (index == -1 && item.selectedUnit == item.minPackagingUnit) {
|
||||||
|
|
||||||
|
let needCodeCount = item.retailNumber - item.gatherNumber;
|
||||||
|
let number = 1;
|
||||||
|
if (needCodeCount >= item.minPackagingNumber) {
|
||||||
|
number = item.minPackagingNumber;
|
||||||
|
}
|
||||||
|
if (needCodeCount < item.minPackagingNumber) {
|
||||||
|
number = needCodeCount;
|
||||||
|
}
|
||||||
|
item.traceAbilityCodeList.push({
|
||||||
|
code: inputIdCode.value,
|
||||||
|
number: number
|
||||||
|
})
|
||||||
|
cleanInputIdCode()
|
||||||
|
getGatherNumber(item)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (item.selectedUnit == item.packagingUnit) {
|
||||||
|
//没拆零 追溯码只能用一次
|
||||||
|
ElMessage({
|
||||||
|
message: '该追溯码已达到最大使用限制',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
//拆零每一个追溯码最多使用minPackagingNumber次
|
||||||
|
if (item.traceAbilityCodeList[index].number == item.minPackagingNumber) {
|
||||||
|
ElMessage({
|
||||||
|
message: '该追溯码已达到最大使用限制',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.traceAbilityCodeList[index].number += 1;
|
||||||
|
}
|
||||||
|
cleanInputIdCode()
|
||||||
|
getGatherNumber(item)
|
||||||
|
console.log("item", item)
|
||||||
|
}
|
||||||
|
const getGatherNumber = (item: any) => {
|
||||||
|
let gatherNumber = 0;
|
||||||
|
for (let subItem of item.traceAbilityCodeList) {
|
||||||
|
gatherNumber += subItem.number;
|
||||||
|
}
|
||||||
|
item.gatherNumber = gatherNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cleanInputIdCode = () => {
|
||||||
|
inputIdCode.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.header {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail {
|
||||||
|
.list {
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -2,17 +2,17 @@
|
||||||
import Panel from '../common/Panel.vue';
|
import Panel from '../common/Panel.vue';
|
||||||
import {defineEmits, defineModel,defineProps} from 'vue'
|
import {defineEmits, defineModel,defineProps} from 'vue'
|
||||||
const {status}=defineProps(['status'])
|
const {status}=defineProps(['status'])
|
||||||
const emit = defineEmits(['save','deleteItem','edit']);
|
const emit = defineEmits(['save','deleteItem','edit','openCheckOut']);
|
||||||
const save = () => {
|
const save = () => {
|
||||||
emit('save');
|
emit('save');
|
||||||
};
|
};
|
||||||
|
const openCheckOut= () => {
|
||||||
|
emit('openCheckOut');
|
||||||
|
};
|
||||||
const deleteItem = () => {
|
const deleteItem = () => {
|
||||||
emit('deleteItem');
|
emit('deleteItem');
|
||||||
};
|
};
|
||||||
const totalAmount = defineModel<any>()
|
const totalAmount = defineModel<any>()
|
||||||
const editItem= () => {
|
|
||||||
emit('edit');
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -20,8 +20,8 @@ const editItem= () => {
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div>总金额:<span class="text icon">¥</span><span class="text">{{ totalAmount || '0' }}</span></div>
|
<div>总金额:<span class="text icon">¥</span><span class="text">{{ totalAmount || '0' }}</span></div>
|
||||||
<div class="btn-group" v-if="status == 0">
|
<div class="btn-group" v-if="status == 0">
|
||||||
<el-button type="primary" disabled>追溯码</el-button>
|
<el-button type="primary" disabled @click="openCheckOut()">追溯码</el-button>
|
||||||
<el-button type="primary" @click="editItem">收费</el-button>
|
<el-button type="primary" @click="save">收费</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
@totalPriceChange="getOrderTotalPrice"></GoodsDetail>
|
@totalPriceChange="getOrderTotalPrice"></GoodsDetail>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<TotalPrice v-model="formData.totalPrice" @edit="saveAndCharge" :status="formData.status"></TotalPrice>
|
<TotalPrice v-model="formData.totalPrice" @save="charge" :status="formData.status"></TotalPrice>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -66,6 +66,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<CheckoutDetail ref="checkoutDetailRef"></CheckoutDetail>
|
||||||
<Settlement
|
<Settlement
|
||||||
ref="settlementRef"
|
ref="settlementRef"
|
||||||
v-model="socialCard"
|
v-model="socialCard"
|
||||||
|
|
@ -86,11 +87,11 @@ import DiagnosisSearchInput from "@/components/outpatient/DiagnosisSearchInput.v
|
||||||
import Settlement from "@/components/charge/Settlement.vue";
|
import Settlement from "@/components/charge/Settlement.vue";
|
||||||
import TotalPrice from "@/components/charge/TotalPrice.vue";
|
import TotalPrice from "@/components/charge/TotalPrice.vue";
|
||||||
import psnCertTypes from "@/assets/config/directory/psnCertTypes.json"
|
import psnCertTypes from "@/assets/config/directory/psnCertTypes.json"
|
||||||
import {getKey} from "@/utils/discrotyUtil.ts";
|
|
||||||
import antys from "@/assets/config/directory/antys.json"
|
|
||||||
import RecordsLog from "@/components/charge/RecordsLog.vue";
|
import RecordsLog from "@/components/charge/RecordsLog.vue";
|
||||||
import PatientCard from "@/components/charge/PatientCard.vue";
|
import PatientCard from "@/components/charge/PatientCard.vue";
|
||||||
import {apiConfig} from "@/assets/config/apiConfig.ts";
|
import {apiConfig} from "@/assets/config/apiConfig.ts";
|
||||||
|
import CheckoutDetail from "@/components/charge/CheckoutDetail.vue";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
const socialCard = ref<any>({payInfo: {}})
|
const socialCard = ref<any>({payInfo: {}})
|
||||||
const formData = ref<any>({
|
const formData = ref<any>({
|
||||||
|
|
@ -108,17 +109,67 @@ const delDraft = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const settlementRef = ref()
|
const settlementRef = ref()
|
||||||
const saveAndCharge = () => {
|
const charge = () => {
|
||||||
|
|
||||||
|
if (checkTraceCode(formData.value.goodsDetail)) {
|
||||||
|
//保存订单
|
||||||
|
saveAndCharge()
|
||||||
|
} else {
|
||||||
|
//打开追溯码详情页
|
||||||
|
openCheckoutDetail(formData.value.goodsDetail)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const checkTraceCode = (goodsList: any[]) => {
|
||||||
|
|
||||||
|
for (let i = 0; i < goodsList.length; i++) {
|
||||||
|
const item = goodsList[i];
|
||||||
|
//应采数量
|
||||||
|
let shouldNumber = 0;
|
||||||
|
if (item.selectedUnit == item.packagingUnit) {
|
||||||
|
shouldNumber = item.selectedNum
|
||||||
|
} else {
|
||||||
|
shouldNumber = Math.ceil(item.selectedNum / item.minPackagingNumber)
|
||||||
|
}
|
||||||
|
if (!item.traceAbilityCodeList || shouldNumber != item.traceAbilityCodeList.length) {
|
||||||
|
return false;
|
||||||
|
}else {
|
||||||
|
ElMessage({
|
||||||
|
message: `${item.name}的追溯码采集未完成`,
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const checkoutDetailRef = ref()
|
||||||
|
const openCheckoutDetail = (goodsList: any[]) => {
|
||||||
|
if (!goodsList || goodsList.length == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '没有商品信息,请先选择需要售卖的商品',
|
||||||
|
type: 'info',
|
||||||
|
plain: true,
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nextTick(() => {
|
||||||
|
checkoutDetailRef.value.init(goodsList);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const saveAndCharge = () => {
|
||||||
post('charge/save', {data: {...formData.value, doctorId: doctorId.value}}).then((res: any) => {
|
post('charge/save', {data: {...formData.value, doctorId: doctorId.value}}).then((res: any) => {
|
||||||
formData.value.code = res
|
formData.value.code = res
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
settlementRef.value?.init(res)
|
settlementRef.value?.init(res)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const diagnosisSearchRef = ref()
|
const diagnosisSearchRef = ref()
|
||||||
const diagnosisSearchApi = "social/diagnose/search"
|
const diagnosisSearchApi = "social/diagnose/search"
|
||||||
const diagnosisShowConfig = [
|
const diagnosisShowConfig = [
|
||||||
{
|
{
|
||||||
label: "诊断名称",
|
label: "诊断名称",
|
||||||
prop: "name",
|
prop: "name",
|
||||||
|
|
@ -127,15 +178,15 @@ const diagnosisShowConfig = [
|
||||||
label: "诊断编码",
|
label: "诊断编码",
|
||||||
prop: "code",
|
prop: "code",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const diagnosisSelect = (list: any) => {
|
const diagnosisSelect = (list: any) => {
|
||||||
const diagnosisNames = list.map((item: any) => item.name).join(',')
|
const diagnosisNames = list.map((item: any) => item.name).join(',')
|
||||||
formData.value.diagnosisMedicalRecord.diagnosisDetail = JSON.stringify(list)
|
formData.value.diagnosisMedicalRecord.diagnosisDetail = JSON.stringify(list)
|
||||||
formData.value.diagnosisMedicalRecord.diagnosisSummary = diagnosisNames
|
formData.value.diagnosisMedicalRecord.diagnosisSummary = diagnosisNames
|
||||||
}
|
}
|
||||||
const recordsConsumptionRef = ref<any>("")
|
const recordsConsumptionRef = ref<any>("")
|
||||||
const patientCardRef = ref()
|
const patientCardRef = ref()
|
||||||
const clickItem = async (item: any, status: any) => {
|
const clickItem = async (item: any, status: any) => {
|
||||||
statusDisabled.value = status
|
statusDisabled.value = status
|
||||||
formData.value = await post('medical/record/getByDiagnosisCode', {diagnosisCode: item.code})
|
formData.value = await post('medical/record/getByDiagnosisCode', {diagnosisCode: item.code})
|
||||||
getOrderTotalPrice()
|
getOrderTotalPrice()
|
||||||
|
|
@ -146,34 +197,34 @@ const clickItem = async (item: any, status: any) => {
|
||||||
recordsConsumptionRef.value?.init(formData.value.patientInfo.id);
|
recordsConsumptionRef.value?.init(formData.value.patientInfo.id);
|
||||||
patientCardRef.value?.init(formData.value.registrationId);
|
patientCardRef.value?.init(formData.value.registrationId);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const dockerList = ref<any[]>([])
|
const dockerList = ref<any[]>([])
|
||||||
const getDockerList = () => {
|
const getDockerList = () => {
|
||||||
let query = {
|
let query = {
|
||||||
role: 1
|
role: 1
|
||||||
}
|
}
|
||||||
post('organization/member/search', {query: query}).then((res: any) => {
|
post('organization/member/search', {query: query}).then((res: any) => {
|
||||||
dockerList.value = res
|
dockerList.value = res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const orderCompleted = () => {
|
const orderCompleted = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
chargeQueueRef.value?.getOrderList()
|
chargeQueueRef.value?.getOrderList()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const orderCanceled = () => {
|
const orderCanceled = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
chargeQueueRef.value?.getOrderList()
|
chargeQueueRef.value?.getOrderList()
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDockerList()
|
getDockerList()
|
||||||
list()
|
list()
|
||||||
})
|
})
|
||||||
const getOrderTotalPrice = () => {
|
const getOrderTotalPrice = () => {
|
||||||
let totalPrice = 0
|
let totalPrice = 0
|
||||||
formData.value.itemDetail?.forEach((item: any) => {
|
formData.value.itemDetail?.forEach((item: any) => {
|
||||||
totalPrice += item.selectedPrice * item.selectedNum
|
totalPrice += item.selectedPrice * item.selectedNum
|
||||||
|
|
@ -183,26 +234,26 @@ const getOrderTotalPrice = () => {
|
||||||
})
|
})
|
||||||
formData.value.preTotalPrice = totalPrice
|
formData.value.preTotalPrice = totalPrice
|
||||||
formData.value.totalPrice = totalPrice
|
formData.value.totalPrice = totalPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
expandTrigger: 'hover' as const,
|
expandTrigger: 'hover' as const,
|
||||||
}
|
}
|
||||||
|
|
||||||
const doctorId = ref<any>('')
|
const doctorId = ref<any>('')
|
||||||
const handleChange = (value: any) => {
|
const handleChange = (value: any) => {
|
||||||
doctorId.value = value[value.length - 1]
|
doctorId.value = value[value.length - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
const cardTypeList = ref<any>(Object.entries(psnCertTypes).map(([id, name]) => ({id, name})))
|
const cardTypeList = ref<any>(Object.entries(psnCertTypes).map(([id, name]) => ({id, name})))
|
||||||
const doctorList = ref<any>([])
|
const doctorList = ref<any>([])
|
||||||
const sectionDoctorOption = ref<any>('')
|
const sectionDoctorOption = ref<any>('')
|
||||||
const list = () => {
|
const list = () => {
|
||||||
post(apiConfig.OrganizationMemberSearch, {query: {role: 1}}).then((res: any) => {
|
post(apiConfig.OrganizationMemberSearch, {query: {role: 1}}).then((res: any) => {
|
||||||
doctorList.value = res
|
doctorList.value = res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
@ -235,6 +286,7 @@ const list = () => {
|
||||||
margin-right: 24px;
|
margin-right: 24px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.doctor {
|
.doctor {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue