index.jsx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. import React, { Component } from 'react';
  2. import Taro from '@tarojs/taro';
  3. import { View, Picker, ScrollView, Button } from '@tarojs/components'
  4. import {
  5. getPublicReleaseList,
  6. techReject,
  7. getReleasetDails,
  8. publicAssistAdvice,
  9. publicAssistAdviceList
  10. } from '../../utils/servers/servers';
  11. import dayjs from 'dayjs';
  12. import {
  13. AtSearchBar,
  14. AtTabs,
  15. AtTabsPane,
  16. AtIcon,
  17. AtModal,
  18. AtModalHeader,
  19. AtModalContent,
  20. AtModalAction,
  21. AtTextarea,
  22. } from 'taro-ui';
  23. import { clockState } from '../../utils/tools/config';
  24. import './index.less';
  25. import 'taro-ui/dist/style/components/tabs.scss';
  26. import "taro-ui/dist/style/components/flex.scss";
  27. import "taro-ui/dist/style/components/action-sheet.scss";
  28. import "taro-ui/dist/style/components/icon.scss";
  29. import "taro-ui/dist/style/components/list.scss";
  30. import "taro-ui/dist/style/components/modal.scss";
  31. import MyList from '../examine/myList';
  32. import MessageNoticebar from "../../components/common/messageNoticebar";
  33. import InquiryModal from "../../components/common/inquiryModal";
  34. import PublicContent from "../egressDetails/publicContent";
  35. import { resourceAddress } from "../../utils/config";
  36. import { getUserByName } from "../../utils/servers/servers";
  37. class Examine extends Component {
  38. constructor(props) {
  39. super(props);
  40. this.state = {
  41. typeList: [
  42. { title: '我的公出' },
  43. { title: '我的协单' }],
  44. current: 0,
  45. isPickerRender: false,
  46. validDates: '',
  47. list: [],
  48. pageNo: 1,
  49. listState: 'LOADING',
  50. starts: {},
  51. clockInStarts: '',
  52. rangeEndVal: '',
  53. rangeStartVal: '',
  54. rangeEndMinuteVal: '',
  55. rangeStartMinuteVal: '',
  56. id: "",
  57. rmk: "",
  58. isOpen: false,
  59. coorderPublic: [
  60. { title: '非公出协单', type: 9 },
  61. { title: '公出协单', type: 8 },
  62. { title: '全部', type: 0 }],
  63. coorder: [
  64. { title: '非公出协单', type: 10 },
  65. { title: '协单助手', type: 3 },
  66. { title: '技术协单', type: 2 },
  67. { title: '全部', type: 4 }],
  68. selcotype: 4,
  69. isOpinion: false,
  70. opinion: [],
  71. isFill: true,
  72. }
  73. this.getPublicReleaseList = this.getPublicReleaseList.bind(this);
  74. this.getMyList = this.getMyList.bind(this);
  75. this.onSetPickerTime = this.onSetPickerTime.bind(this);
  76. this.onPickerHide = this.onPickerHide.bind(this);
  77. this.getReleasetDails = this.getReleasetDails.bind(this);
  78. }
  79. componentDidShow() {
  80. Taro.eventCenter.on('listOperation', (data) => {
  81. if (!isNaN(parseInt(data.index))) {
  82. let arr = this.state.list.concat([]);
  83. arr[data.index] = {
  84. ...arr[data.index],
  85. ...data
  86. }
  87. this.setState({
  88. list: arr
  89. })
  90. }
  91. })
  92. //获取地区选定数据
  93. const chooseLocation = requirePlugin("chooseLocation");
  94. const location = chooseLocation.getLocation();
  95. if (location) {
  96. this.setState({
  97. selectArrderLocation: location,
  98. });
  99. }
  100. this.getPublicReleaseList();
  101. }
  102. async componentDidMount() {
  103. await this.getPublicReleaseList();
  104. }
  105. onPullDownRefresh() {
  106. this.getPublicReleaseList();
  107. }
  108. onReachBottom() {
  109. this.getPublicReleaseList(true);
  110. }
  111. onTabItemTap(obj) {
  112. if (obj.index === 1) {
  113. this.onTabTap();
  114. }
  115. }
  116. onPickerHide() {
  117. this.setState({
  118. isPickerRender: false,
  119. });
  120. }
  121. // 公出详情
  122. getReleasetDails(id, callback) {
  123. getReleasetDails({
  124. id: id
  125. }).then((v) => {
  126. if (v.error.length === 0) {
  127. if (v.data) {
  128. let list = [];
  129. for (let i of v.data.annexUrl.split(",")) {
  130. if (i) {
  131. list.push({ url: resourceAddress + i });
  132. }
  133. }
  134. v.data.annexUrl = list;
  135. this.setState({
  136. dtails: v.data,
  137. selectArrderLocation: {
  138. longitude: parseFloat(v.data.prdList[0]?.longitude),
  139. latitude: parseFloat(v.data.prdList[0]?.latitude),
  140. name: v.data.prdList[0]?.districtName,
  141. },
  142. }, () => {
  143. callback && callback();
  144. })
  145. }
  146. } else {
  147. Taro.showToast({ title: v.error[0].message, icon: "none" });
  148. }
  149. }).catch((err) => {
  150. // Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  151. });
  152. }
  153. async onSetPickerTime(val) {
  154. let data = val.detail;
  155. await this.setState({
  156. rangeStartMinuteVal: dayjs(data.selectStartTime).format("YYYY-MM-DD"),
  157. rangeEndMinuteVal: dayjs(data.selectEndTime).format("YYYY-MM-DD")
  158. })
  159. await this.getMyList(1);
  160. }
  161. async onTabTap() {
  162. await this.getMyList(1);
  163. }
  164. async getPublicReleaseList(lv) {
  165. await this.getMyList(lv ? this.state.pageNo + 1 : 1);
  166. Taro.stopPullDownRefresh();
  167. }
  168. async getMyList(pageNo) {
  169. this.setState({
  170. listState: 'LOADING'
  171. })
  172. let data = {
  173. pageNo: pageNo,
  174. pageSize: 10,
  175. type: '0',
  176. assist: this.state.current === 0 ? 0 : this.state.selcotype,
  177. releaseStarts: this.state.rangeStartMinuteVal || undefined,
  178. releaseEnds: this.state.rangeEndMinuteVal || undefined,
  179. status: isNaN(parseInt(this.state.starts.id)) ? undefined : String(this.state.starts.id),
  180. clockIn: this.state.clockInStarts || undefined,
  181. userName: this.state.searchValue || undefined,
  182. }
  183. for (let i in data) {
  184. if (!data[i]) {
  185. delete data[i]
  186. }
  187. }
  188. let msg = await getPublicReleaseList(data);
  189. if (msg.error.length === 0) {
  190. if (msg.data.totalCount === 0) {
  191. this.setState({
  192. listState: 'NO_DATA'
  193. })
  194. } else if (msg.data.totalCount === this.state.list.length && pageNo !== 1) {
  195. // 防止提示挡住驳回弹窗
  196. !this.state.isOpen && Taro.showToast({ title: '没有更多数据了', icon: 'none' });
  197. this.setState({
  198. listState: 'NO_MORE_DATA'
  199. })
  200. } else {
  201. if (msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list)).length) {
  202. this.setState({
  203. listState: 'NO_MORE_DATA'
  204. })
  205. }
  206. }
  207. this.setState({
  208. list: pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list),
  209. pageNo: msg.data.list.length === 0 ? this.state.pageNo : msg.data.pageNo
  210. })
  211. } else {
  212. Taro.showToast({ title: msg.error[0].message, icon: 'none' });
  213. this.setState({
  214. listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
  215. })
  216. }
  217. Taro.stopPullDownRefresh();
  218. }
  219. onPageScroll(event) {
  220. let touchMove = event.scrollTop;
  221. if (touchMove >= 37) {
  222. this.setState({
  223. openSearch: true
  224. })
  225. } else {
  226. this.setState({
  227. openSearch: false
  228. })
  229. }
  230. }
  231. submit() {
  232. if (!this.state.rmk) {
  233. Taro.showToast({ title: '请填写备注!', icon: 'none' });
  234. return
  235. }
  236. Taro.showLoading({ title: '正在提交...' });
  237. techReject({
  238. id: this.state.id,
  239. remarks: this.state.rmk,
  240. }).then(v => {
  241. Taro.hideLoading()
  242. if (v.error.length === 0) {
  243. Taro.showToast({ title: '提交成功', icon: 'none' });
  244. this.getPublicReleaseList();
  245. this.setState({
  246. isOpen: false,
  247. rmk: "",
  248. })
  249. } else {
  250. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  251. }
  252. }).catch(() => {
  253. Taro.hideLoading()
  254. Taro.showToast({
  255. title: '系统错误,请稍后再试',
  256. icon: 'none'
  257. })
  258. })
  259. }
  260. onOpinion() {
  261. if (!this.state.remarks) {
  262. Taro.showToast({ title: '请填写协单意见!', icon: 'none' });
  263. return
  264. }
  265. Taro.showLoading({ title: '正在提交...' });
  266. publicAssistAdvice({
  267. prid: this.state.id,
  268. remarks: this.state.remarks,
  269. }).then(v => {
  270. Taro.hideLoading()
  271. if (v.error.length === 0) {
  272. Taro.showToast({ title: '填写成功', icon: 'none' });
  273. this.getPublicReleaseList();
  274. this.setState({
  275. isOpinion: false,
  276. remarks: "",
  277. })
  278. } else {
  279. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  280. }
  281. }).catch(() => {
  282. Taro.hideLoading()
  283. Taro.showToast({
  284. title: '系统错误,请稍后再试',
  285. icon: 'none'
  286. })
  287. })
  288. }
  289. publicAssistAdviceList(t, obj) {
  290. publicAssistAdviceList({
  291. id: obj.id,
  292. type: t == "我的公出" ? 1 : 0,
  293. }).then(v => {
  294. if (v.error.length === 0) {
  295. this.setState({
  296. info: obj,
  297. opinion: v.data,
  298. isOpinion: true,
  299. isFill: t == "我的协单" ? true : false
  300. })
  301. } else {
  302. Taro.showToast({ title: v.error[0].message, icon: 'none' })
  303. }
  304. }).catch(() => {
  305. Taro.hideLoading()
  306. Taro.showToast({
  307. title: '系统错误,请稍后再试',
  308. icon: 'none'
  309. })
  310. })
  311. }
  312. getUserInfoByName(name, callback) {
  313. getUserByName({
  314. name,
  315. type: 1,
  316. pageNo: 1,
  317. pageSize: 10,
  318. }).then(res => {
  319. if (!res.error.length) {
  320. callback && callback(res.data.list)
  321. } else {
  322. Taro.showToast({title: "系统异常,请联系管理员!", icon: "none"});
  323. }
  324. })
  325. }
  326. render() {
  327. const { coorderPublic, current, coorder } = this.state
  328. const currCoorderList = current == 0 ? coorderPublic : coorder
  329. return (
  330. <View className='indexPage' >
  331. <MessageNoticebar />
  332. <View className='searchContent'>
  333. <View className='searchTop'>
  334. <AtSearchBar
  335. showActionButton
  336. placeholder='请输入企业/渠道'
  337. value={this.state.searchValue}
  338. onActionClick={() => {
  339. this.getPublicReleaseList();
  340. }}
  341. onChange={(value) => {
  342. this.setState({
  343. searchValue: value
  344. })
  345. }}
  346. onClear={() => {
  347. this.setState({
  348. searchValue: ''
  349. })
  350. }}
  351. />
  352. </View>
  353. <ScrollView className={this.state.openSearch ? 'searchBottomLOL' : ''} scrollX style={{ width: '100%' }}>
  354. <View className='searchBottom'>
  355. <View className='searchItem' style={{ paddingLeft: '5px' }}>
  356. <Picker
  357. value={this.state.starts.id}
  358. range={clockState} rangeKey='title' mode='selector'
  359. onChange={(e) => {
  360. this.setState({
  361. starts: clockState[e.detail.value],
  362. }, () => {
  363. this.getPublicReleaseList();
  364. })
  365. }}>
  366. {
  367. !this.state.starts.title ?
  368. <View className='shortValuecontent'>
  369. <View className='selectTitle'>审核状态</View>
  370. <View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
  371. </View> :
  372. <View className='shortValuecontent'>
  373. <View className='selectValue'>
  374. {this.state.starts.title}
  375. </View>
  376. <View className='iconContent' />
  377. </View>
  378. }
  379. </Picker>
  380. {
  381. this.state.starts.title &&
  382. <View className='searchSelectContent'>
  383. <View className='selectIcon'
  384. onClick={(e) => {
  385. e.stopPropagation();
  386. this.setState({
  387. starts: {}
  388. }, () => {
  389. this.getPublicReleaseList();
  390. })
  391. }}>
  392. <AtIcon value='close-circle' size='10' color='#FFFFFF' />
  393. </View>
  394. </View>
  395. }
  396. </View>
  397. <View className='searchItem' >
  398. <Picker
  399. value={this.state.clockInStarts}
  400. range={['未打卡', '已打卡', '异常打卡']}
  401. mode='selector'
  402. onChange={(e) => {
  403. this.setState({
  404. clockInStarts: String(e.detail.value)
  405. }, () => {
  406. this.getPublicReleaseList();
  407. })
  408. }}>
  409. {
  410. !this.state.clockInStarts ?
  411. <View className='shortValuecontent'>
  412. <View className='selectTitle'>打卡状态</View>
  413. <View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
  414. </View> :
  415. <View className='shortValuecontent'>
  416. <View className='selectValue'>
  417. {
  418. this.state.clockInStarts === '2'
  419. ? '异常打卡' : this.state.clockInStarts === '1'
  420. ? '已打卡' : this.state.clockInStarts === '0'
  421. ? '未打卡' : ''
  422. }
  423. </View>
  424. <View className='iconContent' />
  425. </View>
  426. }
  427. </Picker>
  428. {
  429. this.state.clockInStarts ?
  430. <View className='searchSelectContent'>
  431. <View className='selectIcon'
  432. onClick={(e) => {
  433. e.stopPropagation();
  434. this.setState({
  435. clockInStarts: '',
  436. }, () => {
  437. this.getPublicReleaseList();
  438. })
  439. }}>
  440. <AtIcon value='close-circle' size='10' color='#FFFFFF' />
  441. </View>
  442. </View> : null
  443. }
  444. </View>
  445. {/* */}
  446. {/* 多选时间框 */}
  447. <View className='searchItem' onClick={() => {
  448. this.setState({
  449. isPickerRender: true
  450. })
  451. }}>
  452. <View>
  453. {
  454. !this.state.rangeStartMinuteVal ?
  455. <View className='valuecontent' style={{ width: '200px' }}>
  456. <View className='selectTitle' style={{ paddingLeft: '50px' }}>开始及结束时间</View>
  457. <View className='iconContent' style={{ paddingLeft: '20px' }}><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
  458. </View> :
  459. <View className='valuecontent' style={{ width: '200px' }}>
  460. <View className='selectValue' >
  461. {this.state.rangeStartMinuteVal + "~" + this.state.rangeEndMinuteVal}
  462. </View>
  463. <View className='iconContent' />
  464. </View>
  465. }
  466. </View>
  467. {
  468. this.state.rangeStartMinuteVal &&
  469. <View className='searchSelectContent'>
  470. <View className='selectIcon'
  471. onClick={(e) => {
  472. e.stopPropagation();
  473. this.setState({
  474. rangeStartMinuteVal: '',
  475. rangeEndMinuteVal: '',
  476. }, () => {
  477. this.getPublicReleaseList();
  478. })
  479. }}>
  480. <AtIcon value='close-circle' size='10' color='#FFFFFF' />
  481. </View>
  482. </View>
  483. }
  484. </View>
  485. </View>
  486. </ScrollView>
  487. </View>
  488. <AtTabs
  489. swipeable={false}
  490. current={this.state.current || 0}
  491. tabList={this.state.typeList}
  492. onClick={(current) => {
  493. this.setState({
  494. list: [],
  495. pageNo: 1,
  496. current,
  497. selcotype: 4,
  498. }, () => {
  499. this.getPublicReleaseList();
  500. })
  501. }}>
  502. {
  503. this.state.typeList?.map((item, index) =>
  504. <AtTabsPane
  505. current={this.state.current}
  506. index={index}
  507. >
  508. <View className='navs'>
  509. {
  510. currCoorderList.map((it) =>
  511. <View className={this.state.selcotype == it.type ? 'nitems' : 'nitem'}
  512. key={it.type}
  513. onClick={() => {
  514. this.setState({
  515. list: [],
  516. pageNo: 1,
  517. selcotype: it.type,
  518. }, () => {
  519. this.getPublicReleaseList();
  520. })
  521. }}
  522. >{it.title}</View>
  523. )
  524. }
  525. </View>
  526. <MyList
  527. type={0}
  528. title={item.title}
  529. typelist={this.state.typeList}
  530. seeView={this.state.current}
  531. list={this.state.list}
  532. listState={this.state.listState}
  533. onRefresh={() => {
  534. this.getPublicReleaseList(true);
  535. }}
  536. opens={e => {
  537. this.setState({
  538. id: e,
  539. isOpen: true,
  540. })
  541. }}
  542. again={e => {
  543. if (e.userNames && e.userNames.split(',').length > 1) {
  544. Taro.showToast({ title: "公出企业包含多个,不能再次公出!", icon: "none" });
  545. return;
  546. }
  547. this.getReleasetDails(e.id, () => {
  548. this.setState({
  549. isInquiryOpened: true,
  550. inquiryTitle: "温馨提示",
  551. inquiryContent: "您确定需再次公出拜访同一家企业吗?",
  552. inquiryFn: () => {
  553. },
  554. });
  555. })
  556. }}
  557. opinion={(t, e) => {
  558. this.publicAssistAdviceList(t, e)
  559. this.setState({
  560. id: e.id,
  561. });
  562. }}
  563. />
  564. </AtTabsPane>
  565. )
  566. }
  567. </AtTabs>
  568. <timePicker
  569. config={{
  570. endDate: true,
  571. column: "day",
  572. dateLimit: false,
  573. limitStartTime: dayjs().subtract(3, 'year').format('YYYY-MM-DD '),
  574. limitEndTime: dayjs().add(3, 'year').format('YYYY-MM-DD ')
  575. }}
  576. isPartition
  577. pickerShow={this.state.isPickerRender}
  578. onconditionaljudgment={(v) => {
  579. // let a = dayjs(dayjs(v.detail.endTime).second(0).format('YYYY-MM-DD'));
  580. // let b = dayjs(dayjs().second(0).format('YYYY-MM-DD'))
  581. // if(a.isBefore(b)){
  582. // Taro.showToast({
  583. // title:'结束时间不能小于当前时间',
  584. // icon:'none'
  585. // })
  586. // v.detail.setLv(false);
  587. // }
  588. }}
  589. onhidepicker={() => {
  590. this.onPickerHide()
  591. }}
  592. onsetpickertime={(v) => {
  593. this.onSetPickerTime(v)
  594. }}>
  595. </timePicker>
  596. {/* 驳回协单 */}
  597. {
  598. this.state.isOpen &&
  599. <AtModal
  600. isOpened={this.state.isOpen}
  601. >
  602. <AtModalContent>
  603. <AtTextarea
  604. value={this.state.rmk}
  605. onChange={e => {
  606. this.setState({ rmk: e })
  607. }}
  608. maxLength={200}
  609. placeholder='请填写备注~'
  610. />
  611. </AtModalContent>
  612. <AtModalAction>
  613. <Button type='secondary' onClick={() => { this.setState({ isOpen: false }) }}>取消</Button>
  614. <Button type='primary' onClick={this.submit.bind(this)}>提交</Button>
  615. </AtModalAction>
  616. </AtModal>
  617. }
  618. {/* 再次公出申请 */}
  619. {
  620. this.state.isInquiryOpened &&
  621. <InquiryModal
  622. isOpened={this.state.isInquiryOpened}
  623. title={this.state.inquiryTitle}
  624. content={this.state.inquiryContent}
  625. color="black"
  626. isNo={this.state.isNo}
  627. onClose={() => {
  628. this.setState({
  629. isInquiryOpened: false,
  630. dtails: {},
  631. inquiryTitle: "",
  632. inquiryContent: "",
  633. isNo: true,
  634. });
  635. }}
  636. onDetermine={() => {
  637. const data = this.state.dtails;
  638. let prdData = data.prdList[0];
  639. this.getUserInfoByName(prdData.userName, userList => {
  640. let currUserInfo = userList.find(item => item.id === prdData.uid);
  641. if (currUserInfo && currUserInfo.shareType === 1) {
  642. Taro.showToast({title: "无法发起,公共库客户请领取,再进行公出", icon: "none"});
  643. this.setState({ isInquiryOpened: false });
  644. return;
  645. }
  646. const customerList = data.prdList.map(item => {
  647. return { id: item.uid, aid: data.aid, aname: data.aname, name: item.userName, myUser: currUserInfo.myUser }
  648. })
  649. Taro.setStorageSync('publicInfo', {
  650. type: data.type,
  651. customerList,
  652. orderNo: data.orderNo,
  653. contractNo: data.contractNo
  654. })
  655. Taro.switchTab({
  656. url: `/pages/applyDepart/index`
  657. });
  658. this.setState({
  659. // isModifyOpened: true,
  660. isInquiryOpened: false,
  661. inquiryTitle: "",
  662. inquiryContent: "",
  663. isNo: true,
  664. inquiryFn: () => { },
  665. });
  666. });
  667. }}
  668. />
  669. }
  670. {/* 再次公出详情 */}
  671. {
  672. this.state.isModifyOpened &&
  673. <AtModal
  674. isOpened={this.state.isModifyOpened}
  675. onClose={() => {
  676. this.setState({
  677. isModifyOpened: false,
  678. dtails: {},
  679. })
  680. }}
  681. >
  682. <AtModalContent>
  683. <PublicContent
  684. again={true}
  685. onClose={() => {
  686. this.setState({
  687. isModifyOpened: false,
  688. dtails: {},
  689. })
  690. }}
  691. locationInfor={this.state.selectArrderLocation}
  692. dtails={this.state.dtails}
  693. isOpened={this.state.isModifyOpened}
  694. />
  695. </AtModalContent>
  696. </AtModal>
  697. }
  698. {/* 填写协单意见 */}
  699. {
  700. this.state.isOpinion &&
  701. <AtModal
  702. isOpened={this.state.isOpinion}
  703. >
  704. <AtModalHeader>公出企业-协单意见</AtModalHeader>
  705. <AtModalContent>
  706. <View style={{ margin: "0 0 10px", color: "#6190E8" }}>{this.state.info.userNames}</View>
  707. {
  708. this.state.isFill &&
  709. <AtTextarea
  710. value={this.state.remarks}
  711. onChange={e => {
  712. this.setState({ remarks: e })
  713. }}
  714. maxLength={200}
  715. placeholder='请填写协单意见~'
  716. />
  717. }
  718. <View className='historicalClock'>
  719. {
  720. this.state.opinion.length > 0
  721. ? this.state.opinion.map(item =>
  722. <View key={item.id} className='item'>
  723. <View className='head'>
  724. <View className='spot' />
  725. <View className='clockTime' style={{ color: "#6190E8" }}>
  726. {item.aname}
  727. </View>
  728. </View>
  729. <View className='clockContent'>
  730. <View className='verticalLine' />
  731. <View className='rightContent'>
  732. <View className='contentItem'>
  733. <AtIcon className='atIcon' value='clock' size='15' color='#999999' />
  734. 操作时间:{item.createTime}
  735. </View>
  736. <View className='contentItem'>
  737. <AtIcon className='atIcon' value='message' size='15' color='#999999' />
  738. 评价:{item.remarks || "暂无"}
  739. </View>
  740. </View>
  741. </View>
  742. </View>
  743. )
  744. : <View style={{ textAlign: "center" }}>暂无协单意见</View>
  745. }
  746. </View>
  747. </AtModalContent>
  748. {
  749. this.state.isFill
  750. ? <AtModalAction>
  751. <Button type='secondary' onClick={() => { this.setState({ isOpinion: false }) }}>取消</Button>
  752. <Button type='primary' onClick={this.onOpinion.bind(this)}>确定</Button>
  753. </AtModalAction>
  754. : <AtModalAction>
  755. <Button type='secondary' onClick={() => { this.setState({ isOpinion: false }) }}>确定</Button>
  756. </AtModalAction>
  757. }
  758. </AtModal>
  759. }
  760. </View>
  761. )
  762. }
  763. }
  764. export default Examine