|
@@ -6,7 +6,7 @@
|
|
|
<el-button :disabled="mingXi.list.length === 0" type="success" @click="cunMuBan.dialog = true">存模板</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-button :disabled="mingXi.list.length === 0" type="success" @click="dianJiBaoCunCaoYao">保存数据</el-button>
|
|
|
- <cuo-wu-xin-xi/>
|
|
|
+ <cao-yao-cuo-wu-xin-xin :data="errorMsg"/>
|
|
|
</el-header>
|
|
|
<el-main>
|
|
|
<el-form label-width="120px">
|
|
@@ -186,6 +186,7 @@ import {yaoPinXiangMuPiPeiYiBao} from '@/api/public-api'
|
|
|
import CuoWuXinXi from '@/components/zhu-yuan-yi-sheng/CuoWuXinXi.vue'
|
|
|
import XcComboGrid from "@/components/xiao-chan/combo-grid/XcComboGrid";
|
|
|
import sleep from "@/utils/sleep";
|
|
|
+import CaoYaoCuoWuXinXin from "@/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/CaoYaoCuoWuXinXin.vue";
|
|
|
|
|
|
const props = defineProps({
|
|
|
saveSuccess: Function
|
|
@@ -422,25 +423,44 @@ const dianJiBaoCunCaoYao = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const errorMsg = ref({
|
|
|
+ data: {},
|
|
|
+ count: 0
|
|
|
+})
|
|
|
+
|
|
|
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) => {
|
|
|
+ if (res?.error) {
|
|
|
+ errorMsg.value.data = res.data
|
|
|
+ errorMsg.value.count = msgLength()
|
|
|
+ } else {
|
|
|
+ errorMsg.value.data = {}
|
|
|
+ errorMsg.value.count = 0
|
|
|
+ wipeData();
|
|
|
+ props.saveSuccess()
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- .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) => {
|
|
|
- wipeData()
|
|
|
- props.saveSuccess()
|
|
|
- })
|
|
|
- })
|
|
|
.catch(() => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const msgLength = () => {
|
|
|
+ let a = 0;
|
|
|
+ for (let dataKey in errorMsg.value.data) {
|
|
|
+ a += 1
|
|
|
+ }
|
|
|
+ return a
|
|
|
+}
|
|
|
+
|
|
|
const clearHerbalInformation = () => {
|
|
|
mingXi.value.weiYi = []
|
|
|
mingXi.value.list = []
|