This commit is contained in:
weipengfei 2023-08-15 18:27:07 +08:00
parent 1524b52928
commit 3259be3b13
10 changed files with 215 additions and 139 deletions

View File

@ -3,27 +3,31 @@
<u-sticky bgColor="#f5f5f5" offsetTop="44px"> <u-sticky bgColor="#f5f5f5" offsetTop="44px">
<!-- <u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" <!-- <u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false"
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs> --> inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs> -->
<uni-segmented-control :current="current" :values="['全部','已完成', '未完成']" styleType="text" @clickItem="changeCurrent" activeColor="#3274F9"></uni-segmented-control> <uni-segmented-control :current="current" :values="['全部','已完成', '未完成']" styleType="text"
@clickItem="changeCurrent" activeColor="#3274F9"></uni-segmented-control>
</u-sticky> </u-sticky>
<view class="c_task_index_list"> <view class="c_task_index_list">
<view v-for="item in 10" @click="navTo('/subpkg/dispatching/dispatching')" :key="item"> <view v-for="item in list" :key="item.id">
<taskItem></taskItem> <taskItem :datas="item"></taskItem>
</view> </view>
</view> </view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
<!-- <u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty> --> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
<!-- <u-empty icon="/static/img/empty/data.png" text="没有数据"></u-empty> -->
</view> </view>
</template> </template>
<script> <script>
import { Toast } from "../../libs/uniApi"; import { Toast } from "../../libs/uniApi";
import taskItem from "./taskItem.vue" import taskItem from "./taskItem.vue";
import { taskLists } from "@/api/task.js";
export default { export default {
name: "task", name: "task",
components: { taskItem }, components: { taskItem },
data() { data() {
return { return {
current: 0, current: 0,
status: 0,
// tabLists: [{ // tabLists: [{
// name: '', // name: '',
// }, { // }, {
@ -33,8 +37,7 @@
// }], // }],
loadConfig: { loadConfig: {
page: 1, page: 1,
limit: 15, limit: 25,
lastpage: '',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '轻轻上拉', loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~', nomoreText: '我也是有底线的~~',
@ -43,6 +46,9 @@
list: [] list: []
}; };
}, },
created() {
this.initLoadConfig();
},
methods: { methods: {
navTo(url) { navTo(url) {
url ? url ?
@ -51,9 +57,42 @@
}) : Toast('暂未开放') }) : Toast('暂未开放')
}, },
changeCurrent(e) { changeCurrent(e) {
if(this.current!==e.currentIndex){ if (this.current !== e.currentIndex) {
this.current = e.currentIndex; this.current = +e.currentIndex;
switch (this.current) {
case 1:
this.status = 3;
break;
case 2:
this.status = 5;
break;
default:
this.status = 0;
}
this.initLoadConfig();
} }
},
initLoadConfig() {
this.loadConfig.page = 1;
this.loadConfig.status = 'loadmore';
this.list = [];
this.loadList();
},
async loadList() {
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let res = await taskLists({
page: this.loadConfig.page,
status: this.status,
limit: this.loadConfig.limit
});
this.loadConfig.status = "loadmore"
if (res.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data];
} }
} }
} }

View File

@ -15,8 +15,12 @@
<view class="b_right"> <view class="b_right">
<view class="item"> <view class="item">
<view class="left"> <view class="left">
<view>任务进度:</view> <view>任务状态:</view>
<view class="text">30%</view> <view class="text">
<text v-if="datas.status==2||datas.status==1" style="color: #ff7c32;">进行中</text>
<text v-if="datas.status==3" style="color: #46be61;">已完成</text>
<text v-if="datas.status==5">已关闭</text>
</view>
</view> </view>
<view class="right">{{datas.money||'0.00'}}<text class="price"></text></view> <view class="right">{{datas.money||'0.00'}}<text class="price"></text></view>
</view> </view>
@ -59,9 +63,13 @@ import { Toast } from '../../libs/uniApi';
}) : Toast('暂未开放') }) : Toast('暂未开放')
}, },
clickTask(){ clickTask(){
console.log('点击'); // console.log('', this.$props.datas);
if(this.$props.datas.type==1){ if(this.$props.datas.status!==2&&this.$props.datas.status!==1){
this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr)) return this.$props.datas.status==3?Toast('任务已完成!'):Toast('任务已结束!');
}
if(this.$props.datas.type==31){
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
this.navTo(`/subpkg/updateArchives/updateArchives?id=${this.$props.datas?.extend?.informationg?.arr}&task_id=${this.$props.datas?.id}`)
}else this.navTo(''); }else this.navTo('');
} }
} }

View File

