优化页面,修复bug

This commit is contained in:
weipengfei 2023-08-04 16:09:05 +08:00
parent 9c3df416c1
commit 6e7c536b55
15 changed files with 739 additions and 489 deletions

View File

@ -1,17 +1,8 @@
<template> <template>
<view class="card"> <view class="card">
<view class="title">养殖</view> <view class="title">养殖信息</view>
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="耕地总面积" required prop="cultivated_area" borderBottom> <u-form-item labelWidth="auto" label="有无养殖培训" required prop="breeding_training" borderBottom>
<u--input :readonly="readonly" v-model="formData.cultivated_area" placeholder="请输入耕地总面积"></u--input>
</u-form-item>
<picker :range="landPlanList" :disabled="readonly" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="土地规划" required prop="planning" borderBottom>
<u--input :value="landPlanList[formData.planning]" placeholder="请选择规划" disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<u-form-item labelWidth="auto" label="有无种养殖培训" required prop="breeding_training" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.breeding_training" style="margin: 16rpx;"> <u-radio-group :disabled="readonly" v-model="formData.breeding_training" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
@ -19,8 +10,8 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无注册成立种植公司" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无注册成立养殖公司" required prop="breeding_company" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group :disabled="readonly" v-model="formData.breeding_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value"> :name="item.value">
@ -30,15 +21,12 @@
<u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom> <u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround" count></u--textarea> <u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround" count></u--textarea>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="种养殖类型" required prop="breeding_type" borderBottom> <u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom>
<u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入种养殖类型"></u--input> <u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="area" borderBottom>
<u--input :readonly="readonly" v-model="formData.area" placeholder="请输入面积"></u--input>
</u-form-item> </u-form-item>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'"> <picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
<u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom> <u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom>
<u--input :value="formData.breeding_time" placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></u--input> <u--input :value="formData.breeding_time" placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></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>
</picker> </picker>
@ -58,7 +46,7 @@
<u--textarea :disabled="readonly" v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具收益情况" border="surround" <u--textarea :disabled="readonly" v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具收益情况" border="surround"
count></u--textarea> count></u--textarea>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="是否生态养殖" required prop="ecological_farming" borderBottom> <u-form-item labelWidth="auto" label="是否生态养殖" required prop="ecological_farming" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.ecological_farming" style="margin: 16rpx;"> <u-radio-group :disabled="readonly" v-model="formData.ecological_farming" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label" v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
@ -112,10 +100,10 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="种养殖需求描述" required prop="demand" borderBottom> <u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.demand" autoHeight placeholder="请输入种养殖需求描述" border="surround" count></u--textarea> <u--textarea :disabled="readonly" v-model="formData.demand" autoHeight placeholder="请输入需求描述" border="surround" count></u--textarea>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="政策补助" required prop="policy_subsidies" borderBottom> <u-form-item labelWidth="auto" labelPosition="top" label="政策补助" prop="policy_subsidies" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助" border="surround" <u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助" border="surround"
count></u--textarea> count></u--textarea>
</u-form-item> </u-form-item>
@ -138,21 +126,18 @@
}, },
data() { data() {
return { return {
landPlanList: ['自己养', '出租', '代种养', '租更多地扩大种植'], landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
formData: { formData: {
// "cultivated_area": "20", // // "breeding_training": 1, //
// "planning": 1, // // "breeding_company": 0, //
// "breeding_training": 1, //
// "planting_company": 0, //
// "notes": "", // // "notes": "", //
// "breeding_type": 22, // // "breeding_type": 22, //
// "area": 20, // // "breeding_time": "2022-07-22", //
// "breeding_time": "2022-07-22", //
// "mature_time": "2022-07-22", // // "mature_time": "2022-07-22", //
// "yield": 600, // // "yield": 600, //
// "estimated_income": 1500, // // "estimated_income": 1500, //
// "farm_tools": ",", //使 // "farm_tools": ",", //使
// "ecological_farming": 1, // // "ecological_farming": 1, //
// "modernization": 30, // // "modernization": 30, //
// "pre_price": "30.00", // // "pre_price": "30.00", //
// "method_sales": 1, // // "method_sales": 1, //
@ -160,21 +145,19 @@
// "promote": 0, //广 // "promote": 0, //广
// "transportation": 0, // // "transportation": 0, //
// "expand_business_needs": 0, // // "expand_business_needs": 0, //
// "demand": "", // // "demand": "", //
// "policy_subsidies": "" ,// // "policy_subsidies": "" ,//
"cultivated_area": "", // "breeding_training": "", //
"planning": "", // "breeding_company": "", //
"breeding_training": "", //
"planting_company": "", //
"notes": "", // "notes": "", //
"breeding_type": "", // "breeding_type": "", //
"area": "", // "area": "", //
"breeding_time": "", // "breeding_time": "", //
"mature_time": "", // "mature_time": "", //
"yield": "", // "yield": "", //
"estimated_income": "", // "estimated_income": "", //
"farm_tools": "", //使 "farm_tools": "", //使
"ecological_farming": "", // "ecological_farming": "", //
"modernization": "", // "modernization": "", //
"pre_price": "", // "pre_price": "", //
"method_sales": "", // "method_sales": "", //
@ -182,7 +165,7 @@
"promote": "", //广 "promote": "", //广
"transportation": "", // "transportation": "", //
"expand_business_needs": "", // "expand_business_needs": "", //
"demand": "", // "demand": "", //
"policy_subsidies": "" // "policy_subsidies": "" //
}, },
rules: { rules: {
@ -215,6 +198,10 @@
// //
initRules(){ initRules(){
let arr = Object.keys(this.formData); let arr = Object.keys(this.formData);
let white = ['demand', 'policy_subsidies'];
arr = arr.filter(item=>{
return !white.includes(item);
})
arr.forEach(key=>{ arr.forEach(key=>{
this.rules[key] = { this.rules[key] = {
validator: (rule, value, callback )=>{ validator: (rule, value, callback )=>{

View File

@ -23,7 +23,7 @@
<u-form-item labelWidth="auto" label="技能特长" required prop="family" borderBottom> <u-form-item labelWidth="auto" label="技能特长" required prop="family" borderBottom>
<u--input v-model="item.skills" :readonly="readonly" placeholder="请输入技能特长"></u--input> <u--input v-model="item.skills" :readonly="readonly" placeholder="请输入技能特长"></u--input>
</u-form-item> </u-form-item>
<button v-if="residents.family.length>1&&!readonly" class="delete" <button v-if="!readonly" class="delete"
@click="removeFamily(index)">删除以上信息</button> @click="removeFamily(index)">删除以上信息</button>
</block> </block>
<button v-if="!readonly" class="plus" @click="pushFamily">添加常住人口</button> <button v-if="!readonly" class="plus" @click="pushFamily">添加常住人口</button>
@ -98,12 +98,14 @@
situationList: [ "做工地的","厂里打工","公司职员","政府上班","种地","在家赋闲","其他"], situationList: [ "做工地的","厂里打工","公司职员","政府上班","种地","在家赋闲","其他"],
// //
residents: { residents: {
family: [{ family: [
name: '', // {
birth_time: '', // name: '',
situation: '', // // birth_time: '',
skills: '', // // situation: '', //
}], // skills: '', //
// }
],
child: '', // child: '', //
child_arr: [ // child_arr: [ //
{ {

View File

@ -5,7 +5,7 @@ httpApi = 'https://worker-task.lihaink.cn' //生产
httpApiThree = 'https://worker-task.lihaink.cn' //生产 httpApiThree = 'https://worker-task.lihaink.cn' //生产
// httpApiThree = 'http://ceshi-oa.lihaink.cn' //生产 // httpApiThree = 'http://ceshi-oa.lihaink.cn' //生产
// #ifdef H5 // #ifdef H5
httpApiThree = 'baseUrlTest' //生产 // httpApiThree = 'baseUrlTest' //生产
// #endif // #endif
// if (process.env.NODE_ENV === "development") { // if (process.env.NODE_ENV === "development") {
@ -33,14 +33,11 @@ module.exports = {
// #ifdef H5 // #ifdef H5
//H5接口是浏览器地址 //H5接口是浏览器地址
HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host, // HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,
HTTP_REQUEST_URL_THREE: httpApiThree || window.location.protocol + "//" + window.location.host, // HTTP_REQUEST_URL_THREE: httpApiThree || window.location.protocol + "//" + window.location.host,
// #endif // #endif
HEADER: { HEADER: {
'content-type': 'application/json', 'content-type': 'application/json',
//#ifdef H5
'Form-type': 'h5',
//#endif
//#ifdef MP //#ifdef MP
'Form-type': 'routine', 'Form-type': 'routine',
//#endif //#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -3,40 +3,33 @@
<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="item.avatar||'../../static/img/public/man.png'"></image> --> <image class="avatar" src="../../static/img/public/record.png"></image>
<!-- <u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'" <view class="body">
width="112.28rpx" height="112.28rpx" shape="circle"> <view class="t_top">
</u--image> --> <view>姓名:<text class="name">{{item.name}}</text></view>
<view class="text"> <view>电话:<text class="mobile">{{item.phone}}</text></view>
<view class="name">{{item.name}}</view>
<view class="mobile">
<uni-icons type="phone" color="#999999FF"></uni-icons><text>{{item.phone}}</text>
</view>
<view class="mobile">
<uni-icons type="calendar" color="#999999FF"></uni-icons><text>{{item.create_time}}</text>
</view> </view>
<view class="t_bottom">片区:<text class="address">{{item.address}}</text></view>
</view> </view>
</view>
<u-line color="#cccccc"></u-line>
<view class="bottom">
<view>更新时间: {{item.create_time}}</view>
<view class="right" v-if="showView"> <view class="right" v-if="showView">
<view class="top" @click="navTo('/subpkg/archivesDetail/archivesDetail?id='+item.id)"> <view class="update" @click="navTo('/subpkg/updateArchives/updateArchives?id='+item.id)">
查看
</view>
<view class="bottom" @click="navTo('/subpkg/updateArchives/updateArchives?id='+item.id)">
更新 更新
</view> </view>
<view class="look" @click="navTo('/subpkg/archivesDetail/archivesDetail?id='+item.id)">
查看
</view>
</view> </view>
</view> </view>
<view class="bottom">
<view class="circle"></view>
<view class="green">所属片区</view>
<view class="tips">{{item.address}}</view>
</view>
</view> </view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" <u-empty v-if="loadConfig.status=='nomore'&& list.length==0" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
<button class="new_btn" v-if="showView" <mybtn text="信息登记" v-if="showView" @click="navTo('/subpkg/newArchives/newArchives')"></mybtn>
@click="navTo('/subpkg/newArchives/newArchives')">信息登记</button>
<!-- <button class="new_btn" @click="navTo('/subpkg/updateArchives/updateArchives')">信息更新(测试中)</button> -->
</view> </view>
</template> </template>
@ -59,8 +52,8 @@
} }
}, },
onLoad(options) { onLoad(options) {
if(options.id)this.user_id = options.id; if (options.id) this.user_id = options.id;
else if(this.$store.state.app.userInfo.admin_id==0){ //,id else if (this.$store.state.app.userInfo.admin_id == 0) { //,id
this.user_id = this.$store.state.app.userInfo.id; this.user_id = this.$store.state.app.userInfo.id;
} }
}, },
@ -71,7 +64,7 @@
computed: { computed: {
// //
showView() { showView() {
return !this.$store.state.app.userInfo.admin_id&&this.$store.state.app.userInfo.is_captain; return !this.$store.state.app.userInfo.admin_id && this.$store.state.app.userInfo.is_captain;
} }
}, },
onReachBottom() { onReachBottom() {
@ -144,99 +137,65 @@
margin-bottom: 21rpx; margin-bottom: 21rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 28rpx; padding: 28rpx;
font-size: 24.53rpx;
color: #999999FF;
.top { .top {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
width: 100%; width: 100%;
.avatar { .avatar {
width: 88rpx; width: 120rpx;
height: 88rpx; height: 120rpx;
border-radius: 50%;
margin-right: 18rpx; margin-right: 18rpx;
} }
.u_avatar { .body{
margin-right: 18rpx; flex: 1;
} .t_top{
.text {
display: flex;
justify-content: space-around;
flex-direction: column;
height: 100%;
.name {
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
.mobile {
color: #999999;
font-size: 28rpx;
}
}
.right {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
.top,
.bottom {
width: 158rpx;
height: 53rpx;
background: #FFFFFF;
border-radius: 26rpx 26rpx 26rpx 26rpx;
opacity: 1;
border: 2rpx solid #3274F9;
color: #3274F9;
display: flex; display: flex;
align-items: center; justify-content: space-between;
justify-content: center; margin-bottom: 18rpx;
.name{
font-size: 32rpx;
color: #333;
}
.mobile{
font-size: 28rpx;
color: #333;
}
} }
.t_bottom{
.bottom { width: 500rpx;
border: 2rpx solid #F9AA32; overflow: hidden;
color: #F9AA32; white-space: nowrap;
margin-top: 18rpx; text-overflow: ellipsis;
.address{
font-size: 28rpx;
color: #333;
}
} }
} }
} }
.bottom { .bottom {
display: flex; display: flex;
justify-content: left; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 20rpx; margin-top: 20rpx;
font-size: 25rpx; font-size: 25rpx;
.circle { .right{
width: 11rpx; font-size: 28rpx;
height: 11rpx; display: flex;
opacity: 1; .look{
border: 2rpx solid #34A853; color: $theme-oa-color;
margin-right: 10rpx; }
border-radius: 50%; .update{
} color: #34A853;
margin-right: 38rpx;
.green { }
font-weight: 400;
color: #34A853;
line-height: 0rpx;
margin-right: 18rpx;
-webkit-background-clip: text;
}
.tips{
width: 480rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
} }

View File

@ -1,11 +1,15 @@
<template> <template>
<view class=""> <view class="">
<view class="top_box"> <!-- <view class="top_box">
<view class="item" :class="current==0?'active':''" @click="current=0">基本信息</view> <view class="item" :class="current==0?'active':''" @click="current=0">基本信息</view>
<view class="item" :class="current==1?'active':''" @click="current=1">商机信息</view> <view class="item" :class="current==1?'active':''" @click="current=1">商机信息</view>
</view> </view> -->
<view class="card" v-show="current==0"> <u-sticky bgColor="#fff">
<u--form labelPosition="left" :model="formData" ref="archives"> <u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40'
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs>
</u-sticky>
<u--form v-show="current==0" labelPosition="left" :model="formData" ref="archives">
<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>
@ -29,6 +33,8 @@
<u--input v-model="formData.phone" :readonly="readonly" placeholder="请输入手机号" type="number"></u--input> <u--input v-model="formData.phone" :readonly="readonly" placeholder="请输入手机号" type="number"></u--input>
</u-form-item> </u-form-item>
</view> </view>
</view>
<view class="card">
<view class="item"> <view class="item">
<districtSelector ref="districtSelectorRef" :datas="formData" :readonly="true"></districtSelector> <districtSelector ref="districtSelectorRef" :datas="formData" :readonly="true"></districtSelector>
<u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom> <u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom>
@ -58,16 +64,14 @@
</block> </block>
</block> </block>
</view> </view>
<residents ref="residentsRef" :readonly="true" :datas="formData"></residents> </view>
<!-- <breeding ref="breedingRef"></breeding> --> </u--form>
<residents ref="residentsRef" :readonly="true" :datas="formData"></residents>
</u--form> <view v-show="current==1">
<!-- <button @click="addArchives" type="primary" class="btn">完成登记</button> -->
</view>
<view class="card" style="padding-top: 1rpx;" v-show="current==1">
<block v-for="(item, index) in formData.datas" :key="'demand'+index+item.id"> <block v-for="(item, index) in formData.datas" :key="'demand'+index+item.id">
<block> <block>
<breeding v-if="item.id==7" :datas="item.datas" :readonly="true" ref="demandRef7"></breeding> <breeding v-if="item.id==32" :datas="item.datas" :readonly="true" ref="demandRef32"></breeding>
<plant v-if="item.id==7" :datas="item.datas" :readonly="true" ref="demandRef7"></plant>
<store v-if="item.id==8" :datas="item.datas" :readonly="true" ref="demandRef8"></store> <store v-if="item.id==8" :datas="item.datas" :readonly="true" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" :datas="item.datas" :readonly="true" ref="demandRef9"></deepProcessing> <deepProcessing v-if="item.id==9" :datas="item.datas" :readonly="true" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" :datas="item.datas" :readonly="true" ref="demandRef10"></thickProcessing> <thickProcessing v-if="item.id==10" :datas="item.datas" :readonly="true" ref="demandRef10"></thickProcessing>
@ -76,7 +80,8 @@
<houseRepair v-if="item.id==12" :datas="item.datas" :readonly="true" ref="demandRef12"></houseRepair> <houseRepair v-if="item.id==12" :datas="item.datas" :readonly="true" ref="demandRef12"></houseRepair>
<houseDecoration v-if="item.id==13" :datas="item.datas" :readonly="true" ref="demandRef13"></houseDecoration> <houseDecoration v-if="item.id==13" :datas="item.datas" :readonly="true" ref="demandRef13"></houseDecoration>
<houseRenovate v-if="item.id==14" :datas="item.datas" :readonly="true" ref="demandRef14"></houseRenovate> <houseRenovate v-if="item.id==14" :datas="item.datas" :readonly="true" ref="demandRef14"></houseRenovate>
<houseTransaction v-if="item.id==15" :datas="item.datas" :readonly="true" ref="demandRef15"></houseTransaction> <houseTransaction v-if="item.id==15" :datas="item.datas" :readonly="true" ref="demandRef15">
</houseTransaction>
</block> </block>
<block> <block>
<banquetMarry v-if="item.id==17" :datas="item.datas" :readonly="true" ref="demandRef17"></banquetMarry> <banquetMarry v-if="item.id==17" :datas="item.datas" :readonly="true" ref="demandRef17"></banquetMarry>
@ -96,6 +101,7 @@
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import residents from "@/components/newArchives/residents.vue" // import residents from "@/components/newArchives/residents.vue" //
import breeding from "@/components/newArchives/breeding.vue" // import breeding from "@/components/newArchives/breeding.vue" //
import plant from "@/components/newArchives/plant.vue" //
import store from "@/components/newArchives/store.vue" // import store from "@/components/newArchives/store.vue" //
import deepProcessing from "@/components/newArchives/deepProcessing.vue" // import deepProcessing from "@/components/newArchives/deepProcessing.vue" //
import thickProcessing from "@/components/newArchives/thickProcessing.vue" // import thickProcessing from "@/components/newArchives/thickProcessing.vue" //
@ -109,9 +115,16 @@
import banquetOther from "@/components/newArchives/banquetOther.vue" // import banquetOther from "@/components/newArchives/banquetOther.vue" //
import banquetFuneral from "@/components/newArchives/banquetFuneral.vue" // import banquetFuneral from "@/components/newArchives/banquetFuneral.vue" //
export default { export default {
components: { districtSelector, residents, breeding, store, deepProcessing, thickProcessing, houseRepair, houseDecoration, houseRenovate,houseTransaction, banquetMarry, banquetBirthday,banquetFullMoon, banquetOther, banquetFuneral }, components: { districtSelector, residents, breeding, plant, store, deepProcessing, thickProcessing, houseRepair,
houseDecoration, houseRenovate, houseTransaction, banquetMarry, banquetBirthday, banquetFullMoon, banquetOther,
banquetFuneral },
data() { data() {
return { return {
tabLists: [{
name: '商机信息',
}, {
name: '基本信息'
}],
readonly: true, readonly: true,
current: 0, current: 0,
showDemandList: [], showDemandList: [],
@ -133,17 +146,20 @@
} }
}, },
onLoad(options) { onLoad(options) {
this.initInformationDetails({id:options.id}) this.initInformationDetails({ id: options.id })
}, },
onShow() {}, onShow() {},
methods: { methods: {
async initInformationDetails(id){ async initInformationDetails(id) {
let res = await informationDetails(id); let res = await informationDetails(id);
this.formData = res.data; this.formData = res.data;
}, },
toastShow(){ toastShow() {
Toast('不可修改') Toast('不可修改')
}, },
changeCurrent(e){
this.current = e.index;
}
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
@ -152,11 +168,11 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.top_box{ .top_box {
background-color: #fff; background-color: #fff;
display: flex; display: flex;
.item{ .item {
width: 175rpx; width: 175rpx;
height: 53rpx; height: 53rpx;
background: #F5F5F5FF; background: #F5F5F5FF;
@ -168,11 +184,13 @@
align-items: center; align-items: center;
margin: 28rpx; margin: 28rpx;
} }
.active{
.active {
background: $theme-oa-color; background: $theme-oa-color;
color: #fff; color: #fff;
} }
} }
.card { .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
@ -216,16 +234,27 @@
} }
.delete { .delete {
margin: 22rpx 0; margin: 22rpx 0;
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
width: 100%; width: 100%;
height: 64rpx; height: 64rpx;
line-height: 64rpx; line-height: 64rpx;
background: #f56c6c; background: #f56c6c;
border-radius: 14rpx; border-radius: 14rpx;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
} }
.plus { .plus {

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<view class="card" v-for="item in list" :key="item.id" @click="navTo('/subpkg/archives/archives?id='+item.id)"> <!-- <view class="card" v-for="item in list" :key="item.id" @click="navTo('/subpkg/archives/archives?id='+item.id)">
<view class="top"> <view class="top">
<u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'" <u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'"
width="112.28rpx" height="112.28rpx" shape="circle"> width="112.28rpx" height="112.28rpx" shape="circle">
@ -22,7 +22,52 @@
</view> </view>
</view> </view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
<view class="personnel_list">
<block v-for="(item, index) in list" :key="item.id">
<view class="personnel_item" @click="navTo('/subpkg/archives/archives?id='+item.id)">
<view class="type" :class="item.is_contract?'type_blue':''">
<image v-if="item.is_contract" src="../../static/icons/ok_w.png"></image>
<image v-else src="../../static/icons/err_w.png"></image>
</view>
<view class="top" style="margin-bottom: 28rpx;">
<view class="left">
<u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'"
width="112.28rpx" height="112.28rpx" shape="circle"></u--image>
</view>
<view class="right">
<view class="info_top">
<view class="info_name">{{item.nickname}}</view>
<text class="phone">电话:</text>
<text class="tel">{{item.phone||item.account}}</text>
</view>
<view class="info_bottom">
<text class="item phone">
分管片区:
</text>
<view class="item">
<view class="location">{{ item.city_name+item.area_name+item.street_name }}</view>
</view>
</view>
<view class="company">
<text>
所属公司:
</text>
<view class="itm" v-if="item.company">{{item.company.company_name}}</view>
</view>
</view>
</view>
<u-line color="#999999FF"></u-line>
<view class="bottom" style="margin-top: 28rpx;float: right;">
<view class="look">{{'管理户数: '+item.informationg_count+" 户"}}</view>
</view>
</view>
</block>
<u-empty v-if="loadConfig.status=='nomore'&& list.length==0" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</view> </view>
</template> </template>
@ -164,7 +209,8 @@
margin-right: 18rpx; margin-right: 18rpx;
-webkit-background-clip: text; -webkit-background-clip: text;
} }
.b_l_text{
.b_l_text {
width: 360rpx; width: 360rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -178,4 +224,197 @@
} }
} }
} }
.personnel_list {
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 130rpx;
.personnel_item {
width: 694rpx;
// height: 407rpx;
background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-bottom: 32rpx;
overflow: hidden;
position: relative;
padding: 28rpx;
.type {
width: 50rpx;
height: 50rpx;
background-color: #F02828;
border-radius: 50%;
font-size: 25rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 35rpx;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 28rpx;
right: 28rpx;
image {
width: 18rpx;
height: 18rpx;
margin-right: 1rpx;
}
}
.type_blue {
background-color: #34A853;
}
.top {
// background-color: #3274F9;
display: flex;
.right {
display: flex;
flex-direction: column;
justify-content: space-around;
margin-left: 28rpx;
font-size: 25rpx;
font-weight: 400;
overflow: hidden;
color: #999999;
.info_top {
display: flex;
align-items: flex-end;
font-size: 25rpx;
font-weight: 400;
color: $theme-oa-color;
margin-bottom: 10rpx;
.info_name {
font-size: 32rpx;
font-weight: 400;
color: #333333;
margin-right: 18rpx;
}
.phone {
margin-left: 30rpx;
color: #999999;
}
.tel {
color: #000;
}
}
.info_bottom {
display: flex;
margin-bottom: 8rpx;
.item {
display: flex;
align-items: center;
}
.phone {
margin-right: 28rpx;
}
.location {
width: 320rpx;
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 将超出文本隐藏 */
text-overflow: ellipsis;
/* 使用省略号表示被隐藏的文本 */
color: #000;
}
}
.company {
display: flex;
text {
margin-right: 30rpx;
}
.itm {
width: 320rpx;
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 将超出文本隐藏 */
text-overflow: ellipsis;
/* 使用省略号表示被隐藏的文本 */
color: #000;
}
}
}
}
.center {
padding: 28rpx 0;
.top {
font-size: 28rpx;
font-weight: 400;
color: #666666FF;
margin-bottom: 20rpx;
.green {
color: #34A853FF;
}
.yellow {
color: #F9AA32FF;
}
}
.bottom {
display: flex;
justify-content: space-around;
font-size: 25rpx;
font-weight: 400;
color: #999999;
image {
width: 18rpx;
height: 18rpx;
margin-right: 9rpx;
}
}
}
.bottom {
display: flex;
justify-content: center;
.look {
height: 43rpx;
background: #FFFFFF;
border-radius: 26rpx 26rpx 26rpx 26rpx;
opacity: 1;
// border: 2rpx solid $theme-oa-color;
font-size: 28rpx;
font-weight: 400;
margin-left: 28rpx;
color: $theme-oa-color;
display: flex;
justify-content: center;
align-items: center;
}
.sign {
color: #34A853;
// border: 2rpx solid #34A853;
}
.red {
color: #F02828;
// border: 2rpx solid #F02828;
}
}
}
}
</style> </style>

View File

@ -4,20 +4,6 @@
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40' <u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40'
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs> inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs>
</u-sticky> </u-sticky>
<!-- <view class="fixed_box">
<scroll-view :scroll-x="true" style="background-color: #fff;">
<view class="top_box">
<view class="item" :class="current==0?'active':''" @click="current=0">我的公司</view>
<view class="item" :class="current==1?'active':''" @click="current=1">签约公司</view>
<view class="item" :class="current==2?'active':''" @click="current=2">公司财务</view>
<view class="item" :class="current==3?'active':''" @click="current=3">任务情况</view>
</view>
</scroll-view>
<view class="top_box top_box2" v-if="current==1">
<view class="item" :class="currentChild==0?'active':''" @click="currentChild=0;initLoad()">已签约</view>
<view class="item" :class="currentChild==1?'active':''" @click="currentChild=1;initLoad()">未签约</view>
</view>
</view> -->
<view> <view>
<view class="company_info" v-show="current==0"> <view class="company_info" v-show="current==0">
<company></company> <company></company>

View File

@ -118,7 +118,6 @@
}); });
Toast('合同已生成'); Toast('合同已生成');
this.initCompany(); this.initCompany();
this.naviTo('/subpkg/submit/submit');
if (this.userInfo.contract.check_status == 3) { if (this.userInfo.contract.check_status == 3) {
this.timerCount = 60; this.timerCount = 60;
this.timer = setInterval(() => { this.timer = setInterval(() => {
@ -129,6 +128,7 @@
} }
}, 1000); }, 1000);
} }
this.naviTo('/subpkg/submit/submit');
}, },
// //
async getPostsms() { async getPostsms() {

View File

@ -36,7 +36,8 @@
</view> </view>
</view> </view>
</view> </view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> <u-empty v-if="loadConfig.status=='nomore'&& list.length==0" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
</template> </template>

View File

@ -26,7 +26,8 @@
</u-form-item> </u-form-item>
</view> </view>
<view class="item"> <view class="item">
<districtSelector ref="districtSelectorRef"></districtSelector> <view class="title">地区信息</view>
<!-- <districtSelector ref="districtSelectorRef"></districtSelector> -->
<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,11 +57,13 @@
</view> </view>
<residents ref="residentsRef"></residents> <residents ref="residentsRef"></residents>
<breeding ref="breedingRef"></breeding> <breeding ref="breedingRef"></breeding>
<plant ref="plantRef"></plant>
<!-- 更多内容 --> <!-- 更多内容 -->
<!-- <block v-for="(item, index) in showDemandList" :key="'demand'+index"> <!-- <block v-for="(item, index) in showDemandList" :key="'demand'+index">
<block> <block>
<breeding v-if="item.id==7" ref="demandRef7"></breeding> <breeding v-if="item.id==32" ref="demandRef32"></breeding>
<plant v-if="item.id==7" ref="demandRef7"></plant>
<store v-if="item.id==8" ref="demandRef8"></store> <store v-if="item.id==8" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" ref="demandRef9"></deepProcessing> <deepProcessing v-if="item.id==9" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" ref="demandRef10"></thickProcessing> <thickProcessing v-if="item.id==10" ref="demandRef10"></thickProcessing>
@ -97,7 +100,8 @@
import { categoryBusinessList } from "@/api/oaPbulic.js" import { categoryBusinessList } from "@/api/oaPbulic.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import residents from "@/components/newArchives/residents.vue" // import residents from "@/components/newArchives/residents.vue" //
import breeding from "@/components/newArchives/breeding.vue" // import breeding from "@/components/newArchives/breeding.vue" //
import plant from "@/components/newArchives/plant.vue" //
import store from "@/components/newArchives/store.vue" // import store from "@/components/newArchives/store.vue" //
import deepProcessing from "@/components/newArchives/deepProcessing.vue" // import deepProcessing from "@/components/newArchives/deepProcessing.vue" //
import thickProcessing from "@/components/newArchives/thickProcessing.vue" // import thickProcessing from "@/components/newArchives/thickProcessing.vue" //
@ -111,9 +115,24 @@
import banquetOther from "@/components/newArchives/banquetOther.vue" // import banquetOther from "@/components/newArchives/banquetOther.vue" //
import banquetFuneral from "@/components/newArchives/banquetFuneral.vue" // import banquetFuneral from "@/components/newArchives/banquetFuneral.vue" //
export default { export default {
components: { districtSelector, residents, breeding, store, deepProcessing, thickProcessing, houseRepair, components: {
houseDecoration, houseRenovate, houseTransaction, banquetMarry, banquetBirthday, banquetFullMoon, banquetOther, districtSelector,
banquetFuneral }, residents,
breeding,
plant,
store,
deepProcessing,
thickProcessing,
houseRepair,
houseDecoration,
houseRenovate,
houseTransaction,
banquetMarry,
banquetBirthday,
banquetFullMoon,
banquetOther,
banquetFuneral
},
data() { data() {
return { return {
demandShow: false, demandShow: false,
@ -206,46 +225,57 @@
methods: { methods: {
// //
async addArchives() { async addArchives() {
// Toast('') try{
let refsDatas = this.loadRefsDatas(); // Toast('')
let flag1 = await this.$refs.districtSelectorRef.validate(); let refsDatas = this.loadRefsDatas();
let flag2 = await this.$refs.residentsRef.validate(); // let flag1 = await this.$refs.districtSelectorRef.validate();
let flag3 = await this.$refs.breedingRef.validate(); let flag2 = await this.$refs.residentsRef.validate();
// return console.log(flag1); let flag3 = await this.$refs.breedingRef.validate();
this.$refs.archives.validate().then(async (e) => { let flag4 = await this.$refs.plantRef.validate();
if (e==true && flag1==true && flag2==true && flag3==true) { // return console.log(flag1);
uni.showLoading() this.$refs.archives.validate().then(async (e) => {
let districtForm = { if (e == true && flag4 == true && flag2 == true && flag3 == true) {
area_id: this.$refs.districtSelectorRef.formData.area, uni.showLoading()
street_id: this.$refs.districtSelectorRef.formData.street, // let districtForm = {
village_id: this.$refs.districtSelectorRef.formData.village, // area_id: this.$refs.districtSelectorRef.formData.area,
brigade_id: this.$refs.districtSelectorRef.formData.brigade, // street_id: this.$refs.districtSelectorRef.formData.street,
// village_id: this.$refs.districtSelectorRef.formData.village,
// brigade_id: this.$refs.districtSelectorRef.formData.brigade,
// }
let res = await informationAdd({
...this.formData,
// ...districtForm,
...this.$refs.residentsRef.residents,
datas: [{
card_id: 32,
datas: {
...this.$refs.breedingRef.formData
}
},
{
card_id: 7,
datas: {
...this.$refs.plantRef.formData
}
},
...refsDatas
]
});
uni.hideLoading()
uni.showToast({
icon: "none",
title: "添加成功",
success: () => {
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
} }
let res = await informationAdd({ })
...this.formData, }catch(e){
...districtForm, Toast('请填写完整信息')
...this.$refs.residentsRef.residents, }
datas: [{
card_id: 7,
datas: {
...this.$refs.breedingRef.formData
}
},
...refsDatas
]
});
uni.hideLoading()
uni.showToast({
icon: "none",
title: "添加成功",
success: () => {
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
}
})
}, },
// //
@ -263,22 +293,22 @@
return datas; return datas;
}, },
// //
async initCategoryBusinessList(){ async initCategoryBusinessList() {
let res = await categoryBusinessList(); let res = await categoryBusinessList();
this.demandList = res.data; this.demandList = res.data;
}, },
// //
changeHandler(e) { changeHandler(e) {
if (e.columnIndex == 0) { //, if (e.columnIndex == 0) { //,
this.demandListChild = this.demandList[e.indexs[0]].children||[]; this.demandListChild = this.demandList[e.indexs[0]].children || [];
} }
}, },
// //
changeDemand: throttle(function(e) { changeDemand: throttle(function(e) {
this.demandShow = false; this.demandShow = false;
if(e.value[1]){ if (e.value[1]) {
this.showDemandList.push(e.value[1]); this.showDemandList.push(e.value[1]);
}else { } else {
this.showDemandList.push(e.value[0]); this.showDemandList.push(e.value[0]);
} }
}, 3000), }, 3000),

View File

@ -48,10 +48,12 @@
</view> </view>
</view> </view>
</block> </block>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" <u-empty v-if="loadConfig.status=='nomore'&& userList.length==0" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
<button class="new_btn" @click.stop="navTo('/subpkg/newPersonnel/newPersonnel')">创建账号</button> <!-- <button class="new_btn" @click.stop="navTo('/subpkg/newPersonnel/newPersonnel')">创建账号</button> -->
<mybtn text="创建账号" @click="navTo('/subpkg/newPersonnel/newPersonnel')"></mybtn>
</view> </view>
</template> </template>
@ -156,8 +158,8 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: absolute; position: absolute;
top: 10rpx; top: 28rpx;
right: 10rpx; right: 28rpx;
image { image {
width: 18rpx; width: 18rpx;
@ -190,6 +192,7 @@
font-size: 25rpx; font-size: 25rpx;
font-weight: 400; font-weight: 400;
color: $theme-oa-color; color: $theme-oa-color;
margin-bottom: 10rpx;
.info_name { .info_name {
font-size: 32rpx; font-size: 32rpx;
@ -210,6 +213,7 @@
.info_bottom { .info_bottom {
display: flex; display: flex;
margin-bottom: 8rpx;
.item { .item {
display: flex; display: flex;
@ -221,7 +225,7 @@
} }
.location { .location {
width: 250rpx; width: 350rpx;
white-space: nowrap; white-space: nowrap;
/* 不换行 */ /* 不换行 */
overflow: hidden; overflow: hidden;
@ -240,6 +244,13 @@
} }
.itm { .itm {
width: 350rpx;
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 将超出文本隐藏 */
text-overflow: ellipsis;
/* 使用省略号表示被隐藏的文本 */
color: #000; color: #000;
} }
} }

View File

@ -277,6 +277,7 @@
} }
}, 1000); }, 1000);
} }
this.naviTo('/subpkg/submit/submit');
}, },
// //
async getPostsms(){ async getPostsms(){
@ -293,6 +294,7 @@
id: this.userInfo.id id: this.userInfo.id
}) })
Toast('短信已发送'); Toast('短信已发送');
this.naviTo('/subpkg/submit/submit');
} }
}, },
loadUserDetail() { loadUserDetail() {

View File

@ -2,7 +2,7 @@
<view class=""> <view class="">
<view class="card"> <view class="card">
<u--form labelPosition="left" :model="formData" ref="archives"> <u--form labelPosition="left" :model="formData" ref="archives">
<view class="item"> <!-- <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>
@ -24,11 +24,13 @@
<u-form-item labelWidth="auto" label="联系方式" required prop="phone" borderBottom> <u-form-item labelWidth="auto" label="联系方式" required prop="phone" borderBottom>
<u--input readonly v-model="formData.phone" placeholder="请输入手机号" type="number"></u--input> <u--input readonly v-model="formData.phone" placeholder="请输入手机号" type="number"></u--input>
</u-form-item> </u-form-item>
</view> </view> -->
<u-empty v-if="showDemandList.length==0" text="暂无数据,点击下方按钮添加" icon="/static/img/empty/data.png"></u-empty>
<block v-for="(item, index) in showDemandList" :key="'demand'+index"> <block v-for="(item, index) in showDemandList" :key="'demand'+index">
<block> <block>
<breeding v-if="item.id==7" ref="demandRef7"></breeding> <breeding v-if="item.id==32" ref="demandRef32"></breeding>
<plant v-if="item.id==7" ref="demandRef7"></plant>
<store v-if="item.id==8" ref="demandRef8"></store> <store v-if="item.id==8" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" ref="demandRef9"></deepProcessing> <deepProcessing v-if="item.id==9" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" ref="demandRef10"></thickProcessing> <thickProcessing v-if="item.id==10" ref="demandRef10"></thickProcessing>
@ -48,11 +50,12 @@
</block> </block>
<button class="delete" @click="removeShowDemand(index)">删除以上信息</button> <button class="delete" @click="removeShowDemand(index)">删除以上信息</button>
</block> </block>
<button class="plus demand" @click="demandShow=true">点击添加更多需求</button> <button class="plus demand" style="margin-bottom: 150rpx;" @click="demandShow=true">点击添加更多需求</button>
<u-picker :show="demandShow" ref="demandRef" :loading="demandLoading" :columns="[demandList, demandListChild]" <u-picker :show="demandShow" ref="demandRef" :loading="demandLoading" :columns="[demandList, demandListChild]"
keyName="name" @change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker> keyName="name" @change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker>
</u--form> </u--form>
<button @click="addArchives" class="btn">完成更新</button> <!-- <button @click="addArchives" class="btn">完成更新</button> -->
<mybtn text="完成更新" @click="addArchives"></mybtn>
</view> </view>
</view> </view>
</template> </template>
@ -65,6 +68,7 @@
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import residents from "@/components/newArchives/residents.vue" // import residents from "@/components/newArchives/residents.vue" //
import breeding from "@/components/newArchives/breeding.vue" // import breeding from "@/components/newArchives/breeding.vue" //
import plant from "@/components/newArchives/plant.vue" //
import store from "@/components/newArchives/store.vue" // import store from "@/components/newArchives/store.vue" //
import deepProcessing from "@/components/newArchives/deepProcessing.vue" // import deepProcessing from "@/components/newArchives/deepProcessing.vue" //
import thickProcessing from "@/components/newArchives/thickProcessing.vue" // import thickProcessing from "@/components/newArchives/thickProcessing.vue" //
@ -82,6 +86,7 @@
districtSelector, districtSelector,
residents, residents,
breeding, breeding,
plant,
store, store,
deepProcessing, deepProcessing,
thickProcessing, thickProcessing,
@ -131,6 +136,7 @@
}, },
// //
addArchives: throttle(async function() { addArchives: throttle(async function() {
if(this.showDemandList.length==0)return Toast('请先选择需求!');
let refsDatas = await this.loadRefsDatas(); let refsDatas = await this.loadRefsDatas();
if (!this.updateFlag) return; if (!this.updateFlag) return;
uni.showLoading({ uni.showLoading({
@ -145,9 +151,9 @@
icon: 'none', icon: 'none',
title: '更新成功', title: '更新成功',
success() { success() {
setTimeout(()=>{ setTimeout(() => {
uni.navigateBack() uni.navigateBack()
},1000) }, 1000)
} }
}) })
}, 1000), }, 1000),
@ -157,7 +163,7 @@
let datas = []; let datas = [];
let map = new Map(); // 使mapref let map = new Map(); // 使mapref
for (let demand of this.showDemandList) { for (let demand of this.showDemandList) {
if(map.get(demand.id)>=0) map.set(demand.id, map.get(demand.id)+1); if (map.get(demand.id) >= 0) map.set(demand.id, map.get(demand.id) + 1);
else map.set(demand.id, 0); else map.set(demand.id, 0);
let now = map.get(demand.id); let now = map.get(demand.id);
try { try {
@ -169,6 +175,7 @@
} catch (e) { } catch (e) {
console.log('err', e); console.log('err', e);
this.updateFlag = false; this.updateFlag = false;
Toast('请完整填写以上数据!')
} }
} }
return datas; return datas;
@ -177,8 +184,9 @@
async initCategoryBusinessList() { async initCategoryBusinessList() {
let res = await categoryBusinessList(); let res = await categoryBusinessList();
// this.demandList = res.data; // this.demandList = res.data;
this.demandList = res.data.filter(item=>item.id==6); this.demandList = res.data.filter(item => item.id == 6);
this.demandList[0].children = this.demandList[0].children.filter(item=>item.id==7||item.id==8); this.demandList[0].children = this.demandList[0].children.filter(item => item.id == 7 || item.id == 8 || item
.id == 32);
this.demandListChild = this.demandList[0].children; this.demandListChild = this.demandList[0].children;
// console.log(this.demandList); // console.log(this.demandList);
}, },
@ -215,7 +223,7 @@
<style lang="scss"> <style lang="scss">
.card { .card {
padding-top: 30rpx; // padding-top: 30rpx;
.item { .item {
background-color: #fff; background-color: #fff;

View File

@ -8,9 +8,8 @@ import { Toast } from '../libs/uniApi';
import store from '../store'; import store from '../store';
function toLogin() { function toLogin() {
store.commit("LOGOUT");
uni.showToast({ uni.showToast({
title: '请登录', title: '请登录',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
@ -21,7 +20,7 @@ function baseRequestTwo(url, method, data, {
noVerify = false noVerify = false
}) { }) {
let Url = HTTP_REQUEST_URL_THREE, let Url = HTTP_REQUEST_URL_THREE,
header = HEADER; header = HEADER;
if (!noAuth) { if (!noAuth) {
//登录过期自动登录 //登录过期自动登录