editPreBookDrawer.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. <template>
  2. <!-- 编辑预托书 回显可编辑输入框-->
  3. <div id="editPreBookDrawer">
  4. <a-drawer
  5. title="编辑"
  6. width="89%"
  7. placement="right"
  8. :closable="true"
  9. :visible="visible"
  10. @close="handleCancel">
  11. <!-- 主表信息 :rules="validatorRules"-->
  12. <a-card :bordered="true">
  13. <div class="table-page-search-wrapper">
  14. <a-form-model layout="inline" ref="form" :model="editPreBook" >
  15. <a-row :gutter="24">
  16. <a-col :md="6" :sm="8">
  17. <a-form-model-item label="托书日期" prop="bookDate">
  18. <a-date-picker
  19. placeholder="请选择托书日期"
  20. style="width:100%;"
  21. :format="dateFormat"
  22. v-model="editPreBook.bookDate"
  23. />
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :md="6" :sm="8">
  27. <a-form-model-item label="托书号" prop="bookNum">
  28. <a-input placeholder="请输入托书号" v-model="editPreBook.bookNum"></a-input>
  29. </a-form-model-item>
  30. </a-col>
  31. <a-col :md="12" :sm="12">
  32. <a-form-model-item label="外销发票号码" prop="exportInvoiceNo">
  33. <a-input placeholder="请输入外销发票号码" v-model="editPreBook.exportInvoiceNo"></a-input>
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :md="6" :sm="8">
  37. <a-form-model-item label="经营单位" prop="businessUnit">
  38. <a-input placeholder="请输入经营单位" v-model="editPreBook.businessUnit"></a-input>
  39. </a-form-model-item>
  40. </a-col>
  41. <a-col :md="6" :sm="8">
  42. <a-form-model-item label="经营单位地址" prop="businessUnitAdd">
  43. <a-select placeholder="请选择经营单位地址" v-model="editPreBook.businessUnitAdd">
  44. <a-select-option value="">请选择</a-select-option>
  45. <a-select-option :value="0">客户1</a-select-option>
  46. <a-select-option :value="1">客户2</a-select-option>
  47. <a-select-option :value="2">客户3</a-select-option>
  48. </a-select>
  49. </a-form-model-item>
  50. </a-col>
  51. <a-col :md="6" :sm="8">
  52. <a-form-model-item label="进仓/装柜日期" prop="inLoadDate">
  53. <a-date-picker
  54. placeholder="请选择进仓/装柜日期"
  55. style="width:100%;"
  56. :format="dateFormat"
  57. v-model="editPreBook.inLoadDate"
  58. />
  59. </a-form-model-item>
  60. </a-col>
  61. <a-col :md="6" :sm="8">
  62. <a-form-model-item label="最终船期" prop="finalShipDate">
  63. <a-input placeholder="请输入最终船期" v-model="editPreBook.finalShipDate"></a-input>
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :md="6" :sm="8">
  67. <a-form-model-item label="收货人" prop="consignee">
  68. <a-input placeholder="请输入收货人" v-model="editPreBook.consignee"></a-input>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :md="6" :sm="8">
  72. <a-form-model-item label="收货人地址" prop="consigneeAdd">
  73. <a-select placeholder="请选择收货人地址" v-model="editPreBook.consigneeAdd">
  74. <a-select-option value="">请选择</a-select-option>
  75. <a-select-option value="0">收货人1</a-select-option>
  76. <a-select-option value="1">收货人2</a-select-option>
  77. <a-select-option value="2">收货人3</a-select-option>
  78. </a-select>
  79. </a-form-model-item>
  80. </a-col>
  81. <a-col :md="6" :sm="8">
  82. <a-form-model-item label="通知方" prop="notifying">
  83. <a-input placeholder="请输入通知方" v-model="editPreBook.notifying"></a-input>
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :md="6" :sm="8">
  87. <a-form-model-item label="通知方地址" prop="notifyingAdd">
  88. <a-input placeholder="请输入通知方地址" v-model="editPreBook.notifyingAdd"></a-input>
  89. </a-form-model-item>
  90. </a-col>
  91. <a-col :md="6" :sm="8">
  92. <a-form-model-item label="贸易国别" prop="tradeCountry">
  93. <a-input placeholder="请输入贸易国别" v-model="editPreBook.tradeCountry"></a-input>
  94. </a-form-model-item>
  95. </a-col>
  96. <a-col :md="6" :sm="8">
  97. <a-form-model-item label="运抵国别" prop="arriveCountry">
  98. <a-input placeholder="请输入运抵国别" v-model="editPreBook.arriveCountry"></a-input>
  99. </a-form-model-item>
  100. </a-col>
  101. <a-col :md="6" :sm="8">
  102. <a-form-model-item label="出口口岸" prop="exportPort">
  103. <a-input placeholder="请输入出口口岸" v-model="editPreBook.exportPort"></a-input>
  104. </a-form-model-item>
  105. </a-col>
  106. <a-col :md="6" :sm="8">
  107. <a-form-model-item label="目的港" prop="destinationport">
  108. <a-input placeholder="请输入目的港" v-model="editPreBook.destinationport"></a-input>
  109. </a-form-model-item>
  110. </a-col>
  111. <a-col :md="6" :sm="8">
  112. <a-form-model-item label="收汇方式" prop="collectionMethod">
  113. <a-input placeholder="请输入收汇方式" v-model="editPreBook.collectionMethod"></a-input>
  114. </a-form-model-item>
  115. </a-col>
  116. <a-col :md="6" :sm="8">
  117. <a-form-model-item label="成交方式" prop="soldType">
  118. <a-input placeholder="请输入成交方式" v-model="editPreBook.soldType"></a-input>
  119. </a-form-model-item>
  120. </a-col>
  121. <a-col :md="6" :sm="8">
  122. <a-form-model-item label="金额" prop="money">
  123. <a-input placeholder="请输入金额" v-model="editPreBook.money"></a-input>
  124. </a-form-model-item>
  125. </a-col>
  126. <a-col :md="6" :sm="8">
  127. <a-form-model-item label="人民币" prop="RMB">
  128. <a-input placeholder="请输入人民币" v-model="editPreBook.RMB"></a-input>
  129. </a-form-model-item>
  130. </a-col>
  131. <a-col :md="6" :sm="8">
  132. <a-form-model-item label="美元" prop="dollar">
  133. <a-input placeholder="请输入美元" v-model="editPreBook.dollar"></a-input>
  134. </a-form-model-item>
  135. </a-col>
  136. </a-row>
  137. </a-form-model>
  138. </div>
  139. </a-card>
  140. <!--操作按钮区域 参照预装箱单 増行-->
  141. <a-card :bordered="true" style="marginTop:10px;">
  142. <div class="table-operator">
  143. <a-button type="primary" @click="referadvancePackingList" icon="ordered-list">参照预装箱单</a-button>
  144. <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
  145. </div>
  146. <!-- table :rules="validatorRules"-->
  147. <a-spin :spinning="confirmLoading">
  148. <a-form-model ref="formRef" >
  149. <a-table
  150. bordered
  151. rowKey="id"
  152. :columns="columns"
  153. :data-source="data"
  154. :loading="loading"
  155. :pagination="ipagination"
  156. :scroll="{ x: 1500 }"
  157. @change="handleTableChange"
  158. >
  159. <!-- 集装箱代号 输入框 -->
  160. <template slot="containerCode" slot-scope="text, record, index">
  161. <a-form-model-item prop="containerCode" :rules="rules.containerCode" required>
  162. <a-input style="width:100%" type="text" v-model="record.containerCode" />
  163. </a-form-model-item>
  164. </template>
  165. <!-- 集装箱号 输入框-->
  166. <template slot="containerNo" slot-scope="text, record, index">
  167. <a-form-model-item prop="containerNo" :rules="rules.containerNo">
  168. <a-input style="width:100%" type="text" v-model="record.containerNo" />
  169. </a-form-model-item>
  170. </template>
  171. <!-- 操作 -->
  172. <span slot="operationSlot" slot-scope="text, record">
  173. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
  174. <a href="javascript:void(0);" style="color:red;">删除</a>
  175. </a-popconfirm>
  176. </span>
  177. </a-table>
  178. </a-form-model>
  179. </a-spin>
  180. <!-- 人民币、美金 -->
  181. <a-row style="marginTop:10px;marginBottom:50px;background:white;padding:10px;">
  182. <div class="purchase-order-table" style="width:48%;marginRight:4%;float:left;">
  183. <h6 class="table-title">人民币</h6>
  184. <a-table
  185. :row-key="record => record.id"
  186. :loading="loading"
  187. :columns="CNYColumns"
  188. :data-source="CNYData"
  189. bordered
  190. :pagination="false"
  191. >
  192. <!-- CNY项目列 -->
  193. <template slot="CNYProjectList" slot-scope="text, record, index">
  194. <a-form-model-item prop="CNYProjectList" :rules="rules.CNYProjectList">
  195. <a-select v-model="record.CNYProjectList" 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. <div class="purchase-order-table" style="width:48%;float:right;">
  204. <h6 class="table-title">美金</h6>
  205. <a-table
  206. :row-key="record => record.id"
  207. :loading="loading"
  208. :columns="USDColumns"
  209. :data-source="USDData"
  210. bordered
  211. :pagination="false"
  212. >
  213. <!-- USD项目列 -->
  214. <template slot="USDProjectList" slot-scope="text, record, index">
  215. <a-form-model-item prop="USDProjectList" :rules="rules.USDProjectList">
  216. <a-select v-model="record.USDProjectList" style="width:100%">
  217. <a-select-option :value="1">项目列1</a-select-option>
  218. <a-select-option :value="2">项目列2</a-select-option>
  219. </a-select>
  220. </a-form-model-item>
  221. </template>
  222. </a-table>
  223. </div>
  224. </a-row>
  225. </a-card>
  226. <!-- 页面底部保存取消 -->
  227. <div
  228. :style="{
  229. position: 'absolute',
  230. right: 0,
  231. bottom: 0,
  232. width: '100%',
  233. borderTop: '1px solid #e9e9e9',
  234. padding: '10px 16px',
  235. background: '#fff',
  236. textAlign: 'right',
  237. zIndex: 1
  238. }"
  239. >
  240. <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
  241. <a-button :style="{ marginRight: '8px' }">取消</a-button>
  242. </a-popconfirm>
  243. <a-button type="primary" @click="submitAdd">
  244. 提交
  245. </a-button>
  246. </div>
  247. </a-drawer>
  248. <!-- 参照预装箱单 -->
  249. <advancePackingList-modal ref="advancePackingListModal" :father="aa" @ok="modalFormOk"></advancePackingList-modal>
  250. </div>
  251. </template>
  252. <script>
  253. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  254. import JEllipsis from '@/components/jeecg/JEllipsis'
  255. import moment from 'moment'
  256. import AdvancePackingListModal from '@views/pre-book/advancePackingListModal.vue'
  257. export default {
  258. name: 'EditPreBookDrawer', // 编辑预托书
  259. computed: {},
  260. mixins: [JeecgListMixin],
  261. components: { AdvancePackingListModal, JEllipsis, moment }, // 参照预装箱单 弹框
  262. data() {
  263. return {
  264. // 表头
  265. columns: [
  266. {
  267. title: '英文名称',
  268. dataIndex: 'englishName',
  269. width: 120,
  270. // fixed: 'left',
  271. className: 'replacecolor'
  272. },
  273. {
  274. title: '款号',
  275. dataIndex: 'styleNum',
  276. width: 120,
  277. // fixed: 'left',
  278. className: 'replacecolor'
  279. },
  280. {
  281. title: '小po号',
  282. dataIndex: 'smallPoNum',
  283. width: 120,
  284. className: 'replacecolor'
  285. },
  286. {
  287. title: '数量',
  288. dataIndex: 'quantity',
  289. width: 120,
  290. className: 'replacecolor'
  291. },
  292. {
  293. title: '箱数',
  294. dataIndex: 'boxedNum',
  295. width: 90,
  296. className: 'replacecolor'
  297. },
  298. {
  299. title: '毛重',
  300. dataIndex: 'roughWeigh',
  301. width: 120,
  302. className: 'replacecolor'
  303. },
  304. {
  305. title: '净重',
  306. dataIndex: 'suttle',
  307. width: 120,
  308. className: 'replacecolor'
  309. },
  310. {
  311. title: '体积',
  312. dataIndex: 'volume',
  313. width: 160,
  314. className: 'replacecolor'
  315. },
  316. {
  317. title: '分销点',
  318. dataIndex: 'distributionPoint',
  319. width: 120,
  320. className: 'replacecolor'
  321. },
  322. {
  323. title: '集装箱代号',
  324. dataIndex: 'containerCode',
  325. width: 120,
  326. scopedSlots: { customRender: 'containerCode' },
  327. className: 'replacecolor'
  328. },
  329. {
  330. title: '集装箱号',
  331. dataIndex: 'containerNo',
  332. width: 120,
  333. scopedSlots: { customRender: 'containerNo' },
  334. className: 'replacecolor'
  335. },
  336. {
  337. title: '单价',
  338. dataIndex: 'price',
  339. width: 120,
  340. className: 'replacecolor'
  341. },
  342. // {
  343. // title: '创建时间',
  344. // dataIndex: 'createTime',
  345. // align: 'center',
  346. // sorter: true,
  347. // customRender: text => {
  348. // return moment(text).format('YYYY-MM-DD')
  349. // }
  350. // },
  351. {
  352. title: '预发货日期',
  353. dataIndex: 'scheduledShipDate',
  354. width: 120,
  355. className: 'replacecolor'
  356. },
  357. {
  358. title: '业务员',
  359. dataIndex: 'salesman',
  360. width: 120,
  361. className: 'replacecolor'
  362. },
  363. {
  364. title: '业务部门',
  365. dataIndex: 'operatingDepartment',
  366. width: 120,
  367. className: 'replacecolor'
  368. },
  369. {
  370. title: '采购/委外订单号',
  371. dataIndex: 'purchaseAboardOrderNum',
  372. width: 160,
  373. className: 'replacecolor'
  374. },
  375. {
  376. title: '采购/委外工厂',
  377. dataIndex: 'purchaseAboardFactory',
  378. width: 160,
  379. className: 'replacecolor'
  380. },
  381. {
  382. title: '操作',
  383. dataIndex: 'operation',
  384. scopedSlots: { customRender: 'operationSlot' },
  385. width: 160,
  386. fixed: 'right',
  387. className: 'replacecolor'
  388. }
  389. ],
  390. data: [],
  391. CNYColumns: [
  392. {
  393. title: '货代',
  394. dataIndex: 'CNYfreighForward',
  395. width: 60,
  396. className: 'replacecolor'
  397. },
  398. {
  399. title: '金额',
  400. dataIndex: 'CNYmoney',
  401. width: 60,
  402. className: 'replacecolor'
  403. },
  404. {
  405. title: '项目列',
  406. dataIndex: 'CNYProjectList',
  407. width: 60,
  408. scopedSlots: { customRender: 'CNYProjectList' },
  409. className: 'replacecolor'
  410. }
  411. ],
  412. CNYData: [],
  413. USDColumns: [
  414. {
  415. title: '货代',
  416. dataIndex: 'USDfreighForward',
  417. width: 60,
  418. className: 'replacecolor'
  419. },
  420. {
  421. title: '金额',
  422. dataIndex: 'USDmoney',
  423. width: 60,
  424. className: 'replacecolor'
  425. },
  426. {
  427. title: '项目列',
  428. dataIndex: 'USDProjectList',
  429. width: 60,
  430. scopedSlots: { customRender: 'USDProjectList' },
  431. className: 'replacecolor'
  432. }
  433. ],
  434. USDData: [],
  435. loading: false, // 表格加载
  436. editPreBook: {},
  437. confirmLoading: false,
  438. visible: false,
  439. dateFormat: 'YYYY-MM-DD',
  440. // validatorRules: {
  441. // bookDate: [{ required: true, message: '托书日期不能为空', trigger: 'blur' }]
  442. // // 确定必填项
  443. // }
  444. }
  445. },
  446. created() {},
  447. methods: {
  448. // 参照预装箱单
  449. referadvancePackingList() {
  450. console.log('打开参照订单数据')
  451. // 打开订单数据弹框
  452. this.$refs.advancePackingListModal.advancePackingListModVis = true
  453. },
  454. // 増行
  455. handleAddColumn() {
  456. console.log('増行')
  457. const addrow = {
  458. englishName: '',
  459. styleNum: '',
  460. smallPoNum: '',
  461. quantity: '',
  462. boxedNum: '',
  463. roughWeigh: '',
  464. suttle: '',
  465. volume: '',
  466. distributionPoint: '',
  467. containerCode: '',
  468. containerNo: '',
  469. price: '',
  470. scheduledShipDate: '',
  471. salesman: '',
  472. operatingDepartment: '',
  473. purchaseAboardOrderNum: '',
  474. purchaseAboardFactory: '',
  475. operation: ''
  476. }
  477. this.data.push(addrow)
  478. },
  479. // ------------------------------------------
  480. // 操作 删除
  481. handleDelete(id) {
  482. console.log('id:', id)
  483. },
  484. // 抽屉 取消
  485. handleCancel() {
  486. console.log('点击抽屉取消')
  487. this.close()
  488. },
  489. // 抽屉 提交
  490. submitAdd() {
  491. console.log('保存新增、刷新预托书')
  492. const that = this
  493. // 触发表单验证
  494. this.$refs.form.validate(valid => {
  495. if (valid) {
  496. that.confirmLoading = true
  497. }
  498. })
  499. this.close()
  500. // this.getShipmentList() // 刷新发运明细列表
  501. },
  502. close() {
  503. this.$emit('close')
  504. this.visible = false
  505. this.$refs.form.resetFields()
  506. },
  507. // ------------------------------------------
  508. modalFormOk() {},
  509. aa() {}
  510. // // 分页、排序、筛选变化时触发
  511. // handleTableChange(pagination, filters, sorter) {
  512. // // console.log('当前页信息>>>>',pagination)
  513. // this.queryParam.pageNo = pagination.current
  514. // this.getAnnList()
  515. // }
  516. },
  517. mounted() {}
  518. }
  519. </script>
  520. <style lang="less" scoped>
  521. @import '~@assets/less/common.less';
  522. /deep/ .ant-table-thead > tr > th {
  523. text-align: center;
  524. // font-weight: 700;
  525. }
  526. /deep/ .ant-table-tbody {
  527. text-align: center;
  528. }
  529. // /deep/ th.replacecolor {
  530. // background-color: #ccc;
  531. // }
  532. // 抽屉里的card样式
  533. /deep/ .ant-drawer-content {
  534. background-color: #f0f2f5;
  535. }
  536. /deep/ .ant-drawer-body {
  537. padding: 10px;
  538. }
  539. </style>