NurseStationUI/src/views/system/stationItem/index.vue

1367 lines
40 KiB
Vue
Raw Normal View History

2022-09-20 17:14:55 +08:00
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="110px"
>
<el-form-item
2022-09-23 14:45:51 +08:00
label="护理站名称"
2022-09-20 17:14:55 +08:00
prop="nurseStationId"
label-width="100px"
>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
>
<el-option
2022-11-17 10:37:35 +08:00
v-for="item in handstationlist"
2022-09-20 17:14:55 +08:00
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="护理项目编号" prop="nurseItemCode">
<el-input
v-model="queryParams.nurseItemCode"
placeholder="请输入护理项目编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="护理项目名称" prop="nurseItemName">
<el-input
v-model="queryParams.nurseItemName"
placeholder="请输入护理项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
2022-09-23 14:45:51 +08:00
v-hasPermi="['system:stationItem:add']"
2022-09-20 17:14:55 +08:00
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
2022-09-23 14:45:51 +08:00
v-hasPermi="['system:stationItem:edit']"
2022-09-20 17:14:55 +08:00
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
2022-09-23 14:45:51 +08:00
v-hasPermi="['system:stationItem:remove']"
2022-09-20 17:14:55 +08:00
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleExport"
2022-11-18 12:49:07 +08:00
v-hasPermi="['system:stationItem:importStationItem']"
2022-09-20 17:14:55 +08:00
>导入</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="nurseItemList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
2022-09-22 08:32:14 +08:00
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="护理时长" style="margin-left: 120px">
<div
v-for="(item, index) in props.row.nurseStationItemPrices"
:key="index"
style="display: block"
>
{{ item.serveDurationUnit }}
</div>
</el-form-item>
2022-11-14 11:54:55 +08:00
<el-form-item label="价格(元)" style="margin-left: 30px">
2022-09-22 08:32:14 +08:00
<div
v-for="(item, index) in props.row.nurseStationItemPrices"
:key="index"
style="display: block"
>
{{ item.price }}
</div>
</el-form-item>
</el-form>
</template>
</el-table-column>
2022-09-20 17:14:55 +08:00
<el-table-column
label="所属护理站"
align="center"
prop="nurseStationName"
/>
2022-11-11 15:34:09 +08:00
<!-- <el-table-column label="护理类型" align="center" prop="nurseTypeName" /> -->
2022-09-20 17:14:55 +08:00
<el-table-column
label="护理项目编号"
align="center"
prop="nurseItemCode"
/>
<el-table-column
label="护理项目名称"
align="center"
prop="nurseItemName"
/>
2022-11-30 15:12:42 +08:00
<!-- <el-table-column
2022-09-20 17:14:55 +08:00
label="提前预约时长(h)"
align="center"
prop="advanceAppointDuration"
2022-11-30 15:12:42 +08:00
/> -->
2022-11-11 15:34:09 +08:00
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建人" align="center" prop="createBy" />
2022-09-20 17:14:55 +08:00
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
2022-11-14 11:49:47 +08:00
v-hasPermi="['system:stationItem:edit']"
2022-09-20 17:14:55 +08:00
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
2022-11-14 11:49:47 +08:00
v-hasPermi="['system:stationItem:remove']"
2022-09-20 17:14:55 +08:00
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改护理站护理项目对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
2022-09-22 08:32:14 +08:00
width="1120px"
2022-09-20 17:14:55 +08:00
append-to-body
:before-close="cancel"
>
<el-form
ref="form"
:model="form"
:rules="rules"
2022-09-22 08:32:14 +08:00
label-width="130px"
2022-09-20 17:14:55 +08:00
:inline="true"
>
2022-10-09 09:12:48 +08:00
<el-form-item label="所属护理站" required>
2022-09-20 17:14:55 +08:00
<template>
<el-button
type=""
@click="nurseStationshow = true"
style="
width: 208px;
text-align: left;
height: 36px;
color: #c0c4cc;
"
v-if="
this.form.nurseStationItem.nurseStationName ==
'请选择所属护理站'
"
>{{ form.nurseStationItem.nurseStationName }}</el-button
>
<el-button
type=""
@click="nurseStationshow = true"
v-else
style="
width: 208px;
text-align: left;
height: 36px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>{{ form.nurseStationItem.nurseStationName }}</el-button
>
</template>
</el-form-item>
2022-09-27 09:05:46 +08:00
<el-form-item
label="护理项目名称"
prop="nurseStationItem.nurseItemName"
>
2022-09-22 08:32:14 +08:00
<el-input
v-model="form.nurseStationItem.nurseItemName"
placeholder="请输入护理项目名称"
maxlength="50"
/>
</el-form-item>
2023-02-09 14:28:16 +08:00
<el-form-item label="护理项目分类" required>
<template>
<el-button
type=""
style="
width: 208px;
text-align: left;
height: 36px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #c0c4cc;
"
@click="clickClassifyshow"
v-if="
2023-02-09 15:13:59 +08:00
form.nurseStationItem.classifyName == '请选择护理项目分类'
2023-02-09 14:28:16 +08:00
"
2023-02-09 15:13:59 +08:00
>{{ form.nurseStationItem.classifyName }}</el-button
2023-02-09 14:28:16 +08:00
>
<el-button
type=""
style="
width: 208px;
text-align: left;
height: 36px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
@click="clickClassifyshow"
v-else
2023-02-09 15:13:59 +08:00
>{{ form.nurseStationItem.classifyName }}</el-button
2023-02-09 14:28:16 +08:00
>
</template>
</el-form-item>
2022-11-30 15:12:42 +08:00
<el-form-item label="排序" prop="nurseStationItem.sort">
<el-input
placeholder="请输入排序"
v-model="form.nurseStationItem.sort"
maxlength="10"
oninput="value=value.replace(/[^\d]/g,'')"
/>
2022-09-20 17:14:55 +08:00
</el-form-item>
2022-11-11 15:34:09 +08:00
<el-form-item label="项目头像" prop="nurseStationItem.itemPictureUrl">
<stationAcatar
style="width: 208px"
@imgUrl="imgUrl"
:img="form.nurseStationItem.itemPictureUrl"
:type="'itemPictureUrl'"
/>
</el-form-item>
2022-09-22 08:32:14 +08:00
<el-form-item
label="项目内容简介"
prop="nurseStationItem.nurseItemContent"
>
2022-11-30 15:12:42 +08:00
<editor
2023-02-08 16:19:01 +08:00
@imgs="imgs"
2022-11-30 15:12:42 +08:00
:min-height="82"
style="width: 90%"
2022-09-20 17:14:55 +08:00
maxlength="300"
v-model="form.nurseStationItem.nurseItemContent"
2022-12-02 15:30:10 +08:00
></editor>
2022-09-20 17:14:55 +08:00
</el-form-item>
2022-09-22 08:32:14 +08:00
<el-form-item label="项目时长和价格" required>
2022-09-20 17:14:55 +08:00
<el-table
2022-09-22 08:32:14 +08:00
ref="nurseStationItemPrices"
2022-09-20 17:14:55 +08:00
:data="form.nurseStationItemPrices"
2022-11-11 15:34:09 +08:00
style="margin-top: 20px; width: 900px"
2022-09-20 17:14:55 +08:00
>
<el-table-column
property="serveDurationUnit"
label="服务时长和单位"
align="center"
>
<template slot-scope="scope">
<el-input
v-model="scope.row.serveDurationUnit"
2022-11-11 15:34:09 +08:00
maxlength="6"
2022-09-20 17:14:55 +08:00
></el-input>
</template>
</el-table-column>
2022-11-11 15:34:09 +08:00
<el-table-column property="price" label="价格" align="center">
2022-09-20 17:14:55 +08:00
<template slot-scope="scope">
<el-input
2022-11-24 16:03:22 +08:00
v-model="scope.row.price"
2022-11-14 11:54:55 +08:00
placeholder="小数点后两位(元)"
2022-11-18 12:49:07 +08:00
min="0"
2022-11-24 14:52:01 +08:00
type="number"
2022-11-11 15:34:09 +08:00
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>6){value=value.slice(0,6)}"
2022-09-20 17:14:55 +08:00
></el-input>
</template>
</el-table-column>
2022-11-11 15:34:09 +08:00
<el-table-column property="description" label="描述" align="center">
2022-09-20 17:14:55 +08:00
<template slot-scope="scope">
<el-input
v-model="scope.row.description"
maxlength="300"
></el-input>
</template>
</el-table-column>
2022-11-11 15:34:09 +08:00
<el-table-column label="操作" align="center">
2022-09-20 17:14:55 +08:00
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="addnurseStationItemPrices"
>新增</el-button
>
<el-button
size="mini"
type="text"
@click="delnurseStationItemPrices(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-form-item>
2022-11-11 15:34:09 +08:00
2022-11-17 12:20:38 +08:00
<el-form-item label="护理项目耗材">
2022-09-20 17:14:55 +08:00
<el-button
type="primary"
size="small"
plain
@click="listStationConsumableinfo"
2022-11-04 14:00:14 +08:00
>添加护理项目耗材</el-button
2022-09-20 17:14:55 +08:00
>
<el-table
ref="singleTable"
:data="form.nurseStationItemConsumables"
2022-11-11 15:34:09 +08:00
style="margin-top: 20px; width: 900px"
2022-09-20 17:14:55 +08:00
>
<el-table-column
property="nurseStationConsumableId"
label="耗材包名称"
align="center"
>
<template slot-scope="scope">
{{ scope.row.consumableDetail }}
</template>
</el-table-column>
<el-table-column
property="consumableCount"
label="耗材包数量"
align="center"
>
<template slot-scope="scope">
<el-input
v-model="scope.row.consumableCount"
2022-11-23 16:37:28 +08:00
maxlength="9"
oninput="value=value.replace(/[^\d]/g,'')"
2022-09-20 17:14:55 +08:00
></el-input>
</template>
</el-table-column>
<el-table-column
property="consumablePrice"
label="耗材包单位"
align="center"
>
<template slot-scope="scope">
{{ scope.row.consumableUnit }}
</template>
</el-table-column>
<el-table-column
property="consumablePrice"
label="耗材包单价"
align="center"
>
<template slot-scope="scope">
{{ scope.row.consumablePrice }}
</template>
</el-table-column>
2022-09-22 08:32:14 +08:00
<el-table-column label="操作" align="center">
2022-09-20 17:14:55 +08:00
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="delConsumable(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
2023-02-09 14:28:16 +08:00
<!-- 护理项目分类 -->
<el-dialog
title="选择护理项目分类"
:visible.sync="Classifyshow"
width="1100px"
append-to-body
:before-close="cancelClassifyshow"
>
<el-form :model="classifyquery" label-width="150px" :inline="true">
<el-form-item label="护理项目分类编码" prop="classifyCode">
<el-input
v-model="classifyquery.classifyCode"
placeholder="请输入护理项目分类编码"
/>
</el-form-item>
<el-form-item label="护理项目分类名称" prop="classifyName">
<el-input
v-model="classifyquery.classifyName"
placeholder="请输入护理项目分类名称"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="classifylistInfo"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="classifylistcancel"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="classifylist"
@cell-dblclick="choiceclassify"
>
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="choiceclassify(scope.row)"
v-if="form.nurseStationItem.nurseClassifyId == scope.row.id"
></el-button>
<el-button
style="width: 15px; height: 15px"
circle
v-else
@click="choiceclassify(scope.row)"
>
</el-button>
</template>
</el-table-column>
<el-table-column
property="classifyCode"
label="护理项目分类编码"
align="center"
>
</el-table-column>
<el-table-column
property="classifyName"
label="护理项目分类名称"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="classifytotal > 0"
:total="classifytotal"
:page.sync="classifyquery.pageNum"
:limit.sync="classifyquery.pageSize"
@pagination="classifylistInfo"
/>
</el-dialog>
2022-09-20 17:14:55 +08:00
<!-- 护理站 -->
<el-dialog
2022-09-22 08:32:14 +08:00
title="选择护理站"
2022-09-20 17:14:55 +08:00
:visible.sync="nurseStationshow"
width="1100px"
append-to-body
:before-close="clicknurseStationshow"
>
<el-form
ref="form"
2022-11-11 15:34:09 +08:00
:model="getListByUserquery"
2022-09-20 17:14:55 +08:00
label-width="110px"
:inline="true"
>
2022-11-11 15:34:09 +08:00
<el-form-item label="护理站编码" prop="nurseStationCode">
2022-09-20 17:14:55 +08:00
<el-input
2022-11-11 15:34:09 +08:00
v-model="getListByUserquery.nurseStationCode"
placeholder="请输入护理站编码"
2022-09-20 17:14:55 +08:00
/>
</el-form-item>
2022-11-11 15:34:09 +08:00
<el-form-item label="护理站名称" prop="nurseStationName">
2022-09-22 08:32:14 +08:00
<el-input
2022-11-11 15:34:09 +08:00
v-model="getListByUserquery.nurseStationName"
placeholder="请输入护理站名称"
2022-09-22 08:32:14 +08:00
/>
</el-form-item>
2022-09-20 17:14:55 +08:00
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
2022-11-17 17:28:02 +08:00
@click="handleQuery2"
2022-09-20 17:14:55 +08:00
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="stationcancel"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
2022-11-11 15:34:09 +08:00
:data="nurseStationlist"
2022-09-20 17:14:55 +08:00
@cell-dblclick="choicestationid"
>
2022-11-17 17:28:02 +08:00
<el-table-column label="请选择" width="70" align="center">
2022-09-20 17:14:55 +08:00
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="choicestationid(scope.row)"
v-if="form.nurseStationItem.nurseStationId == scope.row.id"
></el-button>
<el-button
style="width: 15px; height: 15px"
circle
v-else
@click="choicestationid(scope.row)"
>
</el-button>
</template>
</el-table-column>
<el-table-column
2022-11-11 15:34:09 +08:00
property="nurseStationCode"
label="护理站编码"
2022-09-20 17:14:55 +08:00
align="center"
2022-11-11 15:34:09 +08:00
>
</el-table-column>
2022-09-20 17:14:55 +08:00
<el-table-column
2022-11-11 15:34:09 +08:00
property="nurseStationName"
2022-09-20 17:14:55 +08:00
label="护理站名称"
align="center"
2022-11-11 15:34:09 +08:00
>
</el-table-column>
<el-table-column property="phone" label="联系电话" align="center">
</el-table-column>
2022-09-20 17:14:55 +08:00
<el-table-column
2022-11-11 15:34:09 +08:00
property="address"
label="护理站地址"
2022-09-20 17:14:55 +08:00
align="center"
2022-11-11 15:34:09 +08:00
:show-overflow-tooltip="true"
>
</el-table-column>
2022-09-20 17:14:55 +08:00
</el-table>
<pagination
2022-11-11 15:34:09 +08:00
v-show="total4 > 0"
:total="total4"
:page.sync="getListByUserquery.pageNum"
:limit.sync="getListByUserquery.pageSize"
2022-11-17 17:28:02 +08:00
@pagination="getList"
2022-09-20 17:14:55 +08:00
/>
</el-dialog>
<!-- 耗材弹框 -->
<el-dialog
title="添加护理项目耗材"
:visible.sync="stationConsumableshow"
width="1100px"
append-to-body
:before-close="clickstationConsumableshow"
>
<el-form
ref="form"
:model="StationConsumablequeryParams"
label-width="110px"
:inline="true"
>
2022-11-18 12:49:07 +08:00
<el-form-item label="耗材包名称" prop="nurseStationId">
2022-09-20 17:14:55 +08:00
<el-input
v-model="StationConsumablequeryParams.consumableDetail"
2022-11-18 12:49:07 +08:00
placeholder="请输入耗材包名称"
2022-09-20 17:14:55 +08:00
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="listStationConsumableinfo"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="listStationConsumableinfocancel"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="stationConsumableList"
@cell-dblclick="cellchoiceConsumable"
>
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="delConsumable(scope.row)"
v-if="
form.nurseStationItemConsumables.find(
(e) => e.id == scope.row.id
)
"
></el-button>
<el-button
style="width: 15px; height: 15px"
circle
v-else
@click="choiceConsumable(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
label="护理站名称"
align="center"
prop="nurseStationName"
/>
<el-table-column
label="耗材包编号"
align="center"
prop="consumableCode"
/>
<el-table-column
2022-11-18 12:49:07 +08:00
label="耗材包名称"
2022-09-20 17:14:55 +08:00
align="center"
prop="consumableDetail"
/>
<el-table-column
label="耗材包单位"
align="center"
prop="consumableUnit"
/>
<el-table-column
label="耗材包价格"
align="center"
prop="consumablePrice"
/>
</el-table>
<el-button
type="primary"
size="mini"
@click="clickstationConsumableshow"
style="
margin-top: 20px;
margin-left: 85%;
width: 100px;
height: 40px;
font-size: 15px;
"
>选择完成</el-button
>
<pagination
v-show="total3 > 0"
:total="total3"
:page.sync="StationConsumablequeryParams.pageNum"
:limit.sync="StationConsumablequeryParams.pageSize"
@pagination="listStationConsumable"
/>
</el-dialog>
<!-- //导入 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStationConsumable } from "@/api/system/stationConsumable";
2022-09-22 08:32:14 +08:00
import stationAcatar from "../stationAvatar/index.vue";
2023-02-09 14:28:16 +08:00
import { listInfo } from "@/api/system/classifyItem.js";
2022-09-20 17:14:55 +08:00
import {
list,
getNurseItem,
delNurseItem,
addNurseItem,
updateNurseItem,
2022-11-11 15:34:09 +08:00
updatePicture,
2022-09-20 17:14:55 +08:00
} from "@/api/system/nurseItem";
import { getToken } from "@/utils/auth";
2022-09-23 14:45:51 +08:00
import { getListByUser } from "@/api/system/userlist.js";
2022-09-20 17:14:55 +08:00
export default {
2022-09-22 08:32:14 +08:00
components: { stationAcatar },
2022-09-20 17:14:55 +08:00
name: "NurseItem",
data() {
return {
2022-12-02 15:30:10 +08:00
imgsurl: { pictureUrlList: [] },
2022-09-20 17:14:55 +08:00
imageUrl: "",
2022-11-17 12:20:38 +08:00
imgone: "",
2022-11-17 17:28:02 +08:00
handstationlist: [],
2022-09-20 17:14:55 +08:00
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/stationItem/importData",
},
// 遮罩层
loading: true,
stationConsumableshow: false,
nurseStationshow: false,
2023-02-09 14:28:16 +08:00
Classifyshow: false,
2022-09-20 17:14:55 +08:00
// 选中数组
ids: [],
2023-02-08 16:19:01 +08:00
idd: 99999999,
2022-09-20 17:14:55 +08:00
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
2022-11-17 17:28:02 +08:00
// 总条数
2022-09-20 17:14:55 +08:00
total: 0,
total2: 0,
total3: 0,
2022-09-23 14:45:51 +08:00
total4: 0,
2022-09-20 17:14:55 +08:00
//耗材
stationConsumableList: [],
// 护理站护理项目表格数据
nurseItemList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
2022-09-23 14:45:51 +08:00
//权限查询
nurseStationlist: [],
nurseStationlist2: [],
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
2022-09-20 17:14:55 +08:00
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
nurseTypeId: null,
userId: null,
nurseItemCode: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
sort: null,
},
// 查询参数
StationConsumablequeryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
consumableDetail: null,
},
// 表单参数
form: {
nurseStationItem: {
nurseTypeId: null,
nurseItemName: "",
nurseItemContent: "",
advanceAppointDuration: "",
itemPictureUrl: "",
sort: "",
nurseStationName: "请选择所属护理站",
2023-02-09 15:13:59 +08:00
classifyName: "请选择护理项目分类",
2023-02-09 14:28:16 +08:00
nurseClassifyId: "",
2022-09-20 17:14:55 +08:00
},
},
2023-02-08 16:19:01 +08:00
idd: 1,
2022-09-20 17:14:55 +08:00
// 表单校验
rules: {
2022-09-27 09:05:46 +08:00
"nurseStationItem.nurseItemName": [
2022-09-22 08:32:14 +08:00
{ required: true, message: "护理项目名称不能为空", trigger: "blur" },
],
"nurseStationItem.nurseItemContent": [
{ required: true, message: "项目内容简介不能为空", trigger: "blur" },
],
2022-09-27 09:05:46 +08:00
"nurseStationItem.sort": [
{ required: true, message: "排序不能为空", trigger: "blur" },
],
2022-11-30 15:12:42 +08:00
// "nurseStationItem.advanceAppointDuration": [
// { required: true, message: "提前预约时长不能为空", trigger: "blur" },
// ],
2022-11-11 15:34:09 +08:00
"nurseStationItem.itemPictureUrl": [
{
required: true,
trigger: "blur",
message: "请选择项目头像",
},
],
2022-10-09 09:12:48 +08:00
nurseStationId: [
{ required: true, trigger: "blur", message: "请选择所属护理站" },
2022-09-20 17:14:55 +08:00
],
2022-10-09 09:12:48 +08:00
nurseTypeId: [
2022-09-20 17:14:55 +08:00
{ required: true, message: "请选择护理类型", trigger: "blur" },
],
},
2023-02-09 14:28:16 +08:00
classifyquery: {
pageNum: 1,
pageSize: 10,
classifyCode: null,
classifyName: null,
},
classifylist: [],
classifytotal: 0,
2022-09-20 17:14:55 +08:00
};
},
created() {
2022-09-23 14:45:51 +08:00
this.info();
2022-11-17 10:37:35 +08:00
this.infos();
2022-11-18 12:49:07 +08:00
// this.getList();
2023-02-09 14:28:16 +08:00
this.classifylistInfo();
2022-09-20 17:14:55 +08:00
},
methods: {
2023-02-09 14:28:16 +08:00
//// //护理项目list
//打开遮罩层
clickClassifyshow() {
this.Classifyshow = true;
this.classifylistcancel();
},
//关闭遮罩层
cancelClassifyshow() {
this.Classifyshow = false;
},
//选中
choiceclassify(e) {
this.form.nurseStationItem.nurseClassifyId = e.id;
2023-02-09 15:13:59 +08:00
this.form.nurseStationItem.classifyName = e.classifyName;
2023-02-09 14:28:16 +08:00
this.Classifyshow = false;
},
//重置
classifylistcancel() {
this.classifyquery = {
pageNum: 1,
pageSize: 10,
classifyCode: null,
classifyName: null,
};
this.classifylistInfo();
},
//搜索
classifylistInfo() {
listInfo(this.classifyquery).then((res) => {
this.classifylist = res.rows;
this.classifytotal = res.total;
});
},
2022-12-02 15:30:10 +08:00
imgs(item) {
this.imgsurl.pictureUrlList.push(item);
},
2022-09-22 08:32:14 +08:00
imgUrl(imgUrl) {
this.form.nurseStationItem.itemPictureUrl = imgUrl;
},
2022-09-20 17:14:55 +08:00
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/stationItem/downloadTemplate?fileType=1",
{},
2022-09-22 08:32:14 +08:00
`护理站项目信息导入模板.xlsx`
2022-09-20 17:14:55 +08:00
);
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
2022-11-17 12:20:38 +08:00
response.msg +
"</div>",
2022-09-20 17:14:55 +08:00
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//耗材包选择完成
stationConsumablechoiceok() {
this.form.nurseStationItemConsumables.forEach((e) => {
e.nurseStationConsumableId = e.id;
});
this.stationConsumableshow = false;
},
//删除已经选择的耗材包
delConsumable(item) {
this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
},
//双击耗材包
cellchoiceConsumable(item) {
if (this.form.nurseStationItemConsumables.find((e) => e.id == item.id)) {
this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
} else {
this.form.nurseStationItemConsumables.push(item);
}
},
//选择耗材宝
choiceConsumable(item) {
this.form.nurseStationItemConsumables.push(item);
},
//护理站页面选择护理站
choicestationid(item) {
this.form.nurseStationItem.nurseStationId = item.id;
2022-10-09 09:12:48 +08:00
// this.form.nurseStationId = item.id;
2022-09-20 17:14:55 +08:00
this.form.nurseStationItem.nurseStationName = item.nurseStationName;
this.StationConsumablequeryParams.nurseStationId = item.id;
this.nurseStationshow = false;
this.stationcancel();
},
//关闭护理站页面
clicknurseStationshow() {
this.stationcancel();
this.nurseStationshow = false;
},
//耗材包关闭
clickstationConsumableshow() {
this.listStationConsumableinfocancel();
this.stationConsumableshow = false;
},
// 耗材重置
listStationConsumableinfocancel() {
this.StationConsumablequeryParams.consumableDetail = null;
this.StationConsumablequeryParams.pageNum = 1;
this.StationConsumablequeryParams.pageSize = 10;
this.listStationConsumable();
},
//护理站重置
stationcancel() {
2022-11-11 15:34:09 +08:00
this.getListByUserquery = {
2022-09-20 17:14:55 +08:00
pageNum: 1,
pageSize: 10,
};
2022-11-17 17:28:02 +08:00
this.info();
2022-09-20 17:14:55 +08:00
},
2022-11-17 17:28:02 +08:00
//护理站搜索
handleQuery2() {
this.loading = true;
this.getListByUserquery.pageNum = 1;
this.info();
2022-09-20 17:14:55 +08:00
},
/** 耗材列表 */
listStationConsumable() {
listStationConsumable(this.StationConsumablequeryParams).then(
(response) => {
this.stationConsumableList = response.rows;
this.total3 = response.total;
}
);
},
listStationConsumableinfo() {
if (this.form.nurseStationItem.nurseStationId != null) {
listStationConsumable(this.StationConsumablequeryParams).then(
(response) => {
this.stationConsumableList = response.rows;
this.total3 = response.total;
this.stationConsumableshow = true;
}
);
} else {
this.$message.error("请先选择护理站");
}
},
/** 查询护理站护理项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.nurseItemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
2022-11-11 15:34:09 +08:00
var obj = { pictureUrlList: [] };
2022-11-17 12:20:38 +08:00
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
2022-11-11 15:34:09 +08:00
obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
2022-11-17 17:28:02 +08:00
updatePicture(obj).then((res) => {});
2022-11-11 15:34:09 +08:00
}
2022-12-02 15:30:10 +08:00
if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {});
}
this.imgsurl = { pictureUrlList: [] };
2022-09-20 17:14:55 +08:00
this.open = false;
this.reset();
},
//时长价格
addnurseStationItemPrices(item, index) {
2022-09-22 08:32:14 +08:00
if (this.form.nurseStationItemPrices.length == 5) {
this.$message.error("最多只能5条");
} else {
2023-02-08 16:19:01 +08:00
this.idd++;
2022-09-22 08:32:14 +08:00
var obj = {
serveDurationUnit: "",
price: "",
description: "",
2023-02-08 16:19:01 +08:00
idd: this.idd,
2022-09-22 08:32:14 +08:00
};
this.form.nurseStationItemPrices.push(obj);
}
2022-09-20 17:14:55 +08:00
},
delnurseStationItemPrices(item) {
2023-02-08 16:19:01 +08:00
if (item.idd && !item.nurseItemPriceId) {
2022-09-20 17:14:55 +08:00
if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.nurseStationItemPrices =
2023-02-08 16:19:01 +08:00
this.form.nurseStationItemPrices.filter((e) => e.idd != item.idd);
2022-09-20 17:14:55 +08:00
}
2023-02-08 16:19:01 +08:00
} else if (!item.idd && item.nurseItemPriceId) {
2022-09-20 17:14:55 +08:00
if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.nurseStationItemPrices =
2022-11-18 12:49:07 +08:00
this.form.nurseStationItemPrices.filter(
(e) => e.nurseItemPriceId != item.nurseItemPriceId
);
2022-09-20 17:14:55 +08:00
}
}
},
// 表单重置
reset() {
this.form = {
2022-11-17 17:28:02 +08:00
pageNum: 1,
pageSize: 10,
2022-09-20 17:14:55 +08:00
nurseStationItem: {
2022-10-09 09:12:48 +08:00
nurseTypeId: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
itemPictureUrl: null,
sort: null,
2022-09-20 17:14:55 +08:00
nurseStationName: "请选择所属护理站",
2023-02-09 15:13:59 +08:00
classifyName: "请选择护理项目分类",
2023-02-09 14:28:16 +08:00
nurseClassifyId: "",
2022-09-20 17:14:55 +08:00
},
2022-11-18 12:49:07 +08:00
nurseStationItemConsumables: [
// {
// nurseStationConsumableId: "",
// consumableCount: "",
// consumablePrice: "",
// },
],
nurseStationItemPrices: [
{
serveDurationUnit: null,
price: null,
description: null,
2023-02-08 16:19:01 +08:00
idd: this.idd,
2022-11-18 12:49:07 +08:00
},
],
2022-09-20 17:14:55 +08:00
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
2022-11-17 17:28:02 +08:00
if (this.nurseStationlist[0]) {
2022-11-11 15:34:09 +08:00
this.queryParams.pageNum = 1;
2022-11-17 17:28:02 +08:00
this.queryParams.pageSize = 10;
2022-09-26 16:10:51 +08:00
this.queryParams.nurseItemCode = null;
this.queryParams.nurseItemName = null;
}
2022-11-17 17:28:02 +08:00
this.handleQuery();
2022-09-20 17:14:55 +08:00
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
2022-11-14 11:07:57 +08:00
this.StationConsumablequeryParams.nurseStationId = null;
2022-09-20 17:14:55 +08:00
this.title = "添加护理站护理项目";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
2022-11-17 12:20:38 +08:00
this.StationConsumablequeryParams.nurseStationId = null;
2022-09-20 17:14:55 +08:00
const id = row.id || this.ids;
getNurseItem(id).then((response) => {
2022-11-18 12:49:07 +08:00
if (response.data.nurseStationItemConsumables) {
response.data.nurseStationItemConsumables.forEach((e) => {
e.id = e.nurseStationConsumableId;
});
} else {
response.data.nurseStationItemConsumables = [];
}
2022-09-20 17:14:55 +08:00
this.form = response.data;
2022-11-17 12:20:38 +08:00
this.StationConsumablequeryParams.nurseStationId =
response.data.nurseStationItem.nurseStationId;
2022-11-11 15:34:09 +08:00
this.imgone = this.form.nurseStationItem.itemPictureUrl;
2022-09-22 08:32:14 +08:00
if (this.form.nurseStationItemPrices == []) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
2023-02-08 16:19:01 +08:00
idd: this.idd,
2022-09-22 08:32:14 +08:00
};
this.form.nurseStationItemPrices.push(obj);
} else if (this.form.nurseStationItemPrices.length == 0) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
2023-02-08 16:19:01 +08:00
idd: this.idd,
2022-09-22 08:32:14 +08:00
};
this.form.nurseStationItemPrices.push(obj);
} else if (this.form.nurseStationItemPrices == null) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
2023-02-08 16:19:01 +08:00
idd: this.idd,
2022-09-22 08:32:14 +08:00
};
this.form.nurseStationItemPrices.push(obj);
}
2022-09-20 17:14:55 +08:00
this.open = true;
this.title = "修改护理站护理项目";
});
},
/** 提交按钮 */
submitForm() {
this.form.nurseStationItemConsumables.forEach((e) => {
e.nurseStationConsumableId = e.id;
2022-11-23 16:37:28 +08:00
e.consumableCount = Number(e.consumableCount);
2022-09-20 17:14:55 +08:00
});
2022-10-09 09:12:48 +08:00
this.form.nurseStationItem.nurseTypeId = this.form.nurseTypeId;
2022-09-20 17:14:55 +08:00
this.$refs["form"].validate((valid) => {
if (valid) {
2022-09-28 14:15:42 +08:00
if (this.form.nurseStationItem.id != null) {
2022-11-18 12:49:07 +08:00
this.form.nurseStationItemPrices.forEach((e) => {
e.nurseStationItemId = this.form.nurseStationItem.id;
});
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
2022-12-07 11:36:08 +08:00
this.imgsurl = { pictureUrlList: [] };
2022-11-24 16:03:22 +08:00
this.form.nurseStationItemPrices.forEach((e) => {
e.price = Number(e.price);
});
2022-11-30 16:05:13 +08:00
this.form.nurseStationItem.advanceAppointDuration = 0;
2022-09-20 17:14:55 +08:00
updateNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
2022-11-24 16:03:22 +08:00
this.form.nurseStationItemPrices.forEach((e) => {
e.price = Number(e.price);
});
2022-11-30 15:12:42 +08:00
this.form.nurseStationItem.advanceAppointDuration = 0;
2022-09-20 17:14:55 +08:00
addNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
2022-11-17 12:20:38 +08:00
this.$forceUpdate();
2022-09-20 17:14:55 +08:00
this.open = false;
this.getList();
});
}
}
2022-11-17 17:28:02 +08:00
});
2022-09-20 17:14:55 +08:00
},
2022-11-17 10:37:35 +08:00
infos() {
var queryFor = {
pageNum: 1,
2022-11-17 17:28:02 +08:00
pageSize: 9999,
2022-11-17 10:37:35 +08:00
};
getListByUser(queryFor).then((res) => {
this.handstationlist = res.rows;
2022-11-18 12:49:07 +08:00
this.queryParams.nurseStationId = res.rows[0].id;
this.getList();
2022-09-20 17:14:55 +08:00
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除此护理站护理项目?")
.then(function () {
2022-11-17 17:28:02 +08:00
return delNurseItem(ids);
2022-09-20 17:14:55 +08:00
})
.then(() => {
2022-11-16 11:40:24 +08:00
var obj = { pictureUrlList: [] };
2022-11-17 13:15:25 +08:00
obj.pictureUrlList.push(row.itemPictureUrl);
2022-11-17 17:28:02 +08:00
updatePicture(obj).then((res) => {});
2022-11-17 13:18:18 +08:00
this.getList();
2022-11-17 13:36:42 +08:00
this.$modal.msgSuccess("删除成功");
2022-09-20 17:14:55 +08:00
})
2022-11-17 12:28:18 +08:00
.catch(() => {});
2022-09-20 17:14:55 +08:00
},
/** 导入按钮操作 */
handleExport() {
2022-11-02 18:11:38 +08:00
this.upload.title = "护理站护理项目导入";
2022-09-20 17:14:55 +08:00
this.upload.open = true;
},
2022-09-23 14:45:51 +08:00
//权限列表
info() {
getListByUser(this.getListByUserquery).then((res) => {
2022-11-17 17:28:02 +08:00
this.total4 = res.total;
this.nurseStationlist = res.rows;
2022-09-23 14:45:51 +08:00
});
},
2022-09-20 17:14:55 +08:00
},
};
</script>
<style lang="scss" scoped>
2022-09-22 08:32:14 +08:00
::v-deep .el-table__cell .el-form-item--medium .el-form-item__content {
display: block;
}
// ::v-deep .el-form-item__label {
// font-weight: 550;
// }
2022-09-20 17:14:55 +08:00
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
2022-10-09 09:12:48 +08:00
</style>