index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. <template>
  2. <div>
  3. <basic-container v-show="isShow">
  4. <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
  5. :table-loading="loading" @row-del="rowDel" :before-open="beforeOpen" :before-close="beforeClose"
  6. @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
  7. @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
  8. @tree-load="treeLoad" @saveColumn="saveColumn" @resetColumn="resetColumn"
  9. @search-criteria-switch="searchCriteriaSwitch" :cell-style="cellStyle">
  10. <template slot="menuLeft" slot-scope="{size}">
  11. <el-button type="success" :size="size" icon="el-icon-copy-document" @click="copyOrder" :disabled="single">复制单据
  12. </el-button>
  13. <el-button type="info" :size="size" icon="el-icon-printer" @click="outExport">导出</el-button>
  14. <el-button type="warning" :size="size" icon="el-icon-thumb" :disabled="multiple" @click="applyPayment">申请货款
  15. </el-button>
  16. </template>
  17. <template slot-scope="scope" slot="orgOrderNo">
  18. <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.orgOrderNo }}</span>
  19. </template>
  20. <template slot="corpIdSearch">
  21. <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
  22. </template>
  23. <template slot-scope="scope" slot="corpId">
  24. <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.strCorpName }}</span>
  25. </template>
  26. <template slot-scope="scope" slot="orderNo">
  27. <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.orderNo }}</span>
  28. </template>
  29. <template slot-scope="scope" slot="createUser">
  30. {{ scope.row.createUserName }}
  31. </template>
  32. <template slot-scope="scope" slot="createFreight">
  33. {{ scope.row.createFreight == 1 ? '是' : '否' }}
  34. </template>
  35. <template slot-scope="scope" slot="menu">
  36. <el-button type="text" icon="el-icon-delete" size="small" @click.stop="createPlant(scope.row, scope.index)"
  37. :disabled="scope.row.status > 0 || scope.row.createFreight == 1">生成工厂发货
  38. </el-button>
  39. <!-- <el-button-->
  40. <!-- type="text"-->
  41. <!-- icon="el-icon-edit"-->
  42. <!-- size="small"-->
  43. <!-- @click.stop="editOpen(scope.row,scope.index)"-->
  44. <!-- >编辑-->
  45. <!-- </el-button>-->
  46. <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(scope.row, scope.index)"
  47. :disabled="(scope.row.itemsList && scope.row.itemsList.length == 0) || scope.row.createFreight == 1">删除
  48. </el-button>
  49. </template>
  50. </avue-crud>
  51. </basic-container>
  52. <detail-page ref="detail" @goBack="goBack" :detailData="detailData" v-if="!isShow"></detail-page>
  53. <el-dialog title="账单" append-to-body class="el-dialogDeep" :visible.sync="applyPaymentDialog" width="60%"
  54. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  55. <apply-payment v-if="applyPaymentDialog" :billType="billType" :billData="billData" :arrList="applyPaymentList"
  56. @choceFun="choceFun">
  57. </apply-payment>
  58. </el-dialog>
  59. <el-dialog append-to-body title="账单" class="el-dialogDeep" :visible.sync="financialAccountDialog" width="70%"
  60. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  61. <financial-account v-if="financialAccountDialog" :billType="billType" :billData="billData"
  62. :checkData="financeData" :arrList="applyPaymentList" @choceFun="choceFun" tradeType="GN" @submit="feeSubmit" :addBut="false">
  63. </financial-account>
  64. </el-dialog>
  65. </div>
  66. </template>
  67. <script>
  68. import option from "./configuration/mainList.json";
  69. import { customerList, deleteDetails, generateShipment, genfactory, getApplyAmount } from "@/api/basicData/purchaseOrder"
  70. import detailPage from "./detailsPageEdit";
  71. import { defaultDate } from "@/util/date";
  72. import ApplyPayment from "@/components/finance/applyPayment";
  73. import financialAccount from "../../../components/finance/financialAccount";
  74. import { gainUser } from "@/api/basicData/customerInquiry";
  75. import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
  76. import { getCurrentDate } from "@/util/date";
  77. import {getToken} from "@/util/auth";
  78. export default {
  79. name: "customerInformation",
  80. props: {
  81. detailData: {
  82. type: Object
  83. }
  84. },
  85. components: {
  86. detailPage,
  87. ApplyPayment,
  88. financialAccount
  89. },
  90. data() {
  91. return {
  92. configuration: {
  93. multipleChoices: false,
  94. multiple: false,
  95. collapseTags: false,
  96. placeholder: "请点击右边按钮选择",
  97. dicData: [],
  98. clearable: true,
  99. },
  100. search: {},
  101. loading: false,
  102. form: {},
  103. option: {},
  104. parentId: 0,
  105. dataList: [],
  106. page: {
  107. pageSize: 10,
  108. currentPage: 1,
  109. total: 0,
  110. pageSizes: [10, 50, 100, 200, 300]
  111. },
  112. // 非单个禁用
  113. single: true,
  114. // 非多个禁用
  115. multiple: true,
  116. selection: [],
  117. isShow: true,
  118. detailData: {},
  119. billType: "申请", //账单类型
  120. billData: {}, //账单需要数据
  121. financeData: {
  122. url: "/financialManagement/paymentRequest/index",
  123. pageStatus: "this.$store.getters.pqStatus",
  124. pageLabel: "付费申请",
  125. checkType: 'ffsq'
  126. }, // 账单请核需要的路由
  127. applyPaymentDialog: false,//生成账单组件
  128. financialAccountDialog: false,
  129. applyPaymentList: [],
  130. feesOption: [],
  131. }
  132. },
  133. async created() {
  134. // this.search.requiredArrivalDate = defaultDate(1)
  135. this.search.createTime = defaultDate(3)
  136. // this.option = option
  137. this.option = await this.getColumnData(this.getColumnName(17), option);
  138. this.getWorkDicts("payment_term").then(res => {
  139. this.findObject(this.option.column, "paymentType").dicData =
  140. res.data.data;
  141. });
  142. gainUser().then(res => {
  143. this.findObject(this.option.column, "createUser").dicData = res.data.data;
  144. })
  145. feeList().then(res => {
  146. this.feesOption = res.data.data.records
  147. })
  148. let i = 0;
  149. this.option.column.forEach(item => {
  150. if (item.search) i++
  151. })
  152. if (i % 3 !== 0) {
  153. const num = 3 - Number(i % 3)
  154. this.option.searchMenuSpan = num * 8;
  155. this.option.searchMenuPosition = "right";
  156. }
  157. this.option.column.forEach(item => {
  158. if (item.pickerOptions) {
  159. item.pickerOptions = {
  160. shortcuts: [{
  161. text: '最近一周',
  162. onClick(picker) {
  163. const end = new Date();
  164. const start = new Date();
  165. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  166. picker.$emit('pick', [start, end]);
  167. }
  168. }, {
  169. text: '最近一个月',
  170. onClick(picker) {
  171. const end = new Date();
  172. const start = new Date();
  173. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  174. picker.$emit('pick', [start, end]);
  175. }
  176. }, {
  177. text: '最近三个月',
  178. onClick(picker) {
  179. const end = new Date();
  180. const start = new Date();
  181. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  182. picker.$emit('pick', [start, end]);
  183. }
  184. }]
  185. }
  186. }
  187. })
  188. },
  189. activated() {
  190. if (this.$route.query.check) {
  191. this.isShow = true
  192. // this.beforeOpenPage({id: this.$route.query.check.billId})
  193. this.detailData = {
  194. id: this.$route.query.check.billId,
  195. check: this.$route.query.check,
  196. };
  197. this.isShow = false;
  198. this.$store.commit("DOMCG_IN_DETAIL");
  199. }
  200. if (this.$route.query.params) {
  201. this.beforeOpenPage({ id: this.$route.query.params })
  202. }
  203. },
  204. methods: {
  205. cellStyle() {
  206. return "padding:0;height:40px;";
  207. },
  208. searchCriteriaSwitch(type) {
  209. if (type) {
  210. this.option.height = this.option.height - 90
  211. } else {
  212. this.option.height = this.option.height + 90
  213. }
  214. this.$refs.crud.getTableHeight()
  215. },
  216. //删除列表后面的删除按钮触发触发(row, index, done)
  217. rowDel(row, index, done) {
  218. this.$confirm("确定将选择数据删除?", {
  219. confirmButtonText: "确定",
  220. cancelButtonText: "取消",
  221. type: "warning"
  222. }).then(() => {
  223. return deleteDetails(row.id);
  224. }).then(() => {
  225. this.$message({
  226. type: "success",
  227. message: "操作成功!"
  228. });
  229. this.page.currentPage = 1;
  230. this.onLoad(this.page, { parentId: 0 });
  231. });
  232. },
  233. //查询全部
  234. initData() {
  235. customerList().then(res => {
  236. const column = this.findObject(this.option.column, "parentId");
  237. column.dicData = res.data.data.records;
  238. });
  239. },
  240. //新增子项触发
  241. handleAdd(row) {
  242. this.parentId = row.id;
  243. const column = this.findObject(this.option.column, "parentId");
  244. column.value = row.id;
  245. column.addDisabled = true;
  246. this.$refs.crud.rowAdd();
  247. },
  248. //查看跳转页面
  249. beforeOpenPage(row, index) {
  250. const data = {
  251. moduleName: 'cg',
  252. tableName: 'business_order',
  253. billId: row.id,
  254. no: localStorage.getItem('browserID')
  255. }
  256. this.checkLock(data).then(res => {
  257. if (res.data.code == 200) {
  258. this.detailData = {
  259. seeDisabled: true,
  260. id: row.id,
  261. };
  262. this.isShow = false;
  263. this.$store.commit("DOMCG_IN_DETAIL");
  264. }
  265. }).catch(err => {
  266. this.detailData = {
  267. id: row.id,
  268. seeDisabled: true,
  269. opDisabled: true
  270. };
  271. this.isShow = false;
  272. this.$store.commit("DOMCG_IN_DETAIL");
  273. })
  274. },
  275. //新增跳转页面
  276. beforeOpen(row, index) {
  277. this.detailData = {
  278. id: row.id,
  279. };
  280. this.isShow = false;
  281. this.$store.commit("DOMCG_IN_DETAIL");
  282. },
  283. editOpen(row, index) {
  284. const data = {
  285. moduleName: 'cg',
  286. tableName: 'business_order',
  287. billId: row.id,
  288. no: localStorage.getItem('browserID')
  289. }
  290. this.checkLock(data).then(res => {
  291. if (res.data.code == 200) {
  292. this.detailData = {
  293. seeDisabled: true,
  294. id: row.id,
  295. };
  296. this.isShow = false;
  297. this.$store.commit("DOMCG_IN_DETAIL");
  298. }
  299. }).catch(err => {
  300. this.detailData = {
  301. id: row.id,
  302. seeDisabled: true,
  303. opDisabled: true
  304. };
  305. this.isShow = false;
  306. this.$store.commit("DOMCG_IN_DETAIL");
  307. })
  308. },
  309. // 复制新单
  310. copyOrder() {
  311. const id = this.selection[0].id;
  312. this.detailData = {
  313. copyId: id,
  314. };
  315. this.isShow = false;
  316. this.$store.commit("DOMCG_IN_DETAIL");
  317. },
  318. //导出
  319. outExport() {
  320. this.$confirm('是否导出数据明细?', '提示', {
  321. confirmButtonText: '确定',
  322. cancelButtonText: '取消',
  323. type: 'warning'
  324. }).then(() => {
  325. let queryParams = this.search
  326. if (queryParams.requiredArrivalDate) {
  327. this.$set(queryParams, 'requiredArrivalStartDate', queryParams.requiredArrivalDate[0] + " " + "00:00:00")
  328. this.$set(queryParams, 'requiredArrivalEndDate', queryParams.requiredArrivalDate[1] + " " + "23:59:59")
  329. this.$delete(queryParams, 'requiredArrivalDate')
  330. }
  331. if (queryParams.createTime) {
  332. queryParams.createStartTime = queryParams.createTime[0] + " " + "00:00:00"
  333. queryParams.createEndTime = queryParams.createTime[1] + " " + "23:59:59"
  334. this.$delete(queryParams, 'createTime')
  335. }
  336. const routeData = this.$router.resolve({
  337. path: '/api/trade-purchase/purchase-order/selOrderExport', //跳转目标窗口的地址
  338. query: {
  339. ...queryParams //括号内是要传递给新窗口的参数
  340. }
  341. })
  342. window.open(routeData.href.slice(1,routeData.href.length-1)+'&'+`${this.website.tokenHeader}=${getToken()}`);
  343. }).catch(() => {
  344. this.$message({
  345. type: 'info',
  346. message: '已取消' //
  347. });
  348. })
  349. },
  350. //点击新增时触发
  351. beforeClose(done) {
  352. this.parentId = "";
  353. const column = this.findObject(this.option.column, "parentId");
  354. column.value = "";
  355. column.addDisabled = false;
  356. done();
  357. },
  358. //点击搜索按钮触发
  359. searchChange(params, done) {
  360. if (params.requiredArrivalDate) {
  361. this.$set(params, 'requiredArrivalStartDate', params.requiredArrivalDate[0] + " " + "00:00:00")
  362. this.$set(params, 'requiredArrivalEndDate', params.requiredArrivalDate[1] + " " + "23:59:59")
  363. this.$delete(params, 'requiredArrivalDate')
  364. }
  365. if (params.createTime) {
  366. params.createStartTime = params.createTime[0] + " " + "00:00:00"
  367. params.createEndTime = params.createTime[1] + " " + "23:59:59"
  368. this.$delete(params, 'createTime')
  369. }
  370. this.page.currentPage = 1;
  371. this.onLoad(this.page, params);
  372. done()
  373. },
  374. searchReset() {
  375. },
  376. selectionChange(list) {
  377. this.selection = []
  378. this.selection = list;
  379. this.single = list.length !== 1;
  380. this.multiple = list.length == 0
  381. },
  382. currentChange(currentPage) {
  383. this.page.currentPage = currentPage;
  384. },
  385. sizeChange(pageSize) {
  386. this.page.pageSize = pageSize;
  387. },
  388. refreshChange() {
  389. this.page.currentPage = 1;
  390. this.onLoad(this.page, this.search);
  391. },
  392. onLoad(page, params) {
  393. let data = this.gobackSearch(params)
  394. let queryParams = Object.assign({ tradeType: 'GN' }, data, {
  395. size: page.pageSize,
  396. current: page.currentPage,
  397. // billType:'CG',
  398. // corpsTypeId: this.treeDeptId
  399. })
  400. this.loading = true;
  401. customerList(queryParams).then(res => {
  402. this.dataList = res.data.data.records
  403. this.page.total = res.data.data.total
  404. this.option.height = window.innerHeight - 240;
  405. }).finally(() => {
  406. this.loading = false;
  407. })
  408. },
  409. //树桩列点击展开触发
  410. treeLoad(tree, treeNode, resolve) {
  411. const parentId = tree.id;
  412. customerList({ parentId: parentId }).then(res => {
  413. resolve(res.data.data.records);
  414. });
  415. },
  416. goBack() {
  417. this.selection = []
  418. this.applyPaymentList = []
  419. this.single = true
  420. this.multiple = true
  421. this.detailData = this.$options.data().detailData
  422. this.isShow = true;
  423. this.onLoad(this.page, this.search);
  424. },
  425. gobackSearch(params) {
  426. params = Object.assign({}, this.search)
  427. if (params.requiredArrivalDate && params.requiredArrivalDate != '') {
  428. params.requiredArrivalStartDate = params.requiredArrivalDate[0] + " " + "00:00:00"
  429. params.requiredArrivalEndDate = params.requiredArrivalDate[1] + " " + "23:59:59"
  430. this.$delete(params, 'requiredArrivalDate')
  431. }
  432. if (params.createTime && params.createTime != '') {
  433. params.createStartTime = params.createTime[0] + " " + "00:00:00"
  434. params.createEndTime = params.createTime[1] + " " + "23:59:59"
  435. this.$delete(params, 'createTime')
  436. }
  437. return params
  438. },
  439. //列保存触发
  440. async saveColumn() {
  441. /**
  442. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  443. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  444. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  445. */
  446. const inSave = await this.saveColumnData(
  447. this.getColumnName(17),
  448. this.option
  449. );
  450. if (inSave) {
  451. this.$message.success("保存成功");
  452. //关闭窗口
  453. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  454. this.$nextTick(() => {
  455. this.$refs.crud.doLayout()
  456. })
  457. }
  458. },
  459. async resetColumn() {
  460. this.option = option;
  461. const inSave = await this.delColumnData(
  462. this.getColumnName(17),
  463. option
  464. );
  465. if (inSave) {
  466. this.$nextTick(() => {
  467. this.$refs.crud.doLayout()
  468. })
  469. this.$message.success("重置成功");
  470. //关闭窗口
  471. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  472. }
  473. },
  474. // 申请货款
  475. async applyPayment() {
  476. this.applyPaymentList = []
  477. if (this.selection.length > 1) {
  478. for (let item in this.selection) {
  479. if (this.selection[0].corpId !== this.selection[item].corpId) {
  480. return this.$message.error('批量结算供应商必须一致')
  481. }
  482. }
  483. }
  484. // let forData = await this.forData()
  485. // if (forData) {
  486. // return this.$message.error('订单号:' + forData + '货款余额不足')
  487. // }
  488. let a = []
  489. this.selection.forEach(item => {
  490. item.itemsList = item.itemsList ? item.itemsList : [];
  491. let amount = Number(item.debitAmount) - Number(item.settlmentAmount);
  492. let quantity = 0;
  493. item.itemsList.map(e => {
  494. if (e.submitPay != 1) {
  495. // amount += Number(e.amount)
  496. quantity += Number(e.orderQuantity)
  497. }
  498. })
  499. const price = quantity === 0 ? 0 : Number(amount) / Number(quantity)
  500. let form = {
  501. belongCompany: item.belongCompany,
  502. srcOrderno: item.orderNo,
  503. itemType: "采购",
  504. corpsName: [{ cname: item.strCorpName, id: item.id }],
  505. corpId: item.corpId,
  506. srcParentId: item.id,
  507. currency: 'CNY',
  508. exchangeRate: '1',
  509. taxRate: '0',
  510. accDate: item.businesDate,
  511. srcType: 1,
  512. tradeType: 'GN',
  513. optionType: 'GN',
  514. costType: this.feesOption.find(e => e.cname == '货款') ? this.feesOption.find(e => e.cname == '货款').id : null,
  515. amount,
  516. quantity,
  517. price,
  518. unit: '条',
  519. remarks: item.orderRemark,
  520. itemorderAmount:item.orderAmount,
  521. itemId:item.id
  522. }
  523. a.push(form)
  524. // item.itemsList.forEach(e => {
  525. // let form = {
  526. // srcOrderno:item.orderNo,
  527. // itemType:"采购",
  528. // optionType:"GN",
  529. // corpsName: [{cname: item.strCorpName, id: item.id}],
  530. // corpId:item.corpId,
  531. // srcParentId: item.id,
  532. // currency: 'CNY',
  533. // exchangeRate: '1',
  534. // taxRate: '0',
  535. // accDate: item.businesDate,
  536. // srcType: 1,
  537. // tradeType: 'GN',
  538. // costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
  539. // goodName: e.goodsName,
  540. // price: e.price,
  541. // quantity: e.orderQuantity,
  542. // unit: e.unit,
  543. // amount: e.amount,
  544. // }
  545. // a.push(form)
  546. // })
  547. })
  548. this.applyPaymentList = [...a]
  549. // this.beforeBillData(true);
  550. this.financialAccountDialog = true;
  551. },
  552. async forData() {
  553. for (let item in this.selection) {
  554. let res = await getApplyAmount({ srcBillId: this.selection[item].id, billType: "申请" })
  555. if (this.selection[item].orderAmount <= res.data.data) {
  556. return this.selection[item].orderNo
  557. }
  558. }
  559. },
  560. beforeBillData(type) {
  561. if (type) { //申请货款
  562. // this.billData.srcId = -1
  563. }
  564. },
  565. //关闭账单
  566. choceFun() {
  567. this.financialAccountDialog = false
  568. },
  569. feeSubmit() {
  570. this.onLoad(this.page, this.search)
  571. },
  572. // 生成工厂发货
  573. createPlant(row, index) {
  574. let ids = [];
  575. row.itemsList.forEach(item => {
  576. ids.push(item.id)
  577. })
  578. let data = {
  579. id: row.id,
  580. orderItemIds: ids
  581. }
  582. generateShipment(data).then(res => {
  583. this.$confirm("此操作将生成工厂发货,是否继续?", {
  584. confirmButtonText: "确定",
  585. cancelButtonText: "取消",
  586. type: "warning"
  587. }).then(() => {
  588. res.data.data.orgId = res.data.data.id
  589. res.data.data.deliveryStatus = '录入'
  590. res.data.data.salesCompany = res.data.data.belongToCorpId
  591. res.data.data.totalWeight = res.data.data.cartonWeight
  592. res.data.data.totalVolumn = res.data.data.cntrVolumn
  593. res.data.data.deliveryAmount = 0
  594. res.data.data.totalQuantity = 0
  595. res.data.data.purchaseAmount = 0
  596. res.data.data.orderItemsList.forEach(item => {
  597. item.containerVolume = item.cntrVolumn
  598. item.actualWeight = item.cartonWeight
  599. item.specificationAndModel = item.itemType
  600. item.orgOrderNo = res.data.data.orgOrderNo
  601. item.inventoryNumber = item.storageQuantity
  602. item.srcId = item.id
  603. item.purchaseAmount = item.purchaseAmount
  604. item.purchaseQuantity = Number(item.orderQuantity)
  605. item.actualQuantity = (Number(item.orderQuantity) - Number(item.actualQuantity))
  606. res.data.data.deliveryAmount = Number(res.data.data.deliveryAmount) + Number(item.deliveryAmount)
  607. res.data.data.totalQuantity = Number(res.data.data.totalQuantity) + Number(item.actualQuantity)
  608. res.data.data.purchaseAmount = Number(res.data.data.purchaseAmount) + Number(item.deliveryAmount)
  609. res.data.data.deliveryAmount = Number(res.data.data.deliveryAmount ? res.data.data.deliveryAmount : 0).toFixed(2)
  610. res.data.data.purchaseAmount = Number(res.data.data.purchaseAmount ? res.data.data.purchaseAmount : 0).toFixed(2)
  611. delete item.id
  612. delete item.pid
  613. })
  614. res.data.data.deliveryItemsList = res.data.data.orderItemsList
  615. res.data.data.businessDate = getCurrentDate()
  616. delete res.data.data.createTime
  617. delete res.data.data.id
  618. delete res.data.data.sysNo
  619. delete res.data.data.orderItemsList
  620. delete res.data.data.corpName
  621. delete res.data.data.belongToCorpList
  622. res.data.data.deliveryAmount = res.data.data.debitAmount
  623. res.data.data.srcOrderNo = res.data.data.orgOrderNo
  624. delete res.data.data.debitAmount
  625. res.data.data.deliveryItemsList.forEach(item => item.deliveryAmount = item.amount)
  626. genfactory(res.data.data).then(() => {
  627. this.$message.success('生成工厂发货成功')
  628. this.onLoad(this.page, this.search);
  629. })
  630. });
  631. // this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
  632. // this.$router.push({
  633. // path: "/businessManagement/receipt/index",
  634. // query: { form: JSON.stringify(res.data.data) },
  635. // });
  636. })
  637. },
  638. }
  639. }
  640. </script>
  641. <style scoped>
  642. </style>