index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div class="mainContentBox">
  3. <avue-crud
  4. ref="crudRef"
  5. v-model:search="search"
  6. v-model="form"
  7. :data="data"
  8. :option="option"
  9. v-model:page="page"
  10. @row-save="createRow"
  11. @row-update="updateRow"
  12. @row-del="deleteRow"
  13. @search-change="searchChange"
  14. @search-reset="resetChange"
  15. @size-change="dataList"
  16. @current-change="dataList"
  17. @selection-change="selectionChange"
  18. />
  19. </div>
  20. </template>
  21. <script setup>
  22. import { ref } from "vue";
  23. import { useCrud } from "@/hooks/userCrud";
  24. import dictDataUtil from "@/common/configs/dictDataUtil";
  25. import { queryStationByLineId } from "@/api/station";
  26. import { getUserList } from "@/api/system/user";
  27. import { useDictionaryStore } from "@/store";
  28. import { getStatistics } from "@/api/order/index";
  29. // 数据字典相关
  30. const { dicts } = useDictionaryStore();
  31. // 传入一个url,后面不带/
  32. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  33. useCrud({
  34. src: "/api/v1/plan/task/track",
  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 stationList = ref([]);
  42. const userList = ref([]);
  43. const charts = shallowRef(null);
  44. onMounted(() => {
  45. dataList();
  46. });
  47. // 设置表格列或者其他自定义的option
  48. option.value = Object.assign(option.value, {
  49. searchEnter: true,
  50. selection: true,
  51. menu: false,
  52. menuWidth: 160,
  53. searchLabelWidth: 120,
  54. addBtn: false,
  55. filterBtn: false,
  56. searchShowBtn: false,
  57. columnBtn: false,
  58. gridBtn: false,
  59. editBtn: false,
  60. viewBtn: false,
  61. delBtn: false,
  62. column: [
  63. {
  64. label: "管号",
  65. prop: "seqNo",
  66. editDisabled: true,
  67. search: true,
  68. },
  69. {
  70. label: "工位名称",
  71. prop: "stationName",
  72. search: true,
  73. display: false,
  74. },
  75. {
  76. label: "工位名称",
  77. hide: true,
  78. editDisabled: false,
  79. type: "select",
  80. dicData: stationList,
  81. filterable: true,
  82. prop: "stationId",
  83. props: { label: "name", value: "id" },
  84. rules: [
  85. {
  86. required: true,
  87. message: "请选择工位名称",
  88. trigger: "blur",
  89. },
  90. ],
  91. },
  92. {
  93. label: "订单编码",
  94. prop: "orderCode",
  95. search: true,
  96. width: 125,
  97. editDisabled: true,
  98. },
  99. {
  100. label: "工单编码",
  101. prop: "workOrderCode",
  102. search: true,
  103. width: 125,
  104. editDisabled: true,
  105. },
  106. {
  107. label: "产线名称",
  108. prop: "productLineName",
  109. search: true,
  110. editDisabled: true,
  111. },
  112. {
  113. label: "工艺路线",
  114. prop: "routeName",
  115. editDisabled: true,
  116. },
  117. {
  118. label: "物料编号",
  119. prop: "materialCode",
  120. search: true,
  121. editDisabled: true,
  122. },
  123. {
  124. label: "物料名称",
  125. prop: "materialName",
  126. search: true,
  127. editDisabled: true,
  128. },
  129. {
  130. label: "物料规格",
  131. prop: "materialModel",
  132. editDisabled: true,
  133. search: true,
  134. },
  135. {
  136. label: "当前工序编码",
  137. prop: "operationCode",
  138. search: true,
  139. editDisabled: true,
  140. },
  141. {
  142. label: "当前工序名称",
  143. prop: "operationName",
  144. search: true,
  145. editDisabled: true,
  146. },
  147. {
  148. label: "排序",
  149. prop: "operationSort",
  150. editDisabled: true,
  151. width: 60,
  152. },
  153. {
  154. label: "状态",
  155. prop: "state",
  156. type: "select",
  157. width: 80,
  158. editDisabled: true,
  159. dicUrl:
  160. dictDataUtil.request_url + dictDataUtil.TYPE_CODE.station_task_state,
  161. props: {
  162. label: "dictLabel",
  163. value: "dictValue",
  164. },
  165. },
  166. ],
  167. });
  168. </script>
  169. <style lang="scss" scoped>
  170. :deep(.avue-crud__left) {
  171. width: 100%;
  172. }
  173. #charts {
  174. width: 100%;
  175. height: 300px;
  176. border: 1px solid #ccc;
  177. }
  178. </style>