DemandApplicationForm.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159
  1. <template>
  2. <ele-modal
  3. :visible.sync="visible"
  4. :title="title"
  5. :before-close="cancel"
  6. :close-on-click-modal="false"
  7. :close-on-press-escape="false"
  8. :maxable="true"
  9. custom-class="ele-dialog-form demand-application-dialog"
  10. width="88%"
  11. append-to-body
  12. >
  13. <div v-loading="loading" class="application-form-layout">
  14. <el-tabs
  15. v-model="activeTab"
  16. class="detail-tabs"
  17. :class="{ 'detail-tabs--form': !readOnly }"
  18. >
  19. <el-tab-pane label="申请详情" name="application">
  20. <div class="form-overview">
  21. <div class="overview-identity">
  22. <div class="overview-icon">
  23. <i
  24. :class="readOnly ? 'el-icon-view' : 'el-icon-edit-outline'"
  25. ></i>
  26. </div>
  27. <div>
  28. <div class="overview-label">{{
  29. readOnly ? '申请单详情' : '申请单维护'
  30. }}</div>
  31. <div class="overview-code">
  32. {{ formData.applyCode || '保存后生成申请编号' }}
  33. </div>
  34. </div>
  35. </div>
  36. <div class="overview-meta">
  37. <div class="meta-item meta-item--unit">
  38. <span class="meta-label">申请单位</span>
  39. <el-tooltip
  40. :content="formData.applyUnitName || '待填写'"
  41. placement="top"
  42. effect="dark"
  43. >
  44. <span class="meta-value meta-value--unit">{{
  45. formData.applyUnitName || '待填写'
  46. }}</span>
  47. </el-tooltip>
  48. </div>
  49. <div class="meta-item">
  50. <span class="meta-label">明细行数</span>
  51. <span class="meta-value meta-value--number">{{
  52. detailCount
  53. }}</span>
  54. </div>
  55. <el-tag
  56. :type="approvalStatusType(formData.approvalStatus)"
  57. :class="`overview-status overview-status--${Number(
  58. formData.approvalStatus
  59. )}`"
  60. >
  61. <i class="overview-status__dot"></i>
  62. {{ approvalStatusLabel(formData.approvalStatus) }}
  63. </el-tag>
  64. </div>
  65. </div>
  66. <section class="form-section basic-section">
  67. <div class="section-heading">
  68. <div>
  69. <div class="section-title">
  70. <i class="el-icon-s-order"></i>
  71. 基础信息
  72. </div>
  73. <div class="section-description"
  74. >填写申请单位、申请人及单据基础属性</div
  75. >
  76. </div>
  77. <span v-if="!readOnly" class="required-hint">
  78. <i></i> 标记字段为必填项
  79. </span>
  80. </div>
  81. <el-form
  82. ref="form"
  83. :model="formData"
  84. :rules="rules"
  85. :disabled="readOnly"
  86. label-width="140px"
  87. class="ele-body demand-form"
  88. >
  89. <el-row :gutter="24">
  90. <el-col :lg="8" :md="12" :sm="12" :xs="24">
  91. <el-form-item label="申请编号:" prop="applyCode">
  92. <el-input
  93. v-model.trim="formData.applyCode"
  94. size="mini"
  95. placeholder="不填写时由后台生成"
  96. />
  97. </el-form-item>
  98. </el-col>
  99. <el-col :lg="8" :md="12" :sm="12" :xs="24">
  100. <el-form-item label="申请时间:" prop="applyTime">
  101. <el-date-picker
  102. v-model="formData.applyTime"
  103. type="datetime"
  104. size="mini"
  105. value-format="yyyy-MM-dd HH:mm:ss"
  106. placeholder="请选择申请时间"
  107. class="w100"
  108. />
  109. </el-form-item>
  110. </el-col>
  111. <el-col :lg="8" :md="12" :sm="12" :xs="24">
  112. <el-form-item label="申请单位名称:" prop="applyUnitName">
  113. <el-input
  114. v-model.trim="formData.applyUnitName"
  115. disabled
  116. size="mini"
  117. placeholder="当前登录人所属单位"
  118. />
  119. </el-form-item>
  120. </el-col>
  121. <!-- <el-col :lg="8" :md="12" :sm="12" :xs="24">
  122. <el-form-item label="申请用户编码:" prop="applyUserCode">
  123. <el-input
  124. v-model.trim="formData.applyUserCode"
  125. size="mini"
  126. placeholder="请输入申请用户编码"
  127. />
  128. </el-form-item>
  129. </el-col> -->
  130. </el-row>
  131. <el-row :gutter="24">
  132. <el-col :lg="4" :md="12" :sm="12" :xs="24">
  133. <el-form-item label="审批状态:">
  134. <el-tag :type="approvalStatusType(formData.approvalStatus)">
  135. {{ approvalStatusLabel(formData.approvalStatus) }}
  136. </el-tag>
  137. </el-form-item>
  138. </el-col>
  139. </el-row>
  140. <el-row>
  141. <el-col :span="24">
  142. <el-form-item label="备注:" prop="remark">
  143. <el-input
  144. v-model.trim="formData.remark"
  145. type="textarea"
  146. :rows="2"
  147. maxlength="500"
  148. show-word-limit
  149. placeholder="请输入备注"
  150. />
  151. </el-form-item>
  152. </el-col>
  153. </el-row>
  154. </el-form>
  155. </section>
  156. <section class="form-section detail-section">
  157. <div class="section-heading detail-heading">
  158. <div>
  159. <div class="section-title">
  160. <i class="el-icon-s-grid"></i>
  161. 需求明细
  162. <span class="section-count">{{ detailCount }}</span>
  163. </div>
  164. <div class="section-description"
  165. >维护物品、数量及期望到货日期</div
  166. >
  167. </div>
  168. <div v-if="!readOnly" class="detail-guide">
  169. <i class="el-icon-info"></i>
  170. 请先选择物品,仅数量、要求日期和物品类型可修改
  171. </div>
  172. </div>
  173. <ele-pro-table
  174. ref="detailTable"
  175. :columns="detailColumns"
  176. :datasource="formData.detailList"
  177. :need-page="false"
  178. :toolbar="!readOnly"
  179. class="detail-edit-table"
  180. row-key="_rowKey"
  181. height="360px"
  182. >
  183. <template v-if="!readOnly" v-slot:toolbar>
  184. <el-button
  185. type="primary"
  186. size="small"
  187. icon="el-icon-plus"
  188. class="ele-btn-icon"
  189. @click="addDetail"
  190. >
  191. 添加物品明细
  192. </el-button>
  193. </template>
  194. <template v-slot:quantity="{ row }">
  195. <el-input
  196. v-model="row.quantity"
  197. :disabled="readOnly"
  198. size="mini"
  199. inputmode="decimal"
  200. placeholder="请输入大于 0 的数量"
  201. class="w100"
  202. @input="handleQuantityInput($event, row)"
  203. @blur="handleQuantityBlur(row)"
  204. />
  205. </template>
  206. <template v-slot:requestDate="{ row }">
  207. <el-date-picker
  208. v-model="row.requestDate"
  209. :disabled="readOnly"
  210. type="date"
  211. size="mini"
  212. value-format="yyyy-MM-dd HH:mm:ss"
  213. placeholder="必填"
  214. class="w100"
  215. />
  216. </template>
  217. <template v-slot:type="{ row }">
  218. <el-select
  219. v-model="row.type"
  220. :disabled="readOnly"
  221. size="mini"
  222. class="w100"
  223. >
  224. <el-option label="默认" :value="0" />
  225. <el-option label="工装" :value="1" />
  226. </el-select>
  227. </template>
  228. <template v-slot:action="{ $index }">
  229. <el-link
  230. type="danger"
  231. :underline="false"
  232. icon="el-icon-delete"
  233. @click="removeDetail($index)"
  234. >
  235. 删除
  236. </el-link>
  237. </template>
  238. </ele-pro-table>
  239. </section>
  240. </el-tab-pane>
  241. <el-tab-pane v-if="showProcessTab" label="流程详情" name="process" lazy>
  242. <div class="process-detail-pane">
  243. <BpmDetail
  244. v-if="activeTab === 'process'"
  245. :key="formData.processInstanceId"
  246. :id="formData.processInstanceId"
  247. />
  248. </div>
  249. </el-tab-pane>
  250. </el-tabs>
  251. </div>
  252. <MaterialSelectDialog
  253. ref="materialSelectDialog"
  254. @confirm="handleMaterialSelected"
  255. />
  256. <div slot="footer" class="dialog-actions">
  257. <div class="action-hint">
  258. <i :class="readOnly ? 'el-icon-info' : 'el-icon-circle-check'"></i>
  259. {{ readOnly ? '当前为只读查看模式' : '保存前请确认需求明细准确无误' }}
  260. </div>
  261. <div>
  262. <el-button
  263. v-if="!readOnly"
  264. type="primary"
  265. icon="el-icon-check"
  266. :loading="submitting"
  267. @click="submit"
  268. >
  269. 保存申请单
  270. </el-button>
  271. <el-button @click="cancel">{{ readOnly ? '关闭' : '取消' }}</el-button>
  272. </div>
  273. </div>
  274. </ele-modal>
  275. </template>
  276. <script>
  277. import {
  278. getDemandApplicationById,
  279. saveDemandApplication,
  280. updateDemandApplication
  281. } from '@/api/demandApplication';
  282. import {
  283. approvalStatusLabel,
  284. approvalStatusType,
  285. canModifyApplication,
  286. createApplicationForm,
  287. createDetailRow,
  288. normalizeDateTime
  289. } from '../constants';
  290. import BpmDetail from '@/views/bpm/processInstance/detail.vue';
  291. import MaterialSelectDialog from './MaterialSelectDialog.vue';
  292. export default {
  293. name: 'DemandApplicationForm',
  294. components: {
  295. BpmDetail,
  296. MaterialSelectDialog
  297. },
  298. data() {
  299. return {
  300. visible: false,
  301. loading: false,
  302. submitting: false,
  303. mode: 'add',
  304. activeTab: 'application',
  305. formData: createApplicationForm(),
  306. rules: {
  307. applyTime: [
  308. { required: true, message: '请选择申请时间', trigger: 'change' }
  309. ],
  310. applyUnitCode: [
  311. { required: true, message: '请输入申请单位编码', trigger: 'blur' }
  312. ],
  313. applyUnitName: [
  314. { required: true, message: '请输入申请单位名称', trigger: 'blur' }
  315. ],
  316. applyUserCode: [
  317. { required: true, message: '请输入申请用户编码', trigger: 'blur' }
  318. ]
  319. }
  320. };
  321. },
  322. computed: {
  323. readOnly() {
  324. return this.mode === 'view';
  325. },
  326. showProcessTab() {
  327. return this.readOnly && Boolean(this.formData.processInstanceId);
  328. },
  329. title() {
  330. if (this.mode === 'view') return '查看需求申请单';
  331. if (this.mode === 'edit') return '修改需求申请单';
  332. return '新增需求申请单';
  333. },
  334. detailCount() {
  335. return Array.isArray(this.formData.detailList)
  336. ? this.formData.detailList.length
  337. : 0;
  338. },
  339. detailColumns() {
  340. return [
  341. {
  342. columnKey: 'index',
  343. type: 'index',
  344. label: '序号',
  345. width: 55,
  346. align: 'center',
  347. fixed: 'left'
  348. },
  349. // {
  350. // prop: 'lineNumber',
  351. // label: '行号',
  352. // width: 65,
  353. // align: 'center',
  354. // fixed: 'left'
  355. // },
  356. {
  357. prop: 'categoryCode',
  358. label: '物品编码',
  359. minWidth: 150,
  360. showOverflowTooltip: true
  361. },
  362. {
  363. prop: 'categoryName',
  364. label: '物品名称',
  365. minWidth: 160,
  366. showOverflowTooltip: true
  367. },
  368. // {
  369. // prop: 'categoryLevelPath',
  370. // label: '分类',
  371. // minWidth: 160,
  372. // showOverflowTooltip: true
  373. // },
  374. {
  375. prop: 'rootCategoryLevelId',
  376. label: '根级分类ID',
  377. minWidth: 135,
  378. showOverflowTooltip: true
  379. },
  380. {
  381. prop: 'specifications',
  382. label: '规格',
  383. minWidth: 130,
  384. showOverflowTooltip: true
  385. },
  386. {
  387. prop: 'modelType',
  388. label: '型号',
  389. minWidth: 130,
  390. showOverflowTooltip: true
  391. },
  392. {
  393. prop: 'quantity',
  394. label: '申请数量',
  395. width: 135,
  396. slot: 'quantity'
  397. },
  398. {
  399. prop: 'unit',
  400. label: '计量单位',
  401. width: 110,
  402. showOverflowTooltip: true
  403. },
  404. {
  405. prop: 'requestDate',
  406. label: '要求日期',
  407. width: 165,
  408. slot: 'requestDate'
  409. },
  410. {
  411. prop: 'type',
  412. label: '物品类型',
  413. width: 115,
  414. slot: 'type'
  415. },
  416. !this.readOnly
  417. ? {
  418. columnKey: 'action',
  419. label: '操作',
  420. width: 80,
  421. align: 'center',
  422. fixed: 'right',
  423. resizable: false,
  424. slot: 'action'
  425. }
  426. : ''
  427. ].filter(Boolean);
  428. }
  429. },
  430. methods: {
  431. approvalStatusLabel,
  432. approvalStatusType,
  433. async open(mode = 'add', row) {
  434. if (mode === 'edit' && !canModifyApplication(row)) {
  435. this.$message.warning('审核中或审核通过的申请单不能修改');
  436. return;
  437. }
  438. this.mode = mode;
  439. this.activeTab = 'application';
  440. this.formData = createApplicationForm();
  441. if (mode === 'add') {
  442. const userInfo = this.$store.getters.user.info || {};
  443. this.formData.applyUnitName = userInfo.groupName || '';
  444. this.formData.applyUnitCode =
  445. userInfo.groupCode || userInfo.groupId || '';
  446. }
  447. this.visible = true;
  448. this.clearValidate();
  449. if (!row || !row.id) {
  450. this.setDetailData(this.formData.detailList);
  451. return;
  452. }
  453. this.loading = true;
  454. try {
  455. const data = (await getDemandApplicationById(row.id)) || {};
  456. const detailList = Array.isArray(data.detailList)
  457. ? data.detailList.map((item, index) => ({
  458. ...createDetailRow(index),
  459. ...item,
  460. _rowKey: item.id || `${Date.now()}_${index}`,
  461. lineNumber: item.lineNumber || (index + 1) * 10,
  462. requestDate: normalizeDateTime(item.requestDate)
  463. }))
  464. : [];
  465. this.formData = {
  466. ...createApplicationForm(),
  467. ...data,
  468. applyTime: normalizeDateTime(data.applyTime),
  469. processInstanceId:
  470. data.processInstanceId || row.processInstanceId || '',
  471. detailList
  472. };
  473. this.setDetailData(detailList);
  474. this.clearValidate();
  475. } catch (error) {
  476. this.$message.error(error.message || '申请单详情加载失败');
  477. this.visible = false;
  478. } finally {
  479. this.loading = false;
  480. }
  481. },
  482. clearValidate() {
  483. this.$nextTick(() => {
  484. if (this.$refs.form) this.$refs.form.clearValidate();
  485. });
  486. },
  487. setDetailData(list) {
  488. this.$nextTick(() => {
  489. if (this.$refs.detailTable) {
  490. this.$refs.detailTable.setData([...(list || [])]);
  491. }
  492. });
  493. },
  494. getDetailData() {
  495. if (this.$refs.detailTable) {
  496. return this.$refs.detailTable.getData() || [];
  497. }
  498. return this.formData.detailList || [];
  499. },
  500. addDetail() {
  501. if (this.$refs.materialSelectDialog) {
  502. this.$refs.materialSelectDialog.open(this.getDetailData());
  503. }
  504. },
  505. handleMaterialSelected(materials) {
  506. const list = this.getDetailData();
  507. const existingIds = new Set(
  508. list
  509. .map((item) => item.categoryId)
  510. .filter(
  511. (item) => item !== undefined && item !== null && item !== ''
  512. )
  513. .map(String)
  514. );
  515. const existingCodes = new Set(
  516. list
  517. .map((item) => item.categoryCode)
  518. .filter(Boolean)
  519. .map(String)
  520. );
  521. const additions = (materials || [])
  522. .filter((item) => {
  523. const id =
  524. item.id !== undefined && item.id !== null ? String(item.id) : '';
  525. const code = item.code ? String(item.code) : '';
  526. return !existingIds.has(id) && !existingCodes.has(code);
  527. })
  528. .map((item, index) => ({
  529. ...createDetailRow(list.length + index),
  530. categoryCode: item.code || '',
  531. categoryId: item.id || '',
  532. categoryName: item.name || '',
  533. categoryLevelPath:
  534. item.categoryLevelPath || item.categoryLevelName || '',
  535. modelType: item.modelType || '',
  536. rootCategoryLevelId:
  537. item.rootCategoryLevelId || item.rootPathIdParent || '',
  538. specifications: item.specification || item.specifications || '',
  539. unit: item.measuringUnit || item.unit || ''
  540. }));
  541. if (!additions.length) {
  542. this.$message.warning('所选物料已存在于申请明细中');
  543. return;
  544. }
  545. const result = [...list, ...additions];
  546. this.reorderDetails(result);
  547. this.formData.detailList = result;
  548. this.setDetailData(result);
  549. this.$message.success('已添加 ' + additions.length + ' 项物料');
  550. },
  551. handleQuantityInput(value, row) {
  552. let quantity = String(
  553. value === undefined || value === null ? '' : value
  554. ).replace(/[^\d.]/g, '');
  555. const dotIndex = quantity.indexOf('.');
  556. if (dotIndex !== -1) {
  557. quantity =
  558. quantity.slice(0, dotIndex + 1) +
  559. quantity.slice(dotIndex + 1).replace(/\./g, '');
  560. }
  561. if (quantity.startsWith('.')) quantity = '0' + quantity;
  562. quantity = quantity.replace(/^0+(?=\d)/, '');
  563. row.quantity = quantity;
  564. },
  565. handleQuantityBlur(row) {
  566. const quantity = String(row.quantity || '').replace(/\.$/, '');
  567. row.quantity = Number(quantity) > 0 ? quantity : 1;
  568. },
  569. removeDetail(index) {
  570. const list = this.getDetailData();
  571. list.splice(index, 1);
  572. this.reorderDetails(list);
  573. this.formData.detailList = [...list];
  574. this.setDetailData(list);
  575. },
  576. reorderDetails(list) {
  577. list.forEach((item, index) => {
  578. item.lineNumber = (index + 1) * 10;
  579. });
  580. },
  581. validateDetails(list) {
  582. if (!list.length) {
  583. this.$message.warning('请至少添加一条物品明细');
  584. return false;
  585. }
  586. for (let index = 0; index < list.length; index += 1) {
  587. const item = list[index];
  588. const rowNumber = index + 1;
  589. if (!item.categoryCode) {
  590. this.$message.warning(`第 ${rowNumber} 行:请输入物品编码`);
  591. return false;
  592. }
  593. if (!item.categoryName) {
  594. this.$message.warning(`第 ${rowNumber} 行:请输入物品名称`);
  595. return false;
  596. }
  597. if (
  598. item.quantity === '' ||
  599. item.quantity === null ||
  600. !/^\d+(\.\d+)?$/.test(String(item.quantity)) ||
  601. Number(item.quantity) <= 0
  602. ) {
  603. this.$message.warning(`第 ${rowNumber} 行:申请数量必须大于 0`);
  604. return false;
  605. }
  606. if (!item.requestDate) {
  607. this.$message.warning(`第 ${rowNumber} 行:请选择要求日期`);
  608. return false;
  609. }
  610. }
  611. return true;
  612. },
  613. submit() {
  614. this.$refs.form.validate(async (valid) => {
  615. if (!valid) return;
  616. const detailList = this.getDetailData();
  617. if (!this.validateDetails(detailList)) return;
  618. this.submitting = true;
  619. try {
  620. this.reorderDetails(detailList);
  621. const payload = this.buildPayload(detailList);
  622. if (this.formData.id) {
  623. await updateDemandApplication(payload);
  624. this.$message.success('修改成功');
  625. } else {
  626. await saveDemandApplication(payload);
  627. this.$message.success('新增成功');
  628. }
  629. this.visible = false;
  630. this.$emit('success');
  631. } catch (error) {
  632. this.$message.error(error.message || '保存失败');
  633. } finally {
  634. this.submitting = false;
  635. }
  636. });
  637. },
  638. buildPayload(detailList) {
  639. const payload = {
  640. applyCode: this.formData.applyCode,
  641. applyTime: this.formData.applyTime,
  642. applyUnitCode: this.formData.applyUnitCode,
  643. applyUnitName: this.formData.applyUnitName,
  644. applyUserCode: this.formData.applyUserCode,
  645. approvalStatus: Number(this.formData.approvalStatus || 0),
  646. detailList: detailList.map((item, index) => ({
  647. categoryCode: item.categoryCode,
  648. categoryId: item.categoryId || null,
  649. categoryName: item.categoryName,
  650. categoryLevelPath: item.categoryLevelPath || '',
  651. lineNumber: (index + 1) * 10,
  652. modelType: item.modelType,
  653. quantity: Number(item.quantity),
  654. requestDate: item.requestDate,
  655. rootCategoryLevelId: item.rootCategoryLevelId || null,
  656. specifications: item.specifications,
  657. type: Number(item.type || 0),
  658. unit: item.unit
  659. })),
  660. processInstanceId: this.formData.processInstanceId || '',
  661. remark: this.formData.remark,
  662. type: Number(this.formData.type || 0)
  663. };
  664. if (this.formData.id) payload.id = this.formData.id;
  665. return payload;
  666. },
  667. cancel() {
  668. this.visible = false;
  669. this.loading = false;
  670. this.submitting = false;
  671. this.activeTab = 'application';
  672. this.formData = createApplicationForm();
  673. }
  674. }
  675. };
  676. </script>
  677. <style lang="scss" scoped>
  678. .w100 {
  679. width: 100%;
  680. }
  681. .detail-tabs {
  682. min-height: 420px;
  683. }
  684. .process-detail-pane {
  685. min-height: 500px;
  686. padding: 2px 0 8px;
  687. border-radius: 10px;
  688. background: #f4f7fb;
  689. }
  690. ::v-deep .detail-tabs > .el-tabs__header {
  691. margin: 0 0 14px;
  692. padding: 0 14px;
  693. border: 1px solid #dce7f1;
  694. border-radius: 10px;
  695. background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  696. box-shadow: 0 4px 12px rgba(31, 45, 61, 0.04);
  697. }
  698. ::v-deep .detail-tabs > .el-tabs__header .el-tabs__nav-wrap::after {
  699. height: 0;
  700. }
  701. ::v-deep .detail-tabs > .el-tabs__header .el-tabs__item {
  702. height: 46px;
  703. padding: 0 24px;
  704. color: #60758a;
  705. font-size: 14px;
  706. font-weight: 600;
  707. line-height: 46px;
  708. }
  709. ::v-deep .detail-tabs > .el-tabs__header .el-tabs__item:hover {
  710. color: #1684df;
  711. }
  712. ::v-deep .detail-tabs > .el-tabs__header .el-tabs__item.is-active {
  713. color: #1478c9;
  714. }
  715. ::v-deep .detail-tabs > .el-tabs__header .el-tabs__active-bar {
  716. height: 3px;
  717. border-radius: 3px 3px 0 0;
  718. background: linear-gradient(90deg, #1f8ceb 0%, #16b8a6 100%);
  719. }
  720. ::v-deep .detail-tabs--form > .el-tabs__header {
  721. display: none;
  722. }
  723. ::v-deep .process-detail-pane .app-container {
  724. padding: 0 !important;
  725. background: transparent;
  726. }
  727. ::v-deep .process-detail-pane .box-card {
  728. margin-bottom: 14px;
  729. overflow: hidden;
  730. border: 1px solid #dfe8f1;
  731. border-radius: 10px;
  732. box-shadow: 0 5px 16px rgba(31, 45, 61, 0.05);
  733. }
  734. ::v-deep .process-detail-pane .box-card > .el-card__header {
  735. padding: 14px 18px;
  736. border-bottom: 1px solid #e5edf5;
  737. background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  738. color: #263f56;
  739. font-weight: 700;
  740. }
  741. .demand-form {
  742. padding: 4px 0 0;
  743. }
  744. .application-form-layout {
  745. min-height: 420px;
  746. }
  747. .form-overview {
  748. display: flex;
  749. align-items: center;
  750. justify-content: space-between;
  751. min-height: 68px;
  752. margin-bottom: 12px;
  753. padding: 11px 16px;
  754. box-sizing: border-box;
  755. border: 1px solid #d9e8f5;
  756. border-radius: 10px;
  757. background: radial-gradient(
  758. circle at 92% 0,
  759. rgba(22, 184, 166, 0.1),
  760. transparent 30%
  761. ),
  762. linear-gradient(105deg, #f2f9ff 0%, #ffffff 64%, #f3fcfa 100%);
  763. }
  764. .overview-identity {
  765. display: flex;
  766. align-items: center;
  767. min-width: 0;
  768. }
  769. .overview-icon {
  770. display: flex;
  771. align-items: center;
  772. justify-content: center;
  773. flex: 0 0 40px;
  774. width: 40px;
  775. height: 40px;
  776. margin-right: 11px;
  777. border-radius: 10px;
  778. background: linear-gradient(145deg, #258fdf 0%, #16a8a0 100%);
  779. color: #fff;
  780. font-size: 19px;
  781. box-shadow: 0 6px 14px rgba(31, 140, 235, 0.2);
  782. }
  783. .overview-label {
  784. color: #708196;
  785. font-size: 12px;
  786. line-height: 18px;
  787. }
  788. .overview-code {
  789. overflow: hidden;
  790. max-width: 360px;
  791. color: #1d3449;
  792. font-size: 17px;
  793. font-weight: 700;
  794. line-height: 24px;
  795. white-space: nowrap;
  796. text-overflow: ellipsis;
  797. }
  798. .overview-meta {
  799. display: flex;
  800. align-items: center;
  801. gap: 20px;
  802. }
  803. .meta-item {
  804. display: flex;
  805. flex-direction: column;
  806. align-items: flex-end;
  807. min-width: 70px;
  808. }
  809. .meta-item--unit {
  810. min-width: 260px;
  811. max-width: 420px;
  812. }
  813. .meta-label {
  814. color: #98a2b3;
  815. font-size: 11px;
  816. line-height: 18px;
  817. }
  818. .meta-value {
  819. overflow: hidden;
  820. max-width: 180px;
  821. color: #344054;
  822. font-size: 13px;
  823. font-weight: 600;
  824. line-height: 20px;
  825. white-space: nowrap;
  826. text-overflow: ellipsis;
  827. }
  828. .meta-value--number {
  829. color: #1478c9;
  830. font-size: 17px;
  831. }
  832. .meta-value--unit {
  833. overflow: visible;
  834. max-width: 420px;
  835. white-space: normal;
  836. text-align: right;
  837. word-break: break-all;
  838. text-overflow: clip;
  839. }
  840. .overview-status {
  841. display: inline-flex;
  842. align-items: center;
  843. height: 28px;
  844. padding: 0 12px;
  845. border-radius: 15px;
  846. font-weight: 600;
  847. }
  848. .overview-status__dot {
  849. width: 7px;
  850. height: 7px;
  851. margin-right: 6px;
  852. border-radius: 50%;
  853. background: currentColor;
  854. }
  855. .form-section {
  856. margin-bottom: 12px;
  857. padding: 0 14px 10px;
  858. overflow: hidden;
  859. border: 1px solid #e1eaf3;
  860. border-radius: 10px;
  861. background: #fff;
  862. }
  863. .section-heading {
  864. display: flex;
  865. align-items: center;
  866. justify-content: space-between;
  867. min-height: 49px;
  868. margin: 0 -14px 10px;
  869. padding: 7px 14px;
  870. box-sizing: border-box;
  871. border-bottom: 1px solid #e5edf5;
  872. background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
  873. }
  874. .section-title {
  875. display: flex;
  876. align-items: center;
  877. color: #263f56;
  878. font-size: 14px;
  879. font-weight: 700;
  880. line-height: 21px;
  881. }
  882. .section-title > i {
  883. margin-right: 7px;
  884. color: #1684df;
  885. font-size: 15px;
  886. }
  887. .section-description {
  888. margin-left: 22px;
  889. color: #98a2b3;
  890. font-size: 11px;
  891. line-height: 17px;
  892. }
  893. .section-count {
  894. display: inline-flex;
  895. align-items: center;
  896. justify-content: center;
  897. min-width: 24px;
  898. height: 20px;
  899. margin-left: 8px;
  900. padding: 0 6px;
  901. border-radius: 10px;
  902. background: #e2f2ff;
  903. color: #1478c9;
  904. font-size: 12px;
  905. }
  906. .required-hint,
  907. .detail-guide {
  908. color: #8291a3;
  909. font-size: 11px;
  910. }
  911. .required-hint i {
  912. display: inline-block;
  913. width: 6px;
  914. height: 6px;
  915. margin-right: 4px;
  916. border-radius: 50%;
  917. background: #ef5b5b;
  918. }
  919. .detail-guide i {
  920. margin-right: 4px;
  921. color: #f59e0b;
  922. }
  923. .detail-section {
  924. padding-bottom: 8px;
  925. }
  926. .dialog-actions {
  927. display: flex;
  928. align-items: center;
  929. justify-content: space-between;
  930. width: 100%;
  931. }
  932. .action-hint {
  933. color: #78889b;
  934. font-size: 12px;
  935. }
  936. .action-hint i {
  937. margin-right: 5px;
  938. color: #16a66a;
  939. }
  940. ::v-deep .el-input-number .el-input__inner {
  941. text-align: left;
  942. }
  943. ::v-deep .demand-form .el-form-item {
  944. margin-bottom: 14px;
  945. }
  946. ::v-deep .demand-form .el-form-item__label {
  947. box-sizing: border-box;
  948. padding-right: 12px;
  949. color: #53677a;
  950. font-size: 13px;
  951. font-weight: 600;
  952. line-height: 28px;
  953. white-space: nowrap;
  954. }
  955. ::v-deep .demand-form .el-form-item__content {
  956. min-width: 0;
  957. line-height: 28px;
  958. }
  959. ::v-deep .demand-form .el-input__inner,
  960. ::v-deep .demand-form .el-textarea__inner {
  961. border-color: #dce6f0;
  962. border-radius: 7px;
  963. transition: border-color 0.18s ease, box-shadow 0.18s ease;
  964. }
  965. ::v-deep .demand-form .el-input__inner:hover,
  966. ::v-deep .demand-form .el-textarea__inner:hover {
  967. border-color: #a9cce8;
  968. }
  969. ::v-deep .detail-edit-table .ele-pro-table-toolbar {
  970. min-height: 44px;
  971. padding: 6px 9px;
  972. border: 1px solid #dce7f1;
  973. border-bottom: 0;
  974. border-radius: 8px 8px 0 0;
  975. background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  976. }
  977. ::v-deep .detail-edit-table .el-table {
  978. border-color: #dce7f1;
  979. color: #344054;
  980. font-size: 12px;
  981. }
  982. ::v-deep .detail-edit-table .el-table th.el-table__cell {
  983. height: 42px;
  984. padding: 6px 0;
  985. border-bottom-color: #d9e5ef;
  986. background: linear-gradient(180deg, #f8fbff 0%, #edf4fa 100%);
  987. color: #2d4458;
  988. font-weight: 700;
  989. }
  990. ::v-deep .detail-edit-table .el-table td.el-table__cell {
  991. padding: 6px 0;
  992. border-bottom-color: #edf1f5;
  993. }
  994. ::v-deep .detail-edit-table .el-table__row:hover > td.el-table__cell {
  995. background: #f5faff;
  996. }
  997. ::v-deep .detail-edit-table .el-input__inner {
  998. border-color: #dfe7ef;
  999. border-radius: 6px;
  1000. background: #fbfdff;
  1001. }
  1002. ::v-deep .detail-edit-table .el-input__inner:focus {
  1003. border-color: #1f8ceb;
  1004. background: #fff;
  1005. box-shadow: 0 0 0 2px rgba(31, 140, 235, 0.08);
  1006. }
  1007. ::v-deep .detail-edit-table .el-button {
  1008. border-radius: 7px;
  1009. font-weight: 600;
  1010. }
  1011. @media (max-width: 1000px) {
  1012. .form-overview {
  1013. align-items: flex-start;
  1014. flex-direction: column;
  1015. }
  1016. .overview-meta {
  1017. width: calc(100% - 51px);
  1018. margin-top: 10px;
  1019. margin-left: 51px;
  1020. }
  1021. .meta-item--unit {
  1022. flex: 1;
  1023. min-width: 0;
  1024. }
  1025. }
  1026. @media (max-width: 768px) {
  1027. ::v-deep .demand-form .el-form-item__label {
  1028. width: 124px !important;
  1029. }
  1030. ::v-deep .demand-form .el-form-item__content {
  1031. margin-left: 124px !important;
  1032. }
  1033. }
  1034. </style>
  1035. <style lang="scss">
  1036. .demand-application-dialog.el-dialog {
  1037. overflow: hidden;
  1038. border: 1px solid #d7e4ef;
  1039. border-radius: 12px;
  1040. background: #f3f7fb;
  1041. box-shadow: 0 22px 64px rgba(15, 36, 54, 0.2);
  1042. .el-dialog__header {
  1043. padding: 13px 18px;
  1044. border-bottom: 1px solid #dce7f1;
  1045. background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  1046. }
  1047. .el-dialog__title {
  1048. color: #1d3449;
  1049. font-size: 16px;
  1050. font-weight: 700;
  1051. }
  1052. .el-dialog__body {
  1053. max-height: calc(100vh - 180px);
  1054. padding: 10px 12px;
  1055. overflow: auto;
  1056. background: radial-gradient(
  1057. circle at 12% 0,
  1058. rgba(31, 140, 235, 0.055),
  1059. transparent 24%
  1060. ),
  1061. #f3f7fb;
  1062. }
  1063. .el-dialog__footer {
  1064. padding: 9px 16px;
  1065. border-top: 1px solid #dce7f1;
  1066. background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  1067. }
  1068. .el-dialog__footer .el-button {
  1069. min-width: 88px;
  1070. border-radius: 7px;
  1071. font-weight: 600;
  1072. }
  1073. .el-dialog__footer .el-button--primary {
  1074. border-color: #1684df;
  1075. background: linear-gradient(180deg, #299af0 0%, #1684df 100%);
  1076. box-shadow: 0 4px 10px rgba(31, 140, 235, 0.2);
  1077. }
  1078. }
  1079. </style>