index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. @selection-change="selectionChange"
  14. >
  15. <template #menu-left="{ size }">
  16. <el-button
  17. :disabled="toDeleteIds.length < 1"
  18. type="danger"
  19. icon="el-icon-delete"
  20. :size="size"
  21. @click="multipleDelete">删除</el-button>
  22. </template>
  23. </avue-crud>
  24. </div>
  25. </template>
  26. <script setup>
  27. import { ref, getCurrentInstance } from "vue";
  28. import { useCrud } from "@/hooks/userCrud";
  29. import ButtonPermKeys from "@/common/configs/buttonPermission";
  30. import { useCommonStoreHook } from "@/store";
  31. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  32. const test = () => {
  33. isShowTable.value = true;
  34. tableType.value = tableType.value == 1 ? 2 : 1;
  35. };
  36. // 传入一个url,后面不带/
  37. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  38. useCrud({
  39. src: "/api/v1/plan/order",
  40. });
  41. const { dataList, createRow, updateRow, deleteRow } = Methords; //增删改查
  42. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  43. const { checkBtnPerm } = Utils; //按钮权限等工具
  44. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  45. // 设置表格列或者其他自定义的option
  46. option.value = Object.assign(option.value, {
  47. selection: true,
  48. column: [
  49. {
  50. label: "主键",
  51. prop: "id",
  52. search: false,
  53. },
  54. {
  55. label: "创建日期",
  56. prop: "created",
  57. search: false,
  58. },
  59. {
  60. label: "创建人",
  61. prop: "creator",
  62. search: false,
  63. },
  64. {
  65. label: "更新日期",
  66. prop: "updated",
  67. search: false,
  68. },
  69. {
  70. label: "更新人",
  71. prop: "updator",
  72. search: false,
  73. },
  74. {
  75. label: "组织id",
  76. prop: "orgId",
  77. search: false,
  78. },
  79. {
  80. label: "部门id",
  81. prop: "deptId",
  82. search: false,
  83. },
  84. {
  85. label: "版本号",
  86. prop: "version",
  87. search: false,
  88. },
  89. {
  90. label: "基础工序名称",
  91. prop: "operationName",
  92. search: true,
  93. },
  94. {
  95. label: "工序编码",
  96. prop: "operationCode",
  97. search: false,
  98. },
  99. {
  100. label: "基础工序号",
  101. prop: "operationOp",
  102. search: true,
  103. },
  104. {
  105. label: "基础工序描述",
  106. prop: "operationDesc",
  107. search: false,
  108. },
  109. {
  110. label: "标准工时",
  111. prop: "standardWorktime",
  112. search: false,
  113. },
  114. {
  115. label: "工位类型",
  116. prop: "stanType",
  117. search: false,
  118. },
  119. {
  120. label: "技能要求",
  121. prop: "skillAsk",
  122. search: false,
  123. },
  124. {
  125. label: "工段",
  126. prop: "workSection",
  127. search: false,
  128. },
  129. {
  130. label: "工序类型",
  131. prop: "operationType",
  132. search: true,
  133. },
  134. /* {
  135. label: "机时",
  136. prop: "timeingNum",
  137. search: false,
  138. },*/
  139. /* {
  140. label: "是否外协",
  141. prop: "externalCooperation",
  142. search: false,
  143. },*/
  144. {
  145. label: "工艺条件",
  146. prop: "processAsk",
  147. search: false,
  148. },
  149. {
  150. label: "准备工时(人工工时)",
  151. prop: "preparationTime",
  152. search: false,
  153. },
  154. {
  155. label: "是否自检",
  156. prop: "selfCheck",
  157. search: false,
  158. },
  159. {
  160. label: "批量报工",
  161. prop: "batchReport",
  162. search: false,
  163. },
  164. {
  165. label: "是否巡检",
  166. prop: "inspection",
  167. search: false,
  168. },
  169. {
  170. label: "是否首检",
  171. prop: "firstCheck",
  172. search: false,
  173. },
  174. {
  175. label: "是否委外",
  176. prop: "outsourcing",
  177. search: false,
  178. },
  179. {
  180. label: "是否禁用",
  181. prop: "enabled",
  182. search: false,
  183. },
  184. {
  185. label: "是否可跳过",
  186. prop: "skipped",
  187. search: false,
  188. },
  189. /* {
  190. label: "坐标X",
  191. prop: "x",
  192. search: false,
  193. },
  194. {
  195. label: "坐标Y",
  196. prop: "y",
  197. search: false,
  198. },*/
  199. {
  200. label: "删除标识",
  201. prop: "deleted",
  202. search: false,
  203. },
  204. {
  205. label: "是否分批",
  206. prop: "batch",
  207. search: false,
  208. },
  209. {
  210. label: "是否合批",
  211. prop: "merge",
  212. search: false,
  213. },
  214. {
  215. label: "是否工艺数量",
  216. prop: "common",
  217. search: false,
  218. },
  219. {
  220. label: "分批数量",
  221. prop: "batchNum",
  222. search: false,
  223. },
  224. {
  225. label: "合批数量",
  226. prop: "mergeNum",
  227. search: false,
  228. },
  229. {
  230. label: "前置时间",
  231. prop: "forceTime",
  232. search: false,
  233. },
  234. {
  235. label: "外协时间",
  236. prop: "outTime",
  237. search: false,
  238. },
  239. ],
  240. });
  241. onMounted(() => {
  242. dataList();
  243. });
  244. </script>