一单四制优化及加入工作流

This commit is contained in:
王利强
2026-07-27 09:27:22 +08:00
parent 455fd4fc07
commit 7c3285ed5a
725 changed files with 19668 additions and 2921 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"FlowAssigneeTree.js","sources":["components/flow/FlowAssigneeTree.vue","F:/software/HBuilderX/HBuilderX/plugins/uniapp-cli-vite/uniComponent:/RTovaGV4aWV5dW4vVGhyZWVDaGVja3NPbmVFeHBvc3VyZV9wbGF0Zm9ybS8xMi4wN2Nob25ncWl4aW5kZS_kuInmn6XkuIDmm53lhYnlsI_nqIvluo8vdGhyZWVvbmVjaGVja1_lsI_nqIvluo8vY29tcG9uZW50cy9mbG93L0Zsb3dBc3NpZ25lZVRyZWUudnVl"],"sourcesContent":["<template>\r\n\t<view class=\"assignee-tree\">\r\n\t\t<template v-for=\"row in flatRows\" :key=\"row.key\">\r\n\t\t\t<view\r\n\t\t\t\tv-if=\"row.type === 'dept'\"\r\n\t\t\t\tclass=\"dept-node\"\r\n\t\t\t\t:style=\"{ paddingLeft: `${row.level * 24 + 20}rpx` }\"\r\n\t\t\t>\r\n\t\t\t\t<text class=\"dept-name\">{{ row.deptName }}</text>\r\n\t\t\t</view>\r\n\t\t\t<view\r\n\t\t\t\tv-else\r\n\t\t\t\tclass=\"user-item\"\r\n\t\t\t\t:class=\"{ active: String(selectedIdentityId) === String(resolveAssigneeIdentityId(row.user)) }\"\r\n\t\t\t\t:style=\"{ paddingLeft: `${row.level * 24 + 20}rpx` }\"\r\n\t\t\t\t@click=\"handleSelect(row.user)\"\r\n\t\t\t>\r\n\t\t\t\t<text class=\"user-item-text\">{{ formatAssigneeDisplayName(row.user) }}</text>\r\n\t\t\t\t<text\r\n\t\t\t\t\tv-if=\"String(selectedIdentityId) === String(resolveAssigneeIdentityId(row.user))\"\r\n\t\t\t\t\tclass=\"cuIcon-check text-blue\"\r\n\t\t\t\t></text>\r\n\t\t\t</view>\r\n\t\t</template>\r\n\t</view>\r\n</template>\r\n\r\n<script setup>\r\nimport { computed } from 'vue';\r\nimport {\r\n\tflattenApproverDeptTree,\r\n\tformatAssigneeDisplayName,\r\n\tresolveAssigneeIdentityId\r\n} from './flowAssigneeUtils.js';\r\n\r\nconst props = defineProps({\r\n\tdepts: {\r\n\t\ttype: Array,\r\n\t\tdefault: () => []\r\n\t},\r\n\tselectedIdentityId: {\r\n\t\ttype: String,\r\n\t\tdefault: ''\r\n\t}\r\n});\r\n\r\nconst emit = defineEmits(['select']);\r\n\r\nconst flatRows = computed(() => flattenApproverDeptTree(props.depts));\r\n\r\nconst handleSelect = (user) => {\r\n\temit('select', user);\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.dept-node {\r\n\tpadding: 20rpx 20rpx 12rpx;\r\n\tfont-size: 26rpx;\r\n\tcolor: #909399;\r\n\tline-height: 1.4;\r\n}\r\n\r\n.dept-name {\r\n\tfont-weight: 600;\r\n}\r\n\r\n.user-item {\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tjustify-content: space-between;\r\n\tpadding: 24rpx 20rpx;\r\n\tborder-bottom: 1rpx solid #f5f5f5;\r\n\r\n\t&.active {\r\n\t\t.user-item-text {\r\n\t\t\tcolor: #2667E9;\r\n\t\t\tfont-weight: 600;\r\n\t\t}\r\n\t}\r\n\r\n\t.user-item-text {\r\n\t\tflex: 1;\r\n\t\tfont-size: 28rpx;\r\n\t\tcolor: #333;\r\n\t}\r\n}\r\n</style>\r\n","import Component from 'E:/hexieyun/ThreeChecksOneExposure_platform/12.07chongqixinde/三查一曝光小程序/threeonecheck_小程序/components/flow/FlowAssigneeTree.vue'\nwx.createComponent(Component)"],"names":["computed","flattenApproverDeptTree"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,UAAM,QAAQ;AAWd,UAAM,OAAO;AAEb,UAAM,WAAWA,cAAQ,SAAC,MAAMC,kCAAAA,wBAAwB,MAAM,KAAK,CAAC;AAEpE,UAAM,eAAe,CAAC,SAAS;AAC9B,WAAK,UAAU,IAAI;AAAA,IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;ACnDA,GAAG,gBAAgB,SAAS;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"flowAssigneeUtils.js","sources":["components/flow/flowAssigneeUtils.js"],"sourcesContent":["export const resolveAssigneeIdentityId = (user) => {\r\n\tif (!user) return '';\r\n\tconst id = user.identityId ?? user.userIdentityId ?? user.userId ?? '';\r\n\treturn id === '' || id == null ? '' : String(id);\r\n};\r\n\r\nexport const getAssigneeItemKey = (user) => {\r\n\tconst identityId = resolveAssigneeIdentityId(user);\r\n\tif (identityId) return `identity-${identityId}`;\r\n\treturn `user-${user.userId || user.nickName || ''}`;\r\n};\r\n\r\nexport const formatAssigneeDisplayName = (user) => {\r\n\tif (!user) return '';\r\n\tif (user.identityName) {\r\n\t\treturn `${user.nickName || user.userName || ''}_${user.identityName}`;\r\n\t}\r\n\tif (user.postName) {\r\n\t\treturn `${user.nickName || user.userName || ''}_${user.postName}`;\r\n\t}\r\n\treturn user.nickName || user.userName || user.name || '未知人员';\r\n};\r\n\r\nexport const normalizeApproverDeptTree = (data) => {\r\n\tif (!data) return [];\r\n\tif (Array.isArray(data)) return data;\r\n\tif (Array.isArray(data.records)) return data.records;\r\n\tif (Array.isArray(data.list)) return data.list;\r\n\treturn [];\r\n};\r\n\r\nexport const findAssigneeUserInDeptTree = (depts, identityId) => {\r\n\tif (!identityId || !Array.isArray(depts)) return null;\r\n\tfor (const dept of depts) {\r\n\t\tconst user = (dept.users || []).find(\r\n\t\t\t(item) => String(resolveAssigneeIdentityId(item)) === String(identityId)\r\n\t\t);\r\n\t\tif (user) return user;\r\n\t\tif (dept.children?.length) {\r\n\t\t\tconst found = findAssigneeUserInDeptTree(dept.children, identityId);\r\n\t\t\tif (found) return found;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\n/** 将部门树拍平为可渲染行(部门标题 + 人员),避免小程序递归组件不展示子部门 */\r\nexport const flattenApproverDeptTree = (depts, level = 0) => {\r\n\tconst rows = [];\r\n\tif (!Array.isArray(depts)) return rows;\r\n\tfor (const dept of depts) {\r\n\t\trows.push({\r\n\t\t\ttype: 'dept',\r\n\t\t\tkey: `dept-${dept.deptId ?? dept.deptName ?? level}`,\r\n\t\t\tdeptName: dept.deptName || '',\r\n\t\t\tlevel\r\n\t\t});\r\n\t\tfor (const user of dept.users || []) {\r\n\t\t\trows.push({\r\n\t\t\t\ttype: 'user',\r\n\t\t\t\tkey: getAssigneeItemKey(user),\r\n\t\t\t\tuser,\r\n\t\t\t\tlevel: level + 1\r\n\t\t\t});\r\n\t\t}\r\n\t\tif (dept.children?.length) {\r\n\t\t\trows.push(...flattenApproverDeptTree(dept.children, level + 1));\r\n\t\t}\r\n\t}\r\n\treturn rows;\r\n};\r\n"],"names":[],"mappings":";AAAY,MAAC,4BAA4B,CAAC,SAAS;AAClD,MAAI,CAAC;AAAM,WAAO;AAClB,QAAM,KAAK,KAAK,cAAc,KAAK,kBAAkB,KAAK,UAAU;AACpE,SAAO,OAAO,MAAM,MAAM,OAAO,KAAK,OAAO,EAAE;AAChD;AAEO,MAAM,qBAAqB,CAAC,SAAS;AAC3C,QAAM,aAAa,0BAA0B,IAAI;AACjD,MAAI;AAAY,WAAO,YAAY,UAAU;AAC7C,SAAO,QAAQ,KAAK,UAAU,KAAK,YAAY,EAAE;AAClD;AAEY,MAAC,4BAA4B,CAAC,SAAS;AAClD,MAAI,CAAC;AAAM,WAAO;AAClB,MAAI,KAAK,cAAc;AACtB,WAAO,GAAG,KAAK,YAAY,KAAK,YAAY,EAAE,IAAI,KAAK,YAAY;AAAA,EACnE;AACD,MAAI,KAAK,UAAU;AAClB,WAAO,GAAG,KAAK,YAAY,KAAK,YAAY,EAAE,IAAI,KAAK,QAAQ;AAAA,EAC/D;AACD,SAAO,KAAK,YAAY,KAAK,YAAY,KAAK,QAAQ;AACvD;AAEY,MAAC,4BAA4B,CAAC,SAAS;AAClD,MAAI,CAAC;AAAM,WAAO;AAClB,MAAI,MAAM,QAAQ,IAAI;AAAG,WAAO;AAChC,MAAI,MAAM,QAAQ,KAAK,OAAO;AAAG,WAAO,KAAK;AAC7C,MAAI,MAAM,QAAQ,KAAK,IAAI;AAAG,WAAO,KAAK;AAC1C,SAAO;AACR;AAEY,MAAC,6BAA6B,CAAC,OAAO,eAAe;;AAChE,MAAI,CAAC,cAAc,CAAC,MAAM,QAAQ,KAAK;AAAG,WAAO;AACjD,aAAW,QAAQ,OAAO;AACzB,UAAM,QAAQ,KAAK,SAAS,CAAE,GAAE;AAAA,MAC/B,CAAC,SAAS,OAAO,0BAA0B,IAAI,CAAC,MAAM,OAAO,UAAU;AAAA,IAC1E;AACE,QAAI;AAAM,aAAO;AACjB,SAAI,UAAK,aAAL,mBAAe,QAAQ;AAC1B,YAAM,QAAQ,2BAA2B,KAAK,UAAU,UAAU;AAClE,UAAI;AAAO,eAAO;AAAA,IAClB;AAAA,EACD;AACD,SAAO;AACR;AAGY,MAAC,0BAA0B,CAAC,OAAO,QAAQ,MAAM;;AAC5D,QAAM,OAAO,CAAA;AACb,MAAI,CAAC,MAAM,QAAQ,KAAK;AAAG,WAAO;AAClC,aAAW,QAAQ,OAAO;AACzB,SAAK,KAAK;AAAA,MACT,MAAM;AAAA,MACN,KAAK,QAAQ,KAAK,UAAU,KAAK,YAAY,KAAK;AAAA,MAClD,UAAU,KAAK,YAAY;AAAA,MAC3B;AAAA,IACH,CAAG;AACD,eAAW,QAAQ,KAAK,SAAS,CAAA,GAAI;AACpC,WAAK,KAAK;AAAA,QACT,MAAM;AAAA,QACN,KAAK,mBAAmB,IAAI;AAAA,QAC5B;AAAA,QACA,OAAO,QAAQ;AAAA,MACnB,CAAI;AAAA,IACD;AACD,SAAI,UAAK,aAAL,mBAAe,QAAQ;AAC1B,WAAK,KAAK,GAAG,wBAAwB,KAAK,UAAU,QAAQ,CAAC,CAAC;AAAA,IAC9D;AAAA,EACD;AACD,SAAO;AACR;;;;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"processChainLabels.js","sources":["components/hazardDetail/processChainLabels.js"],"sourcesContent":["export const CHAIN_LABELS = {\r\n\tloading: '加载中...',\r\n\tempty: '暂无流程记录',\r\n\tpersonnelSuffix: '人员:',\r\n\thazardCode: '隐患编号',\r\n\thazardTitle: '隐患标题',\r\n\tcheckSource: '检查形式',\r\n\thazardSource: '隐患来源',\r\n\thazardArea: '隐患区域',\r\n\taddress: '位置描述',\r\n\thazardLevel: '隐患等级',\r\n\thazardTag: '隐患标签',\r\n\tdescription: '问题描述',\r\n\thazardAttachments: '隐患附件',\r\n\tlegalBasis: '参考法规',\r\n\tassigneeName: '指定整改责任人',\r\n\tassignDeadline: '指定整改截至日期',\r\n\tassignStatus: '交办状态',\r\n\trectifyStatus: '整改状态',\r\n\trectifyPlan: '整改方案',\r\n\trectifyResult: '整改结果',\r\n\trectifyMeasures: '整改措施',\r\n\tcontrolMeasures: '管控措施',\r\n\trectifierName: '整改责任人',\r\n\tmanagerNames: '管理人员',\r\n\tmemberNames: '整改成员',\r\n\tplanCost: '预计费用',\r\n\tactualCost: '实际费用',\r\n\trectifyAttachments: '整改附件',\r\n\trectifySign: '整改签字',\r\n\tverifyResult: '验收结果',\r\n\tpass: '通过',\r\n\tverifyRemark: '验收备注',\r\n\tverifyAttachments: '验收附件',\r\n\tverifySign: '验收签字',\r\n\twriteoffDeadline: '整改时限',\r\n\tresponsibleDept: '治理责任单位',\r\n\tresponsiblePerson: '主要负责人',\r\n\tmainTreatment: '主要治理内容',\r\n\ttreatmentResult: '治理完成内容',\r\n\tselfVerify: '自行验收情况',\r\n\tapplySign: '申请签字',\r\n\tapprovalOpinion: '审批意见',\r\n\tapprovalComment: '意见说明',\r\n\tsmsReminder: '短信提醒',\r\n\tyes: '是',\r\n\tno: '否',\r\n\tapprovalSign: '审批签字',\r\n\tattachmentFallback: '附件',\r\n\tyuan: '元'\r\n};\r\n\r\nexport const LEVEL_NAME_CLASS_MAP = {\r\n\t一般: 'level-normal',\r\n\t一般隐患: 'level-normal',\r\n\t重大: 'level-major',\r\n\t重大隐患: 'level-major'\r\n};\r\n"],"names":[],"mappings":";AAAY,MAAC,eAAe;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,MAAM;AAAA,EACN,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM;AACP;AAEY,MAAC,uBAAuB;AAAA,EACnC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AACP;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"identity.js","sources":["request/identity.js"],"sourcesContent":["import { requestAPI } from './request.js';\r\n\r\n/** 获取当前用户身份列表及当前生效身份 */\r\nexport function getMyIdentity() {\r\n\treturn requestAPI({\r\n\t\turl: '/system/identity/my',\r\n\t\tmethod: 'GET'\r\n\t});\r\n}\r\n\r\n/** 切换当前用户身份 */\r\nexport function switchIdentity(identityId) {\r\n\treturn requestAPI({\r\n\t\turl: '/system/identity/switch',\r\n\t\tmethod: 'POST',\r\n\t\tdata: { identityId }\r\n\t});\r\n}\r\n\r\n/** 设置默认身份 */\r\nexport function setDefaultIdentity(identityId) {\r\n\treturn requestAPI({\r\n\t\turl: `/system/identity/setDefault/${identityId}`,\r\n\t\tmethod: 'PUT'\r\n\t});\r\n}\r\n"],"names":["requestAPI"],"mappings":";;AAGO,SAAS,gBAAgB;AAC/B,SAAOA,2BAAW;AAAA,IACjB,KAAK;AAAA,IACL,QAAQ;AAAA,EACV,CAAE;AACF;AAGO,SAAS,eAAe,YAAY;AAC1C,SAAOA,2BAAW;AAAA,IACjB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM,EAAE,WAAY;AAAA,EACtB,CAAE;AACF;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"draftCache.js","sources":["utils/draftCache.js"],"sourcesContent":["/** 草稿 Storage 命名空间(统一 key 前缀) */\nexport const DRAFT_NS = {\n\tASSIGN: 'draft_assign',\n\tACCEPT: 'draft_accept',\n\tRECTIFY: 'draft_rectify',\n\tINSPECTION_RESULT: 'draft_inspection_result',\n\tINSPECTION_SHEET: 'draft_inspection_sheet',\n\tHAZARD_ADD: 'draft_hazard_add'\n};\n\n/**\n * 构建草稿 Storage key与迁移前页面逻辑一致保留空片段\n * 例draft_rectify_100_ 、draft_accept_\n * @param {string} namespace 命名空间,如 DRAFT_NS.ASSIGN\n * @param {...string|number} parts 业务 id 片段\n */\nexport function buildDraftKey(namespace, ...parts) {\n\treturn [namespace, ...parts.map((p) => String(p ?? ''))].join('_');\n}\n\n/** 迁移期 compact key曾错误地 filter 掉空片段) */\nexport function buildDraftKeyCompact(namespace, ...parts) {\n\treturn [namespace, ...parts.map((p) => String(p ?? '')).filter(Boolean)].join('_');\n}\n\n/**\n * 读取草稿,支持回退到其它 key迁移兼容\n * @param {string} primaryKey\n * @param {string[]} [fallbackKeys]\n */\nexport function loadDraftWithFallback(primaryKey, fallbackKeys = []) {\n\tconst primary = loadDraft(primaryKey);\n\tif (primary) {\n\t\treturn { data: primary, key: primaryKey, fromFallback: false };\n\t}\n\n\tfor (const fallbackKey of fallbackKeys) {\n\t\tif (!fallbackKey || fallbackKey === primaryKey) continue;\n\t\tconst fallback = loadDraft(fallbackKey);\n\t\tif (fallback) {\n\t\t\treturn { data: fallback, key: primaryKey, fromFallback: true, fallbackKey };\n\t\t}\n\t}\n\n\treturn { data: null, key: primaryKey, fromFallback: false };\n}\n\n/**\n * 读取草稿\n * @param {string} key\n * @returns {Object|null}\n */\nexport function loadDraft(key) {\n\tif (!key) return null;\n\n\tconst raw = uni.getStorageSync(key);\n\tif (!raw) return null;\n\n\ttry {\n\t\treturn typeof raw === 'string' ? JSON.parse(raw) : raw;\n\t} catch (error) {\n\t\tconsole.error('[draftCache] 解析草稿失败:', key, error);\n\t\treturn null;\n\t}\n}\n\n/**\n * 写入草稿\n * @param {string} key\n * @param {Object} data\n */\nexport function saveDraftToStorage(key, data) {\n\tif (!key) return;\n\n\tuni.setStorageSync(\n\t\tkey,\n\t\tJSON.stringify({\n\t\t\t...data,\n\t\t\tupdatedAt: Date.now()\n\t\t})\n\t);\n}\n\n/**\n * 删除草稿\n * @param {string} key\n */\nexport function removeDraft(key) {\n\tif (!key) return;\n\tuni.removeStorageSync(key);\n}\n\n/** 默认payload 中任一字段有值即视为有内容(忽略 updatedAt */\nexport function defaultHasContent(payload) {\n\tif (!payload || typeof payload !== 'object') return false;\n\n\treturn Object.entries(payload).some(([key, value]) => {\n\t\tif (key === 'updatedAt') return false;\n\t\tif (Array.isArray(value)) return value.length > 0;\n\t\tif (value && typeof value === 'object') return Object.keys(value).length > 0;\n\t\treturn value !== '' && value != null;\n\t});\n}\n"],"names":["uni"],"mappings":";;AACY,MAAC,WAAW;AAAA,EACvB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,YAAY;AACb;AAQO,SAAS,cAAc,cAAc,OAAO;AAClD,SAAO,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG;AAClE;AAGO,SAAS,qBAAqB,cAAc,OAAO;AACzD,SAAO,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,EAAE,OAAO,OAAO,CAAC,EAAE,KAAK,GAAG;AAClF;AAOO,SAAS,sBAAsB,YAAY,eAAe,IAAI;AACpE,QAAM,UAAU,UAAU,UAAU;AACpC,MAAI,SAAS;AACZ,WAAO,EAAE,MAAM,SAAS,KAAK,YAAY,cAAc;EACvD;AAED,aAAW,eAAe,cAAc;AACvC,QAAI,CAAC,eAAe,gBAAgB;AAAY;AAChD,UAAM,WAAW,UAAU,WAAW;AACtC,QAAI,UAAU;AACb,aAAO,EAAE,MAAM,UAAU,KAAK,YAAY,cAAc,MAAM;IAC9D;AAAA,EACD;AAED,SAAO,EAAE,MAAM,MAAM,KAAK,YAAY,cAAc;AACrD;AAOO,SAAS,UAAU,KAAK;AAC9B,MAAI,CAAC;AAAK,WAAO;AAEjB,QAAM,MAAMA,cAAAA,MAAI,eAAe,GAAG;AAClC,MAAI,CAAC;AAAK,WAAO;AAEjB,MAAI;AACH,WAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAI;AAAA,EACnD,SAAQ,OAAO;AACfA,kBAAc,MAAA,MAAA,SAAA,6BAAA,wBAAwB,KAAK,KAAK;AAChD,WAAO;AAAA,EACP;AACF;AAOO,SAAS,mBAAmB,KAAK,MAAM;AAC7C,MAAI,CAAC;AAAK;AAEVA,gBAAAA,MAAI;AAAA,IACH;AAAA,IACA,KAAK,UAAU;AAAA,MACd,GAAG;AAAA,MACH,WAAW,KAAK,IAAK;AAAA,IACxB,CAAG;AAAA,EACH;AACA;AAMO,SAAS,YAAY,KAAK;AAChC,MAAI,CAAC;AAAK;AACVA,sBAAI,kBAAkB,GAAG;AAC1B;AAGO,SAAS,kBAAkB,SAAS;AAC1C,MAAI,CAAC,WAAW,OAAO,YAAY;AAAU,WAAO;AAEpD,SAAO,OAAO,QAAQ,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,KAAK,MAAM;AACrD,QAAI,QAAQ;AAAa,aAAO;AAChC,QAAI,MAAM,QAAQ,KAAK;AAAG,aAAO,MAAM,SAAS;AAChD,QAAI,SAAS,OAAO,UAAU;AAAU,aAAO,OAAO,KAAK,KAAK,EAAE,SAAS;AAC3E,WAAO,UAAU,MAAM,SAAS;AAAA,EAClC,CAAE;AACF;;;;;;;;"}
{"version":3,"file":"draftCache.js","sources":["utils/draftCache.js"],"sourcesContent":["/** 草稿 Storage 命名空间(统一 key 前缀) */\nexport const DRAFT_NS = {\n\tASSIGN: 'draft_assign',\n\tACCEPT: 'draft_accept',\n\tACCEPT_APPROVAL: 'draft_accept_approval',\n\tRECTIFY: 'draft_rectify',\n\tINSPECTION_RESULT: 'draft_inspection_result',\n\tINSPECTION_SHEET: 'draft_inspection_sheet',\n\tHAZARD_ADD: 'draft_hazard_add'\n};\n\n/**\n * 构建草稿 Storage key与迁移前页面逻辑一致保留空片段\n * 例draft_rectify_100_ 、draft_accept_\n * @param {string} namespace 命名空间,如 DRAFT_NS.ASSIGN\n * @param {...string|number} parts 业务 id 片段\n */\nexport function buildDraftKey(namespace, ...parts) {\n\treturn [namespace, ...parts.map((p) => String(p ?? ''))].join('_');\n}\n\n/** 迁移期 compact key曾错误地 filter 掉空片段) */\nexport function buildDraftKeyCompact(namespace, ...parts) {\n\treturn [namespace, ...parts.map((p) => String(p ?? '')).filter(Boolean)].join('_');\n}\n\n/**\n * 读取草稿,支持回退到其它 key迁移兼容\n * @param {string} primaryKey\n * @param {string[]} [fallbackKeys]\n */\nexport function loadDraftWithFallback(primaryKey, fallbackKeys = []) {\n\tconst primary = loadDraft(primaryKey);\n\tif (primary) {\n\t\treturn { data: primary, key: primaryKey, fromFallback: false };\n\t}\n\n\tfor (const fallbackKey of fallbackKeys) {\n\t\tif (!fallbackKey || fallbackKey === primaryKey) continue;\n\t\tconst fallback = loadDraft(fallbackKey);\n\t\tif (fallback) {\n\t\t\treturn { data: fallback, key: primaryKey, fromFallback: true, fallbackKey };\n\t\t}\n\t}\n\n\treturn { data: null, key: primaryKey, fromFallback: false };\n}\n\n/**\n * 读取草稿\n * @param {string} key\n * @returns {Object|null}\n */\nexport function loadDraft(key) {\n\tif (!key) return null;\n\n\tconst raw = uni.getStorageSync(key);\n\tif (!raw) return null;\n\n\ttry {\n\t\treturn typeof raw === 'string' ? JSON.parse(raw) : raw;\n\t} catch (error) {\n\t\tconsole.error('[draftCache] 解析草稿失败:', key, error);\n\t\treturn null;\n\t}\n}\n\n/**\n * 写入草稿\n * @param {string} key\n * @param {Object} data\n */\nexport function saveDraftToStorage(key, data) {\n\tif (!key) return;\n\n\tuni.setStorageSync(\n\t\tkey,\n\t\tJSON.stringify({\n\t\t\t...data,\n\t\t\tupdatedAt: Date.now()\n\t\t})\n\t);\n}\n\n/**\n * 删除草稿\n * @param {string} key\n */\nexport function removeDraft(key) {\n\tif (!key) return;\n\tuni.removeStorageSync(key);\n}\n\n/** 默认payload 中任一字段有值即视为有内容(忽略 updatedAt */\nexport function defaultHasContent(payload) {\n\tif (!payload || typeof payload !== 'object') return false;\n\n\treturn Object.entries(payload).some(([key, value]) => {\n\t\tif (key === 'updatedAt') return false;\n\t\tif (Array.isArray(value)) return value.length > 0;\n\t\tif (value && typeof value === 'object') return Object.keys(value).length > 0;\n\t\treturn value !== '' && value != null;\n\t});\n}\n"],"names":["uni"],"mappings":";;AACY,MAAC,WAAW;AAAA,EACvB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,YAAY;AACb;AAQO,SAAS,cAAc,cAAc,OAAO;AAClD,SAAO,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG;AAClE;AAGO,SAAS,qBAAqB,cAAc,OAAO;AACzD,SAAO,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,EAAE,OAAO,OAAO,CAAC,EAAE,KAAK,GAAG;AAClF;AAOO,SAAS,sBAAsB,YAAY,eAAe,IAAI;AACpE,QAAM,UAAU,UAAU,UAAU;AACpC,MAAI,SAAS;AACZ,WAAO,EAAE,MAAM,SAAS,KAAK,YAAY,cAAc;EACvD;AAED,aAAW,eAAe,cAAc;AACvC,QAAI,CAAC,eAAe,gBAAgB;AAAY;AAChD,UAAM,WAAW,UAAU,WAAW;AACtC,QAAI,UAAU;AACb,aAAO,EAAE,MAAM,UAAU,KAAK,YAAY,cAAc,MAAM;IAC9D;AAAA,EACD;AAED,SAAO,EAAE,MAAM,MAAM,KAAK,YAAY,cAAc;AACrD;AAOO,SAAS,UAAU,KAAK;AAC9B,MAAI,CAAC;AAAK,WAAO;AAEjB,QAAM,MAAMA,cAAAA,MAAI,eAAe,GAAG;AAClC,MAAI,CAAC;AAAK,WAAO;AAEjB,MAAI;AACH,WAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAI;AAAA,EACnD,SAAQ,OAAO;AACfA,kBAAc,MAAA,MAAA,SAAA,6BAAA,wBAAwB,KAAK,KAAK;AAChD,WAAO;AAAA,EACP;AACF;AAOO,SAAS,mBAAmB,KAAK,MAAM;AAC7C,MAAI,CAAC;AAAK;AAEVA,gBAAAA,MAAI;AAAA,IACH;AAAA,IACA,KAAK,UAAU;AAAA,MACd,GAAG;AAAA,MACH,WAAW,KAAK,IAAK;AAAA,IACxB,CAAG;AAAA,EACH;AACA;AAMO,SAAS,YAAY,KAAK;AAChC,MAAI,CAAC;AAAK;AACVA,sBAAI,kBAAkB,GAAG;AAC1B;AAGO,SAAS,kBAAkB,SAAS;AAC1C,MAAI,CAAC,WAAW,OAAO,YAAY;AAAU,WAAO;AAEpD,SAAO,OAAO,QAAQ,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,KAAK,MAAM;AACrD,QAAI,QAAQ;AAAa,aAAO;AAChC,QAAI,MAAM,QAAQ,KAAK;AAAG,aAAO,MAAM,SAAS;AAChD,QAAI,SAAS,OAAO,UAAU;AAAU,aAAO,OAAO,KAAK,KAAK,EAAE,SAAS;AAC3E,WAAO,UAAU,MAAM,SAAS;AAAA,EAClC,CAAE;AACF;;;;;;;;"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"identitySwitch.js","sources":["utils/identitySwitch.js"],"sourcesContent":["import { switchIdentity } from '@/request/identity.js';\r\nimport { getProfileDetail } from '@/request/three_one_api/info.js';\r\nimport { saveUserInfoToStorage } from '@/utils/userInfo.js';\r\n\r\nfunction unwrapPayload(res) {\r\n\tif (!res) return {};\r\n\tconst data = res.data;\r\n\tif (data && typeof data === 'object' && (\r\n\t\tdata.token ||\r\n\t\tdata.identities ||\r\n\t\tdata.currentIdentity ||\r\n\t\tdata.roles\r\n\t)) {\r\n\t\treturn data;\r\n\t}\r\n\treturn res;\r\n}\r\n\r\n/** 根据个人信息接口刷新本地 userInfo */\r\nexport async function refreshUserInfoStorage() {\r\n\tconst res = await getProfileDetail();\r\n\tif (res.code === 0 && res.data) {\r\n\t\treturn saveUserInfoToStorage(res.data);\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/** 执行身份切换:更新 token再通过 profile 接口刷新 userInfo */\r\nexport async function performIdentitySwitch(identityId) {\r\n\tconst res = await switchIdentity(identityId);\r\n\tconst payload = unwrapPayload(res);\r\n\r\n\tif (payload.token) {\r\n\t\tuni.setStorageSync('token', payload.token);\r\n\t}\r\n\r\n\tif (payload.currentIdentity) {\r\n\t\tuni.setStorageSync('currentIdentity', JSON.stringify(payload.currentIdentity));\r\n\t}\r\n\r\n\tawait refreshUserInfoStorage();\r\n\treturn payload;\r\n}\r\n\r\n/** 切换成功后重启到首页,清空页面栈 */\r\nexport function reLaunchAfterSwitch() {\r\n\tuni.showToast({\r\n\t\ttitle: '身份切换成功',\r\n\t\ticon: 'success'\r\n\t});\r\n\tsetTimeout(() => {\r\n\t\tuni.reLaunch({\r\n\t\t\turl: '/pages/index/index'\r\n\t\t});\r\n\t}, 1500);\r\n}\r\n"],"names":["getProfileDetail","saveUserInfoToStorage","switchIdentity","uni"],"mappings":";;;;;AAIA,SAAS,cAAc,KAAK;AAC3B,MAAI,CAAC;AAAK,WAAO;AACjB,QAAM,OAAO,IAAI;AACjB,MAAI,QAAQ,OAAO,SAAS,aAC3B,KAAK,SACL,KAAK,cACL,KAAK,mBACL,KAAK,QACH;AACF,WAAO;AAAA,EACP;AACD,SAAO;AACR;AAGO,eAAe,yBAAyB;AAC9C,QAAM,MAAM,MAAMA,2BAAAA;AAClB,MAAI,IAAI,SAAS,KAAK,IAAI,MAAM;AAC/B,WAAOC,eAAqB,sBAAC,IAAI,IAAI;AAAA,EACrC;AACD,SAAO;AACR;AAGO,eAAe,sBAAsB,YAAY;AACvD,QAAM,MAAM,MAAMC,gCAAe,UAAU;AAC3C,QAAM,UAAU,cAAc,GAAG;AAEjC,MAAI,QAAQ,OAAO;AAClBC,kBAAAA,MAAI,eAAe,SAAS,QAAQ,KAAK;AAAA,EACzC;AAED,MAAI,QAAQ,iBAAiB;AAC5BA,kBAAG,MAAC,eAAe,mBAAmB,KAAK,UAAU,QAAQ,eAAe,CAAC;AAAA,EAC7E;AAED,QAAM,uBAAsB;AAC5B,SAAO;AACR;AAGO,SAAS,sBAAsB;AACrCA,gBAAAA,MAAI,UAAU;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAE;AACD,aAAW,MAAM;AAChBA,kBAAAA,MAAI,SAAS;AAAA,MACZ,KAAK;AAAA,IACR,CAAG;AAAA,EACD,GAAE,IAAI;AACR;;;"}

File diff suppressed because one or more lines are too long

View File

@@ -22,10 +22,15 @@ if (!Math) {
"./pages/hiddendanger/add.js";
"./pages/hiddendanger/view.js";
"./pages/hiddendanger/detail2.js";
"./pages/hiddendanger/process-chain.js";
"./pages/hiddendanger/rectification.js";
"./pages/hiddendanger/acceptance.js";
"./pages/hiddendanger/acceptance-approval.js";
"./pages/hiddendanger/assignment.js";
"./pages/closeout/application.js";
"./pages/closeout/apply.js";
"./pages/closeout/approval.js";
"./pages/closeout/leader-approval.js";
"./pages/closeout/editor.js";
"./pages/equipmentregistration/equipmentregistration.js";
"./pages/area/management.js";
@@ -36,6 +41,7 @@ if (!Math) {
"./pages/personalcenter/settings.js";
"./pages/personalcenter/account.js";
"./pages/personalcenter/edit.js";
"./pages/personalcenter/identity.js";
"./pages/login/login.js";
"./pages/login/reg.js";
"./pages/login/enterprise.js";
@@ -114,6 +120,11 @@ common_vendor.index.addInterceptor("uploadFile", {
return validateUploadLocalFileExt(args.filePath) ? args : false;
}
});
uni_modules_uviewPlus_index.setConfig({
config: {
loadFontOnce: true
}
});
function createApp() {
const app = common_vendor.createSSRApp(_sfc_main);
app.use(uni_modules_uviewPlus_index.uviewPlus);

View File

@@ -19,10 +19,15 @@
"pages/hiddendanger/add",
"pages/hiddendanger/view",
"pages/hiddendanger/detail2",
"pages/hiddendanger/process-chain",
"pages/hiddendanger/rectification",
"pages/hiddendanger/acceptance",
"pages/hiddendanger/acceptance-approval",
"pages/hiddendanger/assignment",
"pages/closeout/application",
"pages/closeout/apply",
"pages/closeout/approval",
"pages/closeout/leader-approval",
"pages/closeout/editor",
"pages/equipmentregistration/equipmentregistration",
"pages/area/management",
@@ -33,6 +38,7 @@
"pages/personalcenter/settings",
"pages/personalcenter/account",
"pages/personalcenter/edit",
"pages/personalcenter/identity",
"pages/login/login",
"pages/login/reg",
"pages/login/enterprise",

View File

@@ -7139,9 +7139,9 @@ function isConsoleWritable() {
return isWritable;
}
function initRuntimeSocketService() {
const hosts = "172.22.80.1,192.168.1.144,127.0.0.1";
const hosts = "172.30.48.1,192.168.1.144,127.0.0.1";
const port = "8090";
const id = "mp-weixin_4A0WII";
const id = "mp-weixin_4ene97";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();

View File

@@ -0,0 +1,144 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const components_flow_flowAssigneeUtils = require("./flowAssigneeUtils.js");
if (!Array) {
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
_easycom_u_popup2();
}
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(FlowAssigneeTree + _easycom_u_popup)();
}
const FlowAssigneeTree = () => "./FlowAssigneeTree.js";
const _sfc_main = {
__name: "FlowAssigneePickerPopup",
props: {
show: {
type: Boolean,
default: false
},
taskId: {
type: String,
default: ""
},
pickerIdentityId: {
type: String,
default: ""
},
pickerName: {
type: String,
default: ""
}
},
emits: ["update:pickerIdentityId", "update:pickerName", "cancel", "confirm"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const loading = common_vendor.ref(false);
const deptTree = common_vendor.ref([]);
const localPickerIdentityId = common_vendor.ref("");
const localPickerName = common_vendor.ref("");
const pickerDisplayName = common_vendor.computed(() => {
const user = components_flow_flowAssigneeUtils.findAssigneeUserInDeptTree(deptTree.value, localPickerIdentityId.value);
return user ? components_flow_flowAssigneeUtils.formatAssigneeDisplayName(user) : localPickerName.value;
});
const syncLocalPicker = () => {
localPickerIdentityId.value = props.pickerIdentityId || "";
localPickerName.value = props.pickerName || "";
};
const fetchAssigneeTree = async () => {
if (!props.taskId) {
deptTree.value = [];
return;
}
loading.value = true;
try {
const res = await request_api.getFlowApproverCandidates(props.taskId);
if (res.code === 0) {
deptTree.value = components_flow_flowAssigneeUtils.normalizeApproverDeptTree(res.data);
} else {
deptTree.value = [];
common_vendor.index.showToast({ title: res.msg || "获取处理人失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at components/flow/FlowAssigneePickerPopup.vue:93", "获取处理人失败:", error);
deptTree.value = [];
common_vendor.index.showToast({ title: "获取处理人失败", icon: "none" });
} finally {
loading.value = false;
}
};
common_vendor.watch(
() => props.show,
async (visible) => {
if (!visible)
return;
syncLocalPicker();
await fetchAssigneeTree();
}
);
const handleUserSelect = (user) => {
const identityId = components_flow_flowAssigneeUtils.resolveAssigneeIdentityId(user);
if (!identityId)
return;
localPickerIdentityId.value = identityId;
localPickerName.value = components_flow_flowAssigneeUtils.formatAssigneeDisplayName(user);
emit("update:pickerIdentityId", identityId);
emit("update:pickerName", localPickerName.value);
};
const handleCancel = () => {
emit("cancel");
};
const handleConfirm = () => {
if (!localPickerIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return;
}
const user = components_flow_flowAssigneeUtils.findAssigneeUserInDeptTree(deptTree.value, localPickerIdentityId.value);
if (!user) {
common_vendor.index.showToast({ title: "所选身份无效,请重新选择", icon: "none" });
return;
}
const name = components_flow_flowAssigneeUtils.formatAssigneeDisplayName(user);
emit("update:pickerIdentityId", localPickerIdentityId.value);
emit("update:pickerName", name);
emit("confirm", {
identityId: localPickerIdentityId.value,
name,
user
});
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(handleCancel),
b: __props.pickerIdentityId
}, __props.pickerIdentityId ? {
c: common_vendor.t(pickerDisplayName.value)
} : {}, {
d: loading.value
}, loading.value ? {} : !__props.taskId ? {} : deptTree.value.length === 0 ? {} : {
g: common_vendor.o(handleUserSelect),
h: common_vendor.p({
depts: deptTree.value,
["selected-identity-id"]: __props.pickerIdentityId
})
}, {
e: !__props.taskId,
f: deptTree.value.length === 0,
i: common_vendor.o(handleCancel),
j: common_vendor.o(handleConfirm),
k: common_vendor.o(handleCancel),
l: common_vendor.p({
show: __props.show,
mode: "bottom",
round: "20"
}),
m: common_vendor.gei(_ctx, "")
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2685d664"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/flow/FlowAssigneePickerPopup.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"flow-assignee-tree": "./FlowAssigneeTree"
}
}

View File

@@ -0,0 +1 @@
<u-popup wx:if="{{l}}" u-s="{{['d']}}" bindclose="{{k}}" u-i="2685d664-0" bind:__l="__l" u-p="{{l}}" class="{{['data-v-2685d664', virtualHostClass]}}" virtualHostClass="{{['data-v-2685d664', virtualHostClass]}}" style="{{virtualHostStyle}}" virtualHostStyle="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" virtualHostHidden="{{virtualHostHidden || false}}" id="{{m}}" virtualHostId="{{m}}"><view class="user-popup data-v-2685d664"><view class="popup-header data-v-2685d664"><view class="popup-title text-bold data-v-2685d664">选择下一步处理人</view><view class="popup-close data-v-2685d664" bindtap="{{a}}">×</view></view><view wx:if="{{b}}" class="selected-summary data-v-2685d664"><text class="summary-label data-v-2685d664">已选:</text><text class="summary-text data-v-2685d664">{{c}}</text></view><scroll-view class="user-list-scroll data-v-2685d664" scroll-y><view wx:if="{{d}}" class="empty-tip data-v-2685d664">加载中...</view><view wx:elif="{{e}}" class="empty-tip data-v-2685d664">缺少任务ID无法加载处理人</view><view wx:elif="{{f}}" class="empty-tip data-v-2685d664">暂无人员数据</view><flow-assignee-tree wx:else class="data-v-2685d664" virtualHostClass="data-v-2685d664" bindselect="{{g}}" u-i="2685d664-1,2685d664-0" bind:__l="__l" u-p="{{h||''}}"/></scroll-view><view class="popup-footer data-v-2685d664"><button class="btn-cancel data-v-2685d664" bindtap="{{i}}">取消</button><button class="btn-confirm bg-blue data-v-2685d664" bindtap="{{j}}">确定</button></view></view></u-popup>

View File

@@ -0,0 +1,96 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.user-popup.data-v-2685d664 {
background: #fff;
}
.user-popup .popup-header.data-v-2685d664 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.user-popup .popup-header .popup-title.data-v-2685d664 {
font-size: 32rpx;
color: #333;
}
.user-popup .popup-header .popup-close.data-v-2685d664 {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.user-popup .selected-summary.data-v-2685d664 {
padding: 16rpx 30rpx;
background: #f5f7fa;
border-bottom: 1rpx solid #eee;
font-size: 24rpx;
line-height: 1.5;
}
.user-popup .selected-summary .summary-label.data-v-2685d664 {
color: #909399;
}
.user-popup .selected-summary .summary-text.data-v-2685d664 {
color: #333;
}
.user-popup .user-list-scroll.data-v-2685d664 {
max-height: 600rpx;
box-sizing: border-box;
}
.user-popup .empty-tip.data-v-2685d664 {
padding: 80rpx 20rpx;
text-align: center;
color: #909399;
font-size: 26rpx;
}
.user-popup .popup-footer.data-v-2685d664 {
display: flex;
gap: 24rpx;
padding: 24rpx 30rpx;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
background: #fff;
}
.user-popup .popup-footer button.data-v-2685d664 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
margin: 0;
padding: 0;
}
.user-popup .popup-footer button.data-v-2685d664::after {
border: none;
}
.user-popup .popup-footer .btn-cancel.data-v-2685d664 {
background: #fff;
color: #2667E9;
border: 2rpx solid #2667E9;
}
.user-popup .popup-footer .btn-confirm.data-v-2685d664 {
color: #fff;
border: none;
}

View File

@@ -0,0 +1,50 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const components_flow_flowAssigneeUtils = require("./flowAssigneeUtils.js");
const _sfc_main = {
__name: "FlowAssigneeTree",
props: {
depts: {
type: Array,
default: () => []
},
selectedIdentityId: {
type: String,
default: ""
}
},
emits: ["select"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const flatRows = common_vendor.computed(() => components_flow_flowAssigneeUtils.flattenApproverDeptTree(props.depts));
const handleSelect = (user) => {
emit("select", user);
};
return (_ctx, _cache) => {
return {
a: common_vendor.f(flatRows.value, (row, k0, i0) => {
return common_vendor.e({
a: row.type === "dept"
}, row.type === "dept" ? {
b: common_vendor.t(row.deptName),
c: `${row.level * 24 + 20}rpx`
} : common_vendor.e({
d: common_vendor.t(common_vendor.unref(components_flow_flowAssigneeUtils.formatAssigneeDisplayName)(row.user)),
e: String(__props.selectedIdentityId) === String(common_vendor.unref(components_flow_flowAssigneeUtils.resolveAssigneeIdentityId)(row.user))
}, String(__props.selectedIdentityId) === String(common_vendor.unref(components_flow_flowAssigneeUtils.resolveAssigneeIdentityId)(row.user)) ? {} : {}, {
f: String(__props.selectedIdentityId) === String(common_vendor.unref(components_flow_flowAssigneeUtils.resolveAssigneeIdentityId)(row.user)) ? 1 : "",
g: `${row.level * 24 + 20}rpx`,
h: common_vendor.o(($event) => handleSelect(row.user), row.key)
}), {
i: row.key
});
}),
b: common_vendor.gei(_ctx, "")
};
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1fe646a4"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/flow/FlowAssigneeTree.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['assignee-tree', 'data-v-1fe646a4', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{b}}"><block wx:for="{{a}}" wx:for-item="row" wx:key="i"><view wx:if="{{row.a}}" class="dept-node data-v-1fe646a4" style="{{'padding-left:' + row.c}}"><text class="dept-name data-v-1fe646a4">{{row.b}}</text></view><view wx:else class="{{['user-item', 'data-v-1fe646a4', row.f && 'active']}}" style="{{'padding-left:' + row.g}}" bindtap="{{row.h}}"><text class="user-item-text data-v-1fe646a4">{{row.d}}</text><text wx:if="{{row.e}}" class="cuIcon-check text-blue data-v-1fe646a4"></text></view></block></view>

View File

@@ -0,0 +1,51 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.dept-node.data-v-1fe646a4 {
padding: 20rpx 20rpx 12rpx;
font-size: 26rpx;
color: #909399;
line-height: 1.4;
}
.dept-name.data-v-1fe646a4 {
font-weight: 600;
}
.user-item.data-v-1fe646a4 {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 20rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.user-item.active .user-item-text.data-v-1fe646a4 {
color: #2667E9;
font-weight: 600;
}
.user-item .user-item-text.data-v-1fe646a4 {
flex: 1;
font-size: 28rpx;
color: #333;
}

View File

@@ -0,0 +1,85 @@
"use strict";
const resolveAssigneeIdentityId = (user) => {
if (!user)
return "";
const id = user.identityId ?? user.userIdentityId ?? user.userId ?? "";
return id === "" || id == null ? "" : String(id);
};
const getAssigneeItemKey = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (identityId)
return `identity-${identityId}`;
return `user-${user.userId || user.nickName || ""}`;
};
const formatAssigneeDisplayName = (user) => {
if (!user)
return "";
if (user.identityName) {
return `${user.nickName || user.userName || ""}_${user.identityName}`;
}
if (user.postName) {
return `${user.nickName || user.userName || ""}_${user.postName}`;
}
return user.nickName || user.userName || user.name || "未知人员";
};
const normalizeApproverDeptTree = (data) => {
if (!data)
return [];
if (Array.isArray(data))
return data;
if (Array.isArray(data.records))
return data.records;
if (Array.isArray(data.list))
return data.list;
return [];
};
const findAssigneeUserInDeptTree = (depts, identityId) => {
var _a;
if (!identityId || !Array.isArray(depts))
return null;
for (const dept of depts) {
const user = (dept.users || []).find(
(item) => String(resolveAssigneeIdentityId(item)) === String(identityId)
);
if (user)
return user;
if ((_a = dept.children) == null ? void 0 : _a.length) {
const found = findAssigneeUserInDeptTree(dept.children, identityId);
if (found)
return found;
}
}
return null;
};
const flattenApproverDeptTree = (depts, level = 0) => {
var _a;
const rows = [];
if (!Array.isArray(depts))
return rows;
for (const dept of depts) {
rows.push({
type: "dept",
key: `dept-${dept.deptId ?? dept.deptName ?? level}`,
deptName: dept.deptName || "",
level
});
for (const user of dept.users || []) {
rows.push({
type: "user",
key: getAssigneeItemKey(user),
user,
level: level + 1
});
}
if ((_a = dept.children) == null ? void 0 : _a.length) {
rows.push(...flattenApproverDeptTree(dept.children, level + 1));
}
}
return rows;
};
exports.findAssigneeUserInDeptTree = findAssigneeUserInDeptTree;
exports.flattenApproverDeptTree = flattenApproverDeptTree;
exports.formatAssigneeDisplayName = formatAssigneeDisplayName;
exports.normalizeApproverDeptTree = normalizeApproverDeptTree;
exports.resolveAssigneeIdentityId = resolveAssigneeIdentityId;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/flow/flowAssigneeUtils.js.map

File diff suppressed because one or more lines are too long

View File

@@ -223,9 +223,10 @@ const _sfc_main = {
x: item.type === "rectify",
O: item.type === "verify",
Z: item.type === "writeoff",
ak: "node-" + index,
al: "hazard-node-" + index,
am: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
ak: common_vendor.unref(activeIndex) === index ? 1 : "",
al: "node-" + index,
am: "hazard-node-" + index,
an: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
});
}),
j: common_vendor.unref(contentScrollIntoView),

File diff suppressed because one or more lines are too long

View File

@@ -208,6 +208,16 @@
padding-bottom: 40rpx;
margin-bottom: 0;
}
.detail-card-shell.data-v-f38c3cb4 {
border-radius: 22rpx;
padding: 2rpx;
background: transparent;
transition: background 0.3s ease, box-shadow 0.3s ease;
}
.detail-card-shell--active.data-v-f38c3cb4 {
background: linear-gradient(145deg, rgba(4, 108, 234, 0.48) 0%, rgba(38, 103, 233, 0.3) 50%, rgba(33, 88, 200, 0.16) 100%);
box-shadow: 0 8rpx 24rpx rgba(38, 103, 233, 0.12);
}
.detail-card.data-v-f38c3cb4 {
background: #fff;
border-radius: 16rpx;

View File

@@ -244,9 +244,10 @@ const _sfc_main = {
A: item.type === "rectify",
R: item.type === "verify",
ac: item.type === "writeoff",
an: "node-" + index,
ao: "hazard-node-" + index,
ap: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
an: common_vendor.unref(activeIndex) === index ? 1 : "",
ao: "node-" + index,
ap: "hazard-node-" + index,
aq: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
});
}),
g: common_vendor.s(scrollAreaStyle.value),

File diff suppressed because one or more lines are too long

View File

@@ -121,6 +121,16 @@
padding-bottom: 40rpx;
margin-bottom: 0;
}
.detail-card-shell.data-v-361ef447 {
border-radius: 22rpx;
padding: 2rpx;
background: transparent;
transition: background 0.3s ease, box-shadow 0.3s ease;
}
.detail-card-shell--active.data-v-361ef447 {
background: linear-gradient(145deg, rgba(4, 108, 234, 0.48) 0%, rgba(38, 103, 233, 0.3) 50%, rgba(33, 88, 200, 0.16) 100%);
box-shadow: 0 8rpx 24rpx rgba(38, 103, 233, 0.12);
}
.detail-card.data-v-361ef447 {
background: #fff;
border-radius: 20rpx;

View File

@@ -0,0 +1,350 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_request = require("../../request/request.js");
const components_hazardDetail_processChain = require("./processChain.js");
const components_hazardDetail_processChainLabels = require("./processChainLabels.js");
const components_hazardDetail_useProcessChainScroll = require("./useProcessChainScroll.js");
const _sfc_main = {
__name: "HazardProcessChainPanel",
props: {
chainData: {
type: Object,
default: () => ({})
},
loading: {
type: Boolean,
default: false
},
bodyHeight: {
type: Number,
default: 0
}
},
setup(__props) {
const labels = components_hazardDetail_processChainLabels.CHAIN_LABELS;
const props = __props;
const { chainData, loading } = common_vendor.toRefs(props);
const {
historyList,
activeIndex,
contentScrollIntoView,
stepScrollIntoView,
scrollWithAnimation,
onContentScroll,
onScrollToLower,
scrollToNode,
scheduleMeasureLayout
} = components_hazardDetail_useProcessChainScroll.useProcessChainScroll(chainData, loading);
const scrollAreaStyle = common_vendor.computed(() => {
const height = props.bodyHeight > 0 ? props.bodyHeight : 400;
return { height: `${height}px` };
});
const detailBodyStyle = common_vendor.computed(() => {
const height = props.bodyHeight > 0 ? props.bodyHeight : 400;
return { height: `${height}px` };
});
common_vendor.watch(
() => props.bodyHeight,
(height) => {
if (height > 0) {
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 100);
}
}
);
const LEVEL_CLASS_MAP = {
2: "level-normal",
3: "level-major"
};
const getLevelTagClass = (content) => {
const level = content == null ? void 0 : content.level;
const levelName = content == null ? void 0 : content.levelName;
if (level != null && LEVEL_CLASS_MAP[level]) {
return LEVEL_CLASS_MAP[level];
}
if (levelName && components_hazardDetail_processChainLabels.LEVEL_NAME_CLASS_MAP[levelName]) {
return components_hazardDetail_processChainLabels.LEVEL_NAME_CLASS_MAP[levelName];
}
return "";
};
const resolveFileUrl = (path) => request_request.toImageUrl(path);
const fieldText = (item, value) => components_hazardDetail_processChain.resolveFieldDisplay(value, item.completed);
const isPendingText = (item, value) => fieldText(item, value) === components_hazardDetail_processChain.PENDING_LABEL;
const formatCost = (cost, completed = true) => {
if (cost == null || cost === "")
return components_hazardDetail_processChain.resolveFieldDisplay("", completed);
const num = Number(cost);
if (Number.isNaN(num))
return components_hazardDetail_processChain.resolveFieldDisplay("", completed);
return `${num} ${labels.yuan}`;
};
const previewSingle = (path) => {
const url = resolveFileUrl(path);
if (!url)
return;
common_vendor.index.previewImage({ current: url, urls: [url] });
};
const previewImages = (attachments, index) => {
const urls = (attachments || []).filter((f) => f.fileType === "image" || !f.fileType).map((f) => resolveFileUrl(f.filePath)).filter(Boolean);
if (!urls.length)
return;
common_vendor.index.previewImage({ current: urls[index] || urls[0], urls });
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(loading)
}, common_vendor.unref(loading) ? {
b: common_vendor.t(common_vendor.unref(labels).loading)
} : common_vendor.unref(historyList).length === 0 ? {
d: common_vendor.t(common_vendor.unref(labels).empty)
} : {
e: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.unref(components_hazardDetail_processChain.getProcessStepIconPath)(item, common_vendor.unref(activeIndex) === index),
b: common_vendor.unref(activeIndex) === index ? 1 : "",
c: common_vendor.t(item.nodeName),
d: common_vendor.unref(activeIndex) === index ? 1 : "",
e: index < common_vendor.unref(historyList).length - 1
}, index < common_vendor.unref(historyList).length - 1 ? {} : {}, {
f: "step-" + index,
g: "process-step-" + index,
h: common_vendor.unref(activeIndex) === index ? 1 : "",
i: common_vendor.o(($event) => common_vendor.unref(scrollToNode)(index), "step-" + index)
});
}),
f: common_vendor.s(scrollAreaStyle.value),
g: common_vendor.unref(stepScrollIntoView),
h: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.titlePrefix),
b: common_vendor.t(fieldText(item, item.operator)),
c: common_vendor.t(fieldText(item, item.time)),
d: item.type === "add" && item.content.levelName
}, item.type === "add" && item.content.levelName ? {
e: common_vendor.t(item.content.levelName),
f: common_vendor.n(getLevelTagClass(item.content))
} : {}, {
g: item.type === "add"
}, item.type === "add" ? common_vendor.e({
h: common_vendor.t(common_vendor.unref(labels).hazardCode),
i: common_vendor.t(fieldText(item, item.content.code)),
j: common_vendor.t(common_vendor.unref(labels).hazardTitle),
k: common_vendor.t(fieldText(item, item.content.title)),
l: common_vendor.t(common_vendor.unref(labels).checkSource),
m: common_vendor.t(fieldText(item, item.content.source)),
n: common_vendor.t(common_vendor.unref(labels).hazardSource),
o: common_vendor.t(fieldText(item, item.content.hazardSourceName)),
p: common_vendor.t(common_vendor.unref(labels).hazardArea),
q: common_vendor.t(fieldText(item, item.content.areaName)),
r: common_vendor.t(common_vendor.unref(labels).address),
s: common_vendor.t(fieldText(item, item.content.address)),
t: common_vendor.t(common_vendor.unref(labels).hazardLevel),
v: common_vendor.t(fieldText(item, item.content.levelName)),
w: common_vendor.n(getLevelTagClass(item.content)),
x: common_vendor.t(common_vendor.unref(labels).hazardTag),
y: common_vendor.t(fieldText(item, item.content.tagName)),
z: common_vendor.t(common_vendor.unref(labels).description),
A: common_vendor.t(fieldText(item, item.content.description)),
B: item.content.attachments && item.content.attachments.length || !item.completed
}, item.content.attachments && item.content.attachments.length || !item.completed ? common_vendor.e({
C: common_vendor.t(common_vendor.unref(labels).hazardAttachments),
D: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
E: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return {
a: idx,
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
};
})
} : {
F: common_vendor.t(fieldText(item, ""))
}) : {}, {
G: common_vendor.t(common_vendor.unref(labels).legalBasis),
H: common_vendor.t(fieldText(item, item.content.legalBasis))
}) : item.type === "assign" ? {
J: common_vendor.t(common_vendor.unref(labels).assigneeName),
K: common_vendor.t(fieldText(item, item.content.assigneeName)),
L: common_vendor.t(common_vendor.unref(labels).assignDeadline),
M: common_vendor.t(fieldText(item, item.content.deadline)),
N: common_vendor.t(common_vendor.unref(labels).assignStatus),
O: common_vendor.t(fieldText(item, item.content.assignStatusName))
} : item.type === "rectify" ? common_vendor.e({
Q: common_vendor.t(common_vendor.unref(labels).rectifyStatus),
R: common_vendor.t(fieldText(item, item.content.rectifyStatusName)),
S: common_vendor.t(common_vendor.unref(labels).rectifyPlan),
T: common_vendor.t(fieldText(item, item.content.rectifyPlan)),
U: common_vendor.t(common_vendor.unref(labels).rectifyResult),
V: common_vendor.t(fieldText(item, item.content.rectifyResult)),
W: common_vendor.t(common_vendor.unref(labels).rectifyMeasures),
X: common_vendor.t(fieldText(item, item.content.rectificationMeasures)),
Y: common_vendor.t(common_vendor.unref(labels).controlMeasures),
Z: common_vendor.t(fieldText(item, item.content.controlMeasures)),
aa: common_vendor.t(common_vendor.unref(labels).rectifierName),
ab: common_vendor.t(fieldText(item, item.content.rectifierName)),
ac: common_vendor.t(common_vendor.unref(labels).managerNames),
ad: common_vendor.t(fieldText(item, item.content.managerNames)),
ae: common_vendor.t(common_vendor.unref(labels).memberNames),
af: common_vendor.t(fieldText(item, item.content.memberNames)),
ag: common_vendor.t(common_vendor.unref(labels).planCost),
ah: common_vendor.t(formatCost(item.content.planCost, item.completed)),
ai: common_vendor.t(common_vendor.unref(labels).actualCost),
aj: common_vendor.t(formatCost(item.content.actualCost, item.completed)),
ak: item.content.attachments && item.content.attachments.length || !item.completed
}, item.content.attachments && item.content.attachments.length || !item.completed ? common_vendor.e({
al: common_vendor.t(common_vendor.unref(labels).rectifyAttachments),
am: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
an: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image" || !file.fileType
}, file.fileType === "image" || !file.fileType ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || common_vendor.unref(labels).attachmentFallback)
}, {
f: idx
});
})
} : {
ao: common_vendor.t(fieldText(item, ""))
}) : {}, {
ap: item.content.signPath || !item.completed
}, item.content.signPath || !item.completed ? common_vendor.e({
aq: common_vendor.t(common_vendor.unref(labels).rectifySign),
ar: item.content.signPath
}, item.content.signPath ? {
as: resolveFileUrl(item.content.signPath),
at: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
av: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {
aw: common_vendor.t(fieldText(item, ""))
}) : {}) : item.type === "verify" || item.type === "writeoff_approve" ? common_vendor.e({
ay: common_vendor.t(common_vendor.unref(labels).verifyResult),
az: item.completed && item.content.resultName
}, item.completed && item.content.resultName ? {
aA: common_vendor.t(item.content.resultName),
aB: common_vendor.n(item.content.resultName === common_vendor.unref(labels).pass ? "result-tag--pass" : "result-tag--fail")
} : {
aC: common_vendor.t(fieldText(item, item.content.resultName))
}, {
aD: item.content.remark || !item.completed
}, item.content.remark || !item.completed ? {
aE: common_vendor.t(common_vendor.unref(labels).verifyRemark),
aF: common_vendor.t(fieldText(item, item.content.remark))
} : {}, {
aG: item.content.attachments && item.content.attachments.length || !item.completed
}, item.content.attachments && item.content.attachments.length || !item.completed ? common_vendor.e({
aH: common_vendor.t(common_vendor.unref(labels).verifyAttachments),
aI: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
aJ: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image" || !file.fileType
}, file.fileType === "image" || !file.fileType ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || common_vendor.unref(labels).attachmentFallback)
}, {
f: idx
});
})
} : {
aK: common_vendor.t(fieldText(item, ""))
}) : {}, {
aL: item.content.signPath || !item.completed
}, item.content.signPath || !item.completed ? common_vendor.e({
aM: common_vendor.t(common_vendor.unref(labels).verifySign),
aN: item.content.signPath
}, item.content.signPath ? {
aO: resolveFileUrl(item.content.signPath),
aP: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
aQ: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {
aR: common_vendor.t(fieldText(item, ""))
}) : {}) : item.type === "writeoff_apply" ? common_vendor.e({
aT: common_vendor.t(common_vendor.unref(labels).writeoffDeadline),
aU: common_vendor.t(fieldText(item, item.content.rectifyDeadline)),
aV: common_vendor.t(common_vendor.unref(labels).responsibleDept),
aW: common_vendor.t(fieldText(item, item.content.responsibleDeptName)),
aX: common_vendor.t(common_vendor.unref(labels).responsiblePerson),
aY: common_vendor.t(fieldText(item, item.content.responsiblePerson)),
aZ: common_vendor.t(common_vendor.unref(labels).mainTreatment),
ba: common_vendor.t(fieldText(item, item.content.mainTreatmentContent)),
bb: common_vendor.t(common_vendor.unref(labels).treatmentResult),
bc: common_vendor.t(fieldText(item, item.content.treatmentResult)),
bd: common_vendor.t(common_vendor.unref(labels).selfVerify),
be: common_vendor.t(fieldText(item, item.content.selfVerifyContent)),
bf: item.content.signPath || !item.completed
}, item.content.signPath || !item.completed ? common_vendor.e({
bg: common_vendor.t(common_vendor.unref(labels).applySign),
bh: item.content.signPath
}, item.content.signPath ? {
bi: resolveFileUrl(item.content.signPath),
bj: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
bk: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {
bl: common_vendor.t(fieldText(item, ""))
}) : {}) : item.type === "approval" ? common_vendor.e({
bn: common_vendor.t(common_vendor.unref(labels).approvalOpinion),
bo: item.completed && item.content.approveTypeName
}, item.completed && item.content.approveTypeName ? {
bp: common_vendor.t(item.content.approveTypeName),
bq: common_vendor.n(item.content.pass ? "result-tag--pass" : "result-tag--fail")
} : {
br: common_vendor.t(fieldText(item, item.content.approveTypeName))
}, {
bs: common_vendor.t(common_vendor.unref(labels).approvalComment),
bt: common_vendor.t(fieldText(item, item.content.comment)),
bv: isPendingText(item, item.content.comment) ? 1 : "",
bw: common_vendor.t(common_vendor.unref(labels).smsReminder),
bx: item.content.sendMsgFlag != null
}, item.content.sendMsgFlag != null ? {
by: common_vendor.t(item.content.sendMsgFlag ? common_vendor.unref(labels).yes : common_vendor.unref(labels).no)
} : {
bz: common_vendor.t(fieldText(item, ""))
}, {
bA: item.content.signPath || !item.completed
}, item.content.signPath || !item.completed ? common_vendor.e({
bB: common_vendor.t(common_vendor.unref(labels).approvalSign),
bC: item.content.signPath
}, item.content.signPath ? {
bD: resolveFileUrl(item.content.signPath),
bE: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
bF: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {
bG: common_vendor.t(fieldText(item, ""))
}) : {}) : {}, {
I: item.type === "assign",
P: item.type === "rectify",
ax: item.type === "verify" || item.type === "writeoff_approve",
aS: item.type === "writeoff_apply",
bm: item.type === "approval",
bH: common_vendor.unref(activeIndex) === index ? 1 : "",
bI: "node-" + index,
bJ: "process-node-" + index,
bK: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
});
}),
i: common_vendor.t(common_vendor.unref(labels).personnelSuffix),
j: common_vendor.s(scrollAreaStyle.value),
k: common_vendor.unref(contentScrollIntoView),
l: common_vendor.unref(scrollWithAnimation),
m: common_vendor.o((...args) => common_vendor.unref(onContentScroll) && common_vendor.unref(onContentScroll)(...args)),
n: common_vendor.o((...args) => common_vendor.unref(onScrollToLower) && common_vendor.unref(onScrollToLower)(...args)),
o: common_vendor.s(detailBodyStyle.value)
}, {
c: common_vendor.unref(historyList).length === 0,
p: common_vendor.gei(_ctx, "")
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-020654bc"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/HazardProcessChainPanel.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,286 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.hazard-process-chain-panel.data-v-020654bc {
flex: 1;
min-height: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.loading-wrap.data-v-020654bc,
.empty-wrap.data-v-020654bc {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
min-height: 0;
}
.loading-text.data-v-020654bc,
.empty-text.data-v-020654bc {
font-size: 28rpx;
color: #909399;
}
.detail-body.data-v-020654bc {
display: flex;
gap: 20rpx;
align-items: stretch;
overflow: hidden;
box-sizing: border-box;
}
.steps-card.data-v-020654bc {
width: 148rpx;
flex-shrink: 0;
background: #fff;
border-radius: 20rpx;
box-sizing: border-box;
}
.step-item.data-v-020654bc {
padding: 0 8rpx;
}
.step-track.data-v-020654bc {
display: flex;
flex-direction: column;
align-items: center;
padding: 24rpx 0 0;
}
.step-dot.data-v-020654bc {
width: 66rpx;
height: 66rpx;
border-radius: 50%;
background: #f3f3f3;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
}
.step-dot--active.data-v-020654bc {
background: #2667e9;
}
.step-icon.data-v-020654bc {
width: 36rpx;
height: 36rpx;
}
.step-label.data-v-020654bc {
margin-top: 10rpx;
font-size: 20rpx;
color: #999;
line-height: 1.3;
text-align: center;
word-break: break-all;
}
.step-label--active.data-v-020654bc {
color: #2667e9;
font-weight: 600;
}
.step-line.data-v-020654bc {
width: 0;
height: 36rpx;
margin: 8rpx 0;
border-left: 2rpx dashed #dcdfe6;
}
.content-column.data-v-020654bc {
flex: 1;
width: 0;
min-height: 0;
box-sizing: border-box;
}
.content-scroll.data-v-020654bc {
width: 100%;
box-sizing: border-box;
}
.node-section.data-v-020654bc {
box-sizing: border-box;
padding: 0;
margin-bottom: 24rpx;
}
.node-section--last.data-v-020654bc {
padding-bottom: 40rpx;
margin-bottom: 0;
}
.detail-card-shell.data-v-020654bc {
border-radius: 22rpx;
padding: 2rpx;
background: transparent;
transition: background 0.3s ease, box-shadow 0.3s ease;
}
.detail-card-shell--active.data-v-020654bc {
background: linear-gradient(145deg, rgba(4, 108, 234, 0.48) 0%, rgba(38, 103, 233, 0.3) 50%, rgba(33, 88, 200, 0.16) 100%);
box-shadow: 0 8rpx 24rpx rgba(38, 103, 233, 0.12);
}
.detail-card.data-v-020654bc {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
padding: 28rpx 38rpx;
box-sizing: border-box;
}
.card-header-v2.data-v-020654bc {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16rpx;
padding: 0;
}
.card-header-main.data-v-020654bc {
flex: 1;
min-width: 0;
}
.operator.data-v-020654bc {
font-size: 28rpx;
font-weight: 600;
color: #303133;
line-height: 1.5;
word-break: break-all;
}
.time.data-v-020654bc {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
color: #999;
line-height: 1.4;
}
.level-badge.data-v-020654bc {
flex-shrink: 0;
padding: 6rpx 16rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
white-space: nowrap;
}
.level-badge.level-normal.data-v-020654bc {
background: #fff7e6;
border: 2rpx solid #ffd591;
color: #fa8c16;
}
.level-badge.level-major.data-v-020654bc {
background: #fff1f0;
border: 2rpx solid #ffa39e;
color: #f5222d;
}
.card-divider.data-v-020654bc {
height: 0;
margin: 20rpx 0;
border-top: 2rpx dashed #eee;
}
.card-body.data-v-020654bc {
padding: 0;
}
.detail-row-v2.data-v-020654bc {
display: flex;
align-items: flex-start;
justify-content: flex-start;
gap: 24rpx;
padding: 18rpx 0;
}
.detail-row-v2--block.data-v-020654bc {
flex-wrap: wrap;
}
.label.data-v-020654bc {
flex-shrink: 0;
font-size: 26rpx;
color: #999;
line-height: 1.5;
}
.value.data-v-020654bc {
flex: 1;
min-width: 0;
font-size: 26rpx;
color: #333;
line-height: 1.6;
text-align: left;
word-break: break-all;
}
.value--pending.data-v-020654bc {
color: #e6a23c;
}
.level-tag.data-v-020654bc {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: 500;
line-height: 1.4;
white-space: nowrap;
}
.level-normal.data-v-020654bc {
background: #fff7e6;
border: 2rpx solid #ffd591;
color: #fa8c16;
}
.level-major.data-v-020654bc {
background: #fff1f0;
border: 2rpx solid #ffa39e;
color: #f5222d;
}
.attachment-list.data-v-020654bc {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
flex: 1;
min-width: 0;
}
.attachment-img.data-v-020654bc {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
background: #f5f7fa;
}
.sign-img.data-v-020654bc {
width: 300rpx;
height: 160rpx;
border: 1rpx solid #e4e7ed;
border-radius: 8rpx;
background: #fafafa;
flex: 1;
min-width: 0;
max-width: 100%;
}
.file-link.data-v-020654bc {
display: inline-block;
padding: 12rpx 20rpx;
background: #f5f7fa;
border: 1rpx solid #e4e7ed;
border-radius: 8rpx;
color: #2667e9;
font-size: 24rpx;
}
.result-tag.data-v-020654bc {
padding: 6rpx 16rpx;
border-radius: 6rpx;
font-size: 24rpx;
}
.result-tag--pass.data-v-020654bc {
background: #f0f9eb;
color: #67c23a;
}
.result-tag--fail.data-v-020654bc {
background: #fef0f0;
color: #f56c6c;
}

View File

@@ -199,6 +199,7 @@ function generateHazardHistory(data) {
}
return list;
}
exports.formatNameList = formatNameList;
exports.generateHazardHistory = generateHazardHistory;
exports.getStatusClass = getStatusClass;
exports.getStepIconPath = getStepIconPath;

