index.vue 131 KB

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