Browse Source

附件上传逻辑

dev01 1 year ago
parent
commit
4c5d52277f

+ 2 - 1
src/app.config.js

@@ -33,7 +33,8 @@ export default {
         selectedIconPath: './image/myselect.png',
         pagePath: 'pages/mybusiness/index',
         text: '我的'
-      }],
+      }
+    ],
     'color': '#515151',
     'selectedColor': '#56abe4',
     'backgroundColor': '#fff',

+ 4 - 4
src/app.jsx

@@ -87,12 +87,12 @@ class App extends Component {
       header: {
         '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'
     })
 
     //连接成功

+ 20 - 14
src/pages/applyDepart/publicContent.jsx

@@ -142,15 +142,14 @@ class PublicContent extends Component {
       });
       return;
     }
-    if (this.props.enterpriseInfor.type == 0 && this.state.totalDuration > 4 && this.state.imgs.length == 0) {
+    let info = Taro.getStorageSync("userInfor");
+    if (this.state.totalDuration > info.workTimeInfor.minHours && this.state.imgs.length == 0) {
       Taro.showToast({ title: "请上传附件", icon: "none" });
       return
     }
-
     this.setState({
       loading: true,
     });
-    const { selectArrderLocation } = this.props
     let datas = {
       objectType,
       uids: this.props.enterpriseInfor.id,
@@ -323,6 +322,7 @@ class PublicContent extends Component {
 
   render() {
     const { cList, coorderList, popup } = this.state
+    const info = Taro.getStorageSync("userInfor");
     return (
       <View className="publicContent">
         <View className="formItem">
@@ -365,6 +365,11 @@ class PublicContent extends Component {
         <View className="formItem">
           <View className="formName">作息时间类型:</View>
           <View className="formValue">
+            {this.state.workTypeList[this.state.workType]
+              ? this.state.workTypeList[this.state.workType].name
+              : ""}
+          </View>
+          {/* <View className="formValue">
             <picker
               onChange={(e) => {
                 this.setState({
@@ -395,7 +400,7 @@ class PublicContent extends Component {
                 <AtIcon value="chevron-right" size="20" color="#bbbbbb" />
               </view>
             </picker>
-          </View>
+          </View> */}
         </View>
         <View className="formItem">
           <View className="formName">公出时间:</View>
@@ -583,7 +588,7 @@ class PublicContent extends Component {
         >
           {/* 公出目标 */}
           <View className="formName">
-            <Text style={{ color: "red" }}>*公出目标:</Text>
+            <Text><Text style={{ color: "red" }}>*</Text>公出目标:</Text>
             <View
               className="formValue"
               style={{ paddingTop: "10px", textAlign: "left" }}
@@ -608,7 +613,7 @@ class PublicContent extends Component {
           {/* 公出计划 */}
           {this.props.enterpriseInfor.type != 2 && (
             <View className="formName">
-              <Text style={{ color: "red" }}>*公出计划:</Text>
+              <Text><Text style={{ color: "red" }}>*</Text>公出计划:</Text>
               <View
                 className="formValue"
                 style={{ paddingTop: "10px", textAlign: "left" }}
@@ -630,7 +635,7 @@ class PublicContent extends Component {
           {/* 预计效果 */}
           {this.props.enterpriseInfor.type != 2 && (
             <View className="formName">
-              <Text style={{ color: "red" }}>*预计效果:</Text>
+              <Text><Text style={{ color: "red" }}>*</Text>预计效果:</Text>
               <View
                 className="formValue"
                 style={{ paddingTop: "10px", textAlign: "left" }}
@@ -652,7 +657,14 @@ class PublicContent extends Component {
         </View>
         {/*  */}
         <View className="formItem" style={{ display: "block", paddingBottom: 0 }}>
-          <View className="formName">附件:</View>
+          <View className="formName">
+            {this.state.totalDuration > info.workTimeInfor.minHours && <Text style={{ color: "red" }}>*</Text>}
+            附件:
+          </View>
+          {this.state.totalDuration > info.workTimeInfor.minHours &&
+            <View className="tips">
+              请上传公出事由的凭证截图,如您与企业的对话截图等
+            </View>}
           <View
             className="formValue"
             style={{ paddingTop: "10px", textAlign: "left" }}
@@ -665,12 +677,6 @@ class PublicContent extends Component {
             />
           </View>
         </View>
-        {
-          this.props.enterpriseInfor.type == 0 && this.state.totalDuration > 4 && this.state.imgs.length == 0 &&
-          <View className="tips" style={{ paddingBottom: "40px" }}>
-            您公出时长超过4小时,请上传凭证截图!
-          </View>
-        }
         <View className="operation">
           <AtButton
             disabled={this.state.loading}

+ 2 - 0
src/pages/applyDepart/publicContent.less

@@ -126,6 +126,7 @@
     color: #f00;
     background: #c9c9c9;
     padding: 20px 100px;
+    margin-bottom: 28px;
     
   }
 
@@ -139,6 +140,7 @@
   .operation {
     display: flex;
     flex-flow: row nowrap;
+    margin-top: 40px;
   }
 
   .at-modal__container {

+ 20 - 5
src/pages/egressDetails/publicContent.jsx

@@ -209,7 +209,8 @@ class PublicContent extends Component {
       });
       return;
     }
-    if (this.props.dtails.type == 0 && this.state.totalDuration > 4 && this.state.imgs.length == 0) {
+    let info = Taro.getStorageSync("userInfor");
+    if (this.state.totalDuration > info.workTimeInfor.minHours && this.state.imgs.length == 0) {
       Taro.showToast({ title: "请上传附件", icon: "none" });
       return
     }
@@ -515,6 +516,7 @@ class PublicContent extends Component {
   render() {
     const { dtails, type, again = false } = this.props;
     const { cList, coorderList, popup } = this.state
+    const info = Taro.getStorageSync("userInfor");
     return (
       <View className="publicContent">
         <View className="formItem">
@@ -778,7 +780,9 @@ class PublicContent extends Component {
         >
           {/* 公出目标 */}
           <View className="formName">
-            <Text style={{ color: "red" }}>*公出目标:</Text>
+            <Text>
+              <Text style={{ color: "red" }}>*</Text>
+              公出目标:</Text>
             <View
               className="formValue"
               style={{ paddingTop: "10px", textAlign: "left" }}
@@ -803,7 +807,9 @@ class PublicContent extends Component {
           {/* 公出计划 */}
           {dtails.type != 2 && (
             <View className="formName">
-              <Text style={{ color: "red" }}>*公出计划:</Text>
+              <Text>
+                <Text style={{ color: "red" }}>*</Text>
+                公出计划:</Text>
               <View
                 className="formValue"
                 style={{ paddingTop: "10px", textAlign: "left" }}
@@ -825,7 +831,9 @@ class PublicContent extends Component {
           {/* 预计效果 */}
           {dtails.type != 2 && (
             <View className="formName">
-              <Text style={{ color: "red" }}>*预计效果:</Text>
+              <Text>
+                <Text style={{ color: "red" }}>*</Text>
+                预计效果:</Text>
               <View
                 className="formValue"
                 style={{ paddingTop: "10px", textAlign: "left" }}
@@ -846,7 +854,14 @@ class PublicContent extends Component {
           )}
         </View>
         <View className="formItem" style={{ display: "block" }}>
-          <View className="formName">附件:</View>
+          <View className="formName">
+            {this.state.totalDuration > info.workTimeInfor.minHours && <Text style={{ color: "red" }}>*</Text>}
+            附件:
+          </View>
+          {this.state.totalDuration > info.workTimeInfor.minHours &&
+            <View className="tips">
+              请上传公出事由的凭证截图,如您与企业的对话截图等
+            </View>}
           <View
             className="formValue"
             style={{ paddingTop: "10px", textAlign: "left" }}

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