detail.vue 25 KB

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