indexPK.vue 16 KB

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