signingUpWork.vue 15 KB

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