dev
This commit is contained in:
commit
4d56874d26
|
|
@ -82,7 +82,6 @@ const tableData = ref<TableItem[]>([]);
|
||||||
const init = (newIdCode: any, newTableDate: any) => {
|
const init = (newIdCode: any, newTableDate: any) => {
|
||||||
traceabilityCode.value = newIdCode;
|
traceabilityCode.value = newIdCode;
|
||||||
tableData.value = newTableDate;
|
tableData.value = newTableDate;
|
||||||
console.log(tableData)
|
|
||||||
show.value = true;
|
show.value = true;
|
||||||
}
|
}
|
||||||
const selected = ref()
|
const selected = ref()
|
||||||
|
|
@ -105,78 +104,13 @@ const addIdCode = ()=>{
|
||||||
if(!selectedItem){
|
if(!selectedItem){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
addTraceabilityCode(selectedItem)
|
addTraceabilityCodeDo(selectedItem)
|
||||||
|
|
||||||
}
|
}
|
||||||
const getGatherNumber=(item:any)=>{
|
|
||||||
let gatherNumber = 0;
|
const emit = defineEmits(["addIdCode","addTraceabilityCode"])
|
||||||
for (let subItem of item.traceAbilityCodeList){
|
const addTraceabilityCodeDo = (item: any) => {
|
||||||
gatherNumber+=subItem.number;
|
emit("addTraceabilityCode",item,traceabilityCode.value)
|
||||||
}
|
|
||||||
item.gatherNumber = gatherNumber;
|
|
||||||
}
|
|
||||||
const emit = defineEmits(["addIdCode"])
|
|
||||||
const addTraceabilityCode = (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 === traceabilityCode.value);
|
|
||||||
if (index == -1 && item.selectedUnit == item.packagingUnit){
|
|
||||||
item.traceAbilityCodeList.push({
|
|
||||||
code: traceabilityCode.value,
|
|
||||||
number: 1
|
|
||||||
})
|
|
||||||
traceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
emit("addIdCode")
|
|
||||||
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: traceabilityCode.value,
|
|
||||||
number: number
|
|
||||||
})
|
|
||||||
traceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
emit("addIdCode")
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
traceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
emit("addIdCode")
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,14 @@
|
||||||
<tr v-for="(item,index) in list" :key="index">
|
<tr v-for="(item,index) in list" :key="index">
|
||||||
<td>{{ item.name }}</td>
|
<td>{{ item.name }}</td>
|
||||||
<td>
|
<td>
|
||||||
<IdCodeListShow :idCodeList="item.idCode" v-if="item.idCode&&item.idCode.length>0"/>
|
<IdCodeListShow :idCodeList="item.idCode" v-if="item.idCode&&item.idCode.length>0"
|
||||||
|
@addTraceabilityCode="addTraceAbilityCodeHandler"/>
|
||||||
<div v-else>未关联</div>
|
<div v-else>未关联</div>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ item.selectedNum }}{{ item.selectedUnit }}</td>
|
<td>{{ item.selectedNum }}{{ item.selectedUnit }}</td>
|
||||||
<td>{{ item.traceAbilityCodeList ? item.traceAbilityCodeList.length : 0 }}/{{ item.shouldNumber }}</td>
|
<td>{{ item.traceAbilityCodeList ? item.traceAbilityCodeList.length : 0 }}/{{ item.shouldNumber }}</td>
|
||||||
<td>
|
<td>
|
||||||
<TraceabilityCodeAdd :item="item"/>
|
<TraceabilityCodeAdd :item="item" @addTraceabilityCode="addTraceAbilityCodeHandler"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -50,7 +51,10 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-card>
|
</el-card>
|
||||||
<AssociationIdCode ref="associationIdCodeRef" @addIdCode="cleanInputIdCode"></AssociationIdCode>
|
<AssociationIdCode
|
||||||
|
ref="associationIdCodeRef"
|
||||||
|
@addIdCode="cleanInputIdCode"
|
||||||
|
@addTraceabilityCode="addTraceAbilityCodeHandler"></AssociationIdCode>
|
||||||
</Mask>
|
</Mask>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
@ -90,7 +94,6 @@ const saveRetail = () => {
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
emit('confirm')
|
emit('confirm')
|
||||||
})
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
emit('confirm')
|
emit('confirm')
|
||||||
|
|
@ -120,7 +123,7 @@ const addTraceAbilityCode = () => {
|
||||||
let idCode = inputIdCode.value.slice(0, 7);
|
let idCode = inputIdCode.value.slice(0, 7);
|
||||||
if (!item.idCode) break
|
if (!item.idCode) break
|
||||||
if (item.idCode.includes(idCode)) {
|
if (item.idCode.includes(idCode)) {
|
||||||
addTraceabilityCodeDo(item);
|
addTraceabilityCodeDo(item, inputIdCode.value);
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +131,7 @@ const addTraceAbilityCode = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const addTraceabilityCodeDo = (item: any) => {
|
const addTraceabilityCodeDo = (item: any, inputStr: any) => {
|
||||||
if (!item.traceAbilityCodeList) {
|
if (!item.traceAbilityCodeList) {
|
||||||
item.traceAbilityCodeList = []
|
item.traceAbilityCodeList = []
|
||||||
}
|
}
|
||||||
|
|
@ -141,7 +144,7 @@ const addTraceabilityCodeDo = (item: any) => {
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const index = item.traceAbilityCodeList.findIndex((codeObj: any) => codeObj.code === inputIdCode.value);
|
const index = item.traceAbilityCodeList.findIndex((codeObj: any) => codeObj.code === inputStr);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '该追溯码已采集',
|
message: '该追溯码已采集',
|
||||||
|
|
@ -149,18 +152,18 @@ const addTraceabilityCodeDo = (item: any) => {
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
item.traceAbilityCodeList.push(inputIdCode.value)
|
item.traceAbilityCodeList.push(inputStr)
|
||||||
cleanInputIdCode()
|
cleanInputIdCode()
|
||||||
getGatherNumber(item)
|
|
||||||
}
|
|
||||||
const getGatherNumber = (item: any) => {
|
|
||||||
item.shouldNumber = item.traceAbilityCodeList?item.traceAbilityCodeList.length:0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const cleanInputIdCode = () => {
|
const cleanInputIdCode = () => {
|
||||||
inputIdCode.value = ''
|
inputIdCode.value = ''
|
||||||
}
|
}
|
||||||
|
const addTraceAbilityCodeHandler = (item: any, code: any) => {
|
||||||
|
addTraceabilityCodeDo(item, code)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div v-for="(subItem,index) in item.traceAbilityCodeList" class="list">
|
<div v-for="(subItem,index) in item.traceAbilityCodeList" class="list">
|
||||||
<div class="code"> {{ subItem.code }}</div>
|
<div class="code"> {{ subItem }}</div>
|
||||||
<div class="remove" @click="removeTraceAbility(item)">
|
<div class="remove" @click="removeTraceAbility(subItem)">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<CloseBold/>
|
<CloseBold/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
|
@ -61,93 +61,23 @@ const props = defineProps({
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const getGatherNumber = (item: any) => {
|
|
||||||
item.shouldNumber = item.traceAbilityCodeList?item.traceAbilityCodeList.length:0;
|
|
||||||
}
|
|
||||||
const inputTraceabilityCode = ref("");
|
const inputTraceabilityCode = ref("");
|
||||||
|
const emit = defineEmits(["addTraceabilityCode"]);
|
||||||
const addTraceabilityCodeDo = (item: any) => {
|
const addTraceabilityCodeDo = (item: any) => {
|
||||||
if (!item.traceAbilityCodeList) {
|
emit("addTraceabilityCode",item,inputTraceabilityCode.value)
|
||||||
item.traceAbilityCodeList = []
|
inputTraceabilityCode.value = ""
|
||||||
}
|
}
|
||||||
let traceAbilityCodeListList = item.traceAbilityCodeList.length
|
|
||||||
|
|
||||||
if (traceAbilityCodeListList == item.shouldNumber) {
|
const removeTraceAbility = (code: any) => {
|
||||||
ElMessage({
|
const index = props.item.traceAbilityCodeList.findIndex(
|
||||||
message: '采集数量已满',
|
(codeObj: any) => codeObj === code
|
||||||
type: 'warning',
|
);
|
||||||
})
|
|
||||||
return
|
if (index !== -1) {
|
||||||
|
props.item.traceAbilityCodeList.splice(index, 1); // 删除对应项
|
||||||
}
|
}
|
||||||
const index = item.traceAbilityCodeList.findIndex((codeObj: any) => codeObj.code === inputTraceabilityCode.value);
|
|
||||||
if (index != -1) {
|
|
||||||
ElMessage({
|
|
||||||
message: '该追溯码已采集',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
item.traceAbilityCodeList.push(inputTraceabilityCode.value)
|
|
||||||
inputTraceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
}
|
|
||||||
const removeTraceAbility = (item: any) => {
|
|
||||||
item.traceAbilityCodeList.splice(item.traceAbilityCodeList.findIndex((codeObj: any) => codeObj.code === inputTraceabilityCode.value), 1)
|
|
||||||
getGatherNumber(item)
|
|
||||||
}
|
|
||||||
const changeNumber=ref(0);
|
|
||||||
const openNumberInput = (subItem: any) => {
|
|
||||||
subItem.showNumberInput = true;
|
|
||||||
changeNumber.value = subItem.number;
|
|
||||||
}
|
|
||||||
const handleNumberChange = (subItem:any)=>{
|
|
||||||
let limit = 1;
|
|
||||||
if (props.item.selectedUnit == props.item.minPackagingUnit){
|
|
||||||
limit = props.item.minPackagingNumber;
|
|
||||||
}
|
|
||||||
if (changeNumber.value>limit) {
|
|
||||||
ElMessage({
|
|
||||||
message: '单个追溯码采集数量超过限制',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
subItem.showNumberInput = false;
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 可以在这里添加具体的处理逻辑
|
|
||||||
let totalNumber = 0;
|
|
||||||
for (let subItem of props.item.traceAbilityCodeList) {
|
|
||||||
totalNumber += subItem.number;
|
|
||||||
}
|
|
||||||
totalNumber = totalNumber - subItem.number + changeNumber.value;
|
|
||||||
if (totalNumber > props.item.retailNumber) {
|
|
||||||
ElMessage({
|
|
||||||
message: '采集数量超过上限',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
subItem.showNumberInput = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
subItem.number = changeNumber.value;
|
|
||||||
}
|
|
||||||
const addIdCode = (idCode:any)=>{
|
|
||||||
if (idCode==null || idCode.value ==""){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (props.item.idCode.includes(idCode)){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
`当前标识码未绑定是否确认绑定标识码?`,
|
|
||||||
'Warning',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}).then(() => {
|
|
||||||
post("goods/goods/addIdCode",{goodsId:props.item.id,idCode:idCode}).then((res:any)=>{
|
|
||||||
props.item.idCode.push(idCode);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.list {
|
.list {
|
||||||
|
|
|
||||||
|
|
@ -108,75 +108,10 @@ const addIdCode = ()=>{
|
||||||
addTraceabilityCode(selectedItem)
|
addTraceabilityCode(selectedItem)
|
||||||
|
|
||||||
}
|
}
|
||||||
const getGatherNumber=(item:any)=>{
|
|
||||||
let gatherNumber = 0;
|
const emit = defineEmits(["addIdCode","addTraceabilityCode"])
|
||||||
for (let subItem of item.traceAbilityCodeList){
|
|
||||||
gatherNumber+=subItem.number;
|
|
||||||
}
|
|
||||||
item.gatherNumber = gatherNumber;
|
|
||||||
}
|
|
||||||
const emit = defineEmits(["addIdCode"])
|
|
||||||
const addTraceabilityCode = (item: any) => {
|
const addTraceabilityCode = (item: any) => {
|
||||||
if (!item.traceAbilityCodeList) {
|
emit("addTraceabilityCode",traceabilityCode)
|
||||||
item.traceAbilityCodeList = []
|
|
||||||
}
|
|
||||||
if (item.retailNumber == item.gatherNumber) {
|
|
||||||
ElMessage({
|
|
||||||
message: '采集数量已满',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const index = item.traceAbilityCodeList.findIndex((codeObj: any) => codeObj.code === traceabilityCode.value);
|
|
||||||
if (index == -1 && item.selectedUnit == item.packagingUnit){
|
|
||||||
item.traceAbilityCodeList.push({
|
|
||||||
code: traceabilityCode.value,
|
|
||||||
number: 1
|
|
||||||
})
|
|
||||||
traceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
emit("addIdCode")
|
|
||||||
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: traceabilityCode.value,
|
|
||||||
number: number
|
|
||||||
})
|
|
||||||
traceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
emit("addIdCode")
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
traceabilityCode.value = "";
|
|
||||||
getGatherNumber(item)
|
|
||||||
emit("addIdCode")
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
@selectedCallBack="diagnosisSelect"
|
@selectedCallBack="diagnosisSelect"
|
||||||
ref="diagnosisSearchRef"
|
ref="diagnosisSearchRef"
|
||||||
:show-header="false"
|
:show-header="false"
|
||||||
:disabled="statusDisabled==1"
|
:disabled="statusDisabled==1||formData.status==1"
|
||||||
|
|
||||||
>
|
>
|
||||||
</DiagnosisSearchInput>
|
</DiagnosisSearchInput>
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="formData.status == 1"
|
:disabled="statusDisabled==1||formData.status==1"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in doctorList"
|
v-for="item in doctorList"
|
||||||
|
|
@ -47,11 +47,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 24px">
|
<div style="margin-top: 24px">
|
||||||
<ServiceDetail v-model="formData.itemDetail" :status="formData.status == 0"
|
<ServiceDetail v-model="formData.itemDetail" :status="formData.status == 0"
|
||||||
@totalPriceChange="getOrderTotalPrice"></ServiceDetail>
|
@totalPriceChange="getOrderTotalPrice" :statusDisabled="statusDisabled==1"></ServiceDetail>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 24px">
|
<div style="margin-top: 24px">
|
||||||
<GoodsDetail v-model="formData.goodsDetail" :status="formData.status == 0"
|
<GoodsDetail v-model="formData.goodsDetail" :status="formData.status == 0"
|
||||||
@totalPriceChange="getOrderTotalPrice"></GoodsDetail>
|
@totalPriceChange="getOrderTotalPrice" :statusDisabled="statusDisabled==1"></GoodsDetail>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<TotalPrice v-model="formData.totalPrice" @save="charge" :status="formData.status" @openCheckOut ="openCheckoutDetail(formData.goodsDetail)"></TotalPrice>
|
<TotalPrice v-model="formData.totalPrice" @save="charge" :status="formData.status" @openCheckOut ="openCheckoutDetail(formData.goodsDetail)"></TotalPrice>
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<CheckoutDetail ref="checkoutDetailRef"></CheckoutDetail>
|
<CheckoutDetail ref="checkoutDetailRef" @confirm ="saveAndCharge"></CheckoutDetail>
|
||||||
<Settlement
|
<Settlement
|
||||||
ref="settlementRef"
|
ref="settlementRef"
|
||||||
v-model="socialCard"
|
v-model="socialCard"
|
||||||
|
|
@ -128,16 +128,15 @@ const checkTraceCode = (goodsList: any[]) => {
|
||||||
for (let i = 0; i < goodsList.length; i++) {
|
for (let i = 0; i < goodsList.length; i++) {
|
||||||
const item = goodsList[i];
|
const item = goodsList[i];
|
||||||
if (!item.traceAbilityCodeList || item.shouldNumber != item.traceAbilityCodeList.length) {
|
if (!item.traceAbilityCodeList || item.shouldNumber != item.traceAbilityCodeList.length) {
|
||||||
return false;
|
|
||||||
}else {
|
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: `${item.name}的追溯码采集未完成`,
|
message: `${item.name}的追溯码采集未完成`,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
const checkoutDetailRef = ref()
|
const checkoutDetailRef = ref()
|
||||||
const openCheckoutDetail = (goodsList: any[]) => {
|
const openCheckoutDetail = (goodsList: any[]) => {
|
||||||
|
|
@ -222,6 +221,66 @@ const orderCanceled = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
chargeQueueRef.value?.getOrderList()
|
chargeQueueRef.value?.getOrderList()
|
||||||
})
|
})
|
||||||
|
const saveAndCharge = () => {
|
||||||
|
post('charge/save', {data: {...formData.value, doctorId: doctorId.value}}).then((res: any) => {
|
||||||
|
formData.value.code = res
|
||||||
|
nextTick(() => {
|
||||||
|
settlementRef.value?.init(res)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const diagnosisSearchRef = ref()
|
||||||
|
const diagnosisSearchApi = "social/diagnose/search"
|
||||||
|
const diagnosisShowConfig = [
|
||||||
|
{
|
||||||
|
label: "诊断名称",
|
||||||
|
prop: "name",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "诊断编码",
|
||||||
|
prop: "code",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const diagnosisSelect = (list: any) => {
|
||||||
|
const diagnosisNames = list.map((item: any) => item.name).join(',')
|
||||||
|
formData.value.diagnosisMedicalRecord.diagnosisDetail = JSON.stringify(list)
|
||||||
|
formData.value.diagnosisMedicalRecord.diagnosisSummary = diagnosisNames
|
||||||
|
}
|
||||||
|
const recordsConsumptionRef = ref<any>("")
|
||||||
|
const patientCardRef = ref()
|
||||||
|
const clickItem = async (item: any, status: any) => {
|
||||||
|
statusDisabled.value = status
|
||||||
|
formData.value = await post('medical/record/getByDiagnosisCode', {diagnosisCode: item.code})
|
||||||
|
formData.value.doctorId = formData.value.patientRegistration.organizationDoctorId
|
||||||
|
getOrderTotalPrice()
|
||||||
|
nextTick(() => {
|
||||||
|
let list = JSON.parse(formData.value.diagnosisMedicalRecord.diagnosisDetail)
|
||||||
|
let nList = formData.value.diagnosisMedicalRecord.diagnosisSummary.split(',')
|
||||||
|
diagnosisSearchRef.value?.init(list, nList);
|
||||||
|
recordsConsumptionRef.value?.init(formData.value.patientInfo.id);
|
||||||
|
patientCardRef.value?.init(formData.value.registrationId);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const dockerList = ref<any[]>([])
|
||||||
|
const getDockerList = () => {
|
||||||
|
let query = {
|
||||||
|
role: 1
|
||||||
|
}
|
||||||
|
post('organization/member/search', {query: query}).then((res: any) => {
|
||||||
|
dockerList.value = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const orderCompleted = () => {
|
||||||
|
getDockerList()
|
||||||
|
list()
|
||||||
|
nextTick(() => {
|
||||||
|
chargeQueueRef.value?.getOrderList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const orderCanceled = () => {
|
||||||
|
nextTick(() => {
|
||||||
|
chargeQueueRef.value?.getOrderList()
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -233,10 +292,10 @@ onMounted(() => {
|
||||||
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*100 * item.selectedNum*100)/10000
|
||||||
})
|
})
|
||||||
formData.value.goodsDetail.forEach((item: any) => {
|
formData.value.goodsDetail.forEach((item: any) => {
|
||||||
totalPrice += item.selectedPrice * item.selectedNum
|
totalPrice += (item.selectedPrice*100 * item.selectedNum*100)/10000
|
||||||
})
|
})
|
||||||
formData.value.preTotalPrice = totalPrice
|
formData.value.preTotalPrice = totalPrice
|
||||||
formData.value.totalPrice = totalPrice
|
formData.value.totalPrice = totalPrice
|
||||||
|
|
@ -262,7 +321,7 @@ const list = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStatus=(status:any)=>{
|
const getStatus=(status:any)=>{
|
||||||
console.log(111)
|
statusDisabled.value = status
|
||||||
formData.value = {
|
formData.value = {
|
||||||
patientInfo: {},
|
patientInfo: {},
|
||||||
diagnosisMedicalRecord: {},
|
diagnosisMedicalRecord: {},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue