소스 검색

修复账户默认问题、新增一键复制报销单编号

dev01 2 년 전
부모
커밋
e98d156ce6

+ 2 - 2
src/components/common/accountModal/index.jsx

@@ -131,7 +131,7 @@ class AccountModal extends Component {
 
   render() {
     const { data = {}, } = this.state
-    const { visible = "", onClose } = this.props;
+    const { visible = "", isDefault = false, onClose } = this.props;
     return (
       <View>
         <AtModal
@@ -193,7 +193,7 @@ class AccountModal extends Component {
           <AtModalAction>
             <Button onClick={onClose}>取消</Button>
             <Button onClick={this.onSubmit.bind(this, visible, 1)}>保存并设置为默认账户</Button>
-            <Button onClick={this.onSubmit.bind(this, visible, 0)}>保存账户</Button>
+            {!isDefault && <Button onClick={this.onSubmit.bind(this, visible, 0)}>保存账户</Button>}
           </AtModalAction>
         </AtModal>
         <BankModal

+ 2 - 1
src/components/common/bankModal/index.jsx

@@ -1,7 +1,7 @@
 import React, { Component } from "react";
 import Taro from "@tarojs/taro";
 import { View, } from "@tarojs/components";
-import { AtDrawer, AtIndexes } from "taro-ui";
+import { AtDrawer, AtIndexes, } from "taro-ui";
 import { bankList } from '../../../utils/tools/config';
 
 import './index.less';
@@ -57,6 +57,7 @@ class BankModal extends Component {
             topKey='常'
             list={bankList}
             onClick={this.onClick.bind(this)}
+            onScrollIntoView={fn => { this.scrollIntoView = fn }}
             animation
           >
             <View className='custom'>

+ 1 - 0
src/pages/drafts/index.jsx

@@ -995,6 +995,7 @@ class Drafts extends Component {
         {
           this.state.accountvisible != "" &&
           <AccountModal
+            isDefault={true}
             isSub={true}
             visible={this.state.accountvisible}
             onClose={this.onAccountClose.bind(this)}

+ 6 - 1
src/pages/draftsdetail/index.jsx

@@ -15,6 +15,7 @@ import {
   getTypeName,
   getVehicleName,
   commonAdd,
+  copyText,
 } from "../../utils/tools";
 import { AtTextarea, AtButton, AtIcon } from "taro-ui";
 import { resourceAddress } from "../../utils/config";
@@ -172,7 +173,11 @@ class Drafts extends Component {
     }
     return (
       <View className="subform">
-        <View className="title">{getAccountName(data.type, data.typeOther)}</View>
+        <View className="title">
+          {getAccountName(data.type, data.typeOther)}
+          {data.status == 2 && <View className='tbt'
+            onClick={e => { e.stopPropagation(); copyText(data.checkNo) }}>复制编号打印</View>}
+        </View>
         {data.type == 1 &&
           <View className="formItem">
             <View className="formName" >公出企业:</View>

+ 15 - 0
src/pages/draftsdetail/index.less

@@ -2,10 +2,25 @@
   padding: 20px 30px;
 
   .title {
+    position: relative;
+    height: 72px;
     font-size: 36px;
     font-weight: bold;
     margin: 0 auto 30px;
     text-align: center;
+
+    .tbt{
+      position: absolute;
+      right: -30px;
+      top: 0;
+      font-size: 24px;
+      padding: 20px;
+      color: #fff;
+      background: #ff4d4f;
+      border-bottom-left-radius: 100px;
+      border-top-left-radius: 100px;
+    }
+
   }
 
   .formItem {

+ 1 - 0
src/pages/myinfo/index.jsx

@@ -165,6 +165,7 @@ class myInfo extends Component {
         </View>
         {visible != "" &&
           <AccountModal
+            isDefault={list.length == 0 ? true : false}
             data={data}
             visible={visible}
             onClose={this.onClose.bind(this)}

+ 2 - 1
src/pages/recordlist/index.jsx

@@ -4,7 +4,7 @@ import { View, Picker, ScrollView, } from '@tarojs/components'
 import { getRecordList, } from '../../utils/servers/servers';
 import dayjs from 'dayjs';
 import { AtIcon, } from 'taro-ui';
-import { getAccountName, removeNull } from '../../utils/tools';
+import { getAccountName, removeNull, copyText } from '../../utils/tools';
 import { accountLtate, } from '../../utils/tools/config'
 import ListBottomStart from "../../components/common/listBottomStart";
 import AuditModal from "../../components/common/auditModal";
@@ -241,6 +241,7 @@ class Examine extends Component {
                 }}
               >
                 {item.status == 1 && <View className='lbt' onClick={e => { e.stopPropagation(); this.setState({ visible: true, id: item.id }) }}>查看审核详情</View>}
+                {item.status == 2 && <View className='lbt' style={{ background: "#ff4d4f" }} onClick={e => { e.stopPropagation(); copyText(item.checkNo) }}>复制编号打印</View>}
                 <View className='line'>报销金额:{item.totalAmount}元</View>
                 <View className='line'>报销时间:{item.createTimeStr}</View>
                 <View className='line'>报销类型:{getAccountName(item.type, item.typeOther)}</View>

+ 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/tools/index.js

@@ -2,6 +2,26 @@ import { clockState, clockJournalState, accountList, typeList, vehiclelist } fro
 import dayjs from "dayjs";
 import Taro from "@tarojs/taro";
 
+// 一键复制
+export const copyText = (text) => {
+  Taro.setClipboardData({
+    data: text,
+    success: function (res) {
+      Taro.getClipboardData({
+        success: function (res) {
+          Taro.showToast({
+            title: '复制成功',
+            icon: 'success',
+            duration: 2000
+          })
+        }
+      })
+    }
+  })
+}
+
+
+
 export const getClockState = (id, journal = false) => {
   let arr = journal ? clockJournalState.filter(v => v.id === id) : clockState.filter(v => v.id === id);
   if (arr.length > 0) {