index.vue 5.1 KB

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