orderList.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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" -->
  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="ipagination"
  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" :father="aa" @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. pageSize: '-1' // 每页显示条数
  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)
  203. // 分页信息赋值
  204. this.pagination = {
  205. total: res.result.total,
  206. current: res.result.current,
  207. pageSize: res.result.size
  208. }
  209. }
  210. })
  211. })
  212. },
  213. // 查询按钮
  214. searchQuery() {
  215. this.getOrderList()
  216. console.log('发货状态', this.queryParam.dilivery)
  217. },
  218. searchReset() {
  219. // console.log('>>>>重置')
  220. this.queryParam = {}
  221. this.getOrderList()
  222. },
  223. // 【订单号】 抽屉
  224. showDrawer(record) {
  225. return {
  226. on: {
  227. click: event => {
  228. console.log('点击的订单号', record.orderNumber)
  229. this.$refs.orderDetailDrawer.visible = true
  230. // 子表信息获取
  231. orderByNum({ orderNumber: record.orderNumber }).then(res => {
  232. if (res.success) {
  233. console.log('子表详情', res.result)
  234. // 子表信息赋值
  235. this.$refs.orderDetailDrawer.childData = res.result
  236. console.log('主表信息', record)
  237. this.$refs.orderDetailDrawer.orderDetail = record
  238. }
  239. })
  240. }
  241. }
  242. }
  243. },
  244. // 查询条件 订单日期转换成字符串并赋值
  245. onDateChange(value, dateString) {
  246. // console.log('订单日期', dateString)
  247. this.queryParam.orderDate = dateString
  248. },
  249. // 同步
  250. synchronization() {},
  251. // father 抽屉方法
  252. aa() {}
  253. },
  254. computed: {},
  255. mounted() {}
  256. }
  257. </script>
  258. <style lang="less" scoped>
  259. @import '~@assets/less/common.less';
  260. @import '~@assets/less/overwriter.less';
  261. /deep/ .ant-table-thead > tr > th {
  262. text-align: center;
  263. // font-weight: 700;
  264. }
  265. /deep/ .ant-table-tbody {
  266. text-align: center;
  267. }
  268. // /deep/ th.replacecolor {
  269. // background-color: #ccc;
  270. // }
  271. </style>