dev01 2 years ago
parent
commit
b2d08e8bde

+ 168 - 0
src/components/common/accountModal/index.jsx

@@ -0,0 +1,168 @@
+import React, { Component } from "react";
+import Taro from "@tarojs/taro";
+import { View, Button } from "@tarojs/components";
+import { AtInput, AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
+import { addAccount, editAccount } from '../../../utils/servers/servers';
+
+import "taro-ui/dist/style/components/modal.scss";
+
+class AccountModal extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      data: {},
+    }
+  }
+
+  componentDidMount() {
+    const { data = {} } = this.props
+    this.setState({
+      data
+    })
+  }
+
+  // 新增||修改 账户
+  onSubmit(type, status) {
+    const { data } = this.state
+    const { onClose, isSub = false, onOk } = this.props
+    if (!data.name) {
+      Taro.showToast({ title: '请填写账户姓名!', icon: 'none' });
+      return
+    }
+    if (!data.bank) {
+      Taro.showToast({ title: '请填写银行名称!', icon: 'none' });
+      return
+    }
+    if (!data.openBank) {
+      Taro.showToast({ title: '请填写开户银行!', icon: 'none' });
+      return
+    }
+    if (!data.accounts) {
+      Taro.showToast({ title: '请填写银行账户!', icon: 'none' });
+      return
+    }
+    var num = /^\d*$/
+    if (data.accounts.length < 16 || data.accounts.length > 19 || !num.test(data.accounts)) {
+      Taro.showToast({ title: '请填写正确的银行账户!', icon: 'none' });
+      return
+    }
+    Taro.showLoading({ title: '保存中...' });
+    type == "edit"
+      ? editAccount({
+        id: data.id,
+        bank: data.bank,
+        openBank: data.openBank,
+        accounts: data.accounts,
+        name: data.name,
+        status,
+      }).then(v => {
+        Taro.hideLoading()
+        if (v.error.length === 0) {
+          Taro.showToast({ title: '保存成功', icon: 'none' });
+          onClose();
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: 'none' })
+        }
+      }).catch(() => {
+        Taro.hideLoading()
+        Taro.showToast({
+          title: '系统错误,请稍后再试',
+          icon: 'none'
+        })
+      })
+      : addAccount({
+        bank: data.bank,
+        openBank: data.openBank,
+        accounts: data.accounts,
+        name: data.name,
+        status,
+      }).then(v => {
+        Taro.hideLoading()
+        if (v.error.length === 0) {
+          isSub
+            ? onOk(v.data)
+            : (
+              Taro.showToast({ title: '保存成功', icon: 'none' }),
+              onClose()
+            )
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: 'none' })
+        }
+      }).catch(() => {
+        Taro.hideLoading()
+        Taro.showToast({
+          title: '系统错误,请稍后再试',
+          icon: 'none'
+        })
+      })
+
+  }
+
+  render() {
+    const { data = {} } = this.state
+    const { visible = "", onClose } = this.props;
+    return (
+      <AtModal
+        isOpened={visible != ""}
+        closeOnClickOverlay={false}
+      >
+        <AtModalHeader>{visible == "add" ? "新增收款账户" : visible == "edit" && "编辑收款账户"}</AtModalHeader>
+        <AtModalContent>
+          <View className="modal">
+            <View>
+              <AtInput
+                required
+                name='name'
+                title='账户姓名:'
+                type='text'
+                placeholder='请输入账户姓名'
+                value={data.name}
+                onChange={e => { data.name = e }}
+              />
+            </View>
+            <View>
+              <AtInput
+                required
+                name='address'
+                title='银行名称:'
+                type='text'
+                placeholder='请输入银行名称'
+                value={data.bank}
+                onChange={e => { data.bank = e }}
+              />
+            </View>
+            <View>
+              <AtInput
+                required
+                name='bank'
+                title='开户银行:'
+                type='text'
+                placeholder='请输入开户银行'
+                value={data.openBank}
+                onChange={e => { data.openBank = e }}
+              />
+            </View>
+            <View>
+              <AtInput
+                required
+                name='code'
+                title='银行账户:'
+                type='number'
+                placeholder='请输入银行账户'
+                value={data.accounts}
+                onChange={e => { data.accounts = e }}
+              />
+            </View>
+          </View>
+        </AtModalContent>
+        <AtModalAction>
+          <Button onClick={onClose}>取消</Button>
+          <Button onClick={this.onSubmit.bind(this, visible, 1)}>保存并设置为默认账户</Button>
+          <Button onClick={this.onSubmit.bind(this, visible, 0)}>保存账户</Button>
+        </AtModalAction>
+      </AtModal>
+    );
+  }
+}
+
+export default AccountModal;

