页面修改
This commit is contained in:
parent
edbef3cc41
commit
adf33ad8e4
1
App.vue
1
App.vue
@ -15,6 +15,7 @@
|
||||
console.log(res.messageID)
|
||||
audioContext.play()
|
||||
noticeArr.push(res.messageID)
|
||||
console.log("app的")
|
||||
uni.vibrateLong({
|
||||
success: function() {
|
||||
console.log('success');
|
||||
|
@ -28,7 +28,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="f_list">
|
||||
|
||||
<view class="item" v-for="(item, index) in list" :key="index">
|
||||
|
||||
<view class="top">
|
||||
账单日期: {{current?item.month:item.create_time}}
|
||||
</view>
|
||||
@ -38,26 +40,33 @@
|
||||
<view class="t_title">任务名称:</view>
|
||||
<view class="tips">{{item.remark}}</view>
|
||||
</view>
|
||||
<view class="t_item">
|
||||
<!-- <view class="t_item">
|
||||
<view class="t_title">金额归属:</view>
|
||||
<view class="tips"><text v-if="item.userInfo">{{item.userInfo.nickname}}</text></view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="t_item">
|
||||
<view class="t_title">收益来源:</view>
|
||||
<view class="tips">
|
||||
<!-- {{current?item.remark:item.type_desc}} -->
|
||||
<text v-if="item.change_type==202" style="color: #46be61;">{{item.type_desc}}</text>
|
||||
<text v-else-if="item.change_type==203"
|
||||
style="color: #ff7c32;">{{item.type_desc}}</text>
|
||||
<text v-if="item.change_type==202">{{item.type_desc}}</text>
|
||||
<!-- <text v-else-if="item.change_type==203"
|
||||
style="color: #ff7c32;">{{item.type_desc}}</text> -->
|
||||
<text v-else="item.change_type==203">{{item.type_desc}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="price">
|
||||
{{current?(item.expenditure==0?'+'+item.income:'-'+item.income):item.change_amount_desc}}
|
||||
<text v-if="current" style="color: #FF7C32;">
|
||||
{{item.expenditure==0?'+'+item.income:'-'+item.income}}</text>
|
||||
<text>{{item.change_amount_desc}}</text>
|
||||
<!-- {{current?(item.expenditure==0?'+'+item.income:'-'+item.income):item.change_amount_desc}} -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
||||
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
</view>
|
||||
@ -239,12 +248,12 @@
|
||||
|
||||
&:before {
|
||||
display: inline-block;
|
||||
content: '账单详情';
|
||||
content: '账户收益';
|
||||
width: 137rpx;
|
||||
height: 49rpx;
|
||||
line-height: 49rpx;
|
||||
text-align: center;
|
||||
background: #3274F9;
|
||||
background: #FF7C32;
|
||||
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
||||
color: #fff;
|
||||
margin-right: 28rpx;
|
||||
@ -258,7 +267,7 @@
|
||||
.text {
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
color: #333333;
|
||||
line-height: 39rpx;
|
||||
|
||||
.t_item {
|
||||
@ -282,7 +291,7 @@
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #F02828;
|
||||
color: #488F00;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,282 +1,294 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="title">地区信息</view>
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
|
||||
<u-form-item v-if="!readonly" label="省" :required="!readonly" prop="province" @click="changeCity('province')" borderBottom>
|
||||
<u--input :value="formDataText.province" disabled disabledColor="#fff" placeholder="请选择省"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="!readonly" label="市" :required="!readonly" prop="city" @click="changeCity('city')" borderBottom>
|
||||
<u--input :value="formDataText.city" disabled disabledColor="#fff" placeholder="请选择市"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="区县" :required="!readonly" prop="area" @click="changeCity('area')" borderBottom>
|
||||
<u--input :value="formDataText.area" disabled disabledColor="#fff" placeholder="请选择区县"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
|
||||
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom>
|
||||
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
|
||||
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm"
|
||||
@cancel="showProvince = false" @close="showProvince = false"></u-picker>
|
||||
</view>
|
||||
<view class="component">
|
||||
<view class="title">地区信息</view>
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
|
||||
<u-form-item v-if="!readonly" label="省" :required="!readonly" prop="province"
|
||||
@click="changeCity('province')" borderBottom>
|
||||
<u--input :value="formDataText.province" disabled disabledColor="#fff" placeholder="请选择省"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="!readonly" label="市" :required="!readonly" prop="city" @click="changeCity('city')"
|
||||
borderBottom>
|
||||
<u--input :value="formDataText.city" disabled disabledColor="#fff" placeholder="请选择市"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="区县" :required="!readonly" prop="area" @click="changeCity('area')" borderBottom>
|
||||
<u--input :value="formDataText.area" disabled disabledColor="#fff" placeholder="请选择区县"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
|
||||
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom>
|
||||
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff"
|
||||
placeholder="请选择村"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
|
||||
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm"
|
||||
@cancel="showProvince = false" @close="showProvince = false"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { commonProvince, commonCity, commonArea, commonStreet, commonVillage, commonBrigade } from "@/api/oaPbulic.js"
|
||||
import { Toast } from "../../libs/uniApi"
|
||||
export default {
|
||||
name:"districtSelector",
|
||||
props:{
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
datas:{
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showProvince: false,
|
||||
formData: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
formDataText: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
rules:{
|
||||
province: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
city: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
area: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
street: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
village: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
brigade: {
|
||||
validator: (rule, value, callback )=>{
|
||||
value?callback():callback('不能为空')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
},
|
||||
provinceList: [],
|
||||
cityList: [],
|
||||
areaList: [],
|
||||
streetList: [],
|
||||
villageList: [],
|
||||
brigadeList: [],
|
||||
changeType: '', //当前选择的城市类型
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
datas(newValue, oldValue){
|
||||
if(this.$props.readonly&&newValue){
|
||||
this.formDataText.area = this.$props.datas.area_name;
|
||||
this.formDataText.street = this.$props.datas.street_name;
|
||||
this.formDataText.village = this.$props.datas.village_name;
|
||||
this.formDataText.brigade = this.$props.datas.brigade_name;
|
||||
|
||||
this.formData.area = this.$props.datas.area_id;
|
||||
this.formData.street = this.$props.datas.street_id;
|
||||
this.formData.village = this.$props.datas.village_id;
|
||||
this.formData.brigade = this.$props.datas.brigade_id;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(!this.$props.readonly) {
|
||||
this.initProvinceAndCity();
|
||||
}else{
|
||||
this.rules = {};
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async validate(){
|
||||
return await this.$refs.districtForm.validate();
|
||||
},
|
||||
// 初始化
|
||||
async initProvinceAndCity() {
|
||||
let res = await commonProvince();
|
||||
this.provinceList = res.data;
|
||||
this.provinceList.forEach(item => {
|
||||
if (item.province_name.indexOf('四川') !== -1) {
|
||||
this.formData.province = item.province_code;
|
||||
this.formDataText.province = item.province_name;
|
||||
commonCity({
|
||||
city: item.province_code
|
||||
}).then(cityRes => {
|
||||
this.cityList = cityRes.data;
|
||||
this.cityList.forEach(item => {
|
||||
if (item.city_name.indexOf('泸州') !== -1) {
|
||||
this.formData.city = item.city_code;
|
||||
this.formDataText.city = item.city_name;
|
||||
commonArea({
|
||||
area: item.city_code
|
||||
}).then(areaRes => {
|
||||
this.areaList = areaRes.data;
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
// 选择城市
|
||||
changeCity(type) {
|
||||
if(this.$props.readonly)return ;
|
||||
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
|
||||
this.changeType = type;
|
||||
this.showProvince = true;
|
||||
},
|
||||
// 选择列表
|
||||
changeList() {
|
||||
return this[this.changeType + 'List'];
|
||||
},
|
||||
// 选中城市
|
||||
confirm(e) {
|
||||
let flag = false;//清空所选标记
|
||||
if(this.formData[this.changeType] != e.value[0][this.changeType + '_code'])flag = true;
|
||||
if (this.changeType == 'brigade') {
|
||||
this.formData.brigade = e.value[0].id;
|
||||
this.formDataText.brigade = e.value[0].brigade_name;
|
||||
this.showProvince = false;
|
||||
return ;
|
||||
}
|
||||
this.formData[this.changeType] = e.value[0][this.changeType + '_code'];
|
||||
this.formDataText[this.changeType] = e.value[0][this.changeType + '_name'];
|
||||
// 加载下一级城市信息
|
||||
switch (this.changeType) {
|
||||
case 'province':
|
||||
this.loadCity(this.formData['province']);
|
||||
break;
|
||||
case 'city':
|
||||
this.loadArea(this.formData['city']);
|
||||
break;
|
||||
case 'area':
|
||||
this.loadStreet(this.formData['area']);
|
||||
break;
|
||||
case 'street':
|
||||
this.loadVillage(this.formData['street']);
|
||||
break;
|
||||
case 'village':
|
||||
this.loadBrigade(this.formData['village']);
|
||||
break;
|
||||
}
|
||||
// 清空之前所选信息
|
||||
if(flag) switch (this.changeType) {
|
||||
case 'province':
|
||||
this.formData.city = '';
|
||||
this.formDataText.city = ''
|
||||
case 'city':
|
||||
this.formData.area = '';
|
||||
this.formDataText.area = ''
|
||||
case 'area':
|
||||
this.formData.street = '';
|
||||
this.formDataText.street = ''
|
||||
case 'street':
|
||||
this.formData.village = '';
|
||||
this.formDataText.village = ''
|
||||
case 'village':
|
||||
this.formData.brigade = '';
|
||||
this.formDataText.brigade = ''
|
||||
}
|
||||
this.showProvince = false;
|
||||
},
|
||||
loadCity(code) {
|
||||
commonCity({
|
||||
city: code
|
||||
}).then(res => {
|
||||
this.cityList = res.data;
|
||||
})
|
||||
},
|
||||
loadArea(code) {
|
||||
commonArea({
|
||||
area: code
|
||||
}).then(res => {
|
||||
this.areaList = res.data;
|
||||
})
|
||||
},
|
||||
loadStreet(code) {
|
||||
commonStreet({
|
||||
street: code
|
||||
}).then(res => {
|
||||
this.streetList = res.data;
|
||||
})
|
||||
},
|
||||
loadVillage(code) {
|
||||
commonVillage({
|
||||
village: code
|
||||
}).then(res => {
|
||||
this.villageList = res.data;
|
||||
})
|
||||
},
|
||||
loadBrigade(code) {
|
||||
commonBrigade({
|
||||
brigade: code
|
||||
}).then(res => {
|
||||
this.brigadeList = res.data;
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
import {
|
||||
commonProvince,
|
||||
commonCity,
|
||||
commonArea,
|
||||
commonStreet,
|
||||
commonVillage,
|
||||
commonBrigade
|
||||
} from "@/api/oaPbulic.js"
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi"
|
||||
export default {
|
||||
name: "districtSelector",
|
||||
props: {
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
datas: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showProvince: false,
|
||||
formData: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
formDataText: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
rules: {
|
||||
province: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
city: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
area: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
street: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
village: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
brigade: {
|
||||
validator: (rule, value, callback) => {
|
||||
value ? callback() : callback('不能为空')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
},
|
||||
provinceList: [],
|
||||
cityList: [],
|
||||
areaList: [],
|
||||
streetList: [],
|
||||
villageList: [],
|
||||
brigadeList: [],
|
||||
changeType: '', //当前选择的城市类型
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
datas(newValue, oldValue) {
|
||||
if (this.$props.readonly && newValue) {
|
||||
this.formDataText.area = this.$props.datas.area_name;
|
||||
this.formDataText.street = this.$props.datas.street_name;
|
||||
this.formDataText.village = this.$props.datas.village_name;
|
||||
this.formDataText.brigade = this.$props.datas.brigade_name;
|
||||
|
||||
this.formData.area = this.$props.datas.area_id;
|
||||
this.formData.street = this.$props.datas.street_id;
|
||||
this.formData.village = this.$props.datas.village_id;
|
||||
this.formData.brigade = this.$props.datas.brigade_id;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.$props.readonly) {
|
||||
this.initProvinceAndCity();
|
||||
} else {
|
||||
this.rules = {};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async validate() {
|
||||
return await this.$refs.districtForm.validate();
|
||||
},
|
||||
// 初始化
|
||||
async initProvinceAndCity() {
|
||||
let res = await commonProvince();
|
||||
this.provinceList = res.data;
|
||||
this.provinceList.forEach(item => {
|
||||
if (item.province_name.indexOf('四川') !== -1) {
|
||||
this.formData.province = item.province_code;
|
||||
this.formDataText.province = item.province_name;
|
||||
commonCity({
|
||||
city: item.province_code
|
||||
}).then(cityRes => {
|
||||
this.cityList = cityRes.data;
|
||||
this.cityList.forEach(item => {
|
||||
if (item.city_name.indexOf('泸州') !== -1) {
|
||||
this.formData.city = item.city_code;
|
||||
this.formDataText.city = item.city_name;
|
||||
commonArea({
|
||||
area: item.city_code
|
||||
}).then(areaRes => {
|
||||
this.areaList = areaRes.data;
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
// 选择城市
|
||||
changeCity(type) {
|
||||
if (this.$props.readonly) return;
|
||||
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
|
||||
this.changeType = type;
|
||||
this.showProvince = true;
|
||||
},
|
||||
// 选择列表
|
||||
changeList() {
|
||||
return this[this.changeType + 'List'];
|
||||
},
|
||||
// 选中城市
|
||||
confirm(e) {
|
||||
let flag = false; //清空所选标记
|
||||
if (this.formData[this.changeType] != e.value[0][this.changeType + '_code']) flag = true;
|
||||
if (this.changeType == 'brigade') {
|
||||
this.formData.brigade = e.value[0].id;
|
||||
this.formDataText.brigade = e.value[0].brigade_name;
|
||||
this.showProvince = false;
|
||||
return;
|
||||
}
|
||||
this.formData[this.changeType] = e.value[0][this.changeType + '_code'];
|
||||
this.formDataText[this.changeType] = e.value[0][this.changeType + '_name'];
|
||||
// 加载下一级城市信息
|
||||
switch (this.changeType) {
|
||||
case 'province':
|
||||
this.loadCity(this.formData['province']);
|
||||
break;
|
||||
case 'city':
|
||||
this.loadArea(this.formData['city']);
|
||||
break;
|
||||
case 'area':
|
||||
this.loadStreet(this.formData['area']);
|
||||
break;
|
||||
case 'street':
|
||||
this.loadVillage(this.formData['street']);
|
||||
break;
|
||||
case 'village':
|
||||
this.loadBrigade(this.formData['village']);
|
||||
break;
|
||||
}
|
||||
// 清空之前所选信息
|
||||
if (flag) switch (this.changeType) {
|
||||
case 'province':
|
||||
this.formData.city = '';
|
||||
this.formDataText.city = ''
|
||||
case 'city':
|
||||
this.formData.area = '';
|
||||
this.formDataText.area = ''
|
||||
case 'area':
|
||||
this.formData.street = '';
|
||||
this.formDataText.street = ''
|
||||
case 'street':
|
||||
this.formData.village = '';
|
||||
this.formDataText.village = ''
|
||||
case 'village':
|
||||
this.formData.brigade = '';
|
||||
this.formDataText.brigade = ''
|
||||
}
|
||||
this.showProvince = false;
|
||||
},
|
||||
loadCity(code) {
|
||||
commonCity({
|
||||
city: code
|
||||
}).then(res => {
|
||||
this.cityList = res.data;
|
||||
})
|
||||
},
|
||||
loadArea(code) {
|
||||
commonArea({
|
||||
area: code
|
||||
}).then(res => {
|
||||
this.areaList = res.data;
|
||||
})
|
||||
},
|
||||
loadStreet(code) {
|
||||
commonStreet({
|
||||
street: code
|
||||
}).then(res => {
|
||||
this.streetList = res.data;
|
||||
})
|
||||
},
|
||||
loadVillage(code) {
|
||||
commonVillage({
|
||||
village: code
|
||||
}).then(res => {
|
||||
this.villageList = res.data;
|
||||
})
|
||||
},
|
||||
loadBrigade(code) {
|
||||
commonBrigade({
|
||||
brigade: code
|
||||
}).then(res => {
|
||||
this.brigadeList = res.data;
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.component{
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
|
||||
&::before {
|
||||
width: 8rpx;
|
||||
height: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #3175f9;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.component {
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
|
||||
&::before {
|
||||
width: 8rpx;
|
||||
height: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #3175f9;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,250 +1,264 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="title">地区信息</view>
|
||||
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
|
||||
<u-form-item label="地址" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
|
||||
<u--textarea :value="nowAddress" autoHeight readonly></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="!formDataRead.street" label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
|
||||
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="!formDataRead.village" label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom>
|
||||
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
|
||||
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm"
|
||||
@cancel="showProvince = false" @close="showProvince = false"></u-picker>
|
||||
</view>
|
||||
<view class="component">
|
||||
<!-- <view class="title">地区信息</view> -->
|
||||
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
|
||||
<u-form-item label="地址" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
|
||||
<u--textarea :value="nowAddress" autoHeight readonly></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="!formDataRead.street" label="乡镇" :required="!readonly" prop="street"
|
||||
@click="changeCity('street')" borderBottom>
|
||||
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="!formDataRead.village" label="村社" :required="!readonly" prop="village"
|
||||
@click="changeCity('village')" borderBottom>
|
||||
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff"
|
||||
placeholder="请选择村"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
|
||||
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm"
|
||||
@cancel="showProvince = false" @close="showProvince = false"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { commonProvince, commonCity, commonArea, commonStreet, commonVillage, commonBrigade } from "@/api/oaPbulic.js"
|
||||
import { Toast } from "../../libs/uniApi"
|
||||
export default {
|
||||
name: "districtSelector",
|
||||
props: {
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
datas: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showProvince: false,
|
||||
formData: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
formDataText: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
formDataRead: {
|
||||
province: false,
|
||||
city: false,
|
||||
area: false,
|
||||
street: false,
|
||||
village: false,
|
||||
brigade: false,
|
||||
},
|
||||
rules: {
|
||||
street: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
village: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
brigade: {
|
||||
validator: (rule, value, callback) => {
|
||||
value ? callback() : callback('不能为空')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
},
|
||||
streetList: [],
|
||||
villageList: [],
|
||||
brigadeList: [],
|
||||
changeType: '', //当前选择的城市类型
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
datas(newValue, oldValue) {
|
||||
if (this.$props.readonly && newValue) {
|
||||
this.formDataText.street = this.$props.datas.street_name;
|
||||
this.formDataText.village = this.$props.datas.village_name;
|
||||
this.formDataText.brigade = this.$props.datas.brigade_name;
|
||||
import {
|
||||
commonProvince,
|
||||
commonCity,
|
||||
commonArea,
|
||||
commonStreet,
|
||||
commonVillage,
|
||||
commonBrigade
|
||||
} from "@/api/oaPbulic.js"
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi"
|
||||
export default {
|
||||
name: "districtSelector",
|
||||
props: {
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
datas: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showProvince: false,
|
||||
formData: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
formDataText: {
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
},
|
||||
formDataRead: {
|
||||
province: false,
|
||||
city: false,
|
||||
area: false,
|
||||
street: false,
|
||||
village: false,
|
||||
brigade: false,
|
||||
},
|
||||
rules: {
|
||||
street: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
village: {
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
brigade: {
|
||||
validator: (rule, value, callback) => {
|
||||
value ? callback() : callback('不能为空')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
},
|
||||
streetList: [],
|
||||
villageList: [],
|
||||
brigadeList: [],
|
||||
changeType: '', //当前选择的城市类型
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
datas(newValue, oldValue) {
|
||||
if (this.$props.readonly && newValue) {
|
||||
this.formDataText.street = this.$props.datas.street_name;
|
||||
this.formDataText.village = this.$props.datas.village_name;
|
||||
this.formDataText.brigade = this.$props.datas.brigade_name;
|
||||
|
||||
this.formData.street = this.$props.datas.street_id;
|
||||
this.formData.village = this.$props.datas.village_id;
|
||||
this.formData.brigade = this.$props.datas.brigade_id;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.$props.readonly) {
|
||||
this.initProvinceAndCity();
|
||||
} else {
|
||||
this.rules = {};
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
nowAddress(){
|
||||
let address = this.$store.state.app.userInfo;
|
||||
let str = '';
|
||||
address.province_name?str+=address.province_name:null;
|
||||
address.city_name?str+=address.city_name:null;
|
||||
address.area_name?str+=address.area_name:null;
|
||||
address.street_name?str+=address.street_name:null;
|
||||
address.village_name?str+=address.village_name:null;
|
||||
return str;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async validate() {
|
||||
return await this.$refs.districtForm.validate();
|
||||
},
|
||||
// 初始化
|
||||
async initProvinceAndCity() {
|
||||
let user = this.$store.state.app.userInfo;
|
||||
Object.keys(this.formData).forEach(key => {
|
||||
this.formData[key] = user[key];
|
||||
this.formDataText[key] = user[key + '_name'];
|
||||
if (user[key]&&key!='brigade') {
|
||||
this.formDataRead[key] = true;
|
||||
// 获取选择的列表
|
||||
switch (key) {
|
||||
case 'street':
|
||||
this.loadVillage(this.formData['street']);
|
||||
break;
|
||||
case 'village':
|
||||
this.loadBrigade(this.formData['village']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择城市
|
||||
changeCity(type) {
|
||||
if (this.$props.readonly) return;
|
||||
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
|
||||
this.changeType = type;
|
||||
this.showProvince = true;
|
||||
},
|
||||
// 选择列表
|
||||
changeList() {
|
||||
return this[this.changeType + 'List'];
|
||||
},
|
||||
// 选中城市
|
||||
confirm(e) {
|
||||
let flag = false; //清空所选标记
|
||||
if (this.formData[this.changeType] != e.value[0][this.changeType + '_code']) flag = true;
|
||||
if (this.changeType == 'brigade') {
|
||||
this.formData.brigade = e.value[0].id;
|
||||
this.formDataText.brigade = e.value[0].brigade_name;
|
||||
this.showProvince = false;
|
||||
return;
|
||||
}
|
||||
this.formData[this.changeType] = e.value[0][this.changeType + '_code'];
|
||||
this.formDataText[this.changeType] = e.value[0][this.changeType + '_name'];
|
||||
// 加载下一级城市信息
|
||||
switch (this.changeType) {
|
||||
case 'area':
|
||||
this.loadStreet(this.formData['area']);
|
||||
break;
|
||||
case 'street':
|
||||
this.loadVillage(this.formData['street']);
|
||||
break;
|
||||
case 'village':
|
||||
this.loadBrigade(this.formData['village']);
|
||||
break;
|
||||
}
|
||||
// 清空之前所选信息
|
||||
if (flag) switch (this.changeType) {
|
||||
case 'area':
|
||||
this.formData.street = '';
|
||||
this.formDataText.street = ''
|
||||
case 'street':
|
||||
this.formData.village = '';
|
||||
this.formDataText.village = ''
|
||||
case 'village':
|
||||
this.formData.brigade = '';
|
||||
this.formDataText.brigade = ''
|
||||
}
|
||||
this.showProvince = false;
|
||||
},
|
||||
loadStreet(code) {
|
||||
commonStreet({
|
||||
street: code
|
||||
}).then(res => {
|
||||
this.streetList = res.data;
|
||||
})
|
||||
},
|
||||
loadVillage(code) {
|
||||
commonVillage({
|
||||
village: code
|
||||
}).then(res => {
|
||||
this.villageList = res.data;
|
||||
})
|
||||
},
|
||||
loadBrigade(code) {
|
||||
commonBrigade({
|
||||
brigade: code
|
||||
}).then(res => {
|
||||
this.brigadeList = res.data;
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
this.formData.street = this.$props.datas.street_id;
|
||||
this.formData.village = this.$props.datas.village_id;
|
||||
this.formData.brigade = this.$props.datas.brigade_id;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.$props.readonly) {
|
||||
this.initProvinceAndCity();
|
||||
} else {
|
||||
this.rules = {};
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
nowAddress() {
|
||||
let address = this.$store.state.app.userInfo;
|
||||
let str = '';
|
||||
address.province_name ? str += address.province_name : null;
|
||||
address.city_name ? str += address.city_name : null;
|
||||
address.area_name ? str += address.area_name : null;
|
||||
address.street_name ? str += address.street_name : null;
|
||||
address.village_name ? str += address.village_name : null;
|
||||
return str;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async validate() {
|
||||
return await this.$refs.districtForm.validate();
|
||||
},
|
||||
// 初始化
|
||||
async initProvinceAndCity() {
|
||||
let user = this.$store.state.app.userInfo;
|
||||
Object.keys(this.formData).forEach(key => {
|
||||
this.formData[key] = user[key];
|
||||
this.formDataText[key] = user[key + '_name'];
|
||||
if (user[key] && key != 'brigade') {
|
||||
this.formDataRead[key] = true;
|
||||
// 获取选择的列表
|
||||
switch (key) {
|
||||
case 'street':
|
||||
this.loadVillage(this.formData['street']);
|
||||
break;
|
||||
case 'village':
|
||||
this.loadBrigade(this.formData['village']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择城市
|
||||
changeCity(type) {
|
||||
if (this.$props.readonly) return;
|
||||
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
|
||||
this.changeType = type;
|
||||
this.showProvince = true;
|
||||
},
|
||||
// 选择列表
|
||||
changeList() {
|
||||
return this[this.changeType + 'List'];
|
||||
},
|
||||
// 选中城市
|
||||
confirm(e) {
|
||||
let flag = false; //清空所选标记
|
||||
if (this.formData[this.changeType] != e.value[0][this.changeType + '_code']) flag = true;
|
||||
if (this.changeType == 'brigade') {
|
||||
this.formData.brigade = e.value[0].id;
|
||||
this.formDataText.brigade = e.value[0].brigade_name;
|
||||
this.showProvince = false;
|
||||
return;
|
||||
}
|
||||
this.formData[this.changeType] = e.value[0][this.changeType + '_code'];
|
||||
this.formDataText[this.changeType] = e.value[0][this.changeType + '_name'];
|
||||
// 加载下一级城市信息
|
||||
switch (this.changeType) {
|
||||
case 'area':
|
||||
this.loadStreet(this.formData['area']);
|
||||
break;
|
||||
case 'street':
|
||||
this.loadVillage(this.formData['street']);
|
||||
break;
|
||||
case 'village':
|
||||
this.loadBrigade(this.formData['village']);
|
||||
break;
|
||||
}
|
||||
// 清空之前所选信息
|
||||
if (flag) switch (this.changeType) {
|
||||
case 'area':
|
||||
this.formData.street = '';
|
||||
this.formDataText.street = ''
|
||||
case 'street':
|
||||
this.formData.village = '';
|
||||
this.formDataText.village = ''
|
||||
case 'village':
|
||||
this.formData.brigade = '';
|
||||
this.formDataText.brigade = ''
|
||||
}
|
||||
this.showProvince = false;
|
||||
},
|
||||
loadStreet(code) {
|
||||
commonStreet({
|
||||
street: code
|
||||
}).then(res => {
|
||||
this.streetList = res.data;
|
||||
})
|
||||
},
|
||||
loadVillage(code) {
|
||||
commonVillage({
|
||||
village: code
|
||||
}).then(res => {
|
||||
this.villageList = res.data;
|
||||
})
|
||||
},
|
||||
loadBrigade(code) {
|
||||
commonBrigade({
|
||||
brigade: code
|
||||
}).then(res => {
|
||||
this.brigadeList = res.data;
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.component {
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
.component {
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
|
||||
&::before {
|
||||
width: 8rpx;
|
||||
height: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #3175f9;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
// .checkbox{
|
||||
// margin: 28rpx;
|
||||
// }
|
||||
.box{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
.u-checkbox-group--row[data-v-2ef8bac9]{
|
||||
flex: 1;
|
||||
}
|
||||
&::before {
|
||||
width: 8rpx;
|
||||
height: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #3175f9;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// .checkbox{
|
||||
// margin: 28rpx;
|
||||
// }
|
||||
.box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
.u-checkbox-group--row[data-v-2ef8bac9] {
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
@ -1,147 +1,128 @@
|
||||
<template>
|
||||
<view>
|
||||
<globalPopup ref="globalPopup"></globalPopup>
|
||||
<u-sticky bgColor="#0122C7" style="width: 100vw">
|
||||
<u-tabs
|
||||
:list="tabLists"
|
||||
@change="sectionChange"
|
||||
lineColor="#fff"
|
||||
:scrollable="false"
|
||||
lineWidth="40"
|
||||
inactiveStyle="color:#fff"
|
||||
activeStyle="color:#fff"
|
||||
></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="content">
|
||||
<u-search
|
||||
placeholder="搜索你的订单"
|
||||
@search="getOrderList"
|
||||
:show-action="false"
|
||||
bg-color="white"
|
||||
v-model="keywords"
|
||||
></u-search>
|
||||
<view v-if="!orderlist.length">
|
||||
<u-empty mode="data" icon="../../static/img/empty/data.png"> </u-empty>
|
||||
</view>
|
||||
<view v-else>
|
||||
<logistiCard
|
||||
ref="logistiCards"
|
||||
v-for="(item, index) in orderlist"
|
||||
@getlist="getOrderList"
|
||||
@showTost="showToast"
|
||||
@showToast2="showToast2"
|
||||
:goodsInfo="item"
|
||||
:key="index"
|
||||
>
|
||||
</logistiCard>
|
||||
</view>
|
||||
<!-- -->
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<globalPopup ref="globalPopup"></globalPopup>
|
||||
<u-sticky bgColor="#0122C7" style="width: 100vw">
|
||||
<u-tabs :list="tabLists" @change="sectionChange" lineColor="#fff" :scrollable="false" lineWidth="40"
|
||||
inactiveStyle="color:#fff" activeStyle="color:#fff"></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="content">
|
||||
<u-search placeholder="搜索你的订单" @search="getOrderList" :show-action="false" bg-color="white"
|
||||
v-model="keywords"></u-search>
|
||||
<view v-if="!orderlist.length">
|
||||
<u-empty mode="data" icon="../../static/img/empty/data.png"> </u-empty>
|
||||
</view>
|
||||
<view v-else>
|
||||
<logistiCard ref="logistiCards" v-for="(item, index) in orderlist" @getlist="getOrderList"
|
||||
@showTost="showToast" @showToast2="showToast2" :goodsInfo="item" :key="index">
|
||||
</logistiCard>
|
||||
</view>
|
||||
<!-- -->
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getList
|
||||
} from "@/api/logistics.js"
|
||||
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue"
|
||||
import {
|
||||
informationAdd
|
||||
} from "@/api/logistics.js"
|
||||
import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue"
|
||||
//#ifdef APP-PLUS
|
||||
var jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
logistiCard,
|
||||
globalPopup
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
notArr: [],
|
||||
keywords: "",
|
||||
tabLists: [{
|
||||
name: '待配送',
|
||||
}, {
|
||||
name: '待送达'
|
||||
}, {
|
||||
name: '已送达'
|
||||
}],
|
||||
curNow: 0,
|
||||
orderlist: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
go () {
|
||||
uni.navigateTo({
|
||||
url: "/pages/logistics/te"
|
||||
})
|
||||
},
|
||||
sectionChange (index) {
|
||||
import {
|
||||
getList
|
||||
} from "@/api/logistics.js"
|
||||
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue"
|
||||
import {
|
||||
informationAdd
|
||||
} from "@/api/logistics.js"
|
||||
import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue"
|
||||
//#ifdef APP-PLUS
|
||||
var jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
logistiCard,
|
||||
globalPopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
notArr: [],
|
||||
keywords: "",
|
||||
tabLists: [{
|
||||
name: '待配送',
|
||||
}, {
|
||||
name: '待送达'
|
||||
}, {
|
||||
name: '已送达'
|
||||
}],
|
||||
curNow: 0,
|
||||
orderlist: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
go() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/logistics/te"
|
||||
})
|
||||
},
|
||||
sectionChange(index) {
|
||||
|
||||
this.curNow = index.index;
|
||||
this.getOrderList()
|
||||
},
|
||||
this.curNow = index.index;
|
||||
this.getOrderList()
|
||||
},
|
||||
|
||||
showToast () {
|
||||
// 6
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
title: '成功主题(带图标)',
|
||||
message: "操作成功",
|
||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
||||
})
|
||||
},
|
||||
showToast2 () {
|
||||
// 6
|
||||
showToast() {
|
||||
// 6
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
title: '成功主题(带图标)',
|
||||
message: "操作成功",
|
||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
||||
})
|
||||
},
|
||||
showToast2() {
|
||||
// 6
|
||||
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: "取件码不能为空",
|
||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
|
||||
},)
|
||||
},
|
||||
getOrderList () {
|
||||
console.log("列表更新")
|
||||
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
||||
getList({
|
||||
status: this.curNow,
|
||||
courier_id: id,
|
||||
keywords: this.keywords
|
||||
}).then(res => {
|
||||
this.orderlist = []
|
||||
this.orderlist = res.data.data
|
||||
})
|
||||
}
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: "取件码不能为空",
|
||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
|
||||
}, )
|
||||
},
|
||||
getOrderList() {
|
||||
console.log("列表更新")
|
||||
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
||||
getList({
|
||||
status: this.curNow,
|
||||
courier_id: id,
|
||||
keywords: this.keywords
|
||||
}).then(res => {
|
||||
this.orderlist = []
|
||||
this.orderlist = res.data.data
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
onLoad () {
|
||||
let that = this
|
||||
//#ifdef APP-PLUS
|
||||
jpushModule.addNotificationListener(function (result) {
|
||||
if (!that.notArr.includes(result.messageID)) {
|
||||
that.$refs.globalPopup.showPopu();
|
||||
that.getOrderList()
|
||||
},
|
||||
onLoad() {
|
||||
let that = this
|
||||
//#ifdef APP-PLUS
|
||||
jpushModule.addNotificationListener(function(result) {
|
||||
if (!that.notArr.includes(result.messageID)) {
|
||||
that.$refs.globalPopup.showPopu();
|
||||
that.getOrderList()
|
||||
|
||||
}
|
||||
that.notArr.push(result.messageID)
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
onShow () {
|
||||
this.getOrderList()
|
||||
}
|
||||
that.notArr.push(result.messageID)
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
onShow() {
|
||||
this.getOrderList()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.content {
|
||||
margin-top: 2vh;
|
||||
background-color: #f5f5f5;
|
||||
padding: 0vh 2vw;
|
||||
}
|
||||
.content {
|
||||
margin-top: 2vh;
|
||||
background-color: #f5f5f5;
|
||||
padding: 0vh 2vw;
|
||||
}
|
||||
</style>
|
@ -238,21 +238,19 @@
|
||||
});
|
||||
},
|
||||
onLoad() {
|
||||
// //#ifdef APP-PLUS
|
||||
// const audioContext = uni.createInnerAudioContext();
|
||||
// audioContext.volume = 1;
|
||||
// audioContext.src = "../../static/mp3/order.mp3";
|
||||
// let that = this;
|
||||
// jpushModule.addNotificationListener(function (result) {
|
||||
// if (!that.notArr.includes(result.messageID)) {
|
||||
// that.$refs.globalPopup.showPopu();
|
||||
// that.getOrderList();
|
||||
// console.log("idnex的");
|
||||
// audioContext.play();
|
||||
// }
|
||||
// that.notArr.push(result.messageID);
|
||||
// });
|
||||
// // #endif
|
||||
//#ifdef APP-PLUS
|
||||
|
||||
let that = this;
|
||||
jpushModule.addNotificationListener(function(result) {
|
||||
if (!that.notArr.includes(result.messageID)) {
|
||||
that.$refs.globalPopup.showPopu();
|
||||
that.getOrderList();
|
||||
console.log("idnex的");
|
||||
}
|
||||
that.notArr.push(result.messageID);
|
||||
});
|
||||
// #endif
|
||||
|
||||
},
|
||||
onShow() {
|
||||
// this.getUserIndex()
|
||||
|
@ -1,309 +1,558 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="card">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm">
|
||||
<view class="title">基本信息</view>
|
||||
<u-form-item label="电话" required prop="account" borderBottom>
|
||||
<u--input v-model="formData.account" placeholder="请输入手机号" type="number"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="姓名" required prop="nickname" borderBottom>
|
||||
<u--input v-model="formData.nickname" placeholder="请输入姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="性别" required prop="sex" borderBottom>
|
||||
<u-radio-group v-model="formData.sex" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'男'},{value:2,label:'女'}]" :key="index" :label="item.label"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="头像" required prop="avatar" borderBottom>
|
||||
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]" @afterRead="afterReadAvatar"
|
||||
@delete="formData.avatar=''" name="avatar" :maxCount="1" width="150rpx" height="150rpx"
|
||||
style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
|
||||
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
|
||||
</u-form-item>
|
||||
<view class="title">身份信息</view>
|
||||
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
|
||||
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item labelWidth="auto" label="登录密码" prop="formData.name" borderBottom>
|
||||
<view class="">
|
||||
<view class="card">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm">
|
||||
<view class="cards">
|
||||
<view class="avter">
|
||||
<view class="">
|
||||
用户头像:
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="" v-if="formData.avatar">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.avatar" alt="" style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
上传头像
|
||||
<view class="up" style="opacity: 0;">
|
||||
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]"
|
||||
@afterRead="afterReadAvatar" @delete="formData.avatar=''" :maxCount="1">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cards">
|
||||
|
||||
<u-form-item label="电话" required prop="account" borderBottom>
|
||||
<u--input v-model="formData.account" placeholder="请输入手机号" type="number"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="姓名" required prop="nickname" borderBottom>
|
||||
<u--input v-model="formData.nickname" placeholder="请输入姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="性别" required prop="sex" borderBottom>
|
||||
<u-radio-group v-model="formData.sex" style="margin: 16rpx;">
|
||||
<u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'男'},{value:2,label:'女'}]" :key="index"
|
||||
:label="item.label" :name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
|
||||
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
|
||||
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;">
|
||||
<u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index"
|
||||
:label="item.label" :name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow>
|
||||
</view>
|
||||
<view class="cards">
|
||||
<view style="margin-bottom:30rpx ;">
|
||||
身份证照:
|
||||
</view>
|
||||
<view class="up_list">
|
||||
<view class="" v-if="formData.qualification.id_card">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.qualification.id_card" alt="" style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
身份证正面
|
||||
<view class="up" style="opacity: 0;">
|
||||
<u-upload
|
||||
:fileList="formData.qualification.id_card?[{url:formData.qualification.id_card}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.id_card=''" name="id_card"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
<!--
|
||||
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]"
|
||||
@afterRead="afterReadAvatar" @delete="formData.avatar=''" :maxCount="1">
|
||||
</u-upload> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="formData.qualification.id_card_b">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.qualification.id_card_b" alt=""
|
||||
style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
身份证反面
|
||||
<view class="up" style="opacity: 0;">
|
||||
|
||||
<u-upload
|
||||
:fileList="formData.qualification.id_card_b?[{url:formData.qualification.id_card_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.id_card_b=''"
|
||||
name="id_card_b" :maxCount="1" width="638rpx" height="300rpx"
|
||||
style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="cards">
|
||||
<view style="margin-bottom:30rpx ;">
|
||||
银行卡照:
|
||||
</view>
|
||||
<view class="up_list">
|
||||
<view class="" v-if="formData.qualification.bank_account">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.qualification.bank_account" alt=""
|
||||
style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
银行卡正面
|
||||
<view class="up" style="opacity: 0;">
|
||||
|
||||
<u-upload
|
||||
:fileList="formData.qualification.bank_account?[{url:formData.qualification.bank_account}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.bank_account=''"
|
||||
name="bank_account" :maxCount="1" width="638rpx" height="300rpx"
|
||||
style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="formData.qualification.bank_account_b">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.qualification.bank_account_b" alt=""
|
||||
style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
银行卡反面
|
||||
<view class="up" style="opacity: 0;">
|
||||
<u-upload
|
||||
:fileList="formData.qualification.bank_account_b?[{url:formData.qualification.bank_account_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.bank_account_b=''"
|
||||
name="bank_account_b" :maxCount="1" width="638rpx" height="300rpx"
|
||||
style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class="cards">
|
||||
<view style="margin-bottom:30rpx ;">
|
||||
驾驶证照:
|
||||
</view>
|
||||
<view class="up_list">
|
||||
<view class="" v-if="formData.qualification.car_card">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.qualification.car_card" alt="" style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
驾驶证一页
|
||||
<view class="up" style="opacity: 0;">
|
||||
<u-upload
|
||||
:fileList="formData.qualification.car_card?[{url:formData.qualification.car_card}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.car_card=''" name="car_card"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="formData.qualification.car_card_b">
|
||||
<!-- {{formData.avatar}} -->
|
||||
<image :src="formData.qualification.car_card_b" alt=""
|
||||
style="width:243.57rpx;height:150rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="uplode" v-else>
|
||||
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
|
||||
驾驶证二页
|
||||
<view class="up" style="opacity: 0;">
|
||||
<u-upload
|
||||
:fileList="formData.qualification.car_card_b?[{url:formData.qualification.car_card_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.car_card_b=''"
|
||||
name="car_card_b" :maxCount="1" width="638rpx" height="300rpx"
|
||||
style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <view class="title">基本信息</view>
|
||||
<u-form-item label="电话" required prop="account" borderBottom>
|
||||
<u--input v-model="formData.account" placeholder="请输入手机号" type="number"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="姓名" required prop="nickname" borderBottom>
|
||||
<u--input v-model="formData.nickname" placeholder="请输入姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="性别" required prop="sex" borderBottom>
|
||||
<u-radio-group v-model="formData.sex" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'男'},{value:2,label:'女'}]" :key="index"
|
||||
:label="item.label" :name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="头像" required prop="avatar" borderBottom>
|
||||
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]" @afterRead="afterReadAvatar"
|
||||
@delete="formData.avatar=''" name="avatar" :maxCount="1" width="150rpx" height="150rpx"
|
||||
style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
|
||||
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
|
||||
</u-form-item>
|
||||
<view class="title">身份信息</view>
|
||||
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
|
||||
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index"
|
||||
:label="item.label" :name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item labelWidth="auto" label="登录密码" prop="formData.name" borderBottom>
|
||||
<u--input v-model="formData.password" placeholder="不输入密码则默认为手机号" password></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="确认密码" prop="formData.name" borderBottom>
|
||||
<u--input v-model="formData.password_confirm" placeholder="不输入密码则默认为手机号" password></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <view class="title">地区信息</view> -->
|
||||
<!-- <districtSelector style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelector> -->
|
||||
<districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow>
|
||||
<view class="title">资质信息</view>
|
||||
<u-form-item label="身份证正面" required labelPosition="top" labelWidth="200rpx" prop="qualification.id_card"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.id_card?[{url:formData.qualification.id_card}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.id_card=''" name="id_card" :maxCount="1"
|
||||
width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证反面" required labelPosition="top" labelWidth="200rpx" prop="qualification.id_card_b"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.id_card_b?[{url:formData.qualification.id_card_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.id_card_b=''" name="id_card_b" :maxCount="1"
|
||||
width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="银行卡正面" required labelPosition="top" labelWidth="200rpx" prop="qualification.bank_account"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.bank_account?[{url:formData.qualification.bank_account}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.bank_account=''" name="bank_account" :maxCount="1"
|
||||
width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="银行卡反面" required labelPosition="top" labelWidth="200rpx" prop="qualification.bank_account_b"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.bank_account_b?[{url:formData.qualification.bank_account_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.bank_account_b=''" name="bank_account_b"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="驾驶证正面" labelPosition="top" labelWidth="200rpx"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.car_card?[{url:formData.qualification.car_card}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.car_card=''" name="car_card" :maxCount="1"
|
||||
width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="驾驶证反面" labelPosition="top" labelWidth="200rpx"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.car_card_b?[{url:formData.qualification.car_card_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.car_card_b=''" name="car_card_b" :maxCount="1"
|
||||
width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<button @click="addAcountNum" type="primary" class="btn">创建</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="title">地区信息</view> -->
|
||||
<!-- <districtSelector style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelector> -->
|
||||
<!-- <districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow>
|
||||
<view class="title">资质信息</view>
|
||||
<u-form-item label="身份证正面" required labelPosition="top" labelWidth="200rpx" prop="qualification.id_card"
|
||||
borderBottom>
|
||||
<u-upload :fileList="formData.qualification.id_card?[{url:formData.qualification.id_card}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.id_card=''" name="id_card" :maxCount="1"
|
||||
width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证反面" required labelPosition="top" labelWidth="200rpx"
|
||||
prop="qualification.id_card_b" borderBottom>
|
||||
<u-upload :fileList="formData.qualification.id_card_b?[{url:formData.qualification.id_card_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.id_card_b=''" name="id_card_b"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="银行卡正面" required labelPosition="top" labelWidth="200rpx"
|
||||
prop="qualification.bank_account" borderBottom>
|
||||
<u-upload
|
||||
:fileList="formData.qualification.bank_account?[{url:formData.qualification.bank_account}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.bank_account=''" name="bank_account"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="银行卡反面" required labelPosition="top" labelWidth="200rpx"
|
||||
prop="qualification.bank_account_b" borderBottom>
|
||||
<u-upload
|
||||
:fileList="formData.qualification.bank_account_b?[{url:formData.qualification.bank_account_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.bank_account_b=''" name="bank_account_b"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="驾驶证正面" labelPosition="top" labelWidth="200rpx" borderBottom>
|
||||
<u-upload :fileList="formData.qualification.car_card?[{url:formData.qualification.car_card}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.car_card=''" name="car_card"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="驾驶证反面" labelPosition="top" labelWidth="200rpx" borderBottom>
|
||||
<u-upload :fileList="formData.qualification.car_card_b?[{url:formData.qualification.car_card_b}]:[]"
|
||||
@afterRead="afterRead" @delete="formData.qualification.car_card_b=''" name="car_card_b"
|
||||
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
|
||||
</u-upload>
|
||||
</u-form-item> -->
|
||||
</u--form>
|
||||
<button @click="addAcountNum" type="primary" class="btn">创建</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { upLoadImage } from "@/api/file.js"
|
||||
import { loginAdd } from "@/api/oaUser.js"
|
||||
import districtSelector from "@/components/districtSelector/districtSelector.vue" //地区选择器
|
||||
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //地区选择器
|
||||
export default {
|
||||
components: { districtSelector, districtSelectorTow },
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
account: '', //账号
|
||||
password: '123456', //密码
|
||||
password_confirm: '', //确认密码
|
||||
// channel: 6, //注册渠道[1-微信小程序 2-微信公众号 3-手机H5 4-电脑PC 5-苹果APP 6-安卓APP]
|
||||
id_card: '',
|
||||
is_captain: '',// 队长标识
|
||||
sex: '',
|
||||
avatar: '',
|
||||
nickname: '',
|
||||
address: '',
|
||||
qualification: {
|
||||
id_card: "",
|
||||
id_card_b: "",
|
||||
car_card: "",
|
||||
car_card_b: "",
|
||||
bank_account: "",
|
||||
bank_account_b: ""
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
account: {
|
||||
required: true,
|
||||
pattern: /^(1[3456789]\d{9})$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
id_card: {
|
||||
required: true,
|
||||
pattern: /^\d{17}[\dX]$|^\d{15}[\dX]$/,
|
||||
message: '请输入正确的身份证号',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
sex: {
|
||||
validator: (rule, value, callback) => {
|
||||
typeof value === 'number' ? callback() : callback('请选择男或女')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
avatar: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '头像不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
nickname: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '姓名不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
is_captain:{
|
||||
validator: (rule, value, callback) => {
|
||||
typeof value === 'number' ? callback() : callback('不能为空')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.id_card': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.id_card_b': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.bank_account': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.bank_account_b': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
this.$refs.uForm.setRules(this.rules)
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
// 上传头像
|
||||
async afterReadAvatar(event) {
|
||||
upLoadImage({
|
||||
filePath: event.file.url,
|
||||
name: 'file'
|
||||
}).then(res => {
|
||||
this.formData.avatar = res.data.uri
|
||||
})
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
this.upLoad(event.file.url, event.name)
|
||||
},
|
||||
// 上传图片
|
||||
upLoad(url, type) {
|
||||
upLoadImage({
|
||||
filePath: url,
|
||||
name: 'file'
|
||||
}).then(res => {
|
||||
this.formData.qualification[type] = res.data.uri
|
||||
})
|
||||
},
|
||||
// 创建账号
|
||||
addAcountNum() {
|
||||
let flag = this.$refs.districtSelectorRef.validate();
|
||||
this.$refs.uForm.validate().then(async (e) => {
|
||||
if(e&&flag){
|
||||
uni.showLoading()
|
||||
let res = await loginAdd({...this.formData, ...this.$refs.districtSelectorRef.formData});
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "添加成功",
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
uni.$emit('initPersonnel');
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// // 获取机型,[1-微信小程序 2-微信公众号 3-手机H5 4-电脑PC 5-苹果APP 6-安卓APP]
|
||||
// initTerminal() {
|
||||
// // #ifndef APP-PLUS
|
||||
// this.formData.terminal = 6;
|
||||
// // #endif
|
||||
// uni.getSystemInfo({
|
||||
// success: (res) => {
|
||||
// const platform = res.platform.toLowerCase();
|
||||
// if (platform === 'ios') {
|
||||
// this.formData.terminal = 5;
|
||||
// } else if (platform === 'windows') {
|
||||
// this.formData.terminal = 4;
|
||||
// } else if (platform === 'mac') {
|
||||
// this.formData.terminal = 4;
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// // #ifdef H5
|
||||
// this.formData.terminal = 3;
|
||||
// // #endif
|
||||
// // #ifdef MP-WEIXIN
|
||||
// this.formData.terminal = 1;
|
||||
// // #endif
|
||||
// },
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.stopPullDownRefresh()
|
||||
}
|
||||
}
|
||||
import {
|
||||
upLoadImage
|
||||
} from "@/api/file.js"
|
||||
import {
|
||||
loginAdd
|
||||
} from "@/api/oaUser.js"
|
||||
import districtSelector from "@/components/districtSelector/districtSelector.vue" //地区选择器
|
||||
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //地区选择器
|
||||
export default {
|
||||
components: {
|
||||
districtSelector,
|
||||
districtSelectorTow
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
account: '', //账号
|
||||
password: '123456', //密码
|
||||
password_confirm: '', //确认密码
|
||||
// channel: 6, //注册渠道[1-微信小程序 2-微信公众号 3-手机H5 4-电脑PC 5-苹果APP 6-安卓APP]
|
||||
id_card: '',
|
||||
is_captain: '', // 队长标识
|
||||
sex: '',
|
||||
avatar: '',
|
||||
nickname: '',
|
||||
address: '',
|
||||
qualification: {
|
||||
id_card: "",
|
||||
id_card_b: "",
|
||||
car_card: "",
|
||||
car_card_b: "",
|
||||
bank_account: "",
|
||||
bank_account_b: ""
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
account: {
|
||||
required: true,
|
||||
pattern: /^(1[3456789]\d{9})$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
id_card: {
|
||||
required: true,
|
||||
pattern: /^\d{17}[\dX]$|^\d{15}[\dX]$/,
|
||||
message: '请输入正确的身份证号',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
sex: {
|
||||
validator: (rule, value, callback) => {
|
||||
typeof value === 'number' ? callback() : callback('请选择男或女')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
avatar: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '头像不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
nickname: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '姓名不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
is_captain: {
|
||||
validator: (rule, value, callback) => {
|
||||
typeof value === 'number' ? callback() : callback('不能为空')
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.id_card': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.id_card_b': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.bank_account': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
'qualification.bank_account_b': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
this.$refs.uForm.setRules(this.rules)
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
// 上传头像
|
||||
async afterReadAvatar(event) {
|
||||
upLoadImage({
|
||||
filePath: event.file.url,
|
||||
name: 'file'
|
||||
}).then(res => {
|
||||
this.formData.avatar = res.data.uri
|
||||
})
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
this.upLoad(event.file.url, event.name)
|
||||
},
|
||||
// 上传图片
|
||||
upLoad(url, type) {
|
||||
upLoadImage({
|
||||
filePath: url,
|
||||
name: 'file'
|
||||
}).then(res => {
|
||||
this.formData.qualification[type] = res.data.uri
|
||||
})
|
||||
},
|
||||
// 创建账号
|
||||
addAcountNum() {
|
||||
let flag = this.$refs.districtSelectorRef.validate();
|
||||
this.$refs.uForm.validate().then(async (e) => {
|
||||
if (e && flag) {
|
||||
uni.showLoading()
|
||||
let res = await loginAdd({
|
||||
...this.formData,
|
||||
...this.$refs.districtSelectorRef.formData
|
||||
});
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "添加成功",
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
uni.$emit('initPersonnel');
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// // 获取机型,[1-微信小程序 2-微信公众号 3-手机H5 4-电脑PC 5-苹果APP 6-安卓APP]
|
||||
// initTerminal() {
|
||||
// // #ifndef APP-PLUS
|
||||
// this.formData.terminal = 6;
|
||||
// // #endif
|
||||
// uni.getSystemInfo({
|
||||
// success: (res) => {
|
||||
// const platform = res.platform.toLowerCase();
|
||||
// if (platform === 'ios') {
|
||||
// this.formData.terminal = 5;
|
||||
// } else if (platform === 'windows') {
|
||||
// this.formData.terminal = 4;
|
||||
// } else if (platform === 'mac') {
|
||||
// this.formData.terminal = 4;
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// // #ifdef H5
|
||||
// this.formData.terminal = 3;
|
||||
// // #endif
|
||||
// // #ifdef MP-WEIXIN
|
||||
// this.formData.terminal = 1;
|
||||
// // #endif
|
||||
// },
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.stopPullDownRefresh()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.card {
|
||||
background-color: #fff;
|
||||
margin: 28rpx;
|
||||
padding: 28rpx;
|
||||
border-radius: 14rpx;
|
||||
.card {
|
||||
// background-color: #fff;
|
||||
// margin: 28rpx;
|
||||
// padding: 28rpx;
|
||||
// border-radius: 14rpx;
|
||||
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
margin-top: 30rpx;
|
||||
.cards {
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&::before {
|
||||
width: 8rpx;
|
||||
height: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #3175f9;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
margin: 28rpx;
|
||||
padding: 28rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.btn {
|
||||
margin-top: 32rpx;
|
||||
// margin-bottom: 40rpx;
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
background: $theme-oa-color;
|
||||
border-radius: 42rpx 42rpx 42rpx 42rpx;
|
||||
color: #fff;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.avter {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// line-height: 150rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.up_list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.uplode {
|
||||
width: 243.57rpx;
|
||||
height: 173.48rpx;
|
||||
box-sizing: border-box;
|
||||
padding-top: 30rpx;
|
||||
border-radius: 15rpx;
|
||||
border: 1px solid $theme-oa-color;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
color: $theme-oa-color;
|
||||
position: relative;
|
||||
|
||||
.up {
|
||||
position: absolute;
|
||||
color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&::before {
|
||||
width: 8rpx;
|
||||
height: 26rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #3175f9;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 32rpx;
|
||||
// margin-bottom: 40rpx;
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
background: $theme-oa-color;
|
||||
border-radius: 42rpx 42rpx 42rpx 42rpx;
|
||||
color: #fff;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -58,7 +58,8 @@
|
||||
<view class="personnel_list">
|
||||
<view class="card" v-for="(item, index) in userList" :key="item.id">
|
||||
<view class="card_head">
|
||||
<text style="font-size: 32rpx">创建时间: {{item.create_time||"2020-10-10"}}</text>
|
||||
<text style="font-size: 32rpx;">创建时间: {{creTime(item.create_time)}}
|
||||
</text>
|
||||
<text @click="navTo('/subpkg/finance/finance?id='+item.id)">财务查看</text>
|
||||
<text @click="navTo('/subpkg/personnelDetails/personnelDetails?id='+item.id)">信息查看</text>
|
||||
</view>
|
||||
@ -137,7 +138,13 @@
|
||||
this.loadUserList();
|
||||
uni.$on('initPersonnel', this.initLoad);
|
||||
},
|
||||
|
||||
methods: {
|
||||
creTime(a) {
|
||||
return a.toString().substring(0, 10)
|
||||
// return a.substring(0, 10)
|
||||
// console.log(a.substring(0, 10))
|
||||
},
|
||||
navTo(url) {
|
||||
url ?
|
||||
uni.navigateTo({
|
||||
|
Loading…
x
Reference in New Issue
Block a user