index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="作业方式" prop="modeOperation">
  5. <el-select v-model="queryParams.modeOperation" placeholder="请选择作业方式" clearable>
  6. <el-option
  7. v-for="dict in dict.type.tapping_operation"
  8. :key="dict.value"
  9. :label="dict.label"
  10. :value="dict.value"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="工程名称" prop="enginName">
  15. <el-input
  16. v-model="queryParams.enginName"
  17. placeholder="请输入工程名称"
  18. clearable
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="工程地点" prop="locations">
  23. <el-input
  24. v-model="queryParams.locations"
  25. placeholder="请输入工程地点"
  26. clearable
  27. @keyup.enter.native="handleQuery"
  28. />
  29. </el-form-item>
  30. <el-form-item>
  31. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  32. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <el-row :gutter="10" class="mb8">
  36. <el-col :span="1.5">
  37. <el-button
  38. type="primary"
  39. plain
  40. icon="el-icon-plus"
  41. size="mini"
  42. @click="handleAdd"
  43. v-hasPermi="['zdsz:touchOperationEngineering:add']"
  44. >新增
  45. </el-button>
  46. </el-col>
  47. <el-col :span="1.5">
  48. <el-button
  49. type="success"
  50. plain
  51. icon="el-icon-edit"
  52. size="mini"
  53. :disabled="single"
  54. @click="handleUpdate"
  55. v-hasPermi="['zdsz:touchOperationEngineering:edit']"
  56. >修改
  57. </el-button>
  58. </el-col>
  59. <el-col :span="1.5">
  60. <el-button
  61. type="danger"
  62. plain
  63. icon="el-icon-delete"
  64. size="mini"
  65. :disabled="multiple"
  66. @click="handleDelete"
  67. v-hasPermi="['zdsz:touchOperationEngineering:remove']"
  68. >删除
  69. </el-button>
  70. </el-col>
  71. <el-col :span="1.5">
  72. <el-button
  73. type="warning"
  74. plain
  75. icon="el-icon-download"
  76. size="mini"
  77. @click="handleExport"
  78. v-hasPermi="['zdsz:touchOperationEngineering:export']"
  79. >导出
  80. </el-button>
  81. </el-col>
  82. <el-col :span="2.5" style="float: right;">
  83. <span
  84. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #e0c794;"></span>待审核
  85. <span
  86. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #30B08F;"></span>通过
  87. <span
  88. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #C03639;"></span>不通过
  89. </el-col>
  90. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  91. </el-row>
  92. <el-table v-loading="loading" :data="touchOperationEngineeringList" @selection-change="handleSelectionChange">
  93. <el-table-column type="selection" width="55" align="center"/>
  94. <el-table-column label="" align="center" prop="id" v-if="false"/>
  95. <el-table-column label="作业方式" align="center" prop="modeOperation">
  96. <template slot-scope="scope">
  97. <dict-tag :options="dict.type.tapping_operation" :value="scope.row.modeOperation"/>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="工程名称" align="center" prop="enginName"/>
  101. <el-table-column label="工程地点" align="center" prop="locations"/>
  102. <el-table-column label="审核状态" align="center" prop="nodeReViewStateList" width="250">
  103. <template slot-scope="scope">
  104. <div style="text-align:center">
  105. <el-popover
  106. v-for="item in scope.row.nodeReViewStateList"
  107. placement="top-start"
  108. trigger="hover"
  109. :content="item.Type">
  110. <span slot="reference" v-if="item.state == '0' && item.content=='暂未审核'"
  111. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #e0c794;"></span>
  112. <span slot="reference" v-else-if="item.state == '1' "
  113. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #30B08F;"></span>
  114. <span slot="reference" v-else
  115. style="height: 20px;margin-right: 5px;width: 20px; border-radius: 50%; display: inline-block; background-color: #C03639;"></span>
  116. </el-popover>
  117. </div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="备注" align="center" prop="remark"/>
  121. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  122. <template slot-scope="scope">
  123. <el-button
  124. size="mini"
  125. type="text"
  126. icon="el-icon-edit"
  127. @click="handleUpdate(scope.row)"
  128. v-hasPermi="['zdsz:touchOperationEngineering:edit']"
  129. >修改工程信息
  130. </el-button>
  131. <el-button
  132. size="mini"
  133. type="text"
  134. icon="el-icon-edit"
  135. @click="updateviewSource(scope.row)"
  136. v-hasPermi="['zdsz:touchOperationEngineering:edit']"
  137. >修改施工信息
  138. </el-button>
  139. <el-button
  140. size="mini"
  141. type="text"
  142. icon="el-icon-add"
  143. @click="handleAddYL(scope.row)"
  144. v-hasPermi="['zdsz:touchOperationEngineering:edit']"
  145. >添加用料
  146. </el-button>
  147. <el-button
  148. size="mini"
  149. type="text"
  150. icon="el-icon-time"
  151. @click="handleHistory(scope.row)"
  152. v-hasPermi="['zdsz:touchOperationEngineering:edit']"
  153. >历史施工
  154. </el-button>
  155. <el-button
  156. size="mini"
  157. type="text"
  158. icon="el-icon-edit"
  159. @click="handleHistory(scope.row,'check')"
  160. v-hasPermi="['zdsz:touchOperationEngineering:edit']"
  161. >审核
  162. </el-button>
  163. <el-button
  164. type="text"
  165. icon="el-icon-download"
  166. size="mini"
  167. @click="download(scope.row.enginName)"
  168. >下载图片
  169. </el-button>
  170. <el-button
  171. size="mini"
  172. type="text"
  173. icon="el-icon-delete"
  174. @click="handleDelete(scope.row)"
  175. v-hasPermi="['zdsz:touchOperationEngineering:remove']"
  176. >删除
  177. </el-button>
  178. </template>
  179. </el-table-column>
  180. </el-table>
  181. <pagination
  182. v-show="total>0"
  183. :total="total"
  184. :page.sync="queryParams.pageNum"
  185. :limit.sync="queryParams.pageSize"
  186. @pagination="getList"
  187. />
  188. <!-- 添加或修改碰口作业对话框 -->
  189. <el-dialog :title="title" :visible.sync="open" :width="title == '添加碰口作业用料信息'?'1500px':'800px'"
  190. append-to-body>
  191. <el-form ref="form" :model="form" :rules="rules" label-width="80px" >
  192. <el-row :gutter="24">
  193. <el-col :span="12">
  194. <el-form-item label="作业方式" prop="modeOperation">
  195. <el-select v-model="form.modeOperation" placeholder="请选择作业方式" style="width: 100%" :disabled="title == '添加碰口作业用料信息'">
  196. <el-option
  197. v-for="dict in dict.type.tapping_operation"
  198. :key="dict.value"
  199. :label="dict.label"
  200. :value="dict.value"
  201. ></el-option>
  202. </el-select>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="12">
  206. <el-form-item label="工程名称" prop="enginName">
  207. <el-input v-model="form.enginName" placeholder="请输入工程名称" :disabled="title == '添加碰口作业用料信息'"/>
  208. </el-form-item>
  209. </el-col>
  210. <el-col :span="12">
  211. <el-form-item label="工程地点" prop="locations">
  212. <el-input v-model="form.locations" placeholder="请输入地点" :disabled="title == '添加碰口作业用料信息'"/>
  213. </el-form-item>
  214. </el-col>
  215. <el-col :span="12">
  216. <el-form-item label="备注" prop="remark">
  217. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :disabled="title == '添加碰口作业用料信息'"/>
  218. </el-form-item>
  219. </el-col>
  220. </el-row>
  221. <el-row v-if="title=='添加碰口作业用料信息'">
  222. <el-col :span="24">
  223. <el-form-item label="环节">
  224. <el-checkbox-group v-model="currentCheckList">
  225. <el-checkbox
  226. :label="item.dictValue"
  227. v-for="item in nodeList"
  228. :key="item.dictValue"
  229. ></el-checkbox>
  230. </el-checkbox-group>
  231. </el-form-item>
  232. </el-col>
  233. </el-row>
  234. <EnginNodeInfo
  235. v-if="title=='添加碰口作业用料信息'"
  236. v-for="(e,idx) in currentCheckList"
  237. :key="idx"
  238. :name="e"
  239. :ref="'EnginNodeInfo'+idx"
  240. :types="currentCheckList"
  241. :currentContain="currentCheckList"
  242. :enginType="'碰口作业工程'"
  243. :enginSort="form.enginType"
  244. />
  245. </el-form>
  246. <div slot="footer" class="dialog-footer">
  247. <el-button :loading="buttonLoading" type="primary" v-if="title == '添加碰口作业用料信息'" @click="addForm">添加用料</el-button>
  248. <el-button :loading="buttonLoading" type="primary" v-else @click="submitForm">确 定</el-button>
  249. <el-button @click="cancel">取 消</el-button>
  250. </div>
  251. </el-dialog>
  252. <ConstructionDetails
  253. ref="ConstructionDetails"
  254. :currentCollapses="currentCollapses"
  255. :zEngineeringNodeBo="zEngineeringNodeBo"
  256. @updateNodeOption="updateNodeOption"
  257. @checkWorking="checkWorking"
  258. :enginType="'碰口作业'"
  259. />
  260. </div>
  261. </template>
  262. <script>
  263. import {
  264. listTouchOperationEngineering,
  265. getTouchOperationEngineering,
  266. delTouchOperationEngineering,
  267. addTouchOperationEngineering,
  268. updateTouchOperationEngineering, QueryTouchOperationEngineering
  269. } from "@/api/zdsz/touchOperationEngineering";
  270. import {getDicts} from "@/api/system/dict/data";
  271. import EnginNodeInfo from "@/components/EnginNodeInfo/indexPK.vue";
  272. import ConstructionDetails from "@/components/ConstructionDetails/indexPK.vue";
  273. import {EditEngineeEngineeIndustry, QueryEngineeIndustry} from "@/api/zdsz/engineeringIndustry";
  274. import {insertReview} from "@/api/zdsz/enginee";
  275. export default {
  276. name: "TouchOperationEngineering",
  277. components: {ConstructionDetails, EnginNodeInfo},
  278. dicts: ['tapping_operation', 'bury_the_wrench_hole', 'aerial_wrench_hole', 'shutdown_operation', 'pe_plugging', 'the_steel_pipe_sealed_with_gas'],
  279. data() {
  280. return {
  281. // 按钮loading
  282. buttonLoading: false,
  283. // 遮罩层
  284. loading: true,
  285. // 选中数组
  286. ids: [],
  287. currentCheckList: [],
  288. currentCollapses: [],
  289. zEngineeringNodeBo: {},
  290. nodeList: [],
  291. status: null,
  292. // 非单个禁用
  293. single: true,
  294. // 非多个禁用
  295. multiple: true,
  296. // 显示搜索条件
  297. showSearch: true,
  298. // 总条数
  299. total: 0,
  300. // 碰口作业表格数据
  301. touchOperationEngineeringList: [],
  302. // 弹出层标题
  303. title: "",
  304. // 是否显示弹出层
  305. open: false,
  306. // 查询参数
  307. queryParams: {
  308. pageNum: 1,
  309. pageSize: 10,
  310. modeOperation: undefined,
  311. enginName: undefined,
  312. locations: undefined,
  313. },
  314. // 表单参数
  315. form: {},
  316. // 表单校验
  317. rules: {
  318. id: [
  319. {required: true, message: "不能为空", trigger: "blur"}
  320. ],
  321. modeOperation: [
  322. {required: true, message: "作业方式不能为空", trigger: "change"}
  323. ],
  324. enginName: [
  325. {required: true, message: "工程名称不能为空", trigger: "blur"}
  326. ],
  327. locations: [
  328. {required: true, message: "工程地点不能为空", trigger: "blur"}
  329. ],
  330. }
  331. };
  332. },
  333. created() {
  334. this.getList();
  335. },
  336. methods: {
  337. download(name) {
  338. this.$download.zip(`/zdsz/engineeringPipeJacking/downloadZip/${'碰口工程'}/${name}`, name);
  339. },
  340. // 节点审核
  341. checkWorking(checkingInfo) {
  342. let params = checkingInfo
  343. params.createTime = this.createTime
  344. console.log('节点审核 checkingInfo===', params)
  345. insertReview(params).then(res => {
  346. if (res.code == 200) {
  347. this.$message({
  348. message: '审核成功',
  349. type: 'success'
  350. });
  351. this.$refs.ConstructionDetails.dialogVisible = false
  352. this.getList()
  353. }
  354. })
  355. },
  356. updateNodeOption(value) {
  357. try {
  358. this.form.zEngineeringNodeBo.zEngineeringInfoBoList = this.form.zEngineeringNodeBo.zEngineeringInfoBoList.filter(obj => value.map(o => o.id).includes(obj.id))
  359. } catch (e) {
  360. }
  361. this.form.files = this.form.pics
  362. updateTouchOperationEngineering(this.form).then(res => {
  363. this.$modal.msgSuccess("修改成功");
  364. this.$refs.ConstructionDetails.dialogVisible = false
  365. })
  366. this.getList();
  367. },
  368. viewNodeSource(e) {
  369. this.currentCollapses = []
  370. if (!e) return
  371. // todo: 获取数据
  372. QueryTouchOperationEngineering({
  373. id: this.currentId,
  374. type: e
  375. }).then(res => {
  376. this.createTime = res.data.createTime
  377. this.form = res.data
  378. try {
  379. this.currentCollapses = res.data.zEngineeringNodeBo.zEngineeringInfoBoList
  380. this.$refs.ConstructionDetails.setEngineId(res.data.zEngineeringNodeBo.id || null)
  381. } catch (error) {
  382. this.currentCollapses = [];
  383. }
  384. })
  385. },
  386. updateviewSource(e) {
  387. this.currentId = e.id
  388. let dists ;
  389. if ("地埋扳孔" == e.modeOperation){
  390. dists="bury_the_wrench_hole";
  391. }else if ("架空扳孔" == e.modeOperation){
  392. dists="aerial_wrench_hole";
  393. }else if ("停气作业" == e.modeOperation){
  394. dists="shutdown_operation";
  395. }else if ("PE 封堵" == e.modeOperation){
  396. dists="pe_plugging";
  397. }else if ("钢管带气封堵" == e.modeOperation){
  398. dists="the_steel_pipe_sealed_with_gas";
  399. }
  400. getDicts(dists).then(res => {
  401. this.nodeList = res.data
  402. let dict = []
  403. for (let i = 0; i < this.nodeList.length; i++) {
  404. dict.push({
  405. label: this.nodeList[i].dictLabel,
  406. value: this.nodeList[i].dictValue
  407. })
  408. }
  409. this.status = 'put'
  410. this.$refs.ConstructionDetails.open(dict, null, "修改施工信息", null, this.status)
  411. })
  412. },
  413. handleHistory(e, type = null){
  414. this.currentId = e.id
  415. let dict = []
  416. let dists ;
  417. if ("地埋扳孔" == e.modeOperation){
  418. dists="bury_the_wrench_hole";
  419. }else if ("架空扳孔" == e.modeOperation){
  420. dists="aerial_wrench_hole";
  421. }else if ("停气作业" == e.modeOperation){
  422. dists="shutdown_operation";
  423. }else if ("PE 封堵" == e.modeOperation){
  424. dists="pe_plugging";
  425. }else if ("钢管带气封堵" == e.modeOperation){
  426. dists="the_steel_pipe_sealed_with_gas";
  427. }
  428. getDicts(dists).then(res => {
  429. this.nodeList = res.data
  430. for (let i = 0; i < this.nodeList.length; i++) {
  431. dict.push({
  432. label: this.nodeList[i].dictLabel,
  433. value: this.nodeList[i].dictValue
  434. })
  435. }
  436. if (type) {
  437. this.status = 'review'
  438. } else {
  439. this.status = 'read-only'
  440. }
  441. this.$refs.ConstructionDetails.open(dict, null, "历史施工信息", null, this.status)
  442. })
  443. },
  444. addForm(){
  445. // 收集节点信息
  446. let nodeCollection = []
  447. this.currentCheckList.forEach((e,idx) => {
  448. let nodeItem = this.$refs['EnginNodeInfo'+ idx][0].infoCollection()
  449. // console.log(nodeItem)
  450. nodeCollection.push(nodeItem)
  451. })
  452. this.form.zEngineeringNodeBoList = nodeCollection
  453. addTouchOperationEngineering(this.form).then(response => {
  454. this.$modal.msgSuccess("添加用料成功");
  455. this.cancel()
  456. this.getList();
  457. }).finally(() => {
  458. this.buttonLoading = false;
  459. });
  460. },
  461. /** 查询碰口作业列表 */
  462. getList() {
  463. this.loading = true;
  464. listTouchOperationEngineering(this.queryParams).then(response => {
  465. this.touchOperationEngineeringList = response.rows;
  466. this.total = response.total;
  467. this.loading = false;
  468. });
  469. },
  470. // 取消按钮
  471. cancel() {
  472. this.open = false;
  473. this.title = "";
  474. this.reset();
  475. },
  476. // 表单重置
  477. reset() {
  478. this.currentCheckList=[]
  479. this.nodeList=[]
  480. this.form = {
  481. id: undefined,
  482. modeOperation: undefined,
  483. enginName: undefined,
  484. locations: undefined,
  485. remark: undefined,
  486. delFlag: undefined,
  487. createBy: undefined,
  488. createTime: undefined,
  489. updateBy: undefined,
  490. updateTime: undefined,
  491. updateInfoTime: undefined
  492. };
  493. this.resetForm("form");
  494. },
  495. /** 搜索按钮操作 */
  496. handleQuery() {
  497. this.queryParams.pageNum = 1;
  498. this.getList();
  499. },
  500. /** 重置按钮操作 */
  501. resetQuery() {
  502. this.resetForm("queryForm");
  503. this.handleQuery();
  504. },
  505. // 多选框选中数据
  506. handleSelectionChange(selection) {
  507. this.ids = selection.map(item => item.id)
  508. this.single = selection.length !== 1
  509. this.multiple = !selection.length
  510. },
  511. /** 新增按钮操作 */
  512. handleAdd() {
  513. this.reset();
  514. this.open = true;
  515. this.title = "添加碰口作业";
  516. },
  517. /** 修改按钮操作 */
  518. handleUpdate(row) {
  519. this.loading = true;
  520. this.reset();
  521. const id = row.id || this.ids
  522. getTouchOperationEngineering(id).then(response => {
  523. this.loading = false;
  524. this.form = response.data;
  525. this.open = true;
  526. this.title = "修改碰口作业";
  527. });
  528. },
  529. handleAddYL(row) {
  530. this.loading = true;
  531. this.reset();
  532. const id = row.id || this.ids
  533. getTouchOperationEngineering(id).then(response => {
  534. this.loading = false;
  535. this.form = response.data;
  536. this.open = true;
  537. this.title = "添加碰口作业用料信息";
  538. let dists ;
  539. if ("地埋扳孔" == response.data.modeOperation){
  540. dists="bury_the_wrench_hole";
  541. }else if ("架空扳孔" == response.data.modeOperation){
  542. dists="aerial_wrench_hole";
  543. }else if ("停气作业" == response.data.modeOperation){
  544. dists="shutdown_operation";
  545. }else if ("PE 封堵" == response.data.modeOperation){
  546. dists="pe_plugging";
  547. }else if ("钢管带气封堵" == response.data.modeOperation){
  548. dists="the_steel_pipe_sealed_with_gas";
  549. }
  550. getDicts(dists).then(res => {
  551. this.nodeList = res.data
  552. })
  553. });
  554. },
  555. /** 提交按钮 */
  556. submitForm() {
  557. this.$refs["form"].validate(valid => {
  558. if (valid) {
  559. this.buttonLoading = true;
  560. if (this.form.id != null) {
  561. updateTouchOperationEngineering(this.form).then(response => {
  562. this.$modal.msgSuccess("修改成功");
  563. this.open = false;
  564. this.getList();
  565. }).finally(() => {
  566. this.buttonLoading = false;
  567. });
  568. } else {
  569. addTouchOperationEngineering(this.form).then(response => {
  570. this.$modal.msgSuccess("新增成功");
  571. this.open = false;
  572. this.getList();
  573. }).finally(() => {
  574. this.buttonLoading = false;
  575. });
  576. }
  577. }
  578. });
  579. },
  580. /** 删除按钮操作 */
  581. handleDelete(row) {
  582. const ids = row.id || this.ids;
  583. this.$modal.confirm('是否确认删除碰口作业编号为"' + ids + '"的数据项?').then(() => {
  584. this.loading = true;
  585. return delTouchOperationEngineering(ids);
  586. }).then(() => {
  587. this.loading = false;
  588. this.getList();
  589. this.$modal.msgSuccess("删除成功");
  590. }).catch(() => {
  591. }).finally(() => {
  592. this.loading = false;
  593. });
  594. },
  595. /** 导出按钮操作 */
  596. handleExport() {
  597. this.download('zdsz/touchOperationEngineering/export', {
  598. ...this.queryParams
  599. }, `touchOperationEngineering_${new Date().getTime()}.xlsx`)
  600. }
  601. }
  602. };
  603. </script>