wangfukang 3 years ago
parent
commit
d2e5faa081
  1. 2
      pages/inventory/goodsList1.vue
  2. 148
      pages/other/logisticsAddress.vue

2
pages/inventory/goodsList1.vue

@ -1547,7 +1547,7 @@
} }
.notice{ .notice{
width: 100%; width: 100%;
height: 90rpx; height: 56rpx;
} }
.bottom-right { .bottom-right {
width: 60%; width: 60%;

148
pages/other/logisticsAddress.vue

@ -3,20 +3,19 @@
<view> <view>
<button size="default" type="default" @tap="addAddress" hover-class="is-hover">新增线路</button> <button size="default" type="default" @tap="addAddress" hover-class="is-hover">新增线路</button>
</view> </view>
<view class="list-1" style="display: flex;flex-direction: column;height: 150rpx;"> <view class="list-1" style="display: flex;flex-direction: column;height: 150rpx;" v-for="(item, index) in standardList" :key="index">
<view class="name-tel" style="width: 75%;overflow: hidden;"> <view class="name-tel" style="width: 75%;overflow: hidden;">
<text style="line-height: 75rpx;">河北省沧州市运河区</text> <text style="line-height: 75rpx;">{{item.province +'-'+ item.city+'-'+item.area}}</text>
</view> </view>
<view class="name-tel" style="width: 75%;overflow: hidden;"> <view class="name-tel" style="width: 75%;overflow: hidden;">
<text style="line-height: 75rpx;">10公斤内/30元,每公斤/20元</text> <text style="line-height: 75rpx;">{{item.chargingStandard}}</text>
</view> </view>
<view class="name-edit"> <view class="name-edit">
<!-- <u-icon name="edit-pen-fill" size="24"></u-icon>
<uni-icons color="red" type="trash" size="24"></uni-icons> -->
<text @tap.stop="addAddress(item)" style='line-height: 75rpx;color: #088FEB;'>编辑</text> <text @tap.stop="addAddress(item)" style='line-height: 75rpx;color: #088FEB;'>编辑</text>
<text @tap.stop="delAddress(item)" style='color:red;line-height: 75rpx;'>删除</text> <text @tap.stop="delAddress(item)" style='color:red;line-height: 75rpx;'>删除</text>
</view> </view>
</view> </view>
<u-loadmore :status="status" />
<!-- 弹出输入框 --> <!-- 弹出输入框 -->
<uni-popup ref="inputDialog" background-color="#fff"> <uni-popup ref="inputDialog" background-color="#fff">
<cc-selectDity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></cc-selectDity> <cc-selectDity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></cc-selectDity>
@ -52,7 +51,11 @@
area: '', area: '',
id: '' id: ''
}, },
show: false, show: false,
standardList:[],
status: 'loadmore',
pages:1,
total:0,
rules: { rules: {
address1: { address1: {
rules: [{ rules: [{
@ -77,47 +80,136 @@
}, },
onLoad(options) { onLoad(options) {
this.getList() this.getList()
},
onReachBottom() {
if (this.pages >= this.total) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getList();
}, },
methods: { methods: {
//获取列表 //获取列表
getList(){ getList(){
this.tui.request('/app/operatingArea/getOperatingAreaList', 'POST', { let that = this;
pageNum:1, uni.request({
pageSize:10 url: that.tui.interfaceUrl() + '/app/operatingArea/getOperatingAreaList',
}, false, false).then((res) => { data: {
if (res.code == 200){ pageNum:this.pages,
this.standardList = res.result pageSize:10
},
header: {
'content-type': 'application/json',
// 'Authorization': tui.getToken()
'appWLToken': that.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
this.status = 'nomore';
if (res.data.code == 200){
this.pages = res.data.result.pages
this.total = res.data.result.total
if (this.pages == 1) {
this.standardList = res.data.result.records
} else {
this.standardList = [...this.standardList, ...res.data.result.records]
}
}
},
fail: (res) => {
that.tui.toast("网络不给力,请稍后再试")
} }
}) })
}, },
//弹出弹窗 //弹出弹窗
addAddress(data) { addAddress(data) {
let item = this.formData = {}
if(data){
item.id = data.id
item.standard = data.chargingStandard
item.province = data.province
item.city = data.city
item.area = data.area
item.address1 = data.province + data.city + data.area;
}
this.$refs.inputDialog.open('bottom') this.$refs.inputDialog.open('bottom')
}, },
//新增修改 //新增修改
setAddress(){ setAddress(){
this.tui.request('/app/operatingArea/saveOrUpdateOperatingArea', 'post', { let item = {}
shippingType:uni.getStorageSync("signCompany"), if(this.formData.id != ''){
shippingMethod:uni.getStorageSync("companyName"), item = {
shippingMethodId:uni.getStorageSync("transCompany"), shippingType:uni.getStorageSync("signCompany"),
province:this.formData.province, shippingMethod:uni.getStorageSync("companyName"),
city:this.formData.city, shippingMethodId:uni.getStorageSync("transCompany"),
area:this.formData.area, province:this.formData.province,
chargingStandard:this.formData.standard city:this.formData.city,
}, false, false).then(res => { area:this.formData.area,
if (res.code !== 200) return chargingStandard:this.formData.standard,
this.bList = res.result id:this.formData.id
}
}else{
item= {
shippingType:uni.getStorageSync("signCompany"),
shippingMethod:uni.getStorageSync("companyName"),
shippingMethodId:uni.getStorageSync("transCompany"),
province:this.formData.province,
city:this.formData.city,
area:this.formData.area,
chargingStandard:this.formData.standard
}
}
uni.request({
url: this.tui.interfaceUrl() + '/app/operatingArea/saveOrUpdateOperatingArea',
data: item,
header: {
'content-type': 'application/json',
// 'Authorization': tui.getToken()
'appWLToken': this.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if (res.data.code == 200){
this.tui.toast("操作成功")
this.getList();
this.$refs.inputDialog.close()
this.formData = {}
}
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
}) })
}, },
delAddress(){ delAddress(data){
var that = this; var that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条线路吗?", content: "确定删除此条线路吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.tui.toast('删除成功') uni.request({
url: that.tui.interfaceUrl() + '/app/operatingArea/deleteOperatingArea',
data: {
id:data.id
},
header: {
'content-type': 'application/x-www-form-urlencoded',
'appWLToken': that.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if (res.data.code == 200){
that.tui.toast('删除成功')
that.getList();
}
},
fail: (res) => {
that.tui.toast("网络不给力,请稍后再试~")
}
})
} }
that.$forceUpdate() that.$forceUpdate()
} }

Loading…
Cancel
Save