orderListDialog.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <el-dialog
  3. title="选择订单"
  4. custom-class="ele-dialog-form long-dialog-form"
  5. :visible.sync="visible"
  6. :before-close="handleClose"
  7. :close-on-click-modal="false"
  8. top="5vh"
  9. :close-on-press-escape="false"
  10. append-to-body
  11. width="80%"
  12. >
  13. <el-card shadow="never">
  14. <searchTable @search="reload"></searchTable>
  15. <ele-pro-table
  16. ref="table"
  17. :columns="columns"
  18. :datasource="datasource"
  19. row-key="id"
  20. height="calc(100vh - 500px)"
  21. class="dict-table"
  22. @cell-click="cellClick"
  23. >
  24. <!-- 表头工具栏 -->
  25. <template v-slot:action="{ row }">
  26. <el-radio class="radio" v-model="radio" :label="row.id"
  27. ><i></i
  28. ></el-radio>
  29. </template>
  30. </ele-pro-table>
  31. </el-card>
  32. <div class="btns" slot="footer">
  33. <el-button type="primary" size="small" @click="selected">选择</el-button>
  34. <el-button size="small" @click="handleClose">关闭</el-button>
  35. </div>
  36. </el-dialog>
  37. </template>
  38. <script>
  39. import searchTable from '@/views/purchasingManage/purchaseOrder/components/searchTable.vue';
  40. import { getTableList } from '@/api/purchasingManage/purchaseOrder';
  41. export default {
  42. components: {
  43. searchTable
  44. },
  45. data() {
  46. return {
  47. visible: false,
  48. currentIndex: null,
  49. columns: [
  50. {
  51. columnKey: 'index',
  52. label: '序号',
  53. type: 'index',
  54. width: 55,
  55. align: 'center',
  56. showOverflowTooltip: true,
  57. fixed: 'left'
  58. },
  59. {
  60. width: 60,
  61. type: 'action',
  62. slot: 'action',
  63. label: '选择',
  64. columnKey: 'action',
  65. align: 'center'
  66. },
  67. {
  68. prop: 'orderNo',
  69. label: '订单编码',
  70. align: 'center',
  71. slot: 'orderNo',
  72. showOverflowTooltip: true,
  73. minWidth: 200
  74. },
  75. {
  76. prop: 'contractName',
  77. label: '合同名称',
  78. align: 'center',
  79. slot: 'contractName',
  80. showOverflowTooltip: true,
  81. minWidth: 200
  82. },
  83. // {
  84. // prop: 'deliveryDate',
  85. // label: '交货日期',
  86. // align: 'center',
  87. // showOverflowTooltip: true,
  88. // minWidth: 200
  89. // },
  90. {
  91. prop: 'purchaseTypeName',
  92. label: '采购订单类型',
  93. align: 'center',
  94. showOverflowTooltip: true,
  95. minWidth: 140
  96. },
  97. {
  98. prop: 'partaName',
  99. label: '采购方名称',
  100. align: 'center',
  101. showOverflowTooltip: true,
  102. minWidth: 180
  103. },
  104. {
  105. prop: 'partaLinkName',
  106. label: '采购方联系人',
  107. align: 'center',
  108. showOverflowTooltip: true,
  109. minWidth: 130
  110. },
  111. {
  112. prop: 'partaTel',
  113. label: '采购方联系电话',
  114. align: 'center',
  115. showOverflowTooltip: true,
  116. minWidth: 130
  117. },
  118. {
  119. prop: 'partbName',
  120. label: '供应商名称',
  121. align: 'center',
  122. showOverflowTooltip: true,
  123. minWidth: 130
  124. },
  125. {
  126. prop: 'partbLinkName',
  127. label: '供应商联系人',
  128. align: 'center',
  129. showOverflowTooltip: true,
  130. minWidth: 130
  131. },
  132. {
  133. prop: 'partbTel',
  134. label: '供应商联系电话',
  135. align: 'center',
  136. showOverflowTooltip: true,
  137. minWidth: 130
  138. },
  139. {
  140. prop: 'payAmount',
  141. label: '应付金额(元)',
  142. align: 'center',
  143. showOverflowTooltip: true,
  144. minWidth: 170
  145. },
  146. {
  147. prop: 'createTime',
  148. label: '创建时间',
  149. align: 'center',
  150. showOverflowTooltip: true,
  151. minWidth: 170
  152. }
  153. ],
  154. radio: null
  155. };
  156. },
  157. methods: {
  158. open(item, currentIndex) {
  159. this.currentIndex = currentIndex;
  160. if (item && item.id) {
  161. this.radio = item.id;
  162. }
  163. this.visible = true;
  164. },
  165. /* 表格数据源 */
  166. datasource({ page, limit, where, order }) {
  167. return getTableList({
  168. pageNum: page,
  169. size: limit,
  170. ...where,
  171. orderStatus:2
  172. });
  173. },
  174. /* 刷新表格 */
  175. reload(where) {
  176. console.log(where);
  177. this.$refs.table.reload({ pageNum: 1, where: where });
  178. },
  179. handleNodeClick(data, node) {
  180. this.reload({ categoryId: data.id });
  181. },
  182. // 单击获取id
  183. cellClick(row) {
  184. this.current = row;
  185. console.log(row);
  186. this.radio = row.id;
  187. },
  188. handleClose() {
  189. this.visible = false;
  190. this.current = null;
  191. this.radio = '';
  192. },
  193. selected() {
  194. if (!this.current) {
  195. return this.$message.warning('请至少选择一条数据');
  196. }
  197. this.$emit('changeParent', this.current, this.currentIndex);
  198. this.handleClose();
  199. }
  200. }
  201. };
  202. </script>
  203. <style lang="scss" scoped>
  204. .tree_col {
  205. border: 1px solid #eee;
  206. padding: 10px 0;
  207. box-sizing: border-box;
  208. height: 500px;
  209. overflow: auto;
  210. }
  211. .table_col {
  212. padding-left: 10px;
  213. ::v-deep .el-table th.el-table__cell {
  214. background: #f2f2f2;
  215. }
  216. }
  217. .pagination {
  218. text-align: right;
  219. padding: 10px 0;
  220. }
  221. .btns {
  222. text-align: center;
  223. padding: 10px 0;
  224. }
  225. .topsearch {
  226. margin-bottom: 15px;
  227. }
  228. </style>