View File

@@ -0,0 +1,340 @@
"use strict";
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
const PENDING_LABEL = "待处理";
const isNodeCompleted = (node) => (node == null ? void 0 : node.completed) !== false;
const resolveFieldDisplay = (value, completed = true) => {
if (value != null && value !== "")
return value;
return completed ? "-" : PENDING_LABEL;
};
const PROCESS_NODE_TYPES = {
ADD: "add",
ASSIGN: "assign",
RECTIFY: "rectify",
RECTIFY_ASSIGN: "rectifyAssign",
VERIFY: "verify",
VERIFY_SUB: "verify_sub",
WRITEOFF_APPLY: "writeoff_apply",
WRITEOFF_APPROVE: "writeoff_approve",
WRITEOFF_SUB: "writeoff_sub",
APPROVAL: "approval"
};
const SUB_TYPE_SUFFIX_MAP = {
verify: "验收",
writeoff: "销号"
};
const TITLE_PREFIX_MAP = {
add: "提交",
assign: "交办",
rectify: "整改",
rectifyAssign: "交办",
verify: "验收",
verify_sub: "审批",
writeoff_apply: "销号申请",
writeoff_approve: "销号审核",
writeoff_sub: "审批"
};
const APPROVAL_TASK_KEY_ICON = {
department_review: "bumenshenpi",
section_chief_review: "fenguanshenpi",
supervising_executive_review: "fenguanshenpi",
supervising_leader_review_1: "zhuguanshenpi",
supervising_leader_review_2: "zhuguanshenpi"
};
const NODE_TYPE_ICON = {
add: "tijiao",
assign: "jiaoban",
rectifyAssign: "jiaoban",
rectify: "zhenggai",
verify: "yanshou",
writeoff_apply: "xiaohao",
writeoff_approve: "xiaohao"
};
const resolveTaskKey = (node) => {
var _a;
return (node == null ? void 0 : node.taskKey) || ((_a = node == null ? void 0 : node.subProcessApprovalInfo) == null ? void 0 : _a.taskKey) || "";
};
const toSafeObject = (value) => value && typeof value === "object" ? value : {};
const toDisplayText = (value) => {
if (value == null || value === "")
return "";
return value;
};
const getProcessStepDisplayName = (node) => {
var _a;
if (!node)
return "";
const nodeType = node.nodeType;
if (nodeType === "verify_sub" || nodeType === "writeoff_sub") {
const subType = (_a = node.subProcessApprovalInfo) == null ? void 0 : _a.subType;
const suffix = SUB_TYPE_SUFFIX_MAP[subType];
return suffix ? `${node.nodeName}${suffix}` : node.nodeName;
}
return node.nodeName || "";
};
const getProcessStepIconPath = (item, active = false) => {
const type = item == null ? void 0 : item.type;
const taskKey = (item == null ? void 0 : item.taskKey) || "";
const state = active ? "selected" : "unselected";
if (type === PROCESS_NODE_TYPES.APPROVAL) {
const iconBase = APPROVAL_TASK_KEY_ICON[taskKey] || "bumenshenpi";
return `/static/yinhuan_detail/${iconBase}_${state}.png`;
}
const base = NODE_TYPE_ICON[item == null ? void 0 : item.rawType] || NODE_TYPE_ICON[type] || "tijiao";
if (base === "zhenggai") {
return active ? "/static/yinhuan_detail/zhenggai_selected.png" : "/static/yinhuan_detail/zhenggai__unselected.png";
}
return `/static/yinhuan_detail/${base}__${state}.png`;
};
const resolveOperator = (node, nodeType) => {
var _a, _b, _c, _d, _e;
const completed = isNodeCompleted(node);
const fallback = completed ? "-" : "";
if (nodeType === PROCESS_NODE_TYPES.ADD) {
return ((_a = node.hazardInfo) == null ? void 0 : _a.reporterName) || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.ASSIGN) {
return ((_b = node.assignInfo) == null ? void 0 : _b.assignerName) || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.RECTIFY) {
return ((_c = node.rectifyInfo) == null ? void 0 : _c.rectifierName) || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.VERIFY || nodeType === PROCESS_NODE_TYPES.WRITEOFF_APPROVE) {
return ((_d = node.verifyInfo) == null ? void 0 : _d.verifierName) || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.WRITEOFF_APPLY) {
return ((_e = node.writeOffApplyInfo) == null ? void 0 : _e.applicantName) || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.APPROVAL) {
const info = node.subProcessApprovalInfo || {};
return info.operatorName || info.assigneeName || fallback;
}
return fallback;
};
const resolveTime = (node, nodeType) => {
var _a, _b, _c, _d, _e, _f;
const completed = isNodeCompleted(node);
const fallback = completed ? "-" : "";
if (nodeType === PROCESS_NODE_TYPES.ADD) {
return ((_a = node.hazardInfo) == null ? void 0 : _a.createdAt) || node.completedAt || node.occurredAt || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.ASSIGN) {
return ((_b = node.assignInfo) == null ? void 0 : _b.assignTime) || node.completedAt || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.RECTIFY) {
return ((_c = node.rectifyInfo) == null ? void 0 : _c.rectifyTime) || node.completedAt || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.VERIFY || nodeType === PROCESS_NODE_TYPES.WRITEOFF_APPROVE) {
return ((_d = node.verifyInfo) == null ? void 0 : _d.verifyTime) || node.completedAt || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.WRITEOFF_APPLY) {
return ((_e = node.writeOffApplyInfo) == null ? void 0 : _e.applyTime) || node.completedAt || fallback;
}
if (nodeType === PROCESS_NODE_TYPES.APPROVAL) {
return ((_f = node.subProcessApprovalInfo) == null ? void 0 : _f.endTime) || node.completedAt || fallback;
}
return node.completedAt || node.occurredAt || fallback;
};
const mapAddContent = (info) => {
const data = toSafeObject(info);
return {
code: toDisplayText(data.code),
title: toDisplayText(data.title),
source: toDisplayText(data.source),
hazardSourceName: toDisplayText(data.hazardSourceName),
areaName: toDisplayText(data.areaName),
address: toDisplayText(data.address),
level: data.level ?? null,
levelName: toDisplayText(data.levelName),
tagName: toDisplayText(data.tagName),
description: toDisplayText(data.description),
attachments: Array.isArray(data.attachments) ? data.attachments : [],
legalBasis: toDisplayText(data.legalBasis)
};
};
const mapAssignContent = (info) => {
const data = toSafeObject(info);
return {
assigneeName: toDisplayText(data.assigneeName),
deadline: toDisplayText(data.deadline),
assignRemark: toDisplayText(data.assignRemark),
assignStatusName: toDisplayText(data.assignStatusName)
};
};
const mapRectifyContent = (info) => {
const data = toSafeObject(info);
return {
rectifyStatusName: toDisplayText(data.rectifyStatusName),
rectifyPlan: toDisplayText(data.rectifyPlan),
rectifyResult: toDisplayText(data.rectifyResult),
rectificationMeasures: toDisplayText(data.rectificationMeasures),
controlMeasures: toDisplayText(data.controlMeasures),
rectifierName: toDisplayText(data.rectifierName),
managerNames: components_hazardDetail_hazardDetail.formatNameList(data.managerNames, ""),
memberNames: components_hazardDetail_hazardDetail.formatNameList(data.memberNames, ""),
planCost: data.planCost ?? null,
actualCost: data.actualCost ?? null,
attachments: Array.isArray(data.attachments) ? data.attachments : [],
signPath: toDisplayText(data.signPath)
};
};
const mapVerifyContent = (info) => {
const data = toSafeObject(info);
return {
resultName: toDisplayText(data.resultName),
remark: toDisplayText(data.remark),
attachments: Array.isArray(data.attachments) ? data.attachments : [],
signPath: toDisplayText(data.signPath)
};
};
const mapApprovalContent = (info) => {
const data = toSafeObject(info);
return {
approveTypeName: toDisplayText(data.approveTypeName),
pass: data.pass ?? null,
comment: toDisplayText(data.comment),
nextStepName: toDisplayText(data.nextStepName),
nextAssigneeName: toDisplayText(data.nextAssigneeName),
sendMsgFlag: data.sendMsgFlag ?? null,
signPath: toDisplayText(data.signPath)
};
};
const mapWriteoffApplyContent = (info) => {
const data = toSafeObject(info);
return {
rectifyDeadline: toDisplayText(data.rectifyDeadline),
responsibleDeptName: toDisplayText(data.responsibleDeptName),
responsiblePerson: toDisplayText(data.responsiblePerson),
mainTreatmentContent: toDisplayText(data.mainTreatmentContent),
treatmentResult: toDisplayText(data.treatmentResult),
selfVerifyContent: toDisplayText(data.selfVerifyContent),
signPath: toDisplayText(data.signPath)
};
};
const resolveNodeType = (node) => {
const nodeType = node == null ? void 0 : node.nodeType;
if (nodeType === "verify_sub" || nodeType === "writeoff_sub") {
return PROCESS_NODE_TYPES.APPROVAL;
}
return nodeType || PROCESS_NODE_TYPES.ADD;
};
const hasRectifyData = (rectifyInfo) => {
if (!rectifyInfo || typeof rectifyInfo !== "object") {
return false;
}
return Boolean(
rectifyInfo.rectifyId || rectifyInfo.rectifyPlan || rectifyInfo.rectifyResult || rectifyInfo.rectifyTime || rectifyInfo.rectifierName
);
};
const hasAssignData = (assignInfo) => {
if (!assignInfo || typeof assignInfo !== "object") {
return false;
}
return Boolean(
assignInfo.assignId || assignInfo.assigneeName || assignInfo.assignerName || assignInfo.assignTime
);
};
const isAssignLikeNodeType = (nodeType) => nodeType === PROCESS_NODE_TYPES.ASSIGN || nodeType === PROCESS_NODE_TYPES.RECTIFY_ASSIGN;
const resolveAssignRectifyDisplayType = (node) => {
if (hasRectifyData(node == null ? void 0 : node.rectifyInfo)) {
return PROCESS_NODE_TYPES.RECTIFY;
}
if (hasAssignData(node == null ? void 0 : node.assignInfo)) {
return PROCESS_NODE_TYPES.ASSIGN;
}
return null;
};
const resolveDisplayType = (node, nodeType) => {
if (isAssignLikeNodeType(nodeType)) {
return resolveAssignRectifyDisplayType(node) || PROCESS_NODE_TYPES.ASSIGN;
}
if (nodeType === PROCESS_NODE_TYPES.RECTIFY) {
return resolveAssignRectifyDisplayType(node) || PROCESS_NODE_TYPES.RECTIFY;
}
return nodeType;
};
const resolveTitlePrefix = (rawType, displayType, node) => {
if (displayType === PROCESS_NODE_TYPES.ASSIGN) {
return TITLE_PREFIX_MAP[rawType] || TITLE_PREFIX_MAP.assign;
}
if (displayType === PROCESS_NODE_TYPES.RECTIFY) {
return TITLE_PREFIX_MAP.rectify;
}
return TITLE_PREFIX_MAP[displayType] || TITLE_PREFIX_MAP[rawType] || node.nodeName || "处理";
};
const mapNodeContent = (node, displayType) => {
switch (displayType) {
case PROCESS_NODE_TYPES.ADD:
return mapAddContent(node.hazardInfo);
case PROCESS_NODE_TYPES.ASSIGN:
return mapAssignContent(node.assignInfo);
case PROCESS_NODE_TYPES.RECTIFY:
return mapRectifyContent(node.rectifyInfo);
case PROCESS_NODE_TYPES.VERIFY:
case PROCESS_NODE_TYPES.WRITEOFF_APPROVE:
return mapVerifyContent(node.verifyInfo);
case PROCESS_NODE_TYPES.WRITEOFF_APPLY:
return mapWriteoffApplyContent(node.writeOffApplyInfo);
case PROCESS_NODE_TYPES.APPROVAL:
return mapApprovalContent(node.subProcessApprovalInfo);
default:
return {};
}
};
const mapProcessNodeToHistoryItem = (node) => {
if (!node || typeof node !== "object") {
return {
type: PROCESS_NODE_TYPES.ADD,
rawType: "",
taskKey: "",
nodeName: "",
titlePrefix: "处理",
operator: "",
time: "",
content: {},
flowTaskId: "",
completed: true
};
}
const nodeType = resolveNodeType(node);
const rawType = node.nodeType || nodeType;
const displayType = resolveDisplayType(node, nodeType);
return {
type: displayType,
rawType,
taskKey: resolveTaskKey(node),
nodeName: getProcessStepDisplayName(node),
titlePrefix: resolveTitlePrefix(rawType, displayType, node),
operator: resolveOperator(node, displayType),
time: resolveTime(node, displayType),
content: mapNodeContent(node, displayType),
flowTaskId: node.flowTaskId || "",
completed: isNodeCompleted(node)
};
};
const mapProcessChainNodes = (nodes = []) => {
if (!Array.isArray(nodes) || nodes.length === 0)
return [];
return nodes.map((node) => mapProcessNodeToHistoryItem(node));
};
const resolveProcessChainSummary = (data) => {
var _a;
if (!data) {
return {
statusName: "-",
createdAt: "-"
};
}
const addNode = (data.nodes || []).find((item) => item.nodeType === "add");
const createdAt = ((_a = addNode == null ? void 0 : addNode.hazardInfo) == null ? void 0 : _a.createdAt) || "-";
return {
statusName: data.statusName || "-",
createdAt
};
};
exports.PENDING_LABEL = PENDING_LABEL;
exports.getProcessStepIconPath = getProcessStepIconPath;
exports.mapProcessChainNodes = mapProcessChainNodes;
exports.resolveFieldDisplay = resolveFieldDisplay;
exports.resolveProcessChainSummary = resolveProcessChainSummary;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/processChain.js.map

