detailsPage.vue 44 KB

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