addPreBookDrawer.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. <template>
  2. <!-- 新增预托书 -->
  3. <div id="addPreBookDrawer">
  4. <a-drawer
  5. :title="(defultMethod == 'add')?'新增预托书':'编辑预托书'"
  6. width="89%"
  7. placement="right"
  8. :closable="true"
  9. :visible="visible"
  10. @close="handleCancel"
  11. destroyOnClose
  12. >
  13. <!-- 主表信息 -->
  14. <a-card :bordered="true">
  15. <div class="table-page-search-wrapper">
  16. <!-- :rules="validatorRules" -->
  17. <a-form-model layout="inline" ref="form" :model="addPreBook" :rules="validatorRules">
  18. <a-row :gutter="24">
  19. <a-col :md="6" :sm="8">
  20. <a-form-model-item label="预托书号" prop="depositaryReceiptNo">
  21. <a-input placeholder="请填写预托书号" v-model="addPreBook.depositaryReceiptNo" @blur="convertUppercase(addPreBook.depositaryReceiptNo)"></a-input>
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-model-item label="托书日期" prop="shippingOrderDate">
  26. <a-date-picker
  27. placeholder="请选择托书日期"
  28. style="width:100%;"
  29. :format="dateFormat"
  30. v-model="addPreBook.shippingOrderDate"
  31. />
  32. </a-form-model-item>
  33. </a-col>
  34. <!-- <a-col :md="12" :sm="16">
  35. <a-form-model-item label="外销发票号码" prop="exportInvoiceNo">
  36. <a-input placeholder="请输入外销发票号码" v-model="addPreBook.exportInvoiceNo"></a-input>
  37. </a-form-model-item>
  38. </a-col> -->
  39. <a-col :md="6" :sm="8">
  40. <a-form-model-item label="经营单位" prop="unitInOperation">
  41. <j-search-select-tag
  42. placeholder="请选择收货人"
  43. v-model="addPreBook.unitInOperation"
  44. @change="unitInOperationChange"
  45. dict="test-200">
  46. </j-search-select-tag>
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :md="6" :sm="8">
  50. <a-form-model-item label="经营单位地址" prop="unitInOperationAddress">
  51. <a-input placeholder="根据经营单位自动带出" v-model="addPreBook.unitInOperationAddress"></a-input>
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-model-item label="进仓/装柜日期" prop="latestDateOfShipment">
  56. <a-date-picker
  57. placeholder="请选择进仓/装柜日期"
  58. style="width:100%;"
  59. :format="dateFormat"
  60. v-model="addPreBook.latestDateOfShipment"
  61. />
  62. </a-form-model-item>
  63. </a-col>
  64. <a-col :md="6" :sm="8">
  65. <a-form-model-item label="最终船期" prop="theFinalShippingDate">
  66. <a-date-picker placeholder="请输入最终船期" style="width:100%;" v-model="addPreBook.theFinalShippingDate"/>
  67. </a-form-model-item>
  68. </a-col>
  69. <a-col :md="6" :sm="8">
  70. <a-form-model-item label="贸易国别" prop="tradeCountry">
  71. <j-search-select-tag
  72. placeholder="请选择贸易国别"
  73. v-model="addPreBook.tradeCountry"
  74. dict="trade_country">
  75. </j-search-select-tag>
  76. <!-- <a-input placeholder="请输入贸易国别" v-model="addPreBook.tradeCountry"></a-input> -->
  77. </a-form-model-item>
  78. </a-col>
  79. <a-col :md="6" :sm="8">
  80. <a-form-model-item label="运抵国别" prop="arriveInCountry">
  81. <j-search-select-tag
  82. placeholder="请选择运抵国别"
  83. v-model="addPreBook.arriveInCountry"
  84. dict="country_of_arrival">
  85. </j-search-select-tag>
  86. <!-- <a-input placeholder="请输入运抵国别" v-model="addPreBook.arriveInCountry"></a-input> -->
  87. </a-form-model-item>
  88. </a-col>
  89. <a-col :md="6" :sm="8">
  90. <a-form-model-item label="收货人" prop="consignee">
  91. <!-- <j-dict-select-tag
  92. style="width:100%;margin-bottom: 10px;" v-model="addPreBook.consigneeAll"
  93. dictCode="sys_dict_item,item_text,description,dict_id in(select id from sys_dict where dict_code='receiving_goods_info')"
  94. @change="consigneeSelectChange"/> -->
  95. <j-search-select-tag
  96. placeholder="请选择收货人"
  97. v-model="addPreBook.consignee"
  98. @change="consigneeSelectChange"
  99. dict="receiving_goods_info">
  100. </j-search-select-tag>
  101. </a-form-model-item>
  102. </a-col>
  103. <a-col :md="6" :sm="8">
  104. <a-form-model-item label="收货人地址" prop="consigneeAddress">
  105. <a-input placeholder="根据收货人自动带出" v-model="addPreBook.consigneeAddress" ></a-input>
  106. </a-form-model-item>
  107. </a-col>
  108. <a-col :md="6" :sm="8">
  109. <a-form-model-item label="通知方" prop="notifyParty">
  110. <a-input placeholder="根据收货人自动带出" v-model="addPreBook.notifyParty" ></a-input>
  111. </a-form-model-item>
  112. </a-col>
  113. <a-col :md="6" :sm="8">
  114. <a-form-model-item label="通知方地址" prop="notifyPartyAddress">
  115. <a-input placeholder="根据收货人自动带出" v-model="addPreBook.notifyPartyAddress" ></a-input>
  116. </a-form-model-item>
  117. </a-col>
  118. <a-col :md="6" :sm="8">
  119. <a-form-model-item label="出口口岸" prop="exportPort">
  120. <j-search-select-tag
  121. placeholder="请选择出口口岸"
  122. v-model="addPreBook.exportPort"
  123. dict="export_port">
  124. </j-search-select-tag>
  125. <!-- <a-input placeholder="请输入出口口岸" v-model="addPreBook.exportPort"></a-input> -->
  126. </a-form-model-item>
  127. </a-col>
  128. <a-col :md="6" :sm="8">
  129. <a-form-model-item label="目的港" prop="destinationPort">
  130. <j-search-select-tag
  131. placeholder="请选择目的港"
  132. v-model="addPreBook.destinationPort"
  133. dict="port_of_destination">
  134. </j-search-select-tag>
  135. <!-- <a-input placeholder="请输入目的港" v-model="addPreBook.destinationPort"></a-input> -->
  136. </a-form-model-item>
  137. </a-col>
  138. <a-col :md="6" :sm="8">
  139. <a-form-model-item label="收汇方式" prop="exchangeEarningsValue">
  140. <j-search-select-tag
  141. placeholder="请选择收汇方式"
  142. v-model="addPreBook.exchangeEarningsValue"
  143. dict="collection_method">
  144. </j-search-select-tag>
  145. <!-- <a-input placeholder="请输入收汇方式" v-model="addPreBook.exchangeEarningsValue"></a-input> -->
  146. </a-form-model-item>
  147. </a-col>
  148. <a-col :md="6" :sm="8">
  149. <a-form-model-item label="成交方式" prop="termsOfDeliveryvalue">
  150. <j-search-select-tag
  151. placeholder="请选择成交方式"
  152. v-model="addPreBook.termsOfDeliveryvalue"
  153. dict="transaction_method"
  154. change>
  155. </j-search-select-tag>
  156. <!-- <a-input placeholder="请输入成交方式" v-model="addPreBook.termsOfDeliveryvalue"></a-input> -->
  157. </a-form-model-item>
  158. </a-col>
  159. <a-col :md="6" :sm="8">
  160. <a-form-model-item label="金额" prop="money">
  161. <a-input placeholder="请输入金额" v-model="addPreBook.money"></a-input>
  162. </a-form-model-item>
  163. </a-col>
  164. </a-row>
  165. </a-form-model>
  166. </div>
  167. </a-card>
  168. <!--操作按钮区域 参照预装箱单 増行-->
  169. <a-card :bordered="true" style="margin:10px 0 60px 0;">
  170. <!-- table-->
  171. <a-spin :spinning="confirmLoading">
  172. <!-- :rules="validatorRules" -->
  173. <j-vxe-table
  174. ref="vTable"
  175. toolbar
  176. row-number
  177. row-selection
  178. drag-sort
  179. keep-source
  180. :height="350"
  181. :loading="loading"
  182. :dataSource="addPreBook.syLetterDepositItemList"
  183. :columns="addPerBookColumns"
  184. :alwaysEdit=true
  185. :bordered=true
  186. :toolbarConfig="toolbarConfig"
  187. @valueChange="handleValueChange"
  188. >
  189. <template v-slot:toolbarSuffix>
  190. <a-button @click="referadvancePackingList" type="primary" icon="ordered-list">参照预装箱单</a-button>
  191. </template>
  192. <template v-slot:action="props">
  193. <a-popconfirm title="确定删除吗?" @confirm="handleDelete(props)">
  194. <a>删除</a>
  195. </a-popconfirm>
  196. </template>
  197. </j-vxe-table>
  198. </a-spin>
  199. </a-card>
  200. <!-- 页面底部保存取消 -->
  201. <div
  202. :style="{
  203. position: 'absolute',
  204. right: 0,
  205. bottom: 0,
  206. width: '100%',
  207. borderTop: '1px solid #e9e9e9',
  208. padding: '10px 16px',
  209. background: '#fff',
  210. textAlign: 'right',
  211. zIndex: 999
  212. }"
  213. >
  214. <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
  215. <a-button :style="{ marginRight: '8px' }">取消</a-button>
  216. </a-popconfirm>
  217. <a-button type="primary" @click="myHandSave" :disabled="confirmLoading">
  218. 保存
  219. </a-button>
  220. <!-- <a-button type="primary" @click="myHandSubmit" style="margin-left: 8px">
  221. 保存并提交
  222. </a-button> -->
  223. </div>
  224. </a-drawer>
  225. <!-- 参照预装箱单 -->
  226. <advancePackingList-modal ref="advancePackingListModal" :father="aa" @callback="referCallback" @ok="modalFormOk"></advancePackingList-modal>
  227. </div>
  228. </template>
  229. <script>
  230. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  231. import JEllipsis from '@/components/jeecg/JEllipsis'
  232. import moment from 'moment'
  233. import AdvancePackingListModal from '@views/pre-book/advancePackingListModal.vue'
  234. import { JVXETypes } from '@/components/jeecg/JVxeTable'
  235. import { addPreBook, editById } from '@api/document/pre-book.js'
  236. export default {
  237. name: 'AddPreBookDrawer', // 新增预托书
  238. computed: {},
  239. mixins: [JeecgListMixin],
  240. components: { AdvancePackingListModal, JEllipsis, moment }, // 参照预装箱单 弹框
  241. data() {
  242. return {
  243. // 表头
  244. addPerBookColumns: [
  245. // {
  246. // title: '英文名称',
  247. // key: 'englishName',
  248. // width: 120,
  249. // fixed: 'left',
  250. // className: 'replacecolor'
  251. // },
  252. {
  253. title: '款号',
  254. key: 'itemNumber',
  255. width: 80,
  256. // fixed: 'left',
  257. className: 'replacecolor'
  258. },
  259. {
  260. title: '小po',
  261. key: 'smallPo',
  262. width: 100,
  263. className: 'replacecolor'
  264. },
  265. {
  266. title: '数量',
  267. key: 'total',
  268. width: 80,
  269. className: 'replacecolor'
  270. },
  271. {
  272. title: '箱数',
  273. key: 'boxNumber',
  274. width: 80,
  275. className: 'replacecolor'
  276. },
  277. {
  278. title: '毛重',
  279. key: 'totalGrossWeight',
  280. width: 90,
  281. className: 'replacecolor'
  282. },
  283. {
  284. title: '净重',
  285. key: 'totalNetWeight',
  286. width: 90,
  287. className: 'replacecolor'
  288. },
  289. {
  290. title: '体积',
  291. key: 'totalVolume',
  292. width: 90,
  293. className: 'replacecolor'
  294. },
  295. {
  296. title: '分销点',
  297. key: 'distributionPoint',
  298. width: 100,
  299. className: 'replacecolor'
  300. },
  301. // {
  302. // title: '集装箱代号',
  303. // key: 'containerCode',
  304. // width: 120,
  305. // type:JVXETypes.inputNumber,
  306. // className: 'replacecolor',
  307. // },
  308. {
  309. title: '集装箱号',
  310. key: 'containerNumber',
  311. width: 100,
  312. type:JVXETypes.input,
  313. className: 'replacecolor',
  314. },
  315. {
  316. title: '单价',
  317. key: 'unitPrice',
  318. width: 80,
  319. className: 'replacecolor'
  320. },
  321. {
  322. title: '金额',
  323. key: 'totalPrice',
  324. width: 80,
  325. className: 'replacecolor'
  326. },
  327. // {
  328. // title: '创建时间',
  329. // dataIndex: 'createTime',
  330. // align: 'center',
  331. // sorter: true,
  332. // customRender: text => {
  333. // return moment(text).format('YYYY-MM-DD')
  334. // }
  335. // },
  336. {
  337. title: '预发货日期',
  338. key: 'preDeliveryDate',
  339. width: 100,
  340. className: 'replacecolor'
  341. },
  342. {
  343. title: '业务员',
  344. key: 'salesman',
  345. width: 90,
  346. className: 'replacecolor'
  347. },
  348. {
  349. title: '业务部门',
  350. key: 'salesDepartment',
  351. width: 90,
  352. className: 'replacecolor'
  353. },
  354. {
  355. title: '采购/委外订单号',
  356. key: 'spurOrSubOrder',
  357. width: 160,
  358. className: 'replacecolor'
  359. },
  360. {
  361. title: '采购/委外工厂',
  362. key: 'supplier',
  363. width: 140,
  364. className: 'replacecolor'
  365. },
  366. {
  367. title: '操作',
  368. key: 'action',
  369. type: JVXETypes.slot,
  370. width: 100,
  371. align: 'center',
  372. fixed: 'right',
  373. slotName: 'action',
  374. }
  375. ],
  376. addPerBookData: [],
  377. msgFormSon: 'test', // 子组件传来数据的变量
  378. loading: false, // 表格加载
  379. addPreBook: {}, //主表信息
  380. confirmLoading: false,
  381. visible: false,
  382. defultMethod:'add',
  383. dateFormat: 'YYYY-MM-DD',
  384. toolbarConfig: {
  385. btn: []
  386. },
  387. validatorRules:{
  388. shippingOrderDate:[{required: true, message: '托书日期不能为空!'}],
  389. consignee:[{required: true, message: '收货人不能为空!'}],
  390. depositaryReceiptNo:[{required: true, message: '预托书号不能为空!'}],
  391. unitInOperation:[{required: true, message: '经营单位不能为空!'}],
  392. unitInOperationAddress:[{required: true, message: '经营单位地址不能为空!'}],
  393. tradeCountry:[{required: true, message: '贸易国别不能为空!'}],
  394. arriveInCountry:[{required: true, message: '运抵国别不能为空!'}],
  395. exportPort:[{required: true, message: '出口口岸不能为空!'}],
  396. destinationPort:[{required: true, message: '目的港不能为空!'}],
  397. },
  398. }
  399. },
  400. created() {},
  401. methods: {
  402. moment,
  403. //预托书号转化大写
  404. convertUppercase(val){
  405. this.addPreBook.depositaryReceiptNo = val.toUpperCase()
  406. },
  407. // 参照预装箱单
  408. referadvancePackingList() {
  409. //子表中有数据时,传值给参照数据组件
  410. if(this.addPreBook.syLetterDepositItemList.length !== 0){
  411. this.$refs.advancePackingListModal.fatherData = this.addPreBook.syLetterDepositItemList
  412. }
  413. this.$refs.advancePackingListModal.advancePackingListModVis = true;
  414. this.$refs.advancePackingListModal.queryParam = {};
  415. this.$refs.advancePackingListModal.searchQuery();
  416. },
  417. // 増行
  418. handleAddColumn() {
  419. console.log('増行')
  420. const addrow = {
  421. id:"",
  422. syLetterDepositId:"",
  423. preDeliveryDate:"",
  424. clientAbbreviation:"",
  425. syPreAssembledPackingListId:"",
  426. syPreAssembledPackingListItemId:"",
  427. acSetNo:"",
  428. garmentFactory:"",
  429. // hod:"",
  430. styleNo:"",
  431. smallPo:"",
  432. itemCode:"",
  433. distributionPoint:"",
  434. size:"",
  435. startingBoxNumber:"",
  436. endCaseNumber:"",
  437. colour:"",
  438. piecesBox:"",
  439. boxNumber:"",
  440. total:"",
  441. netWeight:"",
  442. totalNetWeight:"",
  443. grossWeight:"",
  444. totalGrossWeight:"",
  445. outerBoxLength:0,
  446. outerBoxWidth:0,
  447. outerBoxHeight:0,
  448. totalVolume:"",
  449. netWeightToo:0,
  450. unitPrice:"",
  451. totalPrice:"",
  452. containerCode:"",
  453. containerNumber:"",
  454. custor:"",
  455. itemNumber:"",
  456. preAssembledPackingNo:"",
  457. salesman:"",
  458. salesDepartment:"",
  459. spurOrSubOrder:""
  460. }
  461. this.addPerBookData.push(addrow)
  462. },
  463. // ------------------------------------------
  464. // 操作 删除
  465. handleDelete(prop) {
  466. this.addPreBook.syLetterDepositItemList.splice(prop.index, 1);
  467. this.setHeadCalField();
  468. },
  469. // 抽屉 取消
  470. handleCancel() {
  471. this.close()
  472. },
  473. //保存
  474. myHandSave(){
  475. this.addPreBook.theDocumentsState=0;
  476. this.saveAdd();
  477. },
  478. //保存并提交
  479. myHandSubmit(){
  480. this.addPreBook.theDocumentsState=1;
  481. this.saveAdd();
  482. },
  483. // 抽屉 提交
  484. saveAdd() {
  485. const that = this;
  486. var newObj = this.addPreBook;
  487. newObj.latestDateOfShipment =(this.addPreBook.latestDateOfShipment&&this.addPreBook.latestDateOfShipment!=='') ?moment(this.addPreBook.latestDateOfShipment).format('YYYY-MM-DD'):'';
  488. newObj.theFinalShippingDate =(this.addPreBook.theFinalShippingDate&&this.addPreBook.theFinalShippingDate!=='') ? moment(this.addPreBook.theFinalShippingDate).format('YYYY-MM-DD'):'';
  489. if (newObj.syLetterDepositItemList.length == 0){
  490. this.$message.error('当前记录没有子表记录,无法保存');
  491. return;
  492. }
  493. // 触发表单验证
  494. this.$refs.form.validate(valid => {
  495. if (valid) {
  496. // for(var i =0;i<newObj.syLetterDepositItemList.length;i++){
  497. // var row = newObj.syLetterDepositItemList[i]
  498. // if(row.containerCode === '' || !row.containerCode){
  499. // this.$message.error('第'+(i+1)+'行集装箱代号未填,无法保存!');
  500. // return
  501. // }
  502. // if(row.containerNumber === '' || !row.containerNumber){
  503. // this.$message.error('第'+(i+1)+'行集装箱号未填,无法保存!');
  504. // return
  505. // }
  506. // }
  507. that.confirmLoading = true;
  508. if (newObj.id == undefined || newObj.id == "" || newObj.id == null){
  509. addPreBook(newObj).then(res => {
  510. that.confirmLoading = false;
  511. if (res.success) {
  512. this.$message.success('新增成功')
  513. this.close()
  514. //清空信息
  515. this.fatherList(); // 调用父组件 查询方法
  516. // this.msgFormSon = {} 清空子表信息
  517. }else{
  518. this.$message.error(res.message)
  519. }
  520. })
  521. }else{
  522. newObj.syLetterDepositItemList.map(item =>{
  523. item.hod = item.preDeliveryDate
  524. delete item.preDeliveryDate
  525. })
  526. editById(newObj).then(res => {
  527. that.confirmLoading = false;
  528. if (res.success) {
  529. this.$message.success('修改成功')
  530. this.close();
  531. this.fatherList() // 调用父组件 查询方法
  532. // this.msgFormSon = {} 清空子表信息
  533. }else{
  534. this.$message.error(res.message)
  535. }
  536. })
  537. }
  538. }
  539. })
  540. // this.getShipmentList() // 刷新发运明细列表
  541. },
  542. close() {
  543. this.$emit('close')
  544. this.visible = false
  545. this.defultMethod = 'add'
  546. this.$refs.form.resetFields()
  547. this.addPreBook={}
  548. },
  549. // ------------------------------------------
  550. modalFormOk() {},
  551. aa() {},
  552. // 参照回调
  553. referCallback(dataList){
  554. var subList = this.convertReferToSub(dataList);
  555. var filterList = subList.filter(newItem=>{
  556. return this.addPreBook.syLetterDepositItemList.filter(item=>{
  557. return item.syPreAssembledPackingListItemId === newItem.syPreAssembledPackingListItemId;
  558. }).length == 0;
  559. });
  560. this.addPreBook.syLetterDepositItemList = this.addPreBook.syLetterDepositItemList.concat(filterList);
  561. this.addPreBook.termsOfDeliveryvalue = 'FOB'
  562. this.addPreBook.exchangeEarningsValue = 'T/T'
  563. if(this.addPreBook.exportPort==''||!this.addPreBook.exportPort){
  564. this.addPreBook.exportPort='NINGBO'
  565. }
  566. var dd = moment(new Date()).format('YYYY-MM-DD')
  567. this.$set( this.addPreBook,'shippingOrderDate',dd)
  568. // this.addPreBook.shippingOrderDate = moment(new Date()).format('YYYY-MM-DD')
  569. this.setHeadCalField();
  570. },
  571. // 参照数据转换成子表
  572. convertReferToSub(dataList){
  573. var ret = [];
  574. for (var i=0; i<dataList.length; i++){
  575. var data = dataList[i];
  576. var sub = {
  577. id:"",
  578. syLetterDepositId:"",
  579. preDeliveryDate:data.preDeliveryDate,
  580. clientAbbreviation:data.customerAbbreviation,
  581. syPreAssembledPackingListId:data.id,
  582. syPreAssembledPackingListItemId:data.itemId,
  583. acSetNo:data.acSetNo,
  584. garmentFactory:"",
  585. // hod:"",
  586. styleNo:"",
  587. smallPo:data.smallPo,
  588. itemCode:"",
  589. distributionPoint:data.distributionPoint,
  590. size:data.size,
  591. startingBoxNumber:"",
  592. endCaseNumber:"",
  593. colour:data.colour,
  594. piecesBox:data.piecesBox,
  595. boxNumber:data.boxNumber,
  596. total:data.totalQuantity,
  597. netWeight:data.totalNetWeight/data.boxNumber,
  598. totalNetWeight:data.totalNetWeight,
  599. grossWeight:data.totalGrossWeight/data.boxNumber,
  600. totalGrossWeight:data.totalGrossWeight,
  601. outerBoxLength:0,
  602. outerBoxWidth:0,
  603. outerBoxHeight:0,
  604. totalVolume:data.totalVolume,
  605. netWeightToo:0,
  606. unitPrice:data.unitPrice,
  607. totalPrice:data.totalPrice,
  608. containerCode:data.containerCode,
  609. containerNumber:data.containerNumber,
  610. custor:data.customer,
  611. itemNumber:data.itemNumber,
  612. preAssembledPackingNo:data.documentNo,
  613. salesman:data.salesman,
  614. salesDepartment:data.salesDepartment,
  615. spurOrSubOrder:data.spurOrSubOrder,
  616. supplier:data.supplier
  617. };
  618. ret.push(sub);
  619. }
  620. return ret;
  621. },
  622. handleValueChange(event) {
  623. },
  624. // 收货人下拉框
  625. consigneeSelectChange(value){
  626. if(value !=null && value !='' &&value != 'undefined'){
  627. var arr = value.split("+");
  628. this.addPreBook.consignee = arr[0]
  629. if(arr.length == 4){
  630. this.addPreBook.consigneeAddress = arr[1]
  631. this.addPreBook.notifyParty = arr[2]
  632. this.addPreBook.notifyPartyAddress = arr[3]
  633. }else{
  634. this.$message.error('收货信息维护有问题,请检查!')
  635. }
  636. }else{
  637. this.addPreBook.consigneeAddress = '';
  638. this.addPreBook.notifyParty = '';
  639. this.addPreBook.notifyPartyAddress = '';
  640. }
  641. },
  642. //经营单位下拉框
  643. unitInOperationChange(val){
  644. if(val !=null && val !='' &&val != 'undefined'){
  645. var valueArr = val.split("+")
  646. this.addPreBook.unitInOperation = valueArr[0]
  647. this.addPreBook.unitInOperationAddress = valueArr[3]
  648. this.addPreBook.customsCode = valueArr[1]
  649. this.addPreBook.dutyParagraph = valueArr[2]
  650. }else {
  651. this.addPreBook.unitInOperation = ''
  652. this.addPreBook.unitInOperationAddress = ''
  653. this.addPreBook.customsCode = ''
  654. this.addPreBook.dutyParagraph = ''
  655. }
  656. },
  657. // 设置表头计算字段
  658. setHeadCalField(){
  659. var money = 0
  660. for (var i=0; i<this.addPreBook.syLetterDepositItemList.length; i++){
  661. money += this.addPreBook.syLetterDepositItemList[i].totalPrice;
  662. }
  663. this.addPreBook.money = money.toFixed(2);
  664. }
  665. },
  666. mounted() {},
  667. // 接收父组件查询方法
  668. props: {
  669. fatherList: {
  670. type: Function,
  671. default: null
  672. }
  673. },
  674. }
  675. </script>
  676. <style lang="less" scoped>
  677. @import '~@assets/less/common.less';
  678. @import '~@assets/less/overwriter.less';
  679. /deep/ .ant-table-thead > tr > th {
  680. text-align: center;
  681. // font-weight: 700;
  682. }
  683. /deep/ .ant-table-tbody {
  684. text-align: center;
  685. }
  686. // /deep/ th.replacecolor {
  687. // background-color: #ccc;
  688. // }
  689. // 抽屉里的card样式
  690. /deep/ .ant-drawer-content {
  691. background-color: #f0f2f5;
  692. }
  693. /deep/ .ant-drawer-body {
  694. padding: 10px;
  695. }
  696. </style>