orderList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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" :fatherList="getOrderList" @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: 180,
  107. dataIndex: 'orderNumber',
  108. fixed: 'left',
  109. className: 'replacecolor',
  110. // customRender: t => ellipsis(t),
  111. customCell: this.showDrawer,
  112. scopedSlots: { customRender: 'orderNumber' }
  113. },
  114. {
  115. title: '订单日期',
  116. width: 120,
  117. dataIndex: 'orderDate',
  118. fixed: 'left',
  119. customRender: text => {
  120. return moment(text).format('YYYY-MM-DD')
  121. },
  122. className: 'replacecolor'
  123. },
  124. { title: '业务类型', width: 120, dataIndex: 'businessTypeValue', className: 'replacecolor' },
  125. { title: '客户订单', width: 120, dataIndex: 'customerOrderNumber', className: 'replacecolor' },
  126. {
  127. title: '销售类型',
  128. width: 120,
  129. dataIndex: 'salesTypeValue',
  130. className: 'replacecolor'
  131. },
  132. { title: '客户简称', width: 150, dataIndex: 'customerAbbreviation', className: 'replacecolor' },
  133. { title: '客户名称', width: 120, dataIndex: 'customerName', className: 'replacecolor' },
  134. { title: '供应商', width: 120, dataIndex: 'supplier', className: 'replacecolor' },
  135. { title: '汇率', width: 90, dataIndex: 'exchangeRate', className: 'replacecolor' },
  136. { title: '整单合计', width: 120, dataIndex: 'wholeOrderTotal', className: 'replacecolor' },
  137. { title: '销售部门', width: 120, dataIndex: 'salesDepartment', className: 'replacecolor' },
  138. { title: '业务员', width: 120, dataIndex: 'salesman', className: 'replacecolor' },
  139. { title: '币种', width: 120, dataIndex: 'currencyValue', className: 'replacecolor' },
  140. { title: '品牌方', width: 120, dataIndex: 'brandSide', className: 'replacecolor' },
  141. { title: '第三方', width: 120, dataIndex: 'thirdParty', className: 'replacecolor' },
  142. { title: '定金比例(%)', width: 120, dataIndex: 'depositRatio', className: 'replacecolor' },
  143. { title: '定金', width: 120, dataIndex: 'deposit', className: 'replacecolor' },
  144. { title: '协同路线', width: 120, dataIndex: 'collaborativeRoute', className: 'replacecolor' },
  145. { title: '付款条件', width: 180, dataIndex: 'termOfPayment', className: 'replacecolor' },
  146. { title: '最终客户', width: 120, dataIndex: 'endCustomer', className: 'replacecolor' },
  147. {
  148. title: '订单备注',
  149. width: 180,
  150. dataIndex: 'orderRemarks',
  151. customRender: t => ellipsis(t),
  152. className: 'replacecolor',
  153. scopedSlots: { customRender: 'orderRemarks' }
  154. },
  155. {
  156. title: '价格备注',
  157. width: 120,
  158. dataIndex: 'priceRemarks',
  159. customRender: t => ellipsis(t),
  160. className: 'replacecolor',
  161. scopedSlots: { customRender: 'priceRemarks' }
  162. },
  163. {
  164. title: '订单变更说明',
  165. width: 180,
  166. dataIndex: 'orderChangeDescription',
  167. fixed: 'right',
  168. customRender: t => ellipsis(t),
  169. className: 'replacecolor',
  170. scopedSlots: { customRender: 'orderChangeDescription' }
  171. }
  172. ],
  173. orderListData: [], // 主表信息
  174. loading: false, // 表格加载
  175. // 查询条件
  176. queryParam: {
  177. orderNumber: '',
  178. orderDate: '',
  179. customerAbbreviation: '',
  180. account: '',
  181. dilivery: '',
  182. pageNo: '' // 初始页
  183. },
  184. // 分页
  185. pagination: {
  186. // total: '',
  187. // current: 0,
  188. // pageSize: 0
  189. }
  190. }
  191. },
  192. created() {
  193. this.getOrderList()
  194. },
  195. methods: {
  196. // 订单数据查询
  197. getOrderList() {
  198. this.$nextTick(() => {
  199. orderList(this.queryParam).then(res => {
  200. if (res.success) {
  201. this.orderListData = res.result.records
  202. // console.log('订单数据列表', this.orderListData)s
  203. this.pagination = {
  204. total: res.result.total,
  205. current: res.result.current,
  206. pageSize: res.result.size
  207. }
  208. }
  209. })
  210. })
  211. },
  212. // 查询按钮
  213. searchQuery() {
  214. this.getOrderList()
  215. console.log('发货状态', this.queryParam.dilivery)
  216. },
  217. searchReset() {
  218. // console.log('>>>>重置')
  219. this.queryParam = {}
  220. this.getOrderList()
  221. },
  222. // 【订单号】 抽屉
  223. showDrawer(record) {
  224. return {
  225. on: {
  226. click: event => {
  227. // console.log('点击的订单号', record.orderNumber)
  228. this.$refs.orderDetailDrawer.visible = true
  229. this.$refs.orderDetailDrawer.record = record
  230. this.$refs.orderDetailDrawer.getOrderChild()
  231. console.log('---', this.$refs.orderDetailDrawer.record)
  232. console.log('打开订单详情')
  233. // 子表信息获取
  234. // orderByNum({ orderNumber: record.orderNumber }).then(res => {
  235. // if (res.success) {
  236. // // 子表信息赋值
  237. // this.$refs.orderDetailDrawer.childData = res.result.records
  238. // this.$refs.orderDetailDrawer.pagination = {
  239. // total: res.result.total,
  240. // current: res.result.current,
  241. // pageSize: res.result.size
  242. // }
  243. // console.log('childData', this.$refs.orderDetailDrawer.childData)
  244. // console.log(
  245. // '分页信息:',
  246. // this.$refs.orderDetailDrawer.pagination.total,
  247. // this.$refs.orderDetailDrawer.pagination.current,
  248. // this.$refs.orderDetailDrawer.pagination.pageSize
  249. // )
  250. // // console.log('主表信息', record)
  251. // this.$refs.orderDetailDrawer.orderDetail = record
  252. // }
  253. // })
  254. }
  255. }
  256. }
  257. },
  258. // 查询条件 订单日期转换成字符串并赋值
  259. onDateChange(value, dateString) {
  260. // console.log('订单日期', dateString)
  261. this.queryParam.orderDate = dateString
  262. },
  263. // 同步
  264. synchronization() {
  265. console.log('订单数据--同步')
  266. },
  267. // 分页变化时触发
  268. handleTableChange(pagination, filters, sorter) {
  269. console.log('分页器信息', pagination)
  270. if (Object.keys(sorter).length > 0) {
  271. this.isorter.column = sorter.field
  272. this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
  273. }
  274. this.queryParam.pageNo = pagination.current
  275. // console.log('00');
  276. this.getOrderList() //重新渲染
  277. // console.log('\\\\');
  278. }
  279. },
  280. computed: {},
  281. mounted() {}
  282. }
  283. </script>
  284. <style lang="less" scoped>
  285. @import '~@assets/less/common.less';
  286. @import '~@assets/less/overwriter.less';
  287. /deep/ .ant-table-thead > tr > th {
  288. text-align: center;
  289. // font-weight: 700;
  290. }
  291. /deep/ .ant-table-tbody {
  292. text-align: center;
  293. }
  294. // /deep/ th.replacecolor {
  295. // background-color: #ccc;
  296. // }
  297. </style>