@ -13,13 +13,12 @@
itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs> itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs>
</view> </view>
<input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" /> <input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" />
<input v-if="current==0" class="mobile item" v-model="formData.password" maxlength="26" placeholder="输入密码" password <input v-if="current==0" class="mobile item" v-model="formData.password" maxlength="26" placeholder="输入密码"
type="safe-password" /> password type="safe-password" />
<input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" /> <input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current==1" class="code item"> <view v-if="current==1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" /> <input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
<u-code :seconds="seconds" @end="end" @start="start" ref="uCode" <u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
@change="codeChange"></u-code>
<view class="get-code" @click="getCode">{{tips}}</view> <view class="get-code" @click="getCode">{{tips}}</view>
</view> </view>
<view class="btn"> <view class="btn">
@ -34,13 +33,13 @@
</template> </template>
<script> <script>
import { loginAccount, userInfo, test } from "@/api/oaUser.js" import { loginAccount, userInfo, test } from "@/api/oaUser.js"
import { Toast } from "../../libs/uniApi"; import { Toast } from "../../libs/uniApi";
export default { export default {
data() { data() {
return { return {
tabList: [ tabList: [
{name:'账号登录'}, { name: '账号登录' },
// {name:''}, // {name:''},
], ],
current: 0, current: 0,
@ -62,14 +61,14 @@ import { Toast } from "../../libs/uniApi";
this.formData.scene = e.index + 1; this.formData.scene = e.index + 1;
}, },
async login() { async login() {
if(!this.formData.account)return Toast('账号不能为空'); if (!this.formData.account) return Toast('账号不能为空');
if(this.formData.scene==1&&!this.formData.password)return Toast('密码不能为空'); if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
if(this.formData.scene==2&&!this.formData.code)return Toast('验证码不能为空'); if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
let that = this; let that = this;
// let res = await test(); // let res = await test();
// console.log(res); // console.log(res);
uni.showLoading({ uni.showLoading({
title:'正在登录中' title: '正在登录中'
}) })
let res = await loginAccount(that.formData); let res = await loginAccount(that.formData);
this.$store.commit('SET_USERINFO', { this.$store.commit('SET_USERINFO', {
@ -79,19 +78,18 @@ import { Toast } from "../../libs/uniApi";
let { data } = await userInfo(); let { data } = await userInfo();
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);
uni.hideLoading() uni.hideLoading()
if(data.is_new_user) { if (data.is_new_user) {
uni.showLoading({ uni.showLoading({
mask:true, mask: true,
title:'加载中' title: '加载中'
}) })
uni.switchTab({ uni.switchTab({
url:'/pages/oaHome/oaHome', url: '/pages/oaHome/oaHome',
success: () => { success: () => {
uni.hideLoading() uni.hideLoading()
} }
}) })
} } else uni.navigateTo({
else uni.navigateTo({
url: '/pages/updatePasswprd/updatePasswprd' url: '/pages/updatePasswprd/updatePasswprd'
}); });
}, },
@ -119,33 +117,33 @@ import { Toast } from "../../libs/uniApi";
// #endif // #endif
}, },
codeChange(text) { codeChange(text) {
this.tips = text; this.tips = text;
}, },
getCode() { getCode() {
if(this.$refs.uCode.canGetCode) { if (this.$refs.uCode.canGetCode) {
// //
uni.showLoading({ uni.showLoading({
title: '正在获取验证码' title: '正在获取验证码'
}) })
setTimeout(() => { setTimeout(() => {
uni.hideLoading(); uni.hideLoading();
// this.start() // this.start()
uni.$u.toast('验证码已发送'); uni.$u.toast('验证码已发送');
// //
this.$refs.uCode.start(); this.$refs.uCode.start();
}, 2000); }, 2000);
} else { } else {
uni.$u.toast('倒计时结束后再发送'); uni.$u.toast('倒计时结束后再发送');
} }
}, },
end() { end() {
// uni.$u.toast(''); // uni.$u.toast('');
}, },
start() { start() {
// uni.$u.toast(''); // uni.$u.toast('');
}, },
// //
forgetPWD(){ forgetPWD() {
Toast('暂未开放') Toast('暂未开放')
} }
}, },

View File

@ -36,7 +36,8 @@
} }
}, },
onLoad() { onLoad() {
this.loadList() this.loadList();
uni.$on('initOaTask', this.loadList);
}, },
onShow() { onShow() {
}, },

View File

