index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146
  1. <template>
  2. <div class="p-2 inspection-task-page">
  3. <!-- 顶部数据卡片 -->
  4. <el-row :gutter="20" class="mb-2">
  5. <el-col :span="6">
  6. <el-card shadow="hover" class="stat-card">
  7. <div class="stat-card-content">
  8. <div class="stat-info">
  9. <div class="stat-title">今日应打卡</div>
  10. <div class="stat-value">{{ stats.todayShould || 0 }}</div>
  11. </div>
  12. <div class="stat-icon stat-icon-blue">
  13. <el-icon><Calendar /></el-icon>
  14. </div>
  15. </div>
  16. </el-card>
  17. </el-col>
  18. <el-col :span="6">
  19. <el-card shadow="hover" class="stat-card">
  20. <div class="stat-card-content">
  21. <div class="stat-info">
  22. <div class="stat-title">今日已打卡</div>
  23. <div class="stat-value">{{ stats.todayChecked || 0 }}</div>
  24. </div>
  25. <div class="stat-icon stat-icon-green">
  26. <el-icon><Check /></el-icon>
  27. </div>
  28. </div>
  29. </el-card>
  30. </el-col>
  31. <el-col :span="6">
  32. <el-card shadow="hover" class="stat-card">
  33. <div class="stat-card-content">
  34. <div class="stat-info">
  35. <div class="stat-title">异常打卡</div>
  36. <div class="stat-value">{{ stats.abnormal || 0 }}</div>
  37. </div>
  38. <div class="stat-icon stat-icon-orange">
  39. <el-icon><Warning /></el-icon>
  40. </div>
  41. </div>
  42. </el-card>
  43. </el-col>
  44. <el-col :span="6">
  45. <el-card shadow="hover" class="stat-card">
  46. <div class="stat-card-content">
  47. <div class="stat-info">
  48. <div class="stat-title">未打卡</div>
  49. <div class="stat-value">{{ stats.unchecked || 0 }}</div>
  50. </div>
  51. <div class="stat-icon stat-icon-red">
  52. <el-icon><Clock /></el-icon>
  53. </div>
  54. </div>
  55. </el-card>
  56. </el-col>
  57. </el-row>
  58. <!-- 搜索区域 -->
  59. <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
  60. <div v-show="showSearch" class="mb-[10px]">
  61. <el-card shadow="hover">
  62. <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="80">
  63. <el-form-item label="任务名称" prop="taskName">
  64. <el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable style="width: 200px" @keyup.enter="handleQuery" />
  65. </el-form-item>
  66. <el-form-item label="巡检类型" prop="taskType">
  67. <el-select v-model="queryParams.taskType" placeholder="全部" clearable style="width: 180px">
  68. <el-option v-for="dict in inspection_type_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item label="门店" prop="storeId">
  72. <el-select
  73. v-model="queryParams.storeId"
  74. placeholder="全部"
  75. clearable
  76. filterable
  77. style="width: 200px"
  78. @change="handleQuery"
  79. >
  80. <el-option v-for="d in storeOptions" :key="d.value" :label="d.label" :value="d.value" />
  81. </el-select>
  82. </el-form-item>
  83. <el-form-item label="打卡状态" prop="recordStatus">
  84. <el-select v-model="queryParams.recordStatus" placeholder="全部" clearable style="width: 180px">
  85. <el-option v-for="dict in inspection_status_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item label="打卡结果" prop="checkResult">
  89. <el-select v-model="queryParams.checkResult" placeholder="全部" clearable style="width: 180px">
  90. <el-option v-for="dict in inspection_result_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
  91. </el-select>
  92. </el-form-item>
  93. <el-form-item>
  94. <el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
  95. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  96. </el-form-item>
  97. </el-form>
  98. </el-card>
  99. </div>
  100. </transition>
  101. <!-- 数据表格区域 -->
  102. <el-card shadow="hover" class="list-card">
  103. <div class="list-toolbar">
  104. <span class="list-total">共 {{ total }} 条记录</span>
  105. <div class="toolbar-actions">
  106. <el-button type="primary" plain icon="Plus" @click="handleAdd">新增巡检打卡</el-button>
  107. <right-toolbar v-model:show-search="showSearch" @query-table="getList" style="margin-left: 8px;" />
  108. </div>
  109. </div>
  110. <el-table v-loading="loading" :data="taskList" border>
  111. <el-table-column label="巡检任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" />
  112. <el-table-column label="巡检类型" align="center" prop="taskType" width="160" :show-overflow-tooltip="true" />
  113. <el-table-column label="打卡方式" align="center" prop="checkMethod" width="100">
  114. <template #default="scope">
  115. <el-tag :type="getMethodTag(scope.row.checkMethod)">{{ scope.row.checkMethod || '常规' }}</el-tag>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="门店" align="center" prop="storeName" width="140" :show-overflow-tooltip="true" />
  119. <el-table-column label="打卡地点" align="center" prop="location" width="160" :show-overflow-tooltip="true" />
  120. <el-table-column label="责任人" align="center" prop="inspectorName" width="100" />
  121. <el-table-column label="打卡状态" align="center" prop="recordStatus" width="100">
  122. <template #default="scope">
  123. <el-tag :type="getStatusTag(scope.row.recordStatus)">{{ scope.row.recordStatus || '未打卡' }}</el-tag>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="打卡结果" align="center" prop="checkResult" width="100">
  127. <template #default="scope">
  128. <el-tag v-if="scope.row.checkResult" :type="getResultTag(scope.row.checkResult)">{{ getResultLabel(scope.row.checkResult) }}</el-tag>
  129. <span v-else>-</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="操作" fixed="right" align="center" width="240" class-name="small-padding fixed-width">
  133. <template #default="scope">
  134. <el-button link type="primary" icon="Document" @click="handleViewRecords(scope.row)">打卡记录</el-button>
  135. <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">编辑</el-button>
  136. <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
  141. </el-card>
  142. <!-- 新增/编辑对话框 -->
  143. <el-dialog v-model="dialog.visible" :title="dialog.title" width="900px" append-to-body @close="closeDialog">
  144. <el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
  145. <el-row :gutter="20">
  146. <el-col :span="12">
  147. <el-form-item label="任务名称" prop="taskName">
  148. <el-input v-model="form.taskName" placeholder="请输入巡检任务名称" maxlength="100" />
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="12">
  152. <el-form-item label="巡检类型" prop="taskType">
  153. <el-select v-model="form.taskType" placeholder="请选择巡检类型" style="width: 100%">
  154. <el-option v-for="dict in inspection_type_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
  155. </el-select>
  156. </el-form-item>
  157. </el-col>
  158. </el-row>
  159. <el-row :gutter="20">
  160. <el-col :span="12">
  161. <el-form-item label="门店" prop="storeId">
  162. <el-select
  163. v-model="form.storeId"
  164. placeholder="请选择总部/门店"
  165. style="width: 100%"
  166. filterable
  167. clearable
  168. @change="onStoreChange"
  169. >
  170. <el-option v-for="d in storeOptions" :key="d.value" :label="d.label" :value="d.value" />
  171. </el-select>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="12">
  175. <el-form-item label="位置区域" prop="location">
  176. <el-input v-model="form.location" placeholder="巡检点物理名称(如XX车间XX工位)" maxlength="200" />
  177. </el-form-item>
  178. </el-col>
  179. </el-row>
  180. <el-row :gutter="20">
  181. <el-col :span="12">
  182. <el-form-item label="巡检周期" prop="cycle">
  183. <el-select v-model="form.cycle" placeholder="请选择巡检周期" style="width: 100%" @change="onCycleChange">
  184. <el-option v-for="dict in inspection_cycle_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
  185. </el-select>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="12">
  189. <el-form-item label="开启扫码打卡" prop="scanEnabled">
  190. <el-switch v-model="form.scanEnabled" active-text="是" inactive-text="否" @change="onScanChange" />
  191. </el-form-item>
  192. </el-col>
  193. <el-col v-if="form.scanEnabled" :span="12">
  194. <el-form-item label="打卡设备编码" prop="punchDeviceCode">
  195. <el-input
  196. v-model="form.punchDeviceCode"
  197. placeholder="请输入巡检点设备编码(与现场二维码一致)"
  198. maxlength="200"
  199. show-word-limit
  200. />
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. <el-row :gutter="20">
  205. <el-col :span="12">
  206. <el-form-item label="纬度" prop="lat">
  207. <el-input-number v-model="form.lat" :precision="6" :min="-90" :max="90" controls-position="right" style="width: 100%" />
  208. </el-form-item>
  209. </el-col>
  210. <el-col :span="12">
  211. <el-form-item label="经度" prop="lng">
  212. <el-input-number v-model="form.lng" :precision="6" :min="-180" :max="180" controls-position="right" style="width: 100%" />
  213. </el-form-item>
  214. </el-col>
  215. </el-row>
  216. <!-- 巡检时间:根据周期动态适配 -->
  217. <el-form-item label="巡检时间" prop="timeConfig">
  218. <div v-if="form.cycle === '每日' || !form.cycle">
  219. <el-tag v-for="(t, idx) in timeSlotList" :key="idx" closable @close="removeTimeSlot(idx)" style="margin-right: 8px">
  220. {{ t }}
  221. </el-tag>
  222. <el-button size="small" type="primary" plain @click="openAddTimeSlot">添加时间段</el-button>
  223. </div>
  224. <div v-else-if="form.cycle === '每周'">
  225. <el-checkbox-group v-model="weekDayList">
  226. <el-checkbox v-for="d in weekDayOptions" :key="d.value" :label="d.value">{{ d.label }}</el-checkbox>
  227. </el-checkbox-group>
  228. </div>
  229. <div v-else-if="form.cycle === '每月'">
  230. <el-select v-model="monthDayList" multiple placeholder="选择执行日期" style="width: 100%">
  231. <el-option v-for="d in 31" :key="d" :label="`${d}号`" :value="d" />
  232. </el-select>
  233. </div>
  234. </el-form-item>
  235. <el-row :gutter="20">
  236. <el-col :span="12">
  237. <el-form-item label="责任人" prop="inspectorId">
  238. <el-select
  239. v-model="form.inspectorId"
  240. placeholder="请选择责任人(本部门及下级部门)"
  241. style="width: 100%"
  242. filterable
  243. clearable
  244. @change="onInspectorChange"
  245. >
  246. <el-option v-for="u in deptChainUserOptions" :key="String(u.userId)" :label="u.nickName" :value="u.userId" />
  247. </el-select>
  248. </el-form-item>
  249. </el-col>
  250. <el-col :span="12">
  251. <el-form-item label="审核人" prop="auditorId">
  252. <el-select
  253. v-model="form.auditorId"
  254. placeholder="请选择审核人(本部门及下级部门)"
  255. style="width: 100%"
  256. filterable
  257. clearable
  258. @change="onAuditorChange"
  259. >
  260. <el-option v-for="u in deptChainUserOptions" :key="String(u.userId)" :label="u.nickName" :value="u.userId" />
  261. </el-select>
  262. </el-form-item>
  263. </el-col>
  264. </el-row>
  265. <!-- 打卡项目:多行 -->
  266. <el-divider content-position="left">
  267. <span style="font-weight: bold">打卡项目</span>
  268. <el-button link type="primary" icon="Plus" @click="addInspectionItem">添加项目</el-button>
  269. </el-divider>
  270. <el-table :data="form.itemList" border>
  271. <el-table-column label="序号" align="center" width="60">
  272. <template #default="scope">{{ scope.$index + 1 }}</template>
  273. </el-table-column>
  274. <el-table-column label="项目大类" align="center" width="160">
  275. <template #default="scope">
  276. <el-select v-model="scope.row.itemCategory" placeholder="请选择" size="small" style="width: 100%">
  277. <el-option v-for="dict in inspection_item_type_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
  278. </el-select>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="巡检内容" align="center">
  282. <template #default="scope">
  283. <el-input v-model="scope.row.itemContent" placeholder="请输入巡检内容" size="small" />
  284. </template>
  285. </el-table-column>
  286. <el-table-column label="巡检标准" align="center">
  287. <template #default="scope">
  288. <el-input v-model="scope.row.itemStandard" placeholder="请输入巡检标准" size="small" />
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="是否拍照" align="center" width="80">
  292. <template #default="scope">
  293. <el-switch v-model="scope.row.needPhoto" />
  294. </template>
  295. </el-table-column>
  296. <el-table-column label="操作" align="center" width="80">
  297. <template #default="scope">
  298. <el-button link type="danger" size="small" icon="Delete" @click="removeInspectionItem(scope.$index)">删除</el-button>
  299. </template>
  300. </el-table-column>
  301. </el-table>
  302. </el-form>
  303. <template #footer>
  304. <div class="dialog-footer">
  305. <el-button type="primary" @click="submitForm">保存巡检任务</el-button>
  306. <el-button @click="cancel">取 消</el-button>
  307. </div>
  308. </template>
  309. </el-dialog>
  310. <!-- 添加时间段弹窗 -->
  311. <el-dialog v-model="timeSlotDialog.visible" title="添加时间段" width="420px" append-to-body>
  312. <el-form label-width="80px">
  313. <el-form-item label="开始时间">
  314. <el-time-picker v-model="timeSlotForm.start" placeholder="开始时间" value-format="HH:mm" format="HH:mm" style="width: 100%" />
  315. </el-form-item>
  316. <el-form-item label="结束时间">
  317. <el-time-picker v-model="timeSlotForm.end" placeholder="结束时间" value-format="HH:mm" format="HH:mm" style="width: 100%" />
  318. </el-form-item>
  319. </el-form>
  320. <template #footer>
  321. <el-button @click="timeSlotDialog.visible = false">取消</el-button>
  322. <el-button type="primary" @click="confirmAddTimeSlot">确定</el-button>
  323. </template>
  324. </el-dialog>
  325. <!-- 打卡记录对话框 -->
  326. <el-dialog v-model="recordDialog.visible" title="打卡记录" width="900px" append-to-body>
  327. <el-table v-loading="recordLoading" :data="recordList" border>
  328. <el-table-column label="打卡时间" align="center" prop="checkInTime" width="180" />
  329. <el-table-column label="打卡人" align="center" prop="inspectorName" width="100" />
  330. <el-table-column label="打卡地点" align="center" prop="checkInLocation" :show-overflow-tooltip="true" />
  331. <el-table-column label="问题数" align="center" prop="problemCount" width="80" />
  332. <el-table-column label="总数" align="center" prop="totalCount" width="80" />
  333. <el-table-column label="打卡状态" align="center" width="100">
  334. <template #default="scope">
  335. <el-tag :type="getStatusTag(scope.row.recordStatus)">{{ scope.row.recordStatus }}</el-tag>
  336. </template>
  337. </el-table-column>
  338. <el-table-column label="打卡结果" align="center" width="100">
  339. <template #default="scope">
  340. <el-tag v-if="scope.row.checkResult" :type="getResultTag(scope.row.checkResult)">{{ getResultLabel(scope.row.checkResult) }}</el-tag>
  341. <span v-else>-</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column label="审核状态" align="center" prop="auditStatus" width="100">
  345. <template #default="scope">
  346. <el-tag v-if="scope.row.auditStatus" :type="getAuditStatusTag(scope.row.auditStatus)">{{ scope.row.auditStatus }}</el-tag>
  347. <span v-else>-</span>
  348. </template>
  349. </el-table-column>
  350. <el-table-column label="操作" align="center" width="180" fixed="right">
  351. <template #default="scope">
  352. <el-button link type="primary" @click="handleViewDetail(scope.row)">查看详情</el-button>
  353. <el-button
  354. v-if="!scope.row.auditStatus || scope.row.auditStatus === '待审核'"
  355. v-hasPermi="['risk:inspectionRecord:review']"
  356. link
  357. type="primary"
  358. @click="handleAuditRecord(scope.row)"
  359. >审核</el-button>
  360. </template>
  361. </el-table-column>
  362. </el-table>
  363. <template #footer>
  364. <el-button @click="recordDialog.visible = false">关 闭</el-button>
  365. </template>
  366. </el-dialog>
  367. <!-- 打卡详情对话框 -->
  368. <el-dialog v-model="detailDialog.visible" title="打卡详情" width="700px" append-to-body>
  369. <el-descriptions :column="1" border>
  370. <el-descriptions-item label="任务名称">{{ detailForm.taskName }}</el-descriptions-item>
  371. <el-descriptions-item label="打卡时间">{{ detailForm.checkInTime }}</el-descriptions-item>
  372. <el-descriptions-item label="打卡人">{{ detailForm.inspectorName }}</el-descriptions-item>
  373. <el-descriptions-item label="打卡状态">
  374. <el-tag :type="getStatusTag(detailForm.recordStatus)">{{ detailForm.recordStatus }}</el-tag>
  375. </el-descriptions-item>
  376. <el-descriptions-item label="打卡结果">
  377. <el-tag v-if="detailForm.checkResult" :type="getResultTag(detailForm.checkResult)">{{ getResultLabel(detailForm.checkResult) }}</el-tag>
  378. <span v-else>-</span>
  379. </el-descriptions-item>
  380. <el-descriptions-item label="打卡地点">{{ detailForm.checkInLocation }}</el-descriptions-item>
  381. <el-descriptions-item label="问题数/总数">{{ detailForm.problemCount || 0 }}/{{ detailForm.totalCount || 0 }}</el-descriptions-item>
  382. <el-descriptions-item label="审核状态">
  383. <el-tag v-if="detailForm.auditStatus" :type="getAuditStatusTag(detailForm.auditStatus)">{{ detailForm.auditStatus }}</el-tag>
  384. <span v-else>-</span>
  385. </el-descriptions-item>
  386. <el-descriptions-item v-if="detailForm.auditorName" label="审核人">{{ detailForm.auditorName }} ({{ detailForm.auditTime || '-' }})</el-descriptions-item>
  387. <el-descriptions-item v-if="detailForm.auditOpinion" label="审核意见" :span="1">
  388. <span :class="['audit-opinion', detailForm.auditStatus === '审核不通过' ? 'reject' : 'pass']">
  389. {{ detailForm.auditOpinion }}
  390. </span>
  391. </el-descriptions-item>
  392. </el-descriptions>
  393. <h4 style="margin: 16px 0 8px">巡检项目明细</h4>
  394. <el-table :data="detailForm.itemList" border size="small">
  395. <el-table-column label="项目大类" prop="itemType" width="120" />
  396. <el-table-column label="巡检内容" prop="itemContent" />
  397. <el-table-column label="巡检结果" prop="checkResult" width="100">
  398. <template #default="scope">
  399. <el-tag v-if="scope.row.checkResult" :type="getResultTag(scope.row.checkResult)" size="small">{{ getResultLabel(scope.row.checkResult) }}</el-tag>
  400. <span v-else>-</span>
  401. </template>
  402. </el-table-column>
  403. <el-table-column label="照片" min-width="160">
  404. <template #default="scope">
  405. <template v-if="scope.row.checkPhotos">
  406. <el-image
  407. v-for="(url, i) in String(scope.row.checkPhotos).split(',').filter((u) => u)"
  408. :key="i"
  409. :src="url.trim()"
  410. :preview-src-list="String(scope.row.checkPhotos).split(',').map((u) => u.trim()).filter((u) => u)"
  411. :initial-index="i"
  412. :preview-teleported="true"
  413. fit="cover"
  414. style="width: 60px; height: 60px; margin-right: 6px; border-radius: 4px;"
  415. />
  416. </template>
  417. <span v-else>-</span>
  418. </template>
  419. </el-table-column>
  420. </el-table>
  421. <template #footer>
  422. <el-button @click="detailDialog.visible = false">关 闭</el-button>
  423. </template>
  424. </el-dialog>
  425. <!-- 审核弹窗 -->
  426. <el-dialog
  427. v-model="auditDialog.visible"
  428. title="巡检打卡审核"
  429. width="520px"
  430. append-to-body
  431. :close-on-click-modal="false"
  432. @close="closeAuditDialog"
  433. >
  434. <el-form ref="auditFormRef" :model="auditForm" :rules="auditRules" label-width="100px">
  435. <el-form-item label="任务名称">
  436. <span class="readonly-text">{{ auditForm.taskName }}</span>
  437. </el-form-item>
  438. <el-form-item label="打卡人">
  439. <span class="readonly-text">{{ auditForm.inspectorName }}</span>
  440. </el-form-item>
  441. <el-form-item label="打卡时间">
  442. <span class="readonly-text">{{ auditForm.checkInTime }}</span>
  443. </el-form-item>
  444. <el-form-item label="审核结果" prop="auditStatus">
  445. <el-radio-group v-model="auditForm.auditStatus">
  446. <el-radio value="审核通过">通过</el-radio>
  447. <el-radio value="审核不通过">不通过</el-radio>
  448. </el-radio-group>
  449. </el-form-item>
  450. <el-form-item v-if="auditForm.auditStatus === '审核不通过'" label="不通过原因" prop="auditOpinion">
  451. <el-input
  452. v-model="auditForm.auditOpinion"
  453. type="textarea"
  454. :rows="4"
  455. placeholder="请输入不通过原因"
  456. maxlength="500"
  457. show-word-limit
  458. />
  459. </el-form-item>
  460. </el-form>
  461. <template #footer>
  462. <div class="dialog-footer">
  463. <el-button @click="cancelAudit">取消</el-button>
  464. <el-button v-hasPermi="['risk:inspectionRecord:review']" type="primary" @click="submitAudit">确认审核</el-button>
  465. </div>
  466. </template>
  467. </el-dialog>
  468. </div>
  469. </template>
  470. <script setup name="InspectionTask" lang="ts">
  471. import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue';
  472. import {
  473. listInspectionTask,
  474. getInspectionTask,
  475. addInspectionTask,
  476. updateInspectionTask,
  477. delInspectionTask,
  478. getInspectionStats,
  479. listInspectionRecordByTask
  480. } from '@/api/risk/inspectionTask';
  481. import { listInspectionItemByTask } from '@/api/risk/inspectionItem';
  482. import { auditInspectionRecord, listInspectionRecordItemByRecord } from '@/api/risk/inspectionRecord';
  483. import type {
  484. RiskInspectionTaskBo,
  485. RiskInspectionTaskVo,
  486. RiskInspectionItemVo,
  487. RiskInspectionRecordVo,
  488. RiskInspectionRecordBo,
  489. RiskInspectionRecordItemVo,
  490. InspectionStatsVo
  491. } from '@/api/risk/types';
  492. import { listByCurrentDeptChainUsers } from '@/api/system/user';
  493. import type { UserVO } from '@/api/system/user/types';
  494. import { listDept } from '@/api/system/dept';
  495. import { FormInstance } from 'element-plus';
  496. import type { ComponentInternalInstance } from 'vue';
  497. import { Calendar, Check, Warning, Clock } from '@element-plus/icons-vue';
  498. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  499. interface InspectionItemForm {
  500. id?: number;
  501. itemCategory: string;
  502. itemContent: string;
  503. itemStandard: string;
  504. needPhoto: boolean;
  505. }
  506. const taskList = ref<RiskInspectionTaskVo[]>([]);
  507. const loading = ref(true);
  508. const showSearch = ref(true);
  509. const total = ref(0);
  510. const queryFormRef = ref<FormInstance>();
  511. const formRef = ref<FormInstance>();
  512. const recordList = ref<RiskInspectionRecordVo[]>([]);
  513. const recordLoading = ref(false);
  514. // 责任人/审核人选择器数据(当前登录用户所在部门及所有下级部门用户)
  515. const deptChainUserOptions = ref<UserVO[]>([]);
  516. // 门店下拉(集团总部 + 65 个门店,dept_category='门店')
  517. // value 用 string 与后端返回的 storeId (JSON 大数防精度丢失) 严格匹配
  518. const storeOptions = ref<Array<{ label: string; value: string }>>([]);
  519. // 字典
  520. const {
  521. risk_inspection_type: inspection_type_dict,
  522. risk_inspection_method: inspection_method_dict,
  523. risk_inspection_status: inspection_status_dict,
  524. risk_inspection_result: inspection_result_dict,
  525. risk_inspection_item_type: inspection_item_type_dict,
  526. risk_inspection_cycle: inspection_cycle_dict
  527. } = toRefs<any>(
  528. proxy?.useDict(
  529. 'risk_inspection_type',
  530. 'risk_inspection_method',
  531. 'risk_inspection_status',
  532. 'risk_inspection_result',
  533. 'risk_inspection_item_type',
  534. 'risk_inspection_cycle'
  535. )
  536. );
  537. // 统计
  538. const stats = ref<InspectionStatsVo>({
  539. todayShould: 0,
  540. todayChecked: 0,
  541. abnormal: 0,
  542. unchecked: 0
  543. });
  544. // 时间配置
  545. const timeSlotList = ref<string[]>([]);
  546. const weekDayList = ref<string[]>([]);
  547. const monthDayList = ref<number[]>([]);
  548. const weekDayOptions = [
  549. { value: '1', label: '周一' },
  550. { value: '2', label: '周二' },
  551. { value: '3', label: '周三' },
  552. { value: '4', label: '周四' },
  553. { value: '5', label: '周五' },
  554. { value: '6', label: '周六' },
  555. { value: '7', label: '周日' }
  556. ];
  557. const timeSlotDialog = reactive({ visible: false });
  558. const timeSlotForm = reactive({ start: '', end: '' });
  559. const data = reactive<any>({
  560. form: {
  561. id: undefined,
  562. taskName: '',
  563. taskType: '',
  564. storeId: undefined as string | undefined,
  565. storeName: '',
  566. location: '',
  567. cycle: '每日',
  568. scanEnabled: false,
  569. checkMethod: '常规',
  570. punchDeviceCode: '',
  571. lng: undefined,
  572. lat: undefined,
  573. inspectorName: '',
  574. auditorName: '',
  575. dayOfWeek: '',
  576. dayOfMonth: '',
  577. timeSlot: '',
  578. itemList: [] as InspectionItemForm[]
  579. } as any,
  580. queryParams: {
  581. pageNum: 1,
  582. pageSize: 10,
  583. taskName: '',
  584. taskType: '',
  585. storeId: undefined as string | undefined,
  586. recordStatus: '',
  587. checkResult: ''
  588. },
  589. rules: {
  590. taskName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
  591. taskType: [{ required: true, message: '请选择巡检类型', trigger: 'change' }],
  592. cycle: [{ required: true, message: '请选择巡检周期', trigger: 'change' }],
  593. storeId: [{ required: true, message: '请选择门店/总部', trigger: 'change' }],
  594. location: [{ required: true, message: '请输入位置区域', trigger: 'blur' }],
  595. inspectorId: [{ required: true, message: '请选择责任人', trigger: 'change' }],
  596. auditorId: [{ required: true, message: '请选择审核人', trigger: 'change' }]
  597. }
  598. });
  599. const { queryParams, form, rules } = toRefs(data);
  600. const dialog = reactive<DialogOption>({ visible: false, title: '' });
  601. const recordDialog = reactive<DialogOption>({ visible: false, title: '打卡记录' });
  602. const detailDialog = reactive({ visible: false });
  603. const detailForm = ref<any>({ itemList: [] });
  604. const auditDialog = reactive({ visible: false, title: '巡检打卡审核' });
  605. const auditFormRef = ref<FormInstance>();
  606. const getList = async () => {
  607. loading.value = true;
  608. try {
  609. const res = await listInspectionTask(queryParams.value);
  610. taskList.value = res.rows || [];
  611. total.value = res.total || 0;
  612. } finally {
  613. loading.value = false;
  614. }
  615. };
  616. const loadStats = async () => {
  617. const res = await getInspectionStats();
  618. if (res.data) {
  619. stats.value = res.data;
  620. }
  621. };
  622. const loadAll = async () => {
  623. await Promise.all([getList(), loadStats()]);
  624. };
  625. const handleQuery = () => {
  626. queryParams.value.pageNum = 1;
  627. getList();
  628. };
  629. const resetQuery = () => {
  630. queryFormRef.value?.resetFields();
  631. queryParams.value.pageNum = 1;
  632. queryParams.value.storeId = undefined as number | undefined;
  633. handleQuery();
  634. };
  635. const resetForm = () => {
  636. form.value = {
  637. id: undefined,
  638. taskName: '',
  639. taskType: '',
  640. storeId: undefined as string | undefined,
  641. storeName: '',
  642. location: '',
  643. cycle: '每日',
  644. scanEnabled: false,
  645. checkMethod: '常规',
  646. punchDeviceCode: '',
  647. lng: undefined,
  648. lat: undefined,
  649. inspectorId: undefined,
  650. inspectorName: '',
  651. auditorId: undefined,
  652. auditorName: '',
  653. dayOfWeek: '',
  654. dayOfMonth: '',
  655. timeSlot: '',
  656. itemList: [] as InspectionItemForm[]
  657. };
  658. timeSlotList.value = [];
  659. weekDayList.value = [];
  660. monthDayList.value = [];
  661. formRef.value?.resetFields();
  662. };
  663. /**
  664. * 拉取当前登录用户所在部门及所有下级部门的用户列表(责任人/审核人选择器数据源)
  665. */
  666. const loadDeptChainUsers = async () => {
  667. try {
  668. const res = await listByCurrentDeptChainUsers();
  669. deptChainUserOptions.value = res.data || [];
  670. } catch (e) {
  671. deptChainUserOptions.value = [];
  672. }
  673. };
  674. /**
  675. * 选择责任人后,同步回填 inspectorName 字段(便于提交到后端)
  676. */
  677. const onInspectorChange = (val: string | number | undefined) => {
  678. if (val === undefined || val === null || val === '') {
  679. form.value.inspectorName = '';
  680. return;
  681. }
  682. const user = deptChainUserOptions.value.find((u) => String(u.userId) === String(val));
  683. form.value.inspectorName = user?.nickName || user?.userName || '';
  684. };
  685. /**
  686. * 选择审核人后,同步回填 auditorName 字段
  687. */
  688. const onAuditorChange = (val: string | number | undefined) => {
  689. if (val === undefined || val === null || val === '') {
  690. form.value.auditorName = '';
  691. return;
  692. }
  693. const user = deptChainUserOptions.value.find((u) => String(u.userId) === String(val));
  694. form.value.auditorName = user?.nickName || user?.userName || '';
  695. };
  696. /**
  697. * 选择门店后,同步回填 storeName 字段
  698. */
  699. const onStoreChange = (val: string | number | undefined) => {
  700. if (val === undefined || val === null || val === '') {
  701. form.value.storeName = '';
  702. return;
  703. }
  704. const opt = storeOptions.value.find((s) => String(s.value) === String(val));
  705. form.value.storeName = opt?.label || '';
  706. };
  707. const onCycleChange = (val: string) => {
  708. timeSlotList.value = [];
  709. weekDayList.value = [];
  710. monthDayList.value = [];
  711. };
  712. const onScanChange = (val: boolean | string | number) => {
  713. form.value.checkMethod = val ? '扫码' : '常规';
  714. };
  715. const openAddTimeSlot = () => {
  716. timeSlotForm.start = '';
  717. timeSlotForm.end = '';
  718. timeSlotDialog.visible = true;
  719. };
  720. const confirmAddTimeSlot = () => {
  721. if (!timeSlotForm.start || !timeSlotForm.end) {
  722. proxy?.$modal.msgWarning('请选择开始和结束时间');
  723. return;
  724. }
  725. timeSlotList.value.push(`${timeSlotForm.start}-${timeSlotForm.end}`);
  726. timeSlotDialog.visible = false;
  727. };
  728. const removeTimeSlot = (idx: number) => {
  729. timeSlotList.value.splice(idx, 1);
  730. };
  731. const addInspectionItem = () => {
  732. form.value.itemList.push({
  733. itemCategory: '',
  734. itemContent: '',
  735. itemStandard: '',
  736. needPhoto: false
  737. });
  738. };
  739. const removeInspectionItem = (idx: number) => {
  740. form.value.itemList.splice(idx, 1);
  741. };
  742. const handleAdd = () => {
  743. resetForm();
  744. dialog.visible = true;
  745. dialog.title = '新增巡检打卡';
  746. };
  747. const handleUpdate = async (row: RiskInspectionTaskVo) => {
  748. resetForm();
  749. // 编辑时,确保选择器数据源已加载(避免选择器中无对应选项)
  750. if (deptChainUserOptions.value.length === 0) {
  751. await loadDeptChainUsers();
  752. }
  753. if (storeOptions.value.length === 0) {
  754. await loadStores();
  755. }
  756. const res = await getInspectionTask(row.id);
  757. Object.assign(form.value, res.data);
  758. // storeId 统一转 string 与 storeOptions.value 严格匹配
  759. if (form.value.storeId !== undefined && form.value.storeId !== null) {
  760. form.value.storeId = String(form.value.storeId);
  761. const opt = storeOptions.value.find((s) => s.value === form.value.storeId);
  762. if (opt && !form.value.storeName) {
  763. form.value.storeName = opt.label;
  764. }
  765. }
  766. // scanEnabled 后端返 '1'/'0' 字符串,el-switch 严格 boolean,统一转
  767. if (form.value.scanEnabled !== undefined && form.value.scanEnabled !== null) {
  768. form.value.scanEnabled = form.value.scanEnabled === '1' || form.value.scanEnabled === true;
  769. }
  770. // 恢复时间配置
  771. if (res.data?.timeSlot) {
  772. timeSlotList.value = res.data.timeSlot.split(',').filter((s: string) => s);
  773. }
  774. if (res.data?.dayOfWeek) {
  775. weekDayList.value = res.data.dayOfWeek.split(',').filter((s: string) => s);
  776. }
  777. if (res.data?.dayOfMonth) {
  778. monthDayList.value = res.data.dayOfMonth.split(',').filter((s: string) => s).map((n: string) => Number(n));
  779. }
  780. // 加载打卡项目
  781. try {
  782. const itemRes = await listInspectionItemByTask(row.id);
  783. form.value.itemList = (itemRes.data || []).map((it: RiskInspectionItemVo) => ({
  784. id: it.id,
  785. itemCategory: it.itemCategory || it.itemType || '',
  786. itemContent: it.itemContent,
  787. itemStandard: it.itemStandard,
  788. needPhoto: it.needPhoto === '1' || it.needPhoto === true
  789. }));
  790. } catch (e) {
  791. form.value.itemList = [];
  792. }
  793. dialog.visible = true;
  794. dialog.title = '编辑巡检任务';
  795. };
  796. const handleViewRecords = async (row: RiskInspectionTaskVo) => {
  797. recordLoading.value = true;
  798. try {
  799. const res = await listInspectionRecordByTask(row.id);
  800. recordList.value = res.data || [];
  801. } finally {
  802. recordLoading.value = false;
  803. }
  804. recordDialog.visible = true;
  805. };
  806. const handleViewDetail = async (row: RiskInspectionRecordVo) => {
  807. detailForm.value = { ...row, itemList: [] };
  808. detailDialog.visible = true;
  809. try {
  810. const res = await listInspectionRecordItemByRecord(row.id);
  811. detailForm.value.itemList = (res.data || []).map((it: RiskInspectionRecordItemVo) => ({
  812. itemType: it.itemType || it.itemCategory,
  813. itemContent: it.itemContent,
  814. itemStandard: it.itemStandard,
  815. checkResult: it.checkResult,
  816. remark: it.remark,
  817. checkPhotos: it.photos || it.checkPhotos,
  818. problemCount: it.problemCount
  819. }));
  820. } catch (e) {
  821. detailForm.value.itemList = [];
  822. }
  823. };
  824. // ============ 审核相关 ============
  825. const auditData = reactive({
  826. auditForm: {
  827. id: undefined as string | number | undefined,
  828. taskName: '',
  829. inspectorName: '',
  830. checkInTime: '',
  831. auditStatus: '审核通过',
  832. auditOpinion: ''
  833. },
  834. auditRules: {
  835. auditStatus: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
  836. auditOpinion: [
  837. {
  838. validator: (_rule: any, value: any, callback: any) => {
  839. if (auditData.auditForm.auditStatus === '审核不通过' && !value) {
  840. callback(new Error('审核不通过时必须填写原因'));
  841. } else {
  842. callback();
  843. }
  844. },
  845. trigger: 'blur'
  846. }
  847. ]
  848. }
  849. });
  850. const { auditForm, auditRules } = toRefs(auditData);
  851. /** 打卡记录列表 - 打开审核弹窗 */
  852. const handleAuditRecord = (row: RiskInspectionRecordVo) => {
  853. auditForm.value = {
  854. id: row.id,
  855. taskName: row.taskName || '',
  856. inspectorName: row.inspectorName || '',
  857. checkInTime: row.checkInTime || '',
  858. auditStatus: '审核通过',
  859. auditOpinion: ''
  860. };
  861. auditDialog.visible = true;
  862. };
  863. /** 审核弹窗 - 提交 */
  864. const submitAudit = () => {
  865. auditFormRef.value?.validate(async (valid: boolean) => {
  866. if (!valid) return;
  867. const submitData: RiskInspectionRecordBo = {
  868. id: auditForm.value.id,
  869. auditStatus: auditForm.value.auditStatus,
  870. auditOpinion: auditForm.value.auditOpinion
  871. };
  872. await auditInspectionRecord(submitData);
  873. proxy?.$modal.msgSuccess('审核成功');
  874. auditDialog.visible = false;
  875. // 刷新当前打卡记录列表(若弹窗开着则一起刷新)
  876. if (recordDialog.visible && recordList.value.length > 0) {
  877. const taskId = recordList.value[0]?.taskId;
  878. if (taskId) {
  879. const res = await listInspectionRecordByTask(taskId);
  880. recordList.value = res.data || [];
  881. }
  882. }
  883. });
  884. };
  885. const cancelAudit = () => {
  886. auditDialog.visible = false;
  887. auditFormRef.value?.resetFields();
  888. };
  889. const closeAuditDialog = () => {
  890. auditDialog.visible = false;
  891. auditFormRef.value?.resetFields();
  892. };
  893. /** 审核状态 tag 颜色(待审核=warning/审核通过=success/审核不通过=danger) */
  894. const getAuditStatusTag = (s: string): 'primary' | 'success' | 'warning' | 'info' | 'danger' => {
  895. const map: Record<string, 'primary' | 'success' | 'warning' | 'info' | 'danger'> = {
  896. 待审核: 'warning',
  897. 审核通过: 'success',
  898. 审核不通过: 'danger'
  899. };
  900. return (map[s] || 'info') as any;
  901. };
  902. const handleDelete = async (row: RiskInspectionTaskVo) => {
  903. await proxy?.$modal.confirm('是否确认删除任务 "' + row.taskName + '" ?');
  904. await delInspectionTask(row.id);
  905. proxy?.$modal.msgSuccess('删除成功');
  906. await loadAll();
  907. };
  908. const submitForm = () => {
  909. formRef.value?.validate(async (valid: boolean) => {
  910. if (!valid) return;
  911. // 同步时间配置
  912. if (form.value.cycle === '每日') {
  913. form.value.timeSlot = timeSlotList.value.join(',');
  914. form.value.dayOfWeek = '';
  915. form.value.dayOfMonth = '';
  916. } else if (form.value.cycle === '每周') {
  917. form.value.dayOfWeek = weekDayList.value.join(',');
  918. form.value.timeSlot = '';
  919. form.value.dayOfMonth = '';
  920. } else if (form.value.cycle === '每月') {
  921. form.value.dayOfMonth = monthDayList.value.join(',');
  922. form.value.timeSlot = '';
  923. form.value.dayOfWeek = '';
  924. }
  925. // 构造提交 payload(把 boolean scanEnabled 转 '1'/'0',但不改 form.value 本身,
  926. // 避免下次打开弹窗时状态不一致)
  927. const payload: any = {
  928. ...form.value,
  929. scanEnabled: form.value.scanEnabled ? '1' : '0',
  930. itemList: (form.value.itemList || []).map((it: any) => ({
  931. ...it,
  932. // 后端 entity 字段是 itemCategory
  933. itemCategory: it.itemCategory || it.itemType || '',
  934. // needPhoto 归一化:boolean true → '1', false → '0'
  935. needPhoto: it.needPhoto ? '1' : '0'
  936. }))
  937. };
  938. if (form.value.id) {
  939. await updateInspectionTask(payload as RiskInspectionTaskBo);
  940. proxy?.$modal.msgSuccess('修改成功');
  941. } else {
  942. await addInspectionTask(payload as RiskInspectionTaskBo);
  943. proxy?.$modal.msgSuccess('新增成功');
  944. }
  945. dialog.visible = false;
  946. await loadAll();
  947. });
  948. };
  949. const cancel = () => {
  950. dialog.visible = false;
  951. resetForm();
  952. };
  953. const closeDialog = () => {
  954. dialog.visible = false;
  955. resetForm();
  956. };
  957. const getMethodTag = (m: string): 'primary' | 'success' | 'warning' | 'info' | 'danger' => {
  958. const map: Record<string, 'primary' | 'success' | 'warning' | 'info' | 'danger'> = {
  959. 扫码: 'warning',
  960. 常规: 'primary'
  961. };
  962. return (map[m] || 'info') as any;
  963. };
  964. const getStatusTag = (s: string): 'primary' | 'success' | 'warning' | 'info' | 'danger' => {
  965. const map: Record<string, 'primary' | 'success' | 'warning' | 'info' | 'danger'> = {
  966. 已打卡: 'success',
  967. 未打卡: 'danger',
  968. 异常打卡: 'warning'
  969. };
  970. return (map[s] || 'info') as any;
  971. };
  972. const getResultTag = (r: string): 'primary' | 'success' | 'warning' | 'info' | 'danger' => {
  973. const map: Record<string, 'primary' | 'success' | 'warning' | 'info' | 'danger'> = {
  974. 正常: 'success',
  975. 异常: 'danger',
  976. '0': 'success', // 0=正常
  977. '1': 'danger' // 1=异常
  978. };
  979. return (map[r] || 'info') as any;
  980. };
  981. /**
  982. * 巡检结果码 → 中文标签
  983. * - 后端存储:0=正常 / 1=异常(也兼容直接存"正常"/"异常"的老数据)
  984. */
  985. const getResultLabel = (r: string): string => {
  986. const map: Record<string, string> = {
  987. '0': '正常',
  988. '1': '异常',
  989. 正常: '正常',
  990. 异常: '异常'
  991. };
  992. return map[r] || r || '-';
  993. };
  994. onMounted(async () => {
  995. await loadAll();
  996. await loadDeptChainUsers();
  997. await loadStores();
  998. });
  999. /** 加载门店下拉(集团总部 + dept_category='门店' 的所有门店) */
  1000. const loadStores = async () => {
  1001. try {
  1002. const res: any = await listDept({});
  1003. const list: any[] = Array.isArray(res?.data) ? res.data : Array.isArray(res) ? res : [];
  1004. // 总部(dept_id=100 '家得福集团总部') + 所有 dept_category='门店' 的门店
  1005. storeOptions.value = list
  1006. .filter((d: any) => d.deptCategory === '门店' || d.deptId === 100)
  1007. .filter((d: any) => d.status === '0' || d.status === undefined || d.status === null)
  1008. .map((d: any) => ({ label: d.deptName, value: String(d.deptId) }))
  1009. .sort((a, b) => Number(a.value) - Number(b.value));
  1010. } catch (e) {
  1011. console.error('加载门店列表失败', e);
  1012. storeOptions.value = [];
  1013. }
  1014. };
  1015. </script>
  1016. <style scoped lang="scss">
  1017. .inspection-task-page {
  1018. padding: 16px;
  1019. height: 100%;
  1020. overflow-y: auto;
  1021. box-sizing: border-box;
  1022. }
  1023. .stat-card {
  1024. border-radius: 8px;
  1025. :deep(.el-card__body) { padding: 20px; }
  1026. }
  1027. .stat-card-content {
  1028. display: flex;
  1029. align-items: center;
  1030. justify-content: space-between;
  1031. }
  1032. .stat-info { flex: 1; }
  1033. .stat-title {
  1034. font-size: 13px;
  1035. color: #909399;
  1036. margin-bottom: 8px;
  1037. white-space: nowrap;
  1038. }
  1039. .stat-value {
  1040. font-size: 28px;
  1041. font-weight: 700;
  1042. color: #303133;
  1043. line-height: 1.2;
  1044. }
  1045. .stat-icon {
  1046. width: 48px;
  1047. height: 48px;
  1048. border-radius: 8px;
  1049. display: flex;
  1050. align-items: center;
  1051. justify-content: center;
  1052. font-size: 24px;
  1053. color: #fff;
  1054. }
  1055. .stat-icon-blue { background: #ecf5ff; color: #409EFF; }
  1056. .stat-icon-orange { background: #fdf6ec; color: #E6A23C; }
  1057. .stat-icon-green { background: #f0f9eb; color: #67C23A; }
  1058. .stat-icon-red { background: #fef0f0; color: #F56C6C; }
  1059. .mb-2 { margin-bottom: 8px; }
  1060. .mt-2 { margin-top: 8px; }
  1061. .readonly-text {
  1062. color: #303133;
  1063. }
  1064. .audit-opinion.pass {
  1065. color: #67c23a;
  1066. }
  1067. .audit-opinion.reject {
  1068. color: #f56c6c;
  1069. }
  1070. .list-toolbar {
  1071. display: flex;
  1072. justify-content: space-between;
  1073. align-items: center;
  1074. margin-bottom: 12px;
  1075. }
  1076. .list-total {
  1077. font-size: 13px;
  1078. color: #606266;
  1079. }
  1080. .toolbar-actions {
  1081. display: flex;
  1082. align-items: center;
  1083. }
  1084. </style>