index.vue 20 KB

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