weekEdit.vue 141 KB

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