View File

@@ -0,0 +1,61 @@
"use strict";
const CHAIN_LABELS = {
loading: "加载中...",
empty: "暂无流程记录",
personnelSuffix: "人员:",
hazardCode: "隐患编号",
hazardTitle: "隐患标题",
checkSource: "检查形式",
hazardSource: "隐患来源",
hazardArea: "隐患区域",
address: "位置描述",
hazardLevel: "隐患等级",
hazardTag: "隐患标签",
description: "问题描述",
hazardAttachments: "隐患附件",
legalBasis: "参考法规",
assigneeName: "指定整改责任人",
assignDeadline: "指定整改截至日期",
assignStatus: "交办状态",
rectifyStatus: "整改状态",
rectifyPlan: "整改方案",
rectifyResult: "整改结果",
rectifyMeasures: "整改措施",
controlMeasures: "管控措施",
rectifierName: "整改责任人",
managerNames: "管理人员",
memberNames: "整改成员",
planCost: "预计费用",
actualCost: "实际费用",
rectifyAttachments: "整改附件",
rectifySign: "整改签字",
verifyResult: "验收结果",
pass: "通过",
verifyRemark: "验收备注",
verifyAttachments: "验收附件",
verifySign: "验收签字",
writeoffDeadline: "整改时限",
responsibleDept: "治理责任单位",
responsiblePerson: "主要负责人",
mainTreatment: "主要治理内容",
treatmentResult: "治理完成内容",
selfVerify: "自行验收情况",
applySign: "申请签字",
approvalOpinion: "审批意见",
approvalComment: "意见说明",
smsReminder: "短信提醒",
yes: "是",
no: "否",
approvalSign: "审批签字",
attachmentFallback: "附件",
yuan: "元"
};
const LEVEL_NAME_CLASS_MAP = {
一般: "level-normal",
一般隐患: "level-normal",
重大: "level-major",
重大隐患: "level-major"
};
exports.CHAIN_LABELS = CHAIN_LABELS;
exports.LEVEL_NAME_CLASS_MAP = LEVEL_NAME_CLASS_MAP;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/processChainLabels.js.map

View File

@@ -0,0 +1,145 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const components_hazardDetail_processChain = require("./processChain.js");
function useProcessChainScroll(chainSource, loadingSource) {
const instance = common_vendor.getCurrentInstance();
const queryScope = (instance == null ? void 0 : instance.proxy) || instance;
const historyList = common_vendor.ref([]);
const activeIndex = common_vendor.ref(0);
const sectionOffsets = common_vendor.ref([0]);
const contentViewHeight = common_vendor.ref(0);
const contentScrollIntoView = common_vendor.ref("");
const stepScrollIntoView = common_vendor.ref("");
const scrollWithAnimation = common_vendor.ref(true);
const isProgrammaticScroll = common_vendor.ref(false);
let measureLayoutTimer = null;
const measureLayout = () => {
if (!historyList.value.length)
return;
common_vendor.nextTick$1(() => {
const query = common_vendor.index.createSelectorQuery().in(queryScope);
query.select(".content-scroll").boundingClientRect();
query.select(".content-scroll").scrollOffset();
query.selectAll(".node-section").boundingClientRect();
query.exec((res) => {
const containerRect = res == null ? void 0 : res[0];
const scrollOffset = res == null ? void 0 : res[1];
const sections = (res == null ? void 0 : res[2]) || [];
if (!containerRect || !sections.length)
return;
contentViewHeight.value = containerRect.height || 0;
const baseScrollTop = (scrollOffset == null ? void 0 : scrollOffset.scrollTop) || 0;
sectionOffsets.value = sections.map(
(section) => section.top - containerRect.top + baseScrollTop
);
});
});
};
const scheduleMeasureLayout = () => {
clearTimeout(measureLayoutTimer);
measureLayoutTimer = setTimeout(() => {
measureLayout();
}, 80);
};
const rebuildHistory = (data) => {
const nodes = (data == null ? void 0 : data.nodes) || [];
historyList.value = components_hazardDetail_processChain.mapProcessChainNodes(nodes);
activeIndex.value = 0;
contentScrollIntoView.value = "";
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 300);
};
const syncActiveIndex = (scrollTop, scrollHeight = 0) => {
const count = historyList.value.length;
if (!count)
return;
if (scrollHeight > 0 && contentViewHeight.value > 0) {
if (scrollTop + contentViewHeight.value >= scrollHeight - 60) {
if (activeIndex.value !== count - 1) {
activeIndex.value = count - 1;
}
return;
}
}
const offsets = sectionOffsets.value;
if (!offsets.length)
return;
let idx = 0;
for (let i = offsets.length - 1; i >= 0; i--) {
if (scrollTop >= offsets[i] - 80) {
idx = i;
break;
}
}
if (idx !== activeIndex.value) {
activeIndex.value = idx;
}
};
const onContentScroll = (e) => {
if (isProgrammaticScroll.value)
return;
const { scrollTop = 0, scrollHeight = 0 } = e.detail || {};
syncActiveIndex(scrollTop, scrollHeight);
scheduleMeasureLayout();
};
const onScrollToLower = () => {
const count = historyList.value.length;
if (count > 0 && activeIndex.value !== count - 1) {
activeIndex.value = count - 1;
}
};
const scrollToNode = (index) => {
if (index < 0 || index >= historyList.value.length)
return;
isProgrammaticScroll.value = true;
scrollWithAnimation.value = true;
activeIndex.value = index;
contentScrollIntoView.value = "process-node-" + index;
setTimeout(() => {
contentScrollIntoView.value = "";
isProgrammaticScroll.value = false;
scheduleMeasureLayout();
}, 350);
};
common_vendor.watch(
() => typeof loadingSource === "function" ? loadingSource() : loadingSource == null ? void 0 : loadingSource.value,
(loading) => {
if (!loading) {
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 300);
}
}
);
common_vendor.watch(
() => typeof chainSource === "function" ? chainSource() : chainSource == null ? void 0 : chainSource.value,
(val) => rebuildHistory(val),
{ immediate: true, deep: true }
);
common_vendor.watch(activeIndex, (index) => {
stepScrollIntoView.value = "process-step-" + index;
setTimeout(() => {
stepScrollIntoView.value = "";
}, 300);
});
common_vendor.watch(
() => historyList.value.length,
() => scheduleMeasureLayout()
);
common_vendor.onReady(() => {
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 300);
});
return {
historyList,
activeIndex,
contentScrollIntoView,
stepScrollIntoView,
scrollWithAnimation,
onContentScroll,
onScrollToLower,
scrollToNode,
scheduleMeasureLayout
};
}
exports.useProcessChainScroll = useProcessChainScroll;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/useProcessChainScroll.js.map

View File

