综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

projectInfo.vue 32KB

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