wxFinalize.uvue 72 KB

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