addInvoiceDialog.vue 31 KB

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