+ 101 - 0
src/components/common/auditModal/index.jsx

@@ -0,0 +1,101 @@
+import React, { Component } from "react";
+import { AtModal, AtModalAction, AtModalContent, AtIcon } from "taro-ui";
+import { Button, Image, View } from "@tarojs/components";
+import Taro from "@tarojs/taro";
+import './index.less';
+import { getAudit } from '../../../utils/servers/servers';
+import "taro-ui/dist/style/components/icon.scss";
+
+class AuditDetails extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      list: [],
+      status: 1,
+      processStatus: 1,
+    }
+    this.selAudit = this.selAudit.bind(this);
+  }
+
+  componentDidMount() {
+    this.selAudit();
+  }
+
+  selAudit() {
+    Taro.showLoading({
+      title: '加载中...'
+    })
+    getAudit({
+      eaid: this.props.id
+    }).then(v => {
+      Taro.hideLoading();
+      if (v.error.length === 0) {
+        let obj = v.data
+        this.setState({
+          list: [
+            { key: 1, title: "", name: obj.yxy },
+            { key: 2, title: "", name: obj.yxjl },
+            { key: 3, title: "", name: obj.yxgly },
+            { key: 4, title: "", name: obj.cwzy },
+            { key: 5, title: "", name: obj.boss },
+          ],
+          status: obj.status,
+          processStatus: obj.processStatus,
+        })
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
+      }
+    }).catch(err => {
+      Taro.hideLoading();
+      Taro.showToast({ title: '系统错误.请稍后重试', icon: 'none' })
+    })
+  }
+
+  render() {
+    const { list, status, processStatus } = this.state
+    return (
+      <AtModal
+        width="90%"
+        isOpened={this.props.isOpened}
+        onClose={this.props.onClose}
+        onCancel={this.props.onClose}>
+        <AtModalContent>
+          <View className='historicalClock'>
+            {
+              this.state.list?.map(v => (
+                <View key={v.key} className='item'>
+                  <View className='head'>
+                    <View className='spot'
+                      style={{ background: v.key == status ? "#6190E8" : "#999999" }}
+                    >{v.key}</View>
+                    <View className='clockTime'>{v.name}</View>
+                  </View>
+                  <View className='clockContent'>
+                    <View className='verticalLine'
+                      style={{
+                        visibility: list.length != v.key
+                          ? "visible"
+                          : "hidden"
+                      }}
+                    />
+                    <View className='rightContent'>
+                      <View className='contentItem'>
+                        <AtIcon className='atIcon' value='user' size='15' color='#999999' />
+                        操作人:{v.name}
+                      </View>
+                    </View>
+                  </View>
+                </View>
+              ))
+            }
+          </View>
+        </AtModalContent>
+        <AtModalAction>
+          <Button onClick={this.props.onClose}>确定</Button>
+        </AtModalAction>
+      </AtModal>
+    )
+  }
+}
+
+export default AuditDetails;

+ 49 - 0
src/components/common/auditModal/index.less

