index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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="checkApply(row)"
  19. v-if="row.state == '2'"
  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. <Check
  41. :rowData="rowData"
  42. @close="dialog.visible = false"
  43. :showStatus
  44. @data-list="getList"
  45. :key="checkKey"
  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 Check from "./check.vue";
  55. const checkKey = ref(false);
  56. const getList = () => {
  57. dataList();
  58. };
  59. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  60. // 数据字典相关
  61. const { dicts } = useDictionaryStore();
  62. const rowData = ref({});
  63. const showStatus = ref(false);
  64. const checkApply = (row) => {
  65. checkKey.value = !checkKey.value;
  66. rowData.value = row;
  67. showStatus.value = false;
  68. dialog.value.visible = true;
  69. };
  70. const showApply = (row) => {
  71. checkKey.value = !checkKey.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. searchEnter: true,
  100. selection: false,
  101. viewBtn: false,
  102. editBtn: false,
  103. delBtn: false,
  104. addBtn: false,
  105. menu: true,
  106. column: [
  107. {
  108. label: "工单编码",
  109. prop: "workOrderCode",
  110. search: true,
  111. overHidden: true,
  112. },
  113. {
  114. label: "订单编号",
  115. prop: "orderCode",
  116. search: true,
  117. overHidden: true,
  118. },
  119. {
  120. label: "订单名称",
  121. prop: "orderName",
  122. overHidden: true,
  123. search: true,
  124. },
  125. {
  126. label: "物料编码",
  127. prop: "materialCode",
  128. overHidden: true,
  129. editDisplay: false,
  130. addDisplay: false,
  131. },
  132. {
  133. label: "物料型号",
  134. prop: "materialModel",
  135. overHidden: true,
  136. editDisplay: false,
  137. hide: true,
  138. },
  139. {
  140. label: "物料名称",
  141. prop: "materialName",
  142. search: true,
  143. overHidden: true,
  144. disabled: true,
  145. },
  146. {
  147. label: "表格类型",
  148. prop: "formType",
  149. search: true,
  150. filterable: true,
  151. type: "select",
  152. dicData: dicts.excel_type,
  153. props: { label: "dictLabel", value: "dictValue" },
  154. },
  155. {
  156. label: "状态",
  157. prop: "state",
  158. rules: [
  159. {
  160. required: true,
  161. message: "请选择文件",
  162. trigger: "blur",
  163. },
  164. ],
  165. dicData: [
  166. {
  167. label: "待发起",
  168. value: "0",
  169. },
  170. {
  171. label: "驳回",
  172. value: "1",
  173. },
  174. {
  175. label: "审核中",
  176. value: "2",
  177. },
  178. {
  179. label: "完成",
  180. value: "3",
  181. },
  182. ],
  183. },
  184. {
  185. label: "质量等级",
  186. prop: "hOrder",
  187. search: true,
  188. width: 100,
  189. overHidden: true,
  190. filterable: true,
  191. type: "select",
  192. dicData: dicts.quality_grade,
  193. props: { label: "dictLabel", value: "dictValue" },
  194. rules: [
  195. {
  196. required: true,
  197. message: "请选择质量等级",
  198. trigger: "blur",
  199. },
  200. ],
  201. },
  202. ],
  203. });
  204. onMounted(() => {
  205. search.value.isExamine = "1";
  206. dataList();
  207. });
  208. </script>