addPreBookDrawer.vue 25 KB

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