index.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. import React, { Component } from "react";
  2. import { View, Image, Button, Text } from "@tarojs/components";
  3. import Taro, { getCurrentInstance } from "@tarojs/taro";
  4. import {
  5. AtButton,
  6. AtCalendar,
  7. AtIcon,
  8. AtTextarea,
  9. AtModal,
  10. AtModalContent,
  11. AtModalAction,
  12. } from "taro-ui";
  13. import Skeleton from "taro-skeleton";
  14. import InquiryModal from "../../components/common/inquiryModal";
  15. import Modify from "./modify";
  16. import {
  17. examinePublicRelease,
  18. getReleasetDails,
  19. updatePublicRelease,
  20. addAssistant,
  21. deleteAssistant,
  22. checkOrderNoDuration,
  23. getRestrictProjectUser,
  24. } from "../../utils/servers/servers";
  25. import { resourceAddress } from "../../utils/config";
  26. import "./index.less";
  27. import "taro-ui/dist/style/components/icon.scss";
  28. import "taro-ui/dist/style/components/textarea.scss";
  29. import "taro-ui/dist/style/components/modal.scss";
  30. import "taro-ui/dist/style/components/timeline.scss";
  31. import "taro-ui/dist/style/components/icon.scss";
  32. import "taro-ui/dist/style/components/calendar.scss";
  33. import Rejected from "../../image/rejected.png";
  34. import Passed from "../../image/passed.png";
  35. import Reviewed from "../../image/reviewed.png";
  36. import Wx from "../../image/wx.png";
  37. import Revoke from "../../image/revoke.png";
  38. import ImagePicker from "../../components/common/imagePicker";
  39. import MessageNoticebar from "../../components/common/messageNoticebar";
  40. import { getClockState, unique, getUids } from "../../utils/tools";
  41. import HistoricalClock from "../../components/historicalClock";
  42. import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
  43. class EgressDetails extends Component {
  44. $instance = getCurrentInstance();
  45. constructor(props) {
  46. super(props);
  47. this.state = {
  48. dtails: {},
  49. opinion: "",
  50. publicReleaseLog: [],
  51. isDetailedOpened: false,
  52. isModifyOpened: false,
  53. reasonsInvalidation: "",
  54. isVerify: false, //判断是否在审核中修改
  55. selectArrderLocation: {},
  56. current: "",
  57. isNo: true,
  58. foc: false,
  59. coorderList: [],
  60. cList: [],
  61. popup: false,
  62. selid: "",
  63. userList: [],
  64. };
  65. this.examinePublicRelease = this.examinePublicRelease.bind(this);
  66. this.getReleasetDails = this.getReleasetDails.bind(this);
  67. this.oidApplication = this.oidApplication.bind(this);
  68. }
  69. componentDidMount() {
  70. this.setState({
  71. current: this.$instance.router.params.status || "",
  72. sonType: this.$instance.router.params.sonType || "",
  73. });
  74. this.getReleasetDails();
  75. if (!this.isLogin()) {
  76. Taro.setStorageSync('currentPage', `/pages/egressDetails/index?id=${this.$instance.router.params.id}`)
  77. }
  78. }
  79. isLogin() {
  80. return !!Taro.getStorageSync('userInfor');
  81. }
  82. componentDidShow() {
  83. //获取地区选定数据
  84. const chooseLocation = requirePlugin("chooseLocation");
  85. const location = chooseLocation.getLocation();
  86. if (location) {
  87. this.setState({
  88. selectArrderLocation: location,
  89. });
  90. }
  91. }
  92. getRestrictProjectUser() {
  93. const { dtails } = this.state
  94. getRestrictProjectUser({
  95. ids: dtails.uids,
  96. })
  97. .then((v) => {
  98. if (v.error.length === 0) {
  99. this.setState({
  100. userList: v.data,
  101. isModifyOpened: true,
  102. isVerify: true,
  103. foc: false,
  104. })
  105. } else {
  106. Taro.showToast({
  107. title: v.error[0].message,
  108. icon: "none",
  109. });
  110. }
  111. })
  112. .catch((err) => {
  113. });
  114. }
  115. getReleasetDails() {
  116. getReleasetDails({
  117. id: this.$instance.router.params.id,
  118. })
  119. .then((v) => {
  120. if (v.error.length === 0) {
  121. if (v.data) {
  122. let list = [];
  123. for (let i of v.data.annexUrl.split(",")) {
  124. if (i) {
  125. list.push({ url: resourceAddress + i });
  126. }
  127. }
  128. v.data.annexUrl = list;
  129. this.setState({
  130. dtails: v.data,
  131. coorderList: v.data.assistantName != null && v.data.assistantName != "" ? v.data.assistantName.split(",") : [],
  132. cList: v.data.assistantAid != null && v.data.assistantName != "" ? v.data.assistantAid.split(",") : [],
  133. selectArrderLocation: {
  134. longitude: parseFloat(v.data.prdList[0]?.longitude),
  135. latitude: parseFloat(v.data.prdList[0]?.latitude),
  136. name: v.data.prdList[0]?.districtName,
  137. },
  138. });
  139. } else {
  140. setTimeout(() => {
  141. Taro.switchTab({
  142. url: "/pages/punchClock/index",
  143. });
  144. }, 1800);
  145. Taro.showToast({
  146. title: "您没有权限查看此公出详情",
  147. icon: "none",
  148. duration: 1800,
  149. });
  150. }
  151. } else {
  152. Taro.showToast({ title: v.error[0].message, icon: "none" });
  153. }
  154. })
  155. .catch((err) => {
  156. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  157. // console.log(err);
  158. });
  159. }
  160. // 同意/驳回
  161. agree(sta) {
  162. if (!this.state.opinion) {
  163. Taro.showToast({ title: "请填写审批意见", icon: "none" });
  164. return;
  165. }
  166. getReleasetDails({
  167. id: this.$instance.router.params.id,
  168. })
  169. .then((v) => {
  170. if (v.error.length === 0) {
  171. //如果在审核期间修改过
  172. if (
  173. v.data.updateTime != null &&
  174. this.state.dtails.updateTime !== v.data.updateTime
  175. ) {
  176. this.setState({
  177. isInquiryOpened: true,
  178. isNo: false,
  179. inquiryTitle: "提醒",
  180. inquiryContent: "当前公出申请已修改,请重新审核",
  181. });
  182. } else {
  183. sta === 2
  184. ? this.examinePublicRelease(2)
  185. : this.examinePublicRelease(0);
  186. }
  187. if (v.data) {
  188. let list = [];
  189. for (let i of v.data.annexUrl.split(",")) {
  190. if (i) {
  191. list.push({ url: resourceAddress + i });
  192. }
  193. }
  194. v.data.annexUrl = list;
  195. this.setState({
  196. dtails: v.data,
  197. selectArrderLocation: {
  198. longitude: parseFloat(v.data.prdList[0]?.longitude),
  199. latitude: parseFloat(v.data.prdList[0]?.latitude),
  200. name: v.data.prdList[0]?.districtName,
  201. },
  202. });
  203. } else {
  204. setTimeout(() => {
  205. Taro.switchTab({
  206. url: "/pages/punchClock/index",
  207. });
  208. }, 1800);
  209. Taro.showToast({
  210. title: "您没有权限查看此公出详情",
  211. icon: "none",
  212. duration: 1800,
  213. });
  214. }
  215. } else {
  216. Taro.showToast({ title: v.error[0].message, icon: "none" });
  217. }
  218. })
  219. .catch((err) => {
  220. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  221. // console.log(err);
  222. });
  223. }
  224. examinePublicRelease(status) {
  225. if (!this.state.opinion) {
  226. Taro.showToast({ title: "请填写审批意见", icon: "none" });
  227. return;
  228. }
  229. // Taro.showLoading({ title: "加载中..." });
  230. let isSuperior = this.state.current == "他人公出"
  231. ? (this.state.sonType == 4 ? 2 : this.state.sonType == 5 && 3)
  232. : this.state.current == "协单审核" ? 4
  233. : 1
  234. examinePublicRelease(
  235. isSuperior,
  236. {
  237. status,
  238. remarks: this.state.opinion,
  239. id: this.state.dtails.id,
  240. }
  241. )
  242. .then((v) => {
  243. Taro.hideLoading();
  244. if (v.error.length === 0) {
  245. Taro.showToast({
  246. title: "操作成功",
  247. icon: "none",
  248. });
  249. this.getReleasetDails();
  250. } else {
  251. Taro.showToast({ title: v.error[0].message, icon: "none" });
  252. }
  253. })
  254. .catch(() => {
  255. Taro.hideLoading();
  256. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  257. });
  258. }
  259. onShareAppMessage() {
  260. return {
  261. title:
  262. this.state.dtails.status === 3
  263. ? this.state.dtails.aname +
  264. "撤销了前往" +
  265. this.state.dtails.prdList[0]?.districtName +
  266. "的公出"
  267. : this.state.dtails.aname + "将要去" + this.state.dtails.prdList[0]?.districtName,
  268. path: "pages/egressDetails/index?id=" + this.$instance.router.params.id,
  269. };
  270. }
  271. oidApplication() {
  272. if (!this.state.reasonsInvalidation) {
  273. Taro.showToast({ title: "请填写撤销原因", icon: "none" });
  274. return;
  275. }
  276. this.setState({
  277. loading: true,
  278. });
  279. updatePublicRelease({
  280. id: this.$instance.router.params.id,
  281. status: 3,
  282. uids: this.state.dtails.uids,
  283. reason: this.state.reasonsInvalidation,
  284. })
  285. .then((v) => {
  286. this.setState({
  287. loading: false,
  288. });
  289. if (v.error.length === 0) {
  290. Taro.showToast({
  291. title: "修改成功",
  292. });
  293. this.setState({
  294. isInquiryOpened: false,
  295. inquiryTitle: "",
  296. inquiryContent: "",
  297. }, () => {
  298. this.getReleasetDails();
  299. });
  300. Taro.eventCenter.trigger("listOperation", {
  301. type: this.state.dtails.permission,
  302. index: this.$instance.router.params.index,
  303. status: 3,
  304. });
  305. } else {
  306. Taro.showToast({
  307. title: v.error[0].message,
  308. icon: "none",
  309. });
  310. }
  311. })
  312. .catch(() => {
  313. this.setState({
  314. loading: false,
  315. });
  316. });
  317. }
  318. // 弹窗开关
  319. popupClick(id) {
  320. !this.state.popup &&
  321. this.setState({
  322. selid: id
  323. })
  324. this.setState({
  325. popup: !this.state.popup
  326. })
  327. }
  328. //增加协单助力
  329. addA(aid) {
  330. const { selid } = this.state
  331. addAssistant({
  332. id: selid,
  333. aid,
  334. }).then((v) => {
  335. if (v.error.length === 0) {
  336. this.popupClick();
  337. this.getReleasetDails();
  338. } else {
  339. Taro.showToast({ title: v.error[0].message, icon: "none" });
  340. }
  341. }).catch((err) => {
  342. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  343. });
  344. }
  345. //删除协单助力
  346. deleteA(id, aid) {
  347. Taro.showLoading({
  348. title: '操作中...'
  349. })
  350. deleteAssistant({
  351. id,
  352. aid,
  353. }).then((v) => {
  354. Taro.hideLoading();
  355. if (v.error.length === 0) {
  356. this.getReleasetDails();
  357. } else {
  358. Taro.showToast({ title: v.error[0].message, icon: "none" });
  359. }
  360. }).catch((err) => {
  361. Taro.hideLoading();
  362. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  363. });
  364. }
  365. // 技术公出逻辑判断
  366. checkOrderNoDuration() {
  367. const _this = this
  368. checkOrderNoDuration({
  369. id: this.state.dtails.id,
  370. duration: this.state.dtails.duration,
  371. orderNo: this.state.dtails.orderNo,
  372. })
  373. .then((v) => {
  374. if (v.error.length == 0) {
  375. if (!v.data.code) {
  376. let obj = v.data.data
  377. _this.setState({
  378. isNewshow: true,
  379. isInquiryOpened: true,
  380. inquiryTitle: "提醒",
  381. inquiryContent: <View style={{ padding: "10px 15px" }}>
  382. <View><Text style={{ color: 'red' }}>{obj.publicReleaseName}</Text>准备公出<Text style={{ color: 'red' }}>{obj.userName}({obj.contractNo})</Text>,</View>
  383. <View>总计公出:<Text style={{ color: 'red' }}>{obj.peopleCount}人,{obj.timesCount}次,{obj.durationCount}时</Text>。</View>
  384. <View>
  385. <Text style={{ color: 'red' }}>
  386. {obj.amountName},{obj.amountType}
  387. </Text>。
  388. </View>
  389. <View>请确认是否同意本次公出?</View>
  390. </View>,
  391. inquiryFn: () => {
  392. _this.agree(2);
  393. },
  394. })
  395. } else {
  396. _this.setState({
  397. isNewshow: false,
  398. isInquiryOpened: true,
  399. inquiryTitle: "提醒",
  400. inquiryContent: "您确定要同意此申请吗?",
  401. inquiryFn: () => {
  402. _this.agree(2);
  403. },
  404. })
  405. }
  406. }
  407. })
  408. .catch(() => {
  409. this.setState({
  410. loading: false,
  411. });
  412. });
  413. }
  414. render() {
  415. const { dtails, current, cList, coorderList, popup } = this.state;
  416. return (
  417. <View className="egressDetails">
  418. <MessageNoticebar />
  419. <View
  420. className="titleContent"
  421. style={{
  422. padding: Object.keys(dtails).length === 0 ? "0 30px" : "20px 30px",
  423. }}
  424. >
  425. {Object.keys(dtails).length === 0 ? (
  426. <Skeleton
  427. title
  428. row={3}
  429. animateName="elastic"
  430. avatarShape="square"
  431. loading
  432. />
  433. ) : (
  434. <View>
  435. <View className="title">
  436. {dtails.type === 3 ? dtails.mainName : dtails.aname}提交的公出申请
  437. {dtails.updateStatus == 1 && <View className="titRight">改</View>}
  438. </View>
  439. <View className="address">申请时间: {dtails.createTimes}</View>
  440. <View
  441. className="state"
  442. style={{
  443. color: getClockState(dtails.status).color,
  444. }}
  445. >
  446. {getClockState(dtails.status).title}
  447. </View>
  448. {
  449. !!dtails.adminExamine && dtails.adminExamine.split(',')?.map(item =>
  450. <View style={{ fontSize: "15px", color: "#007AFF" }}>{item}</View>
  451. )
  452. }
  453. <View></View>
  454. <Image
  455. src={
  456. dtails.status === 0
  457. ? Rejected : dtails.status === 1
  458. ? Reviewed : dtails.status === 2
  459. ? Passed : dtails.status === 3
  460. ? Revoke : dtails.status === 4
  461. ? Rejected : ""
  462. }
  463. className="startIcon"
  464. />
  465. </View>
  466. )}
  467. </View>
  468. {Object.keys(dtails).length === 0 ? (
  469. <View style={{ margin: "20px" }}>
  470. <Skeleton title row={3} avatarShape="square" loading />
  471. </View>
  472. ) : (
  473. <View className="valueContent">
  474. {
  475. dtails.status != 3 && dtails.type == 3 && (current === "查看协单" || current === "我的协单")
  476. ? <View className="item">
  477. <View className="title" style={{ color: "red" }}>协单助手(助手无成本)</View>
  478. <View className="cassistant">
  479. {
  480. coorderList.length == 0
  481. ? <Text>无</Text>
  482. : coorderList.map((item, index) =>
  483. <View className="citems" key={index}>
  484. {item}
  485. <View className="cclose"
  486. onClick={() => {
  487. this.setState({
  488. isInquiryOpened: true,
  489. inquiryTitle: "温馨提示",
  490. inquiryContent: "您确定要移除此协单助手吗?",
  491. inquiryFn: () => {
  492. this.deleteA(dtails.id, cList[index])
  493. },
  494. });
  495. }}
  496. ><AtIcon value="close-circle" size="15" color="#bbbbbb" /></View>
  497. </View>
  498. )
  499. }
  500. {cList.length < 5 && <Button className="addbuttom" type='primary' onClick={this.popupClick.bind(this, dtails.id)}>添加协单助手</Button>}
  501. </View>
  502. </View>
  503. : coorderList.length != 0 &&
  504. <View className="item">
  505. <View className="title" style={{ color: "red" }}>协单助手(助手无成本)</View>
  506. <View className="cassistant">
  507. {
  508. coorderList.map((item, index) =>
  509. <View className="citems" style={{ paddingRight: 0 }} key={index}>
  510. {item}
  511. </View>
  512. )
  513. }
  514. </View>
  515. </View>
  516. }
  517. <View className="item">
  518. <View className="title">
  519. 公出地点:
  520. {current !== "审核" && dtails.permission === 0
  521. && dtails.type !== 3 && dtails.type !== 4 ? (
  522. <View
  523. className="edit"
  524. onClick={() => {
  525. Taro.pageScrollTo({ selector: "#reasons" })
  526. this.setState({
  527. foc: true,
  528. });
  529. }}
  530. >
  531. <View style={{ color: "#3864ef", fontSize: "15px" }}>
  532. 修改
  533. <AtIcon value="edit" size="18" color="#3864ef" />
  534. </View>
  535. </View>
  536. ) : null}
  537. </View>
  538. <View className="value">
  539. {/* {dtails.districtName} */}
  540. {
  541. unique(dtails.prdList, "districtName")?.map((item, index) =>
  542. <View key={index}>{item.districtName}</View>
  543. )
  544. }
  545. </View>
  546. <View className="timeContent">
  547. <View className="time">
  548. <View className="num">公出{dtails.duration}小时</View>
  549. <View
  550. className="journal"
  551. onClick={(e) => {
  552. e.stopPropagation();
  553. this.setState({
  554. isDetailedOpened: true,
  555. });
  556. }}
  557. >
  558. 明细
  559. </View>
  560. </View>
  561. <View className="timeAxis">
  562. <View className="startTime">
  563. <View className="circle" />
  564. {dtails.releaseStarts}
  565. </View>
  566. <View className="axis" />
  567. <View className="endTime">
  568. <View className="circle" />
  569. {dtails.releaseEnds}
  570. </View>
  571. </View>
  572. </View>
  573. </View>
  574. <AtModal
  575. onClose={() => {
  576. this.setState({
  577. isDetailedOpened: false,
  578. });
  579. }}
  580. isOpened={this.state.isDetailedOpened}
  581. >
  582. <AtModalContent>
  583. {dtails.validDate ? (
  584. <AtCalendar
  585. currentDate={JSON.parse(dtails.validDate)[0]["value"]}
  586. isSwiper={false}
  587. validDates={JSON.parse(dtails.validDate)}
  588. />
  589. ) : null}
  590. </AtModalContent>
  591. <AtModalAction>
  592. <Button
  593. onClick={() => {
  594. this.setState({
  595. isDetailedOpened: false,
  596. });
  597. }}
  598. >
  599. 确定
  600. </Button>
  601. </AtModalAction>
  602. </AtModal>
  603. <View className="item">
  604. <View className="title">公出类型</View>
  605. <View className="value">
  606. {dtails.type == 0
  607. ? "业务公出" : dtails.type == 1
  608. ? "技术公出" : dtails.type == 2
  609. ? "行政公出" : dtails.type == 3
  610. ? "技术协单" : dtails.type == 4
  611. ? "协单助手" : ""}
  612. </View>
  613. </View>
  614. {dtails.type == 1 ? (
  615. <View className="item">
  616. <View className="title">合同编号</View>
  617. <View className="value">{dtails.contractNo}</View>
  618. </View>
  619. ) : (
  620. ""
  621. )}
  622. <View className="item">
  623. <View className="title">公出企业</View>
  624. <View className="value">
  625. {/* {dtails.nickname} */}
  626. {
  627. !!dtails.userNames && dtails.userNames.indexOf(',') > -1
  628. ? dtails.userNames.split(',')?.map((item, index) => <View key={index}>{item}</View>)
  629. : dtails.userNames
  630. }
  631. </View>
  632. </View>
  633. {
  634. dtails.assistAidName != null && dtails.assistAidName != "" &&
  635. <View className="item">
  636. <View className="title" style={{ color: "red" }}>技术协单(技术协单,将统计相关的公出成本等)</View>
  637. <View className="value">{dtails.assistAidName.replace(/,/g, " ")}</View>
  638. </View>
  639. }
  640. {/* 公出目标 */}
  641. <View className="item">
  642. <View className="title">公出目标</View>
  643. <View className="value">{dtails.remarks}</View>
  644. </View>
  645. {/* 公出计划 */}
  646. {dtails.type != 2 && (
  647. <View className="item">
  648. <View className="title">公出计划</View>
  649. <View className="value">{dtails.plan}</View>
  650. </View>
  651. )}
  652. {/* 预计效果 */}
  653. {dtails.type != 2 && (
  654. <View className="item">
  655. <View className="title">预计效果</View>
  656. <View className="value">{dtails.expectedEffect}</View>
  657. </View>
  658. )}
  659. {dtails.annexUrl && dtails.annexUrl.length > 0 ? (
  660. <View className="item">
  661. <View className="title">附件</View>
  662. <View className="value">
  663. <ImagePicker files={dtails.annexUrl} showAddBtn={false} />
  664. </View>
  665. </View>
  666. ) : null}
  667. {((dtails.status === 1 && current === "协单审核" && dtails.myExamine === 0) ||
  668. (dtails.status === 1 && current === "审核" && dtails.assistProcess === 0) ||
  669. (dtails.status === 1 && current === "审核" && dtails.assistProcess === 1) ||
  670. (dtails.myExamine === 0 && current === "他人公出" && dtails.publicType == 1) ||
  671. (dtails.myExamine === 0 && current === "他人公出" && dtails.techStartProcess == 1)) &&
  672. <View className="item">
  673. <View className="title">
  674. 填写审批意见
  675. <View className="titleTips">
  676. 根据公出申请记录指导怎么沟通?并提出详细指导建议
  677. </View>
  678. </View>
  679. <AtTextarea
  680. value={this.state.opinion}
  681. onChange={(value) => {
  682. this.setState({
  683. opinion: value,
  684. });
  685. }}
  686. maxLength={20}
  687. placeholder="请填写审批意见"
  688. />
  689. <View className="operation">
  690. <AtButton
  691. type="secondary"
  692. circle
  693. loading={this.state.loading}
  694. onClick={() => {
  695. this.setState({
  696. isInquiryOpened: true,
  697. inquiryTitle: "提醒",
  698. inquiryContent: "您确定要驳回此申请吗?",
  699. inquiryFn: () => {
  700. this.agree(0);
  701. // this.examinePublicRelease(0);
  702. },
  703. });
  704. }}
  705. >
  706. 驳回
  707. </AtButton>
  708. <AtButton
  709. type="primary"
  710. loading={this.state.loading}
  711. circle
  712. onClick={() => {
  713. if (this.state.loading) {
  714. return;
  715. }
  716. dtails.type == 1
  717. ? this.checkOrderNoDuration()
  718. : this.setState({
  719. isInquiryOpened: true,
  720. inquiryTitle: "提醒",
  721. inquiryContent: "您确定要同意此申请吗?",
  722. inquiryFn: () => {
  723. this.agree(2);
  724. // this.examinePublicRelease(2);
  725. },
  726. });
  727. }}
  728. >
  729. 同意
  730. </AtButton>
  731. </View>
  732. </View>}
  733. {current !== "审核" && dtails.permission === 0
  734. && dtails.type !== 3 && dtails.type !== 4 ? (
  735. <View className="item" id={"reasons"}>
  736. <View className="title">修改/撤销</View>
  737. <AtTextarea
  738. value={this.state.reasonsInvalidation}
  739. focus={this.state.foc}
  740. onChange={(value) => {
  741. this.setState({
  742. reasonsInvalidation: value,
  743. });
  744. }}
  745. maxLength={20}
  746. placeholder="请填写修改或撤销的详细原因"
  747. />
  748. </View>
  749. ) : null}
  750. {current !== "审核" && dtails.permission === 0
  751. && dtails.type !== 3 && dtails.type !== 4 ? (
  752. <View className="operation">
  753. <Button
  754. type="warn"
  755. disabled={dtails.status === 3}
  756. loading={this.state.loading}
  757. onClick={() => {
  758. if (this.state.loading) {
  759. return;
  760. }
  761. this.setState({
  762. isInquiryOpened: true,
  763. inquiryTitle: "提醒",
  764. inquiryContent: dtails.assist == 1
  765. ? "请与技术协单同事协商后再修改,因未协商就个人修改公出内容,产生的影响由个人承担!"
  766. : "您确定要撤销此申请吗?",
  767. inquiryFn: () => {
  768. this.oidApplication();
  769. },
  770. });
  771. }}
  772. >
  773. 撤销申请
  774. </Button>
  775. <Button
  776. style={{ color: "#fff", background: "#4876FF" }}
  777. loading={this.state.loading}
  778. onClick={() => {
  779. if (this.state.loading) {
  780. return;
  781. }
  782. this.setState({
  783. isInquiryOpened: true,
  784. inquiryTitle: "提醒",
  785. inquiryContent: dtails.assist == 1
  786. ? "请与技术协单同事协商后再修改,因未协商就个人修改公出内容,产生的影响由个人承担!"
  787. : "您确定修改此公出申请吗?确定修改,已完成的审核,将自动解除,重新转化为待审核状态!!!",
  788. inquiryFn: () => {
  789. if (!this.state.reasonsInvalidation) {
  790. Taro.showToast({
  791. title: "请填写修改原因",
  792. icon: "none",
  793. });
  794. return;
  795. }
  796. this.getRestrictProjectUser()
  797. },
  798. });
  799. }}
  800. >
  801. 修改申请
  802. </Button>
  803. </View>
  804. ) : null}
  805. </View>
  806. )}
  807. {Object.keys(dtails).length === 0 ? (
  808. <View style={{ margin: "20px" }}>
  809. <Skeleton title row={3} avatarShape="square" loading />
  810. </View>
  811. ) : (
  812. <View
  813. className="valueContent history"
  814. onClick={(e) => {
  815. e.stopPropagation();
  816. this.setState({
  817. historicalIsOpened: true,
  818. });
  819. }}
  820. >
  821. 查看公出申请日志
  822. <AtIcon value="chevron-right" size="20" color="#767272" />
  823. </View>
  824. )}
  825. {Object.keys(dtails).length === 0 ? (
  826. <View style={{ margin: "20px" }}>
  827. <Skeleton title row={3} avatarShape="square" loading />
  828. </View>
  829. ) : (
  830. <View className="valueContent history">
  831. <View className="shareContent">
  832. <Button open-type="share" className="share">
  833. <Image src={Wx} className="shareIcon" />
  834. </Button>
  835. <View className="shareTitle">微信分享</View>
  836. </View>
  837. </View>
  838. )}
  839. {this.state.isModifyOpened ? (
  840. <Modify
  841. permission={dtails.permission}
  842. index={this.$instance.router.params.index}
  843. dtails={dtails}
  844. userList={this.state.userList}
  845. locationInfor={this.state.selectArrderLocation}
  846. id={this.$instance.router.params.id}
  847. isOpened={this.state.isModifyOpened}
  848. isVerify={this.state.isVerify}
  849. reason={this.state.reasonsInvalidation}
  850. onModalClose={() => {
  851. this.setState({
  852. isModifyOpened: false,
  853. });
  854. }}
  855. onClose={() => {
  856. this.setState(
  857. {
  858. isModifyOpened: false,
  859. dtails: {},
  860. reasonsInvalidation: "",
  861. },
  862. () => {
  863. this.getReleasetDails();
  864. }
  865. );
  866. }}
  867. />
  868. ) : null}
  869. <InquiryModal
  870. isOpened={this.state.isInquiryOpened}
  871. title={this.state.inquiryTitle}
  872. content={this.state.inquiryContent}
  873. color={this.state.isNo ? "black" : "red"}
  874. isNo={this.state.isNo}
  875. onClose={() => {
  876. this.setState({
  877. isInquiryOpened: false,
  878. inquiryTitle: "",
  879. inquiryContent: "",
  880. isNo: true,
  881. });
  882. }}
  883. onDetermine={() => {
  884. this.state.inquiryFn();
  885. this.setState({
  886. isInquiryOpened: false,
  887. inquiryTitle: "",
  888. inquiryContent: "",
  889. isNo: true,
  890. inquiryFn: () => { },
  891. });
  892. }}
  893. />
  894. {this.state.historicalIsOpened ? (
  895. <HistoricalClock
  896. id={this.$instance.router.params.id}
  897. isOpened={this.state.historicalIsOpened}
  898. onClose={() => {
  899. this.setState({
  900. historicalIsOpened: false,
  901. });
  902. }}
  903. />
  904. ) : null}
  905. {popup &&
  906. <UserQuery
  907. isOpened={popup}
  908. onDesc={this.popupClick.bind(this)}
  909. coorderList={cList}
  910. selList={dtails.assistAid ? dtails.assistAid.split(",") : []}
  911. req={true}
  912. addClick={this.addA.bind(this)}
  913. />
  914. }
  915. </View>
  916. );
  917. }
  918. }
  919. export default EgressDetails;