orderList.vue 10 KB

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