addEdit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. <template>
  2. <el-dialog
  3. v-loading="loading || detailLoading"
  4. :title="title"
  5. :center="true"
  6. align="left"
  7. top="10vh"
  8. width="1040px"
  9. :close-on-click-modal="false"
  10. :visible.sync="showModelThis"
  11. element-loading-text="拼命加载中"
  12. element-loading-spinner="el-icon-loading"
  13. element-loading-background="rgba(0, 0, 0, 0.8)"
  14. @close="handleClose"
  15. >
  16. <el-card style="margin: -20px 0 0 0">
  17. <el-row :gutter="10">
  18. <el-col :span="24">
  19. <el-form
  20. ref="ruleForm"
  21. :model="ruleForm"
  22. status-icon
  23. :rules="rulesThis"
  24. label-width="80px"
  25. class="demo-ruleForm"
  26. size="mini"
  27. >
  28. <el-divider>
  29. <el-tag size="mini">销售订单信息</el-tag>
  30. </el-divider>
  31. <el-row>
  32. <el-col :span="12">
  33. <el-form-item label="商品分类" prop="cat_id">
  34. <company-sort
  35. :value="ruleForm.cat_id"
  36. :placeholder="'商品分类'"
  37. :disabled="id !== '003'"
  38. :size="'mini'"
  39. :company-no="ruleForm.companyNo"
  40. :names="cat_id_name"
  41. :is-detail="type !== 'add'"
  42. @searchChange="goods_class_change"
  43. />
  44. </el-form-item>
  45. </el-col>
  46. <!-- <el-col :span="7">
  47. <el-form-item label="采购员" prop="buyerid">
  48. <search-account
  49. size="mini"
  50. placeholder="采购员"
  51. level="2"
  52. :value="ruleForm.buyerid"
  53. :names="ruleForm.buyer_name"
  54. :is-detail="true"
  55. @searchChange="handleHandoverName"
  56. />
  57. </el-form-item>
  58. </el-col> -->
  59. <el-col :span="12">
  60. <el-form-item label="所属平台" prop="platform_id">
  61. <search-terrace
  62. :value="ruleForm.platform_id"
  63. :disabled="id !== '003'"
  64. :size="'mini'"
  65. :is-detail="falsse"
  66. :is_show="'0'"
  67. :placeholder="'所属平台'"
  68. @searchChange="platform_codesearchChange"
  69. />
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="12">
  73. <el-form-item label="单据号" prop="workCode">
  74. <el-input
  75. v-model="ruleForm.workCode"
  76. :disabled="id === '007'"
  77. maxlength="50"
  78. placeholder="单据号"
  79. />
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="12">
  83. <el-form-item label="PO编号" prop="poCode">
  84. <el-input
  85. v-model="ruleForm.poCode"
  86. placeholder="PO编号"
  87. maxlength="50"
  88. :disabled="id === '007'"
  89. />
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="12">
  93. <el-form-item label="购买方公司" label-width="100px" prop="khNo">
  94. <search-customer
  95. size="mini"
  96. :names="khName"
  97. :disabled="id !== '003'"
  98. :is-detail="type !== 'add'"
  99. :value="ruleForm.khNo"
  100. placeholder="购买方公司"
  101. @searchChange="handleCustomerChange"
  102. />
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="12">
  106. <el-form-item label="销售方公司" label-width="100px" prop="companyNo">
  107. <search-work-company
  108. disabled
  109. :value="ruleForm.companyNo"
  110. :names="''"
  111. :size="'mini'"
  112. :placeholder="'销售方公司'"
  113. @searchChange="handleCompanyChange"
  114. />
  115. </el-form-item>
  116. </el-col>
  117. </el-row>
  118. <el-divider>
  119. <el-tag size="mini">收货信息</el-tag>
  120. </el-divider>
  121. <el-row>
  122. <el-col :span="8">
  123. <el-form-item label="收货人" prop="contactor">
  124. <el-input
  125. v-model="ruleForm.contactor"
  126. :disabled="id === '007'"
  127. placeholder="收货人"
  128. maxlength="30"
  129. />
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="8">
  133. <el-form-item label="联系电话" prop="mobile">
  134. <el-input
  135. v-model="ruleForm.mobile"
  136. :disabled="id === '007'"
  137. placeholder="联系电话"
  138. maxlength="11"
  139. />
  140. </el-form-item>
  141. </el-col>
  142. <!-- <el-col :span="12">
  143. <el-form-item label="收货省市区" prop="addr_code" label-width="100px">
  144. <select-area
  145. size="mini"
  146. :value="ruleForm.addr_code"
  147. placeholder="收货省市区"
  148. :disabled="id === '007'"
  149. @selectChange="select_area_change($event)"
  150. />
  151. </el-form-item>
  152. </el-col> -->
  153. <el-col :span="8">
  154. <el-form-item label="发货时间" prop="sendtime">
  155. <el-date-picker
  156. v-model="ruleForm.sendtime"
  157. value-format="yyyy-MM-dd"
  158. :disabled="id === '007'"
  159. type="datetime"
  160. placeholder="发货时间"
  161. style="width: 100%"
  162. :picker-options="pickerOptions"
  163. />
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="24">
  167. <el-form-item label="联系地址" prop="addr">
  168. <el-input
  169. v-model="ruleForm.addr"
  170. :disabled="id === '007'"
  171. maxlength="100"
  172. placeholder="联系地址"
  173. />
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. <el-divider>
  178. <el-tag size="mini">商品信息</el-tag>
  179. </el-divider>
  180. <el-row>
  181. <el-col :span="12">
  182. <el-form-item label="供应商公司" label-width="100px" prop="supplierNo">
  183. <search-supplier
  184. size="mini"
  185. placeholder="供应商公司"
  186. :value="ruleForm.supplierNo"
  187. :names="supplierName"
  188. :disabled="id === '007'"
  189. :is-detail="type !== 'add'"
  190. @searchChange="handleSupplierChange"
  191. />
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="12">
  195. <el-form-item label="商品名称" prop="goodName">
  196. <el-input
  197. v-model="ruleForm.goodName"
  198. placeholder="商品名称"
  199. maxlength="50"
  200. :disabled="id !== '003'"
  201. />
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. <el-row>
  206. <el-col :span="6">
  207. <el-form-item label="数量" prop="goodNum" label-width="60px">
  208. <el-input-number
  209. v-model="ruleForm.goodNum"
  210. :disabled="id !== '003'"
  211. style="width: 100%"
  212. controls-position="right"
  213. placeholder="数量"
  214. :precision="0"
  215. :min="0"
  216. :step="1"
  217. />
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="6">
  221. <el-form-item label="销售单价" prop="goodPrice">
  222. <el-input-number
  223. v-model="ruleForm.goodPrice"
  224. :disabled="id !== '003'"
  225. style="width: 100%"
  226. controls-position="right"
  227. placeholder="单价"
  228. :precision="2"
  229. :min="0"
  230. :step="0.01"
  231. @change="number_change($event, 1)"
  232. />
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="6">
  236. <el-form-item label="采购单价" prop="cgdPrice">
  237. <el-input-number
  238. v-model="ruleForm.cgdPrice"
  239. style="width: 100%"
  240. :disabled="id === '007'"
  241. controls-position="right"
  242. placeholder="采购单价"
  243. :precision="2"
  244. :min="0"
  245. :step="0.01"
  246. @change="number_change($event, 1)"
  247. />
  248. </el-form-item>
  249. </el-col>
  250. <el-col :span="6">
  251. <el-form-item label="采购毛利率" label-width="100px" prop="cgd_tax">
  252. <el-input-number
  253. v-model="ruleForm.cgd_tax"
  254. style="width: 100%"
  255. :disabled="id === '007'"
  256. controls-position="right"
  257. placeholder="采购毛利率"
  258. :precision="2"
  259. :min="0"
  260. :max="100"
  261. :step="0.01"
  262. @change="number_change($event, 2)"
  263. />
  264. </el-form-item>
  265. </el-col>
  266. </el-row>
  267. <el-row>
  268. <el-col :span="6">
  269. <el-form-item label="单位" prop="goodUnit" label-width="60px">
  270. <search-unit
  271. :value="ruleForm.goodUnit"
  272. :disabled="type === 'view' || type === 'editCoin'"
  273. :size="'mini'"
  274. :is-detail="type !== 'add'"
  275. :names="unit_name"
  276. :placeholder="'单位'"
  277. @searchChange="unitsearchChange"
  278. />
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="6">
  282. <el-form-item label="销售总额" prop="good_total">
  283. <el-input v-model="ruleForm.good_total" placeholder="销售总额" disabled>
  284. <template #append>元</template>
  285. </el-input>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="6">
  289. <el-form-item label="税率" prop="tax">
  290. <search-tax
  291. :disabled="id === '007'"
  292. :value="ruleForm.tax"
  293. :size="'mini'"
  294. :is-detail="type !== 'add'"
  295. :placeholder="'税点'"
  296. @searchChange="handleTaxChange"
  297. />
  298. </el-form-item>
  299. </el-col>
  300. </el-row>
  301. </el-form>
  302. </el-col>
  303. <el-col :span="24" style="text-align: right">
  304. <el-button v-if="id !== '007'" type="primary" @click="submitForm"
  305. >保 存</el-button
  306. >
  307. <el-button @click="showModelThis = false">
  308. {{ id == "007" ? "关 闭" : "取 消" }}
  309. </el-button>
  310. </el-col>
  311. </el-row>
  312. </el-card>
  313. </el-dialog>
  314. </template>
  315. <script>
  316. import asyncRequest from "@/apis/service/netOrderEntry/netOrderEnter";
  317. import companyHelper from "@/mixins/companyHelper";
  318. import { accMul, accDiv, accSub, isPhone, isMobile } from "@/utils/validate";
  319. import resToken from "@/mixins/resToken";
  320. const defaultData = {
  321. addr_code: [],
  322. cgdPrice: "",
  323. // buyerid: "",
  324. // buyer_name: "",
  325. platform_id: "",
  326. cgd_tax: "",
  327. workCode: "",
  328. poCode: "",
  329. khNo: "",
  330. companyNo: "",
  331. contactor: "",
  332. mobile: "",
  333. addr: "",
  334. sendtime: "",
  335. supplierNo: "",
  336. cat_id: "",
  337. goodName: "",
  338. goodNum: "",
  339. goodPrice: "",
  340. good_total: "",
  341. goodUnit: "",
  342. tax: "",
  343. };
  344. export default {
  345. name: "Terrace",
  346. mixins: [resToken, companyHelper],
  347. props: ["showModel", "id", "sitem"],
  348. data() {
  349. const validatemobile = (rule, value, callback) => {
  350. if (value !== "") {
  351. if (isPhone(value) || isMobile(value)) {
  352. callback();
  353. } else {
  354. callback(new Error("联系电话格式不正确!"));
  355. }
  356. } else {
  357. callback(new Error("请输入联系电话!"));
  358. }
  359. };
  360. return {
  361. loading: false,
  362. detailLoading: false,
  363. title: "添加销售订单信息",
  364. khName: "",
  365. accounts: [],
  366. cat_id_name: "",
  367. showModelThis: this.showModel,
  368. pickerOptions: {
  369. disabledDate: (time) => time.getTime() > new Date(),
  370. },
  371. names: [],
  372. unit_name: "",
  373. companyName: "",
  374. ruleForm: { ...defaultData },
  375. rulesThis: this.rules,
  376. rules: {
  377. goodUnit: [
  378. {
  379. required: true,
  380. message: "请选择单位",
  381. trigger: "blur",
  382. },
  383. ],
  384. // addr_code: [
  385. // {
  386. // type: "array",
  387. // required: true,
  388. // message: "请选择收货省市区",
  389. // trigger: "blur",
  390. // },
  391. // ],
  392. platform_id: [
  393. {
  394. required: true,
  395. message: "请输入所属平台",
  396. trigger: "blur",
  397. },
  398. ],
  399. cgd_tax: [
  400. {
  401. required: true,
  402. message: "请输入采购毛利率",
  403. trigger: "blur",
  404. },
  405. ],
  406. cat_id: [
  407. {
  408. required: true,
  409. message: "请选择商品分类",
  410. trigger: "change",
  411. },
  412. ],
  413. supplierNo: [
  414. {
  415. type: "array",
  416. required: true,
  417. message: "请选择供应商公司",
  418. trigger: "change",
  419. },
  420. ],
  421. qrdType: [
  422. {
  423. required: true,
  424. message: "请输入订单来源",
  425. trigger: "blur",
  426. },
  427. ],
  428. good_total: [
  429. {
  430. required: true,
  431. message: "请输入货款总金额",
  432. trigger: "blur",
  433. },
  434. ],
  435. // workCode: [
  436. // {
  437. // required: true,
  438. // message: '请输入单据号',
  439. // trigger: 'blur'
  440. // }
  441. // ],
  442. poCode: [
  443. {
  444. required: true,
  445. message: "请输入PO编号",
  446. trigger: "blur",
  447. },
  448. ],
  449. khNo: [
  450. {
  451. type: "array",
  452. required: true,
  453. message: "请选择购买方公司",
  454. trigger: "change",
  455. },
  456. ],
  457. tax: [
  458. {
  459. required: true,
  460. message: "请选择税率",
  461. trigger: "change",
  462. },
  463. ],
  464. companyNo: [
  465. {
  466. required: true,
  467. message: "请选择销售方公司",
  468. trigger: "change",
  469. },
  470. ],
  471. contactor: [
  472. {
  473. required: true,
  474. message: "请输入收货人",
  475. trigger: "blur",
  476. },
  477. ],
  478. mobile: [
  479. {
  480. required: true,
  481. validator: validatemobile,
  482. trigger: "blur",
  483. },
  484. ],
  485. addr: [
  486. {
  487. required: true,
  488. message: "请输入联系地址",
  489. trigger: "blur",
  490. },
  491. ],
  492. sendtime: [
  493. {
  494. required: true,
  495. message: "请输入发货时间",
  496. trigger: "change",
  497. },
  498. ],
  499. goodName: [
  500. {
  501. required: true,
  502. message: "请输入商品名称",
  503. trigger: "blur",
  504. },
  505. ],
  506. goodPrice: [
  507. {
  508. required: true,
  509. message: "请输入销售单价",
  510. trigger: "blur",
  511. },
  512. ],
  513. cgdPrice: [
  514. {
  515. required: true,
  516. message: "请选择采购单价",
  517. trigger: "blur",
  518. },
  519. ],
  520. goodNum: [
  521. {
  522. required: true,
  523. message: "请输入数量",
  524. trigger: "blur",
  525. },
  526. ],
  527. },
  528. };
  529. },
  530. computed: {
  531. totalWatchSource() {
  532. const { goodNum, goodPrice } = this.ruleForm;
  533. return { goodNum, goodPrice };
  534. },
  535. },
  536. watch: {
  537. showModel: function (val) {
  538. this.showModelThis = val;
  539. if (val) {
  540. this.initForm();
  541. }
  542. },
  543. showModelThis(val) {
  544. if (!val) {
  545. this.$emit("cancel");
  546. }
  547. },
  548. totalWatchSource: {
  549. handler({ goodPrice, goodNum }) {
  550. if (goodPrice === 0 || goodNum === 0) {
  551. this.ruleForm.good_total = 0;
  552. return;
  553. }
  554. this.ruleForm.good_total = accMul(goodPrice, goodNum);
  555. },
  556. deep: true,
  557. },
  558. },
  559. methods: {
  560. async handleHandoverName(e) {
  561. this.ruleForm.buyerid = e && e.id ? [e.id] : "";
  562. this.ruleForm.buyer_name = e && e.label ? e.label : "";
  563. this.$refs.ruleForm.validateField("buyerid");
  564. },
  565. async select_area_change(e) {
  566. this.ruleForm.addr_code = e;
  567. this.$refs.ruleForm.validateField("addr_code");
  568. },
  569. number_change(e, type) {
  570. console.log(1111);
  571. const { cgdPrice, goodPrice, cgd_tax } = this.ruleForm;
  572. let tax = 0,
  573. cgd_price = 0;
  574. if (type === 1) {
  575. // tax = (1 - cgdPrice / goodPrice)*100
  576. tax = accMul(accSub(1, accDiv(cgdPrice, goodPrice)), 100);
  577. this.ruleForm.cgd_tax = tax;
  578. this.$refs.ruleForm.validateField("cgd_tax");
  579. console.log(type, tax);
  580. }
  581. if (type === 2) {
  582. // cgd_price = (100 - cgd_tax) * goodPrice;
  583. cgd_price = accMul(accDiv(100, cgd_tax), goodPrice);
  584. this.ruleForm.cgdPrice = cgd_price;
  585. this.$refs.ruleForm.validateField("cgdPrice");
  586. console.log(type, cgd_tax);
  587. }
  588. },
  589. handleClose() {
  590. this.showModelThis = false;
  591. this.companyName = "";
  592. this.khName = "";
  593. this.supplierName = "";
  594. this.ruleForm = { ...defaultData };
  595. },
  596. async initForm() {
  597. this.loading = true;
  598. // await this.getAccounts();
  599. if (this.id === "003") {
  600. this.title = "添加销售订单信息";
  601. this.rulesThis = this.rules;
  602. } else if (this.id === "005") {
  603. this.title = "修改销售订单信息";
  604. this.rulesThis = this.rules;
  605. } else {
  606. this.title = "销售订单信息详情";
  607. this.rulesThis = {};
  608. }
  609. await this.resetForm();
  610. this.loading = false;
  611. },
  612. handleCompanyChange(e) {
  613. this.ruleForm.companyNo = e.code || "";
  614. this.$refs.ruleForm.validateField("companyNo");
  615. },
  616. handleCustomerChange(e) {
  617. this.ruleForm.khNo = e.code ? [e.code] : "";
  618. this.$refs.ruleForm.validateField("khNo");
  619. },
  620. handleSupplierChange(e) {
  621. this.ruleForm.supplierNo = e.code ? [e.code] : "";
  622. this.$refs.ruleForm.validateField("supplierNo");
  623. },
  624. handleGoodClassChange(e) {
  625. this.ruleForm.cat_id = e;
  626. this.$refs.ruleForm.validateField("cat_id");
  627. },
  628. handleTaxChange(e) {
  629. this.ruleForm.tax = e;
  630. this.$refs.ruleForm.validateField("tax");
  631. },
  632. unitsearchChange(e) {
  633. console.log(e);
  634. const { id, code, label } = e;
  635. this.ruleForm.goodUnit = code ? [code] : [];
  636. this.$refs.ruleForm.validateField("goodUnit");
  637. },
  638. async resetForm() {
  639. // 重置
  640. await this.$nextTick(() => {
  641. if (this.$refs.ruleForm) {
  642. this.$refs.ruleForm.resetFields();
  643. this.$refs.ruleForm.clearValidate();
  644. }
  645. });
  646. console.log(this.id);
  647. if (this.id === "003") {
  648. this.ruleForm.companyNo = this.currentCompany;
  649. console.log(this.ruleForm.companyNo);
  650. return;
  651. }
  652. if (this.id !== "003") this.getDetail();
  653. },
  654. async getDetail() {
  655. this.detailLoading = true;
  656. const { orderCode } = this.sitem;
  657. const { data } = await asyncRequest.detail({ orderCode });
  658. const {
  659. cat_id,
  660. buyerid,
  661. khNo,
  662. supplierNo,
  663. supplierNanme,
  664. khName,
  665. goodUnit,
  666. tax,
  667. addr_code,
  668. unitName,
  669. ...rest
  670. } = data;
  671. this.ruleForm = {
  672. ...rest,
  673. buyerid: buyerid ? [buyerid] : [],
  674. addr_code: addr_code ? addr_code.split(",") : [],
  675. cat_id: cat_id ? [cat_id[cat_id.length - 1]] : [],
  676. supplierNo: supplierNo ? [supplierNo] : [],
  677. khNo: khNo ? [khNo] : [],
  678. tax: tax ? tax + "%" : "",
  679. goodUnit: goodUnit ? [goodUnit] : "",
  680. };
  681. console.log(this.ruleForm);
  682. this.cat_id_name = cat_id.map(({ name }) => name).join("_");
  683. this.unit_name = unitName;
  684. this.khName = khName;
  685. this.supplierName = supplierNanme;
  686. this.detailLoading = false;
  687. },
  688. platform_codesearchChange(e) {
  689. const { id, label, pay_name } = e;
  690. this.ruleForm.platform_id = id || "";
  691. this.pay_name = pay_name || "";
  692. this.$refs.ruleForm.validateField("platform_id");
  693. },
  694. // async getAccounts() {
  695. // const res = await asyncRequest.accountall(this.dataForm);
  696. // if (res && res.code === 0 && res.data) {
  697. // this.accounts = res.data;
  698. // } else if (res && res.code >= 100 && res.code <= 104) {
  699. // await this.logout();
  700. // } else {
  701. // this.$message.warning(res.message);
  702. // }
  703. // },
  704. async goods_class_change(e) {
  705. const { id } = e;
  706. this.ruleForm.cat_id = id ? [id] : [];
  707. this.$refs.ruleForm.validateField("cat_id");
  708. },
  709. async submitForm() {
  710. await this.$refs.ruleForm.validate(async (valid) => {
  711. if (valid) {
  712. if (this.loading) {
  713. return;
  714. }
  715. this.loading = true;
  716. const model = JSON.parse(JSON.stringify(this.ruleForm));
  717. model.supplierNo = model.supplierNo[0];
  718. model.khNo = model.khNo[0];
  719. model.buyerid = Array.isArray(model.buyerid) ? model.buyerid[0] : model.buyerid;
  720. model.cat_id = model.cat_id ? model.cat_id[model.cat_id.length - 1] : "";
  721. model.addr_code = model.addr_code.join(",");
  722. model.tax = model.tax.split("%")[0];
  723. model.pay_name = this.pay_name;
  724. model.goodUnit = Array.isArray(model.goodUnit)
  725. ? model.goodUnit[0]
  726. : model.goodUnit;
  727. let res = {};
  728. if (this.id === "003") {
  729. delete model["id"];
  730. res = await asyncRequest.add(model);
  731. } else {
  732. res = await asyncRequest.update(model);
  733. }
  734. this.loading = false;
  735. if (res && res.code === 0) {
  736. const title = this.id === "003" ? "添加成功!" : "修改成功!";
  737. this.$notify.success({
  738. title,
  739. message: "",
  740. });
  741. this.showModelThis = false;
  742. // 刷新
  743. this.$emit("refresh");
  744. } else if (res && res.code >= 100 && res.code <= 104) {
  745. await this.logout();
  746. } else {
  747. this.$message.warning(res.message);
  748. }
  749. } else {
  750. console.log("error submit!!");
  751. return false;
  752. }
  753. });
  754. },
  755. },
  756. };
  757. </script>
  758. <style lang="scss" scoped>
  759. .terrace {
  760. }
  761. </style>