detailsBookDrawer.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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 | ellipsis}}
  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 | ellipsis}}
  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 | ellipsis}}
  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. <a-input placeholder="请输入货代" v-model="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. <a-input placeholder="请输入金额" v-model="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="请输入项目列" >
  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. <a-input placeholder="请输入货代" v-model="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. <a-input placeholder="请输入金额" v-model="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%" >
  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-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
  221. <a-button type="primary" :style="{ marginRight: '8px' }" @click="editMoney" :disabled="disabled">保存</a-button> -->
  222. </div>
  223. </a-drawer>
  224. </div>
  225. </template>
  226. <script>
  227. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  228. import JEllipsis from '@/components/jeecg/JEllipsis'
  229. import moment from 'moment'
  230. import {editMoney} from '@api/document/book.js'
  231. export default {
  232. name: 'AddBookDrawer', // 新增 托书
  233. mixins: [JeecgListMixin],
  234. components: { JEllipsis, moment }, // 参照装箱单 弹框
  235. data() {
  236. let ellipsis = (v, l = 15) => <j-ellipsis value={v} length={l} />
  237. return {
  238. disabled:true,
  239. // 表头
  240. addBookColumns: [
  241. {
  242. title: '款号',
  243. dataIndex: 'styleNumber',
  244. width: 120,
  245. ellipsis: true,
  246. className: 'replacecolor'
  247. },
  248. {
  249. title: '小po',
  250. dataIndex: 'smailPo',
  251. width: 120,
  252. ellipsis: true,
  253. className: 'replacecolor'
  254. },
  255. {
  256. title: '数量',
  257. dataIndex: 'number',
  258. width: 100,
  259. ellipsis: true,
  260. className: 'replacecolor'
  261. },
  262. {
  263. title: '箱数',
  264. dataIndex: 'boxNumber',
  265. width: 100,
  266. ellipsis: true,
  267. className: 'replacecolor'
  268. },
  269. {
  270. title: '毛重',
  271. dataIndex: 'grossWeight',
  272. width: 100,
  273. ellipsis: true,
  274. className: 'replacecolor'
  275. },
  276. {
  277. title: '净重',
  278. dataIndex: 'netWeight',
  279. width: 100,
  280. ellipsis: true,
  281. // scopedSlots: { customRender: 'containerCode' },
  282. className: 'replacecolor'
  283. },
  284. {
  285. title: '体积',
  286. dataIndex: 'volume',
  287. width: 100,
  288. ellipsis: true,
  289. // scopedSlots: { customRender: 'containerNo' },
  290. // className: 'replacecolor'
  291. },
  292. {
  293. title: '分销点',
  294. dataIndex: 'distributionPoint',
  295. width: 100,
  296. ellipsis: true,
  297. className: 'replacecolor'
  298. },
  299. {
  300. title: '集装箱号',
  301. dataIndex: 'containerNumber',
  302. ellipsis: true,
  303. scopedSlots: { customRender: 'containerNumber' },
  304. width: 100,
  305. // fixed: 'left',
  306. className: 'replacecolor'
  307. },
  308. // {
  309. // title: '集装箱代号',
  310. // dataIndex: 'containerCode',
  311. // scopedSlots: { customRender: 'containerCode' },
  312. // width: 120,
  313. // ellipsis: true,
  314. // className: 'replacecolor'
  315. // },
  316. {
  317. title: '单价',
  318. dataIndex: 'unitPrice',
  319. width: 100,
  320. ellipsis: true,
  321. className: 'replacecolor'
  322. },
  323. {
  324. title: '金额',
  325. dataIndex: 'totalPrice',
  326. width: 100,
  327. ellipsis: true,
  328. className: 'replacecolor'
  329. },
  330. {
  331. title: '制单人',
  332. dataIndex: 'createBy',
  333. width: 120,
  334. ellipsis: true,
  335. // fixed: 'left',
  336. className: 'replacecolor'
  337. },
  338. {
  339. title: '采购/委外订单号',
  340. dataIndex: 'purOrSubOrder',
  341. width: 160,
  342. ellipsis: true,
  343. className: 'replacecolor'
  344. },
  345. {
  346. title: '英文名称',
  347. dataIndex: 'englishName',
  348. width: 160,
  349. ellipsis: true,
  350. className: 'replacecolor'
  351. },
  352. ],
  353. addBookData: [],
  354. CNYColumns: [
  355. {
  356. title: '货代',
  357. dataIndex: 'freightForwarderName',
  358. width: 60,
  359. className: 'replacecolor',
  360. //scopedSlots: { customRender: 'CNYfreighForward' },
  361. },
  362. {
  363. title: '金额',
  364. dataIndex: 'amount',
  365. width: 60,
  366. className: 'replacecolor',
  367. //scopedSlots: { customRender: 'CNYmoney' },
  368. },
  369. {
  370. title: '项目列',
  371. dataIndex: 'itemColumnName',
  372. // scopedSlots: { customRender: 'CNYProjectList' },
  373. width: 60,
  374. className: 'replacecolor'
  375. }
  376. ],
  377. rmbList: [{}],
  378. USDColumns: [
  379. {
  380. title: '货代',
  381. dataIndex: 'freightForwarderName',
  382. // scopedSlots: { customRender: 'USDfreighForward' },
  383. width: 60,
  384. className: 'replacecolor'
  385. },
  386. {
  387. title: '金额',
  388. dataIndex: 'amount',
  389. //scopedSlots: { customRender: 'USDmoney' },
  390. width: 60,
  391. className: 'replacecolor'
  392. },
  393. {
  394. title: '项目列',
  395. dataIndex: 'itemColumnName',
  396. width: 60,
  397. //scopedSlots: { customRender: 'USDProjectList' },
  398. className: 'replacecolor'
  399. }
  400. ],
  401. usdList: [{}],
  402. loading: false, // 表格加载
  403. addBook: {},
  404. confirmLoading: false,
  405. visible: false,
  406. dateFormat: 'YYYY-MM-DD',
  407. validatorRules: {
  408. shippingOrderDate:[{required: true, message: '托书日期不能为空!'}],
  409. consignee:[{required: true, message: '收货人不能为空!'}],
  410. shippingOrderNumber:[{required: true, message: '预托书号不能为空!'}],
  411. }
  412. }
  413. },
  414. created() {},
  415. filters: {
  416. //文字数超出时,超出部分使用...
  417. ellipsis(value) {
  418. if (!value) return ''
  419. if (value.length > 20) {
  420. return value.slice(0, 30) + '...'
  421. }
  422. return value
  423. }
  424. },
  425. methods: {
  426. // // 新增托书 子表合计
  427. // addBookFooterShow(data) {
  428. // console.log('新增托书 子表 ----合计行')
  429. // console.log('data', data)
  430. // return (
  431. // <a-table
  432. // rowKey={Math.random}
  433. // bordered={false}
  434. // pagination={false}
  435. // columns={this.addBookColumns}
  436. // dataSource={this.addBookFooterDataSource || []}
  437. // showHeader={false}
  438. // ></a-table>
  439. // )
  440. // },
  441. // 抽屉 取消
  442. handleCancel() {
  443. console.log('点击抽屉取消')
  444. this.close()
  445. },
  446. editMoney(){
  447. var param = {
  448. id:this.addBook.id
  449. }
  450. param.rmbList = this.rmbList
  451. param.usdList = this.usdList
  452. editMoney(param).then(res => {
  453. if (res.success) {
  454. this.$message.success('修改成功')
  455. this.close()
  456. }else {
  457. this.$message.error(res.message);
  458. }
  459. })
  460. },
  461. close() {
  462. this.$emit('close')
  463. this.addBook ={}
  464. this.addBookData =[]
  465. this.rmbList = []
  466. this.usdList = []
  467. this.visible = false
  468. },
  469. },
  470. mounted() {}
  471. }
  472. </script>
  473. <style lang="less" scoped>
  474. @import '~@assets/less/common.less';
  475. @import '~@assets/less/overwriter.less';
  476. /deep/ .ant-table-thead > tr > th {
  477. text-align: center;
  478. // font-weight: 700;
  479. }
  480. /deep/ .ant-table-tbody {
  481. text-align: center;
  482. }
  483. // /deep/ th.replacecolor {
  484. // background-color: #ccc;
  485. // }
  486. // 抽屉里的card样式
  487. /deep/ .ant-drawer-content {
  488. background-color: #f0f2f5;
  489. }
  490. /deep/ .ant-drawer-body {
  491. padding: 10px;
  492. }
  493. /deep/ .ant-table-footer .ant-table.body {
  494. // overflow: hidden !important;
  495. }
  496. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  497. border: none;
  498. padding: 0;
  499. }
  500. </style>