traceabilityCom.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!-- 生产履历 -->
  2. <template>
  3. <div class="mainContentBox">
  4. <avue-crud
  5. ref="crudRef2"
  6. v-model:search="search"
  7. v-model="form"
  8. :data="data"
  9. :option="option"
  10. v-model:page="page"
  11. />
  12. </div>
  13. </template>
  14. <script setup>
  15. import { ref, getCurrentInstance } from "vue";
  16. import { useCrud } from "@/hooks/userCrud";
  17. import dictDataUtil from "@/common/configs/dictDataUtil";
  18. import ButtonPermKeys from "@/common/configs/buttonPermission";
  19. import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
  20. // 数据字典相关
  21. const { dicts } = useDictionaryStoreHook();
  22. // 传入一个url,后面不带/
  23. const {
  24. form,
  25. data,
  26. option,
  27. search,
  28. page,
  29. toDeleteIds,
  30. Methords,
  31. Utils,
  32. commonConfig,
  33. } = useCrud({
  34. src: "/api/v1/process/info",
  35. });
  36. const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
  37. Methords; //增删改查
  38. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  39. const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
  40. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  41. const refreshTra = (row) => {
  42. commonConfig.value.params = { seqNo: row.seqNo };
  43. dataList();
  44. };
  45. defineExpose({ refreshTra });
  46. onMounted(() => {});
  47. option.value = Object.assign(option.value, {
  48. selection: false,
  49. border: true,
  50. index: false,
  51. expandLevel: 3,
  52. headerAlign: "center",
  53. align: "center",
  54. labelWidth: 100,
  55. addBtn: false,
  56. menu: false,
  57. header: false,
  58. column: [
  59. {
  60. label: "工序名称",
  61. prop: "operationName",
  62. },
  63. {
  64. label: "工段",
  65. prop: "workSection",
  66. type: "select",
  67. dicData: dicts.workshop_section,
  68. props: {
  69. label: "dictLabel",
  70. value: "dictValue",
  71. },
  72. },
  73. {
  74. label: "状态",
  75. prop: "currentState",
  76. search: false,
  77. },
  78. {
  79. label: "开始时间",
  80. prop: "realStartWhen",
  81. search: false,
  82. },
  83. {
  84. label: "结束时间",
  85. prop: "realEndWhen",
  86. search: false,
  87. },
  88. {
  89. label: "操作人",
  90. prop: "creator",
  91. search: false,
  92. },
  93. {
  94. label: "工时(秒)",
  95. prop: "totalTime",
  96. search: false,
  97. },
  98. {
  99. label: "工步",
  100. prop: "operationSort",
  101. search: false,
  102. },
  103. ],
  104. });
  105. </script>