更新
This commit is contained in:
parent
1524b52928
commit
3259be3b13
@ -3,27 +3,31 @@
|
||||
<u-sticky bgColor="#f5f5f5" offsetTop="44px">
|
||||
<!-- <u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false"
|
||||
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>
|
||||
<view class="c_task_index_list">
|
||||
<view v-for="item in 10" @click="navTo('/subpkg/dispatching/dispatching')" :key="item">
|
||||
<taskItem></taskItem>
|
||||
<view v-for="item in list" :key="item.id">
|
||||
<taskItem :datas="item"></taskItem>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
<!-- <u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty> -->
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
||||
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
<!-- <u-empty icon="/static/img/empty/data.png" text="没有数据"></u-empty> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Toast } from "../../libs/uniApi";
|
||||
import taskItem from "./taskItem.vue"
|
||||
import taskItem from "./taskItem.vue";
|
||||
import { taskLists } from "@/api/task.js";
|
||||
export default {
|
||||
name: "task",
|
||||
components: { taskItem },
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
status: 0,
|
||||
// tabLists: [{
|
||||
// name: '全部',
|
||||
// }, {
|
||||
@ -33,8 +37,7 @@
|
||||
// }],
|
||||
loadConfig: {
|
||||
page: 1,
|
||||
limit: 15,
|
||||
lastpage: '',
|
||||
limit: 25,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
@ -43,6 +46,9 @@
|
||||
list: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initLoadConfig();
|
||||
},
|
||||
methods: {
|
||||
navTo(url) {
|
||||
url ?
|
||||
@ -51,9 +57,42 @@
|
||||
}) : Toast('暂未开放')
|
||||
},
|
||||
changeCurrent(e) {
|
||||
if(this.current!==e.currentIndex){
|
||||
this.current = e.currentIndex;
|
||||
if (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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,12 @@
|
||||
<view class="b_right">
|
||||
<view class="item">
|
||||
<view class="left">
|
||||
<view>任务进度:</view>
|
||||
<view class="text">30%</view>
|
||||
<view>任务状态:</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 class="right">¥{{datas.money||'0.00'}}<text class="price">元</text></view>
|
||||
</view>
|
||||
@ -59,9 +63,13 @@ import { Toast } from '../../libs/uniApi';
|
||||
}) : Toast('暂未开放')
|
||||
},
|
||||
clickTask(){
|
||||
console.log('点击');
|
||||
if(this.$props.datas.type==1){
|
||||
this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
||||
// console.log('点击', this.$props.datas);
|
||||
if(this.$props.datas.status!==2&&this.$props.datas.status!==1){
|
||||
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('');
|
||||
}
|
||||
}
|
||||
|
@ -13,13 +13,12 @@
|
||||
itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs>
|
||||
</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.password" maxlength="26" placeholder="输入密码" password
|
||||
type="safe-password" />
|
||||
<input v-if="current==0" class="mobile item" v-model="formData.password" maxlength="26" placeholder="输入密码"
|
||||
password type="safe-password" />
|
||||
<input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
|
||||
<view v-if="current==1" class="code item">
|
||||
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
|
||||
<u-code :seconds="seconds" @end="end" @start="start" ref="uCode"
|
||||
@change="codeChange"></u-code>
|
||||
<u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
|
||||
<view class="get-code" @click="getCode">{{tips}}</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
@ -34,13 +33,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { loginAccount, userInfo, test } from "@/api/oaUser.js"
|
||||
import { Toast } from "../../libs/uniApi";
|
||||
import { loginAccount, userInfo, test } from "@/api/oaUser.js"
|
||||
import { Toast } from "../../libs/uniApi";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabList: [
|
||||
{name:'账号登录'},
|
||||
{ name: '账号登录' },
|
||||
// {name:'手机登录'},
|
||||
],
|
||||
current: 0,
|
||||
@ -62,14 +61,14 @@ import { Toast } from "../../libs/uniApi";
|
||||
this.formData.scene = e.index + 1;
|
||||
},
|
||||
async login() {
|
||||
if(!this.formData.account)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.account) return Toast('账号不能为空');
|
||||
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
|
||||
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
|
||||
let that = this;
|
||||
// let res = await test();
|
||||
// console.log(res);
|
||||
uni.showLoading({
|
||||
title:'正在登录中'
|
||||
title: '正在登录中'
|
||||
})
|
||||
let res = await loginAccount(that.formData);
|
||||
this.$store.commit('SET_USERINFO', {
|
||||
@ -79,19 +78,18 @@ import { Toast } from "../../libs/uniApi";
|
||||
let { data } = await userInfo();
|
||||
this.$store.commit('setUserInfo', data);
|
||||
uni.hideLoading()
|
||||
if(data.is_new_user) {
|
||||
if (data.is_new_user) {
|
||||
uni.showLoading({
|
||||
mask:true,
|
||||
title:'加载中'
|
||||
mask: true,
|
||||
title: '加载中'
|
||||
})
|
||||
uni.switchTab({
|
||||
url:'/pages/oaHome/oaHome',
|
||||
url: '/pages/oaHome/oaHome',
|
||||
success: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
}
|
||||
else uni.navigateTo({
|
||||
} else uni.navigateTo({
|
||||
url: '/pages/updatePasswprd/updatePasswprd'
|
||||
});
|
||||
},
|
||||
@ -122,7 +120,7 @@ import { Toast } from "../../libs/uniApi";
|
||||
this.tips = text;
|
||||
},
|
||||
getCode() {
|
||||
if(this.$refs.uCode.canGetCode) {
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
// 模拟向后端请求验证码
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码'
|
||||
@ -145,7 +143,7 @@ import { Toast } from "../../libs/uniApi";
|
||||
// uni.$u.toast('倒计时开始');
|
||||
},
|
||||
//忘记密码
|
||||
forgetPWD(){
|
||||
forgetPWD() {
|
||||
Toast('暂未开放')
|
||||
}
|
||||
},
|
||||
|
@ -36,7 +36,8 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadList()
|
||||
this.loadList();
|
||||
uni.$on('initOaTask', this.loadList);
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
|
@ -2,7 +2,13 @@
|
||||
<view class="reset-password">
|
||||
<u--form ref="formRef" :rules="rules" :model="formData">
|
||||
<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 label="新密码" labelWidth="140rpx" borderBottom prop="password">
|
||||
<u--input v-model="formData.password" type="password" placeholder="请输入新密码" maxlength="18"></u--input>
|
||||
@ -16,17 +22,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Toast } from '../../libs/uniApi';
|
||||
import { changePassword } from "@/api/oaUser.js"
|
||||
export default {
|
||||
import { Toast } from '../../libs/uniApi';
|
||||
import { changePassword } from "@/api/oaUser.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData:{
|
||||
pwdShow: {
|
||||
old_password: false,
|
||||
password: false,
|
||||
password_confirm: false,
|
||||
},
|
||||
formData: {
|
||||
old_password: '', // 原密码
|
||||
password: '', // 新密码
|
||||
password_confirm: '', // 确认密码
|
||||
},
|
||||
rules:{
|
||||
rules: {
|
||||
old_password: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
@ -56,41 +67,41 @@ export default {
|
||||
},
|
||||
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});
|
||||
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(()=>{
|
||||
this.$u.sleep(500).then(() => {
|
||||
uni.showLoading({
|
||||
mask:true,
|
||||
title:'加载中'
|
||||
mask: true,
|
||||
title: '加载中'
|
||||
})
|
||||
uni.switchTab({
|
||||
url:'/pages/oaHome/oaHome',
|
||||
url: '/pages/oaHome/oaHome',
|
||||
success: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
})
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
// console.log(e);
|
||||
Toast(e.msg||'修改失败')
|
||||
Toast(e.msg || '修改失败')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.reset-password {
|
||||
.reset-password {
|
||||
margin: 28rpx;
|
||||
padding: 28rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -45,7 +45,7 @@
|
||||
<companyFinance></companyFinance>
|
||||
</view>
|
||||
<view v-show="current==3">
|
||||
<task style="width: 100vw;"></task>
|
||||
<task ref="taskRef" style="width: 100vw;"></task>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty>
|
||||
@ -94,7 +94,8 @@
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadCompanyList();
|
||||
if(this.current==1) this.loadCompanyList();
|
||||
else if(this.current==3) this.$refs.taskRef.loadList();
|
||||
},
|
||||
methods: {
|
||||
async initLoad() {
|
||||
@ -145,7 +146,7 @@
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
if(this.current==1) this.initLoad();
|
||||
|
||||
else if(this.current==3) this.$refs.taskRef.initLoadConfig();
|
||||
this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()})
|
||||
}
|
||||
}
|
||||
|
@ -40,16 +40,16 @@ import { informationList } from "@/api/information.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ids: [],
|
||||
ids: -1,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
try{
|
||||
this.ids = JSON.parse(options.id);
|
||||
this.ids = options.id;
|
||||
this.loadList();
|
||||
}catch(e){
|
||||
this.ids = [];
|
||||
this.ids = -1;
|
||||
}
|
||||
},
|
||||
onShow() {},
|
||||
@ -76,6 +76,7 @@ export default {
|
||||
let res = await informationList({
|
||||
'arr[]': [...this.ids]
|
||||
});
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
|
@ -228,8 +228,8 @@
|
||||
title: "添加成功",
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
// uni.$emit('initPersonnel');
|
||||
// uni.navigateBack();
|
||||
uni.$emit('initPersonnel');
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
|
@ -11,18 +11,19 @@
|
||||
</view>
|
||||
<view class="task_list">
|
||||
<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')">
|
||||
<taskItem></taskItem>
|
||||
</view>
|
||||
<!-- <u-empty icon="/static/img/empty/data.png" text="没有任务"></u-empty> -->
|
||||
<!-- <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
||||
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
|
||||
<u-skeleton :loading="skeleton" :style="{margin: skeleton?'0 28rpx':'0'}" :animate="true" title rows="2" rows-width="100%" rowsHeight="56">
|
||||
<block v-for="item in list" :key="item.id">
|
||||
<taskItem :datas="item"></taskItem>
|
||||
</block>
|
||||
</u-skeleton>
|
||||
<u-empty v-if="!skeleton&&list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import taskItem from "@/components/task/taskItem.vue"
|
||||
import { taskLists } from "@/api/task.js"
|
||||
export default {
|
||||
components:{
|
||||
taskItem
|
||||
@ -30,6 +31,7 @@
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
skeleton: true,
|
||||
nowDate: {
|
||||
y: '',
|
||||
m: '',
|
||||
@ -43,10 +45,12 @@
|
||||
nomoreText: '没有更多账单了~~',
|
||||
status: 'loadmore'
|
||||
},
|
||||
list: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.initDate();
|
||||
this.loadTaskList();
|
||||
},
|
||||
onShow() {},
|
||||
computed: {
|
||||
@ -70,7 +74,16 @@
|
||||
this.nowDate.d = e.date;
|
||||
this.loadConfig.page = 1;
|
||||
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) {
|
||||
|
@ -110,6 +110,7 @@
|
||||
demandListChild: [], //更多二级需求
|
||||
showDemandList: [], //更多需求展示列表
|
||||
updateFlag: true,
|
||||
task_id: 0,
|
||||
formData: {
|
||||
id_card: '',
|
||||
sex: '',
|
||||
@ -127,7 +128,8 @@
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.initInformationDetails({ id: options.id })
|
||||
this.task_id = +options.task_id || 0;
|
||||
this.initInformationDetails({ id: options.id });
|
||||
this.initCategoryBusinessList();
|
||||
this.initMap();
|
||||
},
|
||||
@ -153,6 +155,7 @@
|
||||
});
|
||||
let res = await informationOpportunityUpdate({
|
||||
id: this.formData.id,
|
||||
task_id: this.task_id,
|
||||
datas: [...refsDatas]
|
||||
});
|
||||
uni.hideLoading();
|
||||
@ -161,6 +164,7 @@
|
||||
title: '更新成功',
|
||||
success() {
|
||||
setTimeout(() => {
|
||||
uni.$emit('initOaTask');
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user