detailsPage.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button
  7. type="danger"
  8. style="border: none;background: none;color: red"
  9. icon="el-icon-arrow-left"
  10. @click="backToList"
  11. >返回列表
  12. </el-button>
  13. </div>
  14. <el-button type="success" class="copy-customer-btn" disabled>
  15. 复制新单
  16. </el-button>
  17. <el-button
  18. class="add-customer-btn"
  19. type="primary"
  20. :disabled="disabled"
  21. @click="editCustomer"
  22. >{{ form.id ? "确认修改" : "确认新增" }}
  23. </el-button>
  24. </div>
  25. <div style="margin-top: 60px;margin-bottom:35px">
  26. <containerTitle title="基础信息"></containerTitle>
  27. <basic-container style="margin-bottom: 10px">
  28. <avue-form ref="form" v-model="form" :option="option">
  29. <template slot="portOfLoad">
  30. <port-info
  31. v-model="form.portOfLoad"
  32. :disabled="detailData.status == 1"
  33. />
  34. </template>
  35. <template slot="portOfDestination">
  36. <port-info
  37. v-model="form.portOfDestination"
  38. :disabled="detailData.status == 1"
  39. />
  40. </template>
  41. <template slot="corpId">
  42. <select-component
  43. v-model="form.corpId"
  44. :configuration="configuration"
  45. :disabled="detailData.status == 1"
  46. ></select-component>
  47. </template>
  48. <template slot="exchangeRate">
  49. <el-input
  50. size="mini"
  51. v-model="form.exchangeRate"
  52. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  53. @change="rateChange"
  54. placeholder="请输入 汇率"
  55. :disabled="detailData.status == 1"
  56. ><template slot="append">%</template></el-input
  57. >
  58. </template>
  59. </avue-form>
  60. </basic-container>
  61. <containerTitle title="商品信息"></containerTitle>
  62. <basic-container>
  63. <avue-crud
  64. :ref="crud"
  65. :data="data"
  66. :option="tableOption"
  67. @row-del="rowDel"
  68. >
  69. <template slot="menuLeft">
  70. <el-button
  71. type="primary"
  72. icon="el-icon-plus"
  73. size="small"
  74. @click.stop="newDetails"
  75. :disabled="detailData.status == 1"
  76. >新增明细</el-button
  77. >
  78. <el-button
  79. type="info"
  80. icon="el-icon-printer"
  81. size="small"
  82. @click.stop="openReport()"
  83. >报 表</el-button
  84. >
  85. <el-button
  86. type="info"
  87. size="small"
  88. @click.stop="savePurchase"
  89. :disabled="detailData.status == 1"
  90. >采购询价</el-button
  91. >
  92. <el-button
  93. type="info"
  94. size="small"
  95. @click.stop="saveShipping"
  96. :disabled="detailData.status == 1"
  97. >船务询价</el-button
  98. >
  99. </template>
  100. <template slot="menu" slot-scope="{ row,index }">
  101. <el-button
  102. size="small"
  103. icon="el-icon-edit"
  104. type="text"
  105. @click="rowCell(row, index)"
  106. :disabled="disabled"
  107. >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
  108. >
  109. <el-button
  110. size="small"
  111. icon="el-icon-edit"
  112. type="text"
  113. @click="rowDel(row, index)"
  114. :disabled="detailData.status == 1"
  115. >删 除</el-button
  116. >
  117. </template>
  118. <template slot="price" slot-scope="{ row }">
  119. <el-input
  120. v-if="row.$cellEdit"
  121. v-model="row.price"
  122. size="small"
  123. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  124. @change="priceChange(row)"
  125. ></el-input>
  126. <span v-else>{{ row.price | micrometerFormat }}</span>
  127. </template>
  128. <template slot="amount" slot-scope="{ row }">
  129. <span>{{ row.amount | micrometerFormat }}</span>
  130. </template>
  131. <template slot="orderQuantity" slot-scope="{ row }">
  132. <el-input
  133. v-if="row.$cellEdit"
  134. v-model="row.orderQuantity"
  135. size="small"
  136. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  137. @change="quantityChange(row)"
  138. ></el-input>
  139. <span v-else>{{ row.orderQuantity }}</span>
  140. </template>
  141. <template slot="discount" slot-scope="{ row }">
  142. <el-input
  143. v-if="row.$cellEdit"
  144. v-model="row.discount"
  145. size="small"
  146. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  147. @change="discountChange(row)"
  148. ></el-input>
  149. <span v-else>{{ row.discount | isDiscount }}</span>
  150. </template>
  151. <template slot="insurance" slot-scope="{ row }">
  152. <el-input
  153. v-if="row.$cellEdit"
  154. v-model="row.insurance"
  155. size="small"
  156. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  157. ></el-input>
  158. <span v-else>{{ row.insurance | micrometerFormat }}</span>
  159. </template>
  160. <template slot="freight" slot-scope="{ row }">
  161. <el-input
  162. v-if="row.$cellEdit"
  163. v-model="row.freight"
  164. size="small"
  165. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  166. ></el-input>
  167. <span v-else>{{ row.freight | micrometerFormat }}</span>
  168. </template>
  169. <template slot="taxRate" slot-scope="{ row }">
  170. <el-input
  171. v-if="row.$cellEdit"
  172. v-model="row.taxRate"
  173. size="small"
  174. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  175. @change="taxRateChange(row)"
  176. ></el-input>
  177. <span v-else>{{ row.taxRate | isPercentage }}</span>
  178. </template>
  179. <template slot="itemType" slot-scope="{ row }">
  180. <el-select
  181. v-if="row.$cellEdit"
  182. v-model="row.itemType"
  183. filterable
  184. allow-create
  185. default-first-option
  186. placeholder="请输入"
  187. @focus="itemTypeFocus(row)"
  188. >
  189. <el-option
  190. v-for="(item, index) in itemtypeList"
  191. :key="index"
  192. :label="item.value"
  193. :value="item.value"
  194. >
  195. </el-option>
  196. </el-select>
  197. <span v-else>{{ row.itemType }}</span>
  198. </template>
  199. </avue-crud>
  200. </basic-container>
  201. <fee-info
  202. ref="feeInfo"
  203. :orderFeesList="orderFeesList"
  204. :disabled="detailData.status == 1"
  205. feeUrl="/blade-purchase-sales/orderfees/update"
  206. />
  207. </div>
  208. <el-dialog
  209. title="导入商品"
  210. append-to-body
  211. class="el-dialogDeep"
  212. :visible.sync="dialogVisible"
  213. width="60%"
  214. :close-on-click-modal="false"
  215. :destroy-on-close="true"
  216. :close-on-press-escape="false"
  217. @close="closeGoods"
  218. top="10vh"
  219. v-dialog-drag
  220. >
  221. <span>
  222. <el-row>
  223. <el-col :span="5">
  224. <div>
  225. <el-scrollbar>
  226. <basic-container style="margin-top:45px">
  227. <avue-tree :option="treeOption" @node-click="nodeClick" />
  228. </basic-container>
  229. </el-scrollbar>
  230. </div>
  231. </el-col>
  232. <el-col :span="19">
  233. <avue-crud
  234. :option="goodsOption"
  235. :table-loading="loading"
  236. :data="goodsList"
  237. ref="goodsCrud"
  238. @refresh-change="refreshChange"
  239. @selection-change="selectionChange"
  240. @row-click="rowClick"
  241. :page.sync="page"
  242. @on-load="onLoad"
  243. ></avue-crud>
  244. </el-col>
  245. </el-row>
  246. </span>
  247. <span slot="footer" class="dialog-footer">
  248. <el-button @click="dialogVisible = false">取 消</el-button>
  249. <el-button
  250. type="primary"
  251. @click="importGoods"
  252. :disabled="selectionList.length == 0"
  253. >导入</el-button
  254. >
  255. </span>
  256. </el-dialog>
  257. <report-dialog
  258. :switchDialog="switchDialog"
  259. :reportId="form.id"
  260. reportName="客户询价"
  261. @onClose="onClose()"
  262. ></report-dialog>
  263. </div>
  264. </template>
  265. <script>
  266. import tableOption from "./config/customerContact.json";
  267. import goodsOption from "./config/commodity.json";
  268. import feeInfo from "@/components/fee-info/main";
  269. import {
  270. detail,
  271. submit,
  272. delItem,
  273. getDeptLazyTree,
  274. getGoods,
  275. savePurchase,
  276. saveShipping,
  277. getPorts,
  278. getSpecification
  279. } from "@/api/basicData/customerInquiry";
  280. import reportDialog from "@/components/report-dialog/main";
  281. import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
  282. import { contrastObj, contrastList } from "@/util/contrastData";
  283. import _ from "lodash";
  284. export default {
  285. name: "detailsPageEdit",
  286. data() {
  287. return {
  288. itemtypeList: [],
  289. configuration: {
  290. multipleChoices: false,
  291. multiple: false,
  292. collapseTags: false,
  293. placeholder: "请点击右边按钮选择",
  294. dicData: []
  295. },
  296. switchDialog: false,
  297. form: {},
  298. disabled: false,
  299. dialogVisible: false,
  300. tableOption: tableOption,
  301. option: {
  302. menuBtn: false,
  303. labelWidth: 100,
  304. column: [
  305. {
  306. label: "客户名称",
  307. prop: "corpId",
  308. rules: [
  309. {
  310. required: true,
  311. message: "",
  312. trigger: "blur"
  313. }
  314. ],
  315. span: 8,
  316. slot: true
  317. },
  318. {
  319. label: "系统号",
  320. prop: "sysNo",
  321. span: 8
  322. },
  323. {
  324. label: "订单状态",
  325. prop: "orderStatus",
  326. span: 8,
  327. type: "select",
  328. dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
  329. props: {
  330. label: "dictValue",
  331. value: "dictValue"
  332. }
  333. },
  334. {
  335. label: "联系人",
  336. prop: "corpAttn",
  337. span: 8
  338. },
  339. {
  340. label: "电话",
  341. prop: "corpTel",
  342. span: 8
  343. },
  344. {
  345. label: "起运港",
  346. prop: "portOfLoad",
  347. span: 8,
  348. type: "select",
  349. filterable: true,
  350. dicData: [],
  351. props: {
  352. label: "name",
  353. value: "name"
  354. }
  355. },
  356. {
  357. label: "目的港",
  358. prop: "portOfDestination",
  359. span: 8,
  360. type: "select",
  361. filterable: true,
  362. dicData: [],
  363. props: {
  364. label: "name",
  365. value: "name"
  366. }
  367. },
  368. {
  369. label: "运输方式",
  370. prop: "transport",
  371. span: 8,
  372. type: "select",
  373. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  374. props: {
  375. label: "dictValue",
  376. value: "dictValue"
  377. }
  378. },
  379. {
  380. label: "订单日期",
  381. prop: "businesDate",
  382. span: 8,
  383. type: "date",
  384. format: "yyyy-MM-dd",
  385. valueFormat: "yyyy-MM-dd 00:00:00"
  386. },
  387. {
  388. label: "有效日期",
  389. prop: "dateValidity",
  390. span: 8,
  391. type: "date",
  392. format: "yyyy-MM-dd",
  393. valueFormat: "yyyy-MM-dd 00:00:00"
  394. },
  395. {
  396. label: "价格条款",
  397. prop: "priceTerms",
  398. span: 8,
  399. type: "select",
  400. dicUrl: "/api/blade-system/dict-biz/dictionary?code=pricing_terms",
  401. props: {
  402. label: "dictValue",
  403. value: "dictValue"
  404. }
  405. },
  406. {
  407. label: "条款说明",
  408. prop: "priceTermsDescription",
  409. span: 8
  410. },
  411. {
  412. label: "收款方式",
  413. prop: "paymentType",
  414. span: 8,
  415. type: "select",
  416. dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
  417. props: {
  418. label: "dictValue",
  419. value: "dictValue"
  420. }
  421. },
  422. {
  423. label: "收款说明",
  424. prop: "paymentTypeDescription",
  425. span: 8
  426. },
  427. {
  428. label: "币别",
  429. prop: "currency",
  430. span: 8,
  431. type: "select",
  432. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  433. props: {
  434. label: "dictValue",
  435. value: "dictValue"
  436. }
  437. },
  438. {
  439. label: "汇率",
  440. prop: "exchangeRate",
  441. span: 8,
  442. slot: true
  443. },
  444. {
  445. label: "备注",
  446. prop: "orderRemark",
  447. type: "textarea",
  448. minRows: 2,
  449. span: 16
  450. }
  451. ]
  452. },
  453. treeOption: {
  454. nodeKey: "id",
  455. lazy: true,
  456. treeLoad: function(node, resolve) {
  457. const parentId = node.level === 0 ? 0 : node.data.id;
  458. getDeptLazyTree(parentId).then(res => {
  459. resolve(
  460. res.data.data.map(item => {
  461. return {
  462. ...item,
  463. leaf: !item.hasChildren
  464. };
  465. })
  466. );
  467. });
  468. },
  469. addBtn: false,
  470. menu: false,
  471. size: "small",
  472. props: {
  473. label: "title",
  474. value: "value",
  475. children: "children"
  476. }
  477. },
  478. page: {
  479. pageSize: 10,
  480. currentPage: 1,
  481. total: 0
  482. },
  483. loading: false,
  484. goodsOption: goodsOption,
  485. data: [],
  486. goodsList: [],
  487. selectionList: [],
  488. treeDeptId: null,
  489. orderFeesList: [],
  490. oldform: {},
  491. olddata: [],
  492. oldorderFeesList: []
  493. };
  494. },
  495. props: {
  496. detailData: {
  497. type: Object
  498. }
  499. },
  500. components: {
  501. reportDialog,
  502. feeInfo
  503. },
  504. created() {
  505. if (this.detailData.id) {
  506. this.getDetail(this.detailData.id);
  507. }
  508. if (this.detailData.status == 1) {
  509. this.option.disabled = true;
  510. }
  511. getPorts().then(res => {
  512. this.findObject(this.option.column, "portOfLoad").dicData = res.data;
  513. this.findObject(this.option.column, "portOfDestination").dicData =
  514. res.data;
  515. });
  516. },
  517. filters: {
  518. isDiscount(val) {
  519. return isDiscount(val);
  520. },
  521. isPercentage(val) {
  522. return isPercentage(val);
  523. },
  524. micrometerFormat(val) {
  525. return micrometerFormat(val);
  526. }
  527. },
  528. methods: {
  529. rowCell(row, index) {
  530. if (row.$cellEdit == true) {
  531. this.$set(row, "$cellEdit", false);
  532. } else {
  533. this.$set(row, "$cellEdit", true);
  534. }
  535. },
  536. itemTypeFocus(row) {
  537. this.itemtypeList = [];
  538. getSpecification({ goodId: row.itemId }).then(res => {
  539. const data = res.data.data;
  540. this.itemtypeList = data.map(item => ({ value: item }));
  541. });
  542. },
  543. priceChange(row) {
  544. if (!row.price) {
  545. row.price = 0;
  546. } else {
  547. row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
  548. }
  549. },
  550. discountChange(row) {
  551. if (row.discount >= 10) {
  552. row.discount = 0;
  553. this.$message.error("请正确输入折扣");
  554. }
  555. },
  556. taxRateChange(row) {
  557. if (row.taxRate > 100) {
  558. row.taxRate = 0;
  559. this.$message.error("请正确输入税率");
  560. }
  561. },
  562. quantityChange(row) {
  563. if (!row.orderQuantity) {
  564. row.orderQuantity = 0;
  565. } else {
  566. row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
  567. }
  568. },
  569. saveShipping() {
  570. if (!this.form.id) {
  571. return this.$message.error("此单据没有提交记录,请先提交");
  572. }
  573. this.$confirm("是否生成船务询价单?", {
  574. confirmButtonText: "确定",
  575. cancelButtonText: "取消",
  576. type: "warning"
  577. }).then(() => {
  578. saveShipping(this.form.id).then(res => {
  579. if (res.data.code == 200) {
  580. this.$message.success("生成成功");
  581. }
  582. });
  583. });
  584. },
  585. savePurchase() {
  586. if (!this.form.id) {
  587. return this.$message.error("此单据没有提交记录,请先提交");
  588. }
  589. this.$confirm("是否生成采购询价单?", {
  590. confirmButtonText: "确定",
  591. cancelButtonText: "取消",
  592. type: "warning"
  593. }).then(() => {
  594. savePurchase(this.form.id).then(res => {
  595. if (res.data.code == 200) {
  596. this.$message.success("生成成功");
  597. }
  598. });
  599. });
  600. },
  601. rateChange(row) {
  602. console.log(row);
  603. if (row >= 100) {
  604. this.form.exchangeRate = 0;
  605. this.$message.error("汇率不能超过100%");
  606. }
  607. },
  608. rowSave(row) {
  609. this.$set(row, "$cellEdit", false);
  610. },
  611. rowDel(row, index) {
  612. this.$confirm("确定删除数据?", {
  613. confirmButtonText: "确定",
  614. cancelButtonText: "取消",
  615. type: "warning"
  616. }).then(() => {
  617. if (row.id) {
  618. delItem(row.id).then(res => {
  619. this.$message({
  620. type: "success",
  621. message: "删除成功!"
  622. });
  623. this.data.splice(index, 1);
  624. });
  625. } else {
  626. this.$message({
  627. type: "success",
  628. message: "删除成功!"
  629. });
  630. this.data.splice(index, 1);
  631. }
  632. });
  633. },
  634. importGoods() {
  635. this.selectionList.forEach(e => {
  636. this.data.push({
  637. itemId: e.id,
  638. code: e.code,
  639. cname: e.cname,
  640. priceCategory: e.goodsTypeName,
  641. itemUrl: e.url,
  642. itemProp: null,
  643. itemDescription: null,
  644. itemType: null,
  645. orderQuantity: 0,
  646. tradeTerms: null,
  647. price: 0,
  648. amount: 0,
  649. taxRate: 0,
  650. unit: e.unit,
  651. remarks: null,
  652. $cellEdit: true
  653. });
  654. });
  655. this.dialogVisible = false;
  656. },
  657. closeGoods() {
  658. this.selectionList = [];
  659. this.treeDeptId = "";
  660. },
  661. selectionChange(list) {
  662. this.selectionList = list;
  663. },
  664. rowClick(row) {
  665. this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
  666. },
  667. nodeClick(data) {
  668. this.treeDeptId = data.id;
  669. this.page.currentPage = 1;
  670. this.onLoad(this.page);
  671. },
  672. //费用查询
  673. onLoad(page, params = {}) {
  674. this.loading = true;
  675. getGoods(page.currentPage, page.pageSize, this.treeDeptId)
  676. .then(res => {
  677. const data = res.data.data;
  678. this.page.total = data.total;
  679. this.goodsList = data.records;
  680. if (this.page.total) {
  681. this.goodsOption.height = window.innerHeight - 550;
  682. } else {
  683. this.goodsOption.height = window.innerHeight - 475;
  684. }
  685. })
  686. .finally(() => {
  687. this.loading = false;
  688. });
  689. },
  690. //商品明细导入
  691. newDetails() {
  692. this.dialogVisible = !this.dialogVisible;
  693. },
  694. getDetail(id) {
  695. detail(id).then(res => {
  696. this.form = res.data.data;
  697. this.data = res.data.data.orderItemsList;
  698. this.orderFeesList = res.data.data.orderFeesList;
  699. this.configuration.dicData = this.form.corpName;
  700. this.oldform = res.data.data;
  701. this.olddata = this.deepClone(res.data.data.orderItemsList);
  702. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  703. });
  704. },
  705. //修改提交触发
  706. editCustomer(status) {
  707. this.$refs["form"].validate((valid, done) => {
  708. done();
  709. if (valid) {
  710. let orderFeesList = this.$refs.feeInfo.submitData();
  711. for (let i = 0; i < orderFeesList.length; i++) {
  712. if (orderFeesList[i].corpId == null) {
  713. return this.$message.error(`请输入第${i + 1}行的结算中心`);
  714. }
  715. if (orderFeesList[i].price == 0) {
  716. return this.$message.error(`请正确输入第${i + 1}行的价格`);
  717. }
  718. if (orderFeesList[i].orderQuantity == 0) {
  719. return this.$message.error(`请正确输入第${i + 1}行的数量`);
  720. }
  721. }
  722. submit({
  723. ...this.form,
  724. orderItemsList: this.data,
  725. orderFeesList: orderFeesList
  726. }).then(res => {
  727. if (res.data.code == 200) {
  728. this.$message.success(this.form.id ? "修改成功" : "提交成功");
  729. this.form = res.data.data;
  730. this.data = res.data.data.orderItemsList;
  731. this.orderFeesList = res.data.data.orderFeesList;
  732. this.oldform = res.data.data;
  733. this.olddata = this.deepClone(res.data.data.orderItemsList);
  734. this.oldorderFeesList = this.deepClone(
  735. res.data.data.orderFeesList
  736. );
  737. if (status == "goBack") {
  738. this.$emit("goBack");
  739. }
  740. }
  741. });
  742. } else {
  743. return false;
  744. }
  745. });
  746. },
  747. //返回列表
  748. backToList() {
  749. let orderFeesList = this.$refs.feeInfo.submitData();
  750. if (
  751. contrastObj(this.form, this.oldform) ||
  752. contrastList(this.data, this.olddata) ||
  753. contrastList(orderFeesList, this.oldorderFeesList)
  754. ) {
  755. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  756. confirmButtonText: "确定",
  757. cancelButtonText: "取消",
  758. type: "warning"
  759. })
  760. .then(() => {
  761. this.editCustomer("goBack");
  762. })
  763. .catch(() => {
  764. this.$emit("goBack");
  765. });
  766. } else {
  767. this.$emit("goBack");
  768. }
  769. },
  770. openReport() {
  771. this.switchDialog = !this.switchDialog;
  772. },
  773. onClose(val) {
  774. this.switchDialog = val;
  775. }
  776. }
  777. };
  778. </script>
  779. <style lang="scss" scoped>
  780. .customer-head {
  781. position: fixed;
  782. top: 105px;
  783. width: 100%;
  784. margin-left: -10px;
  785. height: 62px;
  786. background: #ffffff;
  787. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  788. z-index: 999;
  789. }
  790. .customer-back {
  791. cursor: pointer;
  792. line-height: 62px;
  793. font-size: 16px;
  794. color: #323233;
  795. font-weight: 400;
  796. }
  797. .back-icon {
  798. line-height: 64px;
  799. font-size: 20px;
  800. margin-right: 8px;
  801. }
  802. .copy-customer-btn {
  803. position: fixed;
  804. right: 140px;
  805. top: 115px;
  806. }
  807. .add-customer-btn {
  808. position: fixed;
  809. right: 36px;
  810. top: 115px;
  811. }
  812. ::v-deep .el-form-item {
  813. margin-bottom: 8px;
  814. }
  815. ::v-deep .el-form-item__error {
  816. display: none;
  817. }
  818. ::v-deep .select-component {
  819. display: flex;
  820. }
  821. </style>