Compare commits
No commits in common. "ad2f798b50d01e9c443426f05e61d25a19d40b9e" and "83abae6820a0dbb5817e5d3c7fe300d649c537dc" have entirely different histories.
ad2f798b50
...
83abae6820
|
|
@ -0,0 +1,131 @@
|
||||||
|
<template>
|
||||||
|
<Mask :is-show="isShow" @close="isShow = false" title="添加子项目">
|
||||||
|
<div style="display: flex">
|
||||||
|
<el-form
|
||||||
|
:model="form"
|
||||||
|
:rules="{name: [{required: true, message: '请输入项目名称', trigger: 'blur'}]}"
|
||||||
|
class="form"
|
||||||
|
label-width="auto"
|
||||||
|
>
|
||||||
|
<el-form-item label="项目名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
class="input"
|
||||||
|
v-model="form.name"
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<el-input v-model="search" placeholder="请输入搜索内容" style="width: 300px"></el-input>
|
||||||
|
<el-button type="primary" @click="addProject">添加项目</el-button>
|
||||||
|
<List :dataList="dataList" :search="search" ref="listRef" @selected="select"></List>
|
||||||
|
<div class="page">
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:page-size="size"
|
||||||
|
:current-page="current_page"
|
||||||
|
@current-change="current_page = $event"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
<div class="page_btn_list">
|
||||||
|
<el-button type="primary" @click="save">保存</el-button>
|
||||||
|
<el-button @click="close">取消</el-button>
|
||||||
|
<el-button @click="deleteDetail">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Mask>
|
||||||
|
<Mask :is-show="isShowAdd" @close="isShowAdd = false" title="子项目列表">
|
||||||
|
<ListChild @close="isShowAdd=false" @selected="selected"></ListChild>
|
||||||
|
</Mask>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {nextTick, ref, defineExpose, defineProps} from 'vue'
|
||||||
|
import Mask from "@/components/common/Mask.vue";
|
||||||
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
import {post} from "@/utils/request.ts"
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
import List from "@/components/settings/List.vue";
|
||||||
|
import ListChild from "@/components/settings/ListChild.vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
add: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const isShow = ref<any>(false)
|
||||||
|
const search = ref<any>('')
|
||||||
|
const current_page = ref<any>(1)
|
||||||
|
const size = ref<any>(20)
|
||||||
|
const total = ref<any>(0)
|
||||||
|
const dataList = ref<any>([])
|
||||||
|
const id = ref<any>('')
|
||||||
|
const init = (row: any) => {
|
||||||
|
isShow.value = true
|
||||||
|
id.value = row.id
|
||||||
|
form.value.name = row.name
|
||||||
|
if (row.itemJson) {
|
||||||
|
dataList.value = JSON.parse(row.itemJson)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const initData = () => {
|
||||||
|
isShow.value = true
|
||||||
|
}
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
const close = () => {
|
||||||
|
isShow.value = false
|
||||||
|
form.value = {name: '', ids: []}
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = ref<any>({name: '', ids: [], id: ''})
|
||||||
|
const save = () => {
|
||||||
|
if (dataList.value) {
|
||||||
|
dataList.value.forEach((item: any) => {
|
||||||
|
form.value.ids.push(item.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
form.value.ids = []
|
||||||
|
}
|
||||||
|
if (id.value) {
|
||||||
|
form.value.id = id.value
|
||||||
|
post('item/group/save', {data: form.value}).then(() => {
|
||||||
|
ElMessage.success('保存成功')
|
||||||
|
close()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
post('item/group/save', {data: form.value}).then(() => {
|
||||||
|
ElMessage.success('保存成功')
|
||||||
|
close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const addProject = () => {
|
||||||
|
isShowAdd.value = true
|
||||||
|
}
|
||||||
|
const listRef = ref<any>('')
|
||||||
|
const selected = (e: any) => {
|
||||||
|
dataList.value.push(...e)
|
||||||
|
}
|
||||||
|
const select = (e: any) => {
|
||||||
|
dataList.value = dataList.value.filter((item: any) => item.id != e.id)
|
||||||
|
}
|
||||||
|
const isShowAdd = ref<any>(false)
|
||||||
|
const deleteDetail = () => {
|
||||||
|
post('item/group/delete', {id: id.value}).then(() => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
defineExpose({init, initData})
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -76,7 +76,7 @@ import {defineProps, defineEmits, ref, nextTick, onMounted} from 'vue'
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import Mask from "@/components/common/Mask.vue";
|
import Mask from "@/components/common/Mask.vue";
|
||||||
import ItemSearch from "@/components/settings/item/ItemSearch.vue";
|
import ItemSearch from "@/components/settings/ItemSearch.vue";
|
||||||
import UnitSelector from "@/components/inventory/UnitSelector.vue";
|
import UnitSelector from "@/components/inventory/UnitSelector.vue";
|
||||||
import {itemUnitList} from "@/utils/unitList.ts"
|
import {itemUnitList} from "@/utils/unitList.ts"
|
||||||
|
|
||||||
|
|
@ -1,15 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<Mask :width="800" :height="600" :is-show="show" @close="show=false" title="项目组套列表" :show-footer="true">
|
<Mask :width="800" :height="600" :is-show="show" @close="show=false" title="项目列表" :show-footer="true">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="search_content_wrapper">
|
<div class="search_content_wrapper">
|
||||||
<div class="search_wrapper">
|
<div class="search_wrapper">
|
||||||
<el-button type="primary" @click="add">添加组套</el-button>
|
<span>药品名称:</span>
|
||||||
|
<el-input
|
||||||
|
class="input"
|
||||||
|
v-model="keyword"
|
||||||
|
placeholder="请输入药品名称或者编号"
|
||||||
|
@input="search_social"
|
||||||
|
clearable/>
|
||||||
|
<el-button type="primary" @click="add">添加项目</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<el-table :data="tableList" @row-click="rowClick">
|
<el-table :data="tableList" @row-click="rowClick">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="name"
|
prop="name"
|
||||||
label="组套名称">
|
label="项目名称">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="purchaseUnitPrice"
|
prop="purchaseUnitPrice"
|
||||||
|
|
@ -36,19 +43,33 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Mask>
|
</Mask>
|
||||||
<GroupAdd :add="true" ref="addGroupRef" @close="init"></GroupAdd>
|
<AddProject :add="true" ref="addProjectMaskRef" @close="init"></AddProject>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, nextTick} from "vue";
|
import {ref, nextTick} from "vue";
|
||||||
import {post} from '@/utils/request.ts'
|
import {post} from '@/utils/request.ts'
|
||||||
import Mask from "@/components/common/Mask.vue";
|
import Mask from "@/components/common/Mask.vue";
|
||||||
import GroupAdd from "@/components/settings/item/group/GroupAdd.vue";
|
import AddProject from "@/components/settings/AddProject.vue";
|
||||||
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
|
let current_search_data: any = null;
|
||||||
|
let keyword = ref('');
|
||||||
let current_page = ref(1)
|
let current_page = ref(1)
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
||||||
const emit = defineEmits(["confirm"])
|
const emit = defineEmits(["confirm"])
|
||||||
|
|
||||||
|
let search_result = ref({
|
||||||
|
totalPage: 0,
|
||||||
|
list: [],
|
||||||
|
pageNum: 1,
|
||||||
|
});
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
|
|
||||||
post("item/groupList", {
|
post("item/group/list", {
|
||||||
|
name: keyword.value,
|
||||||
page: current_page.value,
|
page: current_page.value,
|
||||||
size: 10,
|
size: 10,
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
|
|
@ -60,6 +81,15 @@ const init = () => {
|
||||||
};
|
};
|
||||||
defineExpose({init});
|
defineExpose({init});
|
||||||
|
|
||||||
|
function init_search_data() {
|
||||||
|
isloading.value = false;
|
||||||
|
current_search_data = null;
|
||||||
|
search_result.value = {
|
||||||
|
totalPage: 0,
|
||||||
|
list: [],
|
||||||
|
pageNum: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const tableList = ref<any>([
|
const tableList = ref<any>([
|
||||||
{
|
{
|
||||||
|
|
@ -68,16 +98,19 @@ const tableList = ref<any>([
|
||||||
unitPrice: '',
|
unitPrice: '',
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
let isloading = ref(false);
|
||||||
const addGroupRef = ref<any>(null);
|
let search_social = () => {
|
||||||
|
isloading.value = true;
|
||||||
|
}
|
||||||
|
const addProjectMaskRef = ref<any>(null);
|
||||||
const rowClick = (row: any) => {
|
const rowClick = (row: any) => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
addGroupRef.value?.init(row);
|
addProjectMaskRef.value?.init(row);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const add = () => {
|
const add = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
addGroupRef.value?.init(null);
|
addProjectMaskRef.value?.initData();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const total = ref<any>(0)
|
const total = ref<any>(0)
|
||||||
|
|
@ -1,148 +0,0 @@
|
||||||
<template>
|
|
||||||
<Mask :is-show="isShow" @close="close" title="添加组套">
|
|
||||||
<el-form :model="form" label-width="auto" ref="formRef">
|
|
||||||
<el-descriptions
|
|
||||||
:column="2"
|
|
||||||
direction="vertical"
|
|
||||||
border
|
|
||||||
>
|
|
||||||
<el-descriptions-item label="组套名称">
|
|
||||||
<el-form-item prop="itemName">
|
|
||||||
<el-input v-model="form.itemName"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="单位">
|
|
||||||
<el-form-item prop="unit">
|
|
||||||
<el-popover
|
|
||||||
placement="bottom"
|
|
||||||
title="Title"
|
|
||||||
trigger="click"
|
|
||||||
>
|
|
||||||
<template #reference>
|
|
||||||
<el-input v-model="form.unit"></el-input>
|
|
||||||
</template>
|
|
||||||
<UnitSelector :units="itemUnitList" v-model="form.unit"></UnitSelector>
|
|
||||||
</el-popover>
|
|
||||||
</el-form-item>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="原价">
|
|
||||||
<el-form-item>
|
|
||||||
<el-input v-model="form.purchaseUnitPrice" readonly>
|
|
||||||
<template #prefix>
|
|
||||||
¥
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="售价">
|
|
||||||
<el-form-item prop="unitPrice">
|
|
||||||
<el-input v-model="form.unitPrice" readonly>
|
|
||||||
<template #prefix>¥</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-form>
|
|
||||||
<div class="top">
|
|
||||||
<div class="default-btn" @click="openSearchDialog">添加子项目</div>
|
|
||||||
</div>
|
|
||||||
<el-table v-if="list.length>0" :data="list">
|
|
||||||
<el-table-column label="名称" prop="name"></el-table-column>
|
|
||||||
<el-table-column label="单位" prop="unit"></el-table-column>
|
|
||||||
<el-table-column label="医保编码" prop="socialCode"></el-table-column>
|
|
||||||
<el-table-column label="原价" prop="purchaseUnitPrice">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.purchaseUnitPrice" type="number">
|
|
||||||
<template #prefix>¥</template>
|
|
||||||
</el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="售价" prop="unitPrice">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.unitPrice" type="number">
|
|
||||||
<template #prefix>¥</template>
|
|
||||||
</el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<ItemSearch ref="createSearchRef" @confirm="createConfirm"/>
|
|
||||||
</Mask>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import {ref, defineExpose, nextTick, watch} from 'vue'
|
|
||||||
import Mask from "@/components/common/Mask.vue";
|
|
||||||
import ItemSearch from "@/components/settings/item/ItemSearch.vue";
|
|
||||||
const createSearchRef = ref<any>('')
|
|
||||||
import {itemUnitList} from "@/utils/unitList.ts"
|
|
||||||
import UnitSelector from "@/components/inventory/UnitSelector.vue";
|
|
||||||
const isShow = ref<any>(false)
|
|
||||||
const list=ref<any[]>([])
|
|
||||||
const id = ref<any>('')
|
|
||||||
const init = (row: any) => {
|
|
||||||
isShow.value = true
|
|
||||||
form.value=default_form
|
|
||||||
if(row!=null){
|
|
||||||
id.value = row.id
|
|
||||||
form.value.name = row.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const openSearchDialog=()=>{
|
|
||||||
nextTick(() => {
|
|
||||||
createSearchRef.value?.init(form.value.itemName);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const createConfirm= (data: any) => {
|
|
||||||
let row={
|
|
||||||
id:null,
|
|
||||||
name:data.name,
|
|
||||||
unit:data.unit,
|
|
||||||
socialCode:data.code,
|
|
||||||
purchaseUnitPrice:0,
|
|
||||||
unitPrice:0,
|
|
||||||
}
|
|
||||||
list.value.push(row)
|
|
||||||
calculateTotalPrices();
|
|
||||||
}
|
|
||||||
const emit = defineEmits(['close'])
|
|
||||||
const close = () => {
|
|
||||||
isShow.value = false
|
|
||||||
form.value = {name: '', ids: []}
|
|
||||||
emit('close')
|
|
||||||
}
|
|
||||||
const default_form={
|
|
||||||
id:null,
|
|
||||||
name:"",
|
|
||||||
unit:"次",
|
|
||||||
purchaseUnitPrice:"",
|
|
||||||
unitPrice:"",
|
|
||||||
}
|
|
||||||
const form = ref<any>(default_form)
|
|
||||||
const calculateTotalPrices = () => {
|
|
||||||
const totalPurchasePrice = list.value.reduce((sum, item) => sum + parseFloat(item.purchaseUnitPrice || 0), 0);
|
|
||||||
const totalPrice = list.value.reduce((sum, item) => sum + parseFloat(item.unitPrice || 0), 0);
|
|
||||||
|
|
||||||
form.value.purchaseUnitPrice = totalPurchasePrice.toFixed(2); // 可以保留两位小数
|
|
||||||
form.value.unitPrice = totalPrice.toFixed(2);
|
|
||||||
};
|
|
||||||
watch(
|
|
||||||
() => list.value.map(item => ({
|
|
||||||
purchaseUnitPrice: item.purchaseUnitPrice,
|
|
||||||
unitPrice: item.unitPrice
|
|
||||||
})),
|
|
||||||
() => {
|
|
||||||
calculateTotalPrices();
|
|
||||||
},
|
|
||||||
{ deep: true }
|
|
||||||
);
|
|
||||||
defineExpose({init})
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.page {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -18,9 +18,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="title-btn">
|
<div class="title-btn">
|
||||||
<span class="default-btn" @click="initData()">查询</span>
|
<span class="default-btn" @click="initData()">查询</span>
|
||||||
<span class="default-btn" @click="resetSearch">重置</span>
|
<span class="default-btn" @click="resetSearch" style="margin: 0 24px">重置</span>
|
||||||
<span class="default-btn" @click="openDialog">新建项目</span>
|
<span class="default-btn" @click="openDialog">新建项目</span>
|
||||||
<span class="default-btn" @click="openGroupDialog">组套</span>
|
<!-- <el-button type="primary" @click="openSetMenu">组套</el-button>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table">
|
<div class="table">
|
||||||
|
|
@ -54,19 +54,26 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ItemEdit :id="id" ref="ItemEditRef" @close="initData()"></ItemEdit>
|
<ItemEdit :id="id" ref="ItemEditRef" @close="initData()"></ItemEdit>
|
||||||
<GroupList ref="isOpenGroup"></GroupList>
|
<SetMenu ref="setMenuRef"></SetMenu>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {nextTick, onMounted, ref} from "vue";
|
import {nextTick, onMounted, ref} from "vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import Mask from "@/components/common/Mask.vue";
|
import Mask from "@/components/common/Mask.vue";
|
||||||
import ItemEdit from "@/components/settings/item/ItemEdit.vue";
|
import ItemEdit from "@/components/settings/ItemEdit.vue";
|
||||||
import GroupList from "@/components/settings/item/group/GroupList.vue";
|
import SetMenu from "@/components/settings/SetMenu.vue";
|
||||||
import {formatDate} from "@/utils/dateUtils.ts";
|
import {formatDate} from "@/utils/dateUtils.ts";
|
||||||
import {Plus} from "@element-plus/icons-vue"
|
import {Plus} from "@element-plus/icons-vue"
|
||||||
|
|
||||||
|
const state = ref([])
|
||||||
const isOpenGroup = ref();
|
const options = ref([
|
||||||
|
{
|
||||||
|
value: '选项1',
|
||||||
|
label: '黄金糕',
|
||||||
|
disabled: true
|
||||||
|
},
|
||||||
|
])
|
||||||
|
const selectRef = ref();
|
||||||
const emit = defineEmits(['selectCallBack'])
|
const emit = defineEmits(['selectCallBack'])
|
||||||
const isShow = ref(false)
|
const isShow = ref(false)
|
||||||
const ItemEditRef = ref<any>('')
|
const ItemEditRef = ref<any>('')
|
||||||
|
|
@ -89,9 +96,9 @@ onMounted(() => {
|
||||||
initData()
|
initData()
|
||||||
})
|
})
|
||||||
const setMenuRef = ref<any>('')
|
const setMenuRef = ref<any>('')
|
||||||
const openGroupDialog = () => {
|
const openSetMenu = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
isOpenGroup.value?.init();
|
setMenuRef.value?.init();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const changePage = (val: any) => {
|
const changePage = (val: any) => {
|
||||||
|
|
@ -119,15 +126,7 @@ const loading= ref(true)
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.title-btn{
|
|
||||||
.default-btn{
|
|
||||||
margin-right: 24px;
|
|
||||||
&:last-child{
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue