逻辑调整

test
zhangdi 1 year ago
parent 31cbed6d6c
commit 9779c5bbbe
  1. 55
      App.vue
  2. 2
      pages/home/components/swiperRepair.vue
  3. 99
      pages/order/location.vue
  4. 22
      pages/submission/sendOrders.vue

@ -3,7 +3,7 @@ export default {
onLaunch(options) {
uni.hideTabBar()
const Pages = options.path;
this.updatePosition()
//
const WHITE = [
"pages/login/login",
@ -35,38 +35,45 @@ export default {
},
onShow() {
this.timer=setInterval(()=>{
this.updatePosition()
},10000)
},
data(){
return {
timer:null,
}
},
methods: {
updatePosition() {
const userInfo = uni.getStorageSync("userinfo");
console.log(333333,this.$store.state.dataType)
// if (this.$store.state.dataType == 4) {
// uni.getLocation({
// type: 'wgs84',
// success: (res) => {
let query = {
id: userInfo.user_id,
// "addressLon": res.longitude,
// "addressLat": res.latitude
"addressLon": 120.4732160947301,
"addressLat": 36.17767397801995
}
// this.$u.api.updatePosition(query).then(res => {
if (this.$store.state.dataType == 4) {
uni.getLocation({
type: 'wgs84',
success: (res) => {
let query = {
id: userInfo.user_id,
// "addressLon": res.longitude,
// "addressLat": res.latitude
"addressLon": 120.4732160947301,
"addressLat": 36.17767397801995
}
this.$u.api.updatePosition(query).then(res => {
// })
// },
// fail: (err) => {
// this.error = err;
// console.error(':', err);
// }
// });
})
},
fail: (err) => {
this.error = err;
console.error('定位失败:', err);
}
});
// }
}
},
},
onHide: function () {
onHide () {
clearInterval(this.timer);
console.log("App Hide");
},
};

@ -49,7 +49,7 @@ export default {
current: 1, //
size: 20, //
dataType: this.dataTypes,//
statusSearch: '1,2,3,4,6,20,7',//5
statusSearch: '201,401,402,301,403,202,104',//5
}
this.$u.api.getWorkOrderRecords(query).then(res => {
if (res.code == 200) {

@ -42,42 +42,44 @@ export default {
latitude: 36.146504,//---
longitude: 120.486065, //
display: 'always',
markers: [{
id: 1,
latitude: 36.146504,//
longitude: 120.486065,//
iconPath: '/static/images/position/destination.png',//
label: {
content: '标记133',
},
callout: {
content: '20',
color: '#fff',
fontSize: 14,
borderRadius: 4,
bgColor: '#2B73FF',
display: 'ALWAYS',
padding: 3,
anchorY: 5
}
},
{
id: 2,
latitude: 35.146504,//
longitude: 116.486065,//
iconPath: '/static/images/position/weixiu.png',//
display: 'ALWAYS',
callout: {
content: '标记25',
color: '#ffffff',
fontSize: 14,
borderRadius: 4,
bgColor: '#3cc51f',
display: "ALWAYS",
},
markers: [
// {
// id: 1,
// latitude: 36.146504,//
// longitude: 120.486065,//
// iconPath: '/static/images/position/destination.png',//
// label: {
// content: '133',
// },
// callout: {
// content: '20',
// color: '#fff',
// fontSize: 14,
// borderRadius: 4,
// bgColor: '#2B73FF',
// display: 'ALWAYS',
// padding: 3,
// anchorY: 5
// }
// },
// {
// id: 2,
// latitude: 35.146504,//
// longitude: 116.486065,//
// iconPath: '/static/images/position/weixiu.png',//
// display: 'ALWAYS',
// callout: {
// content: '25',
// color: '#ffffff',
// fontSize: 14,
// borderRadius: 4,
// bgColor: '#3cc51f',
// display: "ALWAYS",
// },
}],
// }
],
userLat: null,//
userLon: null,//
userId: null,//id
@ -129,30 +131,17 @@ export default {
}
this.$u.api.getPosition(query).then(res => {
if (res.code == 200) {
if (res.data == '') {
if (Object.keys(res.data).length === 0) {
uni.showToast({ title: "正在获取维修人员的位置信息,请稍后再进行查看!", icon: "none" });
} else {
this.markers[1].latitude = data.split(',')[0]
this.markers[1].longitude = data.split(',')[1]
this.getDistances(this.markers[1].latitude, this.markers[1].longitude, this.markers[0].latitude, this.markers[0].longitude)
}
}
})
// uni.getLocation({
// type: 'wgs84',
// success: (res) => {
// this.latitude = res.latitude//
// this.longitude = res.longitude
// this.markers[1].latitude = this.latitude + 20//
// this.markers[1].longitude = this.longitude + 20
// console.log(':', res,this.markers);
// },
// fail: (err) => {
// this.error = err;
// console.error(':', err);
// }
// });
},
getUserInfo() {
this.$u.api.getUserInfo().then(res => {
@ -160,8 +149,8 @@ export default {
this.userInfo = res.data
this.markers[0].latitude = res.data.addressLat
this.markers[0].longitude = res.data.addressLon
this.getDistances(this.markers[1].latitude, this.markers[1].longitude, this.markers[0].latitude, this.markers[0].longitude)
this.getLocation()
}
}).catch(err => {
@ -171,7 +160,7 @@ export default {
mounted() {
this.getUserInfo()
this.getLocation()
},
};

@ -139,9 +139,7 @@
<view class="material-text">型号{{ item.xh }}</view>
<view class="material-text">数量{{ item.goodsNum }}</view>
<view class="material-text">单位{{ item.unit }}</view>
<view class="material-text">价格{{ ((dataTypes == 3 && detailForm.status ==
3) || (dataTypes == 1 && detailForm.status ==
4)) ? item.materialPrice : (item.purchasePrice * item.goodsNum) }}</view>
<view class="material-text">价格{{ item.materialPrice}}</view>
</view>
</view>
<u-button v-if="!optionDisabled" size="medium" :plain="true"
@ -441,9 +439,10 @@ export default {
},
onShow() {
this.getRepairPersons()//
this.getDeviceList()
this.orderId = this.$route.query.id
this.getDtails()
this.userInfo = uni.getStorageSync("userinfo");
//
if (this.dataTypes == 4) {
@ -476,6 +475,7 @@ export default {
let data = 0
if (this.detailForm.materials.length > 0) {
this.detailForm.materials.forEach(item => {
item.materialPrice=item.materialPrice
data = data + item.materialPrice
item.goodsNum = item.materialCount
item.name = item.materialName
@ -493,6 +493,12 @@ export default {
this.deviceData.repairPerson = this.detailForm.deviceId
this.deviceData.name = this.detailForm.deviceName
}
if(this.detailForm.status == 401){
this.deviceData.repairPerson = ''
this.deviceData.name = ''
}
this.getDeviceList()
}
@ -616,6 +622,9 @@ export default {
uni.showToast({ title: "申领数量不能为0", icon: "none" });
return false
}
selected.forEach(item=>{
item.materialPrice = item.goodsNum*item.purchasePrice
})
this.sendOrder.materialsData = JSON.parse(JSON.stringify(selected))
this.aterialShow = false
},
@ -630,7 +639,7 @@ export default {
if (this.sendOrder.materialsData.length > 0) {
this.goodsTableData.forEach(i => {
this.sendOrder.materialsData.forEach(v => {
if (i.id == v.id) {
if (i.inventoryId == v.inventoryId) {
i.checked = true
}
})
@ -697,7 +706,7 @@ export default {
brand: item.brand,//
xh: item.xh,//
rule: item.rule,//
materialPrice: item.goodsNum * item.unifiedQuotation,
materialPrice: item.materialPrice,
materialCount: item.goodsNum,//
orderId: this.detailForm.id,
})
@ -894,6 +903,7 @@ export default {
let query={
current:1,
size:9999,
limsId:this.detailForm.reportUnit,
}
this.$u.api.getDeviceList(query).then(res => {
if (res.code == 200) {

Loading…
Cancel
Save