indexPK.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <!--
  2. *@description: 工程历史详情
  3. *@author: yh Fu
  4. *@date: 2024-1-8 10:04:23
  5. *@version: V1.0.5
  6. -->
  7. <template>
  8. <div style="width: 100%;height: 100%;">
  9. <el-dialog
  10. :visible.sync="dialogVisible"
  11. :title="titleName"
  12. width="60%"
  13. append-to-body
  14. custom-class="ConstructionDetailsDialog">
  15. <el-tabs type="card" v-model="activeNames" @tab-click="viewSource" class="projectTabs">
  16. <el-tab-pane
  17. :label="e.label"
  18. :name="e.value"
  19. v-for="(e,idx) in currentDicts"
  20. :key="idx"
  21. >
  22. <el-checkbox-group v-model="checkList">
  23. <el-collapse
  24. class="rmOldPie"
  25. v-for="(e,idx) in currentCollapses"
  26. :key="idx"
  27. >
  28. <el-collapse-item :name="idx">
  29. <template slot="title">
  30. <div style="display: flex;width: 100%;height: 100%;">
  31. <el-checkbox :label="e.id" @change="handleCheckedCitiesChange">
  32. <h2 style="margin-left: 1%;font-weight: 700;">{{ e.updateTime }}</h2>
  33. </el-checkbox>
  34. <h2 :style="'margin-left: 20%;font-weight: 700;'+ (e.state == '1'? 'color: #1ab394':'') "> {{e.state=='0'?"该施工信息审核未通过":e.state=='1'?"该施工信息审核通过":""}}</h2>
  35. </div>
  36. </template>
  37. <div class="personInfo">
  38. <span>施工人:{{ userNames[idx].nickName }}</span>
  39. <span>施工人电话:{{ userNames[idx].phonenumber }}</span>
  40. </div>
  41. <hr>
  42. <el-form :model="e">
  43. <el-form-item label="管道压力" prop="remark" v-if=" activeNames == '管道压力'">
  44. <el-input
  45. v-model="e.constructAccordingDrawings"
  46. placeholder="请输入管道压力"
  47. maxlength="255"
  48. />
  49. </el-form-item>
  50. <el-form-item label="原有管线压力" prop="remark" v-if="activeNames == '原有管线压力'">
  51. <el-input
  52. v-model="e.constructAddre"
  53. placeholder="请输入原有管线压力"
  54. maxlength="255"
  55. />
  56. </el-form-item>
  57. <el-form-item
  58. :prop="e.remark"
  59. :class="'labelWidth'"
  60. label="施工内容"
  61. label-width="95px"
  62. >
  63. <div class="block" style="display: inline-block; margin-right: 20px;">
  64. <el-input v-model="e.remark" placeholder="请输入施工内容" style="width: 100%" maxlength="100"
  65. type="textarea" :readonly="['review','read-only'].includes(status)"></el-input>
  66. </div>
  67. </el-form-item>
  68. </el-form>
  69. <!-- 用料明细 -->
  70. <div style="display: flex;width: 100%;height: 100%;">
  71. <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">图片</h3>
  72. <ObsImageUpload
  73. :class=" (status == 'read-only' || status == 'review' )? 'obsImageUploads' : '' "
  74. ref="obsImageUpload"
  75. :limit="11"
  76. :fileType="['png', 'jpg', 'jpeg']"
  77. @input="getUrl(arguments,idx)"
  78. :value="e.zEngiineeringPhotoBoList"
  79. :disabled="['review','read-only'].includes(status)"
  80. ></ObsImageUpload>
  81. </div>
  82. <div style="display: flex; justify-content: flex-end; width: 100%;height: 100%;"
  83. v-if="status == 'put'">
  84. <el-button plain type="danger" @click=" handleDelete(e)"
  85. v-hasPermi="['zdsz:engineeringCivilNode:remove']" style="width: 94px;">删除
  86. </el-button>
  87. </div>
  88. </el-collapse-item>
  89. </el-collapse>
  90. </el-checkbox-group>
  91. </el-tab-pane>
  92. <el-button class="check" plain type="danger" @click="checkWorking"
  93. v-if="status == 'review' " style="width: 80px;"
  94. :disabled="currentCollapses.length == 0">审核
  95. </el-button>
  96. <el-button class="check" plain type="danger" @click="updateNodeOption" style="width: 94px;cursor: pointer;"
  97. v-if="status == 'put' ">修改
  98. </el-button>
  99. </el-tabs>
  100. </el-dialog>
  101. <!-- 审核 -->
  102. <el-dialog
  103. title="审核"
  104. :visible.sync="checkingVisible"
  105. :title="titleName"
  106. width="30%"
  107. class="checkingDialog"
  108. :before-close="handleChecking">
  109. <el-form :model="checkingInfo" ref="checking" :rules="checkingRule" class="nodeForm">
  110. <el-form-item
  111. label-width="85px"
  112. label="审核状态"
  113. prop="reviewStatus"
  114. >
  115. <el-select v-model="checkingInfo.reviewStatus" placeholder="请选择审核状态" style="width: 100%"
  116. label="审核状态" @change="validateCHanged">
  117. <el-option
  118. v-for="e in reviewStatusList"
  119. :key="e.label"
  120. :label="e.label"
  121. :value="e.value"
  122. ></el-option>
  123. </el-select>
  124. </el-form-item>
  125. <el-form-item
  126. label-width="85px"
  127. label="审核内容"
  128. prop="reviewContent"
  129. >
  130. <div class="block" style="display: inline-block; margin-right: 20px;">
  131. <el-input
  132. v-model="checkingInfo.reviewContent"
  133. placeholder="请输入审核内容"
  134. type="textarea"
  135. style="width: 97%"/>
  136. </div>
  137. </el-form-item>
  138. </el-form>
  139. <span slot="footer" class="dialog-footer">
  140. <el-button @click="handleChecking">取 消</el-button>
  141. <el-button type="primary" @click=checkingSubmit>确 定</el-button>
  142. </span>
  143. </el-dialog>
  144. </div>
  145. </template>
  146. <script>
  147. import {
  148. deleteinfoById,
  149. getEnginMaterialQualityList, // 材质
  150. getEnginSpecificationsList, // 规格
  151. } from '@/api/zdsz/enginee'
  152. import {selectUserByUserName} from '@/api/system/user'
  153. import ObsVideoUpload from "@/components/ObsVideoUpload/index.vue";
  154. export default {
  155. name: 'PKinfo',
  156. dicts: ['tapping_operation','bury_the_wrench_hole','aerial_wrench_hole','shutdown_operation','pe_plugging','the_steel_pipe_sealed_with_gas'],
  157. components: {ObsVideoUpload},
  158. props: ['currentCollapses', 'nodeDetailType', 'enginType', 'zEngineeringNodeBo'],
  159. data() {
  160. return {
  161. kind: null,
  162. status: null,
  163. userNames: [],
  164. checkList: [],
  165. enginNode: '',
  166. currentDicts: [], // 当前类型工程节点项
  167. dialogVisible: false,
  168. activeNames: '',
  169. titleName: '',
  170. reviewStatusList: [
  171. {
  172. value: '1',
  173. label: '通过'
  174. },
  175. {
  176. value: '0',
  177. label: '不通过'
  178. }
  179. ],
  180. nodesource: '',// 审核状态option
  181. materialQualityList: [], // 材质
  182. specificationsList: [], // 规格
  183. materialComponList: [],
  184. engineType: null,
  185. enginClassification: null,
  186. nodeInfo: {
  187. backfillTime: '', // 回填时间
  188. constructTime: '',
  189. constructAccordingDrawings: '',
  190. segmentedCompressionQualified: '',
  191. zEngiineeringPhotoBoList: [], // 照片集合
  192. zEngiineeringPhotoBoListOne: [], // 照片集合
  193. zEngiineeringPhotoBoListTwo: [], // 照片集合
  194. zEngiineeringPhotoBoListThree: [], // 照片集合
  195. zEngineeringMaterialBo: [], // 用料集合
  196. remark: '',
  197. constructAddre: ''
  198. },
  199. checkingInfo: {
  200. reviewStatus: '', // 审核状态
  201. reviewContent: '', // 审核内容
  202. engInfoId: '', // 节点Id
  203. createTime: '', // 工程创建时间
  204. },
  205. currentStatus: null,
  206. checkingVisible: null,
  207. isChecking: true,
  208. currentEnginId: null,
  209. reviewStatus: null,
  210. corrosionLevelListAll: [],
  211. infoIdList: [],
  212. delinfoidList: [],
  213. checkingRule: {
  214. reviewStatus: [
  215. {required: true, message: "审核状态不能为空", trigger: "blur"}
  216. ],
  217. reviewContent: [
  218. {required: true, message: "审核内容不能为空", trigger: "change"}
  219. ],
  220. },
  221. node: null
  222. }
  223. },
  224. created() {
  225. },
  226. mounted() {
  227. this.getGoods()
  228. },
  229. watch: {
  230. // 此处监听variable变量,当期有变化时执行
  231. currentDicts(item1, item2) {
  232. this.activeNames = item1[0].value
  233. this.$parent.viewNodeSource(item1[0].value)
  234. },
  235. currentCollapses() {
  236. console.log('currentCollapses', this.currentCollapses)
  237. this.userNames = [];
  238. for (let i in this.currentCollapses) {
  239. selectUserByUserName(this.currentCollapses[i].createBy).then(res => {
  240. this.userNames.push(res);
  241. })
  242. }
  243. try {
  244. this.currentCollapses[0].zEngineeringReviewBo.reviewStatus != 1 ? this.isChecking = true : false
  245. } catch (error) {
  246. this.isChecking = true
  247. }
  248. }
  249. },
  250. methods: {
  251. getGoods() {
  252. // 获取材质
  253. let enginType = '市政工程'
  254. getEnginMaterialQualityList({enginType: enginType}).then(res => {
  255. this.materialQualityList = res.data
  256. })
  257. // 获取规格
  258. getEnginSpecificationsList().then(res => {
  259. this.corrosionLevelListAll = res.data
  260. })
  261. },
  262. handleCheckedCitiesChange(e) {
  263. this.infoIdList = this.currentCollapses.filter(item => this.checkList.indexOf(item.id) > -1)
  264. this.delinfoidList = this.currentCollapses.map(item => item.id).filter(item => this.checkList.indexOf(item) == -1)
  265. },
  266. validateCHanged(e) {
  267. this.reviewStatusList[e].label == '通过' ? this.checkingRule.reviewContent[0].required = true : this.checkingRule.reviewContent[0].required = false
  268. },
  269. handleChecking() {
  270. this.checkingVisible = false
  271. this.checkingInfo = {
  272. reviewStatus: '', // 审核状态
  273. reviewContent: '', // 审核内容
  274. engInfoId: '', // 节点Id
  275. createTime: '', // 工程创建时间
  276. }
  277. this.$refs.checking.resetFields()
  278. },
  279. // 保存节点Id
  280. setEngineId(e) {
  281. this.currentEnginId = e
  282. },
  283. // 提交审核
  284. checkingSubmit() {
  285. this.$confirm('此操作将删除其他施工信息, 是否继续?', '提示', {
  286. confirmButtonText: '确定',
  287. cancelButtonText: '取消',
  288. type: 'warning'
  289. }).then(() => {
  290. this.shenhe()
  291. }).catch(() => {
  292. });
  293. },
  294. shenhe() {
  295. this.$refs.checking.validate(valid => {
  296. if (valid) {
  297. try {
  298. this.checkingInfo.engInfoName = this.activeNames
  299. this.checkingInfo.engInfoId = this.currentEnginId
  300. this.checkingInfo.delInfoIdList = this.delinfoidList
  301. this.checkingInfo.infoIdList = this.infoIdList
  302. this.$emit('checkWorking', this.checkingInfo)
  303. this.checkList = []
  304. } catch (error) {
  305. this.checkingInfo.engInfoId = null
  306. }
  307. this.checkingVisible = false
  308. this.checkingInfo = {
  309. reviewStatus: '', // 审核状态
  310. reviewContent: '', // 审核内容
  311. engInfoId: '', // 节点Id
  312. createTime: '', // 工程创建时间
  313. }
  314. } else {
  315. this.$message({
  316. message: '请完善信息',
  317. type: 'error'
  318. });
  319. throw 'valid Failed'
  320. }
  321. })
  322. },
  323. // 查看单节点历史
  324. viewSource(e) {
  325. console.log('节点', e)
  326. this.node = e.name
  327. this.nodesource = e
  328. let data = {enginType: this.enginType}
  329. getEnginMaterialQualityList(data).then(res => {
  330. this.materialQualityList = res.data
  331. })
  332. this.$parent.viewNodeSource(e.name)
  333. },
  334. // 单项审核
  335. checkWorking() {
  336. if (this.checkList.length == 0) {
  337. this.$message.warning("请选择需要审核通过的施工信息")
  338. return
  339. }
  340. if (this.status == 'review') {
  341. this.checkingVisible = true
  342. }
  343. },
  344. updateNodeOption() {
  345. if (this.checkList.length == 0) {
  346. this.$message.warning("请选择需要修改的施工信息")
  347. return
  348. }
  349. const intersection = this.currentCollapses.filter(value => this.checkList.includes(value.id));
  350. this.$emit('updateNodeOption', intersection)
  351. },
  352. deleteById(e) {
  353. deleteinfoById(e).then(res => {
  354. this.viewSource(this.nodesource)
  355. })
  356. },
  357. handleDelete(row) {
  358. this.$modal.confirm('是否确认删除所选数据项?').then(() => {
  359. this.loading = true;
  360. return this.deleteById(row)
  361. }).then(() => {
  362. this.loading = false;
  363. this.getList();
  364. this.$modal.msgSuccess("删除成功");
  365. }).catch(() => {
  366. }).finally(() => {
  367. this.loading = false;
  368. });
  369. },
  370. /**
  371. * 查看历史
  372. * @param dicts 节点集合
  373. * @param currentStatus
  374. * @param title 标题
  375. * @param enginType 工程分类
  376. * @param status 页面状态
  377. */
  378. open(dicts, currentStatus = null, title = null, enginType, status) {
  379. this.checkList = []
  380. this.status = status;
  381. if (dicts && dicts[0]) {
  382. this.node = dicts[0].value
  383. }
  384. this.titleName = title
  385. this.checkingVisible = false
  386. this.currentDicts = dicts
  387. this.$parent.viewNodeSource()
  388. this.dialogVisible = true
  389. this.$forceUpdate()
  390. },
  391. // 获取材质规格
  392. getEnginSpecificationsList(e, idx, parentIndex) {
  393. // 重置规格
  394. this.currentCollapses[parentIndex].zEngineeringMaterialBo[idx].specifications = ''
  395. getEnginSpecificationsList({materId: e.materialQuality}).then(res => {
  396. console.log('规格', res.data)
  397. this.specificationsList = res.data
  398. })
  399. },
  400. getUrl(_, idx) {
  401. this.currentCollapses[idx].zEngiineeringPhotoBoList = [...arguments][0][0].map(e => e.url) || [];
  402. },
  403. getUrl1(_, idx) {
  404. this.currentCollapses[idx].zEngiineeringPhotoBoListOne = [...arguments][0][0].map(e => e.url) || [];
  405. },
  406. getUrl2(_, idx) {
  407. this.currentCollapses[idx].zEngiineeringPhotoBoListTwo = [...arguments][0][0].map(e => e.url) || [];
  408. },
  409. getUrl3(_, idx) {
  410. this.currentCollapses[idx].zEngiineeringPhotoBoListThree = [...arguments][0][0].map(e => e.url) || [];
  411. },
  412. }
  413. }
  414. </script>
  415. <style lang="scss" scoped>
  416. ::v-deep .nodeForm {
  417. .el-form-item__content {
  418. display: flex;
  419. }
  420. }
  421. ::v-deep .materialForm {
  422. display: flex !important;
  423. flex-wrap: wrap;
  424. .el-form-item {
  425. width: 320px;
  426. }
  427. }
  428. ::v-deep .obsImageUpload {
  429. .el-upload--picture-card {
  430. display: block !important;
  431. }
  432. }
  433. ::v-deep .obsImageUpload > div {
  434. display: flex;
  435. }
  436. ::v-deep .el-dialog {
  437. height: 85%;
  438. .el-dialog__body {
  439. overflow: hidden;
  440. height: 91%;
  441. }
  442. }
  443. ::v-deep .el-upload-notShow {
  444. .el-upload--picture-card {
  445. display: none;
  446. }
  447. }
  448. ::v-deep .labelWidth {
  449. .el-form-item__label {
  450. width: 100px;
  451. }
  452. }
  453. ::v-deep .obsImageUploads {
  454. .el-upload--picture-card {
  455. display: none;
  456. }
  457. }
  458. .ConstructionDetailsDialog {
  459. position: absolute;
  460. .projectTabs {
  461. height: 100%;
  462. overflow: hidden;
  463. overflow-y: scroll;
  464. margin-top: 4%;
  465. ::v-deep .el-tabs__content {
  466. margin-top: 1%;
  467. }
  468. ::v-deep .el-tabs__nav {
  469. border: none;
  470. overflow: hidden;
  471. overflow-x: scroll;
  472. }
  473. ::v-deep .el-tabs__item {
  474. // width: 47%;
  475. border: 1px solid #a3d3ff;
  476. border-radius: 5px;
  477. }
  478. ::v-deep .el-tabs__item.is-active {
  479. background-color: #e8f4ff;
  480. color: #1890ff;
  481. }
  482. ::v-deep .el-tabs__header {
  483. position: fixed;
  484. width: 53%;
  485. border: none;
  486. top: 13%;
  487. }
  488. ::v-deep .el-collapse-item__wrap {
  489. padding: 0 4%;
  490. }
  491. .check {
  492. position: fixed;
  493. right: 22.1%;
  494. top: 13.1%;
  495. height: 4.6%;
  496. //background-color: #CC9900;
  497. //color: #fff;
  498. }
  499. }
  500. .projectTabs::-webkit-scrollbar {
  501. display: none;
  502. }
  503. ::v-deep .rmOldPie {
  504. .el-collapse-item {
  505. border: none;
  506. }
  507. }
  508. }
  509. .personInfo > span:not(:nth-child(1)) {
  510. margin-left: 50px;
  511. }
  512. ::v-deep .checkingDialog {
  513. height: 50%;
  514. margin-top: 6%;
  515. .el-dialog__body {
  516. height: 72%;
  517. }
  518. .el-textarea__inner {
  519. width: 246%;
  520. height: 140px;
  521. }
  522. }
  523. </style>