@@ -0,0 +1,49 @@
+.historicalClock{
+  padding: 15px;
+  .item{
+    color: #999999;
+    padding-bottom: 15px;
+    .head{
+      display: flex;
+      flex-flow: row nowrap;
+      align-content: center;
+      padding-bottom: 15px;
+      .spot{
+        width: 40px;
+        height: 40px;
+        border-radius: 30px;
+        background: #999999;
+        color: #fff;
+        margin-right: 20px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+
+      }
+      .clockTime{
+        font-size: 25px;
+      }
+    }
+    .clockContent{
+      display: flex;
+      flex-flow: row nowrap;
+      .verticalLine{
+        border: 2px #cbcaca solid;
+        margin-right: 30px;
+        margin-left: 20px;
+      }
+      .rightContent{
+        padding-bottom: 20px;
+        .contentItem{
+          font-size: 23px;
+          .atIcon{
+            margin-right: 5px;
+          }
+        }
+      }
+    }
+  }
+  .at-image-picker__remove-btn{
+    display: none;
+  }
+}

+ 186 - 79
src/pages/drafts/index.jsx

@@ -5,11 +5,14 @@ import dayjs from "dayjs";
 import "./index.less";
 import ImagePicker from "../../components/common/imagePicker";
 import InquiryModal from "../../components/common/inquiryModal";
