index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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=""
  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-collapse
  23. class="rmOldPie"
  24. v-for="(e,idx) in currentCollapses"
  25. :key="idx"
  26. >
  27. <el-collapse-item :name="idx">
  28. <template slot="title">
  29. <div style="display: flex;width: 100%;height: 100%;">
  30. <div
  31. style="width: 3%;height: 29px;margin: auto 0;border-radius: 73%;background-color: rgb(0, 157, 217);box-shadow: 1px 1px #BFBFBF;">
  32. </div>
  33. <h2 style="margin-left: 1%;font-weight: 700;">{{ e.updateTime }}</h2>
  34. </div>
  35. </template>
  36. <!-- 人员信息 -->
  37. <div>
  38. 负责人:{{ e.headName }} &nbsp;&nbsp;
  39. 施工人:{{ e.constructUser }} &nbsp;&nbsp;
  40. 负责人电话:{{ e.headPhone }} &nbsp;&nbsp;
  41. 施工人电话:{{ e.constructPhone }}
  42. </div>
  43. <hr>
  44. <!-- 用料明细 -->
  45. <div
  46. v-for="(i,index) in e.zEngineeringMaterialBo || [] "
  47. :key="index"
  48. >
  49. <el-form :model="nodeInfo" class="nodeForm">
  50. <el-form-item
  51. :prop="i.materialQuality"
  52. label-width="50px"
  53. label="材质"
  54. v-show="i.materialQuality != null"
  55. >
  56. <!-- :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
  57. <!-- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
  58. <el-select v-model="i.materialQuality" placeholder="请选择材质" style="width: 100%" @change="getEnginSpecificationsList(item, index)" :disabled="status == 'read-only' ">
  59. <el-option
  60. v-for="e in materialQualityList"
  61. :key="e.id"
  62. :label="e.name"
  63. :value="e.id"
  64. ></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item
  68. :prop="i.specifications"
  69. label-width="50px"
  70. label="规格"
  71. v-show="i.specifications != null"
  72. >
  73. <el-select v-model="i.specifications" placeholder="请选择规格" style="width: 100%" @change="getEnginSpecificationsList(item, index)" :disabled="status == 'read-only' ">
  74. <el-option
  75. v-for="e in specificationsList"
  76. :key="e.id"
  77. :label="e.name"
  78. :value="e.id"
  79. ></el-option>
  80. </el-select>
  81. </el-form-item>
  82. <el-form-item
  83. :prop="i.number + ''"
  84. label-width="50px"
  85. label="数量"
  86. v-show="i.number != null"
  87. >
  88. <div class="block" style="display: inline-block; margin-right: 20px;">
  89. <el-input v-model="i.number" placeholder="请输入数量" style="width: 100%" type="number" :disabled="status == 'read-only' "/>
  90. </div>
  91. </el-form-item>
  92. <el-form-item
  93. :prop="i.corrosionLevel"
  94. label="腐蚀等级"
  95. v-show="i.corrosionLevel != null"
  96. >
  97. <!-- :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
  98. <!-- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
  99. <el-select v-model="i.corrosionLevel" placeholder="请选择腐蚀等级" style="width: 100%" @change="getEnginSpecificationsList(item, index)" :disabled="status == 'read-only' ">
  100. <el-option
  101. v-for="e in corrosionLevelList"
  102. :key="e.dictValue"
  103. :label="e.dictLabel"
  104. :value="e.dictValue"
  105. ></el-option>
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item
  109. :prop="i.visitType"
  110. label-width="50px"
  111. label="上门类型"
  112. v-show="i.visitType != null"
  113. >
  114. <!-- :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
  115. <!-- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
  116. <el-select v-model="i.visitType" placeholder="请选择上门类型" style="width: 100%" @change="getEnginSpecificationsList(item, index)" :disabled="status == 'read-only' ">
  117. <el-option
  118. v-for="e in dict.type.visit_type"
  119. :key="e.value"
  120. :label="e.label"
  121. :value="e.value"
  122. ></el-option>
  123. </el-select>
  124. </el-form-item>
  125. <el-form-item
  126. :prop="i.selfClosingValveType"
  127. label-width="50px"
  128. label="自闭阀类型"
  129. v-show="i.selfClosingValveType != null"
  130. >
  131. <!-- :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
  132. <!-- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
  133. <el-select v-model="i.selfClosingValveType" placeholder="请选择自闭阀类型" style="width: 100%" @change="getEnginSpecificationsList(item, index)" :disabled="status == 'read-only' ">
  134. <el-option
  135. v-for="e in dict.type.self_closing_valve_type"
  136. :key="e.value"
  137. :label="e.label"
  138. :value="e.value"
  139. ></el-option>
  140. </el-select>
  141. </el-form-item>
  142. </el-form>
  143. <!-- <el-input size="mini" v-if="i.brand" style="width: 80%" v-model="i.brand" placeholder="请输入品牌">
  144. <template slot="prepend">品牌</template>
  145. </el-input>
  146. <el-input v-if="i.visitType" size="mini" v-model="i.visitType" placeholder="请输入品牌">
  147. <template slot="prepend">上门类型</template>
  148. </el-input>
  149. <el-input size="mini" v-if="i.corrosionLevel" v-model="i.corrosionLevel" placeholder="请输入品牌">
  150. <template slot="prepend">腐蚀等级</template>
  151. </el-input>
  152. <el-input size="mini" v-if="i.selfClosingValveType" v-model="i.selfClosingValveType"
  153. placeholder="请输入品牌">
  154. <template slot="prepend">自闭阀类型</template>
  155. </el-input> -->
  156. </div>
  157. <!-- <el-form-item label="照片" :prop="e.zEngiineeringPhotoBoList" class="obsImage"> -->
  158. <ObsImageUpload
  159. :class=" status == 'read-only' ? '' : obsImageUpload"
  160. ref="obsImageUpload"
  161. :limit="9999"
  162. :fileType="['png', 'jpg', 'jpeg']"
  163. @input="getUrl"
  164. :value="e.zEngiineeringPhotoBoList"
  165. :disabled="status == 'read-only' "
  166. ></ObsImageUpload>
  167. <!-- </el-form-item> -->
  168. <hr>
  169. </el-collapse-item>
  170. </el-collapse>
  171. </el-tab-pane>
  172. <button class="check" @click="checkWorking" v-if="currentStatus == 'check' && reviewStatus " style="width: 80px;border: none;">审核</button>
  173. <button class="check" @click="updateNodeOption" style="width: 94px;border: none;cursor: pointer;" v-if="currentStatus != 'check'">修改</button>
  174. </el-tabs>
  175. </el-dialog>
  176. <!-- 审核 -->
  177. <el-dialog
  178. title="审核"
  179. :visible.sync="checkingVisible"
  180. width="30%"
  181. class="checkingDialog"
  182. :before-close="handleClose">
  183. <el-form :model="checkingInfo" ref="checking" class="nodeForm">
  184. <el-form-item
  185. label-width="70px"
  186. label="审核状态"
  187. >
  188. <el-select v-model="checkingInfo.reviewStatus" placeholder="请选择审核状态" style="width: 100%" label="审核状态">
  189. <el-option
  190. v-for="e in reviewStatusList"
  191. :key="e.label"
  192. :label="e.label"
  193. :value="e.value"
  194. ></el-option>
  195. </el-select>
  196. </el-form-item>
  197. <el-form-item
  198. label-width="70px"
  199. label="审核内容"
  200. >
  201. <div class="block" style="display: inline-block; margin-right: 20px;">
  202. <el-input
  203. v-model="checkingInfo.reviewContent"
  204. placeholder="请输入审核内容"
  205. type="textarea"
  206. style="width: 100%"/>
  207. </div>
  208. </el-form-item>
  209. </el-form>
  210. <span slot="footer" class="dialog-footer">
  211. <el-button @click="checkingVisible = false">取 消</el-button>
  212. <el-button type="primary" @click=checkingSubmit>确 定</el-button>
  213. </span>
  214. </el-dialog>
  215. </div>
  216. </template>
  217. <script>
  218. import {
  219. getEnginMaterialQualityList, // 材质
  220. getEnginSpecificationsList, // 规格
  221. getDictType, // 腐蚀程度
  222. } from '@/api/zdsz/enginee'
  223. export default {
  224. name: 'ConstructionDetails',
  225. dicts:[
  226. 'visit_type',
  227. 'self_closing_valve_type',
  228. ],
  229. props: ['currentCollapses','nodeDetailType','enginType','status'],
  230. data() {
  231. return {
  232. currentDicts: [], // 当前类型工程节点项
  233. dialogVisible: false,
  234. activeNames: '',
  235. reviewStatusList:[
  236. {
  237. value:'1',
  238. label:'通过'
  239. },
  240. {
  241. value:'0',
  242. label:'不通过'
  243. }
  244. ], // 审核状态option
  245. corrosionLevelList:[], // 腐蚀等级option
  246. materialQualityList:[], // 材质
  247. specificationsList:[], // 规格
  248. materialComponList:[],
  249. nodeInfo:{
  250. backfillTime:'', // 回填时间
  251. constructTime:'',
  252. constructAccordingDrawings:'',
  253. segmentedCompressionQualified:'',
  254. zEngiineeringPhotoBoList:[], // 照片集合
  255. zEngineeringMaterialBo:[], // 用料集合
  256. remark:'',
  257. },
  258. checkingInfo:{
  259. reviewStatus:'', // 审核状态
  260. reviewContent:'', // 审核内容
  261. engInfoId:'', // 节点Id
  262. createTime:'', // 工程创建时间
  263. },
  264. currentStatus:null,
  265. checkingVisible:null,
  266. }
  267. },
  268. created(){
  269. // 获取材质
  270. getEnginMaterialQualityList({enginType:this.enginType}).then(res => {
  271. console.log('材质',res)
  272. this.materialQualityList = res.data
  273. })
  274. // 获取腐蚀等级
  275. getDictType({dictType:'corrosion_level'}).then(res => {
  276. console.log('腐蚀等级',res)
  277. this.corrosionLevelList = res.data
  278. })
  279. },
  280. mounted() {
  281. },
  282. computed:{
  283. reviewStatus(){
  284. let flag = null
  285. try {
  286. flag = currentCollapses[0].zEngineeringReviewBo.reviewStatus != '1' ? true : false
  287. } catch (error) {
  288. flag = true
  289. }
  290. return flag
  291. }
  292. },
  293. watch: {
  294. // 此处监听variable变量,当期有变化时执行
  295. currentDicts(item1, item2) {
  296. // item1为新值,item2为旧值
  297. console.log('item1为新值,item2为旧值', item1[0].value)
  298. this.activeNames = item1[0].value
  299. this.$parent.viewNodeSource(item1[0].value)
  300. },
  301. currentCollapses(){
  302. let materialQuality = []
  303. try {
  304. materialQuality = this.currentCollapses[0].zEngineeringMaterialBo[0].materialQuality
  305. } catch (error) {
  306. materialQuality = []
  307. }
  308. if(materialQuality){
  309. getEnginSpecificationsList({materId:materialQuality}).then(res => {
  310. console.log('规格',res.data)
  311. this.specificationsList = res.data
  312. })
  313. }
  314. }
  315. },
  316. methods: {
  317. // 提交审核
  318. checkingSubmit(){
  319. try {
  320. this.checkingInfo.engInfoId = this.currentCollapses[0].id
  321. } catch (error) {
  322. this.checkingInfo.engInfoId = null
  323. }
  324. this.$emit('checkWorking',this.checkingInfo)
  325. },
  326. // 查看单节点历史
  327. viewSource(e) {
  328. console.log(this.$parent)
  329. this.$parent.viewNodeSource(e.name)
  330. },
  331. // 单项审核
  332. checkWorking() {
  333. if(this.currentStatus == 'check'){
  334. this.checkingVisible = true
  335. }
  336. },
  337. updateNodeOption(){
  338. console.log(this.activeNames)
  339. console.log('最新面板',this.currentCollapses)
  340. this.$emit('updateNodeOption',this.currentCollapses)
  341. },
  342. // 查看历史
  343. open(dicts, type = null,currentStatus = null) {
  344. this.currentStatus = currentStatus
  345. this.checkingVisible = false
  346. if (type == '1' || type == '2') {
  347. // 工业 市政
  348. this.$parent.viewNodeSource()
  349. this.currentDicts = [
  350. {
  351. value: "历史数据",
  352. label: "历史数据"
  353. }
  354. ]
  355. } else if (type === '危险作业工程') {
  356. this.$parent.viewNodeSource()
  357. this.currentDicts = [
  358. {
  359. value: "历史数据",
  360. label: "历史数据"
  361. }
  362. ]
  363. } else {
  364. console.log(dicts)
  365. debugger
  366. this.dialogVisible = true
  367. this.currentDicts = dicts
  368. }
  369. this.dialogVisible = true
  370. },
  371. // 获取材质规格
  372. getEnginSpecificationsList(e,idx){
  373. getEnginSpecificationsList({materId:e.materialQuality}).then(res => {
  374. console.log('规格',res.data)
  375. this.specificationsList = res.data
  376. })
  377. },
  378. getUrl(url,idx) {
  379. this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e=>e.url):[];
  380. },
  381. }
  382. }
  383. </script>
  384. <style lang="scss" scoped>
  385. ::v-deep .nodeForm{
  386. .el-form-item__content{
  387. display: flex;
  388. }
  389. }
  390. ::v-deep .obsImageUpload{
  391. .el-upload--picture-card{
  392. display: block !important;
  393. }
  394. }
  395. ::v-deep .obsImageUpload >div{
  396. display: flex;
  397. }
  398. ::v-deep .el-dialog {
  399. height: 85%;
  400. .el-dialog__body {
  401. overflow: hidden;
  402. height: 94%;
  403. }
  404. }
  405. ::v-deep .el-upload--picture-card {
  406. display: none;
  407. }
  408. .ConstructionDetailsDialog {
  409. position: absolute;
  410. .projectTabs {
  411. height: 100%;
  412. overflow: hidden;
  413. overflow-y: scroll;
  414. margin-top: 4%;
  415. ::v-deep .el-tabs__content {
  416. margin-top: 1%;
  417. }
  418. ::v-deep .el-tabs__nav {
  419. border: none;
  420. overflow: hidden;
  421. overflow-x: scroll;
  422. }
  423. ::v-deep .el-tabs__item {
  424. // width: 47%;
  425. border: 1px solid #797979;
  426. border-radius: 5px;
  427. }
  428. ::v-deep .el-tabs__item.is-active {
  429. background-color: #169BD5;
  430. color: #fff;
  431. }
  432. ::v-deep .el-tabs__header {
  433. position: fixed;
  434. width: 53%;
  435. border: none;
  436. top: 13%;
  437. }
  438. ::v-deep .el-collapse-item__wrap {
  439. padding: 0 4%;
  440. }
  441. .check {
  442. position: fixed;
  443. right: 22.1%;
  444. top: 13.1%;
  445. height: 4.6%;
  446. background-color: #CC9900;
  447. color: #fff;
  448. }
  449. }
  450. .projectTabs::-webkit-scrollbar {
  451. display: none;
  452. }
  453. ::v-deep .rmOldPie {
  454. .el-collapse-item {
  455. border: none;
  456. }
  457. }
  458. }
  459. ::v-deep .checkingDialog{
  460. height: 50%;
  461. margin-top: 6%;
  462. .el-dialog__body{
  463. height: 72%;
  464. }
  465. .el-textarea__inner{
  466. width: 246%;
  467. height: 140px;
  468. }
  469. }
  470. </style>