更新,修复bug

This commit is contained in:
wpf 2023-08-06 16:27:59 +08:00
parent 96cf8fbe79
commit f1ed72008c
15 changed files with 868 additions and 780 deletions

View File

@ -40,7 +40,9 @@
props: { props: {
datas: { datas: {
type: Object, type: Object,
default: {} default: function(){
return {}
}
} }
}, },
data() { data() {

11
package-lock.json generated
View File

@ -1,11 +1,6 @@
{ {
"name": "OfficeApp",
"lockfileVersion": 3,
"requires": true, "requires": true,
"lockfileVersion": 1, "packages": {}
"dependencies": {
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}
}
} }

View File

@ -152,7 +152,7 @@
"path": "personnel/personnel", "path": "personnel/personnel",
"style": { "style": {
"navigationBarTitleText": "人员管理", "navigationBarTitleText": "人员管理",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3175f9", "navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
@ -216,7 +216,7 @@
"path": "companyInfo/companyInfo", "path": "companyInfo/companyInfo",
"style": { "style": {
"navigationBarTitleText": "公司信息", "navigationBarTitleText": "公司信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3175f9", "navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
@ -315,7 +315,7 @@
"path": "archives/archives", "path": "archives/archives",
"style": { "style": {
"navigationBarTitleText": "档案管理", "navigationBarTitleText": "档案管理",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3175f9", "navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }

View File

@ -23,12 +23,13 @@
<view v-else class="mesg_box"> <view v-else class="mesg_box">
<view class="name"> <view class="name">
<text class="nickname">姓名:{{ myOaInfo.nickname }}</text> <text class="nickname">姓名:{{ myOaInfo.nickname }}</text>
<text>{{ myOaInfo.admin_id?'超级管理员':'普通用户'}}</text>
</view> </view>
<view class="duty"> <view class="duty">
<!-- ({{ myOaInfo.did_name }}){{myOaInfo.label_name}} --> <!-- ({{ myOaInfo.did_name }}){{myOaInfo.label_name}} -->
电话:{{myOaInfo.account}}<br /> 电话:{{myOaInfo.account}}<br />
公司:<text v-if="myOaInfo.company">{{ myOaInfo.company.company_name }}</text> 公司:<text v-if="myOaInfo.company">{{ myOaInfo.company.company_name }}</text><br/>
公司类型:<text v-if="myOaInfo.company">{{ myOaInfo.company.company_type_name }}</text><br/>
</view> </view>
</view> </view>
</view> </view>

View File

@ -23,11 +23,13 @@
<view v-else class="name_work"> <view v-else class="name_work">
<view class="name"> <view class="name">
<text class="nickname">姓名:{{ oaUserInfo.nickname }}</text> <text class="nickname">姓名:{{ oaUserInfo.nickname }}</text>
{{ oaUserInfo.admin_id?'超级管理员':'普通用户'}}
<!-- <text class="omit" v-if="oaUserInfo.admin.company">所属公司:{{ oaUserInfo.admin.company.company_name }}</text> --> <!-- <text class="omit" v-if="oaUserInfo.admin.company">所属公司:{{ oaUserInfo.admin.company.company_name }}</text> -->
</view> </view>
<view class="work"> <view class="work">
电话:{{oaUserInfo.account}}<br /> 电话:{{oaUserInfo.account}}<br />
公司:<text v-if="oaUserInfo.company">{{ oaUserInfo.company.company_name }}</text> 公司:<text v-if="oaUserInfo.company">{{ oaUserInfo.company.company_name }}</text><br/>
公司类型:<text v-if="oaUserInfo.company">{{ oaUserInfo.company.company_type_name }}</text><br/>
<!-- {{ oaUserInfo.did_name }}({{ oaUserInfo.label_name }}) --> <!-- {{ oaUserInfo.did_name }}({{ oaUserInfo.label_name }}) -->
</view> </view>
</view> </view>

View File

@ -204,12 +204,12 @@ export const oaHomeData = [
url: '/subpkg/personnel/personnel', url: '/subpkg/personnel/personnel',
admin: true admin: true
}, },
{ // {
text: '固定资产', // text: '固定资产',
icon: prefix + 'oa/wcsq@2x.png', // icon: prefix + 'oa/wcsq@2x.png',
// url: '/subpkg/fixedAssets/fixedAssets', // url: '/subpkg/fixedAssets/fixedAssets',
admin: true // admin: true
}, // },
{ {
text: '合同管理', text: '合同管理',
icon: prefix + 'oa/cgsq@2x.png', icon: prefix + 'oa/cgsq@2x.png',

View File

@ -1,217 +1,230 @@
<template> <template>
<view class=""> <view class="">
<view class="personnel_list"> <view class="personnel_list">
<view class="item" v-for="(item, index) in list" :key="item.id"> <view class="item" v-for="(item, index) in list" :key="item.id">
<view class="top"> <view class="top">
<image class="avatar" src="../../static/img/public/record.png"></image> <image class="avatar" src="../../static/img/public/record.png"></image>
<view class="body"> <view class="body">
<view class="t_top"> <view class="t_top">
<view>姓名:<text class="name">{{item.name}}</text></view> <view>姓名:<text class="name">{{item.name}}</text></view>
<view>电话:<text class="mobile">{{item.phone}}</text></view> <view>电话:<text class="mobile">{{item.phone}}</text></view>
</view> </view>
<view class="t_bottom">片区:<text class="address">{{item.address}}</text></view> <view class="t_bottom">片区:<text class="address">{{item.address}}</text></view>
</view> </view>
</view> </view>
<u-line color="#cccccc"></u-line> <u-line color="#cccccc"></u-line>
<view class="bottom"> <view class="bottom">
<view>更新时间: {{item.create_time}}</view> <view>更新时间: {{item.create_time}}</view>
<view class="right" v-if="showView"> <view class="right" v-if="showView">
<view class="update" @click="navTo('/subpkg/updateArchives/updateArchives?id='+item.id)"> <view class="update" @click="navTo('/subpkg/updateArchives/updateArchives?id='+item.id)">
更新 更新
</view> </view>
<view class="look" @click="navTo('/subpkg/archivesDetail/archivesDetail?id='+item.id)"> <view class="look" @click="navTo('/subpkg/archivesDetail/archivesDetail?id='+item.id)">
查看 查看
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="loadConfig.status=='nomore'&& list.length==0" text="没有档案" icon="/static/img/empty/list.png"></u-empty> <u-empty v-if="loadConfig.status=='nomore'&& list.length==0" text="没有档案" icon="/static/img/empty/list.png">
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText" </u-empty>
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
</view> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
<mybtn text="信息登记" v-if="showView" @click="navTo('/subpkg/newArchives/newArchives')"></mybtn> </view>
</view> <mybtn text="信息登记" v-if="showView" @click="navTo('/subpkg/newArchives/newArchives')"></mybtn>
</view>
</template> </template>
<script> <script>
import { informationList } from "@/api/information.js" import {
import { Toast } from "../../libs/uniApi"; informationList
export default { } from "@/api/information.js"
data() { import {
return { Toast
user_id: -1, } from "../../libs/uniApi";
list: [], export default {
loadConfig: { data() {
page: 1, return {
limit: 15, user_id: -1,
loadingText: '努力加载中', list: [],
loadmoreText: '轻轻上拉', loadConfig: {
nomoreText: '我也是有底线的~~', page: 1,
status: 'loadmore' limit: 15,
}, loadingText: '努力加载中',
} loadmoreText: '轻轻上拉',
}, nomoreText: '我也是有底线的~~',
onLoad(options) { status: 'loadmore'
if (options.id) this.user_id = options.id; },
else if (this.$store.state.app.userInfo.admin_id == 0) { //,id }
this.user_id = this.$store.state.app.userInfo.id; },
} onLoad(options) {
}, if (options.id) this.user_id = options.id;
onShow() { else if (this.$store.state.app.userInfo.admin_id == 0) { //,id
this.initLoadconfig(); this.user_id = this.$store.state.app.userInfo.id;
this.loadInformationList(); }
}, this.loadInformationList();
computed: { },
// onShow() {
showView() {
return !this.$store.state.app.userInfo.admin_id && this.$store.state.app.userInfo.is_captain; },
} computed: {
}, //
onReachBottom() { showView() {
this.loadInformationList(); return !this.$store.state.app.userInfo.admin_id && this.$store.state.app.userInfo.is_captain;
}, }
methods: { },
navTo(url) { onReachBottom() {
if(url){ this.loadInformationList();
uni.showLoading({ },
title: '加载中', methods: {
mask: true navTo(url) {
}) if (url) {
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
success() { mask: true
uni.hideLoading() })
} uni.navigateTo({
}) url: url,
} success() {
else Toast('暂未开放'); uni.hideLoading()
}, }
initLoadconfig() { })
this.loadConfig.page = 1; } else Toast('暂未开放');
this.loadConfig.status = "loadmore"; },
this.list = []; async initLoad() {
}, this.loadConfig.page = 1;
async loadInformationList() { this.loadConfig.status = "loadmore";
let that = this; this.list = [];
if (this.loadConfig.status == "nomore") return; await this.loadInformationList();
this.loadConfig.status = "loading" uni.stopPullDownRefresh();
let res = await informationList({ },
page: this.loadConfig.page, async loadInformationList() {
limit: this.loadConfig.limit, let that = this;
user_id: that.user_id if (this.loadConfig.status == "nomore") return;
}) this.loadConfig.status = "loading"
this.loadConfig.status = "loadmore" let res = await informationList({
if (res.data.length < this.loadConfig.limit) { page: this.loadConfig.page,
this.loadConfig.status = "nomore" limit: this.loadConfig.limit,
} else { user_id: that.user_id
this.loadConfig.page++; })
} this.loadConfig.status = "loadmore"
this.list = [...this.list, ...res.data]; if (res.data.length < this.loadConfig.limit) {
} this.loadConfig.status = "nomore"
}, } else {
onPullDownRefresh() { this.loadConfig.page++;
uni.stopPullDownRefresh() }
} this.list = [...this.list, ...res.data];
} }
},
onPullDownRefresh() {
this.initLoad();
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.new_btn { .new_btn {
position: fixed; position: fixed;
bottom: 28rpx; bottom: 28rpx;
left: 50%; left: 50%;
transform: translate(-50%); transform: translate(-50%);
margin-top: 32rpx; margin-top: 32rpx;
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
width: 694rpx; width: 694rpx;
height: 84rpx; height: 84rpx;
background: $theme-oa-color; background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx; border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff; color: #fff;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
} }
.personnel_list { .personnel_list {
padding: 28rpx 0; padding: 28rpx 0;
margin-bottom: 130rpx; margin-bottom: 130rpx;
.item { .item {
margin: 0 auto; margin: 0 auto;
width: 694rpx; width: 694rpx;
// height: 201rpx; // height: 201rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx; border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1; opacity: 1;
margin-bottom: 21rpx; margin-bottom: 21rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 28rpx; padding: 28rpx;
font-size: 24.53rpx; font-size: 24.53rpx;
color: #999999FF; color: #999999FF;
.top { .top {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
.avatar { .avatar {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
margin-right: 18rpx; margin-right: 18rpx;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.body{ .body {
flex: 1; flex: 1;
.t_top{
display: flex;
justify-content: space-between;
margin-bottom: 18rpx;
.name{
font-size: 32rpx;
color: #333;
}
.mobile{
font-size: 28rpx;
color: #333;
}
}
.t_bottom{
width: 500rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.address{
font-size: 28rpx;
color: #333;
}
}
}
}
.bottom { .t_top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; margin-bottom: 18rpx;
margin-top: 20rpx;
font-size: 25rpx;
.right{
font-size: 28rpx;
display: flex;
.look{
color: $theme-oa-color;
}
.update{
color: #34A853;
margin-right: 38rpx;
}
}
} .name {
font-size: 32rpx;
color: #333;
}
.mobile {
font-size: 28rpx;
color: #333;
}
}
.t_bottom {
width: 500rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.address {
font-size: 28rpx;
color: #333;
}
}
}
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
font-size: 25rpx;
.right {
font-size: 28rpx;
display: flex;
.look {
color: $theme-oa-color;
}
.update {
color: #34A853;
margin-right: 38rpx;
}
}
}
} }
} }
</style> </style>

View File

@ -14,7 +14,7 @@
<view class="card"> <view class="card">
<view class="item"> <view class="item">
<view class="title">基本信息</view> <view class="title">基本信息</view>
<u-form-item labelWidth="auto" label="户主姓名" required prop="name" borderBottom> <u-form-item labelWidth="auto" label="姓名" required prop="name" borderBottom>
<u--input v-model="formData.name" :readonly="readonly" placeholder="请输入姓名"></u--input> <u--input v-model="formData.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="性别" required prop="sex" borderBottom> <u-form-item label="性别" required prop="sex" borderBottom>

View File

@ -91,11 +91,12 @@
this.loadCompanyList(); this.loadCompanyList();
}, },
methods: { methods: {
initLoad() { async initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.companyList = []; this.companyList = [];
this.loadCompanyList(); await this.loadCompanyList();
uni.stopPullDownRefresh()
}, },
// //
async loadCompanyList() { async loadCompanyList() {
@ -138,7 +139,7 @@
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() this.initLoad()
} }
} }
</script> </script>

View File

@ -3,12 +3,12 @@
<company :id="id" type="company"></company> <company :id="id" type="company"></company>
<view class="need_contract" v-if="!company.contract||!company.contract.status"> <view class="need_contract" v-if="!company.contract||!company.contract.status">
<picker v-if="!company.contract" :range="contractTypeList" range-key="name" @change="changeType"> <picker v-if="!company.contract" :range="contractTypeList" range-key="name" @change="changeType">
<button class="btn">发起合同</button> <button class="btn">生成合同</button>
<!-- <mybtn text="发起合同" position="false"></mybtn> --> <!-- <mybtn text="生成合同" position="false"></mybtn> -->
</picker> </picker>
<view v-if="company.contract&&company.contract.check_status==1"> <view v-if="company.contract&&company.contract.check_status==1">
<button class="btn tips_center">合同已发起,请等待审核</button> <button class="btn tips_center">合同已生成,请等待审核</button>
<!-- <mybtn text="发起合同" position="false" disabled></mybtn> --> <!-- <mybtn text="生成合同" position="false" disabled></mybtn> -->
</view> </view>
<view v-if="company.contract&&company.contract.check_status==2" class="card"> <view v-if="company.contract&&company.contract.check_status==2" class="card">
<view class="contract_box send"> <view class="contract_box send">
@ -101,22 +101,22 @@
}) })
this.contractTypeList = res.data; this.contractTypeList = res.data;
}, },
// //
async createContract(data) { async createContract(data) {
let res = await initiateContract({ let res = await initiateContract({
party_b: data.party_b, party_b: data.party_b,
contract_type: data.contract_type, contract_type: data.contract_type,
type: data.type type: data.type
}) })
Toast(res.msg || '合同已发起') Toast(res.msg || '合同已生成')
this.initCompany(); this.initCompany();
}, },
// //
async addContract(data) { async addContract(data) {
let res = await Draftingcontracts({ let res = await Draftingcontracts({
id: this.id id: this.id
}); });
Toast('合同已生成'); Toast('合同已发送');
this.initCompany(); this.initCompany();
if (this.userInfo.contract.check_status == 3) { if (this.userInfo.contract.check_status == 3) {
this.timerCount = 60; this.timerCount = 60;

View File

@ -83,6 +83,17 @@ export default {
url: url url: url
}) : Toast('暂未开放') }) : Toast('暂未开放')
}, },
copyPhone(str = "", type = "号码") {
if (str) uni.setClipboardData({
data: str + "",
success: (e) => {
Toast(type + '已复制')
},
fail: (e) => {
Toast('复制失败')
}
})
},
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()

