chunk-4b7eaff4.0fd2ab8d.js 7.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4b7eaff4"],{"083a":function(t,e,n){"use strict";var i=n("0d51"),a=TypeError;t.exports=function(t,e){if(!delete t[e])throw a("Cannot delete property "+i(e)+" of "+i(t))}},"2ab3":function(t,e,n){"use strict";var i=n("9471"),a=n.n(i);a.a},"2c2f":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"checking"},[n("div",{staticClass:"header"},[n("van-icon",{staticStyle:{"line-height":".4rem",position:"absolute",left:".1rem"},attrs:{name:"arrow-left"},on:{click:t.goBack}}),n("span",[t._v("审批状态(日期:"+t._s(t.year)+"年"+t._s(t.month)+"月)")])],1),n("div",{staticClass:"text"},[n("div",{staticClass:"con"},[n("div",{staticClass:"left"},[t._m(0),t._l(t.list.kaoqin,(function(e,i){return n("div",{key:i,staticStyle:{height:".45rem","line-height":".45rem",border:".01rem solid #eee"}},[t._v(" "+t._s(e.name)+" ")])}))],2),n("div",{staticClass:"right"},[n("div",{staticClass:"rightTop"},t._l(t.tableList,(function(e,i){return n("div",{key:i},[n("p",[t._v(t._s(e+1))]),t._l(t.list.kaoqin,(function(i,a){return n("p",{key:a,on:{click:function(n){return t.setCheck(i.name,e+1,i.riqiList.length?i.riqiList[0].contractorPersonnelId:null)}}},t._l(i.riqiList,(function(i,a){return n("span",{directives:[{name:"show",rawName:"v-show",value:e+1===1*i.attendanceDay,expression:"item + 1 === it.attendanceDay * 1"}],key:a,staticStyle:{display:"inline-block","font-size":".2rem",width:".43rem",height:".43rem","line-height":".43rem","text-align":"center"}},[t._v(" "+t._s(e+1===1*i.attendanceDay?"1"===i.attendanceState?"×":"△":"")+" ")])})),0)}))],2)})),0)])]),t.headerType?n("div",{staticClass:"alert"},[t._v(" 保存成功! ")]):t._e()]),n("div",{class:[this.$route.query.type?"footers":"footer"]},[n("van-button",{attrs:{type:"info"},on:{click:t.lastMonth}},[t._v("上一月")]),this.$route.query.type?t._e():n("van-button",{attrs:{type:"info"},on:{click:t.save}},[t._v("保存")]),n("van-button",{attrs:{type:"info"},on:{click:t.nextMonth}},[t._v("下一月")])],1)])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"leftTop"},[n("i"),n("p",{staticStyle:{"text-align":"right","margin-right":".05rem"}},[t._v("日期")]),n("p",{staticStyle:{"text-align":"left","margin-left":".05rem"}},[t._v("施工人员")])])}],s=(n("4160"),n("45fc"),n("a434"),n("b0c0"),n("d3b7"),n("159b"),n("ddb0"),n("2909")),o=n("3324"),r={name:"VueCli4VantIndex",data:function(){return{dayList:[],year:this.$route.query.item.attendanceYear,month:this.$route.query.item.attendanceMonth,tableList:[],list:[],lists:[],headerType:!1}},computed:{},created:function(){},mounted:function(){this.tableList=Object(s["a"])(new Array(this.getDays(this.year,this.month)).keys()),this.getAttendanceDetails(),console.log(this.tableList)},methods:{getAttendanceDetails:function(){var t=this;Object(o["c"])({attendanceId:this.$route.query.constructionAttebdabceId,month:this.month,year:this.year}).then((function(e){var n=e.data;200===n.code&&(console.log(n,"222"),t.lists=JSON.parse(JSON.stringify(n.data)),t.list=JSON.parse(JSON.stringify(n.data)))}))},save:function(){var t=this,e=[],n={attendanceMonth:this.month,attendanceYear:this.year,constructionAttebdabceId:this.$route.query.constructionAttebdabceId};console.log(this.list,"2222222"),this.list.kaoqin.forEach((function(t,i){t.riqiList.forEach((function(t,i){console.log(t);var a=Object.assign(t,n);e.push(a)}))})),e.length||this.lists.kaoqin.forEach((function(n,i){e.push({contractorPersonnelId:t.lists.kaoqin[i].riqiList[0].contractorPersonnelId,attendanceMonth:t.month,attendanceYear:t.year,constructionAttebdabceId:t.$route.query.constructionAttebdabceId})})),console.log(e,"这是最u后的数据"),Object(o["r"])(e).then((function(e){var n=e.data;200===n.code&&(t.headerType=!0,setTimeout((function(){t.headerType=!1}),800))}))},setCheck:function(t,e,n){var i=this;this.$route.query.type||this.list.kaoqin.forEach((function(a,s){if(a.name===t)if(a.riqiList.some((function(t,n){return 1*t.attendanceDay===e})))a.riqiList.forEach((function(t,n){1*t.attendanceDay===e&&("1"===t.attendanceState?i.list.kaoqin[s].riqiList[n].attendanceState="2":i.list.kaoqin[s].riqiList.splice(n,1))}));else if(n)i.list.kaoqin[s].riqiList.push({attendanceDay:e+"",attendanceState:"1",contractorPersonnelId:n});else{var o=null;i.lists.kaoqin.forEach((function(e){e.name===t&&(o=e.riqiList[0].contractorPersonnelId)})),i.list.kaoqin[s].riqiList.push({attendanceDay:e+"",attendanceState:"1",contractorPersonnelId:o})}}))},getDays:function(t,e){return this.dayList=[31,28,31,30,31,30,31,31,30,31,30,31],t%4!==0||t%100===0&&t%400!==0||(this.dayList[1]=29),this.dayList[e-1]},goBack:function(){this.$router.go(-1)},lastMonth:function(){var t=this;"01"===this.month?(this.month="12",this.year=1*this.year-1+""):"1"===this.month[0]&&"0"===this.month[1]?this.month="09":"0"===this.month[0]?this.month="0"+(1*this.month[1]-1):"1"===this.month[0]&&"0"!==this.month[1]&&(this.month="1"+1*this.month[1]-1),this.tableList=Object(s["a"])(new Array(this.getDays(this.year,this.month)).keys()),Object(o["c"])({attendanceId:this.$route.query.constructionAttebdabceId,month:this.month,year:this.year}).then((function(e){var n=e.data;200===n.code&&(n.data.kaoqin.length?t.list=n.data:(t.list.kaoqin.forEach((function(e,n){t.list.kaoqin[n].riqiList=[{contractorPersonnelId:t.lists.kaoqin[n].riqiList[0].contractorPersonnelId}]})),t.list.month=n.data.month,t.list.year=n.data.year,t.list.zhujian=n.data.zhujian))}))},nextMonth:function(){var t=this;"12"===this.month?(this.month="01",this.year=1*this.year+1+""):"0"===this.month[0]&&"9"===this.month[1]?this.month="10":"0"===this.month[0]&&"9"!==this.month[1]?this.month="0"+(1*this.month[1]+1):"0"!==this.month[0]&&(this.month=1*this.month+1+""),this.tableList=Object(s["a"])(new Array(this.getDays(this.year,this.month)).keys()),Object(o["c"])({attendanceId:this.$route.query.constructionAttebdabceId,month:this.month,year:this.year}).then((function(e){var n=e.data;200===n.code&&(n.data.kaoqin.length?t.list=n.data:(t.list.kaoqin.forEach((function(e,n){t.list.kaoqin[n].riqiList=[{contractorPersonnelId:t.lists.kaoqin[n].riqiList[0].contractorPersonnelId}]})),t.list.month=n.data.month,t.list.year=n.data.year,t.list.zhujian=n.data.zhujian))}))}}},c=r,h=(n("2ab3"),n("2877")),l=Object(h["a"])(c,i,a,!1,null,"3017dc16",null);e["default"]=l.exports},3511:function(t,e){var n=TypeError,i=9007199254740991;t.exports=function(t){if(t>i)throw n("Maximum allowed index exceeded");return t}},"3a349":function(t,e,n){"use strict";var i=n("83ab"),a=n("e8b5"),s=TypeError,o=Object.getOwnPropertyDescriptor,r=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=r?function(t,e){if(a(t)&&!o(t,"length").writable)throw s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},"45fc":function(t,e,n){"use strict";var i=n("23e7"),a=n("b727").some,s=n("a640"),o=s("some");i({target:"Array",proto:!0,forced:!o},{some:function(t){return a(this,t,arguments.length>1?arguments[1]:void 0)}})},9471:function(t,e,n){},a434:function(t,e,n){"use strict";var i=n("23e7"),a=n("7b0b"),s=n("23cb"),o=n("5926"),r=n("07fa"),c=n("3a349"),h=n("3511"),l=n("65f0"),d=n("8418"),u=n("083a"),f=n("1dde"),y=f("splice"),m=Math.max,b=Math.min;i({target:"Array",proto:!0,forced:!y},{splice:function(t,e){var n,i,f,y,v,p,g=a(this),q=r(g),k=s(t,q),L=arguments.length;for(0===L?n=i=0:1===L?(n=0,i=q-k):(n=L-2,i=b(m(o(e),0),q-k)),h(q+n-i),f=l(g,i),y=0;y<i;y++)v=k+y,v in g&&d(f,y,g[v]);if(f.length=i,n<i){for(y=k;y<q-i;y++)v=y+i,p=y+n,v in g?g[p]=g[v]:u(g,p);for(y=q;y>q-i+n;y--)u(g,y-1)}else if(n>i)for(y=q-i;y>k;y--)v=y+i-1,p=y+n-1,v in g?g[p]=g[v]:u(g,p);for(y=0;y<n;y++)g[y+k]=arguments[y+2];return c(g,q-i+n),f}})}}]);