certificateTable.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <ele-pro-table
  3. ref="certificateTable"
  4. :columns="certificateColumns"
  5. :need-page="false"
  6. :datasource="tableList"
  7. :toolkit="[]"
  8. >
  9. <!-- 表头工具栏 -->
  10. <template v-slot:toolbar>
  11. <el-button
  12. type="primary"
  13. v-if="form.id"
  14. @click="addCertificate('add', '')"
  15. >新增</el-button
  16. >
  17. </template>
  18. <!-- 操作栏 -->
  19. <template v-slot:action="scope">
  20. <el-link
  21. v-if="[1, 2].includes(scope.row.processStatus)"
  22. type="primary"
  23. :underline="false"
  24. icon="el-icon-edit"
  25. @click="addCertificate('view', scope.row)"
  26. >
  27. 详情
  28. </el-link>
  29. <el-link
  30. v-if="(isNeed_process_is_close&&[0, 3].includes(scope.row.processStatus))||!isNeed_process_is_close"
  31. type="primary"
  32. :underline="false"
  33. icon="el-icon-edit"
  34. @click="addCertificate('update', scope.row)"
  35. >
  36. 修改
  37. </el-link>
  38. <el-link
  39. v-if="isNeed_process_is_close&&[0, 3].includes(scope.row.processStatus)"
  40. type="primary"
  41. :underline="false"
  42. icon="el-icon-plus"
  43. @click="submit(scope.row)"
  44. >
  45. 提交
  46. </el-link>
  47. <el-popconfirm
  48. class="ele-action"
  49. title="确定要删除此资质包吗?"
  50. @confirm="handleRemove(scope.row)"
  51. >
  52. <template v-slot:reference>
  53. <el-link
  54. v-if="(isNeed_process_is_close&&[0, 3].includes(scope.row.processStatus))||!isNeed_process_is_close"
  55. type="danger"
  56. :underline="false"
  57. icon="el-icon-delete"
  58. >
  59. 删除
  60. </el-link>
  61. </template>
  62. </el-popconfirm>
  63. </template>
  64. <!-- 资质证书弹窗 -->
  65. <certificate-qualifications-dialog
  66. :certificate-qualifications-dialog-flag.sync="
  67. certificateQualificationsDialogFlag
  68. "
  69. v-if="certificateQualificationsDialogFlag"
  70. ref="certificateQualificationsDialogRef"
  71. typeInfo="1"
  72. :contactInfo="form"
  73. @reload="init(form)"
  74. >
  75. </certificate-qualifications-dialog>
  76. <process-submit-dialog :processSubmitDialogFlag.sync="processSubmitDialogFlag" v-if="processSubmitDialogFlag" ref="processSubmitDialogRef" @reload="reload"></process-submit-dialog>
  77. </ele-pro-table>
  78. </template>
  79. <script>
  80. import certificateQualificationsDialog from '@/views/purchasingManage/supplierManage/components/certificateQualificationsDialog.vue';
  81. import {
  82. contactQcPackDeleteAPI,
  83. contactQcSubmit,
  84. contactQcPackPageAPI
  85. } from '@/api/saleManage/contact';
  86. import {reviewStatus} from "@/enum/dict";
  87. import dictMixins from '@/mixins/dictMixins';
  88. import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
  89. export default {
  90. mixins: [dictMixins],
  91. components: {processSubmitDialog, certificateQualificationsDialog },
  92. data() {
  93. return {
  94. tableList: [],
  95. form: {},
  96. certificateColumns: [
  97. {
  98. type: 'index',
  99. width: 55,
  100. align: 'center'
  101. },
  102. {
  103. label: '编码',
  104. prop: 'code',
  105. slot: 'code',
  106. align: 'center',
  107. minWidth: 120
  108. },
  109. {
  110. label: '名称',
  111. prop: 'name',
  112. slot: 'name',
  113. align: 'center',
  114. minWidth: 120
  115. },
  116. {
  117. label: '创建时间',
  118. prop: 'createTime',
  119. slot: 'createTime',
  120. align: 'center',
  121. minWidth: 120
  122. },
  123. {
  124. label: '状态',
  125. prop: 'processStatus',
  126. slot: 'processStatus',
  127. align: 'center',
  128. width: 120,
  129. formatter: (_row, _column, cellValue) => {
  130. return reviewStatus[_row.processStatus];
  131. }
  132. },
  133. {
  134. label: '备注',
  135. prop: 'remark',
  136. slot: 'remark',
  137. align: 'center',
  138. minWidth: 120
  139. },
  140. {
  141. action: 'action',
  142. slot: 'action',
  143. label: '操作',
  144. align: 'center',
  145. width: 200
  146. }
  147. ],
  148. certificateQualificationsDialogFlag: false,
  149. processSubmitDialogFlag: false,
  150. };
  151. },
  152. methods: {
  153. async init(row) {
  154. this.form = row;
  155. const data = await contactQcPackPageAPI({
  156. certificationType: '1',
  157. relationId: row.id
  158. });
  159. this.tableList=data
  160. },
  161. //删除资质包
  162. handleRemove(row) {
  163. contactQcPackDeleteAPI([row.id]).then((res) => {
  164. this.$message.success('删除成功!');
  165. this.reload();
  166. });
  167. },
  168. //新增/查看/修改资质
  169. addCertificate(type, row) {
  170. this.certificateQualificationsDialogFlag = true;
  171. this.$nextTick(() => {
  172. this.$refs.certificateQualificationsDialogRef.init(type, row);
  173. });
  174. },
  175. //开启资质提交流程
  176. async submit(row) {
  177. // await contactQcSubmit({ businessId: row.id, certificationType: 1 });
  178. this.processSubmitDialogFlag = true
  179. this.$nextTick(()=>{
  180. let params = {
  181. businessId: row.id,
  182. businessKey : 'contact_qc_approve',
  183. formCreateUserId: row.createUserId,
  184. variables:{
  185. certificationType: 1
  186. },
  187. // callBackMethodType : '1',
  188. // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
  189. // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
  190. // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
  191. // miniHandle : '',
  192. // miniView : '',
  193. }
  194. this.$refs.processSubmitDialogRef.init(params)
  195. })
  196. },
  197. reload(){
  198. this.init(this.form);
  199. }
  200. }
  201. };
  202. </script>