Commit 41f1f5a8 authored by Damon's avatar Damon

perf: 完工项数据处理优化

parent 781230d0
...@@ -28,13 +28,8 @@ ...@@ -28,13 +28,8 @@
</view> </view>
</view> </view>
<slot></slot> <slot></slot>
<!-- <view class="img-list">
<u-image class="pic" width="160rpx" height="160rpx" :border-radius="10" @click="selectUpload" :src="uploadImage"></u-image>
</view> -->
</view> </view>
<!-- <u-action-sheet :list="list" v-model="maskShow" :cancel-btn="true" @click="uploadSelect"></u-action-sheet> -->
</view> </view>
<!-- <take-photo v-if="takeStatus" @close="closeTake" :upload="false" :currentItem="currentItemDate"></take-photo> -->
</view> </view>
</template> </template>
...@@ -98,7 +93,6 @@ export default { ...@@ -98,7 +93,6 @@ export default {
.map((img) => { .map((img) => {
return { src: img ? img : '' } return { src: img ? img : '' }
}) })
this.setValue()
} }
}, },
methods: { methods: {
...@@ -120,102 +114,7 @@ export default { ...@@ -120,102 +114,7 @@ export default {
delFile(index) { delFile(index) {
this.imgList.splice(index, 1) this.imgList.splice(index, 1)
this.setValue() this.setValue()
},
/*
selectUpload(){
if (this.imgList.length === 10) {
return this.$refs.uToast.show({
title: '图片已超出最大数量',
type: 'error',
})
}
// 弹窗展示
this.maskShow = true
},
uploadSelect(index) {
if (index === 0) {
this.uploadFile('photo')
} else {
this.uploadFile()
}
},
async uploadFile(type){
const self = this
if(type&&type==='photo'){
// 直接打开相册
let options = {
sourceType:['album'],//['album', 'camera']
count: 3,
sizeType: ['compressed']
}
const value = await this.chooseImg(options)
self.setTmpValue(value)
//await this.chooseImage('qiniu',config)
//self.setValue()
return
}
// 使用拍照工具拍摄
this.photograph()
this.getWatermark()
},
closeTake(val) {
if(val && val.length > 0){
// val.forEach(item=>{
// this.imgList.push(item)
// })
// const files = val.map(v => {
// return { path: v.path }
// })
const files = val.map(v => v.path)
this.uploadTakeImg(files)
// this.setValue()
} }
this.takeStatus = false
},
async uploadTakeImg(files) {
const value = await this.saveToTask(files)
this.setTmpValue(value)
// const options = {
// files:files, // 必填 临时文件路径 格式: [{path: "图片地址"}]
// load: false, //(默认 true 说明:本接口是否提示加载动画)
// maxSize: 300000, //(默认 无 说明:上传的文件最大字节数限制,默认不限制)
// onEachUpdate: res => {
// const value = [uploader.qiniuTokenObj.visitPrefix + res.url]
// this.valueChange(value)
// },
// Update: res => {
// }
// }
// uploader.qnFileUpload(options)
},
photograph(){// 获取拍照规范接口
let self = this
let param = {"partnerCompanyId":self.partnerCompanyId,
"categoryId":self.categoryId,
"brandId":self.brandId,
"fieldName":self.item.fieldsName}
this.$u.api.orderStandardItem(param).then((res)=>{
if (res.code == 200 && res.data.length>0) {
self.currentItemDate = res.data[0]
}else{
console.log("获取完工项的拍照标准异常",res.data.message)
}
self.takeStatus = true
})
},
getWatermark(){
if(getApp().globalData.photo.waterSetting){
return
}
var data={partnerCompanyId:this.partnerCompanyId}
this.$u.api.getWatermark(data).then((res) => {
if (res.code == 200) {
getApp().globalData.photo.waterSetting = res.data
} else {
console.log("获取水印备注异常",res.data.message)
}
});
}*/
}, },
} }
</script> </script>
...@@ -263,17 +162,4 @@ export default { ...@@ -263,17 +162,4 @@ export default {
transform: rotate(90deg); transform: rotate(90deg);
} }
} }
// .list {
// display: flex;
// .txt {
// color: #666;
// padding: 10rpx;
// &.active {
// background-color: red;
// color: #fff;
// }
// }
// }
</style> </style>
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
style="height: 100%" style="height: 100%"
scroll-y scroll-y
scroll-with-animation scroll-with-animation
scroll-anchoring
class="right-box" class="right-box"
@scroll="rightScroll" @scroll="rightScroll"
:scroll-into-view="itemId" :scroll-into-view="itemId"
...@@ -337,7 +338,6 @@ import XhLabel from '@/components/createCom/XhLabel' ...@@ -337,7 +338,6 @@ import XhLabel from '@/components/createCom/XhLabel'
import XhParts from '@/components/createCom/XhParts' import XhParts from '@/components/createCom/XhParts'
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index' import baseFile from '@/components/upload/index'
import Detail from '@/components/order/detail.vue'
// 表单类型map // 表单类型map
const formType = new Map([ const formType = new Map([
...@@ -467,9 +467,7 @@ export default { ...@@ -467,9 +467,7 @@ export default {
arr: [], arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器 timer: null, // 定时器
form: { form: {},
// 一维表单
},
submitBtnStatus: false, submitBtnStatus: false,
completeCheck: { completeCheck: {
status: false, status: false,
...@@ -516,7 +514,6 @@ export default { ...@@ -516,7 +514,6 @@ export default {
XhServiceMore, XhServiceMore,
XhLabel, XhLabel,
XhParts, XhParts,
Detail,
'take-photo': takePhoto, 'take-photo': takePhoto,
}, },
mixins: [baseFile], mixins: [baseFile],
...@@ -629,8 +626,9 @@ export default { ...@@ -629,8 +626,9 @@ export default {
}, },
initData(res) { initData(res) {
this.form = res.data.value || {} this.form = res.data.value || {}
this.initFormData() this.loadOrderDetail()
const list = res.data.config.sort((a, b) => a.order - b.order) const data = Object.create(res.data.config, {})
const list = data.sort((a, b) => a.order - b.order)
if (this.readOnly) this.tabIndex = 0 if (this.readOnly) this.tabIndex = 0
list.forEach((item, index) => { list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName && !this.readOnly) { if (this.maintainStep === item.panelFieldsName && !this.readOnly) {
...@@ -679,13 +677,10 @@ export default { ...@@ -679,13 +677,10 @@ export default {
} }
this.checkCompleteError(list) this.checkCompleteError(list)
} else { } else {
this.list = list this.list = Object.freeze(list)
} }
uni.hideLoading() uni.hideLoading()
}, },
initFormData() {
this.loadOrderDetail()
},
loadOrderDetail() { loadOrderDetail() {
if ( if (
!this.$u.test.isEmpty(this.form) && !this.$u.test.isEmpty(this.form) &&
...@@ -754,7 +749,7 @@ export default { ...@@ -754,7 +749,7 @@ export default {
panelName: '异常处理', panelName: '异常处理',
items: result, items: result,
} }
this.list = list this.list = Object.freeze(list)
this.tabIndex = index this.tabIndex = index
}, },
...@@ -1327,7 +1322,7 @@ export default { ...@@ -1327,7 +1322,7 @@ export default {
return return
} }
} }
}, 10) }, 100)
}, },
handleTouchstart() { handleTouchstart() {
// 防止输入光标滚动出现错乱 // 防止输入光标滚动出现错乱
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment