dev01 1 год назад
Родитель
Сommit
a008f130ec

+ 2 - 2
src/app.jsx

@@ -85,11 +85,11 @@ class App extends Component {
         'token': token,
       },
       // 生产
-      url: 'wss://bm.jishutao.com/webSocketServer',
+      // url: 'wss://bm.jishutao.com/webSocketServer',
       // 本地
       // url: 'wss://172.16.0.255:8080/webSocketServer'
       // 测试
-      // url: 'wss://uat.jishutao.com/webSocketServer'
+      url: 'wss://uat.jishutao.com/webSocketServer'
     })
 
     //连接成功

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

@@ -258,7 +258,7 @@ class AccountFrom extends Component {
           <AtInput
             name='amount'
             title={type == 4 ? "借支金额:" : "金额:"}
-            type='text'
+            type='digit'
             placeholder='请填写金额(元)'
             value={data.amount}
             onChange={e => {

+ 36 - 32
src/pages/drafts/index.jsx

@@ -16,6 +16,7 @@ import {
   AtRadio,
   AtModalAction,
   AtIcon,
+  AtToast,
 } from "taro-ui";
 import {
   getPridDetail,
@@ -92,7 +93,6 @@ class Drafts extends Component {
     this.setState({
       data: { ...this.state.data, ...obj },
     })
-
     this.getAccountList();
 
   }
@@ -265,9 +265,15 @@ class Drafts extends Component {
 
   // 报销单详情
   getDetail() {
+    this.setState({
+      loading: true
+    })
     getPridDetail({
       id: this.$instance.router.params.id,
     }).then(v => {
+      this.setState({
+        loading: false
+      })
       if (v.error.length === 0) {
         let list = [];
         for (let i of (v.data.attachmentUrl || '').split(',')) {
@@ -282,11 +288,14 @@ class Drafts extends Component {
           totalDuration: v.data.duration,
           imgs: list,
         })
-        this.getAccountList()
+        // this.getAccountList()
       } else {
         Taro.showToast({ title: v.error[0].message, icon: 'none' })
       }
     }).catch(() => {
+      this.setState({
+        loading: false
+      })
       Taro.showToast({
         title: '系统错误,请稍后再试!',
         icon: 'none'
@@ -296,10 +305,16 @@ class Drafts extends Component {
 
   // 报销详情金额列表
   getAccountList() {
+    this.setState({
+      loading: true
+    })
     const { data } = this.state
     getAccountList({
       eaid: this.$instance.router.params.id,
     }).then(v => {
+      this.setState({
+        loading: false
+      })
       if (v.error.length === 0) {
         let sum = 0
         for (var i = 0; i < v.data.length; i++) {
@@ -317,6 +332,9 @@ class Drafts extends Component {
         Taro.showToast({ title: v.error[0].message, icon: 'none' })
       }
     }).catch(() => {
+      this.setState({
+        loading: false
+      })
       Taro.showToast({
         title: '系统错误,请稍后再试',
         icon: 'none'
@@ -862,10 +880,8 @@ 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"
@@ -881,23 +897,18 @@ 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
@@ -918,14 +929,11 @@ 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>
-        }
-        {
-          data.type != 3 && data.type != 5 &&
+          </View>}
+        {data.type != 3 && data.type != 5 &&
           <View className="unobstructedList">
             {(!bankData.id)
               ? <View className="noAccout" onClick={() => { this.setState({ accountvisible: true }) }}>
@@ -953,8 +961,7 @@ class Drafts extends Component {
                   <View className="formName">收款账户:{bankData.accounts}</View>
                 </View>
               </View>}
-          </View>
-        }
+          </View>}
         <View className="bottom">
           <AtButton
             disabled={this.state.loading}
@@ -992,16 +999,14 @@ 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>
@@ -1018,16 +1023,15 @@ 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}
-          />
-        }
+          />}
+        <AtToast isOpened={this.state.loading} text="Loading..." status='loading' />
       </View >
     );
   }

+ 27 - 4
src/pages/drafts/modal.jsx

@@ -109,7 +109,7 @@ class Modal extends Component {
       return
     }
     var isMoney = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
-    if(!isMoney.test(data.amount)){
+    if (!isMoney.test(data.amount)) {
       Taro.showToast({ title: "请填写正确的报销金额", icon: "none", });
       return
     }
@@ -134,6 +134,7 @@ class Modal extends Component {
         });
         if (v.error.length === 0) {
           this.props.onClose()
+          Taro.setStorageSync('location', { start: data.startDistrict, end: data.endDistrict })
         } else {
           Taro.showToast({
             title: v.error[0].message,
@@ -148,6 +149,18 @@ class Modal extends Component {
       });
   }
 
+  swap() {
+    const temp = this.state.data.startDistrict;
+    this.setState({
+      data: {
+        ...this.state.data,
+        ...{
+          startDistrict: this.state.data.endDistrict,
+          endDistrict: temp
+        }
+      }
+    });
+  }
 
 
   render() {
@@ -167,8 +180,18 @@ class Modal extends Component {
                 value={data.type.value == 0 ? typeList.length - 1 : data.type.value - 1}
                 range={typeList} rangeKey='label' mode='selector'
                 onChange={(e) => {
+                  let obj = {
+                    type: typeList[e.detail.value]
+                  }
+                  if (this.props.visible == "add" && e.detail.value == 0) {
+                    let location = Taro.getStorageSync('location')
+                    if (location) {
+                      obj.startDistrict = location.start
+                      obj.endDistrict = location.end
+                    }
+                  }
                   this.setState({
-                    data: { ...data, type: typeList[e.detail.value] }
+                    data: { ...data, ...obj }
                   })
                 }}>
                 <View className='selModal'>
@@ -261,7 +284,7 @@ class Modal extends Component {
                     }}
 
                   />
-                  <Image src={Right} className='ricon' mode='aspectFit' />
+                  <Image src={Right} className='ricon' mode='aspectFit' onClick={this.swap.bind(this)} />
                   {/* <Text style={{ fontSize: "30px", padding: "0 5px" }}>⇀</Text> */}
                   <AtInput name="endDistrict" className="pin" type='text' placeholder='目的地' value={data.endDistrict}
                     onChange={e => {
@@ -277,7 +300,7 @@ class Modal extends Component {
                 required
                 name='amount'
                 title='金额:'
-                type='text'
+                type='digit'
                 placeholder='请填写金额(元)'
                 value={data.amount}
                 onChange={e => {

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

@@ -175,9 +175,15 @@ class Drafts extends Component {
       <View className="subform">
         <View className="title">
           {getAccountName(data.type, data.typeOther)}
-          {data.status == 2 && <View className='tbt'
-            onClick={e => { e.stopPropagation(); copyText(data.checkNo) }}>复制编号打印</View>}
         </View>
+        {(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>}
         {data.type == 1 &&
           <View className="formItem">
             <View className="formName" >公出企业:</View>

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

@@ -2,28 +2,16 @@
   padding: 20px 30px;
 
   .title {
-    position: relative;
-    height: 72px;
+    // 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 {
+    position: relative;
     display: flex;
     // align-items: center;
     align-items: flex-start;
@@ -106,6 +94,19 @@
       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;
+    }
+
   }
 
   .formTitle {

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

@@ -241,10 +241,11 @@ 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>
+                {(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>

+ 14 - 2
src/pages/recordlist/index.less

@@ -163,8 +163,8 @@
       .lbt {
         position: absolute;
         right: 0;
-        font-size: 24px;
-        padding: 20px;
+        font-size: 20px;
+        padding: 15px;
         color: #fff;
         background: #1D4FEA;
         border-bottom-left-radius: 100px;
@@ -172,6 +172,18 @@
 
       }
 
+      .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;
+      }
+
     }
 
   }

+ 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
 }