detailsPage.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="add-customer-btn" v-if="showBut">
  14. <el-button type="info" @click="saveSell" size="small"
  15. >生成采购单</el-button
  16. >
  17. <el-button type="success" disabled size="small">
  18. 复制新单
  19. </el-button>
  20. <el-button
  21. type="primary"
  22. :disabled="disabled"
  23. @click="editCustomer"
  24. :loading="subLoading"
  25. v-if="detailData.status != 1"
  26. size="small"
  27. >{{ form.id ? "确认修改" : "确认新增" }}
  28. </el-button>
  29. </div>
  30. </div>
  31. <div class="customer-main">
  32. <containerTitle title="基础信息"></containerTitle>
  33. <basic-container>
  34. <avue-form
  35. ref="form"
  36. class="trading-form"
  37. v-model="form"
  38. :option="option"
  39. >
  40. <template slot="portOfLoad">
  41. <port-info
  42. v-model="form.portOfLoad"
  43. :disabled="detailData.status == 1"
  44. />
  45. </template>
  46. <template slot="portOfDestination">
  47. <port-info
  48. v-model="form.portOfDestination"
  49. :disabled="detailData.status == 1"
  50. />
  51. </template>
  52. <template slot="corpId">
  53. <crop-select
  54. v-model="form.corpId"
  55. @getCorpData="getCorpData"
  56. corpType="KH"
  57. :disabled="detailData.status == 1"
  58. ></crop-select>
  59. </template>
  60. <template slot="priceTerms">
  61. <el-select
  62. size="small"
  63. v-model="form.priceTerms"
  64. placeholder="请选择"
  65. @change="priceTermsChange"
  66. clearable
  67. >
  68. <el-option
  69. v-for="item in priceTermsList"
  70. :key="item.id"
  71. :label="item.dictValue"
  72. :value="item.dictValue"
  73. >
  74. </el-option>
  75. </el-select>
  76. </template>
  77. <template slot="paymentType">
  78. <el-select
  79. size="small"
  80. v-model="form.paymentType"
  81. placeholder="请选择"
  82. @change="paymentTypeChange"
  83. clearable
  84. >
  85. <el-option
  86. v-for="item in paymentTermList"
  87. :key="item.id"
  88. :label="item.dictValue"
  89. :value="item.dictValue"
  90. >
  91. </el-option>
  92. </el-select>
  93. </template>
  94. <template slot="boxNumber">
  95. <el-input
  96. size="mini"
  97. v-model="form.boxNumber"
  98. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
  99. "$1.$2")'
  100. placeholder="请输入 起订量"
  101. :disabled="detailData.status == 1"
  102. />
  103. </template>
  104. <template slot="minOrder">
  105. <el-input
  106. size="mini"
  107. v-model="form.minOrder"
  108. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
  109. "$1.$2")'
  110. placeholder="请输入 起订量"
  111. :disabled="detailData.status == 1"
  112. />
  113. </template>
  114. <template slot="predictOceanFreight">
  115. <el-input
  116. size="mini"
  117. v-model="form.predictOceanFreight"
  118. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
  119. "$1.$2")'
  120. placeholder="请输入 预计海运费"
  121. :disabled="detailData.status == 1"
  122. />
  123. </template>
  124. <template slot="referenceOceanFreight">
  125. <el-input
  126. size="mini"
  127. v-model="form.referenceOceanFreight"
  128. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
  129. "$1.$2")'
  130. placeholder="请输入 参考海运费"
  131. :disabled="detailData.status == 1"
  132. />
  133. </template>
  134. <template slot="oceanFreight">
  135. <el-input
  136. size="mini"
  137. v-model="form.oceanFreight"
  138. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
  139. "$1.$2")'
  140. placeholder="请输入 实际海运费"
  141. :disabled="detailData.status == 1"
  142. />
  143. </template>
  144. <template slot="orderNo">
  145. <el-input
  146. size="mini"
  147. v-model="form.orderNo"
  148. oninput="this.value=this.value.toUpperCase()"
  149. placeholder="请输入 "
  150. :disabled="detailData.status == 1"
  151. />
  152. </template>
  153. </avue-form>
  154. </basic-container>
  155. <div>
  156. <containerTitle title="商品信息"></containerTitle>
  157. <basic-container>
  158. <avue-crud
  159. ref="crud"
  160. :data="data"
  161. :option="tableOption"
  162. @row-del="rowDel"
  163. @selection-change="goodsSelectionChange"
  164. @saveColumn="saveColumn"
  165. :summary-method="summaryMethod"
  166. :cell-style="cellStyle"
  167. >
  168. <template slot="cname" slot-scope="{ row, index }">
  169. <span v-if="row.$cellEdit" style="display:flex">
  170. <el-select
  171. v-model="row.cname"
  172. placeholder="请选择"
  173. size="small"
  174. style="width:60%"
  175. @change="cnameChange(row, index)"
  176. >
  177. <el-option
  178. v-for="item in goodsoptions"
  179. :key="item.id"
  180. :label="item.cname"
  181. :value="item.cname"
  182. >
  183. </el-option>
  184. </el-select>
  185. <el-button
  186. icon="el-icon-search"
  187. size="small"
  188. @click="rePick(row, index)"
  189. ></el-button>
  190. </span>
  191. <span v-else> {{ row.cname }}</span>
  192. </template>
  193. <template slot="partsList" slot-scope="{ row, index }">
  194. <el-button
  195. size="small"
  196. type="text"
  197. @click="partrePick(row, index)"
  198. :disabled="disabled"
  199. >操作</el-button
  200. >
  201. </template>
  202. <template slot="itemType" slot-scope="{ row }">
  203. <el-select
  204. v-if="row.$cellEdit"
  205. v-model="row.itemType"
  206. filterable
  207. allow-create
  208. default-first-option
  209. placeholder="请输入"
  210. size="small"
  211. @focus="itemTypeFocus(row)"
  212. >
  213. <el-option
  214. v-for="(item, index) in itemtypeList"
  215. :key="index"
  216. :label="item.value"
  217. :value="item.value"
  218. >
  219. </el-option>
  220. </el-select>
  221. <span v-else>{{ row.itemType }}</span>
  222. </template>
  223. <template slot="priorityReferrer" slot-scope="{ row }">
  224. <el-checkbox
  225. :disabled="!row.$cellEdit"
  226. v-model="row.priorityReferrer"
  227. :true-label="1"
  228. :false-label="0"
  229. />
  230. </template>
  231. <template slot="corpId" slot-scope="{ row, index }">
  232. <customer-dialog
  233. v-if="row.$cellEdit"
  234. v-model="row.corpName"
  235. :cropIndex="index"
  236. @getcorpId="getcorpId"
  237. ></customer-dialog>
  238. <span v-else>{{ row.corpName }}</span>
  239. </template>
  240. <template slot="purchaseAmount" slot-scope="{ row }">
  241. <el-input
  242. v-if="row.$cellEdit"
  243. v-model="row.purchaseAmount"
  244. size="small"
  245. placeholder="请输入"
  246. @change="priceChange(row)"
  247. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  248. ></el-input>
  249. <span v-else>{{ row.purchaseAmount | micrometerFormat }}</span>
  250. </template>
  251. <template slot="price" slot-scope="{ row }">
  252. <el-input
  253. v-if="row.$cellEdit"
  254. v-model="row.price"
  255. size="small"
  256. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  257. @change="priceChange(row)"
  258. ></el-input>
  259. <span v-else>{{ row.price | micrometerFormat }}</span>
  260. </template>
  261. <template slot="amount" slot-scope="{ row }">
  262. <span>{{ row.amount | micrometerFormat }}</span>
  263. </template>
  264. <template slot="orderQuantity" slot-scope="{ row }">
  265. <el-input
  266. v-if="row.$cellEdit"
  267. v-model="row.orderQuantity"
  268. size="small"
  269. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  270. @change="priceChange(row)"
  271. ></el-input>
  272. <span v-else>{{ row.orderQuantity }}</span>
  273. </template>
  274. <template slot="discount" slot-scope="{ row }">
  275. <el-input
  276. v-if="row.$cellEdit"
  277. v-model="row.discount"
  278. size="small"
  279. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  280. @change="discountChange(row)"
  281. ></el-input>
  282. <span v-else>{{ row.discount | isDiscount }}</span>
  283. </template>
  284. <template slot="insurance" slot-scope="{ row }">
  285. <el-input
  286. v-if="row.$cellEdit"
  287. v-model="row.insurance"
  288. size="small"
  289. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  290. @change="priceChange(row)"
  291. ></el-input>
  292. <span v-else>{{ row.insurance | micrometerFormat }}</span>
  293. </template>
  294. <template slot="freight" slot-scope="{ row }">
  295. <el-input
  296. v-if="row.$cellEdit"
  297. v-model="row.freight"
  298. size="small"
  299. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  300. @change="priceChange(row)"
  301. ></el-input>
  302. <span v-else>{{ row.freight | micrometerFormat }}</span>
  303. </template>
  304. <template slot="taxRate" slot-scope="{ row }">
  305. <el-input
  306. v-if="row.$cellEdit"
  307. v-model="row.taxRate"
  308. size="small"
  309. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  310. @change="taxRateChange(row)"
  311. ></el-input>
  312. <span v-else>{{ row.taxRate | isPercentage }}</span>
  313. </template>
  314. <template slot="menuLeft">
  315. <el-button
  316. type="primary"
  317. icon="el-icon-plus"
  318. size="small"
  319. @click.stop="newDetails"
  320. :disabled="detailData.status == 1"
  321. >新增明细</el-button
  322. >
  323. <el-button
  324. type="primary"
  325. icon="el-icon-plus"
  326. size="small"
  327. @click.stop="addLibrary"
  328. :disabled="detailData.status == 1"
  329. >出口价格库</el-button
  330. >
  331. <el-button
  332. type="info"
  333. icon="el-icon-printer"
  334. size="small"
  335. @click.stop="openReport()"
  336. >报 表</el-button
  337. >
  338. <el-button
  339. type="warning"
  340. icon="el-icon-plus"
  341. size="small"
  342. :disabled="detailData.status == 1 || orderItemIds.length == 0"
  343. @click="getInvoice"
  344. >生成发货单
  345. </el-button>
  346. </template>
  347. <template slot="menu" slot-scope="{ row, index }">
  348. <el-button
  349. size="small"
  350. icon="el-icon-edit"
  351. type="text"
  352. @click="rowCell(row, index)"
  353. :disabled="disabled"
  354. >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
  355. >
  356. <el-button
  357. size="small"
  358. icon="el-icon-edit"
  359. type="text"
  360. @click="rowDel(row, index)"
  361. :disabled="detailData.status == 1"
  362. >删 除</el-button
  363. >
  364. </template>
  365. </avue-crud>
  366. </basic-container>
  367. </div>
  368. <fee-info
  369. ref="feeInfo"
  370. :orderFeesList="orderFeesList"
  371. :disabled="detailData.status == 1"
  372. feeUrl="/blade-purchase-sales/orderfees/update"
  373. />
  374. <upload-file
  375. ref="uploadFile"
  376. title="合同附件"
  377. :orderFilesList="orderFilesList"
  378. :disabled="detailData.status == 1"
  379. delUrl="/blade-purchase-sales/orderfiles/update"
  380. />
  381. <div>
  382. <containerTitle title="银行信息"></containerTitle>
  383. <basic-container>
  384. <avue-form
  385. class="trading-form"
  386. ref="form"
  387. v-model="form"
  388. :option="bankOption"
  389. />
  390. </basic-container>
  391. </div>
  392. <div>
  393. <containerTitle title="保险信息"></containerTitle>
  394. <basic-container>
  395. <avue-form
  396. class="trading-form"
  397. ref="form"
  398. v-model="form"
  399. :option="insuranceOption"
  400. />
  401. </basic-container>
  402. </div>
  403. <div>
  404. <containerTitle title="唛头"></containerTitle>
  405. <basic-container>
  406. <avue-form
  407. class="trading-form"
  408. ref="form"
  409. v-model="form"
  410. :option="markOption"
  411. />
  412. </basic-container>
  413. </div>
  414. </div>
  415. <el-dialog
  416. title="导入商品"
  417. append-to-body
  418. class="el-dialogDeep"
  419. :visible.sync="dialogVisible"
  420. width="60%"
  421. :close-on-click-modal="false"
  422. :destroy-on-close="true"
  423. :close-on-press-escape="false"
  424. @close="closeGoods"
  425. top="5vh"
  426. v-dialog-drag
  427. >
  428. <span>
  429. <el-row>
  430. <el-col :span="5">
  431. <div>
  432. <el-scrollbar>
  433. <basic-container style="margin-top:45px">
  434. <avue-tree :option="treeOption" @node-click="nodeClick" />
  435. </basic-container>
  436. </el-scrollbar>
  437. </div>
  438. </el-col>
  439. <el-col :span="19">
  440. <avue-crud
  441. :option="goodsOption"
  442. :table-loading="loading"
  443. :data="goodsList"
  444. ref="goodsCrud"
  445. @refresh-change="refreshChange"
  446. @selection-change="selectionChange"
  447. @row-click="rowClick"
  448. :page.sync="page"
  449. @on-load="onLoad"
  450. @saveColumn="saveGoodsColumn"
  451. :cell-style="cellStyle"
  452. ></avue-crud>
  453. </el-col>
  454. </el-row>
  455. </span>
  456. <span slot="footer" class="dialog-footer">
  457. <el-button @click="dialogVisible = false">取 消</el-button>
  458. <el-button
  459. type="primary"
  460. @click="importGoods"
  461. :disabled="selectionList.length == 0"
  462. >导入</el-button
  463. >
  464. </span>
  465. </el-dialog>
  466. <report-dialog
  467. :switchDialog="switchDialog"
  468. :reportId="form.id"
  469. reportName="销售明细(E)"
  470. @onClose="onClose()"
  471. ></report-dialog>
  472. <part-dialog
  473. ref="part"
  474. @partOpen="partOpen()"
  475. :partList="partList"
  476. @importPart="importPart"
  477. @partClosed="partClosed"
  478. @partReData="partReData"
  479. />
  480. <price-library ref="library" @importLibray="importLibray" />
  481. </div>
  482. </template>
  483. <script>
  484. import tableOption from "./config/customerContact.json";
  485. import goodsOption from "./config/commodity.json";
  486. import feeInfo from "@/components/fee-info/main";
  487. import uploadFile from "@/components/upload-file/main";
  488. import {
  489. detail,
  490. submit,
  491. delItem,
  492. getDeptLazyTree,
  493. getGoods,
  494. deliverGoods,
  495. getPorts,
  496. getSpecification,
  497. saveSell
  498. } from "@/api/basicData/salesContract";
  499. import _ from "lodash";
  500. import reportDialog from "@/components/report-dialog/main";
  501. import partDialog from "@/components/part-dialog/main";
  502. import { micrometerFormat } from "@/util/validate";
  503. import { contrastObj, contrastList } from "@/util/contrastData";
  504. import customerDialog from "@/components/customer-dialog/main";
  505. import priceLibrary from "@/components/price-Library/main";
  506. export default {
  507. name: "detailsPageEdit",
  508. data() {
  509. return {
  510. configuration: {
  511. multipleChoices: false,
  512. multiple: false,
  513. collapseTags: false,
  514. placeholder: "请点击右边按钮选择",
  515. dicData: []
  516. },
  517. switchDialog: false,
  518. form: {
  519. orderStatus: "录入"
  520. },
  521. disabled: false,
  522. dialogVisible: false,
  523. tableOption: {},
  524. option: {
  525. menuBtn: false,
  526. labelWidth: 100,
  527. column: [
  528. {
  529. label: "客户名称",
  530. prop: "corpId",
  531. rules: [
  532. {
  533. required: true,
  534. message: "",
  535. trigger: "blur"
  536. }
  537. ],
  538. span: 16,
  539. slot: true
  540. },
  541. {
  542. label: "系统号",
  543. prop: "sysNo",
  544. span: 8,
  545. disabled: true
  546. },
  547. {
  548. label: "联系人",
  549. prop: "corpAttn",
  550. span: 8
  551. },
  552. {
  553. label: "电话",
  554. prop: "corpTel",
  555. span: 8
  556. },
  557. {
  558. label: "订单状态",
  559. prop: "orderStatus",
  560. span: 8,
  561. type: "select",
  562. dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
  563. props: {
  564. label: "dictValue",
  565. value: "dictValue"
  566. }
  567. },
  568. {
  569. label: "起运港",
  570. prop: "portOfLoad",
  571. span: 8,
  572. type: "select",
  573. filterable: true,
  574. dicData: [],
  575. props: {
  576. label: "name",
  577. value: "name"
  578. }
  579. },
  580. {
  581. label: "目的港",
  582. prop: "portOfDestination",
  583. span: 8,
  584. type: "select",
  585. filterable: true,
  586. dicData: [],
  587. props: {
  588. label: "name",
  589. value: "name"
  590. }
  591. },
  592. {
  593. label: "运输方式",
  594. prop: "transport",
  595. span: 8,
  596. type: "select",
  597. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  598. props: {
  599. label: "dictValue",
  600. value: "dictValue"
  601. }
  602. },
  603. {
  604. label: "价格条款",
  605. prop: "priceTerms",
  606. span: 8
  607. // type: "select",
  608. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=pricing_terms",
  609. // props: {
  610. // label: "dictValue",
  611. // value: "dictValue"
  612. // }
  613. },
  614. {
  615. label: "条款说明",
  616. prop: "priceTermsDescription",
  617. span: 16
  618. },
  619. {
  620. label: "收款方式",
  621. prop: "paymentType",
  622. span: 8
  623. // type: "select",
  624. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
  625. // props: {
  626. // label: "dictValue",
  627. // value: "dictValue"
  628. // }
  629. },
  630. {
  631. label: "收款说明",
  632. prop: "paymentTypeDescription",
  633. span: 16
  634. },
  635. {
  636. label: "订单日期",
  637. prop: "businesDate",
  638. span: 8,
  639. type: "date",
  640. format: "yyyy-MM-dd",
  641. valueFormat: "yyyy-MM-dd 00:00:00",
  642. rules: [
  643. {
  644. required: true,
  645. message: "",
  646. trigger: "blur"
  647. }
  648. ]
  649. },
  650. {
  651. label: "预交日期",
  652. prop: "plannedDeliveryDate",
  653. span: 8,
  654. type: "date",
  655. format: "yyyy-MM-dd",
  656. valueFormat: "yyyy-MM-dd 00:00:00"
  657. },
  658. {
  659. label: "销售订单号",
  660. prop: "orderNo",
  661. span: 8
  662. },
  663. {
  664. label: "币别",
  665. prop: "currency",
  666. span: 8,
  667. type: "select",
  668. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  669. props: {
  670. label: "dictValue",
  671. value: "dictValue"
  672. },
  673. change: ({ value }) => {
  674. if (value == "CNY") {
  675. this.form.exchangeRate = 1;
  676. }
  677. if (value == "USD") {
  678. this.form.exchangeRate = 6.3843;
  679. }
  680. }
  681. },
  682. {
  683. label: "汇率",
  684. prop: "exchangeRate",
  685. span: 8,
  686. slot: true,
  687. row: true,
  688. disabled: true
  689. },
  690. {
  691. label: "箱型",
  692. prop: "boxPile",
  693. type: "select",
  694. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  695. props: {
  696. label: "dictValue",
  697. value: "dictValue"
  698. },
  699. span: 8
  700. },
  701. {
  702. label: "箱量",
  703. prop: "boxNumber",
  704. span: 8
  705. },
  706. {
  707. label: "起订量",
  708. prop: "minOrder",
  709. span: 8
  710. },
  711. {
  712. label: "预计海运费",
  713. prop: "predictOceanFreight",
  714. span: 8
  715. },
  716. {
  717. label: "参考海运费",
  718. prop: "referenceOceanFreight",
  719. span: 8
  720. },
  721. {
  722. label: "实际海运费",
  723. prop: "oceanFreight",
  724. span: 8
  725. },
  726. {
  727. label: "毛利额",
  728. prop: "grossProfit",
  729. span: 8,
  730. disabled: true
  731. },
  732. {
  733. label: "毛利率",
  734. prop: "grossProfitRate",
  735. span: 8,
  736. row: true,
  737. append: "%",
  738. disabled: true
  739. },
  740. {
  741. label: "备注",
  742. prop: "orderRemark",
  743. type: "textarea",
  744. minRows: 2,
  745. span: 8
  746. },
  747. {
  748. label: "采购备注",
  749. prop: "purchaseRemark",
  750. type: "textarea",
  751. minRows: 2,
  752. span: 8
  753. },
  754. {
  755. label: "船务备注",
  756. prop: "shippingRemark",
  757. type: "textarea",
  758. minRows: 2,
  759. span: 8
  760. }
  761. ]
  762. },
  763. treeOption: {
  764. nodeKey: "id",
  765. lazy: true,
  766. treeLoad: function(node, resolve) {
  767. const parentId = node.level === 0 ? 0 : node.data.id;
  768. getDeptLazyTree(parentId).then(res => {
  769. resolve(
  770. res.data.data.map(item => {
  771. return {
  772. ...item,
  773. leaf: !item.hasChildren
  774. };
  775. })
  776. );
  777. });
  778. },
  779. addBtn: false,
  780. menu: false,
  781. size: "small",
  782. props: {
  783. label: "title",
  784. value: "value",
  785. children: "children"
  786. }
  787. },
  788. bankOption: {
  789. menuBtn: false,
  790. labelWidth: 100,
  791. column: [
  792. {
  793. label: "外币银行",
  794. prop: "banks",
  795. span: 8
  796. },
  797. {
  798. label: "银行信息",
  799. prop: "banksAccountName",
  800. span: 16,
  801. type: "textarea",
  802. minRows: 2
  803. }
  804. ]
  805. },
  806. insuranceOption: {
  807. menuBtn: false,
  808. labelWidth: 100,
  809. column: [
  810. {
  811. label: "保险描述",
  812. prop: "insuranceRemarks",
  813. span: 24,
  814. type: "textarea",
  815. minRows: 2
  816. }
  817. ]
  818. },
  819. markOption: {
  820. menuBtn: false,
  821. labelWidth: 100,
  822. column: [
  823. {
  824. label: "唛头描述",
  825. prop: "marks",
  826. span: 24,
  827. type: "textarea",
  828. minRows: 2
  829. }
  830. ]
  831. },
  832. page: {
  833. pageSize: 10,
  834. currentPage: 1,
  835. total: 0
  836. },
  837. loading: false,
  838. goodsOption: {},
  839. data: [],
  840. goodsList: [],
  841. selectionList: [],
  842. treeDeptId: null,
  843. orderFeesList: [],
  844. orderFilesList: [],
  845. orderItemIds: [],
  846. itemtypeList: [],
  847. reData: null,
  848. oldform: {
  849. orderStatus: "录入"
  850. },
  851. olddata: [],
  852. oldorderFeesList: [],
  853. oldorderFilesList: [],
  854. subLoading: false,
  855. pageLoading: false,
  856. showBut: true,
  857. partreData: null,
  858. partType: false,
  859. partList: [],
  860. goodsoptions: [],
  861. priceTermsList: [],
  862. paymentTermList: []
  863. };
  864. },
  865. props: {
  866. detailData: {
  867. type: Object
  868. }
  869. },
  870. components: {
  871. reportDialog,
  872. feeInfo,
  873. uploadFile,
  874. customerDialog,
  875. partDialog,
  876. priceLibrary
  877. },
  878. async created() {
  879. if (this.detailData.id) {
  880. this.getDetail(this.detailData.id);
  881. }
  882. this.tableOption = await this.getColumnData(
  883. this.getColumnName(5),
  884. tableOption
  885. );
  886. this.goodsOption = await this.getColumnData(
  887. this.getColumnName(28),
  888. goodsOption
  889. );
  890. if (this.detailData.status == 1) {
  891. this.option.disabled = true;
  892. this.bankOption.disabled = true;
  893. this.insuranceOption.disabled = true;
  894. this.markOption.disabled = true;
  895. }
  896. getPorts().then(res => {
  897. this.findObject(this.option.column, "portOfLoad").dicData = res.data;
  898. this.findObject(this.option.column, "portOfDestination").dicData =
  899. res.data;
  900. });
  901. this.getWorkDicts("product_properties").then(res => {
  902. this.findObject(this.tableOption.column, "itemProp").dicData =
  903. res.data.data;
  904. });
  905. this.getWorkDicts("unit").then(res => {
  906. this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
  907. });
  908. this.getWorkDicts("pricing_terms").then(res => {
  909. this.priceTermsList = res.data.data;
  910. });
  911. this.getWorkDicts("payment_term").then(res => {
  912. this.paymentTermList = res.data.data;
  913. });
  914. getGoods(1, 500).then(res => {
  915. this.goodsoptions = res.data.data.records;
  916. });
  917. },
  918. methods: {
  919. cellStyle() {
  920. return "padding:0;height:40px;";
  921. },
  922. priceTermsChange(row) {
  923. this.priceTermsList.forEach(e => {
  924. if (row == e.dictValue) {
  925. this.form.priceTermsDescription = e.remark;
  926. }
  927. });
  928. },
  929. paymentTypeChange(row) {
  930. this.paymentTermList.forEach(e => {
  931. if (row == e.dictValue) {
  932. this.form.paymentTypeDescription = e.remark;
  933. }
  934. });
  935. },
  936. getCorpData(row) {
  937. this.form.coefficient = row.coefficient;
  938. },
  939. cnameChange(row) {
  940. this.goodsoptions.forEach(e => {
  941. if (e.cname == row.cname) {
  942. row.itemId = e.id;
  943. row.code = e.code;
  944. row.priceCategory = e.goodsTypeName;
  945. row.itemUrl = e.url;
  946. row.itemDescription = e.cnameDescription;
  947. row.unit = e.unit;
  948. }
  949. });
  950. },
  951. partReData(row) {
  952. this.partreData = row;
  953. this.partOpen();
  954. },
  955. partOpen() {
  956. this.partType = true;
  957. this.addLibrary();
  958. },
  959. addLibrary() {
  960. if (!this.form.corpId) {
  961. return this.$message.error("请选择客户名称");
  962. }
  963. this.$refs.library.init(this.partType, this.partreData != null);
  964. },
  965. partrePick(row, index) {
  966. this.partList = row.partsList;
  967. this.$refs.part.init(index);
  968. },
  969. importPart(rows, sum, index) {
  970. this.data[index].partsList = rows;
  971. this.data[index].partsPrice = sum;
  972. const names = [];
  973. const namePrices = [];
  974. rows.map(e => {
  975. names.push(e.goodName);
  976. namePrices.push(e.goodName + ":" + e.price);
  977. });
  978. this.data[index].partsDescribe = names.join(",");
  979. this.data[index].partsPriceDescribe = namePrices.join(";");
  980. this.priceChange(this.data[index]);
  981. },
  982. partClosed() {
  983. this.partList = [];
  984. this.partreData = null;
  985. if (this.partType) {
  986. this.partType = false;
  987. }
  988. },
  989. saveSell() {
  990. if (!this.form.id) {
  991. return this.$message.error("此单据没有提交记录,请先提交");
  992. }
  993. this.$confirm("是否生成采购单?", {
  994. confirmButtonText: "确定",
  995. cancelButtonText: "取消",
  996. type: "warning"
  997. }).then(() => {
  998. saveSell(this.form.id).then(res => {
  999. if (res.data.code == 200) {
  1000. this.$message.success("生成成功");
  1001. }
  1002. });
  1003. });
  1004. },
  1005. getcorpId(row) {
  1006. this.data[row.index].corpId = row.id;
  1007. },
  1008. rePick(row, index) {
  1009. this.reData = {
  1010. ...row,
  1011. index: index
  1012. };
  1013. this.newDetails();
  1014. },
  1015. rowCell(row, index) {
  1016. if (row.$cellEdit == true) {
  1017. this.$set(row, "$cellEdit", false);
  1018. } else {
  1019. this.$set(row, "$cellEdit", true);
  1020. }
  1021. },
  1022. itemTypeFocus(row) {
  1023. this.itemtypeList = [];
  1024. getSpecification({ goodId: row.itemId }).then(res => {
  1025. const data = res.data.data;
  1026. this.itemtypeList = data.map(item => ({ value: item }));
  1027. });
  1028. },
  1029. priceChange(row) {
  1030. const sum = _.multiply(
  1031. _.add(
  1032. _.add(
  1033. Number(
  1034. _.multiply(
  1035. row.price ? row.price : 0,
  1036. row.orderQuantity ? row.orderQuantity : 0
  1037. )
  1038. ),
  1039. Number(
  1040. _.add(
  1041. Number(row.insurance ? row.insurance : 0),
  1042. Number(row.freight ? row.freight : 0)
  1043. )
  1044. )
  1045. ),
  1046. Number(row.partsPrice ? row.partsPrice : 0)
  1047. ),
  1048. _.divide(row.discount ? row.discount : 10, 10)
  1049. );
  1050. row.amount = Number(sum ? sum : 0).toFixed(2);
  1051. // let amountSum = 0;
  1052. // let purchaseAmountSum = 0;
  1053. // let grossProfitRate = 0;
  1054. // this.data.forEach(e => {
  1055. // amountSum = _.add(amountSum, Number(e.amount));
  1056. // purchaseAmountSum = _.add(
  1057. // purchaseAmountSum,
  1058. // Number(
  1059. // _.multiply(
  1060. // Number(e.purchaseAmount ? e.purchaseAmount : 0),
  1061. // Number(e.orderQuantity)
  1062. // )
  1063. // )
  1064. // );
  1065. // this.form.grossProfit = _.subtract(amountSum, purchaseAmountSum);
  1066. // grossProfitRate =
  1067. // amountSum != 0
  1068. // ? _.multiply(
  1069. // _.divide(_.subtract(amountSum, purchaseAmountSum), amountSum),
  1070. // 100
  1071. // )
  1072. // : 0;
  1073. // this.form.grossProfitRate = Number(
  1074. // grossProfitRate ? grossProfitRate : 0
  1075. // ).toFixed(2);
  1076. // });
  1077. },
  1078. quantityChange(row) {
  1079. if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
  1080. row.orderQuantity = row.actualQuantity;
  1081. this.$message.error("修改的数量不能低于发货数量");
  1082. }
  1083. if (!row.orderQuantity) {
  1084. row.orderQuantity = 0;
  1085. } else {
  1086. row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
  1087. }
  1088. },
  1089. taxRateChange(row) {
  1090. if (Number(row.taxRate) >= 100) {
  1091. row.taxRate = 0;
  1092. this.$message.error("税率不能超过100%");
  1093. }
  1094. },
  1095. grossProfitRateChange(row) {
  1096. if (row >= 100) {
  1097. this.form.grossProfitRate = 0;
  1098. this.$message.error("毛利率不能超过100%");
  1099. }
  1100. },
  1101. rowSave(row) {
  1102. console.log(row);
  1103. this.$set(row, "$cellEdit", false);
  1104. },
  1105. rowDel(row, index) {
  1106. this.$confirm("确定删除数据?", {
  1107. confirmButtonText: "确定",
  1108. cancelButtonText: "取消",
  1109. type: "warning"
  1110. }).then(() => {
  1111. if (row.id) {
  1112. delItem(row.id).then(res => {
  1113. this.$message({
  1114. type: "success",
  1115. message: "删除成功!"
  1116. });
  1117. this.data.splice(index, 1);
  1118. });
  1119. } else {
  1120. this.$message({
  1121. type: "success",
  1122. message: "删除成功!"
  1123. });
  1124. this.data.splice(index, 1);
  1125. }
  1126. });
  1127. },
  1128. importGoods() {
  1129. if (this.reData) {
  1130. if (this.selectionList.length != 1) {
  1131. return this.$message.error("重新选择的时候只能选择一条数据");
  1132. } else {
  1133. this.selectionList.forEach(e => {
  1134. this.data.forEach((item, index) => {
  1135. if (index == this.reData.index) {
  1136. item.itemId = e.id;
  1137. item.code = e.code;
  1138. item.cname = e.cname;
  1139. item.priceCategory = e.goodsTypeName;
  1140. item.partsList = this.reData.partsList;
  1141. item.partsPrice = this.reData.partsPrice;
  1142. item.itemUrl = e.url;
  1143. item.itemProp = this.reData.itemProp;
  1144. item.itemDescription = e.cnameDescription;
  1145. item.itemType = this.reData.itemType;
  1146. item.tradeTerms = this.reData.tradeTerms;
  1147. item.price = this.reData.price;
  1148. item.orderQuantity = this.reData.orderQuantity;
  1149. item.insurance = this.reData.insurance;
  1150. item.freight = this.reData.freight;
  1151. item.discount = this.reData.discount;
  1152. item.amount = this.reData.amount;
  1153. item.taxRate = this.reData.taxRate;
  1154. item.unit = e.unit;
  1155. item.remarks = this.reData.remarks;
  1156. item.$cellEdit = true;
  1157. }
  1158. });
  1159. });
  1160. }
  1161. } else {
  1162. this.selectionList.forEach(e => {
  1163. this.data.push({
  1164. itemId: e.id,
  1165. code: e.code,
  1166. cname: e.cname,
  1167. priceCategory: e.goodsTypeName,
  1168. itemUrl: e.url,
  1169. itemProp: null,
  1170. itemDescription: e.cnameDescription,
  1171. partsList: [],
  1172. partsPrice: 0,
  1173. itemType: null,
  1174. tradeTerms: null,
  1175. price: 0,
  1176. orderQuantity: 0,
  1177. insurance: 0,
  1178. freight: 0,
  1179. discount: null,
  1180. amount: 0,
  1181. taxRate: 0,
  1182. unit: e.unit,
  1183. remarks: null,
  1184. $cellEdit: true
  1185. });
  1186. });
  1187. }
  1188. this.dialogVisible = false;
  1189. },
  1190. closeGoods() {
  1191. this.selectionList = [];
  1192. this.treeDeptId = "";
  1193. this.reData = null;
  1194. },
  1195. goodsSelectionChange(list) {
  1196. this.orderItemIds = [];
  1197. list.map(e => {
  1198. this.orderItemIds.push(e.id);
  1199. });
  1200. },
  1201. selectionChange(list) {
  1202. this.selectionList = list;
  1203. },
  1204. rowClick(row) {
  1205. this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
  1206. },
  1207. nodeClick(data) {
  1208. this.treeDeptId = data.id;
  1209. this.page.currentPage = 1;
  1210. this.onLoad(this.page);
  1211. },
  1212. //费用查询
  1213. onLoad(page, params = {}) {
  1214. this.loading = true;
  1215. getGoods(page.currentPage, page.pageSize, this.treeDeptId).then(res => {
  1216. const data = res.data.data;
  1217. this.page.total = data.total;
  1218. this.goodsList = data.records;
  1219. this.loading = false;
  1220. if (this.page.total) {
  1221. this.goodsOption.height = window.innerHeight - 350;
  1222. }
  1223. });
  1224. },
  1225. importLibray(rows, status) {
  1226. if (status) {
  1227. if (this.partreData) {
  1228. rows.forEach(e => {
  1229. this.partList.forEach((item, index) => {
  1230. if (index == this.partreData.index) {
  1231. item.goodId = e.itemId;
  1232. item.goodTypeId = e.goodTypeId;
  1233. item.goodTypeName = e.goodsTypeName;
  1234. item.goodName = e.cname;
  1235. item.price = e.purchaseAmount;
  1236. item.goodNumber = this.partreData.goodNumber;
  1237. item.amout = _.multiply(
  1238. Number(
  1239. this.partreData.goodNumber ? this.partreData.goodNumber : 0
  1240. ),
  1241. Number(e.purchaseAmount ? e.purchaseAmount : 0)
  1242. );
  1243. item.$cellEdit = true;
  1244. }
  1245. });
  1246. });
  1247. } else {
  1248. rows.forEach(e => {
  1249. this.partList.push({
  1250. goodId: e.itemId,
  1251. goodTypeId: e.goodTypeId,
  1252. goodTypeName: e.goodsTypeName,
  1253. goodName: e.cname,
  1254. price: e.purchaseAmount,
  1255. goodNumber: 0,
  1256. amout: 0,
  1257. $cellEdit: true
  1258. });
  1259. });
  1260. }
  1261. } else {
  1262. rows.forEach(e => {
  1263. this.data.push({
  1264. itemId: e.itemId,
  1265. code: e.code,
  1266. cname: e.cname,
  1267. priceCategory: e.goodsTypeName,
  1268. purchaseAmount: e.purchaseAmount,
  1269. itemProp: e.goodNature,
  1270. corpId: e.corpId,
  1271. corpName: e.corpName,
  1272. itemDescription: e.cnameDescription,
  1273. partsList: [],
  1274. partsPrice: 0,
  1275. itemType: e.specs,
  1276. tradeTerms: null,
  1277. price: Number(
  1278. _.multiply(
  1279. Number(e.purchaseAmount),
  1280. Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
  1281. )
  1282. ).toFixed(2),
  1283. orderQuantity: 0,
  1284. insurance: 0,
  1285. freight: 0,
  1286. discount: null,
  1287. amount: 0,
  1288. taxRate: 0,
  1289. unit: e.unit,
  1290. remarks: null,
  1291. $cellEdit: true
  1292. });
  1293. });
  1294. }
  1295. },
  1296. //商品明细导入
  1297. newDetails() {
  1298. if (!this.form.corpId) {
  1299. return this.$message.error("请选择客户名称");
  1300. }
  1301. this.dialogVisible = !this.dialogVisible;
  1302. },
  1303. getDetail(id) {
  1304. this.showBut = false;
  1305. this.pageLoading = true;
  1306. detail(id)
  1307. .then(res => {
  1308. this.form = res.data.data;
  1309. this.data = res.data.data.orderItemsList;
  1310. this.orderFeesList = res.data.data.orderFeesList;
  1311. this.orderFilesList = res.data.data.orderFilesList;
  1312. this.oldform = res.data.data;
  1313. this.olddata = this.deepClone(res.data.data.orderItemsList);
  1314. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  1315. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  1316. })
  1317. .finally(() => {
  1318. this.showBut = true;
  1319. this.pageLoading = false;
  1320. });
  1321. },
  1322. //修改提交触发
  1323. editCustomer(status) {
  1324. this.$refs["form"].validate((valid, done) => {
  1325. done();
  1326. if (valid) {
  1327. if (this.data.length > 0) {
  1328. for (let i = 0; i < this.data.length; i++) {
  1329. if (this.data[i].corpId == null) {
  1330. return this.$message.error(`请输入第${i + 1}行的供应商`);
  1331. }
  1332. }
  1333. }
  1334. const orderFeesList = this.$refs.feeInfo.submitData();
  1335. for (let i = 0; i < orderFeesList.length; i++) {
  1336. if (orderFeesList[i].corpId == null) {
  1337. return this.$message.error(`请输入第${i + 1}行的结算中心`);
  1338. }
  1339. if (orderFeesList[i].price == 0) {
  1340. return this.$message.error(`请正确输入第${i + 1}行的价格`);
  1341. }
  1342. if (orderFeesList[i].quantity == 0) {
  1343. return this.$message.error(`请正确输入第${i + 1}行的数量`);
  1344. }
  1345. }
  1346. const orderFilesList = this.$refs.uploadFile.submitData();
  1347. this.subLoading = true;
  1348. submit({
  1349. ...this.form,
  1350. orderItemsList: this.data,
  1351. orderFeesList: orderFeesList,
  1352. orderFilesList: orderFilesList
  1353. })
  1354. .then(res => {
  1355. this.form = res.data.data;
  1356. this.data = res.data.data.orderItemsList;
  1357. this.orderFeesList = res.data.data.orderFeesList;
  1358. this.orderFilesList = res.data.data.orderFilesList;
  1359. this.$message.success(this.form.id ? "修改成功" : "提交成功");
  1360. this.oldform = res.data.data;
  1361. this.olddata = this.deepClone(res.data.data.orderItemsList);
  1362. this.oldorderFeesList = this.deepClone(
  1363. res.data.data.orderFeesList
  1364. );
  1365. this.oldorderFilesList = this.deepClone(
  1366. res.data.data.orderFilesList
  1367. );
  1368. if (status == "goBack") {
  1369. this.$emit("goBack");
  1370. }
  1371. })
  1372. .finally(() => {
  1373. this.subLoading = false;
  1374. });
  1375. } else {
  1376. return false;
  1377. }
  1378. });
  1379. },
  1380. //返回列表
  1381. backToList() {
  1382. let orderFeesList = this.$refs.feeInfo.submitData();
  1383. let orderFilesList = this.$refs.uploadFile.submitData();
  1384. if (
  1385. contrastObj(this.form, this.oldform) ||
  1386. contrastList(this.data, this.olddata) ||
  1387. contrastList(orderFeesList, this.oldorderFeesList) ||
  1388. contrastList(orderFilesList, this.oldorderFilesList)
  1389. ) {
  1390. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1391. confirmButtonText: "确定",
  1392. cancelButtonText: "取消",
  1393. type: "warning"
  1394. })
  1395. .then(() => {
  1396. this.editCustomer("goBack");
  1397. })
  1398. .catch(() => {
  1399. this.$emit("goBack");
  1400. });
  1401. } else {
  1402. this.$emit("goBack");
  1403. }
  1404. },
  1405. openReport() {
  1406. this.switchDialog = !this.switchDialog;
  1407. },
  1408. onClose(val) {
  1409. this.switchDialog = val;
  1410. },
  1411. getInvoice() {
  1412. if (this.$store.getters.outStatus) {
  1413. this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
  1414. confirmButtonText: "确定",
  1415. type: "warning",
  1416. callback: action => {
  1417. console.log(action);
  1418. }
  1419. });
  1420. } else {
  1421. this.inInvoice();
  1422. }
  1423. },
  1424. inInvoice() {
  1425. const data = { id: this.form.id, orderItemIds: this.orderItemIds };
  1426. deliverGoods(data).then(res => {
  1427. if (res.data.code == 200) {
  1428. this.$message.success("生成成功");
  1429. if (data) {
  1430. const data = res.data.data;
  1431. data.orderItemsList.forEach(e => {
  1432. e.actualQuantity = e.orderQuantity;
  1433. e.contractAmount = e.amount;
  1434. e.srcId = e.id;
  1435. e.specificationAndModel = e.itemType;
  1436. e.productDesc = e.itemDescription;
  1437. delete e.id;
  1438. delete e.version;
  1439. delete e.status;
  1440. delete e.createUser;
  1441. delete e.createTime;
  1442. delete e.updateUser;
  1443. delete e.updateTime;
  1444. delete e.isDeleted;
  1445. });
  1446. console.log(data);
  1447. const obj = {
  1448. corpId: data.corpId,
  1449. deliveryStatus: "录入",
  1450. srcOrderNo: data.sysNo,
  1451. orgOrderNo: data.orgOrderNo,
  1452. orderItemsList: data.orderItemsList,
  1453. orderFeesList: data.deliveryFeesList
  1454. };
  1455. this.$router.$avueRouter.closeTag("/exportTrade/invoice/index");
  1456. this.$router.push({
  1457. path: "/exportTrade/invoice/index",
  1458. query: {
  1459. pageType: "Generate",
  1460. data: JSON.stringify(obj)
  1461. }
  1462. });
  1463. }
  1464. }
  1465. });
  1466. },
  1467. async saveColumn() {
  1468. const inSave = await this.saveColumnData(
  1469. this.getColumnName(5),
  1470. this.tableOption
  1471. );
  1472. if (inSave) {
  1473. this.$message.success("保存成功");
  1474. //关闭窗口
  1475. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1476. }
  1477. },
  1478. summaryMethod({ columns, data }) {
  1479. const sums = [];
  1480. if (columns.length > 0) {
  1481. columns.forEach((item, index) => {
  1482. sums[0] = "合计";
  1483. if (item.property == "orderQuantity" || item.property == "amount") {
  1484. let qtySum = 0;
  1485. let amountSum = 0;
  1486. data.forEach(e => {
  1487. qtySum = _.add(qtySum, Number(e.orderQuantity));
  1488. amountSum = _.add(amountSum, Number(e.amount));
  1489. });
  1490. //数量总计
  1491. if (item.property == "orderQuantity") {
  1492. sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
  1493. }
  1494. //金额总计
  1495. if (item.property == "amount") {
  1496. sums[index] = micrometerFormat(amountSum);
  1497. }
  1498. }
  1499. });
  1500. }
  1501. return sums;
  1502. },
  1503. async saveGoodsColumn() {
  1504. const inSave = await this.saveColumnData(
  1505. this.getColumnName(28),
  1506. this.goodsOption
  1507. );
  1508. if (inSave) {
  1509. this.$message.success("保存成功");
  1510. //关闭窗口
  1511. this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
  1512. }
  1513. }
  1514. }
  1515. };
  1516. </script>
  1517. <style lang="scss" scoped>
  1518. .trading-form ::v-deep .el-form-item {
  1519. margin-bottom: 8px !important;
  1520. }
  1521. ::v-deep .el-form-item__error {
  1522. display: none !important;
  1523. }
  1524. ::v-deep .select-component {
  1525. display: flex !important;
  1526. }
  1527. </style>