View File

@ -4,7 +4,7 @@
<u--form labelPosition="left" :model="formData" :rules="rules" ref="archives"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="archives">
<view class="item"> <view class="item">
<view class="title">基本信息</view> <view class="title">基本信息</view>
<u-form-item labelWidth="auto" label="户主姓名" required prop="name" borderBottom> <u-form-item labelWidth="auto" label="姓名" required prop="name" borderBottom>
<u--input v-model="formData.name" placeholder="请输入姓名"></u--input> <u--input v-model="formData.name" placeholder="请输入姓名"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="性别" required prop="sex" borderBottom> <u-form-item label="性别" required prop="sex" borderBottom>
@ -28,6 +28,9 @@
<view class="item"> <view class="item">
<view class="title">地区信息</view> <view class="title">地区信息</view>
<!-- <districtSelector ref="districtSelectorRef"></districtSelector> --> <!-- <districtSelector ref="districtSelectorRef"></districtSelector> -->
<u-form-item labelWidth="auto" label="地址" borderBottom>
<u--textarea :value="nowAddress" autoHeight readonly></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom> <u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom>
<u--input v-model="formData.address" placeholder="请输入详细地址"></u--input> <u--input v-model="formData.address" placeholder="请输入详细地址"></u--input>
</u-form-item> </u-form-item>
@ -56,8 +59,8 @@
</block> </block>
</view> </view>
<residents ref="residentsRef"></residents> <residents ref="residentsRef"></residents>
<breeding ref="breedingRef"></breeding> <!-- <breeding ref="breedingRef"></breeding>
<plant ref="plantRef"></plant> <plant ref="plantRef"></plant> -->
<!-- 更多内容 --> <!-- 更多内容 -->
<!-- <block v-for="(item, index) in showDemandList" :key="'demand'+index"> <!-- <block v-for="(item, index) in showDemandList" :key="'demand'+index">
@ -223,6 +226,12 @@
this.initCategoryBusinessList(); this.initCategoryBusinessList();
}, },
onShow() {}, onShow() {},
computed:{
nowAddress(){
let address = this.$store.state.app.userInfo;
return address.province_name+address.city_name+address.area_name+address.street_name+address.village_name+address.brigade_name;
}
},
methods: { methods: {
// //
async addArchives() { async addArchives() {
@ -231,11 +240,11 @@
// let refsDatas = this.loadRefsDatas(); // let refsDatas = this.loadRefsDatas();
// let flag1 = await this.$refs.districtSelectorRef.validate(); // let flag1 = await this.$refs.districtSelectorRef.validate();
let flag2 = await this.$refs.residentsRef.validate(); let flag2 = await this.$refs.residentsRef.validate();
let flag3 = await this.$refs.breedingRef.validate(); // let flag3 = await this.$refs.breedingRef.validate();
let flag4 = await this.$refs.plantRef.validate(); // let flag4 = await this.$refs.plantRef.validate();
// return console.log(flag1); // return console.log(flag1);
this.$refs.archives.validate().then(async (e) => { this.$refs.archives.validate().then(async (e) => {
if (e == true && flag4 == true && flag2 == true && flag3 == true) { if (e == true && flag2 == true) {
uni.showLoading({ uni.showLoading({
title: '登记中', title: '登记中',
mask: true mask: true

View File

@ -74,10 +74,9 @@
userList: [] userList: []
} }
}, },
onLoad() {}, onLoad() {
onShow() { this.loadUserList()
this.loadUserList() },
},
methods: { methods: {
navTo(url) { navTo(url) {
url ? url ?
@ -85,6 +84,13 @@
url: url, url: url,
}) : Toast('暂未开放') }) : Toast('暂未开放')
}, },
async initLoad() {
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.userList = [];
await this.loadUserList();
uni.stopPullDownRefresh();
},
async loadUserList() { async loadUserList() {
let that = this; let that = this;
if (this.loadConfig.status == "nomore") return; if (this.loadConfig.status == "nomore") return;
@ -104,7 +110,7 @@
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() this.initLoad();
} }
} }
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
<u--form labelPosition="left" :model="formData" ref="archives"> <u--form labelPosition="left" :model="formData" ref="archives">
<!-- <view class="item" style="margin-top: 30rpx;"> <!-- <view class="item" style="margin-top: 30rpx;">
<view class="title">基本信息</view> <view class="title">基本信息</view>
<u-form-item labelWidth="auto" label="户主姓名" required prop="name" borderBottom> <u-form-item labelWidth="auto" label="姓名" required prop="name" borderBottom>
<u--input readonly v-model="formData.name" placeholder="请输入姓名"></u--input> <u--input readonly v-model="formData.name" placeholder="请输入姓名"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="性别" required prop="sex" borderBottom> <u-form-item label="性别" required prop="sex" borderBottom>