reimbursementAdd.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <style scoped>
  2. ::v-deep .ant-steps-dot .ant-steps-item-content {
  3. width: auto;
  4. }
  5. ::v-deep .ant-steps-dot .ant-steps-item-active .ant-steps-item-icon > .ant-steps-icon .ant-steps-icon-dot {
  6. background: rgb(11, 190, 135);
  7. width: 15px;
  8. height: 15px;
  9. /* margin-top: 5px; */
  10. margin-left: 2px;
  11. }
  12. ::v-deep .endStatus .ant-steps-item-icon > .ant-steps-icon .ant-steps-icon-dot {
  13. background: #1890ff !important;
  14. width: 15px;
  15. height: 15px;
  16. /* margin-top: 5px; */
  17. /* margin-left: 2px; */
  18. }
  19. ::v-deep .ant-steps-dot .ant-steps-item-icon {
  20. width: 15px;
  21. height: 15px;
  22. margin-top: 5px;
  23. margin-left: -4px;
  24. }
  25. ::v-deep .ant-form-item {
  26. width: 100%;
  27. }
  28. ::v-deep .look-show .ant-form-item-label {
  29. font-size: 20px;
  30. }
  31. ::v-deep .look-show .ant-form-item-control-wrapper {
  32. font-size: 16px;
  33. }
  34. </style>
  35. <template>
  36. <div class="reimbursement">
  37. <div class="chartBox">
  38. <a-row :gutter="20">
  39. <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
  40. <a-card
  41. class="search-box step-jump"
  42. title="个人信息"
  43. v-if="!!$route.query.type && ($route.query.type == 'add' || $route.query.type == 'edit')"
  44. >
  45. <a-form
  46. ref="formRef"
  47. name="advanced_search"
  48. class="ant-advanced-search-form"
  49. :form="form"
  50. layout="inline"
  51. :label-col="labelCol"
  52. :wrapper-col="wrapperCol"
  53. >
  54. <a-row :gutter="24">
  55. <a-col :span="6">
  56. <a-form-item label="申请人">
  57. {{ userInfo().realname }}
  58. </a-form-item>
  59. </a-col>
  60. <a-col :span="6">
  61. <a-form-item label="申请日期">
  62. <a-month-picker
  63. v-decorator="[
  64. 'statDate',
  65. {
  66. rules: [{ required: true, message: '请选择申请日期' }],
  67. initialValue: moment().format('YYYY-MM'),
  68. },
  69. ]"
  70. format="YYYY-MM"
  71. />
  72. </a-form-item>
  73. </a-col>
  74. <a-col :span="6">
  75. <a-form-item label="部门">
  76. <j-tree-select
  77. v-decorator="[
  78. 'departId',
  79. {
  80. rules: [{ required: true, message: '请选择部门' }],
  81. },
  82. ]"
  83. placeholder="请选择部门"
  84. dict="sys_depart,depart_name,id"
  85. pidField="parent_id"
  86. style="width: 200px"
  87. >
  88. </j-tree-select>
  89. </a-form-item>
  90. </a-col>
  91. </a-row>
  92. <a-row :gutter="24">
  93. <a-col :span="6">
  94. <a-form-item label="公司主体">
  95. <a-select
  96. v-decorator="[
  97. 'companyId',
  98. {
  99. rules: [{ required: true, message: '请选择公司' }],
  100. },
  101. ]"
  102. style="width: 200px"
  103. :filterOption="filterOption"
  104. showSearch
  105. allowClear
  106. labelInValue
  107. >
  108. <a-select-option
  109. v-for="(item, index) in dataDimensionList"
  110. :key="index + 1"
  111. :value="item.companyId"
  112. >
  113. {{ item.companyName }}
  114. </a-select-option>
  115. </a-select>
  116. </a-form-item>
  117. </a-col>
  118. <a-col :span="6">
  119. <a-form-item label="媒体">
  120. <a-select
  121. v-decorator="[
  122. 'media',
  123. {
  124. rules: [{ required: true, message: '请选择媒体' }],
  125. },
  126. ]"
  127. style="width: 200px"
  128. :filterOption="filterOption"
  129. showSearch
  130. allowClear
  131. placeholder="请选择媒体"
  132. >
  133. <a-select-option value="快手"> 快手 </a-select-option>
  134. <a-select-option value="聚星"> 聚星 </a-select-option>
  135. <a-select-option value="磁力金牛"> 磁力金牛 </a-select-option>
  136. <a-select-option value="头条"> 头条 </a-select-option>
  137. <a-select-option value="头条千川"> 头条千川 </a-select-option>
  138. </a-select>
  139. </a-form-item>
  140. </a-col>
  141. <a-col :span="6" v-if="expenseList.length > 0">
  142. <a-form-item v-bind="tailFormItemLayout">
  143. <a-button type="primary" @click="handleSubmit">提交</a-button>
  144. </a-form-item>
  145. </a-col>
  146. </a-row>
  147. </a-form>
  148. </a-card>
  149. <a-card class="search-box step-jump look-show" title="个人信息" v-else>
  150. <a-form layout="inline" :label-col="labelCol" :wrapper-col="wrapperCol">
  151. <a-row :gutter="24" v-if="lookData">
  152. <a-col :span="9">
  153. <a-form-item label="公司主体"> {{ lookData.companyName }}</a-form-item>
  154. </a-col>
  155. <a-col :span="9">
  156. <a-form-item label="媒体"> {{ lookData.media }}</a-form-item>
  157. </a-col>
  158. <a-col :span="9">
  159. <a-form-item label="申请时间"> {{ lookData.statDate }}</a-form-item>
  160. </a-col>
  161. <a-col :span="9">
  162. <a-form-item label="部门"> {{ lookData.departName }}</a-form-item>
  163. </a-col>
  164. <a-col :span="9">
  165. <a-form-item label="申请人"> {{ lookData.userName }}</a-form-item>
  166. </a-col>
  167. </a-row>
  168. </a-form>
  169. </a-card>
  170. </a-col>
  171. <a-col :sm="24" style="margin-bottom: 20px">
  172. <a-card class="search-box step-jump" title="费用信息">
  173. <a-button type="primary" @click="policyOperationStatus = true" style="margin-bottom: 15px"
  174. >新增费用信息</a-button
  175. >
  176. <div v-if="lookData" style="display: flex">
  177. <h2 style="margin-right: 50px">报销金额:{{ lookData.amount }}</h2>
  178. <h2>发票总数: {{ lookData.invoices }}</h2>
  179. </div>
  180. <a-table
  181. :columns="expenseColumns"
  182. :data-source="expenseList"
  183. bordered
  184. tableLayout="auto"
  185. :pagination="false"
  186. :loading="expenseLoading"
  187. style="word-break: break-all"
  188. >
  189. <span slot="project" slot-scope="text, record">
  190. {{ projectName(text) }}
  191. </span>
  192. <span slot="fileUrls" slot-scope="text, record">
  193. <div v-if="!!text">
  194. <a @click="showFileOk(record)">查看</a>
  195. </div>
  196. <div v-else>-</div>
  197. </span>
  198. <span slot="auditDescription" slot-scope="text, record">
  199. <div v-if="!!text">
  200. <a @click="reasonReject(record)">查看</a>
  201. <!-- <div v-html="refuseReasonImage" style="width: 100%"></div> -->
  202. </div>
  203. <div v-else>-</div>
  204. </span>
  205. <div slot="action" slot-scope="text, record">
  206. <span v-if="!$route.query.person || $route.query.person == 1">
  207. <a
  208. @click="editProject(record)"
  209. :disabled="
  210. !!$route.query.type &&
  211. ($route.query.type == 'look' || $route.query.type == 'add')
  212. "
  213. >编辑</a
  214. >
  215. <a-divider type="vertical" />
  216. <a-popconfirm title="确定删除吗?" @confirm="() => deleteProject(record)">
  217. <a
  218. :disabled="
  219. !!$route.query.type &&
  220. ($route.query.type == 'look' || $route.query.type == 'add')
  221. "
  222. >删除</a
  223. >
  224. </a-popconfirm>
  225. </span>
  226. <span v-else>
  227. <a
  228. @click="editStatusOpen(record)"
  229. :disabled="
  230. !!$route.query.person &&
  231. ($route.query.person == '1' || $route.query.person == '3')
  232. "
  233. >驳回</a
  234. >
  235. </span>
  236. </div>
  237. </a-table>
  238. </a-card>
  239. </a-col>
  240. </a-row>
  241. <div
  242. style="width: 100%; display: flex; justify-content: flex-end"
  243. v-if="!!$route.query.person && $route.query.person != '1'"
  244. >
  245. <a-button type="primary" @click="bfOk" :disabled="!disabledJudge || $route.query.person == '3'"
  246. >部分通过</a-button
  247. >
  248. <a-button type="primary" @click="refuse" style="margin: 0 15px" :disabled="$route.query.person == '3'"
  249. >审核拒绝</a-button
  250. >
  251. <a-button type="primary" @click="allOk" :disabled="disabledJudge || $route.query.person == '3'"
  252. >审核通过</a-button
  253. >
  254. </div>
  255. </div>
  256. <a-modal v-if="showFile" title="查看附件" :visible="showFile" :footer="null" @cancel="showFile = false">
  257. <div v-if="fileList">
  258. <img :src="item" v-for="(item, index) in JSON.parse(fileList)" alt="" style="width: 150px" />
  259. </div>
  260. </a-modal>
  261. <a-modal
  262. v-if="reasonRejectVisible"
  263. title="驳回原因"
  264. :visible="reasonRejectVisible"
  265. :footer="null"
  266. @cancel="reasonRejectVisible = false"
  267. >
  268. <div v-if="reasonRejectData">
  269. <div v-html="reasonRejectData" style="width: 100%"></div>
  270. </div>
  271. </a-modal>
  272. <!-- 新增、编辑政策 -->
  273. <a-modal
  274. v-if="policyOperationStatus"
  275. dialog-class="policy-operation-class"
  276. :title="addType === 'add' ? '新增费用' : '编辑费用'"
  277. :visible="policyOperationStatus"
  278. :confirmLoading="confirmLoading"
  279. @ok="handlePolicyOperationSure"
  280. @cancel="handlePolicyOperationCancel"
  281. >
  282. <div>
  283. <a-form-model
  284. class="policy-operation-form"
  285. ref="policyOperationForm"
  286. :model="policyOperationForm"
  287. :rules="policyOperationRules"
  288. :label-col="labelCol"
  289. :wrapper-col="wrapperCol"
  290. >
  291. <a-row class="policy-operation-form-left">
  292. <a-form-model-item label="报销项目" prop="project">
  293. <a-select v-model="policyOperationForm.project" placeholder="请选择报销项目" allow-clear>
  294. <a-select-option
  295. :value="item.dcode"
  296. v-for="(item, index) in projectList"
  297. :key="index"
  298. >{{ item.dname }}</a-select-option
  299. >
  300. </a-select>
  301. </a-form-model-item>
  302. <a-form-model-item
  303. label="费用"
  304. prop="amount"
  305. :rules="{
  306. required: true,
  307. message: '请输入报销费用',
  308. trigger: 'blur',
  309. }"
  310. >
  311. <a-input-number v-model="policyOperationForm.amount" :step="0.01" :precision="2" />
  312. </a-form-model-item>
  313. <a-form-model-item
  314. label="费用产生日期"
  315. prop="statDate"
  316. :rules="{
  317. required: true,
  318. message: '费用产生日期必填',
  319. trigger: 'change',
  320. }"
  321. >
  322. <a-month-picker v-model="policyOperationForm.statDate" format="YYYY-MM" />
  323. </a-form-model-item>
  324. <a-form-model-item label="附件">
  325. <uploadFile
  326. :value.sync="policyOperationForm.fileUrls"
  327. :multiple="true"
  328. @overUpload="overUpload"
  329. :fileCount="10"
  330. uploadType="image"
  331. />
  332. </a-form-model-item>
  333. </a-row>
  334. <a-row class="policy-operation-form-right">
  335. <a-form-model-item
  336. label="报销类别"
  337. prop="type"
  338. :rules="{
  339. required: true,
  340. message: '报销类别必选',
  341. trigger: 'change',
  342. }"
  343. >
  344. <a-select v-model="policyOperationForm.type" placeholder="请选择报销类别" allow-clear>
  345. <a-select-option value="报销">报销</a-select-option>
  346. </a-select>
  347. </a-form-model-item>
  348. <a-form-model-item
  349. label="发票张数"
  350. prop="invoices"
  351. :rules="{
  352. required: true,
  353. message: '发票张数必填',
  354. trigger: 'blur',
  355. }"
  356. >
  357. <a-input-number v-model="policyOperationForm.invoices" :step="1" :precision="0" />
  358. </a-form-model-item>
  359. <a-form-model-item label="备注" prop="remarks">
  360. <a-input v-model="policyOperationForm.remarks" placeholder="请输入备注" allow-clear />
  361. </a-form-model-item>
  362. </a-row>
  363. </a-form-model>
  364. </div>
  365. </a-modal>
  366. <!-- 驳回原因 -->
  367. <a-modal
  368. v-if="rejectVisible"
  369. title="驳回原因"
  370. :visible="rejectVisible"
  371. @cancel="rejectVisible = false"
  372. @ok="auditDescriptionOk"
  373. >
  374. <j-code-editor language="javascript" v-model="auditDescription" style="min-height: 100px" />
  375. </a-modal>
  376. </div>
  377. </template>
  378. <script>
  379. import moment from 'moment'
  380. import { getAction, postAction, downFile } from '@/api/manage'
  381. import { mapGetters } from 'vuex'
  382. import { urlAcount } from './policy-management-server.js'
  383. import pick from 'lodash.pick'
  384. import JTreeSelect from '@/components/jeecg/JTreeSelect'
  385. import uploadFile from '@/components/uploadFile.vue'
  386. import { defineComponent, ref } from 'vue'
  387. import JCodeEditor from '@/components/jeecg/JEditor'
  388. export default {
  389. name: 'policy-management-reimbursement-add',
  390. data() {
  391. return {
  392. form: this.$form.createForm(this),
  393. showFile: false,
  394. fileList: null,
  395. labelCol: {
  396. span: 8,
  397. },
  398. wrapperCol: {
  399. span: 16,
  400. },
  401. tailFormItemLayout: {
  402. wrapperCol: {
  403. sm: {
  404. span: 24,
  405. offset: 8,
  406. },
  407. },
  408. },
  409. dataDimensionList: [],
  410. expenseColumns: [
  411. {
  412. title: '报销项目',
  413. align: 'center',
  414. dataIndex: 'project',
  415. scopedSlots: { customRender: 'project' },
  416. },
  417. {
  418. title: '报销类别',
  419. align: 'center',
  420. dataIndex: 'type',
  421. },
  422. {
  423. title: '费用金额',
  424. align: 'center',
  425. dataIndex: 'amount',
  426. scopedSlots: { customRender: 'amount' },
  427. },
  428. {
  429. title: '产生日期',
  430. align: 'center',
  431. dataIndex: 'statDate',
  432. scopedSlots: { customRender: 'statDate' },
  433. },
  434. {
  435. title: '发票张数',
  436. align: 'center',
  437. dataIndex: 'invoices',
  438. scopedSlots: { customRender: 'invoices' },
  439. },
  440. {
  441. title: '备注',
  442. align: 'center',
  443. ellipsis: true,
  444. dataIndex: 'remarks',
  445. scopedSlots: { customRender: 'remarks' },
  446. width: 120,
  447. },
  448. {
  449. title: '附件',
  450. align: 'center',
  451. dataIndex: 'fileUrls',
  452. scopedSlots: { customRender: 'fileUrls' },
  453. },
  454. {
  455. title: '驳回原因',
  456. align: 'center',
  457. dataIndex: 'auditDescription',
  458. scopedSlots: { customRender: 'auditDescription' },
  459. },
  460. {
  461. title: '操作',
  462. align: 'center',
  463. dataIndex: 'action',
  464. scopedSlots: { customRender: 'action' },
  465. },
  466. ],
  467. expenseList: [],
  468. expenseLoading: false,
  469. addType: 'add',
  470. projectList: [],
  471. policyOperationStatus: false,
  472. confirmLoading: false,
  473. policyOperationRules: {
  474. project: [{ required: true, message: '请选择报销项目', trigger: 'change' }],
  475. },
  476. policyOperationForm: {},
  477. expenseIds: [],
  478. lookData: null,
  479. rejectVisible: false,
  480. auditDescription: null,
  481. rejectId: null,
  482. reasonRejectVisible: false,
  483. reasonRejectData: null,
  484. }
  485. },
  486. components: {
  487. JTreeSelect,
  488. uploadFile,
  489. JCodeEditor,
  490. },
  491. created() {},
  492. computed: {
  493. disabledJudge() {
  494. var index = this.expenseList.findIndex((item) => {
  495. return item.status == '0'
  496. })
  497. return index > -1 ? true : false
  498. },
  499. },
  500. mounted() {
  501. this.getCompanyList()
  502. this.getProjectList()
  503. let editRecordId = this.$route.query.id
  504. let editRecordType = this.$route.query.type
  505. if (editRecordId) {
  506. this.getDetail(editRecordId)
  507. } else {
  508. this.form.setFieldsValue(pick(this.userInfo(), 'departId'))
  509. }
  510. },
  511. methods: {
  512. ...mapGetters(['userInfo']),
  513. moment,
  514. getDetail(id) {
  515. this.getAction('/reimburse/apply/queryById', { id: id }).then((res) => {
  516. if (res.success) {
  517. this.expenseIds = JSON.parse(res.result.ids)
  518. if (this.$route.query.type == 'look') {
  519. this.lookData = res.result
  520. } else {
  521. var data = res.result
  522. data.statDate = moment(data.statDate)
  523. data.companyId = { key: data.companyId, label: data.companyName }
  524. this.form.setFieldsValue(pick(res.result, 'departId', 'media', 'statDate', 'companyId'))
  525. }
  526. this.getExpenseList(this.expenseIds)
  527. }
  528. })
  529. },
  530. showFileOk(item) {
  531. this.showFile = true
  532. this.fileList = item.fileUrls
  533. },
  534. reasonReject(item) {
  535. this.reasonRejectVisible = true
  536. this.reasonRejectData = item.auditDescription
  537. },
  538. projectName(theme) {
  539. if (this.projectList.length > 0) {
  540. var data = this.projectList.find((item) => {
  541. return item.dcode == theme
  542. })
  543. return data.dname
  544. }
  545. },
  546. filterOption(input, option) {
  547. return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  548. },
  549. disabledDate(current) {
  550. return current > moment().subtract(1, 'day')
  551. },
  552. getFormData(form, className) {
  553. return this[form].getFieldValue(className)
  554. },
  555. //获取公司列表
  556. getCompanyList() {
  557. return new Promise((resolve, reject) => {
  558. this.getAction('/reimburse/apply/getCompanyList').then((res) => {
  559. if (res.success) {
  560. this.dataDimensionList = res.result
  561. resolve(res.result)
  562. } else {
  563. reject(res.message)
  564. }
  565. })
  566. })
  567. },
  568. //获取报销项目
  569. getProjectList() {
  570. return new Promise((resolve, reject) => {
  571. this.getAction('/reimburse/dict/list').then((res) => {
  572. if (res.success) {
  573. this.projectList = res.result
  574. resolve(res.result)
  575. } else {
  576. reject(res.message)
  577. }
  578. })
  579. })
  580. },
  581. //获取费用信息
  582. getExpenseList(ids) {
  583. return new Promise((resolve, reject) => {
  584. this.expenseLoading = true
  585. this.postDataAction('/reimburse/project/queryByIds', ids).then((res) => {
  586. if (res.success) {
  587. this.expenseLoading = false
  588. this.expenseList = res.result
  589. resolve(res.result)
  590. } else {
  591. this.expenseLoading = false
  592. reject(res.message)
  593. }
  594. })
  595. })
  596. },
  597. overUpload(urlAll) {
  598. console.log(urlAll)
  599. },
  600. editProject(item) {
  601. this.getAction('/reimburse/project/queryById', { id: item.id }).then((res) => {
  602. if (res.success) {
  603. this.addType = 'edit'
  604. this.policyOperationStatus = true
  605. var data = res.result
  606. this.policyOperationForm = {
  607. amount: +data.amount,
  608. fileUrls: JSON.parse(data.fileUrls),
  609. id: data.id,
  610. invoices: data.invoices,
  611. project: data.project,
  612. remarks: data.remarks,
  613. statDate: moment(data.statDate),
  614. type: data.type,
  615. }
  616. } else {
  617. this.$message.error(res.message)
  618. }
  619. })
  620. },
  621. deleteProject(item) {
  622. this.getAction('/reimburse/project/delete', { id: item.id }).then((res) => {
  623. if (res.success) {
  624. let index = this.expenseIds.indexOf(item.id)
  625. this.expenseIds.splice(index, 1)
  626. this.getExpenseList(this.expenseIds)
  627. } else {
  628. this.$message.error(res.message)
  629. }
  630. })
  631. },
  632. // 新增费用确定按钮
  633. handlePolicyOperationSure() {
  634. console.log(this.policyOperationForm)
  635. var paramsData = { ...this.policyOperationForm }
  636. paramsData.statDate = moment(paramsData.statDate).format('YYYY-MM')
  637. paramsData.fileUrls = JSON.stringify(paramsData.fileUrls)
  638. this.$refs.policyOperationForm.validate((valid) => {
  639. if (valid) {
  640. this.confirmLoading = true
  641. if (this.addType === 'add') {
  642. this.handleAddSureBtn(paramsData, '/reimburse/project/add')
  643. } else {
  644. this.handleAddSureBtn(paramsData, '/reimburse/project/edit')
  645. }
  646. } else {
  647. return false
  648. }
  649. })
  650. },
  651. handleAddSureBtn(data, url) {
  652. postAction(url, data)
  653. .then((result) => {
  654. if (result.code === 200) {
  655. this.$message.success(result.message)
  656. this.handlePolicyOperationCancel()
  657. this.expenseIds.push(result.result)
  658. this.getExpenseList(this.expenseIds)
  659. } else {
  660. this.$message.error(result.message)
  661. }
  662. })
  663. .catch((error) => {
  664. console.log(error, 'eeee')
  665. })
  666. .finally(() => {
  667. this.confirmLoading = false
  668. })
  669. },
  670. // 新增费用取消按钮
  671. handlePolicyOperationCancel() {
  672. this.policyOperationForm = {}
  673. this.policyOperationStatus = false
  674. },
  675. handleSubmit() {
  676. this.form.validateFields((err, values) => {
  677. if (!err) {
  678. console.log(values)
  679. let params = {}
  680. params.userId = this.userInfo().id
  681. params.departId = values.departId
  682. params.media = values.media
  683. params.statDate = moment(values.statDate).format('YYYY-MM')
  684. params.companyId = values.companyId.key
  685. params.companyName = values.companyId.label.replace(/[\r\n]/g, '').trim()
  686. params.ids = JSON.stringify(this.expenseIds)
  687. if (this.$route.query.type == 'edit') {
  688. params.loginId = this.userInfo().id
  689. params.id = this.$route.query.id
  690. this.postDataAction('/reimburse/apply/edit', params).then((res) => {
  691. if (res.success) {
  692. this.$message.success(res.message)
  693. }else {
  694. this.$message.error(res.message)
  695. }
  696. })
  697. } else {
  698. this.postDataAction('/reimburse/apply/add', params).then((res) => {
  699. if (res.success) {
  700. this.$message.success(res.message)
  701. } else {
  702. this.$message.error(res.message)
  703. }
  704. })
  705. }
  706. }
  707. })
  708. },
  709. editStatusOpen(item) {
  710. this.rejectVisible = true
  711. this.rejectId = item.id
  712. },
  713. auditDescriptionOk() {
  714. if (!!this.auditDescription) {
  715. var params = {}
  716. params.id = this.rejectId
  717. params.auditDescription = this.auditDescription
  718. params.status = 0
  719. this.postDataAction('/reimburse/project/edit', params).then((res) => {
  720. if (res.success) {
  721. this.getExpenseList(this.expenseIds)
  722. } else {
  723. this.$message.error(res.message)
  724. }
  725. })
  726. } else {
  727. this.$message.error('请填写驳回理由')
  728. }
  729. },
  730. refuse() {
  731. var params = {}
  732. params.loginId = this.userInfo().id
  733. params.userId = this.lookData.userId
  734. params.id = this.$route.query.id
  735. params.status = 3
  736. this.postDataAction('/reimburse/apply/edit', params).then((res) => {
  737. if (res.success) {
  738. this.$message.error(res.message)
  739. } else {
  740. this.$message.error(res.message)
  741. }
  742. })
  743. },
  744. bfOk() {
  745. var params = {}
  746. params.loginId = this.userInfo().id
  747. params.userId = this.lookData.userId
  748. params.id = this.$route.query.id
  749. params.status = 5
  750. this.postDataAction('/reimburse/apply/edit', params).then((res) => {
  751. if (res.success) {
  752. this.$message.error(res.message)
  753. } else {
  754. this.$message.error(res.message)
  755. }
  756. })
  757. },
  758. allOk() {
  759. var params = {}
  760. params.loginId = this.userInfo().id
  761. params.userId = this.lookData.userId
  762. params.id = this.$route.query.id
  763. params.status = 2
  764. this.postDataAction('/reimburse/apply/edit', params).then((res) => {
  765. if (res.success) {
  766. this.$message.error(res.message)
  767. } else {
  768. this.$message.error(res.message)
  769. }
  770. })
  771. },
  772. },
  773. }
  774. </script>
  775. <style lang="less" scoped>
  776. @import 'policy-management';
  777. </style>