detailsBookDrawer.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. <!-- 新增托书 -->
  3. <div id="addBookDrawer">
  4. <a-drawer
  5. title="新增托书"
  6. width="89%"
  7. placement="right"
  8. :closable="true"
  9. :visible="visible"
  10. @close="handleCancel">
  11. <!-- 主表信息 填写 为什么原先图部分回显??-->
  12. <a-card :bordered="true">
  13. <div class="table-page-search-wrapper">
  14. <a-form-model layout="inline" ref="form" :model="addBook" :rules="validatorRules">
  15. <a-row :gutter="24">
  16. <a-col :md="6" :sm="8">
  17. <a-form-model-item label="托书日期" prop="shippingOrderDate">
  18. {{addBook.shippingOrderDate}}
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :md="6" :sm="8">
  22. <a-form-model-item label="托书号" prop="shippingOrderNumber">
  23. {{addBook.shippingOrderNumber}}
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :md="12" :sm="12">
  27. <a-form-model-item label="外销发票号码" prop="exportInvoiceNo">
  28. {{addBook.exportInvoiceNo}}
  29. </a-form-model-item>
  30. </a-col>
  31. <a-col :md="6" :sm="8">
  32. <a-form-model-item label="经营单位" prop="businessUnit">
  33. {{addBook.unitInOperation}}
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :md="6" :sm="8">
  37. <a-form-model-item label="经营单位地址" prop="businessUnitAdd">
  38. <a-select placeholder="请选择经营单位地址" v-model="addBook.unitInOperationAddress" disabled="true">
  39. <a-select-option value="">请选择</a-select-option>
  40. <a-select-option value="0">客户1</a-select-option>
  41. <a-select-option value="1">客户2</a-select-option>
  42. <a-select-option value="2">客户3</a-select-option>
  43. </a-select>
  44. </a-form-model-item>
  45. </a-col>
  46. <a-col :md="6" :sm="8">
  47. <a-form-model-item label="装运期限" prop="latestShipmentDate">
  48. {{addBook.latestDateOfShipment}}
  49. </a-form-model-item>
  50. </a-col>
  51. <a-col :md="6" :sm="8">
  52. <a-form-model-item label="最终船期" prop="finalShipDate">
  53. {{addBook.theFinalShippingDate}}
  54. </a-form-model-item>
  55. </a-col>
  56. <a-col :md="6" :sm="8">
  57. <a-form-model-item label="收货人" prop="consignee">
  58. {{addBook.consignee}}
  59. </a-form-model-item>
  60. </a-col>
  61. <a-col :md="6" :sm="8">
  62. <a-form-model-item label="收货人地址" prop="consigneeAddress">
  63. {{addBook.consigneeAddress}}
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :md="6" :sm="8">
  67. <a-form-model-item label="通知方" prop="notifyParty">
  68. {{addBook.notifyParty}}
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :md="6" :sm="8">
  72. <a-form-model-item label="通知方地址" prop="notifyPartyAddress">
  73. {{addBook.notifyPartyAddress}}
  74. </a-form-model-item>
  75. </a-col>
  76. <a-col :md="6" :sm="8">
  77. <a-form-model-item label="贸易国别" prop="tradeCountry">
  78. {{addBook.tradeCountry}}
  79. </a-form-model-item>
  80. </a-col>
  81. <a-col :md="6" :sm="8">
  82. <a-form-model-item label="运抵国别" prop="arriveCountry">
  83. {{addBook.arriveInCountry}}
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :md="6" :sm="8">
  87. <a-form-model-item label="出口口岸" prop="exportPort">
  88. {{addBook.exportPort}}
  89. </a-form-model-item>
  90. </a-col>
  91. <a-col :md="6" :sm="8">
  92. <a-form-model-item label="目的港" prop="destinationport">
  93. {{addBook.destinationPort}}
  94. </a-form-model-item>
  95. </a-col>
  96. <a-col :md="6" :sm="8">
  97. <a-form-model-item label="收汇方式" prop="collectionMethod">
  98. {{addBook.exchangeEarningsValue}}
  99. </a-form-model-item>
  100. </a-col>
  101. <a-col :md="6" :sm="8">
  102. <a-form-model-item label="成交方式" prop="soldType">
  103. {{addBook.termsOfDeliveryvalue}}
  104. </a-form-model-item>
  105. </a-col>
  106. <a-col :md="6" :sm="8">
  107. <a-form-model-item label="金额" prop="money">
  108. {{addBook.money}}
  109. </a-form-model-item>
  110. </a-col>
  111. <a-col :md="6" :sm="8">
  112. <a-form-model-item label="人民币" prop="RMB">
  113. {{addBook.cny}}
  114. </a-form-model-item>
  115. </a-col>
  116. <a-col :md="6" :sm="8">
  117. <a-form-model-item label="美元" prop="dollar">
  118. {{addBook.usd}}
  119. </a-form-model-item>
  120. </a-col>
  121. </a-row>
  122. </a-form-model>
  123. </div>
  124. </a-card>
  125. <!--操作按钮区域 参照装箱单 増行-->
  126. <a-card :bordered="true" style="margin:10px 0 40px 0;">
  127. <!-- 子表-->
  128. <a-spin :spinning="confirmLoading">
  129. <a-form-model ref="formRef" :rules="validatorRules">
  130. <a-table
  131. bordered
  132. :row-key="record => record.id"
  133. :columns="addBookColumns"
  134. :data-source="addBookData"
  135. :loading="loading"
  136. :pagination="ipagination"
  137. :scroll="{ x: 1500 }"
  138. @change="handleTableChange"
  139. >
  140. </a-table>
  141. </a-form-model>
  142. <!-- 人民币、美金 -->
  143. <a-row style="margin:60px 0;">
  144. <div class="purchase-order-table" style="width:48%;marginRight:4%;float:left;">
  145. <h6 class="table-title">人民币</h6>
  146. <a-table
  147. :row-key="record => record.id"
  148. :loading="loading"
  149. :columns="CNYColumns"
  150. :scroll="{ y: 200 }"
  151. :data-source="rmbList"
  152. bordered
  153. :pagination="false"
  154. >
  155. <template slot="CNYfreighForward" slot-scope="text, record, index">
  156. <a-form-model-item prop="CNYfreighForward" :rules="rules.CNYfreighForward" >
  157. {{record.freightForwarder}}
  158. </a-form-model-item>
  159. </template>
  160. <template slot="CNYmoney" slot-scope="text, record, index">
  161. <a-form-model-item prop="CNYmoney" :rules="rules.CNYmoney" >
  162. {{record.amount}}
  163. </a-form-model-item>
  164. </template>
  165. <!-- CNY项目列 -->
  166. <template slot="CNYProjectList" slot-scope="text, record, index">
  167. <a-form-model-item prop="CNYProjectList" :rules="rules.CNYProjectList">
  168. <a-select v-model="record.itemColumn" style="width:100%" placeholder="请输入项目列" disabled="true">
  169. <a-select-option value="1">项目列1</a-select-option>
  170. <a-select-option value="2">项目列2</a-select-option>
  171. </a-select>
  172. </a-form-model-item>
  173. </template>
  174. </a-table>
  175. </div>
  176. <div class="purchase-order-table" style="width:48%;float:right;">
  177. <h6 class="table-title">美金</h6>
  178. <a-table
  179. :row-key="record => record.id"
  180. :loading="loading"
  181. :columns="USDColumns"
  182. :data-source="usdList"
  183. :scroll="{ y: 200 }"
  184. bordered
  185. :pagination="false"
  186. >
  187. <template slot="USDfreighForward" slot-scope="text, record, index">
  188. <a-form-model-item prop="USDfreighForward" :rules="rules.USDfreighForward" >
  189. {{record.freightForwarder}}
  190. </a-form-model-item>
  191. </template>
  192. <template slot="USDmoney" slot-scope="text, record, index">
  193. <a-form-model-item prop="USDmoney" :rules="rules.USDmoney" >
  194. {{record.amount}}
  195. </a-form-model-item>
  196. </template>
  197. <!-- USD项目列 -->
  198. <template slot="USDProjectList" slot-scope="text, record, index">
  199. <a-form-model-item prop="USDProjectList" :rules="rules.USDProjectList">
  200. <a-select v-model="record.itemColumn" style="width:100%" disabled="true">
  201. <a-select-option value="1">项目列1</a-select-option>
  202. <a-select-option value="2">项目列2</a-select-option>
  203. </a-select>
  204. </a-form-model-item>
  205. </template>
  206. </a-table>
  207. </div>
  208. </a-row>
  209. </a-spin>
  210. </a-card>
  211. <!-- 页面底部保存取消 -->
  212. <div
  213. :style="{
  214. position: 'absolute',
  215. right: 0,
  216. bottom: 0,
  217. width: '100%',
  218. borderTop: '1px solid #e9e9e9',
  219. padding: '10px 16px',
  220. background: '#fff',
  221. textAlign: 'right',
  222. zIndex: 1
  223. }"
  224. >
  225. <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
  226. <a-button :style="{ marginRight: '8px' }">关闭</a-button>
  227. </a-popconfirm>
  228. </div>
  229. </a-drawer>
  230. </div>
  231. </template>
  232. <script>
  233. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  234. import JEllipsis from '@/components/jeecg/JEllipsis'
  235. import moment from 'moment'
  236. export default {
  237. name: 'AddBookDrawer', // 新增 托书
  238. mixins: [JeecgListMixin],
  239. components: { JEllipsis, moment }, // 参照装箱单 弹框
  240. data() {
  241. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  242. return {
  243. // 表头
  244. addBookColumns: [
  245. {
  246. title: '英文名称',
  247. dataIndex: 'englishName',
  248. width: 120,
  249. fixed: 'left',
  250. className: 'replacecolor'
  251. },
  252. {
  253. title: '款号',
  254. dataIndex: 'styleNumber',
  255. width: 120,
  256. fixed: 'left',
  257. className: 'replacecolor'
  258. },
  259. {
  260. title: '小po号',
  261. dataIndex: 'smailPo',
  262. width: 120,
  263. className: 'replacecolor'
  264. },
  265. {
  266. title: '数量',
  267. dataIndex: 'number',
  268. width: 120,
  269. className: 'replacecolor'
  270. },
  271. {
  272. title: '箱数',
  273. dataIndex: 'boxNumber',
  274. width: 90,
  275. className: 'replacecolor'
  276. },
  277. {
  278. title: '毛重',
  279. dataIndex: 'grossWeight',
  280. width: 120,
  281. className: 'replacecolor'
  282. },
  283. {
  284. title: '净重',
  285. dataIndex: 'netWeight',
  286. width: 120,
  287. className: 'replacecolor'
  288. },
  289. {
  290. title: '体积',
  291. dataIndex: 'volume',
  292. width: 160,
  293. className: 'replacecolor'
  294. },
  295. {
  296. title: '分销点',
  297. dataIndex: 'distributionPoint',
  298. customRender: t => ellipsis(t),
  299. width: 120,
  300. className: 'replacecolor'
  301. },
  302. {
  303. title: '集装箱代号',
  304. dataIndex: 'containerCode',
  305. width: 120,
  306. className: 'replacecolor'
  307. },
  308. {
  309. title: '集装箱号',
  310. dataIndex: 'containerNumber',
  311. width: 120,
  312. className: 'replacecolor'
  313. },
  314. {
  315. title: '单价',
  316. dataIndex: 'unitPrice',
  317. width: 120,
  318. className: 'replacecolor'
  319. },
  320. // {
  321. // title: '创建时间',
  322. // dataIndex: 'createTime',
  323. // align: 'center',
  324. // sorter: true,
  325. // customRender: text => {
  326. // return moment(text).format('YYYY-MM-DD')
  327. // }
  328. // },
  329. {
  330. title: '预发货日期',
  331. dataIndex: 'preShipmentDate',
  332. width: 120,
  333. className: 'replacecolor'
  334. },
  335. {
  336. title: '业务员',
  337. dataIndex: 'salesman',
  338. width: 120,
  339. className: 'replacecolor'
  340. },
  341. {
  342. title: '业务部门',
  343. dataIndex: 'operatingDepartment',
  344. width: 120,
  345. className: 'replacecolor'
  346. },
  347. {
  348. title: '采购/委外订单号',
  349. dataIndex: 'purchaseOutsourcingOrderNo',
  350. width: 160,
  351. className: 'replacecolor'
  352. },
  353. {
  354. title: '采购/委外工厂',
  355. dataIndex: 'outsourcingFactoryForProcurement',
  356. width: 160,
  357. className: 'replacecolor'
  358. },
  359. {
  360. title: '操作',
  361. dataIndex: 'operation',
  362. width: 160,
  363. fixed: 'right',
  364. className: 'replacecolor'
  365. }
  366. ],
  367. addBookData: [],
  368. CNYColumns: [
  369. {
  370. title: '货代',
  371. dataIndex: 'freightForwarder',
  372. width: 60,
  373. className: 'replacecolor'
  374. },
  375. {
  376. title: '金额',
  377. dataIndex: 'amount',
  378. width: 60,
  379. className: 'replacecolor'
  380. },
  381. {
  382. title: '项目列',
  383. dataIndex: 'itemColumn',
  384. scopedSlots: { customRender: 'CNYProjectList' },
  385. width: 60,
  386. className: 'replacecolor'
  387. }
  388. ],
  389. rmbList: [{}],
  390. USDColumns: [
  391. {
  392. title: '货代',
  393. dataIndex: 'freightForwarder',
  394. scopedSlots: { customRender: 'USDfreighForward' },
  395. width: 20,
  396. className: 'replacecolor'
  397. },
  398. {
  399. title: '金额',
  400. dataIndex: 'amount',
  401. scopedSlots: { customRender: 'USDmoney' },
  402. width: 20,
  403. className: 'replacecolor'
  404. },
  405. {
  406. title: '项目列',
  407. dataIndex: 'itemColumn',
  408. width: 90,
  409. scopedSlots: { customRender: 'USDProjectList' },
  410. className: 'replacecolor'
  411. }
  412. ],
  413. usdList: [{}],
  414. loading: false, // 表格加载
  415. addBook: {},
  416. confirmLoading: false,
  417. visible: false,
  418. dateFormat: 'YYYY-MM-DD',
  419. validatorRules: {
  420. shippingOrderDate:[{required: true, message: '托书日期不能为空!'}],
  421. consignee:[{required: true, message: '收货人不能为空!'}],
  422. shippingOrderNumber:[{required: true, message: '预托书号不能为空!'}],
  423. }
  424. }
  425. },
  426. created() {},
  427. methods: {
  428. // // 新增托书 子表合计
  429. // addBookFooterShow(data) {
  430. // console.log('新增托书 子表 ----合计行')
  431. // console.log('data', data)
  432. // return (
  433. // <a-table
  434. // rowKey={Math.random}
  435. // bordered={false}
  436. // pagination={false}
  437. // columns={this.addBookColumns}
  438. // dataSource={this.addBookFooterDataSource || []}
  439. // showHeader={false}
  440. // ></a-table>
  441. // )
  442. // },
  443. // 抽屉 取消
  444. handleCancel() {
  445. console.log('点击抽屉取消')
  446. this.close()
  447. },
  448. close() {
  449. this.$emit('close')
  450. this.addBook ={}
  451. this.addBookData =[]
  452. this.rmbList = []
  453. this.usdList = []
  454. this.visible = false
  455. },
  456. },
  457. mounted() {}
  458. }
  459. </script>
  460. <style lang="less" scoped>
  461. @import '~@assets/less/common.less';
  462. @import '~@assets/less/overwriter.less';
  463. /deep/ .ant-table-thead > tr > th {
  464. text-align: center;
  465. // font-weight: 700;
  466. }
  467. /deep/ .ant-table-tbody {
  468. text-align: center;
  469. }
  470. // /deep/ th.replacecolor {
  471. // background-color: #ccc;
  472. // }
  473. // 抽屉里的card样式
  474. /deep/ .ant-drawer-content {
  475. background-color: #f0f2f5;
  476. }
  477. /deep/ .ant-drawer-body {
  478. padding: 10px;
  479. }
  480. /deep/ .ant-table-footer .ant-table.body {
  481. // overflow: hidden !important;
  482. }
  483. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  484. border: none;
  485. padding: 0;
  486. }
  487. </style>