detailsBookDrawer.vue 16 KB

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