@@ -80,7 +80,7 @@ const _sfc_main = {
return;
}
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/detail2?hazardId=${item.hazardId}&assignId=${item.assignId || ""}`
url: `/pages/hiddendanger/process-chain?hazardId=${item.hazardId}`
});
};
common_vendor.computed(() => {

View File

@@ -1 +1 @@
<view class="{{['padding', 'page', 'data-v-847f15e8', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{h}}"><view wx:if="{{a}}" class="area-list data-v-847f15e8"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" class="padding bg-white radius margin-bottom data-v-847f15e8"><view class="flex justify-between data-v-847f15e8"><view class="data-v-847f15e8"><view class="text-bold text-black data-v-847f15e8">{{item.a}}</view><view class="margin-top flex align-center data-v-847f15e8"><text class="data-v-847f15e8">颜色:</text><view class="color-dot data-v-847f15e8" style="{{'background-color:' + item.b}}"></view><text class="margin-left-xs data-v-847f15e8">{{item.c}}</text></view></view><view class="data-v-847f15e8"><button class="bg-blue cu-btn data-v-847f15e8" bindtap="{{item.d}}">编辑</button><button class="bg-red cu-btn margin-left data-v-847f15e8" bindtap="{{item.e}}">删除</button></view></view></view></view><view wx:else class="empty-state data-v-847f15e8"><text class="text-gray data-v-847f15e8">暂无区域数据</text></view><button class="add-btn bg-blue round data-v-847f15e8" bindtap="{{c}}">新增公司区域</button><area-form-popup wx:if="{{g}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" bindsubmit="{{d}}" bindclose="{{e}}" u-i="847f15e8-0" bind:__l="__l" bindupdateVisible="{{f}}" u-p="{{g}}"/></view>
<view class="{{['padding', 'page', 'data-v-847f15e8', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{h}}"><view wx:if="{{a}}" class="area-list data-v-847f15e8"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" class="padding bg-white radius margin-bottom data-v-847f15e8"><view class="flex justify-between data-v-847f15e8"><view class="data-v-847f15e8"><view class="text-bold text-black data-v-847f15e8">{{item.a}}</view><view class="margin-top flex align-center data-v-847f15e8"><text class="data-v-847f15e8">颜色:</text><view class="color-dot data-v-847f15e8" style="{{'background-color:' + item.b}}"></view><text class="margin-left-xs data-v-847f15e8">{{item.c}}</text></view></view><view class="data-v-847f15e8"><button class="bg-blue cu-btn data-v-847f15e8" bindtap="{{item.d}}">编辑</button><button class="bg-red cu-btn margin-left data-v-847f15e8" bindtap="{{item.e}}">删除</button></view></view></view></view><view wx:else class="empty-state data-v-847f15e8"><text class="text-gray data-v-847f15e8">暂无区域数据</text></view><button class="add-btn bg-blue round data-v-847f15e8" bindtap="{{c}}">新增区域</button><area-form-popup wx:if="{{g}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" bindsubmit="{{d}}" bindclose="{{e}}" u-i="847f15e8-0" bind:__l="__l" bindupdateVisible="{{f}}" u-p="{{g}}"/></view>

View File

@@ -1,196 +1,22 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
if (!Array) {
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_picker2 + _easycom_up_textarea2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_u_popup2)();
}
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_picker + _easycom_up_textarea + _easycom_up_radio + _easycom_up_radio_group + _easycom_u_popup)();
}
const _sfc_main = {
__name: "application",
setup(__props) {
const showAddPopup = common_vendor.ref(false);
const showHazardPicker = common_vendor.ref(false);
const selectedHazard = common_vendor.ref("");
const selectedHazardId = common_vendor.ref("");
const hazardColumns = common_vendor.ref([["暂无数据"]]);
const acceptanceHazardList = common_vendor.ref([]);
const hazardList = common_vendor.ref([]);
const selectedDeptName = common_vendor.ref("");
const aiGenerating = common_vendor.ref(false);
const sendMsgFlagRadio = common_vendor.ref("yes");
const sendMsgFlag = common_vendor.computed(() => sendMsgFlagRadio.value === "yes");
const formData = common_vendor.reactive({
rectifyDeadline: "",
// 整改时限
responsibleDeptId: "",
// 隐患治理责任单位ID
responsiblePerson: "",
// 主要负责人
mainTreatmentContent: "",
// 主要治理内容
treatmentResult: "",
// 隐患治理完成内容
selfVerifyContent: ""
// 责任单位自行验收情况
});
const fetchWriteOffList = async () => {
try {
const res = await request_api.getMyWriteOffList();
if (res.code === 0 && res.data) {
hazardList.value = res.data;
common_vendor.index.__f__("log", "at pages/closeout/application.vue:166", "销号申请列表:", res.data);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:169", "获取销号申请列表失败:", error);
common_vendor.index.__f__("error", "at pages/closeout/application.vue:47", "获取销号申请列表失败:", error);
}
};
const fetchAcceptanceList = async () => {
try {
const res = await request_api.getAcceptanceList();
if (res.code === 0 && res.data) {
const list = res.data.records || res.data || [];
acceptanceHazardList.value = list;
if (list.length > 0) {
hazardColumns.value = [list.map((item) => item.title || item.hazardTitle || `隐患${item.hazardId}`)];
} else {
hazardColumns.value = [["暂无可申请销号的隐患"]];
}
common_vendor.index.__f__("log", "at pages/closeout/application.vue:186", "可申请销号的隐患列表:", list);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:189", "获取可申请销号隐患列表失败:", error);
}
};
const openAddPopup = () => {
resetForm();
fetchAcceptanceList();
showAddPopup.value = true;
};
const fillHazardRelatedFields = (hazard) => {
formData.rectifyDeadline = hazard.deadline || "";
selectedDeptName.value = hazard.deptName || "";
formData.responsiblePerson = hazard.rectifierName || "";
formData.responsibleDeptId = hazard.deptId || "";
};
const onHazardConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/closeout/application.vue:210", "选择的隐患:", e);
if (e.value && e.value.length > 0) {
selectedHazard.value = e.value[0];
const index = e.indexs[0];
const hazard = acceptanceHazardList.value[index];
if (hazard) {
selectedHazardId.value = hazard.hazardId;
fillHazardRelatedFields(hazard);
}
}
showHazardPicker.value = false;
};
const resetForm = () => {
selectedHazard.value = "";
selectedHazardId.value = "";
selectedDeptName.value = "";
formData.rectifyDeadline = "";
formData.responsibleDeptId = "";
formData.responsiblePerson = "";
formData.mainTreatmentContent = "";
formData.treatmentResult = "";
formData.selfVerifyContent = "";
sendMsgFlagRadio.value = "yes";
};
const handleAiGenerate = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请先选择隐患", icon: "none" });
return;
}
aiGenerating.value = true;
try {
const hazardRes = await request_api.getHiddenDangerDetail({ hazardId: selectedHazardId.value });
if (hazardRes.code !== 0 || !hazardRes.data) {
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
return;
}
const assigns = hazardRes.data.assigns;
if (!assigns || assigns.length === 0 || !assigns[0].rectify) {
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
return;
}
const rectifyId = assigns[0].rectify.rectifyId;
const rectifyRes = await request_api.getRectifyDetail({ rectifyId });
if (rectifyRes.code !== 0 || !rectifyRes.data) {
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
return;
}
const rectifyPlan = rectifyRes.data.rectifyPlan;
if (!rectifyPlan) {
common_vendor.index.showToast({ title: "整改方案内容为空", icon: "none" });
return;
}
const aiRes = await request_api.generateWriteoffContent({ rectifyContent: rectifyPlan });
if (aiRes.code === 0 && aiRes.data) {
formData.mainTreatmentContent = aiRes.data.mainContent || "";
formData.treatmentResult = aiRes.data.completionContent || "";
formData.selfVerifyContent = aiRes.data.selfInspection || "";
common_vendor.index.showToast({ title: "AI生成成功", icon: "success" });
} else {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:285", "AI生成销号方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
}
};
const handleAdd = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
return;
}
const params = {
hazardId: Number(selectedHazardId.value),
// 隐患ID必需
rectifyDeadline: formData.rectifyDeadline || "",
// 整改时限
responsibleDeptId: Number(formData.responsibleDeptId) || 0,
// 隐患治理责任单位ID
responsiblePerson: formData.responsiblePerson || "",
// 主要负责人
mainTreatmentContent: formData.mainTreatmentContent || "",
// 主要治理内容
treatmentResult: formData.treatmentResult || "",
// 隐患治理完成内容
selfVerifyContent: formData.selfVerifyContent || "",
// 责任单位自行验收情况
sendMsgFlag: sendMsgFlag.value
// 是否短信提醒
};
common_vendor.index.__f__("log", "at pages/closeout/application.vue:311", "提交数据:", params);
try {
const res = await request_api.applyDelete(params);
if (res.code === 0) {
common_vendor.index.showToast({ title: "申请成功", icon: "success" });
showAddPopup.value = false;
resetForm();
fetchWriteOffList();
} else {
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:325", "申请失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
const goAddApply = () => {
common_vendor.index.navigateTo({ url: "/pages/closeout/apply" });
};
const editor = (item) => {
if (!(item == null ? void 0 : item.id)) {
@@ -217,11 +43,11 @@ const _sfc_main = {
return "status-rejected";
return "status-default";
};
common_vendor.onMounted(() => {
common_vendor.onShow(() => {
fetchWriteOffList();
});
return (_ctx, _cache) => {
return common_vendor.e({
return {
a: common_vendor.f(hazardList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.hazardTitle),
@@ -235,74 +61,9 @@ const _sfc_main = {
i: item.hazardId || item.id
};
}),
b: common_vendor.o(openAddPopup),
c: common_vendor.o(($event) => showAddPopup.value = false),
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
f: common_vendor.o(($event) => showHazardPicker.value = true)
}, {}, {
k: common_vendor.t(formData.rectifyDeadline || "请先选择隐患"),
l: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
m: common_vendor.t(selectedDeptName.value || "请先选择隐患"),
n: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
o: common_vendor.t(formData.responsiblePerson || "请先选择隐患"),
p: common_vendor.n(formData.responsiblePerson ? "" : "text-gray"),
q: !aiGenerating.value
}, !aiGenerating.value ? {} : {}, {
r: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
s: aiGenerating.value,
t: aiGenerating.value,
v: common_vendor.o(handleAiGenerate),
w: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
x: common_vendor.p({
placeholder: "请输入主要治理内容",
modelValue: formData.mainTreatmentContent
}),
y: common_vendor.o(($event) => formData.treatmentResult = $event),
z: common_vendor.p({
placeholder: "请输入隐患治理完成情况",
modelValue: formData.treatmentResult
}),
A: common_vendor.o(($event) => formData.selfVerifyContent = $event),
B: common_vendor.p({
placeholder: "请输入隐患治理责任单位自行验收的情况",
modelValue: formData.selfVerifyContent
}),
C: common_vendor.p({
label: "是",
name: "yes",
customStyle: {
marginRight: "48rpx"
}
}),
D: common_vendor.p({
label: "否",
name: "no"
}),
E: common_vendor.o(($event) => sendMsgFlagRadio.value = $event),
F: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: sendMsgFlagRadio.value
}),
G: common_vendor.o(($event) => showAddPopup.value = false),
H: common_vendor.o(handleAdd),
I: common_vendor.o(($event) => showAddPopup.value = false),
J: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20",
safeAreaInsetBottom: false
}),
K: common_vendor.o(onHazardConfirm),
L: common_vendor.o(($event) => showHazardPicker.value = false),
M: common_vendor.o(($event) => showHazardPicker.value = false),
N: common_vendor.p({
show: showHazardPicker.value,
columns: hazardColumns.value
}),
O: common_vendor.gei(_ctx, "")
});
b: common_vendor.o(goAddApply),
c: common_vendor.gei(_ctx, "")
};
};
}
};

View File

@@ -1,10 +1,4 @@
{
"navigationBarTitleText": "销号申请",
"usingComponents": {
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
}
"usingComponents": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -58,102 +58,4 @@
.status-default.data-v-4b6250eb {
background: #F5F5F5;
color: #8C8C8C;
}
.popup-content.data-v-4b6250eb {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.popup-header.data-v-4b6250eb {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.popup-header .popup-title.data-v-4b6250eb {
font-size: 32rpx;
color: #333;
}
.popup-header .popup-close.data-v-4b6250eb {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.popup-body.data-v-4b6250eb {
padding: 30rpx;
}
.popup-footer.data-v-4b6250eb {
display: flex;
border-top: 1rpx solid #eee;
}
.popup-footer button.data-v-4b6250eb {
flex: 1;
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
margin: 0 !important;
padding: 0 !important;
font-size: 30rpx;
}
.popup-footer button.data-v-4b6250eb::after {
border: none;
}
.popup-footer .btn-cancel.data-v-4b6250eb {
background: #fff;
color: #666;
}
.popup-footer .btn-confirm.data-v-4b6250eb {
color: #fff;
}
.ai-btn-wrapper.data-v-4b6250eb {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-4b6250eb {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-4b6250eb::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-4b6250eb {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-4b6250eb {
opacity: 0.7;
}
.picker-input.data-v-4b6250eb {
background: #fff;
border-radius: 8rpx;
padding: 24rpx 20rpx;
margin-bottom: 20rpx;
border: 1rpx solid #eee;
}
.picker-input text.data-v-4b6250eb {
font-size: 28rpx;
}
.picker-input.readonly.data-v-4b6250eb {
background: #f5f5f5;
color: #666;
}
.static-field.data-v-4b6250eb {
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333;
line-height: 1.5;
}

View File

@@ -0,0 +1,549 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_hazardNav = require("../../utils/hazardNav.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_textarea2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_picker2 + _easycom_u_popup2)();
}
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_picker + _easycom_u_popup)();
}
const _sfc_main = {
__name: "apply",
setup(__props) {
const showHazardPicker = common_vendor.ref(false);
const hazardLocked = common_vendor.ref(false);
const selectedHazard = common_vendor.ref("");
const selectedHazardId = common_vendor.ref("");
const assignId = common_vendor.ref("");
const taskId = common_vendor.ref("");
const hazardColumns = common_vendor.ref([["暂无数据"]]);
const selectableHazardList = common_vendor.ref([]);
const selectedDeptName = common_vendor.ref("");
const aiGenerating = common_vendor.ref(false);
const sendMsgFlagRadio = common_vendor.ref("yes");
const sendMsgFlag = common_vendor.computed(() => sendMsgFlagRadio.value === "yes");
const nextStepName = common_vendor.ref("");
const nextStepLoading = common_vendor.ref(false);
const nextStepDisplay = common_vendor.computed(() => {
if (nextStepLoading.value)
return "加载中...";
return nextStepName.value || "暂无下一步流程";
});
const selectedAssigneeIdentityId = common_vendor.ref("");
const selectedAssigneeName = common_vendor.ref("");
const pickerAssigneeIdentityId = common_vendor.ref("");
const pickerAssigneeName = common_vendor.ref("");
const showAssigneePopup = common_vendor.ref(false);
const assigneeList = common_vendor.ref([]);
const assigneeLoading = common_vendor.ref(false);
const formData = common_vendor.reactive({
rectifyDeadline: "",
responsibleDeptId: "",
responsiblePerson: "",
mainTreatmentContent: "",
treatmentResult: "",
selfVerifyContent: ""
});
const fillHazardRelatedFields = (hazard) => {
formData.rectifyDeadline = hazard.deadline || "";
selectedDeptName.value = hazard.deptName || "";
formData.responsiblePerson = hazard.rectifierName || "";
formData.responsibleDeptId = hazard.deptId || "";
};
const resolveTaskIdFromHazard = (hazard) => {
var _a, _b;
if (!hazard)
return "";
const candidates = [
hazard.taskId,
hazard.flowTaskId,
hazard.currentTaskId,
(_a = hazard.flowTask) == null ? void 0 : _a.taskId,
(_b = hazard.currentTask) == null ? void 0 : _b.taskId
];
for (const id of candidates) {
if (id != null && id !== "")
return String(id);
}
return "";
};
const resolveTaskIdFromAssign = (assign) => {
var _a, _b, _c, _d, _e;
if (!assign)
return "";
const candidates = [
assign.taskId,
assign.flowTaskId,
assign.currentTaskId,
(_a = assign.rectify) == null ? void 0 : _a.taskId,
(_b = assign.rectify) == null ? void 0 : _b.flowTaskId,
(_c = assign.rectify) == null ? void 0 : _c.currentTaskId,
(_d = assign.flow) == null ? void 0 : _d.taskId,
(_e = assign.currentTask) == null ? void 0 : _e.taskId
];
for (const id of candidates) {
if (id != null && id !== "")
return String(id);
}
return "";
};
const resolveAssignWithRectify = (assigns, currentAssignId) => {
if (!(assigns == null ? void 0 : assigns.length))
return null;
if (currentAssignId) {
const byAssignId = assigns.find(
(item) => String(item.assignId) === String(currentAssignId) && item.rectify
);
if (byAssignId)
return byAssignId;
}
return assigns.find((item) => item.rectify) || assigns[0] || null;
};
const resolveTaskIdFromDetail = (data) => {
if (!data)
return "";
if (data.taskId)
return String(data.taskId);
if (data.flowTaskId)
return String(data.flowTaskId);
if (data.currentTaskId)
return String(data.currentTaskId);
const assigns = data.assigns || [];
const matchedAssign = resolveAssignWithRectify(assigns, assignId.value);
const fromMatched = resolveTaskIdFromAssign(matchedAssign);
if (fromMatched)
return fromMatched;
for (const assign of assigns) {
const id = resolveTaskIdFromAssign(assign);
if (id)
return id;
}
return "";
};
const resolveNextTaskName = (data) => {
var _a;
if (!data)
return "";
const branches = data.branches || [];
const matchedBranch = branches.find((item) => item.matched) || branches[0];
return ((_a = matchedBranch == null ? void 0 : matchedBranch.nextNode) == null ? void 0 : _a.taskName) || "";
};
const buildPreviewVariables = () => ({
quickApprove: true
});
const getStoredUserInfo = () => {
try {
const stored = common_vendor.index.getStorageSync("userInfo");
if (!stored)
return {};
return typeof stored === "string" ? JSON.parse(stored) : stored;
} catch (error) {
return {};
}
};
const getCurrentDeptId = () => {
const userInfo = getStoredUserInfo();
const identity = userInfo.userIdentity;
if ((identity == null ? void 0 : identity.deptId) != null && identity.deptId !== "") {
return String(identity.deptId);
}
if (userInfo.deptId != null && userInfo.deptId !== "") {
return String(userInfo.deptId);
}
return "";
};
const resolveAssigneeIdentityId = (user) => {
if (!user)
return "";
const id = user.identityId ?? user.userIdentityId ?? user.userId ?? "";
return id === "" || id == null ? "" : String(id);
};
const getAssigneeItemKey = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (identityId)
return `identity-${identityId}`;
return `user-${user.userId || user.nickName || ""}`;
};
const formatAssigneeDisplayName = (user) => {
if (!user)
return "";
const name = user.nickName || user.userName || user.name || "";
const identityName = user.identityName || "";
if (name && identityName)
return `${name}${identityName}`;
return name || identityName || "未知人员";
};
const resolveAssigneeDeptUserType = () => 2;
const fetchAssigneeList = async () => {
const deptId = getCurrentDeptId();
if (!deptId) {
assigneeList.value = [];
return;
}
assigneeLoading.value = true;
try {
const res = await request_api.getDeptUsers(deptId, { type: resolveAssigneeDeptUserType() });
if (res.code === 0) {
assigneeList.value = res.data || [];
} else {
assigneeList.value = [];
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/apply.vue:320", "获取部门人员失败:", error);
assigneeList.value = [];
} finally {
assigneeLoading.value = false;
}
};
const openAssigneePopup = async () => {
pickerAssigneeIdentityId.value = selectedAssigneeIdentityId.value;
pickerAssigneeName.value = selectedAssigneeName.value;
showAssigneePopup.value = true;
await fetchAssigneeList();
};
const onAssigneeItemClick = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (!identityId)
return;
pickerAssigneeIdentityId.value = String(identityId);
pickerAssigneeName.value = formatAssigneeDisplayName(user);
};
const confirmAssigneeSelect = () => {
if (!pickerAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return;
}
selectedAssigneeIdentityId.value = pickerAssigneeIdentityId.value;
selectedAssigneeName.value = pickerAssigneeName.value;
showAssigneePopup.value = false;
};
const cancelAssigneeSelect = () => {
showAssigneePopup.value = false;
};
const fetchNextStep = async () => {
nextStepLoading.value = true;
try {
const currentTaskId = taskId.value;
if (!currentTaskId) {
nextStepName.value = "";
return;
}
const res = await request_api.getFlowNextNodes({
taskId: currentTaskId,
previewVariables: buildPreviewVariables(),
includeSubProcess: true
});
if (res.code === 0) {
const payload = res.data && typeof res.data === "object" ? res.data : res;
nextStepName.value = resolveNextTaskName(payload);
} else {
nextStepName.value = "";
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/apply.vue:375", "获取下一步流程失败:", error);
nextStepName.value = "";
} finally {
nextStepLoading.value = false;
}
};
const resolveTaskIdForHazard = async (hazard) => {
const presetTaskId = taskId.value;
const fromHazard = resolveTaskIdFromHazard(hazard);
if (fromHazard) {
taskId.value = fromHazard;
}
if (!(hazard == null ? void 0 : hazard.hazardId)) {
return;
}
if (!assignId.value && hazard.assignId) {
assignId.value = String(hazard.assignId);
}
if (taskId.value) {
return;
}
try {
const params = { hazardId: hazard.hazardId };
if (assignId.value) {
params.assignId = assignId.value;
}
const res = await request_api.getHiddenDangerDetail(params);
if (res.code === 0 && res.data) {
taskId.value = resolveTaskIdFromDetail(res.data) || presetTaskId;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/apply.vue:411", "获取隐患任务信息失败:", error);
}
if (!taskId.value && presetTaskId) {
taskId.value = presetTaskId;
}
};
const resetFlowSelection = () => {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
nextStepName.value = "";
};
const applySelectedHazard = async (hazard) => {
if (!hazard)
return;
selectedHazard.value = hazard.title || hazard.hazardTitle || `隐患${hazard.hazardId}`;
selectedHazardId.value = hazard.hazardId;
assignId.value = hazard.assignId ? String(hazard.assignId) : "";
if (hazard.taskId) {
taskId.value = String(hazard.taskId);
}
fillHazardRelatedFields(hazard);
resetFlowSelection();
await resolveTaskIdForHazard(hazard);
await fetchNextStep();
};
const resolveSelectableRecords = (data) => {
if (!data)
return [];
if (Array.isArray(data))
return data;
if (Array.isArray(data.records))
return data.records;
return [];
};
const canApplyWriteoff = (item) => (item == null ? void 0 : item.statusName) === "待销号" && ((item == null ? void 0 : item.applyFlag) === true || (item == null ? void 0 : item.applyFlag) === 1 || (item == null ? void 0 : item.applyFlag) === "1");
const fetchSelectableHazardList = async () => {
try {
const res = await request_api.getHiddenDangerList({ pageNum: 1, pageSize: 100, status: 4 });
if (res.code === 0 && res.data) {
const list = resolveSelectableRecords(res.data).filter(canApplyWriteoff);
selectableHazardList.value = list;
if (list.length > 0) {
hazardColumns.value = [list.map((item) => item.title || item.hazardTitle || `隐患${item.hazardId}`)];
} else {
hazardColumns.value = [["暂无可申请销号的隐患"]];
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/apply.vue:464", "获取可申请销号隐患列表失败:", error);
}
};
const onHazardConfirm = async (e) => {
if (e.value && e.value.length > 0) {
const index = e.indexs[0];
const hazard = selectableHazardList.value[index];
if (hazard) {
await applySelectedHazard(hazard);
}
}
showHazardPicker.value = false;
};
const handleAiGenerate = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请先选择隐患", icon: "none" });
return;
}
aiGenerating.value = true;
try {
const hazardRes = await request_api.getHiddenDangerDetail({ hazardId: selectedHazardId.value });
if (hazardRes.code !== 0 || !hazardRes.data) {
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
return;
}
const assigns = hazardRes.data.assigns;
if (!assigns || assigns.length === 0 || !assigns[0].rectify) {
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
return;
}
const rectifyId = assigns[0].rectify.rectifyId;
const rectifyRes = await request_api.getRectifyDetail({ rectifyId });
if (rectifyRes.code !== 0 || !rectifyRes.data) {
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
return;
}
const rectifyPlan = rectifyRes.data.rectifyPlan;
if (!rectifyPlan) {
common_vendor.index.showToast({ title: "整改方案内容为空", icon: "none" });
return;
}
const aiRes = await request_api.generateWriteoffContent({ rectifyContent: rectifyPlan });
if (aiRes.code === 0 && aiRes.data) {
formData.mainTreatmentContent = aiRes.data.mainContent || "";
formData.treatmentResult = aiRes.data.completionContent || "";
formData.selfVerifyContent = aiRes.data.selfInspection || "";
common_vendor.index.showToast({ title: "AI生成成功", icon: "success" });
} else {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/apply.vue:529", "AI生成销号方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
}
};
const handleCancel = () => {
common_vendor.index.navigateBack();
};
const handleSubmit = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
return;
}
if (!selectedAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return;
}
const params = {
hazardId: Number(selectedHazardId.value),
rectifyDeadline: formData.rectifyDeadline || "",
responsibleDeptId: Number(formData.responsibleDeptId) || 0,
responsiblePerson: formData.responsiblePerson || "",
mainTreatmentContent: formData.mainTreatmentContent || "",
treatmentResult: formData.treatmentResult || "",
selfVerifyContent: formData.selfVerifyContent || "",
assigneeIdentityId: selectedAssigneeIdentityId.value,
sendMsgFlag: sendMsgFlag.value
};
try {
const res = await request_api.applyDelete(params);
if (res.code === 0) {
common_vendor.index.showToast({ title: "申请成功", icon: "success" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
} else {
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/apply.vue:573", "申请失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
common_vendor.onLoad(async (options) => {
hazardLocked.value = (options == null ? void 0 : options.locked) === "1";
if (options == null ? void 0 : options.assignId) {
assignId.value = String(options.assignId);
}
if (options == null ? void 0 : options.taskId) {
taskId.value = String(options.taskId);
}
const hazardFromOptions = utils_hazardNav.buildWriteoffHazardFromOptions(options);
if (hazardFromOptions == null ? void 0 : hazardFromOptions.hazardId) {
await applySelectedHazard(hazardFromOptions);
return;
}
if (!hazardLocked.value) {
await fetchSelectableHazardList();
}
if (taskId.value) {
await fetchNextStep();
}
});
return (_ctx, _cache) => {
return common_vendor.e({
a: hazardLocked.value
}, hazardLocked.value ? {
b: common_vendor.t(selectedHazard.value || "加载中..."),
c: common_vendor.n(selectedHazard.value ? "" : "text-gray")
} : {
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
f: common_vendor.o(($event) => showHazardPicker.value = true)
}, {
g: common_vendor.t(formData.rectifyDeadline || "请先选择隐患"),
h: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
i: common_vendor.t(selectedDeptName.value || "请先选择隐患"),
j: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
k: common_vendor.t(formData.responsiblePerson || "请先选择隐患"),
l: common_vendor.n(formData.responsiblePerson ? "" : "text-gray"),
m: !aiGenerating.value
}, !aiGenerating.value ? {} : {}, {
n: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
o: aiGenerating.value,
p: aiGenerating.value,
q: common_vendor.o(handleAiGenerate),
r: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
s: common_vendor.p({
placeholder: "请输入主要治理内容",
modelValue: formData.mainTreatmentContent
}),
t: common_vendor.o(($event) => formData.treatmentResult = $event),
v: common_vendor.p({
placeholder: "请输入隐患治理完成情况",
modelValue: formData.treatmentResult
}),
w: common_vendor.o(($event) => formData.selfVerifyContent = $event),
x: common_vendor.p({
placeholder: "请输入隐患治理责任单位自行验收的情况",
modelValue: formData.selfVerifyContent
}),
y: common_vendor.t(nextStepDisplay.value),
z: common_vendor.t(selectedAssigneeName.value || "请选择下一步处理人"),
A: !selectedAssigneeName.value ? 1 : "",
B: common_vendor.o(openAssigneePopup),
C: common_vendor.p({
label: "是",
name: "yes",
customStyle: {
marginRight: "48rpx"
}
}),
D: common_vendor.p({
label: "否",
name: "no"
}),
E: common_vendor.o(($event) => sendMsgFlagRadio.value = $event),
F: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: sendMsgFlagRadio.value
}),
G: common_vendor.o(handleCancel),
H: common_vendor.o(handleSubmit),
I: !hazardLocked.value
}, !hazardLocked.value ? {
J: common_vendor.o(onHazardConfirm),
K: common_vendor.o(($event) => showHazardPicker.value = false),
L: common_vendor.o(($event) => showHazardPicker.value = false),
M: common_vendor.p({
show: showHazardPicker.value,
columns: hazardColumns.value
})
} : {}, {
N: common_vendor.o(cancelAssigneeSelect),
O: assigneeLoading.value
}, assigneeLoading.value ? {} : assigneeList.value.length === 0 ? {} : {
Q: common_vendor.f(assigneeList.value, (user, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(formatAssigneeDisplayName(user)),
b: String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user))
}, String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user)) ? {} : {}, {
c: getAssigneeItemKey(user),
d: String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user)) ? 1 : "",
e: common_vendor.o(($event) => onAssigneeItemClick(user), getAssigneeItemKey(user))
});
})
}, {
P: assigneeList.value.length === 0,
R: common_vendor.o(cancelAssigneeSelect),
S: common_vendor.o(confirmAssigneeSelect),
T: common_vendor.o(cancelAssigneeSelect),
U: common_vendor.p({
show: showAssigneePopup.value,
mode: "bottom",
round: "20"
}),
V: common_vendor.gei(_ctx, "")
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-15674ee6"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/apply.js.map

View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "新增销号申请",
"usingComponents": {
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,172 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-15674ee6 {
min-height: 100vh;
background: #EBF2FC;
}
.ai-btn-wrapper.data-v-15674ee6 {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-15674ee6 {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-15674ee6::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-15674ee6 {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-15674ee6 {
opacity: 0.7;
}
.picker-input.data-v-15674ee6 {
background: #fff;
border-radius: 8rpx;
padding: 24rpx 20rpx;
margin-bottom: 20rpx;
border: 1rpx solid #eee;
}
.picker-input text.data-v-15674ee6 {
font-size: 28rpx;
}
.picker-input.readonly.data-v-15674ee6 {
background: #f5f5f5;
color: #666;
}
.static-field.data-v-15674ee6 {
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333;
line-height: 1.5;
}
.select-trigger.data-v-15674ee6 {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
}
.select-trigger .select-content.data-v-15674ee6 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.user-popup.data-v-15674ee6 {
background: #fff;
}
.user-popup .popup-header.data-v-15674ee6 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.user-popup .popup-header .popup-title.data-v-15674ee6 {
font-size: 32rpx;
color: #333;
}
.user-popup .popup-header .popup-close.data-v-15674ee6 {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.user-popup .user-list-scroll.data-v-15674ee6 {
max-height: 600rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.user-popup .empty-tip.data-v-15674ee6 {
padding: 80rpx 20rpx;
text-align: center;
color: #909399;
font-size: 26rpx;
}
.user-popup .user-item.data-v-15674ee6 {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.user-popup .user-item.data-v-15674ee6:last-child {
border-bottom: none;
}
.user-popup .user-item.active .user-item-text.data-v-15674ee6 {
color: #2667E9;
font-weight: 600;
}
.user-popup .user-item .user-item-text.data-v-15674ee6 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.user-popup .popup-footer.data-v-15674ee6 {
display: flex;
gap: 24rpx;
padding: 24rpx 30rpx;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
background: #fff;
}
.user-popup .popup-footer button.data-v-15674ee6 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
margin: 0;
padding: 0;
}
.user-popup .popup-footer button.data-v-15674ee6::after {
border: none;
}
.user-popup .popup-footer .btn-cancel.data-v-15674ee6 {
background: #fff;
color: #2667E9;
border: 2rpx solid #2667E9;
}
.user-popup .popup-footer .btn-confirm.data-v-15674ee6 {
color: #fff;
border: none;
}

View File

@@ -0,0 +1,904 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_upload = require("../../utils/upload.js");
const utils_hazardNav = require("../../utils/hazardNav.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
const _easycom_wd_signature2 = common_vendor.resolveComponent("wd-signature");
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_textarea2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_wd_signature2 + _easycom_up_picker2 + _easycom_u_popup2)();
}
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_wd_signature = () => "../../node-modules/wot-design-uni/components/wd-signature/wd-signature.js";
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_radio + _easycom_up_radio_group + _easycom_wd_signature + _easycom_up_picker + _easycom_u_popup)();
}
const FLOW_END_STEP_NAME = "隐患流程结束";
const _sfc_main = {
__name: "approval",
setup(__props) {
const showHazardPicker = common_vendor.ref(false);
const hazardLocked = common_vendor.ref(false);
const selectedHazard = common_vendor.ref("");
const selectedHazardId = common_vendor.ref("");
const applyId = common_vendor.ref("");
const assignId = common_vendor.ref("");
const taskId = common_vendor.ref("");
const hazardColumns = common_vendor.ref([["暂无数据"]]);
const acceptanceHazardList = common_vendor.ref([]);
const selectedDeptName = common_vendor.ref("");
const aiGenerating = common_vendor.ref(false);
const quickApproveRadio = common_vendor.ref("yes");
const quickApprove = common_vendor.computed(() => quickApproveRadio.value === "yes");
const sendMsgFlagRadio = common_vendor.ref("yes");
const sendMsgFlag = common_vendor.computed(() => sendMsgFlagRadio.value === "yes");
const nextStepName = common_vendor.ref("");
const nextStepLoading = common_vendor.ref(false);
const nextStepDisplay = common_vendor.computed(() => {
if (nextStepLoading.value)
return "加载中...";
return nextStepName.value || "暂无下一步流程";
});
const needNextAssignee = common_vendor.computed(() => {
if (formData.approvalResult !== 1)
return false;
if (quickApprove.value && nextStepName.value === FLOW_END_STEP_NAME)
return false;
return true;
});
const selectedAssigneeIdentityId = common_vendor.ref("");
const selectedAssigneeName = common_vendor.ref("");
const pickerAssigneeIdentityId = common_vendor.ref("");
const pickerAssigneeName = common_vendor.ref("");
const showAssigneePopup = common_vendor.ref(false);
const assigneeList = common_vendor.ref([]);
const assigneeLoading = common_vendor.ref(false);
const showCanvas = common_vendor.ref(true);
const signatureUrl = common_vendor.ref("");
const signatureServerPath = common_vendor.ref("");
const signatureWidth = common_vendor.ref(340);
const signatureRef = common_vendor.ref(null);
const isSignatureEmpty = common_vendor.ref(true);
const isSubmitting = common_vendor.ref(false);
const signatureLocalPath = common_vendor.ref("");
const approvalOptions = [
{ label: "重新整改", value: "rectify" },
{ label: "重新验收", value: "verify" }
];
const formData = common_vendor.reactive({
rectifyDeadline: "",
responsibleDeptId: "",
responsiblePerson: "",
mainTreatmentContent: "",
treatmentResult: "",
selfVerifyContent: "",
approvalResult: 1,
approvalOpinion: "",
opinionRemark: ""
});
const onApprovalResultChange = (result) => {
formData.approvalResult = result;
if (result === 2) {
quickApproveRadio.value = "no";
formData.approvalOpinion = "";
formData.opinionRemark = "";
} else {
formData.approvalOpinion = "";
formData.opinionRemark = "";
quickApproveRadio.value = "yes";
}
resetSignature();
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
if (result === 1) {
fetchNextStep();
} else {
nextStepName.value = "";
}
};
const fillHazardRelatedFields = (hazard) => {
formData.rectifyDeadline = hazard.deadline || "";
selectedDeptName.value = hazard.deptName || "";
formData.responsiblePerson = hazard.rectifierName || "";
formData.responsibleDeptId = hazard.deptId || "";
};
const applyWriteoffHazardPreview = (hazard) => {
if (!hazard)
return;
selectedHazard.value = hazard.title || hazard.hazardTitle || `隐患${hazard.hazardId}`;
selectedHazardId.value = String(hazard.hazardId);
if (hazard.assignId) {
assignId.value = String(hazard.assignId);
}
if (hazard.taskId) {
taskId.value = String(hazard.taskId);
}
fillHazardRelatedFields(hazard);
};
const resolveTaskIdFromHazard = (hazard) => {
var _a, _b;
if (!hazard)
return "";
const candidates = [
hazard.taskId,
hazard.flowTaskId,
hazard.currentTaskId,
(_a = hazard.flowTask) == null ? void 0 : _a.taskId,
(_b = hazard.currentTask) == null ? void 0 : _b.taskId
];
for (const id of candidates) {
if (id != null && id !== "")
return String(id);
}
return "";
};
const resolveTaskIdFromAssign = (assign) => {
var _a, _b, _c, _d, _e;
if (!assign)
return "";
const candidates = [
assign.taskId,
assign.flowTaskId,
assign.currentTaskId,
(_a = assign.rectify) == null ? void 0 : _a.taskId,
(_b = assign.rectify) == null ? void 0 : _b.flowTaskId,
(_c = assign.rectify) == null ? void 0 : _c.currentTaskId,
(_d = assign.flow) == null ? void 0 : _d.taskId,
(_e = assign.currentTask) == null ? void 0 : _e.taskId
];
for (const id of candidates) {
if (id != null && id !== "")
return String(id);
}
return "";
};
const resolveAssignWithRectify = (assigns, currentAssignId) => {
if (!(assigns == null ? void 0 : assigns.length))
return null;
if (currentAssignId) {
const byAssignId = assigns.find(
(item) => String(item.assignId) === String(currentAssignId) && item.rectify
);
if (byAssignId)
return byAssignId;
}
return assigns.find((item) => item.rectify) || assigns[0] || null;
};
const resolveTaskIdFromDetail = (data) => {
if (!data)
return "";
if (data.taskId)
return String(data.taskId);
if (data.flowTaskId)
return String(data.flowTaskId);
if (data.currentTaskId)
return String(data.currentTaskId);
const assigns = data.assigns || [];
const matchedAssign = resolveAssignWithRectify(assigns, assignId.value);
const fromMatched = resolveTaskIdFromAssign(matchedAssign);
if (fromMatched)
return fromMatched;
for (const assign of assigns) {
const id = resolveTaskIdFromAssign(assign);
if (id)
return id;
}
return "";
};
const resolveNextTaskName = (data) => {
var _a;
if (!data)
return "";
const branches = data.branches || [];
const matchedBranch = branches.find((item) => item.matched) || branches[0];
return ((_a = matchedBranch == null ? void 0 : matchedBranch.nextNode) == null ? void 0 : _a.taskName) || "";
};
const buildPreviewVariables = () => {
if (formData.approvalResult === 2) {
return { pass: false };
}
return {
pass: true,
quickApprove: quickApproveRadio.value === "yes",
type: "agree"
};
};
const getStoredUserInfo = () => {
try {
const stored = common_vendor.index.getStorageSync("userInfo");
if (!stored)
return {};
return typeof stored === "string" ? JSON.parse(stored) : stored;
} catch (error) {
return {};
}
};
const getCurrentDeptId = () => {
const userInfo = getStoredUserInfo();
const identity = userInfo.userIdentity;
if ((identity == null ? void 0 : identity.deptId) != null && identity.deptId !== "") {
return String(identity.deptId);
}
if (userInfo.deptId != null && userInfo.deptId !== "") {
return String(userInfo.deptId);
}
return "";
};
const resolveAssigneeIdentityId = (user) => {
if (!user)
return "";
const id = user.identityId ?? user.userIdentityId ?? user.userId ?? "";
return id === "" || id == null ? "" : String(id);
};
const getAssigneeItemKey = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (identityId)
return `identity-${identityId}`;
return `user-${user.userId || user.nickName || ""}`;
};
const formatAssigneeDisplayName = (user) => {
if (!user)
return "";
const name = user.nickName || user.userName || user.name || "";
const identityName = user.identityName || "";
if (name && identityName)
return `${name}${identityName}`;
return name || identityName || "未知人员";
};
const resolveAssigneeDeptUserType = () => {
if (formData.approvalResult === 2)
return 3;
return quickApproveRadio.value === "yes" ? 2 : 3;
};
const fetchAssigneeList = async () => {
const deptId = getCurrentDeptId();
if (!deptId) {
assigneeList.value = [];
return;
}
assigneeLoading.value = true;
try {
const res = await request_api.getDeptUsers(deptId, { type: resolveAssigneeDeptUserType() });
if (res.code === 0) {
assigneeList.value = res.data || [];
} else {
assigneeList.value = [];
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:500", "获取部门人员失败:", error);
assigneeList.value = [];
} finally {
assigneeLoading.value = false;
}
};
const openAssigneePopup = async () => {
pickerAssigneeIdentityId.value = selectedAssigneeIdentityId.value;
pickerAssigneeName.value = selectedAssigneeName.value;
showAssigneePopup.value = true;
await fetchAssigneeList();
};
const onAssigneeItemClick = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (!identityId)
return;
pickerAssigneeIdentityId.value = String(identityId);
pickerAssigneeName.value = formatAssigneeDisplayName(user);
};
const confirmAssigneeSelect = () => {
if (!pickerAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return;
}
selectedAssigneeIdentityId.value = pickerAssigneeIdentityId.value;
selectedAssigneeName.value = pickerAssigneeName.value;
showAssigneePopup.value = false;
};
const cancelAssigneeSelect = () => {
showAssigneePopup.value = false;
};
const fetchNextStep = async () => {
nextStepLoading.value = true;
try {
const currentTaskId = taskId.value;
if (!currentTaskId) {
nextStepName.value = "";
return;
}
const res = await request_api.getFlowNextNodes({
taskId: currentTaskId,
previewVariables: buildPreviewVariables(),
includeSubProcess: true
});
if (res.code === 0) {
const payload = res.data && typeof res.data === "object" ? res.data : res;
nextStepName.value = resolveNextTaskName(payload);
if (!needNextAssignee.value) {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
}
} else {
nextStepName.value = "";
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:559", "获取下一步流程失败:", error);
nextStepName.value = "";
} finally {
nextStepLoading.value = false;
}
};
const resolveTaskIdForHazard = async (hazard) => {
const presetTaskId = taskId.value;
const fromHazard = resolveTaskIdFromHazard(hazard);
if (fromHazard) {
taskId.value = fromHazard;
}
if (!(hazard == null ? void 0 : hazard.hazardId)) {
return;
}
if (!assignId.value && hazard.assignId) {
assignId.value = String(hazard.assignId);
}
if (taskId.value) {
return;
}
try {
const params = { hazardId: hazard.hazardId };
if (assignId.value) {
params.assignId = assignId.value;
}
const res = await request_api.getHiddenDangerDetail(params);
if (res.code === 0 && res.data) {
taskId.value = resolveTaskIdFromDetail(res.data) || presetTaskId;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:595", "获取隐患任务信息失败:", error);
}
if (!taskId.value && presetTaskId) {
taskId.value = presetTaskId;
}
};
const resetFlowSelection = () => {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
nextStepName.value = "";
};
const applySelectedHazard = async (hazard) => {
if (!hazard)
return;
selectedHazard.value = hazard.title || hazard.hazardTitle || `隐患${hazard.hazardId}`;
selectedHazardId.value = hazard.hazardId;
assignId.value = hazard.assignId ? String(hazard.assignId) : "";
fillHazardRelatedFields(hazard);
resetFlowSelection();
await resolveTaskIdForHazard(hazard);
await fetchNextStep();
};
const formatDeadline = (value) => {
if (!value)
return "";
return String(value).split(" ")[0];
};
const applyWriteoffFormData = (data) => {
if (!data)
return;
if (data.hazardId != null) {
selectedHazardId.value = String(data.hazardId);
}
selectedHazard.value = data.title || "";
formData.rectifyDeadline = formatDeadline(data.rectifyDeadline);
formData.responsibleDeptId = data.responsibleDeptId ?? "";
selectedDeptName.value = data.responsibleDeptName || "";
formData.responsiblePerson = data.responsiblePerson || "";
if (data.applyId != null) {
applyId.value = String(data.applyId);
}
formData.mainTreatmentContent = data.mainTreatmentContent || "";
formData.treatmentResult = data.treatmentResult || "";
formData.selfVerifyContent = data.selfVerifyContent || "";
};
const fetchWriteoffForm = async (hazardId) => {
if (!hazardId)
return null;
try {
const res = await request_api.getWriteoffForm(hazardId);
if (res.code === 0 && res.data) {
applyWriteoffFormData(res.data);
} else {
common_vendor.index.showToast({ title: res.msg || "获取销号审批表单失败", icon: "none" });
}
return res;
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:654", "获取销号审批表单失败:", error);
common_vendor.index.showToast({ title: "获取销号审批表单失败", icon: "none" });
return null;
}
};
const onHazardConfirm = async (e) => {
if (e.value && e.value.length > 0) {
const index = e.indexs[0];
const hazard = acceptanceHazardList.value[index];
if (hazard) {
await applySelectedHazard(hazard);
}
}
showHazardPicker.value = false;
};
common_vendor.watch(quickApproveRadio, (value) => {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
if (value === "yes") {
formData.approvalOpinion = "";
formData.opinionRemark = "";
}
fetchNextStep();
});
common_vendor.watch(needNextAssignee, (value) => {
if (!value) {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
}
});
const applySignatureFromServer = (signPath) => {
const url = signPath ? utils_upload.toSubmitFileUrl(signPath) : "";
if (!url) {
showCanvas.value = true;
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
isSignatureEmpty.value = true;
return;
}
signatureServerPath.value = url;
signatureUrl.value = url;
signatureLocalPath.value = "";
showCanvas.value = false;
isSignatureEmpty.value = false;
};
const resetSignature = () => {
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
signatureLocalPath.value = "";
isSignatureEmpty.value = true;
if (signatureRef.value) {
signatureRef.value.clear();
}
};
const onSignatureStart = () => {
isSignatureEmpty.value = false;
};
const onSignatureSigning = () => {
isSignatureEmpty.value = false;
};
const onSignatureClear = () => {
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
};
const onSignatureEnd = () => {
isSignatureEmpty.value = false;
};
const clearSignature = () => {
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
if (signatureRef.value) {
signatureRef.value.clear();
}
};
const reSign = () => {
isSignatureEmpty.value = true;
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
signatureLocalPath.value = "";
common_vendor.nextTick$1(() => {
if (signatureRef.value) {
signatureRef.value.clear();
}
});
};
const onSignatureConfirm = async (tempFilePath) => {
try {
const { url } = await utils_upload.uploadToCloud(tempFilePath);
applySignatureFromServer(url);
if (isSubmitting.value) {
await executeSubmit();
}
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:780", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
const handleAiGenerate = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请先选择隐患", icon: "none" });
return;
}
aiGenerating.value = true;
try {
const hazardRes = await request_api.getHiddenDangerDetail({ hazardId: selectedHazardId.value });
if (hazardRes.code !== 0 || !hazardRes.data) {
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
return;
}
const assigns = hazardRes.data.assigns;
if (!assigns || assigns.length === 0 || !assigns[0].rectify) {
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
return;
}
const rectifyId = assigns[0].rectify.rectifyId;
const rectifyRes = await request_api.getRectifyDetail({ rectifyId });
if (rectifyRes.code !== 0 || !rectifyRes.data) {
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
return;
}
const rectifyPlan = rectifyRes.data.rectifyPlan;
if (!rectifyPlan) {
common_vendor.index.showToast({ title: "整改方案内容为空", icon: "none" });
return;
}
const aiRes = await request_api.generateWriteoffContent({ rectifyContent: rectifyPlan });
if (aiRes.code === 0 && aiRes.data) {
formData.mainTreatmentContent = aiRes.data.mainContent || "";
formData.treatmentResult = aiRes.data.completionContent || "";
formData.selfVerifyContent = aiRes.data.selfInspection || "";
common_vendor.index.showToast({ title: "AI生成成功", icon: "success" });
} else {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:828", "AI生成销号方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
}
};
const handleCancel = () => {
common_vendor.index.navigateBack();
};
const ensureSignatureAndSubmit = async () => {
if (showCanvas.value) {
if (!signatureRef.value || isSignatureEmpty.value) {
common_vendor.index.showToast({ title: "请进行电子签名", icon: "none" });
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
signatureRef.value.confirm();
return;
}
if (!signatureServerPath.value && !signatureLocalPath.value) {
common_vendor.index.showToast({ title: "请进行电子签名", icon: "none" });
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
try {
if (!signatureServerPath.value && signatureLocalPath.value) {
const { url } = await utils_upload.uploadToCloud(signatureLocalPath.value);
applySignatureFromServer(url);
}
await executeSubmit();
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:865", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
const handleSubmit = async () => {
var _a;
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
return;
}
if (!formData.approvalResult) {
common_vendor.index.showToast({ title: "请选择审批结果", icon: "none" });
return;
}
if (!applyId.value) {
common_vendor.index.showToast({ title: "缺少申请ID", icon: "none" });
return;
}
if (formData.approvalResult === 1) {
if (!quickApproveRadio.value) {
common_vendor.index.showToast({ title: "请选择是否快速审批", icon: "none" });
return;
}
if (needNextAssignee.value && !selectedAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return;
}
await ensureSignatureAndSubmit();
return;
}
if (formData.approvalResult === 2) {
if (!formData.approvalOpinion) {
common_vendor.index.showToast({ title: "请选择审批意见", icon: "none" });
return;
}
if (!((_a = formData.opinionRemark) == null ? void 0 : _a.trim())) {
common_vendor.index.showToast({ title: "请输入意见说明", icon: "none" });
return;
}
await ensureSignatureAndSubmit();
}
};
const executeSubmit = async () => {
const hazardId = Number(selectedHazardId.value);
const applyIdNum = Number(applyId.value);
const signPath = signatureServerPath.value || "";
try {
let res;
if (formData.approvalResult === 1) {
const approvePayload = {
hazardId,
applyId: applyIdNum,
signPath,
type: "agree",
quickApprove: quickApproveRadio.value === "yes",
sendMsgFlag: sendMsgFlag.value
};
if (needNextAssignee.value) {
approvePayload.assigneeId = Number(selectedAssigneeIdentityId.value);
}
res = await request_api.writeoffApprove(approvePayload);
} else {
res = await request_api.writeoffReject({
hazardId,
applyId: applyIdNum,
signPath,
type: formData.approvalOpinion,
remark: formData.opinionRemark.trim(),
sendMsgFlag: sendMsgFlag.value
});
}
common_vendor.index.hideLoading();
if (res.code === 0) {
common_vendor.index.showToast({ title: "审批成功", icon: "success" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
} else {
common_vendor.index.showToast({ title: res.msg || "审批失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:952", "审批失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
} finally {
isSubmitting.value = false;
common_vendor.index.hideLoading();
}
};
common_vendor.onLoad(async (options) => {
try {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/approval.vue:965", "获取系统信息失败:", error);
}
const hazardId = options == null ? void 0 : options.hazardId;
hazardLocked.value = (options == null ? void 0 : options.locked) === "1";
if (options == null ? void 0 : options.assignId) {
assignId.value = String(options.assignId);
}
if (options == null ? void 0 : options.taskId) {
taskId.value = String(options.taskId);
}
const hazardFromOptions = utils_hazardNav.buildWriteoffHazardFromOptions(options);
if (hazardFromOptions) {
applyWriteoffHazardPreview(hazardFromOptions);
}
if (hazardId) {
selectedHazardId.value = String(hazardId);
await fetchWriteoffForm(hazardId);
if (taskId.value) {
await fetchNextStep();
}
} else if (taskId.value) {
await fetchNextStep();
}
});
return (_ctx, _cache) => {
return common_vendor.e({
a: hazardLocked.value
}, hazardLocked.value ? {
b: common_vendor.t(selectedHazard.value || "加载中..."),
c: common_vendor.n(selectedHazard.value ? "" : "text-gray")
} : {
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
f: common_vendor.o(($event) => showHazardPicker.value = true)
}, {
g: common_vendor.t(formData.rectifyDeadline || "请先选择隐患"),
h: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
i: common_vendor.t(selectedDeptName.value || "请先选择隐患"),
j: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
k: common_vendor.t(formData.responsiblePerson || "请先选择隐患"),
l: common_vendor.n(formData.responsiblePerson ? "" : "text-gray"),
m: !aiGenerating.value
}, !aiGenerating.value ? {} : {}, {
n: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
o: aiGenerating.value,
p: aiGenerating.value,
q: common_vendor.o(handleAiGenerate),
r: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
s: common_vendor.p({
placeholder: "暂无",
disabled: true,
modelValue: formData.mainTreatmentContent
}),
t: common_vendor.o(($event) => formData.treatmentResult = $event),
v: common_vendor.p({
placeholder: "暂无",
disabled: true,
modelValue: formData.treatmentResult
}),
w: common_vendor.o(($event) => formData.selfVerifyContent = $event),
x: common_vendor.p({
placeholder: "暂无",
disabled: true,
modelValue: formData.selfVerifyContent
}),
y: common_vendor.n(formData.approvalResult === 1 ? "active" : ""),
z: common_vendor.o(($event) => onApprovalResultChange(1)),
A: common_vendor.n(formData.approvalResult === 2 ? "active" : ""),
B: common_vendor.o(($event) => onApprovalResultChange(2)),
C: formData.approvalResult === 1
}, formData.approvalResult === 1 ? {
D: common_vendor.p({
label: "是",
name: "yes",
customStyle: {
marginRight: "48rpx"
}
}),
E: common_vendor.p({
label: "否",
name: "no"
}),
F: common_vendor.o(($event) => quickApproveRadio.value = $event),
G: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: quickApproveRadio.value
})
} : {}, {
H: formData.approvalResult === 2
}, formData.approvalResult === 2 ? {
I: common_vendor.f(approvalOptions, (opt, index, i0) => {
return {
a: opt.value,
b: "367b7912-7-" + i0 + ",367b7912-6",
c: common_vendor.p({
label: opt.label,
name: opt.value,
customStyle: {
marginRight: index < approvalOptions.length - 1 ? "24rpx" : "0"
}
})
};
}),
J: common_vendor.o(($event) => formData.approvalOpinion = $event),
K: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: formData.approvalOpinion
}),
L: common_vendor.o(($event) => formData.opinionRemark = $event),
M: common_vendor.p({
placeholder: "请输入意见说明",
modelValue: formData.opinionRemark
})
} : {}, {
N: formData.approvalResult === 1
}, formData.approvalResult === 1 ? common_vendor.e({
O: common_vendor.t(nextStepDisplay.value),
P: needNextAssignee.value
}, needNextAssignee.value ? {
Q: common_vendor.t(selectedAssigneeName.value || "请选择下一步处理人"),
R: !selectedAssigneeName.value ? 1 : "",
S: common_vendor.o(openAssigneePopup)
} : {}) : {}, {
T: common_vendor.p({
label: "是",
name: "yes",
customStyle: {
marginRight: "48rpx"
}
}),
U: common_vendor.p({
label: "否",
name: "no"
}),
V: common_vendor.o(($event) => sendMsgFlagRadio.value = $event),
W: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: sendMsgFlagRadio.value
}),
X: formData.approvalResult === 1 || formData.approvalResult === 2
}, formData.approvalResult === 1 || formData.approvalResult === 2 ? common_vendor.e({
Y: showCanvas.value
}, showCanvas.value ? {
Z: common_vendor.o(clearSignature)
} : {
aa: common_vendor.o(reSign)
}, {
ab: !showCanvas.value
}, !showCanvas.value ? common_vendor.e({
ac: signatureUrl.value
}, signatureUrl.value ? {
ad: signatureUrl.value
} : {}) : {}, {
ae: showCanvas.value && !showAssigneePopup.value
}, showCanvas.value && !showAssigneePopup.value ? {
af: common_vendor.sr(signatureRef, "367b7912-12", {
"k": "signatureRef"
}),
ag: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
ah: common_vendor.o(onSignatureStart),
ai: common_vendor.o(onSignatureSigning),
aj: common_vendor.o(onSignatureEnd),
ak: common_vendor.o(onSignatureClear),
al: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
penColor: "#000000",
lineWidth: 3,
enableHistory: false
})
} : {}) : {}, {
am: common_vendor.o(handleCancel),
an: common_vendor.o(handleSubmit),
ao: !hazardLocked.value
}, !hazardLocked.value ? {
ap: common_vendor.o(onHazardConfirm),
aq: common_vendor.o(($event) => showHazardPicker.value = false),
ar: common_vendor.o(($event) => showHazardPicker.value = false),
as: common_vendor.p({
show: showHazardPicker.value,
columns: hazardColumns.value
})
} : {}, {
at: common_vendor.o(cancelAssigneeSelect),
av: assigneeLoading.value
}, assigneeLoading.value ? {} : assigneeList.value.length === 0 ? {} : {
ax: common_vendor.f(assigneeList.value, (user, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(formatAssigneeDisplayName(user)),
b: String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user))
}, String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user)) ? {} : {}, {
c: getAssigneeItemKey(user),
d: String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user)) ? 1 : "",
e: common_vendor.o(($event) => onAssigneeItemClick(user), getAssigneeItemKey(user))
});
})
}, {
aw: assigneeList.value.length === 0,
ay: common_vendor.o(cancelAssigneeSelect),
az: common_vendor.o(confirmAssigneeSelect),
aA: common_vendor.o(cancelAssigneeSelect),
aB: common_vendor.p({
show: showAssigneePopup.value,
mode: "bottom",
round: "20"
}),
aC: common_vendor.gei(_ctx, "")
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-367b7912"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/approval.js.map

View File

@@ -0,0 +1,11 @@
{
"navigationBarTitleText": "销号审批",
"usingComponents": {
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,225 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-367b7912 {
min-height: 100vh;
background: #EBF2FC;
}
.result-btn.data-v-367b7912 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 8rpx;
background: #f5f5f5;
color: #666;
font-size: 28rpx;
}
.result-btn.data-v-367b7912::after {
border: none;
}
.result-btn.active.data-v-367b7912 {
background: #2667E9;
color: #fff;
}
.ai-btn-wrapper.data-v-367b7912 {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-367b7912 {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-367b7912::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-367b7912 {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-367b7912 {
opacity: 0.7;
}
.picker-input.data-v-367b7912 {
background: #fff;
border-radius: 8rpx;
padding: 24rpx 20rpx;
margin-bottom: 20rpx;
border: 1rpx solid #eee;
}
.picker-input text.data-v-367b7912 {
font-size: 28rpx;
}
.picker-input.readonly.data-v-367b7912 {
background: #f5f5f5;
color: #666;
}
.static-field.data-v-367b7912 {
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333;
line-height: 1.5;
}
.approval-radio-group.data-v-367b7912 {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.select-trigger.data-v-367b7912 {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
}
.select-trigger .select-content.data-v-367b7912 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.user-popup.data-v-367b7912 {
background: #fff;
}
.user-popup .popup-header.data-v-367b7912 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.user-popup .popup-header .popup-title.data-v-367b7912 {
font-size: 32rpx;
color: #333;
}
.user-popup .popup-header .popup-close.data-v-367b7912 {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.user-popup .user-list-scroll.data-v-367b7912 {
max-height: 600rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.user-popup .empty-tip.data-v-367b7912 {
padding: 80rpx 20rpx;
text-align: center;
color: #909399;
font-size: 26rpx;
}
.user-popup .user-item.data-v-367b7912 {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.user-popup .user-item.data-v-367b7912:last-child {
border-bottom: none;
}
.user-popup .user-item.active .user-item-text.data-v-367b7912 {
color: #2667E9;
font-weight: 600;
}
.user-popup .user-item .user-item-text.data-v-367b7912 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.user-popup .popup-footer.data-v-367b7912 {
display: flex;
gap: 24rpx;
padding: 24rpx 30rpx;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
background: #fff;
}
.user-popup .popup-footer button.data-v-367b7912 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
margin: 0;
padding: 0;
}
.user-popup .popup-footer button.data-v-367b7912::after {
border: none;
}
.user-popup .popup-footer .btn-cancel.data-v-367b7912 {
background: #fff;
color: #2667E9;
border: 2rpx solid #2667E9;
}
.user-popup .popup-footer .btn-confirm.data-v-367b7912 {
color: #fff;
border: none;
}
.signature-action-btn.data-v-367b7912 {
margin: 0;
padding: 0 20rpx;
height: 50rpx;
font-size: 22rpx;
}
.signature-box.data-v-367b7912 {
width: 100%;
min-height: 240rpx;
background: #f8f8f8;
border: 1rpx dashed #dcdfe6;
border-radius: 8rpx;
}
.signature-box .signature-display.data-v-367b7912 {
width: 100%;
height: 160px;
background-color: #f8f8f8;
}
.signature-box .signature-pad-wrap.data-v-367b7912 {
border: 1px dashed #dcdfe6;
border-radius: 8rpx;
overflow: hidden;
background-color: #f8f8f8;
}
.signature-box .signature-img.data-v-367b7912 {
width: 100%;
height: 100%;
}
.signature-box .signature-placeholder.data-v-367b7912 {
color: #909399;
font-size: 28rpx;
}

View File

@@ -0,0 +1,928 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_upload = require("../../utils/upload.js");
const utils_hazardNav = require("../../utils/hazardNav.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
const _easycom_wd_signature2 = common_vendor.resolveComponent("wd-signature");
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
(_easycom_up_textarea2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_wd_signature2 + _easycom_up_picker2)();
}
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_wd_signature = () => "../../node-modules/wot-design-uni/components/wd-signature/wd-signature.js";
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_radio + _easycom_up_radio_group + _easycom_wd_signature + _easycom_up_picker + FlowAssigneePickerPopup)();
}
const FlowAssigneePickerPopup = () => "../../components/flow/FlowAssigneePickerPopup.js";
const FLOW_END_STEP_NAME = "销号子流程结束";
const _sfc_main = {
__name: "leader-approval",
setup(__props) {
const showHazardPicker = common_vendor.ref(false);
const hazardLocked = common_vendor.ref(false);
const selectedHazard = common_vendor.ref("");
const selectedHazardId = common_vendor.ref("");
const applyId = common_vendor.ref("");
const assignId = common_vendor.ref("");
const taskId = common_vendor.ref("");
const hazardColumns = common_vendor.ref([["暂无数据"]]);
const acceptanceHazardList = common_vendor.ref([]);
const selectedDeptName = common_vendor.ref("");
const aiGenerating = common_vendor.ref(false);
const sendMsgFlagRadio = common_vendor.ref("yes");
const sendMsgFlag = common_vendor.computed(() => sendMsgFlagRadio.value === "yes");
const nextStepName = common_vendor.ref("");
const nextStepKey = common_vendor.ref("");
const nextStepLoading = common_vendor.ref(false);
const FIXED_NEXT_STEP_MAP = {
re_rectify: "隐患整改",
verify: "隐患验收"
};
const currentTaskKey = common_vendor.ref("");
const resolveFixedNextStepName = (opinion) => FIXED_NEXT_STEP_MAP[opinion] || "";
const isFixedNextStepOpinion = (opinion) => !!resolveFixedNextStepName(opinion);
const APPROVAL_TYPE_MAP = {
agree: "agree",
reject: "reject",
report: "report",
re_rectify: "rectify",
verify: "verify"
};
const APPROVAL_OPTIONS_AGREE_REJECT = [
{ label: "同意", value: "agree" },
{ label: "驳回", value: "reject" }
];
const APPROVAL_OPTIONS_WITH_REPORT = [
{ label: "同意", value: "agree" },
{ label: "驳回", value: "reject" },
{ label: "上报", value: "report" }
];
const APPROVAL_OPTIONS_ALL = [
{ label: "同意", value: "agree" },
{ label: "驳回", value: "reject" },
{ label: "上报", value: "report" },
{ label: "重新整改", value: "re_rectify" },
{ label: "重新验收", value: "verify" }
];
const APPROVAL_OPTIONS_LEADER_PREFECTURE = [
{ label: "同意", value: "agree" },
{ label: "驳回", value: "reject" },
{ label: "重新整改", value: "re_rectify" },
{ label: "重新验收", value: "verify" }
];
const resolveApprovalOptionsByCurrentTaskKey = (taskKey, deptType) => {
const key = String(taskKey || "");
const dept = String(deptType || "");
if (key === "supervising_leader_review_1" || key === "supervising_leader_review_2") {
if (dept === "prefecture") {
return APPROVAL_OPTIONS_LEADER_PREFECTURE;
}
return APPROVAL_OPTIONS_ALL;
}
if (key === "department_review" && dept === "town_street") {
return APPROVAL_OPTIONS_WITH_REPORT;
}
if (key === "department_review" || key === "section_chief_review" || key === "supervising_executive_review") {
return APPROVAL_OPTIONS_AGREE_REJECT;
}
return [];
};
const approvalOptions = common_vendor.computed(() => resolveApprovalOptionsByCurrentTaskKey(currentTaskKey.value, getCurrentDeptType()));
const needNextAssignee = common_vendor.computed(() => {
if (formData.approvalOpinion !== "agree" && formData.approvalOpinion !== "report") {
return false;
}
if (formData.approvalOpinion === "agree" && nextStepName.value === FLOW_END_STEP_NAME) {
return false;
}
return true;
});
const nextStepDisplay = common_vendor.computed(() => {
if (!formData.approvalOpinion)
return "请先选择审批意见";
const fixedName = resolveFixedNextStepName(formData.approvalOpinion);
if (fixedName)
return fixedName;
if (nextStepLoading.value)
return "加载中...";
return nextStepName.value || "暂无下一步流程";
});
const selectedAssigneeIdentityId = common_vendor.ref("");
const selectedAssigneeName = common_vendor.ref("");
const pickerAssigneeIdentityId = common_vendor.ref("");
const pickerAssigneeName = common_vendor.ref("");
const showAssigneePopup = common_vendor.ref(false);
const showCanvas = common_vendor.ref(true);
const signatureUrl = common_vendor.ref("");
const signatureServerPath = common_vendor.ref("");
const signatureWidth = common_vendor.ref(340);
const signatureRef = common_vendor.ref(null);
const isSignatureEmpty = common_vendor.ref(true);
const isSubmitting = common_vendor.ref(false);
const signatureLocalPath = common_vendor.ref("");
const formData = common_vendor.reactive({
rectifyDeadline: "",
responsibleDeptId: "",
responsiblePerson: "",
mainTreatmentContent: "",
treatmentResult: "",
selfVerifyContent: "",
approvalOpinion: "",
opinionRemark: ""
});
const syncApprovalOpinionWithOptions = () => {
const validValues = approvalOptions.value.map((item) => item.value);
if (formData.approvalOpinion && !validValues.includes(formData.approvalOpinion)) {
formData.approvalOpinion = "";
}
if (!needNextAssignee.value) {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
pickerAssigneeIdentityId.value = "";
pickerAssigneeName.value = "";
}
};
const applyDefaultOpinionRemark = (opinion) => {
if (opinion === "agree") {
formData.opinionRemark = "同意";
} else if (opinion === "report") {
formData.opinionRemark = "上报";
} else if (opinion) {
formData.opinionRemark = "";
}
};
const resolveApproveType = (opinion) => APPROVAL_TYPE_MAP[opinion] || "";
const fillHazardRelatedFields = (hazard) => {
formData.rectifyDeadline = hazard.deadline || "";
selectedDeptName.value = hazard.deptName || "";
formData.responsiblePerson = hazard.rectifierName || "";
formData.responsibleDeptId = hazard.deptId || "";
};
const applyWriteoffHazardPreview = (hazard) => {
if (!hazard)
return;
selectedHazard.value = hazard.title || hazard.hazardTitle || `隐患${hazard.hazardId}`;
selectedHazardId.value = String(hazard.hazardId);
if (hazard.assignId) {
assignId.value = String(hazard.assignId);
}
if (hazard.taskId) {
taskId.value = String(hazard.taskId);
}
fillHazardRelatedFields(hazard);
};
const resolveTaskIdFromHazard = (hazard) => {
var _a, _b;
if (!hazard)
return "";
const candidates = [
hazard.taskId,
hazard.flowTaskId,
hazard.currentTaskId,
(_a = hazard.flowTask) == null ? void 0 : _a.taskId,
(_b = hazard.currentTask) == null ? void 0 : _b.taskId
];
for (const id of candidates) {
if (id != null && id !== "")
return String(id);
}
return "";
};
const resolveTaskIdFromAssign = (assign) => {
var _a, _b, _c, _d, _e;
if (!assign)
return "";
const candidates = [
assign.taskId,
assign.flowTaskId,
assign.currentTaskId,
(_a = assign.rectify) == null ? void 0 : _a.taskId,
(_b = assign.rectify) == null ? void 0 : _b.flowTaskId,
(_c = assign.rectify) == null ? void 0 : _c.currentTaskId,
(_d = assign.flow) == null ? void 0 : _d.taskId,
(_e = assign.currentTask) == null ? void 0 : _e.taskId
];
for (const id of candidates) {
if (id != null && id !== "")
return String(id);
}
return "";
};
const resolveAssignWithRectify = (assigns, currentAssignId) => {
if (!(assigns == null ? void 0 : assigns.length))
return null;
if (currentAssignId) {
const byAssignId = assigns.find(
(item) => String(item.assignId) === String(currentAssignId) && item.rectify
);
if (byAssignId)
return byAssignId;
}
return assigns.find((item) => item.rectify) || assigns[0] || null;
};
const resolveTaskIdFromDetail = (data) => {
if (!data)
return "";
if (data.taskId)
return String(data.taskId);
if (data.flowTaskId)
return String(data.flowTaskId);
if (data.currentTaskId)
return String(data.currentTaskId);
const assigns = data.assigns || [];
const matchedAssign = resolveAssignWithRectify(assigns, assignId.value);
const fromMatched = resolveTaskIdFromAssign(matchedAssign);
if (fromMatched)
return fromMatched;
for (const assign of assigns) {
const id = resolveTaskIdFromAssign(assign);
if (id)
return id;
}
return "";
};
const resolveNextTaskName = (data) => {
var _a;
if (!data)
return "";
const branches = data.branches || [];
const matchedBranch = branches.find((item) => item.matched) || branches[0];
return ((_a = matchedBranch == null ? void 0 : matchedBranch.nextNode) == null ? void 0 : _a.taskName) || "";
};
const resolveMatchedBranch = (data) => {
if (!data)
return null;
const branches = data.branches || [];
return branches.find((item) => item.matched) || branches[0] || null;
};
const resolveNextTaskKey = (data) => {
var _a;
return resolveNextNodeTaskKey((_a = resolveMatchedBranch(data)) == null ? void 0 : _a.nextNode);
};
const resolveNextNodeTaskKey = (node) => {
if (!(node == null ? void 0 : node.taskKey))
return "";
return String(node.taskKey);
};
const resolveCurrentTaskKey = (data) => {
if (!(data == null ? void 0 : data.currentTaskKey))
return "";
return String(data.currentTaskKey);
};
const buildPreviewVariables = (approvalOpinion) => {
const deptType = getCurrentDeptType();
const vars = {};
if (deptType) {
vars.deptType = deptType;
}
if (approvalOpinion === "report") {
vars.reportLeader = true;
} else if (approvalOpinion === "agree") {
vars.reportLeader = false;
}
return vars;
};
const buildFlowNextNodesParams = (currentTaskId, approvalOpinion) => {
const params = {
taskId: currentTaskId,
includeSubProcess: false
};
if (approvalOpinion === "reject") {
params.reject = true;
} else {
params.previewVariables = buildPreviewVariables(approvalOpinion);
}
return params;
};
const fetchFlowContext = async () => {
if (!taskId.value) {
currentTaskKey.value = "";
return;
}
try {
const res = await request_api.getFlowNextNodes({
taskId: taskId.value,
previewVariables: buildPreviewVariables(""),
includeSubProcess: false
});
if (res.code === 0) {
const payload = res.data && typeof res.data === "object" ? res.data : res;
currentTaskKey.value = resolveCurrentTaskKey(payload);
syncApprovalOpinionWithOptions();
} else {
currentTaskKey.value = "";
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:547", "获取流程上下文失败:", error);
currentTaskKey.value = "";
}
};
const getCurrentDeptType = () => {
var _a;
const userInfo = getStoredUserInfo();
const deptType = (_a = userInfo.userIdentity) == null ? void 0 : _a.deptType;
return deptType != null && deptType !== "" ? String(deptType) : "";
};
const getStoredUserInfo = () => {
try {
const stored = common_vendor.index.getStorageSync("userInfo");
if (!stored)
return {};
return typeof stored === "string" ? JSON.parse(stored) : stored;
} catch (error) {
return {};
}
};
const openAssigneePopup = () => {
if (!taskId.value) {
common_vendor.index.showToast({ title: "缺少任务ID", icon: "none" });
return;
}
pickerAssigneeIdentityId.value = selectedAssigneeIdentityId.value;
pickerAssigneeName.value = selectedAssigneeName.value;
showAssigneePopup.value = true;
};
const confirmAssigneeSelect = ({ identityId, name }) => {
selectedAssigneeIdentityId.value = identityId;
selectedAssigneeName.value = name;
showAssigneePopup.value = false;
};
const cancelAssigneeSelect = () => {
showAssigneePopup.value = false;
};
const fetchNextStep = async () => {
if (!formData.approvalOpinion) {
nextStepName.value = "";
nextStepKey.value = "";
return;
}
const fixedName = resolveFixedNextStepName(formData.approvalOpinion);
if (fixedName) {
nextStepName.value = fixedName;
nextStepKey.value = "";
return;
}
nextStepLoading.value = true;
try {
const currentTaskId = taskId.value;
if (!currentTaskId) {
nextStepName.value = "";
nextStepKey.value = "";
return;
}
const res = await request_api.getFlowNextNodes(
buildFlowNextNodesParams(currentTaskId, formData.approvalOpinion)
);
if (res.code === 0) {
const payload = res.data && typeof res.data === "object" ? res.data : res;
nextStepName.value = resolveNextTaskName(payload);
nextStepKey.value = resolveNextTaskKey(payload);
if (!needNextAssignee.value) {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
pickerAssigneeIdentityId.value = "";
pickerAssigneeName.value = "";
}
} else {
nextStepName.value = "";
nextStepKey.value = "";
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:629", "获取下一步流程失败:", error);
nextStepName.value = "";
nextStepKey.value = "";
} finally {
nextStepLoading.value = false;
}
};
const resolveTaskIdForHazard = async (hazard) => {
const presetTaskId = taskId.value;
const fromHazard = resolveTaskIdFromHazard(hazard);
if (fromHazard) {
taskId.value = fromHazard;
}
if (!(hazard == null ? void 0 : hazard.hazardId)) {
return;
}
if (!assignId.value && hazard.assignId) {
assignId.value = String(hazard.assignId);
}
if (taskId.value) {
return;
}
try {
const params = { hazardId: hazard.hazardId };
if (assignId.value) {
params.assignId = assignId.value;
}
const res = await request_api.getHiddenDangerDetail(params);
if (res.code === 0 && res.data) {
taskId.value = resolveTaskIdFromDetail(res.data) || presetTaskId;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:666", "获取隐患任务信息失败:", error);
}
if (!taskId.value && presetTaskId) {
taskId.value = presetTaskId;
}
};
const resetFlowSelection = () => {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
nextStepName.value = "";
nextStepKey.value = "";
currentTaskKey.value = "";
};
const applySelectedHazard = async (hazard) => {
if (!hazard)
return;
selectedHazard.value = hazard.title || hazard.hazardTitle || `隐患${hazard.hazardId}`;
selectedHazardId.value = hazard.hazardId;
assignId.value = hazard.assignId ? String(hazard.assignId) : "";
fillHazardRelatedFields(hazard);
resetFlowSelection();
await resolveTaskIdForHazard(hazard);
await fetchFlowContext();
};
const formatDeadline = (value) => {
if (!value)
return "";
return String(value).split(" ")[0];
};
const applyWriteoffFormData = (data) => {
if (!data)
return;
if (data.hazardId != null) {
selectedHazardId.value = String(data.hazardId);
}
selectedHazard.value = data.title || "";
formData.rectifyDeadline = formatDeadline(data.rectifyDeadline);
formData.responsibleDeptId = data.responsibleDeptId ?? "";
selectedDeptName.value = data.responsibleDeptName || "";
formData.responsiblePerson = data.responsiblePerson || "";
if (data.applyId != null) {
applyId.value = String(data.applyId);
}
formData.mainTreatmentContent = data.mainTreatmentContent || "";
formData.treatmentResult = data.treatmentResult || "";
formData.selfVerifyContent = data.selfVerifyContent || "";
};
const fetchWriteoffForm = async (hazardId) => {
if (!hazardId)
return null;
try {
const res = await request_api.getWriteoffForm(hazardId);
if (res.code === 0 && res.data) {
applyWriteoffFormData(res.data);
} else {
common_vendor.index.showToast({ title: res.msg || "获取销号审批表单失败", icon: "none" });
}
return res;
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:727", "获取销号审批表单失败:", error);
common_vendor.index.showToast({ title: "获取销号审批表单失败", icon: "none" });
return null;
}
};
const onHazardConfirm = async (e) => {
if (e.value && e.value.length > 0) {
const index = e.indexs[0];
const hazard = acceptanceHazardList.value[index];
if (hazard) {
await applySelectedHazard(hazard);
}
}
showHazardPicker.value = false;
};
common_vendor.watch(() => formData.approvalOpinion, (opinion) => {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
pickerAssigneeIdentityId.value = "";
pickerAssigneeName.value = "";
nextStepName.value = "";
nextStepKey.value = "";
applyDefaultOpinionRemark(opinion);
if (opinion) {
fetchNextStep();
}
syncApprovalOpinionWithOptions();
});
common_vendor.watch(needNextAssignee, (value) => {
if (!value) {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
pickerAssigneeIdentityId.value = "";
pickerAssigneeName.value = "";
}
});
const applySignatureFromServer = (signPath) => {
const url = signPath ? utils_upload.toSubmitFileUrl(signPath) : "";
if (!url) {
showCanvas.value = true;
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
isSignatureEmpty.value = true;
return;
}
signatureServerPath.value = url;
signatureUrl.value = url;
signatureLocalPath.value = "";
showCanvas.value = false;
isSignatureEmpty.value = false;
};
const onSignatureStart = () => {
isSignatureEmpty.value = false;
};
const onSignatureSigning = () => {
isSignatureEmpty.value = false;
};
const onSignatureClear = () => {
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
};
const onSignatureEnd = () => {
isSignatureEmpty.value = false;
};
const clearSignature = () => {
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
if (signatureRef.value) {
signatureRef.value.clear();
}
};
const reSign = () => {
isSignatureEmpty.value = true;
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
signatureLocalPath.value = "";
common_vendor.nextTick$1(() => {
if (signatureRef.value) {
signatureRef.value.clear();
}
});
};
const onSignatureConfirm = async (tempFilePath) => {
try {
const { url } = await utils_upload.uploadToCloud(tempFilePath);
applySignatureFromServer(url);
if (isSubmitting.value) {
await executeSubmit();
}
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:859", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
const handleAiGenerate = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请先选择隐患", icon: "none" });
return;
}
aiGenerating.value = true;
try {
const hazardRes = await request_api.getHiddenDangerDetail({ hazardId: selectedHazardId.value });
if (hazardRes.code !== 0 || !hazardRes.data) {
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
return;
}
const assigns = hazardRes.data.assigns;
if (!assigns || assigns.length === 0 || !assigns[0].rectify) {
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
return;
}
const rectifyId = assigns[0].rectify.rectifyId;
const rectifyRes = await request_api.getRectifyDetail({ rectifyId });
if (rectifyRes.code !== 0 || !rectifyRes.data) {
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
return;
}
const rectifyPlan = rectifyRes.data.rectifyPlan;
if (!rectifyPlan) {
common_vendor.index.showToast({ title: "整改方案内容为空", icon: "none" });
return;
}
const aiRes = await request_api.generateWriteoffContent({ rectifyContent: rectifyPlan });
if (aiRes.code === 0 && aiRes.data) {
formData.mainTreatmentContent = aiRes.data.mainContent || "";
formData.treatmentResult = aiRes.data.completionContent || "";
formData.selfVerifyContent = aiRes.data.selfInspection || "";
common_vendor.index.showToast({ title: "AI生成成功", icon: "success" });
} else {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:907", "AI生成销号方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
}
};
const handleCancel = () => {
common_vendor.index.navigateBack();
};
const ensureSignatureAndSubmit = async () => {
if (showCanvas.value) {
if (!signatureRef.value || isSignatureEmpty.value) {
common_vendor.index.showToast({ title: "请进行电子签名", icon: "none" });
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
signatureRef.value.confirm();
return;
}
if (!signatureServerPath.value && !signatureLocalPath.value) {
common_vendor.index.showToast({ title: "请进行电子签名", icon: "none" });
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
try {
if (!signatureServerPath.value && signatureLocalPath.value) {
const { url } = await utils_upload.uploadToCloud(signatureLocalPath.value);
applySignatureFromServer(url);
}
await executeSubmit();
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:944", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
const validateFormBeforeSubmit = () => {
var _a;
if (!taskId.value) {
common_vendor.index.showToast({ title: "缺少任务ID", icon: "none" });
return false;
}
if (!applyId.value) {
common_vendor.index.showToast({ title: "缺少申请ID", icon: "none" });
return false;
}
if (!formData.approvalOpinion) {
common_vendor.index.showToast({ title: "请选择审批意见", icon: "none" });
return false;
}
if (!((_a = formData.opinionRemark) == null ? void 0 : _a.trim())) {
common_vendor.index.showToast({ title: "请输入意见说明", icon: "none" });
return false;
}
if (!nextStepName.value) {
common_vendor.index.showToast({ title: "暂无下一步流程", icon: "none" });
return false;
}
if (!isFixedNextStepOpinion(formData.approvalOpinion) && !nextStepKey.value) {
common_vendor.index.showToast({ title: "暂无下一步流程", icon: "none" });
return false;
}
if (needNextAssignee.value && !selectedAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return false;
}
return true;
};
const handleSubmit = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
return;
}
if (!validateFormBeforeSubmit()) {
return;
}
await ensureSignatureAndSubmit();
};
const executeSubmit = async () => {
const params = {
taskId: taskId.value,
bizId: Number(applyId.value),
comment: formData.opinionRemark.trim(),
type: resolveApproveType(formData.approvalOpinion),
signPath: signatureServerPath.value || "",
sendMsgFlag: sendMsgFlag.value,
nextStepName: nextStepName.value
};
if (nextStepKey.value) {
params.nextStepKey = nextStepKey.value;
}
if (needNextAssignee.value) {
params.nextAssigneeIdentityId = Number(selectedAssigneeIdentityId.value);
params.nextAssigneeName = selectedAssigneeName.value;
params.nextAssigneeCategory = "identity";
}
if (formData.approvalOpinion === "report") {
params.reportLeader = true;
}
try {
const res = await request_api.flowTaskApprove(params);
common_vendor.index.hideLoading();
if (res.code === 0) {
common_vendor.index.showToast({ title: "审批成功", icon: "success" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
} else {
common_vendor.index.showToast({ title: res.msg || "审批失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:1028", "审批失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
} finally {
isSubmitting.value = false;
common_vendor.index.hideLoading();
}
};
common_vendor.onLoad(async (options) => {
try {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/leader-approval.vue:1041", "获取系统信息失败:", error);
}
const hazardId = options == null ? void 0 : options.hazardId;
hazardLocked.value = (options == null ? void 0 : options.locked) === "1";
if (options == null ? void 0 : options.assignId) {
assignId.value = String(options.assignId);
}
if (options == null ? void 0 : options.taskId) {
taskId.value = String(options.taskId);
}
if (options == null ? void 0 : options.taskKey) {
currentTaskKey.value = String(options.taskKey);
}
const hazardFromOptions = utils_hazardNav.buildWriteoffHazardFromOptions(options);
if (hazardFromOptions) {
applyWriteoffHazardPreview(hazardFromOptions);
}
if (hazardId) {
selectedHazardId.value = String(hazardId);
await fetchWriteoffForm(hazardId);
if (taskId.value) {
await fetchFlowContext();
}
} else if (taskId.value) {
await fetchFlowContext();
}
});
return (_ctx, _cache) => {
return common_vendor.e({
a: hazardLocked.value
}, hazardLocked.value ? {
b: common_vendor.t(selectedHazard.value || "加载中..."),
c: common_vendor.n(selectedHazard.value ? "" : "text-gray")
} : {
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
f: common_vendor.o(($event) => showHazardPicker.value = true)
}, {
g: common_vendor.t(formData.rectifyDeadline || "请先选择隐患"),
h: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
i: common_vendor.t(selectedDeptName.value || "请先选择隐患"),
j: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
k: common_vendor.t(formData.responsiblePerson || "请先选择隐患"),
l: common_vendor.n(formData.responsiblePerson ? "" : "text-gray"),
m: !aiGenerating.value
}, !aiGenerating.value ? {} : {}, {
n: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
o: aiGenerating.value,
p: aiGenerating.value,
q: common_vendor.o(handleAiGenerate),
r: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
s: common_vendor.p({
placeholder: "暂无",
disabled: true,
modelValue: formData.mainTreatmentContent
}),
t: common_vendor.o(($event) => formData.treatmentResult = $event),
v: common_vendor.p({
placeholder: "暂无",
disabled: true,
modelValue: formData.treatmentResult
}),
w: common_vendor.o(($event) => formData.selfVerifyContent = $event),
x: common_vendor.p({
placeholder: "暂无",
disabled: true,
modelValue: formData.selfVerifyContent
}),
y: common_vendor.f(approvalOptions.value, (opt, index, i0) => {
return {
a: opt.value,
b: "480a9a4b-4-" + i0 + ",480a9a4b-3",
c: common_vendor.p({
label: opt.label,
name: opt.value,
customStyle: {
marginRight: index < approvalOptions.value.length - 1 ? "24rpx" : "0"
}
})
};
}),
z: common_vendor.o(($event) => formData.approvalOpinion = $event),
A: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: formData.approvalOpinion
}),
B: common_vendor.o(($event) => formData.opinionRemark = $event),
C: common_vendor.p({
placeholder: "请输入意见说明",
modelValue: formData.opinionRemark
}),
D: common_vendor.t(nextStepDisplay.value),
E: needNextAssignee.value
}, needNextAssignee.value ? {} : {}, {
F: needNextAssignee.value
}, needNextAssignee.value ? {
G: common_vendor.t(selectedAssigneeName.value || "请选择下一步处理人"),
H: !selectedAssigneeName.value ? 1 : "",
I: common_vendor.o(openAssigneePopup)
} : {}, {
J: common_vendor.p({
label: "是",
name: "yes",
customStyle: {
marginRight: "48rpx"
}
}),
K: common_vendor.p({
label: "否",
name: "no"
}),
L: common_vendor.o(($event) => sendMsgFlagRadio.value = $event),
M: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: sendMsgFlagRadio.value
}),
N: showCanvas.value
}, showCanvas.value ? {
O: common_vendor.o(clearSignature)
} : {
P: common_vendor.o(reSign)
}, {
Q: !showCanvas.value
}, !showCanvas.value ? common_vendor.e({
R: signatureUrl.value
}, signatureUrl.value ? {
S: signatureUrl.value
} : {}) : {}, {
T: showCanvas.value && !showAssigneePopup.value
}, showCanvas.value && !showAssigneePopup.value ? {
U: common_vendor.sr(signatureRef, "480a9a4b-9", {
"k": "signatureRef"
}),
V: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
W: common_vendor.o(onSignatureStart),
X: common_vendor.o(onSignatureSigning),
Y: common_vendor.o(onSignatureEnd),
Z: common_vendor.o(onSignatureClear),
aa: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
penColor: "#000000",
lineWidth: 3,
enableHistory: false
})
} : {}, {
ab: common_vendor.o(handleCancel),
ac: common_vendor.o(handleSubmit),
ad: !hazardLocked.value
}, !hazardLocked.value ? {
ae: common_vendor.o(onHazardConfirm),
af: common_vendor.o(($event) => showHazardPicker.value = false),
ag: common_vendor.o(($event) => showHazardPicker.value = false),
ah: common_vendor.p({
show: showHazardPicker.value,
columns: hazardColumns.value
})
} : {}, {
ai: common_vendor.o(cancelAssigneeSelect),
aj: common_vendor.o(confirmAssigneeSelect),
ak: common_vendor.o(($event) => pickerAssigneeIdentityId.value = $event),
al: common_vendor.o(($event) => pickerAssigneeName.value = $event),
am: common_vendor.p({
show: showAssigneePopup.value,
["task-id"]: taskId.value,
["picker-identity-id"]: pickerAssigneeIdentityId.value,
["picker-name"]: pickerAssigneeName.value
}),
an: common_vendor.gei(_ctx, "")
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-480a9a4b"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/leader-approval.js.map

View File

@@ -0,0 +1,11 @@
{
"navigationBarTitleText": "领导审批",
"usingComponents": {
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"flow-assignee-picker-popup": "../../components/flow/FlowAssigneePickerPopup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,148 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-480a9a4b {
min-height: 100vh;
background: #EBF2FC;
}
.result-btn.data-v-480a9a4b {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 8rpx;
background: #f5f5f5;
color: #666;
font-size: 28rpx;
}
.result-btn.data-v-480a9a4b::after {
border: none;
}
.result-btn.active.data-v-480a9a4b {
background: #2667E9;
color: #fff;
}
.ai-btn-wrapper.data-v-480a9a4b {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-480a9a4b {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-480a9a4b::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-480a9a4b {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-480a9a4b {
opacity: 0.7;
}
.picker-input.data-v-480a9a4b {
background: #fff;
border-radius: 8rpx;
padding: 24rpx 20rpx;
margin-bottom: 20rpx;
border: 1rpx solid #eee;
}
.picker-input text.data-v-480a9a4b {
font-size: 28rpx;
}
.picker-input.readonly.data-v-480a9a4b {
background: #f5f5f5;
color: #666;
}
.static-field.data-v-480a9a4b {
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333;
line-height: 1.5;
}
.approval-radio-group.data-v-480a9a4b {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.select-trigger.data-v-480a9a4b {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
}
.select-trigger .select-content.data-v-480a9a4b {
flex: 1;
font-size: 28rpx;
color: #333;
}
.signature-action-btn.data-v-480a9a4b {
margin: 0;
padding: 0 20rpx;
height: 50rpx;
font-size: 22rpx;
}
.signature-box.data-v-480a9a4b {
width: 100%;
min-height: 240rpx;
background: #f8f8f8;
border: 1rpx dashed #dcdfe6;
border-radius: 8rpx;
}
.signature-box .signature-display.data-v-480a9a4b {
width: 100%;
height: 160px;
background-color: #f8f8f8;
}
.signature-box .signature-pad-wrap.data-v-480a9a4b {
border: 1px dashed #dcdfe6;
border-radius: 8rpx;
overflow: hidden;
background-color: #f8f8f8;
}
.signature-box .signature-img.data-v-480a9a4b {
width: 100%;
height: 100%;
}
.signature-box .signature-placeholder.data-v-480a9a4b {
color: #909399;
font-size: 28rpx;
}

View File

@@ -3,19 +3,21 @@ const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
if (!Array) {
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_input2 + _easycom_up_picker2 + _easycom_up_textarea2 + _easycom_up_datetime_picker2 + _easycom_u_popup2)();
const _easycom_xq_tree2 = common_vendor.resolveComponent("xq-tree");
(_easycom_up_input2 + _easycom_up_textarea2 + _easycom_up_picker2 + _easycom_up_datetime_picker2 + _easycom_u_popup2 + _easycom_xq_tree2)();
}
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
const _easycom_xq_tree = () => "../../uni_modules/xq-tree/components/xq-tree/xq-tree.js";
if (!Math) {
(_easycom_up_input + _easycom_up_picker + _easycom_up_textarea + _easycom_up_datetime_picker + _easycom_u_popup)();
(_easycom_up_input + _easycom_up_textarea + _easycom_up_picker + _easycom_up_datetime_picker + _easycom_u_popup + _easycom_xq_tree)();
}
const _sfc_main = {
__name: "editchecklist",
@@ -147,11 +149,9 @@ const _sfc_main = {
const showDeptPicker = common_vendor.ref(false);
const showTypePicker = common_vendor.ref(false);
const showModePicker = common_vendor.ref(false);
common_vendor.ref(false);
const showCyclePicker = common_vendor.ref(false);
const showStartDatePicker = common_vendor.ref(false);
const showEndDatePicker = common_vendor.ref(false);
common_vendor.ref([["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云大数据科技有限公司", "湘西网络有限公司"]]);
const typeColumns = common_vendor.ref([["日常检查", "专项检查", "设备检查"]]);
const modeColumns = common_vendor.ref([["单人完成", "全员"]]);
const cycleColumns = common_vendor.ref([["每天一次", "每周一次", "每月一次", "每季度一次"]]);
@@ -159,17 +159,78 @@ const _sfc_main = {
const executorList = common_vendor.ref([]);
const selectedExecutorId = common_vendor.ref(null);
const deptTree = common_vendor.ref([]);
const deptCascaderColumns = common_vendor.ref([]);
const deptCascaderIndexs = common_vendor.ref([0]);
const selectedDeptPath = common_vendor.ref([]);
const onDeptConfirm = () => {
const lastSelected = selectedDeptPath.value[selectedDeptPath.value.length - 1];
if (lastSelected) {
formData.deptId = lastSelected.deptId;
formData.deptName = selectedDeptPath.value.map((d) => d.deptName).join(" / ");
clearExecutorSelection();
fetchDeptUsers(lastSelected.deptId);
const deptTreeRef = common_vendor.ref(null);
const selectedDeptId = common_vendor.ref(null);
const deptDefaultCheckedKeys = common_vendor.ref([]);
const getDeptNodeId = (node) => {
var _a;
return (node == null ? void 0 : node.deptId) ?? ((_a = node == null ? void 0 : node.raw) == null ? void 0 : _a.deptId) ?? null;
};
const syncDeptTreeChecked = (deptId) => {
common_vendor.nextTick$1(() => {
var _a, _b, _c, _d;
if (deptId) {
(_b = (_a = deptTreeRef.value) == null ? void 0 : _a.setCheckedKeys) == null ? void 0 : _b.call(_a, [deptId]);
} else {
(_d = (_c = deptTreeRef.value) == null ? void 0 : _c.clearChecked) == null ? void 0 : _d.call(_c);
}
});
};
const findDeptPath = (tree, targetId, path = []) => {
var _a;
for (const node of tree) {
const currentPath = [...path, node];
if (String(node.deptId) === String(targetId)) {
return currentPath;
}
if ((_a = node.children) == null ? void 0 : _a.length) {
const found = findDeptPath(node.children, targetId, currentPath);
if (found)
return found;
}
}
return null;
};
const openDeptPopup = () => {
selectedDeptId.value = formData.deptId || null;
deptDefaultCheckedKeys.value = formData.deptId ? [formData.deptId] : [];
showDeptPicker.value = true;
syncDeptTreeChecked(formData.deptId);
};
const onDeptNodeClick = (node) => {
const deptId = getDeptNodeId(node);
selectedDeptId.value = deptId;
syncDeptTreeChecked(deptId);
};
const onDeptCheck = (node, { checkedKeys = [] } = {}) => {
const deptId = getDeptNodeId(node);
const isChecked = checkedKeys.some((key) => String(key) === String(deptId));
if (isChecked) {
selectedDeptId.value = deptId;
syncDeptTreeChecked(deptId);
return;
}
selectedDeptId.value = null;
syncDeptTreeChecked(null);
};
const cancelDeptSelect = () => {
showDeptPicker.value = false;
};
const confirmDeptSelect = () => {
if (!selectedDeptId.value) {
common_vendor.index.showToast({ title: "请选择分派单位", icon: "none" });
return;
}
const path = findDeptPath(deptTree.value, selectedDeptId.value);
if (!(path == null ? void 0 : path.length)) {
common_vendor.index.showToast({ title: "请选择分派单位", icon: "none" });
return;
}
const selected = path[path.length - 1];
formData.deptId = selected.deptId;
formData.deptName = path.map((d) => d.deptName).join(" / ");
clearExecutorSelection();
fetchDeptUsers(selected.deptId);
showDeptPicker.value = false;
};
const typeMap = {
@@ -211,7 +272,7 @@ const _sfc_main = {
executorList.value = [];
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:641", "获取部门用户失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:726", "获取部门用户失败:", error);
executorList.value = [];
}
};
@@ -243,47 +304,9 @@ const _sfc_main = {
if (res.code === 0 && res.data) {
const list = Array.isArray(res.data) ? res.data : [];
deptTree.value = handleTree(list, "deptId");
initDeptCascader(deptTree.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:680", "获取部门树失败:", error);
}
};
const initDeptCascader = (treeData) => {
const roots = Array.isArray(treeData) ? treeData : treeData ? [treeData] : [];
if (roots.length === 0)
return;
const firstColumn = roots.map((item) => ({ text: item.deptName, ...item }));
deptCascaderColumns.value = [firstColumn];
deptCascaderIndexs.value = [0];
selectedDeptPath.value = [roots[0]];
let current = roots[0];
while (current.children && current.children.length > 0) {
const nextColumn = current.children.map((item) => ({ text: item.deptName, ...item }));
deptCascaderColumns.value.push(nextColumn);
deptCascaderIndexs.value.push(0);
selectedDeptPath.value.push(current.children[0]);
current = current.children[0];
}
};
const onDeptCascaderChange = (e) => {
const { columnIndex, index, value } = e;
deptCascaderIndexs.value[columnIndex] = index;
selectedDeptPath.value[columnIndex] = value;
deptCascaderColumns.value = deptCascaderColumns.value.slice(0, columnIndex + 1);
deptCascaderIndexs.value = deptCascaderIndexs.value.slice(0, columnIndex + 1);
selectedDeptPath.value = selectedDeptPath.value.slice(0, columnIndex + 1);
if (value.children && value.children.length > 0) {
const nextColumn = value.children.map((item) => ({ text: item.deptName, ...item }));
deptCascaderColumns.value.push(nextColumn);
deptCascaderIndexs.value.push(0);
selectedDeptPath.value.push(value.children[0]);
if (value.children[0].children && value.children[0].children.length > 0) {
const thirdColumn = value.children[0].children.map((item) => ({ text: item.deptName, ...item }));
deptCascaderColumns.value.push(thirdColumn);
deptCascaderIndexs.value.push(0);
selectedDeptPath.value.push(value.children[0].children[0]);
}
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:764", "获取部门树失败:", error);
}
};
const onCycleConfirm = (e) => {
@@ -392,7 +415,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:867", "删除检查项失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:892", "删除检查项失败:", error);
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
}
} else {
@@ -468,7 +491,7 @@ const _sfc_main = {
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:954", "获取法规列表失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:979", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
@@ -548,7 +571,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1054", "添加检查项失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1079", "添加检查项失败:", error);
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
}
};
@@ -597,7 +620,7 @@ const _sfc_main = {
hasMoreLibrary.value = libraryList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1114", "获取检查库列表失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1139", "获取检查库列表失败:", error);
} finally {
libraryLoading.value = false;
}
@@ -700,7 +723,7 @@ const _sfc_main = {
selectedLibraries.value = [];
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1234", "获取检查库详情失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1259", "获取检查库详情失败:", error);
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
}
};
@@ -797,7 +820,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1349", "保存失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1374", "保存失败:", error);
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
}
};
@@ -814,95 +837,86 @@ const _sfc_main = {
}),
c: common_vendor.t(formData.deptName || "请选择分派单位"),
d: common_vendor.n(formData.deptName ? "picker-value" : "picker-placeholder"),
e: common_vendor.o(($event) => showDeptPicker.value = true),
f: common_vendor.o(onDeptConfirm),
g: common_vendor.o(onDeptCascaderChange),
h: common_vendor.o(($event) => showDeptPicker.value = false),
i: common_vendor.o(($event) => showDeptPicker.value = false),
j: common_vendor.p({
show: showDeptPicker.value,
columns: deptCascaderColumns.value,
defaultIndex: deptCascaderIndexs.value
}),
k: common_vendor.o(($event) => formData.remark = $event),
l: common_vendor.p({
e: common_vendor.o(openDeptPopup),
f: common_vendor.o(($event) => formData.remark = $event),
g: common_vendor.p({
placeholder: "请输入补充说明",
modelValue: formData.remark
}),
m: common_vendor.t(formData.typeName || "请选择检查表类型"),
n: common_vendor.n(formData.typeName ? "picker-value" : "picker-placeholder"),
o: common_vendor.o(($event) => showTypePicker.value = true),
p: common_vendor.o(onTypeConfirm),
q: common_vendor.o(($event) => showTypePicker.value = false),
r: common_vendor.o(($event) => showTypePicker.value = false),
s: common_vendor.p({
h: common_vendor.t(formData.typeName || "请选择检查表类型"),
i: common_vendor.n(formData.typeName ? "picker-value" : "picker-placeholder"),
j: common_vendor.o(($event) => showTypePicker.value = true),
k: common_vendor.o(onTypeConfirm),
l: common_vendor.o(($event) => showTypePicker.value = false),
m: common_vendor.o(($event) => showTypePicker.value = false),
n: common_vendor.p({
show: showTypePicker.value,
columns: typeColumns.value
}),
t: common_vendor.t(formData.modeName || "请选择模式"),
v: common_vendor.n(formData.modeName ? "picker-value" : "picker-placeholder"),
w: common_vendor.o(($event) => showModePicker.value = true),
x: common_vendor.o(onModeConfirm),
y: common_vendor.o(($event) => showModePicker.value = false),
z: common_vendor.o(($event) => showModePicker.value = false),
A: common_vendor.p({
o: common_vendor.t(formData.modeName || "请选择模式"),
p: common_vendor.n(formData.modeName ? "picker-value" : "picker-placeholder"),
q: common_vendor.o(($event) => showModePicker.value = true),
r: common_vendor.o(onModeConfirm),
s: common_vendor.o(($event) => showModePicker.value = false),
t: common_vendor.o(($event) => showModePicker.value = false),
v: common_vendor.p({
show: showModePicker.value,
columns: modeColumns.value
}),
B: formData.modeName === "单人完成"
w: formData.modeName === "单人完成"
}, formData.modeName === "单人完成" ? {
C: common_vendor.t(formData.executorNames || (formData.deptId ? "请选择执行人员" : "请先选择分派单位")),
D: common_vendor.n(formData.executorNames ? "picker-value" : "picker-placeholder"),
E: common_vendor.o(openExecutorPopup)
x: common_vendor.t(formData.executorNames || (formData.deptId ? "请选择执行人员" : "请先选择分派单位")),
y: common_vendor.n(formData.executorNames ? "picker-value" : "picker-placeholder"),
z: common_vendor.o(openExecutorPopup)
} : {}, {
F: common_vendor.t(formData.cycleName || "请选择周期"),
G: common_vendor.n(formData.cycleName ? "picker-value" : "picker-placeholder"),
H: common_vendor.o(($event) => showCyclePicker.value = true),
I: common_vendor.o(onCycleConfirm),
J: common_vendor.o(($event) => showCyclePicker.value = false),
K: common_vendor.o(($event) => showCyclePicker.value = false),
L: common_vendor.p({
A: common_vendor.t(formData.cycleName || "请选择周期"),
B: common_vendor.n(formData.cycleName ? "picker-value" : "picker-placeholder"),
C: common_vendor.o(($event) => showCyclePicker.value = true),
D: common_vendor.o(onCycleConfirm),
E: common_vendor.o(($event) => showCyclePicker.value = false),
F: common_vendor.o(($event) => showCyclePicker.value = false),
G: common_vendor.p({
show: showCyclePicker.value,
columns: cycleColumns.value
}),
M: formData.isWeekend === 1 ? 1 : "",
N: common_vendor.o(($event) => setIsWeekend(1)),
O: formData.isWeekend === 2 ? 1 : "",
P: common_vendor.o(($event) => setIsWeekend(2)),
Q: common_vendor.t(formData.startDate || "请选择计划开始日期"),
R: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"),
S: common_vendor.o(openStartDatePicker),
T: common_vendor.o(onStartDatePickerChange),
U: common_vendor.o(onStartDateConfirm),
V: common_vendor.o(($event) => showStartDatePicker.value = false),
W: common_vendor.o(($event) => showStartDatePicker.value = false),
X: common_vendor.o(($event) => startDateValue.value = $event),
Y: common_vendor.p({
H: formData.isWeekend === 1 ? 1 : "",
I: common_vendor.o(($event) => setIsWeekend(1)),
J: formData.isWeekend === 2 ? 1 : "",
K: common_vendor.o(($event) => setIsWeekend(2)),
L: common_vendor.t(formData.startDate || "请选择计划开始日期"),
M: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"),
N: common_vendor.o(openStartDatePicker),
O: common_vendor.o(onStartDatePickerChange),
P: common_vendor.o(onStartDateConfirm),
Q: common_vendor.o(($event) => showStartDatePicker.value = false),
R: common_vendor.o(($event) => showStartDatePicker.value = false),
S: common_vendor.o(($event) => startDateValue.value = $event),
T: common_vendor.p({
show: showStartDatePicker.value,
mode: "date",
minDate: todayMinDate.value,
filter: startDateFilter.value,
modelValue: startDateValue.value
}),
Z: common_vendor.t(formData.endDate || "请选择计划结束日期"),
aa: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"),
ab: common_vendor.o(openEndDatePicker),
ac: common_vendor.o(onEndDatePickerChange),
ad: common_vendor.o(onEndDateConfirm),
ae: common_vendor.o(($event) => showEndDatePicker.value = false),
af: common_vendor.o(($event) => showEndDatePicker.value = false),
ag: common_vendor.o(($event) => endDateValue.value = $event),
ah: common_vendor.p({
U: common_vendor.t(formData.endDate || "请选择计划结束日期"),
V: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"),
W: common_vendor.o(openEndDatePicker),
X: common_vendor.o(onEndDatePickerChange),
Y: common_vendor.o(onEndDateConfirm),
Z: common_vendor.o(($event) => showEndDatePicker.value = false),
aa: common_vendor.o(($event) => showEndDatePicker.value = false),
ab: common_vendor.o(($event) => endDateValue.value = $event),
ac: common_vendor.p({
show: showEndDatePicker.value,
mode: "date",
minDate: endDateMinDate.value,
filter: endDateFilter.value,
modelValue: endDateValue.value
}),
ai: common_vendor.t(checkItemCount.value),
aj: checkItemCount.value === 0
ad: common_vendor.t(checkItemCount.value),
ae: checkItemCount.value === 0
}, checkItemCount.value === 0 ? {} : {}, {
ak: common_vendor.f(manualCheckItems.value, (item, index, i0) => {
af: common_vendor.f(manualCheckItems.value, (item, index, i0) => {
return {
a: common_vendor.t(index + 1),
b: common_vendor.t(item.name),
@@ -912,7 +926,7 @@ const _sfc_main = {
f: "manual-" + index
};
}),
al: common_vendor.f(libraryCheckItems.value, (item, index, i0) => {
ag: common_vendor.f(libraryCheckItems.value, (item, index, i0) => {
return {
a: common_vendor.t(item.sourceLibraryName || "-"),
b: common_vendor.t(item.name),
@@ -922,41 +936,41 @@ const _sfc_main = {
f: "lib-" + item.pointId
};
}),
am: common_vendor.o(($event) => showAddPopup.value = true),
an: common_vendor.o(openLibraryPopup),
ao: common_vendor.o(handleSave),
ap: common_vendor.o(($event) => showAddPopup.value = false),
aq: common_vendor.o(($event) => checkForm.name = $event),
ar: common_vendor.p({
ah: common_vendor.o(($event) => showAddPopup.value = true),
ai: common_vendor.o(openLibraryPopup),
aj: common_vendor.o(handleSave),
ak: common_vendor.o(($event) => showAddPopup.value = false),
al: common_vendor.o(($event) => checkForm.name = $event),
am: common_vendor.p({
placeholder: "请输入检查名称",
border: "surround",
modelValue: checkForm.name
}),
as: common_vendor.o(($event) => checkForm.point = $event),
at: common_vendor.p({
an: common_vendor.o(($event) => checkForm.point = $event),
ao: common_vendor.p({
placeholder: "请输入检查内容",
height: 150,
modelValue: checkForm.point
}),
av: common_vendor.t(checkForm.regulationName || "选择法规"),
aw: common_vendor.n(checkForm.regulationName ? "" : "text-gray"),
ax: common_vendor.o(openLawPopup),
ay: common_vendor.o(($event) => showAddPopup.value = false),
az: common_vendor.o(handleAddCheck),
aA: common_vendor.o(($event) => showAddPopup.value = false),
aB: common_vendor.p({
ap: common_vendor.t(checkForm.regulationName || "选择法规"),
aq: common_vendor.n(checkForm.regulationName ? "" : "text-gray"),
ar: common_vendor.o(openLawPopup),
as: common_vendor.o(($event) => showAddPopup.value = false),
at: common_vendor.o(handleAddCheck),
av: common_vendor.o(($event) => showAddPopup.value = false),
aw: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20"
}),
aC: common_vendor.o(($event) => showLawPopup.value = false),
aD: common_vendor.o(searchRegulation),
aE: lawKeyword.value,
aF: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
aG: common_vendor.o(searchRegulation),
aH: lawLoading.value && lawList.value.length === 0
ax: common_vendor.o(($event) => showLawPopup.value = false),
ay: common_vendor.o(searchRegulation),
az: lawKeyword.value,
aA: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
aB: common_vendor.o(searchRegulation),
aC: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
aJ: common_vendor.f(lawList.value, (item, k0, i0) => {
aE: common_vendor.f(lawList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis),
@@ -965,26 +979,26 @@ const _sfc_main = {
e: common_vendor.o(($event) => selectLaw(item), item.id)
};
}),
aK: lawLoading.value
aF: lawLoading.value
}, lawLoading.value ? {} : {}), {
aI: !lawLoading.value && lawList.value.length === 0,
aL: common_vendor.o(loadMoreLaw),
aM: common_vendor.o(($event) => showLawPopup.value = false),
aN: common_vendor.o(confirmLaw),
aO: common_vendor.o(($event) => showLawPopup.value = false),
aP: common_vendor.p({
aD: !lawLoading.value && lawList.value.length === 0,
aG: common_vendor.o(loadMoreLaw),
aH: common_vendor.o(($event) => showLawPopup.value = false),
aI: common_vendor.o(confirmLaw),
aJ: common_vendor.o(($event) => showLawPopup.value = false),
aK: common_vendor.p({
show: showLawPopup.value,
mode: "center",
round: "20"
}),
aQ: common_vendor.o(closeLibraryPopup),
aR: common_vendor.o(searchLibrary),
aS: libraryKeyword.value,
aT: common_vendor.o(($event) => libraryKeyword.value = $event.detail.value),
aU: common_vendor.o(searchLibrary),
aV: libraryLoading.value && libraryList.value.length === 0
aL: common_vendor.o(closeLibraryPopup),
aM: common_vendor.o(searchLibrary),
aN: libraryKeyword.value,
aO: common_vendor.o(($event) => libraryKeyword.value = $event.detail.value),
aP: common_vendor.o(searchLibrary),
aQ: libraryLoading.value && libraryList.value.length === 0
}, libraryLoading.value && libraryList.value.length === 0 ? {} : !libraryLoading.value && libraryList.value.length === 0 ? {} : common_vendor.e({
aX: common_vendor.f(libraryList.value, (item, k0, i0) => {
aS: common_vendor.f(libraryList.value, (item, k0, i0) => {
return common_vendor.e({
a: selectedLibraries.value.includes(item.id)
}, selectedLibraries.value.includes(item.id) ? {} : {}, {
@@ -995,21 +1009,54 @@ const _sfc_main = {
f: common_vendor.o(($event) => toggleLibrarySelect(item), item.id)
});
}),
aY: libraryLoading.value
aT: libraryLoading.value
}, libraryLoading.value ? {} : {}), {
aW: !libraryLoading.value && libraryList.value.length === 0,
aZ: common_vendor.o(loadMoreLibrary),
ba: common_vendor.o(addSelectedLibrary),
bb: common_vendor.o(closeLibraryPopup),
bc: common_vendor.p({
aR: !libraryLoading.value && libraryList.value.length === 0,
aU: common_vendor.o(loadMoreLibrary),
aV: common_vendor.o(addSelectedLibrary),
aW: common_vendor.o(closeLibraryPopup),
aX: common_vendor.p({
show: showLibraryPopup.value,
mode: "center",
round: "20"
}),
bd: common_vendor.o(($event) => showExecutorPopup.value = false),
be: executorList.value.length === 0
aY: common_vendor.o(cancelDeptSelect),
aZ: showDeptPicker.value
}, showDeptPicker.value ? common_vendor.e({
ba: deptTree.value.length
}, deptTree.value.length ? {
bb: common_vendor.sr(deptTreeRef, "98282eb3-13,98282eb3-12", {
"k": "deptTreeRef"
}),
bc: common_vendor.o(onDeptCheck),
bd: common_vendor.o(onDeptNodeClick),
be: common_vendor.p({
data: deptTree.value,
["node-key"]: "deptId",
["label-key"]: "deptName",
["children-key"]: "children",
["show-checkbox"]: true,
["check-strictly"]: true,
["default-expand-all"]: true,
height: 500,
width: 560,
["default-checked-keys"]: deptDefaultCheckedKeys.value,
["empty-text"]: "暂无部门数据"
})
} : {}) : {}, {
bf: common_vendor.o(cancelDeptSelect),
bg: common_vendor.o(confirmDeptSelect),
bh: common_vendor.o(cancelDeptSelect),
bi: common_vendor.p({
show: showDeptPicker.value,
mode: "center",
round: "20",
safeAreaInsetBottom: false
}),
bj: common_vendor.o(($event) => showExecutorPopup.value = false),
bk: executorList.value.length === 0
}, executorList.value.length === 0 ? {} : {
bf: common_vendor.f(executorList.value, (item, k0, i0) => {
bl: common_vendor.f(executorList.value, (item, k0, i0) => {
return common_vendor.e({
a: selectedExecutorId.value === item.userId
}, selectedExecutorId.value === item.userId ? {} : {}, {
@@ -1020,15 +1067,15 @@ const _sfc_main = {
});
})
}, {
bg: common_vendor.o(($event) => showExecutorPopup.value = false),
bh: common_vendor.o(confirmExecutorSelect),
bi: common_vendor.o(($event) => showExecutorPopup.value = false),
bj: common_vendor.p({
bm: common_vendor.o(($event) => showExecutorPopup.value = false),
bn: common_vendor.o(confirmExecutorSelect),
bo: common_vendor.o(($event) => showExecutorPopup.value = false),
bp: common_vendor.p({
show: showExecutorPopup.value,
mode: "center",
round: "20"
}),
bk: common_vendor.gei(_ctx, "")
bq: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -2,9 +2,10 @@
"navigationBarTitleText": "添加检查表",
"usingComponents": {
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"xq-tree": "../../uni_modules/xq-tree/components/xq-tree/xq-tree"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -435,6 +435,24 @@
.btn-add-library.data-v-98282eb3::after {
border: none;
}
.dept-popup.data-v-98282eb3 {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.dept-popup .popup-footer button.data-v-98282eb3 {
margin: 0;
}
.dept-tree-body.data-v-98282eb3 {
height: 500rpx;
overflow: hidden;
}
.dept-tree-body.data-v-98282eb3 .checkbox-custom.checked,
.dept-tree-body.data-v-98282eb3 .checkbox-custom.indeterminate {
background-color: #2667E9;
border-color: #2667E9;
}
.executor-popup.data-v-98282eb3 {
width: 600rpx;
background: #fff;

View File

@@ -1,6 +1,17 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_hazardNav = require("../../utils/hazardNav.js");
const utils_userInfo = require("../../utils/userInfo.js");
if (!Array) {
const _easycom_u_loadmore2 = common_vendor.resolveComponent("u-loadmore");
_easycom_u_loadmore2();
}
const _easycom_u_loadmore = () => "../../uni_modules/uview-plus/components/u-loadmore/u-loadmore.js";
if (!Math) {
_easycom_u_loadmore();
}
const HAZARD_PAGE_SIZE = 10;
const _sfc_main = {
__name: "Inspection",
setup(__props) {
@@ -8,21 +19,16 @@ const _sfc_main = {
const checkPointId = common_vendor.ref("");
const oneTableId = common_vendor.ref("");
const userRole = common_vendor.ref("");
const canAcceptance = common_vendor.computed(() => {
return userRole.value === "admin" || userRole.value === "manage";
});
const getUserRole = () => {
try {
const userInfoStr = common_vendor.index.getStorageSync("userInfo");
if (userInfoStr) {
const userInfo = JSON.parse(userInfoStr);
userRole.value = userInfo.role || "";
userRole.value = utils_userInfo.resolveUserRoleKey(JSON.parse(userInfoStr));
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:86", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:104", "获取用户信息失败:", error);
}
};
getUserRole();
const fetchTaskInfo = async (oneTableId2) => {
try {
const startRes = await request_api.enterCheckPlan(oneTableId2);
@@ -35,37 +41,114 @@ const _sfc_main = {
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:103", "获取任务信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:120", "获取任务信息失败:", error);
}
};
common_vendor.onLoad((options) => {
getUserRole();
if (options.id) {
oneTableId.value = options.id;
fetchTaskInfo(options.id);
}
});
const hiddenDangerList = common_vendor.ref([]);
const pageNum = common_vendor.ref(1);
const listLoading = common_vendor.ref(false);
const loadStatus = common_vendor.ref("loadmore");
const statusTabs = common_vendor.ref([
{ label: "全部", value: null },
{ label: "待交办", value: 1 },
{ label: "待整改", value: 2 },
{ label: "待验收", value: 3 },
{ label: "待销号", value: 4 },
{ label: "已完成", value: 5 }
]);
const activeTab = common_vendor.ref(0);
const buildListParams = () => {
const params = {
pageNum: pageNum.value,
pageSize: HAZARD_PAGE_SIZE
};
const currentTab = statusTabs.value[activeTab.value];
if ((currentTab == null ? void 0 : currentTab.value) != null) {
params.status = currentTab.value;
}
return params;
};
const resetHiddenDangerList = () => {
pageNum.value = 1;
hiddenDangerList.value = [];
loadStatus.value = "loadmore";
};
const switchStatusTab = (index) => {
if (activeTab.value === index)
return;
activeTab.value = index;
resetHiddenDangerList();
fetchHiddenDangerList();
};
const fetchHiddenDangerList = async () => {
var _a, _b;
if (listLoading.value)
return;
if (pageNum.value > 1 && loadStatus.value === "nomore")
return;
listLoading.value = true;
if (pageNum.value > 1) {
loadStatus.value = "loading";
}
try {
const res = await request_api.getMyHiddenDangerList();
const res = await request_api.getMyHiddenDangerList(buildListParams());
if (res.code === 0) {
hiddenDangerList.value = res.data.records;
const records = ((_a = res.data) == null ? void 0 : _a.records) || [];
const total = Number(((_b = res.data) == null ? void 0 : _b.total) ?? 0);
if (pageNum.value === 1) {
hiddenDangerList.value = records;
} else {
hiddenDangerList.value = [...hiddenDangerList.value, ...records];
}
if (hiddenDangerList.value.length >= total || records.length < HAZARD_PAGE_SIZE) {
loadStatus.value = "nomore";
} else {
loadStatus.value = "loadmore";
}
} else {
if (pageNum.value === 1) {
hiddenDangerList.value = [];
}
loadStatus.value = "nomore";
common_vendor.index.showToast({
title: res.msg || "获取隐患列表失败",
icon: "none"
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:127", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:207", error);
if (pageNum.value > 1) {
pageNum.value--;
}
loadStatus.value = "loadmore";
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
} finally {
listLoading.value = false;
}
};
common_vendor.onShow(() => {
const loadMoreHiddenDangerList = () => {
if (loadStatus.value !== "loadmore" || listLoading.value)
return;
pageNum.value++;
fetchHiddenDangerList();
};
common_vendor.onShow(() => {
getUserRole();
resetHiddenDangerList();
fetchHiddenDangerList();
});
common_vendor.onReachBottom(() => {
loadMoreHiddenDangerList();
});
const goToAdd = () => {
let url = "/pages/hiddendanger/add";
@@ -86,53 +169,27 @@ const _sfc_main = {
};
const details = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/detail2?hazardId=${item.hazardId}&assignId=${item.assignId || ""}`
url: `/pages/hiddendanger/process-chain?hazardId=${item.hazardId}`
});
};
const Rectification = (item) => {
let url = `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`;
if (item.deadline) {
url += `&deadline=${encodeURIComponent(item.deadline)}`;
}
if (item.assigneeId) {
url += `&assigneeId=${item.assigneeId}`;
}
if (item.assigneeName) {
url += `&assigneeName=${encodeURIComponent(item.assigneeName)}`;
}
common_vendor.index.navigateTo({ url });
common_vendor.index.navigateTo({ url: utils_hazardNav.buildRectificationUrl(item) });
};
const editRectification = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/rectification?rectifyId=${item.rectifyId}&isEdit=1`
});
common_vendor.index.navigateTo({ url: utils_hazardNav.buildEditRectificationUrl(item) });
};
const acceptance = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
});
common_vendor.index.navigateTo({ url: utils_hazardNav.buildAcceptanceUrl(item) });
};
const assignHazard = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
});
common_vendor.index.navigateTo({ url: utils_hazardNav.buildAssignmentUrl(item) });
};
const goWriteoffApply = (item) => {
common_vendor.index.navigateTo({ url: utils_hazardNav.buildWriteoffApplyUrl(item) });
};
const goWriteoffApproval = (item) => {
common_vendor.index.navigateTo({ url: utils_hazardNav.buildWriteoffApprovalUrl(item) });
};
const statusTabs = common_vendor.ref([
{ label: "全部", value: null },
{ label: "待交办", value: 1 },
{ label: "待整改", value: 2 },
{ label: "待验收", value: 3 },
{ label: "待销号", value: 4 },
{ label: "已完成", value: 5 }
]);
const activeTab = common_vendor.ref(0);
const filteredList = common_vendor.computed(() => {
const currentTab = statusTabs.value[activeTab.value];
if (!currentTab || currentTab.value === null) {
return hiddenDangerList.value;
}
return hiddenDangerList.value.filter((item) => item.status === currentTab.value);
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(statusTabs.value, (tab, index, i0) => {
@@ -142,12 +199,12 @@ const _sfc_main = {
}, activeTab.value === index ? {} : {}, {
c: index,
d: activeTab.value === index ? 1 : "",
e: common_vendor.o(($event) => activeTab.value = index, index)
e: common_vendor.o(($event) => switchStatusTab(index), index)
});
}),
b: filteredList.value.length === 0
}, filteredList.value.length === 0 ? {} : {}, {
c: common_vendor.f(filteredList.value, (item, k0, i0) => {
b: hiddenDangerList.value.length === 0 && !listLoading.value
}, hiddenDangerList.value.length === 0 && !listLoading.value ? {} : {}, {
c: common_vendor.f(hiddenDangerList.value, (item, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(item.title),
b: common_vendor.t(item.statusName),
@@ -170,19 +227,33 @@ const _sfc_main = {
}, item.statusName === "待验收" && item.canEdit ? {
o: common_vendor.o(($event) => editRectification(item), item.hazardId)
} : {}, {
p: item.statusName === "待验收" && canAcceptance.value
}, item.statusName === "待验收" && canAcceptance.value ? {
p: common_vendor.unref(utils_hazardNav.canShowAcceptanceButton)(item, userRole.value)
}, common_vendor.unref(utils_hazardNav.canShowAcceptanceButton)(item, userRole.value) ? {
q: common_vendor.o(($event) => acceptance(item), item.hazardId)
} : {}, {
r: item.statusName === "待交办"
}, item.statusName === "待交办" ? {
s: common_vendor.o(($event) => assignHazard(item), item.hazardId)
} : {}, {
t: item.hazardId
t: common_vendor.unref(utils_hazardNav.canShowWriteoffApplyButton)(item)
}, common_vendor.unref(utils_hazardNav.canShowWriteoffApplyButton)(item) ? {
v: common_vendor.o(($event) => goWriteoffApply(item), item.hazardId)
} : {}, {
w: common_vendor.unref(utils_hazardNav.canShowWriteoffApprovalButton)(item, userRole.value)
}, common_vendor.unref(utils_hazardNav.canShowWriteoffApprovalButton)(item, userRole.value) ? {
x: common_vendor.o(($event) => goWriteoffApproval(item), item.hazardId)
} : {}, {
y: item.hazardId
});
}),
d: common_vendor.o(goToAdd),
e: common_vendor.gei(_ctx, "")
d: hiddenDangerList.value.length > 0
}, hiddenDangerList.value.length > 0 ? {
e: common_vendor.p({
status: loadStatus.value
})
} : {}, {
f: common_vendor.o(goToAdd),
g: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -1,4 +1,6 @@
{
"navigationBarTitleText": "隐患排查",
"usingComponents": {}
"usingComponents": {
"u-loadmore": "../../uni_modules/uview-plus/components/u-loadmore/u-loadmore"
}
}

View File

@@ -1 +1 @@
<view class="{{['page', 'padding', 'data-v-b44c631d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{e}}"><scroll-view class="status-tabs data-v-b44c631d" scroll-x show-scrollbar="{{false}}"><view class="status-tabs-inner data-v-b44c631d"><view wx:for="{{a}}" wx:for-item="tab" wx:key="c" class="{{['status-tab-item', 'data-v-b44c631d', tab.d && 'status-tab-active']}}" bindtap="{{tab.e}}"><text class="status-tab-text data-v-b44c631d">{{tab.a}}</text><view wx:if="{{tab.b}}" class="status-tab-bar data-v-b44c631d"></view></view></view></scroll-view><view wx:if="{{b}}" class="empty-tip text-gray text-center padding data-v-b44c631d">暂无数据</view><view wx:for="{{c}}" wx:for-item="item" wx:key="t" class="padding radius bg-white list-list margin-bottom data-v-b44c631d"><view class="flex justify-between margin-bottom data-v-b44c631d"><view class="text-bold text-black data-v-b44c631d" style="word-break:break-all;flex:1">{{item.a}}</view><view class="text-blue data-v-b44c631d" style="white-space:nowrap;flex-shrink:0;margin-left:16rpx">{{item.b}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">隐患等级:</view><view class="{{['level-tag', 'data-v-b44c631d', item.d && 'level-minor', item.e && 'level-normal', item.f && 'level-major']}}">{{item.c}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d" style="white-space:nowrap">隐患位置:</view><view class="text-black data-v-b44c631d">{{item.g}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">创建时间:</view><view class="text-black data-v-b44c631d">{{item.h}}</view></view><view class="flex justify-end card-actions data-v-b44c631d" style="gap:10rpx"><button class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.i}}">查看详情</button><button wx:if="{{item.j}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.k}}">隐患交办</button><button wx:if="{{item.l}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.m}}">立即整改</button><button wx:if="{{item.n}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.o}}">编辑整改信息</button><button wx:if="{{item.p}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.q}}">立即验收</button><button wx:if="{{item.r}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.s}}">隐患交办</button></view></view><view class="fixed-add-btn data-v-b44c631d" bindtap="{{d}}"><text class="cuIcon-add data-v-b44c631d"></text><text class="data-v-b44c631d">新增</text></view></view>
<view class="{{['page', 'padding', 'data-v-b44c631d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><scroll-view class="status-tabs data-v-b44c631d" scroll-x show-scrollbar="{{false}}"><view class="status-tabs-inner data-v-b44c631d"><view wx:for="{{a}}" wx:for-item="tab" wx:key="c" class="{{['status-tab-item', 'data-v-b44c631d', tab.d && 'status-tab-active']}}" bindtap="{{tab.e}}"><text class="status-tab-text data-v-b44c631d">{{tab.a}}</text><view wx:if="{{tab.b}}" class="status-tab-bar data-v-b44c631d"></view></view></view></scroll-view><view wx:if="{{b}}" class="empty-tip text-gray text-center padding data-v-b44c631d">暂无数据</view><view wx:for="{{c}}" wx:for-item="item" wx:key="y" class="padding radius bg-white list-list margin-bottom data-v-b44c631d"><view class="flex justify-between margin-bottom data-v-b44c631d"><view class="text-bold text-black data-v-b44c631d" style="word-break:break-all;flex:1">{{item.a}}</view><view class="text-blue data-v-b44c631d" style="white-space:nowrap;flex-shrink:0;margin-left:16rpx">{{item.b}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">隐患等级:</view><view class="{{['level-tag', 'data-v-b44c631d', item.d && 'level-minor', item.e && 'level-normal', item.f && 'level-major']}}">{{item.c}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d" style="white-space:nowrap">隐患位置:</view><view class="text-black data-v-b44c631d">{{item.g}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">创建时间:</view><view class="text-black data-v-b44c631d">{{item.h}}</view></view><view class="flex justify-end card-actions data-v-b44c631d" style="gap:10rpx"><button class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.i}}">查看详情</button><button wx:if="{{item.j}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.k}}">隐患交办</button><button wx:if="{{item.l}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.m}}">立即整改</button><button wx:if="{{item.n}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.o}}">编辑整改信息</button><button wx:if="{{item.p}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.q}}">立即验收</button><button wx:if="{{item.r}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.s}}">隐患交办</button><button wx:if="{{item.t}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.v}}">销号申请</button><button wx:if="{{item.w}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.x}}">销号审批</button></view></view><u-loadmore wx:if="{{d}}" class="data-v-b44c631d" virtualHostClass="data-v-b44c631d" style="margin-top:20rpx;margin-bottom:140rpx" virtualHostStyle="margin-top:20rpx;margin-bottom:140rpx" u-i="b44c631d-0" bind:__l="__l" u-p="{{e}}"/><view class="fixed-add-btn data-v-b44c631d" bindtap="{{f}}"><text class="cuIcon-add data-v-b44c631d"></text><text class="data-v-b44c631d">新增</text></view></view>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "验收审批",
"usingComponents": {
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature",
"flow-assignee-picker-popup": "../../components/flow/FlowAssigneePickerPopup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,88 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-1ff36a41 {
min-height: 100vh;
background: #EBF2FC;
}
.result-btn.data-v-1ff36a41 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 8rpx;
background: #f5f5f5;
color: #666;
font-size: 28rpx;
}
.result-btn.data-v-1ff36a41::after {
border: none;
}
.approval-radio-group.data-v-1ff36a41 {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.static-field.data-v-1ff36a41 {
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333;
line-height: 1.5;
}
.select-trigger.data-v-1ff36a41 {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
}
.select-trigger .select-content.data-v-1ff36a41 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.signature-box.data-v-1ff36a41 {
width: 100%;
min-height: 240rpx;
background: #f8f8f8;
border: 1rpx dashed #dcdfe6;
border-radius: 8rpx;
margin-top: 16rpx;
}
.signature-box .signature-img.data-v-1ff36a41 {
width: 100%;
height: 100%;
}
.signature-box .signature-placeholder.data-v-1ff36a41 {
color: #909399;
font-size: 28rpx;
}

View File

@@ -8,14 +8,16 @@ const utils_upload = require("../../utils/upload.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
const _easycom_wd_signature2 = common_vendor.resolveComponent("wd-signature");
(_easycom_up_textarea2 + _easycom_up_upload2 + _easycom_wd_signature2)();
(_easycom_up_textarea2 + _easycom_up_upload2 + _easycom_u_popup2 + _easycom_wd_signature2)();
}
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
const _easycom_wd_signature = () => "../../node-modules/wot-design-uni/components/wd-signature/wd-signature.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_upload + _easycom_wd_signature)();
(_easycom_up_textarea + _easycom_up_upload + _easycom_u_popup + _easycom_wd_signature)();
}
const _sfc_main = {
__name: "acceptance",
@@ -23,6 +25,224 @@ const _sfc_main = {
const rectifyId = common_vendor.ref("");
const hazardId = common_vendor.ref("");
const assignId = common_vendor.ref("");
const taskId = common_vendor.ref("");
const nextStepName = common_vendor.ref("");
const nextStepLoading = common_vendor.ref(false);
const nextStepDisplay = common_vendor.computed(() => {
if (nextStepLoading.value)
return "加载中...";
return nextStepName.value || "暂无下一步流程";
});
const resolveTaskIdFromAssign = (assign) => {
if (!assign)
return "";
if (assign.taskId)
return String(assign.taskId);
if (assign.flowTaskId)
return String(assign.flowTaskId);
if (assign.currentTaskId)
return String(assign.currentTaskId);
return "";
};
const resolveAssignWithRectify = (assigns) => {
if (!(assigns == null ? void 0 : assigns.length))
return null;
if (rectifyId.value) {
const byRectifyId = assigns.find(
(item) => item.rectify && String(item.rectify.rectifyId) === String(rectifyId.value)
);
if (byRectifyId)
return byRectifyId;
}
if (assignId.value) {
const byAssignId = assigns.find(
(item) => String(item.assignId) === String(assignId.value) && item.rectify
);
if (byAssignId)
return byAssignId;
}
return assigns.find((item) => item.rectify) || null;
};
const resolveTaskIdFromDetail = (data) => {
if (!data)
return "";
if (data.taskId)
return String(data.taskId);
if (data.flowTaskId)
return String(data.flowTaskId);
if (data.currentTaskId)
return String(data.currentTaskId);
const assigns = data.assigns || [];
const matchedAssign = resolveAssignWithRectify(assigns);
const fromMatched = resolveTaskIdFromAssign(matchedAssign);
if (fromMatched)
return fromMatched;
for (const assign of assigns) {
const id = resolveTaskIdFromAssign(assign);
if (id)
return id;
}
return "";
};
const resolveNextTaskName = (data) => {
var _a;
if (!data)
return "";
const branches = data.branches || [];
const matchedBranch = branches.find((item) => item.matched) || branches[0];
return ((_a = matchedBranch == null ? void 0 : matchedBranch.nextNode) == null ? void 0 : _a.taskName) || "";
};
const buildPreviewVariables = () => {
if (formData.result === 2) {
return { pass: false };
}
return {
pass: true,
quickApprove: formData.quickApproveRadio === "yes"
};
};
const getStoredUserInfo = () => {
try {
const stored = common_vendor.index.getStorageSync("userInfo");
if (!stored)
return {};
return typeof stored === "string" ? JSON.parse(stored) : stored;
} catch (error) {
return {};
}
};
const getCurrentDeptId = () => {
const userInfo = getStoredUserInfo();
const identity = userInfo.userIdentity;
if ((identity == null ? void 0 : identity.deptId) != null && identity.deptId !== "") {
return String(identity.deptId);
}
if (userInfo.deptId != null && userInfo.deptId !== "") {
return String(userInfo.deptId);
}
return "";
};
const rectifierDisplayName = common_vendor.computed(() => {
var _a;
return ((_a = rectifyData.rectifierName) == null ? void 0 : _a.trim()) || "暂无";
});
const selectedAssigneeIdentityId = common_vendor.ref("");
const selectedAssigneeName = common_vendor.ref("");
const pickerAssigneeIdentityId = common_vendor.ref("");
const pickerAssigneeName = common_vendor.ref("");
const showAssigneePopup = common_vendor.ref(false);
const assigneeList = common_vendor.ref([]);
const assigneeLoading = common_vendor.ref(false);
const resolveAssigneeIdentityId = (user) => {
if (!user)
return "";
const id = user.identityId ?? user.userIdentityId ?? user.userId ?? "";
return id === "" || id == null ? "" : String(id);
};
const getAssigneeItemKey = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (identityId)
return `identity-${identityId}`;
return `user-${user.userId || user.nickName || ""}`;
};
const formatAssigneeDisplayName = (user) => {
if (!user)
return "";
const name = user.nickName || user.userName || user.name || "";
const identityName = user.identityName || "";
if (name && identityName)
return `${name}${identityName}`;
return name || identityName || "未知人员";
};
const resolveAssigneeDeptUserType = () => formData.quickApproveRadio === "yes" ? 2 : 3;
const fetchAssigneeList = async () => {
const deptId = getCurrentDeptId();
if (!deptId) {
assigneeList.value = [];
return;
}
assigneeLoading.value = true;
try {
const res = await request_api.getDeptUsers(deptId, { type: resolveAssigneeDeptUserType() });
if (res.code === 0) {
assigneeList.value = res.data || [];
} else {
assigneeList.value = [];
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:352", "获取部门人员失败:", error);
assigneeList.value = [];
} finally {
assigneeLoading.value = false;
}
};
const openAssigneePopup = async () => {
pickerAssigneeIdentityId.value = selectedAssigneeIdentityId.value;
pickerAssigneeName.value = selectedAssigneeName.value;
showAssigneePopup.value = true;
await fetchAssigneeList();
};
const onAssigneeItemClick = (user) => {
const identityId = resolveAssigneeIdentityId(user);
if (!identityId)
return;
pickerAssigneeIdentityId.value = String(identityId);
pickerAssigneeName.value = formatAssigneeDisplayName(user);
};
const confirmAssigneeSelect = () => {
if (!pickerAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return;
}
selectedAssigneeIdentityId.value = pickerAssigneeIdentityId.value;
selectedAssigneeName.value = pickerAssigneeName.value;
showAssigneePopup.value = false;
};
const cancelAssigneeSelect = () => {
showAssigneePopup.value = false;
};
const onResultChange = (result) => {
formData.result = result;
if (result === 2) {
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
} else if (!formData.quickApproveRadio) {
formData.quickApproveRadio = "yes";
}
fetchNextStep();
};
const onQuickApproveChange = (value) => {
formData.quickApproveRadio = value;
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
fetchNextStep();
};
const fetchNextStep = async () => {
nextStepLoading.value = true;
try {
const currentTaskId = taskId.value;
if (!currentTaskId) {
nextStepName.value = "";
return;
}
const res = await request_api.getFlowNextNodes({
taskId: currentTaskId,
previewVariables: buildPreviewVariables(),
includeSubProcess: true
});
if (res.code === 0) {
const payload = res.data && typeof res.data === "object" ? res.data : res;
nextStepName.value = resolveNextTaskName(payload);
} else {
nextStepName.value = "";
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:425", "获取下一步流程失败:", error);
nextStepName.value = "";
} finally {
nextStepLoading.value = false;
}
};
const rectifyData = common_vendor.reactive({
rectifyPlan: "",
rectificationMeasures: "",
@@ -32,6 +252,7 @@ const _sfc_main = {
actualCost: null,
managerNames: [],
memberNames: [],
rectifierName: "",
rectifyStatusName: ""
});
const formatPersonNames = (names) => {
@@ -60,8 +281,10 @@ const _sfc_main = {
const formData = common_vendor.reactive({
result: 1,
// 验收结果 1.通过 2.不通过
verifyRemark: ""
verifyRemark: "",
// 验收备注
quickApproveRadio: "yes"
// 是否快速审批 yes/no仅通过时有效
});
const fileList1 = common_vendor.ref([]);
const canvasWidth = common_vendor.ref(300);
@@ -122,8 +345,11 @@ const _sfc_main = {
getPayload: () => ({
formData: {
result: formData.result,
verifyRemark: formData.verifyRemark
verifyRemark: formData.verifyRemark,
quickApproveRadio: formData.quickApproveRadio
},
selectedAssigneeIdentityId: selectedAssigneeIdentityId.value,
selectedAssigneeName: selectedAssigneeName.value,
fileList1: fileList1.value,
signatureServerPath: signatureServerPath.value,
signatureUrl: signatureUrl.value,
@@ -137,6 +363,9 @@ const _sfc_main = {
const form = data.formData || {};
formData.result = form.result !== void 0 ? form.result : 1;
formData.verifyRemark = form.verifyRemark || "";
formData.quickApproveRadio = form.quickApproveRadio === "no" ? "no" : "yes";
selectedAssigneeIdentityId.value = data.selectedAssigneeIdentityId || "";
selectedAssigneeName.value = data.selectedAssigneeName || "";
fileList1.value = data.fileList1 || [];
signaturePaths.value = data.signaturePaths || [];
if (data.signatureServerPath || data.signatureUrl) {
@@ -154,6 +383,9 @@ const _sfc_main = {
clearForm: () => {
formData.result = 1;
formData.verifyRemark = "";
formData.quickApproveRadio = "yes";
selectedAssigneeIdentityId.value = "";
selectedAssigneeName.value = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
@@ -168,6 +400,7 @@ const _sfc_main = {
requireInitialized: true,
onAfterRestore: (data) => {
var _a;
fetchNextStep();
if (data.signatureServerPath || data.signatureUrl || data.signatureLocalPath) {
return;
}
@@ -183,6 +416,9 @@ const _sfc_main = {
bindAutoSave(() => [
formData.result,
formData.verifyRemark,
formData.quickApproveRadio,
selectedAssigneeIdentityId.value,
selectedAssigneeName.value,
fileList1.value,
signatureServerPath.value,
signatureUrl.value,
@@ -206,24 +442,23 @@ const _sfc_main = {
urls
});
};
const resolveAssignWithRectify = (assigns) => {
if (!(assigns == null ? void 0 : assigns.length))
return null;
if (rectifyId.value) {
const byRectifyId = assigns.find(
(item) => item.rectify && String(item.rectify.rectifyId) === String(rectifyId.value)
);
if (byRectifyId)
return byRectifyId;
const mapPersonListToNickNames = (people) => {
if (!Array.isArray(people) || people.length === 0)
return [];
const names = people.map((person) => person.nickName || person.userName || person.name || "").filter(Boolean);
return [...new Set(names)];
};
const resolveManagerNames = (rectify) => {
if (Array.isArray(rectify.managers) && rectify.managers.length > 0) {
return mapPersonListToNickNames(rectify.managers);
}
if (assignId.value) {
const byAssignId = assigns.find(
(item) => String(item.assignId) === String(assignId.value) && item.rectify
);
if (byAssignId)
return byAssignId;
return rectify.managerNames || [];
};
const resolveMemberNames = (rectify) => {
if (Array.isArray(rectify.members) && rectify.members.length > 0) {
return mapPersonListToNickNames(rectify.members);
}
return assigns.find((item) => item.rectify) || null;
return rectify.memberNames || [];
};
const applyRectifyData = (rectify) => {
if (!rectify)
@@ -234,11 +469,37 @@ const _sfc_main = {
rectifyData.rectifyResult = rectify.rectifyResult || "";
rectifyData.planCost = rectify.planCost ?? null;
rectifyData.actualCost = rectify.actualCost ?? null;
rectifyData.managerNames = rectify.managerNames || [];
rectifyData.memberNames = rectify.memberNames || [];
rectifyData.rectifyStatusName = rectify.rectifyStatusName || "";
rectifyData.managerNames = resolveManagerNames(rectify);
rectifyData.memberNames = resolveMemberNames(rectify);
rectifyData.rectifierName = rectify.rectifierName || "";
rectifyData.rectifyStatusName = rectify.rectifyStatusName || rectify.statusName || "";
rectifyAttachments.value = rectify.attachments || [];
};
const fetchRectifyDetail = async () => {
if (!rectifyId.value)
return;
try {
const res = await request_api.getRectifyDetail({ rectifyId: rectifyId.value });
if (res.code === 0 && res.data) {
applyRectifyData(res.data);
if (!hazardId.value && res.data.hazardId) {
hazardId.value = String(res.data.hazardId);
}
if (!assignId.value && res.data.assignId) {
assignId.value = String(res.data.assignId);
}
const resolvedTaskId = resolveTaskIdFromDetail(res.data);
if (resolvedTaskId) {
taskId.value = resolvedTaskId;
}
} else {
common_vendor.index.showToast({ title: res.msg || "获取整改详情失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:719", "获取整改详情失败:", error);
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
}
};
const fetchDetail = async () => {
if (!hazardId.value)
return;
@@ -251,17 +512,43 @@ const _sfc_main = {
const assign = resolveAssignWithRectify(res.data.assigns);
if (assign == null ? void 0 : assign.rectify) {
applyRectifyData(assign.rectify);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:423", "整改记录:", rectifyData);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:424", "整改附件:", rectifyAttachments.value);
if (!rectifyId.value && assign.rectify.rectifyId) {
rectifyId.value = String(assign.rectify.rectifyId);
}
} else {
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
}
const resolvedTaskId = resolveTaskIdFromAssign(assign) || resolveTaskIdFromDetail(res.data);
if (resolvedTaskId) {
taskId.value = resolvedTaskId;
}
} else {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:430", "获取隐患详情失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:751", "获取隐患详情失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
const loadPageData = async () => {
if (rectifyId.value) {
await fetchRectifyDetail();
} else if (hazardId.value) {
await fetchDetail();
}
await fetchNextStep();
};
const validateFormBeforeSubmit = () => {
if (formData.result === 1 && !formData.quickApproveRadio) {
common_vendor.index.showToast({ title: "请选择是否快速审批", icon: "none" });
return false;
}
if (formData.result === 1 && formData.quickApproveRadio === "no" && !selectedAssigneeIdentityId.value) {
common_vendor.index.showToast({ title: "请选择下一步处理人", icon: "none" });
return false;
}
return true;
};
const handleCancel = () => {
common_vendor.index.navigateBack();
};
@@ -273,6 +560,9 @@ const _sfc_main = {
});
return;
}
if (!validateFormBeforeSubmit()) {
return;
}
if (showCanvas.value) {
if (!signatureRef.value || isSignatureEmpty.value) {
common_vendor.index.showToast({
@@ -303,7 +593,7 @@ const _sfc_main = {
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:484", "签名上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:830", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
}
@@ -319,7 +609,13 @@ const _sfc_main = {
// 电子签名路径
// sendMsgFlag: sendMsgFlag.value
};
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:506", "提交验收参数:", params);
if (formData.result === 1) {
params.quickApprove = formData.quickApproveRadio === "yes";
if (formData.quickApproveRadio === "no") {
params.assigneeIdentityId = selectedAssigneeIdentityId.value;
}
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:859", "提交验收参数:", params);
try {
const res = await request_api.acceptanceRectification(params);
common_vendor.index.hideLoading();
@@ -340,7 +636,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:528", "验收失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:881", "验收失败:", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -420,7 +716,7 @@ const _sfc_main = {
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:637", "签名上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:990", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
@@ -436,7 +732,7 @@ const _sfc_main = {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:656", "获取系统信息失败:", e);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:1009", "获取系统信息失败:", e);
}
if (options.rectifyId) {
rectifyId.value = options.rectifyId;
@@ -447,8 +743,11 @@ const _sfc_main = {
if (options.assignId) {
assignId.value = options.assignId;
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:667", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
fetchDetail();
if (options.taskId) {
taskId.value = options.taskId;
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:1023", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value, taskId: taskId.value });
loadPageData();
restoreDraft();
});
return (_ctx, _cache) => {
@@ -473,9 +772,9 @@ const _sfc_main = {
})
} : {}, {
l: common_vendor.n(formData.result === 1 ? "active" : ""),
m: common_vendor.o(($event) => formData.result = 1),
m: common_vendor.o(($event) => onResultChange(1)),
n: common_vendor.n(formData.result === 2 ? "active" : ""),
o: common_vendor.o(($event) => formData.result = 2),
o: common_vendor.o(($event) => onResultChange(2)),
p: common_vendor.o(($event) => formData.verifyRemark = $event),
q: common_vendor.p({
placeholder: "请输入验收备注",
@@ -490,33 +789,74 @@ const _sfc_main = {
imageMode: "aspectFill",
maxCount: 10
}),
v: canvasWidth.value,
w: canvasHeight.value,
x: canvasWidth.value + "px",
y: canvasHeight.value + "px",
z: showCanvas.value
}, showCanvas.value ? {
A: common_vendor.o(clearSignature)
v: formData.result === 1
}, formData.result === 1 ? {} : {}, {
w: formData.result === 1
}, formData.result === 1 ? {
x: common_vendor.n(formData.quickApproveRadio === "yes" ? "active" : ""),
y: common_vendor.o(($event) => onQuickApproveChange("yes")),
z: common_vendor.n(formData.quickApproveRadio === "no" ? "active" : ""),
A: common_vendor.o(($event) => onQuickApproveChange("no"))
} : {}, {
B: canvasWidth.value,
C: canvasHeight.value,
D: canvasWidth.value + "px",
E: canvasHeight.value + "px",
F: common_vendor.t(nextStepDisplay.value),
G: formData.result === 2
}, formData.result === 2 ? {
H: common_vendor.t(rectifierDisplayName.value)
} : {
B: common_vendor.o(reSign)
I: common_vendor.t(selectedAssigneeName.value || "请选择下一步处理人"),
J: !selectedAssigneeName.value ? 1 : "",
K: common_vendor.o(openAssigneePopup)
}, {
C: !showCanvas.value
}, !showCanvas.value ? common_vendor.e({
D: signatureUrl.value
}, signatureUrl.value ? {
E: signatureUrl.value
} : {}) : {}, {
F: showCanvas.value
L: common_vendor.o(cancelAssigneeSelect),
M: assigneeLoading.value
}, assigneeLoading.value ? {} : assigneeList.value.length === 0 ? {} : {
O: common_vendor.f(assigneeList.value, (user, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(formatAssigneeDisplayName(user)),
b: String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user))
}, String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user)) ? {} : {}, {
c: getAssigneeItemKey(user),
d: String(pickerAssigneeIdentityId.value) === String(resolveAssigneeIdentityId(user)) ? 1 : "",
e: common_vendor.o(($event) => onAssigneeItemClick(user), getAssigneeItemKey(user))
});
})
}, {
N: assigneeList.value.length === 0,
P: common_vendor.o(cancelAssigneeSelect),
Q: common_vendor.o(confirmAssigneeSelect),
R: common_vendor.o(cancelAssigneeSelect),
S: common_vendor.p({
show: showAssigneePopup.value,
mode: "bottom",
round: "20"
}),
T: showCanvas.value
}, showCanvas.value ? {
G: common_vendor.sr(signatureRef, "39f9b795-2", {
U: common_vendor.o(clearSignature)
} : {
V: common_vendor.o(reSign)
}, {
W: !showCanvas.value
}, !showCanvas.value ? common_vendor.e({
X: signatureUrl.value
}, signatureUrl.value ? {
Y: signatureUrl.value
} : {}) : {}, {
Z: showCanvas.value && !showAssigneePopup.value
}, showCanvas.value && !showAssigneePopup.value ? {
aa: common_vendor.sr(signatureRef, "39f9b795-3", {
"k": "signatureRef"
}),
H: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
I: common_vendor.o(onSignatureStart),
J: common_vendor.o(onSignatureSigning),
K: common_vendor.o(onSignatureEnd),
L: common_vendor.o(onSignatureClear),
M: common_vendor.p({
ab: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
ac: common_vendor.o(onSignatureStart),
ad: common_vendor.o(onSignatureSigning),
ae: common_vendor.o(onSignatureEnd),
af: common_vendor.o(onSignatureClear),
ag: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
@@ -525,9 +865,9 @@ const _sfc_main = {
enableHistory: false
})
} : {}, {
N: common_vendor.o(handleCancel),
O: common_vendor.o(handleSubmit),
P: common_vendor.gei(_ctx, "")
ah: common_vendor.o(handleCancel),
ai: common_vendor.o(handleSubmit),
aj: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -3,6 +3,7 @@
"usingComponents": {
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -54,6 +54,98 @@
color: #333;
line-height: 1.5;
}
.select-trigger.data-v-39f9b795 {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
margin-bottom: 20rpx;
}
.select-trigger .select-content.data-v-39f9b795 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.user-popup.data-v-39f9b795 {
background: #fff;
}
.user-popup .popup-header.data-v-39f9b795 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.user-popup .popup-header .popup-title.data-v-39f9b795 {
font-size: 32rpx;
color: #333;
}
.user-popup .popup-header .popup-close.data-v-39f9b795 {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.user-popup .user-list-scroll.data-v-39f9b795 {
max-height: 600rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.user-popup .empty-tip.data-v-39f9b795 {
padding: 80rpx 20rpx;
text-align: center;
color: #909399;
font-size: 26rpx;
}
.user-popup .user-item.data-v-39f9b795 {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.user-popup .user-item.data-v-39f9b795:last-child {
border-bottom: none;
}
.user-popup .user-item.active .user-item-text.data-v-39f9b795 {
color: #2667E9;
font-weight: 600;
}
.user-popup .user-item .user-item-text.data-v-39f9b795 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.user-popup .popup-footer.data-v-39f9b795 {
display: flex;
gap: 24rpx;
padding: 24rpx 30rpx;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
background: #fff;
}
.user-popup .popup-footer button.data-v-39f9b795 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
margin: 0;
padding: 0;
}
.user-popup .popup-footer button.data-v-39f9b795::after {
border: none;
}
.user-popup .popup-footer .btn-cancel.data-v-39f9b795 {
background: #fff;
color: #2667E9;
border: 2rpx solid #2667E9;
}
.user-popup .popup-footer .btn-confirm.data-v-39f9b795 {
color: #fff;
border: none;
}
.signature-box.data-v-39f9b795 {
width: 100%;
min-height: 240rpx;

View File

@@ -17,18 +17,34 @@ const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u
if (!Math) {
(_easycom_u_popup + _easycom_up_datetime_picker + _easycom_up_radio + _easycom_up_radio_group)();
}
const nextStepDisplay = "隐患整改";
const _sfc_main = {
__name: "assignment",
setup(__props) {
const hazardId = common_vendor.ref("");
const assignId = common_vendor.ref("");
const taskId = common_vendor.ref("");
const showUserPopup = common_vendor.ref(false);
const selectedUser = common_vendor.ref("");
const selectedIdentityId = common_vendor.ref("");
const selectedUserId = common_vendor.ref("");
const deptList = common_vendor.ref([]);
const activeDeptIndex = common_vendor.ref(0);
const userPickerSelectedId = common_vendor.ref("");
const userPickerSelectedIdentityId = common_vendor.ref("");
const findUserByIdentityId = (identityId) => {
if (!identityId)
return null;
for (const dept of deptList.value) {
const user = (dept.users || []).find((u) => String(u.identityId) === String(identityId));
if (user)
return user;
}
return null;
};
const formatUserDisplayName = (user) => {
if (user.identityName) {
return `${user.nickName}_${user.identityName}`;
}
if (user.postName) {
return `${user.nickName}_${user.postName}`;
}
@@ -39,43 +55,54 @@ const _sfc_main = {
return (dept == null ? void 0 : dept.users) || [];
});
const userPickerSelectedText = common_vendor.computed(() => {
if (!userPickerSelectedId.value)
return "";
for (const dept of deptList.value) {
const user = (dept.users || []).find((u) => String(u.userId) === String(userPickerSelectedId.value));
if (user)
return formatUserDisplayName(user);
}
return "";
const user = findUserByIdentityId(userPickerSelectedIdentityId.value);
return user ? formatUserDisplayName(user) : "";
});
const deptHasSelectedUser = (dept) => {
var _a;
if (!userPickerSelectedId.value || !((_a = dept.users) == null ? void 0 : _a.length))
if (!userPickerSelectedIdentityId.value || !((_a = dept.users) == null ? void 0 : _a.length))
return false;
return dept.users.some((user) => String(user.userId) === String(userPickerSelectedId.value));
return dept.users.some((user) => String(user.identityId) === String(userPickerSelectedIdentityId.value));
};
const onUserItemClick = (userId) => {
userPickerSelectedId.value = String(userId);
const onUserItemClick = (identityId) => {
userPickerSelectedIdentityId.value = String(identityId);
};
const openUserPopup = () => {
userPickerSelectedId.value = selectedUserId.value;
const firstDeptWithUsers = deptList.value.findIndex((dept) => {
var _a;
return ((_a = dept.users) == null ? void 0 : _a.length) > 0;
});
activeDeptIndex.value = firstDeptWithUsers >= 0 ? firstDeptWithUsers : 0;
userPickerSelectedIdentityId.value = selectedIdentityId.value;
let targetDeptIndex = 0;
if (selectedIdentityId.value) {
const deptIndex = deptList.value.findIndex(
(dept) => (dept.users || []).some((user) => String(user.identityId) === String(selectedIdentityId.value))
);
if (deptIndex >= 0)
targetDeptIndex = deptIndex;
} else {
const firstDeptWithUsers = deptList.value.findIndex((dept) => {
var _a;
return ((_a = dept.users) == null ? void 0 : _a.length) > 0;
});
if (firstDeptWithUsers >= 0)
targetDeptIndex = firstDeptWithUsers;
}
activeDeptIndex.value = targetDeptIndex;
showUserPopup.value = true;
};
const cancelUserSelect = () => {
showUserPopup.value = false;
};
const confirmUserSelect = () => {
if (!userPickerSelectedId.value) {
if (!userPickerSelectedIdentityId.value) {
common_vendor.index.showToast({ title: "请选择整改责任人", icon: "none" });
return;
}
selectedUserId.value = String(userPickerSelectedId.value);
selectedUser.value = userPickerSelectedText.value;
const user = findUserByIdentityId(userPickerSelectedIdentityId.value);
if (!user) {
common_vendor.index.showToast({ title: "所选身份无效,请重新选择", icon: "none" });
return;
}
selectedIdentityId.value = String(user.identityId);
selectedUserId.value = String(user.userId);
selectedUser.value = formatUserDisplayName(user);
showUserPopup.value = false;
};
const showDatePicker = common_vendor.ref(false);
@@ -116,10 +143,10 @@ const _sfc_main = {
});
if (res.code === 0 && res.data) {
deptList.value = res.data;
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:230", "部门人员树:", deptList.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:257", "部门人员树:", deptList.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:233", "获取部门人员失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:260", "获取部门人员失败:", error);
}
};
const onDateConfirm = (e) => {
@@ -134,7 +161,7 @@ const _sfc_main = {
common_vendor.index.navigateBack();
};
const handleSubmit = async () => {
if (!selectedUserId.value) {
if (!selectedIdentityId.value) {
common_vendor.index.showToast({ title: "请选择整改人员", icon: "none" });
return;
}
@@ -142,11 +169,19 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请选择整改期限", icon: "none" });
return;
}
if (!taskId.value) {
common_vendor.index.showToast({ title: "缺少任务ID", icon: "none" });
return;
}
const params = {
hazardId: Number(hazardId.value),
// 隐患ID
taskId: taskId.value,
// 流程任务ID列表传入
assigneeId: Number(selectedUserId.value),
// 被指派人ID
// 被指派人用户ID
assigneeIdentityId: Number(selectedIdentityId.value),
// 被指派人身份ID
deadline: selectedDate.value,
// 处理期限
assignRemark: "",
@@ -154,7 +189,7 @@ const _sfc_main = {
sendMsgFlag: sendMsgFlag.value
// 是否短信提醒
};
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:272", "提交数据:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:305", "提交数据:", params);
try {
const res = await request_api.assignHiddenDanger(params);
if (res.code === 0) {
@@ -167,7 +202,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:286", "交办失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:319", "交办失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
@@ -176,6 +211,8 @@ const _sfc_main = {
hazardId.value = options.hazardId;
if (options.assignId)
assignId.value = options.assignId;
if (options.taskId)
taskId.value = options.taskId;
fetchDeptUsers();
restoreDraft();
});
@@ -185,15 +222,16 @@ const _sfc_main = {
}, common_vendor.unref(showRestoreBanner) ? {
b: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
} : {}, {
c: common_vendor.t(selectedUser.value || "请选择整改责任人"),
d: !selectedUser.value ? 1 : "",
e: common_vendor.o(openUserPopup),
f: common_vendor.o(cancelUserSelect),
g: userPickerSelectedId.value
}, userPickerSelectedId.value ? {
h: common_vendor.t(userPickerSelectedText.value)
c: common_vendor.t(nextStepDisplay),
d: common_vendor.t(selectedUser.value || "请选择整改责任人"),
e: !selectedUser.value ? 1 : "",
f: common_vendor.o(openUserPopup),
g: common_vendor.o(cancelUserSelect),
h: userPickerSelectedIdentityId.value
}, userPickerSelectedIdentityId.value ? {
i: common_vendor.t(userPickerSelectedText.value)
} : {}, {
i: common_vendor.f(deptList.value, (dept, index, i0) => {
j: common_vendor.f(deptList.value, (dept, index, i0) => {
return common_vendor.e({
a: common_vendor.t(dept.deptName),
b: deptHasSelectedUser(dept)
@@ -205,60 +243,60 @@ const _sfc_main = {
e: common_vendor.o(($event) => activeDeptIndex.value = index, dept.deptId)
});
}),
j: currentDeptUsers.value.length === 0
k: currentDeptUsers.value.length === 0
}, currentDeptUsers.value.length === 0 ? {} : {
k: common_vendor.f(currentDeptUsers.value, (user, k0, i0) => {
l: common_vendor.f(currentDeptUsers.value, (user, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(formatUserDisplayName(user)),
b: String(userPickerSelectedId.value) === String(user.userId)
}, String(userPickerSelectedId.value) === String(user.userId) ? {} : {}, {
c: "user-" + user.userId,
d: String(userPickerSelectedId.value) === String(user.userId) ? 1 : "",
e: common_vendor.o(($event) => onUserItemClick(user.userId), "user-" + user.userId)
b: String(userPickerSelectedIdentityId.value) === String(user.identityId)
}, String(userPickerSelectedIdentityId.value) === String(user.identityId) ? {} : {}, {
c: "identity-" + user.identityId,
d: String(userPickerSelectedIdentityId.value) === String(user.identityId) ? 1 : "",
e: common_vendor.o(($event) => onUserItemClick(user.identityId), "identity-" + user.identityId)
});
})
}, {
l: "dept-users-" + activeDeptIndex.value,
m: common_vendor.o(cancelUserSelect),
n: common_vendor.o(confirmUserSelect),
o: common_vendor.o(cancelUserSelect),
p: common_vendor.p({
m: "dept-users-" + activeDeptIndex.value,
n: common_vendor.o(cancelUserSelect),
o: common_vendor.o(confirmUserSelect),
p: common_vendor.o(cancelUserSelect),
q: common_vendor.p({
show: showUserPopup.value,
mode: "bottom",
round: "20"
}),
q: common_vendor.t(selectedDate.value || "请选择整改期限"),
r: common_vendor.n(selectedDate.value ? "" : "text-gray"),
s: common_vendor.o(($event) => showDatePicker.value = true),
t: common_vendor.o(onDateConfirm),
v: common_vendor.o(($event) => showDatePicker.value = false),
r: common_vendor.t(selectedDate.value || "请选择整改期限"),
s: common_vendor.n(selectedDate.value ? "" : "text-gray"),
t: common_vendor.o(($event) => showDatePicker.value = true),
v: common_vendor.o(onDateConfirm),
w: common_vendor.o(($event) => showDatePicker.value = false),
x: common_vendor.o(($event) => dateValue.value = $event),
y: common_vendor.p({
x: common_vendor.o(($event) => showDatePicker.value = false),
y: common_vendor.o(($event) => dateValue.value = $event),
z: common_vendor.p({
show: showDatePicker.value,
mode: "date",
modelValue: dateValue.value
}),
z: common_vendor.p({
A: common_vendor.p({
label: "是",
name: "yes",
customStyle: {
marginRight: "48rpx"
}
}),
A: common_vendor.p({
B: common_vendor.p({
label: "否",
name: "no"
}),
B: common_vendor.o(($event) => sendMsgFlagRadio.value = $event),
C: common_vendor.p({
C: common_vendor.o(($event) => sendMsgFlagRadio.value = $event),
D: common_vendor.p({
placement: "row",
activeColor: "#2667e9",
modelValue: sendMsgFlagRadio.value
}),
D: common_vendor.o(handleCancel),
E: common_vendor.o(handleSubmit),
F: common_vendor.gei(_ctx, "")
E: common_vendor.o(handleCancel),
F: common_vendor.o(handleSubmit),
G: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -1 +1 @@
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{F}}"><view class="padding radius bg-white data-v-6209e844"><view wx:if="{{a}}" class="bg-orange-light text-orange padding-sm radius margin-bottom flex justify-between align-center data-v-6209e844" style="font-size:24rpx;background-color:#FFF7EB;border:1rpx solid #FFE4CC;width:100%;box-sizing:border-box;display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:20rpx"><view class="flex align-center data-v-6209e844" style="display:flex;flex-direction:row;align-items:center"><text class="cuIcon-info margin-right-xs data-v-6209e844" style="margin-right:10rpx"></text><text class="data-v-6209e844">已自动恢复您上次未提交的内容</text></view><text class="text-blue text-bold data-v-6209e844" style="cursor:pointer;padding:0 10rpx;color:#2667E9;font-weight:bold" bindtap="{{b}}">清空草稿</text></view><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">下一步流程</view><view class="text-red data-v-6209e844">*</view></view><view class="static-field data-v-6209e844">隐患整改</view><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改责任人</view><view class="text-red data-v-6209e844">*</view></view><view class="select-trigger data-v-6209e844" bindtap="{{e}}"><view class="{{['select-content', 'data-v-6209e844', d && 'text-gray']}}">{{c}}</view><text class="cuIcon-unfold data-v-6209e844"></text></view><u-popup wx:if="{{p}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-s="{{['d']}}" bindclose="{{o}}" u-i="6209e844-0" bind:__l="__l" u-p="{{p}}"><view class="user-popup cascader-user-popup data-v-6209e844"><view class="popup-header data-v-6209e844"><view class="popup-title text-bold data-v-6209e844">选择整改责任人</view><view class="popup-close data-v-6209e844" bindtap="{{f}}">×</view></view><view wx:if="{{g}}" class="selected-summary data-v-6209e844"><text class="summary-label data-v-6209e844">已选:</text><text class="summary-text data-v-6209e844">{{h}}</text></view><view class="cascader-body data-v-6209e844"><scroll-view class="cascader-col dept-col data-v-6209e844" scroll-y><view wx:for="{{i}}" wx:for-item="dept" wx:key="c" class="{{['data-v-6209e844', 'cascader-item', dept.d]}}" bindtap="{{dept.e}}"><text class="cascader-item-text data-v-6209e844">{{dept.a}}</text><text wx:if="{{dept.b}}" class="dept-dot data-v-6209e844"></text></view></scroll-view><scroll-view class="cascader-col user-col data-v-6209e844" scroll-y key="{{l}}"><view wx:if="{{j}}" class="empty-tip data-v-6209e844">该部门暂无人员</view><view wx:else class="data-v-6209e844"><view wx:for="{{k}}" wx:for-item="user" wx:key="c" class="{{['user-item', 'data-v-6209e844', user.d && 'active']}}" bindtap="{{user.e}}"><text class="user-item-text data-v-6209e844">{{user.a}}</text><text wx:if="{{user.b}}" class="cuIcon-check text-blue data-v-6209e844"></text></view></view></scroll-view></view><view class="popup-footer data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{m}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{n}}">确定</button></view></view></u-popup><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{s}}"><text class="{{['data-v-6209e844', r]}}">{{q}}</text></view><up-datetime-picker wx:if="{{y}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{t}}" bindcancel="{{v}}" bindclose="{{w}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{x}}" u-p="{{y}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">短信提醒</view><view class="text-red data-v-6209e844">*</view></view><up-radio-group wx:if="{{C}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-s="{{['d']}}" u-i="6209e844-2" bind:__l="__l" bindupdateModelValue="{{B}}" u-p="{{C}}"><up-radio wx:if="{{z}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-i="6209e844-3,6209e844-2" bind:__l="__l" u-p="{{z}}"></up-radio><up-radio wx:if="{{A}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-i="6209e844-4,6209e844-2" bind:__l="__l" u-p="{{A}}"></up-radio></up-radio-group><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{D}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{E}}">确认</button></view></view></view>
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{G}}"><view class="padding radius bg-white data-v-6209e844"><view wx:if="{{a}}" class="bg-orange-light text-orange padding-sm radius margin-bottom flex justify-between align-center data-v-6209e844" style="font-size:24rpx;background-color:#FFF7EB;border:1rpx solid #FFE4CC;width:100%;box-sizing:border-box;display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:20rpx"><view class="flex align-center data-v-6209e844" style="display:flex;flex-direction:row;align-items:center"><text class="cuIcon-info margin-right-xs data-v-6209e844" style="margin-right:10rpx"></text><text class="data-v-6209e844">已自动恢复您上次未提交的内容</text></view><text class="text-blue text-bold data-v-6209e844" style="cursor:pointer;padding:0 10rpx;color:#2667E9;font-weight:bold" bindtap="{{b}}">清空草稿</text></view><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">下一步流程</view><view class="text-red data-v-6209e844">*</view></view><view class="static-field data-v-6209e844">{{c}}</view><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改责任人</view><view class="text-red data-v-6209e844">*</view></view><view class="select-trigger data-v-6209e844" bindtap="{{f}}"><view class="{{['select-content', 'data-v-6209e844', e && 'text-gray']}}">{{d}}</view><text class="cuIcon-unfold data-v-6209e844"></text></view><u-popup wx:if="{{q}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-s="{{['d']}}" bindclose="{{p}}" u-i="6209e844-0" bind:__l="__l" u-p="{{q}}"><view class="user-popup cascader-user-popup data-v-6209e844"><view class="popup-header data-v-6209e844"><view class="popup-title text-bold data-v-6209e844">选择整改责任人</view><view class="popup-close data-v-6209e844" bindtap="{{g}}">×</view></view><view wx:if="{{h}}" class="selected-summary data-v-6209e844"><text class="summary-label data-v-6209e844">已选:</text><text class="summary-text data-v-6209e844">{{i}}</text></view><view class="cascader-body data-v-6209e844"><scroll-view class="cascader-col dept-col data-v-6209e844" scroll-y><view wx:for="{{j}}" wx:for-item="dept" wx:key="c" class="{{['data-v-6209e844', 'cascader-item', dept.d]}}" bindtap="{{dept.e}}"><text class="cascader-item-text data-v-6209e844">{{dept.a}}</text><text wx:if="{{dept.b}}" class="dept-dot data-v-6209e844"></text></view></scroll-view><scroll-view class="cascader-col user-col data-v-6209e844" scroll-y key="{{m}}"><view wx:if="{{k}}" class="empty-tip data-v-6209e844">该部门暂无人员</view><view wx:else class="data-v-6209e844"><view wx:for="{{l}}" wx:for-item="user" wx:key="c" class="{{['user-item', 'data-v-6209e844', user.d && 'active']}}" bindtap="{{user.e}}"><text class="user-item-text data-v-6209e844">{{user.a}}</text><text wx:if="{{user.b}}" class="cuIcon-check text-blue data-v-6209e844"></text></view></view></scroll-view></view><view class="popup-footer data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{n}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{o}}">确定</button></view></view></u-popup><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{t}}"><text class="{{['data-v-6209e844', s]}}">{{r}}</text></view><up-datetime-picker wx:if="{{z}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{v}}" bindcancel="{{w}}" bindclose="{{x}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{y}}" u-p="{{z}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">短信提醒</view><view class="text-red data-v-6209e844">*</view></view><up-radio-group wx:if="{{D}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-s="{{['d']}}" u-i="6209e844-2" bind:__l="__l" bindupdateModelValue="{{C}}" u-p="{{D}}"><up-radio wx:if="{{A}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-i="6209e844-3,6209e844-2" bind:__l="__l" u-p="{{A}}"></up-radio><up-radio wx:if="{{B}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-i="6209e844-4,6209e844-2" bind:__l="__l" u-p="{{B}}"></up-radio></up-radio-group><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{E}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{F}}">确认</button></view></view></view>

View File

@@ -0,0 +1,110 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const request_api = require("../../request/api.js");
const components_hazardDetail_processChain = require("../../components/hazardDetail/processChain.js");
if (!Array) {
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
_easycom_u_navbar2();
}
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
if (!Math) {
(_easycom_u_navbar + HazardProcessChainPanel)();
}
const HazardProcessChainPanel = () => "../../components/hazardDetail/HazardProcessChainPanel.js";
const _sfc_main = {
__name: "process-chain",
setup(__props) {
const instance = common_vendor.getCurrentInstance();
const queryScope = (instance == null ? void 0 : instance.proxy) || instance;
const chainData = common_vendor.ref({});
const loading = common_vendor.ref(false);
const panelBodyHeight = common_vendor.ref(0);
const summary = common_vendor.computed(() => components_hazardDetail_processChain.resolveProcessChainSummary(chainData.value));
const calcPanelBodyHeight = () => {
common_vendor.nextTick$1(() => {
const query = common_vendor.index.createSelectorQuery().in(queryScope);
query.select(".panel-wrap").boundingClientRect();
query.exec((res) => {
const rect = res == null ? void 0 : res[0];
if ((rect == null ? void 0 : rect.height) > 0) {
panelBodyHeight.value = Math.floor(rect.height);
return;
}
const sys = common_vendor.index.getSystemInfoSync();
panelBodyHeight.value = Math.floor(sys.windowHeight * 0.55);
});
});
};
const loadProcessChain = async (hazardId) => {
loading.value = true;
try {
const res = await request_api.getHazardProcessChain(hazardId);
if (res.code === 0 && res.data) {
chainData.value = res.data;
} else {
chainData.value = {};
common_vendor.index.showToast({ title: res.msg || "获取流程链失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/process-chain.vue:89", "获取隐患流程链失败:", error);
chainData.value = {};
common_vendor.index.showToast({ title: "获取流程链失败", icon: "none" });
} finally {
loading.value = false;
calcPanelBodyHeight();
setTimeout(calcPanelBodyHeight, 100);
setTimeout(calcPanelBodyHeight, 400);
}
};
common_vendor.onReady(() => {
calcPanelBodyHeight();
setTimeout(calcPanelBodyHeight, 100);
setTimeout(calcPanelBodyHeight, 400);
});
common_vendor.watch(loading, (isLoading) => {
if (!isLoading) {
calcPanelBodyHeight();
setTimeout(calcPanelBodyHeight, 100);
setTimeout(calcPanelBodyHeight, 400);
}
});
common_vendor.onLoad((options) => {
if (options.hazardId) {
loadProcessChain(options.hazardId);
return;
}
common_vendor.index.showToast({ title: "缺少隐患ID", icon: "none" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
});
return (_ctx, _cache) => {
return {
a: common_vendor.p({
title: "查看隐患",
placeholder: true,
safeAreaInsetTop: true,
bgColor: "transparent",
titleColor: "#ffffff",
leftIconColor: "#ffffff",
autoBack: true,
border: false
}),
b: common_assets._imports_0$2,
c: common_vendor.t(summary.value.statusName),
d: common_assets._imports_1,
e: common_vendor.t(summary.value.createdAt),
f: common_vendor.p({
["chain-data"]: chainData.value,
loading: loading.value,
["body-height"]: panelBodyHeight.value
}),
g: common_vendor.gei(_ctx, "")
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-18336741"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/process-chain.js.map

Some files were not shown because too many files have changed in this diff Show More