|
@@ -0,0 +1,282 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="app-container1">
|
|
|
+ <el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="护理时间" align="center" prop="nursingTime" width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="实际计算天数" align="center" prop="calDays" />
|
|
|
+ <el-table-column label="计算原因" align="center" prop="calDayReason" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button link type="primary" icon="Edit" @click="check(scope.row)">查看</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="recordTotal>0"
|
|
|
+ :total="recordTotal"
|
|
|
+ v-model:page="queryRecordParams.pageNum"
|
|
|
+ v-model:limit="queryRecordParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ <!-- 显示某一天的打卡详细-->
|
|
|
+ <el-dialog title="查看当天打卡详细" v-model="openDay" width="800px" append-to-body>
|
|
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="护理时间" prop="nursingTime">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="queryParams.nursingTime"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择护理时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="clocksList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="护理时间" align="center" prop="nursingTime" width="180">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="图片数量" align="center" prop="imgNum" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">查看</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 添加或修改护理任务打卡对话框 -->
|
|
|
+ <el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="clocksRef" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="护理时间" prop="nursingTime">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.nursingTime"
|
|
|
+ type="datetime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placeholder="请选择护理时间"
|
|
|
+ :picker-options="pickerOptions" disabled
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片路径" prop="imgPaths">
|
|
|
+ <el-upload
|
|
|
+ v-model:file-list="fileLists"
|
|
|
+ :action="uploadImgUrl"
|
|
|
+ :headers="uploadHeaders"
|
|
|
+ list-type="picture-card"
|
|
|
+ :data="uploadImgData" disabled
|
|
|
+ >
|
|
|
+ <el-icon><Plus /></el-icon>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" type="textarea" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <span style="color: red">注:图片数量不能少于<cite style="font-weight: bolder;font-style: normal">{{leastNum}}</cite>张</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<style>
|
|
|
+.app-container1{
|
|
|
+ height: 700px;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<script setup name="Clocks">
|
|
|
+import { listClocks, getClocks, delClocks, addClocks, updateClocks,removeImg,getleastNum } from "@/api/care/clocks";
|
|
|
+import { ref,computed } from 'vue'
|
|
|
+import { Plus } from '@element-plus/icons-vue'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
+import {listRecords} from "@/api/care/records";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+
|
|
|
+const recordTotal=ref(0);
|
|
|
+const recordsList=ref([]);
|
|
|
+const clocksList = ref([]);
|
|
|
+const open = ref(false);
|
|
|
+const openDay=ref(false);
|
|
|
+const loading = ref(true);
|
|
|
+const showSearch = ref(true);
|
|
|
+const ids = ref([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
+const total = ref(0);
|
|
|
+const title = ref("");
|
|
|
+const leastNum=ref(0);
|
|
|
+const fileLists =ref([]);
|
|
|
+// 定义 props
|
|
|
+const props = defineProps({
|
|
|
+ applyId: {
|
|
|
+ type: Number,
|
|
|
+ required: true
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const data = reactive({
|
|
|
+ form: {},
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ applyId: props.applyId,
|
|
|
+ nursingTime: null,
|
|
|
+ imgPaths: null,
|
|
|
+ imgNum: null,
|
|
|
+ },
|
|
|
+ queryRecordParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ applyId: props.applyId
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const { queryParams, form, rules,queryRecordParams} = toRefs(data);
|
|
|
+const uploadImgData={applyId:props.applyId,"nursingDate":form.value.nursingTime};
|
|
|
+
|
|
|
+const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/care/clocks/upload"); // 上传的图片服务器地址
|
|
|
+const uploadHeaders={Authorization: 'Bearer ' + getToken()};
|
|
|
+const fileSize=1;
|
|
|
+
|
|
|
+/** 查询护理任务记录列表 */
|
|
|
+function getRecordList() {
|
|
|
+ loading.value = true;
|
|
|
+ listRecords(queryRecordParams.value).then(response => {
|
|
|
+ recordsList.value = response.rows;
|
|
|
+ recordTotal.value = response.total;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+async function check(row){
|
|
|
+ loading.value = true;
|
|
|
+ queryParams.value.nursingTime=row.nursingTime;
|
|
|
+ await getList();
|
|
|
+
|
|
|
+ openDay.value=true;
|
|
|
+ loading.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+/** 查询护理任务打卡列表 */
|
|
|
+function getList() {
|
|
|
+ loading.value = true;
|
|
|
+ listClocks(queryParams.value).then(response => {
|
|
|
+ clocksList.value = response.rows;
|
|
|
+ total.value = response.total;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 取消按钮
|
|
|
+function cancel() {
|
|
|
+ open.value = false;
|
|
|
+ reset();
|
|
|
+}
|
|
|
+
|
|
|
+// 表单重置
|
|
|
+function reset() {
|
|
|
+ form.value = {
|
|
|
+ clockId: null,
|
|
|
+ nursingRecordId: props.applyId,
|
|
|
+ nursingTime: null,
|
|
|
+ imgPaths: null,
|
|
|
+ imgNum: null,
|
|
|
+ delFlag: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ remark: null,
|
|
|
+ applyId:props.applyId
|
|
|
+ };
|
|
|
+ fileLists.value=[]
|
|
|
+ proxy.resetForm("clocksRef");
|
|
|
+}
|
|
|
+
|
|
|
+/** 搜索按钮操作 */
|
|
|
+function handleQuery() {
|
|
|
+ queryParams.value.pageNum = 1;
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+/** 重置按钮操作 */
|
|
|
+function resetQuery() {
|
|
|
+ proxy.resetForm("queryRef");
|
|
|
+ handleQuery();
|
|
|
+}
|
|
|
+
|
|
|
+// 多选框选中数据
|
|
|
+function handleSelectionChange(selection) {
|
|
|
+ ids.value = selection.map(item => item.clockId);
|
|
|
+ single.value = selection.length != 1;
|
|
|
+ multiple.value = !selection.length;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/** 修改按钮操作 */
|
|
|
+function handleUpdate(row) {
|
|
|
+ reset();
|
|
|
+ const _clockId = row.clockId || ids.value
|
|
|
+ getClocks(_clockId).then(response => {
|
|
|
+ form.value = response.data;
|
|
|
+ const imgs=response.data.imgPaths.split(",").filter(item => item.trim() !== "");
|
|
|
+ imgs.forEach(function (item){
|
|
|
+ console.info(item)
|
|
|
+ const obj={};
|
|
|
+ obj.name=''
|
|
|
+ obj.url=import.meta.env.VITE_APP_BASE_API + item
|
|
|
+ console.info(obj)
|
|
|
+ fileLists.value.push(obj);
|
|
|
+ })
|
|
|
+
|
|
|
+ open.value = true;
|
|
|
+ title.value = "查看护理任务打卡";
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function handleRemove(file, fileList) {
|
|
|
+ console.log('移除文件:', file, '剩余文件:', fileList);
|
|
|
+ //removeImg(file.response.imgUrl);
|
|
|
+}
|
|
|
+
|
|
|
+function handleSuccess(response, file, fileList)
|
|
|
+{
|
|
|
+ if(response.code==200){
|
|
|
+ fileLists.value=fileList;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//获取图片上传最少数量
|
|
|
+function findleastNum() {
|
|
|
+ getleastNum('need_img_num').then(response => {
|
|
|
+ leastNum.value=response.data.number;
|
|
|
+ });
|
|
|
+}
|
|
|
+findleastNum();
|
|
|
+getRecordList();
|
|
|
+</script>
|