综合办公系统
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

projectInfo.vue 33KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-05-26 10:44:29
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-05-27 10:10:16
  6. -->
  7. <template>
  8. <view class="container">
  9. <!-- 内容区域 -->
  10. <view class="content">
  11. <!-- 项目基本信息 -->
  12. <view class="section" id="section1">
  13. <view class="section-title">
  14. <view class="line"></view>
  15. <text>项目基本信息</text>
  16. </view>
  17. <view class="info-list">
  18. <view class="info-item">
  19. <text class="label">项目编号</text>
  20. <text class="value">{{ project.projectNumber }}</text>
  21. </view>
  22. <view class="info-item">
  23. <text class="label">项目名称</text>
  24. <text class="value">{{ project.projectName }}</text>
  25. </view>
  26. <view class="info-item">
  27. <text class="label">项目类型</text>
  28. <text class="value">{{ project.projectType }}</text>
  29. </view>
  30. <view class="info-item">
  31. <text class="label">项目来源</text>
  32. <text class="value">{{ project.projectSource == '0' ? '院内' : '院外' }}</text>
  33. </view>
  34. <view class="info-item">
  35. <text class="label">项目级别</text>
  36. <text class="value" :class="project.projectLevel === '0' ? 'normal' : 'important'">
  37. {{ project.projectLevel ? (project.projectLevel == '0' ? '一般项目' : '重大项目') : '一般项目' }}
  38. </text>
  39. </view>
  40. <view class="info-item">
  41. <text class="label">甲方单位</text>
  42. <text class="value">{{ project.partyA ? project.partyA.partyAName : '' }}</text>
  43. </view>
  44. <view class="info-item">
  45. <text class="label">联系人</text>
  46. <text class="value">{{ project.contactPerson }}</text>
  47. </view>
  48. <view class="info-item">
  49. <text class="label">联系电话</text>
  50. <text class="value">{{ project.telephone }}</text>
  51. </view>
  52. <view class="info-item">
  53. <text class="label">承担部门</text>
  54. <text class="value">{{ project.undertakingDeptName }}</text>
  55. </view>
  56. <view class="info-item">
  57. <text class="label">项目登记人</text>
  58. <text class="value">{{ getUserName(project.projectRegistrant) }}</text>
  59. </view>
  60. <view class="info-item">
  61. <text class="label">项目登记时间</text>
  62. <text class="value">{{ project.registerTime }}</text>
  63. </view>
  64. <view class="info-item">
  65. <text class="label">合同编码</text>
  66. <text class="value">{{ contractCode }}</text>
  67. </view>
  68. <view class="info-item">
  69. <text class="label">合同编号</text>
  70. <text class="value">{{ contractNumber }}</text>
  71. </view>
  72. <view class="info-item full-width">
  73. <text class="label">项目概况</text>
  74. <view class="value">
  75. <view class="card-container">
  76. <view class="card" v-for="(item, index) in workList" :key="index">
  77. <view class="card-content">
  78. <view class="card-left">
  79. <text class="card-title">工作内容{{ index + 1 }}</text>
  80. </view>
  81. <view class="card-right">
  82. <view class="card-item">
  83. <text class="label">工作内容:</text>
  84. <text class="value">{{ item.content }}</text>
  85. </view>
  86. <view class="card-item">
  87. <text class="label">等级或比例尺:</text>
  88. <text class="value">{{ item.scale }}</text>
  89. </view>
  90. <view class="card-item">
  91. <text class="label">单位:</text>
  92. <text class="value">{{ item.unit }}</text>
  93. </view>
  94. <view class="card-item">
  95. <text class="label">工作量:</text>
  96. <text class="value">{{ item.workload }}</text>
  97. </view>
  98. <view class="card-item">
  99. <text class="label">要求完成时间:</text>
  100. <text class="value">{{ item.deadline }}</text>
  101. </view>
  102. <view class="card-item">
  103. <text class="label">备注:</text>
  104. <text class="value">{{ item.remark }}</text>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="info-item full-width">
  113. <text class="label">资料提交要求</text>
  114. <text class="value">{{ project.projectRequest }}</text>
  115. </view>
  116. <view class="info-item">
  117. <text class="label">项目备注</text>
  118. <text class="value">{{ project.remark }}</text>
  119. </view>
  120. </view>
  121. </view>
  122. <!-- 项目安排 -->
  123. <view class="section" id="section2">
  124. <view class="section-title">
  125. <view class="line"></view>
  126. <text>项目安排</text>
  127. </view>
  128. <view class="info-list">
  129. <view class="info-item">
  130. <text class="label">承担部门</text>
  131. <view class="value">
  132. <text>{{ project.undertakingDeptName }}</text>
  133. <button class="btn-small" @click="deptOpen = true" v-if="hasPermi(['oa:project:edit'])">更换部门</button>
  134. </view>
  135. </view>
  136. <view class="info-item">
  137. <text class="label">部门负责人</text>
  138. <text class="value">{{ deptLeaderList.join(',') }}</text>
  139. </view>
  140. <view class="info-item">
  141. <text class="label">项目负责人</text>
  142. <view class="value">
  143. <text>{{ project.projectLeaderUser ? project.projectLeaderUser.nickName : "" }}</text>
  144. <button class="btn-small" @click="prLeaderOpen = true"
  145. v-if="hasPermi(['oa:project:edit'])">更换项目负责人</button>
  146. </view>
  147. </view>
  148. <view class="info-item">
  149. <text class="label">现场负责人</text>
  150. <text class="value">{{ getUserName(project.siteLeader) }}</text>
  151. </view>
  152. <view class="info-item full-width">
  153. <text class="label">项目预算编制</text>
  154. <view class="value">
  155. <text class="link" @click="openBudget = true" v-if="isProjectLeader">项目预算表</text>
  156. <text class="link" @click="openBudget = true" v-else-if="hasPermi(['oa:allproject:query'])">项目预算表</text>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. <!-- 技术安排 -->
  162. <view class="section" id="section3">
  163. <view class="section-title">
  164. <view class="line"></view>
  165. <text>技术安排</text>
  166. </view>
  167. <view class="info-list">
  168. <view class="info-item">
  169. <text class="label">技术负责人</text>
  170. <text class="value">{{ project.technicalDirectorUser ? project.technicalDirectorUser.nickName : '' }}</text>
  171. </view>
  172. <view class="info-item">
  173. <text class="label">技术设计人</text>
  174. <text class="value">{{ project.technicalDesignerUser ? project.technicalDesignerUser.nickName : '' }}</text>
  175. </view>
  176. <view class="info-item">
  177. <text class="label">质量检查员</text>
  178. <text class="value">{{ project.qualityInspectorName }}</text>
  179. </view>
  180. <view class="info-item">
  181. <text class="label">技术方案设计</text>
  182. <text class="value link" @click="openPlan = true">技术方案审批表</text>
  183. </view>
  184. </view>
  185. </view>
  186. <!-- 任务审核情况 -->
  187. <view class="section" id="section4">
  188. <view class="section-title">
  189. <view class="line"></view>
  190. <text>任务审核情况</text>
  191. </view>
  192. <view class="info-list">
  193. <view class="info-item full-width">
  194. <text class="label">经营副总审核</text>
  195. <view class="value">
  196. <textarea disabled v-model="projectComment.jyComment" class="textarea"></textarea>
  197. <view class="sign">
  198. <text>签名:
  199. <text class="auditor">
  200. {{ projectComment.jyUser ? projectComment.jyUser.nickName : '' }}
  201. </text>
  202. </text>
  203. <text>审核时间:{{ projectComment.jyApprovalTime }}</text>
  204. </view>
  205. </view>
  206. </view>
  207. <view class="info-item full-width">
  208. <text class="label">分管领导批准</text>
  209. <view class="value">
  210. <textarea disabled v-model="projectComment.manageComment" class="textarea"></textarea>
  211. <view class="sign">
  212. <text>签名:
  213. <text class="auditor">
  214. {{ projectComment.managerUser ? projectComment.managerUser.nickName : '' }}
  215. </text>
  216. </text>
  217. <text>审核时间:{{ projectComment.manageApprovalTime }}</text>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. <!-- 项目生产情况 -->
  224. <view class="section" id="section5">
  225. <view class="section-title">
  226. <view class="line"></view>
  227. <text>项目生产情况</text>
  228. </view>
  229. <view class="info-list">
  230. <view class="info-item full-width">
  231. <text class="label" style="width:200rpx">安全交底记录表</text>
  232. <view class="value">
  233. <text class="link" @click="openSafe = true">安全交底记录表</text>
  234. <button class="btn-small" @click="handleUrge('1')" v-if="isSend">发送企业微信消息提醒相关人员</button>
  235. </view>
  236. </view>
  237. <view class="info-item full-width">
  238. <text class="label" style="width:200rpx">技术交底记录表</text>
  239. <view class="value">
  240. <text class="link" @click="openTech = true">技术交底记录表</text>
  241. <button class="btn-small" @click="handleUrge('2')" v-if="isSend">发送企业微信消息提醒相关人员</button>
  242. </view>
  243. </view>
  244. <view class="info-item full-width">
  245. <text class="label">申请设备</text>
  246. <view class="value">
  247. <view>
  248. <view class="device-item" v-for="(item, index) in devices" :key="index">
  249. <text>{{ item }}</text>
  250. </view>
  251. </view>
  252. </view>
  253. </view>
  254. <view class="info-item full-width">
  255. <text class="label">使用车辆</text>
  256. <view class="value">
  257. <text>{{ cars.join(',') }}</text>
  258. </view>
  259. </view>
  260. <view class="info-item full-width">
  261. <text class="label">驾驶员</text>
  262. <view class="value">
  263. <text>{{ drivers.join(',') }}</text>
  264. </view>
  265. </view>
  266. <view class="info-item full-width">
  267. <text class="label">参与人员</text>
  268. <view class="value">
  269. <text class="participate-list">{{ participates.join(',') }}</text>
  270. </view>
  271. </view>
  272. <view class="info-item">
  273. <text class="label">进场时间</text>
  274. <text class="value">{{ project.entryTime }}</text>
  275. </view>
  276. <view class="info-item">
  277. <text class="label">撤场时间</text>
  278. <text class="value">{{ project.exitTime }}</text>
  279. </view>
  280. <view class="info-item full-width">
  281. <text class="label">项目进度</text>
  282. <view class="value">
  283. <view class="card-container">
  284. <view class="card" v-for="(item, index) in progressList" :key="index">
  285. <view class="card-content">
  286. <view class="card-left">
  287. <text class="card-title">进度记录 {{ index + 1 }}</text>
  288. </view>
  289. <view class="card-right">
  290. <view class="card-item">
  291. <text class="label">截至日期:</text>
  292. <text class="value">{{ item.date }}</text>
  293. </view>
  294. <view class="card-item">
  295. <text class="label">累计总进度:</text>
  296. <text class="value">{{ item.percentage }}%</text>
  297. </view>
  298. <view class="card-item">
  299. <text class="label">情况说明:</text>
  300. <text class="value">{{ item.situation }}</text>
  301. </view>
  302. </view>
  303. </view>
  304. </view>
  305. </view>
  306. </view>
  307. </view>
  308. <view class="info-item full-width">
  309. <text class="label" style="width:200rpx">实际完成工作量</text>
  310. <view class="value">
  311. <view class="card-container">
  312. <view class="card" v-for="(item, index) in actualList" :key="index">
  313. <view class="card-content">
  314. <view class="card-left">
  315. <text class="card-title">实际工作量记录 {{ index + 1 }}</text>
  316. </view>
  317. <view class="card-right">
  318. <view class="card-item">
  319. <text class="label">工作内容:</text>
  320. <text class="value">{{ item.content }}</text>
  321. </view>
  322. <view class="card-item">
  323. <text class="label">等级或比例尺:</text>
  324. <text class="value">{{ item.scale }}</text>
  325. </view>
  326. <view class="card-item">
  327. <text class="label">单位:</text>
  328. <text class="value">{{ item.unit }}</text>
  329. </view>
  330. <view class="card-item">
  331. <text class="label">工作量:</text>
  332. <text class="value">{{ item.workload }}</text>
  333. </view>
  334. <view class="card-item">
  335. <text class="label">实际完成时间:</text>
  336. <text class="value">{{ parseTime(item.finishTime, '{y}-{m}-{d}') }}</text>
  337. </view>
  338. <view class="card-item">
  339. <text class="label">备注:</text>
  340. <text class="value">{{ item.remark }}</text>
  341. </view>
  342. </view>
  343. </view>
  344. </view>
  345. </view>
  346. </view>
  347. </view>
  348. </view>
  349. </view>
  350. </view>
  351. <!-- 弹窗组件 -->
  352. <uni-popup ref="popup" type="center">
  353. <view class="popup-content">
  354. <!-- 这里可以添加弹窗内容 -->
  355. </view>
  356. </uni-popup>
  357. </view>
  358. </template>
  359. <script>
  360. import { getDept } from "@/api/system/dept";
  361. import { getUsersDeptLeaderByDept, getUserByPost, getUsersManageLeaderByDept } from '@/api/system/post'
  362. import { listUser, getUser } from "@/api/system/user";
  363. import { getProject, updateProject } from "@/api/oa/project/project";
  364. import { listProjectWork, addProjectWork } from "@/api/oa/project/projectWork";
  365. import { listProjectComment, getProjectComment } from "@/api/oa/project/projectComment";
  366. import { listProjectProgress, getProjectProgress } from "@/api/oa/project/projectProgress";
  367. import { listProjectWorkload } from '@/api/oa/project/projectWorkload'
  368. import { listProjectContract, addProjectContract } from "@/api/oa/contract/projectContract";
  369. import { listContract, getContract } from "@/api/oa/contract/contract";
  370. import { listDevice, getDevice } from "@/api/oa/device/device";
  371. import { listCar, getCar } from '@/api/oa/car/car';
  372. import { listProjectChange } from "@/api/oa/project/projectChange";
  373. import { flowXmlAndNodeByFormId } from "@/api/flowable/definition";
  374. import { sendQyMessage } from "@/api/qywx/index"
  375. export default {
  376. props: {
  377. needReturn: {
  378. type: Boolean,
  379. default: true
  380. }
  381. },
  382. data() {
  383. return {
  384. baseUrl: process.env.VUE_APP_BASE_API,
  385. project: {},
  386. userList: [],
  387. deviceList: [],
  388. carList: [],
  389. workList: [],
  390. deptLeaderList: [],
  391. progressList: [],
  392. actualList: [],
  393. contractCode: "",
  394. contractNumber: "",
  395. openBudget: false,
  396. openPlan: false,
  397. openSafe: false,
  398. openTech: false,
  399. prLeaderOpen: false,
  400. deptOpen: false,
  401. taskForm: {
  402. formId: ''
  403. },
  404. projectComment: {},
  405. devices: [],
  406. cars: [],
  407. drivers: [],
  408. participates: [],
  409. undertakingDept: [],
  410. projectChangeList: [],
  411. drawerOpen: false,
  412. flowData: {},
  413. recordOpen: false,
  414. clickRow: {
  415. procInsId: '',
  416. deployId: ''
  417. },
  418. isProjectLeader: false,
  419. printOpen: false,
  420. isSend: false,
  421. }
  422. },
  423. created() {
  424. // 初始化数据
  425. this.userList = [];
  426. this.deviceList = [];
  427. this.carList = [];
  428. this.workList = [];
  429. this.deptLeaderList = [];
  430. this.progressList = [];
  431. this.actualList = [];
  432. this.projectChangeList = [];
  433. // 获取基础数据
  434. this.getUserList();
  435. this.getDeviceList();
  436. this.getCarList();
  437. // 获取项目相关数据
  438. if (this.$route.query.projectId) {
  439. this.taskForm.formId = this.$route.query.projectId;
  440. let projectId = this.$route.query.projectId;
  441. this.getProjectInfo(projectId);
  442. this.getProjectWorkList(projectId);
  443. this.getProjectCommentList(projectId);
  444. this.getContractDataList(projectId);
  445. this.getProjectProgressList(projectId);
  446. this.getActualList(projectId);
  447. this.getProjectChangeList(projectId);
  448. } else {
  449. this.goBack();
  450. }
  451. },
  452. methods: {
  453. // 获取项目信息
  454. async getProjectInfo(projectId) {
  455. const res = await getProject(projectId)
  456. if (res.data) {
  457. this.project = res.data;
  458. if (this.project.projectLeader == this.$store.state.user.id) {
  459. this.isProjectLeader = true;
  460. }
  461. let deptArr = [];
  462. if (this.project.undertakingDept && this.project.undertakingDept.trim() !== '') {
  463. deptArr = (this.project.undertakingDept.split(',')).map(Number)
  464. }
  465. for (let dept of deptArr) {
  466. const res = await getUsersDeptLeaderByDept({ deptId: Number(dept) })
  467. this.deptLeaderList.push(res.data.nickName);
  468. }
  469. if (this.project.devices && this.project.devices.trim() !== '') {
  470. this.devices = (this.project.devices.split(',')).map(Number)
  471. this.devices = await Promise.all(this.devices.map(async item => {
  472. const res = await getDevice(item)
  473. return res.data.name + '【' + res.data.code + '】' + '(' + res.data.brand + ')'
  474. }))
  475. }
  476. if (this.project.cars && this.project.cars.trim() !== '') {
  477. this.cars = (this.project.cars.split(',')).map(Number)
  478. this.cars = await Promise.all(this.cars.map(async item => {
  479. const res = await getCar(item)
  480. return res.data.licensePlate + '(' + res.data.brand + ')'
  481. }))
  482. }
  483. if (this.project.drivers && this.project.drivers.trim() !== '') {
  484. this.drivers = (this.project.drivers.split(',')).map(Number)
  485. this.drivers = await Promise.all(this.drivers.map(async item => {
  486. const res = await getUser(item)
  487. return res.data.nickName
  488. }))
  489. }
  490. if (this.project.participates && this.project.participates.trim() !== '') {
  491. this.participates = (this.project.participates.split(',')).map(Number);
  492. this.participates = await Promise.all(this.participates.map(async item => {
  493. const res = await getUser(item)
  494. return res.data.nickName
  495. }))
  496. }
  497. console.log(this.devices, this.cars, this.drivers, this.participates)
  498. this.getManagerList();
  499. }
  500. },
  501. // 获取用户列表
  502. getUserList() {
  503. listUser({
  504. pageNum: 1,
  505. pageSize: 9999
  506. }).then(res => {
  507. if (res.code == 200) {
  508. this.userList = res.rows
  509. }
  510. })
  511. },
  512. // 获取设备列表
  513. getDeviceList() {
  514. listDevice({
  515. pageNum: 1,
  516. pageSize: 99999999,
  517. type: '仪器设备'
  518. }).then(res => {
  519. this.deviceList = res.rows
  520. })
  521. },
  522. // 获取车辆列表
  523. getCarList() {
  524. listCar({ pageSize: 9999, pageNum: 1 }).then(res => {
  525. this.carList = res.rows
  526. })
  527. },
  528. // 获取项目工作列表
  529. getProjectWorkList(projectId) {
  530. listProjectWork({ pageNum: 1, pageSize: 50, projectId }).then(res => {
  531. this.workList = res.rows;
  532. })
  533. },
  534. // 获取项目评论列表
  535. getProjectCommentList(projectId) {
  536. getProjectComment(projectId).then(res => {
  537. if (res.data) {
  538. this.projectComment = res.data
  539. }
  540. })
  541. },
  542. // 获取项目进度列表
  543. getProjectProgressList(projectId) {
  544. getProjectProgress(projectId).then(res => {
  545. if (res.data) {
  546. this.progressList = res.data;
  547. }
  548. });
  549. },
  550. // 获取实际工作量列表
  551. getActualList(projectId) {
  552. listProjectWorkload({ pageNum: 1, pageSize: 100, projectId: projectId }).then(res => {
  553. if (res.total > 0) {
  554. this.actualList = res.rows;
  555. }
  556. })
  557. },
  558. // 获取合同数据列表
  559. getContractDataList(projectId) {
  560. listProjectContract({ projectId }).then(res => {
  561. if (res.rows) {
  562. for (let row of res.rows) {
  563. getContract(row.contractId).then(res => {
  564. if (res.data) {
  565. if (this.contractCode != '') {
  566. this.contractCode = this.contractCode + '、' + res.data.contractCode;
  567. } else {
  568. this.contractCode = res.data.contractCode;
  569. }
  570. if (this.contractNumber != '') {
  571. this.contractNumber = this.contractNumber + '、' + res.data.contractNumber;
  572. } else {
  573. this.contractNumber = res.data.contractNumber;
  574. }
  575. }
  576. })
  577. }
  578. }
  579. })
  580. },
  581. // 获取项目变更列表
  582. getProjectChangeList(projectId) {
  583. listProjectChange({ pageNum: 1, pageSize: 100, projectId }).then(response => {
  584. this.projectChangeList = response.rows;
  585. });
  586. },
  587. // 获取该项目的分管领导
  588. getManagerList() {
  589. let deptArr = [];
  590. if (this.project.undertakingDept && this.project.undertakingDept.trim() !== '') {
  591. deptArr = (this.project.undertakingDept.split(',')).map(Number)
  592. }
  593. for (let deptId of deptArr) {
  594. getUsersManageLeaderByDept({ deptId }).then(resopnse => {
  595. if (resopnse.data) {
  596. resopnse.data.forEach(element => {
  597. if (this.$store.getters.userId == element.userId) {
  598. this.isSend = true
  599. }
  600. });
  601. }
  602. })
  603. }
  604. },
  605. // 获取部门名称
  606. getDeptNames(deptIds) {
  607. if (!deptIds) return '';
  608. if (!this.$store.state.user || !this.$store.state.user.deptList) return deptIds;
  609. let names = [];
  610. let ids = deptIds.split(',');
  611. ids.forEach(id => {
  612. let dept = this.$store.state.user.deptList.find(d => d.deptId == id);
  613. if (dept) {
  614. names.push(dept.deptName);
  615. }
  616. });
  617. return names.length > 0 ? names.join(',') : deptIds;
  618. },
  619. // 获取用户名称
  620. getUserName(userId) {
  621. if (!userId || !this.userList) return '';
  622. let user = this.userList.find(u => u.userId == userId);
  623. return user ? user.nickName : '';
  624. },
  625. // 获取设备名称
  626. getDeviceNames(deviceIds) {
  627. if (!deviceIds || !deviceIds.length || !this.deviceList) return '';
  628. return deviceIds.map(id => {
  629. let device = this.deviceList.find(d => d.deviceId == id);
  630. return device ? device.name : '';
  631. }).join(',');
  632. },
  633. // 获取车辆名称
  634. getCarNames(carIds) {
  635. if (!carIds || !carIds.length || !this.carList) return '';
  636. return carIds.map(id => {
  637. let car = this.carList.find(c => c.carId == id);
  638. return car ? car.licensePlate : '';
  639. }).join(',');
  640. },
  641. // 获取用户名称列表
  642. getUserNames(userIds) {
  643. if (!userIds || !userIds.length || !this.userList) return '';
  644. return userIds.map(id => {
  645. let user = this.userList.find(u => u.userId == id);
  646. return user ? user.nickName : '';
  647. }).join(',');
  648. },
  649. // 获取文件名
  650. getFileName(name) {
  651. if (name != null) {
  652. let arr = name.split('/')
  653. return arr[arr.length - 1];
  654. }
  655. },
  656. // 返回上一页
  657. goBack() {
  658. uni.navigateBack();
  659. },
  660. // 预览文档
  661. reviewWord(url) {
  662. uni.navigateTo({
  663. url: '/pages/preview/preview?url=' + encodeURIComponent(url)
  664. });
  665. },
  666. // 下载文件
  667. downloadFile(url) {
  668. uni.downloadFile({
  669. url: url,
  670. success: (res) => {
  671. if (res.statusCode === 200) {
  672. uni.openDocument({
  673. filePath: res.tempFilePath,
  674. success: function () {
  675. console.log('打开文档成功');
  676. }
  677. });
  678. }
  679. }
  680. });
  681. },
  682. // 处理设备选择变化
  683. onDeviceChange(e) {
  684. this.devices = e.detail.value;
  685. },
  686. // 处理车辆选择变化
  687. onCarChange(e) {
  688. this.cars = e.detail.value;
  689. },
  690. // 处理驾驶员选择变化
  691. onDriverChange(e) {
  692. this.drivers = e.detail.value;
  693. },
  694. // 处理参与人员选择变化
  695. onParticipateChange(e) {
  696. this.participates = e.detail.value;
  697. },
  698. // 处理催促消息
  699. async handleUrge(type) {
  700. if (!this.project.projectLeader) {
  701. uni.showToast({
  702. title: '项目负责人未选定',
  703. icon: 'none'
  704. });
  705. return;
  706. }
  707. let message = '';
  708. let user = [];
  709. let userStirngList = [];
  710. if (type == '1') {
  711. let { data } = await getUserByPost({ postName: "专职安全员" });
  712. user.push(data[0].userId);
  713. message = "<font color='warning'>请尽快进行安全交底:</font> \n>" +
  714. "项目编号:" + this.project.projectNumber + " \n>" +
  715. "项目名称:" + this.project.projectName + " \n>";
  716. } else if (type == '2') {
  717. message = "<font color='warning'>请尽快进行技术交底:</font> \n>" +
  718. "项目编号:" + this.project.projectNumber + " \n>" +
  719. "项目名称:" + this.project.projectName + " \n>";
  720. }
  721. let deptList = (this.project.undertakingDept.split(',')).map(Number);
  722. for (let d of deptList) {
  723. let { data } = await getUsersDeptLeaderByDept({ deptId: d });
  724. user.push(data.userId);
  725. }
  726. user.push(this.project.projectLeader);
  727. for (let u of user) {
  728. let { data } = await getUser(u);
  729. userStirngList.push(data.pinyin);
  730. }
  731. let userString = userStirngList.join('|');
  732. uni.showModal({
  733. title: '提示',
  734. content: '是否发送企业微信消息?',
  735. success: (res) => {
  736. if (res.confirm) {
  737. let formData = new FormData();
  738. formData.append('message', message);
  739. formData.append('userString', userString + '|YuSiHan|WangRongHua');
  740. sendQyMessage(formData).then(() => {
  741. uni.showToast({
  742. title: '消息已发送!',
  743. icon: 'success'
  744. });
  745. });
  746. }
  747. }
  748. });
  749. },
  750. // 检查权限
  751. hasPermi(permission) {
  752. return this.$store.getters.permissions.includes(permission);
  753. },
  754. // 格式化时间
  755. parseTime(time, pattern) {
  756. if (!time) return '';
  757. let date = new Date(time);
  758. let year = date.getFullYear();
  759. let month = date.getMonth() + 1;
  760. let day = date.getDate();
  761. return pattern.replace('{y}', year)
  762. .replace('{m}', month.toString().padStart(2, '0'))
  763. .replace('{d}', day.toString().padStart(2, '0'));
  764. }
  765. }
  766. }
  767. </script>
  768. <style lang="scss" scoped>
  769. .container {
  770. padding: 20rpx;
  771. background-color: #f3f5f7;
  772. }
  773. .header {
  774. background-color: #fff;
  775. padding: 20rpx;
  776. margin-bottom: 20rpx;
  777. position: relative;
  778. text-align: center;
  779. .header-btns {
  780. display: flex;
  781. justify-content: space-between;
  782. margin-bottom: 20rpx;
  783. }
  784. .title {
  785. font-size: 36rpx;
  786. font-weight: bold;
  787. }
  788. }
  789. .section {
  790. background-color: #fff;
  791. margin-bottom: 20rpx;
  792. padding: 20rpx;
  793. .section-title {
  794. font-size: 32rpx;
  795. font-weight: bold;
  796. margin-bottom: 20rpx;
  797. position: relative;
  798. padding-left: 20rpx;
  799. .line {
  800. position: absolute;
  801. left: 0;
  802. top: 50%;
  803. transform: translateY(-50%);
  804. width: 8rpx;
  805. height: 32rpx;
  806. background-color: #303133;
  807. border-radius: 4rpx;
  808. }
  809. }
  810. }
  811. .info-list {
  812. .info-item {
  813. display: flex;
  814. margin-bottom: 20rpx;
  815. padding: 20rpx;
  816. background-color: #f8f9fa;
  817. border-radius: 8rpx;
  818. &.full-width {
  819. flex-direction: column;
  820. }
  821. .label {
  822. width: 175rpx;
  823. color: #5a5757;
  824. font-weight: bold;
  825. }
  826. .value {
  827. flex: 1;
  828. color: #333;
  829. padding-left: 10rpx;
  830. }
  831. }
  832. }
  833. .table {
  834. width: 100%;
  835. border: 1px solid #eee;
  836. .table-header {
  837. display: flex;
  838. background-color: #f5f7fa;
  839. .th {
  840. flex: 1;
  841. padding: 20rpx;
  842. text-align: center;
  843. font-weight: bold;
  844. border-right: 1px solid #eee;
  845. border-bottom: 1px solid #eee;
  846. }
  847. }
  848. .table-body {
  849. .tr {
  850. display: flex;
  851. border-bottom: 1px solid #eee;
  852. .td {
  853. flex: 1;
  854. padding: 20rpx;
  855. text-align: center;
  856. border-right: 1px solid #eee;
  857. }
  858. }
  859. }
  860. }
  861. .btn {
  862. padding: 20rpx 40rpx;
  863. background-color: #409eff;
  864. color: #fff;
  865. border-radius: 8rpx;
  866. font-size: 28rpx;
  867. margin: 0 10rpx;
  868. &.btn-small {
  869. padding: 10rpx 20rpx;
  870. font-size: 24rpx;
  871. }
  872. }
  873. .link {
  874. color: #409eff;
  875. text-decoration: underline;
  876. }
  877. .textarea {
  878. width: 100%;
  879. height: 200rpx;
  880. border: 1px solid #eee;
  881. border-radius: 8rpx;
  882. padding: 20rpx;
  883. margin-bottom: 20rpx;
  884. }
  885. .sign {
  886. display: flex;
  887. justify-content: space-between;
  888. color: #666;
  889. font-size: 24rpx;
  890. }
  891. .picker {
  892. padding: 20rpx;
  893. background-color: #fff;
  894. border: 1px solid #eee;
  895. border-radius: 8rpx;
  896. }
  897. .normal {
  898. color: #909399;
  899. }
  900. .important {
  901. color: #f56c6c;
  902. }
  903. .card-container {
  904. display: flex;
  905. flex-direction: column;
  906. gap: 20rpx;
  907. width: 100%;
  908. margin-top: 20rpx;
  909. }
  910. .card {
  911. background-color: #fff;
  912. border-radius: 12rpx;
  913. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
  914. overflow: hidden;
  915. margin-bottom: 20rpx;
  916. }
  917. .card-content {
  918. display: flex;
  919. flex-direction: column;
  920. min-height: 200rpx;
  921. }
  922. .card-left {
  923. width: 100%;
  924. background-color: #f5f7fa;
  925. padding: 20rpx;
  926. display: flex;
  927. align-items: center;
  928. justify-content: center;
  929. border-bottom: 1px solid #eee;
  930. }
  931. .card-title {
  932. font-size: 28rpx;
  933. font-weight: bold;
  934. color: #303133;
  935. letter-spacing: 4rpx;
  936. }
  937. .card-right {
  938. flex: 1;
  939. padding: 20rpx;
  940. }
  941. .card-item {
  942. display: flex;
  943. margin-bottom: 16rpx;
  944. line-height: 1.5;
  945. }
  946. .card-item .label {
  947. width: 180rpx;
  948. font-size: 26rpx;
  949. color: #5a5757;
  950. font-weight: bold;
  951. text-align: right;
  952. }
  953. .card-item .value {
  954. flex: 1;
  955. font-size: 26rpx;
  956. color: #333;
  957. word-break: break-all;
  958. padding-left: 10rpx;
  959. }
  960. .device-item{
  961. border-bottom: 1px solid #e2e2e2;
  962. padding: 10rpx;
  963. }
  964. </style>