@studio-west/employees 0.6.19 → 0.6.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SheetTable.cjs +3 -3
- package/dist/SheetTable.js +112 -114
- package/dist/WorkTable.cjs +4 -4
- package/dist/WorkTable.js +84 -83
- package/package.json +1 -1
package/dist/SheetTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),O=require("vue-i18n"),v=require("./index-Dn3djtwj.cjs"),o=require("element-plus"),P={style:{height:"20px",width:"100%",display:"inline-block"}},U={style:{height:"20px",width:"100%",display:"inline-block"}},K={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(
|
|
2
|
-
`+
|
|
3
|
-
`+
|
|
1
|
+
"use strict";const e=require("vue"),O=require("vue-i18n"),v=require("./index-Dn3djtwj.cjs"),o=require("element-plus"),P={style:{height:"20px",width:"100%",display:"inline-block"}},U={style:{height:"20px",width:"100%",display:"inline-block"}},K={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(N){const g=N,{t:i,d:E}=O.useI18n(),c=e.ref([]),w=e.ref("0"),h=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(w.value))),m=e.ref([]),p=e.ref("all"),k=e.ref([{value:"all",label:"Все",key:"all"}]),V=e.ref([]),D=e.ref(0),b=e.ref([]),T=e.ref([]),x=e.ref([]);e.watch(p,async(a,l)=>{a!==l&&(b.value=[],confirm.value=!1,g.odata.personal.forEach(t=>{t.divisionName===a&&(b.value.some(u=>(u==null?void 0:u.activeText)===t.roleName)||b.value.push({val:!0,activeText:t.roleName}))}),S())}),e.watch(w,a=>{h.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),I()});const r=e.computed(()=>c.value.flatMap((a,l)=>[{...a,key:0,ids:l},{...a,key:1,ids:l}])),F=a=>{if(a.columnIndex<2||a.columnIndex>m.value.length+3&&a.columnIndex<m.value.length+9||a.columnIndex>m.value.length+11)return r.value[a.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},I=()=>{const a=V.value,l=new Date(h.value),t=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let u=[],y=0;for(let n=1;n<=t;n++){const s=v.parseTime(l.setDate(n),"{Y}-{m}-{dd}");y+=a.nowork.includes(s)||a.holidays.includes(s)?0:a.preholidays.includes(s)?7:8;let d=a.nowork.includes(s)?"nowork":a.holidays.includes(s)?"holiday":a.preholidays.includes(s)?"preholiday":"";u.push({day:n,holidays:d,weekday:E(new Date(l.getFullYear(),l.getMonth(),n),"day")})}D.value=y,m.value=u,g.odata.getPersonal({}).then(n=>{var s;p.value=(s=n.find(d=>d.employeeName===g.fullName))==null?void 0:s.divisionName,n.forEach(d=>{k.value.some(f=>(f==null?void 0:f.value)===d.divisionName)||k.value.push({value:d.divisionName,label:d.divisionName,key:d.divisionName}),d.divisionName===p.value&&!b.value.some(f=>(f==null?void 0:f.activeText)===d.roleName)&&b.value.push({val:!0,activeText:d.roleName})}),S()})},S=()=>{c.value=[],x.value=[],T.value=[],g.odata.personal.forEach(a=>{if(a.divisionName===p.value&&b.value.some(l=>l.val&&l.activeText===a.roleName)){let l=v.byInitials(a.employeeName);x.value.push(a.employeeKey),c.value.push({name:l+" ("+a.roleName+")",code:a.employeeKey,days:[],contHour:0,id:!1,ids:c.value.length})}}),g.workSchedule.getUsersYear({code:x.value,year:new Date(h.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&T.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),Y()})},Y=()=>{g.workSchedule.getWorkSchedule({code:x.value,date:v.parseTime(new Date(h.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,t)=>{var u,y;if(l!==null){l.data.days.forEach(n=>n.state="Я");for(let n=1;n<=m.value.length;n++){let s=v.parseTime(new Date(h.value).setDate(n),"{Y}-{m}-{dd}");const d=(u=l.data)==null?void 0:u.days.findIndex(f=>f.day===s);d===-1?c.value[t].days.push({day:s,time:"-",state:"В"}):c.value[t].days.push((y=l.data)==null?void 0:y.days[d])}}else{c.value[t].days=[];for(let n=1;n<=m.value.length;n++)m.value[n-1].holidays===""?B(n,t,8):m.value[n-1].holidays==="preholiday"?B(n,t,7):c.value[t].days.push({day:v.parseTime(new Date(h.value).setDate(n),"{Y}-{m}-{dd}"),time:"-",state:"В"})}for(let n=1;n<=m.value.length;n++){let s=new Date(new Date(h.value).getFullYear(),new Date(h.value).getMonth(),n).getTime()+1e3;for(let d of T.value){const{dateStart:f,dateEnd:M,code:q}=d;if(f&&M&&q===l.code){const j=new Date(v.parseDate(f)).getTime(),A=new Date(v.parseDate(M)).getTime();if(s>=j&&s<=A){const C=v.parseTime(new Date(h.value).setDate(n),"{Y}-{m}-{dd}"),_=c.value[t].days.findIndex(L=>L.day===C);_!==-1?c.value[t].days[_]={day:C,time:"-",state:"О"}:c.value[t].days.push({day:C,time:"-",state:"О"})}}}}}),H()})},B=(a,l,t)=>{const u=v.parseTime(new Date(h.value).setDate(a),"{Y}-{m}-{dd}");c.value[l].days.push({day:u,time:t,state:"Я"})},H=()=>{c.value.forEach(a=>{a.hourI=0,a.hourII=0,a.halfII=0,a.halfI=0,a.weekend=0,a.weekendDays=0,a.night=0;for(let l=0;l<a.days.length;l++)l<15&&a.days[l].time!=="-"&&(a.hourI+=a.days[l].time),l<15&&a.days[l].state==="Я"&&a.halfI++,l>=15&&a.days[l].time!=="-"&&(a.hourII+=a.days[l].time),l>=15&&a.days[l].state==="Я"&&a.halfII++,a.days[l].state==="Н"&&(a.night+=a.days[l].time),a.days[l].state==="РВ"&&(a.weekend+=a.days[l].time),a.days[l].state==="В"&&a.weekendDays++;a.contDays=a.halfI+a.halfII,a.contHour=a.hourI+a.hourII,a.overtime=0,D.value<a.contHour&&(a.overtime=a.contHour-D.value),a.numberNonAppearing=0,a.appearing={code:"-",countH:"-"}})},$=(a,l)=>{var n,s;if(l===-1)return"";const t=new Date(h.value),u=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,y=r.value[l].days.findIndex(d=>d.day===u);return y===-1?"":r.value[l].key===0?(n=r.value[l].days[y])==null?void 0:n.state:(s=r.value[l].days[y])==null?void 0:s.time};return v.holidays().then(a=>{V.value=a,I()}),(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[N.checkEdit?(e.openBlock(),e.createBlock(e.unref(o.ElSelect),{key:0,modelValue:p.value,"onUpdate:modelValue":l[0]||(l[0]=t=>p.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,t=>(e.openBlock(),e.createBlock(e.unref(o.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),l[2]||(l[2]=e.createElementVNode("div",{class:"expander"},null,-1)),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(o.ElSwitch),{key:1,modelValue:w.value,"onUpdate:modelValue":l[1]||(l[1]=t=>w.value=t),"active-text":e.unref(i)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"-1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(o.ElTable),{id:"printTable",data:r.value,"span-method":F,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(i)("sheet.emptyText"),align:"center",onCellClick:a.coMenu},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.title",{name:p.value})+e.unref(E)(h.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.employee"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.personnelNumber"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.day},[t.day<=15?(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:0,width:"30","class-name":t.holidays,align:"center",label:t.day.toString()+`
|
|
2
|
+
`+t.weekday},{default:e.withCtx(u=>[e.createElementVNode("div",P,e.toDisplayString($(t.day,u.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"I"}),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].key===0?r.value[t.$index].halfI:r.value[t.$index].hourI),1)]),_:1},8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.day},[t.day>15?(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:0,width:"30","class-name":t.holidays,align:"center",label:t.day.toString()+`
|
|
3
|
+
`+t.weekday},{default:e.withCtx(u=>[e.createElementVNode("div",U,e.toDisplayString($(t.day,u.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"II"}),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].key===0?r.value[t.$index].halfII:r.value[t.$index].hourII),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.workedMonth"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.days"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].contDays),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.hours"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.all"),align:"center","label-class-name":"turn",width:"40"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].contHour),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.overtime"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].overtime),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.night"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].night),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.weekend"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].weekend),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].numberNonAppearing),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.them"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.code"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(t=>{var u;return[e.createTextVNode(e.toDisplayString((u=r.value[t.$index].appearing)==null?void 0:u.code),1)]}),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.count"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(t=>{var u;return[e.createTextVNode(e.toDisplayString((u=r.value[t.$index].appearing)==null?void 0:u.countH),1)]}),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.countWeekend"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(r.value[t.$index].weekendDays),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text","onCellClick"])],64))}};module.exports=K;
|
package/dist/SheetTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as b, watch as
|
|
1
|
+
import { ref as b, watch as L, computed as le, createElementBlock as N, openBlock as w, Fragment as S, createBlock as M, createCommentVNode as T, createElementVNode as B, createVNode as r, unref as t, withCtx as s, renderList as j, createTextVNode as y, toDisplayString as v } from "vue";
|
|
2
2
|
import { useI18n as te } from "vue-i18n";
|
|
3
|
-
import { p as $, b as ne, a as
|
|
3
|
+
import { p as $, b as ne, a as q, h as oe } from "./index-2Mx6IUGl.js";
|
|
4
4
|
import { ElSelect as ue, ElOption as se, ElSwitch as ie, ElTable as de, ElTableColumn as d } from "element-plus";
|
|
5
5
|
const re = { style: { height: "20px", width: "100%", display: "inline-block" } }, ce = { style: { height: "20px", width: "100%", display: "inline-block" } }, fe = {
|
|
6
6
|
__name: "SheetTable",
|
|
@@ -10,72 +10,70 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
10
10
|
workSchedule: Object,
|
|
11
11
|
fullName: { type: String, default: "Вы" }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const k =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
}),
|
|
20
|
-
f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(
|
|
13
|
+
setup(Y) {
|
|
14
|
+
const k = Y, { t: i, d: A } = te(), m = b([]), _ = b("0"), f = b(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(_.value))), p = b([]), D = b("all"), V = b([{ value: "all", label: "Все", key: "all" }]), O = b([]), F = b(0), I = b([]), H = b([]), E = b([]);
|
|
15
|
+
L(D, async (e, l) => {
|
|
16
|
+
e !== l && (I.value = [], confirm.value = !1, k.odata.personal.forEach((a) => {
|
|
17
|
+
a.divisionName === e && (I.value.some((u) => (u == null ? void 0 : u.activeText) === a.roleName) || I.value.push({ val: !0, activeText: a.roleName }));
|
|
18
|
+
}), K());
|
|
19
|
+
}), L(_, (e) => {
|
|
20
|
+
f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(e)), U();
|
|
21
21
|
});
|
|
22
|
-
const o = le(() => m.value.flatMap((
|
|
23
|
-
if (
|
|
24
|
-
return o.value[
|
|
22
|
+
const o = le(() => m.value.flatMap((e, l) => [{ ...e, key: 0, ids: l }, { ...e, key: 1, ids: l }])), G = (e) => {
|
|
23
|
+
if (e.columnIndex < 2 || e.columnIndex > p.value.length + 3 && e.columnIndex < p.value.length + 9 || e.columnIndex > p.value.length + 11)
|
|
24
|
+
return o.value[e.rowIndex].key === 0 ? {
|
|
25
25
|
rowspan: 2,
|
|
26
26
|
colspan: 1
|
|
27
27
|
} : {
|
|
28
28
|
rowspan: 0,
|
|
29
29
|
colspan: 0
|
|
30
30
|
};
|
|
31
|
-
},
|
|
32
|
-
const
|
|
31
|
+
}, U = () => {
|
|
32
|
+
const e = O.value, l = new Date(f.value), a = new Date(l.getFullYear(), l.getMonth() + 1, 0).getDate();
|
|
33
33
|
let u = [], x = 0;
|
|
34
|
-
for (let n = 1; n <=
|
|
34
|
+
for (let n = 1; n <= a; n++) {
|
|
35
35
|
const c = $(l.setDate(n), "{Y}-{m}-{dd}");
|
|
36
|
-
x +=
|
|
37
|
-
let h =
|
|
38
|
-
u.push({ day: n, holidays: h, weekday:
|
|
36
|
+
x += e.nowork.includes(c) || e.holidays.includes(c) ? 0 : e.preholidays.includes(c) ? 7 : 8;
|
|
37
|
+
let h = e.nowork.includes(c) ? "nowork" : e.holidays.includes(c) ? "holiday" : e.preholidays.includes(c) ? "preholiday" : "";
|
|
38
|
+
u.push({ day: n, holidays: h, weekday: A(new Date(l.getFullYear(), l.getMonth(), n), "day") });
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
F.value = x, p.value = u, k.odata.getPersonal({}).then((n) => {
|
|
41
41
|
var c;
|
|
42
42
|
D.value = (c = n.find((h) => h.employeeName === k.fullName)) == null ? void 0 : c.divisionName, n.forEach((h) => {
|
|
43
|
-
|
|
44
|
-
}),
|
|
43
|
+
V.value.some((g) => (g == null ? void 0 : g.value) === h.divisionName) || V.value.push({ value: h.divisionName, label: h.divisionName, key: h.divisionName }), h.divisionName === D.value && !I.value.some((g) => (g == null ? void 0 : g.activeText) === h.roleName) && I.value.push({ val: !0, activeText: h.roleName });
|
|
44
|
+
}), K();
|
|
45
45
|
});
|
|
46
|
-
},
|
|
47
|
-
m.value = []
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let e = ne(l.employeeName);
|
|
52
|
-
a.value.push(l.employeeKey), m.value.push({ name: e + " (" + l.roleName + ")", code: l.employeeKey, days: [], contHour: 0, id: !1, ids: m.value.length });
|
|
46
|
+
}, K = () => {
|
|
47
|
+
m.value = [], E.value = [], H.value = [], k.odata.personal.forEach((e) => {
|
|
48
|
+
if (e.divisionName === D.value && I.value.some((l) => l.val && l.activeText === e.roleName)) {
|
|
49
|
+
let l = ne(e.employeeName);
|
|
50
|
+
E.value.push(e.employeeKey), m.value.push({ name: l + " (" + e.roleName + ")", code: e.employeeKey, days: [], contHour: 0, id: !1, ids: m.value.length });
|
|
53
51
|
}
|
|
54
|
-
}), k.workSchedule.getUsersYear({ code:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}), console.log(
|
|
52
|
+
}), k.workSchedule.getUsersYear({ code: E.value, year: new Date(f.value).getFullYear() }).then((e) => {
|
|
53
|
+
e.forEach((l) => {
|
|
54
|
+
l.dateStart && H.value.push({ code: l.code, dateStart: l.dateStart, dateEnd: l.dateEnd });
|
|
55
|
+
}), console.log(e), R();
|
|
58
56
|
});
|
|
59
57
|
}, R = () => {
|
|
60
|
-
k.workSchedule.getWorkSchedule({ code:
|
|
61
|
-
(
|
|
62
|
-
|
|
58
|
+
k.workSchedule.getWorkSchedule({ code: E.value, date: $(new Date(f.value), "{Y}-{m}-{dd}") }).then(
|
|
59
|
+
(e) => {
|
|
60
|
+
e.forEach((l, a) => {
|
|
63
61
|
var u, x;
|
|
64
62
|
if (l !== null) {
|
|
65
63
|
l.data.days.forEach((n) => n.state = "Я");
|
|
66
64
|
for (let n = 1; n <= p.value.length; n++) {
|
|
67
65
|
let c = $(new Date(f.value).setDate(n), "{Y}-{m}-{dd}");
|
|
68
66
|
const h = (u = l.data) == null ? void 0 : u.days.findIndex((g) => g.day === c);
|
|
69
|
-
h === -1 ? m.value[
|
|
67
|
+
h === -1 ? m.value[a].days.push({
|
|
70
68
|
day: c,
|
|
71
69
|
time: "-",
|
|
72
70
|
state: "В"
|
|
73
|
-
}) : m.value[
|
|
71
|
+
}) : m.value[a].days.push((x = l.data) == null ? void 0 : x.days[h]);
|
|
74
72
|
}
|
|
75
73
|
} else {
|
|
76
|
-
m.value[
|
|
74
|
+
m.value[a].days = [];
|
|
77
75
|
for (let n = 1; n <= p.value.length; n++)
|
|
78
|
-
p.value[n - 1].holidays === "" ?
|
|
76
|
+
p.value[n - 1].holidays === "" ? P(n, a, 8) : p.value[n - 1].holidays === "preholiday" ? P(n, a, 7) : m.value[a].days.push({
|
|
79
77
|
day: $(new Date(f.value).setDate(n), "{Y}-{m}-{dd}"),
|
|
80
78
|
time: "-",
|
|
81
79
|
state: "В"
|
|
@@ -83,13 +81,13 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
83
81
|
}
|
|
84
82
|
for (let n = 1; n <= p.value.length; n++) {
|
|
85
83
|
let c = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), n).getTime() + 1e3;
|
|
86
|
-
for (let h of
|
|
87
|
-
const { dateStart: g, dateEnd:
|
|
88
|
-
if (g &&
|
|
89
|
-
const Q = new Date(
|
|
84
|
+
for (let h of H.value) {
|
|
85
|
+
const { dateStart: g, dateEnd: z, code: Z } = h;
|
|
86
|
+
if (g && z && Z === l.code) {
|
|
87
|
+
const Q = new Date(q(g)).getTime(), ee = new Date(q(z)).getTime();
|
|
90
88
|
if (c >= Q && c <= ee) {
|
|
91
|
-
const
|
|
92
|
-
|
|
89
|
+
const C = $(new Date(f.value).setDate(n), "{Y}-{m}-{dd}"), J = m.value[a].days.findIndex((ae) => ae.day === C);
|
|
90
|
+
J !== -1 ? m.value[a].days[J] = { day: C, time: "-", state: "О" } : m.value[a].days.push({ day: C, time: "-", state: "О" });
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
}
|
|
@@ -97,58 +95,58 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
97
95
|
}), X();
|
|
98
96
|
}
|
|
99
97
|
);
|
|
100
|
-
},
|
|
101
|
-
const u = $(new Date(f.value).setDate(
|
|
98
|
+
}, P = (e, l, a) => {
|
|
99
|
+
const u = $(new Date(f.value).setDate(e), "{Y}-{m}-{dd}");
|
|
102
100
|
m.value[l].days.push({
|
|
103
101
|
day: u,
|
|
104
|
-
time:
|
|
102
|
+
time: a,
|
|
105
103
|
state: "Я"
|
|
106
104
|
});
|
|
107
105
|
}, X = () => {
|
|
108
|
-
m.value.forEach((
|
|
109
|
-
|
|
110
|
-
for (let l = 0; l <
|
|
111
|
-
l < 15 &&
|
|
112
|
-
|
|
106
|
+
m.value.forEach((e) => {
|
|
107
|
+
e.hourI = 0, e.hourII = 0, e.halfII = 0, e.halfI = 0, e.weekend = 0, e.weekendDays = 0, e.night = 0;
|
|
108
|
+
for (let l = 0; l < e.days.length; l++)
|
|
109
|
+
l < 15 && e.days[l].time !== "-" && (e.hourI += e.days[l].time), l < 15 && e.days[l].state === "Я" && e.halfI++, l >= 15 && e.days[l].time !== "-" && (e.hourII += e.days[l].time), l >= 15 && e.days[l].state === "Я" && e.halfII++, e.days[l].state === "Н" && (e.night += e.days[l].time), e.days[l].state === "РВ" && (e.weekend += e.days[l].time), e.days[l].state === "В" && e.weekendDays++;
|
|
110
|
+
e.contDays = e.halfI + e.halfII, e.contHour = e.hourI + e.hourII, e.overtime = 0, F.value < e.contHour && (e.overtime = e.contHour - F.value), e.numberNonAppearing = 0, e.appearing = {
|
|
113
111
|
code: "-",
|
|
114
112
|
countH: "-"
|
|
115
113
|
};
|
|
116
114
|
});
|
|
117
|
-
},
|
|
115
|
+
}, W = (e, l) => {
|
|
118
116
|
var n, c;
|
|
119
117
|
if (l === -1) return "";
|
|
120
|
-
const
|
|
118
|
+
const a = new Date(f.value), u = `${a.getFullYear()}-${(a.getMonth() + 1).toString().padStart(2, "0")}-${e.toString().padStart(2, "0")}`, x = o.value[l].days.findIndex((h) => h.day === u);
|
|
121
119
|
return x === -1 ? "" : o.value[l].key === 0 ? (n = o.value[l].days[x]) == null ? void 0 : n.state : (c = o.value[l].days[x]) == null ? void 0 : c.time;
|
|
122
120
|
};
|
|
123
|
-
return oe().then((
|
|
124
|
-
|
|
125
|
-
}), (
|
|
126
|
-
|
|
121
|
+
return oe().then((e) => {
|
|
122
|
+
O.value = e, U();
|
|
123
|
+
}), (e, l) => (w(), N(S, null, [
|
|
124
|
+
Y.checkEdit ? (w(), M(t(ue), {
|
|
127
125
|
key: 0,
|
|
128
126
|
modelValue: D.value,
|
|
129
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
127
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => D.value = a),
|
|
130
128
|
placeholder: "Select",
|
|
131
129
|
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
132
130
|
}, {
|
|
133
131
|
default: s(() => [
|
|
134
|
-
(w(!0), N(S, null,
|
|
135
|
-
key:
|
|
136
|
-
label:
|
|
137
|
-
value:
|
|
132
|
+
(w(!0), N(S, null, j(V.value, (a) => (w(), M(t(se), {
|
|
133
|
+
key: a.value,
|
|
134
|
+
label: a.label,
|
|
135
|
+
value: a.value
|
|
138
136
|
}, null, 8, ["label", "value"]))), 128))
|
|
139
137
|
]),
|
|
140
138
|
_: 1
|
|
141
|
-
}, 8, ["modelValue"])) :
|
|
142
|
-
l[2] || (l[2] =
|
|
143
|
-
|
|
139
|
+
}, 8, ["modelValue"])) : T("", !0),
|
|
140
|
+
l[2] || (l[2] = B("div", { class: "expander" }, null, -1)),
|
|
141
|
+
Y.checkEdit ? (w(), M(t(ie), {
|
|
144
142
|
key: 1,
|
|
145
143
|
modelValue: _.value,
|
|
146
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
144
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => _.value = a),
|
|
147
145
|
"active-text": t(i)("workSchedule.currentMonth"),
|
|
148
146
|
"active-value": "0",
|
|
149
147
|
"inactive-value": "-1",
|
|
150
148
|
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
151
|
-
}, null, 8, ["modelValue", "active-text"])) :
|
|
149
|
+
}, null, 8, ["modelValue", "active-text"])) : T("", !0),
|
|
152
150
|
r(t(de), {
|
|
153
151
|
id: "printTable",
|
|
154
152
|
data: o.value,
|
|
@@ -158,11 +156,11 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
158
156
|
size: "small",
|
|
159
157
|
"empty-text": t(i)("sheet.emptyText"),
|
|
160
158
|
align: "center",
|
|
161
|
-
onCellClick:
|
|
159
|
+
onCellClick: e.coMenu
|
|
162
160
|
}, {
|
|
163
161
|
default: s(() => [
|
|
164
162
|
r(t(d), {
|
|
165
|
-
label: t(i)("sheet.title", { name: D.value }) + t(
|
|
163
|
+
label: t(i)("sheet.title", { name: D.value }) + t(A)(f.value, "month"),
|
|
166
164
|
align: "center",
|
|
167
165
|
height: "10"
|
|
168
166
|
}, {
|
|
@@ -172,8 +170,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
172
170
|
width: "180",
|
|
173
171
|
align: "center"
|
|
174
172
|
}, {
|
|
175
|
-
default: s((
|
|
176
|
-
y(v(o.value[
|
|
173
|
+
default: s((a) => [
|
|
174
|
+
y(v(o.value[a.$index].name), 1)
|
|
177
175
|
]),
|
|
178
176
|
_: 1
|
|
179
177
|
}, 8, ["label"]),
|
|
@@ -181,8 +179,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
181
179
|
label: t(i)("sheet.personnelNumber"),
|
|
182
180
|
align: "center"
|
|
183
181
|
}, {
|
|
184
|
-
default: s((
|
|
185
|
-
y(v(o.value[
|
|
182
|
+
default: s((a) => [
|
|
183
|
+
y(v(o.value[a.$index].code), 1)
|
|
186
184
|
]),
|
|
187
185
|
_: 1
|
|
188
186
|
}, 8, ["label"]),
|
|
@@ -191,55 +189,55 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
191
189
|
align: "center"
|
|
192
190
|
}, {
|
|
193
191
|
default: s(() => [
|
|
194
|
-
(w(!0), N(S, null,
|
|
195
|
-
key:
|
|
192
|
+
(w(!0), N(S, null, j(p.value, (a) => (w(), N(S, {
|
|
193
|
+
key: a.day
|
|
196
194
|
}, [
|
|
197
|
-
|
|
195
|
+
a.day <= 15 ? (w(), M(t(d), {
|
|
198
196
|
key: 0,
|
|
199
197
|
width: "30",
|
|
200
|
-
"class-name":
|
|
198
|
+
"class-name": a.holidays,
|
|
201
199
|
align: "center",
|
|
202
|
-
label:
|
|
203
|
-
` +
|
|
200
|
+
label: a.day.toString() + `
|
|
201
|
+
` + a.weekday
|
|
204
202
|
}, {
|
|
205
203
|
default: s((u) => [
|
|
206
|
-
|
|
204
|
+
B("div", re, v(W(a.day, u.$index) || " "), 1)
|
|
207
205
|
]),
|
|
208
206
|
_: 2
|
|
209
|
-
}, 1032, ["class-name", "label"])) :
|
|
207
|
+
}, 1032, ["class-name", "label"])) : T("", !0)
|
|
210
208
|
], 64))), 128)),
|
|
211
209
|
r(t(d), {
|
|
212
210
|
label: t(i)("sheet.halfMonth", { half: "I" }),
|
|
213
211
|
align: "center"
|
|
214
212
|
}, {
|
|
215
|
-
default: s((
|
|
216
|
-
y(v(o.value[
|
|
213
|
+
default: s((a) => [
|
|
214
|
+
y(v(o.value[a.$index].key === 0 ? o.value[a.$index].halfI : o.value[a.$index].hourI), 1)
|
|
217
215
|
]),
|
|
218
216
|
_: 1
|
|
219
217
|
}, 8, ["label"]),
|
|
220
|
-
(w(!0), N(S, null,
|
|
221
|
-
key:
|
|
218
|
+
(w(!0), N(S, null, j(p.value, (a) => (w(), N(S, {
|
|
219
|
+
key: a.day
|
|
222
220
|
}, [
|
|
223
|
-
|
|
221
|
+
a.day > 15 ? (w(), M(t(d), {
|
|
224
222
|
key: 0,
|
|
225
223
|
width: "30",
|
|
226
|
-
"class-name":
|
|
224
|
+
"class-name": a.holidays,
|
|
227
225
|
align: "center",
|
|
228
|
-
label:
|
|
229
|
-
` +
|
|
226
|
+
label: a.day.toString() + `
|
|
227
|
+
` + a.weekday
|
|
230
228
|
}, {
|
|
231
229
|
default: s((u) => [
|
|
232
|
-
|
|
230
|
+
B("div", ce, v(W(a.day, u.$index) || " "), 1)
|
|
233
231
|
]),
|
|
234
232
|
_: 2
|
|
235
|
-
}, 1032, ["class-name", "label"])) :
|
|
233
|
+
}, 1032, ["class-name", "label"])) : T("", !0)
|
|
236
234
|
], 64))), 128)),
|
|
237
235
|
r(t(d), {
|
|
238
236
|
label: t(i)("sheet.halfMonth", { half: "II" }),
|
|
239
237
|
align: "center"
|
|
240
238
|
}, {
|
|
241
|
-
default: s((
|
|
242
|
-
y(v(o.value[
|
|
239
|
+
default: s((a) => [
|
|
240
|
+
y(v(o.value[a.$index].key === 0 ? o.value[a.$index].halfII : o.value[a.$index].hourII), 1)
|
|
243
241
|
]),
|
|
244
242
|
_: 1
|
|
245
243
|
}, 8, ["label"])
|
|
@@ -257,8 +255,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
257
255
|
"label-class-name": "turn",
|
|
258
256
|
width: "34"
|
|
259
257
|
}, {
|
|
260
|
-
default: s((
|
|
261
|
-
y(v(o.value[
|
|
258
|
+
default: s((a) => [
|
|
259
|
+
y(v(o.value[a.$index].contDays), 1)
|
|
262
260
|
]),
|
|
263
261
|
_: 1
|
|
264
262
|
}, 8, ["label"]),
|
|
@@ -273,8 +271,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
273
271
|
"label-class-name": "turn",
|
|
274
272
|
width: "40"
|
|
275
273
|
}, {
|
|
276
|
-
default: s((
|
|
277
|
-
y(v(o.value[
|
|
274
|
+
default: s((a) => [
|
|
275
|
+
y(v(o.value[a.$index].contHour), 1)
|
|
278
276
|
]),
|
|
279
277
|
_: 1
|
|
280
278
|
}, 8, ["label"]),
|
|
@@ -284,8 +282,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
284
282
|
"label-class-name": "turn",
|
|
285
283
|
width: "34"
|
|
286
284
|
}, {
|
|
287
|
-
default: s((
|
|
288
|
-
y(v(o.value[
|
|
285
|
+
default: s((a) => [
|
|
286
|
+
y(v(o.value[a.$index].overtime), 1)
|
|
289
287
|
]),
|
|
290
288
|
_: 1
|
|
291
289
|
}, 8, ["label"]),
|
|
@@ -295,8 +293,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
295
293
|
"label-class-name": "turn",
|
|
296
294
|
width: "34"
|
|
297
295
|
}, {
|
|
298
|
-
default: s((
|
|
299
|
-
y(v(o.value[
|
|
296
|
+
default: s((a) => [
|
|
297
|
+
y(v(o.value[a.$index].night), 1)
|
|
300
298
|
]),
|
|
301
299
|
_: 1
|
|
302
300
|
}, 8, ["label"]),
|
|
@@ -306,8 +304,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
306
304
|
"label-class-name": "turn",
|
|
307
305
|
width: "34"
|
|
308
306
|
}, {
|
|
309
|
-
default: s((
|
|
310
|
-
y(v(o.value[
|
|
307
|
+
default: s((a) => [
|
|
308
|
+
y(v(o.value[a.$index].weekend), 1)
|
|
311
309
|
]),
|
|
312
310
|
_: 1
|
|
313
311
|
}, 8, ["label"])
|
|
@@ -321,8 +319,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
321
319
|
label: t(i)("sheet.numberNonAppearing"),
|
|
322
320
|
align: "center"
|
|
323
321
|
}, {
|
|
324
|
-
default: s((
|
|
325
|
-
y(v(o.value[
|
|
322
|
+
default: s((a) => [
|
|
323
|
+
y(v(o.value[a.$index].numberNonAppearing), 1)
|
|
326
324
|
]),
|
|
327
325
|
_: 1
|
|
328
326
|
}, 8, ["label"]),
|
|
@@ -337,10 +335,10 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
337
335
|
"label-class-name": "turn",
|
|
338
336
|
width: "30"
|
|
339
337
|
}, {
|
|
340
|
-
default: s((
|
|
338
|
+
default: s((a) => {
|
|
341
339
|
var u;
|
|
342
340
|
return [
|
|
343
|
-
y(v((u = o.value[
|
|
341
|
+
y(v((u = o.value[a.$index].appearing) == null ? void 0 : u.code), 1)
|
|
344
342
|
];
|
|
345
343
|
}),
|
|
346
344
|
_: 1
|
|
@@ -351,10 +349,10 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
351
349
|
"label-class-name": "turn",
|
|
352
350
|
width: "30"
|
|
353
351
|
}, {
|
|
354
|
-
default: s((
|
|
352
|
+
default: s((a) => {
|
|
355
353
|
var u;
|
|
356
354
|
return [
|
|
357
|
-
y(v((u = o.value[
|
|
355
|
+
y(v((u = o.value[a.$index].appearing) == null ? void 0 : u.countH), 1)
|
|
358
356
|
];
|
|
359
357
|
}),
|
|
360
358
|
_: 1
|
|
@@ -366,8 +364,8 @@ const re = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
366
364
|
label: t(i)("sheet.countWeekend"),
|
|
367
365
|
align: "center"
|
|
368
366
|
}, {
|
|
369
|
-
default: s((
|
|
370
|
-
y(v(o.value[
|
|
367
|
+
default: s((a) => [
|
|
368
|
+
y(v(o.value[a.$index].weekendDays), 1)
|
|
371
369
|
]),
|
|
372
370
|
_: 1
|
|
373
371
|
}, 8, ["label"])
|
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),v=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const
|
|
2
|
-
`+((
|
|
3
|
-
`+(
|
|
4
|
-
`+t.day.toString(),prop:"vacation"},{default:e.withCtx(s=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,s.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:T.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${D.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${D.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),
|
|
1
|
+
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),v=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const m=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,m.get?m:{enumerable:!0,get:()=>k[S]})}}return r.default=k,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(k){const{t:r,d:S}=ve.useI18n(),m=k,z=e.ref(!1),n=e.ref([]),F=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),D=e.ref(0),y=e.ref(9),g=e.ref(8),I=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),B=e.ref(1),C=e.ref(""),O=e.ref([]),V=e.ref([]),Y=e.ref([]),c=e.ref({name:"Имя",length:0,code:""}),U=e.ref(!1),P=e.ref({zIndex:30,minWidth:220,x:500,y:200}),Z=e.ref({}),T=e.ref("100%");e.watch(C,async(a,l)=>{a!==l&&(V.value=[],I.value=!1,m.odata.personal.forEach(o=>{o.divisionName===a&&(V.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||V.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(F,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,w.value=new Date(new Date().getFullYear(),o,1),K()});const _=(a,l,o,d)=>{c.value.ids=a.ids,c.value.key=a.key,c.value.add=a.days.length>0&&a.days[a.days.length-1].cont,c.value.level=l.level,c.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&m.checkEdit&&(c.value.name=r("workSchedule.autocomplete"),U.value=!0),l.level===3&&o.cellIndex-l.no===1&&m.checkEdit&&(N(o.cellIndex,a.ids),c.value.name=r("workSchedule.modeSelection"),U.value=!0)},ee=({row:a,columnIndex:l})=>{if(!E.value||E.value.length===0||!j.value)return"";const o=new Date(new Date(w.value).getFullYear(),new Date(w.value).getMonth(),l).getTime()+1e3;for(let d of E.value){const{dateStart:t,dateEnd:s,code:h}=d;if(t&&s&&h===a.code&&l!==0&&l<=u.value.length){const f=new Date(v.parseDate(t)).getTime(),b=new Date(v.parseDate(s)).getTime();if(o>=f&&o<=b)return"vacation"}}return""},K=()=>{const a=Z.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let s=1;s<=o;s++){const h=v.parseTime(l.setDate(s),"{Y}-{m}-{dd}");t+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const f=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";d.push({day:s,holidays:f,weekday:S(new Date(l.getFullYear(),l.getMonth(),s),"day")})}D.value=t,u.value=d,m.odata.getPersonal({}).then(s=>{var h;C.value.length===0&&(C.value=(h=s.find(f=>f.employeeName===m.fullName))==null?void 0:h.divisionName),s.forEach((f,b)=>{O.value.some(x=>(x==null?void 0:x.value)===f.divisionName)||O.value.push({value:f.divisionName,label:f.divisionName,key:b}),f.divisionName===C.value&&!V.value.some(x=>(x==null?void 0:x.activeText)===f.roleName)&&V.value.push({val:!0,activeText:f.roleName})}),W(),J.value=!1})},le=e.computed(()=>!n.value.some(a=>a.contHour!==D.value)),Q=(a,l)=>{var s,h,f;const o=new Date(w.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(s=n.value[l])==null?void 0:s.days.findIndex(b=>b.day===d);return l===-1||t===-1?"":((h=n.value[l].days[t])==null?void 0:h.tips)+`
|
|
2
|
+
`+((f=n.value[l].days[t])==null?void 0:f.time)},W=()=>{n.value=[],Y.value=[],E.value=[],m.odata.personal.forEach(a=>{if(a.divisionName===C.value&&V.value.some(l=>l.val&&l.activeText===a.roleName)){let l=v.byInitials(a.employeeName);Y.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),m.workSchedule.getUsersYear({code:Y.value,year:new Date(w.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&E.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),te(),$.value=!1})},te=()=>{m.workSchedule.getWorkSchedule({code:Y.value,date:v.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),M()})},M=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},ae=a=>{n.value[a].days=[],M()},ne=a=>{switch(q.value){case"5":for(let l=B.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&N(l,a,!0),u.value[l-1].holidays==="preholiday"&&(g.value-=1,N(l,a,!0),g.value+=1);break;case"2x2":for(let l=B.value;l<=u.value.length;l+=4)N(l,a,!0),l+1<=u.value.length&&N(l+1,a,!0);break;case"2x5":for(let l=B.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(g.value-=1,N(o,a,!0),g.value+=1):N(o,a,!0);break}},N=(a,l,o=!1)=>{const{date:d,ind:t}=H(a,l);t===-1?(n.value[l].days.push({day:d,time:g.value,tips:`(${y.value}:00 - ${g.value>=22?y.value+g.value+2:y.value+g.value+1}:00)`}),M()):o||(g.value=n.value[l].days[t].time,y.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},oe=(a,l)=>{const{ind:o}=H(a,l);n.value[l].days.splice(o,1),M(),document.querySelector(".app-main").click()},X=(a,l)=>{const{date:o,ind:d}=H(a,l);n.value[l].days[d]={day:o,time:g.value,tips:`(${y.value}:00 - ${g.value>=22?y.value+g.value+2:y.value+g.value+1}:00)`},M()},H=(a,l)=>{var t;const o=v.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(s=>s.day===o);return{date:o,ind:d}},ue=async()=>{var x;z.value=!0;const a=new me.Workbook,l=a.addWorksheet(S(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${v.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${v.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+1)}3:${v.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+3)}3:${v.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+4)}3:${v.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:C.value})+S(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${D.value})`;for(let p=2;p<=u.value.length+1;p++)l.getCell(4,p).value=u.value[p-2].weekday+`
|
|
3
|
+
`+(p-1),l.getColumn(p).width=6,l.getColumn(p).alignment=t,l.getCell(4,p).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let s=0;for(const p of n.value){let R=[p.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=H(A,s);L!==-1?R[A]=`${p.days[L].time} ${p.days[L].tips}`:R[A]=" "}R.push(((x=p.days)==null?void 0:x.length)||" ",p.contHour||0);const ie=l.addRow(R);ie.border=d,s++}let h="Щербина Е. В.";m.odata.personal.forEach(p=>{p.roleName==="Начальник отдела правовой и кадровой работы"&&(h=p.employeeName)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=v.byInitials(m.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(h),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const f="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),f),z.value=!1},re=async()=>{I.value||m.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(w.value),"{Y}-{m}-{dd}"),group:C.value}).then(a=>I.value=a)};return m.group&&(C.value=m.group),m.date&&(F.value=new Date(m.date+"T00:00:01")),v.holidays().then(a=>{Z.value=a,K()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=t=>C.value=t),placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.key,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:F.value,"onUpdate:modelValue":l[2]||(l[2]=t=>F.value=t),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:T.value,"onUpdate:modelValue":l[3]||(l[3]=t=>T.value=t),"active-text":a.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*4 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=t=>j.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":T.value,size:"small",align:"center",onCellClick:_,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":ee},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:C.value})+e.unref(S)(w.value,"month")+` ${new Date(w.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:T.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"46","class-name":t.holidays,align:"center",label:t.weekday+`
|
|
4
|
+
`+t.day.toString(),prop:"vacation"},{default:e.withCtx(s=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,s.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:T.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${D.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${D.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[20]||(l[20]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:z.value,plain:"",onClick:ue,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,z.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":s=>t.val=s,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:U.value,"onUpdate:show":l[18]||(l[18]=t=>U.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[7]||(l[7]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:B.value,"onUpdate:modelValue":l[8]||(l[8]=t=>B.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[9]||(l[9]=t=>y.value=t),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:g.value,"onUpdate:modelValue":l[10]||(l[10]=t=>g.value=t),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[11]||(l[11]=t=>ne(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[12]||(l[12]=t=>ae(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",null,e.toDisplayString(Q(c.value.day,c.value.ids)),1),l[22]||(l[22]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[13]||(l[13]=t=>y.value=t),step:1,min:0,max:19,onChange:l[14]||(l[14]=t=>X(c.value.day,c.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:g.value,"onUpdate:modelValue":l[15]||(l[15]=t=>g.value=t),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22),onChange:l[16]||(l[16]=t=>X(c.value.day,c.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[17]||(l[17]=t=>oe(c.value.day,c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ce;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as s, watch as ye, computed as Ae, resolveComponent as Me, resolveDirective as
|
|
1
|
+
import { ref as s, watch as ye, computed as Ae, resolveComponent as Me, resolveDirective as Te, createElementBlock as T, openBlock as x, createElementVNode as S, createVNode as i, createCommentVNode as ee, withDirectives as Be, createBlock as B, unref as a, withCtx as v, Fragment as de, renderList as ie, createTextVNode as b, toDisplayString as m, normalizeStyle as ze } from "vue";
|
|
2
2
|
import { saveAs as Fe } from "file-saver";
|
|
3
3
|
import * as Ye from "exceljs";
|
|
4
|
-
import { p as j, b as re, h as Ue, c as fe, a as we, d as
|
|
4
|
+
import { p as j, b as re, h as Ue, c as fe, a as we, d as V } from "./index-2Mx6IUGl.js";
|
|
5
5
|
import { useI18n as Ie } from "vue-i18n";
|
|
6
6
|
import { ElSelect as He, ElOption as Re, ElButton as N, ElSwitch as ve, ElSkeleton as We, ElTable as Pe, ElTableColumn as z, ElSkeletonItem as O, ElDialog as je, ElForm as Oe, ElFormItem as Ge, ElRadioGroup as Le, ElRadioButton as se, ElSlider as G } from "element-plus";
|
|
7
7
|
import { ContextMenu as Ze, ContextMenuItem as qe, ContextMenuSeparator as Je } from "@imengyu/vue3-context-menu";
|
|
@@ -22,10 +22,11 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
22
22
|
odata: Object,
|
|
23
23
|
workSchedule: Object,
|
|
24
24
|
fullName: { type: String, default: "Вы" },
|
|
25
|
-
group: String
|
|
25
|
+
group: String,
|
|
26
|
+
date: String
|
|
26
27
|
},
|
|
27
28
|
setup(F) {
|
|
28
|
-
const { t: d, d: L } = Ie(),
|
|
29
|
+
const { t: d, d: L } = Ie(), w = F, Z = s(!1), n = s([
|
|
29
30
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
30
31
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
31
32
|
// contHour: 0,
|
|
@@ -38,25 +39,25 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
38
39
|
// code: '0000-00052'
|
|
39
40
|
// ids: 1
|
|
40
41
|
// }
|
|
41
|
-
]),
|
|
42
|
+
]), q = s((/* @__PURE__ */ new Date()).getMonth() + 1), le = s(!1), Y = s([]), C = s(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = s([]), U = s(0), k = s(9), c = s(8), J = s(!1), ge = s(!0), I = s(!1), te = s("5"), H = s(1), $ = s(""), ae = s([]), E = s([]), K = s([]), h = s({ name: "Имя", length: 0, code: "" }), Q = s(!1), ne = s({
|
|
42
43
|
zIndex: 30,
|
|
43
44
|
minWidth: 220,
|
|
44
45
|
x: 500,
|
|
45
46
|
y: 200
|
|
46
47
|
}), me = s({}), R = s("100%");
|
|
47
48
|
ye($, async (t, e) => {
|
|
48
|
-
t !== e && (E.value = [],
|
|
49
|
+
t !== e && (E.value = [], J.value = !1, w.odata.personal.forEach((o) => {
|
|
49
50
|
o.divisionName === t && (E.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || E.value.push({ val: !0, activeText: o.roleName }));
|
|
50
51
|
}), oe());
|
|
51
|
-
}), ye(
|
|
52
|
+
}), ye(q, async (t) => {
|
|
52
53
|
let e = (/* @__PURE__ */ new Date()).getMonth(), o = t === null ? e : t - 1;
|
|
53
|
-
o = e - 1 <= o ? o : o + 12,
|
|
54
|
+
o = e - 1 <= o ? o : o + 12, C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), he();
|
|
54
55
|
});
|
|
55
56
|
const ke = (t, e, o, r) => {
|
|
56
|
-
h.value.ids = t.ids, h.value.key = t.key, h.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, h.value.level = e.level, h.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 &&
|
|
57
|
+
h.value.ids = t.ids, h.value.key = t.key, h.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, h.value.level = e.level, h.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && w.checkEdit && (h.value.name = d("workSchedule.autocomplete"), Q.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && w.checkEdit && (A(o.cellIndex, t.ids), h.value.name = d("workSchedule.modeSelection"), Q.value = !0);
|
|
57
58
|
}, Ce = ({ row: t, columnIndex: e }) => {
|
|
58
59
|
if (!Y.value || Y.value.length === 0 || !le.value) return "";
|
|
59
|
-
const o = new Date(new Date(
|
|
60
|
+
const o = new Date(new Date(C.value).getFullYear(), new Date(C.value).getMonth(), e).getTime() + 1e3;
|
|
60
61
|
for (let r of Y.value) {
|
|
61
62
|
const { dateStart: l, dateEnd: g, code: p } = r;
|
|
62
63
|
if (l && g && p === t.code && e !== 0 && e <= u.value.length) {
|
|
@@ -66,7 +67,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
66
67
|
}
|
|
67
68
|
return "";
|
|
68
69
|
}, he = () => {
|
|
69
|
-
const t = me.value, e = new Date(
|
|
70
|
+
const t = me.value, e = new Date(C.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
70
71
|
let r = [], l = 0;
|
|
71
72
|
for (let g = 1; g <= o; g++) {
|
|
72
73
|
const p = j(e.setDate(g), "{Y}-{m}-{dd}");
|
|
@@ -74,30 +75,30 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
74
75
|
const y = t.nowork.includes(p) ? "nowork" : t.holidays.includes(p) ? "holiday" : t.preholidays.includes(p) ? "preholiday" : "";
|
|
75
76
|
r.push({ day: g, holidays: y, weekday: L(new Date(e.getFullYear(), e.getMonth(), g), "day") });
|
|
76
77
|
}
|
|
77
|
-
U.value = l, u.value = r,
|
|
78
|
+
U.value = l, u.value = r, w.odata.getPersonal({}).then((g) => {
|
|
78
79
|
var p;
|
|
79
|
-
$.value.length === 0 && ($.value = (p = g.find((y) => y.employeeName ===
|
|
80
|
-
ae.value.some((
|
|
80
|
+
$.value.length === 0 && ($.value = (p = g.find((y) => y.employeeName === w.fullName)) == null ? void 0 : p.divisionName), g.forEach((y, M) => {
|
|
81
|
+
ae.value.some((D) => (D == null ? void 0 : D.value) === y.divisionName) || ae.value.push({ value: y.divisionName, label: y.divisionName, key: M }), y.divisionName === $.value && !E.value.some((D) => (D == null ? void 0 : D.activeText) === y.roleName) && E.value.push({ val: !0, activeText: y.roleName });
|
|
81
82
|
}), oe(), ge.value = !1;
|
|
82
83
|
});
|
|
83
84
|
}, xe = Ae(() => !n.value.some((t) => t.contHour !== U.value)), ce = (t, e) => {
|
|
84
85
|
var g, p, y;
|
|
85
|
-
const o = new Date(
|
|
86
|
+
const o = new Date(C.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, l = (g = n.value[e]) == null ? void 0 : g.days.findIndex((M) => M.day === r);
|
|
86
87
|
return e === -1 || l === -1 ? "" : ((p = n.value[e].days[l]) == null ? void 0 : p.tips) + `
|
|
87
88
|
` + ((y = n.value[e].days[l]) == null ? void 0 : y.time);
|
|
88
89
|
}, oe = () => {
|
|
89
|
-
n.value = [],
|
|
90
|
+
n.value = [], K.value = [], Y.value = [], w.odata.personal.forEach((t) => {
|
|
90
91
|
if (t.divisionName === $.value && E.value.some((e) => e.val && e.activeText === t.roleName)) {
|
|
91
92
|
let e = re(t.employeeName);
|
|
92
|
-
|
|
93
|
+
K.value.push(t.employeeKey), n.value.push({ name: e + " (" + t.roleName + ")", days: [], contHour: 0, code: t.employeeKey, id: !1, ids: n.value.length });
|
|
93
94
|
}
|
|
94
|
-
}),
|
|
95
|
+
}), w.workSchedule.getUsersYear({ code: K.value, year: new Date(C.value).getFullYear() }).then((t) => {
|
|
95
96
|
t.forEach((e) => {
|
|
96
97
|
e.dateStart && Y.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
97
98
|
}), console.log(t), Se(), I.value = !1;
|
|
98
99
|
});
|
|
99
100
|
}, Se = () => {
|
|
100
|
-
|
|
101
|
+
w.workSchedule.getWorkSchedule({ code: K.value, date: j(new Date(C.value), "{Y}-{m}-{dd}") }).then(
|
|
101
102
|
(t) => {
|
|
102
103
|
t.forEach((e, o) => {
|
|
103
104
|
e !== null && (n.value[o].days = e.data.days, n.value[o].id = e.id);
|
|
@@ -127,62 +128,62 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
127
128
|
break;
|
|
128
129
|
}
|
|
129
130
|
}, A = (t, e, o = !1) => {
|
|
130
|
-
const { date: r, ind: l } =
|
|
131
|
+
const { date: r, ind: l } = X(t, e);
|
|
131
132
|
l === -1 ? (n.value[e].days.push({
|
|
132
133
|
day: r,
|
|
133
134
|
time: c.value,
|
|
134
|
-
tips: `(${
|
|
135
|
-
}), W()) : o || (c.value = n.value[e].days[l].time,
|
|
136
|
-
},
|
|
137
|
-
const { ind: o } =
|
|
135
|
+
tips: `(${k.value}:00 - ${c.value >= 22 ? k.value + c.value + 2 : k.value + c.value + 1}:00)`
|
|
136
|
+
}), W()) : o || (c.value = n.value[e].days[l].time, k.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
|
|
137
|
+
}, De = (t, e) => {
|
|
138
|
+
const { ind: o } = X(t, e);
|
|
138
139
|
n.value[e].days.splice(o, 1), W(), document.querySelector(".app-main").click();
|
|
139
140
|
}, pe = (t, e) => {
|
|
140
|
-
const { date: o, ind: r } =
|
|
141
|
+
const { date: o, ind: r } = X(t, e);
|
|
141
142
|
n.value[e].days[r] = {
|
|
142
143
|
day: o,
|
|
143
144
|
time: c.value,
|
|
144
|
-
tips: `(${
|
|
145
|
+
tips: `(${k.value}:00 - ${c.value >= 22 ? k.value + c.value + 2 : k.value + c.value + 1}:00)`
|
|
145
146
|
}, W();
|
|
146
|
-
},
|
|
147
|
+
}, X = (t, e) => {
|
|
147
148
|
var l;
|
|
148
|
-
const o = j(new Date(
|
|
149
|
+
const o = j(new Date(C.value).setDate(t), "{Y}-{m}-{dd}"), r = (l = n.value[e]) == null ? void 0 : l.days.findIndex((g) => g.day === o);
|
|
149
150
|
return { date: o, ind: r };
|
|
150
|
-
},
|
|
151
|
-
var
|
|
151
|
+
}, Ve = async () => {
|
|
152
|
+
var D;
|
|
152
153
|
Z.value = !0;
|
|
153
|
-
const t = new Ye.Workbook(), e = t.addWorksheet(L(
|
|
154
|
-
e.mergeCells(`A1:${
|
|
154
|
+
const t = new Ye.Workbook(), e = t.addWorksheet(L(C.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, l = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
155
|
+
e.mergeCells(`A1:${V("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${V("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${V("B3", u.value.length)}3`), e.mergeCells(`${V("B3", u.value.length + 1)}3:${V("B3", u.value.length + 2)}3`), e.mergeCells(`${V("B3", u.value.length + 3)}3:${V("B4", u.value.length + 3)}4`), e.mergeCells(`${V("B3", u.value.length + 4)}3:${V("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value }) + L(C.value, "month") + ` ${new Date(C.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${U.value})`;
|
|
155
156
|
for (let f = 2; f <= u.value.length + 1; f++)
|
|
156
157
|
e.getCell(4, f).value = u.value[f - 2].weekday + `
|
|
157
158
|
` + (f - 1), e.getColumn(f).width = 6, e.getColumn(f).alignment = l, e.getCell(4, f).border = r;
|
|
158
159
|
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(u.value.length + 2).width = 5, e.getColumn(u.value.length + 3).width = 6, e.getColumn(u.value.length + 4).width = 13, e.getColumn(u.value.length + 5).width = 13, e.getColumn(1).alignment = l, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, u.value.length + 2).alignment = o, e.getColumn(u.value.length + 2).alignment = l, e.getColumn(u.value.length + 3).alignment = l, e.getColumn(u.value.length + 4).alignment = o, e.getColumn(u.value.length + 5).alignment = o, e.getCell("A3").border = r, e.getCell("B3").border = r, e.getCell(3, u.value.length + 2).border = r, e.getCell(4, u.value.length + 2).border = r, e.getCell(3, u.value.length + 4).border = r, e.getCell(3, u.value.length + 5).border = r, e.getCell(4, u.value.length + 3).border = r;
|
|
159
160
|
let g = 0;
|
|
160
161
|
for (const f of n.value) {
|
|
161
|
-
let
|
|
162
|
+
let _ = [f.name];
|
|
162
163
|
for (let P = 1; P <= u.value.length; P++) {
|
|
163
|
-
const { ind: ue } =
|
|
164
|
-
ue !== -1 ?
|
|
164
|
+
const { ind: ue } = X(P, g);
|
|
165
|
+
ue !== -1 ? _[P] = `${f.days[ue].time} ${f.days[ue].tips}` : _[P] = " ";
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
const Ne = e.addRow(
|
|
167
|
+
_.push(((D = f.days) == null ? void 0 : D.length) || " ", f.contHour || 0);
|
|
168
|
+
const Ne = e.addRow(_);
|
|
168
169
|
Ne.border = r, g++;
|
|
169
170
|
}
|
|
170
171
|
let p = "Щербина Е. В.";
|
|
171
|
-
|
|
172
|
+
w.odata.personal.forEach((f) => {
|
|
172
173
|
f.roleName === "Начальник отдела правовой и кадровой работы" && (p = f.employeeName);
|
|
173
|
-
}), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(
|
|
174
|
+
}), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(w.fullName), e.getCell(`AD${n.value.length + 8}`).value = re(p), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
|
|
174
175
|
const y = "export_" + j(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", M = await t.xlsx.writeBuffer();
|
|
175
176
|
Fe(new Blob([M]), y), Z.value = !1;
|
|
176
177
|
}, Ee = async () => {
|
|
177
|
-
|
|
178
|
+
J.value || w.workSchedule.addWorkSchedule({ data: n.value, date: j(new Date(C.value), "{Y}-{m}-{dd}"), group: $.value }).then((t) => J.value = t);
|
|
178
179
|
};
|
|
179
|
-
return
|
|
180
|
+
return w.group && ($.value = w.group), w.date && (q.value = /* @__PURE__ */ new Date(w.date + "T00:00:01")), Ue().then((t) => {
|
|
180
181
|
me.value = t, he();
|
|
181
182
|
}), (t, e) => {
|
|
182
|
-
const o = Me("el-date-picker"), r =
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
F.checkEdit ? (
|
|
183
|
+
const o = Me("el-date-picker"), r = Te("loading");
|
|
184
|
+
return x(), T("div", Ke, [
|
|
185
|
+
S("div", Qe, [
|
|
186
|
+
F.checkEdit ? (x(), B(a(He), {
|
|
186
187
|
key: 0,
|
|
187
188
|
modelValue: $.value,
|
|
188
189
|
"onUpdate:modelValue": e[0] || (e[0] = (l) => $.value = l),
|
|
@@ -190,15 +191,15 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
190
191
|
style: { width: "240px" }
|
|
191
192
|
}, {
|
|
192
193
|
default: v(() => [
|
|
193
|
-
(
|
|
194
|
+
(x(!0), T(de, null, ie(ae.value, (l) => (x(), B(a(Re), {
|
|
194
195
|
key: l.key,
|
|
195
196
|
label: l.label,
|
|
196
197
|
value: l.value
|
|
197
198
|
}, null, 8, ["label", "value"]))), 128))
|
|
198
199
|
]),
|
|
199
200
|
_: 1
|
|
200
|
-
}, 8, ["modelValue"])) :
|
|
201
|
-
F.checkEdit ? (
|
|
201
|
+
}, 8, ["modelValue"])) : ee("", !0),
|
|
202
|
+
F.checkEdit ? (x(), B(a(N), {
|
|
202
203
|
key: 1,
|
|
203
204
|
plain: "",
|
|
204
205
|
onClick: e[1] || (e[1] = (l) => I.value = !0)
|
|
@@ -207,16 +208,16 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
207
208
|
b(m(a(d)("workSchedule.jobTitle")), 1)
|
|
208
209
|
]),
|
|
209
210
|
_: 1
|
|
210
|
-
})) :
|
|
211
|
+
})) : ee("", !0),
|
|
211
212
|
i(o, {
|
|
212
|
-
modelValue:
|
|
213
|
-
"onUpdate:modelValue": e[2] || (e[2] = (l) =>
|
|
213
|
+
modelValue: q.value,
|
|
214
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => q.value = l),
|
|
214
215
|
type: "month",
|
|
215
216
|
placeholder: "Выберите месяц",
|
|
216
217
|
format: "MMM",
|
|
217
218
|
"value-format": "M"
|
|
218
219
|
}, null, 8, ["modelValue"]),
|
|
219
|
-
e[19] || (e[19] =
|
|
220
|
+
e[19] || (e[19] = S("div", { class: "expander" }, null, -1)),
|
|
220
221
|
i(a(ve), {
|
|
221
222
|
modelValue: R.value,
|
|
222
223
|
"onUpdate:modelValue": e[3] || (e[3] = (l) => R.value = l),
|
|
@@ -273,7 +274,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
273
274
|
}, {
|
|
274
275
|
default: v(() => [
|
|
275
276
|
i(a(z), {
|
|
276
|
-
label: a(d)("workSchedule.title", { name: $.value }) + a(L)(
|
|
277
|
+
label: a(d)("workSchedule.title", { name: $.value }) + a(L)(C.value, "month") + ` ${new Date(C.value).getFullYear()}`,
|
|
277
278
|
align: "center",
|
|
278
279
|
height: "34"
|
|
279
280
|
}, {
|
|
@@ -285,7 +286,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
285
286
|
fixed: R.value !== "100%"
|
|
286
287
|
}, {
|
|
287
288
|
default: v((l) => [
|
|
288
|
-
|
|
289
|
+
S("div", Xe, m(n.value[l.$index].name), 1)
|
|
289
290
|
]),
|
|
290
291
|
_: 1
|
|
291
292
|
}, 8, ["label", "fixed"]),
|
|
@@ -294,7 +295,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
294
295
|
align: "center"
|
|
295
296
|
}, {
|
|
296
297
|
default: v(() => [
|
|
297
|
-
(
|
|
298
|
+
(x(!0), T(de, null, ie(u.value, (l) => (x(), B(a(z), {
|
|
298
299
|
key: l.day,
|
|
299
300
|
width: "46",
|
|
300
301
|
"class-name": l.holidays,
|
|
@@ -304,7 +305,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
304
305
|
prop: "vacation"
|
|
305
306
|
}, {
|
|
306
307
|
default: v((g) => [
|
|
307
|
-
|
|
308
|
+
S("div", _e, m(ce(l.day, g.$index) || " "), 1)
|
|
308
309
|
]),
|
|
309
310
|
_: 2
|
|
310
311
|
}, 1032, ["class-name", "label"]))), 128))
|
|
@@ -331,7 +332,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
331
332
|
align: "center"
|
|
332
333
|
}, {
|
|
333
334
|
default: v((l) => [
|
|
334
|
-
|
|
335
|
+
S("div", {
|
|
335
336
|
style: ze(`color: ${U.value === l.row.contHour ? "green" : "red"};`)
|
|
336
337
|
}, m(l.row.contHour), 5)
|
|
337
338
|
]),
|
|
@@ -349,9 +350,9 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
349
350
|
]),
|
|
350
351
|
_: 1
|
|
351
352
|
}, 8, ["loading"]),
|
|
352
|
-
xe.value && F.checkEdit ? (
|
|
353
|
+
xe.value && F.checkEdit ? (x(), T("div", el, [
|
|
353
354
|
b(m(a(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
354
|
-
|
|
355
|
+
J.value ? ee("", !0) : (x(), B(a(N), {
|
|
355
356
|
key: 0,
|
|
356
357
|
type: "primary",
|
|
357
358
|
onClick: Ee
|
|
@@ -362,12 +363,12 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
362
363
|
_: 1
|
|
363
364
|
})),
|
|
364
365
|
e[20] || (e[20] = b()),
|
|
365
|
-
|
|
366
|
-
])) :
|
|
367
|
-
|
|
366
|
+
S("span", null, m(F.fullName), 1)
|
|
367
|
+
])) : ee("", !0),
|
|
368
|
+
Be((x(), B(a(N), {
|
|
368
369
|
disabled: Z.value,
|
|
369
370
|
plain: "",
|
|
370
|
-
onClick:
|
|
371
|
+
onClick: Ve,
|
|
371
372
|
style: { "margin-top": ".5rem" }
|
|
372
373
|
}, {
|
|
373
374
|
default: v(() => [
|
|
@@ -411,7 +412,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
411
412
|
autocomplete: "on"
|
|
412
413
|
}, {
|
|
413
414
|
default: v(() => [
|
|
414
|
-
(
|
|
415
|
+
(x(!0), T(de, null, ie(E.value, (l) => (x(), B(a(Ge), null, {
|
|
415
416
|
default: v(() => [
|
|
416
417
|
i(a(ve), {
|
|
417
418
|
modelValue: l.val,
|
|
@@ -428,8 +429,8 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
428
429
|
_: 1
|
|
429
430
|
}, 8, ["title", "modelValue"]),
|
|
430
431
|
i(a(Ze), {
|
|
431
|
-
show:
|
|
432
|
-
"onUpdate:show": e[18] || (e[18] = (l) =>
|
|
432
|
+
show: Q.value,
|
|
433
|
+
"onUpdate:show": e[18] || (e[18] = (l) => Q.value = l),
|
|
433
434
|
options: ne.value
|
|
434
435
|
}, {
|
|
435
436
|
default: v(() => [
|
|
@@ -438,7 +439,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
438
439
|
disabled: ""
|
|
439
440
|
}, null, 8, ["label"]),
|
|
440
441
|
i(a(Je)),
|
|
441
|
-
h.value.level === 2 ? (
|
|
442
|
+
h.value.level === 2 ? (x(), T("div", ll, [
|
|
442
443
|
i(a(Le), {
|
|
443
444
|
modelValue: te.value,
|
|
444
445
|
"onUpdate:modelValue": e[7] || (e[7] = (l) => te.value = l),
|
|
@@ -460,8 +461,8 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
460
461
|
]),
|
|
461
462
|
_: 1
|
|
462
463
|
}, 8, ["modelValue"]),
|
|
463
|
-
e[21] || (e[21] =
|
|
464
|
-
|
|
464
|
+
e[21] || (e[21] = S("br", null, null, -1)),
|
|
465
|
+
S("span", null, m(a(d)("workSchedule.fromDate")) + ":", 1),
|
|
465
466
|
i(a(G), {
|
|
466
467
|
modelValue: H.value,
|
|
467
468
|
"onUpdate:modelValue": e[8] || (e[8] = (l) => H.value = l),
|
|
@@ -469,21 +470,21 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
469
470
|
min: 1,
|
|
470
471
|
max: u.value.length
|
|
471
472
|
}, null, 8, ["modelValue", "max"]),
|
|
472
|
-
|
|
473
|
+
S("span", null, m(a(d)("workSchedule.with")) + ":", 1),
|
|
473
474
|
i(a(G), {
|
|
474
|
-
modelValue:
|
|
475
|
-
"onUpdate:modelValue": e[9] || (e[9] = (l) =>
|
|
475
|
+
modelValue: k.value,
|
|
476
|
+
"onUpdate:modelValue": e[9] || (e[9] = (l) => k.value = l),
|
|
476
477
|
step: 1,
|
|
477
478
|
min: 0,
|
|
478
479
|
max: 19
|
|
479
480
|
}, null, 8, ["modelValue"]),
|
|
480
|
-
|
|
481
|
+
S("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
|
|
481
482
|
i(a(G), {
|
|
482
483
|
modelValue: c.value,
|
|
483
484
|
"onUpdate:modelValue": e[10] || (e[10] = (l) => c.value = l),
|
|
484
485
|
step: 1,
|
|
485
486
|
min: 4,
|
|
486
|
-
max: a(fe)(
|
|
487
|
+
max: a(fe)(k.value !== 1 ? 23 - k.value : 21, 4, 22)
|
|
487
488
|
}, null, 8, ["modelValue", "max"]),
|
|
488
489
|
i(a(N), {
|
|
489
490
|
style: { "margin-top": ".5rem" },
|
|
@@ -505,31 +506,31 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
505
506
|
]),
|
|
506
507
|
_: 1
|
|
507
508
|
})
|
|
508
|
-
])) : (
|
|
509
|
-
|
|
510
|
-
e[22] || (e[22] =
|
|
511
|
-
|
|
509
|
+
])) : (x(), T("div", tl, [
|
|
510
|
+
S("div", null, m(ce(h.value.day, h.value.ids)), 1),
|
|
511
|
+
e[22] || (e[22] = S("br", null, null, -1)),
|
|
512
|
+
S("span", null, m(a(d)("workSchedule.with")) + ":", 1),
|
|
512
513
|
i(a(G), {
|
|
513
|
-
modelValue:
|
|
514
|
-
"onUpdate:modelValue": e[13] || (e[13] = (l) =>
|
|
514
|
+
modelValue: k.value,
|
|
515
|
+
"onUpdate:modelValue": e[13] || (e[13] = (l) => k.value = l),
|
|
515
516
|
step: 1,
|
|
516
517
|
min: 0,
|
|
517
518
|
max: 19,
|
|
518
519
|
onChange: e[14] || (e[14] = (l) => pe(h.value.day, h.value.ids))
|
|
519
520
|
}, null, 8, ["modelValue"]),
|
|
520
|
-
|
|
521
|
+
S("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
|
|
521
522
|
i(a(G), {
|
|
522
523
|
modelValue: c.value,
|
|
523
524
|
"onUpdate:modelValue": e[15] || (e[15] = (l) => c.value = l),
|
|
524
525
|
step: 1,
|
|
525
526
|
min: 4,
|
|
526
|
-
max: a(fe)(
|
|
527
|
+
max: a(fe)(k.value !== 1 ? 23 - k.value : 21, 4, 22),
|
|
527
528
|
onChange: e[16] || (e[16] = (l) => pe(h.value.day, h.value.ids))
|
|
528
529
|
}, null, 8, ["modelValue", "max"]),
|
|
529
530
|
i(a(N), {
|
|
530
531
|
style: { "margin-top": ".5rem" },
|
|
531
532
|
size: "small",
|
|
532
|
-
onClick: e[17] || (e[17] = (l) =>
|
|
533
|
+
onClick: e[17] || (e[17] = (l) => De(h.value.day, h.value.ids))
|
|
533
534
|
}, {
|
|
534
535
|
default: v(() => [
|
|
535
536
|
b(m(a(d)("workSchedule.delete")), 1)
|