orderList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. c<template>
  2. <!-- 【单证】 订单数据 -->
  3. <a-spin :spinning="spinIsShow" >
  4. <div id="orderList">
  5. <a-card :bordered="false">
  6. <!-- 查询区域 -->
  7. <div class="table-page-search-wrapper">
  8. <a-form layout="inline" @keyup.enter.native="searchQuery">
  9. <a-row :gutter="24">
  10. <a-col :md="6" :sm="8">
  11. <a-form-item label="账套">
  12. <j-search-select-tag
  13. placeholder="请选择账套"
  14. v-model="queryParam.account"
  15. dict="view_account,account,account">
  16. </j-search-select-tag>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="订单号">
  21. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-item label="订单日期">
  26. <a-range-picker
  27. style="width: 100%"
  28. :mode="dataRangeMode"
  29. :placeholder="['开始日期', '结束日期']"
  30. :value="dateRange"
  31. format = "YYYY-MM-DD"
  32. @change="dateRangeSelectChange"
  33. />
  34. </a-form-item>
  35. </a-col>
  36. <template v-if="toggleSearchStatus">
  37. <a-col :md="6" :sm="8">
  38. <a-form-item label="客户简称">
  39. <j-search-select-tag
  40. placeholder="请选择客户简称"
  41. v-model="queryParam.customerAbbreviation"
  42. dict="view_customer,customername,customername">
  43. </j-search-select-tag>
  44. </a-form-item>
  45. </a-col>
  46. <a-col :md="6" :sm="8">
  47. <a-form-item label="发货状态">
  48. <a-select placeholder="请选择发货状态" v-model="queryParam.dilivery">
  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. <a-col :md="6" :sm="8">
  56. <a-form-item label="成品/面辅料">
  57. <a-select placeholder="请选择" v-model="queryParam.isProduct">
  58. <a-select-option value="">请选择</a-select-option>
  59. <a-select-option value="0">成品</a-select-option>
  60. <a-select-option value="1">面辅料</a-select-option>
  61. </a-select>
  62. </a-form-item>
  63. </a-col>
  64. <a-col :md="6" :sm="8">
  65. <a-form-item label="部门">
  66. <a-input placeholder="请输入部门" v-model="queryParam.salesDepartment"></a-input>
  67. </a-form-item>
  68. </a-col>
  69. <a-col :md="6" :sm="8">
  70. <a-form-item label="业务员">
  71. <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input>
  72. </a-form-item>
  73. </a-col>
  74. </template>
  75. <a-col :md="6" :sm="8">
  76. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  77. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  78. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  79. <a @click="handleToggleSearch" style="margin-left: 8px">
  80. {{ toggleSearchStatus ? '收起' : '展开' }}
  81. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  82. </a>
  83. </span>
  84. </a-col>
  85. </a-row>
  86. </a-form>
  87. </div>
  88. </a-card>
  89. <!-- 操作按钮区域 -->
  90. <a-card :bordered="false" style="marginTop:10px;">
  91. <div class="table-operator">
  92. <a-row :gutter="24">
  93. <a-col :md="6" :sm="8">
  94. <a-input placeholder="请输入" v-model="dingDan"></a-input>
  95. </a-col>
  96. <a-button type="primary" @click="synchronizationOne" icon="reload" style="margin-right:3%">单条同步</a-button>
  97. <a-button type="primary" @click="synchronization" icon="reload">全量同步</a-button>
  98. </a-row>
  99. </div>
  100. <!-- 主表信息 rowKey="id" :pagination="ipagination" -->
  101. <div>
  102. <a-table
  103. bordered
  104. :row-key="record => record.id"
  105. :columns="orderLIstColumns"
  106. :data-source="orderListData"
  107. :loading="loading"
  108. :pagination="pagination"
  109. :scroll="{ x: 1500 }"
  110. @change="handleTableChange"
  111. >
  112. <!-- 订单号 链接-->
  113. <span slot="orderNumber" slot-scope="text">
  114. <a>{{ text }}</a>
  115. </span>
  116. </a-table>
  117. </div>
  118. </a-card>
  119. <!-- 订单数据明细 抽屉 -->
  120. <orderDetail-drawer ref="orderDetailDrawer" :fatherList="getOrderList" @ok="modalFormOk"></orderDetail-drawer>
  121. </div>
  122. </a-spin>
  123. </template>
  124. <script>
  125. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  126. import JEllipsis from '@/components/jeecg/JEllipsis'
  127. import moment from 'moment'
  128. import OrderDetailDrawer from '@views/order/orderDetailDrawer.vue'
  129. import { orderList, syncy,oneSyncy } from '@api/document/order'
  130. export default {
  131. name: 'OrderList', // 【单证】 订单数据
  132. mixins: [JeecgListMixin],
  133. components: { JEllipsis, moment, OrderDetailDrawer },
  134. data() {
  135. // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  136. // sorter: true, table表头排序
  137. return {
  138. // 表头
  139. orderLIstColumns: [
  140. {
  141. title: '账套',
  142. width: 80,
  143. dataIndex: 'account',
  144. fixed: 'left',
  145. className: 'replacecolor',
  146. align: 'center',
  147. ellipsis: true
  148. },
  149. {
  150. title: '订单号',
  151. width: 260,
  152. dataIndex: 'orderNumber',
  153. fixed: 'left',
  154. className: 'replacecolor',
  155. align: 'left',
  156. customCell: this.showDrawer,
  157. scopedSlots: { customRender: 'orderNumber' },
  158. ellipsis: true
  159. },
  160. {
  161. title: '订单日期',
  162. width: 120,
  163. dataIndex: 'orderDate',
  164. fixed: 'left',
  165. customRender: text => {
  166. return moment(text).format('YYYY-MM-DD')
  167. },
  168. className: 'replacecolor',
  169. },
  170. { title: '业务类型', width: 100, dataIndex: 'businessTypeValue', className: 'replacecolor' ,ellipsis: true},
  171. { title: '客户订单号', width: 120, dataIndex: 'customerOrderNumber', className: 'replacecolor',ellipsis: true },
  172. {
  173. title: '销售类型',
  174. width: 100,
  175. dataIndex: 'salesTypeText',
  176. className: 'replacecolor'
  177. },
  178. { title: '客户简称', width: 220, dataIndex: 'customerAbbreviation', align: 'left', className: 'replacecolor',ellipsis: true },
  179. { title: '客户名称', width: 220, dataIndex: 'customerName', align: 'left', className: 'replacecolor', ellipsis: true, },
  180. { title: '供应商', width: 120, dataIndex: 'supplier', className: 'replacecolor' ,ellipsis: true},
  181. { title: '汇率', width: 90, dataIndex: 'exchangeRate', className: 'replacecolor' ,ellipsis: true},
  182. { title: '整单合计', width: 120, dataIndex: 'wholeOrderTotal', className: 'replacecolor' ,ellipsis: true},
  183. { title: '销售部门', width: 100, dataIndex: 'salesDepartment', className: 'replacecolor' ,ellipsis: true},
  184. { title: '业务员', width: 140, dataIndex: 'salesman', className: 'replacecolor' ,ellipsis: true},
  185. { title: '币种', width: 90, dataIndex: 'currencyText', className: 'replacecolor',ellipsis: true },
  186. { title: '品牌方', width: 220, dataIndex: 'brandSide', align: 'left', className: 'replacecolor',ellipsis: true },
  187. { title: '第三方', width: 220, dataIndex: 'thirdParty', align: 'left', className: 'replacecolor',ellipsis: true },
  188. { title: '定金比例(%)', width: 120, dataIndex: 'depositRatio', className: 'replacecolor',ellipsis: true },
  189. { title: '定金', width: 100, dataIndex: 'deposit', className: 'replacecolor',ellipsis: true },
  190. { title: '协同路线', width: 160, dataIndex: 'collaborativeRoute', className: 'replacecolor',ellipsis: true },
  191. { title: '付款条件', width: 180, dataIndex: 'termOfPayment', className: 'replacecolor' ,ellipsis: true},
  192. { title: '最终客户', width: 120, dataIndex: 'endCustomer', className: 'replacecolor', ellipsis: true, },
  193. {
  194. title: '订单备注',
  195. width: 220,
  196. dataIndex: 'orderRemarks',
  197. // customRender: t => ellipsis(t),
  198. className: 'replacecolor',
  199. scopedSlots: { customRender: 'orderRemarks' },
  200. ellipsis: true
  201. },
  202. {
  203. title: '价格备注',
  204. width: 120,
  205. dataIndex: 'priceRemarks',
  206. // customRender: t => ellipsis(t),
  207. className: 'replacecolor',
  208. scopedSlots: { customRender: 'priceRemarks' },
  209. ellipsis: true
  210. },
  211. {
  212. title: '订单变更说明',
  213. width: 220,
  214. dataIndex: 'orderChangeDescription',
  215. fixed: 'right',
  216. // customRender: t => ellipsis(t),
  217. className: 'replacecolor',
  218. scopedSlots: { customRender: 'orderChangeDescription' },
  219. ellipsis: true
  220. }
  221. ],
  222. orderListData: [], // 主表信息
  223. loading: false, // 表格加载
  224. queryParam: {
  225. orderNumber: '',
  226. orderDate: '',
  227. customerAbbreviation: '',
  228. account: '',
  229. dilivery: '',
  230. isProduct: '', // 客户需求新增
  231. salesDepartment: '',//部门
  232. salesman:'',//业务员
  233. pageNo: '' // 初始页
  234. },
  235. dingDan:'',//单条同步订单号
  236. pagination: {
  237. // total: '',
  238. // current: 0,
  239. // pageSize: 0
  240. },
  241. dateRange:[],
  242. dataRangeMode:['date','date'],
  243. spinDelayMS:500, // 加载框延迟时间
  244. spinIsShow:false, // 加载框是否显示
  245. }
  246. },
  247. created() {
  248. this.getOrderList()
  249. },
  250. methods: {
  251. // 分页查询
  252. getOrderList() {
  253. var that = this;
  254. // that.spinIsShow = true;
  255. this.loading = true
  256. this.$nextTick(() => {
  257. orderList(this.queryParam).then(res => {
  258. // that.spinIsShow = false;
  259. this.loading = false
  260. if (res.success) {
  261. that.orderListData = res.result.records;
  262. that.pagination = {
  263. total: res.result.total,
  264. current: res.result.current,
  265. pageSize: res.result.size
  266. }
  267. }else{
  268. that.$message.error(res.message);
  269. }
  270. })
  271. })
  272. },
  273. // 同步
  274. synchronization() {
  275. this.$nextTick(() => {
  276. var id = "1570672855704420354"
  277. this.loading = true
  278. syncy({id}).then(res => {
  279. if (res.success) {
  280. this.getOrderList();
  281. this.$message.success('同步成功')
  282. }else{
  283. this.$message.error(res.message)
  284. }
  285. })
  286. })
  287. },
  288. //单条同步
  289. synchronizationOne(){
  290. this.$nextTick(() => {
  291. var parameter = this.dingDan
  292. this.loading = true
  293. oneSyncy({parameter}).then(res => {
  294. if (res.success) {
  295. this.loading =false
  296. this.queryParam.orderNumber = this.dingDan
  297. this.getOrderList();
  298. this.$message.success(res.message)
  299. }else{
  300. this.$message.error(res.message)
  301. }
  302. })
  303. })
  304. },
  305. // 【订单号】 抽屉
  306. showDrawer(record) {
  307. return {
  308. on: {
  309. click: event => {
  310. this.$refs.orderDetailDrawer.visible = true
  311. this.$refs.orderDetailDrawer.record = record // 接口参数
  312. this.$refs.orderDetailDrawer.getOrderChild()
  313. this.$refs.orderDetailDrawer.orderDetail = record // 详情页主表赋值
  314. }
  315. }
  316. }
  317. },
  318. // 查询按钮
  319. searchQuery() {
  320. this.queryParam.pageNo = ''
  321. this.toggleSearchStatus = false
  322. this.getOrderList()
  323. // console.log('发货状态', this.queryParam.dilivery)
  324. },
  325. searchReset() {
  326. this.queryParam = {}
  327. this.getOrderList()
  328. },
  329. // 查询条件 订单日期转换成字符串并赋值
  330. onDateChange(value, dateString) {
  331. this.queryParam.orderDate = dateString
  332. },
  333. handleTableChange(pagination, filters, sorter) {
  334. this.queryParam.pageNo = pagination.current
  335. this.getOrderList()
  336. },
  337. // 时间发生变化的回调,发生在用户选择时间时
  338. dateRangeSelectChange(value) {
  339. this.dateRange = value;
  340. if (value.length == 0){
  341. this.queryParam.dateStar = "";
  342. this.queryParam.dateEnd = "";
  343. }else{
  344. this.queryParam.dateStar = value[0].format('YYYY-MM-DD');
  345. this.queryParam.dateEnd = value[1].format('YYYY-MM-DD');
  346. }
  347. },
  348. },
  349. computed: {},
  350. mounted() {}
  351. }
  352. </script>
  353. <style lang="less" scoped>
  354. @import '~@assets/less/common.less';
  355. @import '~@assets/less/overwriter.less';
  356. /deep/ .ant-table-thead > tr > th {
  357. text-align: center;
  358. // font-weight: 700;
  359. }
  360. /deep/ .ant-table-tbody {
  361. text-align: center;
  362. }
  363. // /deep/ th.replacecolor {
  364. // background-color: #ccc;
  365. // }
  366. </style>