detailsPage.vue 24 KB

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