orderListDialog.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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="70%"
  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 { contactTypeTree } from '@/api/saleManage/contact';
  40. import searchTable from './components/searchTable.vue';
  41. import { getTableList } from '@/api/saleManage/saleorder';
  42. import AssetTree from '@/components/AssetTree';
  43. export default {
  44. components: {
  45. AssetTree,
  46. searchTable
  47. },
  48. props: {
  49. contactData: {
  50. type: Object,
  51. default: () => {
  52. return {};
  53. }
  54. }
  55. },
  56. data() {
  57. return {
  58. visible: false,
  59. currentIndex: null,
  60. columns: [
  61. {
  62. columnKey: 'index',
  63. label: '序号',
  64. type: 'index',
  65. width: 55,
  66. align: 'center',
  67. showOverflowTooltip: true,
  68. fixed: 'left'
  69. },
  70. {
  71. action: 'action',
  72. slot: 'action',
  73. align: 'center',
  74. label: '选择'
  75. },
  76. {
  77. prop: 'orderNo',
  78. label: '订单编码',
  79. align: 'center',
  80. slot: 'orderNo',
  81. showOverflowTooltip: true,
  82. minWidth: 200
  83. },
  84. {
  85. prop: 'contractName',
  86. label: '合同名称',
  87. align: 'center',
  88. slot: 'contractName',
  89. showOverflowTooltip: true,
  90. minWidth: 200
  91. },
  92. {
  93. prop: 'deliveryDate',
  94. label: '交货日期',
  95. align: 'center',
  96. showOverflowTooltip: true,
  97. minWidth: 200
  98. },
  99. {
  100. prop: 'saleTypeName',
  101. label: '销售类型',
  102. align: 'center',
  103. showOverflowTooltip: true,
  104. minWidth: 140
  105. },
  106. {
  107. prop: 'partaName',
  108. label: '客户名称',
  109. align: 'center',
  110. showOverflowTooltip: true,
  111. minWidth: 180
  112. },
  113. {
  114. prop: 'partaLinkName',
  115. label: '客户联系人',
  116. align: 'center',
  117. showOverflowTooltip: true,
  118. minWidth: 130
  119. },
  120. {
  121. prop: 'partaTel',
  122. label: '客户联系电话',
  123. align: 'center',
  124. showOverflowTooltip: true,
  125. minWidth: 130
  126. },
  127. {
  128. prop: 'partbName',
  129. label: '售出方名称',
  130. align: 'center',
  131. showOverflowTooltip: true,
  132. minWidth: 130
  133. },
  134. {
  135. prop: 'partbLinkName',
  136. label: '售出方联系人',
  137. align: 'center',
  138. showOverflowTooltip: true,
  139. minWidth: 130
  140. },
  141. {
  142. prop: 'partbTel',
  143. label: '售出方联系电话',
  144. align: 'center',
  145. showOverflowTooltip: true,
  146. minWidth: 130
  147. },
  148. {
  149. prop: 'payAmount',
  150. label: '应付金额(元)',
  151. align: 'center',
  152. showOverflowTooltip: true,
  153. minWidth: 170
  154. },
  155. {
  156. prop: 'createTime',
  157. label: '创建时间',
  158. align: 'center',
  159. showOverflowTooltip: true,
  160. minWidth: 170
  161. }
  162. ],
  163. radio: null
  164. };
  165. },
  166. methods: {
  167. open(item, currentIndex) {
  168. this.currentIndex = currentIndex;
  169. if (item && item.id) {
  170. this.radio = item.id;
  171. }
  172. this.visible = true;
  173. },
  174. /* 表格数据源 */
  175. datasource({ page, limit, where, order }) {
  176. if (this.contactData.id) {
  177. where['contactId'] = this.contactData.id;
  178. }
  179. return getTableList({
  180. pageNum: page,
  181. size: limit,
  182. ...where
  183. });
  184. },
  185. /* 刷新表格 */
  186. reload(where) {
  187. this.$refs.table.reload({ pageNum: 1, where: where });
  188. },
  189. handleNodeClick(data, node) {
  190. this.reload({ categoryId: data.id });
  191. },
  192. // 单击获取id
  193. cellClick(row) {
  194. this.current = row;
  195. console.log(row);
  196. this.radio = row.id;
  197. },
  198. handleClose() {
  199. this.visible = false;
  200. this.current = null;
  201. this.radio = '';
  202. },
  203. selected() {
  204. if (!this.current) {
  205. return this.$message.warning('请至少选择一条数据');
  206. }
  207. this.$emit('changeParent', this.current, this.currentIndex);
  208. this.handleClose();
  209. }
  210. }
  211. };
  212. </script>
  213. <style lang="scss" scoped>
  214. .tree_col {
  215. border: 1px solid #eee;
  216. padding: 10px 0;
  217. box-sizing: border-box;
  218. height: 500px;
  219. overflow: auto;
  220. }
  221. .table_col {
  222. padding-left: 10px;
  223. ::v-deep .el-table th.el-table__cell {
  224. background: #f2f2f2;
  225. }
  226. }
  227. .pagination {
  228. text-align: right;
  229. padding: 10px 0;
  230. }
  231. .btns {
  232. text-align: center;
  233. padding: 10px 0;
  234. }
  235. .topsearch {
  236. margin-bottom: 15px;
  237. }
  238. </style>