weekEdit.vue 87 KB

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