test01 3 anni fa
parent
commit
19bb1b6080

+ 2 - 2
src/app.jsx

@@ -57,9 +57,9 @@ 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'
     })
 
     //连接成功

+ 122 - 45
src/pages/applyDepart/enterprise.jsx

@@ -1,8 +1,8 @@
-import React,{Component} from 'react';
-import {View} from '@tarojs/components'
-import {getUserByName} from '../../utils/servers/servers';
+import React, { Component } from 'react';
+import { View } from '@tarojs/components'
+import { getUserByName, getOrderByUid } from '../../utils/servers/servers';
 
-import {AtSearchBar, AtListItem} from 'taro-ui'
+import { AtSearchBar, AtListItem, AtButton } from 'taro-ui'
 
 import 'taro-ui/dist/style/components/search-bar.scss';
 import 'taro-ui/dist/style/components/button.scss';
@@ -14,14 +14,17 @@ import ListBottomStart from '../../components/common/listBottomStart';
 
 import Taro from '@tarojs/taro';
 
-class Enterprise extends Component{
+class Enterprise extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      value:'',
-      list:[],
-      listState:'NO_DATA',
-      pageNo:1
+    this.state = {
+      value: '',
+      list: [],
+      listState: 'NO_DATA',
+      pageNo: 1,
+      listVisible: false,
+      listValue: {},
+      orderNo: [],
     }
     this.onChange = this.onChange.bind(this);
     this.getList = this.getList.bind(this);
@@ -30,66 +33,86 @@ class Enterprise extends Component{
   componentDidMount() {
     Taro.eventCenter.on('result', () => {
       this.setState({
-        value:'',
-        list:[],
-        listState:'NO_DATA',
-        pageNo:1
+        value: '',
+        list: [],
+        listState: 'NO_DATA',
+        pageNo: 1
       })
     })
     Taro.eventCenter.on('applyDepartSearchList', () => {
-      this.getList(this.state.value,this.state.pageNo + 1);
+      this.getList(this.state.value, this.state.pageNo + 1);
     })
   }
 
-  onChange (value,lv=true) {
+  onChange(value, lv = true) {
     this.setState({
       value,
     })
-    if(value.length < 2 && !lv){
-      Taro.showToast({title:'最少输入两个字符',icon:'none'})
+    if (value.length < 2 && !lv) {
+      Taro.showToast({ title: '最少输入两个字符', icon: 'none' })
       return
     }
-    if(value.length < 4 && lv){return}
+    if (value.length < 4 && lv) { return }
     this.getList(value);
   }
-
-  getList(value = this.state.value,pageNo = 1){
+  getByUid(val) {
+    this.setState({
+      listState: 'LOADING'
+    })
+    getOrderByUid({
+      uid: val.id
+    }).then((msg) => {
+      if (msg.error.length === 0) {
+        let data = msg.data;
+        this.setState({
+          listState: 'NO_MORE_DATA',
+          orderNo: data
+        })
+      } else {
+        Taro.showToast({ title: msg.error[0].message, icon: 'none' });
+        this.setState({
+          listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
+        })
+      }
+    })
+  }
+  getList(value = this.state.value, pageNo = 1) {
     this.setState({
       listState: 'LOADING'
     })
     getUserByName({
-      name:value,
+      name: value,
       pageNo: pageNo,
       pageSize: 10,
-    }).then((msg)=>{
-      if(msg.error.length === 0){
-        if(msg.data.totalCount === 0){
+    }).then((msg) => {
+      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'});
+        } 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){
+        } 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),
+          list: pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list),
           pageNo: msg.data.pageNo
         })
-      }else{
-        Taro.showToast({title:msg.error[0].message,icon:'none'});
+      } else {
+        Taro.showToast({ title: msg.error[0].message, icon: 'none' });
         this.setState({
           listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
         })
       }
-    }).catch(()=>{
+    }).catch(() => {
       this.setState({
         listState: 'RELOAD'
       })
@@ -103,37 +126,91 @@ class Enterprise extends Component{
           showActionButton
           value={this.state.value}
           onChange={this.onChange}
-          onActionClick={()=>{this.onChange(this.state.value,false)}}
-          onConfirm={()=>{this.onChange(this.state.value,false)}}
-          onClear={()=>{
+          onActionClick={() => {
+            this.setState({
+              listVisible: false
+            })
+            this.onChange(this.state.value, false)
+          }}
+          onConfirm={() => { this.onChange(this.state.value, false) }}
+          onClear={() => {
             this.setState({
-              value:'',
-              list:[],
-              listState:'NO_DATA',
-              pageNo:1
+              value: '',
+              list: [],
+              listState: 'NO_DATA',
+              pageNo: 1,
+              listVisible: false
             })
           }}
         />
         <View>
           {
-            this.state.list.map((v,k)=>(
+            this.props.type == 0 ? this.state.list.map((v, k) => (
               <View key={k}>
                 <AtListItem
                   title={v.name}
                   arrow='right'
                   iconInfo={{ size: 25, color: '#000000', value: 'bookmark', }}
-                  onClick={()=>{
+                  onClick={() => {
+                    // this.setState({
+                    //   listVisible: true,
+                    //   listValue: v,
+                    // })
+                    // this.getByUid(v)
                     Taro.eventCenter.trigger('enterprise', v)
                   }}
                 />
               </View>
-            ))
+            )) :  !this.state.listVisible ? this.state.list.map((v, k) => (
+              <View key={k}>
+                <AtListItem
+                  title={v.name}
+                  arrow='right'
+                  iconInfo={{ size: 25, color: '#000000', value: 'bookmark', }}
+                  onClick={() => {
+                    this.setState({
+                      listVisible: true,
+                      listValue: v,
+                    })
+                    this.getByUid(v)
+                    // Taro.eventCenter.trigger('enterprise', v)
+                  }}
+                />
+              </View>
+            )) :''
+          }
+          {
+             this.state.listVisible && this.props.type ==1  ? (<View><AtListItem
+              title={this.state.listValue.name}
+              arrow='right'
+              iconInfo={{ size: 25, color: '#000000', value: 'bookmark', }}
+
+            />
+              <View>
+                {this.state.orderNo.length > 0 ? <View>{this.state.orderNo.map((v, k) => (
+
+                  <View key={k} style={{ display: 'flex', justifyContent: ' center', marginBottom: '20px' }}>
+                    编号:<View>{v.contractNo}</View><View style={{ width: '60px', height: '24px', backgroundColor: '#5599FF', borderRadius: '15px', textAlign: 'center', lineHeight: '24px', marginLeft: '20px', color: 'white' }} circle onClick={() => {
+                      this.setState({
+                        listVisible: false
+                      })
+                      v.name = this.state.listValue.name
+                      v.id = this.state.listValue.id
+                      Taro.eventCenter.trigger('enterprise', v)
+                    }}>选择</View>
+                  </View>
+
+                ))} <View style={{ color: 'red', width: '260px', margin: '0 auto' }} >
+                    注:请选择正确的派单编号!公出信息将统计至对应的订单中。
+          </View></View> : <View style={{ color: 'red' }}>该企业暂无订单,无法技术公出!请联系营销员查询派单情况</View>}
+              </View>
+            </View>) : ''
           }
           <ListBottomStart
             state={this.state.listState}
-            reload={()=>{
+            reload={() => {
               this.onChange(this.state.value)
-            }}/>
+            }} />
         </View>
       </>
     )

+ 41 - 4
src/pages/applyDepart/index.jsx

@@ -1,7 +1,7 @@
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
 import {View} from '@tarojs/components'
-import { AtSteps } from 'taro-ui'
+import { AtSteps,AtButton,AtListItem } from 'taro-ui'
 
 import 'taro-ui/dist/style/components/steps.scss';
 import 'taro-ui/dist/style/components/icon.scss';
@@ -46,16 +46,22 @@ class ApplyDepart extends Component {
       selectArrderLocation:{},
       resultState:0,
       resultId:'',
-      punchClockInfor:{}
+      punchClockInfor:{},
+      colors:'primary',
+      color:'secondary',
+      type:0,
     }
   }
 
   componentDidShow () {
     Taro.eventCenter.on('enterprise', (arg) => {
+      arg.type = this.state.type
+      // 跳转
       this.setState({
         current:1,
         enterpriseInfor:arg
       })
+      console.log(arg);
     })
     Taro.eventCenter.on('publicContent', (arg) => {
       this.setState({
@@ -77,7 +83,7 @@ class ApplyDepart extends Component {
         selectArrderLocation:{},
         resultState:0,
         resultId:'',
-        punchClockInfor:{}
+        punchClockInfor:{},
       })
     })
     //获取地区选定数据
@@ -110,9 +116,30 @@ class ApplyDepart extends Component {
             items={items}
             current={this.state.current}
           />
+          <View style={{display:this.state.current===0 ? 'block' : 'none'}}>
+          <View style={{display:'flex'}}>
+          <View style={{margin:'0 10px'}}>
+          <AtButton   circle size='small' type={this.state.colors} onClick={()=>{
+            this.setState({
+              colors:'primary',
+              color:'secondary',
+              type:0
+            })
+          }}>业务/行政公出</AtButton>
+          </View>
+          <AtButton type={this.state.color} circle size='small' onClick={()=>{
+             this.setState({
+              colors:'secondary',
+              color:'primary',
+              type:1
+            })
+          }}>技术公出</AtButton>
+           <View style={{flex:'1'}}></View>
+          </View>
+          </View>
           <View className='content'>
             <View style={{display:this.state.current===0 ? 'block' : 'none'}}>
-              <Enterprise/>
+              <Enterprise type={this.state.type}/>
             </View>
             <View style={{display:this.state.current===1 ? 'block' : 'none'}}>
               <PublicContent enterpriseInfor={this.state.enterpriseInfor} selectArrderLocation={this.state.selectArrderLocation}/>
@@ -120,6 +147,16 @@ class ApplyDepart extends Component {
             <View style={{display:this.state.current===2 ? 'block' : 'none'}}>
               <Result resultState={this.state.resultState} resultId={this.state.resultId} punchClockInfor={this.state.punchClockInfor}/>
             </View>
+            {/* <View style={{display:this.state.current===3 ? 'block' : 'none'}}>
+            <AtListItem
+                  title={this.state.enterpriseInfor.name}
+                  arrow='right'
+                  iconInfo={{ size: 25, color: '#000000', value: 'bookmark', }}
+                  onClick={()=>{
+                    // Taro.eventCenter.trigger('enterprise', v)
+                  }}
+                />
+            </View> */}
           </View>
         </View>
       </View>

+ 44 - 15
src/pages/applyDepart/publicContent.jsx

@@ -62,7 +62,6 @@ class PublicContent extends Component{
         reason:'',
         plan:'',
         expectedEffect:'',
-
         imgs:[],
         validDates:[],
         totalDuration:0,
@@ -111,20 +110,42 @@ class PublicContent extends Component{
     this.setState({
       loading:true
     })
-    addPublicRelease({
-      uid:this.props.enterpriseInfor.id,
-      releaseStarts:this.state.rangeStartMinuteVal,
-      releaseEnds:this.state.rangeEndMinuteVal,
-      remarks:this.state.reason,
-      plan:this.state.plan,
-      expectedEffect:this.state.expectedEffect,
-      userName: this.props.selectArrderLocation.name,
-      longitude: this.props.selectArrderLocation.longitude,
-      latitude: this.props.selectArrderLocation.latitude,
-      annexUrl: this.state.imgs.length === 0 ? '' : this.state.imgs.join(','),
-      duration: this.state.totalDuration,
-      validDate: JSON.stringify(this.state.validDates)
-    }).then(v=>{
+    let datas;
+    if(this.props.enterpriseInfor.type == 0) {
+      datas= {
+        uid:this.props.enterpriseInfor.id,
+        releaseStarts:this.state.rangeStartMinuteVal,
+        releaseEnds:this.state.rangeEndMinuteVal,
+        remarks:this.state.reason,
+        plan:this.state.plan,
+        expectedEffect:this.state.expectedEffect,
+        userName: this.props.selectArrderLocation.name,
+        longitude: this.props.selectArrderLocation.longitude,
+        latitude: this.props.selectArrderLocation.latitude,
+        annexUrl: this.state.imgs.length === 0 ? '' : this.state.imgs.join(','),
+        duration: this.state.totalDuration,
+        type:this.props.enterpriseInfor.type,
+        validDate: JSON.stringify(this.state.validDates)
+      }
+    }else {
+      datas = {
+        uid:this.props.enterpriseInfor.id,
+        releaseStarts:this.state.rangeStartMinuteVal,
+        releaseEnds:this.state.rangeEndMinuteVal,
+        remarks:this.state.reason,
+        plan:this.state.plan,
+        expectedEffect:this.state.expectedEffect,
+        userName: this.props.selectArrderLocation.name,
+        longitude: this.props.selectArrderLocation.longitude,
+        latitude: this.props.selectArrderLocation.latitude,
+        annexUrl: this.state.imgs.length === 0 ? '' : this.state.imgs.join(','),
+        duration: this.state.totalDuration,
+        type:this.props.enterpriseInfor.type,
+        orderNo:this.props.enterpriseInfor.orderNo,
+        validDate: JSON.stringify(this.state.validDates)
+      }
+    }
+    addPublicRelease(datas).then(v=>{
       this.setState({
         loading:false
       })
@@ -229,6 +250,14 @@ class PublicContent extends Component{
           <View className='formValue'>{this.props.enterpriseInfor.name}</View>
         </View>
         <View className='formItem'>
+          <View className='formName'>公出类型:</View>
+          <View className='formValue'>{this.props.enterpriseInfor.type == 1 ? '技术公出' : '业务/行政公出'}</View>
+        </View> 
+       { this.props.enterpriseInfor.contractNo ? <View className='formItem'>
+          <View className='formName'>合同编号:</View>
+          <View className='formValue'>{this.props.enterpriseInfor.contractNo}</View>
+        </View> : ''}
+        <View className='formItem'>
           <View className='formName'>作息时间类型:</View>
           <View className='formValue'>
             <picker onChange={(e)=>{

+ 160 - 74
src/pages/egressDetails/enterprise.jsx

@@ -1,8 +1,8 @@
-import React,{Component} from 'react';
-import {View,Icon} from '@tarojs/components'
-import {getUserByName} from '../../utils/servers/servers';
+import React, { Component } from 'react';
+import { View, Icon } from '@tarojs/components'
+import { getUserByName, getOrderByUid } from '../../utils/servers/servers';
 
-import {AtSearchBar, AtPagination} from 'taro-ui'
+import { AtSearchBar, AtPagination, AtListItem } from 'taro-ui'
 
 import 'taro-ui/dist/style/components/search-bar.scss';
 import 'taro-ui/dist/style/components/button.scss';
@@ -14,82 +14,106 @@ import ListBottomStart from '../../components/common/listBottomStart';
 
 import Taro from '@tarojs/taro';
 
-class Enterprise extends Component{
+class Enterprise extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      value:'',
-      list:[],
-      listState:'NO_DATA',
-      selectId:0,
-      pageNo:1
+    this.state = {
+      value: '',
+      list: [],
+      listState: 'NO_DATA',
+      selectId: 0,
+      pageNo: 1,
+      listVisible: false,
+      listValue: {},
+      orderNo: [],
+      visibles: true
     }
     this.onChange = this.onChange.bind(this);
   }
 
-  onChange (value,lv=true) {
+  onChange(value, lv = true) {
     this.setState({
       value,
     })
-    if(value.length < 2 && !lv){
-      Taro.showToast({title:'最少输入两个字符',icon:'none'})
+    if (value.length < 2 && !lv) {
+      Taro.showToast({ title: '最少输入两个字符', icon: 'none' })
       return
     }
-    if(value.length < 4 && lv){return}
+    if (value.length < 4 && lv) { return }
     this.getList(value)
   }
 
   componentWillUnmount() {
     this.setState({
-      value:'',
-      list:[],
-      listState:'NO_DATA',
-      selectId:0,
-      pageNo:1,
-      totalCount:0
+      value: '',
+      list: [],
+      listState: 'NO_DATA',
+      selectId: 0,
+      pageNo: 1,
+      totalCount: 0,
     })
   }
-
-  getList(value = this.state.value,pageNo = 1){
-    Taro.showLoading({title:'加载中...'})
+  getByUid(val) {
+    this.setState({
+      listState: 'LOADING'
+    })
+    getOrderByUid({
+      uid: val.id
+    }).then((msg) => {
+      if (msg.error.length === 0) {
+        let data = msg.data;
+        this.setState({
+          listState: 'NO_MORE_DATA',
+          orderNo: data
+        })
+      } else {
+        Taro.showToast({ title: msg.error[0].message, icon: 'none' });
+        this.setState({
+          listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
+        })
+      }
+    })
+  }
+  getList(value = this.state.value, pageNo = 1) {
+    Taro.showLoading({ title: '加载中...' })
     this.setState({
       listState: 'LOADING'
     })
     getUserByName({
-      name:value,
+      name: value,
       pageNo: pageNo,
       pageSize: 10,
-    }).then((msg)=>{
+    }).then((msg) => {
       Taro.hideLoading();
-      if(msg.error.length === 0){
-        if(msg.data.totalCount === 0){
+      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'});
+        } 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){
+        } 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:msg.data.list,
+          list: msg.data.list,
           pageNo: msg.data.pageNo,
-          totalCount:msg.data.totalCount
+          totalCount: msg.data.totalCount
         })
-      }else{
-        Taro.showToast({title:msg.error[0].message,icon:'none'});
+      } else {
+        Taro.showToast({ title: msg.error[0].message, icon: 'none' });
         this.setState({
           listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
         })
       }
-    }).catch(()=>{
+    }).catch(() => {
       Taro.hideLoading();
       this.setState({
         listState: 'RELOAD'
@@ -105,55 +129,117 @@ class Enterprise extends Component{
           value={this.state.value}
           placeholder='请输入公出企业名称'
           onChange={this.onChange}
-          onActionClick={()=>{this.onChange(this.state.value,false)}}
-          onConfirm={()=>{this.onChange(this.state.value,false)}}
-          onClear={()=>{
+          onActionClick={() => { this.onChange(this.state.value, false) }}
+          onConfirm={() => { this.onChange(this.state.value, false) }}
+          onClear={() => {
             this.setState({
-              value:'',
-              list:[],
-              listState:'NO_DATA',
-              selectId:0,
-              pageNo:1,
-              totalCount:0
-            },()=>{
-              this.props.onChange({});
+              value: '',
+              list: [],
+              orderNo: [],
+              listValue: {},
+              listVisible: false,
+              listState: 'NO_DATA',
+              selectId: 0,
+              pageNo: 1,
+              totalCount: 0
+            }, () => {
+              this.props.onChange({}, 0);
             })
           }}
         />
         <View>
-          {
-            this.state.list.map((v,k)=>(
+          {this.props.type == 0 ? <View> {this.state.list.map((v, k) => (
+            <View style={{
+              padding: '10px',
+              display: 'flex',
+              flexFlow: 'row',
+              alignItems: 'center',
+              justifyContent: 'space-between',
+              borderBottom: '1px #ece6e6 solid'
+            }} key={k} onClick={() => {
+              this.setState({
+                selectId: v.id
+              })
+              // this.getByUid(v)
+              this.props.onChange({ uid: v.id, nickname: v.name }, 0);
+            }}>
+              <View style={{ fontSize: '15px' }}>{v.name}</View>
+              {this.state.selectId === v.id ? <Icon size='20' type='success_no_circle' /> : null}
+            </View>
+          ))} <ListBottomStart
+              type='pagination'
+              pageSize={10}
+              state={this.state.listState}
+              total={this.state.totalCount}
+              current={this.state.pageNo}
+              onPageChange={(type, current) => {
+                this.getList(this.state.value, current);
+              }}
+              reload={() => {
+                this.getList(this.state.value);
+              }}
+            /> </View> :
+            !this.state.listVisible ? <View>{this.state.list.map((v, k) => (
               <View style={{
-                padding:'10px',
-                display:'flex',
-                flexFlow:'row',
-                alignItems:'center',
-                justifyContent:'space-between',
-                borderBottom:'1px #ece6e6 solid'
-              }} key={k} onClick={()=>{
+                padding: '10px',
+                display: 'flex',
+                flexFlow: 'row',
+                alignItems: 'center',
+                justifyContent: 'space-between',
+                borderBottom: '1px #ece6e6 solid'
+              }} key={k} onClick={() => {
                 this.setState({
-                  selectId:v.id
+                  // selectId:v.id
+                  listValue: v,
+                  listVisible: true,
                 })
-                this.props.onChange({uid:v.id,nickname:v.name});
+                this.getByUid(v)
+                // this.props.onVisible()
+                // this.props.onChange({uid:v.id,nickname:v.name});
               }}>
-                <View style={{fontSize:'15px'}}>{v.name}</View>
+                <View style={{ fontSize: '15px' }}>{v.name}</View>
                 {this.state.selectId === v.id ? <Icon size='20' type='success_no_circle' /> : null}
               </View>
-            ))
+            ))} <ListBottomStart
+                type='pagination'
+                pageSize={10}
+                state={this.state.listState}
+                total={this.state.totalCount}
+                current={this.state.pageNo}
+                onPageChange={(type, current) => {
+                  this.getList(this.state.value, current);
+                }}
+                reload={() => {
+                  this.getList(this.state.value);
+                }}
+              /> </View> : ''
+          }
+          {
+            this.state.listVisible && this.props.type == 1 ? (<View><AtListItem
+              title={this.state.listValue.name}
+              arrow='right'
+              iconInfo={{ size: 25, color: '#000000', value: 'bookmark', }}
+
+            />
+              <View>
+                {this.state.orderNo.length > 0 ? <View> {this.state.orderNo.map((v, k) => (
+                  <View key={k} style={{ display: 'flex', justifyContent: ' center', marginBottom: '20px' }}>
+                    编号:<View>{v.contractNo}</View><View style={{ width: '60px', height: '24px', backgroundColor: '#5599FF', borderRadius: '15px', textAlign: 'center', lineHeight: '24px', marginLeft: '20px', color: 'white' }} circle onClick={() => {
+                      this.setState({
+                        listVisible: false,
+                      })
+                      v.id = this.state.listValue.id
+                      v.name = this.state.listValue.name
+                      this.props.onChange({ uid: v.id, nickname: v.name, orderNo: v.orderNo,contractNo:v.contractNo}, 1);
+                      // Taro.eventCenter.trigger('enterprise', v)
+                    }}>选择</View>
+                  </View>
+                ))}<View style={{ color: 'red', width: '260px', margin: '0 auto' }} >
+                    注:请选择正确的派单编号!公出信息将统计至对应的订单中。
+            </View></View> : <View style={{ color: 'red' }}>该企业暂无订单,无法技术公出!请联系营销员查询派单情况</View>}
+              </View>
+            </View>) : ''
           }
-          <ListBottomStart
-            type='pagination'
-            pageSize={10}
-            state={this.state.listState}
-            total={this.state.totalCount}
-            current={this.state.pageNo}
-            onPageChange={(type, current)=>{
-              this.getList(this.state.value,current);
-            }}
-            reload={()=>{
-              this.getList(this.state.value);
-            }}
-          />
         </View>
       </>
     )

+ 185 - 176
src/pages/egressDetails/index.jsx

@@ -1,14 +1,14 @@
-import React,{Component} from "react";
-import { View,Image,Button } from '@tarojs/components'
+import React, { Component } from "react";
+import { View, Image, Button } from '@tarojs/components'
 import Taro, { getCurrentInstance } from "@tarojs/taro";
-import {AtButton, AtCalendar, AtIcon, AtTextarea,AtModal, AtModalContent, AtModalAction} from 'taro-ui'
+import { AtButton, AtCalendar, AtIcon, AtTextarea, AtModal, AtModalContent, AtModalAction } from 'taro-ui'
 import Skeleton from 'taro-skeleton'
 
 import InquiryModal from '../../components/common/inquiryModal';
 
 import Modify from './modify';
-import {examinePublicRelease,getReleasetDails,updatePublicRelease} from '../../utils/servers/servers';
-import {resourceAddress} from '../../utils/config';
+import { examinePublicRelease, getReleasetDails, updatePublicRelease } from '../../utils/servers/servers';
+import { resourceAddress } from '../../utils/config';
 import './index.less';
 
 import 'taro-ui/dist/style/components/icon.scss';
@@ -27,32 +27,32 @@ import Revoke from '../../image/revoke.png';
 
 import ImagePicker from "../../components/common/imagePicker";
 import MessageNoticebar from "../../components/common/messageNoticebar";
-import {getClockState} from "../../utils/tools";
+import { getClockState } from "../../utils/tools";
 import HistoricalClock from "../../components/historicalClock";
 
-class EgressDetails extends Component{
+class EgressDetails extends Component {
 
   $instance = getCurrentInstance()
 
   constructor(props) {
     super(props);
-    this.state={
-      dtails:{},
-      opinion:'',
-      publicReleaseLog:[],
-      isDetailedOpened:false,
-      isModifyOpened:false,
-      selectArrderLocation:{},
-      current:''
+    this.state = {
+      dtails: {},
+      opinion: '',
+      publicReleaseLog: [],
+      isDetailedOpened: false,
+      isModifyOpened: false,
+      selectArrderLocation: {},
+      current: ''
     }
-    this.examinePublicRelease= this.examinePublicRelease.bind(this);
-    this.getReleasetDails= this.getReleasetDails.bind(this);
-    this.oidApplication= this.oidApplication.bind(this);
+    this.examinePublicRelease = this.examinePublicRelease.bind(this);
+    this.getReleasetDails = this.getReleasetDails.bind(this);
+    this.oidApplication = this.oidApplication.bind(this);
   }
 
   componentDidMount() {
     this.setState({
-      current:this.$instance.router.params.status || '',
+      current: this.$instance.router.params.status || '',
     })
     console.log(this.$instance.router.params.status);
     this.getReleasetDails();
@@ -62,158 +62,159 @@ class EgressDetails extends Component{
     //获取地区选定数据
     const chooseLocation = requirePlugin('chooseLocation');
     const location = chooseLocation.getLocation();
-    if(location){
+    if (location) {
       this.setState({
         selectArrderLocation: location
       })
     }
   }
 
-  getReleasetDails(){
+  getReleasetDails() {
     getReleasetDails({
-      id:this.$instance.router.params.id
-    }).then(v=>{
-      if(v.error.length === 0){
-        if(v.data){
+      id: this.$instance.router.params.id
+    }).then(v => {
+      if (v.error.length === 0) {
+        if (v.data) {
           let list = [];
-          for(let i of v.data.annexUrl.split(',')){
-            if(i){
-              list.push({'url':resourceAddress + i})
+          for (let i of v.data.annexUrl.split(',')) {
+            if (i) {
+              list.push({ 'url': resourceAddress + i })
             }
           }
           v.data.annexUrl = list;
           this.setState({
-            dtails:v.data,
-            selectArrderLocation:{
-              longitude:parseFloat(v.data.longitude),
-              latitude:parseFloat(v.data.latitude),
-              name:v.data.userName
+            dtails: v.data,
+            selectArrderLocation: {
+              longitude: parseFloat(v.data.longitude),
+              latitude: parseFloat(v.data.latitude),
+              name: v.data.userName
             }
           })
-        }else{
-          setTimeout(()=>{
+        } else {
+          setTimeout(() => {
             Taro.switchTab({
               url: '/pages/punchClock/index',
             })
-          },1800)
+          }, 1800)
           Taro.showToast({
-            title:'您没有权限查看此公出详情',
-            icon:'none',
-            duration:1800,
+            title: '您没有权限查看此公出详情',
+            icon: 'none',
+            duration: 1800,
           })
         }
-      }else{
-        Taro.showToast({title:v.error[0].message,icon:'none'})
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
       }
-    }).catch(err=>{
-      Taro.showToast({title:'系统错误,请稍后再试',icon:'none'});
+    }).catch(err => {
+      Taro.showToast({ title: '系统错误,请稍后再试', icon: 'none' });
       console.log(err)
     })
   }
 
-  examinePublicRelease(status){
-    if(!this.state.opinion){
-      Taro.showToast({title:'请填写审批意见',icon:'none'})
+  examinePublicRelease(status) {
+    if (!this.state.opinion) {
+      Taro.showToast({ title: '请填写审批意见', icon: 'none' })
       return;
     }
-    Taro.showLoading({title:'加载中...'})
+    Taro.showLoading({ title: '加载中...' })
     examinePublicRelease({
       status,
-      remarks:this.state.opinion,
-      id:this.state.dtails.id
-    }).then(v=>{
+      remarks: this.state.opinion,
+      id: this.state.dtails.id
+    }).then(v => {
       Taro.hideLoading();
-      if(v.error.length === 0){
-        Taro.showToast({title:status===0?'驳回成功':'通过成功',icon:'none'});
-        this.state.dtails.status=status;
+      if (v.error.length === 0) {
+        Taro.showToast({ title: status === 0 ? '驳回成功' : '通过成功', icon: 'none' });
+        this.state.dtails.status = status;
         this.setState({
-          dtails:this.state.dtails
+          dtails: this.state.dtails
         })
-        Taro.eventCenter.trigger('listOperation',{
-          type:this.state.dtails.permission,
-          index:this.$instance.router.params.index,
-          status:status===0?0:2
+        Taro.eventCenter.trigger('listOperation', {
+          type: this.state.dtails.permission,
+          index: this.$instance.router.params.index,
+          status: status === 0 ? 0 : 2
         })
 
-      }else{
-        Taro.showToast({title:v.error[0].message,icon:'none'})
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
       }
-    }).catch(()=>{
+    }).catch(() => {
       Taro.hideLoading();
-      Taro.showToast({title:'系统错误,请稍后再试',icon:'none'})
+      Taro.showToast({ title: '系统错误,请稍后再试', icon: 'none' })
     })
   }
 
-  onShareAppMessage(){
+  onShareAppMessage() {
     return {
-      title: this.state.dtails.status === 3 ? this.state.dtails.aname+ '撤销了前往' + this.state.dtails.userName + '的公出' : this.state.dtails.aname+ '将要去' + this.state.dtails.userName,
-      path: 'pages/egressDetails/index?id='+this.$instance.router.params.id
+      title: this.state.dtails.status === 3 ? this.state.dtails.aname + '撤销了前往' + this.state.dtails.userName + '的公出' : this.state.dtails.aname + '将要去' + this.state.dtails.userName,
+      path: 'pages/egressDetails/index?id=' + this.$instance.router.params.id
     }
   }
 
-  oidApplication(){
-    if(!this.state.reasonsInvalidation){
-      Taro.showToast({title:'请填写撤销原因',icon:'none'})
+  oidApplication() {
+    if (!this.state.reasonsInvalidation) {
+      Taro.showToast({ title: '请填写撤销原因', icon: 'none' })
       return;
     }
     this.setState({
-      loading:true
+      loading: true
     })
     updatePublicRelease({
-      id:this.$instance.router.params.id,
-      status:3,
-      reason:this.state.reasonsInvalidation,
-    }).then(v=>{
+      id: this.$instance.router.params.id,
+      status: 3,
+      uid:this.state.dtails.uid,
+      reason: this.state.reasonsInvalidation,
+    }).then(v => {
       this.setState({
-        loading:false
+        loading: false
       })
-      if(v.error.length === 0){
+      if (v.error.length === 0) {
         Taro.showToast({
-          title:'修改成功',
+          title: '修改成功',
         })
         this.setState({
-          isInquiryOpened:false,
-          inquiryTitle:'',
-          inquiryContent:'',
-        },()=>{
+          isInquiryOpened: false,
+          inquiryTitle: '',
+          inquiryContent: '',
+        }, () => {
           this.getReleasetDails();
         })
-        Taro.eventCenter.trigger('listOperation',{
-          type:this.state.dtails.permission,
-          index:this.$instance.router.params.index,
+        Taro.eventCenter.trigger('listOperation', {
+          type: this.state.dtails.permission,
+          index: this.$instance.router.params.index,
           status: 3,
         })
-      }else{
+      } else {
         Taro.showToast({
-          title:v.error[0].message,
-          icon:'none'
+          title: v.error[0].message,
+          icon: 'none'
         })
       }
-    }).catch(()=>{
+    }).catch(() => {
       this.setState({
-        loading:false
+        loading: false
       })
     });
   }
 
   render() {
-    const {dtails,current} = this.state;
+    const { dtails, current } = this.state;
     console.log(dtails);
     return (
       <View className='egressDetails'>
-        <MessageNoticebar/>
+        <MessageNoticebar />
         <View className='titleContent' style={{
-          padding:Object.keys(dtails).length === 0? '0 30px' : '20px 30px'
+          padding: Object.keys(dtails).length === 0 ? '0 30px' : '20px 30px'
         }}>
-          {Object.keys(dtails).length === 0?
-            <Skeleton title row={3} animateName='elastic' avatarShape='square' loading/>:
+          {Object.keys(dtails).length === 0 ?
+            <Skeleton title row={3} animateName='elastic' avatarShape='square' loading /> :
             <View>
               <View className='title'>{dtails.aname}提交的公出申请</View>
               <View className='address'>
                 申请时间: {dtails.createTimes}
               </View>
               <View className='state' style={{
-                color:getClockState(dtails.status).color
+                color: getClockState(dtails.status).color
               }}>
                 {
                   getClockState(dtails.status).title
@@ -223,73 +224,81 @@ class EgressDetails extends Component{
                 dtails.status === 0 ? Rejected :
                   dtails.status === 1 ? Reviewed :
                     dtails.status === 2 ? Passed :
-                      dtails.status === 3 ? Revoke :''} className='startIcon'/>
+                      dtails.status === 3 ? Revoke : ''} className='startIcon' />
             </View>
           }
         </View>
-        {Object.keys(dtails).length === 0?
-          <View style={{margin: '20px'}}>
-            <Skeleton title row={3} avatarShape='square' loading/>
-          </View>:
+        {Object.keys(dtails).length === 0 ?
+          <View style={{ margin: '20px' }}>
+            <Skeleton title row={3} avatarShape='square' loading />
+          </View> :
           <View className='valueContent'>
             <View className='item'>
               <View className='title'>
                 公出地点:
                 {dtails.permission === 0 && dtails.status === 0 ?
-                  <View className='edit' onClick={()=>{
+                  <View className='edit' onClick={() => {
                     this.setState({
-                      isModifyOpened:true,
+                      isModifyOpened: true,
                     })
                   }}>
-                    <AtIcon value='edit' size='18' color='#3864ef'/>
+                    <AtIcon value='edit' size='18' color='#3864ef' />
                   </View> : null}
               </View>
               <View className='value'>{dtails.userName}</View>
               <View className='timeContent'>
                 <View className='time'>
                   <View className='num'>公出{dtails.duration}小时</View>
-                  <View className='journal' onClick={(e)=>{
+                  <View className='journal' onClick={(e) => {
                     e.stopPropagation();
                     this.setState({
-                      isDetailedOpened:true
+                      isDetailedOpened: true
                     })
                   }}>明细</View>
                 </View>
                 <View className='timeAxis'>
                   <View className='startTime'>
-                    <View className='circle'/>
+                    <View className='circle' />
                     {dtails.releaseStarts}
                   </View>
-                  <View className='axis'/>
+                  <View className='axis' />
                   <View className='endTime'>
-                    <View className='circle'/>
+                    <View className='circle' />
                     {dtails.releaseEnds}
                   </View>
                 </View>
               </View>
             </View>
-            <AtModal onClose={()=>{
+            <AtModal onClose={() => {
               this.setState({
-                isDetailedOpened:false
+                isDetailedOpened: false
               })
             }} isOpened={this.state.isDetailedOpened}>
-             <AtModalContent>
-               {dtails.validDate ?  <AtCalendar
-                    currentDate={JSON.parse(dtails.validDate)[0]['value']}
-                    isSwiper={false}
-                    validDates={JSON.parse(dtails.validDate)}
-                  /> : null
-               }
+              <AtModalContent>
+                {dtails.validDate ? <AtCalendar
+                  currentDate={JSON.parse(dtails.validDate)[0]['value']}
+                  isSwiper={false}
+                  validDates={JSON.parse(dtails.validDate)}
+                /> : null
+                }
               </AtModalContent>
               <AtModalAction>
-                <Button onClick={()=>{
+                <Button onClick={() => {
                   this.setState({
-                    isDetailedOpened:false
+                    isDetailedOpened: false
                   })
                 }}>确定</Button>
               </AtModalAction>
             </AtModal>
             <View className='item'>
+              <View className='title'>公出类型:</View>
+              <View className='value'>{dtails.type == 1 ? '技术公出' : '业务/行政公出'}</View>
+            </View>
+            {dtails.type == 1 ? <View className='item'>
+              <View className='title'>合同编号:</View>
+              <View className='value'>{dtails.contractNo}</View>
+            </View> : ''}
+            <View className='item'>
               <View className='title'>
                 公出企业
               </View>
@@ -327,14 +336,14 @@ class EgressDetails extends Component{
               </View>
             </View> : null}
             {
-              dtails.permission === 1 && dtails.status === 1 &&  current !== '2' ?
+              dtails.permission === 1 && dtails.status === 1 && current !== '2' ?
                 <View className='item'>
                   <View className='title'>填写审批意见<View className='titleTips'>根据公出申请记录指导怎么沟通?并提出详细指导建议</View></View>
                   <AtTextarea
                     value={this.state.opinion}
-                    onChange={(value)=>{
+                    onChange={(value) => {
                       this.setState({
-                        opinion:value
+                        opinion: value
                       })
                     }}
                     maxLength={20}
@@ -343,27 +352,27 @@ class EgressDetails extends Component{
                 </View> : null
             }
             {
-              dtails.permission === 1 && dtails.status === 1 &&  current !== '2' ?
+              dtails.permission === 1 && dtails.status === 1 && current !== '2' ?
                 <View className='operation'>
-                  <AtButton type='secondary' circle loading={this.state.loading} onClick={()=>{
+                  <AtButton type='secondary' circle loading={this.state.loading} onClick={() => {
                     this.setState({
-                      isInquiryOpened:true,
-                      inquiryTitle:'提醒',
-                      inquiryContent:'您确定要驳回此申请吗?',
-                      inquiryFn:()=>{
+                      isInquiryOpened: true,
+                      inquiryTitle: '提醒',
+                      inquiryContent: '您确定要驳回此申请吗?',
+                      inquiryFn: () => {
                         this.examinePublicRelease(0);
                       }
                     })
                   }}>
                     驳回
                   </AtButton>
-                  <AtButton type='primary' loading={this.state.loading} circle onClick={()=>{
-                    if(this.state.loading){return;}
+                  <AtButton type='primary' loading={this.state.loading} circle onClick={() => {
+                    if (this.state.loading) { return; }
                     this.setState({
-                      isInquiryOpened:true,
-                      inquiryTitle:'提醒',
-                      inquiryContent:'您确定要同意此申请吗?',
-                      inquiryFn:()=>{
+                      isInquiryOpened: true,
+                      inquiryTitle: '提醒',
+                      inquiryContent: '您确定要同意此申请吗?',
+                      inquiryFn: () => {
                         this.examinePublicRelease(2);
                       }
                     })
@@ -378,9 +387,9 @@ class EgressDetails extends Component{
                   <View className='title'>撤销申请</View>
                   <AtTextarea
                     value={this.state.reasonsInvalidation}
-                    onChange={(value)=>{
+                    onChange={(value) => {
                       this.setState({
-                        reasonsInvalidation:value
+                        reasonsInvalidation: value
                       })
                     }}
                     maxLength={20}
@@ -391,13 +400,13 @@ class EgressDetails extends Component{
             {
               dtails.permission === 0 && dtails.status !== 3 ?
                 <View className='operation'>
-                  <Button type='warn' loading={this.state.loading} onClick={()=>{
-                    if(this.state.loading){return;}
+                  <Button type='warn' loading={this.state.loading} onClick={() => {
+                    if (this.state.loading) { return; }
                     this.setState({
-                      isInquiryOpened:true,
-                      inquiryTitle:'提醒',
-                      inquiryContent:'您确定要撤销此申请吗?',
-                      inquiryFn:()=>{
+                      isInquiryOpened: true,
+                      inquiryTitle: '提醒',
+                      inquiryContent: '您确定要撤销此申请吗?',
+                      inquiryFn: () => {
                         this.oidApplication();
                       }
                     })
@@ -406,28 +415,28 @@ class EgressDetails extends Component{
                   </Button>
                 </View> : null
             }
-        </View>}
-        {Object.keys(dtails).length === 0?
-          <View style={{margin: '20px'}}>
-            <Skeleton title row={3} avatarShape='square' loading/>
-          </View>:
-          <View className='valueContent history' onClick={(e)=>{
+          </View>}
+        {Object.keys(dtails).length === 0 ?
+          <View style={{ margin: '20px' }}>
+            <Skeleton title row={3} avatarShape='square' loading />
+          </View> :
+          <View className='valueContent history' onClick={(e) => {
             e.stopPropagation();
             this.setState({
-              historicalIsOpened:true
+              historicalIsOpened: true
             })
           }}>
             查看公出申请日志
-          <AtIcon value='chevron-right' size='20' color='#767272'/>
-        </View>}
-        {Object.keys(dtails).length === 0?
-          <View style={{margin: '20px'}}>
-            <Skeleton title row={3} avatarShape='square' loading/>
-          </View>:
+          <AtIcon value='chevron-right' size='20' color='#767272' />
+          </View>}
+        {Object.keys(dtails).length === 0 ?
+          <View style={{ margin: '20px' }}>
+            <Skeleton title row={3} avatarShape='square' loading />
+          </View> :
           <View className='valueContent history'>
             <View className='shareContent'>
               <Button open-type='share' className='share'>
-                <Image src={Wx} className='shareIcon'/>
+                <Image src={Wx} className='shareIcon' />
               </Button>
               <View className='shareTitle'>微信分享</View>
             </View>
@@ -439,46 +448,46 @@ class EgressDetails extends Component{
           locationInfor={this.state.selectArrderLocation}
           id={this.$instance.router.params.id}
           isOpened={this.state.isModifyOpened}
-          onModalClose={()=>{
+          onModalClose={() => {
             this.setState({
-              isModifyOpened:false,
+              isModifyOpened: false,
             })
           }}
-          onClose={()=>{
-          this.setState({
-            isModifyOpened:false,
-            dtails:{}
-          },()=>{
-            this.getReleasetDails();
-          })
-        }}/> : null}
+          onClose={() => {
+            this.setState({
+              isModifyOpened: false,
+              dtails: {}
+            }, () => {
+              this.getReleasetDails();
+            })
+          }} /> : null}
         <InquiryModal
           isOpened={this.state.isInquiryOpened}
           title={this.state.inquiryTitle}
           content={this.state.inquiryContent}
-          onClose={()=>{
+          onClose={() => {
             this.setState({
-              isInquiryOpened:false,
-              inquiryTitle:'',
-              inquiryContent:'',
+              isInquiryOpened: false,
+              inquiryTitle: '',
+              inquiryContent: '',
             })
           }}
-          onDetermine={()=>{
+          onDetermine={() => {
             this.state.inquiryFn();
             this.setState({
-              isInquiryOpened:false,
-              inquiryTitle:'',
-              inquiryContent:'',
-              inquiryFn:()=>{}
+              isInquiryOpened: false,
+              inquiryTitle: '',
+              inquiryContent: '',
+              inquiryFn: () => { }
             })
           }}
         />
         {this.state.historicalIsOpened ? <HistoricalClock
           id={this.$instance.router.params.id}
           isOpened={this.state.historicalIsOpened}
-          onClose={()=>{
+          onClose={() => {
             this.setState({
-              historicalIsOpened:false
+              historicalIsOpened: false
             })
           }}
         /> : null}

+ 74 - 27
src/pages/egressDetails/modify.jsx

@@ -1,63 +1,110 @@
-import React,{Component} from "react";
-import {AtCalendar, AtModal, AtModalAction, AtModalContent} from "taro-ui";
-import {Button} from "@tarojs/components";
+import React, { Component } from "react";
+import { AtCalendar, AtModal, AtModalAction, AtModalContent, AtButton } from "taro-ui";
+import { Button, View } from "@tarojs/components";
 import Enterprise from './enterprise';
 import PublicContent from './publicContent';
 
-import {updatePublicRelease} from '../../utils/servers/servers';
+import { updatePublicRelease } from '../../utils/servers/servers';
 
 import 'taro-ui/dist/style/components/modal.scss';
 import Taro from "@tarojs/taro";
 
-class Modify extends Component{
+class Modify extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      data:{},
-      dtails:props.dtails,
-      modifyType:1,
+    this.state = {
+      data: {},
+      dtails: props.dtails,
+      modifyType: 1,
+      colors: 'primary',
+      color: 'secondary',
+      type: 0,
+      visibles:true,
     }
     this.submit = this.submit.bind(this);
     this.onChange = this.onChange.bind(this);
+    this.onVisible = this.onVisible.bind(this);
   }
 
-  submit(){
-    if(Object.keys(this.state.data).length === 0){
-      Taro.showToast({title:'请先选择公出的企业',icon:'none'})
+  submit() {
+    if (Object.keys(this.state.data).length === 0 ) {
+      Taro.showToast({ title: '请先选择公出的企业', icon: 'none' })
+      return;
+    } else if(this.state.type == 1) {
+      Taro.showToast({ title: '技术公出请直接点击公出企业', icon: 'none' })
       return;
     }
     this.setState({
-      modifyType:2
+      modifyType: 2
     })
   }
-
-  componentWillUnmount() {
+  onVisible () {
     this.setState({
-      data:{}
+      visibles:false
     })
   }
-
-  onChange(value){
+  componentWillUnmount() {
     this.setState({
-      dtails:{
-        ...this.state.dtails,
-        ...value,
-      },
-      data:value,
+      data: {}
     })
   }
 
+  onChange(value, visi) {
+    if (visi == 0) {
+      this.setState({
+        dtails: {
+          ...this.state.dtails,
+          ...value,
+        },
+        data: value,
+      })
+    } else {
+      value.type = this.state.type
+      this.setState({
+        dtails: {
+          ...this.state.dtails,
+          ...value,
+        },
+        data: value,
+        modifyType: 2
+      })
+    }
+  }
+
   render() {
     return (
       <AtModal isOpened={this.props.isOpened} onClose={this.props.onModalClose}>
+        {
+          this.state.modifyType === 1 ? <View style={{ display: 'flex', margin: '10px 0 0 0' }}>
+            <View style={{ margin: '0 10px' }}>
+              <AtButton circle size='small' type={this.state.colors} onClick={() => {
+                this.setState({
+                  colors: 'primary',
+                  color: 'secondary',
+                  type: 0,
+                  visibles:true
+                })
+              }}>业务/行政公出</AtButton>
+            </View>
+            <AtButton type={this.state.color} circle size='small' onClick={() => {
+              this.setState({
+                colors: 'secondary',
+                color: 'primary',
+                type: 1,
+              })
+            }}>技术公出</AtButton>
+            <View style={{ flex: '1' }}></View>
+          </View> : ''
+        }
+
         <AtModalContent>
           {
             this.state.modifyType === 1 ?
-              <Enterprise isOpened={this.props.isOpened} onChange={this.onChange}/> :
+              <Enterprise type={this.state.type}  isOpened={this.props.isOpened} onChange={this.onChange} /> :
               <PublicContent
                 permission={this.props.permission}
                 index={this.props.index}
-                onClose={()=>{
+                onClose={() => {
                   this.props.onClose();
                 }}
                 locationInfor={this.props.locationInfor}
@@ -70,7 +117,7 @@ class Modify extends Component{
         {
           this.state.modifyType === 1 ?
             <AtModalAction>
-              <Button onClick={()=>{
+              <Button onClick={() => {
                 this.props.onClose();
               }}>
                 取消
@@ -78,7 +125,7 @@ class Modify extends Component{
               <Button onClick={this.submit}>
                 下一步
               </Button>
-            </AtModalAction>:
+            </AtModalAction> :
             null
         }
       </AtModal>

+ 254 - 222
src/pages/egressDetails/publicContent.jsx

@@ -1,16 +1,16 @@
-import React,{Component} from 'react';
+import React, { Component } from 'react';
 import Taro from '@tarojs/taro';
-import {Text, View} from '@tarojs/components'
+import { Text, View } from '@tarojs/components'
 import dayjs from 'dayjs';
 import './index.less';
 
 import ImagePicker from '../../components/common/imagePicker'
-import {resourceAddress} from '../../utils/config';
+import { resourceAddress } from '../../utils/config';
 
-import { AtButton,AtTextarea ,AtIcon,AtCalendar   } from 'taro-ui'
-import {updatePublicRelease,getWorkingHoursList} from '../../utils/servers/servers';
+import { AtButton, AtTextarea, AtIcon, AtCalendar } from 'taro-ui'
+import { updatePublicRelease, getWorkingHoursList } from '../../utils/servers/servers';
 
-import {getHours, getNumHourse, getUserWordTimes} from '../../utils/tools';
+import { getHours, getNumHourse, getUserWordTimes } from '../../utils/tools';
 
 import 'taro-ui/dist/style/components/form.scss';
 import 'taro-ui/dist/style/components/button.scss';
@@ -23,26 +23,24 @@ import 'taro-ui/dist/style/components/calendar.scss';
 import './publicContent.less';
 import InquiryModal from "../../components/common/inquiryModal";
 
-class PublicContent extends Component{
+class PublicContent extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      rangeStartVal:'',
-      rangeEndVal:'',
-      rangeEndMinuteVal:'',
-      rangeStartMinuteVal:'',
-      reason:'',
-      plan:'',
-      expectedEffect:'',
-      imgs:[],
-      validDates:[],
-      totalDuration:0,
-      loading:false,
-
-      workTypeList:[],
-      workType:0,
-
-      isPickerRender:false,
+    this.state = {
+      rangeStartVal: '',
+      rangeEndVal: '',
+      rangeEndMinuteVal: '',
+      rangeStartMinuteVal: '',
+      reason: '',
+      plan: '',
+      expectedEffect: '',
+      imgs: [],
+      validDates: [],
+      totalDuration: 0,
+      loading: false,
+      workTypeList: [],
+      workType: 0,
+      isPickerRender: false,
     }
     this.onSubmit = this.onSubmit.bind(this);
     this.selectArrder = this.selectArrder.bind(this);
@@ -56,18 +54,20 @@ class PublicContent extends Component{
 
   componentDidMount() {
     let arr = [];
-    for(let i of this.props.dtails.annexUrl){
+    for (let i of this.props.dtails.annexUrl) {
       arr.push(i.url.split(resourceAddress).join(""))
     }
     this.setState({
-      imgs:arr,
-      totalDuration:this.props.dtails.duration,
-      reason:this.props.dtails.remarks,
-      validDates:JSON.parse(this.props.dtails.validDate),
-      rangeEndVal:dayjs(this.props.dtails.releaseEnds).format('YYYY-MM-DD'),
+      imgs: arr,
+      totalDuration: this.props.dtails.duration,
+      reason: this.props.dtails.remarks,
+      validDates: JSON.parse(this.props.dtails.validDate),
+      rangeEndVal: dayjs(this.props.dtails.releaseEnds).format('YYYY-MM-DD'),
       rangeEndMinuteVal: dayjs(this.props.dtails.releaseEnds).format('YYYY-MM-DD HH:mm:ss'),
-      rangeStartVal:dayjs(this.props.dtails.releaseStarts).format('YYYY-MM-DD'),
+      rangeStartVal: dayjs(this.props.dtails.releaseStarts).format('YYYY-MM-DD'),
       rangeStartMinuteVal: dayjs(this.props.dtails.releaseStarts).format('YYYY-MM-DD HH:mm:ss'),
+      plan: this.props.dtails.plan,
+      expectedEffect: this.props.dtails.expectedEffect,
     })
     this.getWorkingHoursList();
   }
@@ -75,126 +75,149 @@ class PublicContent extends Component{
   componentWillUnmount() {
     this.imagePickerRef && this.imagePickerRef.clear();
     this.setState({
-      rangeStartVal:'',
-      rangeEndVal:'',
-      rangeEndMinuteVal:'',
-      rangeStartMinuteVal:'',
-      reason:'',
-      plan:'',
-      expectedEffect:'',
-      imgs:[],
-      validDates:[],
-      totalDuration:0,
-      loading:false,
+      rangeStartVal: '',
+      rangeEndVal: '',
+      rangeEndMinuteVal: '',
+      rangeStartMinuteVal: '',
+      reason: '',
+      plan: '',
+      expectedEffect: '',
+      imgs: [],
+      validDates: [],
+      totalDuration: 0,
+      loading: false,
     })
   }
 
-  getWorkingHoursList(){
-    getWorkingHoursList({}).then((v)=>{
-      if(v.error.length === 0){
+  getWorkingHoursList() {
+    getWorkingHoursList({}).then((v) => {
+      if (v.error.length === 0) {
         let obj = Taro.getStorageSync('userInfor');
-        let index = v.data.findIndex(value=>value.type === obj.workTimeInfor.type);
+        let index = v.data.findIndex(value => value.type === obj.workTimeInfor.type);
         this.setState({
-          workType:index !== -1 ? index : 0
+          workType: index !== -1 ? index : 0
         })
         this.setState({
-          workTypeList:v.data
+          workTypeList: v.data
         })
-      }else{
+      } else {
         Taro.showToast({
-          title:v.error[0].message,
-          icon:'none'
+          title: v.error[0].message,
+          icon: 'none'
         })
       }
-    }).catch(err=>{
+    }).catch(err => {
       console.log(err)
     })
   }
 
-  getNumHourse(startTime,endTime){
+  getNumHourse(startTime, endTime) {
     this.setState({
-      totalDuration:getNumHourse(startTime,endTime,this.state.validDates.length)
+      totalDuration: getNumHourse(startTime, endTime, this.state.validDates.length)
     })
   }
 
 
-  onSubmit(){
-    if(!this.state.rangeStartMinuteVal){
-      Taro.showToast({title:'请选择公出时间',icon:'none'})
-      return ;
+  onSubmit() {
+    if (!this.state.rangeStartMinuteVal) {
+      Taro.showToast({ title: '请选择公出时间', icon: 'none' })
+      return;
     }
-    if(!this.state.rangeEndMinuteVal){
-      Taro.showToast({title:'请选择公出时间',icon:'none'})
-      return ;
+    if (!this.state.rangeEndMinuteVal) {
+      Taro.showToast({ title: '请选择公出时间', icon: 'none' })
+      return;
     }
-    if(!(this.props.locationInfor.longitude && this.props.locationInfor.latitude)){
-      Taro.showToast({title:'请选择公出地点',icon:'none'})
-      return ;
+    if (!(this.props.locationInfor.longitude && this.props.locationInfor.latitude)) {
+      Taro.showToast({ title: '请选择公出地点', icon: 'none' })
+      return;
     }
-    if(!this.state.reason){
-      Taro.showToast({title:'请输入公出目标',icon:'none'})
-      return ;
+    if (!this.state.reason) {
+      Taro.showToast({ title: '请输入公出目标', icon: 'none' })
+      return;
     }
-    if(!this.state.plan){
-      Taro.showToast({title:'请输入公出计划',icon:'none'})
-      return ;
+    if (!this.state.plan) {
+      Taro.showToast({ title: '请输入公出计划', icon: 'none' })
+      return;
     }
-    if(!this.state.expectedEffect){
-      Taro.showToast({title:'请输入预计效果',icon:'none'})
-      return ;
+    if (!this.state.expectedEffect) {
+      Taro.showToast({ title: '请输入预计效果', icon: 'none' })
+      return;
     }
-    if(this.state.totalDuration === 0){
-      Taro.showToast({title:'公出时间不足0小时',icon:'none'})
-      return ;
+    if (this.state.totalDuration === 0) {
+      Taro.showToast({ title: '公出时间不足0小时', icon: 'none' })
+      return;
     }
     this.setState({
-      loading:true
+      loading: true
     })
-    updatePublicRelease({
-      id:this.props.dtails.id,
-      uid:this.props.dtails.uid,
-      releaseStarts:this.state.rangeStartMinuteVal,
-      releaseEnds:this.state.rangeEndMinuteVal,
-      remarks:this.state.reason,
-      plan:this.state.plan,
-      expectedEffect:this.state.expectedEffect,
-      userName: this.props.locationInfor.name,
-      longitude: this.props.locationInfor.longitude,
-      latitude: this.props.locationInfor.latitude,
-      annexUrl: this.state.imgs.length === 0 ? '' : this.state.imgs.join(','),
-      duration: this.state.totalDuration,
-      validDate: JSON.stringify(this.state.validDates)
-    }).then(v=>{
+    let datas;
+    if (this.props.dtails.type == 0) {
+      datas = {
+        id: this.props.dtails.id,
+        uid: this.props.dtails.uid,
+        releaseStarts: this.state.rangeStartMinuteVal,
+        releaseEnds: this.state.rangeEndMinuteVal,
+        remarks: this.state.reason,
+        plan: this.state.plan,
+        expectedEffect: this.state.expectedEffect,
+        userName: this.props.locationInfor.name,
+        longitude: this.props.locationInfor.longitude,
+        latitude: this.props.locationInfor.latitude,
+        annexUrl: this.state.imgs.length === 0 ? '' : this.state.imgs.join(','),
+        duration: this.state.totalDuration,
+        validDate: JSON.stringify(this.state.validDates),
+        type: this.props.dtails.type,
+      }
+    } else {
+      datas = {
+        id: this.props.dtails.id,
+        uid: this.props.dtails.uid,
+        releaseStarts: this.state.rangeStartMinuteVal,
+        releaseEnds: this.state.rangeEndMinuteVal,
+        remarks: this.state.reason,
+        plan: this.state.plan,
+        expectedEffect: this.state.expectedEffect,
+        userName: this.props.locationInfor.name,
+        longitude: this.props.locationInfor.longitude,
+        latitude: this.props.locationInfor.latitude,
+        annexUrl: this.state.imgs.length === 0 ? '' : this.state.imgs.join(','),
+        duration: this.state.totalDuration,
+        validDate: JSON.stringify(this.state.validDates),
+        type: this.props.dtails.type,
+        orderNo: this.props.dtails.orderNo,
+      }
+    }
+    updatePublicRelease(datas).then(v => {
       this.setState({
-        loading:false
+        loading: false
       })
-      if(v.error.length === 0){
+      if (v.error.length === 0) {
         Taro.showToast({
-          title:'修改成功',
+          title: '修改成功',
         })
-        Taro.eventCenter.trigger('listOperation',{
-          type:this.props.permission,
-          index:this.props.index,
+        Taro.eventCenter.trigger('listOperation', {
+          type: this.props.permission,
+          index: this.props.index,
           status: 1,
           userName: this.props.locationInfor.name,
-          releaseStarts:this.state.rangeStartMinuteVal,
-          releaseEnds:this.state.rangeEndMinuteVal,
+          releaseStarts: this.state.rangeStartMinuteVal,
+          releaseEnds: this.state.rangeEndMinuteVal,
         })
         this.props.onClose();
-      }else{
+      } else {
         Taro.showToast({
-          title:v.error[0].message,
-          icon:'none'
+          title: v.error[0].message,
+          icon: 'none'
         })
       }
-    }).catch(()=>{
+    }).catch(() => {
       this.setState({
-        loading:false
+        loading: false
       })
     });
   }
 
-  selectArrder(){
+  selectArrder() {
     const key = 'AWBBZ-GRAC2-JFYUO-CLA7I-JAHXK-YFFGT'; //使用在腾讯位置服务申请的key
     const referer = '科德打卡定位'; //调用插件的app的名称
     const category = '公司企业,房产小区';
@@ -203,25 +226,25 @@ class PublicContent extends Component{
     });
   }
 
-  onChange(value,type){
+  onChange(value, type) {
     let arr = this.state.imgs.concat([]);
-    if(type === 'add'){
+    if (type === 'add') {
       arr.push(value)
-    }else if(type === 'remove'){
-      arr.splice(value,1)
+    } else if (type === 'remove') {
+      arr.splice(value, 1)
     }
     this.setState({
       imgs: arr,
     })
   }
 
-  onPickerHide(){
+  onPickerHide() {
     this.setState({
       isPickerRender: false,
     });
   }
 
-  onSetPickerTime(val){
+  onSetPickerTime(val) {
     let data = val.detail;
     this.setState({
       rangeStartMinuteVal: data.selectStartTime,
@@ -229,29 +252,30 @@ class PublicContent extends Component{
     });
 
     let arr = [];
-    if(data.startTime && data.endTime){
+    if (data.startTime && data.endTime) {
       let a = dayjs(data.startTime);
       let b = dayjs(data.endTime);
-      let num = b.diff(a, 'day')+1;
+      let num = b.diff(a, 'day') + 1;
       let strAdd = data.startTime;
-      for(let i = 0;i<num;i++){
+      for (let i = 0; i < num; i++) {
         let time = dayjs(strAdd).add(i, 'days').format('YYYY-MM-DD');
-        arr.push({value:time});
+        arr.push({ value: time });
       }
     }
     this.setState({
-      rangeEndVal:dayjs(data.endTime).format('YYYY-MM-DD'),
-      rangeStartVal:dayjs(data.startTime).format('YYYY-MM-DD'),
-      validDates:arr,
-    },()=>{
+      rangeEndVal: dayjs(data.endTime).format('YYYY-MM-DD'),
+      rangeStartVal: dayjs(data.startTime).format('YYYY-MM-DD'),
+      validDates: arr,
+    }, () => {
       let a1 = dayjs(dayjs(data.endTime).format('YYYY-MM-DD HH:mm:ss'));
       let b1 = dayjs(dayjs(data.startTime).format('YYYY-MM-DD  HH:mm:ss'));
-      this.getNumHourse(b1,a1)
+      this.getNumHourse(b1, a1)
     })
   }
 
   render() {
-    const {dtails} = this.props;
+    const { dtails } = this.props;
+    console.log(dtails);
     return (
       <View className='publicContent'>
         <View className='formItem'>
@@ -259,29 +283,37 @@ class PublicContent extends Component{
           <View className='formValue'>{dtails.nickname}</View>
         </View>
         <View className='formItem'>
+          <View className='formName'>公出类型:</View>
+          <View className='formValue'>{dtails.type == 1 ? '技术公出' : '业务/行政公出'}</View>
+        </View> 
+       { dtails.contractNo ? <View className='formItem'>
+          <View className='formName'>合同编号:</View>
+          <View className='formValue'>{dtails.contractNo}</View>
+        </View> : ''}
+        <View className='formItem'>
           <View className='formName'>作息时间类型:</View>
           <View className='formValue'>
-            <picker onChange={(e)=>{
+            <picker onChange={(e) => {
               this.setState({
                 workType: e.detail.value
               })
-              if(this.state.workTypeList[e.detail.value]){
+              if (this.state.workTypeList[e.detail.value]) {
                 let obj = Taro.getStorageSync('userInfor');
                 obj.workTimeInfor = this.state.workTypeList[e.detail.value];
                 Taro.setStorageSync('userInfor', obj);
                 this.setState({
-                  rangeStartVal:'',
+                  rangeStartVal: '',
                   rangeStartMinuteVal: '',
-                  rangeEndMinuteVal:'',
-                  rangeEndVal:'',
-                  validDates:[],
-                  totalDuration:0
+                  rangeEndMinuteVal: '',
+                  rangeEndVal: '',
+                  validDates: [],
+                  totalDuration: 0
                 })
               }
             }} value={this.state.workType} rangeKey='name' range={this.state.workTypeList}>
-              <view style={{display:'flex',alignItems:'center'}}>
+              <view style={{ display: 'flex', alignItems: 'center' }}>
                 {this.state.workTypeList[this.state.workType] ? this.state.workTypeList[this.state.workType].name : ''}
-                <AtIcon value='chevron-right' size='20' color='#bbbbbb'/>
+                <AtIcon value='chevron-right' size='20' color='#bbbbbb' />
               </view>
             </picker>
           </View>
@@ -289,9 +321,9 @@ class PublicContent extends Component{
         <View className='formItem'>
           <View className='formName'>公出时间:</View>
           <View className='formValue'>
-            <View className='time' onClick={()=>{
+            <View className='time' onClick={() => {
               this.setState({
-                isPickerRender:true
+                isPickerRender: true
               })
             }}>
               {
@@ -302,7 +334,7 @@ class PublicContent extends Component{
                   <View>
                     结束时间:{this.state.rangeEndMinuteVal}
                   </View>
-                </View>: '请选择公出时间'
+                </View> : '请选择公出时间'
               }
             </View>
             <timePicker
@@ -312,28 +344,28 @@ class PublicContent extends Component{
                 dateLimit: false,
                 initStartTime: this.state.rangeStartMinuteVal, //默认开始时间
                 initEndTime: this.state.rangeEndMinuteVal,   //默认结束时间
-                limitStartTime: dayjs().subtract(3,'year').format('YYYY-MM-DD HH:mm:ss'),
-                limitEndTime: dayjs().add(3,'year').format('YYYY-MM-DD HH:mm:ss')
+                limitStartTime: dayjs().subtract(3, 'year').format('YYYY-MM-DD HH:mm:ss'),
+                limitEndTime: dayjs().add(3, 'year').format('YYYY-MM-DD HH:mm:ss')
               }}
               isPartition
               pickerShow={this.state.isPickerRender}
-              onconditionaljudgment={(v)=>{
+              onconditionaljudgment={(v) => {
                 let a = dayjs(dayjs(v.detail.endTime).second(0).format('YYYY-MM-DD HH:mm:ss'));
                 let b = dayjs(dayjs().second(0).format('YYYY-MM-DD HH:mm:ss'))
-                if(a.isBefore(b)){
+                if (a.isBefore(b)) {
                   Taro.showToast({
-                    title:'结束时间不能小于当前时间',
-                    icon:'none'
+                    title: '结束时间不能小于当前时间',
+                    icon: 'none'
                   })
                   v.detail.setLv(false);
                 }
               }}
-              onhidepicker={()=>{
+              onhidepicker={() => {
                 this.onPickerHide()
               }}
-              onsetpickertime={(v)=>{
+              onsetpickertime={(v) => {
                 this.onSetPickerTime(v)
-              }}/>
+              }} />
           </View>
         </View>
         <View className='formItem'>
@@ -342,7 +374,7 @@ class PublicContent extends Component{
             {this.state.totalDuration}小时
           </View>
         </View>
-        {this.state.validDates.length !== 0? <View className='formItem' style={{display:'block',paddingTop:'15px'}}>
+        {this.state.validDates.length !== 0 ? <View className='formItem' style={{ display: 'block', paddingTop: '15px' }}>
           <View className='formName'>
             <View>去除放假时间:</View>
             <View className='tips'>绿色方块为公出时间,长按即可去除放假时间</View>
@@ -353,32 +385,32 @@ class PublicContent extends Component{
             maxDate={this.state.rangeEndVal}
             isSwiper={false}
             validDates={this.state.validDates}
-            onDayLongClick={(item)=>{
-              if(!(dayjs(item.value).isSame(this.state.rangeStartVal) || dayjs(item.value).isSame(this.state.rangeEndVal))){
-                if(!(dayjs(item.value).isAfter(this.state.rangeStartVal) && dayjs(item.value).isBefore(this.state.rangeEndVal))){
+            onDayLongClick={(item) => {
+              if (!(dayjs(item.value).isSame(this.state.rangeStartVal) || dayjs(item.value).isSame(this.state.rangeEndVal))) {
+                if (!(dayjs(item.value).isAfter(this.state.rangeStartVal) && dayjs(item.value).isBefore(this.state.rangeEndVal))) {
                   return;
                 }
-              }else{
-                Taro.showToast({title:'开始结束时间不能取消',icon:'none'})
+              } else {
+                Taro.showToast({ title: '开始结束时间不能取消', icon: 'none' })
                 return
               }
-              let index = this.state.validDates.findIndex(v=>{
+              let index = this.state.validDates.findIndex(v => {
                 let lv = dayjs(v.value).isSame(item.value);
                 return lv
               })
-              const {start,end} = getUserWordTimes();
-              let totalDuration = getHours(dayjs().format('YYYY-MM-DD')+start,dayjs(dayjs().format('YYYY-MM-DD')+end));   //一天工作时长
-              if(index<0){
+              const { start, end } = getUserWordTimes();
+              let totalDuration = getHours(dayjs().format('YYYY-MM-DD') + start, dayjs(dayjs().format('YYYY-MM-DD') + end));   //一天工作时长
+              if (index < 0) {
                 let arr = item.value.split('-');
-                this.state.validDates.push({value:arr.join('-')})
+                this.state.validDates.push({ value: arr.join('-') })
                 this.setState({
-                  validDates:this.state.validDates,
+                  validDates: this.state.validDates,
                   totalDuration: this.state.totalDuration + totalDuration
                 })
-              }else{
-                this.state.validDates.splice(index,1)
+              } else {
+                this.state.validDates.splice(index, 1)
                 this.setState({
-                  validDates:this.state.validDates,
+                  validDates: this.state.validDates,
                   totalDuration: this.state.totalDuration - totalDuration
                 })
               }
@@ -386,89 +418,89 @@ class PublicContent extends Component{
           />
         </View> : null}
         <View className='formItem' style={{
-          paddingBottom:0
+          paddingBottom: 0
         }}>
           <View className='formName'>公出地点:</View>
           <View className='formValue' onClick={this.selectArrder}>
-              <Text className='formValueText'>{this.props.locationInfor.name}</Text>
-              <AtIcon value='chevron-right' size='30' color='#bbbbbb'/>
+            <Text className='formValueText'>{this.props.locationInfor.name}</Text>
+            <AtIcon value='chevron-right' size='30' color='#bbbbbb' />
           </View>
         </View>
         <View className='tips'>以地图为中心100米范围为可打卡区域,移动红标只需要拖动地图即可</View>
-        <View className='formItem' style={{display:'block',paddingTop:'15px'}}>
+        <View className='formItem' style={{ display: 'block', paddingTop: '15px' }}>
           {/* 公出目标 */}
-          <View className='formName'><Text style={{color:'red'}}>*公出目标:</Text>
-          <View className='formValue' style={{paddingTop:'10px',textAlign:'left'}}>
-            <AtTextarea
-              height={46}
-              value={this.state.reason}
-              onChange={(v)=>{
-                this.setState({
-                  reason:v
-                })
-              }}
-              maxLength={200}
-              placeholder='本次公出目标,谈的思路与步骤?'
-            />
-          </View>
+          <View className='formName'><Text style={{ color: 'red' }}>*公出目标:</Text>
+            <View className='formValue' style={{ paddingTop: '10px', textAlign: 'left' }}>
+              <AtTextarea
+                height={46}
+                value={this.state.reason}
+                onChange={(v) => {
+                  this.setState({
+                    reason: v
+                  })
+                }}
+                maxLength={200}
+                placeholder='本次公出目标,谈的思路与步骤?'
+              />
+            </View>
           </View>
           {/* 公出计划 */}
-          <View className='formName'><Text style={{color:'red'}}>*公出计划:</Text>
-          <View className='formValue' style={{paddingTop:'10px',textAlign:'left'}}>
-            <AtTextarea
-              height={46}
-              value={this.state.plan}
-              onChange={(v)=>{
-                this.setState({
-                  plan:v
-                })
-              }}
-              maxLength={200}
-              placeholder='本次公出准备工作'
-            />
-          </View>
+          <View className='formName'><Text style={{ color: 'red' }}>*公出计划:</Text>
+            <View className='formValue' style={{ paddingTop: '10px', textAlign: 'left' }}>
+              <AtTextarea
+                height={46}
+                value={this.state.plan}
+                onChange={(v) => {
+                  this.setState({
+                    plan: v
+                  })
+                }}
+                maxLength={200}
+                placeholder='本次公出准备工作'
+              />
+            </View>
           </View>
           {/* 预计效果 */}
-          <View className='formName'><Text style={{color:'red'}}>*预计效果:</Text>
-          <View className='formValue' style={{paddingTop:'10px',textAlign:'left'}}>
-            <AtTextarea
-              height={46}
-              value={this.state.expectedEffect}
-              onChange={(v)=>{
-                this.setState({
-                  expectedEffect:v
-                })
-              }}
-              maxLength={200}
-              placeholder='预计本次公出效果'
-            />
-          </View>
+          <View className='formName'><Text style={{ color: 'red' }}>*预计效果:</Text>
+            <View className='formValue' style={{ paddingTop: '10px', textAlign: 'left' }}>
+              <AtTextarea
+                height={46}
+                value={this.state.expectedEffect}
+                onChange={(v) => {
+                  this.setState({
+                    expectedEffect: v
+                  })
+                }}
+                maxLength={200}
+                placeholder='预计本次公出效果'
+              />
+            </View>
           </View>
         </View>
-        <View className='formItem' style={{display:'block'}}>
+        <View className='formItem' style={{ display: 'block' }}>
           <View className='formName'>附件:</View>
-          <View className='formValue' style={{paddingTop:'10px',textAlign:'left'}}>
+          <View className='formValue' style={{ paddingTop: '10px', textAlign: 'left' }}>
             {dtails.annexUrl && this.props.isOpened ? <ImagePicker
               files={dtails.annexUrl}
               showAddBtn={true}
               ref={ref => this.imagePickerRef = ref}
               url='/api/admin/release/upload'
               onChange={this.onChange}
-            /> : null }
+            /> : null}
           </View>
         </View>
         <View className='operation'>
-          <AtButton disabled={this.state.loading} type='secondary' circle onClick={()=>{
+          <AtButton disabled={this.state.loading} type='secondary' circle onClick={() => {
             this.props.onClose();
           }}>
             取消
           </AtButton>
-          <AtButton type='primary' loading={this.state.loading} circle onClick={()=>{
+          <AtButton type='primary' loading={this.state.loading} circle onClick={() => {
             this.setState({
-              isInquiryOpened:true,
-              inquiryTitle:'提醒',
-              inquiryContent:'您确定要修改此申请吗?',
-              inquiryFn:()=>{
+              isInquiryOpened: true,
+              inquiryTitle: '提醒',
+              inquiryContent: '您确定要修改此申请吗?',
+              inquiryFn: () => {
                 this.onSubmit();
               }
             })
@@ -480,20 +512,20 @@ class PublicContent extends Component{
           isOpened={this.state.isInquiryOpened}
           title={this.state.inquiryTitle}
           content={this.state.inquiryContent}
-          onClose={()=>{
+          onClose={() => {
             this.setState({
-              isInquiryOpened:false,
-              inquiryTitle:'',
-              inquiryContent:'',
+              isInquiryOpened: false,
+              inquiryTitle: '',
+              inquiryContent: '',
             })
           }}
-          onDetermine={()=>{
+          onDetermine={() => {
             this.state.inquiryFn();
             this.setState({
-              isInquiryOpened:false,
-              inquiryTitle:'',
-              inquiryContent:'',
-              inquiryFn:()=>{}
+              isInquiryOpened: false,
+              inquiryTitle: '',
+              inquiryContent: '',
+              inquiryFn: () => { }
             })
           }}
         />

+ 2 - 2
src/utils/config.js

@@ -1,4 +1,4 @@
 // export const resourceAddress = 'http://172.16.0.255:3000/upload;'
-export const resourceAddress = 'https://s.jishutao.com/upload';
-// export const resourceAddress = 'https://static.jishutao.com/upload';
+// export const resourceAddress = 'https://s.jishutao.com/upload';
+export const resourceAddress = 'https://static.jishutao.com/upload';
 

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

@@ -3,13 +3,13 @@ const getBaseUrl = (url) => {
   if (process.env.NODE_ENV === 'development') {
     //开发环境 - 根据请求不同返回不同的BASE_URL
     // 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'
   } 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
 }

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

@@ -33,7 +33,10 @@ export const login = (res) => {
     }
   })
 }
-
+// 查询客户订单
+export const getOrderByUid = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/release/selectOrderByUid', postData)
+}
 export const getUserByName = (postData = {}) => {
   return HTTPREQUEST.get('/api/admin/customer/getUserByNames', postData)
 }