-import { AtButton, AtInput } from "taro-ui";
+import AccountModal from "../../components/common/accountModal";
+import { AtButton, AtInput, AtModal, AtModalHeader, AtModalContent, AtRadio, AtModalAction } from "taro-ui";
 import {
   getPridDetail,
   getAccountList,
-  detailsDelete
+  selectList,
+  detailsDelete,
+  subAccount,
 } from "../../utils/servers/servers";
 import {
   getNumHourse,
@@ -17,6 +20,8 @@ import {
   getTypeName,
   getVehicleName,
   commonAdd,
+  getNewOptions,
+  removeNull,
 } from "../../utils/tools";
 import "taro-ui/dist/style/components/form.scss";
 import "taro-ui/dist/style/components/button.scss";
@@ -35,26 +40,57 @@ class Drafts extends Component {
   constructor(props) {
     super(props);
     this.state = {
+      imgs: [],
       data: {},
       visible: "",
       list: [],
       total: 0,
+      accountvisible: "",
+      bankData: {},
+      upaccount: false,
+      accountsList: [],
     };
+    this.onChange = this.onChange.bind(this);
     this.getNumHourse = this.getNumHourse.bind(this);
   }
 
   componentDidMount() {
-    this.$instance.router.params &&
-      this.$instance.router.params.id && (
+    this.$instance.router.params && this.$instance.router.params.id &&
+      (
         this.getDetail(),
-        this.getAccountList()
+        this.getAccountList(),
+        this.state.data.type != 2 && this.getMyList()
       )
   }
 
+  onChange(value, type) {
+    let arr = this.state.imgs.concat([]);
+    if (type === "add") {
+      arr.push(value);
+    } else if (type === "remove") {
+      arr.splice(value, 1);
+    }
+    this.setState({
+      imgs: arr,
+    });
+  }
+
   onInputChange(title, value) {
 
   }
 
+  onAccountClose() {
+    this.setState({
+      accountvisible: "",
+    })
+  }
+
+  onAccountOk() {
+    this.setState({
+      accountvisible: "",
+    }, () => { this.getMyList() })
+  }
+
   // 费用弹窗
   onClose() {
     this.setState({
@@ -63,6 +99,50 @@ class Drafts extends Component {
     this.getAccountList()
   }
 
+  // 报销账户列表
+  getMyList(sta) {
+    let data1 = { status: 1 }
+    let data2 = {
+      pageNo: 1,
+      pageSize: 99,
+    }
+    selectList(sta ? data2 : data1).then(v => {
+      if (v.error.length === 0) {
+        let list = v.data.list || []
+        if (list?.length > 0) {
+          if (sta) {
+            this.setState({
+              accountsList: list
+            })
+          } else {
+            this.setState({
+              bankData: list[0],
+            })
+          }
+        }
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
+      }
+    }).catch(() => {
+      Taro.showToast({
+        title: '系统错误,请稍后再试',
+        icon: 'none'
+      })
+    })
+  }
+
+  selectOn() {
+    let list = this.state.accountsList
+    for (var i = 0; i < list.length; i++) {
+      if (list[i].id == this.state.aid) {
+        this.setState({
+          upaccount: false,
+          bankData: list[i]
+        })
+      }
+    }
+  }
+
   // 报销单详情
   getDetail() {
     getPridDetail({
@@ -134,6 +214,15 @@ class Drafts extends Component {
 
 
   onSubmit() {
+    const { data, bankData } = this.state
+    if (!data.userNames) {
+      Taro.showToast({ title: "请填写公出客户名称", icon: "none" });
+      return;
+    }
+    if (!data.districtName) {
+      Taro.showToast({ title: "请填写公出地点", icon: "none" });
+      return;
+    }
     if (!this.state.rangeStartMinuteVal) {
       Taro.showToast({ title: "请选择公出时间", icon: "none" });
       return;
@@ -142,37 +231,49 @@ class Drafts extends Component {
       Taro.showToast({ title: "请选择公出时间", icon: "none" });
       return;
     }
-    if ("") {
-      Taro.showToast({ title: "请选择公出地点", icon: "none" });
-      return;
-    }
     this.setState({
       loading: true,
     });
     let datas = {
-      uids: this.props.enterpriseInfor.id,
-      releaseStarts: this.state.rangeStartMinuteVal,
-      releaseEnds: this.state.rangeEndMinuteVal,
+      id: this.$instance.router.params.id,
+      status: 1,  // 提交审核
+      type: data.type,
+      typeOther: data.typeOther,
+      userNames: data.userNames,
+      districtName: data.districtName,
+      releaseStart: this.state.rangeStartMinuteVal,
+      releaseEnd: this.state.rangeEndMinuteVal,
+      duration: this.state.totalDuration,
+      orderNo: data.orderNo,
+      applyDep: data.applyDep,
+      payDep: data.payDep,
+      attachmentUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
+      eaaid: bankData.id,
     };
-    // addPublicRelease(datas)
-    //   .then((v) => {
-    //     this.setState({
-    //       loading: false,
-    //     })
-    //     if (v.error.length === 0) {
-
-    //     } else {
-    //       Taro.showToast({
-    //         title: v.error[0].message,
-    //         icon: "none",
-    //       });
-    //     }
-    //   })
-    //   .catch(() => {
-    //     this.setState({
-    //       loading: false,
-    //     });
-    //   });
+    console.log("-----", datas)
+    // return
+    subAccount(removeNull(datas))
+      .then((v) => {
+        this.setState({
+          loading: false,
+        })
+        if (v.error.length === 0) {
+          Taro.showToast({
+            title: "提交成功!",
+            icon: "none",
+          });
+        } else {
+          Taro.showToast({
+            title: v.error[0].message,
+            icon: "none",
+          });
+        }
+      })
+      .catch(() => {
+        this.setState({
+          loading: false,
+        });
+      });
   }
 
 
@@ -229,7 +330,7 @@ class Drafts extends Component {
 
 
   render() {
-    const { data, list, total } = this.state
+    const { data, list, total, bankData, } = this.state
     return (
       <View className="subform">
         <View className="title">{[data.typeOther, "差旅费报销", "餐费报销", "第三方付款", "申请预借支"][data.type]}</View>
@@ -417,42 +518,6 @@ class Drafts extends Component {
                 }}
               >删除</View>
             </View>)}
-        {/* <View className="unobstructedList">
-          {
-            [0].map((item, index) =>
-              <View className="unItem" key={index}>
-                <View className="close">删除</View>
-                <View className="edit">编辑</View>
-                <View className="formItem">
-                  <View className="formName">交通工具:</View>
-                  <View className="formValue"></View>
-                </View>
-                <View className="formItem">
-                  <View className="formName">时间:</View>
-                  <View className="formValue"></View>
-                </View>
-                <View className="formItem">
-                  <View className="formName">地点:</View>
-                  <View className="formValue"></View>
-                </View>
-                <View className="formItem">
-                  <View className="formName">金额:</View>
-                  <View className="formValue"></View>
-                </View>
-              </View>
-            )
-          }
-        </View>
-        <View className="inputFormItem">
-          <AtInput
-            name='qt'
-            title='其他:'
-            type='number'
-            placeholder='请输入金额(元)'
-            value={this.state.qt}
-            onChange={e => { console.log("---", e) }}
-          />
-        </View> */}
         <View className="formItem" style={{ paddingTop: "10px" }}>
           <View className="formName">总金额:</View>
           <View className="formValue"><Text style={{ color: "red" }}>{total}</Text>(元)</View>
@@ -478,22 +543,41 @@ class Drafts extends Component {
         <View className="formTitle" style={{ marginTop: "20px" }}>
           报销收款账户
         </View>
-        <View className="unobstructedList">
-          <View className="unItem" >
-            <View className="edit">修改</View>
-            <View className="formItem">
-              <View className="formName">收款人:曹津</View>
-            </View>
-            <View className="formItem">
-              <View className="formName">收款账户:4005201205500020</View>
-            </View>
-          </View>
-        </View>
+        {data.type != 2 &&
+          <View className="unobstructedList">
+            {(!bankData.id)
+              ? <View className="noAccout" onClick={() => { this.setState({ accountvisible: true }) }}>
+                暂未有收款账户
+                <View className="nbt">去添加 &gt;</View>
+              </View>
+              : <View className="unItem" >
+                <View className="edit"
+                  onClick={() => {
+                    this.setState({
+                      upaccount: true,
+                      aid: bankData.id,
+                    }, () => {
+                      this.getMyList(true)
+                    })
+                  }}
+                >修改</View>
+                <View className="formItem">
+                  <View className="formName">收款人:{bankData.name}</View>
+                </View>
+                <View className="formItem">
+                  <View className="formName">收款银行:{bankData.bank}</View>
+                </View>
+                <View className="formItem">
+                  <View className="formName">收款账户:{bankData.accounts}</View>
+                </View>
+              </View>}
+          </View>}
         <View className="bottom">
           <AtButton
             type="primary"
             circle
             onClick={() => {
+              this.onSubmit()
             }}
           >
             提交申请
@@ -523,6 +607,29 @@ class Drafts extends Component {
             });
           }}
         />
+        {/* 收款账户添加 */}
+        {this.state.accountvisible != "" &&
+          <AccountModal
+            isSub={true}
+            visible={this.state.accountvisible}
+            onClose={this.onAccountClose.bind(this)}
+            onOk={this.onAccountOk.bind(this)}
+          />}
+        {/* 收款账户列表 */}
+        <AtModal isOpened={this.state.upaccount}>
+          <AtModalHeader>请选择收款账户</AtModalHeader>
+          <AtModalContent>
+            <AtRadio
+              options={getNewOptions(this.state.accountsList)}
+              value={this.state.aid}
+              onClick={e => { this.setState({ aid: e }) }}
+            />
+          </AtModalContent>
+          <AtModalAction>
+            <Button type='secondary' onClick={() => { this.setState({ upaccount: false, accountsList: [] }) }}>取消</Button>
+            <Button type='primary' onClick={() => { this.selectOn() }}>确定</Button>
+          </AtModalAction>
+        </AtModal>
       </View>
     );
   }

+ 18 - 6
src/pages/drafts/index.less

@@ -77,14 +77,26 @@
 
   }
 
-  // .unobstructedList {
+  .unobstructedList {
+    .noAccout {
+      border: 1px solid #eae8e8;
+      border-radius: 10px;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      padding: 30px 0;
 
-  // }
+      .nbt {
+        color: #6190E8;
+      }
+
+    }
+  }
 
   .unItem {
     position: relative;
     border-radius: 10px;
-    background: #eae8e8;
+    background: rgba(0, 51, 255, .09);
     padding: 20px 20px 0;
     margin-bottom: 20px;
 
@@ -118,7 +130,7 @@
       font-size: 30px;
       padding: 15px 0;
 
-      .formName{
+      .formName {
         width: 136px;
         margin-right: 16px;
         white-space: nowrap;
@@ -133,11 +145,11 @@
         align-items: center;
         justify-content: flex-start;
 
-        .ftxt{
+        .ftxt {
           width: 40%;
           text-align: center;
         }
-  
+
       }
 
     }

+ 1 - 1
src/pages/login/index.jsx

@@ -138,7 +138,7 @@ class Login extends Component {
       this.setState({
         loading: false
       });
-      if (!msg.data.openId) {
+      if (!msg.data.expenseOpenId) {
         Taro.login({
           success: (res) => {
             setOpenId({

+ 11 - 143
src/pages/myinfo/index.jsx

@@ -1,9 +1,9 @@
 import React, { Component } from "react";
-import { connect } from "react-redux";
-import { View, Text, Button } from "@tarojs/components";
+import { View, } from "@tarojs/components";
 import UserFloatingLayer from "../../components/common/userFloatingLayer";
-import { selectList, addAccount, editAccount, updateStatus } from '../../utils/servers/servers';
-import { AtButton, AtInput, AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
+import { selectList, updateStatus } from '../../utils/servers/servers';
+import { AtButton, } from "taro-ui";
+import AccountModal from "../../components/common/accountModal";
 import "taro-ui/dist/style/components/button.scss";
 import "taro-ui/dist/style/components/modal.scss";
 import "taro-ui/dist/style/components/input.scss";
@@ -52,6 +52,7 @@ class myInfo extends Component {
   }
 
   onClose() {
+    this.selectList();
     this.setState({
       data: {},
       visible: ""
@@ -100,85 +101,6 @@ class myInfo extends Component {
     Taro.stopPullDownRefresh();
   }
 
-  // 新增||修改 账户
-  onSubmit(type, status) {
-    const { data } = this.state
-    if (!data.name) {
-      Taro.showToast({ title: '请填写账户姓名!', icon: 'none' });
-      return
-    }
-    if (!data.bank) {
-      Taro.showToast({ title: '请填写银行名称!', icon: 'none' });
-      return
-    }
-    if (!data.openBank) {
-      Taro.showToast({ title: '请填写开户银行!', icon: 'none' });
-      return
-    }
-    if (!data.accounts) {
-      Taro.showToast({ title: '请填写银行账户!', icon: 'none' });
-      return
-    }
-    var num = /^\d*$/
-    if (data.accounts.length < 16 || data.accounts.length > 19 || !num.test(data.accounts)) {
-      Taro.showToast({ title: '请填写正确的银行账户!', icon: 'none' });
-      return
-    }
-    Taro.showLoading({ title: '保存中...' });
-    type == "edit"
-      ? editAccount({
-        id: data.id,
-        bank: data.bank,
-        openBank: data.openBank,
-        accounts: data.accounts,
-        name: data.name,
-        status,
-      }).then(v => {
-        Taro.hideLoading()
-        if (v.error.length === 0) {
-          Taro.showToast({ title: '保存成功', icon: 'none' });
-          this.selectList();
-          this.setState({
-            visible: "",
-            data: {},
-          })
-        } else {
-          Taro.showToast({ title: v.error[0].message, icon: 'none' })
-        }
-      }).catch(() => {
-        Taro.hideLoading()
-        Taro.showToast({
-          title: '系统错误,请稍后再试',
-          icon: 'none'
-        })
-      })
-      : addAccount({
-        bank: data.bank,
-        openBank: data.openBank,
-        accounts: data.accounts,
-        name: data.name,
-        status,
-      }).then(v => {
-        Taro.hideLoading()
-        if (v.error.length === 0) {
-          Taro.showToast({ title: '保存成功', icon: 'none' });
-          this.selectList();
-          this.setState({
-            visible: "",
-            data: {},
-          })
-        } else {
-          Taro.showToast({ title: v.error[0].message, icon: 'none' })
-        }
-      }).catch(() => {
-        Taro.hideLoading()
-        Taro.showToast({
-          title: '系统错误,请稍后再试',
-          icon: 'none'
-        })
-      })
-
-  }
 
   // 设置默认
   onUpdateStatus(id) {
@@ -241,66 +163,12 @@ class myInfo extends Component {
         <View className="mbottom">
           <AtButton type="primary" onClick={() => { this.setState({ visible: "add" }) }}>+ 新增收款账户</AtButton>
         </View>
-
-        <AtModal
-          isOpened={visible != ""}
-          closeOnClickOverlay={false}
-        >
-          <AtModalHeader>{visible == "add" ? "新增收款账户" : visible == "edit" && "编辑收款账户"}</AtModalHeader>
-          <AtModalContent>
-            <View className="modal">
-              <View>
-                <AtInput
-                  required
-                  name='name'
-                  title='账户姓名:'
-                  type='text'
-                  placeholder='请输入账户姓名'
-                  value={data.name}
-                  onChange={e => { data.name = e }}
-                />
-              </View>
-              <View>
-                <AtInput
-                  required
-                  name='address'
-                  title='银行名称:'
-                  type='text'
-                  placeholder='请输入银行名称'
-                  value={data.bank}
-                  onChange={e => { data.bank = e }}
-                />
-              </View>
-              <View>
-                <AtInput
-                  required
-                  name='bank'
-                  title='开户银行:'
-                  type='text'
-                  placeholder='请输入开户银行'
-                  value={data.openBank}
-                  onChange={e => { data.openBank = e }}
-                />
-              </View>
-              <View>
-                <AtInput
-                  required
-                  name='code'
-                  title='银行账户:'
-                  type='number'
-                  placeholder='请输入银行账户'
-                  value={data.accounts}
-                  onChange={e => { data.accounts = e }}
-                />
-              </View>
-            </View>
-          </AtModalContent>
-          <AtModalAction>
-            <Button onClick={(this.onClose.bind(this))}>取消</Button>
-            <Button onClick={this.onSubmit.bind(this, visible, 1)}>保存并设置为默认账户</Button>
-            <Button onClick={this.onSubmit.bind(this, visible, 0)}>保存账户</Button>
-          </AtModalAction>
-        </AtModal>
+        {visible != "" &&
+          <AccountModal
+            data={data}
+            visible={visible}
+            onClose={this.onClose.bind(this)}
+          />}
       </View>
     );
   }

+ 1 - 1
src/pages/myinfo/index.less

@@ -31,7 +31,7 @@ page {
     .mitem {
       position: relative;
       border-radius: 10px;
-      background: #eae8e8;
+      background: rgba(0, 51, 255, .09);
       padding: 20px 20px 0;
       margin-bottom: 20px;
 

+ 28 - 3
src/pages/recordlist/index.jsx

@@ -1,12 +1,13 @@
 import React, { Component } from 'react';
 import Taro from '@tarojs/taro';
 import { View, Picker, ScrollView, } from '@tarojs/components'
-import { getRecordList, } from '../../utils/servers/servers';
+import { getRecordList, getAudit } from '../../utils/servers/servers';
 import dayjs from 'dayjs';
 import { AtIcon, } from 'taro-ui';
 import { getAccountName } from '../../utils/tools';
 import { accountLtate, } from '../../utils/tools/config'
 import ListBottomStart from "../../components/common/listBottomStart";
+import AuditModal from "../../components/common/auditModal";
 
 import './index.less';
 import 'taro-ui/dist/style/components/tabs.scss';
@@ -24,6 +25,7 @@ class Examine extends Component {
     this.state = {
       starts: {},
       list: [],
+      visible: false,
     }
   }
 
@@ -134,8 +136,20 @@ class Examine extends Component {
     }
   }
 
-  onRefresh() {
 
+  selAudit(id, e) {
+    e.stopPropagation();
+    getAudit({
+      eaid: id,
+    }).then((v) => {
+      if (v.error.length === 0) {
+
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: "none" });
+      }
+    }).catch((err) => {
+      Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+    });
   }
 
 
@@ -239,6 +253,7 @@ class Examine extends Component {
                   })
                 }}
               >
+                {item.status == 1 && <View className='lbt' onClick={e => { e.stopPropagation(); this.setState({ visible: true, id: item.id }) }}>查看审核详情</View>}
                 <View className='line'>报销金额:{item.totalAmount}元</View>
                 <View className='line'>报销时间:{item.createTimeStr}</View>
                 <View className='line'>报销类型:{getAccountName(item.type, item.typeOther)}</View>
@@ -274,7 +289,17 @@ class Examine extends Component {
             this.onSetPickerTime(v)
           }}>
         </timePicker>
-      </View>
+        {this.state.visible &&
+          <AuditModal
+            id={this.state.id}
+            isOpened={this.state.visible}
+            onClose={() => {
+              this.setState({
+                visible: false
+              })
+            }}
+          />}
+      </View >
     )
   }
 }

+ 15 - 4
src/pages/recordlist/index.less

@@ -146,21 +146,32 @@
       margin-bottom: 17px;
       position: relative;
       overflow: hidden;
+      font-size: 26px;
 
-      .line{
+      .line {
         width: 100%;
-        font-size: 30px;
         padding: 5px 0;
 
       }
 
-      .lines{
+      .lines {
         width: 100%;
-        font-size: 30px;
         padding: 5px 0;
         text-align: right;
       }
 
+      .lbt {
+        position: absolute;
+        right: 0;
+        font-size: 24px;
+        padding: 20px;
+        color: #fff;
+        background: #1D4FEA;
+        border-bottom-left-radius: 100px;
+        border-top-left-radius: 100px;
+
+      }
+
     }
 
   }

+ 12 - 1
src/utils/servers/servers.js

@@ -98,6 +98,11 @@ export const getRecordList = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccount/pageList', postData)
 }
 
+// 报销审核流程
+export const getAudit = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/expenseAccount/examineLog', postData)
+}
+
 // 报销详情金额列表
 export const getAccountList = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccount/details/list', postData)
@@ -111,4 +116,10 @@ export const detailsAdd = (postData = {}) => {
 // 删除报销详情
 export const detailsDelete = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccount/details/delete', postData)
-}
+}
+
+// 修改报销
+export const subAccount = (postData = {}) => {
+  return HTTPREQUEST.post('/api/admin/expenseAccount/update', postData)
+}
+

+ 1 - 1
src/utils/servers/utils.js

@@ -11,7 +11,7 @@ export const getCurrentPageUrl = () => {
 };
 
 export const pageToLogin = async () => {
-  Taro.closeSocket();
+  // Taro.closeSocket();
   Taro.reLaunch({
     url: '/pages/login/index'
   })

+ 19 - 1
src/utils/tools/index.js

@@ -116,6 +116,14 @@ export const formatDate = (year, month, day, hour, minute) => {
   return year + '-' + newmonth + '-' + newday + ' ' + newhour + ":" + newminute;
 };
 
+// 报销账户列表重组
+export const getNewOptions = (arr) => {
+  let list = []
+  for (var i = 0; i < arr.length; i++) {
+    list.push({ label: arr[i].name, value: arr[i].id, desc: arr[i].bank + " " + arr[i].accounts })
+  }
+  return list
+}
 
 // 
 export const getNameList = (aidList, arr) => {
@@ -192,5 +200,15 @@ export const commonAdd = (number1, number2) => {
   return result;
 }
 
-
+// 移除null
+export const removeNull = (obj) => {
+  var param = {};
+  if (obj === null || obj === undefined) return param;
+  for (var key in obj) {
+    if (obj[key] !== null && obj[key] !== undefined) {
+      param[key] = obj[key];
+    }
+  }
+  return param;
+}