signingUpWork.vue 14 KB

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