index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="switch">
  5. <div class="switch_left">
  6. <ul>
  7. <li
  8. v-for="item in tabOptions"
  9. :key="item.key"
  10. :class="{ active: activeComp == item.key }"
  11. @click="activeComp = item.key"
  12. >
  13. {{ item.name }}
  14. </li>
  15. </ul>
  16. </div>
  17. <!-- <div class="right" style="padding: 10px">
  18. <el-button @click="$router.go(-1)">返回</el-button>
  19. </div> -->
  20. </div>
  21. <div class="main">
  22. <div v-if="activeComp == 'point'">
  23. <InspectionPoint />
  24. </div>
  25. <div v-if="activeComp == 'anmac'">
  26. <Maintenance />
  27. </div>
  28. <div v-if="activeComp == 'plan'" class="plan">
  29. <inventory-search @search="reload"> </inventory-search>
  30. <!-- 数据表格 -->
  31. <ele-pro-table
  32. ref="table"
  33. :columns="columns"
  34. :datasource="datasource"
  35. cache-key="systemRoleTable14"
  36. >
  37. <!-- 表头工具栏 -->
  38. <template v-slot:toolbar>
  39. <el-button
  40. size="small"
  41. type="primary"
  42. icon="el-icon-plus"
  43. class="ele-btn-icon"
  44. @click="openEdit()"
  45. >
  46. 新建
  47. </el-button>
  48. <el-button
  49. size="small"
  50. type="primary"
  51. class="ele-btn-icon"
  52. @click="goDetail()"
  53. >
  54. 详情
  55. </el-button>
  56. </template>
  57. <!-- 操作列 -->
  58. <template v-slot:action="{ row }">
  59. <el-link
  60. type="primary"
  61. :underline="false"
  62. icon="el-icon-edit"
  63. @click="openEdit(row)"
  64. >
  65. 修改
  66. </el-link>
  67. <el-popconfirm
  68. class="ele-action"
  69. title="确定要删除此角色吗?"
  70. @confirm="remove(row)"
  71. >
  72. <template v-slot:reference>
  73. <el-link
  74. type="danger"
  75. :underline="false"
  76. icon="el-icon-delete"
  77. >
  78. 删除
  79. </el-link>
  80. </template>
  81. </el-popconfirm>
  82. </template>
  83. </ele-pro-table>
  84. </div>
  85. <div v-if="activeComp == 'measuringSubmit'">
  86. <InspectionPoint />
  87. </div>
  88. </div>
  89. </el-card>
  90. <!-- 新建或编辑弹窗 -->
  91. <AddInventoryDialog
  92. ref="addInventoryDialogRef"
  93. :dialogTile="dialogTitle"
  94. @refreshList="resetForm"
  95. :isBindPlan="isBindPlan"
  96. />
  97. </div>
  98. </template>
  99. <script>
  100. import InspectionPoint from '../inspectionPoint';
  101. import Maintenance from '../maintenance';
  102. import InventorySearch from './components/inventory-search.vue';
  103. import AddInventoryDialog from './components/addInventoryDialog.vue';
  104. import { pageRoles } from '@/api/system/role';
  105. export default {
  106. components: {
  107. InventorySearch,
  108. AddInventoryDialog,
  109. InspectionPoint,
  110. Maintenance
  111. },
  112. data() {
  113. return {
  114. activeComp: 'point',
  115. tabOptions: [
  116. { key: 'point', name: '巡点检配置' },
  117. { key: 'anmac', name: '保养配置' },
  118. { key: 'plan', name: '盘点配置' },
  119. { key: 'measuringSubmit', name: '量具送检配置' }
  120. ],
  121. // 表格列配置
  122. columns: [
  123. {
  124. columnKey: 'index',
  125. label: '序号',
  126. type: 'index',
  127. width: 55,
  128. align: 'center',
  129. showOverflowTooltip: true,
  130. fixed: 'left'
  131. },
  132. {
  133. prop: 'code',
  134. label: '计划单号',
  135. align: 'center',
  136. showOverflowTooltip: true,
  137. minWidth: 110
  138. },
  139. {
  140. prop: 'groupId',
  141. label: '盘点名称',
  142. align: 'center',
  143. showOverflowTooltip: true,
  144. minWidth: 110
  145. },
  146. {
  147. prop: 'enable',
  148. label: '盘点仓库',
  149. align: 'center',
  150. showOverflowTooltip: true,
  151. slot: 'enable',
  152. minWidth: 110
  153. },
  154. {
  155. prop: 'name',
  156. label: '盘点部门',
  157. align: 'center',
  158. showOverflowTooltip: true,
  159. minWidth: 110
  160. },
  161. {
  162. prop: 'type',
  163. label: '资产分类',
  164. align: 'center',
  165. showOverflowTooltip: true,
  166. minWidth: 110
  167. },
  168. {
  169. prop: 'cycle',
  170. label: '规则名称',
  171. align: 'center',
  172. showOverflowTooltip: true,
  173. minWidth: 110
  174. },
  175. {
  176. prop: 'auto',
  177. label: '自动派单',
  178. align: 'center',
  179. showOverflowTooltip: true,
  180. minWidth: 110
  181. },
  182. {
  183. prop: 'status',
  184. label: '状态',
  185. align: 'center',
  186. showOverflowTooltip: true,
  187. minWidth: 110
  188. },
  189. {
  190. prop: 'creater',
  191. label: '创建人',
  192. align: 'center',
  193. showOverflowTooltip: true,
  194. minWidth: 110
  195. },
  196. {
  197. prop: 'createTime',
  198. label: '创建时间',
  199. align: 'center',
  200. showOverflowTooltip: true,
  201. minWidth: 110,
  202. formatter: (_row, _column, cellValue) => {
  203. return this.$util.toDateString(cellValue);
  204. }
  205. },
  206. {
  207. columnKey: 'action',
  208. label: '操作',
  209. width: 150,
  210. align: 'center',
  211. resizable: false,
  212. slot: 'action',
  213. showOverflowTooltip: true
  214. }
  215. ],
  216. // 加载状态
  217. loading: false,
  218. pageType: 'add',
  219. dialogTitle: '',
  220. isBindPlan: false
  221. };
  222. },
  223. computed: {},
  224. methods: {
  225. // 重置
  226. resetForm() {
  227. this.$refs.configFormRef.resetFields();
  228. // this.searchForm()
  229. },
  230. /* 表格数据源 */
  231. datasource({ page, limit, where, order }) {
  232. return pageRoles({ pageNum: page, size: limit, ...where });
  233. },
  234. /* 刷新表格 */
  235. reload(where) {
  236. this.$refs.table.reload({ page: 1, where });
  237. },
  238. openEdit(row) {
  239. this.isBindPlan = false;
  240. this.dialogTitle = '新增盘点计划配置';
  241. this.$refs.addInventoryDialogRef.dialogVisible = true;
  242. // this.$store.dispatch('planRules/setAddOrUpdate', 'add')
  243. },
  244. goDetail() {
  245. this.$router.push({
  246. path: '/rulesManagement/planRules/detail'
  247. // query: {
  248. // id
  249. // }
  250. });
  251. }
  252. }
  253. };
  254. </script>
  255. <style lang="scss" scoped>
  256. ::v-deep .el-card__body {
  257. padding-top: 0;
  258. padding-left: 0;
  259. }
  260. .main {
  261. padding-left: 17px;
  262. .plan {
  263. padding-top: 15px;
  264. }
  265. }
  266. </style>