repairReportingWork.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. <template>
  2. <!-- 报工 -->
  3. <el-dialog :visible.sync="visible" title="报工" width="80%">
  4. <el-form>
  5. <el-form-item label="实际起始时间">
  6. <el-date-picker
  7. v-model="time"
  8. type="datetimerange"
  9. value-format="yyyy-MM-dd HH:mm:ss"
  10. range-separator="至"
  11. start-placeholder="实际开始日期"
  12. end-placeholder="实际结束日期"
  13. >
  14. </el-date-picker>
  15. </el-form-item>
  16. </el-form>
  17. <div class="page">
  18. <div class="content-detail">
  19. <div class="maintain_equipment_info">
  20. <HeaderTitle title="报修设备" size="16px"></HeaderTitle>
  21. <div class="maintain_equipment_info_content">
  22. <div
  23. class="equipment_item"
  24. v-for="item in infoData.planDeviceList"
  25. :key="item.id"
  26. >
  27. <div class="equipment_info" v-if="item.substance">
  28. <div class="item_info">
  29. <span class="item_label">设备编码</span>
  30. <span class="item_value">{{ item.substance.code }}</span>
  31. </div>
  32. <div class="item_info">
  33. <span class="item_label">设备名称</span>
  34. <span class="item_value">{{ item.substance.name }}</span>
  35. </div>
  36. <div class="item_info">
  37. <span class="item_label">设备型号</span>
  38. <span class="item_value">{{ item.substance.model }}</span>
  39. </div>
  40. <div class="item_info">
  41. <span class="item_label">工单编号</span>
  42. <span class="item_value">{{ workCode}}</span>
  43. </div>
  44. <div class="item_info">
  45. <span class="item_label">设备位置</span>
  46. <span class="item_value">{{
  47. item.substance.positionNames
  48. }}</span>
  49. </div>
  50. <div class="item_info">
  51. <span class="item_label">固资编码</span>
  52. <span class="item_value">{{ item.substance.fixCode }}</span>
  53. </div>
  54. <div class="item_info">
  55. <span class="item_label">编号</span>
  56. <span class="item_value">{{
  57. item.substance.extInfo.codeNumber
  58. }}</span>
  59. </div>
  60. </div>
  61. <p>操作事项</p>
  62. <div class="ruleMatters_box">
  63. <el-table :data="item.workItems" border>
  64. <el-table-column label="序号" width="50">
  65. <template slot-scope="scope">
  66. <span>{{ scope.$index + 1 }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="事项" prop="name" width="100">
  70. <template slot-scope="scope">
  71. <div>
  72. <span>{{ scope.row.name }}</span>
  73. </div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="内容" prop="content" width="300">
  77. <template slot-scope="scope">
  78. <div>
  79. <span>{{ scope.row.content }}</span>
  80. </div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="操作指导" prop="operationGuide">
  84. <template slot-scope="scope">
  85. <div class="operationGuide_box">
  86. <div class="left_content">
  87. <template v-if="scope.row.operationGuide">
  88. <div
  89. v-for="(item, index) in scope.row.operationGuide
  90. .toolList"
  91. :key="item.id"
  92. >{{ index + 1 }}.{{ item.name }}</div
  93. >
  94. </template>
  95. </div>
  96. <div class="line"></div>
  97. <div class="right_content">
  98. <template v-if="scope.row.operationGuide">
  99. <div
  100. v-for="(item, index) in scope.row.operationGuide
  101. .procedureList"
  102. :key="item.id"
  103. >{{ index + 1 }}.{{ item.content }}</div
  104. >
  105. </template>
  106. </div>
  107. </div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="标准" prop="norm" width="100">
  111. <template slot-scope="scope">
  112. <div>
  113. <span>{{ scope.row.norm }}</span>
  114. </div>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="" prop="status" width="150">
  118. <template slot-scope="scope">
  119. <template>
  120. <el-select
  121. v-model="scope.row.status"
  122. placeholder="请选择"
  123. >
  124. <el-option
  125. v-for="item in options"
  126. :label="item.label"
  127. :value="item.value"
  128. :key="item.value"
  129. >
  130. </el-option>
  131. </el-select>
  132. </template>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="结果" prop="result" width="250">
  136. <template slot-scope="scope">
  137. <el-input
  138. v-model="scope.row.result"
  139. placeholder="请输入内容"
  140. ></el-input>
  141. </template>
  142. </el-table-column>
  143. </el-table>
  144. </div>
  145. </div>
  146. </div>
  147. <div class="control">
  148. <span>处理说明:</span>
  149. <el-input
  150. type="textarea"
  151. placeholder="请输入内容"
  152. v-model="infoData.reason"
  153. >
  154. </el-input>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <div slot="footer" class="footer">
  160. <el-button @click="cancel">返回</el-button>
  161. <el-button :loading="btnLoading" type="primary" @click="submit"
  162. >提交</el-button
  163. >
  164. </div>
  165. </el-dialog>
  166. </template>
  167. <script>
  168. import { report } from '@/api/equipment/work.js';
  169. import {
  170. getById,
  171. getRepairInfoById
  172. } from '@/api/maintenance/patrol_maintenance';
  173. export default {
  174. data() {
  175. return {
  176. time: [],
  177. btnLoading: false,
  178. options: [
  179. {
  180. label: '正常',
  181. value: 0
  182. },
  183. {
  184. label: '缺陷',
  185. value: -1
  186. }
  187. ],
  188. visible: false,
  189. infoData: {
  190. reason: ''
  191. },
  192. workCode:''
  193. };
  194. },
  195. methods: {
  196. open(row, isRepaire) {
  197. this.getInfo(row, isRepaire);
  198. this.visible = true;
  199. },
  200. cancel() {
  201. this.visible = false;
  202. },
  203. async submit() {
  204. console.log(this.time);
  205. if (this.time.length > 0) {
  206. this.infoData.acceptTime = this.time[0];
  207. this.infoData.finishTime = this.time[1];
  208. this.infoData.deviceList = this.infoData.planDeviceList;
  209. console.log(this.infoData);
  210. this.btnLoading = true;
  211. let deviceList = this.infoData.deviceList
  212. .map((item) => {
  213. return item.workItems;
  214. })
  215. .flat();
  216. let boolen = deviceList.every((item) => item.status > -1);
  217. this.infoData.isAbnormal = boolen ? 1 : 0;
  218. report(this.infoData).then((res) => {
  219. if (res.code == 0) {
  220. this.$message.success('报工成功');
  221. this.visible = false;
  222. this.btnLoading = false;
  223. this.$emit('refresh');
  224. }
  225. });
  226. } else {
  227. this.$message.error('请选择实际起始时间');
  228. }
  229. },
  230. // 表格数据
  231. async getInfo(row, isRepaire) {
  232. let res = null;
  233. if (isRepaire) {
  234. res = await getRepairInfoById({
  235. id: row.planId,
  236. workOrderId: row.id
  237. });
  238. } else {
  239. res = await getById(row.planId);
  240. }
  241. console.log(row);
  242. this.workCode=row.code
  243. this.infoData = res.data;
  244. this.infoData.workOrderId = row.id;
  245. }
  246. }
  247. };
  248. </script>
  249. <style lang="scss" scoped>
  250. .control {
  251. display: flex;
  252. > span {
  253. width: 80px;
  254. }
  255. }
  256. .page {
  257. padding: 10px;
  258. }
  259. .page-title {
  260. background: #fff;
  261. font-size: 18px;
  262. padding: 6px 20px;
  263. font-weight: 500;
  264. .page-title-div {
  265. margin: 5px 0;
  266. height: 30px;
  267. line-height: 30px;
  268. border-bottom: 1px solid #eaeefb;
  269. .title-div-no {
  270. margin-left: 10px;
  271. font-weight: 400;
  272. color: #909090;
  273. font-size: 14px;
  274. }
  275. }
  276. }
  277. .page-data {
  278. padding-top: 10px;
  279. }
  280. .content-detail {
  281. background: #fff;
  282. padding: 20px;
  283. }
  284. .flows {
  285. .flow-left {
  286. width: 156px;
  287. height: 70px;
  288. border: 1px dashed #ccc;
  289. padding: 10px;
  290. }
  291. .row {
  292. margin-top: 13px;
  293. }
  294. }
  295. .basic-details-title {
  296. margin-bottom: 12px;
  297. margin-top: 20px;
  298. border-bottom: 1px solid #157a2c;
  299. padding-bottom: 8px;
  300. display: flex;
  301. justify-content: space-between;
  302. }
  303. .basic-details-title .border-span {
  304. height: 18px;
  305. font-size: 16px;
  306. border-left: 4px solid #157a2c;
  307. padding-left: 8px;
  308. font-weight: 500;
  309. }
  310. .heade-right {
  311. // float: right;
  312. .heade-right-content {
  313. margin-right: 12px;
  314. font-size: 14px;
  315. display: inline-block;
  316. .content-key {
  317. color: #3e3e3e;
  318. margin-right: 12px;
  319. font-weight: 500;
  320. }
  321. .content-value {
  322. color: #000;
  323. }
  324. }
  325. }
  326. .list-title {
  327. font-size: 14px;
  328. color: #3e3e3e;
  329. margin: 10px 0px;
  330. }
  331. .goods {
  332. background: #a30014;
  333. border: 1px solid #a30014;
  334. }
  335. .details-title {
  336. display: inline-block;
  337. color: #6e6e6e;
  338. font-size: 14px;
  339. font-weight: bold;
  340. margin-right: 13px;
  341. width: 70px;
  342. text-align: right;
  343. }
  344. .details-con {
  345. color: #3e3e3e;
  346. font-size: 14px;
  347. }
  348. .detailed-tab {
  349. margin-left: 10px;
  350. margin-top: 10px;
  351. }
  352. .maintain_equipment_info_content {
  353. padding: 0 30px;
  354. .equipment_item {
  355. border: 1px solid #ccc;
  356. font-size: 14px;
  357. padding: 15px;
  358. margin-bottom: 30px;
  359. .equipment_info {
  360. display: flex;
  361. flex-wrap: wrap;
  362. border: 1px solid #ddd;
  363. .item_info {
  364. width: 33.33%;
  365. height: 24px;
  366. line-height: 24px;
  367. display: flex;
  368. .item_label {
  369. width: 90px;
  370. text-align: center;
  371. background-color: #f2f2f2;
  372. font-weight: 700;
  373. }
  374. .item_value {
  375. border-bottom: 1px solid #f2f2f2;
  376. flex: 1;
  377. padding-left: 5px;
  378. }
  379. }
  380. }
  381. > p {
  382. margin-top: 20px;
  383. color: #797979;
  384. }
  385. .matter_info {
  386. ::v-deep .el-table {
  387. th.el-table__cell {
  388. background-color: #f2f2f2;
  389. padding: 0;
  390. }
  391. td.el-table__cell {
  392. padding: 0;
  393. }
  394. }
  395. }
  396. .ruleMatters_box {
  397. flex: 3;
  398. height: 100%;
  399. display: flex;
  400. flex-direction: column;
  401. .divider {
  402. flex: 0 0 50px;
  403. .title {
  404. height: 35px;
  405. }
  406. }
  407. .el-table {
  408. overflow: auto;
  409. .operationGuide_box {
  410. width: 100%;
  411. display: flex;
  412. position: relative;
  413. .left_content {
  414. width: 30%;
  415. padding: 10px;
  416. margin-right: 10px;
  417. overflow-y: auto;
  418. }
  419. .line {
  420. position: absolute;
  421. top: -10px;
  422. left: 30%;
  423. bottom: -10px;
  424. height: 110%;
  425. width: 1px;
  426. background-color: #ededed;
  427. }
  428. .right_content {
  429. flex: 1;
  430. padding: 10px;
  431. overflow-y: auto;
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438. ::v-deep .el-form-item--medium .el-form-item__label {
  439. color: #6e6e6e;
  440. font-size: 14px;
  441. font-weight: bold;
  442. }
  443. .warehouse {
  444. display: block;
  445. border-bottom: 1px solid #eaeefb;
  446. padding: 10px 0;
  447. }
  448. .box-card {
  449. .store-box {
  450. width: 80%;
  451. .store-box-span {
  452. display: inline-block;
  453. font-size: 14px;
  454. height: 50px;
  455. width: 50px;
  456. text-align: center;
  457. line-height: 50px;
  458. color: #fff;
  459. margin: 2px;
  460. }
  461. }
  462. }
  463. .vacant {
  464. background: #3196fb;
  465. }
  466. .inUse {
  467. background: #157a2c;
  468. }
  469. .invalid {
  470. background: #cccccc;
  471. }
  472. .full {
  473. background: #cc3300;
  474. }
  475. .map {
  476. display: inline-block;
  477. position: absolute;
  478. right: 4%;
  479. top: 15%;
  480. width: 380px;
  481. height: 200px;
  482. background-color: #b12492;
  483. }
  484. .mapTitle {
  485. display: inline-block;
  486. position: absolute;
  487. transform: translate(-50%, -50%);
  488. right: 11%;
  489. top: 39%;
  490. }
  491. .equipment {
  492. position: relative;
  493. width: 100%;
  494. min-height: 200px;
  495. .equipment-icon {
  496. text-align: center;
  497. line-height: 30px;
  498. width: 30px;
  499. height: 30px;
  500. border-radius: 15px;
  501. border: 2px solid #000;
  502. }
  503. .equipment-step {
  504. position: absolute;
  505. left: 15px;
  506. border-left: 2px solid #000;
  507. width: 2px;
  508. height: 85%;
  509. }
  510. .equipment-arrows {
  511. position: absolute;
  512. bottom: -8px;
  513. left: 8px;
  514. border: 8px solid rgb(255, 255, 255);
  515. border-top-color: #000;
  516. width: 0;
  517. height: 0;
  518. }
  519. .equipment-title {
  520. position: absolute;
  521. top: 3%;
  522. left: 3%;
  523. }
  524. .equipment-details {
  525. position: absolute;
  526. top: 3%;
  527. left: 25%;
  528. span {
  529. margin-right: 70px;
  530. }
  531. }
  532. .equipment-content {
  533. display: flex;
  534. .equipment-content-span1 {
  535. width: 150px;
  536. margin: 20px 70px 5px 47px;
  537. }
  538. .equipment-content-span2 {
  539. width: 350px;
  540. margin: 20px 70px 5px 120px;
  541. }
  542. }
  543. }
  544. .btnbox {
  545. display: flex;
  546. justify-content: center;
  547. }
  548. ::v-deep .el-button {
  549. padding: 10px 20px;
  550. margin-right: 10px;
  551. }
  552. .textbox {
  553. margin-top: 10px;
  554. }
  555. .execute_info {
  556. margin: 30px 0;
  557. .execute_info_title {
  558. border-bottom: 1px solid #157a2c;
  559. padding-bottom: 3px;
  560. margin-bottom: 20px;
  561. display: flex;
  562. justify-content: space-between;
  563. > span:first-child {
  564. line-height: 16px;
  565. border-left: 6px solid #157a2c;
  566. padding-left: 6px;
  567. }
  568. }
  569. .execute_row {
  570. padding: 0 30px;
  571. .column {
  572. display: flex;
  573. font-size: 14px;
  574. margin-bottom: 20px;
  575. .label {
  576. // width: 110px;
  577. text-align: center;
  578. font-weight: 700;
  579. }
  580. }
  581. }
  582. }
  583. </style>