detail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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. :loading="btnLoading"
  11. >返回列表</el-button
  12. >
  13. </div>
  14. <div class="add-customer-btn">
  15. <el-button
  16. type="primary"
  17. size="small"
  18. class="el-button--small-yh"
  19. @click.stop="openEdit"
  20. v-if="disabled"
  21. >编 辑</el-button
  22. >
  23. <el-button
  24. v-if="
  25. form.id &&
  26. loginUser === form.handingUser &&
  27. form.confirmStatus !== 1
  28. "
  29. type="primary"
  30. size="small"
  31. class="el-button--small-yh"
  32. :loading="btnLoading"
  33. @click="submitConfirm"
  34. :disabled="!form.id || disabled"
  35. >提交确认</el-button
  36. >
  37. <el-button
  38. v-if="checker && form.status != 3"
  39. type="primary"
  40. size="small"
  41. class="el-button--small-yh"
  42. @click.stop="openCheckDialog"
  43. >
  44. 审批
  45. </el-button>
  46. <el-button
  47. v-if="form.status > 0"
  48. @click.native="(checkScheduleDialog = true), (checkId = form.id)"
  49. type="primary"
  50. size="small"
  51. >审核进度</el-button
  52. >
  53. <el-button
  54. type="primary"
  55. v-if="!checkDisabled"
  56. :disabled="!form.id || disabled || form.confirmStatus !== 1"
  57. size="small"
  58. @click="pleaseCheck"
  59. :loading="btnLoading"
  60. >请核</el-button
  61. >
  62. <el-button
  63. type="success"
  64. :disabled="!form.id"
  65. size="small"
  66. @click="copyDoc"
  67. :loading="btnLoading"
  68. v-if="false"
  69. >复制单据</el-button
  70. >
  71. <el-button
  72. type="primary"
  73. @click="editCustomer"
  74. size="small"
  75. :loading="btnLoading"
  76. >保存数据</el-button
  77. >
  78. </div>
  79. </div>
  80. <div class="customer-main">
  81. <containerTitle title="基础信息" />
  82. <basic-container :showBtn="true">
  83. <avue-form
  84. ref="form"
  85. class="trading-form"
  86. v-model="form"
  87. :option="option"
  88. >
  89. <template slot="corpId">
  90. <crop-select
  91. v-model="form.corpId"
  92. @getCorpData="getKHData"
  93. corpType="KH"
  94. :disabled="disabled || checkDisabled || confirmDisabled"
  95. />
  96. </template>
  97. <template slot="chargeStatus">
  98. <el-switch
  99. v-model="form.chargeStatus"
  100. active-text="是"
  101. inactive-text="否"
  102. :active-value="1"
  103. :inactive-value="0"
  104. :disabled="disabled || checkDisabled || confirmDisabled"
  105. @change="chargeStatusChange"
  106. ></el-switch>
  107. </template>
  108. <template slot="handingUser">
  109. <el-select
  110. v-model="form.handingUser"
  111. filterable
  112. clearable
  113. size="small"
  114. placeholder="请选择"
  115. :disabled="
  116. disabled ||
  117. checkDisabled ||
  118. form.chargeStatus == 0 ||
  119. confirmDisabled
  120. "
  121. @change="handingUserChange"
  122. >
  123. <el-option
  124. v-for="(item, index) in userList"
  125. :key="index"
  126. :label="item.realName"
  127. :value="item.id"
  128. ></el-option>
  129. </el-select>
  130. </template>
  131. <template slot="handingUserName">
  132. <el-select
  133. v-model="form.handingUserName"
  134. filterable
  135. clearable
  136. allow-create
  137. default-first-option
  138. size="small"
  139. placeholder="请选择"
  140. :disabled="
  141. disabled ||
  142. checkDisabled ||
  143. form.chargeStatus == 0 ||
  144. confirmDisabled
  145. "
  146. >
  147. <el-option
  148. v-for="(item, index) in userList"
  149. :key="index"
  150. :label="item.realName"
  151. :value="item.realName"
  152. ></el-option>
  153. </el-select>
  154. </template>
  155. <template slot="external">
  156. <el-switch
  157. v-model="form.external"
  158. active-text="是"
  159. inactive-text="否"
  160. :active-value="1"
  161. :inactive-value="0"
  162. :disabled="disabled || checkDisabled || confirmDisabled"
  163. @change="externalChange"
  164. ></el-switch>
  165. </template>
  166. </avue-form>
  167. </basic-container>
  168. <containerTitle title="详情内容" />
  169. <basic-container>
  170. <avue-crud
  171. ref="crud"
  172. :data="dataList"
  173. :option="tableOption"
  174. :cell-style="cellStyle"
  175. @saveColumn="saveColumn"
  176. @resetColumn="resetColumn"
  177. >
  178. <template slot="menuLeft">
  179. <el-button
  180. type="primary"
  181. icon="el-icon-plus"
  182. size="small"
  183. @click.stop="newDetails"
  184. :disabled="disabled || checkDisabled || confirmDisabled"
  185. >录入明细</el-button
  186. >
  187. <el-button
  188. type="info"
  189. icon="el-icon-printer"
  190. size="small"
  191. @click="openReport"
  192. >报表打印</el-button
  193. >
  194. </template>
  195. <template slot="menu" slot-scope="{ row, index }">
  196. <el-button
  197. size="small"
  198. icon="el-icon-edit"
  199. type="text"
  200. @click="rowCell(row, index)"
  201. :disabled="disabled || checkDisabled || confirmDisabled"
  202. >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
  203. >
  204. <el-button
  205. size="small"
  206. icon="el-icon-upload"
  207. type="text"
  208. :disabled="disabled || checkDisabled || confirmDisabled"
  209. @click="annexOpen(row, index)"
  210. >附件</el-button
  211. >
  212. <el-button
  213. size="small"
  214. icon="el-icon-delete"
  215. type="text"
  216. @click="rowDel(row, index)"
  217. :disabled="disabled || checkDisabled || confirmDisabled"
  218. >删除</el-button
  219. >
  220. </template>
  221. <template slot="quantity" slot-scope="{ row, index }">
  222. <el-input-number
  223. v-if="row.$cellEdit"
  224. v-model="row.quantity"
  225. size="small"
  226. :controls="false"
  227. :precision="0"
  228. style="width: 100%"
  229. placeholder="数量"
  230. ></el-input-number>
  231. <span v-else>{{ row.quantity }}</span>
  232. </template>
  233. <template slot-scope="{ row, index }" slot="unit">
  234. <el-select
  235. v-if="row.$cellEdit"
  236. v-model="row.unit"
  237. size="small"
  238. clearable
  239. filterable
  240. >
  241. <el-option
  242. v-for="(item, index) in unitOption"
  243. :key="index"
  244. :label="item.dictValue"
  245. :value="item.dictValue"
  246. />
  247. </el-select>
  248. <span v-else>{{ row.unit }}</span>
  249. </template>
  250. <template slot="amount" slot-scope="{ row, index }">
  251. <el-input-number
  252. v-if="row.$cellEdit"
  253. v-model="row.amount"
  254. size="small"
  255. :controls="false"
  256. :precision="2"
  257. style="width: 100%"
  258. placeholder="金额"
  259. ></el-input-number>
  260. <span v-else>{{ row.amount }}</span>
  261. </template>
  262. </avue-crud>
  263. </basic-container>
  264. <containerTitle title="客户未收款" />
  265. <basic-container>
  266. <avue-form
  267. ref="detailForm"
  268. class="trading-form"
  269. v-model="form"
  270. :option="detailOption"
  271. ></avue-form>
  272. </basic-container>
  273. </div>
  274. <el-dialog
  275. append-to-body
  276. title="审批"
  277. class="el-dialogDeep"
  278. :visible.sync="checkDialog"
  279. width="50%"
  280. :close-on-click-modal="false"
  281. :destroy-on-close="true"
  282. :close-on-press-escape="false"
  283. v-dialog-drag
  284. >
  285. <check
  286. :checkData="checkData"
  287. :checkDetail="false"
  288. :idList="[]"
  289. @choceCheckFun="choceCheckFun"
  290. />
  291. </el-dialog>
  292. <el-dialog
  293. append-to-body
  294. title="审批进度"
  295. class="el-dialogDeep"
  296. :visible.sync="checkScheduleDialog"
  297. width="40%"
  298. :close-on-click-modal="false"
  299. :destroy-on-close="true"
  300. :close-on-press-escape="false"
  301. v-dialog-drag
  302. >
  303. <check-schedule
  304. :checkId="checkId"
  305. :batchNo="batchNo"
  306. @choceScheduleFun="choceScheduleFun"
  307. />
  308. </el-dialog>
  309. <!-- 报表-->
  310. <report-dialog
  311. :switchDialog="switchDialog"
  312. :reportId="form.id"
  313. reportName="交接单"
  314. @onClose="onClose()"
  315. />
  316. <el-dialog
  317. title="附件"
  318. :visible.sync="dialogVisible"
  319. append-to-body
  320. width="70%"
  321. >
  322. <c-upload
  323. typeUpload="PC"
  324. :basic="true"
  325. deleteUrl="/api/blade-client/common-file/remove"
  326. :data="orderList"
  327. :disabled="upLoadForm.status >= 2"
  328. :enumerationValue="124"
  329. ></c-upload>
  330. <span slot="footer" class="dialog-footer">
  331. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  332. <el-button
  333. type="primary"
  334. @click="saveAnnex"
  335. size="small"
  336. :disabled="upLoadForm.status >= 2"
  337. >保 存</el-button
  338. >
  339. </span>
  340. </el-dialog>
  341. </div>
  342. </template>
  343. <script>
  344. import tableOption from "./config/customerContact.json";
  345. import {
  346. isDiscount,
  347. isPercentage,
  348. micrometerFormat,
  349. IntegerFormat
  350. } from "@/util/validate";
  351. import { gainUser } from "@/api/basicData/customerInquiry";
  352. import { getUserInfo } from "@/api/system/user";
  353. import { getDeptTree } from "@/api/system/dept";
  354. import { getCurrentDate } from "@/util/date";
  355. import { contrastObj, contrastList } from "@/util/contrastData";
  356. import check from "@/components/check/check";
  357. import checkSchedule from "@/components/check/checkSchedule";
  358. import {
  359. dataDetail,
  360. typeSave,
  361. removeGoods,
  362. pleaseCheck,
  363. saveAttached,
  364. getAttachment,
  365. submitConfirm
  366. } from "@/api/standAlone/handoverSheet";
  367. import reportDialog from "@/components/report-dialog/main";
  368. export default {
  369. name: "detail",
  370. props: {
  371. detailData: {
  372. type: Object
  373. }
  374. },
  375. components: {
  376. check,
  377. checkSchedule,
  378. reportDialog
  379. },
  380. data() {
  381. const validateHandingUser = (rule, value, callback) => {
  382. if (this.form.chargeStatus == 1 && !this.form.handingUser) {
  383. callback(new Error("接收人不能为空"));
  384. } else {
  385. callback();
  386. }
  387. };
  388. return {
  389. disabled: false,
  390. pageLoading: false,
  391. btnLoading: false,
  392. form: {},
  393. option: {
  394. menuBtn: false,
  395. labelWidth: 100,
  396. column: [
  397. {
  398. label: "客户名称",
  399. prop: "corpId",
  400. rules: [
  401. {
  402. required: true,
  403. message: " ",
  404. trigger: "change"
  405. }
  406. ],
  407. span: 8,
  408. slot: true
  409. },
  410. {
  411. label: "交接日期",
  412. prop: "handoverDate",
  413. span: 8,
  414. type: "date",
  415. format: "yyyy-MM-dd",
  416. valueFormat: "yyyy-MM-dd HH:mm:ss",
  417. rules: [
  418. {
  419. required: true,
  420. message: " ",
  421. trigger: "blur"
  422. }
  423. ]
  424. },
  425. {
  426. label: "NO.",
  427. prop: "serialNo",
  428. disabled: true,
  429. span: 8
  430. },
  431. {
  432. label: "交接人",
  433. prop: "handoverUserName",
  434. span: 8
  435. },
  436. {
  437. label: "联系电话",
  438. prop: "contacts",
  439. span: 8
  440. },
  441. {
  442. label: "是否收费",
  443. prop: "chargeStatus",
  444. span: 8
  445. },
  446. {
  447. label: "接收人",
  448. prop: "handingUser",
  449. span: 8,
  450. rules: [{ validator: validateHandingUser, trigger: "change" }]
  451. },
  452. {
  453. label: "是否外部交接单",
  454. prop: "external",
  455. span: 8
  456. },
  457. {
  458. label: "接收客户名称",
  459. prop: "handingCorpName",
  460. span: 8,
  461. display: false
  462. },
  463. {
  464. label: "交接备注",
  465. prop: "remarks",
  466. type: "textarea",
  467. minRows: 2,
  468. span: 24
  469. }
  470. ]
  471. },
  472. detailForm: {},
  473. detailOption: {
  474. menuBtn: false,
  475. labelWidth: 100,
  476. column: [
  477. {
  478. label: "客户名称",
  479. prop: "corpName",
  480. disabled: true,
  481. span: 8
  482. },
  483. {
  484. label: "未收金额",
  485. prop: "uncollectedAmount",
  486. disabled: true,
  487. span: 8
  488. }
  489. ]
  490. },
  491. dataList: [],
  492. tableOption: {},
  493. goodsoptions: [],
  494. unitOption: [],
  495. selectionList: [],
  496. search: {},
  497. treeStyle: "height:" + (window.innerHeight - 315) + "px",
  498. goodsOption: {},
  499. loading: false,
  500. switchDialog: false, // 报表弹窗控制
  501. userList: [],
  502. dic: [],
  503. loginUser: "", // 登录人
  504. oldForm: {},
  505. oldDataList: [],
  506. checkDisabled: false, // 审核状态
  507. confirmDisabled: false, // 提交状态
  508. checker: false,
  509. checkId: "",
  510. batchNo: "",
  511. checkDialog: false,
  512. checkScheduleDialog: false,
  513. checkData: {},
  514. dialogVisible: false,
  515. orderList: [],
  516. upLoadForm: {},
  517. rowIndex: null //暂存明细下标
  518. };
  519. },
  520. async created() {
  521. this.$set(this.form, "handoverDate", getCurrentDate()); // 默认当前日期
  522. this.tableOption = await this.getColumnData(
  523. this.getColumnName(104),
  524. tableOption
  525. );
  526. gainUser().then(res => {
  527. this.userList = res.data.data;
  528. });
  529. getUserInfo().then(res => {
  530. this.loginUser = res.data.data.id;
  531. });
  532. getDeptTree().then(res => {
  533. this.dic = res.data.data;
  534. });
  535. this.getWorkDicts("unit").then(res => {
  536. this.unitOption = res.data.data;
  537. });
  538. if (this.detailData.query) {
  539. this.disabled = true;
  540. this.option.column.map(e => {
  541. this.$set(e, "disabled", true);
  542. });
  543. this.queryData(this.detailData.id);
  544. } else if (this.detailData.auditId) {
  545. this.checker = true;
  546. this.batchNo = this.detailData.check.batchNo;
  547. this.queryData(this.detailData.id);
  548. }
  549. },
  550. filters: {
  551. IntegerFormat(num) {
  552. return IntegerFormat(num);
  553. },
  554. decimalFormat(num) {
  555. return num ? Number(num).toFixed(2) : "0.00";
  556. }
  557. },
  558. methods: {
  559. // 查询
  560. queryData(id) {
  561. this.pageLoading = true;
  562. dataDetail({ id: id })
  563. .then(res => {
  564. this.form = res.data.data;
  565. this.dataList = this.form.itemList ? this.form.itemList : [];
  566. delete this.form.itemList;
  567. this.oldForm = { ...this.form };
  568. this.oldDataList = [...this.dataList];
  569. this.checkDisabled = this.form.status > 0 ? true : false;
  570. this.confirmDisabled = this.form.confirmStatus === 1 ? true : false;
  571. if (this.form.status > 0 || this.form.confirmStatus === 1) {
  572. this.option.column.map(e => {
  573. this.$set(e, "disabled", true);
  574. });
  575. }
  576. })
  577. .finally(() => {
  578. this.pageLoading = false;
  579. });
  580. },
  581. //返回列表
  582. backToList() {
  583. this.$emit("goBack");
  584. },
  585. // 编辑按钮触发
  586. openEdit() {
  587. this.disabled = false;
  588. this.option.column.map(e => {
  589. if (this.checkDisabled || this.confirmDisabled) {
  590. this.$set(e, "disabled", true);
  591. } else {
  592. if (e.prop != "serialNo") {
  593. this.$set(e, "disabled", false);
  594. }
  595. }
  596. });
  597. },
  598. // 复制
  599. copyDoc() {
  600. this.$emit("copyOrder", this.form.id);
  601. },
  602. //修改提交触发
  603. editCustomer(status) {
  604. this.$refs["form"].validate((valid, done) => {
  605. done();
  606. if (valid) {
  607. this.$set(this.form, "itemList", this.dataList);
  608. this.form.itemList.forEach(item => {
  609. item.fileList = item.fileList ? item.fileList : [];
  610. });
  611. this.btnLoading = true;
  612. typeSave(this.form)
  613. .then(res => {
  614. this.$message({
  615. type: "success",
  616. message: this.form.id ? "修改成功!" : "新增成功!"
  617. });
  618. this.queryData(res.data.data);
  619. })
  620. .finally(() => {
  621. this.btnLoading = false;
  622. });
  623. } else {
  624. return false;
  625. }
  626. });
  627. },
  628. cellStyle() {
  629. return "padding:0;height:40px;";
  630. },
  631. async saveColumn() {
  632. const inSave = await this.saveColumnData(
  633. this.getColumnName(104),
  634. this.tableOption
  635. );
  636. if (inSave) {
  637. this.$message.success("保存成功");
  638. //关闭窗口
  639. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  640. this.$nextTick(() => {
  641. this.$refs.crud.doLayout();
  642. });
  643. }
  644. },
  645. async resetColumn() {
  646. this.tableOption = tableOption;
  647. const inSave = await this.delColumnData(
  648. this.getColumnName(104),
  649. tableOption
  650. );
  651. if (inSave) {
  652. this.$nextTick(() => {
  653. this.$refs.crud.doLayout();
  654. });
  655. this.$message.success("重置成功");
  656. //关闭窗口
  657. setTimeout(() => {
  658. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  659. }, 1000);
  660. }
  661. },
  662. //录入明细
  663. newDetails() {
  664. this.$refs["form"].validate((valid, done) => {
  665. done();
  666. if (valid) {
  667. this.dataList.push({
  668. $cellEdit: true
  669. });
  670. }
  671. });
  672. },
  673. rowCell(row, index) {
  674. if (row.$cellEdit == true) {
  675. this.$set(row, "$cellEdit", false);
  676. } else {
  677. this.$set(row, "$cellEdit", true);
  678. }
  679. },
  680. rowDel(row, index) {
  681. this.$confirm("确定删除数据?", {
  682. confirmButtonText: "确定",
  683. cancelButtonText: "取消",
  684. type: "warning"
  685. }).then(() => {
  686. if (row.id) {
  687. removeGoods(row.id).then(res => {
  688. this.$message({
  689. type: "success",
  690. message: "删除成功!"
  691. });
  692. this.dataList.splice(row.$index, 1);
  693. });
  694. } else {
  695. this.$message({
  696. type: "success",
  697. message: "删除成功!"
  698. });
  699. this.dataList.splice(row.$index, 1);
  700. }
  701. });
  702. },
  703. getKHData(row) {
  704. this.$set(this.form, "corpName", row.cname);
  705. },
  706. // 验证新旧值对比
  707. verification() {
  708. if (
  709. contrastObj(this.form, this.oldForm) ||
  710. contrastList(this.dataList, this.oldDataList)
  711. ) {
  712. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  713. confirmButtonText: "确定",
  714. cancelButtonText: "取消",
  715. type: "warning"
  716. })
  717. .then(() => {
  718. this.editCustomer();
  719. })
  720. .catch(() => {
  721. return false; //取消改动数据
  722. });
  723. } else {
  724. return true;
  725. }
  726. },
  727. //打开审核
  728. openCheckDialog() {
  729. this.checkData = this.detailData.check;
  730. this.checkDialog = true;
  731. },
  732. //关闭审核
  733. choceCheckFun() {
  734. this.checkDialog = false;
  735. },
  736. choceScheduleFun() {
  737. this.checkScheduleDialog = false;
  738. },
  739. // 请核
  740. pleaseCheck() {
  741. if (this.verification()) {
  742. const data = {
  743. id: this.form.id,
  744. serialNo: this.form.serialNo,
  745. checkType: "jjd",
  746. url: "/workManagement/handoverSheet/index",
  747. pageStatus: "this.$store.getters.handOverStatus",
  748. pageLabel: "交接单",
  749. checkFlag: 1
  750. };
  751. this.btnLoading = true;
  752. pleaseCheck(data)
  753. .then(res => {
  754. this.$message.success("请核成功");
  755. this.queryData(this.form.id);
  756. })
  757. .catch(() => {
  758. this.$message.error("请核失败");
  759. })
  760. .finally(() => {
  761. this.btnLoading = false;
  762. });
  763. }
  764. },
  765. // 报表
  766. openReport() {
  767. this.switchDialog = !this.switchDialog;
  768. },
  769. // 报表关闭
  770. onClose(val) {
  771. this.switchDialog = val;
  772. },
  773. //打开附件
  774. annexOpen(row, index) {
  775. this.dialogVisible = true;
  776. this.upLoadForm = row;
  777. if (row.id) {
  778. getAttachment({ id: row.id }).then(res => {
  779. this.orderList = res.data.data ? res.data.data : [];
  780. });
  781. } else {
  782. this.$set(row, "fileList", row.fileList ? row.fileList : []); // 新数据默认插入空
  783. this.orderList = [...row.fileList];
  784. this.rowIndex = index;
  785. }
  786. },
  787. //保存
  788. saveAnnex() {
  789. if (this.upLoadForm.id) {
  790. this.orderList.forEach(item =>
  791. this.$set(item, "pid", this.upLoadForm.id)
  792. );
  793. saveAttached(this.orderList).then(res => {
  794. this.$nextTick(() => {
  795. this.dialogVisible = false;
  796. this.rowIndex = null;
  797. this.orderList = [];
  798. });
  799. });
  800. } else {
  801. this.dataList[this.rowIndex].fileList = [...this.orderList];
  802. this.$nextTick(() => {
  803. this.dialogVisible = false;
  804. this.rowIndex = null;
  805. this.orderList = [];
  806. });
  807. }
  808. },
  809. // 是否收费选择触发
  810. chargeStatusChange(data) {
  811. if (data === 0) this.form.handingUser = null;
  812. },
  813. // 接收人选择触发
  814. handingUserChange(data) {
  815. this.$set(
  816. this.form,
  817. "handingUserName",
  818. this.userList.find(item => data == item.id)
  819. ? this.userList.find(item => data == item.id).realName
  820. : null
  821. );
  822. },
  823. // 提交确认
  824. submitConfirm() {
  825. this.$confirm("提交确认?", "提示", {
  826. confirmButtonText: "确定",
  827. cancelButtonText: "取消",
  828. type: "warning"
  829. }).then(() => {
  830. this.btnLoading = true;
  831. submitConfirm({ id: this.form.id })
  832. .then(res => {
  833. this.$message.success("提交成功");
  834. this.queryData(this.form.id);
  835. })
  836. .finally(() => {
  837. this.btnLoading = false;
  838. });
  839. });
  840. },
  841. externalChange(row) {
  842. // if (row == 1) {
  843. // this.findObject(this.option.column, "handingCorpName").display = true;
  844. // } else {
  845. // this.findObject(this.option.column, "handingCorpName").display = false;
  846. // }
  847. }
  848. },
  849. watch: {
  850. "form.external": function(obj) {
  851. if (obj == 1) {
  852. this.findObject(this.option.column, "handingCorpName").display = true;
  853. } else {
  854. this.findObject(this.option.column, "handingCorpName").display = false;
  855. }
  856. }
  857. }
  858. };
  859. </script>
  860. <style scoped></style>