瀏覽代碼

新版本

dev01 1 年之前
父節點
當前提交
09d2a86762

+ 6 - 4
src/app.config.js

@@ -7,11 +7,13 @@ export default {
     'pages/accountfrom/index', // 添加报销数据
     'pages/drafts/index', // 报销提交
     'pages/dataindex/index', // 订单数据索引
-    'pages/draftsdetail/index', // 报销详情
+    'pages/draftsdetail/index', // 费用详情
+    'pages/mergedetail/index', // 合并报销详情
     'pages/debitnote/index', // 借支单列表
-    'pages/recordlist/index', // 报销记录
+    'pages/recordlist/index', //  费用列表
     'pages/examine/index', // 审核
     'pages/myinfo/index', // 我的账户
+    'pages/mymerge/index', // 我的报销列表
   ],
   tabBar: {
     list: [
@@ -31,7 +33,7 @@ export default {
         iconPath: './image/record.png',
         selectedIconPath: './image/recordSelect.png',
         pagePath: 'pages/recordlist/index',
-        text: '报销记录'
+        text: '费用'
       },
       {
         iconPath: './image/examineUnSelect.png',
@@ -42,7 +44,7 @@ export default {
       {
         iconPath: './image/my.png',
         selectedIconPath: './image/mySelect.png',
-        pagePath: 'pages/myinfo/index',
+        pagePath: 'pages/mymerge/index',
         text: '我的'
       },
     ],

二進制
src/image/bg.jpg


二進制
src/image/sel.png


二進制
src/image/sels.png


+ 6 - 2
src/pages/accountFrom/index.jsx

@@ -3,6 +3,7 @@ import Taro, { getCurrentInstance } from "@tarojs/taro";
 import { Text, Picker, View } from "@tarojs/components";
 import { AtInput, AtTextarea, AtButton, AtIcon } from "taro-ui";
 import { detailsAdd } from "../../utils/servers/servers";
+import { removeNull } from "../../utils/tools";
 import "./index.less";
 
 class AccountFrom extends Component {
@@ -85,10 +86,13 @@ class AccountFrom extends Component {
 
     let obj = {
       ...data,
-      ...{ eaid, type, }
+      ...{
+        eaid,
+        type: type == 6 ? type : undefined,
+      }
     }
     Taro.showLoading({ title: '保存中...' });
-    detailsAdd(obj)
+    detailsAdd(removeNull(obj))
       .then((v) => {
         Taro.hideLoading()
         if (v.error.length === 0) {

+ 81 - 6
src/pages/applyReimbursement/index.jsx

@@ -1,14 +1,14 @@
 import React, { Component } from "react";
 import Taro, { getCurrentInstance } from "@tarojs/taro";
 import { connect } from "react-redux";
-import { View, Text, } from "@tarojs/components";
-import { AtInput, AtButton, AtRadio } from "taro-ui";
+import { View, Button, } from "@tarojs/components";
+import { AtInput, AtButton, AtRadio, AtModal, AtModalContent, AtModalAction } from "taro-ui";
 import "taro-ui/dist/style/components/button.scss";
 import "taro-ui/dist/style/components/radio.scss";
 import "taro-ui/dist/style/components/input.scss";
 import "taro-ui/dist/style/components/icon.scss";
 import { creatOrder } from '../../utils/servers/servers';
-import { accountList } from '../../utils/tools/config';
+import { accountList, nonBusiness } from '../../utils/tools/config';
 import "./index.less";
 
 class applyReimbursement extends Component {
@@ -19,12 +19,16 @@ class applyReimbursement extends Component {
     this.state = {
       type: -1,
       other: "",
+      noType: -1,
+      others: "",
+      popup: false,
     };
   }
 
   handleChange(e) {
     this.setState({
-      type: e
+      type: e,
+      popup: e == 2 ? true : false
     })
   }
 
@@ -34,6 +38,18 @@ class applyReimbursement extends Component {
     })
   }
 
+  onNoChange(e) {
+    this.setState({
+      noType: e
+    })
+  }
+
+  onNoInputChange(e) {
+    this.setState({
+      others: e
+    })
+  }
+
   componentDidShow() {
 
   }
@@ -44,11 +60,22 @@ class applyReimbursement extends Component {
 
   // 不需要prid绑定,直接发起
   creatOrder() {
-    const { type, other, } = this.state
+    const { type, other, noType, others } = this.state
+    if (type == 2) {
+      if (noType == -1) {
+        Taro.showToast({
+          title: '非业务报销需选择二级分类',
+          icon: 'none'
+        })
+        return
+      }
+    }
     Taro.showLoading({ title: '处理中...' });
     creatOrder({
       type,
       typeOther: other,
+      secondaryType: type == 2 ? noType : "",
+      secondaryTypeOther: others,
     }).then(v => {
       Taro.hideLoading()
       if (v.error.length === 0) {
@@ -68,7 +95,7 @@ class applyReimbursement extends Component {
 
 
   render() {
-    const { type, other } = this.state
+    const { type, other, popup, noType, others } = this.state
     return (
       <View className="reimbursement">
         <View>
@@ -112,6 +139,54 @@ class applyReimbursement extends Component {
             </View>
           </View>
         </View>
+
+        {(type == 2) && popup &&
+          <AtModal
+            isOpened={(type == 2) && popup}
+            closeOnClickOverlay={false}
+          >
+            <AtModalContent>
+              <View className="rlist">
+                <AtRadio
+                  options={nonBusiness}
+                  value={noType}
+                  onClick={this.onNoChange.bind(this)}
+                />
+                {noType == 0 &&
+                  <AtInput
+                    name='others'
+                    type='text'
+                    placeholder='请填写明细'
+                    value={others}
+                    onChange={this.onNoInputChange.bind(this)}
+                  />}
+              </View>
+            </AtModalContent>
+            <AtModalAction>
+              <Button onClick={() => {
+                this.setState({
+                  popup: false
+                })
+              }}>上一步</Button>
+              <Button onClick={() => {
+                if (noType == -1) {
+                  Taro.showToast({
+                    title: '请选择费用类型',
+                    icon: 'none'
+                  })
+                } else if (noType == 0 && !others) {
+                  Taro.showToast({
+                    title: '请填写其他明细',
+                    icon: 'none'
+                  })
+                } else {
+                  this.setState({
+                    popup: false
+                  })
+                }
+              }}>确定</Button>
+            </AtModalAction>
+          </AtModal>}
       </View>
     );
   }

+ 100 - 23
src/pages/applyReimbursement/select.jsx

@@ -2,7 +2,7 @@ import React, { Component } from "react";
 import Taro from "@tarojs/taro";
 import { View, Button, } from '@tarojs/components'
 import { AtRadio, AtInput, AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
-import { accountList } from '../../utils/tools/config';
+import { accountList, nonBusiness } from '../../utils/tools/config';
 import { creatOrder } from '../../utils/servers/servers';
 import './index.less';
 
@@ -16,36 +16,65 @@ class Select extends Component {
     this.state = {
       type: -1,
       other: "",
+      noType: -1,
+      others: "",
+      popup: false,
     };
   }
 
   componentDidMount() {
-    const { type, other } = this.props
+    const { type, other, noType, others } = this.props
     this.setState({
       type,
-      other
+      other,
+      noType,
+      others,
     })
   }
 
   handleChange(e) {
     this.setState({
-      type: e
+      type: e,
+      popup: e == 2 ? true : false
     })
   }
 
   onInputChange(e) {
     this.setState({
-      other: e
+      other: e,
+    })
+  }
+
+  onNoChange(e) {
+    this.setState({
+      noType: e
+    })
+  }
+
+  onNoInputChange(e) {
+    this.setState({
+      others: e
     })
   }
 
   creatOrder() {
     const { prid, onClose } = this.props
-    const { type, other, } = this.state
+    const { type, other, noType, others } = this.state
+    if (type == 2) {
+      if (noType == -1) {
+        Taro.showToast({
+          title: '非业务报销需选择二级分类',
+          icon: 'none'
+        })
+        return
+      }
+    }
     creatOrder({
       prid,
       type,
       typeOther: other,
+      secondaryType: type == 2 ? noType : undefined,
+      secondaryTypeOther: others,
     }).then(v => {
       if (v.error.length === 0) {
         onClose()
@@ -66,7 +95,7 @@ class Select extends Component {
 
   render() {
     const { visible = "", onClose, noPost = false, onOk } = this.props
-    const { type, other } = this.state
+    const { type, other, noType, others, popup } = this.state
     return (
       <AtModal
         isOpened={visible != ""}
@@ -74,21 +103,69 @@ class Select extends Component {
       >
         <AtModalHeader>请选择报销类型</AtModalHeader>
         <AtModalContent>
-          <View className="rlist">
-            <AtRadio
-              options={accountList}
-              value={type}
-              onClick={this.handleChange.bind(this)}
-            />
-            {type == 0 &&
-              <AtInput
-                name='other'
-                type='text'
-                placeholder='请填写明细'
-                value={other}
-                onChange={this.onInputChange.bind(this)}
-              />}
-          </View>
+          {visible != "" &&
+            <View className="rlist">
+              <AtRadio
+                options={accountList}
+                value={type}
+                onClick={this.handleChange.bind(this)}
+              />
+              {type == 0 &&
+                <AtInput
+                  name='other'
+                  type='text'
+                  placeholder='请填写明细'
+                  value={other}
+                  onChange={this.onInputChange.bind(this)}
+                />}
+              {(type == 2) && popup &&
+                <AtModal
+                  isOpened={(type == 2) && popup}
+                  closeOnClickOverlay={false}
+                >
+                  <AtModalContent>
+                    <View className="rlist">
+                      <AtRadio
+                        options={nonBusiness}
+                        value={noType}
+                        onClick={this.onNoChange.bind(this)}
+                      />
+                      {noType == 0 &&
+                        <AtInput
+                          name='others'
+                          type='text'
+                          placeholder='请填写明细'
+                          value={others}
+                          onChange={this.onNoInputChange.bind(this)}
+                        />}
+                    </View>
+                  </AtModalContent>
+                  <AtModalAction>
+                    <Button onClick={() => {
+                      this.setState({
+                        popup: false
+                      })
+                    }}>上一步</Button>
+                    <Button onClick={() => {
+                      if (noType == -1) {
+                        Taro.showToast({
+                          title: '请选择费用类型',
+                          icon: 'none'
+                        })
+                      } else if (noType == 0 && !others) {
+                        Taro.showToast({
+                          title: '请填写其他明细',
+                          icon: 'none'
+                        })
+                      } else {
+                        this.setState({
+                          popup: false
+                        })
+                      }
+                    }}>确定</Button>
+                  </AtModalAction>
+                </AtModal>}
+            </View>}
         </AtModalContent>
         <AtModalAction>
           <Button onClick={onClose}>取消</Button>
@@ -106,7 +183,7 @@ class Select extends Component {
             } else {
               noPost
                 ? this.creatOrder()
-                : onOk(type, other)
+                : onOk(type, other, noType, others)
             }
           }}>确定</Button>
         </AtModalAction>

+ 168 - 59
src/pages/drafts/index.jsx

@@ -29,6 +29,7 @@ import {
 import {
   getNumHourse,
   getAccountName,
+  getSecondaryAccountName,
   getTypeName,
   getVehicleName,
   commonAdd,
@@ -169,10 +170,16 @@ class Drafts extends Component {
   }
 
   // 类型修改 确定
-  onTypeOk(type, typeOther) {
+  onTypeOk(type, typeOther, noType, others) {
     const oldType = this.state.data.type
     const oldTypeOther = this.state.data.typeOther
-    if ((oldType == type) && (typeOther == oldTypeOther)) {
+    const secondaryType = this.state.data.secondaryType
+    const secondaryTypeOther = this.state.data.secondaryTypeOther
+    if ((oldType == type) && (typeOther == oldTypeOther) && (type != 2)) {
+      this.setState({
+        typeVisible: "",
+      })
+    } else if ((type == 2) && (noType == secondaryType) && (others == secondaryTypeOther)) {
       this.setState({
         typeVisible: "",
       })
@@ -182,13 +189,15 @@ class Drafts extends Component {
         id: this.$instance.router.params.id,
         type,
         typeOther,
+        secondaryType: noType,
+        secondaryTypeOther: others,
       }
       subAccount(removeNull(data))
         .then((v) => {
           if (v.error.length === 0) {
             this.getAccountList()
             // 手动刷新
-            const obj = { type, typeOther }
+            const obj = { type, typeOther, secondaryType: noType, secondaryTypeOther: others }
             this.setState({
               data: { ...this.state.data, ...obj },
               typeVisible: "",
@@ -285,6 +294,8 @@ class Drafts extends Component {
           data: v.data,
           rangeStartMinuteVal: v.data.releaseStartStr,
           rangeEndMinuteVal: v.data.releaseEndStr,
+          rangeStartMinuteVal1: v.data.releaseStartStr,
+          rangeEndMinuteVal1: v.data.releaseEndStr,
           totalDuration: v.data.duration,
           imgs: list,
         })
@@ -386,8 +397,12 @@ class Drafts extends Component {
         return;
       }
     }
-    if (!data.remarks) {
-      Taro.showToast({ title: "请填写报销事由", icon: "none" });
+    // if (!data.remarks) {
+    //   Taro.showToast({ title: "请填写报销事由", icon: "none" });
+    //   return;
+    // }
+    if (data.type != 1 && !this.state.rangeStartMinuteVal1) {
+      Taro.showToast({ title: "请选择费用产生时间", icon: "none" });
       return;
     }
     if (list.length == 0) {
@@ -400,12 +415,12 @@ class Drafts extends Component {
         return;
       }
     }
-    if (data.type != 3 && data.type != 5) {
-      if (!bankData.id) {
-        Taro.showToast({ title: "请选择收款账户", icon: "none" });
-        return;
-      }
-    }
+    // if (data.type != 3 && data.type != 5) {
+    //   if (!bankData.id) {
+    //     Taro.showToast({ title: "请选择收款账户", icon: "none" });
+    //     return;
+    //   }
+    // }
     let imgUrls = []
     if (this.state.imgs.length) {
       let picArr = [];
@@ -424,21 +439,23 @@ class Drafts extends Component {
     let comData = {
       updateType: 0,
       id: this.$instance.router.params.id,
-      status: 1,  // 提交审核
+      // status: 1,  // 提交审核
       type: data.type, // 报销类型
       typeOther: data.type == 0 ? data.typeOther : undefined, // 其他类型
-      remarks: data.remarks, // 报销事由
-      applyDep: (data.type == 4 || data.type == 5) ? undefined : data.applyDep, // 申请部门(借支抵扣不需要)
+      secondaryType: data.type == 2 ? data.secondaryType : undefined,
+      secondaryTypeOther: data.secondaryType == 0 ? data.secondaryTypeOther : undefined,
+      // remarks: data.remarks, // 报销事由
+      // applyDep: (data.type == 4 || data.type == 5) ? undefined : data.applyDep, // 申请部门(借支抵扣不需要)
       attachmentUrl: this.state.imgs.length === 0 ? "" : imgUrls, // 附件
-      payDep: data.payDep, // 支付部门
+      // payDep: data.payDep, // 支付部门
       orderNo: (data.type == 4 || data.type == 5) ? undefined : data.orderNo, // 订单编号(借支抵扣不需要)
       debitId: data.type == 4 ? undefined : data.debitId, // 预支单
-      eaaid: (data.type == 3 || data.type == 5) ? undefined : bankData.id, // 报销账户(第三方付款和抵扣不需要)
+      // eaaid: (data.type == 3 || data.type == 5) ? undefined : bankData.id, // 报销账户(第三方付款和抵扣不需要)
       // 差旅费
       userNames: data.type == 1 ? data.userNames : undefined, // 公出客户名称
       districtName: data.type == 1 ? data.districtName : undefined, // 公出地点
-      releaseStart: data.type == 1 ? this.state.rangeStartMinuteVal : undefined, // 开始时间
-      releaseEnd: data.type == 1 ? this.state.rangeEndMinuteVal : undefined, // 结束时间
+      releaseStart: data.type == 1 ? this.state.rangeStartMinuteVal : this.state.rangeStartMinuteVal1, // 开始时间
+      releaseEnd: data.type == 1 ? this.state.rangeEndMinuteVal : this.state.rangeEndMinuteVal1, // 结束时间
       duration: data.type == 1 ? this.state.totalDuration : undefined, // 公出时长
     }
     subAccount(removeNull(comData))
@@ -485,6 +502,12 @@ class Drafts extends Component {
     });
   }
 
+  onPickerHide1() {
+    this.setState({
+      isPicker: false,
+    });
+  }
+
 
   onSetPickerTime(val) {
     let data = val.detail;
@@ -519,6 +542,14 @@ class Drafts extends Component {
     });
   }
 
+  onSetPickerTime1(val) {
+    let data = val.detail;
+    // console.log("===", data)
+    this.setState({
+      rangeStartMinuteVal1: dayjs(data.selectStartTime).format("YYYY-MM-DD HH:mm:ss"),
+      rangeEndMinuteVal1: dayjs(data.selectEndTime).format("YYYY-MM-DD HH:mm:ss"),
+    });
+  }
 
   render() {
     const { data, list, total, bankData, } = this.state
@@ -608,23 +639,53 @@ class Drafts extends Component {
           </View>}
         <View className="formItem">
           <View className="formName">申请类型:</View>
-          <View className="formValue" onClick={() => {
-            this.setState({
-              isInquiryOpened: true,
-              inquiryTitle: "温馨提示",
-              inquiryContent: "您是否需要重新选择费用类型?原报销数据将清空后,需重新填写!!!",
-              inquiryFn: () => {
-                this.setState({
-                  typeVisible: "edit"
-                })
-              },
-            });
-          }}>
-            {getAccountName(data.type, data.typeOther)}
+          <View className="formValue"
+            onClick={() => {
+              this.setState({
+                isInquiryOpened: true,
+                inquiryTitle: "温馨提示",
+                inquiryContent: "您是否需要重新选择费用类型?原报销数据将清空后,需重新填写!!!",
+                inquiryFn: () => {
+                  this.setState({
+                    typeVisible: "edit"
+                  })
+                },
+              });
+            }}>
+            <View>{getAccountName(data.type, data.typeOther)}</View>
             <AtIcon value="chevron-right" size="20" color="#000000" />
+            {data.type == 2 && <View>{getSecondaryAccountName(data.secondaryType, data.secondaryTypeOther)}</View>}
+            {data.type == 2 && <AtIcon value="chevron-right" size="20" color="#000000" />}
           </View>
         </View>
-        {data.type != 4 && data.type != 5 &&
+        {data.type != 1 &&
+          < View className="formItem">
+            <View className="formName">费用产生时间:</View>
+            <View className="formValue"
+              onClick={() => {
+                this.setState({
+                  isPicker: true
+                })
+              }}>
+              {
+                !this.state.rangeStartMinuteVal1 ?
+                  <View className='valuecontent'>
+                    <View className='selectTitle'>
+                      请填写费用产生时间
+                      <AtIcon value="chevron-right" size="20" color="#000000" />
+                    </View>
+                  </View> :
+                  <View className='valuecontent'>
+                    <View className='selectValue' >
+                      {this.state.rangeStartMinuteVal1.slice(0, 10) + " 至 " + this.state.rangeEndMinuteVal1.slice(0, 10)}
+                    </View>
+                    <View className='iconContent' />
+                  </View>
+              }
+            </View>
+          </View>}
+        {/* {
+          data.type != 4 && data.type != 5 &&
           <View className="formItem">
             <View className="formName">报销至订单:</View>
             <View className="formValue" onClick={() => {
@@ -638,8 +699,10 @@ class Drafts extends Component {
               </View>
               <AtIcon value="chevron-right" size="20" color="#000000" />
             </View>
-          </View>}
-        <View className="formTitle">
+          </View>
+        } */}
+
+        {/* <View className="formTitle">
           {(data.type == 4 || data.type == 5) ? "申请详细" : "报销详细"}
         </View>
         <View className="formItem">
@@ -655,13 +718,13 @@ class Drafts extends Component {
                 value={departmentArr.findIndex(item => item.id === data.applyDep)}
                 range={departmentArr} rangeKey='name' mode='selector'
                 onChange={(e) => {
-                  const obj = { applyDep: departmentArr[e.detail.value].id, appDepName: departmentArr[e.detail.value].name }
+                  const obj = { applyDep: departmentArr[e.detail.value].id, applyDepName: departmentArr[e.detail.value].name }
                   this.setState({
                     data: { ...data, ...obj },
                   })
                 }}>
                 <View>
-                  {data.appDepName}
+                  {data.applyDepName}
                   <AtIcon value="chevron-right" size="20" color="#000000" />
                 </View>
               </Picker>
@@ -706,7 +769,9 @@ class Drafts extends Component {
               placeholder={(data.type == 4 || data.type == 5) ? "请填写说明:" : "请填写报销事由"}
             />
           </View>
-        </View>
+        </View> */}
+
+
         <View className="formTitle">
           {data.type != 4 && data.type != 5 && "报销"}费用详细
           <Button className="ftBottom" size='mini' type='primary'
@@ -718,14 +783,17 @@ class Drafts extends Component {
                 })
             }}>+ 增加</Button>
         </View>
-        {this.state.visible != "" &&
+        {
+          this.state.visible != "" &&
           <NewModal
             eaid={this.$instance.router.params.id}
             visible={this.state.visible}
             onClose={this.onClose.bind(this)}
-          />}
+          />
+        }
         {/* 差旅费显示 */}
-        {data.type == 1 &&
+        {
+          data.type == 1 &&
           list?.map(item =>
             item.type == 1
               ? <View className="unItem" key={item.id}>
@@ -777,7 +845,7 @@ class Drafts extends Component {
                   value={item.amount}
                 /> */}
                 <View className="formItem">
-                  <View className="formName">{getTypeName(item.type) + ":"}</View>
+                  <View className="formName">{getTypeName(item.type, item.typeOther) + ":"}</View>
                   <View className="formValue">{item.amount}(元)</View>
                 </View>
                 <View className="close"
@@ -792,9 +860,11 @@ class Drafts extends Component {
                     });
                   }}
                 >删除</View>
-              </View>)}
+              </View>)
+        }
         {/* 通用 */}
-        {(data.type == 0 || data.type == 2 || data.type == 4 || data.type == 5) &&
+        {
+          (data.type == 0 || data.type == 2 || data.type == 4 || data.type == 5) &&
           list?.map(item =>
             <View className="unItem" key={item.id}>
               <View className="close"
@@ -824,9 +894,11 @@ class Drafts extends Component {
                 <View className="formValue">{item.amount}(元)</View>
               </View>
             </View>
-          )}
+          )
+        }
         {/* 第三方付款 */}
-        {data.type == 3 &&
+        {
+          data.type == 3 &&
           list?.map(item =>
             <View className="unItem" key={item.id}>
               <View className="close"
@@ -880,8 +952,10 @@ class Drafts extends Component {
                 <View className="formValue">{item.amount}</View>
               </View>
             </View>
-          )}
-        {data.type != 4 &&
+          )
+        }
+        {
+          data.type != 4 &&
           <View className="formItem">
             <View className="formName">{data.type == 5 ? "抵扣借支:" : "抵扣:"}</View>
             <View className="formValue"
@@ -897,18 +971,23 @@ class Drafts extends Component {
                   <AtIcon value="chevron-right" size="20" color="#000000" />
                 </View>}
             </View>
-          </View>}
+          </View>
+        }
         {data.type != 4 && data.type != 5 && < View className="tips">注:如需抵扣借支,请选择对应的借支订单</View>}
-        {data.type != 4 && data.type != 5 &&
+        {
+          data.type != 4 && data.type != 5 &&
           <View className="formItem" style={{ paddingTop: "10px" }}>
             <View className="formName">总金额:</View>
             <View className="formValue"><Text style={{ color: "red" }}>{total}</Text>(元)</View>
-          </View>}
-        {data.type != 4 && data.type != 5 &&
+          </View>
+        }
+        {
+          data.type != 4 && data.type != 5 &&
           <View className="formItem" style={{ paddingTop: "10px" }}>
             <View className="formName">实报金额:</View>
             <View className="formValue"><Text style={{ color: "red" }}>{this.state.reality}</Text>(元)</View>
-          </View>}
+          </View>
+        }
         <View className="formItem" style={{ display: "block", paddingBottom: 0 }}>
           <View className="formName">附件:</View>
           <View
@@ -929,7 +1008,8 @@ class Drafts extends Component {
         <View className="tips">①需要提供发票报销</View>
         <View className="tips">②需要填写报销明细表</View>
         <View className="tips">③招待费需要提供报备截图</View>
-        {data.type != 3 &&
+
+        {/* {data.type != 3 &&
           <View className="formTitle" style={{ marginTop: "20px" }}>
             报销收款账户
           </View>}
@@ -961,7 +1041,9 @@ class Drafts extends Component {
                   <View className="formName">收款账户:{bankData.accounts}</View>
                 </View>
               </View>}
-          </View>}
+          </View>} */}
+
+
         <View className="bottom">
           <AtButton
             disabled={this.state.loading}
@@ -971,7 +1053,8 @@ class Drafts extends Component {
               this.onSubmit()
             }}
           >
-            {data.status == 0 ? "提交申请" : data.status == 3 && "重新发起"}
+            保存单笔费用
+            {/* {data.status == 0 ? "保存单笔费用" : data.status == 3 && "重新发起"} */}
           </AtButton>
         </View>
         {/* 二级确认弹窗 */}
@@ -999,14 +1082,16 @@ class Drafts extends Component {
           }}
         />
         {/* 收款账户添加 */}
-        {this.state.accountvisible != "" &&
+        {
+          this.state.accountvisible != "" &&
           <AccountModal
             isDefault={true}
             isSub={true}
             visible={this.state.accountvisible}
             onClose={this.onAccountClose.bind(this)}
             onOk={this.onAccountOk.bind(this)}
-          />}
+          />
+        }
         {/* 收款账户列表 */}
         <AtModal isOpened={this.state.upaccount}>
           <AtModalHeader>请选择收款账户</AtModalHeader>
@@ -1023,14 +1108,38 @@ class Drafts extends Component {
           </AtModalAction>
         </AtModal>
         {/* 申请类型修改 */}
-        {this.state.typeVisible != "" &&
+        {
+          this.state.typeVisible != "" &&
           <Select
             visible={this.state.typeVisible}
             onClose={this.onTypeClose.bind(this)}
             onOk={this.onTypeOk.bind(this)}
             type={data.type}
             other={data.typeOther}
-          />}
+            noType={data.secondaryType}
+            others={data.secondaryTypeOther}
+          />
+        }
+
+        <timePicker
+          config={{
+            endDate: true,
+            column: "day",
+            dateLimit: false,
+            limitStartTime: dayjs().subtract(3, 'year').format('YYYY-MM-DD '),
+            limitEndTime: dayjs().add(3, 'year').format('YYYY-MM-DD ')
+          }}
+          isPartition
+          pickerShow={this.state.isPicker}
+          onconditionaljudgment={(v) => {
+          }}
+          onhidepicker={() => {
+            this.onPickerHide1()
+          }}
+          onsetpickertime={(v) => {
+            this.onSetPickerTime1(v)
+          }}
+        />
         <AtToast isOpened={this.state.loading} text="Loading..." status='loading' />
       </View >
     );

+ 10 - 6
src/pages/drafts/modal.jsx

@@ -83,6 +83,12 @@ class Modal extends Component {
       Taro.showToast({ title: "请选择费用类型", icon: "none", });
       return
     }
+    if (type == 0) {
+      if (!data.typeOther) {
+        Taro.showToast({ title: "请填写类型说明", icon: "none", });
+        return
+      }
+    }
     if (type == 1) {
       if (!data.vehicle.value && data.vehicle.value != 0) {
         Taro.showToast({ title: "请选择交通工具", icon: "none", });
@@ -186,9 +192,7 @@ class Modal extends Component {
                   let obj = {
                     type: typeList[e.detail.value]
                   }
-                  console.log(this.props.visible, "======", e.detail.value)
                   if (this.props.visible == "add" && e.detail.value == 0) {
-                    console.log("--")
                     let location = Taro.getStorageSync('location')
                     if (location) {
                       obj.startDistrict = location.start
@@ -205,7 +209,7 @@ class Modal extends Component {
               </Picker>
             </View>
             {/* 其他 */}
-            {/* {data.type.value == 0 &&
+            {data.type.value == 0 &&
               <View>
                 <AtInput
                   required
@@ -213,14 +217,14 @@ class Modal extends Component {
                   title='类型说明:'
                   type='text'
                   placeholder='其他说明'
-                  value={data.vehicleOther}
+                  value={data.typeOther}
                   onChange={e => {
                     this.setState({
-                      data: { ...data, vehicleOther: e }
+                      data: { ...data, typeOther: e }
                     })
                   }}
                 />
-              </View>} */}
+              </View>}
             {/* 交通费 */}
             {data.type?.value == 1 &&
               <View className="picker">

+ 1 - 1
src/pages/draftsdetail/index.config.js

@@ -1,3 +1,3 @@
 export default {
-  navigationBarTitleText: '报销信息详情',
+  navigationBarTitleText: '费用详情',
 }

+ 2 - 216
src/pages/draftsdetail/index.jsx

@@ -53,33 +53,6 @@ class Drafts extends Component {
       )
   }
 
-  // 报销账户列表
-  getMyList(id) {
-    let data = {
-      pageNo: 1,
-      pageSize: 99,
-    }
-    selectList(data).then(v => {
-      if (v.error.length === 0) {
-        let list = v.data.list || []
-        for (var i = 0; i < list.length; i++) {
-          if (list[i].aid == id) {
-            this.setState({
-              bankData: list[i]
-            })
-          }
-        }
-      } else {
-        Taro.showToast({ title: v.error[0].message, icon: 'none' })
-      }
-    }).catch(() => {
-      Taro.showToast({
-        title: '系统错误,请稍后再试',
-        icon: 'none'
-      })
-    })
-  }
-
   // 报销单详情
   getDetail() {
     getPridDetail({
@@ -99,7 +72,6 @@ class Drafts extends Component {
           totalDuration: v.data.duration,
           attachmentUrl: list,
         })
-        // v.data.aid && this.getMyList(v.data.aid)
       } else {
         Taro.showToast({ title: v.error[0].message, icon: 'none' })
       }
@@ -138,31 +110,6 @@ class Drafts extends Component {
     })
   }
 
-  // 审批
-  examine(val) {
-    Taro.showLoading({ title: '处理中...' });
-    AccountExamine({
-      id: this.state.data.id,
-      reason: this.state.reason,
-      status: val,
-    })
-      .then((v) => {
-        Taro.hideLoading();
-        if (v.error.length === 0) {
-          Taro.showToast({
-            title: "操作成功",
-            icon: "none",
-          });
-          this.getDetail()
-        } else {
-          Taro.showToast({ title: v.error[0].message, icon: "none" });
-        }
-      })
-      .catch((err) => {
-        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
-      });
-  }
-
 
   render() {
     const { data, list, total, bankData, attachmentUrl } = this.state
@@ -176,14 +123,14 @@ class Drafts extends Component {
         <View className="title">
           {getAccountName(data.type, data.typeOther)}
         </View>
-        {(data.status == 1 || data.status == 2) &&
+        {/* {(data.status == 1 || data.status == 2) &&
           <View className="formItem">
             <View className="formName" >编号:</View>
             <View className="formValue">{data.checkNo}</View>
             <View className='tbt'
               onClick={e => { e.stopPropagation(); copyText(data.checkNo) }}
             >复制编号打印</View>
-          </View>}
+          </View>} */}
         {data.type == 1 &&
           <View className="formItem">
             <View className="formName" >公出企业:</View>
@@ -228,32 +175,6 @@ class Drafts extends Component {
             </View>
           </View>}
         <View className="formTitle">
-          {(data.type == 4 || data.type == 5) ? "申请详细" : "报销详细"}
-        </View>
-        <View className="formItem">
-          <View className="formName">申请人:</View>
-          <View className="formValue">{data.aname}</View>
-        </View>
-        {
-          data.type != 4 && data.type != 5 &&
-          <View className="formItem">
-            <View className="formName">报销公司:</View>
-            <View className="formValue">{data.appDepName}</View>
-          </View>
-        }
-        <View className="formItem">
-          <View className="formName">
-            {data.type == 4
-              ? "预借支公司:" : data.type == 5
-                ? "抵扣公司:" : "支付公司:"}
-          </View>
-          <View className="formValue">{data.payDepName}</View>
-        </View>
-        <View className="formItem">
-          <View className="formName">{(data.type == 4 || data.type == 5) ? "说明:" : "报销事由:"}</View>
-          <View className="formValueremarks">{data.remarks}</View>
-        </View>
-        <View className="formTitle">
           {data.type != 4 && data.type != 5 && "报销"}费用详细
         </View>
         {/* 差旅费显示 */}
@@ -269,15 +190,12 @@ class Drafts extends Component {
                   <View className="formName">时间:</View>
                   <View className="formValue">
                     <View className="ftxt">{item.startTimeStr.slice(0, 16)}&nbsp;至&nbsp;{item.endTimeStr.slice(0, 16)}</View>
-                    {/* <View style={{ width: "50px", textAlign: "center" }}>至</View>
-                    <View className="ftxt">{item.endTimeStr.slice(0, 16)}</View> */}
                   </View>
                 </View>
                 <View className="formItem">
                   <View className="formName">地点:</View>
                   <View className="formValue">
                     <View className="ftxt">{item.startDistrict}</View>
-                    {/* <View style={{ width: "34px", textAlign: "center" }}>⇀</View> */}
                     <Image src={Right} style={icon} mode='aspectFit' />
                     <View className="ftxt">{item.endDistrict}</View>
                   </View>
@@ -393,138 +311,6 @@ class Drafts extends Component {
               />}
           </View>
         </View>
-        {data.type != 3 && data.type != 5 &&
-          <View className="formTitle" style={{ marginTop: "20px" }}>
-            报销至收款账户
-          </View>}
-        {data.type != 3 && data.type != 5 &&
-          <View className="unobstructedList">
-            {<View className="unItem" >
-              <View className="formItem">
-                <View className="formName">收款人:{data.name}</View>
-              </View>
-              <View className="formItem">
-                <View className="formName">收款银行:{data.bank}</View>
-              </View>
-              <View className="formItem">
-                <View className="formName">收款账户:{data.accounts}</View>
-              </View>
-            </View>}
-          </View>}
-
-        <View
-          className="select"
-          onClick={(e) => {
-            e.stopPropagation();
-            this.setState({
-              visible: true,
-              id: data.id
-            });
-          }}
-        >
-          查看审核详情
-          <AtIcon value="chevron-right" size="20" color="#fff" />
-        </View>
-
-        {
-          data.examine == 1 &&
-          <View>
-            <View className="formTitle" style={{ marginTop: "20px" }}>
-              填写审批意见
-            </View>
-            <AtTextarea
-              value={this.state.reason}
-              onChange={(value) => {
-                this.setState({
-                  reason: value,
-                });
-              }}
-              maxLength={30}
-              placeholder="请填写审批意见"
-            />
-            <View className="operation">
-              <AtButton
-                type="secondary"
-                circle
-                loading={this.state.loading}
-                onClick={() => {
-                  if (!this.state.reason) {
-                    Taro.showToast({ title: "请先填写审批意见", icon: "none" });
-                    return;
-                  }
-                  this.setState({
-                    isInquiryOpened: true,
-                    inquiryTitle: "提醒",
-                    inquiryContent: "您确定要驳回此申请吗?",
-                    inquiryFn: () => {
-                      this.examine(3);
-                    },
-                  });
-                }}
-              >
-                驳回
-              </AtButton>
-              <AtButton
-                type="primary"
-                loading={this.state.loading}
-                circle
-                onClick={() => {
-                  if (!this.state.reason) {
-                    Taro.showToast({ title: "请先填写审批意见", icon: "none" });
-                    return;
-                  }
-                  this.setState({
-                    isInquiryOpened: true,
-                    inquiryTitle: "提醒",
-                    inquiryContent: "您确定要同意此申请吗?",
-                    inquiryFn: () => {
-                      this.examine(1);
-                    },
-                  });
-                }}
-              >
-                同意
-              </AtButton>
-            </View>
-          </View>
-        }
-
-        {/* 二级确认弹窗 */}
-        <InquiryModal
-          isOpened={this.state.isInquiryOpened}
-          title={this.state.inquiryTitle}
-          content={this.state.inquiryContent}
-          onClose={() => {
-            this.setState({
-              isInquiryOpened: false,
-              inquiryTitle: "",
-              inquiryContent: "",
-              isNo: true,
-            });
-          }}
-          onDetermine={() => {
-            this.state.inquiryFn();
-            this.setState({
-              isInquiryOpened: false,
-              inquiryTitle: "",
-              inquiryContent: "",
-              isNo: true,
-              inquiryFn: () => { },
-            });
-          }}
-        />
-        {/* 审核详情 */}
-        {this.state.visible &&
-          <AuditModal
-            id={this.state.id}
-            isOpened={this.state.visible}
-            onClose={() => {
-              this.setState({
-                visible: false
-              })
-            }}
-          />}
-
       </View>
     );
   }

+ 5 - 1
src/pages/draftsdetail/index.less

@@ -167,7 +167,7 @@
     background: rgba(0, 51, 255, .09);
     padding: 20px 30px;
     margin: 15px 0 20px -30px;
-
+    // border-bottom: 1px dashed #000;
 
     .formItem {
       display: flex;
@@ -420,4 +420,8 @@
     }
   }
 
+}
+
+.at-image-picker__remove-btn{
+  display: none;
 }

+ 51 - 98
src/pages/examine/index.jsx

@@ -1,10 +1,10 @@
 import React, { Component } from 'react';
 import Taro from '@tarojs/taro';
 import { View, Picker, ScrollView, } from '@tarojs/components'
-import { AtTabs, AtTabsPane, AtIcon, } from 'taro-ui';
-import { getRecordList, } from '../../utils/servers/servers';
+import { AtTabs, AtTabsPane, AtIcon, AtSearchBar } from 'taro-ui';
+import { getRecordList, getNewRecordList } from '../../utils/servers/servers';
 import dayjs from 'dayjs';
-import { getAccountName, removeNull } from '../../utils/tools';
+import { getAccountName, getSecondaryAccountName, removeNull } from '../../utils/tools';
 import { accountLtate, } from '../../utils/tools/config'
 import ListBottomStart from "../../components/common/listBottomStart";
 import AuditModal from "../../components/common/auditModal";
@@ -41,9 +41,9 @@ class Examine extends Component {
     this.getPublicReleaseList();
   }
 
-  async componentDidMount() {
-    await this.getPublicReleaseList();
-  }
+  // async componentDidMount() {
+  //   await this.getPublicReleaseList();
+  // }
 
   onPullDownRefresh() {
     this.getPublicReleaseList();
@@ -91,13 +91,13 @@ class Examine extends Component {
     let data = {
       pageNo: pageNo,
       pageSize: 10,
-      startTime: this.state.rangeStartMinuteVal || undefined,
-      endTime: this.state.rangeEndMinuteVal || undefined,
-      status: isNaN(parseInt(this.state.starts.id)) ? undefined : String(this.state.starts.id),
-      examineStatus: this.state.current,
+      // startTime: this.state.rangeStartMinuteVal || undefined,
+      // endTime: this.state.rangeEndMinuteVal || undefined,
+      listStatus: this.state.current,
       processStatus: 1,
+      checkNo: this.state.searchValue,
     }
-    let msg = await getRecordList(removeNull(data));
+    let msg = await getNewRecordList(removeNull(data));
     if (msg.error.length === 0) {
       if (msg.data.totalCount === 0) {
         this.setState({
@@ -147,90 +147,26 @@ class Examine extends Component {
     return (
       <View className='indexPage' >
         <View className='searchContent'>
-          <ScrollView className={this.state.openSearch ? 'searchBottomLOL' : ''} scrollX style={{ width: '100%' }}>
-            <View className='searchBottom'>
-              <View className='searchItem' style={{ paddingLeft: '5px' }}>
-                <Picker
-                  value={this.state.starts.id}
-                  range={accountLtate} rangeKey='title' mode='selector'
-                  onChange={(e) => {
-                    this.setState({
-                      starts: accountLtate[e.detail.value],
-                    }, () => {
-                      this.getPublicReleaseList();
-                    })
-                  }}>
-                  {
-                    !this.state.starts.title ?
-                      <View className='shortValuecontent'>
-                        <View className='selectTitle'>状态</View>
-                        <View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
-                      </View> :
-                      <View className='shortValuecontent'>
-                        <View className='selectValue'>
-                          {this.state.starts.title}
-                        </View>
-                        <View className='iconContent' />
-                      </View>
-                  }
-                </Picker>
-                {
-                  this.state.starts.title &&
-                  <View className='searchSelectContent'>
-                    <View className='selectIcon'
-                      onClick={(e) => {
-                        e.stopPropagation();
-                        this.setState({
-                          starts: {}
-                        }, () => {
-                          this.getPublicReleaseList();
-                        })
-                      }}>
-                      <AtIcon value='close-circle' size='10' color='#FFFFFF' />
-                    </View>
-                  </View>
-                }
-              </View>
-              <View className='searchItem' onClick={() => {
+          <View className='searchTop'>
+            <AtSearchBar
+              showActionButton
+              placeholder='请输入报销编号'
+              value={this.state.searchValue}
+              onActionClick={() => {
+                this.getPublicReleaseList();
+              }}
+              onChange={(value) => {
                 this.setState({
-                  isPickerRender: true
+                  searchValue: value
                 })
-              }}>
-                <View>
-                  {
-                    !this.state.rangeStartMinuteVal ?
-                      <View className='valuecontent'>
-                        <View className='selectTitle'>开始及结束时间</View>
-                        <View className='iconContent' ><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
-                      </View> :
-                      <View className='valuecontent'>
-                        <View className='selectValue' >
-                          {this.state.rangeStartMinuteVal + "~" + this.state.rangeEndMinuteVal}
-                        </View>
-                        <View className='iconContent' />
-                      </View>
-                  }
-                </View>
-                {
-                  this.state.rangeStartMinuteVal &&
-                  <View className='searchSelectContent'>
-                    <View className='selectIcon'
-                      onClick={(e) => {
-                        e.stopPropagation();
-                        this.setState({
-                          rangeStartMinuteVal: '',
-                          rangeEndMinuteVal: '',
-                        }, () => {
-                          this.getPublicReleaseList();
-                        })
-                      }}>
-                      <AtIcon value='close-circle' size='10' color='#FFFFFF' />
-                    </View>
-                  </View>
-                }
-              </View>
-            </View>
-          </ScrollView>
+              }}
+              onClear={() => {
+                this.setState({
+                  searchValue: ''
+                })
+              }}
+            />
+          </View>
         </View>
         <AtTabs
           swipeable={false}
@@ -242,7 +178,7 @@ class Examine extends Component {
               pageNo: 1,
               current,
             }, () => {
-              this.getMyList();
+              this.getPublicReleaseList();
             })
           }}>
           {
@@ -257,15 +193,32 @@ class Examine extends Component {
                       <View className='item' key={item.id}
                         onClick={() => {
                           Taro.navigateTo({
-                            url: '/pages/draftsdetail/index?id=' + item.id
+                            url: '/pages/mergedetail/index?id=' + item.id
                           })
                         }}
                       >
-                        {item.status == 1 && <View className='lbt' onClick={e => { e.stopPropagation(); this.setState({ visible: true, id: item.id }) }}>查看审核详情</View>}
-                        <View className='line'>报销类型:{getAccountName(item.type, item.typeOther)}</View>
-                        <View className='line'>报销金额(元):{item.totalAmount}</View>
+                        {/* {item.status == 1 && <View className='lbt' onClick={e => { e.stopPropagation(); this.setState({ visible: true, id: item.id }) }}>查看审核详情</View>} */}
+                        <View className='line' style={{ color: "#6190E8" }}>报销编号:{item.checkNo}</View>
+                        <View className='line' style={{ color: "#6190E8" }}>总金额:{item.totalAmount}元</View>
                         <View className='line'>报销人:{item.aname}</View>
+                        <View className='line'>报销部门:{item.applyDepName}</View>
                         <View className='line'>报销时间:{item.createTimeStr}</View>
+                        <View className='lis'></View>
+                        {
+                          item.sonList?.map((it) =>
+                            <View key={it.id} style={{ marginTop: 10 }}>
+                              <View className='line'>报销金额(元):{it.totalAmount}</View>
+                              <View className='line'>报销类型:
+                                {getAccountName(it.type, it.typeOther)}
+                                {it.type == 2 && (" - " + getSecondaryAccountName(it.secondaryType, it.secondaryTypeOther))}
+                              </View>
+                              {it.type == 1 && <View className='line'>公出企业:{it.userNames}</View>}
+                              <View className='line'>{it.type == 1 ? "公出时间" : "费用时间"}:
+                                {!it.releaseStart ? "" : (it.releaseStart.slice(0, 10) + " 至 " + it.releaseEnd.slice(0, 10))}
+                              </View>
+                            </View>
+                          )
+                        }
                         <View className='lines'
                           style={{ color: accountLtate[item.status].color }}
                         >{item.status == 1 && `[${item.examineName}]`}{accountLtate[item.status].title}</View>

+ 6 - 1
src/pages/examine/index.less

@@ -2,7 +2,7 @@
   position: relative;
   z-index: 1;
   background: #F5F5F5;
-  min-height: calc(100vh - 52px);
+  min-height: calc(100vh);
 
   .searchContent {
     position: relative;
@@ -147,6 +147,11 @@
       position: relative;
       overflow: hidden;
       font-size: 26px;
+      
+      .lis{
+        height: 20px;
+        border-bottom: 1px dashed #000;
+      }
 
       .line {
         width: 100%;

+ 3 - 0
src/pages/mergedetail/index.config.js

@@ -0,0 +1,3 @@
+export default {
+  navigationBarTitleText: '报销信息详情',
+}

+ 803 - 0
src/pages/mergedetail/index.jsx

@@ -0,0 +1,803 @@
+import React, { Component } from "react";
+import Taro, { getCurrentInstance } from "@tarojs/taro";
+import { Text, View, Picker, Button, Image } from "@tarojs/components";
+import ImagePicker from "../../components/common/imagePicker";
+import InquiryModal from "../../components/common/inquiryModal";
+import AuditModal from "../../components/common/auditModal";
+import AccountModal from "../../components/common/accountModal";
+import {
+  getPridDetail,
+  getAccountList,
+  selectList,
+  AccountExamine,
+  getMainExpenseDetail,
+  getDepartmentList,
+  subMainAccount,
+} from "../../utils/servers/servers";
+import {
+  getAccountName,
+  getSecondaryAccountName,
+  getTypeName,
+  getVehicleName,
+  commonAdd,
+  copyText,
+  getNewOptions,
+  removeNull,
+} from "../../utils/tools";
+import {
+  AtTextarea,
+  AtButton,
+  AtIcon,
+  AtModal,
+  AtModalHeader,
+  AtModalContent,
+  AtRadio,
+  AtModalAction,
+} from "taro-ui";
+import { resourceAddress } from "../../utils/config";
+import Reviewed from '../../image/reviewed.png'
+import Rejected from '../../image/rejected.png'
+import Passed from '../../image/passed.png'
+
+import "taro-ui/dist/style/components/form.scss";
+import "taro-ui/dist/style/components/button.scss";
+import "taro-ui/dist/style/components/loading.scss";
+import "taro-ui/dist/style/components/icon.scss";
+import "taro-ui/dist/style/components/textarea.scss";
+import "taro-ui/dist/style/components/input.scss";
+
+import "./index.less";
+
+class Drafts extends Component {
+  $instance = getCurrentInstance();
+
+  constructor(props) {
+    super(props);
+    this.state = {
+      data: {},
+      list: [],
+      total: 0,
+      accountvisible: "",
+      bankData: {},
+      upaccount: false,
+      accountsList: [],
+      reason: "",
+      visible: false,
+    };
+  }
+
+  componentDidMount() {
+    this.getDepartmentList()
+    this.$instance.router.params && this.$instance.router.params.id &&
+      (
+        this.getDetail()
+        // this.getAccountList(),
+        // this.getMyList()
+      )
+  }
+
+  componentDidShow() {
+    let pages = Taro.getCurrentPages();
+    let currPage = pages[pages.length - 1]; // 获取当前页面
+    const { data } = this.state
+    const obj = {
+      buyerName: currPage.data.name || data.buyerName,
+      orderNo: currPage.data.orderNo || data.orderNo,
+      contractNo: currPage.data.contractNo || data.contractNo,
+    }
+    this.setState({
+      data: { ...this.state.data, ...obj },
+    })
+  }
+
+  // 部门数据
+  getDepartmentList() {
+    getDepartmentList({}).then(v => {
+      let thedata = v.data;
+      let theArr = [];
+      if (!thedata) {
+        if (v.error && v.error.length) {
+          Taro.showToast({ title: v.error[0].message, icon: 'none' })
+        }
+      } else {
+        thedata.map(function (item, index) {
+          theArr.push({
+            key: index,
+            name: item.name,
+            id: item.id
+          });
+        });
+      }
+      this.setState({
+        departmentArr: theArr
+      });
+    }).catch(() => {
+      Taro.showToast({
+        title: '系统错误,请稍后再试',
+        icon: 'none'
+      })
+    })
+  }
+
+  // 报销账户列表
+  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 {
+            let obj = {
+              name: list[0].name,
+              bank: list[0].bank,
+              accounts: list[0].accounts,
+              eaaid: list[0].id,
+            }
+            this.setState({
+              data: { ...this.state.data, ...obj },
+            })
+          }
+        }
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
+      }
+    }).catch(() => {
+      Taro.showToast({
+        title: '系统错误,请稍后再试',
+        icon: 'none'
+      })
+    })
+  }
+
+  // 详情
+  getDetail() {
+    getMainExpenseDetail({
+      id: this.$instance.router.params.id,
+    }).then(v => {
+      if (v.error.length === 0) {
+        this.setState({
+          data: v.data,
+        })
+        v.data.status == 0 && this.getMyList()
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
+      }
+    }).catch(() => {
+      Taro.showToast({
+        title: '系统错误,请稍后再试',
+        icon: 'none'
+      })
+    })
+  }
+
+  getUrls(url) {
+    let list = [];
+    for (let i of (url || '').split(',')) {
+      if (i) {
+        list.push({ 'url': resourceAddress + i })
+      }
+    }
+    return list
+  }
+
+  // 报销详情金额列表
+  getAccountList() {
+    getAccountList({
+      eaid: this.$instance.router.params.id,
+    }).then(v => {
+      if (v.error.length === 0) {
+        let sum = 0
+        for (var i = 0; i < v.data.length; i++) {
+          // sum += v.data[i].amount
+          sum = commonAdd(sum, v.data[i].amount)
+        }
+        this.setState({
+          list: v.data,
+          total: sum,
+        })
+
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
+      }
+    }).catch(() => {
+      Taro.showToast({
+        title: '系统错误,请稍后再试',
+        icon: 'none'
+      })
+    })
+  }
+
+  // 审批
+  examine(val) {
+    Taro.showLoading({ title: '处理中...' });
+    AccountExamine({
+      id: this.state.data.id,
+      reason: this.state.reason,
+      status: val,
+    })
+      .then((v) => {
+        Taro.hideLoading();
+        if (v.error.length === 0) {
+          Taro.showToast({
+            title: "操作成功",
+            icon: "none",
+          });
+          this.getDetail()
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: "none" });
+        }
+      })
+      .catch((err) => {
+        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+      });
+  }
+
+  onSubmit(val) {
+    this.setState({
+      loading: true,
+    });
+    const { data } = this.state
+    let comData = {
+      id: data.id,
+      orderNo: data.orderNo,
+      applyDep: data.applyDep,
+      payDep: data.payDep,
+      eaaid: data.eaaid,
+      remarks: data.remarks,
+      status: val
+    }
+    let comData1 = {
+      id: data.id,
+      status: val
+    }
+    subMainAccount(removeNull(val == 4 ? comData1 : comData))
+      .then((v) => {
+        this.setState({
+          loading: false,
+        })
+        if (v.error.length === 0) {
+          Taro.showToast({
+            title: "操作成功!",
+            icon: "none",
+          });
+          // Taro.switchTab({
+          //   url: "/pages/recordlist/index",
+          // });
+          Taro.navigateBack({
+            delta: 1
+          })
+        } else {
+          Taro.showToast({
+            title: v.error[0].message,
+            icon: "none",
+          });
+        }
+      })
+      .catch(() => {
+        this.setState({
+          loading: false,
+        });
+      });
+  }
+
+  // 取消添加
+  onAccountClose() {
+    this.setState({
+      accountvisible: "",
+    })
+  }
+
+  // 添加收款账户
+  onAccountOk() {
+    this.setState({
+      accountvisible: "",
+    }, () => { this.getMyList() })
+  }
+
+  // 确认收款账户
+  selectOn() {
+    let list = this.state.accountsList
+    for (var i = 0; i < list.length; i++) {
+      if (list[i].id == this.state.aid) {
+        const obj = {
+          eaaid: list[i].id,
+          name: list[i].name,
+          bank: list[i].bank,
+          accounts: list[i].accounts,
+        }
+        this.setState({
+          upaccount: false,
+          data: { ...this.state.data, ...obj },
+        })
+      }
+    }
+  }
+
+  render() {
+    const { data, } = this.state
+    const departmentArr = this.state.departmentArr || [];
+    const isEdit = data.status == 0 && data.processStatus == 0
+    return (
+      <View className="subform">
+        {/* <View className="title">
+          {getAccountName(data.type, data.typeOther)}
+        </View> */}
+        {<View className="formItem">
+          <View className="formName">报销编号:</View>
+          <View className="formValue">{data.checkNo}</View>
+          <View className='tbt'
+            onClick={e => { e.stopPropagation(); copyText(data.checkNo) }}
+          >复制编号</View>
+        </View>}
+        <View className="formItem">
+          <View className="formName" >总金额:</View>
+          <View className="formValue">{data.totalAmount}元</View>
+        </View>
+        <View className="formItem">
+          <View className="formName">报销至订单:</View>
+          <View className="formValue"
+            onClick={() => {
+              isEdit &&
+                Taro.navigateTo({
+                  url: "/pages/dataindex/index"
+                })
+            }}>
+            <View>
+              <View>{data.contractNo}</View>
+            </View>
+            {isEdit && <AtIcon value="chevron-right" size="20" color="#000000" />}
+          </View>
+        </View>
+        <View className="formItem">
+          <View className="formName">报销时间:</View>
+          <View className="formValue">{data.createTimeStr}</View>
+        </View>
+        <View className="formTitle">
+          {"报销详细"}
+          <Image className="ficon"
+            src={data.status == 1
+              ? Reviewed : data.status == 2
+                ? Passed : data.status == 3 && Rejected}
+          />
+        </View>
+        <View className="formItem">
+          <View className="formName">申请人:</View>
+          <View className="formValue">{data.aname}</View>
+        </View>
+        <View className="formItem">
+          <View className="formName">报销公司:</View>
+          {isEdit ?
+            <View className="formValue">
+              <Picker
+                value={departmentArr.findIndex(item => item.id === data.applyDep)}
+                range={departmentArr} rangeKey='name' mode='selector'
+                onChange={(e) => {
+                  const obj = { applyDep: departmentArr[e.detail.value].id, applyDepName: departmentArr[e.detail.value].name }
+                  this.setState({
+                    data: { ...data, ...obj },
+                  })
+                }}>
+                <View>
+                  {data.applyDepName}
+                  <AtIcon value="chevron-right" size="20" color="#000000" />
+                </View>
+              </Picker>
+            </View> :
+            <View className="formValue">{data.applyDepName}</View>}
+        </View>
+        <View className="formItem">
+          <View className="formName">支付公司:</View>
+          {isEdit ?
+            <View className="formValue">
+              <Picker
+                value={departmentArr.findIndex(item => item.id === data.payDep)}
+                range={departmentArr} rangeKey='name' mode='selector'
+                onChange={(e) => {
+                  const obj = { payDep: departmentArr[e.detail.value].id, payDepName: departmentArr[e.detail.value].name }
+                  this.setState({
+                    data: { ...data, ...obj },
+                  })
+                }}>
+                <View>
+                  {data.payDepName}
+                  <AtIcon value="chevron-right" size="20" color="#000000" />
+                </View>
+              </Picker>
+            </View> :
+            <View className="formValue">{data.payDepName}</View>}
+        </View>
+        <View className="formItem">
+          <View className="formName">
+            报销事由:
+          </View>
+          {isEdit ?
+            <View className="formValues">
+              <AtTextarea
+                value={data.remarks == null ? "" : data.remarks}
+                onChange={e => {
+                  const obj = { remarks: e }
+                  this.setState({
+                    data: { ...data, ...obj }
+                  })
+                }}
+                height={75}
+                maxLength={50}
+                placeholder={(data.type == 4 || data.type == 5) ? "请填写说明:" : "请填写报销事由"}
+              />
+            </View> :
+            <View className="formValueremarks">{data.remarks}</View>}
+        </View>
+        <View className="formTitle">
+          报销费用详细
+        </View>
+        {
+          data.sonList?.map((it) =>
+            <View key={it.id} style={{ borderTop: "1px solid #eae8e8" }}>
+              <View className="formItem">
+                <View className="formName">报销金额:</View>
+                <View className="formValue">{it.totalAmount}(元)</View>
+              </View>
+              <View className="formItem">
+                <View className="formName">报销类型:</View>
+                <View className="formValue">
+                  {getAccountName(it.type, it.typeOther)}
+                  {it.type == 2 && (" - " + getSecondaryAccountName(it.secondaryType, it.secondaryTypeOther))}
+                </View>
+              </View>
+              {it.type == 1 &&
+                <View className="formItem">
+                  <View className="formName">公出企业:</View>
+                  <View className="formValue">{it.userNames}</View>
+                </View>}
+              <View className="formItem">
+                <View className="formName">{it.type == 1 ? "公出时间" : "费用时间"}:</View>
+                <View className="formValue">
+                  {!it.releaseStart ? "" : (it.releaseStart.slice(0, 10) + " 至 " + it.releaseEnd.slice(0, 10))}
+                </View>
+              </View>
+              {/* 差旅费显示 */}
+              {it.type == 1 &&
+                it.detList?.map(item =>
+                  item.type == 1
+                    ? <View className="unItem" key={item.id}>
+                      <View className="formItem">
+                        <View className="formName">交通费:</View>
+                        <View className="formValue">
+                          {getVehicleName(item.vehicle, item.vehicleOther)}
+                          ({item.startDistrict + " - " + item.endDistrict})
+                          {item.amount}(元)
+                        </View>
+                      </View>
+                    </View>
+                    : <View className="unItem" key={item.id}>
+                      <View className="formItem" key={item.id}>
+                        <View className="formName" >{getTypeName(item.type) + ":"}</View>
+                        <View className="formValue">{item.amount}(元)</View>
+                      </View>
+                    </View>
+                )
+              }
+              {/* 通用 */}
+              {(it.type == 0 || it.type == 2 || it.type == 4 || it.type == 5) &&
+                it.detList?.map(item =>
+                  <View className="unItem" key={item.id}>
+                    {!!item.agreeTimeStr &&
+                      <View className="formItem">
+                        <View className="formName">{it.type == 5 ? "支付时间:" : "需付款时间:"}</View>
+                        <View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
+                      </View>}
+                    <View className="formItem">
+                      <View className="formName">
+                        {it.type == 4
+                          ? "预借支金额:" : it.type == 5
+                            ? "抵扣金额:" : "金额:"}
+                      </View>
+                      <View className="formValue">{item.amount}(元)</View>
+                    </View>
+                  </View>
+                )
+              }
+              {/* 第三方付款 */}
+              {it.type == 3 &&
+                it.detList?.map(item =>
+                  <View className="unItem" key={item.id}>
+                    {!!item.agreeTimeStr &&
+                      <View className="formItem">
+                        <View className="formName">需付款时间:</View>
+                        <View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
+                      </View>}
+                    <View className="formItem">
+                      <View className="formName">付款方式:</View>
+                      <View className="formValue">{["公对公转账"][item.payType]}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">发票类型:</View>
+                      <View className="formValue">{["普票", "专票"][item.invoiceType]}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">发票号:</View>
+                      <View className="formValue">{item.invoiceNo}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">付款单位:</View>
+                      <View className="formValue">{item.payerName}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">开户银行:</View>
+                      <View className="formValue">{item.openBank}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">银行账户:</View>
+                      <View className="formValue">{item.bankAccounts}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">开户行地址:</View>
+                      <View className="formValue">{item.openBankAddress}</View>
+                    </View>
+                    <View className="formItem">
+                      <View className="formName">金额:</View>
+                      <View className="formValue">{item.amount}(元)</View>
+                    </View>
+                  </View>
+                )
+              }
+              <View className="formItem" style={{ display: "block", paddingBottom: 0 }}>
+                <View className="formName">附件:</View>
+                <View
+                  className="formValue"
+                  style={{ paddingTop: "10px", textAlign: "left" }}
+                >
+                  {this.getUrls(it.attachmentUrl) && this.getUrls(it.attachmentUrl).length > 0 &&
+                    <ImagePicker
+                      files={this.getUrls(it.attachmentUrl)}
+                      showAddBtn={false}
+                    />}
+                </View>
+              </View>
+
+            </View>
+          )
+        }
+        {
+          data.type != 4 && data.debitTotalAmount &&
+          <View className="formItem">
+            <View className="formName">预借支:</View>
+            <View className="formValue"><Text style={{ color: "red" }}>{data.debitTotalAmount}</Text>(元)</View>
+          </View>
+        }
+        {
+          data.type != 4 && data.type != 5 &&
+          <View className="formItem">
+            <View className="formName">总金额:</View>
+            <View className="formValue"><Text style={{ color: "red" }}>{data.totalAmount}</Text>(元)</View>
+          </View>
+        }
+        {
+          data.type != 4 && data.type != 5 &&
+          <View className="formItem">
+            <View className="formName">实报金额:</View>
+            <View className="formValue"><Text style={{ color: "red" }}>{data.realAmount}</Text>(元)</View>
+          </View>
+        }
+        <View className="formTitle" style={{ marginTop: "20px" }}>
+          报销账户
+        </View>
+        <View className="unobstructedList" style={{ marginBottom: "20px" }}>
+          {
+            !data.eaaid && isEdit ?
+              <View className="noAccout"
+                onClick={() => { this.setState({ accountvisible: true }) }}>
+                暂未有收款账户
+                <View className="nbt">去添加 &gt;</View>
+              </View> :
+              <View className="unItem" >
+                {isEdit &&
+                  <View className="edit"
+                    onClick={() => {
+                      this.setState({
+                        upaccount: true,
+                        // aid: bankData.id,
+                      }, () => {
+                        this.getMyList(true)
+                      })
+                    }}
+                  >修改</View>}
+                <View className="formItem">
+                  <View className="formName">收款人:{data.name}</View>
+                </View>
+                <View className="formItem">
+                  <View className="formName">收款银行:{data.bank}</View>
+                </View>
+                <View className="formItem">
+                  <View className="formName">收款账户:{data.accounts}</View>
+                </View>
+              </View>
+          }
+        </View>
+
+        {
+          data.status != 0 &&
+          <View
+            className="select"
+            onClick={(e) => {
+              e.stopPropagation();
+              this.setState({
+                visible: true,
+                id: data.id
+              });
+            }}
+          >
+            查看审核详情
+            <AtIcon value="chevron-right" size="20" color="#fff" />
+          </View>
+        }
+        {
+          data.examine == 1 &&
+          <View>
+            <View className="formTitle" style={{ marginTop: "20px" }}>
+              填写审批意见
+            </View>
+            <AtTextarea
+              value={this.state.reason}
+              onChange={(value) => {
+                this.setState({
+                  reason: value,
+                });
+              }}
+              maxLength={30}
+              placeholder="请填写审批意见"
+            />
+            <View className="operation">
+              <AtButton
+                type="secondary"
+                circle
+                loading={this.state.loading}
+                onClick={() => {
+                  if (!this.state.reason) {
+                    Taro.showToast({ title: "请先填写审批意见", icon: "none" });
+                    return;
+                  }
+                  this.setState({
+                    isInquiryOpened: true,
+                    inquiryTitle: "提醒",
+                    inquiryContent: "您确定要驳回此申请吗?",
+                    inquiryFn: () => {
+                      this.examine(3);
+                    },
+                  });
+                }}
+              >
+                驳回
+              </AtButton>
+              <AtButton
+                type="primary"
+                loading={this.state.loading}
+                circle
+                onClick={() => {
+                  if (!this.state.reason) {
+                    Taro.showToast({ title: "请先填写审批意见", icon: "none" });
+                    return;
+                  }
+                  this.setState({
+                    isInquiryOpened: true,
+                    inquiryTitle: "提醒",
+                    inquiryContent: "您确定要同意此申请吗?",
+                    inquiryFn: () => {
+                      this.examine(1);
+                    },
+                  });
+                }}
+              >
+                同意
+              </AtButton>
+            </View>
+          </View>
+        }
+        {
+          isEdit &&
+          <View className="bottom">
+            <AtButton
+              disabled={this.state.loading}
+              type="primary"
+              circle
+              onClick={() => {
+                this.onSubmit(1)
+              }}
+            >
+              提交报销订单
+            </AtButton>
+          </View>
+        }
+        {
+          data.examine == 2 && data.status == 3 &&
+          <View className="bottom">
+            <AtButton
+              className="bt"
+              disabled={this.state.loading}
+              type="primary"
+              circle
+              onClick={() => {
+                this.onSubmit(4)
+              }}
+            >
+              取消报销订单
+            </AtButton>
+            <View className="btips">注:取消后,请重新发起报销</View>
+          </View>
+        }
+        {/* 收款账户添加 */}
+        {
+          this.state.accountvisible != "" &&
+          <AccountModal
+            isDefault={true}
+            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>
+        {/* 二级确认弹窗 */}
+        <InquiryModal
+          isOpened={this.state.isInquiryOpened}
+          title={this.state.inquiryTitle}
+          content={this.state.inquiryContent}
+          onClose={() => {
+            this.setState({
+              isInquiryOpened: false,
+              inquiryTitle: "",
+              inquiryContent: "",
+              isNo: true,
+            });
+          }}
+          onDetermine={() => {
+            this.state.inquiryFn();
+            this.setState({
+              isInquiryOpened: false,
+              inquiryTitle: "",
+              inquiryContent: "",
+              isNo: true,
+              inquiryFn: () => { },
+            });
+          }}
+        />
+        {/* 审核详情 */}
+        {this.state.visible &&
+          <AuditModal
+            id={this.state.id}
+            isOpened={this.state.visible}
+            onClose={() => {
+              this.setState({
+                visible: false
+              })
+            }}
+          />}
+
+      </View>
+    );
+  }
+}
+
+export default Drafts;

+ 464 - 0
src/pages/mergedetail/index.less

@@ -0,0 +1,464 @@
+.subform {
+  padding: 20px 30px;
+
+  .title {
+    // height: 72px;
+    font-size: 36px;
+    font-weight: bold;
+    margin: 0 auto 30px;
+    text-align: center;
+
+  }
+
+  .formItem {
+    position: relative;
+    display: flex;
+    // align-items: center;
+    align-items: flex-start;
+    font-size: 28px;
+    padding: 10px 0;
+
+    .formName {
+      white-space: nowrap;
+      display: flex;
+      align-items: center;
+
+    }
+
+    .formValue {
+      // text-align: right;
+      flex: 1;
+      display: flex;
+      flex-flow: row nowrap;
+      align-items: center;
+      // justify-content: flex-end;
+
+      picker {
+        flex: 1;
+        margin-left: 20px;
+      }
+
+      .button {
+        font-size: 22px;
+        padding: 0 10px;
+
+      }
+
+      .time {
+        flex: 1;
+        font-size: 28px;
+        // color: #bfbdbd;
+
+        .timeContent {
+          display: flex;
+          flex-direction: row;
+          align-items: center;
+          flex-wrap: nowrap;
+          // justify-content: flex-end;
+          // flex-flow: column nowrap;
+          // align-items: flex-end;
+          // justify-content: center;
+        }
+      }
+
+      .formValueText {
+        display: block;
+        width: 452px;
+        text-overflow: ellipsis;
+        overflow: hidden;
+        white-space: nowrap;
+      }
+    }
+
+    .formValues {
+      display: flex;
+      flex: 1;
+      flex-flow: row nowrap;
+
+      .at-textarea {
+        margin-left: 20px;
+      }
+
+      .at-textarea__textarea {
+        font-size: 28px;
+      }
+
+    }
+
+    .formValueremarks {
+      display: flex;
+      flex: 1;
+      // flex-wrap: wrap;
+      // margin-left: 20px;
+      // justify-content: flex-end;
+      word-break: break-all;
+
+    }
+
+    .tbt {
+      position: absolute;
+      right: -30px;
+      top: 0;
+      font-size: 20px;
+      padding: 15px;
+      color: #fff;
+      background: #ff4d4f;
+      border-bottom-left-radius: 100px;
+      border-top-left-radius: 100px;
+      z-index: 1;
+    }
+
+  }
+
+  .formTitle {
+    font-size: 32px;
+    font-weight: bold;
+    border-top: 1px solid #eae8e8;
+    padding: 20px 0;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    position: relative;
+
+    .ficon {
+      width: 200px;
+      height: 200px;
+      position: absolute;
+      right: 0;
+    }
+
+    .ftBottom {
+      margin: 0;
+    }
+
+  }
+
+  .operation {
+    display: flex;
+    flex-flow: row nowrap;
+    margin: 30px 0;
+  }
+
+  .select {
+    display: flex;
+    flex-flow: row nowrap;
+    justify-content: space-between;
+    align-items: center;
+    font-size: 28px;
+    color: #fff;
+    background: #6190E8;
+    margin: 40px auto;
+    padding: 20px;
+    border-radius: 20px;
+
+  }
+
+  .unobstructedList {
+    .noAccout {
+      border: 1px solid #eae8e8;
+      border-radius: 10px;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      padding: 30px 0;
+
+      .nbt {
+        color: #6190E8;
+      }
+
+    }
+  }
+
+  .unItem {
+    width: 690px;
+    position: relative;
+    background: rgba(0, 51, 255, .09);
+    padding: 20px 30px;
+    margin: 15px 0 20px -30px;
+    // border-bottom: 1px dashed #000;
+
+    .edit {
+      position: absolute;
+      top: 20px;
+      right: 20px;
+      font-size: 26px;
+      background: rgb(97, 144, 232);
+      color: #fff;
+      padding: 10px;
+      border-radius: 8px;
+      z-index: 1;
+
+    }
+
+    .formItem {
+      display: flex;
+      font-size: 28px;
+      padding: 10px 0;
+      align-items: baseline;
+
+      .formName {
+        // min-width: 150px;
+        // margin-right: 16px;
+        white-space: nowrap;
+        display: flex;
+
+      }
+
+      .formValues {
+        display: flex;
+        flex: 1;
+
+      }
+
+      .formValue {
+        flex: 1;
+        display: flex;
+        flex-flow: row nowrap;
+        align-items: center;
+        // justify-content: flex-end;
+
+        .ftxt {
+          // width: 40%;
+          text-align: right;
+        }
+
+      }
+
+    }
+
+
+  }
+
+  .inputFormItem {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 28px;
+
+    .close {
+      font-size: 26px;
+      background: red;
+      color: #fff;
+      padding: 10px;
+      border-radius: 8px;
+      margin-right: 20px;
+
+    }
+
+    .at-input input {
+      font-size: 28px;
+    }
+
+    .at-input {
+      width: 100%;
+      margin-left: 0;
+      padding: 10px 0;
+
+      .at-input__title {
+        font-size: 28px;
+        color: #000000;
+
+      }
+
+      .at-input__input {
+        font-size: 28px;
+
+      }
+
+    }
+
+    .at-input::after {
+      border: 0;
+    }
+
+  }
+
+  .inputFormItems {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 28px;
+
+    .close {
+      font-size: 26px;
+      background: red;
+      color: #fff;
+      padding: 10px;
+      border-radius: 8px;
+      margin-right: 20px;
+
+    }
+
+    .at-input input {
+      font-size: 28px;
+    }
+
+    .at-input {
+      width: 70%;
+      margin-left: 0;
+      padding: 15px 0;
+
+      .at-input__title {
+        font-size: 28px;
+        color: #000000;
+
+      }
+
+      .at-input__input {
+        font-size: 28px;
+
+      }
+
+    }
+
+    .at-input::after {
+      border: 0;
+    }
+
+  }
+
+  .tips {
+    color: #ff0000;
+    font-size: 20px;
+    margin-left: 20px;
+
+  }
+
+  .bottom {
+    width: 60%;
+    padding: 30px 0;
+    margin: 0 auto;
+
+    .bt {
+      background: red;
+      color: #fff;
+      border: 0;
+
+    }
+
+    .btips {
+      margin-top: 5px;
+      text-align: center;
+      font-size: 24px;
+      color: red;
+  
+    }
+
+  }
+
+}
+
+.at-modal__container {
+  width: 710px;
+}
+
+.modal {
+  // min-height: 400px;
+
+  .picker {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    margin: 25px 0 20px;
+
+    .ptit {
+      display: flex;
+      flex-direction: row;
+      margin-right: 16px;
+      width: 172px;
+      font-size: 28px;
+      line-height: 1.5;
+      vertical-align: middle;
+      text-align: left;
+    }
+
+    picker {
+      width: 70%;
+    }
+
+  }
+
+  .at-input input {
+    font-size: 28px;
+  }
+
+  .at-input {
+    width: 100%;
+    margin-left: 0;
+    padding: 15px 0;
+
+    .at-input__title {
+      font-size: 28px;
+      color: #000000;
+
+    }
+
+    .at-input__input {
+      font-size: 28px;
+
+    }
+
+  }
+
+  .at-input::after {
+    border: 0;
+  }
+
+  .pub {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    padding: 15px 0;
+    // margin: 25px 0 20px;
+
+    .ptit {
+      display: flex;
+      flex-direction: row;
+      margin-right: 16px;
+      width: 172px;
+      font-size: 28px;
+      line-height: 1.5;
+      vertical-align: middle;
+      text-align: left;
+
+    }
+
+    .ptxt {
+      width: 70%;
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      flex-wrap: nowrap;
+
+      .pin {
+        text-align: center;
+        border-bottom: 1px solid #eae8e8;
+      }
+
+      .pick {
+        display: flex;
+        flex-direction: row;
+        flex-wrap: nowrap;
+        // font-size: 28px;
+
+        .ptime {
+          text-align: center;
+          border-bottom: 1px solid #eae8e8;
+        }
+
+      }
+
+      .ricon {
+        width: 200px;
+        height: 20px;
+      }
+
+    }
+  }
+
+}
+
+.at-image-picker__remove-btn {
+  display: none;
+}

+ 30 - 22
src/pages/mybusiness/index.jsx

@@ -60,9 +60,9 @@ class MyBusiness extends Component {
     this.getPublicReleaseList();
   }
 
-  async componentDidMount() {
-    await this.getPublicReleaseList();
-  }
+  // async componentDidMount() {
+  //   await this.getPublicReleaseList();
+  // }
 
   onPullDownRefresh() {
     this.getPublicReleaseList();
@@ -160,20 +160,23 @@ class MyBusiness extends Component {
   getByDrafts(id) {
     selectByPrid({
       prid: id,
-      status: 0, //  0=草稿,1=审核中,2=完成,3=驳回
+      // status: 0, //  0=草稿,1=审核中,2=完成,3=驳回
     }).then((v) => {
       if (v.error.length === 0) {
         if (v.data) {
           // 1有草稿未提交
-          Taro.navigateTo({
-            url: '/pages/drafts/index?id=' + v.data
-          })
+          if (v.data.status == 0 || v.data.status == 3) {
+            Taro.navigateTo({
+              url: '/pages/drafts/index?id=' + v.data.id
+            })
+          } else {
+            Taro.showToast({
+              title: "不能重复发起",
+              icon: "none"
+            })
+          }
         } else {
           this.creatOrder(id)
-          // this.setState({
-          //   id,
-          //   visible: "add",
-          // })
         }
       } else {
         Taro.showToast({ title: v.error[0].message, icon: "none" });
@@ -204,15 +207,20 @@ class MyBusiness extends Component {
     })
   }
 
-  onPup(id) {
-    this.setState({
-      isInquiryOpened: true,
-      inquiryTitle: "温馨提醒",
-      inquiryContent: "您确定要发起此次公出费用报销吗?",
-      inquiryFn: () => {
-        this.getByDrafts(id)
-      },
-    });
+  onPup(t, id) {
+    if (t) {
+      this.setState({
+        isInquiryOpened: true,
+        inquiryTitle: "温馨提醒",
+        inquiryContent: "您确定要发起此次公出费用报销吗?",
+        inquiryFn: () => {
+          this.getByDrafts(id)
+        },
+      });
+    } else {
+      this.getByDrafts(id)
+    }
+
   }
 
 
@@ -422,8 +430,8 @@ class MyBusiness extends Component {
                   onRefresh={() => {
                     this.getPublicReleaseList(true);
                   }}
-                  initiate={(id) => {
-                    this.onPup(id)
+                  initiate={(t, id) => {
+                    this.onPup(t, id)
                   }}
 
                 />

+ 14 - 4
src/pages/mybusiness/list.jsx

@@ -60,18 +60,28 @@ class List extends Component {
                   <View
                     className="nopunchClock"
                   >
-                    发起报销
+                    报销
                   </View>
                 }
                 {
-                  v.status == 2 &&
+                  !!v.expenseAmount &&
+                  <View className="punchClock"
+                    onClick={() => {
+                      this.props.initiate(false, v.id)
+                    }}
+                  >
+                    报销{v.expenseAmount}元
+                  </View>
+                }
+                {
+                  !v.expenseAmount && v.status == 2 &&
                   <View
                     className="punchClock"
                     onClick={() => {
-                      this.props.initiate(v.id)
+                      this.props.initiate(true, v.id)
                     }}
                   >
-                    发起报销
+                    报销
                   </View>
                 }
                 <View className="releaseEnds">

+ 1 - 1
src/pages/myinfo/index.config.js

@@ -1,5 +1,5 @@
 export default {
-  navigationBarTitleText: '我的',
+  navigationBarTitleText: '我的报销账户',
   enablePullDownRefresh: true,
   onReachBottomDistance: 50,
   usingComponents: {

+ 12 - 6
src/pages/myinfo/index.jsx

@@ -27,9 +27,9 @@ class myInfo extends Component {
     this.selectList();
   }
 
-  async componentDidMount() {
-    await this.selectList();
-  }
+  // async componentDidMount() {
+  //   await this.selectList();
+  // }
 
   onPullDownRefresh() {
     this.selectList();
@@ -127,10 +127,10 @@ class myInfo extends Component {
     const { visible, list, data } = this.state
     return (
       <View className="myinfo">
-        <View className="head">
+        {/* <View className="head">
           <UserFloatingLayer />
           <View className="mtitle">收款账户管理</View>
-        </View>
+        </View> */}
         <View className="mlist">
           {
             list.length > 0
@@ -161,7 +161,13 @@ class myInfo extends Component {
           }
         </View>
         <View className="mbottom">
-          <AtButton type="primary" onClick={() => { this.setState({ visible: "add" }) }}>+ 新增收款账户</AtButton>
+          <AtButton
+            type="primary"
+            circle
+            onClick={() => {
+              this.setState({ visible: "add" })
+            }}
+          >+ 新增收款账户</AtButton>
         </View>
         {visible != "" &&
           <AccountModal

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

@@ -26,7 +26,7 @@ page {
   .mlist {
     display: flex;
     flex-direction: column;
-    padding-top: 200px;
+    padding-top: 20px;
 
     .mitem {
       position: relative;

+ 8 - 0
src/pages/mymerge/index.config.js

@@ -0,0 +1,8 @@
+export default {
+  navigationBarTitleText: '我的报销单',
+  enablePullDownRefresh: true,
+  onReachBottomDistance: 50,
+  usingComponents: {
+    // timePicker: '../../components/common/timePicker/timePicker'
+  }
+}

+ 284 - 0
src/pages/mymerge/index.jsx

@@ -0,0 +1,284 @@
+import React, { Component } from 'react';
+import Taro from '@tarojs/taro';
+import { View, Picker, ScrollView, } from '@tarojs/components'
+import { AtTabs, AtTabsPane, AtIcon, AtSearchBar } from 'taro-ui';
+import { getRecordList, getNewRecordList } from '../../utils/servers/servers';
+import UserFloatingLayer from "../../components/common/userFloatingLayer";
+import dayjs from 'dayjs';
+import { getAccountName, getSecondaryAccountName, removeNull } 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';
+import "taro-ui/dist/style/components/flex.scss";
+import "taro-ui/dist/style/components/action-sheet.scss";
+import "taro-ui/dist/style/components/icon.scss";
+import "taro-ui/dist/style/components/list.scss";
+import "taro-ui/dist/style/components/icon.scss";
+import "taro-ui/dist/style/components/modal.scss";
+
+class Examine extends Component {
+
+  constructor(props) {
+    super(props);
+    this.state = {
+      typeList: [
+        { title: '我的报销列表' },],
+      current: 0,
+      starts: {},
+      list: [],
+      visible: false,
+    }
+  }
+
+  componentDidShow() {
+    this.setState({
+      visible: false,
+    })
+    this.getPublicReleaseList();
+  }
+
+  // async componentDidMount() {
+  //   await this.getPublicReleaseList();
+  // }
+
+  onPullDownRefresh() {
+    this.getPublicReleaseList();
+  }
+
+  onReachBottom() {
+    this.getPublicReleaseList(true);
+  }
+
+  onTabItemTap(obj) {
+    if (obj.index === 1) {
+      this.onTabTap();
+    }
+  }
+
+  onPickerHide() {
+    this.setState({
+      isPickerRender: false,
+    });
+  }
+
+
+  async onSetPickerTime(val) {
+    let data = val.detail;
+    await this.setState({
+      rangeStartMinuteVal: dayjs(data.selectStartTime).format("YYYY-MM-DD"),
+      rangeEndMinuteVal: dayjs(data.selectEndTime).format("YYYY-MM-DD")
+    })
+    await this.getMyList(1);
+  }
+
+  async onTabTap() {
+    await this.getMyList(1);
+  }
+
+  async getPublicReleaseList(lv) {
+    await this.getMyList(lv ? this.state.pageNo + 1 : 1);
+    Taro.stopPullDownRefresh();
+  }
+
+  async getMyList(pageNo) {
+    this.setState({
+      listState: 'LOADING'
+    })
+    let data = {
+      pageNo: pageNo,
+      pageSize: 10,
+      // startTime: this.state.rangeStartMinuteVal || undefined,
+      // endTime: this.state.rangeEndMinuteVal || undefined,
+      listStatus: this.state.current,
+      processStatus: 0,
+      checkNo: this.state.searchValue,
+    }
+    let msg = await getNewRecordList(removeNull(data));
+    if (msg.error.length === 0) {
+      if (msg.data.totalCount === 0) {
+        this.setState({
+          listState: 'NO_DATA'
+        })
+      } else if (msg.data.totalCount === this.state.list.length && pageNo !== 1) {
+        Taro.showToast({ title: '没有更多数据了', icon: 'none' });
+        this.setState({
+          listState: 'NO_MORE_DATA'
+        })
+      } else {
+        if (msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list)).length) {
+          this.setState({
+            listState: 'NO_MORE_DATA'
+          })
+        }
+      }
+      this.setState({
+        list: pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list),
+        pageNo: msg.data.list.length === 0 ? this.state.pageNo : msg.data.pageNo
+      })
+    } else {
+      Taro.showToast({ title: msg.error[0].message, icon: 'none' });
+      this.setState({
+        listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
+      })
+    }
+    Taro.stopPullDownRefresh();
+  }
+
+  onPageScroll(event) {
+    let touchMove = event.scrollTop;
+    if (touchMove >= 37) {
+      this.setState({
+        openSearch: true
+      })
+    } else {
+      this.setState({
+        openSearch: false
+      })
+    }
+  }
+
+
+  render() {
+    const { list } = this.state
+    return (
+      <View className='indexPage' >
+        <View className="heads">
+          <UserFloatingLayer />
+          <View className="right"
+            onClick={() => {
+              Taro.navigateTo({
+                url: "/pages/myinfo/index"
+              })
+            }}
+          >我的报销账户</View>
+        </View>
+        <View className='searchContent'>
+          <View className='searchTop'>
+            <AtSearchBar
+              showActionButton
+              placeholder='请输入报销编号'
+              value={this.state.searchValue}
+              onActionClick={() => {
+                this.getPublicReleaseList();
+              }}
+              onChange={(value) => {
+                this.setState({
+                  searchValue: value
+                })
+              }}
+              onClear={() => {
+                this.setState({
+                  searchValue: ''
+                })
+              }}
+            />
+          </View>
+        </View>
+        <AtTabs
+          swipeable={false}
+          current={this.state.current || 0}
+          tabList={this.state.typeList}
+          onClick={(current) => {
+            this.setState({
+              list: [],
+              pageNo: 1,
+              current,
+            }, () => {
+              this.getMyList();
+            })
+          }}>
+          {
+            this.state.typeList?.map((item, index) =>
+              <AtTabsPane
+                current={this.state.current}
+                index={index}
+              >
+                <View className='list'>
+                  {
+                    list?.map((item) =>
+                      <View className='item' key={item.id}
+                        onClick={() => {
+                          Taro.navigateTo({
+                            url: '/pages/mergedetail/index?id=' + item.id
+                          })
+                        }}
+                      >
+                        {/* {item.status == 1 && <View className='lbt' onClick={e => { e.stopPropagation(); this.setState({ visible: true, id: item.id }) }}>查看审核详情</View>} */}
+                        <View className='line' style={{ color: "#6190E8" }}>报销编号:{item.checkNo}</View>
+                        <View className='line' style={{ color: "#6190E8" }}>总金额:{item.totalAmount}元</View>
+                        <View className='line'>报销人:{item.aname}</View>
+                        <View className='line'>报销部门:{item.applyDepName}</View>
+                        <View className='line'>报销时间:{item.createTimeStr}</View>
+                        <View className='lis'></View>
+                        {
+                          item.sonList?.map((it) =>
+                            <View key={it.id} style={{ marginTop: 10 }}>
+                              <View className='line'>报销金额(元):{it.totalAmount}</View>
+                              <View className='line'>报销类型:
+                                {getAccountName(it.type, it.typeOther)}
+                                {it.type == 2 && (" - " + getSecondaryAccountName(it.secondaryType, it.secondaryTypeOther))}
+                              </View>
+                              {it.type == 1 && <View className='line'>公出企业:{it.userNames}</View>}
+                              <View className='line'>{it.type == 1 ? "公出时间" : "费用时间"}:
+                                {!it.releaseStart ? "" : (it.releaseStart.slice(0, 10) + " 至 " + it.releaseEnd.slice(0, 10))}
+                              </View>
+                            </View>
+                          )
+                        }
+                        <View className='lines'
+                          style={{ color: accountLtate[item.status].color }}
+                        >{item.status == 1 && `[${item.examineName}]`}{accountLtate[item.status].title}</View>
+                      </View>
+                    )
+                  }
+                  <ListBottomStart
+                    state={this.state.listState}
+                    reload={() => {
+                      this.getPublicReleaseList(true)
+                    }}
+                  />
+                </View>
+              </AtTabsPane>
+            )
+          }
+        </AtTabs>
+        <timePicker
+          config={{
+            endDate: true,
+            column: "day",
+            dateLimit: false,
+            limitStartTime: dayjs().subtract(3, 'year').format('YYYY-MM-DD '),
+            limitEndTime: dayjs().add(3, 'year').format('YYYY-MM-DD ')
+          }}
+          isPartition
+          pickerShow={this.state.isPickerRender}
+          onconditionaljudgment={(v) => {
+          }}
+          onhidepicker={() => {
+            this.onPickerHide()
+          }}
+          onsetpickertime={(v) => {
+            this.onSetPickerTime(v)
+          }}>
+        </timePicker>
+        {/* 审核详情 */}
+        {this.state.visible &&
+          <AuditModal
+            id={this.state.id}
+            isOpened={this.state.visible}
+            onClose={() => {
+              this.setState({
+                visible: false
+              })
+            }}
+          />}
+      </View >
+    )
+  }
+}
+
+export default Examine

+ 199 - 0
src/pages/mymerge/index.less

@@ -0,0 +1,199 @@
+.indexPage {
+  position: relative;
+  z-index: 1;
+  background: #F5F5F5;
+  min-height: calc(100vh);
+
+  .heads{
+    background: #fff;
+    position: relative;
+
+    .right{
+      position: absolute;
+      padding: 20px 20px 0 0;
+      right: 0;
+      top: 0;
+      color: #6190E8;
+
+    }
+
+  }
+
+  .searchContent {
+    position: relative;
+    background: white;
+    padding: 20px;
+
+    .searchTop {
+      z-index: 1000;
+    }
+
+    .searchBottom {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      background: #FFFFFF;
+      border-bottom-left-radius: 10px;
+      border-bottom-right-radius: 10px;
+      padding: 10px 0 10px 0;
+
+      .searchBottomBack {
+        position: fixed;
+        z-index: -1;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        top: 100px;
+        background: rgba(0, 0, 0, .7);
+      }
+
+      .searchItem {
+        position: relative;
+        font-size: 25px;
+        color: #FFFFFF;
+
+        .shortValuecontent {
+          position: relative;
+          display: flex;
+          align-items: center;
+          text-align: center;
+          width: 200px;
+          background: #6190E8;
+          border-radius: 100px;
+          padding: 10px 0;
+          margin-right: 5px;
+
+          .selectValue {
+            width: 100%;
+            text-align: center;
+            white-space: nowrap;
+          }
+
+          .selectTitle {
+            width: 100%;
+            text-align: center;
+          }
+
+          .iconContent {
+            position: absolute;
+            right: 0;
+            width: 60px;
+            text-align: center;
+          }
+        }
+
+        .valuecontent {
+          position: relative;
+          display: flex;
+          align-items: center;
+          width: 440px;
+          background: #6190E8;
+          border-radius: 100px;
+          padding: 10px 0;
+          margin-right: 5px;
+
+          .selectValue {
+            width: 100%;
+            text-align: center;
+            white-space: nowrap;
+          }
+
+          .selectTitle {
+            width: 100%;
+            text-align: center;
+            white-space: nowrap;
+          }
+
+          .iconContent {
+            position: absolute;
+            right: 0;
+            width: 60px;
+            text-align: center;
+          }
+        }
+
+        .searchSelectContent {
+          position: absolute;
+          right: 0;
+          top: 0;
+          bottom: 0;
+          z-index: 1;
+          width: 45px;
+          padding-right: 20px;
+          text-align: right;
+          display: flex;
+          justify-content: flex-end;
+          align-items: center;
+          padding-bottom: 3px;
+        }
+
+        .closeIcon {
+          background: #F00;
+          width: 60px;
+          height: 46px;
+          display: flex;
+          padding-left: 20px;
+          align-items: center;
+        }
+      }
+    }
+
+    .searchBottomLOL {
+      position: fixed;
+      z-index: 1000;
+      top: 0;
+      left: 0;
+      right: 0;
+      box-shadow: 0px 6px 27px 16px #8e8d8d;
+      background: #FFFFFF;
+    }
+  }
+
+  .list {
+    padding: 20px 23px 52px 23px;
+
+    .item {
+      border-radius: 10px;
+      padding: 31px;
+      background: #FFFFFF;
+      display: flex;
+      flex-direction: column;
+      margin-bottom: 17px;
+      position: relative;
+      overflow: hidden;
+      font-size: 26px;
+      
+      .lis{
+        height: 20px;
+        border-bottom: 1px dashed #000;
+      }
+
+      .line {
+        width: 100%;
+        padding: 5px 0;
+
+      }
+
+      .lines {
+        width: 100%;
+        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;
+
+      }
+
+    }
+
+  }
+
+}

+ 1 - 1
src/pages/recordlist/index.config.js

@@ -1,5 +1,5 @@
 export default {
-  navigationBarTitleText: '报销记录',
+  navigationBarTitleText: '费用列表',
   enablePullDownRefresh: true,
   onReachBottomDistance: 50,
   usingComponents: {

+ 189 - 20
src/pages/recordlist/index.jsx

@@ -1,13 +1,15 @@
 import React, { Component } from 'react';
 import Taro from '@tarojs/taro';
-import { View, Picker, ScrollView, } from '@tarojs/components'
-import { getRecordList, } from '../../utils/servers/servers';
+import { View, Picker, ScrollView, Image, Button } from '@tarojs/components'
+import { getRecordList, subMrge } from '../../utils/servers/servers';
 import dayjs from 'dayjs';
-import { AtIcon, } from 'taro-ui';
-import { getAccountName, removeNull, copyText } from '../../utils/tools';
+import { AtIcon, AtSearchBar } from 'taro-ui';
+import { getAccountName, getSecondaryAccountName, removeNull, copyText, commonAdd } from '../../utils/tools';
 import { accountLtate, } from '../../utils/tools/config'
 import ListBottomStart from "../../components/common/listBottomStart";
 import AuditModal from "../../components/common/auditModal";
+import sels from "../../image/sels.png";
+import sel from "../../image/sel.png";
 
 import './index.less';
 import 'taro-ui/dist/style/components/tabs.scss';
@@ -23,9 +25,19 @@ class Examine extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      starts: {},
+      starts: {
+        title: '待提交',
+        id: 0,
+        color: '#f1662f'
+      },
       list: [],
       visible: false,
+      sublist: [],
+      searchType: { title: "按编号", id: 0 },
+      search: [
+        { title: "按编号", id: 0 },
+        { title: "按企业名称", id: 1 },
+      ]
     }
   }
 
@@ -36,9 +48,9 @@ class Examine extends Component {
     this.getPublicReleaseList();
   }
 
-  async componentDidMount() {
-    await this.getPublicReleaseList();
-  }
+  // async componentDidMount() {
+  //   await this.getPublicReleaseList();
+  // }
 
   onPullDownRefresh() {
     this.getPublicReleaseList();
@@ -90,6 +102,8 @@ class Examine extends Component {
       endTime: this.state.rangeEndMinuteVal || undefined,
       status: isNaN(parseInt(this.state.starts.id)) ? undefined : String(this.state.starts.id),
       processStatus: 0,
+      username: this.state.searchType.id == 1 ? this.state.searchValue : undefined,
+      checkNo: this.state.searchType.id == 0 ? this.state.searchValue : undefined,
     }
     let msg = await getRecordList(removeNull(data));
     if (msg.error.length === 0) {
@@ -135,12 +149,118 @@ class Examine extends Component {
     }
   }
 
+  onChecked(item) {
+    let list = this.state.sublist
+    list.includes(item.id)
+      ? list = list.filter(function (value) {
+        return value !== item.id;
+      }, this)
+      : list.push(item.id)
+    this.setState({
+      sublist: list
+    })
+  }
+
+  onAllCheck() {
+    const { list, } = this.state
+    let nlist = this.state.sublist
+    if (list.length == nlist.length) {
+      nlist = []
+    } else {
+      nlist = list.map(i => i.id)
+    }
+    this.setState({
+      sublist: nlist
+    })
+  }
+
+  getAmount(slist) {
 
-  render() {
     const { list } = this.state
+    let xlist = []
+    let amount = 0
+    for (var i = 0; i < list.length; i++) {
+      for (var j = 0; j < slist.length; j++) {
+        if (list[i].id == slist[j]) {
+          xlist.push(list[i])
+        }
+      }
+    }
+    for (var k = 0; k < xlist.length; k++) {
+      amount = commonAdd(amount, xlist[k].totalAmount)
+    }
+    return amount
+  }
+
+  subMerge() {
+    let data = {
+      ids: this.state.sublist.toString()
+    }
+    this.setState({
+      loading: true,
+    });
+    subMrge(data)
+      .then((v) => {
+        this.setState({
+          loading: false,
+        })
+        if (v.error.length === 0) {
+          Taro.navigateTo({
+            url: '/pages/mergedetail/index?id=' + v.data,
+          });
+        } else {
+          Taro.showToast({
+            title: v.error[0].message,
+            icon: "none",
+          });
+        }
+      })
+      .catch(() => {
+        this.setState({
+          loading: false,
+        });
+      });
+  }
+
+
+  render() {
+    const { list, sublist, searchType, search } = this.state
     return (
       <View className='indexPage' >
         <View className='searchContent'>
+          <View className='searchTop'>
+            <Picker
+              value={searchType.id}
+              range={search} rangeKey='title' mode='selector'
+              onChange={(e) => {
+                this.setState({
+                  searchType: search[e.detail.value],
+                })
+              }}>
+              <View className='shortValuecontent'>
+                <View className='selectTitle'>{searchType.title}</View>
+                <View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
+              </View>
+            </Picker>
+            <AtSearchBar
+              showActionButton
+              placeholder='请输入'
+              value={this.state.searchValue}
+              onActionClick={() => {
+                this.getPublicReleaseList();
+              }}
+              onChange={(value) => {
+                this.setState({
+                  searchValue: value
+                })
+              }}
+              onClear={() => {
+                this.setState({
+                  searchValue: ''
+                })
+              }}
+            />
+          </View>
           <ScrollView className={this.state.openSearch ? 'searchBottomLOL' : ''} scrollX style={{ width: '100%' }}>
             <View className='searchBottom'>
               <View className='searchItem' style={{ paddingLeft: '5px' }}>
@@ -240,15 +360,39 @@ 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>
-                {(item.status == 1 || item.status == 2) && <View className='line'>编号:{item.checkNo}</View>}
-                {(item.status == 1 || item.status == 2) && <View className='lbts' onClick={e => { e.stopPropagation(); copyText(item.checkNo) }}>复制编号打印</View>}
-                <View className='lines'
-                  style={{ color: accountLtate[item.status].color }}
-                >{item.status == 1 && `[${item.examineName}]`}{accountLtate[item.status].title}</View>
+                <View className='left'
+                  onClick={e => {
+                    e.stopPropagation();
+                    item.status == 0
+                      ? this.onChecked(item)
+                      : Taro.showToast({ title: '只能选择待提交的费用!', icon: 'none' })
+                  }}>
+                  <Image className='check' src={sublist.includes(item.id) ? sels : sel} />
+                </View>
+                <View className='right'>
+                  {/* {item.status == 1 && <View className='lbt' onClick={e => { e.stopPropagation(); this.setState({ visible: true, id: item.id }) }}>查看审核详情</View>} */}
+                  <View className='line' style={{ color: "#6190E8" }}>报销金额:{item.totalAmount}</View>
+                  {!!item.checkNo && <View className='line' style={{ color: "#6190E8" }}>报销编号:{item.checkNo}</View>}
+                  {!!item.checkNo && <View className='lbt' onClick={e => { e.stopPropagation(); copyText(item.checkNo) }}>复制编号</View>}
+                  <View className='line'>
+                    报销类型:
+                    {getAccountName(item.type, item.typeOther)}
+                    {item.type == 2 && (" - " + getSecondaryAccountName(item.secondaryType, item.secondaryTypeOther))}
+                  </View>
+                  {/* {<View className='line'>报销至订单:{item.contractNo || "固定费用"}</View>} */}
+                  {!!item.applyDepName && <View className='line'>报销至部门:{item.applyDepName}</View>}
+                  {item.type == 1 && <View className='line'>公出企业:{item.userNames}</View>}
+                  <View className='line'>
+                    {item.type == 1 ? "公出时间" : "费用时间"}:
+                    {!item.releaseStartStr ? "" : (item.releaseStartStr.slice(0, 10) + " 至 " + item.releaseEndStr.slice(0, 10))}
+                  </View>
+                  <View className='lines'
+                    style={{ color: accountLtate[item.status].color }}
+                  >
+                    {/* {item.status == 1 && `[${item.examineName}]`} */}
+                    {accountLtate[item.status].title}
+                  </View>
+                </View>
               </View>
             )
           }
@@ -259,6 +403,29 @@ class Examine extends Component {
             }}
           />
         </View>
+        {
+          list.length > 0 &&
+          <View className='bottom'>
+            <View className='lbt'>
+              {this.state.starts.id == 0 &&
+                <View className='lbtxt'
+                  onClick={() => {
+                    this.onAllCheck()
+                  }}
+                >
+                  <Image className='lbtck' src={list.length == sublist.length ? sels : sel} />
+                  全选
+                </View>}
+              报销金额:{this.getAmount(sublist)}元
+            </View>
+            <Button
+              disabled={sublist.length == 0}
+              className='rbt'
+              type='primary'
+              onClick={() => { this.subMerge() }}
+            >可多选,发起报销</Button>
+          </View>
+        }
         <timePicker
           config={{
             endDate: true,
@@ -278,7 +445,8 @@ class Examine extends Component {
             this.onSetPickerTime(v)
           }}>
         </timePicker>
-        {this.state.visible &&
+        {
+          this.state.visible &&
           <AuditModal
             id={this.state.id}
             isOpened={this.state.visible}
@@ -287,7 +455,8 @@ class Examine extends Component {
                 visible: false
               })
             }}
-          />}
+          />
+        }
       </View >
     )
   }

+ 146 - 34
src/pages/recordlist/index.less

@@ -2,7 +2,7 @@
   position: relative;
   z-index: 1;
   background: #F5F5F5;
-  min-height: calc(100vh - 52px);
+  height: calc(100vh);
 
   .searchContent {
     position: relative;
@@ -11,6 +11,47 @@
 
     .searchTop {
       z-index: 1000;
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      justify-content: space-between;
+
+      .at-search-bar{
+        width: 70%;
+      }
+
+      .shortValuecontent {
+        position: relative;
+        display: flex;
+        align-items: center;
+        text-align: center;
+        width: 200px;
+        background: #6190E8;
+        border-radius: 100px;
+        padding: 10px 0;
+        margin-left: 10px;
+        font-size: 25px;
+        color: #FFFFFF;
+
+        .selectValue {
+          width: 100%;
+          text-align: center;
+          white-space: nowrap;
+        }
+
+        .selectTitle {
+          width: 100%;
+          text-align: center;
+        }
+
+        .iconContent {
+          position: absolute;
+          right: 0;
+          width: 60px;
+          text-align: center;
+        }
+      }
+
     }
 
     .searchBottom {
@@ -136,56 +177,127 @@
 
   .list {
     padding: 20px 23px 52px 23px;
+    display: flex;
+    flex-direction: column;
+    flex: 1;
 
     .item {
+      display: flex;
+      flex-direction: row;
       border-radius: 10px;
-      padding: 31px;
+      padding: 30px 30px 30px 0;
       background: #FFFFFF;
-      display: flex;
-      flex-direction: column;
       margin-bottom: 17px;
-      position: relative;
-      overflow: hidden;
-      font-size: 26px;
 
-      .line {
-        width: 100%;
-        padding: 5px 0;
+      .left {
+        padding: 0 15px 0 30px;
 
-      }
+        .check {
+          width: 32px;
+          height: 32px;
 
-      .lines {
-        width: 100%;
-        padding: 5px 0;
-        text-align: right;
+        }
       }
 
-      .lbt {
-        position: absolute;
-        right: 0;
-        font-size: 20px;
-        padding: 15px;
-        color: #fff;
-        background: #1D4FEA;
-        border-bottom-left-radius: 100px;
-        border-top-left-radius: 100px;
+      .right {
+        display: flex;
+        flex: 1;
+        flex-direction: column;
+        position: relative;
+        font-size: 26px;
+
+
+        .line {
+          width: 100%;
+          padding: 5px 0;
+          display: flex;
+          flex-direction: row;
+          align-items: center;
+
+        }
+
+        .lines {
+          width: 100%;
+          padding: 5px 0;
+          text-align: right;
+        }
+
+        .lbt {
+          position: absolute;
+          right: -30px;
+          top: 30px;
+          font-size: 20px;
+          padding: 15px;
+          color: #fff;
+          background: #6190E8;
+          border-bottom-left-radius: 100px;
+          border-top-left-radius: 100px;
+
+        }
+
+        .lbts {
+          position: absolute;
+          right: 0;
+          top: 140px;
+          font-size: 20px;
+          padding: 15px;
+          color: #fff;
+          background: #ff4d4f;
+          border-bottom-left-radius: 100px;
+          border-top-left-radius: 100px;
+        }
+
+
 
       }
 
-      .lbts {
-        position: absolute;
-        right: 0;
-        top: 140px;
-        font-size: 20px;
-        padding: 15px;
-        color: #fff;
-        background: #ff4d4f;
-        border-bottom-left-radius: 100px;
-        border-top-left-radius: 100px;
+    }
+
+  }
+
+  .bottom {
+    width: 94%;
+    height: 100px;
+    background: #fff;
+    position: fixed;
+    bottom: 0;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 3%;
+
+    .lbt {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      font-size: 24px;
+
+      .lbtxt {
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        margin-right: 20px;
+
+        .lbtck {
+          width: 32px;
+          height: 32px;
+          margin-right: 10px;
+
+        }
+
       }
 
     }
 
+    .rbt {
+      background: #6190E8;
+      // border-radius: 100px;
+      font-size: 28px;
+      margin: 0;
+
+    }
+
   }
 
 }

+ 2 - 2
src/utils/config.js

@@ -1,7 +1,7 @@
 // 本地
 // export const resourceAddress = 'http://172.16.0.255:3000/upload';
 // 生产
-export const resourceAddress = 'https://s.jishutao.com/upload';
+// export const resourceAddress = 'https://s.jishutao.com/upload';
 // 测试
-// export const resourceAddress = 'https://static.jishutao.com/upload';
+export const resourceAddress = 'https://static.jishutao.com/upload';
 

+ 2 - 2
src/utils/servers/baseUrl.js

@@ -8,8 +8,8 @@ const getBaseUrl = (url) => {
   } else {
     // 生产环境
     // BASE_URL = 'http://172.16.0.255:8080'
-    // BASE_URL = 'https://uat.jishutao.com'
-    BASE_URL = 'https://bm.jishutao.com'
+    BASE_URL = 'https://uat.jishutao.com'
+    // BASE_URL = 'https://bm.jishutao.com'
   }
   return BASE_URL
 }

+ 20 - 0
src/utils/servers/servers.js

@@ -87,6 +87,11 @@ export const getPridDetail = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccount/selectById', postData)
 }
 
+// 新-报销记录详情
+export const getMainExpenseDetail = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/expenseAccount/mainExpense', postData)
+}
+
 // 私有账号列表
 export const selectList = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccountPrivate/selectList', postData)
@@ -112,6 +117,11 @@ export const getRecordList = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccount/pageList', postData)
 }
 
+// 主报销记录列表
+export const getNewRecordList = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/expenseAccount/mainList', postData)
+}
+
 // 报销审核流程
 export const getAccountLog = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/expenseAccount/log/list', postData)
@@ -145,4 +155,14 @@ export const getDrbitNote = (postData = {}) => {
 // 报销审核
 export const AccountExamine = (postData = {}) => {
   return HTTPREQUEST.post('/api/admin/expenseAccount/examine', postData)
+}
+
+// 合并报销
+export const subMrge= (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/expenseAccount/merge', postData)
+}
+
+// 修改主报销
+export const subMainAccount = (postData = {}) => {
+  return HTTPREQUEST.post('/api/admin/expenseAccount/updateMain', postData)
 }

+ 12 - 2
src/utils/tools/config.js

@@ -71,9 +71,18 @@ export const accountList = [
   { label: '其他', value: 0, desc: '自行填写' }
 ]
 
+export const nonBusiness = [
+  { label: '招待费', value: 8, },
+  { label: '办公费', value: 9, },
+  { label: '福利费', value: 10, },
+  { label: '物业水电费', value: 11, },
+  { label: '打印费', value: 12, },
+  { label: '其他', value: 0, },
+]
+
 export const accountLtate = [
   {
-    title: '未提交',
+    title: '提交',
     id: 0,
     color: '#f1662f'
   },
@@ -83,7 +92,7 @@ export const accountLtate = [
     color: '#1d4fea'
   },
   {
-    title: '完成',
+    title: '完成',
     id: 2,
     color: '#34de38'
   },
@@ -101,6 +110,7 @@ export const typeList = [
   { label: '餐费', value: 4 },
   { label: '出差补贴', value: 5 },
   // { label: '预借支', value: 6 },
+  { label: '油费', value: 7 },
   { label: '其他', value: 0, }
 ]
 

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

@@ -1,4 +1,4 @@
-import { clockState, clockJournalState, accountList, typeList, vehiclelist } from './config';
+import { clockState, clockJournalState, accountList, nonBusiness, typeList, vehiclelist } from './config';
 import dayjs from "dayjs";
 import Taro from "@tarojs/taro";
 
@@ -170,6 +170,20 @@ export const getAccountName = (type, other = "其他") => {
   return theType;
 }
 
+// 获取报销申请类型 二级
+export const getSecondaryAccountName = (type, other = "其他") => {
+  let theType = "";
+  nonBusiness.map(function (item) {
+    if (item.value == type) {
+      theType = item.label;
+      if (item.value == 0) {
+        theType = other
+      }
+    }
+  });
+  return theType;
+}
+
 // 获取报销费用类型
 export const getTypeName = (type, other = "其他") => {
   let theType = "";