choice-workshop-page.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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-click="rowClick"
  11. @search-change="searchChange"
  12. @search-reset="resetChange"
  13. @size-change="dataList"
  14. @current-change="dataList"
  15. >
  16. </avue-crud>
  17. </div>
  18. </template>
  19. <script setup>
  20. import { ref } from "vue";
  21. import { useCrud } from "@/hooks/userCrud";
  22. import { useCommonStoreHook } from "@/store";
  23. import dictDataUtil from "@/common/configs/dictDataUtil";
  24. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  25. const test = () => {
  26. isShowTable.value = true;
  27. tableType.value = tableType.value == 1 ? 2 : 1;
  28. };
  29. // 传入一个url,后面不带/
  30. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  31. useCrud({
  32. src: "/api/v1/base/workShop",
  33. });
  34. const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
  35. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  36. const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
  37. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  38. const emit = defineEmits(["workShopInfo"])
  39. const rowClick = (row)=>{
  40. emit("workShopInfo", row)
  41. }
  42. // 设置表格列或者其他自定义的option
  43. option.value = Object.assign(option.value, {
  44. delBtn: false,
  45. selection: false,
  46. search: false,
  47. editBtn: false,
  48. addBtn: false,
  49. viewBtn: false,
  50. menu: false,
  51. column: [
  52. {
  53. label: "订单编号",
  54. prop: "orderCode",
  55. search: true,
  56. width: "125",
  57. display: false,
  58. },
  59. {
  60. label: "订单名称",
  61. prop: "orderName",
  62. search: true,
  63. width: "100",
  64. },
  65. {
  66. label: "ERP号",
  67. prop: "erpCode",
  68. search: true,
  69. width: "100",
  70. },
  71. {
  72. label: "产品编码",
  73. prop: "materialCode",
  74. search: true,
  75. width: "100",
  76. },
  77. {
  78. label: "产品名称",
  79. prop: "materialName",
  80. search: true,
  81. width: "100",
  82. },
  83. {
  84. label: "产品规格",
  85. width: "100",
  86. prop: "materialModel",
  87. },
  88. {
  89. label: "订单状态",
  90. prop: "orderState",
  91. display: false,
  92. width: "100",
  93. type: "select", //类型为下拉选择框
  94. dicUrl:
  95. dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_state,
  96. props: {
  97. label: "dictLabel",
  98. value: "dictValue",
  99. },
  100. searchClearable: false, //可清空的输入框,默认为true
  101. filterable: true, //添加filterable属性即可启用搜索功能
  102. },
  103. {
  104. label: "订单类型",
  105. prop: "orderType",
  106. type: "select", //类型为下拉选择框
  107. width: "100",
  108. dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
  109. props: {
  110. label: "dictLabel",
  111. value: "dictValue",
  112. },
  113. searchClearable: false, //可清空的输入框,默认为true
  114. filterable: true, //添加filterable属性即可启用搜索功能
  115. },
  116. {
  117. label: "订单数量",
  118. prop: "orderNum",
  119. type: "number",
  120. width: "100",
  121. min: 1,
  122. max: 99999,
  123. },
  124. {
  125. label: "排产数量",
  126. prop: "scheduledNum",
  127. width: "100",
  128. display: false,
  129. },
  130. {
  131. label: "优先级",
  132. prop: "priority",
  133. width: "100",
  134. type: "select", //类型为下拉选择框
  135. dicUrl:
  136. dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
  137. props: {
  138. label: "dictLabel",
  139. value: "dictValue",
  140. },
  141. searchClearable: false, //可清空的输入框,默认为true
  142. filterable: true, //添加filterable属性即可启用搜索功能
  143. },
  144. {
  145. label: "交付日期",
  146. prop: "deliverTime",
  147. type: "date",
  148. width: "100",
  149. format: "YYYY-MM-DD", //前端展示格式
  150. valueFormat: "YYYY-MM-DD", //设置后端接收的日期格式
  151. },
  152. {
  153. label: "所属公司",
  154. prop: "companyId",
  155. width: "100",
  156. type: "select", //类型为下拉选择框
  157. dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/orgList",
  158. props: {
  159. label: "deptName",
  160. value: "id",
  161. },
  162. },
  163. {
  164. label: "项目号",
  165. width: "100",
  166. prop: "projectCode",
  167. },
  168. {
  169. label: "绑定铭牌",
  170. prop: "nameplated",
  171. width: "100",
  172. type: "radio", //类型为单选框
  173. dicData: [
  174. {
  175. label: "否",
  176. value: 0,
  177. },
  178. {
  179. label: "是",
  180. value: 1,
  181. },
  182. ],
  183. value: 0,
  184. },
  185. {
  186. label: "备注",
  187. prop: "remark",
  188. width: "100",
  189. minRows: 2, //最小行/最小值
  190. type: "textarea", //类型为多行文本域框
  191. maxlength: 512, //最大输入长度
  192. },
  193. {
  194. label: "创建时间",
  195. prop: "created",
  196. width: "140",
  197. overHidden: true,
  198. type: "datetime",
  199. valueFormat: "yyyy-MM-dd HH:mm:ss",
  200. },
  201. {
  202. label: "创建人",
  203. prop: "creator",
  204. width: 80,
  205. overHidden: true,
  206. },
  207. ],
  208. });
  209. onMounted(() => {
  210. dataList();
  211. });
  212. </script>