orderList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <!-- 【单证】 订单数据 -->
  3. <div id="orderList">
  4. <a-card :bordered="false">
  5. <!-- 查询区域 -->
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="订单号">
  11. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="订单日期">
  16. <a-date-picker
  17. style="width: 100%"
  18. format="YYYY-MM-DD"
  19. v-model="queryParam.orderDate"
  20. placeholder="请选择订单日期"
  21. @change="onDateChange"
  22. ></a-date-picker>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="6" :sm="8">
  26. <a-form-item label="客户简称">
  27. <a-input placeholder="请输入客户简称" v-model="queryParam.customerAbbreviation"></a-input>
  28. </a-form-item>
  29. </a-col>
  30. <template v-if="toggleSearchStatus">
  31. <a-col :md="6" :sm="8">
  32. <a-form-item label="账套">
  33. <a-input placeholder="请输入账套" v-model="queryParam.account"></a-input>
  34. </a-form-item>
  35. </a-col>
  36. <a-col :md="6" :sm="8">
  37. <a-form-item label="发货状态">
  38. <a-select placeholder="请选择发货状态" v-model="queryParam.dilivery">
  39. <a-select-option value="">请选择</a-select-option>
  40. <a-select-option value="0">未发货</a-select-option>
  41. <a-select-option value="1">已发货</a-select-option>
  42. </a-select>
  43. </a-form-item>
  44. </a-col>
  45. </template>
  46. <a-col :md="6" :sm="8">
  47. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  48. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  49. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  50. <a @click="handleToggleSearch" style="margin-left: 8px">
  51. {{ toggleSearchStatus ? '收起' : '展开' }}
  52. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  53. </a>
  54. </span>
  55. </a-col>
  56. </a-row>
  57. </a-form>
  58. </div>
  59. </a-card>
  60. <!-- 操作按钮区域 -->
  61. <a-card :bordered="false" style="marginTop:10px;">
  62. <div class="table-operator">
  63. <a-button type="primary" @click="synchronization" icon="reload">同步</a-button>
  64. </div>
  65. <!-- 主表信息 rowKey="id" :pagination="ipagination" -->
  66. <div>
  67. <a-table
  68. bordered
  69. :row-key="record => record.id"
  70. :columns="orderLIstColumns"
  71. :data-source="orderListData"
  72. :loading="loading"
  73. :pagination="pagination"
  74. :scroll="{ x: 1500 }"
  75. @change="handleTableChange"
  76. >
  77. <!-- 订单号 链接-->
  78. <span slot="orderNumber" slot-scope="text">
  79. <a>{{ text }}</a>
  80. </span>
  81. </a-table>
  82. </div>
  83. </a-card>
  84. <!-- 订单数据明细 抽屉 -->
  85. <orderDetail-drawer ref="orderDetailDrawer" @ok="modalFormOk"></orderDetail-drawer>
  86. </div>
  87. </template>
  88. <script>
  89. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  90. import JEllipsis from '@/components/jeecg/JEllipsis'
  91. import moment from 'moment'
  92. import OrderDetailDrawer from '@views/order/orderDetailDrawer.vue'
  93. import { orderList, orderByNum } from '@api/document/order'
  94. export default {
  95. name: 'OrderList', // 【单证】 订单数据
  96. mixins: [JeecgListMixin],
  97. components: { JEllipsis, moment, OrderDetailDrawer },
  98. data() {
  99. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  100. // sorter: true, table表头排序
  101. return {
  102. // 表头
  103. orderLIstColumns: [
  104. {
  105. title: '订单号',
  106. width: 140,
  107. dataIndex: 'orderNumber',
  108. fixed: 'left',
  109. className: 'replacecolor',
  110. customCell: this.showDrawer,
  111. scopedSlots: { customRender: 'orderNumber' }
  112. },
  113. {
  114. title: '订单日期',
  115. width: 120,
  116. dataIndex: 'orderDate',
  117. fixed: 'left',
  118. customRender: text => {
  119. return moment(text).format('YYYY-MM-DD')
  120. },
  121. className: 'replacecolor'
  122. },
  123. { title: '业务类型', width: 120, dataIndex: 'businessTypeValue', className: 'replacecolor' },
  124. { title: '客户订单', width: 120, dataIndex: 'customerOrderNumber', className: 'replacecolor' },
  125. {
  126. title: '销售类型',
  127. width: 120,
  128. dataIndex: 'salesTypeValue',
  129. className: 'replacecolor'
  130. },
  131. { title: '客户简称', width: 150, dataIndex: 'customerAbbreviation', className: 'replacecolor' },
  132. { title: '客户名称', width: 120, dataIndex: 'customerName', className: 'replacecolor' },
  133. { title: '供应商', width: 120, dataIndex: 'supplier', className: 'replacecolor' },
  134. { title: '汇率', width: 90, dataIndex: 'exchangeRate', className: 'replacecolor' },
  135. { title: '整单合计', width: 120, dataIndex: 'wholeOrderTotal', className: 'replacecolor' },
  136. { title: '销售部门', width: 120, dataIndex: 'salesDepartment', className: 'replacecolor' },
  137. { title: '业务员', width: 120, dataIndex: 'salesman', className: 'replacecolor' },
  138. { title: '币种', width: 120, dataIndex: 'currencyValue', className: 'replacecolor' },
  139. { title: '品牌方', width: 120, dataIndex: 'brandSide', className: 'replacecolor' },
  140. { title: '第三方', width: 120, dataIndex: 'thirdParty', className: 'replacecolor' },
  141. { title: '定金比例(%)', width: 120, dataIndex: 'depositRatio', className: 'replacecolor' },
  142. { title: '定金', width: 120, dataIndex: 'deposit', className: 'replacecolor' },
  143. { title: '协同路线', width: 120, dataIndex: 'collaborativeRoute', className: 'replacecolor' },
  144. { title: '付款条件', width: 180, dataIndex: 'termOfPayment', className: 'replacecolor' },
  145. { title: '最终客户', width: 120, dataIndex: 'endCustomer', className: 'replacecolor' },
  146. {
  147. title: '订单备注',
  148. width: 180,
  149. dataIndex: 'orderRemarks',
  150. customRender: t => ellipsis(t),
  151. className: 'replacecolor',
  152. scopedSlots: { customRender: 'orderRemarks' }
  153. },
  154. {
  155. title: '价格备注',
  156. width: 120,
  157. dataIndex: 'priceRemarks',
  158. customRender: t => ellipsis(t),
  159. className: 'replacecolor',
  160. scopedSlots: { customRender: 'priceRemarks' }
  161. },
  162. {
  163. title: '订单变更说明',
  164. width: 180,
  165. dataIndex: 'orderChangeDescription',
  166. fixed: 'right',
  167. customRender: t => ellipsis(t),
  168. className: 'replacecolor',
  169. scopedSlots: { customRender: 'orderChangeDescription' }
  170. }
  171. ],
  172. orderListData: [], // 主表信息
  173. loading: false, // 表格加载
  174. // 查询条件
  175. queryParam: {
  176. orderNumber: '',
  177. orderDate: '',
  178. customerAbbreviation: '',
  179. account: '',
  180. dilivery: '',
  181. pageNo: '' // 初始页
  182. },
  183. // 分页
  184. pagination: {
  185. // total: '',
  186. // current: 0,
  187. // pageSize: 0
  188. }
  189. }
  190. },
  191. created() {
  192. this.getOrderList()
  193. },
  194. methods: {
  195. // 订单数据查询
  196. getOrderList() {
  197. this.$nextTick(() => {
  198. orderList(this.queryParam).then(res => {
  199. if (res.success) {
  200. this.orderListData = res.result.records
  201. console.log('订单数据列表', this.orderListData)
  202. this.pagination = {
  203. total: res.result.total,
  204. current: res.result.current,
  205. pageSize: res.result.size
  206. }
  207. }
  208. })
  209. })
  210. },
  211. // 查询按钮
  212. searchQuery() {
  213. this.getOrderList()
  214. console.log('发货状态', this.queryParam.dilivery)
  215. },
  216. searchReset() {
  217. // console.log('>>>>重置')
  218. this.queryParam = {}
  219. this.getOrderList()
  220. },
  221. // 【订单号】 抽屉
  222. showDrawer(record) {
  223. return {
  224. on: {
  225. click: event => {
  226. console.log('点击的订单号', record.orderNumber)
  227. this.$refs.orderDetailDrawer.visible = true
  228. // 子表信息获取
  229. orderByNum({ orderNumber: record.orderNumber }).then(res => {
  230. if (res.success) {
  231. console.log('子表详情', res.result)
  232. // 子表信息赋值
  233. this.$refs.orderDetailDrawer.childData = res.result
  234. console.log('主表信息', record)
  235. this.$refs.orderDetailDrawer.orderDetail = record
  236. }
  237. })
  238. }
  239. }
  240. }
  241. },
  242. // 查询条件 订单日期转换成字符串并赋值
  243. onDateChange(value, dateString) {
  244. // console.log('订单日期', dateString)
  245. this.queryParam.orderDate = dateString
  246. },
  247. // 同步
  248. synchronization() {
  249. console.log('订单数据--同步');
  250. },
  251. // 分页变化时触发
  252. handleTableChange(pagination, filters, sorter) {
  253. console.log('分页器信息', pagination)
  254. if (Object.keys(sorter).length > 0) {
  255. this.isorter.column = sorter.field
  256. this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
  257. }
  258. this.queryParam.pageNo = pagination.current
  259. this.getOrderList() //重新渲染
  260. }
  261. },
  262. computed: {},
  263. mounted() {}
  264. }
  265. </script>
  266. <style lang="less" scoped>
  267. @import '~@assets/less/common.less';
  268. @import '~@assets/less/overwriter.less';
  269. /deep/ .ant-table-thead > tr > th {
  270. text-align: center;
  271. // font-weight: 700;
  272. }
  273. /deep/ .ant-table-tbody {
  274. text-align: center;
  275. }
  276. // /deep/ th.replacecolor {
  277. // background-color: #ccc;
  278. // }
  279. </style>