1
This commit is contained in:
parent
704fd7c309
commit
0ecaa68ae1
81
App.vue
81
App.vue
@ -1,8 +1,85 @@
|
||||
<script>
|
||||
|
||||
import config from '@/config'
|
||||
import request from '@/utils/request';
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
console.log('app lunch');
|
||||
let version = config.appInfo.version
|
||||
request({
|
||||
url:'/admin-api/system/config/configKey/repairVersion',
|
||||
method: 'get',
|
||||
params:''
|
||||
}).then(res => {
|
||||
console.log(res,1444);
|
||||
if (res.code == 200 && res.data &&res.data != version){
|
||||
uni.showModal({
|
||||
title:'版本升级',
|
||||
content:'新版本上线了,根据您自己的选择是否升级',
|
||||
showCancel: true,
|
||||
confirmText:'升级',
|
||||
success: res => {
|
||||
if (res.cancel) return;
|
||||
|
||||
let waiting = plus.nativeUI.showWaiting("正在下载 - 0%");
|
||||
// uni.showLoading({
|
||||
// title: '安装包下载中'
|
||||
// });
|
||||
// wgt 和 安卓下载更新
|
||||
const downloadTask = uni.downloadFile({
|
||||
url:'http://159.75.168.143:88/apk/repairWorker.apk',
|
||||
success: res => {
|
||||
if (res.statusCode !== 200) {
|
||||
console.error('下载安装包失败', err);
|
||||
return;
|
||||
}
|
||||
// 下载好直接安装,下次启动生效
|
||||
plus.runtime.install(res.tempFilePath, {
|
||||
force: false
|
||||
}, () => {
|
||||
uni.hideLoading()
|
||||
if (is_mandatory) {
|
||||
//更新完重启app
|
||||
plus.runtime.restart();
|
||||
return;
|
||||
}
|
||||
uni.showModal({
|
||||
title: '安装成功是否重启?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
//更新完重启app
|
||||
plus.runtime.restart();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, err => {
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
title: '更新失败',
|
||||
content: err.message,
|
||||
showCancel: false
|
||||
});
|
||||
});
|
||||
},
|
||||
//接口调用结束
|
||||
complete: ()=>{
|
||||
uni.hideLoading();
|
||||
downloadTask.offProgressUpdate();//取消监听加载进度
|
||||
}
|
||||
});
|
||||
//监听下载进度
|
||||
downloadTask.onProgressUpdate(res => {
|
||||
// state.percent = res.progress;
|
||||
waiting.setTitle("正在下载 - "+res.progress+"%");
|
||||
// console.log('下载进度百分比:' + res.progress); // 下载进度百分比
|
||||
// console.log('已经下载的数据长度:' + res.totalBytesWritten); // 已经下载的数据长度,单位 Bytes
|
||||
// console.log('预期需要下载的数据总长度:' + res.totalBytesExpectedToWrite); // 预期需要下载的数据总长度,单位 Bytes
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
|
@ -125,7 +125,16 @@
|
||||
<text>{{ item.itemName }}</text>
|
||||
<text v-if="canSeeMoney" class="projAmount">¥{{ item.itemMoney }}</text>
|
||||
</view>
|
||||
<view class="projBaseInfo" v-if="loginUser.roleCodes.includes('weixiu') || loginUser.roleCodes.includes('service_advisor')||loginUser.roleCodes.includes('general_inspection')" >
|
||||
<view class="projBaseInfo" v-if="(loginUser.roleCodes.includes('weixiu') || loginUser.roleCodes.includes('service_advisor')||loginUser.roleCodes.includes('general_inspection')) && isDetail == '0'" >
|
||||
<!-- 可编辑-->
|
||||
<view v-if="canSeeMoney">售价:<input @input="onKeyInput('sj',item)" style="background: white;padding: 0 10rpx" type="decimal" placeholder="请输入售价" v-model="item.itemPrice" /></view>
|
||||
<view>数量:<input @input="onKeyInput('sl',item)" style="background: white;padding: 0 10rpx" type="number" placeholder="请输入数量" v-model="item.itemCount" /></view>
|
||||
<!-- <view>单位:{{ item.itemUnit}}</view>-->
|
||||
<view v-if="canSeeMoney">折扣:<input @input="onKeyInput('zk',item)" style="background: white;padding: 0 10rpx" type="decimal" placeholder="请输入折扣(0-1)" v-model="item.itemDiscount" /></view>
|
||||
<view v-if="canSeeMoney">金额:<input type="number" disabled placeholder="请输入售价" v-model="item.itemMoney" /></view>
|
||||
</view>
|
||||
<view v-else class="projBaseInfo" v-if="(loginUser.roleCodes.includes('weixiu') || loginUser.roleCodes.includes('service_advisor')||loginUser.roleCodes.includes('general_inspection')) && isDetail != '0'" >
|
||||
<!-- 只读 -->
|
||||
<view v-if="canSeeMoney">售价:{{ item.itemPrice || "" }}</view>
|
||||
<view>数量:{{ item.itemCount || "" }}</view>
|
||||
<!-- <view>单位:{{ item.itemUnit}}</view>-->
|
||||
@ -399,6 +408,26 @@ export default {
|
||||
this.waresByTicket()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 监听输入框
|
||||
*/
|
||||
onKeyInput(type,item){
|
||||
this.$nextTick(()=>{
|
||||
if("zk"==type && (item.itemDiscount<0 || item.itemDiscount>1)){
|
||||
uni.showToast({
|
||||
title: '请输入正确的折扣(数字0-1)',
|
||||
icon: 'none'
|
||||
})
|
||||
item.itemDiscount=1
|
||||
return
|
||||
}
|
||||
if((item.itemPrice && item.itemPrice>0) && (item.itemCount && item.itemCount>0) && (item.itemDiscount && item.itemDiscount>0 && item.itemDiscount<=1)){
|
||||
//数据符合要求重新计算
|
||||
item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
|
||||
}
|
||||
})
|
||||
console.log(item,"item")
|
||||
},
|
||||
/**
|
||||
* 预览图片
|
||||
*/
|
||||
@ -413,9 +442,74 @@ export default {
|
||||
});
|
||||
},
|
||||
submit (){
|
||||
let canSubmit = true
|
||||
//校验所有项目、配件是否填写了价格、数量、折扣,并且是否合理
|
||||
if(this.ticketInfo.projects && this.ticketInfo.projects.length>0){
|
||||
this.ticketInfo.projects.map((item)=>{
|
||||
if(!item.repairIds || item.repairIds==null || item.repairIds==''){
|
||||
//某个维修项目没选施工人员
|
||||
canSubmit=false
|
||||
uni.showToast({
|
||||
title: '维修项目'+item.itemName+'请选择施工人员!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if((item.itemPrice && item.itemPrice>0) && (item.itemCount && item.itemCount>0) && (item.itemDiscount && item.itemDiscount>0 && item.itemDiscount<=1)){
|
||||
//数据符合要求重新计算
|
||||
item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
|
||||
}else{
|
||||
canSubmit=false
|
||||
uni.showToast({
|
||||
title: '维修项目'+item.itemName+'价格有误!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
//APP暂时不修改配件的信息--
|
||||
// if(this.ticketInfo.wares && this.ticketInfo.wares.length>0){
|
||||
// this.ticketInfo.wares.map((item)=>{
|
||||
// if((item.itemPrice && item.itemPrice>0) && (item.itemCount && item.itemCount>0) && (item.itemDiscount && item.itemDiscount>0 && item.itemDiscount<=1)){
|
||||
// //数据符合要求重新计算
|
||||
// item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
|
||||
// }else{
|
||||
// canSubmit=false
|
||||
// uni.showToast({
|
||||
// title: '维修配件'+item.itemName+'价格有误!',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
if(canSubmit){
|
||||
//更新工单配件价格
|
||||
request({
|
||||
url: '/admin-api/repair/titem/updateRepairItem',
|
||||
method: 'PUT',
|
||||
data:this.ticketInfo.projects
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
},700)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '操作失败,请联系管理员',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
afterRead(file) {
|
||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||
|
@ -50,6 +50,7 @@
|
||||
import {
|
||||
setToken,
|
||||
setTenantId,
|
||||
getTenantId,
|
||||
setUserInfo,
|
||||
setJSONData,
|
||||
setStrData
|
||||
@ -132,7 +133,8 @@
|
||||
phone: this.tel,
|
||||
code: this.yzm,
|
||||
type: 1,
|
||||
sysCode:this.sysCode
|
||||
sysCode:this.sysCode,
|
||||
tenantId:getTenantId()
|
||||
}
|
||||
} else {
|
||||
//密码登录
|
||||
@ -140,11 +142,12 @@
|
||||
username: this.tel,
|
||||
password: this.wrod,
|
||||
type: 0,
|
||||
sysCode:this.sysCode
|
||||
sysCode:this.sysCode,
|
||||
tenantId:getTenantId()
|
||||
}
|
||||
}
|
||||
request({
|
||||
url: '/app-api/company/staff/loginApp',
|
||||
url: '/admin-api/company/staff/loginApp',
|
||||
method: 'post',
|
||||
data: data
|
||||
}).then((res) => {
|
||||
|
Loading…
Reference in New Issue
Block a user