inquiryManage-list.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <el-dialog
  3. title="选择"
  4. :visible.sync="visible"
  5. :before-close="handleClose"
  6. :close-on-click-modal="false"
  7. top="5vh"
  8. :close-on-press-escape="false"
  9. append-to-body
  10. width="80%"
  11. >
  12. <search-quotation @search="reload"> </search-quotation>
  13. <ele-pro-table
  14. ref="table"
  15. :columns="columns"
  16. :datasource="datasource"
  17. row-key="id"
  18. height="calc(100vh - 350px)"
  19. @cell-click="cellClick"
  20. class="dict-table"
  21. >
  22. <!-- 表头工具栏 -->
  23. <template v-slot:action="{ row }">
  24. <el-radio class="radio" v-model="radio" :label="row.planCode"
  25. ><i></i
  26. ></el-radio>
  27. </template>
  28. <!-- 状态 -->
  29. <template v-slot:status="{ row }">
  30. {{ getStatus(row.status) }}
  31. </template>
  32. </ele-pro-table>
  33. <div class="btns">
  34. <el-button type="primary" size="small" @click="selected">选择</el-button>
  35. <el-button size="small" @click="handleClose">关闭</el-button>
  36. </div>
  37. </el-dialog>
  38. </template>
  39. <script>
  40. import { getTableList } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
  41. import searchQuotation from './searchQuotation.vue';
  42. export default {
  43. components: {
  44. searchQuotation
  45. },
  46. data() {
  47. return {
  48. visible: false,
  49. currentIndex: null,
  50. list: [],
  51. columns: [
  52. {
  53. action: 'action',
  54. slot: 'action',
  55. align: 'center',
  56. label: '选择'
  57. },
  58. {
  59. columnKey: 'index',
  60. label: '序号',
  61. type: 'index',
  62. width: 55,
  63. align: 'center',
  64. showOverflowTooltip: true,
  65. fixed: 'left'
  66. },
  67. {
  68. prop: 'planCode',
  69. slot: 'planCode',
  70. label: '采购计划编码',
  71. align: 'center',
  72. showOverflowTooltip: true,
  73. minWidth: 200
  74. },
  75. {
  76. prop: 'requirementCode',
  77. label: '采购需求编码',
  78. align: 'center',
  79. showOverflowTooltip: true,
  80. minWidth: 200
  81. },
  82. {
  83. prop: 'requireDeptName',
  84. label: '需求部门',
  85. align: 'center',
  86. slot: 'requireDeptName',
  87. showOverflowTooltip: true,
  88. minWidth: 200
  89. },
  90. {
  91. prop: 'requireUserName',
  92. label: '需求人',
  93. align: 'center',
  94. showOverflowTooltip: true,
  95. minWidth: 140
  96. },
  97. {
  98. prop: 'responsibleName',
  99. label: '负责人',
  100. align: 'center',
  101. showOverflowTooltip: true,
  102. minWidth: 120
  103. },
  104. {
  105. prop: 'detailCount',
  106. label: '明细条数',
  107. align: 'center',
  108. showOverflowTooltip: true,
  109. minWidth: 140
  110. },
  111. {
  112. prop: 'finishDate',
  113. label: '完成日期',
  114. align: 'center',
  115. showOverflowTooltip: true,
  116. minWidth: 140
  117. },
  118. {
  119. prop: 'createTime',
  120. label: '创建时间',
  121. align: 'center',
  122. showOverflowTooltip: true,
  123. minWidth: 180
  124. },
  125. {
  126. prop: 'status',
  127. label: '状态',
  128. align: 'center',
  129. slot: 'status',
  130. showOverflowTooltip: true,
  131. minWidth: 120
  132. },
  133. {
  134. prop: 'remark',
  135. label: '备注',
  136. align: 'center',
  137. showOverflowTooltip: true,
  138. minWidth: 170
  139. }
  140. ],
  141. radio: null
  142. };
  143. },
  144. watch: {},
  145. methods: {
  146. open(planCode) {
  147. //数据回显
  148. if (planCode) {
  149. this.radio = planCode;
  150. if (this.list.length > 0) {
  151. this.current = this.list.find(
  152. (item) => item.planCode == this.radio
  153. );
  154. }
  155. }
  156. this.visible = true;
  157. },
  158. /* 表格数据源 */
  159. datasource({ page, limit, where, order }) {
  160. return getTableList({
  161. pageNum: page,
  162. size: limit,
  163. status: 2,
  164. ...where
  165. }).then((res) => {
  166. this.current = res.list.find((item) => item.planCode == this.radio);
  167. this.list = res.list;
  168. return res;
  169. });
  170. },
  171. /* 刷新表格 */
  172. reload(where) {
  173. this.$refs.table.reload({ pageNum: 1, where: where });
  174. },
  175. handleNodeClick(data, node) {
  176. this.curNodeData = data;
  177. this.reload({ categoryLevelId: data.planCode });
  178. },
  179. // 单击获取id
  180. cellClick(row) {
  181. this.current = row;
  182. this.radio = row.planCode;
  183. },
  184. handleClose() {
  185. this.visible = false;
  186. this.current = null;
  187. this.radio = '';
  188. },
  189. //获取状态
  190. getStatus(status) {
  191. return status == 0
  192. ? '未提交'
  193. : status == 1
  194. ? '审核中'
  195. : status == 2
  196. ? '审核通过'
  197. : status == 3
  198. ? '审核不通过'
  199. : '';
  200. },
  201. selected() {
  202. if (!this.current) {
  203. return this.$message.warning('请至少选择一条数据');
  204. }
  205. this.$emit('changeInquiryManageList', this.current);
  206. this.handleClose();
  207. }
  208. }
  209. };
  210. </script>
  211. <style lang="scss" scoped>
  212. .tree_col {
  213. border: 1px solid #eee;
  214. padding: 10px 0;
  215. box-sizing: border-box;
  216. height: 500px;
  217. overflow: auto;
  218. }
  219. .table_col {
  220. padding-left: 10px;
  221. ::v-deep .el-table th.el-table__cell {
  222. background: #f2f2f2;
  223. }
  224. }
  225. .pagination {
  226. text-align: right;
  227. padding: 10px 0;
  228. }
  229. .btns {
  230. text-align: center;
  231. padding: 10px 0;
  232. }
  233. .topsearch {
  234. margin-bottom: 15px;
  235. }
  236. </style>