|
@@ -3,7 +3,7 @@
|
|
|
<el-header style="height: 40px">
|
|
|
<el-button icon="el-icon-arrow-left" style="font-size: 14px" type="text" @click="router.go(-1)">返回</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
- <el-button type="primary" @click="quMuBan.dialog = true;dianJiaChaXunMuBan(0)">取模板</el-button>
|
|
|
+ <el-button type="primary" @click="muBanZuJian = true">取模板</el-button>
|
|
|
<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>
|
|
@@ -95,7 +95,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="药品编码:">
|
|
|
- <el-input v-model="caoYao.chargeCode" @click="dianJiCaoYaoBianMa"></el-input>
|
|
|
+ <el-input v-model="caoYao.chargeCode" @click="chaXunCaoYaoZuJian = true"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
@@ -118,6 +118,7 @@
|
|
|
</el-form>
|
|
|
<el-table :data="mingXi.list" :height="windowSize.h / 2.3" highlight-current-row stripe
|
|
|
@row-click="dianJiBianJi">
|
|
|
+ <el-table-column type="index"></el-table-column>
|
|
|
<el-table-column label="编码" prop="chargeCode"></el-table-column>
|
|
|
<el-table-column label="名称" prop="chargeCodeName"></el-table-column>
|
|
|
<el-table-column label="数量" prop="quantity"></el-table-column>
|
|
@@ -144,73 +145,11 @@
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
<!--搜索草药弹框-->
|
|
|
- <el-dialog v-model="caoYaoXinXi.dialog" title="搜索草药">
|
|
|
- <el-input ref="queryName" v-model="caoYaoXinXi.queryName" clearable
|
|
|
- style="width: 120px;" @keyup.enter="dianJiChaXunCaoYao(0)"></el-input>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <el-button icon="el-icon-search" type="primary" @click="dianJiChaXunCaoYao(0)">查询</el-button>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <el-tag>双击数据选中</el-tag>
|
|
|
- <el-divider></el-divider>
|
|
|
- <el-table :data="caoYaoXinXi.data" :height="windowSize.h / 2.1" highlight-current-row stripe
|
|
|
- @row-dblclick="dianJiXuanZhongCaoYao">
|
|
|
- <el-table-column label="编码" prop="chargeCode"></el-table-column>
|
|
|
- <el-table-column label="名称" prop="chargeCodeName"></el-table-column>
|
|
|
- <el-table-column label="单价" prop="retprice"></el-table-column>
|
|
|
- <el-table-column label="规格" prop="specification"></el-table-column>
|
|
|
- <el-table-column label="药房" prop="groupName"></el-table-column>
|
|
|
- <el-table-column label="包装大小" prop="serial">
|
|
|
- <template #default="scope">
|
|
|
- <span v-if="scope.row.serial === '01'">小包装</span>
|
|
|
- <span v-else-if="scope.row.serial === '99'">大包装</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-pagination
|
|
|
- :current-page="caoYaoXinXi.currentPage"
|
|
|
- :page-size="caoYaoXinXi.pageSize"
|
|
|
- :total="caoYaoXinXi.total"
|
|
|
- layout="total, prev, pager, next"
|
|
|
- @current-change="caoYaoFanYe">
|
|
|
- </el-pagination>
|
|
|
- </el-dialog>
|
|
|
- <!--取模板弹框-->
|
|
|
- <el-dialog v-model="quMuBan.dialog" title="取模板" width="60%">
|
|
|
- <el-container>
|
|
|
- <el-aside style="width: 180px;">
|
|
|
- <el-input v-model="quMuBan.queryName" placeholder="模板名称" style="width: 120px;"></el-input>
|
|
|
- <el-button @click="dianJiaChaXunMuBan(0)">查询</el-button>
|
|
|
- <el-table :data="quMuBan.muBan" :height="windowSize.h / 2.1" @row-click="dianJiChaKanMuBanXiangQing">
|
|
|
- <el-table-column label="名称" prop="patternName"></el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template #default="scope">
|
|
|
- <el-button circle icon="el-icon-delete" type="danger"
|
|
|
- @click="dianJiShanChuMuBan(scope.row,scope.$index)"></el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-aside>
|
|
|
- <el-main>
|
|
|
- <el-button :disabled="quMuBan.xuanZhongShuJu.length ===0" @click="dianJiXuanZhongMuBanShuJu">确定</el-button>
|
|
|
- <el-table :data="quMuBan.muBanXiangQing" :height="windowSize.h / 2.1"
|
|
|
- @selection-change="huoQuMuBanXuanZhongShuJu">
|
|
|
- <el-table-column type="selection"></el-table-column>
|
|
|
- <el-table-column label="编码" prop="chargeCode"></el-table-column>
|
|
|
- <el-table-column label="名称" prop="chargeCodeName"></el-table-column>
|
|
|
- <el-table-column label="规格" prop="specification"></el-table-column>
|
|
|
- <el-table-column label="数量" prop="quantity"></el-table-column>
|
|
|
- <el-table-column label="单价" prop="retprice"></el-table-column>
|
|
|
- <el-table-column label="药房" prop="groupNo"></el-table-column>
|
|
|
- <el-table-column label="包装大小" prop="serial">
|
|
|
- <template #default="scope">
|
|
|
- <span v-if="scope.row.serial === '01'">小包装</span>
|
|
|
- <span v-else-if="scope.row.serial === '99'">大包装</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-main>
|
|
|
- </el-container>
|
|
|
- </el-dialog>
|
|
|
+ <cha-xuan-cao-yao v-if="chaXunCaoYaoZuJian" :group-no="chuFang.groupNo"
|
|
|
+ @close="chaXunCaoYaoZuJian = false" @xuanZhongShuJu="dianJiXuanZhongCaoYao"></cha-xuan-cao-yao>
|
|
|
+ <!-- 获取草药模板 -->
|
|
|
+ <cao-yao-mu-ban v-if="muBanZuJian" @close="muBanZuJian = false"
|
|
|
+ @xuanZhongShuJu="dianJiXuanZhongMuBanShuJu"></cao-yao-mu-ban>
|
|
|
<!-- 下面是新增模板 -->
|
|
|
<el-dialog v-model="cunMuBan.dialog" center title="存模板">
|
|
|
模板名称:
|
|
@@ -223,23 +162,16 @@
|
|
|
import router from '@/router'
|
|
|
import {computed, onMounted, ref, watch} from "vue";
|
|
|
import {huanZheXinXi, youWuXuanZheHuanZhe} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
-import {
|
|
|
- baoCunCaoYao,
|
|
|
- chongFuMuBanMing,
|
|
|
- cunMuBanApi,
|
|
|
- fuYongFangFa,
|
|
|
- huoQuCaoYao,
|
|
|
- huoQuMuBan,
|
|
|
- muBanXiangQing,
|
|
|
- shanChuMuBan
|
|
|
-} from "@/api/zhu-yuan-yi-sheng/cao-yao-yi-zhu";
|
|
|
+import {baoCunCaoYao, chongFuMuBanMing, cunMuBanApi, fuYongFangFa} from "@/api/zhu-yuan-yi-sheng/cao-yao-yi-zhu";
|
|
|
import store from "@/store";
|
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
|
import {stringIsBlank} from "@/utils/blank-utils";
|
|
|
+import ChaXuanCaoYao from "@/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/ChaXuanCaoYao.vue";
|
|
|
+import CaoYaoMuBan from "@/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/CaoYaoMuBan.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "XinZhenCaoYao",
|
|
|
-
|
|
|
+ components: {CaoYaoMuBan, ChaXuanCaoYao},
|
|
|
setup() {
|
|
|
const windowSize = computed(() => {
|
|
|
return store.state.app.windowSize
|
|
@@ -282,17 +214,8 @@ export default {
|
|
|
list: [],
|
|
|
})
|
|
|
|
|
|
- /**
|
|
|
- * 查询的草药信息
|
|
|
- */
|
|
|
- const caoYaoXinXi = ref({
|
|
|
- queryName: '',
|
|
|
- dialog: false,
|
|
|
- data: [],
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 20,
|
|
|
- total: 0
|
|
|
- })
|
|
|
+
|
|
|
+ const chaXunCaoYaoZuJian = ref(false)
|
|
|
|
|
|
/**
|
|
|
* 查询草药信息中的 搜索框
|
|
@@ -305,28 +228,6 @@ export default {
|
|
|
*/
|
|
|
const fuYongFangFaShuJu = ref([])
|
|
|
|
|
|
-
|
|
|
- const dianJiCaoYaoBianMa = () => {
|
|
|
- caoYaoXinXi.value.dialog = true
|
|
|
- setTimeout(() => {
|
|
|
- queryName.value.focus()
|
|
|
- }, 100)
|
|
|
- }
|
|
|
-
|
|
|
- const dianJiChaXunCaoYao = (val) => {
|
|
|
- huoQuCaoYao(caoYaoXinXi.value.queryName, chuFang.value.groupNo, caoYaoXinXi.value.currentPage, caoYaoXinXi.value.pageSize, caoYaoXinXi.value.total).then((res) => {
|
|
|
- if (val === 0) {
|
|
|
- caoYaoXinXi.value.total = res.total
|
|
|
- }
|
|
|
- caoYaoXinXi.value.data = res.records
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- const caoYaoFanYe = (val) => {
|
|
|
- caoYaoXinXi.value.currentPage = val
|
|
|
- dianJiChaXunCaoYao(caoYaoXinXi.value.total)
|
|
|
- }
|
|
|
-
|
|
|
const dianJiXuanZhongCaoYao = (row) => {
|
|
|
let key = row.chargeCode + row.serial
|
|
|
if (mingXi.value.weiYi.indexOf(key) > -1) {
|
|
@@ -351,44 +252,17 @@ export default {
|
|
|
/**
|
|
|
* 下面是取模板的
|
|
|
*/
|
|
|
- const quMuBan = ref({
|
|
|
- dialog: false,
|
|
|
- muBan: [],
|
|
|
- queryName: '',
|
|
|
- muBanXiangQing: [],
|
|
|
- xuanZhongShuJu: [],
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 30,
|
|
|
- total: 0
|
|
|
- })
|
|
|
- const dianJiaChaXunMuBan = (val) => {
|
|
|
- huoQuMuBan(quMuBan.value.queryName, store.state.user.info.deptCode, quMuBan.value.currentPage, quMuBan.value.pageSize, quMuBan.value.total).then((res) => {
|
|
|
- quMuBan.value.muBan = res.records
|
|
|
- if (val === 0) {
|
|
|
- quMuBan.value.total = res.total
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- const dianJiChaKanMuBanXiangQing = ({patternName, deptCode}) => {
|
|
|
- muBanXiangQing(patternName, deptCode).then((res) => {
|
|
|
- quMuBan.value.muBanXiangQing = res
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- const huoQuMuBanXuanZhongShuJu = (val) => {
|
|
|
- quMuBan.value.xuanZhongShuJu = val
|
|
|
- }
|
|
|
+ const muBanZuJian = ref(false)
|
|
|
|
|
|
- const dianJiXuanZhongMuBanShuJu = () => {
|
|
|
+ const dianJiXuanZhongMuBanShuJu = (data) => {
|
|
|
let flag = false;
|
|
|
- for (let item of quMuBan.value.xuanZhongShuJu) {
|
|
|
+ for (let item of data) {
|
|
|
if (item.groupNo !== chuFang.value.groupNo) {
|
|
|
ElMessage.error("模板药房和当前药房不相同")
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- quMuBan.value.xuanZhongShuJu.forEach(item => {
|
|
|
+ data.forEach(item => {
|
|
|
let key = item.chargeCode + item.serial
|
|
|
if (mingXi.value.weiYi.indexOf(key) > -1) {
|
|
|
flag = true
|
|
@@ -400,7 +274,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
if (flag) {
|
|
|
- ElMessage.error('请勿重复添加。')
|
|
|
+ ElMessage({
|
|
|
+ showClose: true,
|
|
|
+ message: '请勿重复添加。',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -454,29 +332,13 @@ export default {
|
|
|
data.admissTimes = huanZheXinXi.value.admissTimes
|
|
|
data.list = mingXi.value.list
|
|
|
data.deptCode = store.state.user.info.deptCode
|
|
|
- console.log(data)
|
|
|
baoCunCaoYao(data).then((res) => {
|
|
|
- console.log(res)
|
|
|
+ router.go(-1)
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const dianJiShanChuMuBan = (row, index) => {
|
|
|
- ElMessageBox.confirm(`您确定删除<span style="color: teal">【${row.patternName}】</span>吗?`, '温馨提示', {
|
|
|
- type: "warning",
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- }).then(() => {
|
|
|
- shanChuMuBan(row.patternName, store.state.user.info.deptCode).then(() => {
|
|
|
- quMuBan.value.muBan.splice(index, 1)
|
|
|
- quMuBan.value.muBanXiangQing = []
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
fuYongFangFa().then(res => {
|
|
|
fuYongFangFaShuJu.value = res
|
|
@@ -497,24 +359,17 @@ export default {
|
|
|
],
|
|
|
fuYongFangFaShuJu,
|
|
|
mingXi,
|
|
|
- caoYaoXinXi,
|
|
|
- dianJiChaXunCaoYao,
|
|
|
windowSize,
|
|
|
dianJiXuanZhongCaoYao,
|
|
|
- caoYaoFanYe,
|
|
|
dianJiBianJi,
|
|
|
caoYao,
|
|
|
- dianJiCaoYaoBianMa,
|
|
|
queryName,
|
|
|
- quMuBan,
|
|
|
- dianJiaChaXunMuBan,
|
|
|
- dianJiChaKanMuBanXiangQing,
|
|
|
dianJiCunMuBan,
|
|
|
cunMuBan,
|
|
|
- dianJiXuanZhongMuBanShuJu,
|
|
|
- huoQuMuBanXuanZhongShuJu,
|
|
|
dianJiBaoCunCaoYao,
|
|
|
- dianJiShanChuMuBan
|
|
|
+ chaXunCaoYaoZuJian,
|
|
|
+ muBanZuJian,
|
|
|
+ dianJiXuanZhongMuBanShuJu
|
|
|
}
|
|
|
}
|
|
|
}
|