|
|
@@ -3,7 +3,13 @@ import dayjs from 'dayjs';
|
|
|
import {listMedicalMechanism} from '@/api/medical/mechanism';
|
|
|
import {transformFlatObjectToNested, transformNestedObjectToFlat} from '@/tools/object';
|
|
|
import {bignumber, chain, multiply} from 'mathjs';
|
|
|
-import {addPrescriptionCore2, check, check2, getPrescriptionCore2} from '@/api/prescription/prescriptionCore';
|
|
|
+import {
|
|
|
+ addPrescriptionCore2,
|
|
|
+ check,
|
|
|
+ check2,
|
|
|
+ getPrescriptionCore2,
|
|
|
+ getPrescriptionRS,
|
|
|
+} from '@/api/prescription/prescriptionCore';
|
|
|
import {mapGetters} from 'vuex';
|
|
|
|
|
|
import regionOptions from '@/utils/options';
|
|
|
@@ -87,6 +93,10 @@ export default {
|
|
|
saving: false,
|
|
|
|
|
|
tableHeight: 0,
|
|
|
+
|
|
|
+ showRS: false,
|
|
|
+ rsLoading: false,
|
|
|
+ rs: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -168,6 +178,23 @@ export default {
|
|
|
|
|
|
if (!this.model.tackleTime) this.model.tackleTime = dayjs().startOf('minute').format('YYYY-MM-DD HH:mm:ss');
|
|
|
},
|
|
|
+ async loadRS() {
|
|
|
+ const medicines = this.medicines.filter(medicine => Object.keys(medicine).length);
|
|
|
+ if (medicines.length === 0) return this.toggleShowRS(false);
|
|
|
+ this.rsLoading = true;
|
|
|
+ try {
|
|
|
+ const id = this.model.id || this.$props.id;
|
|
|
+ this.rs = await getPrescriptionRS(id, medicines, {hidePregnant: this.model.sex === '男' || this.model.age < 14});
|
|
|
+ } catch (e) {
|
|
|
+ if (e instanceof AggregateError) {
|
|
|
+ this.$message.error(e.errors.map(e=>e.message).join('; '));
|
|
|
+ } else {
|
|
|
+ this.$message.error(e.message);
|
|
|
+ }
|
|
|
+ this.toggleShowRS(false);
|
|
|
+ }
|
|
|
+ this.rsLoading = false;
|
|
|
+ },
|
|
|
formReset() {
|
|
|
const pharmacies = Array.isArray(this.pharmacyList) ? this.pharmacyList : [];
|
|
|
this.model = {
|
|
|
@@ -326,15 +353,18 @@ export default {
|
|
|
this.medicines.splice(index, 1, row);
|
|
|
}
|
|
|
if (this.getEmptyMedicineRowIndex === -1) this.appendMedicine({}, index + 1);
|
|
|
+ if (this.showRS) this.loadRS();
|
|
|
},
|
|
|
appendMedicine(model, index = this.medicines.length) {
|
|
|
this.medicines.splice(index, 0, model || {});
|
|
|
},
|
|
|
deleteMedicine(row, index) {
|
|
|
this.medicines.splice(index, 1);
|
|
|
+ if (this.showRS) this.loadRS();
|
|
|
},
|
|
|
updateMedicine(row, index) {
|
|
|
this.medicines.splice(index, 1, {...row, subtotalMoney: this.calculationMedicinePrice(row)});
|
|
|
+ if (this.showRS) this.loadRS();
|
|
|
},
|
|
|
calculationMedicinePrice(medicine) {
|
|
|
let price = chain(bignumber(medicine.matXsj || 0));
|
|
|
@@ -346,6 +376,11 @@ export default {
|
|
|
colspan: 8,
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ toggleShowRS(show = true) {
|
|
|
+ this.showRS = show && !this.showRS;
|
|
|
+ if (this.showRS) this.loadRS();
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -725,6 +760,25 @@ export default {
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
+ <transition name="slide-left">
|
|
|
+ <div v-if="showRS" class="drawer-container">
|
|
|
+ <div class="header">智能审方</div>
|
|
|
+ <div class="main" v-loading="rsLoading">
|
|
|
+ <el-empty v-if="!rsLoading && rs.length === 0">
|
|
|
+ <el-button type="primary" @click="toggleShowRS(false)">关闭</el-button>
|
|
|
+ </el-empty>
|
|
|
+ <div v-for="block in rs" :key="block.title">
|
|
|
+ <div class="rs-title">{{ block.title }}</div>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24" v-for="item in block.collection" :key="item.name" style="margin-top: 8px;"
|
|
|
+ v-html="item"></el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <i class="el-icon-circle-close close" @click="toggleShowRS(false)"></i>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
</el-col>
|
|
|
<el-col class="col-container" :span="12">
|
|
|
<div class="area" style="flex: auto;display: flex;flex-direction: column;">
|
|
|
@@ -827,6 +881,9 @@ export default {
|
|
|
</template>
|
|
|
</div>
|
|
|
<div>
|
|
|
+ <el-button v-if="isCheck" type="primary" plain @click="toggleShowRS()"
|
|
|
+ :disabled="!getEmptyMedicineRowIndex">{{ showRS ? '关闭' : '' }}智能审方
|
|
|
+ </el-button>
|
|
|
<el-button v-if="isCheck" type="primary" @click="check('110')" :disabled="saving">审核通过</el-button>
|
|
|
<el-button v-else type="primary" :loading="saving" @click="handle">保 存</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
@@ -959,6 +1016,65 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
+
|
|
|
+.col-container {
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .drawer-container {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ padding: 12px 10px;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .close {
|
|
|
+ position: absolute;
|
|
|
+ top: 12px + 4px;
|
|
|
+ right: 12px;
|
|
|
+ font-size: 24px;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ color: #5AD8A6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ > .header {
|
|
|
+ flex: none;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 700;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 32px;
|
|
|
+ }
|
|
|
+
|
|
|
+ > .main {
|
|
|
+ flex: auto;
|
|
|
+ overflow-x: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ .rs-title {
|
|
|
+ margin-top: 12px;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 700;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 动画效果 */
|
|
|
+ .slide-left-enter-active,
|
|
|
+ .slide-left-leave-active {
|
|
|
+ transition: transform 0.3s ease;
|
|
|
+ }
|
|
|
+
|
|
|
+ .slide-left-enter,
|
|
|
+ .slide-left-leave-to {
|
|
|
+ transform: translateX(-100%);
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.el-dialog {
|