index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <search-table @search="reload"></search-table>
  5. <!-- 数据表格 -->
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. height="calc(100vh - 325px)"
  11. full-height="calc(100vh - 116px)"
  12. tool-class="ele-toolbar-form"
  13. :selection.sync="selection"
  14. :page-size="20"
  15. @columns-change="handleColumnChange"
  16. :cache-key="cacheKeyUrl"
  17. :response="{
  18. dataName: 'records',
  19. countName: 'total'
  20. }"
  21. >
  22. <!-- 表头工具栏 -->
  23. <template v-slot:toolbar>
  24. <el-button
  25. size="small"
  26. type="primary"
  27. icon="el-icon-plus"
  28. class="ele-btn-icon"
  29. @click="handleAddOrEdit('', 'add')"
  30. >
  31. 新建
  32. </el-button>
  33. </template>
  34. <!-- 操作 -->
  35. <template v-slot:action="{ row }">
  36. <el-link
  37. type="primary"
  38. :underline="false"
  39. icon="el-icon-edit"
  40. @click="handleAddOrEdit(row, 'edit')"
  41. >
  42. 修改
  43. </el-link>
  44. <el-link
  45. type="primary"
  46. :underline="false"
  47. icon="el-icon-edit"
  48. @click="submit(row)"
  49. v-if="row.reviewStatus == 0 || row.reviewStatus == 3"
  50. >
  51. 提交
  52. </el-link>
  53. <el-popconfirm
  54. class="ele-action"
  55. title="确定要删除此信息吗?"
  56. @confirm="remove([row.id])"
  57. >
  58. <template v-slot:reference>
  59. <el-link type="danger" :underline="false" icon="el-icon-delete">
  60. 删除
  61. </el-link>
  62. </template>
  63. </el-popconfirm>
  64. </template>
  65. <template v-slot:code="{ row }">
  66. <el-link
  67. type="primary"
  68. :underline="false"
  69. @click="handleAddOrEdit(row, 'view')"
  70. >
  71. {{ row.code }}
  72. </el-link>
  73. </template>
  74. </ele-pro-table>
  75. </el-card>
  76. <add-or-edit-dialog
  77. ref="addOrEditDialogRef"
  78. @done="reload"
  79. ></add-or-edit-dialog>
  80. <process-submit-dialog
  81. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  82. v-if="processSubmitDialogFlag"
  83. ref="processSubmitDialogRef"
  84. @reload="reload"
  85. :isNotNeedProcess="false"
  86. ></process-submit-dialog>
  87. </div>
  88. </template>
  89. <script>
  90. import tabMixins from '@/mixins/tableColumnsMixin';
  91. import addOrEditDialog from './components/addOrEditDialog.vue';
  92. import searchTable from './components/searchTable.vue';
  93. // import { getList, del } from '@/api/marketManagem/index';
  94. import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
  95. import {
  96. getTableList,
  97. deleteList
  98. } from '@/api/productionScheduling/productionShift';
  99. export default {
  100. mixins: [tabMixins],
  101. components: {
  102. processSubmitDialog,
  103. addOrEditDialog,
  104. searchTable
  105. },
  106. data() {
  107. return {
  108. // 加载状态
  109. loading: false,
  110. delVisible: false,
  111. selection: [],
  112. processSubmitDialogFlag: false,
  113. cacheKeyUrl: 'main-productionScheduling-productionShift-index',
  114. columns: [
  115. // {
  116. // width: 45,
  117. // type: 'selection',
  118. // columnKey: 'selection',
  119. // align: 'center',
  120. // selectable: (row, index) => {
  121. // return row.reviewStatus != 1 && row.reviewStatus != 2;
  122. // }
  123. // },
  124. {
  125. width: 60,
  126. label: '序号',
  127. type: 'index',
  128. columnKey: 'index',
  129. align: 'center'
  130. },
  131. {
  132. minWidth: 180,
  133. prop: 'code',
  134. label: '班次编码',
  135. align: 'center',
  136. slot: 'code',
  137. showOverflowTooltip: true
  138. },
  139. {
  140. minWidth: 180,
  141. prop: 'shiftName',
  142. label: '班次名称',
  143. align: 'center',
  144. showOverflowTooltip: true
  145. },
  146. {
  147. minWidth: 180,
  148. prop: 'factoryVos',
  149. label: '所属工厂',
  150. align: 'center',
  151. formatter: (row, column) => {
  152. if(row.factoryVos){
  153. return row.factoryVos.map(item => item.factoryName).join(',')
  154. }
  155. },
  156. showOverflowTooltip: true
  157. },
  158. {
  159. minWidth: 180,
  160. prop: 'attendanceStartTime',
  161. label: '出勤开始时间',
  162. align: 'center',
  163. showOverflowTooltip: true
  164. },
  165. {
  166. minWidth: 130,
  167. prop: 'attendanceEndTime',
  168. label: '出勤结束时间',
  169. align: 'center',
  170. showOverflowTooltip: true
  171. },
  172. {
  173. minWidth: 180,
  174. prop: 'totalWorkingMinutes',
  175. label: '工作总时长(分钟)',
  176. align: 'center',
  177. showOverflowTooltip: true
  178. },
  179. {
  180. minWidth: 200,
  181. prop: 'restDurationMinutes',
  182. label: '休息时长(分钟)',
  183. align: 'center',
  184. showOverflowTooltip: true
  185. },
  186. {
  187. minWidth: 150,
  188. prop: 'status',
  189. label: '状态',
  190. align: 'center',
  191. formatter: (row, column) => {
  192. return row.status == 0 ? '启用' : '禁用';
  193. },
  194. showOverflowTooltip: true
  195. },
  196. {
  197. minWidth: 100,
  198. prop: 'updateUserName',
  199. label: '设置人',
  200. align: 'center',
  201. showOverflowTooltip: true
  202. },
  203. {
  204. minWidth: 150,
  205. prop: 'updateTime',
  206. label: '设置时间',
  207. align: 'center',
  208. showOverflowTooltip: true
  209. },
  210. {
  211. columnKey: 'action',
  212. label: '操作',
  213. width: 200,
  214. align: 'center',
  215. resizable: false,
  216. slot: 'action',
  217. showOverflowTooltip: true,
  218. fixed: 'right'
  219. }
  220. ]
  221. };
  222. },
  223. computed: {
  224. columns() {
  225. return [];
  226. }
  227. },
  228. created() {},
  229. methods: {
  230. //新增、修改
  231. handleAddOrEdit(row = {}, type) {
  232. this.$nextTick(() => {
  233. this.$refs.addOrEditDialogRef.open(row, type);
  234. });
  235. },
  236. /* 表格数据源 */
  237. datasource({ page, limit, where, order }) {
  238. return getTableList({
  239. pageNum: page,
  240. size: limit,
  241. ...where
  242. });
  243. },
  244. submit(res) {
  245. this.processSubmitDialogFlag = true;
  246. this.$nextTick(() => {
  247. let params = {
  248. businessId: res.id,
  249. businessKey: 'market_management_approve',
  250. formCreateUserId: res.createUserId,
  251. pcHandle: '/bpm/handleTask/components/marketManagem/submit.vue',
  252. pcView: '/bpm/handleTask/components/marketManagem/view.vue',
  253. variables: {
  254. businessCode: res.code,
  255. businessName: res.name,
  256. businessType: res.type
  257. }
  258. };
  259. this.$refs.processSubmitDialogRef.init(params);
  260. });
  261. },
  262. /* 刷新表格 */
  263. reload(where = {}) {
  264. this.$refs.table.reload({ page: 1, where });
  265. },
  266. remove(row) {
  267. del(row).then((res) => {
  268. this.$message.success('删除成功!');
  269. this.reload();
  270. });
  271. }
  272. }
  273. };
  274. </script>
  275. <style lang="scss" scoped>
  276. :deep(.el-link--inner) {
  277. margin-left: 0px !important;
  278. }
  279. .sys-organization-list {
  280. height: calc(100vh - 264px);
  281. box-sizing: border-box;
  282. border-width: 1px;
  283. border-style: solid;
  284. overflow: auto;
  285. }
  286. .sys-organization-list :deep(.el-tree-node__content) {
  287. height: 40px;
  288. & > .el-tree-node__expand-icon {
  289. margin-left: 10px;
  290. }
  291. }
  292. </style>