index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <zj-page-container>
  3. <zj-page-fill class="neibuview">
  4. <template v-if="payData.length">
  5. <zj-form-container>
  6. <template v-for="(item, index) in payData">
  7. <formModule :item="payData[index]" :index="index" @shuaxin="shuaxin"> </formModule>
  8. </template>
  9. </zj-form-container>
  10. </template>
  11. <el-empty v-else description="暂时没有配件申请"></el-empty>
  12. </zj-page-fill>
  13. </zj-page-container>
  14. </template>
  15. <script>
  16. import { orderPartsApplyRecord } from '@/api/workOrderPool.js'
  17. import formModule from './formModule.vue'
  18. export default {
  19. components: {
  20. formModule
  21. },
  22. props: {
  23. id: {
  24. type: [String, Number],
  25. default: null
  26. }
  27. },
  28. data() {
  29. return {
  30. payData: []
  31. }
  32. },
  33. watch: {
  34. id: {
  35. handler(newVal, oldVal) {
  36. this.shuaxin()
  37. },
  38. deep: true,
  39. immediate: true
  40. }
  41. },
  42. computed: {},
  43. methods: {
  44. shuaxin() {
  45. orderPartsApplyRecord({
  46. orderId: this.id
  47. }).then(res => {
  48. this.payData = res.data || []
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .neibuview {
  56. box-sizing: border-box;
  57. padding-left: 16px;
  58. ::v-deep & > .zj-page-fill-scroll {
  59. box-sizing: border-box;
  60. padding-right: 16px;
  61. & > div:nth-child(1) {
  62. margin-top: 20px;
  63. }
  64. }
  65. }
  66. </style>