detail.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList" :loading="btnLoading">返回列表</el-button>
  7. </div>
  8. <div class="add-customer-btn">
  9. <el-button type="primary" size="small" class="el-button--small-yh" @click.stop="openEdit" v-if="disabled">编 辑
  10. </el-button>
  11. <el-button v-if="checker && form.status != 3" type="primary" size="small" class="el-button--small-yh"
  12. @click.stop="openCheckDialog">
  13. 审批
  14. </el-button>
  15. <el-button v-if="form.status > 0" @click.native="checkScheduleDialog = true, checkId = form.id" type="primary"
  16. size="small">审核进度</el-button>
  17. <el-button type="primary" v-if="!checkDisabled" :disabled="!form.id || disabled" size="small"
  18. @click="pleaseCheck" :loading="btnLoading">请核</el-button>
  19. <el-button type="success" :disabled="!form.id" size="small" @click="copyDoc" :loading="btnLoading" v-if="false">
  20. 复制单据</el-button>
  21. <el-button type="primary" @click="editCustomer" size="small" :disabled="form.status > 0" :loading="btnLoading">
  22. 保存数据</el-button>
  23. </div>
  24. </div>
  25. <div class="customer-main">
  26. <trade-card title="经办人信息">
  27. <avue-form ref="form" class="trading-form" v-model="form" :option="option">
  28. <template slot="userId">
  29. <el-select v-model="form.userId" filterable clearable size="small" placeholder="请选择" @change="userHandle"
  30. @clear="form.userName == null" :disabled="disabled || checkDisabled">
  31. <el-option v-for="(item, index) in userList" :key="index" :label="item.realName" :value="item.id">
  32. </el-option>
  33. </el-select>
  34. </template>
  35. <template slot="belongToCorpId">
  36. <crop-select
  37. v-model="form.belongToCorpId"
  38. corpType="GS"
  39. :disabled="disabled || checkDisabled"
  40. @getCorpData="returnBack"
  41. style="width: 100%"
  42. ref="KHSelect"
  43. ></crop-select>
  44. </template>
  45. <template slot="deptId">
  46. <avue-input-tree leaf-only style="width: 100%;" size="small" :props="{ label: 'title' }"
  47. v-model="form.deptId" placeholder=" " type="tree" :dic="dic" :nodeClick="deptClick"
  48. :disabled="disabled || checkDisabled"></avue-input-tree>
  49. </template>
  50. <template slot="postId">
  51. <el-select v-model="form.postId" clearable filterable placeholder="请选择 岗位" @change="postHandle"
  52. @clear="form.postId == null" :disabled="disabled || checkDisabled">
  53. <el-option v-for="(item, index) in postDic" :label="item.postName" :value="item.id" :key="index" />
  54. </el-select>
  55. </template>
  56. </avue-form>
  57. </trade-card>
  58. <trade-card title="报销明细">
  59. <avue-crud ref="crud" :key="key" :data="dataList" :option="tableOption" :cell-style="cellStyle" @saveColumn="saveColumn"
  60. @resetColumn="resetColumn">
  61. <template slot="menuLeft">
  62. <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
  63. :disabled="disabled || checkDisabled">录入明细</el-button>
  64. <el-button type="info" icon="el-icon-printer" size="small" @click="openReport">报表打印</el-button>
  65. </template>
  66. <template slot="menu" slot-scope="{ row, index }">
  67. <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
  68. :disabled="disabled || checkDisabled">{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
  69. <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
  70. :disabled="disabled || checkDisabled">删除</el-button>
  71. </template>
  72. <template slot="payDate" slot-scope="{ row, index }">
  73. <el-date-picker v-if="row.$cellEdit" v-model="row.payDate" type="date" placeholder="选择日期" size="small"
  74. style="width: 100%" format="yyyy-MM-dd" valueFormat="yyyy-MM-dd"></el-date-picker>
  75. <span v-else>{{ row.payDate }}</span>
  76. </template>
  77. <template slot="moldId" slot-scope="{ row }">
  78. <avue-cascader v-if="row.$cellEdit" v-model="row.moldId" size="small" style="width: 100%;" :dic="dicArea"
  79. :props="props" check-strictly :emit-path="false" :show-all-levels="false"
  80. @change="moldChange($event, row, dicArea)" @clear="row.feeList = feesOption" placeholder="请选择">
  81. </avue-cascader>
  82. <span v-else>{{ row.mold }}</span>
  83. </template>
  84. <template slot="detailId" slot-scope="{ row }">
  85. <el-select v-if="row.$cellEdit" v-model="row.detailId" filterable clearable @change="detailChange(row)"
  86. size="small">
  87. <el-option v-for="(item, index) in row.feeList" :key="index" :label="item.cname" :value="item.id">
  88. </el-option>
  89. </el-select>
  90. <span v-else>{{ row.detail }}</span>
  91. </template>
  92. <template slot="explanation" slot-scope="{ row, index }">
  93. <el-input v-if="row.$cellEdit" v-model="row.explanation" size="small" placeholder="输入内容" />
  94. <span v-else>{{ row.explanation }}</span>
  95. </template>
  96. <template slot="payMethod" slot-scope="{ row, index }">
  97. <el-select v-model="row.payMethod" size="small" placeholder="请选择" clearable :disabled="!row.$cellEdit">
  98. <el-option v-for="(item, index) in paymentOption" :key="index" :label="item.dictValue"
  99. :value="item.dictKey"></el-option>
  100. </el-select>
  101. </template>
  102. <template slot="amount" slot-scope="{ row, index }">
  103. <el-input-number v-if="row.$cellEdit" v-model="row.amount" size="small" :controls="false" :precision="2"
  104. style="width: 100%" placeholder="金额"></el-input-number>
  105. <span v-else>{{ row.amount }}</span>
  106. </template>
  107. </avue-crud>
  108. </trade-card>
  109. <trade-card title="上传附件">
  110. <c-upload :basic="true"
  111. :enumerationValue="107.1"
  112. :disabled="disabled || checkDisabled"
  113. :data="fileList"></c-upload>
  114. </trade-card>
  115. <trade-card title="付款信息">
  116. <avue-form :option="optionTwo" v-model="form">
  117. <template slot="paymentMethodName" slot-scope="{ row, index }">
  118. <el-select v-model="form.paymentMethodName" filterable size="small" placeholder="请选择" clearable>
  119. <el-option v-for="(item, index) in paymentOption" :key="index" :label="item.dictValue"
  120. :value="item.dictKey"></el-option>
  121. </el-select>
  122. </template>
  123. </avue-form>
  124. </trade-card>
  125. </div>
  126. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  127. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  128. <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
  129. </check>
  130. </el-dialog>
  131. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  132. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  133. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
  134. </check-schedule>
  135. </el-dialog>
  136. <!-- 报表-->
  137. <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="事务-报销单" @onClose="onClose()" />
  138. </div>
  139. </template>
  140. <script>
  141. import tableOption from "./config/customerContact.json";
  142. import tableOptionTwo from "./config/customerContactTwo.json";
  143. import {
  144. isDiscount,
  145. isPercentage,
  146. micrometerFormat,
  147. IntegerFormat
  148. } from "@/util/validate";
  149. import {gainUser, getCharge} from "@/api/basicData/customerInquiry";
  150. import { getUserInfo } from "@/api/system/user";
  151. import { getDeptTree } from "@/api/system/dept";
  152. import { getCurrentDate } from "@/util/date";
  153. import { getList as getPostList } from "@/api/system/post";
  154. import { dataDetail, typeSave, removeGoods, pleaseCheck } from "@/api/standAlone/reimbursement";
  155. import { contrastObj, contrastList } from "@/util/contrastData";
  156. import check from "@/components/check/check";
  157. import checkSchedule from "@/components/check/checkSchedule";
  158. import reportDialog from "@/components/report-dialog/main";
  159. import { getDeptTree as getFeesId, getFeesList } from "@/api/basicData/basicFeesDesc";
  160. import {customerList as getKHList, detail as khDetail} from "@/api/basicData/customerInformation";
  161. import {getCorpDetail} from "@/api/maintenance/overpayment";
  162. import {integralDetail} from "@/api/maintenance/integral";
  163. import {getlistBankBy, getProfit} from "@/api/basicData/configuration";
  164. import da from "element-ui/src/locale/lang/da";
  165. export default {
  166. name: "detail",
  167. props: {
  168. detailData: {
  169. type: Object
  170. }
  171. },
  172. components: {
  173. check,
  174. checkSchedule,
  175. reportDialog
  176. },
  177. data() {
  178. return {
  179. disabled: false,
  180. pageLoading: false,
  181. btnLoading: false,
  182. form: {},
  183. option: {
  184. menuBtn: false,
  185. labelWidth: 100,
  186. column: [
  187. {
  188. label: "申请报销人",
  189. prop: "userId",
  190. rules: [
  191. {
  192. required: true,
  193. message: " ",
  194. trigger: "change"
  195. }
  196. ],
  197. span: 8,
  198. slot: true,
  199. },
  200. {
  201. label: "提交时间",
  202. prop: "claimDate",
  203. span: 8,
  204. type: "date",
  205. format: "yyyy-MM-dd",
  206. valueFormat: "yyyy-MM-dd HH:mm:ss",
  207. rules: [
  208. {
  209. required: true,
  210. message: " ",
  211. trigger: "blur"
  212. }
  213. ]
  214. },
  215. {
  216. label: "要求支付日期",
  217. prop: "requiredPaymentTime",
  218. span: 8,
  219. type: "date",
  220. format: "yyyy-MM-dd",
  221. valueFormat: "yyyy-MM-dd HH:mm:ss"
  222. },
  223. {
  224. label: "所属公司",
  225. prop: "belongToCorpId",
  226. span: 16,
  227. slot: true,
  228. },
  229. {
  230. label: "所属部门",
  231. prop: "deptId",
  232. rules: [
  233. {
  234. required: true,
  235. message: " ",
  236. trigger: "blur"
  237. }
  238. ],
  239. span: 8,
  240. slot: true,
  241. },
  242. {
  243. label: "所属公司编码",
  244. prop: "belongToCorpCode",
  245. span: 8,
  246. slot: true,
  247. },
  248. {
  249. label: "报销人银行户头",
  250. prop: "accountReimbursement",
  251. type: 'select',
  252. dicData:[],
  253. filterable:true,
  254. props: {
  255. label: "accountName",
  256. value: "accountName"
  257. },
  258. change:(data)=>{
  259. let list = this.findObject(this.option.column, "accountReimbursement").dicData
  260. for (let item of list){
  261. if (data.value == item.accountName){
  262. this.form.accountReimbursement = data.value
  263. this.form.reimbursementAccountNo = item.accountBank
  264. this.form.bankOfDeposit = item.accountNo
  265. }
  266. }
  267. },
  268. span: 8,
  269. slot: true,
  270. },
  271. {
  272. label: "报销人账号",
  273. prop: "reimbursementAccountNo",
  274. span: 8,
  275. slot: true,
  276. },
  277. {
  278. label: "报销人开户行",
  279. prop: "bankOfDeposit",
  280. span: 8,
  281. slot: true,
  282. },
  283. {
  284. label: "系统编号",
  285. prop: "serialNo",
  286. disabled:true,
  287. span: 8,
  288. slot: true,
  289. },
  290. {
  291. label: "单据数量",
  292. prop: "billQuantity",
  293. span: 8,
  294. slot: true,
  295. },
  296. {
  297. label: "备注",
  298. prop: "remarks",
  299. type: "textarea",
  300. minRows: 2,
  301. span: 24,
  302. },
  303. ],
  304. },
  305. optionTwo: {
  306. menuBtn: false,
  307. labelWidth: 100,
  308. column: [
  309. {
  310. label: "支付时间",
  311. prop: "paymentTime",
  312. span: 8,
  313. type: "date",
  314. format: "yyyy-MM-dd",
  315. valueFormat: "yyyy-MM-dd HH:mm:ss"
  316. },
  317. {
  318. label: "支付方式",
  319. prop: "paymentMethodName",
  320. type: "select",
  321. dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
  322. props: {
  323. label: "dictValue",
  324. value: "dictKey"
  325. },
  326. span: 8,
  327. slot: true,
  328. },{
  329. label: "实际付款金额",
  330. prop: "paymentAmount",
  331. span: 8,
  332. slot: true,
  333. },{
  334. label: "给付人",
  335. prop: "dans",
  336. span: 8,
  337. slot: true,
  338. },{
  339. label: "财务出纳",
  340. prop: "financialCashier",
  341. span: 8,
  342. slot: true,
  343. },{
  344. label: "科目编码",
  345. prop: "subjectCode",
  346. span: 8,
  347. slot: true,
  348. },
  349. ]
  350. },
  351. dataList: [],
  352. tableOption: {},
  353. goodsoptions: [],
  354. unitOption: [],
  355. paymentOption: [],
  356. fileList:[],
  357. selectionList: [],
  358. search: {},
  359. treeStyle: "height:" + (window.innerHeight - 315) + "px",
  360. goodsOption: {},
  361. loading: false,
  362. switchDialog: false, // 报表弹窗控制
  363. userList: [],
  364. dic: [], // 部门
  365. postDic: [], // 岗位
  366. loginUser: '', // 登录人
  367. breakConfiguration: {
  368. multipleChoices: false,
  369. multiple: false,
  370. disabled: false,
  371. searchShow: true,
  372. collapseTags: false,
  373. clearable: true,
  374. placeholder: "请点击右边按钮选择",
  375. dicData: []
  376. },
  377. oldForm: {},
  378. oldDataList: [],
  379. checkDisabled: false, // 审核状态
  380. checker: false,
  381. checkId: '',
  382. batchNo: '',
  383. checkDialog: false,
  384. checkScheduleDialog: false,
  385. checkData: {},
  386. dicArea: [],
  387. props: {
  388. value: 'value',
  389. label: 'title',
  390. },
  391. feesOption: [],
  392. tableOptionBack:{},
  393. key:0,
  394. tenantId:JSON.parse(localStorage.getItem("saber-userInfo")).content.tenant_id
  395. }
  396. },
  397. async created() {
  398. if (this.tenantId == '681169'){
  399. this.tableOptionBack = tableOptionTwo
  400. }else {
  401. this.tableOptionBack = tableOption
  402. }
  403. this.$set(this.form, 'claimDate', getCurrentDate()); // 默认当前日期
  404. this.tableOption = await this.getColumnData(this.getColumnName(107),this.tableOptionBack);
  405. this.key++
  406. gainUser().then(res => {
  407. this.userList = res.data.data;
  408. });
  409. getUserInfo().then(res => {
  410. this.$set(this.form, 'userId', res.data.data.id);
  411. this.$set(this.form, 'userName', res.data.data.realName);
  412. this.$set(this.form, 'deptId', res.data.data.deptId);
  413. this.$set(this.form, 'deptName', res.data.data.deptName);
  414. this.$set(this.form, 'postId', res.data.data.postId.split(',')[0]);
  415. this.$set(this.form, 'postName', res.data.data.postName.split(',')[0]);
  416. this.loginUser = res.data.data.realName;
  417. })
  418. getDeptTree().then(res => {
  419. this.dic = res.data.data
  420. })
  421. getPostList(1, 10).then(res => {
  422. if (res.data.data.total > 0) {
  423. this.postDic = res.data.data.records;
  424. if (Math.ceil(res.data.data.total / 10) > 1) {
  425. for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
  426. getPostList(i, 10).then(e => {
  427. this.postDic = this.postDic.concat(e.data.data.records);
  428. });
  429. }
  430. }
  431. }
  432. });
  433. getFeesId().then(res => {
  434. this.dicArea = res.data.data;
  435. })
  436. getFeesList().then(res => {
  437. this.feesOption = res.data.data;
  438. });
  439. this.getWorkDicts('unit').then(res => {
  440. this.unitOption = res.data.data;
  441. })
  442. this.getWorkDicts("payment_term").then(res => {
  443. this.paymentOption = res.data.data;
  444. })
  445. if (this.detailData.query) {
  446. this.disabled = true;
  447. this.option.column.map(e => {
  448. this.$set(e, 'disabled', true)
  449. })
  450. this.optionTwo.column.map(e => {
  451. this.$set(e, 'disabled', true)
  452. })
  453. this.queryData(this.detailData.id);
  454. } else if (this.detailData.auditId) {
  455. this.checker = true;
  456. this.batchNo = this.detailData.check.batchNo
  457. this.queryData(this.detailData.id);
  458. }
  459. },
  460. filters: {
  461. IntegerFormat(num) {
  462. return IntegerFormat(num);
  463. },
  464. decimalFormat(num) {
  465. return num ? Number(num).toFixed(2) : "0.00";
  466. }
  467. },
  468. methods: {
  469. returnBack(row) {
  470. getlistBankBy(row.id).then(res =>{
  471. this.findObject(this.option.column, "accountReimbursement").dicData = res.data
  472. })
  473. },
  474. // 查询
  475. queryData(id) {
  476. this.pageLoading = true;
  477. dataDetail({ id: id }).then(res => {
  478. this.form = res.data.data;
  479. this.fileList = this.form.fileList
  480. delete this.form.fileList
  481. this.dataList = this.form.itemList ? this.form.itemList : [];
  482. this.dataList.forEach(item => {
  483. this.moldChange(item.moldId, item, this.dicArea)
  484. if (item.payMethod) {
  485. item.payMethod = item.payMethod.toString();
  486. }
  487. })
  488. delete this.form.itemList;
  489. this.oldForm =this.deepClone({ ...this.form });
  490. this.oldDataList =this.deepClone([...this.dataList]);
  491. this.checkDisabled = this.form.status > 0 ? true : false;
  492. if (this.form.status > 0) {
  493. this.option.column.map(e => {
  494. this.$set(e, 'disabled', true)
  495. })
  496. this.optionTwo.column.map(e => {
  497. this.$set(e, 'disabled', true)
  498. })
  499. }
  500. }).finally(() => {
  501. this.pageLoading = false;
  502. })
  503. },
  504. //返回列表
  505. backToList() {
  506. this.$emit("goBack");
  507. },
  508. // 编辑按钮触发
  509. openEdit() {
  510. this.disabled = false;
  511. this.option.column.map(e => {
  512. if (this.checkDisabled) {
  513. this.$set(e, 'disabled', true)
  514. } else {
  515. if (e.prop != 'serialNo') {
  516. this.$set(e, 'disabled', false)
  517. }
  518. }
  519. })
  520. this.optionTwo.column.map(e => {
  521. if (this.checkDisabled) {
  522. this.$set(e, 'disabled', true)
  523. } else {
  524. if (e.prop != 'serialNo') {
  525. this.$set(e, 'disabled', false)
  526. }
  527. }
  528. })
  529. },
  530. // 复制
  531. copyDoc() {
  532. this.$emit("copyOrder", this.form.id);
  533. },
  534. //修改提交触发
  535. editCustomer(status) {
  536. for (let i = 0; i < this.dataList.length; i++) {
  537. if (this.dataList[i].amount == null) {
  538. return this.$message.error("报销明细第" + Number(i + 1) + "行的金额不能为空");
  539. }
  540. }
  541. this.$refs["form"].validate((valid, done) => {
  542. done();
  543. if (valid) {
  544. this.$set(this.form, 'itemList', this.dataList)
  545. let formTwo = {
  546. ...this.form,
  547. fileList:this.fileList
  548. }
  549. this.btnLoading = true;
  550. typeSave(formTwo).then(res => {
  551. this.$message({ type: "success", message: this.form.id ? "修改成功!" : "新增成功!" });
  552. this.queryData(res.data.data);
  553. }).finally(() => {
  554. this.btnLoading = false;
  555. })
  556. } else {
  557. return false
  558. }
  559. })
  560. },
  561. cellStyle() {
  562. return "padding:0;height:40px;";
  563. },
  564. async saveColumn() {
  565. const inSave = await this.saveColumnData(
  566. this.getColumnName(107),
  567. this.tableOption
  568. );
  569. if (inSave) {
  570. this.$message.success("保存成功");
  571. //关闭窗口
  572. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  573. this.$nextTick(() => {
  574. this.$refs.crud.doLayout()
  575. })
  576. }
  577. },
  578. async resetColumn() {
  579. this.tableOption = this.tableOptionBack;
  580. const inSave = await this.delColumnData(
  581. this.getColumnName(107),this.tableOptionBack
  582. );
  583. if (inSave) {
  584. this.$nextTick(() => {
  585. this.$refs.crud.doLayout()
  586. })
  587. this.$message.success("重置成功");
  588. //关闭窗口
  589. setTimeout(() => {
  590. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  591. }, 1000);
  592. }
  593. },
  594. //录入明细
  595. newDetails() {
  596. this.$refs["form"].validate((valid, done) => {
  597. done()
  598. if (valid) {
  599. this.dataList.push({
  600. $cellEdit: true,
  601. feeList: this.feesOption,
  602. })
  603. }
  604. })
  605. },
  606. rowCell(row, index) {
  607. if (row.$cellEdit == true) {
  608. this.$set(row, "$cellEdit", false);
  609. } else {
  610. this.$set(row, "$cellEdit", true);
  611. }
  612. },
  613. rowDel(row, index) {
  614. this.$confirm("确定删除数据?", {
  615. confirmButtonText: "确定",
  616. cancelButtonText: "取消",
  617. type: "warning"
  618. }).then(() => {
  619. if (row.id) {
  620. removeGoods(row.id).then(res => {
  621. this.$message({
  622. type: 'success',
  623. message: '删除成功!'
  624. })
  625. this.dataList.splice(row.$index, 1);
  626. })
  627. } else {
  628. this.$message({
  629. type: "success",
  630. message: "删除成功!"
  631. });
  632. this.dataList.splice(row.$index, 1);
  633. }
  634. });
  635. },
  636. getKHData(row) { },
  637. //选择费用
  638. selectValue(value, row) {
  639. console.log(value)
  640. this.$set(row, "expenseItem", value.cname);
  641. },
  642. userHandle() {
  643. this.form.userName = this.userList.find(item => item.id == this.form.userId).realName;
  644. },
  645. postHandle() {
  646. this.form.postName = this.postDic.find(item => item.id == this.form.postId).postName;
  647. },
  648. // 验证新旧值对比
  649. verification() {
  650. if (contrastObj(this.form, this.oldForm) ||
  651. contrastList(this.dataList, this.oldDataList)) {
  652. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  653. confirmButtonText: "确定",
  654. cancelButtonText: "取消",
  655. type: "warning"
  656. }).then(() => {
  657. this.editCustomer();
  658. }).catch(() => {
  659. return false; //取消改动数据
  660. })
  661. } else {
  662. return true;
  663. }
  664. },
  665. deptClick(data) {
  666. this.$set(this.form, 'deptName', data.title)
  667. },
  668. //打开审核
  669. openCheckDialog() {
  670. this.checkData = this.detailData.check
  671. this.checkDialog = true;
  672. },
  673. //关闭审核
  674. choceCheckFun() {
  675. this.checkDialog = false;
  676. },
  677. choceScheduleFun() {
  678. this.checkScheduleDialog = false
  679. },
  680. // 请核
  681. pleaseCheck() {
  682. if (this.verification()) {
  683. const data = {
  684. id: this.form.id,
  685. serialNo: this.form.serialNo,
  686. checkType: 'fybx',
  687. url: '/reimbursement/index',
  688. pageStatus: "this.$store.getters.reimbursementStatus",
  689. pageLabel: "报销",
  690. checkFlag: 1,
  691. }
  692. this.btnLoading = true;
  693. pleaseCheck(data).then(res => {
  694. this.$message.success('请核成功')
  695. this.queryData(this.form.id)
  696. }).catch(() => {
  697. this.$message.error('请核失败')
  698. }).finally(() => {
  699. this.btnLoading = false;
  700. })
  701. }
  702. },
  703. // 报表
  704. openReport() {
  705. this.switchDialog = !this.switchDialog;
  706. },
  707. // 报表关闭
  708. onClose(val) {
  709. this.switchDialog = val;
  710. },
  711. moldChange(e, row, list) {
  712. list.forEach(item => {
  713. if (e == item.value) {
  714. this.$set(row, 'mold', item.title);
  715. getFeesList({ feesTypeId: e }).then(res => {
  716. this.$set(row, 'feeList', res.data.data);
  717. this.$nextTick(() => {
  718. if (!(row.feeList.some(item => item.id == row.detailId))) {
  719. this.$set(row, 'detailId', null);
  720. }
  721. })
  722. });
  723. }
  724. if (item.hasChildren) {
  725. this.moldChange(e, row, item.children)
  726. }
  727. })
  728. },
  729. detailChange(row) {
  730. row.detail = row.feeList.find(item => item.id == row.detailId) ? row.feeList.find(item => item.id == row.detailId).cname : null
  731. },
  732. },
  733. }
  734. </script>
  735. <style scoped>
  736. </style>