index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <order-search @search="reload" ref="searchRef"> </order-search>
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="datasource"
  9. :selection.sync="selection"
  10. row-key="id"
  11. :page-size="20"
  12. @columns-change="handleColumnChange"
  13. :cache-key="cacheKeyUrl"
  14. >
  15. <template v-slot:type="{ row }">
  16. <span> {{ getDictValue('异常类型', row.type + '') }}</span>
  17. </template>
  18. <template v-slot:code="{ row }">
  19. <el-link
  20. type="primary"
  21. :underline="false"
  22. @click="dispose('detail', row)"
  23. >
  24. {{ row.code }}
  25. </el-link>
  26. </template>
  27. <!-- 操作列 -->
  28. <!-- 表头工具栏 -->
  29. <template v-slot:toolbar>
  30. <el-button
  31. size="small"
  32. type="primary"
  33. icon="el-icon-plus"
  34. class="ele-btn-icon"
  35. @click="dispose('add')"
  36. >
  37. 新建
  38. </el-button>
  39. <!-- <el-button
  40. size="small"
  41. type="danger"
  42. icon="el-icon-delete"
  43. class="ele-btn-icon"
  44. @click="remove()"
  45. plain
  46. :disabled="selection.length == 0"
  47. >
  48. 删除
  49. </el-button>
  50. <el-button
  51. size="small"
  52. type="primary"
  53. icon="el-icon-upload2"
  54. class="ele-btn-icon"
  55. plain
  56. >
  57. 导出
  58. </el-button>
  59. <el-button
  60. size="small"
  61. type="primary"
  62. icon="el-icon-download"
  63. class="ele-btn-icon"
  64. plain
  65. >
  66. 导入
  67. </el-button> -->
  68. <!-- <el-button
  69. size="small"
  70. type="primary"
  71. icon="el-icon-circle-plus-outline"
  72. class="ele-btn-icon"
  73. plain
  74. :disabled="selection.length == 0"
  75. >
  76. 处置
  77. </el-button> -->
  78. </template>
  79. <!-- <template v-slot:action="{ row }">
  80. <el-link
  81. type="primary"
  82. :underline="false"
  83. icon="el-icon-circle-plus-outline"
  84. v-if="(row.approvalStatus == 0 || row.approvalStatus == 3)&&(!row.exceptionClose||row.exceptionClose==2)"
  85. @click="submit(row.id)"
  86. >
  87. 提交
  88. </el-link>
  89. </template> -->
  90. <template v-slot:action="{ row }">
  91. <el-link
  92. type="primary"
  93. :underline="false"
  94. icon="el-icon-truck"
  95. v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
  96. @click="dispose('edit', row)"
  97. >
  98. 编辑
  99. </el-link>
  100. <el-link
  101. type="primary"
  102. :underline="false"
  103. v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
  104. @click="submit(row)"
  105. >
  106. 提交
  107. </el-link>
  108. <el-popconfirm
  109. class="ele-action"
  110. title="确定要删除吗?"
  111. v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
  112. @confirm="remove([row.id])"
  113. >
  114. <template v-slot:reference>
  115. <el-link type="danger" :underline="false" icon="el-icon-delete">
  116. 删除
  117. </el-link>
  118. </template>
  119. </el-popconfirm>
  120. </template>
  121. <dispose
  122. ref="disposeRef"
  123. @done="reload"
  124. :relationType="relationType"
  125. ></dispose>
  126. </ele-pro-table>
  127. </el-card>
  128. <process-submit-dialog
  129. :isNotNeedProcess="false"
  130. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  131. v-if="processSubmitDialogFlag"
  132. ref="processSubmitDialogRef"
  133. @reload="reload"
  134. ></process-submit-dialog>
  135. </div>
  136. </template>
  137. <script>
  138. import OrderSearch from '../components/order-search.vue';
  139. import dictMixins from '@/mixins/dictMixins';
  140. // import Create from '../components/create';
  141. import dispose from '../components/addOrEditDialog';
  142. import { getList, remove, submit } from '@/api/exceptionManagement/index';
  143. import { relationTypeOption } from '@/enum/dict.js';
  144. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  145. import tabMixins from '@/mixins/tableColumnsMixin';
  146. import { reviewStatus } from '@/enum/dict';
  147. export default {
  148. components: {
  149. OrderSearch,
  150. dispose,
  151. processSubmitDialog
  152. },
  153. mixins: [dictMixins, tabMixins],
  154. props: {
  155. relationType: {
  156. default: '1,3'
  157. }
  158. },
  159. data() {
  160. return {
  161. visible: false,
  162. loading: false,
  163. processSubmitDialogFlag: false,
  164. releasParams: {
  165. teamId: '',
  166. id: ''
  167. },
  168. selection: [],
  169. // userOptions: [],
  170. viewId: '',
  171. qualityInspector: '',
  172. cacheKeyUrl: 'eos-7a45afd7-saleManage-exceptionList',
  173. columnsVersion: 1
  174. };
  175. },
  176. computed: {
  177. // 表格列配置
  178. columns() {
  179. // 当columnsVersion变化时会重新计算,用作更新列配置
  180. const version = this.columnsVersion;
  181. return [
  182. {
  183. columnKey: 'selection',
  184. type: 'selection',
  185. width: 45,
  186. align: 'center',
  187. fixed: 'left'
  188. },
  189. {
  190. columnKey: 'index',
  191. label: '序号',
  192. type: 'index',
  193. width: 55,
  194. align: 'center',
  195. showOverflowTooltip: true,
  196. fixed: 'left'
  197. },
  198. {
  199. prop: 'code',
  200. label: '编码',
  201. align: 'center',
  202. slot: 'code'
  203. },
  204. {
  205. prop: 'name',
  206. label: '名称',
  207. align: 'center'
  208. },
  209. {
  210. prop: 'progress',
  211. label: '进度',
  212. align: 'center',
  213. formatter: (row, column, cellValue) => {
  214. return cellValue == 1
  215. ? '处置中'
  216. : cellValue == 2
  217. ? '处置完毕'
  218. : cellValue == 3
  219. ? '暂时搁置'
  220. : cellValue == 4
  221. ? '关闭'
  222. : '未开始';
  223. }
  224. },
  225. // {
  226. // prop: 'describes',
  227. // label: '异常描述',
  228. // align: 'center'
  229. // },
  230. // {
  231. // prop: 'disposalStatus',
  232. // label: '处置类型',
  233. // align: 'center',
  234. // },
  235. {
  236. prop: 'relationType',
  237. label: '来源单据类型',
  238. align: 'center',
  239. formatter: (row, column, cellValue) => {
  240. return relationTypeOption[cellValue] || '';
  241. }
  242. },
  243. {
  244. prop: 'relationCode',
  245. label: '来源单据编码',
  246. align: 'center'
  247. },
  248. {
  249. prop: 'relationName',
  250. label: '来源单据名称',
  251. align: 'center'
  252. },
  253. {
  254. prop: 'createUserName',
  255. label: '创建人',
  256. align: 'center'
  257. },
  258. {
  259. prop: 'createTime',
  260. label: '创建时间',
  261. align: 'center'
  262. },
  263. {
  264. prop: 'approvalStatus',
  265. label: '审批状态',
  266. align: 'center',
  267. formatter: (_row, _column, cellValue) => {
  268. return reviewStatus[_row.approvalStatus];
  269. }
  270. },
  271. {
  272. columnKey: 'action',
  273. label: '操作',
  274. width: 180,
  275. align: 'center',
  276. resizable: false,
  277. fixed: 'right',
  278. slot: 'action',
  279. showOverflowTooltip: true
  280. }
  281. ];
  282. }
  283. },
  284. created() {
  285. this.requestDict('异常类型');
  286. // this.userOptions = [];
  287. // listAllUserBind().then((data) => {
  288. // return;
  289. // this.userOptions.push(...data);
  290. // });
  291. },
  292. filters: {},
  293. methods: {
  294. //处置
  295. dispose(type, row) {
  296. this.$refs.disposeRef.open(type, row);
  297. },
  298. /* 表格数据源 */
  299. datasource({ page, limit, where }) {
  300. return getList({
  301. pageNum: page,
  302. size: limit,
  303. ...where,
  304. relationType: this.relationType
  305. });
  306. },
  307. open(type, row) {
  308. this.$refs.create.open(type, row);
  309. },
  310. remove(id) {
  311. remove(id).then((res) => {
  312. this.reload();
  313. });
  314. },
  315. async submit(res) {
  316. this.processSubmitDialogFlag = true;
  317. this.$nextTick(() => {
  318. let params = {
  319. businessId: res.id,
  320. businessKey: 'eom_exception_approve',
  321. formCreateUserId: res.createUserId,
  322. variables: {
  323. businessCode: res.code,
  324. businessName: res.name,
  325. businessType: res.relationName
  326. }
  327. };
  328. this.$refs.processSubmitDialogRef.init(params);
  329. });
  330. },
  331. /* 刷新表格 */
  332. reload(where) {
  333. this.$nextTick(() => {
  334. this.$refs.table.reload({ page: 1, where });
  335. this.$emit('getToDoReminder');
  336. });
  337. }
  338. }
  339. };
  340. </script>
  341. <style lang="scss" scoped></style>