@ -2,7 +2,13 @@
<view class="reset-password"> <view class="reset-password">
<u--form ref="formRef" :rules="rules" :model="formData"> <u--form ref="formRef" :rules="rules" :model="formData">
<u-form-item label="原密码" labelWidth="140rpx" borderBottom prop="old_password"> <u-form-item label="原密码" labelWidth="140rpx" borderBottom prop="old_password">
<u--input v-model="formData.old_password" type="password" placeholder="请输入原密码" maxlength="18"></u--input> <u--input v-model="formData.old_password" :password="!pwdShow.old_password" placeholder="请输入原密码" maxlength="18">
<!-- #ifdef APP-PLUS -->
<template slot="suffix">
<u-icon :name="pwdShow.old_password?'eye-off':'eye-fill'" @click="pwdShow.old_password=!pwdShow.old_password" color="#999"></u-icon>
</template>
<!-- #endif -->
</u--input>
</u-form-item> </u-form-item>
<u-form-item label="新密码" labelWidth="140rpx" borderBottom prop="password"> <u-form-item label="新密码" labelWidth="140rpx" borderBottom prop="password">
<u--input v-model="formData.password" type="password" placeholder="请输入新密码" maxlength="18"></u--input> <u--input v-model="formData.password" type="password" placeholder="请输入新密码" maxlength="18"></u--input>
@ -16,81 +22,86 @@
</template> </template>
<script> <script>
import { Toast } from '../../libs/uniApi'; import { Toast } from '../../libs/uniApi';
import { changePassword } from "@/api/oaUser.js" import { changePassword } from "@/api/oaUser.js"
export default { export default {
data() { data() {
return { return {
formData:{ pwdShow: {
old_password: '', // old_password: false,
password: '', // password: false,
password_confirm: '', // password_confirm: false,
},
rules:{
old_password: {
type: 'string',
required: true,
min: 6,
max: 18,
message: '请输入6-18位密码',
trigger: ['change', 'blur']
}, },
password: { formData: {
type: 'string', old_password: '', //
required: true, password: '', //
min: 6, password_confirm: '', //
max: 18,
message: '请输入6-18位密码',
trigger: ['change', 'blur']
},
password_confirm: {
type: 'string',
required: true,
min: 6,
max: 18,
message: '请输入6-18位密码',
trigger: ['change', 'blur']
}, },
rules: {
old_password: {
type: 'string',
required: true,
min: 6,
max: 18,
message: '请输入6-18位密码',
trigger: ['change', 'blur']
},
password: {
type: 'string',
required: true,
min: 6,
max: 18,
message: '请输入6-18位密码',
trigger: ['change', 'blur']
},
password_confirm: {
type: 'string',
required: true,
min: 6,
max: 18,
message: '请输入6-18位密码',
trigger: ['change', 'blur']
},
}
}
},
methods: {
submit() {
this.$refs.formRef.validate().then(async (e) => {
if (e) {
if (this.formData.password == this.formData.old_password) return Toast('新密码不能与原密码一致');
if (this.formData.password !== this.formData.password_confirm) return Toast('两次新密码不一致');
try {
await changePassword({ ...this.formData });
Toast('修改成功');
this.$u.sleep(500).then(() => {
uni.showLoading({
mask: true,
title: '加载中'
})
uni.switchTab({
url: '/pages/oaHome/oaHome',
success: () => {
uni.hideLoading()
}
})
})
} catch (e) {
// console.log(e);
Toast(e.msg || '修改失败')
}
}
})
} }
} }
},
methods: {
submit() {
this.$refs.formRef.validate().then(async (e)=>{
if(e){
if(this.formData.password == this.formData.old_password) return Toast('新密码不能与原密码一致');
if(this.formData.password !== this.formData.password_confirm) return Toast('两次新密码不一致');
try{
await changePassword({...this.formData});
Toast('修改成功');
this.$u.sleep(500).then(()=>{
uni.showLoading({
mask:true,
title:'加载中'
})
uni.switchTab({
url:'/pages/oaHome/oaHome',
success: () => {
uni.hideLoading()
}
})
})
}catch(e){
// console.log(e);
Toast(e.msg||'修改失败')
}
}
})
}
} }
}
</script> </script>
<style> <style>
.reset-password { .reset-password {
margin: 28rpx; margin: 28rpx;
padding: 28rpx; padding: 28rpx;
background-color: #fff; background-color: #fff;
border-radius: 14rpx; border-radius: 14rpx;
} }
</style> </style>

View File

@ -45,7 +45,7 @@
<companyFinance></companyFinance> <companyFinance></companyFinance>
</view> </view>
<view v-show="current==3"> <view v-show="current==3">
<task style="width: 100vw;"></task> <task ref="taskRef" style="width: 100vw;"></task>
</view> </view>
</view> </view>
<u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty> <u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty>
@ -94,7 +94,8 @@
} }
}, },
onReachBottom() { onReachBottom() {
this.loadCompanyList(); if(this.current==1) this.loadCompanyList();
else if(this.current==3) this.$refs.taskRef.loadList();
}, },
methods: { methods: {
async initLoad() { async initLoad() {
@ -145,7 +146,7 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
if(this.current==1) this.initLoad(); if(this.current==1) this.initLoad();
else if(this.current==3) this.$refs.taskRef.initLoadConfig();
this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()}) this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()})
} }
} }

