wxFinalize.uvue 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132
  1. <template>
  2. <view class="detail-page">
  3. <scroll-view class="detail-content" :scroll-y="true">
  4. <!-- 工单信息 -->
  5. <view class="info-section">
  6. <view class="section-title">
  7. <text class="section-title-text">工单信息</text>
  8. </view>
  9. <view class="info-card">
  10. <view class="info-item">
  11. <text class="info-label">工单编码</text>
  12. <text class="info-value">{{ workOrderProjectNo ?? '-' }}</text>
  13. </view>
  14. <view class="info-item">
  15. <text class="info-label">工单类型</text>
  16. <text class="info-value">{{ orderType == '1' ? '维修工单' : '维保工单' }}</text>
  17. </view>
  18. <view class="info-item">
  19. <text class="info-label">风机编号</text>
  20. <text class="info-value">{{ pcsDeviceName ?? '-' }}</text>
  21. </view>
  22. <view class="info-item">
  23. <text class="info-label">维保中心</text>
  24. <text class="info-value">{{ gxtCenter ?? '-' }}</text>
  25. </view>
  26. <view class="info-item">
  27. <text class="info-label">场站</text>
  28. <text class="info-value">{{ pcsStationName ?? '-' }}</text>
  29. </view>
  30. <!-- <view class="info-item">
  31. <text class="info-label">品牌</text>
  32. <text class="info-value">{{ detailData.model ?? '' }}</text>
  33. </view> -->
  34. <view class="info-item">
  35. <text class="info-label">机型</text>
  36. <text class="info-value">{{ brand ?? '-' }} {{ model ?? '-' }}</text>
  37. </view>
  38. <view class="info-item">
  39. <text class="info-label">接单时间</text>
  40. <text class="info-value">{{ acceptTime ?? '-' }}</text>
  41. </view>
  42. <view class="info-item">
  43. <text class="info-label">故障代码</text>
  44. <text class="info-value">{{ faultCode ?? '-' }}</text>
  45. </view>
  46. <view class="info-item">
  47. <text class="info-label">故障条文</text>
  48. <text class="info-value">{{ faultBarcode ?? '-' }}</text>
  49. </view>
  50. <view class="info-item">
  51. <text class="info-label">故障描述</text>
  52. <text class="info-value">{{ faultDesc ?? '-' }}</text>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 结单表单 -->
  57. <view class="info-section">
  58. <view class="section-title">
  59. <text class="section-title-text">结单信息</text>
  60. </view>
  61. <view class="info-card">
  62. <!-- 信息录入 -->
  63. <view class="info-item">
  64. <view class="info-label">
  65. <text class="form-label required">信息录入<text style="color: red;">*</text></text>
  66. </view>
  67. <view class="info-value">
  68. <radio-group @change="handleInfoEntryChange" :disabled="infoEntryDisabled" class="uni-flex uni-row radio-group">
  69. <view v-for="(option, index) in infoEntryOptions" :key="index" class="radio-label">
  70. <radio :value="option.dictValue" :checked="infoEntry == option.dictValue">{{ option.dictLabel }}</radio>
  71. <!-- <text></text> -->
  72. </view>
  73. </radio-group>
  74. </view>
  75. </view>
  76. <!-- MIS工单编码选择(当信息录入为1时显示) -->
  77. <view class="info-item" v-if="infoEntry == '1'">
  78. <view class="info-label">
  79. <text class="form-label required">MIS工单编码<text style="color: red;">*</text></text>
  80. </view>
  81. <view class="info-value">
  82. <view class="input-with-select">
  83. <input
  84. class="input-field"
  85. placeholder="请输入或选择MIS工单编码"
  86. v-model="misNo"
  87. @focus="handleMisNoInputFocus"
  88. @blur="handleMisNoInputBlur"
  89. @input="handleMisNoInput"
  90. :readonly="infoEntry == '1'"
  91. :style="{ paddingRight: '120rpx' }" />
  92. <text class="select-mis-btn" @click="openMisListModal">选择</text>
  93. </view>
  94. </view>
  95. </view>
  96. <!-- 工作票编号(当信息录入为2时可编辑) -->
  97. <view class="info-item">
  98. <view class="info-label">
  99. <text class="form-label required">工作票编号<text style="color: red;">*</text></text>
  100. </view>
  101. <view class="info-value">
  102. <input
  103. class="input-field"
  104. placeholder="请输入工作票编号"
  105. v-model="workPermitNum"
  106. maxlength="20"
  107. :disabled="infoEntry == '1'"
  108. @change="handleWorkPermitNumChange"
  109. />
  110. </view>
  111. </view>
  112. <!-- 开始时间 -->
  113. <view class="info-item">
  114. <view class="info-label">
  115. <text class="form-label required">开始时间<text style="color: red;">*</text></text>
  116. </view>
  117. <view class="info-value">
  118. <view class="form-picker" @click="infoEntry == '1' ? showStartTimePicker = false : showStartTimePicker = true">
  119. <input
  120. class="input-field"
  121. placeholder="请选择开始时间"
  122. v-model="realStartTime"
  123. type="none"
  124. style="pointer-events: none;"
  125. />
  126. </view>
  127. </view>
  128. </view>
  129. <!-- 结束时间 -->
  130. <view class="info-item">
  131. <view class="info-label">
  132. <text class="form-label required">结束时间<text style="color: red;">*</text></text>
  133. </view>
  134. <view class="info-value">
  135. <view class="form-picker" @click="infoEntry == '1' ? showEndTimePicker = false : showEndTimePicker = true">
  136. <input
  137. class="input-field"
  138. placeholder="请选择结束时间"
  139. v-model="realEndTime"
  140. type="none"
  141. style="pointer-events: none;"
  142. />
  143. <!-- <text class="input-field">
  144. {{ realEndTime != '' ? realEndTime : '请选择结束时间' }}
  145. </text> -->
  146. </view>
  147. </view>
  148. </view>
  149. <!-- 挂起结束时间 -->
  150. <view class="info-item" v-if="resumeInfo != null && resumeShow">
  151. <view class="info-label">
  152. <text class="form-label required">挂起结束时间<text style="color: red;">*</text></text>
  153. </view>
  154. <view class="info-value">
  155. <view class="form-picker" @click="showResumeTimePicker = true">
  156. <input
  157. class="input-field"
  158. placeholder="请选择挂起结束时间"
  159. v-model="resumeTime"
  160. type="none"
  161. />
  162. </view>
  163. </view>
  164. </view>
  165. <!-- 工作部位 -->
  166. <view class="info-item">
  167. <view class="info-label">
  168. <text class="form-label">工作部位<text style="color: red;">*</text></text>
  169. </view>
  170. <view class="info-value">
  171. <view class="form-picker" @click="showWorkAreaPicker = true">
  172. <input
  173. class="input-field"
  174. placeholder="请选择工作部位"
  175. v-model="workAreaLabel"
  176. readonly
  177. />
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 外委人员数 -->
  182. <view class="info-item">
  183. <view class="info-label">
  184. <text class="form-label required">外委人员数(人)</text>
  185. </view>
  186. <view class="info-value">
  187. <input
  188. type="number"
  189. class="input-field"
  190. placeholder="请输入外委人员数"
  191. v-model="wwryNum"
  192. @input="onWwryNumInput"
  193. />
  194. </view>
  195. </view>
  196. <!-- 外来人员数 -->
  197. <view class="info-item">
  198. <view class="info-label">
  199. <text class="form-label required">外来人员数(人)</text>
  200. </view>
  201. <view class="info-value">
  202. <input
  203. type="number"
  204. class="input-field"
  205. placeholder="请输入外来人员数"
  206. v-model="wlryNum"
  207. @input="onWlryNumInput"
  208. />
  209. </view>
  210. </view>
  211. <!-- 工作负责人 -->
  212. <view class="info-item">
  213. <view class="info-label">
  214. <text class="form-label required">工作负责人<text style="color: red;">*</text></text>
  215. </view>
  216. <view class="info-value">
  217. <view class="input-with-clear">
  218. <input
  219. class="input-field"
  220. placeholder="请选择工作负责人"
  221. v-model="teamLeaderName"
  222. @click="showLeaderPicker = true"
  223. :disabled="infoEntry == '1'"
  224. />
  225. </view>
  226. </view>
  227. </view>
  228. <!-- 工作班成员选择(当信息录入为2时可编辑) -->
  229. <view class="info-item">
  230. <view class="info-label">
  231. <text class="form-label required">工作班成员<text style="color: red;">*</text></text>
  232. </view>
  233. <view class="info-value">
  234. <view class="input-with-clear">
  235. <input
  236. class="input-field"
  237. placeholder="请选择工作班成员"
  238. v-model="workGroupMemberName"
  239. @click="showUserSelect = true"
  240. :disabled="infoEntry == '1'"
  241. />
  242. <!-- <text class="select-users-count" v-if="selectedUserIds.length > 0" :style="{ marginRight: selectedUserIds.length > 0 ? '60rpx' : '0' }">({{ selectedUserIds.length }}人)</text> -->
  243. <text class="select-clear" v-if="selectedUserIds.length > 0" @click="clearSelectedUsers">×</text>
  244. </view>
  245. </view>
  246. </view>
  247. <!-- 维保内容 -->
  248. <view class="info-item full-width">
  249. <view class="info-label">
  250. <text class="form-label required">真实故障原因</text>
  251. </view>
  252. <view class="info-value">
  253. <textarea
  254. class="textarea-field"
  255. placeholder="请输入真实故障原因"
  256. v-model="realFailureReason"
  257. maxlength="500"
  258. :show-confirm-bar="false"
  259. auto-height
  260. ></textarea>
  261. </view>
  262. </view>
  263. <!-- 附件上传 -->
  264. <view class="info-item full-width">
  265. <view class="info-label">
  266. <text class="form-label">附件(可选)</text>
  267. </view>
  268. <view class="info-value">
  269. <upload-image
  270. :limit="8"
  271. :modelValue="uploadedFiles"
  272. :businessType="'workOrder'"
  273. @update:modelValue="uploadedFiles = $event as UTSArray<UploadResponse>"
  274. />
  275. </view>
  276. </view>
  277. </view>
  278. </view>
  279. <!-- 时间选择器弹窗 -->
  280. <!-- Start Date Picker -->
  281. <l-popup v-model="showStartTimePicker" position="bottom" :safe-area-inset-bottom="true" :z-index="10000">
  282. <l-date-time-picker
  283. title="选择开始时间"
  284. :mode="1 | 2 | 4 | 8 | 16"
  285. format="YYYY-MM-DD HH:mm"
  286. :modelValue="realStartTime"
  287. confirm-btn="确定"
  288. cancel-btn="取消"
  289. @confirm="onStartDateConfirm"
  290. @cancel="showStartTimePicker = false">
  291. </l-date-time-picker>
  292. </l-popup>
  293. <!-- End Date Picker -->
  294. <l-popup v-model="showEndTimePicker" position="bottom" :safe-area-inset-bottom="true" :z-index="10000">
  295. <l-date-time-picker
  296. title="选择结束时间"
  297. :mode="31"
  298. format="YYYY-MM-DD HH:mm"
  299. :modelValue="realEndTime"
  300. confirm-btn="确定"
  301. cancel-btn="取消"
  302. @confirm="onEndDateConfirm"
  303. @cancel="showEndTimePicker = false">
  304. </l-date-time-picker>
  305. </l-popup>
  306. <l-popup v-model="showResumeTimePicker" position="bottom" :safe-area-inset-bottom="true" :z-index="10000">
  307. <l-date-time-picker
  308. title="选择挂起结束时间"
  309. :mode="31"
  310. format="YYYY-MM-DD HH:mm"
  311. :modelValue="resumeTime"
  312. confirm-btn="确定"
  313. cancel-btn="取消"
  314. @confirm="onResumeTimeConfirm"
  315. @cancel="showResumeTimePicker = false">
  316. </l-date-time-picker>
  317. </l-popup>
  318. <!-- 人员选择弹窗 -->
  319. <view v-if="showUserSelect" class="picker-modal">
  320. <view class="modal-mask" @click="showUserSelect = false"></view>
  321. <view class="modal-content">
  322. <view class="modal-header">
  323. <text class="modal-title">选择工作班成员</text>
  324. <text class="modal-close" @click="confirmSelectedUsers">确定</text>
  325. </view>
  326. <view class="search-bar">
  327. <view class="search-box">
  328. <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
  329. <input class="search-input" type="text" placeholder="搜索姓名" v-model="userKeyword" @input="handleUserSearch" />
  330. <text v-if="userKeyword.length > 0" class="clear-icon" @click="clearUserSearch">✕</text>
  331. </view>
  332. </view>
  333. <scroll-view class="modal-body" scroll-y="true">
  334. <view
  335. v-for="(user, index) in userList"
  336. :key="index"
  337. class="picker-option"
  338. @click="toggleUserSelection(user)"
  339. >
  340. <text class="option-text">{{ (user['nickName'] as string | null) ?? '' }}</text>
  341. <text class="option-text">{{ ((user['dept'] as UTSJSONObject | null)?.['deptName'] as string | null) ?? '' }}</text>
  342. <text class="option-check" v-if="isSelected(user)">✓</text>
  343. </view>
  344. </scroll-view>
  345. </view>
  346. </view>
  347. <!-- MIS工单列表弹窗 -->
  348. <view v-if="showMisListModal" class="picker-modal">
  349. <view class="modal-mask" @click="closeMisListModal"></view>
  350. <view class="modal-content">
  351. <view class="modal-header">
  352. <text class="modal-title">选择MIS工单</text>
  353. <text class="modal-close" @click="closeMisListModal">取消</text>
  354. </view>
  355. <!-- 搜索栏 -->
  356. <view class="search-bar">
  357. <view class="search-box">
  358. <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
  359. <input class="search-input" type="text" placeholder="搜索 MIS工单编码" v-model="misListKeyword" @input="searchMisList" />
  360. <text v-if="misListKeyword.length > 0" class="clear-icon" @click="clearMisListSearch">✕</text>
  361. </view>
  362. </view>
  363. <!-- 列表内容 -->
  364. <scroll-view class="modal-body" scroll-y="true">
  365. <!-- 有数据时显示列表 -->
  366. <view v-if="misList.length > 0">
  367. <view
  368. v-for="(item, index) in misList"
  369. :key="index"
  370. class="picker-option"
  371. @click="selectMisItem(item, index)"
  372. >
  373. <!-- <text class="option-text">{{ option.label }}</text> -->
  374. <view>
  375. <text class="option-text">MIS工单编码</text>
  376. <text class="option-text">工作票编号</text>
  377. </view>
  378. <view>
  379. <text class="option-text">{{ ((item['misNo'] as string | null) ?? '-')}}</text>
  380. <text class="option-text">{{ item['workPermitNum'] as string | null ?? '-' }}</text>
  381. </view>
  382. <text v-if="index === selectedMisInfoIndex" class="option-check">✓</text>
  383. </view>
  384. </view>
  385. <!-- 无数据时显示提示 -->
  386. <view v-else class="empty-tip">
  387. <text>未找到匹配的MIS工单</text>
  388. </view>
  389. </scroll-view>
  390. </view>
  391. </view>
  392. <!-- 工作部位选择弹窗 -->
  393. <view v-if="showWorkAreaPicker" class="picker-modal">
  394. <view class="modal-mask" @click="showWorkAreaPicker = false"></view>
  395. <view class="modal-content">
  396. <view class="modal-header">
  397. <text class="modal-title">选择工作部位</text>
  398. <text class="modal-close" @click="confirmSelectedWorkAreas">确定</text>
  399. </view>
  400. <scroll-view class="modal-body" scroll-y="true">
  401. <view
  402. v-for="(item, index) in workAreaDictList"
  403. :key="index"
  404. class="picker-option"
  405. @click="toggleWorkAreaSelection(item)"
  406. >
  407. <text class="option-text">{{ item.dictLabel ?? '' }}</text>
  408. <text class="option-check" v-if="isWorkAreaSelected(item)">✓</text>
  409. </view>
  410. </scroll-view>
  411. </view>
  412. </view>
  413. <!-- 工作负责人弹窗 -->
  414. <view v-if="showLeaderPicker" class="picker-modal">
  415. <view class="modal-mask" @click="showLeaderPicker = false"></view>
  416. <view class="modal-content">
  417. <view class="modal-header">
  418. <text class="modal-title">选择工作负责人</text>
  419. <text class="modal-close" @click="showLeaderPicker = false">取消</text>
  420. </view>
  421. <view class="search-bar">
  422. <view class="search-box">
  423. <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
  424. <input class="search-input" type="text" placeholder="搜索姓名" v-model="teamKeyword" @input="handleSearch" />
  425. <text v-if="teamKeyword.length > 0" class="clear-icon" @click="clearSearch">✕</text>
  426. </view>
  427. </view>
  428. <scroll-view class="modal-body" scroll-y="true">
  429. <!-- 有数据时显示列表 -->
  430. <view v-if="teamLeaderList.length > 0">
  431. <view
  432. v-for="(user, index) in teamLeaderList"
  433. :key="index"
  434. class="picker-option"
  435. :class="{ 'selected': index === selectedTeamLeaderIndex }"
  436. @click="selectLeaderManually(user, index)"
  437. >
  438. <text class="option-text">{{ (user['nickName'] as string | null) ?? '' }}</text>
  439. <text class="option-text">{{ ((user['dept'] as UTSJSONObject | null)?.['deptName'] as string | null) ?? '' }}</text>
  440. <text v-if="index === selectedTeamLeaderIndex" class="option-check">✓</text>
  441. </view>
  442. </view>
  443. <!-- 无数据时显示提示 -->
  444. <view v-else class="empty-tip">
  445. <text>未找到匹配的人员</text>
  446. </view>
  447. </scroll-view>
  448. </view>
  449. </view>
  450. </scroll-view>
  451. <!-- 确认结单按钮 -->
  452. <view class="accept-button-container">
  453. <button class="accept-button" @click="handleSubmit" :loading="submitLoading">{{ submitLoading ? '提交中...' : '确认结单' }}</button>
  454. </view>
  455. <!-- 加载中状态 -->
  456. <view v-if="loading" class="loading-mask">
  457. <text class="loading-text">加载中...</text>
  458. </view>
  459. </view>
  460. </template>
  461. <script setup lang="uts">
  462. import { ref, watch } from 'vue'
  463. import type { acceptOrderInfo } from '../../../types/order'
  464. import type { WorkOrderFlow } from '../../../types/flow'
  465. import { getOrderInfoById, getRepairOrderInfoById, returnRepairOrder, repairFinishOrder } from '../../../api/order/detail'
  466. import { getMisInfoList, listWorkPerson, getOrderList, listAutoMisInfo, allListOrder } from '../../../api/order/list'
  467. import type { SysDictData } from '../../../types/dict'
  468. import { getDictDataByType } from '../../../api/dict/index'
  469. import type { UserInfo } from '../../../types/user'
  470. import type { UploadResponse } from '../../../types/workbench'
  471. import {checkPermi} from '../../../utils/storage'
  472. import { getUserList, getLeaderList } from '../../../api/user/list'
  473. import uploadImage from '../../../components/upload-image/upload-image.uvue'
  474. // 工单信息
  475. const orderId = ref<string>('')
  476. const workOrderProjectNo = ref<string>('')
  477. const workOrderStatus = ref<string>('')
  478. const orderType = ref<string>('')
  479. const pcsDeviceName = ref<string>('')
  480. const gxtCenter = ref<string>('')
  481. const pcsStationName = ref<string>('')
  482. const brand = ref<string>('')
  483. const model = ref<string>('')
  484. const acceptTime = ref<string>('')
  485. const returnType = ref<string>('')
  486. const returnReason = ref<string>("")
  487. const returnTypeLabel = ref<string>("")
  488. const acceptReturnType = ref<string>('')
  489. const acceptReturnReason = ref<string>("")
  490. const teamLeaderId = ref<Number | null>(null)
  491. const teamLeaderName = ref<string>('')
  492. const pauseTime = ref<string>('')
  493. const restartTime = ref<string>('')
  494. const faultCode = ref<string>('')
  495. const faultBarcode = ref<string>('')
  496. const faultDesc = ref<string>('')
  497. const suspendReason = ref<string>('') // 挂起原因
  498. const flowList = ref<UTSJSONObject[]>([]) //流转过程
  499. const suspendInfo = ref<UTSJSONObject | null>(null)
  500. const resumeInfo = ref<UTSJSONObject | null>(null)
  501. const resumeShow = ref<boolean>(false)
  502. const resumeTime = ref<string>('') // 挂起结束时间
  503. const showResumeTimePicker = ref<boolean>(false)
  504. // 添加字典加载状态
  505. const dictLoaded = ref<boolean>(false)
  506. // 结单表单相关变量
  507. const infoEntry = ref<string>('') // 信息录入
  508. const misNo = ref<string>('') // MIS工单编码
  509. const workPermitNum = ref<string>('') // 工作票编号
  510. const realStartTime = ref<string>('') // 开始时间
  511. const realEndTime = ref<string>('') // 结束时间
  512. const wwryNum = ref<string>('') // 外委人员数
  513. const wlryNum = ref<string>('') // 外来人员数
  514. const workGroupMemberName = ref<string>('') // 工作班成员
  515. const attachmentUrls = ref<string>('') // 附件URLs(逗号分隔的字符串格式)
  516. const uploadedFiles = ref<UploadResponse[]>([]) // 上传的文件对象数组
  517. const repairOrderPersonList = ref<UTSJSONObject[]>([]) // 工作班成员数组
  518. const selectedUserIds = ref<string[]>([]) // 选中的用户ID数组
  519. const selectedUsers = ref<UTSJSONObject[]>([]) // 选中的用户对象数组
  520. const realFailureReason = ref<string>('') //真实故障原因
  521. const workArea = ref<string>('') //工作部位
  522. const workAreaLabel = ref<string>('')
  523. const workAreaDictList = ref<SysDictData[]>([]) // 工作部位字典列表
  524. const selectedWorkAreas = ref<SysDictData[]>([]) // 选中的工作部位
  525. const showWorkAreaPicker = ref<boolean>(false) // 显示工作部位选择器
  526. // 选中的负责人信息
  527. const selectedTeamLeaderName = ref<string>('')
  528. const selectedTeamLeaderIndex = ref<number>(-1)
  529. const showLeaderPicker = ref<boolean>(false)
  530. const teamLeaderList = ref<UTSJSONObject[]>([])
  531. const teamAllLeaderList = ref<UTSJSONObject[]>([])
  532. let teamKeyword = ref<string>("")
  533. // 时间选择器相关变量
  534. const showStartTimePicker = ref<boolean>(false)
  535. const showEndTimePicker = ref<boolean>(false)
  536. const startTimeDate = ref<string>('')
  537. const startTimeTime = ref<string>('')
  538. const endTimeDate = ref<string>('')
  539. const endTimeTime = ref<string>('')
  540. // 监听开始时间和结束时间变化
  541. watch(realStartTime, (value: string) => {
  542. // 在这里添加开始时间变化时的处理逻辑
  543. if (resumeInfo.value != null && value != '') {
  544. const suspendTime = (suspendInfo.value?.['actionTime'] as string | null) ?? ''
  545. if (suspendTime != '' && value != '') {
  546. const suspendDate = new Date(suspendTime)
  547. const startDate = new Date(value)
  548. if (suspendDate.getTime() < startDate.getTime()) { // 开工前挂起
  549. const resumeDate = new Date(resumeTime.value)
  550. const endDate = new Date(realEndTime.value)
  551. if (resumeDate.getTime() > startDate.getTime() || (realEndTime.value != '' && resumeDate.getTime() > endDate.getTime())) {
  552. resumeShow.value = true
  553. } else {
  554. resumeShow.value = false
  555. }
  556. } else if (suspendDate.getTime() >= startDate.getTime()) { // 作业中挂起
  557. const resumeDate = new Date(resumeTime.value)
  558. const endDate = new Date(realEndTime.value)
  559. if (resumeDate.getTime() < startDate.getTime() || (realEndTime.value != '' && resumeDate.getTime() > endDate.getTime())) {
  560. resumeShow.value = true
  561. } else {
  562. resumeShow.value = false
  563. }
  564. } else {
  565. resumeShow.value = false
  566. }
  567. } else {
  568. resumeShow.value = false
  569. }
  570. }
  571. })
  572. watch(realEndTime, (value: string) => {
  573. // 在这里添加结束时间变化时的处理逻辑
  574. if (resumeInfo.value != null && value != '') {
  575. const suspendTime = (suspendInfo.value?.['actionTime'] as string | null) ?? ''
  576. if (suspendTime != '' && realStartTime.value != '' && new Date(suspendTime).getTime() < new Date(realStartTime.value).getTime()) { // 开工前挂起
  577. if (value != '' && resumeTime.value != '' && new Date(resumeTime.value).getTime() > new Date(realStartTime.value).getTime()) {
  578. resumeShow.value = true
  579. } else if(value != '' && resumeTime.value != '' && new Date(resumeTime.value).getTime() > new Date(value).getTime()) {
  580. resumeShow.value = true
  581. } else {
  582. resumeShow.value = false
  583. }
  584. } else if(suspendTime != '' && realStartTime.value != '' && new Date(suspendTime).getTime() >= new Date(realStartTime.value).getTime()) { // 作业中挂起
  585. if (realStartTime.value != '' && resumeTime.value != '' && new Date(resumeTime.value).getTime() < new Date(realStartTime.value).getTime()) {
  586. resumeShow.value = true
  587. } else if(value != '' && resumeTime.value != '' && new Date(resumeTime.value).getTime() > new Date(value).getTime()) {
  588. resumeShow.value = true
  589. } else {
  590. resumeShow.value = false
  591. }
  592. } else {
  593. resumeShow.value = false
  594. }
  595. }
  596. })
  597. // MIS工单选择相关变量
  598. const showMisNoQuickSelect = ref<boolean>(false)
  599. const quickMisNoList = ref<UTSJSONObject[]>([])
  600. // 添加MIS工单列表弹窗显示状态
  601. const showMisListModal = ref<boolean>(false)
  602. // MIS工单列表数据
  603. const misList = ref<UTSJSONObject[]>([])
  604. const allMisList = ref<UTSJSONObject[]>([])
  605. // 分页信息
  606. const misListPage = ref<number>(1)
  607. const misListPageSize = ref<number>(999)
  608. const misListTotal = ref<number>(0)
  609. // 搜索关键词
  610. const misListKeyword = ref<string>('')
  611. const userKeyword = ref<string>('')
  612. // 人员选择相关变量
  613. const showUserSelect = ref<boolean>(false)
  614. const userList = ref<UTSJSONObject[]>([])
  615. const userAllList = ref<UTSJSONObject[]>([])
  616. // 信息录入选项
  617. const infoEntryOptions = ref<SysDictData[]>([])
  618. const selectedMisInfoIndex = ref<number>(-1)
  619. // 获取信息录入字典列表
  620. const loadInfoEntryDictList = async (): Promise<void> => {
  621. try {
  622. const result = await getDictDataByType('gxt_info_entry') // 假设信息录入类型字典类型为gxt_info_entry
  623. const resultObj = result as UTSJSONObject
  624. if (resultObj['code'] == 200) {
  625. const data = resultObj['data'] as any[]
  626. const dictData: SysDictData[] = []
  627. if (data.length > 0) {
  628. for (let i = 0; i < data.length; i++) {
  629. const item = data[i] as UTSJSONObject
  630. // 只提取需要的字段
  631. const dictItem: SysDictData = {
  632. dictValue: item['dictValue'] as string | null,
  633. dictLabel: item['dictLabel'] as string | null,
  634. dictCode: null,
  635. dictSort: null,
  636. dictType: null,
  637. cssClass: null,
  638. listClass: null,
  639. isDefault: null,
  640. status: null,
  641. default: null,
  642. createTime: null,
  643. remark: null
  644. }
  645. dictData.push(dictItem)
  646. }
  647. }
  648. infoEntryOptions.value = dictData
  649. }
  650. } catch (e: any) {
  651. console.error('获取信息录入类型字典失败:', e.message)
  652. // 设置默认值
  653. infoEntryOptions.value = [
  654. { dictValue: '1', dictLabel: 'MIS工单', dictCode: null, dictSort: null, dictType: null, cssClass: null, listClass: null, isDefault: null, status: null, default: null, createTime: null, remark: null },
  655. { dictValue: '2', dictLabel: '手工录入', dictCode: null, dictSort: null, dictType: null, cssClass: null, listClass: null, isDefault: null, status: null, default: null, createTime: null, remark: null }
  656. ];
  657. }
  658. }
  659. // 获取工作部位字典列表
  660. const loadWorkAreaDictList = async (): Promise<void> => {
  661. try {
  662. const result = await getDictDataByType('gxt_work_area')
  663. const resultObj = result as UTSJSONObject
  664. if (resultObj['code'] == 200) {
  665. const data = resultObj['data'] as any[]
  666. const dictData: SysDictData[] = []
  667. if (data.length > 0) {
  668. for (let i = 0; i < data.length; i++) {
  669. const item = data[i] as UTSJSONObject
  670. // 只提取需要的字段
  671. const dictItem: SysDictData = {
  672. dictValue: item['dictValue'] as string | null,
  673. dictLabel: item['dictLabel'] as string | null,
  674. dictCode: null,
  675. dictSort: null,
  676. dictType: null,
  677. cssClass: null,
  678. listClass: null,
  679. isDefault: null,
  680. status: null,
  681. default: null,
  682. createTime: null,
  683. remark: null
  684. }
  685. dictData.push(dictItem)
  686. }
  687. }
  688. workAreaDictList.value = dictData
  689. }
  690. } catch (e: any) {
  691. console.error('获取工作部位字典失败:', e.message)
  692. }
  693. }
  694. // 获取用户列表
  695. const getUserAllList = async (): Promise<void> => {
  696. try {
  697. // 这里应该调用获取用户列表的API
  698. const result = await getLeaderList(-1); // 空参数调用
  699. const resultObj = result as UTSJSONObject;
  700. const code = resultObj['code'] as number
  701. const users = resultObj['data'] as UTSJSONObject[] | null
  702. if (code == 200 && users != null ) {
  703. // 解析列表数据
  704. // const rows = resultObj['rows'] as UTSJSONObject[]
  705. userList.value = users
  706. userAllList.value = users
  707. teamLeaderList.value = users
  708. teamAllLeaderList.value = users
  709. // userList.value = result.data || [];
  710. }
  711. } catch (error) {
  712. console.error('获取用户列表失败:', error);
  713. uni.showToast({
  714. title: '获取用户列表失败',
  715. icon: 'none'
  716. });
  717. }
  718. };
  719. // 外委人员数输入处理
  720. const onWwryNumInput = (): void => {
  721. let value = wwryNum.value;
  722. // 移除非数字字符,包括负号和小数点
  723. value = value.replace(/[^0-9]/g, '');
  724. wwryNum.value = value;
  725. };
  726. // 外来人员数输入处理
  727. const onWlryNumInput = (): void => {
  728. let value = wlryNum.value;
  729. // 移除非数字字符,包括负号和小数点
  730. value = value.replace(/[^0-9]/g, '');
  731. wlryNum.value = value;
  732. };
  733. // 验证和提交
  734. const submitLoading = ref<boolean>(false)
  735. // 信息录入禁用状态
  736. const infoEntryDisabled = ref<boolean>(false)
  737. // 接受用户名
  738. const acceptUserName = ref<string>('')
  739. // 选择器选项类型
  740. type PickerOption = {
  741. label: string
  742. value: string
  743. }
  744. // 手动选择负责人
  745. const selectLeaderManually = (user: UTSJSONObject, index: number): void => {
  746. selectedTeamLeaderIndex.value = index
  747. const uid = user['userId']
  748. if (uid != null) {
  749. teamLeaderId.value = uid as Number
  750. }
  751. const name = user['nickName']
  752. teamLeaderName.value = name != null ? name.toString() : ''
  753. showLeaderPicker.value = false
  754. }
  755. // 信息录入变化处理
  756. const handleInfoEntryChange = (e: UniRadioGroupChangeEvent): void => {
  757. // 兼容 radio-group 事件:detail 可能不存在,直接取 e.value
  758. const val = e.detail?.value as string | null
  759. infoEntry.value = val ?? ''
  760. if (infoEntry.value == '1') {
  761. // 当选择MIS工单时,清空手工录入的字段
  762. workPermitNum.value = '';
  763. realStartTime.value = '';
  764. realEndTime.value = '';
  765. workGroupMemberName.value = '';
  766. }
  767. };
  768. // 工作票编号变化处理
  769. const handleWorkPermitNumChange = async(): Promise<void> => {
  770. if (infoEntry.value == '2') {
  771. // 查询工作票编号是否已存在
  772. const queryParams = {
  773. workPermitNum: workPermitNum.value,
  774. } as UTSJSONObject;
  775. const response = await allListOrder(queryParams)
  776. const responseObj = response as UTSJSONObject
  777. const rows = responseObj['rows'] as UTSJSONObject[] | null
  778. if (rows != null && rows.length > 0) {
  779. uni.showToast({ title: '工作票编号:' + workPermitNum.value + '已存在', icon: 'none' })
  780. workPermitNum.value = ''
  781. return
  782. }
  783. }
  784. };
  785. // MIS工单编码输入处理
  786. const handleMisNoInputFocus = (): void => {
  787. showMisNoQuickSelect.value = true;
  788. };
  789. const handleMisNoInputBlur = (): void => {
  790. setTimeout(() => {
  791. showMisNoQuickSelect.value = false;
  792. }, 200);
  793. };
  794. const handleMisNoInput = (e: SysDictData): void => {
  795. misNo.value = (e['detail'] as string | null) ?? '';
  796. // 这里可以添加实时搜索MIS工单的逻辑
  797. };
  798. const handleMisNoClear = (): void => {
  799. misNo.value = '';
  800. showMisNoQuickSelect.value = false;
  801. };
  802. const handleMisNoQuickSelect = (item: UTSJSONObject): void => {
  803. misNo.value = (item['misNo'] as string | null) ?? '';
  804. showMisNoQuickSelect.value = false;
  805. };
  806. // 获取MIS工单列表
  807. const getMisList = async (): Promise<void> => {
  808. try {
  809. const queryParams = {
  810. pcsDeviceName: pcsDeviceName.value,
  811. pcsStationName: pcsStationName.value,
  812. workOrderStatus: '结束'
  813. } as UTSJSONObject;
  814. // 调用获取MIS工单列表的API
  815. const result = await getMisInfoList(queryParams);
  816. const resultObj = result as UTSJSONObject;
  817. if (resultObj['code'] == 200) {
  818. // 解析列表数据
  819. const rows = resultObj['rows'] as UTSJSONObject[]
  820. misList.value = rows;
  821. allMisList.value = rows
  822. // 解析总数
  823. misListTotal.value = resultObj['total'] as number;
  824. } else {
  825. const msg = resultObj['msg'] as string | null
  826. uni.showToast({
  827. title: msg ?? '获取MIS工单列表失败',
  828. icon: 'none'
  829. })
  830. }
  831. } catch (error: any) {
  832. console.error('获取MIS工单列表失败:', error);
  833. uni.showToast({
  834. title: error.message ?? '获取MIS工单列表失败',
  835. icon: 'none'
  836. });
  837. }
  838. };
  839. // 打开MIS工单选择弹窗
  840. const openMisListModal = (): void => {
  841. showMisListModal.value = true;
  842. misListPage.value = 1; // 重置为第一页
  843. getMisList(); // 获取列表数据
  844. };
  845. // 选择MIS工单
  846. const selectMisItem = async (item: UTSJSONObject, index: number): Promise<void> => {
  847. selectedMisInfoIndex.value = index
  848. // 回填MIS工单相关信息
  849. misNo.value = item['misNo'] as string | '';
  850. // 查询MIS工单是否已存在
  851. const response = await getOrderList(1, 10, misNo.value, '')
  852. const responseObj = response as UTSJSONObject
  853. const rows = responseObj['rows'] as UTSJSONObject[] | null
  854. if (rows != null && rows.length > 0) {
  855. uni.showToast({ title: '该MIS工单已被其他工单关联!请重新选择!', icon: 'none' })
  856. misNo.value = ''
  857. return
  858. }
  859. // 查询相关工作班成员
  860. await listWorkPerson(misNo.value).then(response => {
  861. const responseObj = response as UTSJSONObject
  862. const rows = responseObj['rows'] as UTSJSONObject[] | null
  863. repairOrderPersonList.value = rows ?? []
  864. if (rows != null && rows.length > 0) {
  865. // 查找 isLeader 等于 1 的负责人(优先获取第一个符合条件的,贴合常规单负责人场景)
  866. const leaderPerson = rows.find(person => person.isLeader == 1);
  867. if(leaderPerson != null) {
  868. teamLeaderId.value = (leaderPerson['userId'] as Number | null) ?? null
  869. teamLeaderName.value = (leaderPerson['nickName'] as string | null) ?? ''
  870. }
  871. const nickNames = rows
  872. .filter(person => person.isLeader != 1)
  873. .map(person => (person.nickName as string | null) ?? '')
  874. .join(',');
  875. workGroupMemberName.value = nickNames;
  876. }
  877. })
  878. workPermitNum.value = item['workPermitNum'] as string | '';
  879. realStartTime.value = item['realStartTime'] as string | '';
  880. realEndTime.value = item['realEndTime'] as string | '';
  881. // 关闭弹窗
  882. showMisListModal.value = false;
  883. };
  884. // 搜索
  885. const handleUserSearch = (): void => {
  886. const keyword = userKeyword.value
  887. userList.value = userAllList.value.filter(leader => {
  888. const nickName = leader['nickName'] as string | null
  889. return nickName != null && nickName.indexOf(keyword) >= 0
  890. })
  891. }
  892. // 关闭MIS工单选择弹窗
  893. const closeMisListModal = (): void => {
  894. showMisListModal.value = false;
  895. };
  896. // 搜索
  897. const searchMisList = (): void => {
  898. const keyword = misListKeyword.value
  899. misList.value = allMisList.value.filter(misInfo => {
  900. const misNo = misInfo['misNo'] as string | null
  901. // return misNo != null && misNo.indexOf(keyword) >= 0
  902. const workPermitNum = misInfo['workPermitNum'] as string | null
  903. // 逻辑或(||)连接两个条件,满足其一即可
  904. const misNoMatch = misNo != null && misNo.indexOf(keyword) >= 0
  905. const workPermitNumMatch = workPermitNum != null && workPermitNum.indexOf(keyword) >= 0
  906. return misNoMatch || workPermitNumMatch
  907. })
  908. }
  909. // 清除MIS工单搜索
  910. const clearMisListSearch = (): void => {
  911. misListKeyword.value = "";
  912. misList.value = allMisList.value
  913. };
  914. // 清除用户搜索
  915. const clearUserSearch = (): void => {
  916. userKeyword.value = "";
  917. userList.value = userAllList.value
  918. };
  919. // 搜索工作负责人
  920. const handleSearch = (): void => {
  921. const keyword = teamKeyword.value
  922. teamLeaderList.value = teamAllLeaderList.value.filter(leader => {
  923. const nickName = leader['nickName'] as string | null
  924. return nickName != null && nickName.indexOf(keyword) >= 0
  925. })
  926. }
  927. // 清空搜索工作负责人
  928. const clearSearch = (): void => {
  929. teamKeyword.value = ""
  930. teamLeaderList.value = teamAllLeaderList.value
  931. }
  932. function onStartDateConfirm(value: string) {
  933. // 检查结束时间是否小于新的开始时间
  934. if (realEndTime.value != '' && new Date(value) > new Date(realEndTime.value as string)) {
  935. uni.showToast({ title: '开始时间不能大于结束时间', icon: 'none' })
  936. return
  937. }
  938. realStartTime.value = value
  939. showStartTimePicker.value = false
  940. }
  941. function onEndDateConfirm(value: string) {
  942. // 检查新的结束时间是否小于开始时间
  943. if (realStartTime.value != '' && new Date(realStartTime.value as string) > new Date(value)) {
  944. uni.showToast({ title: '结束时间不能小于开始时间', icon: 'none' })
  945. return
  946. }
  947. realEndTime.value = value
  948. showEndTimePicker.value = false
  949. }
  950. function onResumeTimeConfirm(value: string) {
  951. // 检查新的结束时间是否小于开始时间
  952. if (resumeTime.value != '' && new Date(realStartTime.value as string) > new Date(value)) {
  953. uni.showToast({ title: '结束时间不能小于开始时间', icon: 'none' })
  954. return
  955. }
  956. resumeTime.value = value
  957. showResumeTimePicker.value = false
  958. }
  959. // 检查用户是否已被选中
  960. const isSelected = (user: UTSJSONObject): boolean => {
  961. const userId = user['userId'] as string | number | null;
  962. if (userId !== null) {
  963. return selectedUserIds.value.includes(userId.toString());
  964. }
  965. // 如果没有userId,则比较nickName
  966. const nickName = user['nickName'] as string | null;
  967. if (nickName !== null) {
  968. return selectedUsers.value.some(selected =>
  969. (selected['nickName'] as string | null) === nickName
  970. );
  971. }
  972. return false;
  973. };
  974. // 切换用户选择状态
  975. const toggleUserSelection = (user: UTSJSONObject): void => {
  976. const userId = user['userId'] as string | number | null;
  977. const nickName = user['nickName'] as string | null;
  978. if (userId !== null) {
  979. const userIdStr = userId.toString();
  980. const index = selectedUserIds.value.indexOf(userIdStr);
  981. if (index > -1) {
  982. // 取消选择
  983. selectedUserIds.value.splice(index, 1);
  984. selectedUsers.value = selectedUsers.value.filter(selected =>
  985. (selected['userId'] as string | number | null)?.toString() !== userIdStr
  986. );
  987. } else {
  988. // 添加选择
  989. selectedUserIds.value.push(userIdStr);
  990. selectedUsers.value.push(user);
  991. }
  992. } else if (nickName !== null) {
  993. // 如果没有userId,通过nickName来识别
  994. const index = selectedUsers.value.findIndex(selected =>
  995. (selected['nickName'] as string | null) === nickName
  996. );
  997. if (index > -1) {
  998. // 取消选择
  999. selectedUsers.value.splice(index, 1);
  1000. // 同时移除对应的userId(如果有的话)
  1001. const userToRemoveId = user['userId'] as string | number | null;
  1002. if (userToRemoveId !== null) {
  1003. const idIndex = selectedUserIds.value.indexOf(userToRemoveId.toString());
  1004. if (idIndex > -1) {
  1005. selectedUserIds.value.splice(idIndex, 1);
  1006. }
  1007. }
  1008. } else {
  1009. // 添加选择
  1010. selectedUsers.value.push(user);
  1011. const userToAddId = user['userId'] as string | number | null;
  1012. if (userToAddId !== null) {
  1013. selectedUserIds.value.push(userToAddId.toString());
  1014. }
  1015. }
  1016. }
  1017. };
  1018. // 确认选择的用户
  1019. const confirmSelectedUsers = (): void => {
  1020. // 将选中的用户姓名拼接成字符串
  1021. const nickNames = selectedUsers.value
  1022. .map(user => (user['nickName'] as string | null) ?? '')
  1023. .filter(name => name !== '')
  1024. .join(',');
  1025. workGroupMemberName.value = nickNames;
  1026. // 更新repairOrderPersonList为选中的用户
  1027. repairOrderPersonList.value = [...selectedUsers.value];
  1028. showUserSelect.value = false;
  1029. };
  1030. // 清空已选择的用户
  1031. const clearSelectedUsers = (): void => {
  1032. // 清空选中的用户数组
  1033. selectedUsers.value = [];
  1034. selectedUserIds.value = [];
  1035. // 清空显示的用户名
  1036. workGroupMemberName.value = '';
  1037. // 清空工作班成员列表
  1038. repairOrderPersonList.value = [];
  1039. };
  1040. // 检查工作部位是否已被选中
  1041. const isWorkAreaSelected = (workArea: SysDictData): boolean => {
  1042. return selectedWorkAreas.value.some(selected =>
  1043. (selected.dictValue as string | null) === (workArea.dictValue as string | null)
  1044. );
  1045. };
  1046. // 切换工作部位选择状态
  1047. const toggleWorkAreaSelection = (workArea: SysDictData): void => {
  1048. const index = selectedWorkAreas.value.findIndex(selected =>
  1049. (selected.dictValue as string | null) === (workArea.dictValue as string | null)
  1050. );
  1051. if (index > -1) {
  1052. // 取消选择
  1053. selectedWorkAreas.value.splice(index, 1);
  1054. } else {
  1055. // 添加选择
  1056. selectedWorkAreas.value.push(workArea);
  1057. }
  1058. };
  1059. // 确认选择的工作部位
  1060. const confirmSelectedWorkAreas = (): void => {
  1061. // 将选中的工作部位标签拼接成字符串,用逗号分隔
  1062. const labels = selectedWorkAreas.value
  1063. .map(item => item.dictLabel ?? '')
  1064. .filter(label => label !== '');
  1065. workAreaLabel.value = labels.join(', ');
  1066. // 将选中的工作部位值拼接成字符串,用逗号分隔
  1067. workArea.value = selectedWorkAreas.value
  1068. .map(item => item.dictValue ?? '')
  1069. .filter(value => value !== '')
  1070. .join(',');
  1071. showWorkAreaPicker.value = false;
  1072. };
  1073. // 表单验证
  1074. const validateForm = (): boolean => {
  1075. if (infoEntry.value == '') {
  1076. uni.showToast({
  1077. title: '请选择信息录入方式',
  1078. icon: 'none'
  1079. });
  1080. return false;
  1081. }
  1082. if (infoEntry.value == '1' && (misNo.value == '')) {
  1083. uni.showToast({
  1084. title: '请输入MIS工单编码',
  1085. icon: 'none'
  1086. });
  1087. return false;
  1088. }
  1089. if (workPermitNum.value == '') {
  1090. uni.showToast({
  1091. title: '请输入工作票编号',
  1092. icon: 'none'
  1093. });
  1094. return false;
  1095. }
  1096. if (realStartTime.value == '') {
  1097. uni.showToast({
  1098. title: '请选择开始时间',
  1099. icon: 'none'
  1100. });
  1101. return false;
  1102. }
  1103. if (realEndTime.value == '') {
  1104. uni.showToast({
  1105. title: '请选择结束时间',
  1106. icon: 'none'
  1107. });
  1108. return false;
  1109. }
  1110. if (new Date(realEndTime.value) <= new Date(realStartTime.value)) {
  1111. uni.showToast({
  1112. title: '结束时间必须大于开始时间',
  1113. icon: 'none'
  1114. });
  1115. return false;
  1116. }
  1117. if (teamLeaderName.value == '') {
  1118. uni.showToast({
  1119. title: '请选择工作负责人',
  1120. icon: 'none'
  1121. });
  1122. return false;
  1123. }
  1124. if (workGroupMemberName.value == '') {
  1125. uni.showToast({
  1126. title: '请选择工作班成员',
  1127. icon: 'none'
  1128. });
  1129. return false;
  1130. }
  1131. if (workArea.value == '') {
  1132. uni.showToast({
  1133. title: '请选择工作部位',
  1134. icon: 'none'
  1135. });
  1136. return false;
  1137. }
  1138. if(resumeShow.value) {
  1139. if(resumeTime.value == '') {
  1140. uni.showToast({
  1141. title: '请选挂起结束时间',
  1142. icon: 'none'
  1143. });
  1144. return false;
  1145. } else {
  1146. const suspendTime = (suspendInfo.value?.['actionTime'] as string | null) ?? ''
  1147. if (suspendTime != '' && realStartTime.value != '' && new Date(suspendTime) < new Date(realStartTime.value)) { // 开工前挂起
  1148. if (resumeTime.value != '' && new Date(resumeTime.value) > new Date(realStartTime.value)) {
  1149. uni.showToast({
  1150. title: '开工前挂起结束时间晚于实际开始时间,请调整',
  1151. icon: 'none'
  1152. });
  1153. return false;
  1154. } else if(realEndTime.value != '' && resumeTime.value != '' && new Date(resumeTime.value) > new Date(realEndTime.value)) {
  1155. uni.showToast({
  1156. title: '开工前挂起结束时间晚于实际结束时间,请调整',
  1157. icon: 'none'
  1158. });
  1159. return false;
  1160. }
  1161. } else if(suspendTime != '' && realStartTime.value != '' && new Date(suspendTime) >= new Date(realStartTime.value)) { // 作业中挂起
  1162. if (resumeTime.value != '' && new Date(resumeTime.value) < new Date(realStartTime.value)) {
  1163. uni.showToast({
  1164. title: '作业中挂起结束时间早于实际开始时间,请调整',
  1165. icon: 'none'
  1166. });
  1167. return false;
  1168. } else if(realEndTime.value != '' && resumeTime.value != '' && new Date(resumeTime.value) > new Date(realEndTime.value)) {
  1169. uni.showToast({
  1170. title: '作业中挂起结束时间晚于实际结束时间,请调整',
  1171. icon: 'none'
  1172. });
  1173. return false;
  1174. }
  1175. }
  1176. }
  1177. }
  1178. return true;
  1179. };
  1180. const isDealing = ref(false)
  1181. const hasDealed = ref(false)
  1182. // 提交表单
  1183. const handleSubmit = async (): Promise<void> => {
  1184. if (!validateForm()) {
  1185. return;
  1186. }
  1187. submitLoading.value = true;
  1188. try {
  1189. if (isDealing.value || hasDealed.value) return // 双重保险
  1190. isDealing.value = true
  1191. // 确保附件URLs是最新的逗号分隔格式
  1192. attachmentUrls.value = uploadedFiles.value.map(file => file.fileName).join(',');
  1193. flowList.value = []
  1194. if (resumeTime.value != '' && resumeInfo.value != null && resumeTime.value != (resumeInfo.value['actionTime'] as string | null)) { //存入新的挂起结束时间
  1195. resumeInfo.value['actionTime'] = resumeTime.value
  1196. flowList.value.push(resumeInfo.value as UTSJSONObject)
  1197. }
  1198. const finishData = {
  1199. id: orderId.value,
  1200. orderType: orderType.value,
  1201. workOrderProjectNo: workOrderProjectNo.value,
  1202. infoEntry: infoEntry.value,
  1203. misOrderNo: infoEntry.value == '1' ? misNo.value : null,
  1204. workPermitNum: workPermitNum.value,
  1205. realStartTime: realStartTime.value,
  1206. realEndTime: realEndTime.value,
  1207. wwryNum: wwryNum.value,
  1208. wlryNum: wlryNum.value,
  1209. workGroupMemberName: workGroupMemberName.value,
  1210. realFailureReason: realFailureReason.value,
  1211. attachmentUrls: attachmentUrls.value,
  1212. repairOrderPersonList: repairOrderPersonList.value,
  1213. teamLeaderId: teamLeaderId.value,
  1214. teamLeaderName: teamLeaderName.value,
  1215. finalizeMethod: '2',
  1216. workOrderStatus: 'completed',
  1217. workArea: workArea.value,
  1218. repairOrderFlowList: flowList.value,
  1219. repairMethod: '1'
  1220. } as UTSJSONObject;
  1221. const result = await repairFinishOrder(finishData);
  1222. const resultObj = result as UTSJSONObject;
  1223. const code = resultObj['code'] as number;
  1224. if (code == 200) {
  1225. uni.showToast({
  1226. title: '结单成功',
  1227. icon: 'success'
  1228. });
  1229. hasDealed.value = true
  1230. // 使用事件总线通知列表页面刷新
  1231. uni.$emit('refreshOrderList', {});
  1232. uni.$emit('refreshAssignedCount');
  1233. uni.$emit('refreshOverdueCount');
  1234. setTimeout(() => {
  1235. uni.navigateBack();
  1236. }, 800);
  1237. } else {
  1238. const msg = resultObj['msg'] as string;
  1239. uni.showToast({
  1240. title: msg.length > 0 ? msg : '结单失败',
  1241. icon: 'none'
  1242. });
  1243. }
  1244. } catch (error: Error) {
  1245. uni.showToast({
  1246. title: error.message,
  1247. icon: 'none'
  1248. });
  1249. } finally {
  1250. submitLoading.value = false;
  1251. isDealing.value = false // 无论成功失败都解锁
  1252. }
  1253. };
  1254. const loading = ref<boolean>(false)
  1255. // 加载详情数据
  1256. const loadDetail = async (id: string, orderType?: string): Promise<void> => {
  1257. try {
  1258. loading.value = true
  1259. let result: any;
  1260. // 根据orderType决定调用哪个API
  1261. if (orderType == '1') {
  1262. // 维修工单
  1263. result = await getRepairOrderInfoById(id)
  1264. } else {
  1265. // 维保工单
  1266. result = await getOrderInfoById(id)
  1267. }
  1268. // 提取响应数据
  1269. const resultObj = result as UTSJSONObject
  1270. const code = resultObj['code'] as number
  1271. const data = resultObj['data'] as UTSJSONObject | null
  1272. if (code == 200 && data != null) {
  1273. workOrderStatus.value = (data['workOrderStatus'] as string | null) ?? ''
  1274. workOrderProjectNo.value = (data['workOrderProjectNo'] as string | null) ?? ''
  1275. pcsDeviceName.value = (data['pcsDeviceName'] as string | null) ?? ''
  1276. gxtCenter.value = (data['gxtCenter'] as string | null) ?? ''
  1277. pcsStationName.value = (data['pcsStationName'] as string | null) ?? ''
  1278. brand.value = (data['brand'] as string | null) ?? ''
  1279. model.value = (data['model'] as string | null) ?? ''
  1280. acceptTime.value = (data['acceptTime'] as string | null) ?? ''
  1281. acceptUserName.value = (data['acceptUserName'] as string | null) ?? ''
  1282. // 初始化结单表单默认值
  1283. infoEntry.value = '1' // 默认为手工录入
  1284. teamLeaderId.value = (data['teamLeaderId'] as Number | null) ?? null
  1285. teamLeaderName.value = (data['teamLeaderName'] as string | null) ?? ''
  1286. returnType.value = workOrderStatus.value == 'to_finish' ? '1' : ''
  1287. faultCode.value = (data['faultCode'] as string | null) ?? ''
  1288. faultBarcode.value = (data['faultBarcode'] as string | null) ?? ''
  1289. faultDesc.value = (data['faultDesc'] as string | null) ?? ''
  1290. suspendReason.value = (data['suspendReason'] as string | null) ?? ''
  1291. // 初始化附件数据
  1292. const attachmentUrlsFromServer = (data['attachmentUrls'] as string | null) ?? ''
  1293. if (attachmentUrlsFromServer.length > 0) {
  1294. attachmentUrls.value = attachmentUrlsFromServer
  1295. // 将逗号分隔的URL字符串转换为UploadResponse对象数组
  1296. const urls = attachmentUrlsFromServer.split(',')
  1297. const fileArr : UploadResponse[] = []
  1298. for (let i = 0; i < urls.length; i++) {
  1299. const url = urls[i]
  1300. const item : UploadResponse = {
  1301. url: url,
  1302. fileId: '',
  1303. fileName: url.substring(url.lastIndexOf('/') + 1),
  1304. filePath: url,
  1305. fileSize: 0,
  1306. fileExt: url.substring(url.lastIndexOf('.') + 1),
  1307. businessType: 'workOrder'
  1308. }
  1309. fileArr.push(item)
  1310. }
  1311. uploadedFiles.value = fileArr
  1312. }
  1313. pauseTime.value = (data['occurTime'] as string | null) ?? ''
  1314. restartTime.value = (data['restartTime'] as string | null) ?? ''
  1315. if(pauseTime.value != '' && restartTime.value != '') {
  1316. const queryParams = {
  1317. pauseTime: pauseTime.value,
  1318. restartTime: restartTime.value,
  1319. pcsDeviceName: pcsDeviceName.value,
  1320. pcsStationName: pcsStationName.value,
  1321. workOrderStatus: '结束'
  1322. } as UTSJSONObject;
  1323. const result = await listAutoMisInfo(queryParams)
  1324. // 提取响应数据
  1325. const resultObj = result as UTSJSONObject
  1326. const code = resultObj['code'] as number
  1327. const misInfo = resultObj['rows'] as UTSJSONObject[] | null
  1328. if (code == 200 && misInfo != null) {
  1329. if(misInfo.length > 0 && misInfo.length == 1) {
  1330. // 有工作票号提示
  1331. const workPermitNum2 = misInfo[0]['workPermitNum'] as string | null
  1332. const misNo2 = misInfo[0]['misNo'] as string | null
  1333. if (workPermitNum2 != null && workPermitNum2.length > 0) {
  1334. const response = await getOrderList(1, 10, misNo2 ?? '', '')
  1335. const responseObj = response as UTSJSONObject
  1336. const rows = responseObj['rows'] as UTSJSONObject[] | null
  1337. if (rows != null && rows.length > 0) {
  1338. misNo.value = ''
  1339. uni.showModal({
  1340. title: '提示',
  1341. content: '已匹配到' + misNo2 + '工单,但该MIS工单已被其他工单关联,请检查是否重复操作。',
  1342. showCancel: false, // 只显示确定按钮
  1343. confirmText: '确定',
  1344. confirmColor: '#007aff', // 自定义按钮颜色,匹配你的UI风格
  1345. success: (res) => {
  1346. }
  1347. });
  1348. } else {
  1349. misNo.value = (misInfo[0]['misNo'] as string | null) ?? ''
  1350. realStartTime.value = (misInfo[0]['realStartTime'] as string | null) ?? ''
  1351. realEndTime.value = (misInfo[0]['realEndTime'] as string | null) ?? ''
  1352. workPermitNum.value = (misInfo[0]['workPermitNum'] as string | null) ?? ''
  1353. // 查询相关工作班成员
  1354. listWorkPerson(misNo.value).then(response => {
  1355. const responseObj = response as UTSJSONObject
  1356. const rows = responseObj['rows'] as UTSJSONObject[] | null
  1357. repairOrderPersonList.value = rows ?? []
  1358. if (rows != null && rows.length > 0) {
  1359. // 查询负责人信息并回填
  1360. for (const person of repairOrderPersonList.value) {
  1361. // 严格判断isLeader为1(兼容数字/字符串类型)
  1362. if (person.isLeader == 1) {
  1363. teamLeaderName.value = (person.nickName as string | null) ?? '';
  1364. teamLeaderId.value = (person.userId as Number | null) ?? null;
  1365. break; // 找到后立即停止循环
  1366. }
  1367. }
  1368. const nickNames = rows
  1369. .filter(person => person.isLeader != 1)
  1370. .map(person => (person.nickName as string | null) ?? '')
  1371. .join(',');
  1372. workGroupMemberName.value = nickNames;
  1373. repairOrderPersonList.value.map(person => {
  1374. // 构造查询参数:username 和 nickName
  1375. const queryParams = {
  1376. userName: person.userName, // 假设person对象有username字段
  1377. nickName: person.nickName // 假设person对象有nickName字段
  1378. };
  1379. getUserList(queryParams).then(response => {
  1380. const responseObj = response as UTSJSONObject
  1381. const rows = responseObj['rows'] as UTSJSONObject[] | null
  1382. if (rows == null || rows.length == 0) {
  1383. let msg = "已匹配到MIS工单,但工作班成员'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查。"
  1384. if (person.isLeader == 1) {
  1385. msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查。"
  1386. }
  1387. // uni.showToast({
  1388. // title: msg,
  1389. // icon: 'none',
  1390. // duration: 3000 // 自定义显示时间,单位ms
  1391. // });
  1392. uni.showModal({
  1393. title: '提示',
  1394. content: msg,
  1395. showCancel: false, // 只显示确定按钮
  1396. confirmText: '确定',
  1397. confirmColor: '#007aff',
  1398. success: (res) => {
  1399. }
  1400. });
  1401. }
  1402. });
  1403. })
  1404. }
  1405. })
  1406. }
  1407. } else {
  1408. misNo.value = ''
  1409. // infoEntry.value = '2'
  1410. uni.showModal({
  1411. title: '提示',
  1412. content: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
  1413. showCancel: false, // 只显示确定按钮
  1414. confirmText: '确定',
  1415. confirmColor: '#007aff',
  1416. success: (res) => {
  1417. }
  1418. });
  1419. }
  1420. } else if(misInfo.length == 0) {
  1421. misNo.value = ''
  1422. // infoEntry.value = '2'
  1423. uni.showModal({
  1424. title: '提示',
  1425. content: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
  1426. showCancel: false, // 只显示确定按钮
  1427. confirmText: '确定',
  1428. confirmColor: '#007aff',
  1429. success: (res) => {
  1430. }
  1431. });
  1432. } else if(misInfo.length > 1) {
  1433. misNo.value = ''
  1434. // infoEntry.value = '2'
  1435. // uni.showToast({
  1436. // title: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
  1437. // icon: 'none',
  1438. // duration: 3000
  1439. // });
  1440. uni.showModal({
  1441. title: '提示',
  1442. content: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
  1443. showCancel: false, // 只显示确定按钮
  1444. confirmText: '确定',
  1445. confirmColor: '#007aff',
  1446. success: (res) => {
  1447. }
  1448. });
  1449. }
  1450. }
  1451. } else {
  1452. misNo.value = ''
  1453. uni.showModal({
  1454. title: '提示',
  1455. content: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
  1456. showCancel: false, // 只显示确定按钮
  1457. confirmText: '确定',
  1458. confirmColor: '#007aff',
  1459. success: (res) => {
  1460. }
  1461. });
  1462. }
  1463. flowList.value = data['repairOrderFlowList'] as UTSJSONObject[]
  1464. if (suspendReason.value != '' && flowList.value.length > 0) {
  1465. // 获取最后一个 actionType 等于 'resume' 的项
  1466. const lastResumeItem = flowList.value.findLast(item => item['actionType'] === 'resume') as UTSJSONObject | null
  1467. if (lastResumeItem != null) {
  1468. resumeInfo.value = lastResumeItem
  1469. // 直接给 resumeTime 赋值,无需 formData
  1470. resumeTime.value = (lastResumeItem['actionTime'] as string | null) ?? ''
  1471. }
  1472. const lastSuspendItem = flowList.value.findLast(item => (item['actionType'] as string | null) === 'to_approve') as UTSJSONObject | null
  1473. if (lastSuspendItem != null) {
  1474. suspendInfo.value = lastSuspendItem
  1475. }
  1476. }
  1477. } else {
  1478. const msg = resultObj['msg'] as string | null
  1479. uni.showToast({
  1480. title: msg ?? '加载失败',
  1481. icon: 'none'
  1482. })
  1483. }
  1484. } catch (e: any) {
  1485. uni.showToast({
  1486. title: e.message ?? '加载失败',
  1487. icon: 'none'
  1488. })
  1489. } finally {
  1490. loading.value = false
  1491. }
  1492. }
  1493. // 页面加载
  1494. onLoad((options: any) => {
  1495. const params = options as UTSJSONObject
  1496. const id = params['id'] as string | null
  1497. const orderTypeParam = params['orderType'] as string | null
  1498. if (id != null && orderTypeParam != null) {
  1499. // 先尝试从参数中获取orderType
  1500. // const orderTypeNumber = parseInt(orderTypeParam)
  1501. orderType.value = orderTypeParam
  1502. orderId.value = id
  1503. loadDetail(id, orderTypeParam)
  1504. }
  1505. })
  1506. // 初始化
  1507. onMounted(() => {
  1508. getUserAllList();
  1509. loadInfoEntryDictList();
  1510. loadWorkAreaDictList();
  1511. })
  1512. </script>
  1513. <style lang="scss">
  1514. .detail-page {
  1515. flex: 1;
  1516. background-color: #e8f0f9;
  1517. }
  1518. .detail-content {
  1519. flex: 1;
  1520. padding: 20rpx 0;
  1521. }
  1522. .info-section {
  1523. margin: 0 30rpx 24rpx;
  1524. .section-title {
  1525. position: relative;
  1526. padding-left: 20rpx;
  1527. margin-bottom: 20rpx;
  1528. &::before {
  1529. position: absolute;
  1530. left: 0;
  1531. top: 50%;
  1532. transform: translateY(-50%);
  1533. width: 8rpx;
  1534. height: 32rpx;
  1535. background-color: #007aff;
  1536. border-radius: 4rpx;
  1537. }
  1538. &-text {
  1539. font-size: 32rpx;
  1540. font-weight: bold;
  1541. color: #333333;
  1542. }
  1543. }
  1544. .info-card {
  1545. background-color: #ffffff;
  1546. border-radius: 16rpx;
  1547. padding: 30rpx;
  1548. .info-item {
  1549. flex-direction: row;
  1550. padding: 20rpx 0;
  1551. border-bottom: 1rpx solid #f0f0f0;
  1552. &:last-child {
  1553. border-bottom: none;
  1554. }
  1555. &.full-width {
  1556. flex-direction: column;
  1557. .info-label {
  1558. margin-bottom: 12rpx;
  1559. }
  1560. .info-value {
  1561. line-height: 44rpx;
  1562. }
  1563. }
  1564. .info-label {
  1565. width: 240rpx;
  1566. font-size: 28rpx;
  1567. color: #666666;
  1568. white-space: nowrap;
  1569. }
  1570. .info-value {
  1571. flex: 1;
  1572. font-size: 28rpx;
  1573. color: #333333;
  1574. text-align: left;
  1575. &.highlight {
  1576. color: #007aff;
  1577. font-weight: bold;
  1578. }
  1579. &.input {
  1580. text-align: left;
  1581. border: 1rpx solid #e0e0e0;
  1582. border-radius: 8rpx;
  1583. padding: 10rpx;
  1584. }
  1585. .input-with-clear {
  1586. position: relative;
  1587. display: flex;
  1588. align-items: center;
  1589. }
  1590. .select-clear {
  1591. position: absolute;
  1592. right: 20rpx;
  1593. color: #ccc;
  1594. text-align: center;
  1595. font-size: 40rpx;
  1596. font-weight: bold;
  1597. z-index: 1;
  1598. }
  1599. .input-with-select {
  1600. position: relative;
  1601. display: flex;
  1602. align-items: center;
  1603. }
  1604. .select-mis-btn {
  1605. line-height: 50rpx;
  1606. text-align: center;
  1607. position: absolute;
  1608. right: 0rpx;
  1609. padding: 6rpx 12rpx;
  1610. background-color: #007aff;
  1611. color: #fff;
  1612. border-radius: 6rpx;
  1613. font-size: 26rpx;
  1614. z-index: 1;
  1615. max-width: 100rpx;
  1616. overflow: hidden;
  1617. text-overflow: ellipsis;
  1618. white-space: nowrap;
  1619. }
  1620. }
  1621. }
  1622. .flow-item {
  1623. padding: 20rpx 0;
  1624. border-bottom: 1rpx solid #f0f0f0;
  1625. &:last-child {
  1626. border-bottom: none;
  1627. }
  1628. .flow-header {
  1629. flex-direction: row;
  1630. justify-content: space-between;
  1631. margin-bottom: 10rpx;
  1632. .flow-operator {
  1633. font-size: 28rpx;
  1634. color: #333333;
  1635. font-weight: bold;
  1636. }
  1637. .flow-time {
  1638. font-size: 24rpx;
  1639. color: #999999;
  1640. }
  1641. }
  1642. .flow-content {
  1643. flex-direction: column;
  1644. .flow-action {
  1645. font-size: 26rpx;
  1646. color: #666666;
  1647. margin-bottom: 8rpx;
  1648. }
  1649. .flow-remark {
  1650. font-size: 24rpx;
  1651. color: #999999;
  1652. background-color: #f5f5f5;
  1653. padding: 10rpx;
  1654. border-radius: 8rpx;
  1655. }
  1656. }
  1657. }
  1658. .no-data {
  1659. text-align: center;
  1660. padding: 40rpx 0;
  1661. font-size: 28rpx;
  1662. color: #999999;
  1663. }
  1664. }
  1665. }
  1666. .accept-button-container {
  1667. padding: 30rpx 30rpx 50rpx;
  1668. background-color: #ffffff;
  1669. .accept-button {
  1670. width: 100%;
  1671. height: 80rpx;
  1672. background-color: #007aff;
  1673. color: #ffffff;
  1674. font-size: 32rpx;
  1675. border-radius: 16rpx;
  1676. border: none;
  1677. &:active {
  1678. background-color: #0062cc;
  1679. }
  1680. }
  1681. }
  1682. .loading-mask {
  1683. position: absolute;
  1684. top: 0;
  1685. left: 0;
  1686. right: 0;
  1687. bottom: 0;
  1688. justify-content: center;
  1689. align-items: center;
  1690. background-color: rgba(0, 0, 0, 0.3);
  1691. .loading-text {
  1692. padding: 30rpx 60rpx;
  1693. background-color: rgba(0, 0, 0, 0.7);
  1694. color: #ffffff;
  1695. font-size: 28rpx;
  1696. border-radius: 12rpx;
  1697. }
  1698. }
  1699. .picker-modal {
  1700. position: fixed;
  1701. top: 0;
  1702. left: 0;
  1703. right: 0;
  1704. bottom: 0;
  1705. z-index: 1000;
  1706. }
  1707. .modal-mask {
  1708. position: absolute;
  1709. top: 0;
  1710. left: 0;
  1711. right: 0;
  1712. bottom: 0;
  1713. background-color: rgba(0, 0, 0, 0.5);
  1714. }
  1715. .modal-content {
  1716. position: absolute;
  1717. bottom: 0;
  1718. left: 0;
  1719. right: 0;
  1720. background-color: #ffffff;
  1721. border-top-left-radius: 16rpx;
  1722. border-top-right-radius: 16rpx;
  1723. min-height: 700rpx;
  1724. }
  1725. .modal-header {
  1726. flex-direction: row;
  1727. justify-content: space-between;
  1728. align-items: center;
  1729. padding: 30rpx;
  1730. border-bottom: 1rpx solid #f0f0f0;
  1731. }
  1732. .modal-title {
  1733. font-size: 32rpx;
  1734. font-weight: bold;
  1735. color: #333333;
  1736. }
  1737. .modal-close {
  1738. font-size: 28rpx;
  1739. color: #007aff;
  1740. }
  1741. .modal-body {
  1742. max-height: 800rpx;
  1743. min-height: 800rpx;
  1744. }
  1745. .picker-option {
  1746. flex-direction: row;
  1747. justify-content: space-between;
  1748. align-items: center;
  1749. padding: 24rpx 30rpx;
  1750. border-bottom: 1rpx solid #f0f0f0;
  1751. }
  1752. .picker-option.selected {
  1753. background-color: #f8f9fa;
  1754. }
  1755. .picker-option:last-child {
  1756. border-bottom: none;
  1757. }
  1758. .option-text {
  1759. font-size: 28rpx;
  1760. color: #333333;
  1761. margin-bottom: 10rpx;
  1762. }
  1763. .option-text:last-child {
  1764. margin-bottom: 0;
  1765. }
  1766. .option-check {
  1767. font-size: 28rpx;
  1768. color: #007aff;
  1769. }
  1770. .empty-tip {
  1771. justify-content: space-between;
  1772. padding: 24rpx 30rpx;
  1773. display: flex;
  1774. align-items: center;
  1775. justify-content: center;
  1776. color: #999;
  1777. }
  1778. .picker-option {
  1779. flex-direction: row;
  1780. justify-content: space-between;
  1781. align-items: center;
  1782. padding: 24rpx 30rpx;
  1783. border-bottom: 1rpx solid #f0f0f0;
  1784. }
  1785. .picker-option:last-child {
  1786. border-bottom: none;
  1787. }
  1788. .picker-option.selected {
  1789. background-color: #f8f9fa;
  1790. }
  1791. .picker-mis-option {
  1792. justify-content: space-between;
  1793. align-items: center;
  1794. padding: 24rpx 30rpx;
  1795. border-bottom: 1rpx solid #f0f0f0;
  1796. }
  1797. .picker-mis-option:last-child {
  1798. border-bottom: none;
  1799. }
  1800. .picker-mis-option.selected {
  1801. background-color: #f8f9fa;
  1802. }
  1803. .option-row {
  1804. flex-direction: row;
  1805. justify-content: space-around;
  1806. align-items: center;
  1807. }
  1808. .option-text {
  1809. font-size: 28rpx;
  1810. color: #333333;
  1811. }
  1812. .mis-list {
  1813. flex: 1;
  1814. height: 100%;
  1815. display: flex;
  1816. flex-direction: column;
  1817. }
  1818. .empty-tip {
  1819. text-align: center;
  1820. padding: 40rpx;
  1821. color: #999;
  1822. font-size: 28rpx;
  1823. }
  1824. .form-item {
  1825. flex-direction: row;
  1826. padding: 20rpx 0;
  1827. border-bottom: 1rpx solid #f0f0f0;
  1828. }
  1829. .reject-reason-textarea {
  1830. width: 100%;
  1831. min-height: 100rpx;
  1832. line-height: 1.5;
  1833. }
  1834. .input-field {
  1835. width: 100%;
  1836. height: 60rpx;
  1837. padding: 0 20rpx;
  1838. border: 1rpx solid #e0e0e0;
  1839. border-radius: 8rpx;
  1840. font-size: 28rpx;
  1841. background-color: #f8f9fa;
  1842. }
  1843. .select-mis-btn {
  1844. width: 150rpx;
  1845. height: 60rpx;
  1846. margin-left: 10rpx;
  1847. background-color: #007aff;
  1848. color: #fff;
  1849. border: none;
  1850. border-radius: 8rpx;
  1851. font-size: 24rpx;
  1852. }
  1853. .textarea-field {
  1854. width: 100%;
  1855. min-height: 120rpx;
  1856. padding: 20rpx;
  1857. border: 1rpx solid #e0e0e0;
  1858. border-radius: 8rpx;
  1859. font-size: 28rpx;
  1860. background-color: #f8f9fa;
  1861. }
  1862. .radio-label {
  1863. display: flex;
  1864. align-items: center;
  1865. margin-right: 30rpx;
  1866. }
  1867. .quick-select-dropdown {
  1868. position: absolute;
  1869. top: 100%;
  1870. left: 0;
  1871. right: 0;
  1872. background: #fff;
  1873. border: 1rpx solid #ddd;
  1874. border-top: none;
  1875. z-index: 1000;
  1876. max-height: 300rpx;
  1877. }
  1878. .quick-select-item {
  1879. padding: 20rpx;
  1880. border-bottom: 1rpx solid #eee;
  1881. }
  1882. .mis-no {
  1883. font-size: 28rpx;
  1884. color: #333;
  1885. }
  1886. .search-bar {
  1887. padding: 20rpx 30rpx;
  1888. background-color: #d7eafe;
  1889. }
  1890. .search-box {
  1891. flex-direction: row;
  1892. align-items: center;
  1893. height: 72rpx;
  1894. padding: 0 24rpx;
  1895. background-color: #f5f5f5;
  1896. border-radius: 36rpx;
  1897. .search-icon {
  1898. width: 32rpx;
  1899. height: 32rpx;
  1900. margin-right: 12rpx;
  1901. }
  1902. .search-input {
  1903. flex: 1;
  1904. font-size: 28rpx;
  1905. color: #333333;
  1906. }
  1907. .clear-icon {
  1908. margin-left: 12rpx;
  1909. font-size: 28rpx;
  1910. color: #999999;
  1911. }
  1912. }
  1913. .mis-list {
  1914. flex: 1;
  1915. height: 100%;
  1916. display: flex;
  1917. flex-direction: column;
  1918. }
  1919. .select-users-count {
  1920. margin-left: 10rpx;
  1921. font-size: 24rpx;
  1922. color: #666;
  1923. }
  1924. </style>