{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/homeCalendarBox.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/homeCalendarBox.vue","mtime":1725957645723},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["\nimport {currDateTime} from '@/utils/global.js'\nexport default {\n data(){\n return{\n currentYear: 1970,\n currentMonth: 1,\n currentDay: 1, \n currentWeek: 1,\n days: [],\n value:'',\n dialog:false,\n title:'',\n formList:{},\n form:{},\n fileList: [\n // {\n // name: 'food.jpeg',\n // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'\n // }, {\n // name: 'food2.jpeg',\n // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'\n // }\n ],\n dialogdetail:false,\n titledetail:'日程详情',\n rules: {\n thescheduleofTheType: [{required: true, message: \"请选择日程类型\", trigger: \"blur\" }], \n title: [{required: true, message: \"请输入标题\", trigger: \"blur\" }], \n Content: [{required: true, message: \"请输入内容\", trigger: \"blur\" }], \n executor: [{required: true, message: \"请选择执行人\", trigger: \"blur\" }],\n startTime: [{required: true, message: \"请选择开始时间\", trigger: \"blur\" }],\n pushTime: [{required: true, message: \"请选择提醒时间\", trigger: \"blur\" }], \n \n }, \n params:{//搜索条件\n pageIndex:1,\n pageSize:10,\n keyword:'', \n total:0\n },\n params2:{//搜索条件\n pageIndex:1,\n pageSize:10,\n keyword:'', \n total:0\n },\n tableDataEmployee:[],\n tableDataEmployeeParty:[],\n resultArr:[],\n calendarDataItems:[],//日历项点击当天的数据\n calendarAllItem:[],//当月每一天数量\n pushTimeOptions:[\n {lable:'无提醒',value:'无提醒'},\n {lable:'开始时',value:'0'},\n {lable:'开始15分钟前',value:'15'},\n {lable:'开始30分钟前',value:'30'},\n {lable:'开始一个小时前',value:'60'},\n {lable:'开始一天前',value:'1440'},\n ],\n pickerOptions:{\n disabledDate(date){//禁用今天之前的日期\n return date.getTime(){\n this.$nextTick(()=>{\n this.$set(item,'count',0)//查询--重置当月每一天的数量为0\n this.$set(item,'itemstatecount',0)//查询--重置当月每一天完成的数量为0\n })\n })\n let currentMonthStr=this.currentMonth \n if(this.currentMonth<10){\n currentMonthStr='0'+this.currentMonth \n }\n let str=this.currentYear+'-'+currentMonthStr \n let obj={startTime:str}\n console.log(obj)\n this.$api.v3searchCalendarListApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code){\n this.calendarAllItem=response.data.datas \n console.log(this.calendarAllItem)\n if(this.calendarAllItem.length){\n this.calendarAllItem.forEach(item=>{\n let date=new Date(item.item_starttime.time)\n let yearStr=date.getFullYear()\n let monthStr=(date.getMonth()+1)<10?'0'+(date.getMonth()+1):(date.getMonth()+1)\n let dayStr=date.getDate()<10?'0'+date.getDate():date.getDate()\n let dateStr=yearStr+'-'+monthStr+'-'+dayStr\n this.$set(item,'itemStartTimeAllTime',dateStr) \n })\n console.log(this.calendarAllItem)\n \n //同一天 \n this.days.forEach(item=>{\n this.calendarAllItem.forEach(its=>{\n if(item.startTime==its.itemStartTimeAllTime){\n this.$nextTick(()=>{\n this.$set(item,'count',item.count+1)\n console.log(its.item_state)\n if(its.item_state=='已完成'){\n this.$set(item,'itemstatecount',item.itemstatecount+1)\n }\n })\n }\n })\n })\n\n console.log(this.days)\n }\n }\n }\n })\n },\n searchCalendarListDay(year,month,day){ \n let str='' \n if(year){\n str=year+'-'+month+'-'+day \n }else{\n let currentMonthStr=this.currentMonth \n let currentDayStr=this.currentDay \n if(this.currentMonth<10){\n currentMonthStr='0'+this.currentMonth \n }\n if(this.currentDay<10){\n currentDayStr='0'+this.currentDay \n }\n str=this.currentYear+'-'+currentMonthStr+'-'+currentDayStr \n } \n let obj={startTime:str}\n console.log(obj)\n this.$api.v3searchCalendarListApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code){\n this.calendarDataItems=response.data.datas \n if(this.calendarDataItems.length){\n this.calendarDataItems.forEach(item=>{\n if(item.item_state=='未完成'){\n this.$set(item,'item_stateFlag',false)\n }else{\n this.$set(item,'item_stateFlag',true)\n }\n }) \n }\n console.log(this.calendarDataItems) \n }\n }\n })\n },\n itemState(item){\n console.log(item) \n let obj={\n id:item.id,\n state:item.item_stateFlag?'已完成':'未完成'\n }\n this.$api.v3CanlendarFinishStatusApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code){\n this.searchCalendarList() \n this.searchCalendarListDay() \n }\n }\n })\n\n },\n addCalendar(){\n this.formList={}\n this.$set(this.formList,'thescheduleofTheType','工作安排')\n this.$set(this.formList,'id','')\n this.$set(this.form,'id','')\n this.$set(this.formList,'pushTime','15')\n this.fileList=[]\n this.dialog=true\n this.title='新建日程' \n this.employeeTableList()\n this.employeeTableListParty()\n },\n typechange(){\n if(this.formList.thescheduleofTheType=='私人安排'){\n this.$set(this.formList,'executor',localStorage.getItem('employeeId'))\n this.$set(this.formList,'executorName',this.$store.state.myProfile.name)\n }else{\n this.$set(this.formList,'executor','')\n this.$set(this.formList,'executorName','')\n }\n },\n handleClose(done){\n done()\n this.dialog = false;\n },\n cancelForm(){\n this.dialog = false;\n },\n submit(){\n console.log(this.formList.startTime)\n console.log(typeof this.formList.startTime)\n console.log(this.formList)\n console.log(this.resultArr)\n if(this.formList.endTime){\n if(this.formList.endTime {\n if (valid) {\n let participant=''\n let ParticipantName=''\n if(this.resultArr.length){\n this.resultArr.forEach(item=>{\n participant+=item.id+';'\n ParticipantName+=item.name+';'\n }) \n participant=participant.substring(0,participant.length-1) \n ParticipantName=ParticipantName.substring(0,ParticipantName.length-1) \n }\n console.log(participant) \n let obj={ \n items:{ \n thescheduleofTheType:this.formList.thescheduleofTheType,\n title:this.formList.title,\n Content:this.formList.Content,\n executor:this.formList.executor,\n executorName:this.formList.executorName,\n participant:participant,\n ParticipantName:ParticipantName,\n startTime:this.formList.startTime,\n endTime:this.formList.endTime,\n file:this.fileList.length?JSON.stringify(this.fileList):'',\n pushTime:this.formList.pushTime,\n },\n id:this.form.id\n }\n if(this.form.id){\n this.$api.v3CalendarOkUpdateApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code==0){ \n this.dialog=false\n this.$nextTick(function () {\n this.$refs.ruleForm.resetFields(); //重置输入框提示\n });\n this.searchCalendarList() \n this.searchCalendarListDay() \n }\n }\n }) \n\n }else{ \n this.$api.v3CalendarOkApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code==0){ \n this.dialog=false\n this.$nextTick(function () {\n this.$refs.ruleForm.resetFields(); //重置输入框提示\n });\n this.searchCalendarList() \n this.searchCalendarListDay() \n }\n }\n }) \n } \n }\n }) \n },\n employeeTableList(){//列表表格-查询结果\n let obj2={domainId:localStorage.getItem(\"domainId\")||''}\n this.$api.v3employeeTableListApi(this.params,obj2,{\n onSucess: response => {\n if(response.data.data){\n this.tableDataEmployee=response.data.data.data\n this.params.total=response.data.data.total\n }\n }\n })\n }, \n filterMethod(val){//输入框过滤搜索\n console.log(val)//输入框关键词名称\n this.params.keyword=val\n let obj2={domainId:localStorage.getItem(\"domainId\")||''}\n this.$api.v3employeeTableListApi(this.params,obj2,{\n onSucess: response => {\n if(response.data.data){\n this.tableDataEmployee=response.data.data.data\n this.params.total=response.data.data.total\n }\n }\n }) \n }, \n selectUser(val){//查询下拉框id对应的名称数组\n const items=this.tableDataEmployee.find(item=>{\n return item.id==val\n })\n if(items){\n this.$set(this.formList,'executor',items.id)\n this.$set(this.formList,'executorName',items.name) \n } \n },\n cleartag(val){\n this.$set(this.params,'keyword','') \n this.employeeTableList()\n },\n employeeTableListParty(){//列表表格-查询结果\n let obj2={domainId:localStorage.getItem(\"domainId\")||''}\n this.$api.v3employeeTableListApi(this.params2,obj2,{\n onSucess: response => {\n if(response.data.data){\n this.tableDataEmployeeParty=response.data.data.data\n this.params2.total=response.data.data.total\n }\n }\n })\n }, \n filterMethodParty(val){//输入框过滤搜索\n console.log(val)//输入框关键词名称\n this.params2.keyword=val\n let obj2={domainId:localStorage.getItem(\"domainId\")||''}\n this.$api.v3employeeTableListApi(this.params2,obj2,{\n onSucess: response => {\n if(response.data.data){\n this.tableDataEmployeeParty=response.data.data.data\n this.params2.total=response.data.data.total\n }\n }\n }) \n },\n selectUserParty(val){//查询下拉框id对应的名称数组\n let resultArr=[]\n resultArr=this.tableDataEmployeeParty.filter(item=>{\n return val.indexOf(item.id)>-1\n })\n resultArr.forEach(its=>{\n this.resultArr.push(its)\n })\n let resultArr2=this.resultArr.filter(item=>{\n return val.indexOf(item.id)>-1\n })\n this.resultArr=resultArr2\n this.resultArr=[...new Set(this.resultArr)]\n console.log(this.resultArr) \n },\n removetagParty(val){\n console.log(val)\n this.resultArr.forEach(item=>{\n if(item.id==val){\n this.resultArr.splice(item,1)\n }\n })\n console.log(this.resultArr)\n },\n uploadImg(e) {\n // alert(this.fileList.length)\n // if(this.fileList.length>0){\n // this.$message({type:'warning',message:'最多只能上传5个文件'})\n // return false\n // }\n console.log(e.file) \n let fd=new FormData()\n fd.append(\"file\",e.file) \n console.log(fd)\n this.$api.v3commonFileUploadApi(fd,{\n onSucess: response => {\n console.log(response.data.data) \n let obj={\n name:e.file.name,\n path:response.data.data,\n url:'obpm'+response.data.data,\n fileType:e.file.type,\n uploader:this.$store.state.myProfile.name,\n uploadTime:currDateTime(),\n userName:this.$store.state.myProfile.name,\n time:currDateTime(),\n size:e.file.size,\n uid:e.file.uid,\n status:'success'\n }\n this.fileList.push(obj) \n \n }\n }) \n },\n handleRemove(file, fileList){\n console.log(file)\n this.fileList.forEach((item,index)=>{\n if(item==file){\n this.fileList.splice(index,1)\n }\n })\n },\n calendarDetail(item){\n this.dialogdetail = true;\n let obj={id:item.id}\n this.$api.v3CanlendarDetailApi(obj,{\n onSucess: response => {\n if(response.data.code==0){\n this.form=response.data.datas[0]\n if(this.form.item_starttime){\n let date=new Date(this.form.item_starttime.time)\n let year=date.getFullYear()\n let month=(date.getMonth()+1)<10?'0'+(date.getMonth()+1):(date.getMonth()+1)\n let dates=date.getDate()\n let HH=date.getHours()<10?'0'+date.getHours():date.getHours()\n let mm=date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes()\n let startTime=year+'-'+month+'-'+dates+' '+HH+':'+mm\n this.$set(this.form,'starTime',startTime)\n }\n if(this.form.item_endtime){\n let date=new Date(this.form.item_endtime.time)\n let year=date.getFullYear()\n let month=(date.getMonth()+1)<10?'0'+(date.getMonth()+1):(date.getMonth()+1)\n let dates=date.getDate()<10?'0'+date.getDate():date.getDate()\n let HH=date.getHours()<10?'0'+date.getHours():date.getHours()\n let mm=date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes()\n let endTime=year+'-'+month+'-'+dates+' '+HH+':'+mm\n this.$set(this.form,'endTime',endTime)\n }\n this.fileList=this.form.item_file?JSON.parse(this.form.item_file):[]\n }\n }\n }) \n }, \n viewplan(){\n let url=`/static/portal/vue/index.html#/open?appId=__K9C0HmAjnqJZgTI2sjd&actionContent=__OfViG2ekPlRujgkIDHR&opentarget=detail&linkType=00&realformId=__OfViG2ekPlRujgkIDHR&docid=${this.form.item_planid}`\n window.open(url)\n }, \n onpreview(file){\n console.log(file)\n if(file.path.indexOf('http')==-1){\n if(location.origin.indexOf('test')>-1){\n window.open('/v3/shared'+file.path)\n }else{\n window.open('/obpm'+file.path)\n }\n }else{\n window.open(file.path)\n }\n },\n handleClosedetail(done){\n done()\n this.dialogdetail = false;\n },\n cancelFormDetail(){\n this.dialogdetail = false;\n },\n delDetail(){\n this.$confirm('即将删除该日程数据!删除后无法恢复,是否继续?')\n .then(_ => { \n this.dialogdetail = false;\n let obj={\n id:this.form.id,\n }\n this.$api.v3CanlendarDelApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code){\n this.searchCalendarList() \n this.searchCalendarListDay() \n }\n }\n })\n\n }).catch(_ => {}); \n },\n submitDetail(){\n this.dialogdetail = false;\n let obj={\n id:this.form.id,\n state:'已完成'\n }\n this.$api.v3CanlendarFinishStatusApi(obj,{\n onSucess: response => {\n console.log(response.data)\n if(response.data.code){\n this.searchCalendarList() \n this.searchCalendarListDay() \n }\n }\n })\n },\n updateDetail(){\n this.dialogdetail = false;\n this.dialog = true;\n this.title='编辑日程'\n this.$set(this.params,'pageSize',999999)\n this.$set(this.params2,'pageSize',999999)\n this.employeeTableList()\n this.employeeTableListParty()\n let obj={id:this.form.id}\n this.$api.v3CanlendarDetailApi(obj,{\n onSucess: response => {\n if(response.data.code==0){\n this.formList=response.data.datas[0]\n console.log(this.formList)\n if(this.formList.item_starttime){\n let date=new Date(this.formList.item_starttime.time)\n let year=date.getFullYear()\n let month=(date.getMonth()+1)<10?'0'+(date.getMonth()+1):(date.getMonth()+1)\n let dates=date.getDate()\n let HH=date.getHours()<10?'0'+date.getHours():date.getHours()\n let mm=date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes()\n let startTime=year+'-'+month+'-'+dates+' '+HH+':'+mm\n console.log(startTime)\n console.log(typeof startTime)\n this.$set(this.formList,'startTime',startTime)\n }\n if(this.formList.item_endtime){\n let date=new Date(this.formList.item_endtime.time)\n let year=date.getFullYear()\n let month=(date.getMonth()+1)<10?'0'+(date.getMonth()+1):(date.getMonth()+1)\n let dates=date.getDate()\n let HH=date.getHours()<10?'0'+date.getHours():date.getHours()\n let mm=date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes()\n let endTime=year+'-'+month+'-'+dates+' '+HH+':'+mm\n this.$set(this.formList,'endTime',endTime)\n }\n this.fileList=this.formList.item_file?JSON.parse(this.formList.item_file):[]\n this.$set(this.formList,'thescheduleofTheType',this.formList.item_thescheduleofthetype)\n this.$set(this.formList,'title',this.formList.item_title)\n this.$set(this.formList,'Content',this.formList.item_content)\n this.$set(this.formList,'executor',this.formList.item_executor)\n this.$set(this.formList,'executorName',this.formList.item_executorname)\n if(this.formList.item_participant){\n console.log(this.formList.item_participant)\n let participantStr=this.formList.item_participant.split(\";\") \n this.$set(this.formList,'participant',participantStr)\n this.$set(this.formList,'ParticipantName',this.formList.item_participantname)\n }\n this.$set(this.formList,'pushTime',this.formList.item_pushtime)\n\n }\n }\n }) \n },\n initData(cur){\n var date;\n if(cur){ \n date=new Date(cur)\n }else{\n date=new Date()\n // var d=new Date();\n // var d=new Date(this.formatDate(now.getFullYear(),now.getMonth(),1))\n // d.setDate(42);\n // date=new Date(this.formatDate(d.getFullYear(),d.getMonth()+1,1))\n } \n this.currentYear=date.getFullYear();\n this.currentMonth=date.getMonth()+1;\n this.currentDay=date.getDate();\n\n this.currentWeek=date.getDay();//1,6...0\n if(this.currentWeek==0){\n this.currentWeek=7;\n }\n var str=this.formatDate(this.currentYear,this.currentMonth,1)\n this.days.length=0;\n // 今天是周日,放在第一行第7个位置,前面6个\n //初始化本周\n for(var i=this.currentWeek-1;i>=0;i--){\n var d=new Date(str);\n d.setDate(d.getDate()-i);\n var dayobject={};\n dayobject.day=d;\n var now=new Date();\n // if(d.getDate()===(now.getDate())&&d.getMonth()===now.getMonth()&&d.getFullYear()===now.getFullYear()){\n // dayobject.index=index++;//从今天开始显示数量\n // }else if(index!=0&&index<3){\n // dayobject.index=index++;//从今天开始3天内显示的数量\n // }\n this.days.push(dayobject)\n }\n //其他周\n for (var i = 1; i <= 42 - this.currentWeek; i++) {\n var d = new Date(str);\n d.setDate(d.getDate() + i);\n var dayobject={};\n dayobject.day=d;\n var now=new Date();\n // if(d.getDate()===(now.getDate())&&d.getMonth()===now.getMonth()&&d.getFullYear()===now.getFullYear())\n // {\n // dayobject.index=index++;\n // }\n\n // else if(index!=0&&index<3)\n // dayobject.index=index++;\n this.days.push(dayobject);\n }\n \n this.days.forEach(item=>{\n let date=new Date(item.day)\n let year=date.getFullYear()\n let month=(date.getMonth()+1)<10?'0'+(date.getMonth()+1):(date.getMonth()+1)\n let dates=date.getDate()<10?'0'+date.getDate():date.getDate()\n let startTime=year+'-'+month+'-'+dates\n this.$set(item,'startTime',startTime)\n this.$set(item,'count',0)\n })\n console.log(this.days)\n },\n pickPre(year, month){\n // setDate(0); 上月最后一天\n // setDate(-1); 上月倒数第二天\n // setDate(dx) 参数dx为 上月最后一天的前后dx天\n var d = new Date(this.formatDate(year , month , 1));\n d.setDate(0);\n this.initData(this.formatDate(d.getFullYear(),d.getMonth() + 1,1));\n this.searchCalendarList() \n },\n pickNext(year, month){\n var d = new Date(this.formatDate(year , month , 1));\n d.setDate(42);\n this.initData(this.formatDate(d.getFullYear(),d.getMonth() + 1,1));\n this.searchCalendarList() \n },\n formatDate(year,month,day){\n var y=year;\n var m=month;\n if(m<10) m=\"0\"+m;\n var d=day;\n if(d<10) d=\"0\"+d;\n return y+\"-\"+m+\"-\"+d;\n },\n enterSchedule(){\n // console.log('进入日程管理应用')\n let appId='__Z9Q7OLCk3xcm8EcAy22'\n let name='日程管理'\n let flag=1\n this.$store.dispatch(\"loadMenus\", {appId, name,flag});\n }\n },\n}\n",null]}