index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. @search-change="searchChange"
  11. @search-reset="resetChange"
  12. @size-change="dataList"
  13. @current-change="dataList"
  14. @selection-change="selectionChange"
  15. >
  16. <template #menu="{ row, index, type }">
  17. <el-button
  18. @click="addApply(row)"
  19. v-if="row.state == '0' || row.state == '1'"
  20. text
  21. type="primary"
  22. >发起申请</el-button
  23. >
  24. <el-button
  25. @click="showApply(row)"
  26. v-if="row.state != '0'"
  27. text
  28. type="primary"
  29. >查看</el-button
  30. >
  31. </template>
  32. </avue-crud>
  33. </div>
  34. <el-dialog
  35. v-model="dialog.visible"
  36. :title="dialog.title"
  37. width="80%"
  38. @close="dialog.visible = false"
  39. >
  40. <Apply
  41. :rowData="rowData"
  42. @close="dialog.visible = false"
  43. :showStatus
  44. @data-list="getList"
  45. :key="applyKey"
  46. />
  47. </el-dialog>
  48. </template>
  49. <script setup>
  50. import { ref, getCurrentInstance } from "vue";
  51. import { useCrud } from "@/hooks/userCrud";
  52. import { useCommonStoreHook, useDictionaryStore } from "@/store";
  53. import dictDataUtil from "@/common/configs/dictDataUtil";
  54. import Apply from "./apply.vue";
  55. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  56. // 数据字典相关
  57. const { dicts } = useDictionaryStore();
  58. const getList = () => {
  59. dataList();
  60. };
  61. const rowData = ref({});
  62. const showStatus = ref(false);
  63. const applyKey = ref(false);
  64. const addApply = (row) => {
  65. applyKey.value = !applyKey.value;
  66. rowData.value = row;
  67. showStatus.value = false;
  68. dialog.value.visible = true;
  69. };
  70. const showApply = (row) => {
  71. applyKey.value = !applyKey.value;
  72. rowData.value = row;
  73. showStatus.value = true;
  74. dialog.value.visible = true;
  75. };
  76. const dialog = ref({
  77. visible: false,
  78. title: "归档申请",
  79. });
  80. // 传入一个url,后面不带/
  81. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  82. useCrud({
  83. src: "/api/v1/ProcessFormData/examine",
  84. });
  85. const {
  86. dataEditList,
  87. createRow,
  88. updateRow,
  89. deleteRow,
  90. searchChange,
  91. dataList,
  92. resetChange,
  93. } = Methords; //增删改查
  94. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  95. const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
  96. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  97. // 设置表格列或者其他自定义的option
  98. option.value = Object.assign(option.value, {
  99. selection: false,
  100. viewBtn: false,
  101. editBtn: false,
  102. delBtn: false,
  103. addBtn: false,
  104. menu: true,
  105. column: [
  106. {
  107. label: "工单编码",
  108. prop: "workOrderCode",
  109. search: true,
  110. overHidden: true,
  111. },
  112. {
  113. label: "订单编号",
  114. prop: "orderCode",
  115. search: true,
  116. overHidden: true,
  117. },
  118. {
  119. label: "订单名称",
  120. prop: "orderName",
  121. overHidden: true,
  122. search: true,
  123. },
  124. {
  125. label: "物料编码",
  126. prop: "materialCode",
  127. overHidden: true,
  128. editDisplay: false,
  129. addDisplay: false,
  130. },
  131. {
  132. label: "物料型号",
  133. prop: "materialModel",
  134. overHidden: true,
  135. editDisplay: false,
  136. hide: true,
  137. },
  138. {
  139. label: "物料名称",
  140. prop: "materialName",
  141. search: true,
  142. overHidden: true,
  143. disabled: true,
  144. },
  145. {
  146. label: "表格类型",
  147. prop: "formType",
  148. search: true,
  149. filterable: true,
  150. type: "select",
  151. dicData: dicts.excel_type,
  152. props: { label: "dictLabel", value: "dictValue" },
  153. },
  154. {
  155. label: "状态",
  156. prop: "state",
  157. rules: [
  158. {
  159. required: true,
  160. message: "请选择文件",
  161. trigger: "blur",
  162. },
  163. ],
  164. dicData: [
  165. {
  166. label: "待发起",
  167. value: "0",
  168. },
  169. {
  170. label: "驳回",
  171. value: "1",
  172. },
  173. {
  174. label: "审核中",
  175. value: "2",
  176. },
  177. {
  178. label: "完成",
  179. value: "3",
  180. },
  181. ],
  182. },
  183. {
  184. label: "是否H级",
  185. prop: "hOrder",
  186. rules: [
  187. {
  188. required: true,
  189. message: "请选择文件",
  190. trigger: "blur",
  191. },
  192. ],
  193. dicData: [
  194. {
  195. label: "是",
  196. value: "1",
  197. },
  198. {
  199. label: "否",
  200. value: "0",
  201. },
  202. ],
  203. },
  204. ],
  205. });
  206. onMounted(() => {
  207. search.value.isExamine = "0";
  208. dataList();
  209. });
  210. </script>