|
@@ -141,9 +141,7 @@
|
|
|
circle
|
|
|
icon="Delete"
|
|
|
type="danger"
|
|
|
- @click="
|
|
|
- removeHerbs(scope.$index)
|
|
|
- "
|
|
|
+ @click="removeHerbs(scope.$index)"
|
|
|
>
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -165,7 +163,7 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script setup name="XinZhenCaoYao">
|
|
|
import router from '@/router'
|
|
|
import {computed, onMounted, ref, watch} from 'vue'
|
|
|
import {
|
|
@@ -182,253 +180,229 @@ import CaoYaoMuBan from '@/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/CaoYaoMuB
|
|
|
import {yaoPinXiangMuPiPeiYiBao} from '@/api/public-api'
|
|
|
import CuoWuXinXi from '@/components/zhu-yuan-yi-sheng/CuoWuXinXi.vue'
|
|
|
|
|
|
-export default {
|
|
|
- name: 'XinZhenCaoYao',
|
|
|
- components: {CuoWuXinXi, CaoYaoMuBan, ChaXuanCaoYao},
|
|
|
- setup() {
|
|
|
- const windowSize = computed(() => {
|
|
|
- return store.state.app.windowSize
|
|
|
- })
|
|
|
+const windowSize = computed(() => {
|
|
|
+ return store.state.app.windowSize
|
|
|
+})
|
|
|
|
|
|
- /**
|
|
|
- * 处方信息
|
|
|
- */
|
|
|
- const chuFang = ref({
|
|
|
- orderName: '',
|
|
|
- quantity: 0,
|
|
|
- quantityDj: 0,
|
|
|
- cyMtjs: 0,
|
|
|
- cyJsl: 0,
|
|
|
- cyZql: 0,
|
|
|
- cyFj: 0,
|
|
|
- cyFfcs: 0,
|
|
|
- cyJssm: '',
|
|
|
- groupNo: '81',
|
|
|
- })
|
|
|
- /**
|
|
|
- * 编辑草药
|
|
|
- * @type {Ref<UnwrapRef<{chargeCodeName: string, quantity: number, retprice: number, instruction: string, je: string, chargeCode: string}>>}
|
|
|
- */
|
|
|
- const caoYao = ref({
|
|
|
- chargeCode: '',
|
|
|
- chargeCodeName: '',
|
|
|
- quantity: 0,
|
|
|
- retprice: 0,
|
|
|
- instruction: '',
|
|
|
- je: '',
|
|
|
- })
|
|
|
+/**
|
|
|
+ * 处方信息
|
|
|
+ */
|
|
|
+const chuFang = ref({
|
|
|
+ orderName: '',
|
|
|
+ quantity: 0,
|
|
|
+ quantityDj: 0,
|
|
|
+ cyMtjs: 0,
|
|
|
+ cyJsl: 0,
|
|
|
+ cyZql: 0,
|
|
|
+ cyFj: 0,
|
|
|
+ cyFfcs: 0,
|
|
|
+ cyJssm: '',
|
|
|
+ groupNo: '81',
|
|
|
+})
|
|
|
+/**
|
|
|
+ * 编辑草药
|
|
|
+ * @type {Ref<UnwrapRef<{chargeCodeName: string, quantity: number, retprice: number, instruction: string, je: string, chargeCode: string}>>}
|
|
|
+ */
|
|
|
+const caoYao = ref({
|
|
|
+ chargeCode: '',
|
|
|
+ chargeCodeName: '',
|
|
|
+ quantity: 0,
|
|
|
+ retprice: 0,
|
|
|
+ instruction: '',
|
|
|
+ je: '',
|
|
|
+})
|
|
|
|
|
|
- /**
|
|
|
- * 具体的草药明细
|
|
|
- * @type {Ref<UnwrapRef<{weiYi: *[], list: *[]}>>}
|
|
|
- */
|
|
|
- const mingXi = ref({
|
|
|
- weiYi: [],
|
|
|
- list: [],
|
|
|
- })
|
|
|
+/**
|
|
|
+ * 具体的草药明细
|
|
|
+ * @type {Ref<UnwrapRef<{weiYi: *[], list: *[]}>>}
|
|
|
+ */
|
|
|
+const mingXi = ref({
|
|
|
+ weiYi: [],
|
|
|
+ list: [],
|
|
|
+})
|
|
|
|
|
|
- const chaXunCaoYaoZuJian = ref(false)
|
|
|
+const chaXunCaoYaoZuJian = ref(false)
|
|
|
|
|
|
- /**
|
|
|
- * 删除草药下标
|
|
|
- * @param index
|
|
|
- */
|
|
|
- const removeHerbs = (index) => {
|
|
|
- mingXi.weiYi.splice(index, 1);
|
|
|
- mingXi.list.splice(index, 1)
|
|
|
- }
|
|
|
+/**
|
|
|
+ * 删除草药下标
|
|
|
+ * @param index
|
|
|
+ */
|
|
|
+const removeHerbs = (index) => {
|
|
|
+ mingXi.value.weiYi.splice(index, 1);
|
|
|
+ mingXi.value.list.splice(index, 1)
|
|
|
+}
|
|
|
|
|
|
- /**
|
|
|
- * 查询草药信息中的 搜索框
|
|
|
- * @type {null}
|
|
|
- */
|
|
|
- const queryName = ref(null)
|
|
|
- /**
|
|
|
- * 草药服用方法数据
|
|
|
- * @type {Ref<UnwrapRef<*[]>>}
|
|
|
- */
|
|
|
- const fuYongFangFaShuJu = ref([])
|
|
|
+/**
|
|
|
+ * 查询草药信息中的 搜索框
|
|
|
+ * @type {null}
|
|
|
+ */
|
|
|
+const queryName = ref(null)
|
|
|
+/**
|
|
|
+ * 草药服用方法数据
|
|
|
+ * @type {Ref<UnwrapRef<*[]>>}
|
|
|
+ */
|
|
|
+const fuYongFangFaShuJu = ref([])
|
|
|
|
|
|
- const dianJiXuanZhongCaoYao = (row) => {
|
|
|
- let key = row.chargeCode + row.serial
|
|
|
- if (mingXi.value.weiYi.indexOf(key) > -1) {
|
|
|
- return ElMessage.error('请勿重复添加。')
|
|
|
- } else {
|
|
|
- ElMessage.success('添加成功。')
|
|
|
- row.quantity = 1
|
|
|
- row.je = row.retprice
|
|
|
- mingXi.value.list.push(row)
|
|
|
- mingXi.value.weiYi.push(key)
|
|
|
- }
|
|
|
- }
|
|
|
+const dianJiXuanZhongCaoYao = (row) => {
|
|
|
+ let key = row.chargeCode + row.serial
|
|
|
+ if (mingXi.value.weiYi.indexOf(key) > -1) {
|
|
|
+ return ElMessage.error('请勿重复添加。')
|
|
|
+ } else {
|
|
|
+ ElMessage.success('添加成功。')
|
|
|
+ row.quantity = 1
|
|
|
+ row.je = row.retprice
|
|
|
+ mingXi.value.list.push(row)
|
|
|
+ mingXi.value.weiYi.push(key)
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- const dianJiBianJi = (row) => {
|
|
|
- caoYao.value = row
|
|
|
- }
|
|
|
+const dianJiBianJi = (row) => {
|
|
|
+ caoYao.value = row
|
|
|
+}
|
|
|
|
|
|
- watch(
|
|
|
- () => caoYao.value.quantity,
|
|
|
- () => {
|
|
|
- caoYao.value.je = (caoYao.value.quantity * caoYao.value.retprice).toFixed(2)
|
|
|
- }
|
|
|
- )
|
|
|
+watch(
|
|
|
+ () => caoYao.value.quantity,
|
|
|
+ () => {
|
|
|
+ caoYao.value.je = (caoYao.value.quantity * caoYao.value.retprice).toFixed(2)
|
|
|
+ }
|
|
|
+)
|
|
|
|
|
|
- /**
|
|
|
- * 下面是取模板的
|
|
|
- */
|
|
|
- const muBanZuJian = ref(false)
|
|
|
+/**
|
|
|
+ * 下面是取模板的
|
|
|
+ */
|
|
|
+const muBanZuJian = ref(false)
|
|
|
|
|
|
- const dianJiXuanZhongMuBanShuJu = (data) => {
|
|
|
- let flag = false
|
|
|
- for (let item of data) {
|
|
|
- if (item.groupNo !== chuFang.value.groupNo) {
|
|
|
- ElMessage.error('模板药房和当前药房不相同')
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- data.forEach((item) => {
|
|
|
- let key = item.chargeCode + item.serial
|
|
|
- if (mingXi.value.weiYi.indexOf(key) > -1) {
|
|
|
- flag = true
|
|
|
- } else {
|
|
|
- item.je = (item.quantity * item.retprice).toFixed(2)
|
|
|
- item.groupName = item.groupNo === '81' ? '门诊中药房' : '颗粒剂药房'
|
|
|
- mingXi.value.list.push(item)
|
|
|
- mingXi.value.weiYi.push(key)
|
|
|
- }
|
|
|
- })
|
|
|
- if (flag) {
|
|
|
- ElMessage({
|
|
|
- showClose: true,
|
|
|
- message: '请勿重复添加。',
|
|
|
- type: 'error',
|
|
|
- })
|
|
|
- }
|
|
|
+const dianJiXuanZhongMuBanShuJu = (data) => {
|
|
|
+ let flag = false
|
|
|
+ for (let item of data) {
|
|
|
+ if (item.groupNo !== chuFang.value.groupNo) {
|
|
|
+ ElMessage.error('模板药房和当前药房不相同')
|
|
|
+ return
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 下面是存模板
|
|
|
- */
|
|
|
- const cunMuBan = ref({
|
|
|
- patternName: '',
|
|
|
- dialog: false,
|
|
|
- chongFuBiaoZhi: false,
|
|
|
- })
|
|
|
- const dianJiCunMuBan = () => {
|
|
|
- let val = cunMuBan.value.patternName
|
|
|
- if (stringIsBlank(val)) return
|
|
|
- chongFuMuBanMing(val).then((res) => {
|
|
|
- if (res) {
|
|
|
- return ElMessage.error('模板名重复。')
|
|
|
- } else {
|
|
|
- let data = {
|
|
|
- patternName: val,
|
|
|
- list: mingXi.value.list,
|
|
|
- deptCode: store.state.user.info.deptCode,
|
|
|
- }
|
|
|
- cunMuBanApi(data).then(() => {
|
|
|
- cunMuBan.value.dialog = false
|
|
|
- cunMuBan.value.patternName = ''
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ data.forEach((item) => {
|
|
|
+ let key = item.chargeCode + item.serial
|
|
|
+ if (mingXi.value.weiYi.indexOf(key) > -1) {
|
|
|
+ flag = true
|
|
|
+ } else {
|
|
|
+ item.je = (item.quantity * item.retprice).toFixed(2)
|
|
|
+ item.groupName = item.groupNo === '81' ? '门诊中药房' : '颗粒剂药房'
|
|
|
+ mingXi.value.list.push(item)
|
|
|
+ mingXi.value.weiYi.push(key)
|
|
|
}
|
|
|
+ })
|
|
|
+ if (flag) {
|
|
|
+ ElMessage({
|
|
|
+ showClose: true,
|
|
|
+ message: '请勿重复添加。',
|
|
|
+ type: 'error',
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- /**
|
|
|
- * 保存草药
|
|
|
- */
|
|
|
- const dianJiBaoCunCaoYao = () => {
|
|
|
- if (youWuXuanZheHuanZhe()) return
|
|
|
- if (stringIsBlank(chuFang.value.orderName)) {
|
|
|
- return ElMessage.error('请输入处方名。')
|
|
|
- }
|
|
|
- if (chuFang.value.quantity === 0) {
|
|
|
- return ElMessage.error('请选择剂数')
|
|
|
- }
|
|
|
- if (chuFang.value.quantityDj === 0) {
|
|
|
- return ElMessage.error('请选择代煎数')
|
|
|
+/**
|
|
|
+ * 下面是存模板
|
|
|
+ */
|
|
|
+const cunMuBan = ref({
|
|
|
+ patternName: '',
|
|
|
+ dialog: false,
|
|
|
+ chongFuBiaoZhi: false,
|
|
|
+})
|
|
|
+
|
|
|
+const dianJiCunMuBan = () => {
|
|
|
+ let val = cunMuBan.value.patternName
|
|
|
+ if (stringIsBlank(val)) return
|
|
|
+ chongFuMuBanMing(val).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ return ElMessage.error('模板名重复。')
|
|
|
+ } else {
|
|
|
+ let data = {
|
|
|
+ patternName: val,
|
|
|
+ list: mingXi.value.list,
|
|
|
+ deptCode: store.state.user.info.deptCode,
|
|
|
}
|
|
|
- let listCode = []
|
|
|
- mingXi.value.list.forEach((item) => {
|
|
|
- listCode.push(item.chargeCode + '-' + item.serial)
|
|
|
- })
|
|
|
- yaoPinXiangMuPiPeiYiBao(listCode).then((res) => {
|
|
|
- if (stringNotBlank(res)) {
|
|
|
- cuoWuXinXi.value = res
|
|
|
- ElMessageBox.confirm(res, '提示', {
|
|
|
- type: 'warning',
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- baoCunShuJu()
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- })
|
|
|
- } else {
|
|
|
- baoCunShuJu()
|
|
|
- }
|
|
|
+ cunMuBanApi(data).then(() => {
|
|
|
+ cunMuBan.value.dialog = false
|
|
|
+ cunMuBan.value.patternName = ''
|
|
|
})
|
|
|
}
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- function baoCunShuJu() {
|
|
|
- ElMessageBox.confirm(chuFang.value.quantity > 20 ? '剂数大于20是否继续录入?' : '请确定好数据?', '提示', {
|
|
|
+/**
|
|
|
+ * 保存草药
|
|
|
+ */
|
|
|
+const dianJiBaoCunCaoYao = () => {
|
|
|
+ if (youWuXuanZheHuanZhe()) return
|
|
|
+ if (stringIsBlank(chuFang.value.orderName)) {
|
|
|
+ return ElMessage.error('请输入处方名。')
|
|
|
+ }
|
|
|
+ if (chuFang.value.quantity === 0) {
|
|
|
+ return ElMessage.error('请选择剂数')
|
|
|
+ }
|
|
|
+ if (chuFang.value.quantityDj === 0) {
|
|
|
+ return ElMessage.error('请选择代煎数')
|
|
|
+ }
|
|
|
+ let listCode = []
|
|
|
+ mingXi.value.list.forEach((item) => {
|
|
|
+ listCode.push(item.chargeCode + '-' + item.serial)
|
|
|
+ })
|
|
|
+ yaoPinXiangMuPiPeiYiBao(listCode).then((res) => {
|
|
|
+ if (stringNotBlank(res)) {
|
|
|
+ cuoWuXinXi.value = res
|
|
|
+ ElMessageBox.confirm(res, '提示', {
|
|
|
type: 'warning',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
})
|
|
|
.then(() => {
|
|
|
- let data = chuFang.value
|
|
|
- data.inpatientNo = huanZheXinXi.value.inpatientNo
|
|
|
- data.admissTimes = huanZheXinXi.value.admissTimes
|
|
|
- data.list = mingXi.value.list
|
|
|
- data.deptCode = store.state.user.info.deptCode
|
|
|
- baoCunCaoYao(data).then((res) => {
|
|
|
- router.go(-1)
|
|
|
- })
|
|
|
+ baoCunShuJu()
|
|
|
})
|
|
|
.catch(() => {
|
|
|
})
|
|
|
+ } else {
|
|
|
+ baoCunShuJu()
|
|
|
}
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- const clearHerbalInformation = () => {
|
|
|
- mingXi.weiYi = []
|
|
|
- mingXi.list = []
|
|
|
- }
|
|
|
-
|
|
|
- onMounted(() => {
|
|
|
- fuYongFangFa().then((res) => {
|
|
|
- fuYongFangFaShuJu.value = res
|
|
|
+function baoCunShuJu() {
|
|
|
+ ElMessageBox.confirm(chuFang.value.quantity > 20 ? '剂数大于20是否继续录入?' : '请确定好数据?', '提示', {
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let data = chuFang.value
|
|
|
+ data.inpatientNo = huanZheXinXi.value.inpatientNo
|
|
|
+ data.admissTimes = huanZheXinXi.value.admissTimes
|
|
|
+ data.list = mingXi.value.list
|
|
|
+ data.deptCode = store.state.user.info.deptCode
|
|
|
+ baoCunCaoYao(data).then((res) => {
|
|
|
+ router.go(-1)
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ .catch(() => {
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- return {
|
|
|
- router,
|
|
|
- chuFang,
|
|
|
- huanZheXinXi,
|
|
|
- jiaShuiLeiXing: [
|
|
|
- {code: '加凉水', name: '加凉水'},
|
|
|
- {code: '加温水', name: '加温水'},
|
|
|
- {code: '加开水', name: '加开水'},
|
|
|
- {code: '加冰水', name: '加冰水'},
|
|
|
- {code: '加外糖水', name: '加外糖水'},
|
|
|
- {code: '外敷', name: '外敷'},
|
|
|
- ],
|
|
|
- fuYongFangFaShuJu,
|
|
|
- mingXi,
|
|
|
- windowSize,
|
|
|
- dianJiXuanZhongCaoYao,
|
|
|
- dianJiBianJi,
|
|
|
- caoYao,
|
|
|
- queryName,
|
|
|
- dianJiCunMuBan,
|
|
|
- cunMuBan,
|
|
|
- dianJiBaoCunCaoYao,
|
|
|
- chaXunCaoYaoZuJian,
|
|
|
- muBanZuJian,
|
|
|
- dianJiXuanZhongMuBanShuJu,
|
|
|
- clearHerbalInformation,
|
|
|
- removeHerbs
|
|
|
- }
|
|
|
- },
|
|
|
+const clearHerbalInformation = () => {
|
|
|
+ mingXi.value.weiYi = []
|
|
|
+ mingXi.value.list = []
|
|
|
}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ fuYongFangFa().then((res) => {
|
|
|
+ fuYongFangFaShuJu.value = res
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+let jiaShuiLeiXing = [
|
|
|
+ {code: '加凉水', name: '加凉水'},
|
|
|
+ {code: '加温水', name: '加温水'},
|
|
|
+ {code: '加开水', name: '加开水'},
|
|
|
+ {code: '加冰水', name: '加冰水'},
|
|
|
+ {code: '加外糖水', name: '加外糖水'},
|
|
|
+ {code: '外敷', name: '外敷'},
|
|
|
+]
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style scoped></style>
|