index.vue 113 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221
  1. <template>
  2. <div>
  3. <van-nav-bar title="填写日报" left-text="返回" @click-left="back" fixed left-arrow/>
  4. <van-form class="login_form" ref="loginForm">
  5. <div>
  6. <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间"
  7. @click="showPicker = true" :rules="rules.createDate" />
  8. <van-cell >
  9. <template #default>
  10. <div class="attendanceRecord">
  11. <template v-if="user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1">
  12. <span>考勤打卡:</span>
  13. <span v-if="!report.time">暂无考勤记录</span>
  14. <span v-else>{{report.time.startTime}}-{{report.time.endTime}}, {{report.time.workHours}}h</span>
  15. </template>
  16. <span style="margin-left:20px">总填报时长:</span>
  17. <span>{{totalReportHours}}h</span>
  18. </div>
  19. </template>
  20. <template #right-icon>
  21. <van-button icon="replay" native-type="button" type="default" size="mini" style="height:0.6rem;padding:0 0.16667rem;" :loading="cardRefLoading" loading-size="0.26667rem" @click.stop.native="cardtimeRefresh(form.createDate)" v-if="user.timeType.syncCorpwxTime==1 && (form.createDate == today || !report.time || report.time.workHours <= 0) && (user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1)"></van-button>
  22. </template>
  23. </van-cell>
  24. <!-- <div v-if="report.time" class="attendanceRecord">
  25. <i class="iconfont firerock-icondakajilu" style="font-size:0.35rem;margin-right:0.12rem"></i>
  26. <span v-if="user.timeType.syncDingding==1&&!report.time">暂无考勤记录</span>
  27. <span v-else>{{report.time.startTime}}-{{report.time.endTime}}, {{report.time.workHours}}小时</span>
  28. </div> -->
  29. </div>
  30. <van-popup v-model="showPicker" position="bottom">
  31. <van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate" @confirm="changeTime" @cancel="showPicker = false"/>
  32. </van-popup>
  33. <van-cell title="总时长(h)" v-if="reportTimeType.type == 3">
  34. <template>
  35. <van-stepper :disabled="(!canEdit || user.timeType.lockWorktime == 1) && !isWeekend" v-model="reportTimeType.allday" @change="changeAllTime" min="0.5" max="12" step="0.5" :decimal-length="1" />
  36. </template>
  37. </van-cell>
  38. <!-- <van-cell title="待分配时长" :value="report.time + 'h'" size="large"></van-cell> -->
  39. <div class="form_domains" v-for="(item,index) in form.domains" :key="item.id">
  40. <div style="float:right;margin-top:10px;margin-right:10px;">
  41. <!-- <van-tag v-if="canEdit&&item.projectName.length>0" color="#fff"
  42. @click="copyProject(index)" style="border: 1px solid #20a0ff;padding:5px;"
  43. icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">复制项目</span></van-tag> -->
  44. <van-tag v-if="index>0&&item.canEdit" color="#fff"
  45. @click="delPro(index)" style="border: 1px solid #ff0000;padding:5px;margin-left:10px;"
  46. icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">删除</span></van-tag>
  47. </div>
  48. <!-- <van-icon v-if="index>0&&canEdit" class="form_del" name="delete" @click="delPro(index)" /> -->
  49. <van-cell-group :title="(user.companyId==781?'任务':'项目') + (index+1)">
  50. <!-- <div>请选择投入项目</div> -->
  51. <van-field readonly name="projectId" clickable :value="item.projectName" :label="user.companyId==781?'工作任务':'投入项目'" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" @click="clickPicker(index, item)"
  52. :rules="[{ required: true, message: user.companyId==781?'请选择任务':'请选择项目' }]" />
  53. <van-field readonly name="subProjectId" v-if="item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable
  54. :value="item.subProjectName" label="子项目" placeholder="请选择子项目"
  55. @click="clickPickSubProject(index, item)" />
  56. <van-popup v-model="item.showPickerSubProject" position="bottom">
  57. <van-picker show-toolbar :columns="item.subProjectList" value-key="name" @confirm="choseSubProject"
  58. @cancel="item.showPickerSubProject = false;$forceUpdate();" />
  59. </van-popup>
  60. <!--任务分组 -->
  61. <van-field readonly name="groupId" v-if="user.timeType.reportAuditType >= 1 || (user.company.packageProject==1&&item.taskGroups != null && item.taskGroups.length > 0)" clickable
  62. :value="item.groupName" label="任务分组" placeholder="请选择任务分组"
  63. @click="clickPickTaskGroup(index, item)" />
  64. <van-popup v-model="item.showPickerTaskGroup" position="bottom">
  65. <van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup"
  66. @cancel="item.showPickerTaskGroup = false;$forceUpdate();" />
  67. </van-popup>
  68. <!--任务阶段 -->
  69. <van-field readonly name="stage" v-if="user.company.packageProject==1&&item.stages != null && item.stages.length > 0" clickable
  70. :value="item.stage" label="投入阶段" placeholder="请选择投入阶段"
  71. @click="clickPickStage(index, item)" />
  72. <van-popup v-model="item.showPickerStage" position="bottom">
  73. <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage"
  74. @cancel="item.showPickerStage = false;$forceUpdate();" />
  75. </van-popup>
  76. <!-- 预算来源 -->
  77. <van-field readonly name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0"
  78. :value="item.basecostName" label="预算来源" placeholder="请选择预算来源"
  79. @click="clickPickCostId(index, item)" />
  80. <van-popup v-model="item.showPickerCostId" position="bottom">
  81. <van-picker show-toolbar :columns="reportBasecostList" value-key="name" @confirm="choseCostId"
  82. @cancel="item.showPickerCostId = false;$forceUpdate();" />
  83. </van-popup>
  84. <!-- 审核人 -->
  85. <template v-if="user.timeType.reportAuditType != 3">
  86. <van-field readonly name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
  87. :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人"
  88. @click="clickPickAuditor(index, item)">
  89. <template #input>
  90. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
  91. <span v-else>{{item.projectAuditorName}}</span>
  92. </template>
  93. </van-field>
  94. <van-popup v-model="item.showPickerAuditor" position="bottom">
  95. <van-picker show-toolbar :columns="item.auditUserList" value-key="auditorName" @confirm="choseAuditor"
  96. @cancel="item.showPickerAuditor = false;$forceUpdate();">
  97. <template #option="item">
  98. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  99. <span v-else>{{item.auditorName}}</span>
  100. </template>
  101. </van-picker>
  102. </van-popup>
  103. </template>
  104. <!-- 自选审批人 -->
  105. <template v-if="user.timeType.reportAuditType == 3">
  106. <van-field readonly clickable label="第一审核人" @click="auditorClick(index,'auditorFirst')">
  107. <template #input>
  108. <span v-if="!item.auditorFirst"></span>
  109. <span v-else-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorFirst.name'></ww-open-data></span>
  110. <span v-else>{{item.auditorFirst.name}}</span>
  111. </template>
  112. </van-field>
  113. <van-field readonly clickable label="第二审核人" @click="auditorClick(index,'auditorSec')" v-if="user.timeType.auditLevel > 1">
  114. <template #input>
  115. <span v-if="!item.auditorSec"></span>
  116. <span v-else-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorSec.name'></ww-open-data></span>
  117. <span v-else>{{item.auditorSec.name}}</span>
  118. </template>
  119. </van-field>
  120. <van-field readonly clickable label="第三审核人" @click="auditorClick(index,'auditorThird')" v-if="user.timeType.auditLevel > 2">
  121. <template #input>
  122. <span v-if="!item.auditorThird"></span>
  123. <span v-else-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorThird.name'></ww-open-data></span>
  124. <span v-else>{{item.auditorThird.name}}</span>
  125. </template>
  126. </van-field>
  127. <van-field readonly clickable label="抄送人" @click="auditorClick(index,'ccUserid')">
  128. <template #input>
  129. <span v-if="!item.ccUserid"></span>
  130. <span v-else-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.ccUserid.name'></ww-open-data></span>
  131. <span v-else>{{item.ccUserid.name}}</span>
  132. </template>
  133. </van-field>
  134. <van-popup v-model="auditorShow" position="bottom">
  135. <van-search v-model="auditor.searchText" placeholder="输入员工姓名搜索" @search="onSearch" v-if="user.userNameNeedTranslate != '1'"></van-search>
  136. <div style="minHeight:300px;">
  137. <van-radio-group v-model="auditor.item">
  138. <van-radio v-for="uitem in auditor.searchList" :key="uitem.id" :name="uitem" style="padding:10px">
  139. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='uitem.name'></ww-open-data></span>
  140. <span v-else>{{uitem.name ? uitem.name : ''}}</span>
  141. </van-radio>
  142. </van-radio-group>
  143. <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="searchAuditor()">确定</van-button>
  144. </div>
  145. </van-popup>
  146. </template>
  147. <!-- 相关维度 -->
  148. <van-field :value="item.weiduName" v-if="item.projectId && user.timeType.customDegreeActive == 1" readonly name="id" clickable :label="user.timeType.customDegreeName" placeholder="请选择" @click="clickPickers(index,item)"/>
  149. <van-popup v-model="item.showPickDegree" position="bottom">
  150. <van-picker show-toolbar :columns="item.wuduList" value-key="name" @confirm="choseProjects" @cancel="item.showPickDegree = false;$forceUpdate()" />
  151. </van-popup>
  152. <!-- 自定义数值 -->
  153. <van-field v-if="user.timeType.customDataActive==1" type="number" :disabled="!item.canEdit" v-model="item.customData" :label="user.timeType.customDataName" placeholder="请输入数字" :rules="user.timeType.customDataStatus == 1 ? [{ required: true, message: '请输入' + user.timeType.customDataName }] : []"></van-field>
  154. <!-- 自定义文本 -->
  155. <van-field v-if="user.timeType.customTextActive==1" :disabled="!item.canEdit" v-model="item.customText" :label="user.timeType.customTextName" placeholder="请输入" maxlength="1000" :rules="user.timeType.customTextStatus ? [{ required: true, message: '请选择' + user.timeType.customTextName }] : []" rows="2" type="textarea" show-word-limit autosize></van-field>
  156. <van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
  157. </van-cell>
  158. <van-field :disabled="!item.canEdit"
  159. type="number" :name="'progress_'+pItem.professionId" input-align="right"
  160. v-for="pItem in item.professionProgress" :key="pItem.professionId"
  161. :label="'-- '+pItem.professionName"
  162. >
  163. <template slot="input">
  164. <van-stepper v-model="pItem.progress" integer min="0" max="100" />%
  165. </template>
  166. </van-field>
  167. <van-field v-if="user.company.packageProject == 1" readonly name="taskId" :value="item.taskName" label="任务/里程碑" placeholder="请选择任务/里程碑" @click="clickPickerTask(index,item)"
  168. ></van-field>
  169. <van-field name="taskFinish" label="是否已完成" v-if="item.taskId != null">
  170. <template #input>
  171. <van-checkbox :disabled="!item.canEdit" v-model="item.taskFinish" shape="square">已完成</van-checkbox>
  172. </template>
  173. </van-field>
  174. <van-popup v-model="item.showPickerTask" position="bottom">
  175. <van-picker show-toolbar :columns="item.taskList" value-key="taskName" @confirm="choseTask" @cancel="item.showPickerTask = false;$forceUpdate()" />
  176. </van-popup>
  177. <!-- <van-field readonly clickable class="form_input" :value="item.workingTime" name="workingTime" label="工作时长" placeholder="请输入工作时长(单位:小时)"
  178. :rules="[{ required: true, message: '请输入工作时长(单位:小时)' }]" @touchstart.native.stop="showNumberKey = true"/>
  179. <van-number-keyboard v-model="item.workingTime" :show="showNumberKey" close-button-text="完成" extra-key="." :maxlength="4" @blur="showNumberKey = false" /> -->
  180. <!-- 常规选择时间的方式 -->
  181. <!-- 全天上下午模式 -->
  182. <div v-if="reportTimeType.multiWorktime==0">
  183. <van-field v-if="reportTimeType.type < 2" readonly clickable :value="reportTimeType.type==0?item.label:(parseFloat(item.workingTime).toFixed(1)+'h')" label="工作时长" placeholder="请选择工作时长(小时)" @click="clickTimePicker(index,item)"
  184. :rules="[{ required: true, message: '请选择工作时长' }]"/>
  185. <van-popup v-model="showPickerTime" position="bottom">
  186. <van-picker show-toolbar :columns="timeType" value-key="label" @confirm="choseTimePick" @cancel="showPickerTime = false" />
  187. </van-popup>
  188. <!-- 选择数字时间长度模式 -->
  189. <van-popup v-model="showPickerHours" position="bottom">
  190. <van-picker show-toolbar :columns="timeRange"
  191. :default-index="15"
  192. @confirm="choseTimePick" @cancel="showPickerHours = false" />
  193. </van-popup>
  194. <!-- 时间段选择模式 -->
  195. <van-field readonly v-if="reportTimeType.type == 2" clickable name="datetimePicker" :value="item.startTime" label="开始时间" placeholder="点击选择时间"
  196. @click="item.canEdit?showStartTime = true:''" :disabled="!item.canEdit"
  197. :rules="[{ required: true, message: '请选择开始时间' }]"
  198. />
  199. <van-popup v-model="showStartTime" position="bottom">
  200. <van-datetime-picker
  201. v-model="startTime"
  202. type="time"
  203. @confirm="confirmTime(item,0);"
  204. @cancel="showStartTime = false"
  205. :min-hour="0"
  206. :max-hour="23"
  207. />
  208. <!-- :filter="filter" 原本这个属性在里面 -->
  209. </van-popup>
  210. <van-field v-if="reportTimeType.type == 2" readonly clickable name="datetimePicker" :value="item.endTime" label="结束时间" placeholder="点击选择时间"
  211. @click="item.canEdit?showEndTime = true:''" :disabled="!item.canEdit"
  212. :rules="[{ required: true, message: '请选择结束时间' }]" />
  213. <van-popup v-model="showEndTime" position="bottom" >
  214. <van-datetime-picker
  215. v-model="endTime"
  216. type="time"
  217. :min-hour="0"
  218. :max-hour="23"
  219. @confirm="confirmTime(item,1)"
  220. @cancel="showEndTime = false"
  221. />
  222. <!-- :filter="filter" 原本这个属性在里面 -->
  223. </van-popup>
  224. <van-cell v-if="reportTimeType.type == 3" >
  225. <template >
  226. <div>
  227. <span>用时占比</span>
  228. <van-slider :disabled="!item.canEdit" :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
  229. <template #button>
  230. <div class="custom-button">{{ item.progress }}%</div>
  231. </template>
  232. </van-slider>
  233. <span style="margin-left:10px;float:right;">{{item.workingTime}}小时</span>
  234. </div>
  235. </template>
  236. </van-cell>
  237. <van-field class="form_input" :disabled="!item.canEdit"
  238. v-model="item.content" name="content" type="textarea" :label="user.companyId==781?'具体内容与结果':'工作事项'" placeholder="请输入" :rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
  239. rows="3" autosize />
  240. </div>
  241. <!-- 多个时间和工作事项的选择方式 -->
  242. <div v-if="reportTimeType.multiWorktime==1">
  243. <div v-for="(timeItem, tindex) in item.worktimeList" :key="tindex" style="position:relative;border:#ccc 0.5px solid;margin:7px;">
  244. <van-tag v-if="tindex>0 && item.canEdit" style="position:absolute; right:-7px;top:-7px;z-index:10;"
  245. @click="removeTimeItem(item,tindex)">X</van-tag>
  246. <!-- 时间段选择模式 -->
  247. <van-field readonly v-if="reportTimeType.type == 2" :clickable="item.canEdit" name="datetimePicker"
  248. :value="timeItem.startTime" label="开始时间" placeholder="点击选择时间"
  249. :rules="[{ required: true, message: '必填项' }]"
  250. @click="item.canEdit?showStartDialog(timeItem):''" />
  251. <van-field v-if="reportTimeType.type == 2" readonly :clickable="canEdit" name="datetimePicker"
  252. :value="timeItem.endTime" label="结束时间" placeholder="点击选择时间"
  253. :rules="[{ required: true, message: '必填项' }]"
  254. @click="item.canEdit?showEndDialog(timeItem):''" />
  255. <van-field class="form_input" :disabled="!item.canEdit" style="color:#333;-webkit-text-fill-color:#646566;"
  256. v-model="timeItem.content" name="content" type="textarea" label="工作事项" placeholder="请输入工作事项"
  257. :rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
  258. rows="1" autosize />
  259. </div>
  260. <!--时间选择器 , 做统一处理,不能放到循环里,不然会有多个公用showStartTime,最后一个会现在最上层UI,导致BUG -->
  261. <van-popup v-model="showWorkStartTime" position="bottom">
  262. <van-datetime-picker
  263. v-model="startTime"
  264. type="time"
  265. @confirm="confirmWorkTime(0);"
  266. @cancel="showWorkStartTime = false"
  267. :min-hour="0"
  268. :max-hour="23"
  269. />
  270. <!-- :filter="filter" 原本这个属性在里面 -->
  271. </van-popup>
  272. <van-popup v-model="showWorkEndTime" position="bottom" >
  273. <van-datetime-picker
  274. v-model="endTime"
  275. type="time"
  276. :min-hour="0"
  277. :max-hour="23"
  278. @confirm="confirmWorkTime(1)"
  279. @cancel="showWorkEndTime = false"
  280. />
  281. <!-- :filter="filter" 原本这个属性在里面 -->
  282. </van-popup>
  283. </div>
  284. <div style="width:100%;" v-if="item.canEdit&&reportTimeType.multiWorktime==1">
  285. <van-tag style="text-align:center;padding:5px;margin-left:15px;border: 1px solid #20a0ff;"
  286. :disabled="!item.canEdit" @click="addNewWorktime(index, item)"
  287. icon="plus" color="#ffffff" ><span style="color:#999;text-align:center;padding: 0 5px;"> 添加工时 </span></van-tag>
  288. </div>
  289. <div class="overtime" v-if="((user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)) || (isCorpWX&&canEdit))">
  290. <div class="overTimeClas" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  291. <van-checkbox :disabled="!item.canEdit" v-model="item.isOvertime" style="width: 4.3rem;">含加班</van-checkbox>
  292. <van-field v-model="item.overtimeHours" type="number" :disabled="!item.canEdit || item.isOvertime==null||item.isOvertime==0 || !item.isOvertime"
  293. placeholder="请输入加班时长" style="width: 5.2rem"></van-field>
  294. <span :class="item.canEdit ? 'overListTime' : 'overListTime hoveOver'">小时</span>
  295. </div>
  296. <van-tag style="position:absolute;right:10px;" v-if="isCorpWX&&item.canEdit" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag>
  297. <!-- <van-tag style="position:absolute;right:10px;" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag> -->
  298. <!-- <van-tag style="position:absolute;right:10px;" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag> -->
  299. </div>
  300. <div style="padding:5px;text-align:center;" v-if="!isIOSystem">
  301. <span v-for="(p, index) in item.pics" :key="p" style="margin-right:15px;">
  302. <div class="imgList">
  303. <van-icon v-if="item.canEdit && user.companyId==7" size="20" name="clear" @click="deleteImg(item, index)" class="imgList_i"/>
  304. <img :src="p" style="width:100px; height:100px;" @click="showLargeImg(item.pics, index)"/>
  305. </div>
  306. </span>
  307. </div>
  308. <div style="padding:5px;text-align:center;" v-if="isIOSystem">
  309. <span v-for="(p, index) in item.iospics" :key="p" style="margin-right:15px;">
  310. <div class="imgList">
  311. <van-icon v-if="item.canEdit && user.companyId==7" size="20" name="clear" @click="deleteImg(item, index)" class="imgList_i"/>
  312. <img :src="p" style="width:100px; height:100px;" @click="showLargeImg(item.iospics, index)"/>
  313. </div>
  314. </span>
  315. </div>
  316. <van-popup v-model="imgShow" position="bottom" closeable >
  317. <van-swipe class="my-swipe" indicator-color="white">
  318. <van-swipe-item v-for="(picItem, index) in tmpPics" :key="index">
  319. <img :src="picItem" style="width:100%;" />
  320. </van-swipe-item>
  321. </van-swipe>
  322. </van-popup>
  323. </van-cell-group>
  324. </div>
  325. <div style="text-align:center;" >
  326. <van-tag size="large" style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
  327. @click="addNewPro"
  328. icon="plus" color="#ffffff" ><span style="color:#999;text-align:center;padding: 0 50px;"> + 新增{{user.companyId==781?'任务':'项目'}} </span></van-tag>
  329. </div>
  330. <div class="form_btn" style="position:fixed; bottom:0px;width:100%;">
  331. <div style="padding-bottom:10px;">
  332. <van-button v-if="canEdit" square block type="info" @click="isDraft=0;submitReport()" native-type="submit" style="width:50%;float:left;">
  333. <div v-if="flgLg">提交</div>
  334. <van-loading type="spinner" v-if="!flgLg" />
  335. </van-button>
  336. <van-button v-if="canEdit" square block type="default" @click="isDraft=1;submitReport()" native-type="submit" style="width:50%;float:left;">
  337. <div v-if="flgLg">暂存</div>
  338. <van-loading type="spinner" v-if="!flgLg" />
  339. </van-button>
  340. </div>
  341. <van-button v-if="canDeleteReport"
  342. square block type="default" @click="deleteReport" native-type="button"
  343. style=""> 删除 </van-button>
  344. <van-button v-if="canCancelInDialog" block type="default" @click="cancel"> 撤销 </van-button>
  345. <!-- <div v-if="canEdit&&form.domains.length>0 && form.domains[0].id != null"
  346. style="display:block;padding-top:30px;font-size:15px;color:#666;margin:0 auto;text-align:center;padding-bottom:10px;background:#ffffff;"
  347. @click="deleteReport"> 删除 </div> -->
  348. <!-- <van-button v-if="canEdit" square block type="default" @click="deleteReport" native-type="button"
  349. style="margin-top:10px;"> 删除 </van-button> -->
  350. </div>
  351. </van-form>
  352. <div class="form_tip" v-if="!canEdit && !canCancel"> 已审核无法修改 </div>
  353. <!-- 选择项目弹窗 -->
  354. <van-popup v-model="showPickerUserddp" position="bottom" style="height: 80%">
  355. <!-- <van-search v-model="userName" placeholder="输入项目名称搜索" @clear="sea()" @blur="sea()" @search="sea()"></van-search> -->
  356. <van-search v-model="userName" placeholder="请输入项目名称/编号" @clear="sea()" @blur="sea()" @search="sea()" @input="sea()"/>
  357. <div style="minHeight:300px;">
  358. <div v-for="(item, index) in projectss" :key="item.id" class="ryuan" @click="fZr(item, index)">
  359. <p>{{item.projectName}}</p>
  360. <p style="margin-top: 5px;color: #9697B2;">{{item.projectCode}}</p>
  361. </div>
  362. </div>
  363. </van-popup>
  364. </div>
  365. </template>
  366. <script>
  367. import timetoolVue from '../timetool/timetool.vue';
  368. // Vue.prototype.$wx = wx
  369. export default {
  370. data() {
  371. return {
  372. cardRefLoading: false,
  373. today: '',
  374. showPickerStage: false,
  375. showPickerTaskGroup: false,
  376. showPickerSubProject: false,
  377. showPickerCostId: false,
  378. isDraft:0,
  379. showWorkStartTime:false,
  380. showWorkEndTime:false,
  381. curWorktime:null,
  382. isIOSystem:false,
  383. imgShow: false,
  384. isCorpWX:false,
  385. isWX: false,
  386. showPickerTask:false,
  387. canCancel:false,
  388. canDeleteReport: false,
  389. canCancelInDialog: false,
  390. canEdit:false,
  391. showEndTime: false,
  392. showStartTime: false,
  393. startTime:'09:00',
  394. endTime: '18:00',
  395. nowTime:new Date(),
  396. showPickerHours: false,
  397. timeRange:[0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.5,13.0,13.5,14.0,14.5,15.0],
  398. selectTime:null,
  399. reportTimeType:{},
  400. user: JSON.parse(localStorage.userInfo),
  401. minDate: new Date(2010, 0, 1),
  402. maxDate: new Date(),
  403. currentDate: new Date(),
  404. showPickerTime: false,
  405. showPicker: false,
  406. showPickerProject: false,
  407. showPickDegree: false,
  408. clickIndex: 0,
  409. clickTimeIndex: 0,
  410. showNumberKey: false,
  411. canClick: 2,
  412. timeType:[],
  413. form: {
  414. createDate: this.format(new Date(new Date()),"yyyy-MM-dd"),
  415. domains: [{
  416. id: null,
  417. projectId: "",
  418. projectName: "",
  419. workingTime: "",
  420. content: "",
  421. state: 2,
  422. multiWorktime:0,
  423. worktimeList:{},
  424. degreeId: ''
  425. // pics:["https://worktime.ttkuaiban.com/upload/bc4df504fa724e6cab69872e2c1cfb35.png",
  426. // "https://worktime.ttkuaiban.com/upload/bc4df504fa724e6cab69872e2c1cfb35.png",
  427. // "https://worktime.ttkuaiban.com/upload/bc4df504fa724e6cab69872e2c1cfb35.png",]
  428. }],
  429. },
  430. rules: {
  431. createDate: [{ required: true, message: '请选择填报日期' }],
  432. },
  433. project: [],
  434. report: "",
  435. loading: false,
  436. finished: false,
  437. // isOvertime: false
  438. tmpPics:[],
  439. dateAr: [],
  440. showPickerUserddp: false, // 选择项目弹窗
  441. projectss: [],
  442. proads: [],
  443. userName: '',
  444. flgLg: true,
  445. reportBasecostList: [],
  446. isWeekend: false,
  447. auditorShow: false,
  448. auditor: {
  449. index: 0,
  450. auditorIndex: 'auditorFirst',
  451. searchText: '',
  452. item: {},
  453. list: [],
  454. searchList: []
  455. },
  456. vacationTime: {}
  457. };
  458. },
  459. created() {
  460. },
  461. computed: {
  462. totalReportHours(){
  463. let domains = this.form.domains
  464. let hours = 0
  465. for(let i in domains){
  466. if(domains[i].projectId){
  467. // hours += parseFloat(domains[i].workingTime)
  468. if(this.reportTimeType.multiWorktime == 1){
  469. for(let m in domains[i].worktimeList){
  470. if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
  471. hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
  472. }
  473. }
  474. }else{
  475. if(this.user.timeType.type == 2){
  476. if(domains[i].startTime && domains[i].endTime){
  477. let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
  478. let subtractedData = 0
  479. let arr = JSON.parse(JSON.stringify(this.vacationTime))
  480. arr.unshift({s: domains[i].startTime, e: domains[i].endTime})
  481. for(var j in arr) {
  482. subtractedData += +this.timeOverlap(j, arr)
  483. }
  484. console.log(selectionTime, subtractedData)
  485. hours += +selectionTime - +subtractedData
  486. console.log(hours)
  487. }
  488. } else {
  489. hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
  490. }
  491. }
  492. }
  493. }
  494. return hours.toFixed(2)
  495. },
  496. },
  497. methods: {
  498. // 判断两个时间段是否重叠
  499. timeOverlap(idx, dateAr) {
  500. let zhi = 0
  501. for (let k in dateAr) {
  502. if (idx !== k) {
  503. if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
  504. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  505. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  506. // zhi += 2
  507. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  508. }
  509. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  510. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  511. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  512. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  513. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  514. } else {
  515. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  516. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  517. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  518. }
  519. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  520. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  521. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  522. }
  523. }
  524. }
  525. }
  526. }
  527. return zhi
  528. },
  529. getHour(s1, s2) {
  530. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  531. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  532. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  533. var ms = s2.getTime() - s1.getTime();
  534. if (ms < 0) return 0;
  535. let ma = ms / 1000 / 60 / 60
  536. return ma; //小时
  537. },
  538. cardtimeRefresh(workdate){ // 考勤记录刷新
  539. if (!workdate) return;
  540. this.cardRefLoading = true;
  541. this.$axios.post('/user-corpwx-time/getPunchRecordBySelf',{
  542. date: workdate
  543. })
  544. .then(res => {
  545. if(res.code == 'ok'){
  546. this.cardRefLoading = false;
  547. this.report.time = res.data.time;
  548. }else{
  549. this.cardRefLoading = false;
  550. this.$toast.fail('获取失败:'+res.msg);
  551. }
  552. }).catch(err => {this.$toast.clear();this.cardRefLoading = false;})
  553. },
  554. auditorClick(domainIndex,auditorIndex){
  555. this.auditor.index = domainIndex
  556. this.auditor.auditorIndex = auditorIndex
  557. this.auditor.searchList.forEach(u=>{
  558. if(u.id == this.form.domains[domainIndex][auditorIndex].id){
  559. this.auditor.item = u
  560. }
  561. })
  562. this.auditorShow = true
  563. },
  564. onSearch(val){
  565. console.log(val);
  566. this.auditor.searchList = [];
  567. this.auditor.list.forEach(u=>{if (u.name.startsWith(val)) {
  568. this.auditor.searchList.push(u);
  569. }})
  570. },
  571. searchAuditor(){
  572. this.form.domains[this.auditor.index][this.auditor.auditorIndex] = this.auditor.item
  573. this.auditorShow = false
  574. console.log('searchAuditor');
  575. },
  576. getAllUsersList(){
  577. this.$axios.post('/user/getSimpleActiveUserList',{})
  578. .then(res => {
  579. if(res.code == 'ok'){
  580. this.auditor.list = res.data
  581. this.auditor.searchList = res.data
  582. }else{
  583. this.$toast.fail('获取失败:'+res.msg);
  584. }
  585. }).catch(err => {this.$toast.clear();})
  586. },
  587. requiredRule(val){
  588. console.log('requiredRule',val);
  589. return false
  590. },
  591. // 获取预算来源
  592. getReportBasecostList(){
  593. this.$axios.post('/project-basecost-setting/getReportBasecostList',{
  594. companyId: this.user.companyId
  595. }).then(res => {
  596. if(res.code == 'ok'){
  597. this.reportBasecostList = res.data
  598. }else{
  599. this.$toast.fail('获取失败:'+res.msg);
  600. }
  601. }).catch(err => {this.$toast.clear();})
  602. },
  603. //获取项目审核人
  604. getProjectAuditorList(domainItem) {
  605. this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId})
  606. .then(res => {
  607. if(res.code == "ok") {
  608. domainItem.auditUserList = res.data;
  609. if (res.data.length==1) {
  610. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  611. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  612. }
  613. this.$forceUpdate();
  614. } else {
  615. this.$toast.fail('获取失败:'+res.msg);
  616. }
  617. }).catch(err=> {this.$toast.clear();});
  618. },
  619. updateTxt() {
  620. this.$forceUpdate();
  621. },
  622. // 获取项目
  623. getPeoject() {
  624. this.$axios.post("/project/getProjectList", {forReport: 1})
  625. .then(res => {
  626. if(res.code == "ok") {
  627. for(var i in res.data) {
  628. if(res.data[i].projectCode == 'null' || res.data[i].projectCode == null) {
  629. res.data[i].projectCode = ' '
  630. }
  631. }
  632. this.projectss = res.data;
  633. this.project = res.data;
  634. this.projectss = this.projectss.filter(p=>p.status == 1 || p.status == 4);
  635. this.proads = res.data
  636. } else {
  637. this.$toast.fail('获取失败:'+res.msg);
  638. }
  639. }).catch(err=> {this.$toast.clear();});
  640. },
  641. sea() {
  642. // console.log(this.userName.length)
  643. if(this.userName.length > 0) {
  644. // let text = this.userName
  645. // let reg = new RegExp(text)
  646. // let data = this.proads.filter(item => reg.test(item.projectName)) //返回
  647. // let datas = this.proads.filter(item => reg.test(item.projectCode))
  648. // let dataTree = data.concat(datas)
  649. // let arrList = Array.from(new Set(dataTree))
  650. // this.projectss = arrList
  651. // console.log(this.userName.toUpperCase())
  652. let data = this.proads.filter(item => {return item.projectName.indexOf(this.userName.toUpperCase()) != '-1'});
  653. let dataList = this.proads.filter(item => {return item.projectCode.indexOf(this.userName.toUpperCase()) != '-1'});
  654. let dataTree = data.concat(dataList)
  655. let arrList = Array.from(new Set(dataTree))
  656. this.projectss = arrList
  657. } else {
  658. // console.log(456)
  659. this.projectss = this.proads
  660. }
  661. },
  662. selectDegreeId(domain, index, domainItem, list) {
  663. this.$axios.post("/report/defaultDegree", {
  664. projectId: domain.id
  665. })
  666. .then(res => {
  667. if(res.code == "ok") {
  668. var arr = domainItem.wuduList
  669. for(var i in arr) {
  670. if(arr[i].id == res.data.id) {
  671. domainItem.weiduName = arr[i].name
  672. domainItem.degreeId = res.data.id
  673. }
  674. }
  675. this.$forceUpdate();
  676. } else {
  677. this.$toast.fail('获取失败:'+res.msg);
  678. }
  679. }).catch(err=> {this.$toast.clear();});
  680. },
  681. fZr(item,index) {
  682. var domainItem = this.form.domains[this.clickIndex];
  683. domainItem.projectId = item.id;
  684. domainItem.projectName = item.projectName;
  685. //清空子项目
  686. domainItem.subProjectId = null;
  687. domainItem.subProjectName = null;
  688. //清空任务
  689. domainItem.taskId = null;
  690. domainItem.taskName = null;
  691. //清空分组和阶段
  692. domainItem.stage = null;
  693. domainItem.groupId = null;
  694. domainItem.weiduName = null;
  695. this.showPickerUserddp = false;
  696. //获取子项目
  697. if(this.user.timeType.mainProjectState != 1){
  698. this.getSubprojectList(this.form.domains[this.clickIndex]);
  699. }
  700. //加载项目相关的工程进度
  701. if (this.user.company.packageEngineering == 1){
  702. this.getProjectProfessions(this.form.domains[this.clickIndex],index);
  703. }
  704. //获取任务分组
  705. this.getTaskGroups(this.form.domains[this.clickIndex], this.clickIndex);
  706. // 获取1相关维度
  707. this.getTaskList(domainItem.projectId)
  708. this.dimension(domainItem.projectId)
  709. //获取相关日报提交选择人
  710. domainItem.projectAuditorId = null;
  711. domainItem.projectAuditorName = null;
  712. domainItem.auditUserList = null;
  713. //获取项目审核人
  714. // console.log(domainItem.projectId,this.project);
  715. var curProject = this.project.filter(p=>p.id == domainItem.projectId)[0];
  716. if (curProject && this.user.timeType.reportAuditType == 0) {
  717. this.getProjectAuditorList(domainItem, index);
  718. }
  719. console.log(item, '数据')
  720. if(this.user.timeType.customDegreeActive == 1 && item) {
  721. var that = this
  722. setTimeout(()=>{
  723. that.selectDegreeId(item, index, that.form.domains[that.clickIndex])
  724. }, 500)
  725. }
  726. },
  727. //获取项目下的任务分组
  728. getTaskGroups(domainItem, index) {
  729. domainItem.groupId=null;
  730. domainItem.groupName=null;
  731. this.$axios.post("/task-group/listMyJoinGroup", {projectId: domainItem.projectId})
  732. .then(res => {
  733. if(res.code == "ok") {
  734. domainItem.taskGroups = res.data;
  735. }
  736. this.$forceUpdate();
  737. }).catch(err=> {this.$toast.clear();});
  738. },
  739. getSubprojectList(domainItem) {
  740. domainItem.subProjectList = [];
  741. this.$axios.post("/sub-project/list", {projectId: domainItem.projectId})
  742. .then(res => {
  743. if(res.code == "ok") {
  744. domainItem.subProjectList = res.data;
  745. }
  746. this.$forceUpdate();
  747. }).catch(err=> {this.$toast.clear();});
  748. },
  749. showEndDialog(timeItem) {
  750. this.curWorktime = timeItem;
  751. this.showWorkEndTime = true;
  752. },
  753. showStartDialog(timeItem) {
  754. this.curWorktime = timeItem;
  755. this.showWorkStartTime = true;
  756. },
  757. removeTimeItem(item, index) {
  758. item.worktimeList.splice(index, 1);
  759. },
  760. isIOS(){
  761. var u = navigator.userAgent;
  762. var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  763. return isiOS;
  764. },
  765. showLargeImg(item, index) {
  766. this.imgShow = true;
  767. this.tmpPics = item;
  768. },
  769. //拍照上传
  770. takePhoto(index) {
  771. var that = this;
  772. wx.chooseImage({
  773. count: 9, // 默认9
  774. sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  775. sourceType: that.user.timeType.choseFromAlbum == 1 ? ['camera','album'] : ['camera'], // 可以指定来源是相册还是相机,默认二者都有
  776. defaultCameraMode: "batch", //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
  777. isSaveToAlbum: 0, //整型值,0表示拍照时不保存到系统相册,1表示自动保存,默认值是1
  778. success: function (res) {
  779. var localIds = res.localIds; // 返回选定照片的本地ID列表,
  780. // andriod中localId可以作为img标签的src属性显示图片;
  781. // iOS应当使用 getLocalImgData 获取图片base64数据,从而用于img标签的显示(在img标签内使用 wx.chooseImage 的 localid 显示可能会不成功)
  782. if (that.form.domains[index].pics == null) {
  783. that.form.domains[index].pics = [];
  784. that.form.domains[index].iospics = [];
  785. }
  786. if (that.isIOSystem) {
  787. for (var i=0;i<localIds.length; i++) {
  788. wx.getLocalImgData({
  789. localId: localIds[i], // 图片的localID
  790. success: function (res) {
  791. var localData = res.localData; // localData是图片的base64数据,可以用img标签显示
  792. that.form.domains[index].iospics.push(localData);
  793. that.$forceUpdate();
  794. }
  795. });
  796. }
  797. if (that.user.companyId == 7) {
  798. that.form.domains[index].pics = that.form.domains[index].pics.concat(localIds);
  799. } else {
  800. that.form.domains[index].pics = localIds;
  801. }
  802. } else {
  803. if (that.user.companyId == 7) {
  804. that.form.domains[index].pics = that.form.domains[index].pics.concat(localIds);
  805. } else {
  806. that.form.domains[index].pics = localIds;
  807. }
  808. that.$forceUpdate();
  809. }
  810. // var serverIdList = [];
  811. if (that.form.domains[index].serverPics == null) {
  812. that.form.domains[index].serverPics = [];
  813. }
  814. //立即就上传到企业微信服务器
  815. for (var i=0;i<localIds.length; i++) {
  816. wx.uploadImage({
  817. localId: localIds[i], // 需要上传的图片的本地ID,由chooseImage接口获得
  818. isShowProgressTips: 1, // 默认为1,显示进度提示
  819. success: function (res) {
  820. var serverId = res.serverId; // 返回图片的服务器端ID
  821. // serverIdList.push(serverId);
  822. that.form.domains[index].serverPics.push(serverId);
  823. }
  824. });
  825. }
  826. }
  827. });
  828. },
  829. copyProject(index) {
  830. var leftProgress = 10;
  831. if (this.reportTimeType.type == 3) {
  832. //计算已经待分配工时比例
  833. let array = this.form.domains;
  834. let totalProgress = 0;
  835. for (var i=0;i<array.length; i++) {
  836. totalProgress += array[i].progress;
  837. }
  838. if (totalProgress < 100) {
  839. leftProgress = 100 - totalProgress;
  840. }
  841. }
  842. var newIndex = index+1;
  843. var pName = "";
  844. if (this.form.domains[index].projectId != '') {
  845. pName = this.project.filter(p=>p.id == this.form.domains[index].projectId)[0].projectName;
  846. }
  847. var itemDomain = {
  848. id: null,
  849. projectId: this.form.domains[index].projectId,
  850. projectName: pName,
  851. workingTime: this.reportTimeType.type==3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  852. progress:leftProgress,
  853. content: "",
  854. state: 2,
  855. isOvertime:false,
  856. };
  857. this.form.domains.splice(newIndex, 0,itemDomain);
  858. },
  859. //删除日报
  860. deleteReport() {
  861. this.$dialog.confirm({
  862. title: '删除日报',
  863. message: '确定要删除当天日报吗?'
  864. }).then(() => {
  865. const toast = this.$toast.loading({
  866. forbidClick: true,
  867. duration: 0
  868. });
  869. this.$axios.post("/report/delete", {userId: this.user.id, date:this.form.createDate})
  870. .then(res => {
  871. if(res.code == "ok") {
  872. this.$toast.clear();
  873. this.$toast.success('删除成功');
  874. window.location.reload();
  875. } else {
  876. this.$toast.clear();
  877. this.$toast.fail('删除失败');
  878. }
  879. }).catch(err=> {this.$toast.clear();});
  880. }).catch(() => {});
  881. },
  882. changeAllTime() {
  883. //总时长发生改变,自动按比例计算
  884. this.form.domains.forEach(d=>{
  885. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  886. });
  887. },
  888. cancel() {
  889. const toast = this.$toast.loading({
  890. forbidClick: true,
  891. duration: 0
  892. });
  893. var ids = '';
  894. var data = this.form.domains;
  895. data.forEach(element => {
  896. if (element.id != null && element.id != '') {
  897. if(element.id){
  898. ids +=(element.id+',');
  899. }
  900. }
  901. });
  902. this.$axios.post("/report/cancel", {userId: this.user.id, reportIds:ids})
  903. .then(res => {
  904. if(res.code == "ok") {
  905. this.$toast.clear();
  906. this.$toast.success('撤销成功');
  907. this.getReport();
  908. } else {
  909. this.$toast.clear();
  910. this.$toast.fail('获取失败');
  911. }
  912. }).catch(err=> {this.$toast.clear();});
  913. },
  914. confirmWorkTime(field) {
  915. if (field == 0) {
  916. this.curWorktime.startTime = this.startTime;
  917. this.showWorkStartTime = false;
  918. } else {
  919. this.curWorktime.endTime = this.endTime;
  920. this.showWorkEndTime = false;
  921. }
  922. },
  923. confirmTime(item, field) {
  924. if (field == 0) {
  925. item.startTime = this.startTime;
  926. this.showStartTime = false;
  927. } else {
  928. item.endTime = this.endTime;
  929. this.showEndTime = false;
  930. }
  931. },
  932. filter(type, options) {
  933. if (type === 'minute') {
  934. return options.filter(option => option % 30 === 0);
  935. }
  936. return options;
  937. },
  938. choseTimePick(value, index) {
  939. if(!value){
  940. return
  941. }
  942. //选中时间
  943. if (this.reportTimeType.type == 0) {
  944. this.form.domains[this.clickTimeIndex].timeType = value.value;
  945. this.form.domains[this.clickTimeIndex].workingTime = value.hours;
  946. this.form.domains[this.clickTimeIndex].label = value.label;
  947. this.showPickerTime = false;
  948. } else if (this.reportTimeType.type == 1) {
  949. // console.log('this.reportTimeType.type=='+value,this.form.domains);
  950. this.form.domains[this.clickTimeIndex].workingTime = value;
  951. this.form.domains[this.clickTimeIndex].label = value.toFixed(1)+'小时';
  952. this.showPickerHours = false;
  953. let allhour = 0
  954. for(let i in this.form.domains){
  955. if(this.isWeekend){
  956. this.form.domains[i].isOvertime = true
  957. this.form.domains[i].overtimeHours = this.form.domains[i].workingTime
  958. }else{
  959. this.form.domains[i].isOvertime = false
  960. delete this.form.domains[i].overtimeHours
  961. }
  962. allhour += this.form.domains[i].workingTime*1
  963. }
  964. if(allhour > this.user.timeType.allday && !this.isWeekend){
  965. this.form.domains[this.clickTimeIndex].isOvertime = true
  966. this.form.domains[this.clickTimeIndex].overtimeHours = allhour - this.user.timeType.allday
  967. }
  968. }
  969. },
  970. clickTimePicker(i,item) {
  971. if (!item.canEdit) {
  972. return;
  973. }
  974. this.clickTimeIndex = i;
  975. if (this.reportTimeType.type == 0) {
  976. this.showPickerTime = true;
  977. } else if (this.reportTimeType.type == 1) {
  978. this.showPickerHours = true;
  979. }
  980. },
  981. getTimeType() {
  982. this.$axios.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId})
  983. .then(res => {
  984. if(res.code == "ok") {
  985. var t = res.data;
  986. this.reportTimeType = t;
  987. //转化时间格式
  988. if (t.allday != null) {
  989. this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
  990. }
  991. if (t.am != null) {
  992. this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
  993. }
  994. if (t.pm != null) {
  995. this.timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
  996. }
  997. let arr = []
  998. for(var i in res.data.excludeTimeList) {
  999. let obj = {
  1000. s: res.data.excludeTimeList[i].startTime,
  1001. e: res.data.excludeTimeList[i].endTime,
  1002. }
  1003. arr.push(obj)
  1004. }
  1005. this.vacationTime = arr
  1006. } else {
  1007. this.$toast.clear();
  1008. this.$toast.fail(res.msg);
  1009. }
  1010. }).catch(err=> {this.$toast.clear();});
  1011. },
  1012. // 返回
  1013. back() {
  1014. history.back();
  1015. },
  1016. // 时间转换
  1017. format(date, pattern) {
  1018. pattern = pattern || "yyyy-MM-dd";
  1019. var _this = this;
  1020. return pattern.replace(/([yMdhsm])(\1*)/g, function ($0) {
  1021. switch ($0.charAt(0)) {
  1022. case 'y': return _this.padding(date.getFullYear(), $0.length);
  1023. case 'M': return _this.padding(date.getMonth() + 1, $0.length);
  1024. case 'd': return _this.padding(date.getDate(), $0.length);
  1025. case 'w': return date.getDay() + 1;
  1026. case 'h': return _this.padding(date.getHours(), $0.length);
  1027. case 'm': return _this.padding(date.getMinutes(), $0.length);
  1028. case 's': return _this.padding(date.getSeconds(), $0.length);
  1029. }
  1030. });
  1031. },
  1032. padding(s, len) {
  1033. var len = len - (s + '').length;
  1034. for (var i = 0; i < len; i++) { s = '0' + s; }
  1035. return s;
  1036. },
  1037. // 获取项目
  1038. getProject() {
  1039. const toast = this.$toast.loading({
  1040. forbidClick: true,
  1041. duration: 0
  1042. });
  1043. this.$axios.post("/project/getProjectList", {})
  1044. .then(res => {
  1045. if(res.code == "ok") {
  1046. this.$toast.clear();
  1047. // if (this.project.length > 0) {
  1048. // console.log('this.project[0].id=='+this.project[0].id);
  1049. // this.getTaskList(this.project[0].id);
  1050. // }
  1051. } else {
  1052. this.$toast.clear();
  1053. this.$toast.fail('获取失败:'+res.msg);
  1054. }
  1055. }).catch(err=> {this.$toast.clear();});
  1056. },
  1057. // 获取日报
  1058. getReport() {
  1059. this.isWeekend = false
  1060. let weekday = new Date(this.form.createDate).getDay()
  1061. if(this.user.companyId == 817){
  1062. if(weekday == 0){
  1063. this.isWeekend = true
  1064. }
  1065. }else{
  1066. if(weekday == 0 || weekday == 6){
  1067. this.isWeekend = true
  1068. }
  1069. }
  1070. const toast = this.$toast.loading({
  1071. forbidClick: true,
  1072. duration: 0
  1073. });
  1074. this.$axios.post("/report/getReport", {date: this.form.createDate})
  1075. .then(res => {
  1076. if(res.code == "ok") {
  1077. this.$toast.clear();
  1078. this.report = res.data;
  1079. var t = res.data.timeType;
  1080. var timeType=[];
  1081. //转化时间格式
  1082. if (t.allday != null) {
  1083. timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
  1084. }
  1085. if (t.am != null) {
  1086. timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
  1087. }
  1088. if (t.pm != null) {
  1089. timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
  1090. }
  1091. var list = res.data.report;
  1092. this.canCancelInDialog = false
  1093. if(list.length != 0) {
  1094. this.canEdit = false;
  1095. this.canCancel = false;
  1096. this.canDeleteReport = true
  1097. let array = [];
  1098. for(var i in list) {
  1099. var projectName = "";
  1100. var flg = (list[i].isOvertime == 1);
  1101. for(var j in this.project) {
  1102. if(this.project[j].id == list[i].projectId) {
  1103. projectName = this.project[j].projectName;
  1104. }
  1105. }
  1106. let tname = '';
  1107. if (list[i].taskId != null && list[i].taskList.length > 0) {
  1108. let filterList = list[i].taskList.filter(t=>t.taskId == list[i].taskId);
  1109. if (filterList.length > 0) {
  1110. tname = filterList[0].taskName;
  1111. }
  1112. }
  1113. let mmm = list[i].degreeId
  1114. let sss = list[i].degreeList
  1115. let wuduName = ''
  1116. for (var s in sss) {
  1117. if(sss[s].id == mmm) {
  1118. wuduName = sss[s].name
  1119. }
  1120. }
  1121. let serverPicArray = [];
  1122. // console.log('picArray=='+list[i].picStr);
  1123. if (list[i].picStr != null && list[i].picStr != '@') {
  1124. serverPicArray = JSON.parse(list[i].picStr.replace(/@/g,","));
  1125. }
  1126. var subProjectName = null;
  1127. if (list[i].subProjectId) {
  1128. subProjectName = list[i].subProjectList.filter(s=>s.id==list[i].subProjectId)[0].name;
  1129. }
  1130. let basecostName = ''
  1131. if (res.data.timeBasecostList && res.data.timeBasecostList.length > 0) {
  1132. for(let m in res.data.timeBasecostList){
  1133. if(res.data.timeBasecostList[m].id == list[i].basecostId){
  1134. basecostName = res.data.timeBasecostList[m].name
  1135. }
  1136. }
  1137. }
  1138. array.push({
  1139. id: list[i].id,
  1140. projectId: list[i].projectId,
  1141. projectName: projectName,
  1142. workingTime: String(list[i].workingTime),
  1143. content: list[i].content,
  1144. state: list[i].state,
  1145. timeType: list[i].timeType,
  1146. label: timeType[list[i].timeType].label,
  1147. startTime: list[i].startTime,
  1148. endTime: list[i].endTime,
  1149. isOvertime: flg,
  1150. progress: list[i].progress,
  1151. taskList: list[i].taskList,
  1152. taskId: list[i].taskId ? list[i].taskId : null,
  1153. taskName:tname,
  1154. professionProgress:list[i].professionProgressList,
  1155. pics: list[i].pics,
  1156. iospics:list[i].pics,
  1157. serverPics:serverPicArray,
  1158. multiWorktime:t.multiWorktime,
  1159. worktimeList:list[i].worktimeList,
  1160. wuduList: list[i].degreeList,
  1161. weiduName: wuduName,
  1162. degreeId: list[i].degreeId,
  1163. subProjectId: list[i].subProjectId,
  1164. subProjectName: subProjectName,
  1165. subProjectList: list[i].subProjectList,
  1166. groupId: list[i].groupId == 0?null:list[i].groupId,
  1167. groupName: list[i].groupName,
  1168. taskGroups:list[i].taskGroups,
  1169. stages:list[i].stages,
  1170. stage:list[i].stage == '-'?null:list[i].stage,
  1171. customData: list[i].customData,
  1172. projectAuditorId: list[i].projectAuditorId,
  1173. projectAuditorName: list[i].projectAuditorName,
  1174. auditUserList: list[i].auditUserList,
  1175. overtimeHours: list[i].overtimeHours,
  1176. customText: list[i].customText,
  1177. basecostId: list[i].basecostId,
  1178. basecostName: basecostName,
  1179. canEdit: list[i].state >= 2 ? true : false,
  1180. auditorFirst: list[i].auditorSetting && list[i].auditorSetting.auditorFirst ? list[i].auditorSetting.auditorFirst : {name:'',id:''},
  1181. auditorSec: list[i].auditorSetting && list[i].auditorSetting.auditorSec ? list[i].auditorSetting.auditorSec : {name:'',id:''},
  1182. auditorThird: list[i].auditorSetting && list[i].auditorSetting.auditorThird ? list[i].auditorSetting.auditorThird : {name:'',id:''},
  1183. ccUserid: list[i].auditorSetting && list[i].auditorSetting.ccUserid ? list[i].auditorSetting.ccUserid : {name:'',id:''},
  1184. })
  1185. if (list[i].state >= 2) {
  1186. this.canEdit = true;
  1187. } else {
  1188. this.canDeleteReport = false
  1189. }
  1190. if (list[i].state == 0) {
  1191. this.canCancel = true;
  1192. this.canCancelInDialog = true
  1193. }
  1194. }
  1195. this.form.domains = array;
  1196. } else {
  1197. this.canCancel = false;
  1198. this.canEdit = true;
  1199. var shuzhi = this.user.timeType.allday + ''
  1200. //没有填报的可以点击提交
  1201. this.form.domains = [{
  1202. id: null,
  1203. projectId: "",
  1204. projectName: "",
  1205. // workingTime: t.type==3?(t.allday).toFixed(1):"8.0",
  1206. workingTime: t.type==3?(t.allday).toFixed(1):shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi,
  1207. content: "",
  1208. state: 2,
  1209. progress:100,
  1210. isOvertime:false,
  1211. professionProgress:[],
  1212. multiWorktime:t.multiWorktime,
  1213. worktimeList:[{}],
  1214. canEdit: true,
  1215. auditorFirst: {name:'',id:''},
  1216. auditorSec: {name:'',id:''},
  1217. auditorThird: {name:'',id:''},
  1218. ccUserid: {name:'',id:''}
  1219. }]
  1220. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  1221. this.$set(this.form.domains[0],'isOvertime',true)
  1222. if(t.type != 2 && t.type != 0){
  1223. this.$set(this.form.domains[0],'overtimeHours',t.allday.toFixed(0))
  1224. }
  1225. }
  1226. if(this.report.timeBasecostList.length != 0 && this.user.company.packageProject == 1){
  1227. this.form.domains[0].basecostId = this.report.timeBasecostList[0].id;
  1228. this.form.domains[0].basecostName = this.report.timeBasecostList[0].name;
  1229. }
  1230. this.canEdit = true;
  1231. }
  1232. } else {
  1233. this.$toast.clear();
  1234. this.$toast.fail('获取失败:'+res.msg);
  1235. }
  1236. if(localStorage.getItem("formVal")) {
  1237. // console.log('触发了')
  1238. var obj = localStorage.getItem("formVal")
  1239. this.form = JSON.parse(obj)
  1240. localStorage.removeItem('formVal')
  1241. }
  1242. }).catch(err=> {this.$toast.clear();});
  1243. },
  1244. // 改变时间
  1245. changeTime(time) {
  1246. this.form.createDate = this.format(new Date(time),"yyyy-MM-dd");
  1247. this.currentDate = time;
  1248. this.showPicker = false;
  1249. this.getReport();
  1250. },
  1251. //点击选择审核人
  1252. clickPickAuditor(i, item) {
  1253. if (!item.canEdit) return;
  1254. if (item.auditUserList.length<=1) return;
  1255. this.clickIndex = i;
  1256. item.showPickerAuditor = true;
  1257. this.$forceUpdate();
  1258. },
  1259. choseAuditor(value, index) {
  1260. if(value){
  1261. this.form.domains[this.clickIndex].projectAuditorId = value.auditorId;
  1262. this.form.domains[this.clickIndex].projectAuditorName = value.auditorName;
  1263. }
  1264. this.form.domains[this.clickIndex].showPickerAuditor = false;
  1265. this.$forceUpdate();
  1266. },
  1267. //点击选择子项目
  1268. clickPickSubProject(i, item) {
  1269. if (!item.canEdit) return;
  1270. this.clickIndex = i;
  1271. item.showPickerSubProject = true;
  1272. this.$forceUpdate();
  1273. },
  1274. clickPickCostId(i, item) {
  1275. if (!item.canEdit) return;
  1276. this.clickIndex = i;
  1277. item.showPickerCostId = true;
  1278. this.$forceUpdate();
  1279. },
  1280. clickPickTaskGroup(i, item) {
  1281. if (!item.canEdit) return;
  1282. this.clickIndex = i;
  1283. item.showPickerTaskGroup = true;
  1284. this.$forceUpdate();
  1285. },
  1286. clickPickStage(i, item) {
  1287. if (!item.canEdit) return;
  1288. this.clickIndex = i;
  1289. item.showPickerStage = true;
  1290. this.$forceUpdate();
  1291. },
  1292. // 选择项目
  1293. clickPicker(i, item) {
  1294. if (!item.canEdit) return;
  1295. // this.clickIndex = i;
  1296. // this.showPickerProject = true;
  1297. // console.log(i, item, this.form)
  1298. this.clickIndex = i
  1299. this.showPickerUserddp = true
  1300. // console.log(item);
  1301. // this.dimension()
  1302. // this.$router.push({
  1303. // path: '/search',
  1304. // query: {
  1305. // // from: JSON.stringify(this.form)
  1306. // from: this.form,
  1307. // idx: i
  1308. // }
  1309. // });
  1310. },
  1311. clickPickers(i,item) {
  1312. // console.log('wudulist',item.wuduList);
  1313. if (!item.canEdit) return;
  1314. this.clickIndex = i;
  1315. // item.showPickDegree = true;
  1316. this.$set(item,'showPickDegree',true)
  1317. // var proId = this.form.domains[this.clickIndex].projectId
  1318. // this.dimension(proId)
  1319. },
  1320. //选择任务
  1321. clickPickerTask(i,item) {
  1322. if (!item.canEdit) return;
  1323. // console.log(i);
  1324. this.clickIndex = i;
  1325. // var proId = this.form.domains[this.clickIndex].projectId
  1326. // this.getTaskList(proId)
  1327. // console.log(this.form.domains[this.clickIndex].taskList);
  1328. this.$toast.clear();
  1329. if(!this.form.domains[this.clickIndex].taskList){
  1330. this.$toast.fail('当前项目暂无可选的任务/里程碑');
  1331. }else if(this.form.domains[this.clickIndex].taskList.length == 0){
  1332. this.$toast.fail('当前项目暂无可选的任务/里程碑');
  1333. }else{
  1334. this.form.domains[this.clickIndex].showPickerTask = true;
  1335. }
  1336. this.$forceUpdate();
  1337. },
  1338. choseTask(value, index) {
  1339. if(value){
  1340. this.form.domains[this.clickIndex].taskId = value.taskId;
  1341. this.form.domains[this.clickIndex].taskName = value.taskName;
  1342. }
  1343. this.form.domains[this.clickIndex].showPickerTask = false;
  1344. this.$forceUpdate();
  1345. },
  1346. choseProjects(value, index) {
  1347. // console.log(value)
  1348. if(value){
  1349. this.form.domains[this.clickIndex].weiduName = value.name;
  1350. this.form.domains[this.clickIndex].degreeId = value.id;
  1351. this.$forceUpdate();}
  1352. this.form.domains[this.clickIndex].showPickDegree = false;
  1353. },
  1354. choseSubProject(value, index) {
  1355. if(value){
  1356. this.form.domains[this.clickIndex].subProjectId = value.id;
  1357. this.form.domains[this.clickIndex].subProjectName = value.name;
  1358. }
  1359. this.form.domains[this.clickIndex].showPickerSubProject = false;
  1360. this.$forceUpdate();
  1361. },
  1362. choseTaskGroup(value, index) {
  1363. if(!value){
  1364. return
  1365. }
  1366. this.form.domains[this.clickIndex].groupId = value.id;
  1367. this.form.domains[this.clickIndex].groupName = value.name;
  1368. this.form.domains[this.clickIndex].showPickerTaskGroup = false;
  1369. var domainItem = this.form.domains[this.clickIndex];
  1370. this.getGroupStages(this.form.domains[this.clickIndex], index);
  1371. //检查当前的项目是否需要获取分组的负责人
  1372. var curProject = this.project.filter(p=>p.id == this.form.domains[this.clickIndex].projectId)[0];
  1373. if (curProject && this.user.timeType.reportAuditType >= 1) {
  1374. this.$axios.post("/task-group/getGroupIncharger", {groupId: domainItem.groupId})
  1375. .then(res => {
  1376. if(res.code == "ok") {
  1377. domainItem.auditUserList = res.data;
  1378. if (res.data.length==1) {
  1379. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  1380. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  1381. }
  1382. this.$forceUpdate();
  1383. } else {
  1384. this.$toast.fail('获取失败:'+res.msg);
  1385. }
  1386. }).catch(err=> {this.$toast.clear();});
  1387. }
  1388. },
  1389. choseStage(value, index) {
  1390. if (value) {
  1391. this.form.domains[this.clickIndex].stage = value.stagesName;
  1392. }
  1393. this.form.domains[this.clickIndex].showPickerStage = false;
  1394. this.$forceUpdate();
  1395. },
  1396. choseCostId(value,index){
  1397. if(value){
  1398. this.form.domains[this.clickIndex].basecostId = value.id;
  1399. this.form.domains[this.clickIndex].basecostName = value.name;
  1400. }
  1401. this.form.domains[this.clickIndex].showPickerCostId = false;
  1402. this.$forceUpdate();
  1403. },
  1404. getGroupStages(domain, index) {
  1405. this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
  1406. .then(res => {
  1407. if(res.code == "ok") {
  1408. domain.stage = '';
  1409. domain.stages = res.data;
  1410. this.$forceUpdate();
  1411. } else {
  1412. this.$toast.fail('获取失败');
  1413. }
  1414. }).catch(err=> {this.$toast.clear();});
  1415. },
  1416. getProjectProfessions(domain, index) {
  1417. // console.log(domain, '数据')
  1418. this.$axios.post("/project-profession/getMyProfession", {projectId: domain.projectId})
  1419. .then(res => {
  1420. if(res.code == "ok") {
  1421. this.form.domains[this.clickIndex].professionProgress = res.data;
  1422. // console.log(this.form.domains)
  1423. this.$forceUpdate();
  1424. } else {
  1425. this.$toast.fail('获取失败');
  1426. }
  1427. }).catch(err=> {this.$toast.clear();});
  1428. },
  1429. // 获取维度
  1430. dimension(projectId) {
  1431. this.$axios.post("/project/getDegreeList", {projectId: projectId})
  1432. .then(res => {
  1433. if(res.code == "ok") {
  1434. this.form.domains[this.clickIndex].wuduList = res.data;
  1435. this.$forceUpdate();
  1436. } else {
  1437. this.$toast.fail('获取失败');
  1438. }
  1439. }).catch(err=> {this.$toast.clear();});
  1440. },
  1441. getTaskList(projectId) {
  1442. //如果是专业版,需要列出任务列表
  1443. if (this.user.company.packageProject == 1) {
  1444. this.$axios.post("/task/getRecentTask", {projectId: projectId})
  1445. .then(res => {
  1446. if(res.code == "ok") {
  1447. this.form.domains[this.clickIndex].taskList = res.data;
  1448. this.form = this.form;
  1449. // this.$forceUpdate();
  1450. } else {
  1451. this.$toast.fail('获取失败');
  1452. }
  1453. }).catch(err=> {this.$toast.clear();});
  1454. }
  1455. },
  1456. //添加工时
  1457. addNewWorktime(index, item) {
  1458. item.worktimeList.push({});
  1459. },
  1460. // 添加项目
  1461. addNewPro() {
  1462. var leftProgress = 10;
  1463. if (this.reportTimeType.type == 3) {
  1464. //计算已经待分配工时比例
  1465. let array = this.form.domains;
  1466. let totalProgress = 0;
  1467. for (var i=0;i<array.length; i++) {
  1468. totalProgress += array[i].progress;
  1469. }
  1470. if (totalProgress < 100) {
  1471. leftProgress = 100 - totalProgress;
  1472. }
  1473. }
  1474. let item = {
  1475. id: null,
  1476. projectId: "",
  1477. projectName: "",
  1478. workingTime: this.reportTimeType.type==3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"4.0",
  1479. progress:leftProgress,
  1480. content: "",
  1481. state: 2,
  1482. isOvertime:false,
  1483. multiWorktime: this.reportTimeType.multiWorktime,
  1484. worktimeList:[{}],
  1485. degreeId: null,
  1486. canEdit: true
  1487. }
  1488. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  1489. this.$set(item,'isOvertime',true)
  1490. if(this.reportTimeType.type == 3){
  1491. this.$set(item,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(1))
  1492. }else{
  1493. this.$set(item,'overtimeHours',4)
  1494. }
  1495. }
  1496. if(this.report.timeBasecostList.length != 0 && this.user.company.packageProject==1){
  1497. this.$set(item,'basecostId',this.report.timeBasecostList[0].id)
  1498. this.$set(item,'basecostName',this.report.timeBasecostList[0].name)
  1499. }
  1500. this.form.domains.push(item)
  1501. this.canEdit = true
  1502. this.$forceUpdate()
  1503. },
  1504. // 移除项目
  1505. delPro(i) {
  1506. this.$dialog.confirm({
  1507. title: '',
  1508. message: '是否移除当前项目'
  1509. }).then(() => {
  1510. this.form.domains.splice(i,1);
  1511. }).catch(() => {
  1512. });
  1513. },
  1514. // 判断时间段
  1515. fns() {
  1516. for (let k in this.dateAr) {
  1517. if (!this.judege(k)) {
  1518. return false
  1519. }
  1520. }
  1521. return true
  1522. },
  1523. judege(idx){
  1524. for (let k in this.dateAr) {
  1525. if (idx !== k) {
  1526. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  1527. return false
  1528. }
  1529. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  1530. return false
  1531. }
  1532. }
  1533. }
  1534. return true
  1535. },
  1536. // 提交日报
  1537. submitReport() {
  1538. this.$refs.loginForm.validate().then(
  1539. ()=>{
  1540. // 验证通过
  1541. if(this.totalReportHours < this.user.timeType.allday){
  1542. this.$dialog.confirm({
  1543. title: '提示',
  1544. message: '当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?'
  1545. }).then(()=>{
  1546. this.submitReportSon()
  1547. }).catch(()=>{})
  1548. }else{
  1549. this.submitReportSon()
  1550. }
  1551. }).catch(()=>{
  1552. //验证失败
  1553. console.log('验证失败');
  1554. return
  1555. })
  1556. },
  1557. submitReportSon(){
  1558. this.dateAr = []
  1559. let alp = []
  1560. if(this.user.timeType.multiWorktime == 1) {
  1561. for(var p in this.form.domains) {
  1562. var slll = this.form.domains[p]
  1563. for(var o in slll.worktimeList) {
  1564. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  1565. let objs = {}
  1566. objs.s = slll.worktimeList[o].startTime
  1567. objs.e = slll.worktimeList[o].endTime
  1568. alp.push(objs)
  1569. }
  1570. }
  1571. }
  1572. }else{
  1573. for(let i in this.form.domains){
  1574. let objs = {}
  1575. objs.s = this.form.domains[i].startTime
  1576. objs.e = this.form.domains[i].endTime
  1577. alp.push(objs)
  1578. }
  1579. }
  1580. this.dateAr = alp
  1581. if(this.dateAr.length > 0) {
  1582. let trus = this.fns()
  1583. if(!trus) {
  1584. this.$toast('填写的时间段重叠')
  1585. return
  1586. }
  1587. }
  1588. //检查子项目
  1589. if (this.user.timeType.subProMustFill == 1) {
  1590. for(var p in this.form.domains) {
  1591. var oneProItem = this.form.domains[p]
  1592. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  1593. //没有选择子项目
  1594. this.$toast('子项目必填,请检查')
  1595. return
  1596. }
  1597. }
  1598. }
  1599. // return
  1600. const toast = this.$toast.loading({
  1601. forbidClick: true,
  1602. duration: 0
  1603. });
  1604. // let formData = new FormData();
  1605. let formData = new URLSearchParams()
  1606. formData.append("draft", this.isDraft);
  1607. if (this.reportTimeType.type == 0) {
  1608. var alldayNum = 0;
  1609. var amNum = 0;
  1610. var pmNum = 0;
  1611. for(var i in this.form.domains) {
  1612. if (this.form.domains[i].timeType == 0) {
  1613. alldayNum ++;
  1614. } else if (this.form.domains[i].timeType == 1) {
  1615. amNum++;
  1616. } else if (this.form.domains[i].timeType == 2) {
  1617. pmNum++;
  1618. }
  1619. }
  1620. if (alldayNum > 1) {
  1621. this.$toast.fail("工作时间-全天,只能选择一次");
  1622. return;
  1623. }
  1624. if (amNum > 1) {
  1625. this.$toast.fail("工作时间-上午,只能选择一次");
  1626. return;
  1627. }
  1628. if (pmNum > 1) {
  1629. this.$toast.fail("工作时间-下午,只能选择一次");
  1630. return;
  1631. }
  1632. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  1633. this.$toast.fail("工作时间-全天,不能和上下午同时存在");
  1634. return;
  1635. }
  1636. } else if (this.reportTimeType.type == 3) {
  1637. //总百分比不能超过100%
  1638. let total = 0;
  1639. this.form.domains.forEach(w=>{total += w.progress});
  1640. if (total > 100) {
  1641. this.$toast.fail("用时比例之和不能超过100%");
  1642. return;
  1643. } else if (total < 100) {
  1644. this.$toast.fail("工时尚未完全分配,无法提交");
  1645. return;
  1646. }
  1647. }
  1648. if(this.user.timeType.notAllowedNoAttendance == 1){
  1649. if (this.report.time){
  1650. if (this.report.time.workHours == 0){
  1651. this.$toast.fail('无考勤记录不可填报')
  1652. return
  1653. }
  1654. }else{
  1655. this.$toast.fail('无考勤记录不可填报')
  1656. return
  1657. }
  1658. }
  1659. if (this.reportTimeType.type == 1 && this.report.time) {
  1660. var totalTime = 0;
  1661. for (var t=0;t<this.form.domains.length; t++) {
  1662. totalTime += parseFloat(this.form.domains[t].workingTime);
  1663. }
  1664. if (this.report.time.workHours && totalTime > parseFloat(this.report.time.workHours)) {
  1665. this.$toast.fail("填报工时之和"+(totalTime)+"h不能超过考勤总工时("+this.report.time.workHours.toFixed(1)+"h)");
  1666. return;
  1667. }
  1668. }
  1669. //填字段
  1670. for(var i in this.form.domains) {
  1671. if(this.user.timeType.reportAuditType == 3){
  1672. let audItem = {}
  1673. let auditRule = ''
  1674. if(this.form.domains[i].id){
  1675. audItem.reportId = this.form.domains[i].id
  1676. }
  1677. if(this.user.timeType.auditLevel > 0){
  1678. if(!this.form.domains[i].auditorFirst.id){ auditRule += '第一、' }
  1679. audItem.auditorFirst = this.form.domains[i].auditorFirst.id
  1680. }
  1681. if(this.user.timeType.auditLevel > 1){
  1682. // if(!this.form.domains[i].auditorSec.id){ auditRule += '第二、' }
  1683. audItem.auditorSec = this.form.domains[i].auditorSec.id
  1684. }
  1685. if(this.user.timeType.auditLevel > 2){
  1686. // if(!this.form.domains[i].auditorThird.id){ auditRule += '第三、' }
  1687. audItem.auditorThird = this.form.domains[i].auditorThird.id
  1688. }
  1689. if(this.form.domains[i].ccUserid.id){
  1690. audItem.ccUserid = this.form.domains[i].ccUserid.id
  1691. }
  1692. if(auditRule){
  1693. auditRule = auditRule.substring(0,auditRule.length - 1)
  1694. this.$toast.fail('请指定' + auditRule + '审核人')
  1695. return
  1696. }
  1697. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  1698. }
  1699. if (this.user.timeType.customDegreeActive == 1) {
  1700. if(this.form.domains[i].degreeId) {
  1701. formData.append("degreeId", this.form.domains[i].degreeId);
  1702. } else {
  1703. if(this.user.timeType.customDegreeStatus && this.form.domains[i].wuduList.length){
  1704. this.$toast.fail('请选择' + this.user.timeType.customDegreeName)
  1705. return
  1706. }else{
  1707. formData.append("degreeId", -1);
  1708. }
  1709. }
  1710. } else {
  1711. formData.append("degreeId", -1);
  1712. }
  1713. if(this.form.domains[i].customData) {
  1714. formData.append("customData", this.form.domains[i].customData);
  1715. } else {
  1716. formData.append("customData", "0");
  1717. }
  1718. if(this.form.domains[i].customText) {
  1719. formData.append("customText", this.form.domains[i].customText);
  1720. } else {
  1721. formData.append("customText", "-");
  1722. }
  1723. if (this.form.domains[i].id) {
  1724. formData.append("id", this.form.domains[i].id);
  1725. } else {
  1726. formData.append("id", -1);
  1727. }
  1728. formData.append("projectId", parseFloat(this.form.domains[i].projectId));
  1729. if (this.form.domains[i].subProjectId) {
  1730. formData.append("subProjectId", this.form.domains[i].subProjectId);
  1731. } else {
  1732. formData.append("subProjectId", 0);
  1733. }
  1734. if (this.form.domains[i].groupId) {
  1735. formData.append("groupId", this.form.domains[i].groupId);
  1736. } else {
  1737. formData.append("groupId", 0);
  1738. }
  1739. if (this.form.domains[i].stage) {
  1740. formData.append("stage", this.form.domains[i].stage);
  1741. } else {
  1742. formData.append("stage", '-');
  1743. }
  1744. formData.append("reportTimeType", this.reportTimeType.type);
  1745. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  1746. if (this.reportTimeType.type == 0) {
  1747. formData.append("timeType", this.form.domains[i].timeType);
  1748. formData.append("workingTime", parseFloat(this.form.domains[i].workingTime));
  1749. } else if (this.reportTimeType.type == 1) {
  1750. formData.append("workingTime", parseFloat(this.form.domains[i].workingTime));
  1751. } else if (this.reportTimeType.type == 2) {
  1752. formData.append("startTime", this.form.domains[i].startTime);
  1753. formData.append("endTime",this.form.domains[i].endTime);
  1754. } else if (this.reportTimeType.type == 3) {
  1755. formData.append("progress", this.form.domains[i].progress);
  1756. formData.append("workingTime",this.form.domains[i].workingTime);
  1757. }
  1758. if (this.form.domains[i].taskId) {
  1759. formData.append("taskId", this.form.domains[i].taskId);
  1760. } else {
  1761. formData.append("taskId", 0);
  1762. }
  1763. if (this.form.domains[i].taskFinish == true) {
  1764. formData.append("taskFinish", 1);
  1765. } else {
  1766. formData.append("taskFinish", 0);
  1767. }
  1768. formData.append("createDate", this.form.createDate);
  1769. formData.append("isOvertime", this.form.domains[i].isOvertime && this.user.timeType.fillOvertime?1:0);
  1770. if (this.form.domains[i].overtimeHours && this.form.domains[i].isOvertime == 1 && this.user.timeType.fillOvertime) {
  1771. formData.append("overtimeHours", this.form.domains[i].overtimeHours);
  1772. } else {
  1773. formData.append("overtimeHours", 0);
  1774. }
  1775. if(this.form.domains[i].basecostId){
  1776. formData.append("basecostId", this.form.domains[i].basecostId);
  1777. }
  1778. //项目专业进度
  1779. if (this.form.domains[i].professionProgress) {
  1780. let m = JSON.stringify(this.form.domains[i].professionProgress);
  1781. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  1782. formData.append("professionProgress", m);
  1783. } else {
  1784. formData.append("professionProgress", "[]");
  1785. }
  1786. //图片的处理,serverPic是当前所有的照片
  1787. if (this.form.domains[i].serverPics) {
  1788. let m = JSON.stringify(this.form.domains[i].serverPics);
  1789. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  1790. formData.append("pics", m);
  1791. } else {
  1792. formData.append("pics", "@");
  1793. }
  1794. //处理多个时间事项
  1795. if (this.reportTimeType.multiWorktime == 1) {
  1796. //检查时间是否有重叠
  1797. var workList = this.form.domains[i].worktimeList;
  1798. for (var j=0;j<workList.length; j++) {
  1799. var curItem = workList[j];
  1800. if (curItem.startTime == null || curItem.endTime == null) {
  1801. this.$toast.fail("请设置工作时间");
  1802. return;
  1803. }
  1804. //检查开始时间是否大于结束时间
  1805. if (curItem.startTime >= curItem.endTime) {
  1806. this.$toast.fail("时间段"+curItem.startTime+'-'+curItem.endTime+"有误:"+
  1807. "结束时间必须大于开始时间");
  1808. return;
  1809. }
  1810. for (var p = j+1;p<workList.length; p++) {
  1811. var jItem = workList[p];
  1812. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  1813. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  1814. this.$toast.fail("时间段"+curItem.startTime+'-'+curItem.endTime+"与"+
  1815. jItem.startTime+'-'+jItem.endTime+ "存在重叠,请修改。");
  1816. return;
  1817. }
  1818. }
  1819. }
  1820. let m = JSON.stringify(this.form.domains[i].worktimeList);
  1821. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  1822. formData.append("content", m);
  1823. } else {
  1824. if (this.form.domains[i].content) {
  1825. formData.append("content", this.form.domains[i].content);
  1826. } else {
  1827. formData.append("content", '-');
  1828. }
  1829. }
  1830. //审核人
  1831. if (this.form.domains[i].projectAuditorId) {
  1832. formData.append("projectAuditorId", this.form.domains[i].projectAuditorId);
  1833. } else {
  1834. if (this.user.timeType.reportAuditType == 0) {
  1835. this.$toast.fail("请指定["+this.form.domains[i].projectName+']项目的审核人');
  1836. return;
  1837. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  1838. if (this.form.domains[i].taskGroups.length == 0) {
  1839. this.$toast.fail("您在["+this.form.domains[i].projectName+"]项目上尚无参与的任务分组");
  1840. return;
  1841. } else if (!this.form.domains[i].groupId) {
  1842. this.$toast.fail("请选择["+this.form.domains[i].projectName+"]项目的任务分组");
  1843. return;
  1844. } else {
  1845. this.$toast.fail("请先设置["+this.form.domains[i].projectName+']-['+this.form.domains[i].groupName+']的分组负责人');
  1846. return;
  1847. }
  1848. }
  1849. }
  1850. }
  1851. if(!this.flgLg) {
  1852. return
  1853. }
  1854. this.flgLg = false
  1855. this.$axios.post("/report/editReport", formData)
  1856. .then(res => {
  1857. this.flgLg = true
  1858. if(res.code == "ok") {
  1859. this.$toast.clear();
  1860. this.$toast.success(this.isDraft==0?'提交成功':'暂存成功');
  1861. this.$router.push("/index");
  1862. } else {
  1863. this.$toast.clear();
  1864. this.$toast.fail((this.isDraft==0?'提交失败':'暂存失败')+':'+res.msg);
  1865. }
  1866. }).catch(err=> {this.$toast.clear(); this.flgLg = true});
  1867. },
  1868. //初始化参数
  1869. initWxConfig() {
  1870. var curUrl=location.href.split("#")[0];
  1871. this.$axios.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id})
  1872. .then(res => {
  1873. if(res.code == "ok") {
  1874. var data=res.data;
  1875. wx.config({
  1876. beta: true,
  1877. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1878. appId: data.appid, // 必填,公众号的唯一标识
  1879. timestamp: data.timestamp, // 必填,生成签名的时间戳
  1880. nonceStr: data.noncestr, // 必填,生成签名的随机串
  1881. signature: data.sign, // 必填,签名,见附录1
  1882. jsApiList: [
  1883. 'chooseImage',
  1884. 'previewImage',
  1885. 'uploadImage',
  1886. 'downloadImage',
  1887. 'previewFile',
  1888. 'getLocation',
  1889. ]
  1890. });
  1891. var that = this;
  1892. wx.ready(function(){
  1893. // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
  1894. // if (that.user.companyId == 7) {
  1895. // that.$toast('wx init success==7 ');
  1896. // that.getLocation();
  1897. // }
  1898. });
  1899. } else {
  1900. this.$toast.fail('获取失败');
  1901. }
  1902. }).catch(err=> {this.$toast.fail('发生异常'+err);console.log(err)});
  1903. },
  1904. deleteImg(item, index) {
  1905. //删除添加的图片
  1906. if (this.isIOSystem) {
  1907. item.iospics.splice(index,1);
  1908. item.iospics = item.iospics;
  1909. }
  1910. item.pics.splice(index,1);
  1911. item.pics = item.pics;
  1912. //传递到后台的数据也要做同步删除
  1913. item.serverPics.splice(index,1);
  1914. this.$forceUpdate();
  1915. },
  1916. //企业微信获取定位
  1917. getLocation() {
  1918. wx.getLocation({
  1919. type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
  1920. success: function (res) {
  1921. var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
  1922. var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
  1923. alert(JSON.stringify(res));
  1924. }
  1925. });
  1926. }
  1927. },
  1928. mounted() {
  1929. this.today = this.format(new Date(), 'yyyy-MM-dd')
  1930. this.timeRange = []
  1931. for(let i=0.5; i<=20; i+=0.5){
  1932. this.timeRange.push(i)
  1933. }
  1934. // console.log('user',this.user)
  1935. var ua = navigator.userAgent.toLowerCase();
  1936. this.isIOSystem = this.isIOS();
  1937. if (ua.indexOf("wxwork") > 0) {
  1938. this.isCorpWX = true;
  1939. } else if (ua.indexOf("micromessenger") > 0) {
  1940. this.isWX = true;
  1941. }
  1942. this.getPeoject() // 获取项目
  1943. // console.log('mounted');
  1944. this.getReportBasecostList()
  1945. //获取传递过来的日期
  1946. var passDate = this.$route.query.date;
  1947. if (passDate != null) {
  1948. this.form.createDate = this.$route.query.date;
  1949. }
  1950. // this.getProject();
  1951. this.getReport();
  1952. this.getAllUsersList()
  1953. this.getTimeType();
  1954. //初始化微信js-sdk参数
  1955. if (this.isCorpWX) {
  1956. this.initWxConfig();
  1957. }
  1958. if(this.user.timeType.lockWorktime){
  1959. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  1960. }
  1961. // if(localStorage.getItem("formVal")) {
  1962. // var obj = localStorage.getItem("formVal")
  1963. // this.form = JSON.parse(obj)
  1964. // localStorage.removeItem('formVal')
  1965. // }
  1966. },
  1967. beforeDestroy() {
  1968. localStorage.removeItem('formVal')
  1969. }
  1970. };
  1971. </script>
  1972. <style lang="less" scope>
  1973. .my-swipe .van-swipe-item {
  1974. color: #fff;
  1975. font-size: 20px;
  1976. line-height: 150px;
  1977. text-align: center;
  1978. background-color: #39a9ed;
  1979. }
  1980. .van-field__control:disabled {
  1981. -webkit-text-fill-color:#646566;
  1982. }
  1983. .login_form {
  1984. margin-top: 46px;
  1985. position: relative;
  1986. }
  1987. .attendanceRecord{
  1988. // position: absolute;
  1989. // top: 0.26667rem;
  1990. // right: 0.42667rem;
  1991. color: #969799;
  1992. text-align: center;
  1993. font-size: 0.35rem;
  1994. line-height: 0.64rem;
  1995. }
  1996. .form_domains {
  1997. position: relative;
  1998. .form_copy {
  1999. position: absolute;
  2000. right: 85px;
  2001. top: 10px;
  2002. }
  2003. .form_addNew {
  2004. text-align: center;
  2005. margin:10px;
  2006. }
  2007. .form_del {
  2008. position: absolute;
  2009. right: 10px;
  2010. top: 10px;
  2011. }
  2012. // .form_del {
  2013. // color: #ff0000;
  2014. // font-size: 22px;
  2015. // position: absolute;
  2016. // right: 15px;
  2017. // top: 10px;
  2018. // }
  2019. }
  2020. .form_tip {
  2021. text-align: center;
  2022. margin-top: 20px;
  2023. color: #afafaf;
  2024. font-size: 14px;
  2025. }
  2026. .card__footer {
  2027. padding-top: 10px;
  2028. }
  2029. .card__tags {
  2030. .van-tag {
  2031. margin-right: 5px;
  2032. }
  2033. }
  2034. .overTimeClas{
  2035. display: flex;
  2036. width: 7.4rem;
  2037. // justify-content: space-between;
  2038. align-items: center;
  2039. }
  2040. </style>
  2041. <style lang="less">
  2042. .van-nav-bar .van-icon , .van-nav-bar__text {
  2043. color: #20a0ff;
  2044. }
  2045. .overtime {
  2046. height: 50px;
  2047. box-sizing: border-box;
  2048. padding-left: 10px;
  2049. display: flex;
  2050. align-items: center;
  2051. }
  2052. .custom-button {
  2053. width: 40px;
  2054. color: #fff;
  2055. font-size: 10px;
  2056. line-height: 16px;
  2057. text-align: center;
  2058. background-color: #1989fa;
  2059. border-radius: 100px;
  2060. }
  2061. .imgList {
  2062. position: relative;
  2063. width: 100px;
  2064. height: 100px;
  2065. display: inline-block;
  2066. }
  2067. .imgList_i {
  2068. position: absolute;
  2069. top: -8px;
  2070. right: -6px;
  2071. z-index: 999;
  2072. }
  2073. .ryuan {
  2074. padding: 0.3rem 0.53333rem;
  2075. // line-height: 40px;
  2076. // height: 40px;
  2077. overflow: auto;
  2078. color: #333;
  2079. border-bottom: 2px solid #f6f6f6;
  2080. width: 100%;
  2081. overflow: hidden;
  2082. text-overflow:ellipsis;
  2083. white-space: nowrap;
  2084. }
  2085. .overListTime {
  2086. margin-left:5px;
  2087. display: inline-block;
  2088. width: 2rem;
  2089. color: #646566;
  2090. }
  2091. .hoveOver {
  2092. color: #C8C9CC;
  2093. }
  2094. .van-checkbox__label {
  2095. color: #646566 !important;
  2096. }
  2097. .van-checkbox__label--disabled {
  2098. color: #c8c9cc !important;
  2099. }
  2100. </style>