修复bug,调整功能

This commit is contained in:
weipengfei 2023-09-07 10:31:06 +08:00
parent edab952d33
commit dbbf9e789e
8 changed files with 44 additions and 14 deletions

View File

@ -25,6 +25,11 @@ export const userInfo = (data) => oahttp.get('/user/info', data)
*/ */
export const changePassword = (data) => oahttp.post('/user/changePassword', data) export const changePassword = (data) => oahttp.post('/user/changePassword', data)
/**
* 获取当前公司已创建的小队
*/
export const userCompanyBrigade = (data) => oahttp.get('/user/company_brigade', data)
/** /**
* 新增人员 * 新增人员
*/ */
@ -35,7 +40,6 @@ export const loginAdd = (data) => oahttp.post('/login/add', data)
*/ */
export const userSetInfo = (data) => oahttp.post('/user/setInfo', data) export const userSetInfo = (data) => oahttp.post('/user/setInfo', data)
/** /**
* 设置是否为队长 * 设置是否为队长
*/ */

View File

@ -115,8 +115,9 @@
}); });
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success() { success:(res)=> {
uni.hideLoading() uni.hideLoading();
res.eventChannel.emit('company_money', { company_money: this.company.company_money })
} }
}) })
}else Toast('暂未开放') }else Toast('暂未开放')
@ -125,9 +126,9 @@
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.list = []; this.list = [];
this.initList(); this.loadList();
}, },
async initList() { async loadList() {
if (this.loadConfig.status == "nomore") return; if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading"; this.loadConfig.status = "loading";
let res; let res;

View File

@ -18,7 +18,7 @@
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom> <u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input> <u--input :value="formDataText.brigade" style="pointer-events: none;" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</u--form> </u--form>
@ -36,6 +36,9 @@
commonVillage, commonVillage,
commonBrigade commonBrigade
} from "@/api/oaPbulic.js" } from "@/api/oaPbulic.js"
import {
userCompanyBrigade
} from "@/api/oaUser.js"
import { import {
Toast Toast
} from "../../libs/uniApi" } from "../../libs/uniApi"
@ -163,7 +166,10 @@
changeCity(type, toast=false) { changeCity(type, toast=false) {
if(toast) return Toast('不可修改该区域') if(toast) return Toast('不可修改该区域')
if (this.$props.readonly) return ; if (this.$props.readonly) return ;
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区'); if (this[type + 'List'].length == 0) {
if(type=='brigade') return Toast('小队已经建立完毕');
return Toast('请先选择上一级地区');
}
this.changeType = type; this.changeType = type;
this.showProvince = true; this.showProvince = true;
}, },
@ -229,10 +235,20 @@
commonBrigade({ commonBrigade({
brigade: code brigade: code
}).then(res => { }).then(res => {
// ,
let f_arr = this.$store.state.app.userInfo.company?.responsible_area?.split(',')||[]; let f_arr = this.$store.state.app.userInfo.company?.responsible_area?.split(',')||[];
this.brigadeList = res.data.filter(item=>{ this.brigadeList = res.data.filter(item=>{
return f_arr.find(t=>item.id==t); return f_arr.find(t=>item.id==t);
}); });
//
userCompanyBrigade().then((e)=>{
this.brigadeList = this.brigadeList.filter(item=>{
return !e.data.find(t=>t==item.id);
})
this.formData.brigade = '';
this.formDataRead.brigade = '';
this.formDataText.brigade = '';
})
}) })
}, },
} }

View File

@ -93,7 +93,7 @@
<!-- <u-button class="btns" type="primary" icon="plus" text="新建签约"></u-button> --> <!-- <u-button class="btns" type="primary" icon="plus" text="新建签约"></u-button> -->
</view> </view>
<view class="company_info" v-show="current==2"> <view class="company_info" v-show="current==2">
<companyFinance></companyFinance> <companyFinance ref="financeRef"></companyFinance>
</view> </view>
<view v-show="current==3"> <view v-show="current==3">
<task ref="taskRef" style="width: 100vw;"></task> <task ref="taskRef" style="width: 100vw;"></task>
@ -153,6 +153,7 @@
}, },
onReachBottom() { onReachBottom() {
if (this.current == 1) this.loadCompanyList(); if (this.current == 1) this.loadCompanyList();
else if (this.current == 2) this.$refs.financeRef.loadList();
else if (this.current == 3) this.$refs.taskRef.loadList(); else if (this.current == 3) this.$refs.taskRef.loadList();
}, },
methods: { methods: {
@ -212,6 +213,7 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
if (this.current == 1) this.initLoad(); if (this.current == 1) this.initLoad();
else if (this.current == 2) this.$refs.financeRef.initLoad();
else if (this.current == 3) this.$refs.taskRef.initLoadConfig(); else if (this.current == 3) this.$refs.taskRef.initLoadConfig();
this.$u.sleep(500).then(() => { this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()

View File

@ -296,8 +296,8 @@
upLoadImage upLoadImage
} from "@/api/file.js" } from "@/api/file.js"
import { import {
loginAdd loginAdd,
} from "@/api/oaUser.js" } from "@/api/oaUser.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" // import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //
import { Toast } from "../../libs/uniApi" import { Toast } from "../../libs/uniApi"

View File

@ -75,7 +75,7 @@
}, },
loadConfig:{ loadConfig:{
page: 1, page: 1,
limit: 25, limit: 15,
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '轻轻上拉', loadmoreText: '轻轻上拉',
nomoreText: '没有更多账单了~~', nomoreText: '没有更多账单了~~',

View File

@ -203,6 +203,7 @@
<style lang="scss"> <style lang="scss">
.personnel { .personnel {
padding: 28rpx 0; padding: 28rpx 0;
padding-bottom: 160rpx;
.new_btn { .new_btn {
position: fixed; position: fixed;
bottom: 30rpx; bottom: 30rpx;

View File

@ -11,7 +11,8 @@
</view> </view>
<view class="item"> <view class="item">
<text>可用余额</text> <text>可用余额</text>
<text>{{$store.state.app.userInfo.user_money||'0.00'}}</text> <text>{{company_money||'0.00'}}</text>
<!-- <text>{{$store.state.app.userInfo.user_money||'0.00'}}</text> -->
</view> </view>
</view> </view>
</view> </view>
@ -43,6 +44,7 @@
return { return {
priceList: ['10元','50元','100元','500元','1000元','5000元','全部', '自定义'], priceList: ['10元','50元','100元','500元','1000元','5000元','全部', '自定义'],
changeMoney: -1, changeMoney: -1,
company_money: "0.00",
payMoney: { payMoney: {
money: '' money: ''
}, },
@ -58,8 +60,12 @@
}) })
} }
}, },
onLoad() {}, onLoad() {
onShow() {}, const eventChannel = this.getOpenerEventChannel();
eventChannel.on('company_money', (e)=>{
this.company_money = e.company_money;
})
},
methods: { methods: {
copyPhone(str = "") { copyPhone(str = "") {
uni.setClipboardData({ uni.setClipboardData({