View File

@ -40,16 +40,16 @@ import { informationList } from "@/api/information.js"
export default { export default {
data() { data() {
return { return {
ids: [], ids: -1,
list: [] list: []
} }
}, },
onLoad(options) { onLoad(options) {
try{ try{
this.ids = JSON.parse(options.id); this.ids = options.id;
this.loadList(); this.loadList();
}catch(e){ }catch(e){
this.ids = []; this.ids = -1;
} }
}, },
onShow() {}, onShow() {},
@ -76,6 +76,7 @@ export default {
let res = await informationList({ let res = await informationList({
'arr[]': [...this.ids] 'arr[]': [...this.ids]
}); });
console.log(res);
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {

View File

@ -228,8 +228,8 @@
title: "添加成功", title: "添加成功",
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
// uni.$emit('initPersonnel'); uni.$emit('initPersonnel');
// uni.navigateBack(); uni.navigateBack();
}, 1000) }, 1000)
} }
}) })

View File

@ -11,18 +11,19 @@
</view> </view>
<view class="task_list"> <view class="task_list">
<uni-section class="title" titleFontSize="32rpx" :title="'任务清单 '+ nowYMD" type="line"></uni-section> <uni-section class="title" titleFontSize="32rpx" :title="'任务清单 '+ nowYMD" type="line"></uni-section>
<view v-for="item in 5" :key="item" @click="navTo('/subpkg/fileTask/fileTask')"> <u-skeleton :loading="skeleton" :style="{margin: skeleton?'0 28rpx':'0'}" :animate="true" title rows="2" rows-width="100%" rowsHeight="56">
<taskItem></taskItem> <block v-for="item in list" :key="item.id">
</view> <taskItem :datas="item"></taskItem>
<!-- <u-empty icon="/static/img/empty/data.png" text="没有任务"></u-empty> --> </block>
<!-- <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" </u-skeleton>
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> --> <u-empty v-if="!skeleton&&list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import taskItem from "@/components/task/taskItem.vue" import taskItem from "@/components/task/taskItem.vue"
import { taskLists } from "@/api/task.js"
export default { export default {
components:{ components:{
taskItem taskItem
@ -30,6 +31,7 @@
data() { data() {
return { return {
current: 0, current: 0,
skeleton: true,
nowDate: { nowDate: {
y: '', y: '',
m: '', m: '',
@ -43,10 +45,12 @@
nomoreText: '没有更多账单了~~', nomoreText: '没有更多账单了~~',
status: 'loadmore' status: 'loadmore'
}, },
list: []
} }
}, },
onLoad() { onLoad() {
this.initDate(); this.initDate();
this.loadTaskList();
}, },
onShow() {}, onShow() {},
computed: { computed: {
@ -70,7 +74,16 @@
this.nowDate.d = e.date; this.nowDate.d = e.date;
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = 'loadmore'; this.loadConfig.status = 'loadmore';
console.log('加载任务'); this.loadTaskList();
},
async loadTaskList(){
this.skeleton = true;
let res = await taskLists({
page: 1,
date_time: this.nowYMD
})
this.list = res.data;
this.$u.sleep(200).then(()=>this.skeleton = false);
}, },
// //
bindDateChangeMonth(e) { bindDateChangeMonth(e) {

View File

@ -110,6 +110,7 @@
demandListChild: [], // demandListChild: [], //
showDemandList: [], // showDemandList: [], //
updateFlag: true, updateFlag: true,
task_id: 0,
formData: { formData: {
id_card: '', id_card: '',
sex: '', sex: '',
@ -127,7 +128,8 @@
} }
}, },
onLoad(options) { onLoad(options) {
this.initInformationDetails({ id: options.id }) this.task_id = +options.task_id || 0;
this.initInformationDetails({ id: options.id });
this.initCategoryBusinessList(); this.initCategoryBusinessList();
this.initMap(); this.initMap();
}, },
@ -153,6 +155,7 @@
}); });
let res = await informationOpportunityUpdate({ let res = await informationOpportunityUpdate({
id: this.formData.id, id: this.formData.id,
task_id: this.task_id,
datas: [...refsDatas] datas: [...refsDatas]
}); });
uni.hideLoading(); uni.hideLoading();
@ -161,6 +164,7 @@
title: '更新成功', title: '更新成功',
success() { success() {
setTimeout(() => { setTimeout(() => {
uni.$emit('initOaTask');
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)
} }