orderDetailDrawer.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <!-- 【单证】 订单数据 详情 -->
  3. <a-drawer
  4. title="详情"
  5. width="89%"
  6. placement="right"
  7. :closable="true"
  8. :visible="visible"
  9. @close="onClose">
  10. <!--主表信息 -->
  11. <a-card :bordered="true">
  12. <div class="table-page-search-wrapper">
  13. <a-form-model layout="inline" ref="form">
  14. <a-row :gutter="24">
  15. <a-col :md="6" :sm="8">
  16. <a-form-model-item label="订单号" prop="orderNumber">
  17. {{ orderDetail.orderNumber }}
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :md="6" :sm="8">
  21. <a-form-model-item label="订单日期" prop="orderDate">
  22. {{ orderDetail.orderDate }}
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :md="6" :sm="8">
  26. <a-form-model-item label="业务类型" prop="businessTypeValue">
  27. {{ orderDetail.businessTypeValue }}
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-model-item label="销售类型" prop="salesTypeValue">
  32. {{ orderDetail.salesTypeValue }}
  33. </a-form-model-item>
  34. </a-col>
  35. <a-col :md="6" :sm="8">
  36. <a-form-model-item label="客户简称" prop="customerAbbreviation">
  37. {{ orderDetail.customerAbbreviation }}
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :md="6" :sm="8">
  41. <a-form-model-item label="客户名称" prop="customerName">
  42. {{ orderDetail.customerName }}
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="6" :sm="8">
  46. <a-form-model-item label="汇率" prop="exchangeRate">
  47. {{ orderDetail.exchangeRate }}
  48. </a-form-model-item>
  49. </a-col>
  50. <a-col :md="6" :sm="8">
  51. <a-form-model-item label="销售部门" prop="salesDepartment">
  52. {{ orderDetail.salesDepartment }}
  53. </a-form-model-item>
  54. </a-col>
  55. <a-col :md="6" :sm="8">
  56. <a-form-model-item label="业务员" prop="salesman">
  57. {{ orderDetail.salesman }}
  58. </a-form-model-item>
  59. </a-col>
  60. <a-col :md="6" :sm="8">
  61. <a-form-model-item label="币种" prop="currencyValue">
  62. {{ orderDetail.currencyValue }}
  63. </a-form-model-item>
  64. </a-col>
  65. <a-col :md="6" :sm="8">
  66. <a-form-model-item label="品牌方" prop="brandSide">
  67. {{ orderDetail.brandSide }}
  68. </a-form-model-item>
  69. </a-col>
  70. <a-col :md="6" :sm="8">
  71. <a-form-model-item label="第三方" prop="thirdParty">
  72. {{ orderDetail.thirdParty }}
  73. </a-form-model-item>
  74. </a-col>
  75. <a-col :md="6" :sm="8">
  76. <a-form-model-item label="定金比例(%)" prop="depositRatio">
  77. {{ orderDetail.depositRatio }}
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :md="6" :sm="8">
  81. <a-form-model-item label="定金" prop="deposit">
  82. {{ orderDetail.deposit }}
  83. </a-form-model-item>
  84. </a-col>
  85. <a-col :md="6" :sm="8">
  86. <a-form-model-item label="协同路线" prop="collaborativeRoute">
  87. {{ orderDetail.collaborativeRoute }}
  88. </a-form-model-item>
  89. </a-col>
  90. <a-col :md="6" :sm="8">
  91. <a-form-model-item label="订单备注" prop="orderRemarks">
  92. {{ orderDetail.orderRemarks }}
  93. </a-form-model-item>
  94. </a-col>
  95. <a-col :md="6" :sm="8">
  96. <a-form-model-item label="价格备注" prop="priceRemarks">
  97. {{ orderDetail.priceRemarks }}
  98. </a-form-model-item>
  99. </a-col>
  100. <!-- TODO:缺少该字段 -->
  101. <a-col :md="6" :sm="8">
  102. <a-form-model-item label="客户订单号" prop="customerOrderNum">
  103. {{ orderDetail.customerOrderNumber }}
  104. </a-form-model-item>
  105. </a-col>
  106. <a-col :md="6" :sm="8">
  107. <a-form-model-item label="整单合计" prop="wholeOrderTotal">
  108. {{ orderDetail.wholeOrderTotal }}
  109. </a-form-model-item>
  110. </a-col>
  111. <a-col :md="6" :sm="8">
  112. <a-form-model-item label="最终客户" prop="endCustomer">
  113. {{ orderDetail.endCustomer }}
  114. </a-form-model-item>
  115. </a-col>
  116. <a-col :md="6" :sm="8">
  117. <a-form-model-item label="付款条件" prop="termOfPayment">
  118. {{ orderDetail.termOfPayment }}
  119. </a-form-model-item>
  120. </a-col>
  121. <a-col :md="18" :sm="12">
  122. <a-form-model-item label="订单变更说明" prop="orderChangeDescription">
  123. {{ orderDetail.orderChangeDescription }}
  124. </a-form-model-item>
  125. </a-col>
  126. </a-row>
  127. </a-form-model>
  128. </div>
  129. </a-card>
  130. <!-- 子表 -->
  131. <a-card :bordered="true" style="margin:10px 0">
  132. <a-table
  133. bordered
  134. :columns="childColumns"
  135. :data-source="childData"
  136. :pagination="pagination"
  137. :loading="loading"
  138. :scroll="{ x: 1500 }"
  139. @change="handleTableChange"
  140. >
  141. </a-table>
  142. </a-card>
  143. </a-drawer>
  144. </template>
  145. <script>
  146. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  147. import JEllipsis from '@/components/jeecg/JEllipsis'
  148. import moment from 'moment'
  149. import { orderByNum } from '@api/document/order'
  150. export default {
  151. name: 'OrderDetailDrawer',
  152. mixins: [JeecgListMixin],
  153. components: { JEllipsis, moment },
  154. data() {
  155. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  156. return {
  157. orderDetail: [], // 主表信息
  158. childColumns: [
  159. { title: '款号', width: 100, dataIndex: 'itemNumber', fixed: 'left', className: 'replacecolor' },
  160. {
  161. title: '预发货日期',
  162. width: 120,
  163. dataIndex: 'preDeliveryDate',
  164. fixed: 'left',
  165. customRender: text => {
  166. return moment(text).format('YYYY-MM-DD')
  167. },
  168. className: 'replacecolor'
  169. },
  170. {
  171. title: '预完工日期',
  172. width: 120,
  173. dataIndex: 'preCompletionDate',
  174. customRender: text => {
  175. return moment(text).format('YYYY-MM-DD')
  176. },
  177. className: 'replacecolor'
  178. },
  179. { title: 'Pack Id', width: 120, dataIndex: 'packId', className: 'replacecolor' },
  180. { title: '小po', width: 120, dataIndex: 'smallPo', className: 'replacecolor' },
  181. { title: '分销点', width: 150, dataIndex: 'distributionPoint', className: 'replacecolor' },
  182. { title: '存货编码', width: 120, dataIndex: 'inventoryCode', className: 'replacecolor' },
  183. { title: '存货名称', width: 320, dataIndex: 'inventoryName', align: 'left', className: 'replacecolor' },
  184. { title: '规格型号', width: 100, dataIndex: 'specificationAndModel', className: 'replacecolor' },
  185. { title: '颜色', width: 160, dataIndex: 'colour', className: 'replacecolor' },
  186. // { title: '尺码', width: 100, dataIndex: 'size', className: 'replacecolor' },
  187. { title: '配码规则', width: 160, dataIndex: 'codingRules', className: 'replacecolor' },
  188. { title: '光坯毛门幅CM', width: 140, dataIndex: 'guangpeiGateWidth', className: 'replacecolor' },
  189. { title: '箱数', width: 100, dataIndex: 'boxNumber', className: 'replacecolor' },
  190. { title: '数量', width: 100, dataIndex: 'quantity', className: 'replacecolor' },
  191. { title: '主计量', width: 100, dataIndex: 'masterMetering', className: 'replacecolor' },
  192. { title: '含税单价', width: 100, dataIndex: 'unitPriceIncludingTax', className: 'replacecolor' },
  193. { title: '价税合计', width: 100, dataIndex: 'totalPriceAndTax', className: 'replacecolor' },
  194. { title: '税率(%)', width: 100, dataIndex: 'taxRate', className: 'replacecolor' },
  195. {
  196. title: '备注',
  197. width: 150,
  198. dataIndex: 'remarks',
  199. customRender: t => ellipsis(t),
  200. className: 'replacecolor',
  201. scopedSlots: { customRender: 'remarks' }
  202. },
  203. { title: '行关闭人', width: 100, dataIndex: 'bankClosedBy', className: 'replacecolor' }
  204. ],
  205. childData: [], // 子表数据
  206. loading: false, // 表格加载
  207. pagination: {
  208. pageNo: ''
  209. // total: '',
  210. // current: '',
  211. // pageSize: ''
  212. },
  213. visible: false, // 抽屉
  214. dateFormat: 'YYYY-MM-DD',
  215. record: {} // 点击的订单对象
  216. }
  217. },
  218. created() {
  219. this.getOrderChild()
  220. },
  221. methods: {
  222. // 子表信息获取
  223. getOrderChild() {
  224. this.$nextTick(() => {
  225. console.log('详情拿到订单号', this.record.id)
  226. orderByNum({ syOrderDataId: this.record.id, pageNo: this.pagination.pageNo }).then(res => {
  227. if (res.success) {
  228. // 子表信息赋值
  229. this.childData = res.result.records
  230. this.pagination = {
  231. total: res.result.total,
  232. current: res.result.current,
  233. pageSize: res.result.size
  234. }
  235. }
  236. })
  237. })
  238. },
  239. onClose() {
  240. this.visible = false
  241. },
  242. handleTableChange(pagination, filters, sorter) {
  243. this.pagination.pageNo = pagination.current
  244. this.getOrderChild()
  245. }
  246. }
  247. }
  248. </script>
  249. <style lang="less" scoped>
  250. @import '~@assets/less/common.less';
  251. /deep/ .ant-table-thead > tr > th {
  252. text-align: center;
  253. // font-weight: 700;
  254. }
  255. /deep/ .ant-table-tbody {
  256. text-align: center;
  257. }
  258. // /deep/ th.replacecolor {
  259. // background-color: #ccc;
  260. // }
  261. // 抽屉里的card样式
  262. /deep/ .ant-drawer-content {
  263. background-color: #f0f2f5;
  264. }
  265. /deep/ .ant-drawer-body {
  266. padding: 10px;
  267. }
  268. // 回显label文字
  269. /deep/.ant-form-item-label > label {
  270. font-weight: 700;
  271. }
  272. </style>