orderList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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-page-search-wrapper">
  92. <a-form layout="inline">
  93. <a-row :gutter="24">
  94. <a-col :md="6" :sm="8">
  95. <a-form-item label="账套">
  96. <j-search-select-tag
  97. placeholder="请选择账套"
  98. v-model="account"
  99. dict="view_account,account,account">
  100. </j-search-select-tag>
  101. </a-form-item>
  102. </a-col>
  103. <a-col :md="6" :sm="8">
  104. <a-input placeholder="请输入" v-model="dingDan"></a-input>
  105. </a-col>
  106. <a-button type="primary" @click="synchronizationOne" icon="reload" style="margin-right:3%">单条同步</a-button>
  107. <a-button type="primary" @click="synchronization" icon="reload" style="margin-right:3%">全量同步</a-button>
  108. <a-button type="primary" @click="getManualList" icon="reload">手工匹配订单</a-button>
  109. </a-row>
  110. </a-form>
  111. </div>
  112. <!-- 主表信息 rowKey="id" :pagination="ipagination" -->
  113. <div>
  114. <a-table
  115. bordered
  116. :row-key="record => record.id"
  117. :columns="orderLIstColumns"
  118. :data-source="orderListData"
  119. :loading="loading"
  120. :pagination="pagination"
  121. :scroll="{ x: 1500,y:600 }"
  122. @change="handleTableChange"
  123. >
  124. <span slot="operationSlot" slot-scope="text, record,index">
  125. <a @click="handleDelete(record)" style="color:red;">删除</a>
  126. </span>
  127. <!-- 订单号 链接-->
  128. <span slot="orderNumber" slot-scope="text">
  129. <a>{{ text }}</a>
  130. </span>
  131. </a-table>
  132. </div>
  133. </a-card>
  134. <!-- 订单数据明细 抽屉 -->
  135. <orderDetail-drawer ref="orderDetailDrawer" :fatherList="getOrderList" @ok="modalFormOk"></orderDetail-drawer>
  136. <manualModal ref="manualModal"></manualModal>
  137. </div>
  138. </a-spin>
  139. </template>
  140. <script>
  141. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  142. import JEllipsis from '@/components/jeecg/JEllipsis'
  143. import moment from 'moment'
  144. import OrderDetailDrawer from '@views/order/orderDetailDrawer.vue'
  145. import manualModal from '@views/order/manualModal.vue'
  146. import { orderList, syncy,oneSyncy,deleteOrder} from '@api/document/order'
  147. export default {
  148. name: 'OrderList', // 【单证】 订单数据
  149. mixins: [JeecgListMixin],
  150. components: { JEllipsis, moment, OrderDetailDrawer,manualModal },
  151. data() {
  152. // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  153. // sorter: true, table表头排序
  154. return {
  155. // 表头
  156. orderLIstColumns: [
  157. {
  158. title: '账套',
  159. width: 70,
  160. dataIndex: 'account',
  161. fixed: 'left',
  162. className: 'replacecolor',
  163. align: 'center',
  164. ellipsis: true
  165. },
  166. {
  167. title: '订单号',
  168. width: 200,
  169. dataIndex: 'orderNumber',
  170. fixed: 'left',
  171. className: 'replacecolor',
  172. align: 'left',
  173. customCell: this.showDrawer,
  174. scopedSlots: { customRender: 'orderNumber' },
  175. ellipsis: true
  176. },
  177. {
  178. title: '订单日期',
  179. width: 110,
  180. dataIndex: 'orderDate',
  181. fixed: 'left',
  182. customRender: text => {
  183. return moment(text).format('YYYY-MM-DD')
  184. },
  185. className: 'replacecolor',
  186. },
  187. // { title: '业务类型', width: 100, dataIndex: 'businessTypeValue', className: 'replacecolor' ,ellipsis: true},
  188. { title: '客户订单号', width: 120, dataIndex: 'customerOrderNumber', className: 'replacecolor',ellipsis: true },
  189. // {
  190. // title: '销售类型',
  191. // width: 100,
  192. // dataIndex: 'salesTypeText',
  193. // className: 'replacecolor'
  194. // },
  195. { title: '最终客户', width: 120, dataIndex: 'endCustomer', className: 'replacecolor', ellipsis: true, },
  196. { title: '客户简称', width: 220, dataIndex: 'customerAbbreviation', align: 'left', className: 'replacecolor',ellipsis: true },
  197. // { title: '客户名称', width: 220, dataIndex: 'customerName', align: 'left', className: 'replacecolor', ellipsis: true, },
  198. { title: '供应商', width: 120, dataIndex: 'supplier', className: 'replacecolor' ,ellipsis: true},
  199. // { title: '汇率', width: 90, dataIndex: 'exchangeRate', className: 'replacecolor' ,ellipsis: true},
  200. { title: '整单合计', width: 120, dataIndex: 'wholeOrderTotal', className: 'replacecolor' ,ellipsis: true},
  201. { title: '销售部门', width: 100, dataIndex: 'salesDepartment', className: 'replacecolor' ,ellipsis: true},
  202. { title: '业务员', width: 140, dataIndex: 'salesman', className: 'replacecolor' ,ellipsis: true},
  203. { title: '品牌方', width: 220, dataIndex: 'brandSide', align: 'left', className: 'replacecolor',ellipsis: true },
  204. { title: '币种', width: 90, dataIndex: 'currencyText', className: 'replacecolor',ellipsis: true },
  205. { title: '第三方', width: 220, dataIndex: 'thirdParty', align: 'left', className: 'replacecolor',ellipsis: true },
  206. { title: '定金比例(%)', width: 120, dataIndex: 'depositRatio', className: 'replacecolor',ellipsis: true },
  207. { title: '定金', width: 100, dataIndex: 'deposit', className: 'replacecolor',ellipsis: true },
  208. // { title: '协同路线', width: 160, dataIndex: 'collaborativeRoute', className: 'replacecolor',ellipsis: true },
  209. { title: '付款条件', width: 180, dataIndex: 'termOfPayment', className: 'replacecolor' ,ellipsis: true},
  210. {
  211. title: '订单备注',
  212. width: 220,
  213. dataIndex: 'orderRemarks',
  214. // customRender: t => ellipsis(t),
  215. className: 'replacecolor',
  216. scopedSlots: { customRender: 'orderRemarks' },
  217. ellipsis: true
  218. },
  219. {
  220. title: '价格备注',
  221. width: 120,
  222. dataIndex: 'priceRemarks',
  223. // customRender: t => ellipsis(t),
  224. className: 'replacecolor',
  225. scopedSlots: { customRender: 'priceRemarks' },
  226. ellipsis: true
  227. },
  228. {
  229. title: '订单变更说明',
  230. width: 120,
  231. dataIndex: 'orderChangeDescription',
  232. fixed: 'right',
  233. // customRender: t => ellipsis(t),
  234. className: 'replacecolor',
  235. scopedSlots: { customRender: 'orderChangeDescription' },
  236. ellipsis: true
  237. },
  238. {
  239. title: '操作',
  240. width: 120,
  241. dataIndex: 'operation',
  242. scopedSlots: { customRender: 'operationSlot' },
  243. className: 'replacecolor',
  244. ellipsis: true,
  245. fixed: 'right',
  246. },
  247. ],
  248. orderListData: [], // 主表信息
  249. loading: false, // 表格加载
  250. queryParam: {
  251. orderNumber: '',
  252. orderDate: '',
  253. customerAbbreviation: '',
  254. account: '',
  255. dilivery: '',
  256. isProduct: '', // 客户需求新增
  257. salesDepartment: '',//部门
  258. salesman:'',//业务员
  259. pageNo: '' // 初始页
  260. },
  261. dingDan:'',//单条同步订单号
  262. pagination: {
  263. pageSizeOptions: ["50", "100", "150"],
  264. showSizeChanger: true,
  265. // total: '',
  266. // current: 0,
  267. // pageSize: 0
  268. },
  269. account:'',//单条同步条件
  270. dateRange:[],
  271. dataRangeMode:['date','date'],
  272. spinDelayMS:500, // 加载框延迟时间
  273. spinIsShow:false, // 加载框是否显示
  274. }
  275. },
  276. created() {
  277. // this.getOrderList()
  278. },
  279. methods: {
  280. // 分页查询
  281. getOrderList() {
  282. var that = this;
  283. // that.spinIsShow = true;
  284. this.loading = true
  285. this.$nextTick(() => {
  286. this.queryParam.pageSize = 50
  287. orderList(this.queryParam).then(res => {
  288. // that.spinIsShow = false;
  289. this.loading = false
  290. if (res.success) {
  291. that.orderListData = res.result.records;
  292. that.pagination = {
  293. total: res.result.total,
  294. current: res.result.current,
  295. pageSize: res.result.size
  296. }
  297. }else{
  298. that.$message.error(res.message);
  299. }
  300. })
  301. })
  302. },
  303. // 同步
  304. synchronization() {
  305. this.$nextTick(() => {
  306. var id = "1570672855704420354"
  307. this.loading = true
  308. syncy({id}).then(res => {
  309. if (res.success) {
  310. this.loading = false
  311. this.getOrderList();
  312. this.$message.success('同步成功')
  313. }else{
  314. this.loading = false
  315. this.$message.error(res.message)
  316. }
  317. })
  318. })
  319. },
  320. //单条同步
  321. synchronizationOne(){
  322. this.$nextTick(() => {
  323. if(this.account == '' || !this.account){
  324. this.$message.error('请选择账套号!')
  325. }else{
  326. // var parameter = this.dingDan,
  327. // account=this.account
  328. this.loading = true
  329. oneSyncy({parameter:this.dingDan,account:this.account}).then(res => {
  330. if (res.success) {
  331. this.loading =false
  332. this.queryParam.orderNumber = this.dingDan
  333. this.getOrderList();
  334. this.$message.success(res.message)
  335. }else{
  336. this.loading =false
  337. this.$message.error(res.message)
  338. }
  339. })
  340. }
  341. })
  342. },
  343. //删除
  344. handleDelete(record){
  345. deleteOrder({orderNumber:record.orderNumber,account:record.account}).then(res => {
  346. if (res.success) {
  347. this.getOrderList();
  348. this.$message.success('删除成功')
  349. }else{
  350. this.$message.error(res.message)
  351. }
  352. })
  353. },
  354. // 【订单号】 抽屉
  355. showDrawer(record) {
  356. return {
  357. on: {
  358. click: event => {
  359. this.$refs.orderDetailDrawer.visible = true
  360. this.$refs.orderDetailDrawer.record = record // 接口参数
  361. this.$refs.orderDetailDrawer.getOrderChild()
  362. this.$refs.orderDetailDrawer.orderDetail = record // 详情页主表赋值
  363. }
  364. }
  365. }
  366. },
  367. //手工匹配订单
  368. getManualList(){
  369. this.$refs.manualModal.manualModVis = true
  370. },
  371. // 查询按钮
  372. searchQuery() {
  373. this.queryParam.pageNo = ''
  374. this.toggleSearchStatus = false
  375. this.getOrderList()
  376. // console.log('发货状态', this.queryParam.dilivery)
  377. },
  378. searchReset() {
  379. this.queryParam = {}
  380. this.getOrderList()
  381. },
  382. // 查询条件 订单日期转换成字符串并赋值
  383. onDateChange(value, dateString) {
  384. this.queryParam.orderDate = dateString
  385. },
  386. handleTableChange(pagination, filters, sorter) {
  387. this.queryParam.pageNo = pagination.current
  388. this.getOrderList()
  389. },
  390. // 时间发生变化的回调,发生在用户选择时间时
  391. dateRangeSelectChange(value) {
  392. this.dateRange = value;
  393. if (value.length == 0){
  394. this.queryParam.dateStar = "";
  395. this.queryParam.dateEnd = "";
  396. }else{
  397. this.queryParam.dateStar = value[0].format('YYYY-MM-DD');
  398. this.queryParam.dateEnd = value[1].format('YYYY-MM-DD');
  399. }
  400. },
  401. },
  402. computed: {},
  403. mounted() {}
  404. }
  405. </script>
  406. <style lang="less" scoped>
  407. @import '~@assets/less/common.less';
  408. @import '~@assets/less/overwriter.less';
  409. /deep/ .ant-table-thead > tr > th {
  410. text-align: center !important;
  411. // font-weight: 700;
  412. }
  413. /deep/ .ant-table-tbody {
  414. text-align: center !important;
  415. }
  416. // /deep/ th.replacecolor {
  417. // background-color: #ccc;
  418. // }
  419. /deep/ .ant-table-tbody .ant-table-row td{
  420. padding-top: 8px;
  421. padding-bottom: 8px;
  422. text-align: center !important;
  423. }
  424. /deep/.ant-card-body{
  425. padding-top: 10px !important;
  426. padding-bottom: 0px !important;
  427. }
  428. /deep/.table-operator .ant-btn{
  429. margin: 0 8px 3px 0;
  430. }
  431. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  432. margin-bottom: 10px;
  433. }
  434. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  435. margin-bottom: 10px;
  436. }
  437. /deep/ thead.ant-table-thead>tr{
  438. height: 0 !important;
  439. }
  440. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  441. padding: 9px 16px
  442. }
  443. </style>