index.jsx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. import React, { Component } from "react";
  2. import Taro, { getCurrentInstance } from "@tarojs/taro";
  3. import { Text, View, Picker, Button, Image } from "@tarojs/components";
  4. import ImagePicker from "../../components/common/imagePicker";
  5. import InquiryModal from "../../components/common/inquiryModal";
  6. import AuditModal from "../../components/common/auditModal";
  7. import AccountModal from "../../components/common/accountModal";
  8. import {
  9. getPridDetail,
  10. getAccountList,
  11. selectList,
  12. AccountExamine,
  13. getMainExpenseDetail,
  14. getDepartmentList,
  15. subMainAccount,
  16. } from "../../utils/servers/servers";
  17. import {
  18. getAccountName,
  19. getSecondaryAccountName,
  20. getTypeName,
  21. getVehicleName,
  22. commonAdd,
  23. copyText,
  24. getNewOptions,
  25. removeNull,
  26. } from "../../utils/tools";
  27. import {
  28. AtTextarea,
  29. AtButton,
  30. AtIcon,
  31. AtModal,
  32. AtModalHeader,
  33. AtModalContent,
  34. AtRadio,
  35. AtModalAction,
  36. } from "taro-ui";
  37. import { resourceAddress } from "../../utils/config";
  38. import Reviewed from '../../image/reviewed.png'
  39. import Rejected from '../../image/rejected.png'
  40. import Passed from '../../image/passed.png'
  41. import "taro-ui/dist/style/components/form.scss";
  42. import "taro-ui/dist/style/components/button.scss";
  43. import "taro-ui/dist/style/components/loading.scss";
  44. import "taro-ui/dist/style/components/icon.scss";
  45. import "taro-ui/dist/style/components/textarea.scss";
  46. import "taro-ui/dist/style/components/input.scss";
  47. import "./index.less";
  48. class Drafts extends Component {
  49. $instance = getCurrentInstance();
  50. constructor(props) {
  51. super(props);
  52. this.state = {
  53. data: {},
  54. list: [],
  55. total: 0,
  56. accountvisible: "",
  57. bankData: {},
  58. upaccount: false,
  59. accountsList: [],
  60. reason: "",
  61. visible: false,
  62. };
  63. }
  64. componentDidMount() {
  65. this.getDepartmentList()
  66. this.$instance.router.params && this.$instance.router.params.id &&
  67. (
  68. this.getDetail()
  69. // this.getAccountList(),
  70. // this.getMyList()
  71. )
  72. }
  73. componentDidShow() {
  74. let pages = Taro.getCurrentPages();
  75. let currPage = pages[pages.length - 1]; // 获取当前页面
  76. const { data } = this.state
  77. const obj = {
  78. buyerName: currPage.data.name || data.buyerName,
  79. orderNo: currPage.data.orderNo || data.orderNo,
  80. contractNo: currPage.data.contractNo || data.contractNo,
  81. }
  82. this.setState({
  83. data: { ...this.state.data, ...obj },
  84. })
  85. }
  86. // 部门数据
  87. getDepartmentList() {
  88. getDepartmentList({}).then(v => {
  89. let thedata = v.data;
  90. let theArr = [];
  91. if (!thedata) {
  92. if (v.error && v.error.length) {
  93. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  94. }
  95. } else {
  96. thedata.map(function (item, index) {
  97. theArr.push({
  98. key: index,
  99. name: item.name,
  100. id: item.id
  101. });
  102. });
  103. }
  104. this.setState({
  105. departmentArr: theArr
  106. });
  107. }).catch(() => {
  108. Taro.showToast({
  109. title: '系统错误,请稍后再试',
  110. icon: 'none'
  111. })
  112. })
  113. }
  114. // 报销账户列表
  115. getMyList(sta) {
  116. let data1 = { status: 1 }
  117. let data2 = {
  118. pageNo: 1,
  119. pageSize: 99,
  120. }
  121. selectList(sta ? data2 : data1).then(v => {
  122. if (v.error.length === 0) {
  123. let list = v.data.list || []
  124. if (list?.length > 0) {
  125. if (sta) {
  126. this.setState({
  127. accountsList: list
  128. })
  129. } else {
  130. let obj = {
  131. name: list[0].name,
  132. bank: list[0].bank,
  133. accounts: list[0].accounts,
  134. eaaid: list[0].id,
  135. }
  136. this.setState({
  137. data: { ...this.state.data, ...obj },
  138. })
  139. }
  140. }
  141. } else {
  142. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  143. }
  144. }).catch(() => {
  145. Taro.showToast({
  146. title: '系统错误,请稍后再试',
  147. icon: 'none'
  148. })
  149. })
  150. }
  151. // 详情
  152. getDetail() {
  153. getMainExpenseDetail({
  154. id: this.$instance.router.params.id,
  155. }).then(v => {
  156. if (v.error.length === 0) {
  157. this.setState({
  158. data: v.data,
  159. })
  160. v.data.status == 0 && this.getMyList()
  161. } else {
  162. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  163. }
  164. }).catch(() => {
  165. Taro.showToast({
  166. title: '系统错误,请稍后再试',
  167. icon: 'none'
  168. })
  169. })
  170. }
  171. getUrls(url) {
  172. let list = [];
  173. for (let i of (url || '').split(',')) {
  174. if (i) {
  175. list.push({ 'url': resourceAddress + i })
  176. }
  177. }
  178. return list
  179. }
  180. // 报销详情金额列表
  181. getAccountList() {
  182. getAccountList({
  183. eaid: this.$instance.router.params.id,
  184. }).then(v => {
  185. if (v.error.length === 0) {
  186. let sum = 0
  187. for (var i = 0; i < v.data.length; i++) {
  188. // sum += v.data[i].amount
  189. sum = commonAdd(sum, v.data[i].amount)
  190. }
  191. this.setState({
  192. list: v.data,
  193. total: sum,
  194. })
  195. } else {
  196. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  197. }
  198. }).catch(() => {
  199. Taro.showToast({
  200. title: '系统错误,请稍后再试',
  201. icon: 'none'
  202. })
  203. })
  204. }
  205. // 审批
  206. examine(val) {
  207. Taro.showLoading({ title: '处理中...' });
  208. AccountExamine({
  209. id: this.state.data.id,
  210. reason: this.state.reason,
  211. status: val,
  212. })
  213. .then((v) => {
  214. Taro.hideLoading();
  215. if (v.error.length === 0) {
  216. Taro.showToast({
  217. title: "操作成功",
  218. icon: "none",
  219. });
  220. Taro.navigateBack({
  221. delta: 1
  222. })
  223. // this.getDetail()
  224. } else {
  225. Taro.showToast({ title: v.error[0].message, icon: "none" });
  226. }
  227. })
  228. .catch((err) => {
  229. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  230. });
  231. }
  232. onSubmit(val) {
  233. this.setState({
  234. loading: true,
  235. });
  236. const { data } = this.state
  237. let comData = {
  238. id: data.id,
  239. orderNo: data.orderNo,
  240. applyDep: data.applyDep,
  241. payDep: data.payDep,
  242. eaaid: data.eaaid,
  243. remarks: data.remarks,
  244. status: val
  245. }
  246. let comData1 = {
  247. id: data.id,
  248. status: val
  249. }
  250. subMainAccount(removeNull(val == 4 ? comData1 : comData))
  251. .then((v) => {
  252. this.setState({
  253. loading: false,
  254. })
  255. if (v.error.length === 0) {
  256. Taro.showToast({
  257. title: "操作成功!",
  258. icon: "none",
  259. });
  260. // Taro.switchTab({
  261. // url: "/pages/recordlist/index",
  262. // });
  263. Taro.navigateBack({
  264. delta: 1
  265. })
  266. } else {
  267. Taro.showToast({
  268. title: v.error[0].message,
  269. icon: "none",
  270. });
  271. }
  272. })
  273. .catch(() => {
  274. this.setState({
  275. loading: false,
  276. });
  277. });
  278. }
  279. // 取消添加
  280. onAccountClose() {
  281. this.setState({
  282. accountvisible: "",
  283. })
  284. }
  285. // 添加收款账户
  286. onAccountOk() {
  287. this.setState({
  288. accountvisible: "",
  289. }, () => { this.getMyList() })
  290. }
  291. // 确认收款账户
  292. selectOn() {
  293. let list = this.state.accountsList
  294. for (var i = 0; i < list.length; i++) {
  295. if (list[i].id == this.state.aid) {
  296. const obj = {
  297. eaaid: list[i].id,
  298. name: list[i].name,
  299. bank: list[i].bank,
  300. accounts: list[i].accounts,
  301. }
  302. this.setState({
  303. upaccount: false,
  304. data: { ...this.state.data, ...obj },
  305. })
  306. }
  307. }
  308. }
  309. render() {
  310. const { data, } = this.state
  311. const departmentArr = this.state.departmentArr || [];
  312. const isEdit = data.status == 0 && data.processStatus == 0
  313. return (
  314. <View className="subform">
  315. {/* <View className="title">
  316. {getAccountName(data.type, data.typeOther)}
  317. </View> */}
  318. {<View className="formItem">
  319. <View className="formName">报销编号:</View>
  320. <View className="formValue">{data.checkNo}</View>
  321. <View className='tbt'
  322. onClick={e => { e.stopPropagation(); copyText(data.checkNo) }}
  323. >复制编号</View>
  324. </View>}
  325. {/* <View className="formItem">
  326. <View className="formName" >总金额:</View>
  327. <View className="formValue">{data.totalAmount}元</View>
  328. </View> */}
  329. <View className="formItem">
  330. <View className="formName">报销至订单:</View>
  331. <View className="formValue"
  332. onClick={() => {
  333. isEdit &&
  334. Taro.navigateTo({
  335. url: "/pages/dataindex/index"
  336. })
  337. }}>
  338. <View>
  339. <View>{data.contractNo}</View>
  340. </View>
  341. {isEdit && <AtIcon value="chevron-right" size="20" color="#000000" />}
  342. </View>
  343. </View>
  344. <View className="formItem">
  345. <View className="formName">报销时间:</View>
  346. <View className="formValue">{data.createTimeStr}</View>
  347. </View>
  348. <View className="formTitle">
  349. {"报销详细"}
  350. <Image className="ficon"
  351. src={data.status == 1
  352. ? Reviewed : data.status == 2
  353. ? Passed : data.status == 3 && Rejected}
  354. />
  355. </View>
  356. <View className="formItem">
  357. <View className="formName">申请人:</View>
  358. <View className="formValue">{data.aname}</View>
  359. </View>
  360. <View className="formItem">
  361. <View className="formName">报销公司:</View>
  362. {isEdit ?
  363. <View className="formValue">
  364. <Picker
  365. value={departmentArr.findIndex(item => item.id === data.applyDep)}
  366. range={departmentArr} rangeKey='name' mode='selector'
  367. onChange={(e) => {
  368. const obj = { applyDep: departmentArr[e.detail.value].id, applyDepName: departmentArr[e.detail.value].name }
  369. this.setState({
  370. data: { ...data, ...obj },
  371. })
  372. }}>
  373. <View>
  374. {data.applyDepName}
  375. <AtIcon value="chevron-right" size="20" color="#000000" />
  376. </View>
  377. </Picker>
  378. </View> :
  379. <View className="formValue">{data.applyDepName}</View>}
  380. </View>
  381. <View className="formItem">
  382. <View className="formName">支付公司:</View>
  383. {isEdit ?
  384. <View className="formValue">
  385. <Picker
  386. value={departmentArr.findIndex(item => item.id === data.payDep)}
  387. range={departmentArr} rangeKey='name' mode='selector'
  388. onChange={(e) => {
  389. const obj = { payDep: departmentArr[e.detail.value].id, payDepName: departmentArr[e.detail.value].name }
  390. this.setState({
  391. data: { ...data, ...obj },
  392. })
  393. }}>
  394. <View>
  395. {data.payDepName}
  396. <AtIcon value="chevron-right" size="20" color="#000000" />
  397. </View>
  398. </Picker>
  399. </View> :
  400. <View className="formValue">{data.payDepName}</View>}
  401. </View>
  402. <View className="formItem">
  403. <View className="formName">
  404. 报销事由:
  405. </View>
  406. {isEdit ?
  407. <View className="formValues">
  408. <AtTextarea
  409. value={data.remarks == null ? "" : data.remarks}
  410. onChange={e => {
  411. const obj = { remarks: e }
  412. this.setState({
  413. data: { ...data, ...obj }
  414. })
  415. }}
  416. height={75}
  417. maxLength={50}
  418. placeholder={(data.type == 4 || data.type == 5) ? "请填写说明:" : "请填写报销事由"}
  419. />
  420. </View> :
  421. <View className="formValueremarks">{data.remarks}</View>}
  422. </View>
  423. <View className="formTitle">
  424. 报销费用详细
  425. </View>
  426. {
  427. data.sonList?.map((it) =>
  428. <View key={it.id} style={{ borderTop: "1px solid #eae8e8" }}>
  429. <View className="formItem" style={{ fontWeight: "bold" }}>
  430. <View className="formName">报销金额:</View>
  431. <View className="formValue">{it.amount}(元)</View>
  432. </View>
  433. <View className="formItem" style={{ fontWeight: "bold" }}>
  434. <View className="formName">报销类型:</View>
  435. <View className="formValue">
  436. {getAccountName(it.type, it.typeOther)}
  437. {it.type == 2 && (" - " + getSecondaryAccountName(it.secondaryType, it.secondaryTypeOther))}
  438. </View>
  439. </View>
  440. {it.type == 1 &&
  441. <View className="formItem">
  442. <View className="formName">公出企业:</View>
  443. <View className="formValue">{it.userNames}</View>
  444. </View>}
  445. <View className="formItem">
  446. <View className="formName">{it.type == 1 ? "公出时间" : "费用时间"}:</View>
  447. <View className="formValue">
  448. {!it.releaseStart ? "" : (it.releaseStart.slice(0, 10) + " 至 " + it.releaseEnd.slice(0, 10))}
  449. </View>
  450. </View>
  451. {/* 差旅费显示 */}
  452. {it.type == 1 &&
  453. it.detList?.map(item =>
  454. item.type == 1
  455. ? <View className="unItem" key={item.id}>
  456. <View className="formItem">
  457. <View className="formName">交通费:</View>
  458. <View className="formValue">
  459. {getVehicleName(item.vehicle, item.vehicleOther)}
  460. ({item.startDistrict + " - " + item.endDistrict})
  461. {item.amount}(元)
  462. </View>
  463. </View>
  464. </View>
  465. : <View className="unItem" key={item.id}>
  466. <View className="formItem" key={item.id}>
  467. <View className="formName" >{getTypeName(item.type) + ":"}</View>
  468. <View className="formValue">{item.amount}(元)</View>
  469. </View>
  470. </View>
  471. )
  472. }
  473. {/* 通用 */}
  474. {(it.type == 0 || it.type == 2 || it.type == 4 || it.type == 5) &&
  475. it.detList?.map(item =>
  476. <View className="unItem" key={item.id}>
  477. {!!item.agreeTimeStr &&
  478. <View className="formItem">
  479. <View className="formName">{it.type == 5 ? "支付时间:" : "需付款时间:"}</View>
  480. <View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
  481. </View>}
  482. <View className="formItem">
  483. <View className="formName">
  484. {it.type == 4
  485. ? "预借支金额:" : it.type == 5
  486. ? "抵扣金额:" : "金额:"}
  487. </View>
  488. <View className="formValue">{item.amount}(元)</View>
  489. </View>
  490. </View>
  491. )
  492. }
  493. {/* 第三方付款 */}
  494. {it.type == 3 &&
  495. it.detList?.map(item =>
  496. <View className="unItem" key={item.id}>
  497. {!!item.agreeTimeStr &&
  498. <View className="formItem">
  499. <View className="formName">需付款时间:</View>
  500. <View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
  501. </View>}
  502. <View className="formItem">
  503. <View className="formName">付款方式:</View>
  504. <View className="formValue">{["公对公转账"][item.payType]}</View>
  505. </View>
  506. <View className="formItem">
  507. <View className="formName">发票类型:</View>
  508. <View className="formValue">{["普票", "专票"][item.invoiceType]}</View>
  509. </View>
  510. <View className="formItem">
  511. <View className="formName">发票号:</View>
  512. <View className="formValue">{item.invoiceNo}</View>
  513. </View>
  514. <View className="formItem">
  515. <View className="formName">付款单位:</View>
  516. <View className="formValue">{item.payerName}</View>
  517. </View>
  518. <View className="formItem">
  519. <View className="formName">开户银行:</View>
  520. <View className="formValue">{item.openBank}</View>
  521. </View>
  522. <View className="formItem">
  523. <View className="formName">银行账户:</View>
  524. <View className="formValue">{item.bankAccounts}</View>
  525. </View>
  526. <View className="formItem">
  527. <View className="formName">开户行地址:</View>
  528. <View className="formValue">{item.openBankAddress}</View>
  529. </View>
  530. <View className="formItem">
  531. <View className="formName">金额:</View>
  532. <View className="formValue">{item.amount}(元)</View>
  533. </View>
  534. </View>
  535. )
  536. }
  537. {
  538. it.settlementAmount != 0 && it.type != 4 && it.type != 5 &&
  539. <View className="formItem">
  540. <View className="formName">抵扣金额:</View>
  541. <View className="formValue">{it.settlementAmount}(元)</View>
  542. </View>
  543. }
  544. <View className="formItem" style={{ display: "block", paddingBottom: 0 }}>
  545. <View className="formName">附件:</View>
  546. <View
  547. className="formValue"
  548. style={{ paddingTop: "10px", textAlign: "left" }}
  549. >
  550. {this.getUrls(it.attachmentUrl) && this.getUrls(it.attachmentUrl).length > 0 &&
  551. <ImagePicker
  552. files={this.getUrls(it.attachmentUrl)}
  553. showAddBtn={false}
  554. />}
  555. </View>
  556. </View>
  557. </View>
  558. )
  559. }
  560. {
  561. data.type != 4 && data.debitTotalAmount &&
  562. <View className="formItem">
  563. <View className="formName">预借支:</View>
  564. <View className="formValue"><Text style={{ color: "red" }}>{data.debitTotalAmount}</Text>(元)</View>
  565. </View>
  566. }
  567. {/* {
  568. data.type != 4 && data.type != 5 &&
  569. <View className="formItem">
  570. <View className="formName">总金额:</View>
  571. <View className="formValue"><Text style={{ color: "red" }}>{data.totalAmount}</Text>(元)</View>
  572. </View>
  573. } */}
  574. {
  575. data.type != 4 && data.type != 5 &&
  576. <View className="formItem" style={{ fontWeight: "bold" }}>
  577. <View className="formName">本次报销金额:</View>
  578. <View className="formValue"><Text style={{ color: "red" }}>{data.amount}</Text>(元)</View>
  579. </View>
  580. }
  581. <View className="formTitle" style={{ marginTop: "20px" }}>
  582. 报销账户
  583. </View>
  584. <View className="unobstructedList" style={{ marginBottom: "20px" }}>
  585. {
  586. !data.eaaid && isEdit ?
  587. <View className="noAccout"
  588. onClick={() => { this.setState({ accountvisible: true }) }}>
  589. 暂未有收款账户
  590. <View className="nbt">去添加 &gt;</View>
  591. </View> :
  592. <View className="unItem" >
  593. {isEdit &&
  594. <View className="edit"
  595. onClick={() => {
  596. this.setState({
  597. upaccount: true,
  598. // aid: bankData.id,
  599. }, () => {
  600. this.getMyList(true)
  601. })
  602. }}
  603. >修改</View>}
  604. <View className="formItem">
  605. <View className="formName">收款人:{data.name}</View>
  606. </View>
  607. <View className="formItem">
  608. <View className="formName">收款银行:{data.bank}</View>
  609. </View>
  610. <View className="formItem">
  611. <View className="formName">收款账户:{data.accounts}</View>
  612. </View>
  613. </View>
  614. }
  615. </View>
  616. {
  617. data.status != 0 &&
  618. <View
  619. className="select"
  620. onClick={(e) => {
  621. e.stopPropagation();
  622. this.setState({
  623. visible: true,
  624. id: data.id
  625. });
  626. }}
  627. >
  628. 查看审核详情
  629. <AtIcon value="chevron-right" size="20" color="#fff" />
  630. </View>
  631. }
  632. {
  633. data.examine == 1 &&
  634. <View>
  635. <View className="formTitle" style={{ marginTop: "20px" }}>
  636. 填写审批意见
  637. </View>
  638. <AtTextarea
  639. value={this.state.reason}
  640. onChange={(value) => {
  641. this.setState({
  642. reason: value,
  643. });
  644. }}
  645. maxLength={30}
  646. placeholder="请填写审批意见"
  647. />
  648. <View className="operation">
  649. <AtButton
  650. type="secondary"
  651. circle
  652. loading={this.state.loading}
  653. onClick={() => {
  654. if (!this.state.reason) {
  655. Taro.showToast({ title: "请先填写审批意见", icon: "none" });
  656. return;
  657. }
  658. this.setState({
  659. isInquiryOpened: true,
  660. inquiryTitle: "提醒",
  661. inquiryContent: "您确定要驳回此申请吗?",
  662. inquiryFn: () => {
  663. this.examine(3);
  664. },
  665. });
  666. }}
  667. >
  668. 驳回
  669. </AtButton>
  670. <AtButton
  671. type="primary"
  672. loading={this.state.loading}
  673. circle
  674. onClick={() => {
  675. if (!this.state.reason) {
  676. Taro.showToast({ title: "请先填写审批意见", icon: "none" });
  677. return;
  678. }
  679. this.setState({
  680. isInquiryOpened: true,
  681. inquiryTitle: "提醒",
  682. inquiryContent: "您确定要同意此申请吗?",
  683. inquiryFn: () => {
  684. this.examine(1);
  685. },
  686. });
  687. }}
  688. >
  689. 同意
  690. </AtButton>
  691. </View>
  692. </View>
  693. }
  694. {
  695. isEdit &&
  696. <View className="bottom">
  697. <AtButton
  698. disabled={this.state.loading}
  699. type="primary"
  700. circle
  701. onClick={() => {
  702. this.onSubmit(1)
  703. }}
  704. >
  705. 提交报销订单
  706. </AtButton>
  707. </View>
  708. }
  709. {
  710. data.examine == 2 && data.status == 3 &&
  711. <View className="bottom">
  712. <AtButton
  713. className="bt"
  714. disabled={this.state.loading}
  715. type="primary"
  716. circle
  717. onClick={() => {
  718. this.setState({
  719. isInquiryOpened: true,
  720. inquiryTitle: "提醒",
  721. inquiryContent: "您确定取消该报销订单吗?",
  722. inquiryFn: () => {
  723. this.onSubmit(4);
  724. },
  725. });
  726. }}
  727. >
  728. 取消报销订单
  729. </AtButton>
  730. <View className="btips">注:取消后,请重新发起报销</View>
  731. </View>
  732. }
  733. {/* 收款账户添加 */}
  734. {
  735. this.state.accountvisible != "" &&
  736. <AccountModal
  737. isDefault={true}
  738. isSub={true}
  739. visible={this.state.accountvisible}
  740. onClose={this.onAccountClose.bind(this)}
  741. onOk={this.onAccountOk.bind(this)}
  742. />
  743. }
  744. {/* 收款账户列表 */}
  745. <AtModal isOpened={this.state.upaccount}>
  746. <AtModalHeader>请选择收款账户</AtModalHeader>
  747. <AtModalContent>
  748. <AtRadio
  749. options={getNewOptions(this.state.accountsList)}
  750. value={this.state.aid}
  751. onClick={e => { this.setState({ aid: e }) }}
  752. />
  753. </AtModalContent>
  754. <AtModalAction>
  755. <Button type='secondary' onClick={() => { this.setState({ upaccount: false, accountsList: [] }) }}>取消</Button>
  756. <Button type='primary' onClick={() => { this.selectOn() }}>确定</Button>
  757. </AtModalAction>
  758. </AtModal>
  759. {/* 二级确认弹窗 */}
  760. <InquiryModal
  761. isOpened={this.state.isInquiryOpened}
  762. title={this.state.inquiryTitle}
  763. content={this.state.inquiryContent}
  764. onClose={() => {
  765. this.setState({
  766. isInquiryOpened: false,
  767. inquiryTitle: "",
  768. inquiryContent: "",
  769. isNo: true,
  770. });
  771. }}
  772. onDetermine={() => {
  773. this.state.inquiryFn();
  774. this.setState({
  775. isInquiryOpened: false,
  776. inquiryTitle: "",
  777. inquiryContent: "",
  778. isNo: true,
  779. inquiryFn: () => { },
  780. });
  781. }}
  782. />
  783. {/* 审核详情 */}
  784. {this.state.visible &&
  785. <AuditModal
  786. id={this.state.id}
  787. isOpened={this.state.visible}
  788. onClose={() => {
  789. this.setState({
  790. visible: false
  791. })
  792. }}
  793. />}
  794. </View>
  795. );
  796. }
  797. }
  798. export default Drafts;