This commit is contained in:
wangweidong 2025-11-19 13:32:33 +08:00
commit 4b36343dde
2 changed files with 87 additions and 87 deletions

View File

@ -986,54 +986,54 @@
let startTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime;
let endTime = timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime;
let positioning = timearr.value[indexsave.value[0]].positioning;
// trim
const parseTime = (t) => {
const parts = String(t || '').split(':').map(s => s.trim());
const h = Number(parts[0] ?? 0);
const m = Number(parts[1] ?? 0);
return {
hour: Number.isFinite(h) ? h : 0,
minute: Number.isFinite(m) ? m : 0
};
const parts = String(t || '').split(':').map(s => s.trim());
const h = Number(parts[0] ?? 0);
const m = Number(parts[1] ?? 0);
return {
hour: Number.isFinite(h) ? h : 0,
minute: Number.isFinite(m) ? m : 0
};
};
const sOrig = parseTime(startTime);
const eOrig = parseTime(endTime);
// 24*60
let duration = (eOrig.hour * 60 + eOrig.minute) - (sOrig.hour * 60 + sOrig.minute);
if (duration < 0) duration += 24 * 60; //
// positioning
const newStartMin = Number(String(newtagName).trim());
const newHour = Number(String(positioning).trim());
//
if (!Number.isFinite(newStartMin) || newStartMin < 0 || newStartMin >= 60) {
throw new Error('newtagName 必须是 0-59 的数字字符串或数字');
throw new Error('newtagName 必须是 0-59 的数字字符串或数字');
}
if (!Number.isFinite(newHour) || newHour < 0) {
throw new Error('positioning 必须是有效小时(数字或数字字符串)');
throw new Error('positioning 必须是有效小时(数字或数字字符串)');
}
//
const newStartTotal = newHour * 60 + newStartMin;
const newEndTotal = newStartTotal + duration;
// /
const newEndHour = Math.floor(newEndTotal / 60) % 24; // 0-23
const newEndMin = newEndTotal % 60;
//
const pad2 = (n) => String(n).padStart(2, '0');
timearr.value[indexsave.value[0]].children[indexsave.value[1]].startTime =
`${String(newHour)}:${pad2(newStartMin)}`;
`${String(newHour)}:${pad2(newStartMin)}`;
timearr.value[indexsave.value[0]].children[indexsave.value[1]].endTime =
`${String(newEndHour)}:${pad2(newEndMin)}`;
`${String(newEndHour)}:${pad2(newEndMin)}`;
// const rest = startTime.split(":")[1]; // ":20"
// const rest0 = endTime.split(":")[1];; // ":20"
// let many = Number(rest0) - Number(rest);
@ -1575,9 +1575,9 @@
const shakyTable = ref(false);
const reldata = ref([]);
const deleteRuler = (index0 : number, index1 : number) => {
console.log("?????",timearr.value[index0].children[index1])
console.log("?????", timearr.value[index0].children[index1])
deleteDirective(timearr.value[index0].children[index1]).then((res : any) => {
if (res.success) {
geteverything()
}
@ -1804,6 +1804,11 @@
immediateFileFocus: "",
netImmediateFile: "",
tagName: timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].tagName,
mp3File: allobject.mp3File,
netMp3File: allobject.netMp3File,
mp4File: allobject.mp4File,
netMp4File: allobject.netMp4File,
serviceContent: allobject.serviceContent,
}
//
timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1] = param;
@ -1812,9 +1817,9 @@
index1: saveEditIndex.value.index1
}
whereEvent(data);
console.log("zou",haveValue)
console.log("zou", haveValue)
if (haveValue) {
editDirective(param).then((res : any) => {
if (res.success) {
geteverything()
@ -1860,7 +1865,7 @@
//
cleansettimeout.value = setTimeout(() => {
bottomItems.value[0].target = `#fff`;
console.log("即时指令看看进入了啥",pushValue)
console.log("即时指令看看进入了啥", pushValue)
addInstant(pushValue).then((res : any) => {
if (res.success) {
geteverything()
@ -1924,7 +1929,7 @@
const endHour = startHour + Math.floor(endMinute / 60)
const formattedStart = `${String(startHour)}:${String(startMinute).padStart(2, '0')}`
const formattedEnd = `${String(endHour)}:${String(endMinute % 60).padStart(2, '0')}`
console.log("allobject",allobject)
console.log("allobject", allobject)
let param = {
id: haveValue ? timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].id : "",
nuId: uni.getStorageSync('nuId'),
@ -1952,6 +1957,11 @@
immediateFileFocus: allobject.immediateFileFocus,
netImmediateFile: allobject.netImmediateFile,
tagName: timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1].tagName,
mp3File: allobject.mp3File,
netMp3File: allobject.netMp3File,
mp4File: allobject.mp4File,
netMp4File: allobject.netMp4File,
serviceContent: allobject.serviceContent,
}
//
timearr.value[saveEditIndex.value.index0].children[saveEditIndex.value.index1] = param;
@ -1960,7 +1970,7 @@
index1: saveEditIndex.value.index1
}
whereEvent(data);
console.log("日常指令看看进入了啥",param)
console.log("日常指令看看进入了啥", param)
if (haveValue) {
editDirective(param).then((res : any) => {
if (res.success) {
@ -1980,21 +1990,6 @@
if (!cansumit.value) {
return
}
//
// let postArray = [];
// timearr.value.forEach((element0, index0) => {
// element0.children.forEach((element1, index1) => {
// if (!element1.directiveName && !element1.id) {
// } else {
// element1.positioning = index0;
// element1.positioningLong = index1;
// postArray.push(element1)
// }
// })
// })
let info = []
@ -2094,7 +2089,7 @@
directiveName: '' // directiveName
}))
}))
console.log("wtf",res)
console.log("wtf", res)
res.result.serviceList.forEach((res : any) => {
timearr.value[res.positioning].children[res.positioningLong] = res;
})
@ -2123,10 +2118,10 @@
}
const savePackagelist = ref([]);
onMounted(() => {
// console.log("jiance",uni.getStorageSync('serverUrl'))
// uni.setStorageSync('serverUrl', `http://localhost:8091/nursing-unit_101`);
savePackagelist.value = uni.getStorageSync('Packagelist') || []
let res = uni.getStorageSync('saveTree')

View File

@ -213,19 +213,7 @@
</view>
</view>
<view style="display: flex;flex-wrap: wrap;width: 60%;">
<view style="
width: 40%;
height: 150rpx;
margin-right: 4%;
margin-top: 3%;
background-color: #F9F9F9;
display: flex;
justify-content: center;
align-items: center;
border-radius: 20rpx;
border-radius: 0.6vw;
overflow: hidden;
position: relative;" v-for="(item,index) in albumlist" :key="index">
<view class="moban-photo" v-for="(item,index) in albumlist" :key="index">
<view
style="width: 1.6vw;height: 1.6vw;z-index: 20;position: absolute; right: 0.1vw;top: 0.1vw;background: rgba(255, 255, 255, 0.7);display: flex;justify-content: center;align-items: center;"
@click.stop="deldex=index;open=1">
@ -234,17 +222,9 @@
<image style="width: 100%;height: 100%;" :src="item?item:'/static/zhanwei.png'" mode="aspectFill"
@click="previewImage(item,index,albumlist)" />
</view>
<view style="width: 40%;height: 150rpx;margin-right: 4%;margin-top: 3%;" v-if="albumlist.length<4" @click="uplod">
<view style="
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color:#fafdff ;
border: 1rpx solid #c4ebff;
border-radius: 20rpx;">
<view style="width: 40%;height: 150rpx;margin-right: 4%;margin-top: 3%;" v-if="albumlist.length<4"
@click="uplod(0)">
<view class="moban-photo-special">
<image style="width: 50rpx;height: 50rpx;margin-bottom: 5rpx;"
src="/static/index/warehouse/procurement/picking/addphoto.png" />
<view style="color: #78B1EB;font-size: 25rpx;">
@ -380,7 +360,9 @@
</view>
<view class="photowall-other-one" v-if="topbuttontarget==1">
<view
style="width: 100%;height: 70%;display: flex;flex-direction: column;justify-content: center;align-items: center;background-color:#fafdff ;border: 1rpx solid #78B1EB;border-radius: 30rpx;">
style="width: 100%;height: 70%;display: flex;flex-direction: column;justify-content: center;align-items: center;background-color:#fafdff ;border: 1rpx solid #78B1EB;border-radius: 30rpx;"
@click="uplod(1)"
>
<image style="width: 70rpx;height: 70rpx;margin-bottom: 5rpx;"
src="/static/index/warehouse/procurement/picking/addphoto.png" />
<view style="color: #78B1EB;">
@ -1141,7 +1123,7 @@
console.log("///", res);
opengys.value = false;
}
const openjianhuoclick = () => {
if (showvalue.value.jianhuobtn == false) {
return
@ -1464,9 +1446,9 @@
}
const InvoicingList = ref([])
const queryInvo = (index:number) => {
queryCgdInfoList(form).then(res => {
InvoicingList.value=res.result.records;
const queryInvo = (index : number) => {
queryCgdInfoList(form).then(res => {
InvoicingList.value = res.result.records;
clickmiddle(index);
})
}
@ -1537,17 +1519,12 @@
const badshow = ref(false);
const donghuacs = ref(false)
const bebad = () => {
// console.log("ceshi",Number(plsbuy.value[lefttarget.value]?.status))
// console.log("right?",plsbuy.value[lefttarget.value])
if (!Number(plsbuy.value[lefttarget.value]?.status) && plsbuy.value.length) {
badshow.value = true;
moreindex.value = -1;
donghuacs.value = false;
setTimeout(() => donghuacs.value = true, 50)
}
// return
}
const zuofei = () => {
voidedCgdMain({ id: plsbuy.value[lefttarget.value].id }).then((res : any) => {
@ -1573,26 +1550,27 @@
donghuaopo.value = false;
setTimeout(() => {
donghuaopo.value = true;
console.log("zzz", donghuaopo.value)
}, 100)
}
//
const albumlist = ref([])
const uplod = () => {
const uplod = (type:number) => {
uni.chooseImage({
count: 1, //9
sizeType: ['compressed'], //
sourceType: ['camera'], //
crop: {
quality: 60
},
success: (e) => {
let ar = JSON.stringify(e.tempFilePaths)
uni.compressImage({
src: JSON.parse(ar)[0],
quality: 60,
success: res => {
albumlist.value.push(res.tempFilePath)
if(!type){
albumlist.value.push(res.tempFilePath)
}else if(type==1){
console.log("成功!")
}
}
})
}
@ -3152,4 +3130,31 @@
font-size: 34rpx;
color: #999;
}
.moban-photo {
width: 40%;
height: 150rpx;
margin-right: 4%;
margin-top: 3%;
background-color: #F9F9F9;
display: flex;
justify-content: center;
align-items: center;
border-radius: 20rpx;
border-radius: 0.6vw;
overflow: hidden;
position: relative;
}
.moban-photo-special {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #fafdff;
border: 1rpx solid #c4ebff;
border-radius: 20rpx;
}
</style>