逻辑调整

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

@ -49,7 +49,7 @@ export default {
current: 1, // current: 1, //
size: 20, // size: 20, //
dataType: this.dataTypes,// 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 => { this.$u.api.getWorkOrderRecords(query).then(res => {
if (res.code == 200) { if (res.code == 200) {

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

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

Loading…
Cancel
Save