orderList.vue 11 KB

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