This commit is contained in:
parent
06f71f26b6
commit
7c1396de44
|
|
@ -72,6 +72,7 @@
|
||||||
typeId:'',
|
typeId:'',
|
||||||
agreementId:'',
|
agreementId:'',
|
||||||
keyWord: '',
|
keyWord: '',
|
||||||
|
status: '',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10
|
pageSize: 10
|
||||||
})
|
})
|
||||||
|
|
@ -105,6 +106,11 @@
|
||||||
queryParams.value.useStatus = options.useStatus
|
queryParams.value.useStatus = options.useStatus
|
||||||
queryParams.value.typeId = item.value.typeId
|
queryParams.value.typeId = item.value.typeId
|
||||||
queryParams.value.agreementId = item.value.agreementId
|
queryParams.value.agreementId = item.value.agreementId
|
||||||
|
if(item.value.status=== 'expired'){
|
||||||
|
queryParams.value.status="0"
|
||||||
|
} else if(item.value.status=== 'about_to_expire'){
|
||||||
|
queryParams.value.status="1"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,9 +128,17 @@ const getRepairDetailsData = async () => {
|
||||||
const onChangeAllChecked = (e) => {
|
const onChangeAllChecked = (e) => {
|
||||||
detailsList.value.forEach((item) => {
|
detailsList.value.forEach((item) => {
|
||||||
if (e.detail.value.length > 0) {
|
if (e.detail.value.length > 0) {
|
||||||
if(Number(item.typeRepairNum)-Number(item.typeRepairedNum)-Number(item.typeScrapNum)==0){
|
const repairNum = Number(item.typeRepairNum) || 0;
|
||||||
|
const repairedNum = Number(item.typeRepairedNum) || 0;
|
||||||
|
const scrapNum = Number(item.typeScrapNum) || 0;
|
||||||
|
// 放大1000倍(支持两位或三位小数都安全)
|
||||||
|
const toInt = n => Math.round(n * 1000);
|
||||||
|
const diff = toInt(repairNum) - toInt(repairedNum) - toInt(scrapNum);
|
||||||
|
if (diff === 0) {
|
||||||
item.isChecked = false
|
item.isChecked = false
|
||||||
}else{
|
}else if (toInt(repairedNum) + toInt(scrapNum)>toInt(repairNum)) {
|
||||||
|
item.isChecked = false
|
||||||
|
} else {
|
||||||
item.isChecked = true
|
item.isChecked = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -189,11 +197,23 @@ const onRepairItem = (item) => {
|
||||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(item)}` })
|
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(item)}` })
|
||||||
}
|
}
|
||||||
if (item.manageType == 1) {// 数量维修
|
if (item.manageType == 1) {// 数量维修
|
||||||
if(Number(item.typeRepairNum)-Number(item.typeRepairedNum)-Number(item.typeScrapNum)==0){
|
const repairNum = Number(item.typeRepairNum) || 0;
|
||||||
|
const repairedNum = Number(item.typeRepairedNum) || 0;
|
||||||
|
const scrapNum = Number(item.typeScrapNum) || 0;
|
||||||
|
// 放大1000倍(支持两位或三位小数都安全)
|
||||||
|
const toInt = n => Math.round(n * 1000);
|
||||||
|
const diff = toInt(repairNum) - toInt(repairedNum) - toInt(scrapNum);
|
||||||
|
|
||||||
|
if (diff===0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '已完成维修',
|
title: '已完成维修',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
|
} else if (toInt(repairedNum) + toInt(scrapNum)>toInt(repairNum)){
|
||||||
|
uni.showToast({
|
||||||
|
title: '数据异常,不可操作',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
}else{
|
}else{
|
||||||
codingUrl = '/pages/repair/repairManage/num-operate'
|
codingUrl = '/pages/repair/repairManage/num-operate'
|
||||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(item)}` })
|
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(item)}` })
|
||||||
|
|
@ -202,6 +222,7 @@ const onRepairItem = (item) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const isSubmit = ref(false)
|
const isSubmit = ref(false)
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue