|
@@ -33,12 +33,12 @@
|
|
|
</uni-td>
|
|
|
<uni-td align="center" style="width: 200rpx;">
|
|
|
<view style="display: flex;align-items: center;">
|
|
|
- <uni-easyinput v-model.number="item.totalScore" :clearable="false" :disabled="pageData.disabledStatus" type="digit"></uni-easyinput>
|
|
|
+ <uni-easyinput v-model.number="item.totalScore" :clearable="false" :disabled="pageData.disabledStatus" type="digit" @change="changeYz(item)"></uni-easyinput>
|
|
|
<text>{{"(>"+(item.score!=null?item.score:0)+"g)"}}</text>
|
|
|
</view>
|
|
|
</uni-td>
|
|
|
<uni-td align="center">
|
|
|
- <uni-easyinput v-model.number="item.score" :clearable="false" :disabled="pageData.disabledStatus" type="digit"></uni-easyinput>
|
|
|
+ <uni-easyinput v-model.number="item.score" :clearable="false" :disabled="pageData.disabledStatus" type="digit" @change="changeSz(item)"></uni-easyinput>
|
|
|
</uni-td>
|
|
|
<uni-td align="center">
|
|
|
<uni-easyinput v-model.number="item.resultContent" :clearable="false" :disabled="pageData.disabledStatus" type="digit"></uni-easyinput>
|
|
@@ -59,7 +59,7 @@
|
|
|
<uni-section title="图片上传" type="line">
|
|
|
</uni-section>
|
|
|
<view class="image_upload" style="border-top: 0.5px solid #ebedf0;margin-bottom: 3px;">
|
|
|
- <uni-file-picker limit="4" :modelValue="pageData.imageList" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
|
|
|
+ <uni-file-picker limit="4" :modelValue="showImage(pageData.imageList)" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
|
|
|
</view>
|
|
|
</uni-card>
|
|
|
</view>
|
|
@@ -95,7 +95,6 @@ const pageData = reactive({
|
|
|
dpList:[],
|
|
|
// 图片列表
|
|
|
imageList: [],
|
|
|
- imageIdList:[],
|
|
|
// 图片状态
|
|
|
imageStatus:true,
|
|
|
resData:{},
|
|
@@ -121,6 +120,20 @@ const createData=reactive({
|
|
|
providerType:''
|
|
|
})
|
|
|
|
|
|
+// const changeSz=(item)=>{
|
|
|
+// if(item.score!=null && item.totalScore!=null){
|
|
|
+// // 误差率 = (实重 - 应重) / 实重
|
|
|
+// item.resultContent=Math.abs((item.score-item.totalScore)/item.score)
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// const changeYz=(item)=>{
|
|
|
+// if(item.score!=null && item.totalScore!=null){
|
|
|
+// // 误差率 = (实重 - 应重) / 实重
|
|
|
+// item.resultContent=Math.abs((item.score-item.totalScore)/item.score)
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
// 均值 应重
|
|
|
const avgYz=()=>{
|
|
|
let num=0
|
|
@@ -150,7 +163,9 @@ const avgWc=()=>{
|
|
|
|
|
|
// 选中图片,将选中的图片添加列表
|
|
|
const selectImg=(e)=>{
|
|
|
- console.log(e)
|
|
|
+ if(pageData.imageList==null || pageData.imageList == undefined){
|
|
|
+ pageData.imageList=[]
|
|
|
+ }
|
|
|
e.tempFiles.forEach(item=>{
|
|
|
uni.showLoading({
|
|
|
title: '图片上传....',
|
|
@@ -158,13 +173,7 @@ const selectImg=(e)=>{
|
|
|
});
|
|
|
http.upload("oss/upload",{file:item.file}).then(e => {
|
|
|
uni.hideLoading()
|
|
|
- item.id = e.id
|
|
|
- console.log(e.id);
|
|
|
- // pageData.resData.detail.imageIds=[]
|
|
|
- // pageData.imageIdList.push(e.id)
|
|
|
- pageData.imageIdList=pageData.imageIdList+','+e.id
|
|
|
- pageData.resData.detail.imageIds=pageData.imageIdList.toString()
|
|
|
- pageData.imageList.push(item)
|
|
|
+ pageData.imageList.push(e.id)
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -172,24 +181,22 @@ const selectImg=(e)=>{
|
|
|
// 删除图片,并将其从列表中删除
|
|
|
const deleteImg=(e)=>{
|
|
|
let index=0
|
|
|
- let deleteImgId = e.tempFilePath.split("=")[1].split("&")[0]
|
|
|
- index = pageData.imageList.indexOf(deleteImgId)
|
|
|
- pageData.imageList.splice(index,1)
|
|
|
- if(typeof(pageData.imageIdList)==Array){
|
|
|
- pageData.imageIdList.splice(index,1)
|
|
|
- pageData.resData.detail.imageIds=pageData.imageIdList.toString()
|
|
|
- }else{
|
|
|
- let list = pageData.imageIdList.split(",")
|
|
|
- list.splice(index,1)
|
|
|
- pageData.resData.detail.imageIds=list.toString()
|
|
|
- }
|
|
|
+ pageData.imageList.forEach((item,idx)=>{
|
|
|
+ index=e.tempFilePath.indexOf(item)
|
|
|
+ if(index>0){
|
|
|
+ // 删除列表中的元素
|
|
|
+ pageData.imageList.splice(idx,1)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const countResultContent=()=>{
|
|
|
- console.log(pageData.resData);
|
|
|
pageData.resData.resultContent=0
|
|
|
pageData.resData.resultContent=avgWc()
|
|
|
pageData.resData.detail.reciper=data.reciper
|
|
|
+ if(pageData.imageList!=null || pageData.imageList!=undefined){
|
|
|
+ pageData.resData.detail.imageIds=pageData.imageList.toString()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 下一个
|
|
@@ -324,24 +331,28 @@ const getDpTaskDetail=()=>{
|
|
|
pageData.taskStatus=res.detail.status
|
|
|
data.reciper=res.detail.reciper
|
|
|
if(res.detail.imageIds!=null && res.detail.imageIds!=''){
|
|
|
- pageData.imageIdList=res.detail.imageIds
|
|
|
- pageData.imageList = uploadImageModelValue(res.detail.imageIds)
|
|
|
+ if(typeof(res.detail.imageIds)=='string'){
|
|
|
+ var urls=res.detail.imageIds.split(',')
|
|
|
+ pageData.imageList=[]
|
|
|
+ urls.forEach(e=>{
|
|
|
+ pageData.imageList.push(e)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-onShow(()=>{
|
|
|
- if(pageData.operatorStatus=='add'){
|
|
|
- pageData.imageStatus=false
|
|
|
- pageData.disabledStatus=false
|
|
|
- createTask()
|
|
|
- }else{
|
|
|
- pageData.imageStatus=true
|
|
|
- pageData.disabledStatus=true
|
|
|
- getDpTaskDetail()
|
|
|
- }
|
|
|
-
|
|
|
-})
|
|
|
+// onShow(()=>{
|
|
|
+// if(pageData.operatorStatus=='add'){
|
|
|
+// pageData.imageStatus=false
|
|
|
+// pageData.disabledStatus=false
|
|
|
+// createTask()
|
|
|
+// }else{
|
|
|
+// pageData.imageStatus=true
|
|
|
+// pageData.disabledStatus=true
|
|
|
+// getDpTaskDetail()
|
|
|
+// }
|
|
|
+// })
|
|
|
|
|
|
onLoad((type)=>{
|
|
|
console.log(type)
|
|
@@ -364,6 +375,16 @@ onLoad((type)=>{
|
|
|
if(type.taskStatus!=null){
|
|
|
pageData.taskStatusData=type.taskStatus
|
|
|
}
|
|
|
+ // 获取代配数据
|
|
|
+ if(pageData.operatorStatus=='add'){
|
|
|
+ pageData.imageStatus=false
|
|
|
+ pageData.disabledStatus=false
|
|
|
+ createTask()
|
|
|
+ }else{
|
|
|
+ pageData.imageStatus=true
|
|
|
+ pageData.disabledStatus=true
|
|
|
+ getDpTaskDetail()
|
|
|
+ }
|
|
|
})
|
|
|
</script>
|
|
|
|