main
zouyanyan 6 days ago
parent 8fedb052a2
commit 8f3e48eb0e

@ -1,6 +1,9 @@
<template>
<view class="easy-scancode" v-if="show">
<view id="reader"></view>
<view class="scan-back">
<button class="action-btn" @tap="stop"></button>
</view>
<!-- 扫码提示区域 -->
<view class="scan-tip-overlay">
<view class="scan-tip"> 请将二维码放入框内 </view>
@ -70,16 +73,19 @@ export default {
stop() {
this.show = false;
let that = this;
this.html5QrCode
.stop()
.then((ignore) => {
//
console.log("二维码扫描已停止");
})
.catch((err) => {
//
console.log("无法停止扫描");
});
if(this.html5QrCode){
this.html5QrCode
.stop()
.then((ignore) => {
//
console.log("二维码扫描已停止");
})
.catch((err) => {
//
console.log("无法停止扫描");
});
}
},
getCameras() {
let that = this;
@ -155,6 +161,9 @@ export default {
});
},
},
// beforeDestroy() {
// this.stop();
// }
};
</script>
<style lang="scss" scoped>
@ -165,7 +174,7 @@ export default {
z-index: 1000;
top: 0;
left: 0;
background-color: #000;
background-color: rgba(0, 0, 0, 0.5);
}
#reader {
@ -181,6 +190,7 @@ export default {
width: 100%;
height: 100%;
z-index: 10000;
background: rgba(0, 0, 0, 0.1);
pointer-events: none; /* 不阻挡摄像头画面 */
}
@ -193,8 +203,20 @@ export default {
font-size: 16px;
text-align: center;
z-index: 10001;
background-color: rgba(0, 0, 0, 0.5);
background: rgba(0, 0, 0, 0.5);
padding: 10px 20px;
border-radius: 5px;
}
.scan-back{
position: absolute;
top: calc(100vh - 100px );
left: 50%;
transform: translateX(-50%);
color: #fff;
font-size: 16px;
text-align: center;
z-index: 10001;
padding: 10px;
border-radius: 5px;
}
</style>

@ -18,16 +18,19 @@
<radio-group class="checklist-group" @change="chagne">
<view class="sitem" v-for="(item,index) in clistnow" :key="index">
<view class="conright">
<view class="adress">
{{index+1}}
</view>
<view class="sname">
{{retType(item.departCode,2)}}
</view>
<view class="adress">
{{item.workshop}}
</view>
<view v-if="cur==2" class="adress">
<view class="adress">
{{item.location}}
</view>
<view v-if="cur==2" class="adress">
<view class="adress">
{{item.address}}
</view>
</view>

