index.vue 5.4 KB

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