Commit 172d2b29 authored by Damon's avatar Damon

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents 2c9e6edd 38fe6c41
...@@ -245,24 +245,26 @@ ...@@ -245,24 +245,26 @@
this.takeStatus = true this.takeStatus = true
}, },
async closeTake(img) { async closeTake(img) {
const files = img.map(v => v.path) if(img !==undefined){
const value = await this.saveToTask(files) const files = img.map(v => v.path)
console.log("value", value) const value = await this.saveToTask(files)
if(img !==undefined ){
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = [] if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
// step1 添加图片 // 复制一份 用于保存
img.forEach(v => { let saveList = this.currentItemDate.orderImages.concat();
this.currentItemDate.orderImages.push(v.key) value.map(item =>{
// step1 添加缓存图片 到显示
this.currentItemDate.orderImages.push(item.path)
// 文件key添加保存数组中
saveList.push(item.key)
}) })
// step2 保存图片 // step2 保存图片
var data={ var data={
type : this.currentItemDate.type, type : this.currentItemDate.type,
images : Array.from(this.currentItemDate.orderImages), images : Array.from(saveList),
fieldsName:this.currentItemDate.fieldName fieldsName:this.currentItemDate.fieldName
} }
this.$u.api.saveImage(data,this.orderId).then((res) => { this.$u.api.saveImage(data,this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===", res.data)
} else { } else {
console.log("保存图片异常",res.data.message) console.log("保存图片异常",res.data.message)
} }
......
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