addInvoiceDialog.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  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. width="70%"
  11. :maxable="true"
  12. :resizable="true"
  13. @close="cancel"
  14. >
  15. <el-form
  16. ref="form"
  17. :model="form"
  18. :rules="rules"
  19. class="el-form-box"
  20. label-width="120px"
  21. >
  22. <headerTitle title="发货信息"></headerTitle>
  23. <el-row :gutter="12">
  24. <el-col :span="12">
  25. <el-form-item label="销售订单" prop="orderNo">
  26. <el-input
  27. clearable
  28. v-model="form.orderNo"
  29. @click.native="handleOrderBtn"
  30. placeholder="请输入"
  31. :disabled="!!saleOrderData.id"
  32. />
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="12">
  36. <el-form-item label="受托收货单">
  37. <el-input
  38. clearable
  39. :disabled="!!saleOrderData.id"
  40. v-model="form.entrustedCode"
  41. @click.native="handleEntrustedReceive"
  42. placeholder="请输入"
  43. />
  44. </el-form-item>
  45. </el-col>
  46. </el-row>
  47. <el-row :gutter="12">
  48. <el-col :span="12">
  49. <el-form-item label="客户名称" prop="contactName">
  50. <el-input v-model="form.contactName" disabled></el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="12">
  54. <el-form-item label="客户联系人" prop="linkName">
  55. <el-input clearable v-model="form.linkName" placeholder="请输入" />
  56. </el-form-item>
  57. </el-col>
  58. </el-row>
  59. <el-row :gutter="12">
  60. <el-col :span="12">
  61. <el-form-item label="客户电话" prop="linkPhone">
  62. <el-input clearable v-model="form.linkPhone" placeholder="请输入" />
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="12">
  66. <el-form-item label="收货地址" prop="receiveAddress">
  67. <el-input
  68. clearable
  69. v-model="form.receiveAddress"
  70. placeholder="请输入"
  71. />
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="12">
  75. <el-form-item label="项目名称" prop="projectName">
  76. <el-input clearable v-model="form.projectName" :disabled="true" />
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="12">
  80. <el-form-item label="车牌号" prop="carNo">
  81. <el-select v-model="form.carNo" style="width: 100%">
  82. <el-option
  83. :label="item.trakNumber"
  84. :value="item.trakNumber"
  85. v-for="(item, index) in carList"
  86. :key="index"
  87. ></el-option>
  88. </el-select>
  89. </el-form-item>
  90. </el-col>
  91. <el-col :span="12">
  92. <el-form-item label="托盘数" prop="trayNum">
  93. <el-input clearable v-model="form.trayNum" />
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="12">
  97. <el-form-item prop="sendFiles" label="发货附件">
  98. <fileMain v-model="form.sendFiles"></fileMain>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="12">
  102. <el-form-item prop="repliedFiles" label="回执附件">
  103. <fileMain v-model="form.repliedFiles"></fileMain>
  104. </el-form-item>
  105. </el-col>
  106. </el-row>
  107. </el-form>
  108. <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
  109. <el-tab-pane label="物品清单" name="first">
  110. <inventoryTable
  111. :pricingWay="form.pricingWay"
  112. :entrustedCode="form.entrustedCode"
  113. ref="inventoryTableref"
  114. :orderId="form.orderId"
  115. @replaceTableChange="replaceTableChange"
  116. :needProduce="saleOrderValue.needProduce"
  117. :typeIds="saleOrderValue.typedetailIds"
  118. ></inventoryTable>
  119. </el-tab-pane>
  120. <el-tab-pane label="托盘清单" name="second">
  121. <palletTable
  122. ref="palletTableRef"
  123. @totalCountChange="totalCountChange"
  124. ></palletTable>
  125. </el-tab-pane>
  126. <el-tab-pane label="装载车叉车信息" name="third">
  127. <stowageTable ref="stowageTableRef"></stowageTable>
  128. </el-tab-pane>
  129. <el-tab-pane label="运输清单" name="fourth">
  130. <taskInfoTable
  131. ref="taskInfoTableRef"
  132. @setAddress="setAddress"
  133. ></taskInfoTable>
  134. </el-tab-pane>
  135. <el-tab-pane label="替代料" name="5">
  136. <replaceTable
  137. :pricingWay="form.pricingWay"
  138. ref="replaceRef"
  139. ></replaceTable>
  140. </el-tab-pane>
  141. </el-tabs>
  142. <div slot="footer" class="footer">
  143. <el-button type="primary" @click="save" v-click-once>保存</el-button>
  144. <el-button
  145. type="primary"
  146. v-if="isNeed_process_is_close"
  147. @click="save('sub')"
  148. v-click-once
  149. >提交</el-button
  150. >
  151. <el-button @click="cancel">返回</el-button>
  152. </div>
  153. <orderListDialog
  154. ref="orderListDialogRef"
  155. @changeParent="changeOrder"
  156. :contactData="contactData"
  157. ></orderListDialog>
  158. <!-- 受托发货单 -->
  159. <entrusted-receive-dialog
  160. :entrusted-receive-dialog-flag.sync="entrustedReceiveDialogFlag"
  161. v-if="entrustedReceiveDialogFlag"
  162. @changeParent="getInfo"
  163. ref="entrustedReceiveDialogRef"
  164. ></entrusted-receive-dialog>
  165. <process-submit-dialog
  166. :isNotNeedProcess="false"
  167. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  168. v-if="processSubmitDialogFlag"
  169. ref="processSubmitDialogRef"
  170. @reload="reload"
  171. ></process-submit-dialog>
  172. </ele-modal>
  173. </template>
  174. <script>
  175. import { acceptUnpackoptions, treeClassifyCodeEnum } from '@/enum/dict';
  176. import fileUpload from '@/components/upload/fileUpload';
  177. import dictMixins from '@/mixins/dictMixins';
  178. import parentList from '@/views/saleManage/contact/components/parentList.vue';
  179. import { getSaleOrderDetail } from '@/api/saleManage/saleorder';
  180. import taskInfoTable from './taskInfoTable.vue';
  181. import {
  182. addSendInformation,
  183. UpdateSendInformation,
  184. getSendSaleOrderrecordDetailSplit,
  185. submit
  186. } from '@/api/saleManage/saleordersendrecord';
  187. import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
  188. import { getcontactlink } from '@/api/saleManage/businessFollow';
  189. import inventoryTable from './inventoryTable.vue';
  190. import replaceTable from './replaceTable.vue';
  191. import stowageTable from './stowageTable.vue';
  192. import orderListDialog from './orderListDialog.vue';
  193. import { copyObj } from '@/utils/util';
  194. import entrustedReceiveDialog from './entrustedReceiveDialog.vue';
  195. import outSourceSendDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/outSourceSendDialog.vue';
  196. import PalletTable from '@/views/saleManage/saleOrder/invoice/components/palletTable.vue';
  197. import fileMain from '@/components/addDoc/index.vue';
  198. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  199. import { carBookPageListAPI } from '@/api/transportManager/carBook';
  200. import { projectsGetByIdAPI } from '@/api/pro';
  201. export default {
  202. mixins: [dictMixins],
  203. components: {
  204. processSubmitDialog,
  205. fileMain,
  206. PalletTable,
  207. outSourceSendDialog,
  208. taskInfoTable,
  209. fileUpload,
  210. inventoryTable,
  211. orderListDialog,
  212. parentList,
  213. entrustedReceiveDialog,
  214. stowageTable,
  215. replaceTable,
  216. },
  217. //客户管理数据
  218. props: {
  219. contactData: {
  220. type: Object,
  221. default: () => {
  222. return {};
  223. }
  224. },
  225. saleOrderData: {
  226. type: Object,
  227. default: () => {
  228. return {};
  229. }
  230. }
  231. },
  232. data() {
  233. let formDef = {
  234. id: '',
  235. contactId: '',
  236. contactName: '',
  237. entrustedCode: '',
  238. entrustedId: '',
  239. pricingWay: 1,
  240. sendFiles: [],
  241. repliedFiles: [],
  242. projectName: '',
  243. projectId: '',
  244. receiveAddress: '',
  245. deviceName: '',
  246. deviceId: '',
  247. carNo: '',
  248. linkName: '',
  249. linkPhone: '',
  250. orderNo: '',
  251. orderId: '',
  252. replied: 0,
  253. trayNum: '',
  254. replaceList: []
  255. };
  256. return {
  257. fullscreen: false,
  258. saleOrderValue:{},
  259. detailData: {},
  260. payWayOptions: [],
  261. delDetailIds: [],
  262. linkNameOptions: [],
  263. carList: [],
  264. acceptUnpackoptions,
  265. visible: false,
  266. entrustedReceiveDialogFlag: false,
  267. processSubmitDialogFlag: false,
  268. title: '',
  269. row: {},
  270. activeName: 'first',
  271. formDef,
  272. form: copyObj(formDef),
  273. tableBankData: [],
  274. tableLinkData: [],
  275. // 组织机构树形结构数据
  276. groupTreeData: [],
  277. groupData: [],
  278. rules: {
  279. partaName: [
  280. { required: true, message: '请选择客户名称', trigger: 'change' }
  281. ],
  282. linkName: [
  283. { required: true, message: '请输入', trigger: ['blur', 'change'] }
  284. ],
  285. orderNo: [{ required: true, message: '请选择', trigger: 'change' }],
  286. receiveAddress: [
  287. { required: true, message: '请输入', trigger: 'change' }
  288. ],
  289. deviceName: [
  290. { required: true, message: '前选择车辆', trigger: 'change' }
  291. ]
  292. },
  293. // 提交状态
  294. loading: false,
  295. // 是否是修改
  296. isUpdate: false,
  297. businessId: ''
  298. };
  299. },
  300. computed: {
  301. allcountAmount() {
  302. return this.$store.state.order.allcountAmount;
  303. }
  304. },
  305. methods: {
  306. //选择订单回调
  307. changeOrder(obj) {
  308. this.form = Object.assign({}, this.form, {
  309. orderId: obj.id,
  310. orderNo: obj.orderNo
  311. });
  312. this.getSaleOrderDetail(obj.id);
  313. },
  314. //获取订单详情
  315. async getSaleOrderDetail(id) {
  316. this.loading = true;
  317. const data = await getSaleOrderDetail(id);
  318. this.saleOrderValue=data
  319. this.loading = false;
  320. this.partbAddress = data.partbAddress;
  321. if (data) {
  322. this.$nextTick(() => {
  323. let {
  324. partaId,
  325. partaName,
  326. partaTel,
  327. orderNo,
  328. id,
  329. partaLinkName,
  330. partaAddress,
  331. productList,
  332. trayList,
  333. trakNoteList,
  334. totalAmount,
  335. payAmount,
  336. projectName,
  337. projectId,
  338. projectCode,
  339. totalPrice,
  340. receiveAddress
  341. } = data;
  342. if (productList && productList.length > 0) {
  343. productList.forEach((v) => {
  344. v.orderTotalCount = v.totalCount;
  345. v.extField = {};
  346. });
  347. }
  348. this.form = Object.assign({}, this.form, {
  349. contactId: partaId,
  350. contactName: partaName,
  351. linkName: partaLinkName,
  352. linkPhone: partaTel,
  353. orderNo,
  354. orderId: id,
  355. receiveAddress: receiveAddress || partaAddress,
  356. productList,
  357. trakNoteList,
  358. trayList,
  359. totalAmount,
  360. totalPrice,
  361. payAmount,
  362. projectName,
  363. projectId,
  364. projectSn:projectCode
  365. });
  366. productList.forEach((item, index) => {
  367. item['tempId'] = index;
  368. item.id = '';
  369. });
  370. this.$refs.inventoryTableref &&
  371. this.$refs.inventoryTableref.putTableValue(productList);
  372. this.$refs.taskInfoTableRef &&
  373. this.$refs.taskInfoTableRef.putTableValue(trakNoteList);
  374. this.setAddress();
  375. if (projectId) {
  376. this.getProjectData(projectId);
  377. }
  378. });
  379. }
  380. },
  381. setAddress() {
  382. this.$refs.taskInfoTableRef.setAddress(
  383. this.partbAddress,
  384. this.form.receiveAddress
  385. );
  386. },
  387. async getProjectData(id) {
  388. const data = await projectsGetByIdAPI(id);
  389. if (data.contactAddressId) {
  390. this.form.receiveAddress =
  391. data.contactAddressName + data.contactAddress;
  392. this.setAddress();
  393. }
  394. if (data.contactRelationPhone) {
  395. this.form.linkPhone = data.contactRelationPhone;
  396. }
  397. if(data.contactRelationUserName){
  398. this.form.linkName=data.contactRelationUserName
  399. }
  400. },
  401. //发货单详情
  402. async getSendSaleOrderDetail(id) {
  403. this.businessId = id;
  404. this.loading = true;
  405. const data = await getSendSaleOrderrecordDetailSplit(id);
  406. this.partbAddress = data.saleOrder.partbAddress;
  407. this.saleOrderValue=data.saleOrder
  408. this.loading = false;
  409. if (data) {
  410. this.$nextTick(() => {
  411. data.productList.forEach((item) => {
  412. item['tempId'] = item.id;
  413. });
  414. this.form = data;
  415. this.form.pricingWay = data?.saleOrder?.pricingWay;
  416. this.$refs.inventoryTableref &&
  417. this.$refs.inventoryTableref.putTableValue(data.productList);
  418. this.$refs.stowageTableRef &&
  419. this.$refs.stowageTableRef.putTableValue(data.carList);
  420. this.$refs.taskInfoTableRef &&
  421. this.$refs.taskInfoTableRef.putTableValue(
  422. data.logisticTrakListNoteVOList
  423. );
  424. this.$refs.palletTableRef &&
  425. this.$refs.palletTableRef.putTableValue(data.trayList);
  426. this.$refs.replaceRef &&
  427. this.$refs.replaceRef.putTableValue(data.replaceList);
  428. });
  429. }
  430. },
  431. //选择受托收货单弹框
  432. handleEntrustedReceive(e) {
  433. if (e.target.nodeName == 'I') {
  434. this.form = Object.assign({}, this.form, {
  435. carNo: '',
  436. deviceName: '',
  437. deviceId: '',
  438. linkName: '',
  439. linkPhone: '',
  440. orderNo: '',
  441. orderId: '',
  442. contactId: '',
  443. contactName: '',
  444. entrustedCode: '',
  445. entrustedId: '',
  446. sendNoteNo: '',
  447. pricingWay: ''
  448. });
  449. this.$refs.inventoryTableref &&
  450. this.$refs.inventoryTableref.putTableValue([]);
  451. return;
  452. }
  453. this.searchParams = {
  454. orderId: this.form.orderId
  455. };
  456. this.entrustedReceiveDialogFlag = true;
  457. this.$nextTick(() => {
  458. this.$refs.entrustedReceiveDialogRef.init();
  459. });
  460. },
  461. //获取受托收货单数据回调
  462. async getInfo(row) {
  463. const data = await getPSaleEntrustedReceiveDetailAPI(row.id);
  464. this.$nextTick(() => {
  465. let {
  466. carNo,
  467. code,
  468. id,
  469. linkName,
  470. linkPhone,
  471. orderId,
  472. orderNo,
  473. productList,
  474. contactId,
  475. contactName,
  476. pricingWay = data?.saleOrder?.pricingWay
  477. } = data;
  478. if (productList && productList.length > 0) {
  479. productList.forEach((v) => {
  480. v.orderTotalCount = v.orderTotalCount || v.totalCount;
  481. v.extField = {};
  482. });
  483. }
  484. this.form = Object.assign({}, this.form, {
  485. contactId,
  486. contactName,
  487. linkName,
  488. linkPhone,
  489. orderNo,
  490. orderId,
  491. productList,
  492. carNo,
  493. pricingWay,
  494. entrustedCode: code,
  495. entrustedId: id
  496. });
  497. productList.forEach((item, index) => {
  498. item.id = '';
  499. item['tempId'] = index;
  500. });
  501. this.$refs.inventoryTableref &&
  502. this.$refs.inventoryTableref.putTableValue(productList, code);
  503. });
  504. },
  505. //替代料
  506. replaceTableChange(list) {
  507. this.$refs.replaceRef.putTableValue(list, 'add');
  508. },
  509. //更新联系人数据
  510. async getLinkInfo(contactId) {
  511. const data = await getcontactlink({ contactId });
  512. if (data && data?.length) {
  513. this.linkNameOptions = data;
  514. }
  515. },
  516. selectFocus() {
  517. if (this.linkNameOptions.length === 0) {
  518. return this.$message.error('请先选择名称');
  519. }
  520. },
  521. handHead() {
  522. let item = {
  523. id: this.form.partbLinkId
  524. };
  525. this.$refs.headRef.open(item);
  526. },
  527. //选择订单弹框
  528. handleOrderBtn(e) {
  529. if (e.target.nodeName == 'I') {
  530. this.form = Object.assign({}, this.form, {
  531. contactId: '',
  532. contactName: '',
  533. carNo: '',
  534. deviceName: '',
  535. deviceId: '',
  536. linkName: '',
  537. linkPhone: '',
  538. orderNo: '',
  539. orderId: '',
  540. pricingWay: '',
  541. entrustedCode: '',
  542. entrustedId: ''
  543. });
  544. this.$refs.inventoryTableref &&
  545. this.$refs.inventoryTableref.putTableValue([]);
  546. return;
  547. }
  548. let item = {
  549. id: this.form.orderId
  550. };
  551. this.$refs.orderListDialogRef.open(item);
  552. },
  553. //打开新增编辑弹框
  554. async open(type, row, orderId) {
  555. this.title = type === 'add' ? '新增发货单' : '修改';
  556. this.row = row;
  557. this.visible = true;
  558. this.carList = await carBookPageListAPI({ pageNum: 1, size: 100 });
  559. if (orderId) {
  560. await this.getSaleOrderDetail(orderId);
  561. }
  562. if (this.saleOrderData.id) {
  563. await this.getSaleOrderDetail(this.saleOrderData.id);
  564. }
  565. if (row && row?.id) {
  566. await this.getSendSaleOrderDetail(row?.id);
  567. }
  568. if (type == 'add') {
  569. this.isUpdate = false;
  570. } else {
  571. this.isUpdate = true;
  572. }
  573. },
  574. entrustedReceiveInit(row) {
  575. this.title = '新增发货单';
  576. this.visible = true;
  577. this.isUpdate = false;
  578. this.getInfo(row);
  579. },
  580. totalCountChange(num) {
  581. this.form.trayNum = num;
  582. },
  583. salesmanChange(val, info) {
  584. this.otherForm.salesmanName = info.name;
  585. },
  586. settlementModeChange(info) {
  587. this.form.settlementModeName = info.dictValue;
  588. },
  589. ifChiefChange(value, idx) {
  590. if (value === 1) {
  591. this.tableLinkData.forEach((e) => (e.ifChief = 0));
  592. this.tableLinkData[idx].ifChief = 1;
  593. }
  594. },
  595. getValidate() {
  596. return Promise.all([
  597. new Promise((resolve, reject) => {
  598. this.$refs.form.validate((valid) => {
  599. if (!valid) {
  600. reject(false);
  601. } else {
  602. resolve(true);
  603. }
  604. });
  605. }),
  606. new Promise((resolve, reject) => {
  607. this.$refs.inventoryTableref.validateForm((valid) => {
  608. if (!valid) {
  609. reject(false);
  610. } else {
  611. resolve(true);
  612. }
  613. });
  614. }),
  615. new Promise((resolve, reject) => {
  616. this.$refs.taskInfoTableRef.getTableValidate((valid) => {
  617. if (!valid) {
  618. reject(false);
  619. } else {
  620. resolve(true);
  621. }
  622. });
  623. }),
  624. new Promise((resolve, reject) => {
  625. this.$refs.palletTableRef.validateForm((valid) => {
  626. if (!valid) {
  627. reject(false);
  628. } else {
  629. resolve(true);
  630. }
  631. });
  632. })
  633. ]).catch((e) => {
  634. this.$message.warning('有必填项未填写,请检查');
  635. return Promise.reject(e);
  636. });
  637. },
  638. async save(type) {
  639. try {
  640. await this.getValidate();
  641. // 表单验证通过,执行保存操作
  642. this.loading = true;
  643. if (!this.isUpdate) {
  644. delete this.form.id;
  645. }
  646. this.form.repliedFiles = this.form.repliedFiles || [];
  647. this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
  648. const replaceList =
  649. (this.$refs.replaceRef && this.$refs.replaceRef.getTableValue()) ||
  650. [];
  651. const productList = this.$refs.inventoryTableref.getTableValue();
  652. productList.forEach((item) => {
  653. if (
  654. replaceList.map((_item) => _item.relationId).includes(item.tempId)
  655. ) {
  656. item['isReplace'] = 1;
  657. }
  658. });
  659. // console.log(productList,'productList')
  660. // console.log(replaceList,'productList')
  661. // return
  662. let commitData = Object.assign({}, this.form, {
  663. productList,
  664. replaceList,
  665. trayList: this.$refs.palletTableRef.getTableValue(),
  666. carList: this.$refs.stowageTableRef.getTableValue(),
  667. trakNoteList: this.$refs.taskInfoTableRef.getTableValue()
  668. });
  669. if (this.isUpdate) {
  670. UpdateSendInformation(commitData)
  671. .then((res) => {
  672. this.loading = false;
  673. this.$message.success('修改成功');
  674. if (type === 'sub') {
  675. this.sendSubmit(res);
  676. return;
  677. }
  678. this.cancel();
  679. this.$emit('done');
  680. })
  681. .catch((e) => {
  682. //this.loading = false;
  683. });
  684. } else {
  685. addSendInformation(commitData)
  686. .then((res) => {
  687. this.loading = false;
  688. this.$message.success('新增成功');
  689. if (type === 'sub') {
  690. this.sendSubmit(res);
  691. return;
  692. }
  693. this.cancel();
  694. this.$emit('done');
  695. })
  696. .catch((e) => {
  697. //this.loading = false;
  698. });
  699. }
  700. } catch (error) {
  701. console.log(error);
  702. // 表单验证未通过,不执行保存操作
  703. }
  704. },
  705. async sendSubmit(res) {
  706. const data = await getSendSaleOrderrecordDetailSplit(
  707. this.businessId || res
  708. );
  709. this.processSubmitDialogFlag = true;
  710. this.$nextTick(() => {
  711. let params = {
  712. businessId: this.businessId || res,
  713. businessKey: 'sales_send_approve',
  714. formCreateUserId: data.createUserId,
  715. variables: {
  716. businessCode: data.docNo
  717. }
  718. // callBackMethodType : '1',
  719. // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
  720. // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
  721. // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
  722. // miniHandle : '',
  723. // miniView : '',
  724. };
  725. this.$refs.processSubmitDialogRef.init(params);
  726. });
  727. // submit({
  728. // businessId: this.businessId || res
  729. // // productionSupervisorId
  730. // }).then((res) => {
  731. // this.cancel();
  732. // this.$emit('done');
  733. // });
  734. },
  735. reload() {
  736. this.cancel();
  737. this.$emit('done');
  738. },
  739. cancel() {
  740. this.$nextTick(() => {
  741. this.activeName = 'first';
  742. // 关闭后,销毁所有的表单数据
  743. this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
  744. this.$refs['formRef'] && this.$refs['formRef'].resetFields();
  745. this.$store.commit('order/clearUserData');
  746. this.form = copyObj(this.formDef);
  747. this.visible = false;
  748. });
  749. }
  750. }
  751. };
  752. </script>
  753. <style scoped lang="scss">
  754. .TotalAmount {
  755. font-size: 16px;
  756. padding-right: 30px;
  757. }
  758. .headbox {
  759. display: flex;
  760. justify-content: flex-start;
  761. align-items: center;
  762. .amount {
  763. font-size: 14px;
  764. font-weight: bold;
  765. margin-right: 20px;
  766. }
  767. }
  768. </style>