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