index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <zj-page-container>
  3. <zj-page-fill class="neibuview">
  4. <zj-form-container>
  5. <zj-form-module title="评价信息">
  6. <zj-table :is-drop="true" :columns="evaluationColumns" :table-data="evaluationData" :table-attributes="{
  7. border: true
  8. }" />
  9. </zj-form-module>
  10. </zj-form-container>
  11. </zj-page-fill>
  12. </zj-page-container>
  13. </template>
  14. <script>
  15. import { listPageV2 } from "@/api/workOrder/appraise";
  16. import { tableDataParsing } from "@/utils/common.js"
  17. export default {
  18. props: {
  19. id: {
  20. type: [String, Number],
  21. default: null,
  22. }
  23. },
  24. data() {
  25. return {
  26. evaluationData: [],
  27. evaluationColumns: []
  28. }
  29. },
  30. created() {
  31. listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.id", "compare": "=", "value": this.id }] }).then(res => {
  32. this.evaluationColumns = tableDataParsing(res.fieldBeans.filter(item => !~["orderFlags", "orderType"].indexOf(item.jname)))
  33. this.$nextTick(() => {
  34. this.evaluationData = res.data.records.map(item => {
  35. Object.keys(item).map(key => {
  36. var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || "{}")[item[key]];
  37. if (val) item[key] = val;
  38. })
  39. return item
  40. })
  41. })
  42. })
  43. },
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .neibuview {
  48. box-sizing: border-box;
  49. padding-left: 16px;
  50. ::v-deep .zj-page-fill-scroll {
  51. box-sizing: border-box;
  52. padding-right: 16px;
  53. &>div:nth-child(1) {
  54. margin-top: 20px;
  55. }
  56. }
  57. }
  58. </style>