@ -18,16 +18,19 @@
<radio-group class="checklist-group" @change="chagne">
<view class="sitem" v-for="(item,index) in clistnow" :key="index">
<view class="conright">
<view class="adress">
{{index+1}}
</view>
<view class="sname">
{{retType(item.departCode,2)}}
</view>
<view class="adress">
{{item.workshop}}
</view>
<view v-if="cur==1" class="adress">
<view class="adress">
{{item.location}}
</view>
<view v-if="cur==1" class="adress">
<view class="adress">
{{item.address}}
</view>
</view>
@ -70,10 +73,10 @@ export default {
};
},
watch: {
clist(list) {
console.log('监视值的改变1');
this._initTree(list);
},
// clist(list) {
// console.log('1');
// this._initTree(list);
// },
fcur(v) {
console.log('监视值的改变2');
this.cur=v;
@ -85,6 +88,7 @@ export default {
this.getTypes();
},
methods: {
// tab
qhclick(index){
this.cur=index;
this.$forceUpdate();
@ -118,72 +122,63 @@ export default {
});
},
_initTree(list){
this.clistall=list;
if(this.cur==1){
this.clistall=list;
this.$forceUpdate();
}
else{
this.clistall=[];
this.$forceUpdate();
var commondata = uni.getStorageSync("commondata");
var data = JSON.parse(commondata);
if(data){
if(data.address&&data.address.length>0){
var user = JSON.parse(uni.getStorageSync("user"));
var bmbm = user.bmbm?user.bmbm:''; // '02'
data.address.forEach(cell=>{
if(bmbm==cell.departCode){
this.clistall.push(cell);
this.$forceUpdate();
}
});
}
}
else{
this.clistall=[];
this.$forceUpdate();
}
}
this.clistnow=[];
this.clistall.forEach((v, i) => {
if(this.cur==2){
//
var findx = this.clistnow.findIndex(item => item.departCode === v.departCode && item.workshop === v.workshop);
if(findx<0){
//
var add={
id:v.id,
departCode:v.departCode,
workshop:v.workshop
}
if(this.value == v.id){
add.isChecked = true;
}
else{
add.isChecked = false;
}
this.clistnow.push(add);
}
//
if(this.value == v.id){
this.clistall[i].isChecked = true;
}
else{
//
if(this.value == v.id){
this.clistall[i].isChecked = true;
}
else{
this.clistall[i].isChecked = false;
}
this.clistnow.push(this.clistall[i]);
this.clistall[i].isChecked = false;
}
this.clistnow.push(this.clistall[i]);
});
console.log(this.clistnow);
this.$forceUpdate();
},
chagne(e){
var rt= null;
if(e.detail.value){
this.clist.forEach(cell=>{
this.clistnow.forEach(cell=>{
if(cell.id==e.detail.value){
rt=cell;
}
});
}
if(this.cur==2){
rt.location="";
rt.address="";
}
this.$emit("change", rt);
this._hide();
},
_show(id) {
_show() {
console.log("_show");
this.cur=this.fcur;
this.$forceUpdate();
this._initTree(this.clist);
this.$refs.share.open();
this.value=id;
this.clistnow.forEach(cell=>{
if(this.value == cell.id){
cell.isChecked=true;
}
else{
cell.isChecked=false;
}
});
this.$forceUpdate();
},
_hide() {
this.$refs.share.close();

@ -32,7 +32,7 @@
"path": "pages/me/index",
"style": {
"navigationBarBackgroundColor": "#3690ff",
"navigationBarTitleText": "我的"
"navigationBarTitleText": "我的地址"
// "app-plus": {
// "titleNView": false
// }

@ -185,10 +185,10 @@
});
this.menus.push({
name:"我的",
name:"我的地址",
key:"my",
src:"../../static/image/my.png",
remark:"查看当前用户信息",
remark:"查看常用地址信息",
url:"/pages/me/index",
opentype:"1",
ifshow: true
@ -287,7 +287,7 @@
return false;
}
if(item.name=="我的"){
if(item.name=="我的地址"){
uni.navigateTo({
url: item.url
});

@ -0,0 +1,513 @@
<template>
<view class="page">
<view class="tip">
<uni-icons type="info" size="20" color="#00a89b"></uni-icons>
<text style="margin-left: 10rpx;">若所在省市无法选择请在省市区选择其他在详细地址输入即可</text>
</view>
<view class="example">
<!-- 基础表单校验 -->
<uni-forms ref="valiForm" :modelValue="valiFormData">
<uni-forms-item label="收货人" labelWidth="168rpx" required name="name">
<uni-easyinput v-model="valiFormData.name" maxlength="10" placeholder="请输入收货人" />
</uni-forms-item>
<uni-forms-item label="手机号码" labelWidth="168rpx" required name="phone">
<uni-easyinput type="number" v-model="valiFormData.phone" maxlength="12" placeholder="请输入手机号码" />
</uni-forms-item>
<uni-forms-item label="所在区域" labelWidth="168rpx" name="region">
<view class="usel" @click="openPicker">
<view class="txt" v-if="valiFormData.region">{{valiFormData.region}} </view>
<view class="txt0" v-else></view>
<uni-icons type="right" size="18" color="#ddd"></uni-icons>
</view>
</uni-forms-item>
<uni-forms-item label="详细地址" labelWidth="168rpx" name="address">
<uni-easyinput type="textarea" v-model="valiFormData.address" autoHeight maxlength="200" placeholder="请输入详细地址" />
</uni-forms-item>
</uni-forms>
</view>
<view class="xcon">
<view class="xcell">
<text class="txt">设置默认地址</text>
<switch :checked="valiFormData.isDefault" @change="switch1Change" color="#00a89b" style="transform:scale(0.7)"/>
</view>
<!-- <view class="xright" @click="delDo" >删除地址</view> -->
</view>
<view class="submitcon">
<button type="primary" v-if="type=='add'||type=='edit'" class="btn" @click="submit('valiForm')"></button>
</view>
<cc-selectCity :show="show" :province="province" :city="city" :area="district" @sureSelectArea="onsetCity" @changeClick="changeClick" @hideShow="onhideShow"></cc-selectCity>
<!-- 是否登录 -->
<openlogin ref="loginId" @getPhoneNumber="getPhoneNumber"></openlogin>
</view>
</template>
<script>
import { myCache } from '../../utils/utils.js';
import openlogin from "../components/openlogin.vue";
export default {
components: {
openlogin
},
data() {
return {
openId:"",
phone:"",
userid:"",
index:0,
type:'add',
show:false,
province:"辽宁省",
city:"沈阳市",
district: "沈北新区",
valiFormData: {//
id: null,
name: '',
phone: '',
province: "",//
city: "",//
district: "", //
region: "", //
address: '',//
isDefault: false, //
},
//
rules: {
name: {
rules: [{
required: true,
errorMessage: '姓名不能为空'
}]
},
phone: {
rules: [{
required: true,
errorMessage: '请填写联系电话',
}, {
validateFunction: function(rule, value, data, callback) {
let iphoneReg = (
/^(13[0-9]|14[1579]|15[0-3,5-9]|16[6]|17[0123456789]|18[0-9]|19[89])\d{8}$/
); //
if (!iphoneReg.test(value)) {
callback('手机号码格式不正确,请重新填写')
}
}
}]
}
},
ifselshow:true
}
},
onLoad(options) {
console.log('onLoad')
if(options.data){
var data = JSON.parse(decodeURIComponent(options.data));
console.log(data);
this.valiFormData.id= data.id;
this.valiFormData.name= data.name;
this.valiFormData.phone= data.phone;
this.valiFormData.province= data.province;//
this.valiFormData.city= data.city; //
this.valiFormData.district= data.district; //
this.valiFormData.region= data.province+data.city+data.district; //
this.valiFormData.address= data.address.replace(data.province+data.city+data.district, "") ,//
this.valiFormData.isDefault= data.isDefault?data.isDefault:false; //
console.log(this.valiFormData)
this.province=this.valiFormData.province;
this.city=this.valiFormData.city;
this.district=this.valiFormData.district;
this.ifselshow=true;
this.$forceUpdate();
}
if(options.index){
this.index=options.index;
}
if(options.type){
this.type=options.type;
if(this.type=="edit")
{
uni.setNavigationBarTitle({
title: "收件地址编辑",
});
}
else if(this.type=="add")
{
uni.setNavigationBarTitle({
title: "添加收件地址",
});
}
}
},
onReady() {
console.log('onReady')
if(this.ifselshow){
// onReady
this.$refs.valiForm.setRules(this.rules);
}
},
onShow(){
this.openId = myCache('openId');
var user = myCache('user');
this.userid = user.userid? user.userid:'';
this.phone = user.userphone;
if(this.userid==""||this.userid=="0"){
uni.navigateTo({
url: `/pages/login/login`
});
}
},
create(){
console.log('create');
},
methods: {
switch1Change: function (e) {
console.log('switch1 发生 change 事件,携带值为', e.detail.value);
if(e.detail.value){
this.valiFormData.isDefault=true
}
else{
this.valiFormData.isDefault=false
}
this.$forceUpdate();
},
//
openPicker() {
console.log('执行打开地址选择器')
this.show = true;
this.$forceUpdate();
},
//
changeClick(value1, value2, value3){
console.log('地址选择器 = ' + value1 + value2 + value3);
this.province=value1;
this.city=value2;
this.district=value3;
this.$forceUpdate();
},
//
onhideShow() {
this.show = false;
console.log('执行了关闭地址选择器')
},
//
onsetCity(e) {
console.log('选中操作',e)
let data = e.detail.target.dataset;
let address = data.province + data.city + data.area;
this.show = false;
this.valiFormData.region = address;
this.valiFormData.province = data.province;
this.valiFormData.city = data.city;
this.valiFormData.district = data.area;
this.$forceUpdate();
},
getPhoneNumber(e){
if(e.phone){
this.phone = e.phone
}
if(e.userid){
this.userid = e.userid
}
},
async getinfo() {
uni.showLoading({
title: '数据加载中...'
});
const {data: res} = await uni.$http.post('/patient/'+this.id, null);
if(res.data){
this.valiFormData=res.data;
this.$forceUpdate();
}
},
async delDo(){
var _this=this;
try{
uni.showModal({
title: '提示',
content: '确定要删除此收件地址吗?',
cancelText: '取消',
confirmText: '确定',
success: ress => {
if (ress.confirm) {
// var myaddresslist=myCache("myaddresslist");
// if(myaddresslist&&myaddresslist.length>0){
// if(myaddresslist[this.index]){
// myaddresslist.splice(this.index, 1);
// myCache("myaddresslist",myaddresslist);
// }
// }
// uni.showToast({
// title: '',
// icon: 'success',
// duration: 2000
// })
// setTimeout(() => {
// uni.navigateBack({
// delta: 1
// });
// }, 2000);
_this.delDoDo();
}
}
});
}
catch{
uni.showToast({
title: '地址删除失败!',
icon: 'error',
duration: 2000
});
}
},
async delDoDo() {
uni.showLoading({
title: '数据删除中...'
});
const {data: res} = await uni.$http.post('/Appiso/delAddressByAddressid', {id:this.valiFormData.id});
if(res){
uni.showToast({
title: '地址已删除!',
icon: 'success',
duration: 2000
})
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
}
else{
uni.showToast({
title: '地址删除失败!请重试',
icon: 'error',
duration: 2000
})
}
},
async submit(ref) {
var that = this;
this.$refs[ref].validate().then(res => {
console.log('success', res);
that.savedo();
}).catch(err => {
console.log('err', err);
})
},
async savedo(){
try{
if(this.type=="edit"){
var adr={
id:this.valiFormData.id,
address:this.valiFormData.address, // this.valiFormData.province+this.valiFormData.city+this.valiFormData.area+this.valiFormData.address,
district: this.valiFormData.district,
city: this.valiFormData.city,
province: this.valiFormData.province,
name: this.valiFormData.name,
phone: this.valiFormData.phone,
isDefault: this.valiFormData.isDefault,
}
const {data: res} = await uni.$http.post('/api/address/edit', adr);
if(res){
uni.showToast({
title: '收件地址已修改!',
icon: 'success',
duration: 2000
})
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
}
else{
uni.showToast({
title: '收件地址修改失败!请重试',
icon: 'error',
duration: 2000
})
}
}
else{
var adr={
address:this.valiFormData.address, // this.valiFormData.province+this.valiFormData.city+this.valiFormData.area+this.valiFormData.address,
district: this.valiFormData.district,
city: this.valiFormData.city,
province: this.valiFormData.province,
name: this.valiFormData.name,
phone: this.valiFormData.phone,
isDefault: this.valiFormData.isDefault,
}
const {data: res} = await uni.$http.post('/api/address/add', adr);
if(res){
uni.showToast({
title: '收件地址已新增!',
icon: 'success',
duration: 2000
})
myCache("ifaddressadd",1);
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
}
else{
uni.showToast({
title: '收件地址新增失败!请重试',
icon: 'error',
duration: 2000
})
}
}
}
catch(e){
console.log(e)
uni.showToast({
title: '收件地址保存失败!',
icon: 'error',
duration: 2000
});
}
}
}
}
</script>
<style lang="scss" scoped>
.page{
padding: 0;
position: relative;
background-image: url('@/static/image/bg.jpg');
background-attachment: fixed;
background-size: cover;
background-position: center center;
min-height: calc(100vh - var(--window-top) - var(--window-bottom));
}
.usel{
display: flex;
flex-direction: row;
flex: 1;
justify-content: flex-end;
align-items: center;
margin-top: 10rpx;
.txt{
font-weight: 500;
font-size: 28rpx;
color: #606266;
margin-right: 20rpx;
}
.txt0{
font-weight: 500;
font-size: 28rpx;
color: #999;
margin-right: 20rpx;
}
}
.xcon{
box-sizing: border-box;
margin: 24rpx;
display: flex;
flex-direction: column;
align-items: center;
.xcell{
display: flex;
flex-direction: row;
align-items: center;
padding: 20rpx;
border-radius: 16rpx;
background-color: #FFF;
box-sizing: border-box;
width: 100%;
height: 120rpx;
.txt{
font-weight: 500;
font-size: 28rpx;
color: #303133;
display: flex;
flex: 1;
}
}
.xright{
width: 100%;
display: flex;
flex: 1;
justify-content: flex-end;
font-weight: 500;
font-size: 28rpx;
color: #303133;
margin-top: 20rpx;
margin-right: 20rpx;
}
}
.tip{
background: #e4f9f7;
padding: 20rpx;
font-size: 24rpx;
color: #303133;
display: flex;
justify-content: center;
align-items: center;
}
.btn{
margin: 50rpx auto 54rpx;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FCFCFD;
width: 660rpx;
height: 76rpx;
line-height: 76rpx;
background: #00a89b;
box-shadow: 0rpx 12rpx 64rpx 2rpx rgba(137,150,95,0.4);
border-radius: 10rpx;
opacity: 1;
&::after{
border:none;
}
}
.ftext{
margin-top: 20rpx;
font-size: 28rpx;
line-height: 2.5;
}
.example {
margin: 30rpx 20rpx;
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 16rpx;
}
.submitcon{
margin: 10rpx 20rpx 50rpx;
position: relative;
display: block;
overflow: hidden;
height: 200rpx;
}
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 30rpx;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
}
.button {
display: flex;
align-items: center;
height: 60rpx;
margin-left: 20rpx;
}
</style>

@ -0,0 +1,338 @@
<template>
<view class="page">
<view class="topcon">
<view class="tleft">收件地址</view>
<view class="tright" @click="gotoadd">
<uni-icons type="plusempty" size="14" color="#FFF"></uni-icons>
</view>
</view>
<view class="skcon" v-if="myaddresslist.length==0">
<image class="skimg" src="@/static/image/noaddress.png" mode="aspectFill" ></image>
</view>
<view class="scroll" v-else>
<view class="scell">
<view v-for="(item, index) in myaddresslist" :key="index" class="sitem">
<view class="lcon">
<view class="sname">
<text>{{item.name}}</text>
<text style="margin-left: 10rpx;margin-right: 10rpx;">{{item.phone}}</text>
<view v-if="item.isDefault" class="tip"></view>
</view>
<view class="sinfo">
{{item.province+item.city+item.district+item.address}}
</view>
</view>
<view class="opecon">
<uni-icons type="compose" size="25" color="#999999" @click="gotoedit(item,index)"></uni-icons>
<uni-icons type="trash-filled" size="25" color="#999999" @click="delDo(item.id)"></uni-icons>
</view>
</view>
<uni-load-more v-if="loadStatus!=='noMore'" iconType="circle" :status="loadStatus" />
</view>
</view>
<view class="submitcon">
<button type="primary" class="btn" @click="gotoadd"></button>
</view>
</view>
</template>
<script>
import { myCache } from '../../utils/utils.js';
export default {
data() {
return {
openId:"",
phone:"",
userid:"",
loadStatus:'more',
myaddresslist:[
// {
// id:1,
// contact:"",
// phone:"18900000001",
// address:"",
// sortid:1
// }
]
};
},
onLoad() {
},
onReady(){
},
onShow(){
this.openId = myCache('openId');
var user = myCache('user');
this.userid = user.userid? user.userid:'';
this.phone = user.userphone;
if(this.userid==""||this.userid=="0"){
uni.navigateTo({
url: `/pages/login/login`
});
}
try{
this.getList();
}
catch(e){
this.myaddresslist=[];
console.log(e);
}
},
methods: {
async delDo(id){
var _this=this;
try{
uni.showModal({
title: '提示',
content: '确定要删除此收件地址吗?',
cancelText: '取消',
confirmText: '确定',
success: ress => {
if (ress.confirm) {
_this.delDoDo(id);
}
}
});
}
catch{
uni.showToast({
title: '收件地址删除失败!',
icon: 'error',
duration: 2000
});
}
},
async delDoDo(id) {
uni.showLoading({
title: '数据删除中...'
});
const {data: res} = await uni.$http.post('/api/address/del', {id:id});
if(res&&res.success){
uni.showToast({
title: '收件地址已删除!',
icon: 'success',
duration: 2000
});
this.myaddresslist=[];
this.loadStatus="more";
this.getList();
}
else{
uni.showToast({
title: '收件地址删除失败!请重试',
icon: 'error',
duration: 2000
})
}
},
gotoedit(item,index){
var type='edit';
var data=encodeURIComponent(JSON.stringify(item));
uni.navigateTo({
url: `/pages/address/add?data=${data}&index=${index}&type=${type}`
});
},
getAddr(){
var _this=this;
//
// #ifdef MP-ALIPAY
my.getAddress({
success: function(res) {
console.log(res);
if(res.result){
res.result.sortid=0;
//
if(_this.myaddresslist&&_this.myaddresslist.length>0){
var ifexist=false
_this.myaddresslist.forEach((cell)=>{
if(cell.address==res.result.address){
ifexist=true
}
});
if(!ifexist){
//
_this.myaddresslist.push(res.result);
_this.$forceUpdate();
myCache("myaddresslist",_this.myaddresslist);
}
}
else{
_this.myaddresslist=[];
_this.myaddresslist.push(res.result);
_this.$forceUpdate();
myCache("myaddresslist",_this.myaddresslist);
}
}
},
fail: function(err) {
console.log(err);
}
});
// #endif
},
gotoadd(){
var type='add';
uni.navigateTo({
url: `/pages/address/add?type=${type}`
});
},
async getList() {
const {data: res} = await uni.$http.post('/api/address/list');
if(res.data&&res.data.length>0){
this.myaddresslist=res.data;
this.loadStatus="noMore";
}
else{
this.myaddresslist=[];
this.loadStatus="noMore";
}
this.$forceUpdate();
}
}
}
</script>
<style lang="scss" scoped>
.page{
padding: 0;
position: relative;
display: block;
background-color: #F5F5F5;
}
.topcon{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 30rpx;
.tleft{
font-weight: 400;
font-size: 28rpx;
color: #23262F;
}
.tright{
width: 160rpx;
height: 50rpx;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
background: #00a89b;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.skcon{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
.skimg{
width: 360rpx;
height: 320rpx;
margin-top: 200rpx;
}
.sktip{
margin-top: 42rpx;
margin-left: 30rpx;
margin-right: 30rpx;
margin-bottom: 30rpx;
height: 48rpx;
line-height: 48rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #23262F;
}
}
.submitcon{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 168rpx;
background-color: #FFFFFF;
}
.btn{
margin: 20rpx auto 54rpx;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FCFCFD;
width: 560rpx;
height: 76rpx;
line-height: 76rpx;
background: #00a89b;
box-shadow: 0rpx 12rpx 64rpx 2rpx rgba(137,150,95,0.4);
border-radius: 10rpx;
opacity: 1;
&::after{
border:none;
}
}
.scroll{
width: 100%;
position: relative;
display: block;
margin-bottom: 178rpx;
margin-top: 20rpx;
}
.scell{
display: flex;
background-color: #F5F5F5;
padding: 0 24rpx 0 24rpx;
flex-direction: column;
.sitem {
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
margin-bottom: 20rpx;
border-radius: 16rpx;
.lcon{
display: flex;
flex: 1;
flex-direction: column;
}
.opecon{
width: 110rpx;
display: flex;
}
.sname{
font-size: 30rpx;
font-weight: 600;
color: rgb(29, 29, 29);
padding: 24rpx;
justify-content: flex-start;
align-items: center;
display: flex;
.tip{
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
width: 80rpx;
height: 48rpx;
text-align: center;
line-height: 50rpx;
background: #00a89b;
border-radius: 24rpx;
margin-left: 10rpx;
}
}
.sinfo{
padding: 0 24rpx 24rpx;
font-size: 26rpx;
color:rgb(116, 116, 116);
line-height: 40rpx;
}
}
}
</style>

@ -4,87 +4,131 @@
<view class="wrap">
<view class="titleImg">
<view class="user">
<image :src="icon" @error="handleImageError($event,0)" class="anquanguanli"></image>
<view class="upimg">
<!-- <image style="width: 40rpx; height: 40rpx;" src="../../static/images/hedit.png" @click="chooseImg"></image> -->
<!-- <UploadheadFile class="upload" @picIds="zpics" :deletable="false" :count="1" :sourceType="sourceType" :width="30" :height="30" :fileidList="zpimgs">
</UploadheadFile> -->
<!-- <uni-file-picker limit="1" :del-icon="false" disable-preview :imageStyles="imageStyles" file-mediatype="image" @select="upload">
<image style="width: 40rpx; height: 40rpx;" src="../../static/images/hedit.png"></image>
</uni-file-picker> -->
<uni-icons type="person-filled" size="28" color="#fff"></uni-icons>
<view class="username">
<p class="p1">{{loginName}}{{deptName}} {{lxdh?'—'+lxdh:''}}</p>
</view>
</view>
<view class="user" v-if="psdz">
<uni-icons type="location-filled" size="28" color="#fff"></uni-icons>
<view class="username">
<p class="p1">{{loginName}} {{deptName}}</p>
<p class="p2">登录时间{{actual}}</p>
<p class="p1">{{psdz}}</p>
</view>
</view>
</view>
<view class="item">
<u-form ref="uForm">
<!-- <u-form-item>
<image :src="shezhi" class="inpuIcon"></image>
<view class="text" @click="gotome()"></view>
<image :src="xiayiji" class="righticon"></image>
</u-form-item> -->
<u-form-item>
<image :src="banbengengxin" class="inpuIcon"></image>
<view class="text">关于</view>
<view class="version">版本号 {{VersionIn}}</view>
<image :src="xiayiji" class="righticon"></image>
</u-form-item>
</u-form>
<view class="adrcon">
<view class="topcon">
<view class="tleft">常用地址</view>
<view class="tright" @click="gotoadd">
<uni-icons type="plusempty" size="14" color="#FFF"></uni-icons>
</view>
</view>
<view class="skcon" v-if="myaddresslist.length==0">
暂无常用地址请添加~~
</view>
<view class="scroll" v-else>
<view class="scell">
<view v-for="(item, index) in myaddresslist" :key="index" class="sitem">
<view class="lcon">
<view class="sname">
<text>{{item.userName}}({{item.userCode}})</text>
<text>{{ item.departCode?retType(item.departCode,1):''}}</text>
</view>
<view class="sinfo">
{{item.workshop+item.location+item.address}}
</view>
</view>
<view class="opecon">
<uni-icons type="trash-filled" size="25" color="#999999" @click="delDo(item.id)"></uni-icons>
</view>
</view>
<uni-load-more v-if="loadStatus!=='noMore'" iconType="circle" :status="loadStatus" />
</view>
</view>
</view>
<!-- <view class="loginout" @click="loginout">
退出当前账户
</view>-->
</view>
<u-modal v-model="show" show-cancel-button @confirm="confirm" content="是否退出用户"></u-modal>
<u-toast ref="uToast" />
<!-- 添加 -->
<!-- 弹框 -->
<uni-popup ref="share" type="share">
<view class="allcon">
<view class="xcon">
<view class="xcell cur" @click="saveClick()"></view>
<view class="rclose" @tap="_cancel"></view>
</view>
<view class="hcon">
<view class="htitle">
<u-search class="searchinput" v-model="searchKey" @change="searchchange" @custom="searchcustom" placeholder="请输入地址查询"
shape="square" bg-color="#EFF4F9" :clearabled="true" :show-action="showAction" input-align="left" @clear="clear"></u-search>
</view>
</view>
<view class="selcon">
<radio-group class="checklist-group" @change="chagne">
<view class="sitem" v-for="(item,index) in clistnow" :key="index">
<view class="conright">
<view class="adress">
{{index+1}}
</view>
<view class="sname">
{{retType(item.departCode,1)}}
</view>
<view class="adress">
{{item.workshop}}
</view>
<view class="adress">
{{item.location}}
</view>
<view class="adress">
{{item.address}}
</view>
</view>
<view class="selbtn">
<radio :value="item.id" :checked="item.isChecked" />
</view>
</view>
</radio-group>
<view class="lineb"></view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
//#ifdef APP-PLUS
// const jpushModule = uni.requireNativePlugin('JG-JPush');
//#endif
import utils from "@/common/utils.js";
import UploadheadFile from "@/components/UploadheadFile.vue";
export default {
components: {
UploadheadFile
},
<script>
export default {
data() {
return {
VersionIn: '1.0.0',
edit: require("@/static/images/hedit.png"),
icon: require("@/static/images/icon.png"),
xiugaimima: require("@/static/images/xiugaimima.png"),
banbengengxin: require("@/static/images/banbengengxin.png"),
shezhi: require("@/static/images/shezhi.png"),
xiayiji: require("@/static/images/xiayiji.png"),
show: false,
actual: utils.formatDate(new Date().getTime()),
loginName:"",
deptName:"",
imgurl:uni.$http.baseUrl,
sourceType:['album', 'camera'], // album-camera-使['album', 'camera']
imageStyles: {
width: 40,
height: 40,
border: false
},
lxdh:"",
psdz:"",
depts:[],
loadStatus:'more',
myaddresslist:[],
address:[],
clistnow:[],
clistall:[],
searchKey:"",
showAction:false,
seladr:null
}
},
onLoad() {
let that = this;
// #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
that.VersionIn = widgetInfo.version;
});
// #endif
var user= JSON.parse(uni.getStorageSync("user"));
var yhms=user.yhms?user.yhms:"";
this.loginName=yhms;
var bmmc= uni.getStorageSync("bmmc");
this.deptName=bmmc?bmmc:"";
this.lxdh=user.lxdh?user.lxdh:"";
this.psdz=user.psdz?user.psdz:"";
this.$forceUpdate();
this.getTypes();
},
onShow() {
if (!uni.getStorageSync("token")) {
@ -98,22 +142,14 @@
url: '/pages/login/index'
});
}, 2000);
}
var user= JSON.parse(uni.getStorageSync("user"));
var yhms=user.yhms?user.yhms:"";
if(user.yhdm)
{
this.icon= this.imgurl+'/images/'+ user.yhdm+".jpg?id="+Math.random()*100;
try{
this.getList();
}
catch(e){
this.myaddresslist=[];
console.log(e);
}
this.loginName=yhms;
var bmmc= uni.getStorageSync("bmmc");
this.deptName=bmmc?bmmc:"";
this.$forceUpdate();
this.getMsg();
},
mounted() {
},
methods: {
handleImageError(e,index){
@ -121,171 +157,275 @@
this.icon= require("@/static/images/icon.png");
this.$forceUpdate();
},
chooseImg(){
uni.chooseImage({
count: 1, //9
sizeType: ['compressed'], //
sourceType: ['album','camera'], //
success: res=> {
console.log(res)
/*res.tempFilePaths[0]是获取到的第一个数据的blob地址将他赋值给数据区的imgUrl*/
// this.imgUrl=res.tempFilePaths[0]
// console.log(this.imgUrl)
this.upimg(res.tempFilePaths[0]);
}
});
async delDo(id){
var _this=this;
try{
uni.showModal({
title: '提示',
content: '确定要删除此常用地址吗?',
cancelText: '取消',
confirmText: '确定',
success: ress => {
if (ress.confirm) {
_this.delDoDo(id);
}
}
});
}
catch{
uni.showToast({
title: '收件地址删除失败!',
icon: 'error',
duration: 2000
});
}
},
upload(e) {
var that = this;
const tempFilePaths = e.tempFilePaths; //e
async delDoDo(id) {
uni.showLoading({
title: '头像上传中...'
});
tempFilePaths.forEach(item => {
this.upimg(item)
title: '数据删除中...'
});
const {data: res} = await uni.$http.get('/userAddr/removeById', {id:id});
if(res&&res.success){
uni.showToast({
title: '此地址已删除!',
icon: 'success',
duration: 2000
});
this.myaddresslist=[];
this.loadStatus="more";
this.getList();
}
else{
uni.showToast({
title: '此地址删除失败!请重试',
icon: 'error',
duration: 2000
})
}
},
//
upimg(tempFilePaths) {
var that = this;
uni.showLoading({
title: '头像上传中...'
});
uni.uploadFile({
url: this.imgurl+'/api/uploadRyzp', //
filePath: tempFilePaths,
name: 'file',
header: {
token: uni.getStorageSync("token")
},
success: res => {
console.log(res)
uni.hideLoading();
if(res.statusCode==200){
var data = JSON.parse(res.data);
if (data.success) {
that.icon = this.imgurl+'/images/'+ data.data+"?id="+Math.random()*100;
} else {
uni.showToast({
title: "头像上传失败!" + data.massage,
icon: 'error'
});
}
}
else{
uni.showToast({
title: "头像上传失败!" + res.errMsg,
icon: 'error'
});
gotoadd(){
this.clistall=[];
this.$forceUpdate();
this.address.forEach(cell=>{
var ifadd=0;
this.myaddresslist.forEach(item=>{
if(item.id==cell.id){
ifadd=1
}
});
if(ifadd==0){
this.clistall.push(cell);
this.$forceUpdate();
}
});
this._show();
},
//
zpics(val) {
console.log(val)
if(val.length>0){
console.log(this.imgurl+'/images/'+val[0])
this.icon = this.imgurl+'/images/'+val[0];
async getList() {
const {data: res} = await uni.$http.get('/userAddr/myAddr');
if(res.data&&res.data.length>0){
this.myaddresslist=res.data;
this.$forceUpdate();
this.loadStatus="noMore";
}
else{
this.myaddresslist=[];
this.$forceUpdate();
this.loadStatus="noMore";
//
// this.myaddresslist=[{address : "2",
// departCode : "02",
// id : "91CABDDF00314651BDBC47B389F3981D",
// location : "2",
// workshop :"",
// userName:"",
// userCode:"tuopan"}]
}
},
async getMsg(){
var _this=this;
var user= JSON.parse(uni.getStorageSync("user"));
var yhdm=user.yhdm?user.yhdm:"";
const {data: res} = await uni.$http.post('/api/getMsgCount?yhdm='+yhdm);
if(res.success){
if(res.data){
_this.msgCount=1*(res.data.msgCount?res.data.msgCount:0);
if(_this.msgCount>0){
//
uni.setTabBarBadge({
//
index: 2,
text: _this.msgCount+''
getTypes() {
//
this.depts=[];
var commondata = uni.getStorageSync("commondata");
if(commondata){
var data = JSON.parse(commondata);
if(data){
this.depts=data.depts;
this.$forceUpdate();
//
if(data.address&&data.address.length>0){
var user = JSON.parse(uni.getStorageSync("user"));
var bmbm = user.bmbm?user.bmbm:''; // '02'; //
var workshop = user.workshop?user.workshop:'';
data.address.forEach(cell=>{
if(bmbm==cell.departCode){
if(workshop){
if(workshop==cell.workshop){
this.address.push(cell);
this.$forceUpdate();
}
}
else{
this.address.push(cell);
this.$forceUpdate();
}
}
});
}
else{
uni.removeTabBarBadge({
index: 2
})
}
//#ifdef APP-PLUS
plus.runtime.setBadgeNumber(_this.msgCount);
//#endif
console.log("address",this.address);
}
}
else{
this.depts=[];
this.address=[];
}
},
loginout() {
this.show = true;
retType(type,str) {
var rets = '';
if(str==1){
//
this.depts.forEach((cell,idx)=>{
if(type==cell.departCode){
rets=cell.departName;
return;
}
});
}
if(!rets){
rets=type
}
return rets;
},
confirm() {
setTimeout(function(){
uni.removeStorageSync('token');
uni.removeStorageSync('user');
uni.removeStorageSync('bmmc');
// uni.redirectTo({
// url: '/pages/login/index'
// });
},500);
//
saveClick(){
if(this.seladr){
this.addDo();
}
else{
uni.showModal({
title: '提示',
content: '请选择需要添加的地址!',
cancelText: '取消',
confirmText: '确定',
success: ress => {
}
});
}
},
setpsd(){
uni.navigateTo({
url: `/pages/aboutMe/psdSet?type=0`
async addDo() {
uni.showLoading({
title: '数据提交中...'
});
const {data: res} = await uni.$http.post('/userAddr/save', {
departCode:this.seladr.departCode,
workshop:this.seladr.workshop,
location:this.seladr.location,
address:this.seladr.address,
});
if(res&&res.success){
this._hide();
uni.showToast({
title: '此地址已添加!',
icon: 'success',
duration: 2000
});
this.myaddresslist=[];
this.loadStatus="more";
this.getList();
}
else{
uni.showModal({
title: '提示',
content: res.message?res.message:'此地址添加失败!请重试!',
cancelText: '取消',
confirmText: '确定',
success: ress => {
}
});
}
},
gotome(){
uni.navigateTo({
url: `/pages/aboutMe/myInfo`
searchchange(value) {
// value
if(value){
this.showAction=true;
this.$forceUpdate();
}
},
searchcustom(value) {
if (this.searchKey) {
this.clistall.forEach((v, i) => {
this.clistall[i].isChecked = false;
});
this.clistnow = this.clistall.filter((p) => {
//filterpersonList
return ( p.address.indexOf(this.searchKey) !== -1 );
});
this.$forceUpdate();
}
},
clear() {
this.showAction=false;
this.clistnow=[];
this.clistall.forEach((v, i) => {
this.clistall[i].isChecked = false;
this.clistnow.push(this.clistall[i]);
});
}
},
_initTree(){
this.clistnow=[];
this.clistall.forEach((v, i) => {
this.clistall[i].isChecked = false;
this.clistnow.push(this.clistall[i]);
});
this.$forceUpdate();
},
chagne(e){
var rt= null;
if(e.detail.value){
this.seladr=null;
this.$forceUpdate();
this.clistnow.forEach(cell=>{
if(cell.id==e.detail.value){
this.seladr=cell;
this.$forceUpdate();
}
});
}
},
_show() {
this._initTree();
this.$refs.share.open();
this.$forceUpdate();
},
_hide() {
this.$refs.share.close();
},
_cancel() {
this._hide();
},
}
}
</script>
<style lang="scss">
.titleImg {
padding: 0 57rpx;
padding:30rpx;
color: #fff;
width: 100%;
background-size: 100%;
position: relative;
height: 365rpx;
background-image: url(@/static/images/mebackimg.jpg);
.user {
// position: absolute;
// top: 165rpx;
// left: 72rpx;
position: relative;
display: flex;
flex-direction: row;
margin: 0;
padding-top: 165rpx;
padding-left: 72rpx;
.upimg{
position: absolute;
top: 220rpx;
left: 150rpx;
width: 40rpx;
height: 40rpx;
}
.anquanguanli {
width: 96rpx;
height: 96rpx;
border-radius: 50%;
}
.username {
margin-top: 0rpx;
margin-left: 50rpx;
line-height: 60rpx;
margin-left: 10rpx;
.p1 {
font-size: 36rpx;
font-size: 32rpx;
}
.p2 {
font-size: 22rpx;
opacity: 0.7;
@ -293,62 +433,238 @@
}
}
}
}
.item {
width: 710rpx;
margin-left: 20rpx;
border-radius: 5rpx;
margin-top: 20rpx;
height: 110rpx;
position: relative;
padding: 0 47rpx 43rpx 40rpx;
background: #fff;
.text {
width: 400rpx;
margin-left: 25rpx;
display: inline-block;
.adrcon{
display: flex;
flex-direction: column;
background: #F5F5F5;
padding: 20rpx;
margin: 0;
}
.topcon{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 10rpx;
.tleft{
font-weight: 400;
font-size: 28rpx;
color: #23262F;
}
.tright{
width: 160rpx;
height: 50rpx;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
background: #3690ff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.user-box {
background-color: #fff;
.skcon{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #23262F;
width: 100%;
padding: 20rpx;
border-top: 1rpx dotted #f0f0f0;
}
.loginout {
width: 710rpx;
height: 100rpx;
.submitcon{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 150rpx;
}
.btn{
margin: 30rpx auto;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FCFCFD;
width: 560rpx;
height: 76rpx;
line-height: 76rpx;
background: #3690ff;
box-shadow: 0rpx 12rpx 64rpx 2rpx rgba(54,144,255,0.4);
border-radius: 10rpx;
opacity: 1;
&::after{
border:none;
}
}
.scroll{
width: 100%;
position: relative;
margin-left: 20rpx;
display: block;
margin-bottom: 30rpx;
margin-top: 20rpx;
background-color: #fff;
border-radius: 5rpx;
text-align: center;
line-height: 110rpx;
font-size: 28rpx;
font-family: FZLTZHUNHJW--GB1-0;
color: #3690ff
}
.inpuIcon {
width: 35rpx;
height: 35rpx;
.scell{
display: flex;
background-color: #F5F5F5;
padding: 0 10rpx;
flex-direction: column;
.sitem {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
margin-bottom: 20rpx;
border-radius: 16rpx;
.lcon{
display: flex;
flex: 1;
flex-direction: column;
}
.opecon{
position: absolute;
right: 20rpx;
bottom: 20rpx;
}
.sname{
font-size: 30rpx;
font-weight: 600;
color: rgb(29, 29, 29);
padding: 24rpx;
justify-content:space-between;
align-items: center;
display: flex;
.tip{
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
width: 80rpx;
height: 48rpx;
text-align: center;
line-height: 50rpx;
background: #3690ff;
border-radius: 24rpx;
margin-left: 10rpx;
}
}
.sinfo{
padding: 0 24rpx 24rpx;
font-size: 26rpx;
color:rgb(116, 116, 116);
line-height: 40rpx;
}
}
}
.righticon {
width: 11rpx;
height: 22rpx;
position: absolute;
right: 0rpx;
top:45rpx;
::v-deep.uni-radio-input-checked::before{
display: none!important;
}
.allcon{
height: calc((0.8*100vh));
min-height: 300rpx;
overflow: hidden;
background-color: #FFFFFF;
}
.version{
width: 180rpx;
height: 70rpx;
position: absolute;
right: 20rpx;
color:#888;
.xcon{
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
padding: 20rpx 20rpx 0 20rpx;
.xcell{
border: 1rpx solid #ddd;
color: #949494;
margin-right: 20rpx;
padding: 10rpx 20rpx;
border-radius: 10rpx;
}
.xcell.cur{
color: #fff;
background-color: #007aff;
border: 1rpx solid #007aff;
}
}
.hcon{
display: flex;
flex-direction: row;
padding: 20rpx;
.htitle{
flex:1;
justify-content: flex-start;
font-size: 32rpx;
font-weight: 600;
letter-spacing: 5rpx;
padding-right: 20rpx;
}
.rclose{
width: 70rpx;
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 28rpx;
color:#949494;
}
}
.checklist-group{
width: 100%;
}
.selcon{
padding: 20rpx;
position: relative;
display: block;
overflow-y: auto;
height: calc((100vh*0.9 - 280rpx));
.lineb{
height: 50rpx;
}
.sitem {
display: flex;
flex-direction: row;
flex: 1;
background-color: #FFFFFF;
border-bottom: 1rpx solid #eeeeee;
padding: 10rpx 0;
.conright{
flex: 1;
display: flex;
flex-direction: row;
width: 100%;
justify-content:flex-start;
}
.selbtn{
width: 80rpx;
display: flex;
justify-content: center;
align-items: center;
}
.sname{
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 28rpx;
font-weight: 600;
color: rgb(29, 29, 29);
padding: 10rpx 10rpx 10rpx 0;
}
.adress{
display: flex;
justify-content: flex-start;
align-items: center;
padding: 10rpx 10rpx 10rpx 10rpx;
font-size: 26rpx;
color:#949494;
}
}
}
</style>

@ -11,8 +11,21 @@
<!-- 配送单扫描区域 -->
<view class="section">
<!-- 备注 -->
<view class="order-details">
<!-- 存放地址 -->
<view class="detail-header">
<view class="detail-title" style="width: 150rpx;"><text style="color: #fa3534;">*</text>存放地址</view>
<view class="detail-tip">
<view class="selarr" @click="showaddress()">
<text class="txt" v-if="itemList.departCode">{{retType(itemList.departCode,2)}}{{itemList.workshop}}{{itemList.location}}{{itemList.address}}</text>
<text class="txt" v-else style="color:#999">请选择</text>
<uni-icons type="right" size="20" color="#999"></uni-icons>
</view>
</view>
</view>
<!-- 备注 -->
<view class="detail-item" style="margin-top: 10rpx;">
<view class="item-label">备注</view>
<view class="item-value">
@ -100,6 +113,9 @@
<!-- 扫码组件 html5-qrcode -->
<scan-code ref="scan"></scan-code>
<!-- 选择存放 -->
<selXP ref="clsel" :clist="address" :cur="1" :value="itemList.id" @change="selXPDO" @cancel="cancelClDO"></selXP>
<u-toast ref="uToast" />
</view>
@ -108,6 +124,8 @@
<script>
import psDetail from "@/components/psDetail.vue";
import selXP from "@/components/selXP.vue";
// jsQR
// import scanQR from "@/components/scanQR.vue";
@ -121,6 +139,7 @@ import Compressor from 'compressorjs';
export default {
components: {
psDetail,
selXP,
// scanQR,
scanCode
},
@ -178,8 +197,15 @@ export default {
remark: '',
data: [],
deliveryCar:'',//
departCode:"",
workshop:"",
location:"",
address:"",
id:"",
},
selids:[], //
address:[],
};
},
onLoad(options) {
@ -187,6 +213,35 @@ export default {
this.getTypes();
},
methods: {
//
showaddress(e) {
this.$refs.clsel._show();
},
selXPDO(e){
//
console.log(e);
if(e){
this.itemList.id=e.id?e.id:'';
this.itemList.departCode=e.departCode?e.departCode:'';
this.itemList.workshop=e.workshop?e.workshop:'';
this.itemList.location=e.location?e.location:'';
this.itemList.address=e.address?e.address:'';
}
else{
this.itemList.id='';
this.itemList.departCode='';
this.itemList.workshop='';
this.itemList.location='';
this.itemList.address='';
}
this.$forceUpdate();
},
cancelClDO(e){
//
console.log(e);
this.$forceUpdate();
},
/**
* h5扫码返回
*/
@ -552,7 +607,16 @@ export default {
//
finishLoading(){
console.log('完成接收');
if(!this.itemList.departCode||!this.itemList.workshop||!this.itemList.location||!this.itemList.address){
this.$refs.uToast.show({
title: "请选择正确的存放地址!",
type: "warning",
duration: 3000,
});
return false
}
var data=[];
this.palletData.forEach((item,index)=>{
if(item.checked){
@ -631,7 +695,7 @@ export default {
this.users=data.users;
this.dicts=data.dicts;
this.depts=data.depts;
this.address=data.address;
// this.address=data.address;
this.dicts.forEach(cell=>{
if("PJCD"==cell.bmlb){
//
@ -649,8 +713,9 @@ export default {
this.users=[];
this.dicts=[];
this.depts=[];
this.address=[];
// this.address=[];
}
this.getList();
},
retType(type,str) {
var rets = '';
@ -680,7 +745,27 @@ export default {
}
return rets;
},
async getList() {
const {data: res} = await uni.$http.get('/userAddr/myAddr');
if(res.data&&res.data.length>0){
this.address=res.data;
this.$forceUpdate();
if(this.address.length==1){
var e=this.address[0];
this.itemList.id=e.id?e.id:'';
this.itemList.departCode=e.departCode?e.departCode:'';
this.itemList.workshop=e.workshop?e.workshop:'';
this.itemList.location=e.location?e.location:'';
this.itemList.address=e.address?e.address:'';
this.$forceUpdate();
}
}
else{
this.address=[];
this.$forceUpdate();
}
},
}
};
@ -860,7 +945,7 @@ page {
}
.order-details {
margin-top: 20rpx;
margin-top: 2rpx;
}
.detail-header {
@ -888,6 +973,20 @@ page {
width: 100%;
flex:1;
}
.selarr {
width: 100%;
height: 100%;
line-height: 1;
text-align: right;
display: flex;
flex-direction: row;
align-items: center;
.txt{
display: flex;
justify-content: flex-end;
flex: 1;
}
}
.tip{
display: flex;
flex: 1;

@ -151,7 +151,7 @@
件号: {{ item.assemcode || '-' }}
</view>
<view class="item-cell">
数量: {{ item.qty || '-' }}
数量: {{ item.qty?(1.0*item.qty).toFixed(0) : '-' }}
</view>
</view>
<view class="list-cell">

@ -63,11 +63,11 @@
</view>
<view class="detail-item" v-if="expanded">
<text class="item-label">制作图号</text>
<view class="item-value">{{ itemList.dwgno }}<text v-if="itemList.dwgno" class="xqtxt" @click="gotoXQ(1,itemList.dwgno,'',itemList.project)"></text></view>
<view class="item-value">{{ itemList.dwgno }}<text v-if="itemList.dwgno" class="xqtxt" @click="gotoXQ('1',itemList.dwgno,itemList.instno,itemList.project)"></text></view>
</view>
<view class="detail-item" v-if="expanded">
<text class="item-label">托盘表号</text>
<view class="item-value">{{ itemList.instno }}<text v-if="itemList.instno" class="xqtxt" @click="gotoXQ(2,'',itemList.instno,itemList.project)"></text></view>
<view class="item-value">{{ itemList.instno }}<text v-if="itemList.instno" class="xqtxt" @click="gotoXQ('2',itemList.dwgno,itemList.instno,itemList.project)"></text></view>
</view>
<view class="detail-item" v-if="expanded">
<text class="item-label">数量</text>
@ -93,6 +93,19 @@
<text class="item-label">配送车辆</text>
<text class="item-value">{{ itemList.deliveryCar }}</text>
</view>
<!-- 存放地址 -->
<view class="detail-header">
<view class="detail-title" style="width: 150rpx;"><text style="color: #fa3534;">*</text>存放地址</view>
<view class="detail-tip">
<view class="selarr" @click="showaddress()">
<text class="txt" v-if="itemList.departCode">{{retType(itemList.departCode,2)}}{{itemList.workshop}}{{itemList.location}}{{itemList.address}}</text>
<text class="txt" v-else style="color:#999">请选择</text>
<uni-icons type="right" size="20" color="#999"></uni-icons>
</view>
</view>
</view>
<view class="detail-header">
<text class="detail-title" style="width: 120rpx;">备注</text>
<view class="detail-tip">
@ -111,7 +124,7 @@
<!-- 配送单照片 -->
<view class="list-section">
<text class="list-title">配送单照片</text>
<view class="list-title"><text style="color: #fa3534;">*</text>配送单照片</view>
<view class="devpicon">
<u-upload ref="uUploadps" :auto-upload="false" upload-text='' :max-size="10 * 1024 * 1024" max-count="3" :width="100" :height="100"
@on-remove="onRemovePS" @on-choose-complete="onChooseCompletePS" :file-list="itemList.deliveryPhoto"
@ -233,6 +246,9 @@
</view>
</u-popup>
<!-- 选择存放 -->
<selXP ref="clsel" :clist="address" :cur="1" :value="itemList.id" @change="selXPDO" @cancel="cancelClDO"></selXP>
<!-- <scanQR ref="scan" @scanSuccess="scanSuccess"></scanQR> -->
<!-- 扫码组件 html5-qrcode -->
<scan-code ref="scan"></scan-code>
@ -246,6 +262,7 @@ import utils from "@/common/utils.js";
import UploadzcFile from "@/components/UploadzcFile.vue";
import deliveryDetail from "@/components/deliveryDetail.vue";
import tpDetail from "@/components/tpDetail.vue";
import selXP from "@/components/selXP.vue";
//
import psDetail from "@/components/psDetail.vue";
@ -266,6 +283,7 @@ export default {
deliveryDetail,
tpDetail,
psDetail,
selXP,
// scanQR,
scanCode
},
@ -384,13 +402,20 @@ export default {
deliveryCar:'',//
files: [],
deliveryPhoto:[], //
qty:0,
departCode:"",
workshop:"",
location:"",
address:"",
id:"",
qty:0,
},
selids:[], //
deliveryimgs:[], //
deliveryurls:'', //
//
scantype:1, // 1 2
address:[],
};
},
onLoad(options) {
@ -405,6 +430,34 @@ export default {
// #endif
},
methods: {
//
showaddress(e) {
this.$refs.clsel._show();
},
selXPDO(e){
//
console.log(e);
if(e){
this.itemList.id=e.id?e.id:'';
this.itemList.departCode=e.departCode?e.departCode:'';
this.itemList.workshop=e.workshop?e.workshop:'';
this.itemList.location=e.location?e.location:'';
this.itemList.address=e.address?e.address:'';
}
else{
this.itemList.id='';
this.itemList.departCode='';
this.itemList.workshop='';
this.itemList.location='';
this.itemList.address='';
}
this.$forceUpdate();
},
cancelClDO(e){
//
console.log(e);
this.$forceUpdate();
},
closepl() {
this.showpl = false;
},
@ -442,7 +495,7 @@ export default {
gotoXQ(type,dwgno,instno,project){
uni.navigateTo({
url: `/pages/pallet/tpcxtk?dwgno=${dwgno}&instno=${instno}&project=${project}`
url: `/pages/pallet/tpcxtk?type=${type}&dwgno=${dwgno}&instno=${instno}&project=${project}`
});
},
toggleGroup() {
@ -1221,6 +1274,15 @@ export default {
return false
}
if(!this.itemList.departCode||!this.itemList.workshop||!this.itemList.location||!this.itemList.address){
this.$refs.uToast.show({
title: "请选择正确的存放地址!",
type: "warning",
duration: 3000,
});
return false
}
if(!this.itemList.deliveryPhoto||this.itemList.deliveryPhoto.length<1){
this.$refs.uToast.show({
title: "请上传配送单图片!",
@ -1352,7 +1414,7 @@ export default {
this.users=data.users;
this.dicts=data.dicts;
this.depts=data.depts;
this.address=data.address;
// this.address=data.address;
this.dicts.forEach(cell=>{
if("PJCD"==cell.bmlb){
//
@ -1370,8 +1432,9 @@ export default {
this.users=[];
this.dicts=[];
this.depts=[];
this.address=[];
// this.address=[];
}
this.getList();
},
retType(type,str) {
var rets = '';
@ -1401,6 +1464,27 @@ export default {
}
return rets;
},
async getList() {
const {data: res} = await uni.$http.get('/userAddr/myAddr');
if(res.data&&res.data.length>0){
this.address=res.data;
this.$forceUpdate();
if(this.address.length==1){
var e=this.address[0];
this.itemList.id=e.id?e.id:'';
this.itemList.departCode=e.departCode?e.departCode:'';
this.itemList.workshop=e.workshop?e.workshop:'';
this.itemList.location=e.location?e.location:'';
this.itemList.address=e.address?e.address:'';
this.$forceUpdate();
}
}
else{
this.address=[];
this.$forceUpdate();
}
},
/**
@ -1612,7 +1696,7 @@ page {
}
.detail-title {
font-size: 32rpx;
font-size: 30rpx;
font-weight: bold;
color: #333;
display: flex;
@ -1627,6 +1711,20 @@ page {
width: 100%;
flex:1;
}
.selarr {
width: 100%;
height: 100%;
line-height: 1;
text-align: right;
display: flex;
flex-direction: row;
align-items: center;
.txt{
display: flex;
justify-content: flex-end;
flex: 1;
}
}
.tip{
display: flex;
flex: 1;
@ -1687,7 +1785,7 @@ page {
}
.section-title {
font-size: 34rpx;
font-size: 30rpx;
font-weight: bold;
color: #333;
}

@ -16,7 +16,7 @@
<view class="accordion" v-for="(group, index) in tabItem.slist" :key="index+'-'+group.assemcode">
<view class="accordion-header">
<view class="header-info">
<text class="group-title">{{ page.instno?'托盘表号:':(page.dwgno?'制作图:':'') }}{{ page.instno?group.instno:(page.dwgno?group.dwgno:'') }}</text>
<text class="group-title">{{ type=='1'?'制作图号:':'托盘表号:' }}{{ type=='1'?group.dwgno:page.instno }}</text>
<text class="group-title"> 配送比例:{{group.percent?group.percent+'%':'0.0%'}}</text>
</view>
<view class="header-info">
@ -114,7 +114,7 @@
件号: {{ item.assemcode || '-' }}
</view>
<view class="item-cell">
数量: {{ item.qty || '-' }}
数量: {{ item.qty?(1.0*item.qty).toFixed(0) : '-' }}
</view>
</view>
<view class="list-cell">
@ -185,6 +185,7 @@
data() {
return {
show: false,
type: '1',// 1 2, 3,
page: {
project: null,
dwgno: null,
@ -212,6 +213,10 @@
};
},
onLoad(option) {
if(option.type){
this.type=option.type;
this.$forceUpdate();
}
if(option.project){
this.page.project=option.project;
this.$forceUpdate();
@ -252,7 +257,24 @@
});
//
// this.page.project="T300K-106";
const {data: res} = await uni.$http.get('/searchInstdetail',this.page);
var parms={};
if(this.page.project){
parms["project"]=this.page.project;
}
if(this.page.section){
parms["section"]=this.page.section;
}
if(this.page.palletNo){
parms["palletNo"]=this.page.palletNo;
}
if(this.page.dwgno){
parms["dwgno"]=this.page.dwgno;
}
if(this.page.instno){
parms["instno"]=this.page.instno;
}
const {data: res} = await uni.$http.get('/searchInstdetail',parms);
if(res.success){
this.list[0].slist=[];
if(res.data&&res.data.length>0){
@ -261,14 +283,14 @@
res.data.forEach((cell,idx)=>{
var findx = -1;
if(this.page.instno){
//
findx = this.list[0].slist.findIndex(item => item.instno === cell.instno);
}
else if(this.page.dwgno){
if(this.type=='1'){
//
findx = this.list[0].slist.findIndex(item => item.dwgno === cell.dwgno);
}
else {
//
findx = this.list[0].slist.findIndex(item => item.instno === cell.instno);
}
if(findx<0){
var add = {
expanded:false,
@ -276,6 +298,7 @@
items:[cell],
project:cell.project,
instno:cell.instno,
dwgno:cell.dwgno,
requireDepartCode:cell.requireDepartCode,
requireRate:cell.requireRate,
requireAddress:cell.requireAddress,
@ -378,7 +401,6 @@
num=num+1.0*(cell.qty?cell.qty:0);
}
});
// console.log(num.toFixed(2))
return num.toFixed(2);
}
else{
@ -394,7 +416,6 @@
num=num+1.0*(cell.qty?cell.qty:0);
}
});
// console.log(num.toFixed(2))
return num.toFixed(2);
}
else{

@ -109,7 +109,7 @@
</uni-popup>
<!-- 选择存放 -->
<selXP ref="clsel" :clist="address" :cur="fcur" :value="itemList.address" @change="selXPDO" @cancel="cancelClDO"></selXP>
<selXP ref="clsel" :clist="address" :cur="fcur" :value="itemList.id" @change="selXPDO" @cancel="cancelClDO"></selXP>
<!-- 托盘详情 -->
<u-popup v-model="showpl" @close="closepl" mode="center" :mask="true" :closeable="true" :border-radius="20" close-icon-pos="top-right">
@ -417,7 +417,7 @@ export default {
//
showaddress(e) {
this.$refs.clsel._show(this.itemList.id);
this.$refs.clsel._show();
},
selXPDO(e){
//
@ -725,17 +725,17 @@ export default {
this.depts=data.depts;
//
console.log("this.address",data.address);
if(data.address&&data.address.length>0){
// console.log("user",uni.getStorageSync("user"));
var user = JSON.parse(uni.getStorageSync("user"));
var bmbm = user.bmbm?user.bmbm:''; // '02'; //
data.address.forEach(cell=>{
if(bmbm==cell.departCode){
this.address.push(cell);
}
});
}
// console.log("this.address",data.address);
// if(data.address&&data.address.length>0){
// // console.log("user",uni.getStorageSync("user"));
// var user = JSON.parse(uni.getStorageSync("user"));
// var bmbm = user.bmbm?user.bmbm:''; // '02'; //
// data.address.forEach(cell=>{
// if(bmbm==cell.departCode){
// this.address.push(cell);
// }
// });
// }
this.dicts.forEach(cell=>{
if("PJCD"==cell.bmlb){
@ -759,8 +759,9 @@ export default {
this.users=[];
this.dicts=[];
this.depts=[];
this.address=[];
// this.address=[];
}
this.getList();
},
retType(type,str) {
var rets = '';
@ -790,6 +791,17 @@ export default {
}
return rets;
},
async getList() {
const {data: res} = await uni.$http.get('/userAddr/myAddr');
if(res.data&&res.data.length>0){
this.address=res.data;
this.$forceUpdate();
}
else{
this.address=[];
this.$forceUpdate();
}
},
getStatusClass(status) {
switch (status) {
case '02':

@ -31,11 +31,8 @@
<!-- 配送单扫描区域 -->
<view class="section">
<!-- 转运存放区域 -->
<!-- 转运去向区域 -->
<view class="order-details">
<u-form :model="itemList" :rules="rules" ref="uForm" :errorType="errorType">
<view class="detail-header">
<text class="detail-title">转运信息</text>
@ -280,22 +277,22 @@ export default {
rules: {
departCode: [{
required: true,
message: '请选择存放单位',
message: '请选择去向单位',
trigger: ['change'],
}],
workshop: [{
required: true,
message: '请选择存放工场',
message: '请选择去向工场',
trigger: ["change"],// blur
}],
location: [{
required: true,
message: '请选择存放区域',
message: '请选择去向区域',
trigger: ["change"],
}],
location: [{
address: [{
required: true,
message: '请选择存放地址',
message: '请选择去向地址',
trigger: ["change"],
}],
},

Loading…
Cancel
Save