outSourceSendDialog.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <el-dialog
  3. title="选择委外发货单"
  4. custom-class="ele-dialog-form long-dialog-form"
  5. :visible.sync="outSourceSendDialogFlag"
  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 './outSourceSearchTable.vue';
  40. import {getPurchaseOutSourceSendPageAPI} from "@/api/bpm/components/purchasingManage/outSourceSend";
  41. export default {
  42. components: {
  43. searchTable
  44. },
  45. props: {
  46. searchParams: {
  47. type: Object,
  48. default: () => {
  49. }
  50. },
  51. outSourceSendDialogFlag: Boolean
  52. },
  53. data() {
  54. return {
  55. currentIndex: null,
  56. columns: [
  57. {
  58. columnKey: 'index',
  59. label: '序号',
  60. type: 'index',
  61. width: 55,
  62. align: 'center',
  63. showOverflowTooltip: true,
  64. fixed: 'left'
  65. },
  66. {
  67. width: 60,
  68. type: 'action',
  69. slot: 'action',
  70. label: '选择',
  71. columnKey: 'action',
  72. align: 'center'
  73. },
  74. {
  75. prop: 'code',
  76. label: '发货单编码',
  77. align: 'center',
  78. slot: 'code',
  79. showOverflowTooltip: true,
  80. minWidth: 200
  81. },
  82. {
  83. prop: 'orderNo',
  84. label: '订单编码',
  85. align: 'center',
  86. slot: 'orderNo',
  87. showOverflowTooltip: true,
  88. minWidth: 200
  89. },
  90. {
  91. prop: 'sourceTypeName',
  92. label: '订单类型',
  93. align: 'center',
  94. showOverflowTooltip: true,
  95. minWidth: 140
  96. },
  97. {
  98. prop: 'supplierName',
  99. label: '供应商名称',
  100. align: 'center',
  101. showOverflowTooltip: true,
  102. minWidth: 130
  103. },
  104. {
  105. prop: 'linkName',
  106. label: '供应商联系人',
  107. align: 'center',
  108. showOverflowTooltip: true,
  109. minWidth: 130
  110. },
  111. {
  112. prop: 'linkPhone',
  113. label: '供应商联系电话',
  114. align: 'center',
  115. showOverflowTooltip: true,
  116. minWidth: 130
  117. }
  118. ],
  119. radio: null
  120. };
  121. },
  122. methods: {
  123. init() {},
  124. /* 表格数据源 */
  125. datasource({page, limit, where}) {
  126. return getPurchaseOutSourceSendPageAPI({
  127. pageNum: page,
  128. size: limit,
  129. ...where,
  130. reviewStatus: 2,
  131. ...this.searchParams
  132. });
  133. },
  134. /* 刷新表格 */
  135. reload(where) {
  136. where = {
  137. ...where,
  138. ...this.searchParams
  139. }
  140. this.$refs.table.reload({pageNum: 1, where: where});
  141. },
  142. // 单击获取id
  143. cellClick(row) {
  144. this.current = row;
  145. this.radio = row.id;
  146. },
  147. handleClose() {
  148. this.$emit('update:outSourceSendDialogFlag', false)
  149. },
  150. selected() {
  151. if (!this.current) {
  152. return this.$message.warning('请至少选择一条数据');
  153. }
  154. this.$emit('changeParent', this.current, this.currentIndex);
  155. this.handleClose();
  156. }
  157. }
  158. };
  159. </script>
  160. <style lang="scss" scoped>
  161. .tree_col {
  162. border: 1px solid #eee;
  163. padding: 10px 0;
  164. box-sizing: border-box;
  165. height: 500px;
  166. overflow: auto;
  167. }
  168. .table_col {
  169. padding-left: 10px;
  170. ::v-deep .el-table th.el-table__cell {
  171. background: #f2f2f2;
  172. }
  173. }
  174. .pagination {
  175. text-align: right;
  176. padding: 10px 0;
  177. }
  178. .btns {
  179. text-align: center;
  180. padding: 10px 0;
  181. }
  182. .topsearch {
  183. margin-bottom: 15px;
  184. }
  185. </style>