This commit is contained in:
parent
dcbd23b8e8
commit
8bf449d2da
|
|
@ -23,16 +23,16 @@ export const getServiceTree2 = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询表格
|
// 查询表格
|
||||||
export const getNclist = (nuId,elderId) => {
|
export const getNclist = (nuId,elderId,instructionTagId) => {
|
||||||
return request({
|
return request({
|
||||||
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/getNclist?nuId=${nuId}&elderId=${elderId}`,
|
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/getNclist?nuId=${nuId}&elderId=${elderId}&instructionTagId=${instructionTagId}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 保存表格
|
// 保存表格
|
||||||
export const addBatch = (params) => {
|
export const addBatch = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/addBatch`,
|
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/addBatch`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
|
|
@ -131,7 +131,7 @@ export const getDirectiveOrders = (date) => {
|
||||||
// 新增服务指令
|
// 新增服务指令
|
||||||
export const addDirective = (params) => {
|
export const addDirective = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/addDirective`,
|
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/addDirective`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
|
|
@ -147,7 +147,7 @@ export const addDirective = (params) => {
|
||||||
// 删除服务指令
|
// 删除服务指令
|
||||||
export const deleteDirective = (params) => {
|
export const deleteDirective = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/deleteDirective`,
|
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/deleteDirective`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
|
|
@ -155,8 +155,14 @@ export const deleteDirective = (params) => {
|
||||||
// 修改服务指令
|
// 修改服务指令
|
||||||
export const editDirective = (params) => {
|
export const editDirective = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: `${uni.getStorageSync('serverUrl')}/api/pad/${uni.getStorageSync('rulerbase')}/directive/editDirective`,
|
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/editDirective`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
export const getInstructionTag = () => {
|
||||||
|
return request({
|
||||||
|
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/getInstructionTag`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -422,7 +422,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="typeitem-one" :style="whitchtype===index?{color:`#fff`}:{}"
|
<view class="typeitem-one" :style="whitchtype===index?{color:`#fff`}:{}"
|
||||||
v-for="(item,index) in typearray" :key="index" @click="clicktype(index)">
|
v-for="(item,index) in typearray" :key="index" @click="clicktype(index)">
|
||||||
{{ item }}
|
{{ item.instructionName }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -853,7 +853,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, onUnmounted, toRaw } from 'vue';
|
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, onUnmounted, toRaw } from 'vue';
|
||||||
import { onShow, onHide } from '@dcloudio/uni-app';
|
import { onShow, onHide } from '@dcloudio/uni-app';
|
||||||
import { getNclist, addBatch, addDirective, addInstant, deleteDirective, editDirective } from "./api.js";
|
import { getNclist, addBatch, addDirective, addInstant, deleteDirective, editDirective ,getInstructionTag } from "./api.js";
|
||||||
import { myArray } from './yaoshandiao.js';
|
import { myArray } from './yaoshandiao.js';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -882,8 +882,15 @@
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
onMounted(() => {
|
||||||
|
uni.setStorageSync('rulerbase', "care")
|
||||||
|
getInstructionTag().then((res)=>{
|
||||||
|
typearray.value = res.result;
|
||||||
|
})
|
||||||
|
init()
|
||||||
|
})
|
||||||
|
|
||||||
const typearray = ["护理", "医疗", "后勤", "占位", "占位", "占位"]
|
const typearray = ref(["护理", "医疗", "后勤", "占位", "占位", "占位"])
|
||||||
|
|
||||||
|
|
||||||
const whitchtype = ref(0)
|
const whitchtype = ref(0)
|
||||||
|
|
@ -892,14 +899,12 @@
|
||||||
|
|
||||||
|
|
||||||
const clicktype = (index : number) => {
|
const clicktype = (index : number) => {
|
||||||
if (index < 3) {
|
|
||||||
whitchtype.value = index
|
whitchtype.value = index
|
||||||
|
init()
|
||||||
if (typebasearray[index]) {
|
// if (typebasearray[index]) {
|
||||||
uni.setStorageSync('rulerbase', typebasearray[index])
|
// uni.setStorageSync('rulerbase', typebasearray[index])
|
||||||
init()
|
// init()
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const canmovechange = ref(true);
|
const canmovechange = ref(true);
|
||||||
|
|
@ -958,7 +963,7 @@
|
||||||
});
|
});
|
||||||
const killruleclick = () => {
|
const killruleclick = () => {
|
||||||
isDelete.value = false;
|
isDelete.value = false;
|
||||||
deleteDirective({ id: postitem.value.id }).then((res) => {
|
deleteDirective({ id: postitem.value.id ,instructionTagId:typearray.value[whitchtype.value]?.instructionType}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
geteverything()
|
geteverything()
|
||||||
if (saveEditIndex.value.index0 != -1) {
|
if (saveEditIndex.value.index0 != -1) {
|
||||||
|
|
@ -1042,6 +1047,7 @@
|
||||||
cycleValue: nosave.value.cycleValue,
|
cycleValue: nosave.value.cycleValue,
|
||||||
optCount: nosave.value.optCount,
|
optCount: nosave.value.optCount,
|
||||||
optTime: ts,
|
optTime: ts,
|
||||||
|
instructionTagId:typearray.value[whitchtype.value]?.instructionType
|
||||||
}
|
}
|
||||||
// console.log("啥情况", data)
|
// console.log("啥情况", data)
|
||||||
|
|
||||||
|
|
@ -1147,7 +1153,9 @@
|
||||||
directiveId: allobject.id,
|
directiveId: allobject.id,
|
||||||
izPackage: `N`,
|
izPackage: `N`,
|
||||||
cycleTypeId: 2,
|
cycleTypeId: 2,
|
||||||
|
instructionTagId:typearray.value[whitchtype.value]?.instructionType
|
||||||
}
|
}
|
||||||
|
console.log("kankan", postdata, res)
|
||||||
addDirective(postdata).then((res) => {
|
addDirective(postdata).then((res) => {
|
||||||
console.log("kankan", postdata, res)
|
console.log("kankan", postdata, res)
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
@ -1325,6 +1333,7 @@
|
||||||
infoValue.positioningLong = indexsave.value[1];
|
infoValue.positioningLong = indexsave.value[1];
|
||||||
infoValue.startTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime;
|
infoValue.startTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime;
|
||||||
infoValue.endTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime;
|
infoValue.endTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime;
|
||||||
|
infoValue.instructionTagId = typearray.value[whitchtype.value]?.instructionType
|
||||||
|
|
||||||
editDirective(infoValue).then((res : any) => {
|
editDirective(infoValue).then((res : any) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
@ -1623,6 +1632,7 @@
|
||||||
|
|
||||||
const reldata = ref([]);
|
const reldata = ref([]);
|
||||||
const deleteRuler = (index0 : number, index1 : number) => {
|
const deleteRuler = (index0 : number, index1 : number) => {
|
||||||
|
// timearr.value[index0]?.children[index1].instructionTagId = typearray.value[whitchtype.value]?.instructionType;
|
||||||
deleteDirective(timearr.value[index0]?.children[index1]).then((res : any) => {
|
deleteDirective(timearr.value[index0]?.children[index1]).then((res : any) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
geteverything()
|
geteverything()
|
||||||
|
|
@ -1670,6 +1680,7 @@
|
||||||
let animTimer = null
|
let animTimer = null
|
||||||
|
|
||||||
const doaddDirective = (element : any) => {
|
const doaddDirective = (element : any) => {
|
||||||
|
console.log(element,1683)
|
||||||
addDirective(element).then((res) => {
|
addDirective(element).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
geteverything()
|
geteverything()
|
||||||
|
|
@ -1690,7 +1701,7 @@
|
||||||
killisopen.value = false;
|
killisopen.value = false;
|
||||||
deleteshake.value = false;
|
deleteshake.value = false;
|
||||||
detailshake.value = false;
|
detailshake.value = false;
|
||||||
deleteDirective({ id: killthisid.value.id }).then((res) => {
|
deleteDirective({ id: killthisid.value.id ,instructionTagId:typearray.value[whitchtype.value]?.instructionType}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
geteverything()
|
geteverything()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
@ -1749,6 +1760,7 @@
|
||||||
serviceContent: allobject.serviceContent,
|
serviceContent: allobject.serviceContent,
|
||||||
netPreviewFile: allobject.netPreviewFile,
|
netPreviewFile: allobject.netPreviewFile,
|
||||||
netPreviewFileSmall: allobject.netPreviewFileSmall,
|
netPreviewFileSmall: allobject.netPreviewFileSmall,
|
||||||
|
instructionTagId:typearray.value[whitchtype.value]?.instructionType
|
||||||
}
|
}
|
||||||
//给表格赋值
|
//给表格赋值
|
||||||
timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1] = param;
|
timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1] = param;
|
||||||
|
|
@ -1788,7 +1800,8 @@
|
||||||
nuName: uni.getStorageSync('nuName'),
|
nuName: uni.getStorageSync('nuName'),
|
||||||
elderId: uni.getStorageSync('elderId'),
|
elderId: uni.getStorageSync('elderId'),
|
||||||
elderName: uni.getStorageSync('NUall').elderInfo.name,
|
elderName: uni.getStorageSync('NUall').elderInfo.name,
|
||||||
tagList: info
|
tagList: info,
|
||||||
|
instructionTagId:typearray.value[whitchtype.value]?.instructionType
|
||||||
}
|
}
|
||||||
|
|
||||||
addBatch(allvalue).then(() => {
|
addBatch(allvalue).then(() => {
|
||||||
|
|
@ -1844,8 +1857,8 @@
|
||||||
const geteverything = () => {
|
const geteverything = () => {
|
||||||
// console.log("有老人吗",uni.getStorageSync('elderId'))
|
// console.log("有老人吗",uni.getStorageSync('elderId'))
|
||||||
if (uni.getStorageSync('nuId') && uni.getStorageSync('elderId')) {
|
if (uni.getStorageSync('nuId') && uni.getStorageSync('elderId')) {
|
||||||
getNclist(uni.getStorageSync('nuId'), uni.getStorageSync('elderId')).then((res : any) => {
|
getNclist(uni.getStorageSync('nuId'), uni.getStorageSync('elderId'),typearray.value[whitchtype.value]?.instructionType).then((res : any) => {
|
||||||
// console.log("通了吗", res.result.serviceList)
|
console.log("通了吗", res,uni.getStorageSync('nuId'),typearray.value[whitchtype.value]?.instructionType)
|
||||||
timearr.value = Array.from({ length: 24 }, (_, hour) => ({
|
timearr.value = Array.from({ length: 24 }, (_, hour) => ({
|
||||||
positioning: hour.toString(),
|
positioning: hour.toString(),
|
||||||
children: minuteArr.map(time => ({
|
children: minuteArr.map(time => ({
|
||||||
|
|
@ -2007,10 +2020,7 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
uni.setStorageSync('rulerbase', "care")
|
|
||||||
init()
|
|
||||||
})
|
|
||||||
const hournow = ref(new Date().getHours());
|
const hournow = ref(new Date().getHours());
|
||||||
// 表格进来就给我居中
|
// 表格进来就给我居中
|
||||||
function timeNowMove() {
|
function timeNowMove() {
|
||||||
|
|
@ -2368,6 +2378,7 @@
|
||||||
startTime: formattedStart,
|
startTime: formattedStart,
|
||||||
izPackage: servertype.value ? `Y` : `N`,
|
izPackage: servertype.value ? `Y` : `N`,
|
||||||
cycleTypeId: 1,
|
cycleTypeId: 1,
|
||||||
|
instructionTagId:typearray.value[whitchtype.value]?.instructionType
|
||||||
}
|
}
|
||||||
if (cardvalue.directiveId) {
|
if (cardvalue.directiveId) {
|
||||||
if (refreshtype.value) {
|
if (refreshtype.value) {
|
||||||
|
|
@ -2394,6 +2405,7 @@
|
||||||
openerror.value = true
|
openerror.value = true
|
||||||
return // ✅ 这次是真的 return 出函数了
|
return // ✅ 这次是真的 return 出函数了
|
||||||
}
|
}
|
||||||
|
console.log(postdata,2408)
|
||||||
addDirective(postdata).then((res) => {
|
addDirective(postdata).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
geteverything()
|
geteverything()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue