addInvoiceDialog.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. v-if="visible"
  6. :visible.sync="visible"
  7. :title="title"
  8. :close-on-click-modal="false"
  9. :append-to-body="true"
  10. :fullscreen="fullscreen"
  11. width="70%"
  12. @close="cancel"
  13. >
  14. <template slot="title">
  15. <modalTitle
  16. :title="title"
  17. @setFullscreen="fullscreen = !fullscreen"
  18. ></modalTitle>
  19. </template>
  20. <el-form
  21. ref="form"
  22. :model="form"
  23. :rules="rules"
  24. class="el-form-box"
  25. label-width="120px"
  26. >
  27. <headerTitle title="收货确认单信息"></headerTitle>
  28. <el-row :gutter="12">
  29. <el-col :span="12">
  30. <el-form-item label="发货单" prop="sendNo">
  31. <el-input
  32. clearable
  33. v-model="form.sendNo"
  34. @click.native="handleSendOrderBtn"
  35. placeholder="请输入"
  36. />
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="12">
  40. <el-form-item prop="repliedFiles" label="回执附件">
  41. <fileMain v-model="form.repliedFiles"></fileMain>
  42. </el-form-item>
  43. </el-col>
  44. </el-row>
  45. <headerTitle title="发货信息"></headerTitle>
  46. <el-row :gutter="12">
  47. <el-col :span="12">
  48. <el-form-item label="销售订单" prop="orderNo">
  49. <el-input
  50. clearable
  51. v-model="form.orderNo"
  52. disabled
  53. @click.native="handleOrderBtn"
  54. placeholder="请输入"
  55. />
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="12">
  59. <el-form-item label="受托收货单">
  60. <el-input
  61. clearable
  62. disabled
  63. v-model="form.entrustedCode"
  64. @click.native="handleEntrustedReceive"
  65. placeholder="请输入"
  66. />
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row :gutter="12">
  71. <el-col :span="12">
  72. <el-form-item label="客户名称" prop="contactName">
  73. <el-input v-model="form.contactName" disabled></el-input>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="12">
  77. <el-form-item label="客户联系人" prop="linkName">
  78. <el-input
  79. clearable
  80. v-model="form.linkName"
  81. disabled
  82. placeholder="请输入"
  83. />
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row :gutter="12">
  88. <el-col :span="12">
  89. <el-form-item label="客户电话" prop="linkPhone">
  90. <el-input
  91. clearable
  92. v-model="form.linkPhone"
  93. disabled
  94. placeholder="请输入"
  95. />
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="12">
  99. <el-form-item label="收货地址" prop="receiveAddress">
  100. <el-input
  101. disabled
  102. clearable
  103. v-model="form.receiveAddress"
  104. placeholder="请输入"
  105. />
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="12">
  109. <el-form-item label="项目名称" prop="projectName">
  110. <el-input clearable v-model="form.projectName" :disabled="true" />
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="12">
  114. <el-form-item prop="sendFiles" label="发货附件">
  115. <fileMain v-model="form.sendFiles" type="view"></fileMain>
  116. </el-form-item>
  117. </el-col>
  118. </el-row>
  119. </el-form>
  120. <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
  121. <el-tab-pane label="收货产品明细" name="first">
  122. <ele-pro-table
  123. ref="table"
  124. :needPage="false"
  125. :columns="columns"
  126. :toolkit="[]"
  127. :datasource="form.productList"
  128. row-key="id"
  129. >
  130. <template v-slot:isException="scope">
  131. <el-select v-model="scope.row.isException" placeholder="请选择">
  132. <el-option
  133. v-for="item in options"
  134. :key="item.value"
  135. :label="item.label"
  136. :value="item.value"
  137. >
  138. </el-option>
  139. </el-select>
  140. </template>
  141. <template v-slot:notaxSinglePrice="scope">
  142. <el-input
  143. v-model="scope.row.notaxSinglePrice"
  144. placeholder="请输入"
  145. type="number"
  146. >
  147. <template slot="append">元</template>
  148. </el-input>
  149. </template>
  150. </ele-pro-table>
  151. </el-tab-pane>
  152. <el-tab-pane label="托盘清单" name="second">
  153. <!-- <palletTable ref="palletTableRef" type="view"></palletTable> -->
  154. <ele-pro-table
  155. ref="table"
  156. :needPage="false"
  157. :columns="trayListColumns"
  158. :toolkit="[]"
  159. :datasource="trayListData"
  160. row-key="id"
  161. >
  162. <template v-slot:type="scope">
  163. <el-select v-model="scope.row.type" placeholder="请选择">
  164. <el-option
  165. v-for="item in options1"
  166. :key="item.value"
  167. :label="item.label"
  168. :value="item.value"
  169. >
  170. </el-option>
  171. </el-select>
  172. </template>
  173. </ele-pro-table>
  174. </el-tab-pane>
  175. <el-tab-pane label="装载车叉车信息" name="third">
  176. <stowageTable ref="stowageTableRef" dialogType="view"></stowageTable>
  177. </el-tab-pane>
  178. <el-tab-pane label="运输清单" name="fourth">
  179. <taskInfoTable ref="taskInfoTableRef" dialogType="view"></taskInfoTable>
  180. </el-tab-pane>
  181. </el-tabs>
  182. <div slot="footer" class="footer">
  183. <el-button type="primary" @click="save" v-click-once>保存</el-button>
  184. <el-button
  185. type="primary"
  186. v-if="isNeed_process_is_close"
  187. @click="save('sub')"
  188. v-click-once
  189. >提交</el-button
  190. >
  191. <el-button @click="cancel">返回</el-button>
  192. </div>
  193. <sendListDialog
  194. ref="orderListDialogRef"
  195. @changeParent="changeOrder"
  196. :contactData="contactData"
  197. ></sendListDialog>
  198. <!--出库详情-->
  199. <outbound-details-dialog
  200. v-if="outboundDetailsDialogFlag"
  201. ref="outboundDetailsDialogRef"
  202. :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
  203. @saveDate="saveDate"
  204. ></outbound-details-dialog>
  205. <process-submit-dialog
  206. :isNotNeedProcess="false"
  207. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  208. v-if="processSubmitDialogFlag"
  209. ref="processSubmitDialogRef"
  210. @reload="reload"
  211. ></process-submit-dialog>
  212. </ele-modal>
  213. </template>
  214. <script>
  215. import { acceptUnpackoptions } from '@/enum/dict';
  216. import fileUpload from '@/components/upload/fileUpload';
  217. import dictMixins from '@/mixins/dictMixins';
  218. import outboundDetailsDialog from '@/views/saleManage/saleOrder/returnGoods/components/outboundDetailsDialog.vue';
  219. import { getSaleOrderDetail } from '@/api/saleManage/saleorder';
  220. import taskInfoTable from '../../invoice/components/taskInfoTable.vue';
  221. import {
  222. addSendInformation,
  223. getSendSaleOrderrecordDetailSplit
  224. } from '@/api/saleManage/saleordersendrecord';
  225. import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
  226. import { getcontactlink } from '@/api/saleManage/businessFollow';
  227. import inventoryTable from '../../invoice/components/inventoryTable.vue';
  228. import stowageTable from '../../invoice/components/stowageTable.vue';
  229. import sendListDialog from './sendListDialog.vue';
  230. import { copyObj } from '@/utils/util';
  231. // import PalletTable from '@/views/saleManage/saleOrder/invoice/components/palletTable.vue';
  232. import fileMain from '@/components/addDoc/index.vue';
  233. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  234. import getDynamicsColumns from '@/mixins/getDynamicsColumns';
  235. import {
  236. addSendConfirmInformation,
  237. getSendSaleOrderConfirmDetail,
  238. getSendSaleOrderConfirmDetailSplit,
  239. UpdateSendConfirmInformation
  240. } from '@/api/saleManage/invoiceConfirm';
  241. import modalTitle from '@/BIZComponents/modalTitle.vue';
  242. export default {
  243. mixins: [dictMixins, getDynamicsColumns],
  244. components: {
  245. processSubmitDialog,
  246. fileMain,
  247. // PalletTable,
  248. sendListDialog,
  249. taskInfoTable,
  250. fileUpload,
  251. inventoryTable,
  252. stowageTable,
  253. modalTitle,
  254. outboundDetailsDialog
  255. },
  256. //客户管理数据
  257. props: {
  258. contactData: {
  259. type: Object,
  260. default: () => {
  261. return {};
  262. }
  263. },
  264. saleOrderData: {
  265. type: Object,
  266. default: () => {
  267. return {};
  268. }
  269. }
  270. },
  271. data() {
  272. let formDef = {
  273. id: '',
  274. sendNo: '',
  275. sendId: '',
  276. contactId: '',
  277. contactName: '',
  278. entrustedCode: '',
  279. entrustedId: '',
  280. pricingWay: 1,
  281. sendFiles: [],
  282. repliedFiles: [],
  283. productList: [],
  284. projectName: '',
  285. projectId: '',
  286. receiveAddress: '',
  287. deviceName: '',
  288. deviceId: '',
  289. carNo: '',
  290. linkName: '',
  291. linkPhone: '',
  292. orderNo: '',
  293. orderId: '',
  294. replied: 0
  295. };
  296. return {
  297. fullscreen: false,
  298. outboundDetailsDialogFlag: false,
  299. payWayOptions: [],
  300. delDetailIds: [],
  301. linkNameOptions: [],
  302. productList: [],
  303. trayList: [],
  304. trayListData: [],
  305. acceptUnpackoptions,
  306. visible: false,
  307. entrustedReceiveDialogFlag: false,
  308. processSubmitDialogFlag: false,
  309. title: '',
  310. row: {},
  311. activeName: 'first',
  312. formDef,
  313. options: [
  314. { value: 0, label: '已收货' },
  315. { value: 1, label: '未收货' }
  316. ],
  317. options1: [
  318. { value: 0, label: '未回收' },
  319. { value: 1, label: '已回收' }
  320. ],
  321. columns: [
  322. {
  323. width: 45,
  324. type: 'index',
  325. columnKey: 'index',
  326. align: 'center',
  327. fixed: 'left'
  328. },
  329. {
  330. minWidth: 160,
  331. prop: 'productCode',
  332. label: '编码',
  333. showOverflowTooltip: true,
  334. align: 'center'
  335. },
  336. {
  337. minWidth: 120,
  338. prop: 'productName',
  339. label: '名称',
  340. showOverflowTooltip: true,
  341. align: 'center'
  342. },
  343. {
  344. minWidth: 160,
  345. prop: 'batchNo',
  346. label: '批次号',
  347. showOverflowTooltip: true,
  348. slot: 'batchNo',
  349. align: 'center'
  350. },
  351. {
  352. minWidth: 160,
  353. prop: 'barcodes',
  354. label: '发货条码',
  355. showOverflowTooltip: true,
  356. slot: 'barcodes',
  357. align: 'center'
  358. },
  359. {
  360. minWidth: 120,
  361. prop: 'materielDesignation',
  362. label: '物料代号',
  363. showOverflowTooltip: true,
  364. align: 'center'
  365. },
  366. {
  367. minWidth: 120,
  368. prop: 'clientCode',
  369. label: '客户代号',
  370. showOverflowTooltip: true,
  371. align: 'center'
  372. },
  373. {
  374. minWidth: 120,
  375. prop: 'engrave',
  376. label: '刻码',
  377. showOverflowTooltip: true,
  378. align: 'center'
  379. },
  380. {
  381. minWidth: 160,
  382. prop: 'packageNo',
  383. align: 'center',
  384. label: '包装编码',
  385. showOverflowTooltip: true
  386. },
  387. {
  388. minWidth: 100,
  389. prop: 'packingQuantity',
  390. align: 'center',
  391. label: '包装数量',
  392. showOverflowTooltip: true
  393. },
  394. {
  395. minWidth: 120,
  396. prop: 'packingUnit',
  397. align: 'center',
  398. label: '包装单位',
  399. showOverflowTooltip: true
  400. },
  401. {
  402. minWidth: 100,
  403. prop: 'totalCount',
  404. label: '计量数量',
  405. showOverflowTooltip: true,
  406. align: 'center'
  407. },
  408. {
  409. minWidth: 150,
  410. prop: 'measuringUnit',
  411. label: '计量单位',
  412. showOverflowTooltip: true,
  413. align: 'center'
  414. },
  415. {
  416. width: 160,
  417. prop: 'pricingWay',
  418. label: '计价方式',
  419. slot: 'pricingWay',
  420. align: 'center',
  421. formatter: (row, column) => {
  422. return row.pricingWay == 1
  423. ? '按数量计费'
  424. : row.pricingWay == 2
  425. ? '按重量计费'
  426. : '';
  427. }
  428. },
  429. {
  430. width: 100,
  431. prop: 'singlePrice',
  432. label: '单价',
  433. slot: 'singlePrice',
  434. align: 'center'
  435. },
  436. {
  437. width: 180,
  438. prop: 'notaxSinglePrice',
  439. label: '不含税单价',
  440. slot: 'notaxSinglePrice',
  441. align: 'center'
  442. },
  443. {
  444. width: 100,
  445. prop: 'totalPrice',
  446. label: '合计',
  447. align: 'center'
  448. },
  449. {
  450. minWidth: 80,
  451. prop: 'sendTotalWeight',
  452. label: '重量',
  453. showOverflowTooltip: true,
  454. align: 'center'
  455. },
  456. {
  457. minWidth: 100,
  458. prop: 'weightUnit',
  459. label: '重量单位',
  460. showOverflowTooltip: true,
  461. align: 'center'
  462. },
  463. {
  464. prop: 'provenance',
  465. label: '产地',
  466. slot: 'provenance',
  467. align: 'center',
  468. // show:this.contractBookType==2,
  469. minWidth: 200,
  470. showOverflowTooltip: true,
  471. formatter: (row, column) => {
  472. return row.provenance && row.provenance.length
  473. ? row.provenance
  474. .map((item) => this.getDictValue('产地', item))
  475. .join(',')
  476. : '';
  477. }
  478. },
  479. {
  480. width: 220,
  481. prop: 'remark',
  482. label: '备注',
  483. slot: 'remark',
  484. align: 'center'
  485. },
  486. {
  487. width: 120,
  488. slot: 'isException',
  489. prop: 'isException',
  490. label: '收货状态',
  491. align: 'center',
  492. fixed: 'right'
  493. }
  494. ],
  495. trayListColumns: [
  496. {
  497. width: 45,
  498. type: 'index',
  499. columnKey: 'index',
  500. align: 'center',
  501. fixed: 'left'
  502. },
  503. {
  504. minWidth: 160,
  505. prop: 'productCode',
  506. label: '编码',
  507. showOverflowTooltip: true,
  508. align: 'center'
  509. },
  510. {
  511. minWidth: 120,
  512. prop: 'productName',
  513. label: '名称',
  514. showOverflowTooltip: true,
  515. align: 'center'
  516. },
  517. {
  518. minWidth: 160,
  519. prop: 'batchNo',
  520. label: '批次号',
  521. showOverflowTooltip: true,
  522. align: 'center'
  523. },
  524. {
  525. minWidth: 160,
  526. prop: 'barcodes',
  527. label: '发货条码',
  528. showOverflowTooltip: true,
  529. align: 'center'
  530. },
  531. {
  532. minWidth: 120,
  533. prop: 'materielDesignation',
  534. label: '物料代号',
  535. showOverflowTooltip: true,
  536. align: 'center'
  537. },
  538. {
  539. minWidth: 120,
  540. prop: 'clientCode',
  541. label: '客户代号',
  542. showOverflowTooltip: true,
  543. align: 'center'
  544. },
  545. {
  546. minWidth: 120,
  547. prop: 'engrave',
  548. label: '刻码',
  549. showOverflowTooltip: true,
  550. align: 'center'
  551. },
  552. {
  553. minWidth: 160,
  554. prop: 'packageNo',
  555. align: 'center',
  556. label: '包装编码',
  557. showOverflowTooltip: true
  558. },
  559. {
  560. minWidth: 100,
  561. prop: 'packingQuantity',
  562. align: 'center',
  563. label: '包装数量',
  564. showOverflowTooltip: true
  565. },
  566. {
  567. minWidth: 120,
  568. prop: 'packingUnit',
  569. align: 'center',
  570. label: '包装单位',
  571. showOverflowTooltip: true
  572. },
  573. {
  574. minWidth: 100,
  575. prop: 'totalCount',
  576. label: '计量数量',
  577. showOverflowTooltip: true,
  578. align: 'center'
  579. },
  580. {
  581. minWidth: 150,
  582. prop: 'measuringUnit',
  583. label: '计量单位',
  584. showOverflowTooltip: true,
  585. align: 'center'
  586. },
  587. {
  588. width: 120,
  589. slot: 'type',
  590. prop: 'type',
  591. label: '回收状态',
  592. align: 'center',
  593. fixed: 'right'
  594. }
  595. ],
  596. form: copyObj(formDef),
  597. tableBankData: [],
  598. tableLinkData: [],
  599. oldId: '',
  600. oldDocNo: '',
  601. // 组织机构树形结构数据
  602. groupTreeData: [],
  603. groupData: [],
  604. rules: {
  605. sendNo: [
  606. { required: true, message: '请选择发货单', trigger: 'change' }
  607. ],
  608. repliedFiles: [
  609. { required: true, message: '请上传回执附件', trigger: 'change' }
  610. ]
  611. },
  612. // 提交状态
  613. loading: false,
  614. // 是否是修改
  615. isUpdate: false,
  616. businessId: ''
  617. };
  618. },
  619. created() {
  620. this.requestDict('产地');
  621. },
  622. computed: {},
  623. methods: {
  624. //选择订单回调
  625. changeOrder(obj) {
  626. this.form = Object.assign({}, this.form, {
  627. sendId: obj.id,
  628. sendNo: obj.docNo
  629. });
  630. this.getSaleOrderDetail(obj.id);
  631. },
  632. //发货单详情
  633. async getSaleOrderDetail(id) {
  634. this.loading = true;
  635. const data = await getSendSaleOrderrecordDetailSplit(id);
  636. this.loading = false;
  637. if (data) {
  638. this.form = data;
  639. this.form.sendId = data.id;
  640. this.form.sendNo = data.docNo;
  641. this.form.docNo = this.oldDocNo;
  642. this.form.id = this.oldId;
  643. this.form.reviewStatus = 0;
  644. this.form.processInstanceId = '';
  645. this.$refs.taskInfoTableRef &&
  646. this.$refs.taskInfoTableRef.putTableValue(
  647. data.logisticTrakListNoteVOList
  648. );
  649. this.$refs.stowageTableRef &&
  650. this.$refs.stowageTableRef.putTableValue(data.carList);
  651. this.trayList = data.trayList;
  652. this.productList = data.productList;
  653. // this.form.pricingWay = data?.saleOrder?.pricingWay;
  654. this.form.productList = [];
  655. this.handleSelectGoods();
  656. }
  657. },
  658. //选择退货明细
  659. handleSelectGoods(list) {
  660. this.outboundDetailsDialogFlag = true;
  661. this.$nextTick(() => {
  662. this.$refs.outboundDetailsDialogRef.init(
  663. { ...this.form, type: 10 },
  664. list
  665. );
  666. });
  667. },
  668. saveDate(data) {
  669. data.forEach((item) => {
  670. item['totalCount'] = item.measureQuantity;
  671. item['qmsResult'] = item.result;
  672. item['qmsStatus'] = item.status;
  673. item['sendProductId'] = item.categoryId;
  674. item['sendTotalWeight'] = item.weight;
  675. this.productList.forEach((val) => {
  676. if (item.productCode == val.productCode) {
  677. item['singlePrice'] = val.singlePrice;
  678. item['clientCode'] = item.clientCode || val.customerMark;
  679. item['pricingWay'] = item.pricingWay || val.pricingWay || 1;
  680. if (item.pricingWay == 1) {
  681. item.totalPrice = item.singlePrice * item.measureQuantity;
  682. }
  683. if (item.pricingWay == 2) {
  684. item.totalPrice =
  685. item.singlePrice *
  686. item.measureQuantity *
  687. item.sendTotalWeight;
  688. }
  689. }
  690. });
  691. });
  692. let trayListCodes = this.trayList.map((item) => item.productCode);
  693. this.form.productList = data.filter(
  694. (item) => !trayListCodes.includes(item.productCode)
  695. );
  696. this.form.productList.forEach((item, index) => {
  697. this.$set(this.form.productList[index], 'isException', 0);
  698. });
  699. this.trayListData = data.filter((item) => {
  700. if (trayListCodes.includes(item.productCode)) {
  701. item['orderProductType'] = 1;
  702. return item;
  703. }
  704. });
  705. this.trayListData.forEach((item, index) => {
  706. this.$set(this.trayListData[index], 'type', 0);
  707. });
  708. },
  709. // //发货单确认详情
  710. async getSendSaleOrderDetail(id) {
  711. this.businessId = id;
  712. this.loading = true;
  713. const data = await getSendSaleOrderConfirmDetail(id);
  714. this.oldId = data.id;
  715. this.oldDocNo = data.docNo;
  716. this.loading = false;
  717. if (data) {
  718. this.form = data;
  719. this.trayListData = data.trayList;
  720. this.$nextTick(() => {
  721. this.form.pricingWay = data?.saleOrder?.pricingWay;
  722. this.$refs.inventoryTableref &&
  723. this.$refs.inventoryTableref.putTableValue(data.productList);
  724. this.$refs.stowageTableRef &&
  725. this.$refs.stowageTableRef.putTableValue(data.carList);
  726. this.$refs.taskInfoTableRef &&
  727. this.$refs.taskInfoTableRef.putTableValue(
  728. data.logisticTrakListNoteVOList
  729. );
  730. // this.$refs.palletTableRef &&
  731. // this.$refs.palletTableRef.putTableValue(data.trayList);
  732. });
  733. }
  734. },
  735. //选择订单弹框
  736. handleSendOrderBtn(e) {
  737. if (e.target.nodeName == 'I') {
  738. this.form = Object.assign({}, this.form, {
  739. sendId: '',
  740. sendNo: '',
  741. contactId: '',
  742. contactName: '',
  743. carNo: '',
  744. deviceName: '',
  745. deviceId: '',
  746. linkName: '',
  747. linkPhone: '',
  748. orderNo: '',
  749. orderId: '',
  750. pricingWay: '',
  751. receiveAddress: '',
  752. entrustedCode: '',
  753. entrustedId: '',
  754. productList: [],
  755. sendFiles: [],
  756. repliedFiles: []
  757. });
  758. // this.$refs.inventoryTableref && this.$refs.inventoryTableref.putTableValue([]);
  759. this.$refs.stowageTableRef &&
  760. this.$refs.stowageTableRef.putTableValue([]);
  761. this.$refs.taskInfoTableRef &&
  762. this.$refs.taskInfoTableRef.putTableValue([]);
  763. this.trayListData = [];
  764. this.trayList = [];
  765. return;
  766. }
  767. let item = {
  768. id: this.form.sendId
  769. };
  770. this.$refs.orderListDialogRef.open(item);
  771. },
  772. //打开新增编辑弹框
  773. async open(type, row, invoiceData) {
  774. this.title = type === 'add' ? '新增收货确认单' : '修改';
  775. this.row = row;
  776. this.visible = true;
  777. if (row && row?.id) {
  778. await this.getSendSaleOrderDetail(row?.id);
  779. }
  780. if (invoiceData) {
  781. this.changeOrder(invoiceData);
  782. }
  783. this.isUpdate = type != 'add';
  784. },
  785. totalCountChange(row) {
  786. if (row.totalCount > row.sendTotalCount) {
  787. row.totalCount = row.sendTotalCount;
  788. }
  789. if (row.totalCount < 0) {
  790. row.totalCount = 0;
  791. }
  792. },
  793. getValidate() {
  794. return Promise.all([
  795. new Promise((resolve, reject) => {
  796. this.$refs.form.validate((valid) => {
  797. if (!valid) {
  798. reject(false);
  799. } else {
  800. resolve(true);
  801. }
  802. });
  803. })
  804. ]).catch((e) => {
  805. this.$message.warning('有必填项未填写,请检查');
  806. return Promise.reject(e);
  807. });
  808. },
  809. // 添加
  810. handlAdd() {
  811. if (!this.form.sendNo) return this.$message.error('请先选择来源单据');
  812. this.handleSelectGoods();
  813. // this.$refs.productListRef.open(this.form.datasource);
  814. },
  815. async save(type) {
  816. try {
  817. await this.getValidate();
  818. // 表单验证通过,执行保存操作
  819. this.loading = true;
  820. if (!this.isUpdate) {
  821. delete this.form.id;
  822. }
  823. this.form.repliedFiles = this.form.repliedFiles || [];
  824. this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
  825. let commitData = Object.assign({}, this.form, {
  826. trayList: this.trayListData,
  827. carList: this.$refs.stowageTableRef.getTableValue(),
  828. trakNoteList: this.$refs.taskInfoTableRef.getTableValue()
  829. });
  830. const API = this.isUpdate
  831. ? UpdateSendConfirmInformation
  832. : addSendConfirmInformation;
  833. API(commitData)
  834. .then((res) => {
  835. this.loading = false;
  836. this.$message.success('修改成功');
  837. if (type === 'sub') {
  838. this.sendSubmit(res);
  839. return;
  840. }
  841. this.cancel();
  842. this.$emit('done');
  843. })
  844. .catch((e) => {
  845. //this.loading = false;
  846. });
  847. } catch (error) {
  848. console.log(error);
  849. // 表单验证未通过,不执行保存操作
  850. }
  851. },
  852. async sendSubmit(res) {
  853. const data = await getSendSaleOrderConfirmDetail(
  854. this.businessId || res
  855. );
  856. this.processSubmitDialogFlag = true;
  857. this.$nextTick(() => {
  858. let params = {
  859. businessId: this.businessId || res,
  860. businessKey: 'sales_sendconfirm_approve',
  861. formCreateUserId: data.createUserId,
  862. variables: {
  863. businessCode: data.docNo
  864. }
  865. // callBackMethodType : '1',
  866. // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
  867. // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
  868. // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
  869. // miniHandle : '',
  870. // miniView : '',
  871. };
  872. this.$refs.processSubmitDialogRef.init(params);
  873. });
  874. // submit({
  875. // businessId: this.businessId || res
  876. // // productionSupervisorId
  877. // }).then((res) => {
  878. // this.cancel();
  879. // this.$emit('done');
  880. // });
  881. },
  882. remove(index) {
  883. this.form.productList.splice(index, 1);
  884. },
  885. reload() {
  886. this.cancel();
  887. this.$emit('done');
  888. },
  889. cancel() {
  890. this.$nextTick(() => {
  891. this.activeName = 'first';
  892. // 关闭后,销毁所有的表单数据
  893. this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
  894. this.$refs['formRef'] && this.$refs['formRef'].resetFields();
  895. this.$store.commit('order/clearUserData');
  896. this.form = copyObj(this.formDef);
  897. this.visible = false;
  898. this.trayListData = [];
  899. this.trayLis = [];
  900. });
  901. }
  902. }
  903. };
  904. </script>
  905. <style scoped lang="scss">
  906. .TotalAmount {
  907. font-size: 16px;
  908. padding-right: 30px;
  909. }
  910. .headbox {
  911. display: flex;
  912. justify-content: flex-start;
  913. align-items: center;
  914. .amount {
  915. font-size: 14px;
  916. font-weight: bold;
  917. margin-right: 20px;
  918. }
  919. }
  920. </style>