index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. >
  18. <template #menu-left="{ size }">
  19. <el-button
  20. :size="size"
  21. icon="el-icon-plus"
  22. type="primary"
  23. @click="addRow"
  24. >新增
  25. </el-button>
  26. </template>
  27. <template #menu="{ size, row, index }">
  28. <el-button text @click="showSeqPage(row)" type="primary" :size="size"
  29. >明细
  30. <template #icon>
  31. <svg-icon icon-class="luozhuankahao" />
  32. </template>
  33. </el-button>
  34. </template>
  35. </avue-crud>
  36. <el-dialog
  37. v-model="dialog4.visible"
  38. :title="dialog4.title"
  39. width="950px"
  40. @close="dialog4.visible = false"
  41. >
  42. <wms_order_details :orderId="form.id" />
  43. </el-dialog>
  44. <el-dialog
  45. v-model="dialog.visible"
  46. :destroy-on-close="true"
  47. :title="dialog.title"
  48. width="1200px"
  49. @close="dialog.visible = false"
  50. >
  51. <add_order_details @closeDialog="closeDialog"/>
  52. </el-dialog>
  53. </div>
  54. </template>
  55. <script setup>
  56. import { ref, getCurrentInstance } from "vue";
  57. import { useCrud } from "@/hooks/userCrud";
  58. import { useCommonStoreHook } from "@/store";
  59. import dictDataUtil from "@/common/configs/dictDataUtil";
  60. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  61. const test = () => {
  62. isShowTable.value = true;
  63. tableType.value = tableType.value == 1 ? 2 : 1;
  64. };
  65. // 传入一个url,后面不带/
  66. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  67. useCrud({
  68. src: "/api/v1/wmsOrder",
  69. });
  70. const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
  71. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  72. const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
  73. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  74. const dialog4 = reactive({
  75. title: "任务明细",
  76. visible: false,
  77. });
  78. const dialog = reactive({
  79. title: "添加出入库",
  80. visible: false,
  81. });
  82. const addRow = () => {
  83. dialog.visible = true;
  84. }
  85. const closeDialog =(val) =>{
  86. dialog.visible = false
  87. dataList()
  88. }
  89. const showSeqPage = (workOrderCode) => {
  90. form.value = workOrderCode;
  91. dialog4.visible = true;
  92. };
  93. // 设置表格列或者其他自定义的option
  94. option.value = Object.assign(option.value, {
  95. delBtn: false,
  96. selection: false,
  97. viewBtn: false,
  98. editBtn: false,
  99. menu: true,
  100. addBtn: false,
  101. column: [
  102. {
  103. label: "仓库编码",
  104. prop: "houseNo",
  105. type: "select",
  106. search: true,
  107. width: 90,
  108. overHidden: true,
  109. editDisabled: true,
  110. dicUrl:
  111. dictDataUtil.request_url +
  112. dictDataUtil.TYPE_CODE.warehouse_type,
  113. props: {
  114. label: "dictLabel",
  115. value: "dictValue",
  116. },
  117. rules: [
  118. {
  119. required: true,
  120. message: "仓库编码不能为空",
  121. trigger: "trigger",
  122. },
  123. ],
  124. },
  125. {
  126. label: "类型",
  127. prop: "type",
  128. overHidden: true,
  129. type: "select",
  130. search: true,
  131. dicData:[{label: "原材料入库",value: "1"},{label: "工装入库",value: "2"},{label: "退料",value: "3"},{label: "出库",value: "4"}],
  132. },
  133. {
  134. label: "货区",
  135. width: 110,
  136. overHidden: true,
  137. prop: "coordinate",
  138. },
  139. {
  140. label: "任务单号",
  141. width: 130,
  142. search: true,
  143. overHidden: true,
  144. prop: "taskNo",
  145. },
  146. {
  147. label: "开始时间",
  148. width: 130,
  149. search: true,
  150. overHidden: true,
  151. prop: "startTime",
  152. type:"datetime",
  153. },
  154. {
  155. label: "结束时间",
  156. width: 130,
  157. search: true,
  158. overHidden: true,
  159. prop: "endTime",
  160. type:"datetime",
  161. },
  162. {
  163. label: "库位",
  164. overHidden: true,
  165. prop: "locationNo",
  166. },
  167. {
  168. label: "状态",
  169. prop: "state",
  170. type: "select",
  171. search: true,
  172. width: 70,
  173. overHidden: true,
  174. dicUrl:
  175. dictDataUtil.request_url +
  176. dictDataUtil.TYPE_CODE.warehouse_task_state,
  177. props: {
  178. label: "dictLabel",
  179. value: "dictValue",
  180. }
  181. },
  182. /*{
  183. label: "操作日志",
  184. prop: "message",
  185. width: 180,
  186. overHidden: true,
  187. display: false
  188. },*/
  189. {
  190. label: "操作时间",
  191. prop: "created",
  192. width: 180,
  193. display: false
  194. },
  195. {
  196. label: "操作人",
  197. prop: "creator",
  198. search: true,
  199. display: false
  200. },
  201. ],
  202. });
  203. onMounted(() => {
  204. // console.log("crudRef", crudRef)
  205. //search.value.type = '2'
  206. dataList();
  207. });
  208. </script>