|
|
@ -17,10 +17,9 @@ |
|
|
|
<el-form-item prop="vin" label="车架号:"> |
|
|
|
<el-input |
|
|
|
v-model="temp.vin" |
|
|
|
:disabled="temp.orderType == '01'" |
|
|
|
placeholder="请输入车架号" |
|
|
|
class="addinputw" |
|
|
|
readonly |
|
|
|
:readonly="temp.purchaseKey !== '01'" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -41,6 +40,7 @@ |
|
|
|
<el-input |
|
|
|
v-model="temp.config" |
|
|
|
type="textarea" |
|
|
|
autosize |
|
|
|
placeholder="请输入配置" |
|
|
|
class="addinputw" |
|
|
|
readonly/> |
|
|
@ -121,13 +121,16 @@ export default { |
|
|
|
vin: '', |
|
|
|
config: '', |
|
|
|
model: '', |
|
|
|
inspectedSid:'' |
|
|
|
inspectedSid: '' |
|
|
|
}, // 添加和修改 |
|
|
|
dialogFormVisible: false, // 添加修改对话框状态 |
|
|
|
dialogFormShowVisible: false, // 查看对话框默认关闭状态 |
|
|
|
dialogStatus: '', // 对话框状态 |
|
|
|
vehiclePhoto: [], |
|
|
|
rules: {} |
|
|
|
rules: { |
|
|
|
vin: [{ required: true, message: '车架号不能为空', trigger: 'blur' }], // 车架号 |
|
|
|
price: [{ required: true, message: '洗车费不能为空', trigger: 'blur' }] // 洗车费 |
|
|
|
} |
|
|
|
// ------------------------------------ |
|
|
|
} |
|
|
|
}, |
|
|
@ -144,10 +147,32 @@ export default { |
|
|
|
} |
|
|
|
getCarInspectedInfo(data).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.temp = res.data |
|
|
|
this.temp.vin = res.data.vin |
|
|
|
this.temp.config = res.data.config |
|
|
|
this.temp.model = res.data.model |
|
|
|
this.temp.inspectedSid = res.data.inspectedSid |
|
|
|
this.temp.purchaseKey = res.data.purchaseKey |
|
|
|
if (this.temp.carInspectedImage.length > 0) { |
|
|
|
for (var i = 0; i < this.temp.carInspectedImage.length; i++) { |
|
|
|
const imgName = this.temp.carInspectedImage[i].split('/') |
|
|
|
this.imgList01.push({ |
|
|
|
name: imgName[imgName.length - 1], |
|
|
|
url: this.temp.carInspectedImage[i] |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log('imgList01', this.imgList01) |
|
|
|
} |
|
|
|
if (this.temp.factoryImage.length > 0) { |
|
|
|
for (var i = 0; i < this.temp.factoryImage.length; i++) { |
|
|
|
const imgName = this.temp.factoryImage[i].split('/') |
|
|
|
this.imgList02.push({ |
|
|
|
name: imgName[imgName.length - 1], |
|
|
|
url: this.temp.factoryImage[i] |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log('imgList02', this.imgList02) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -200,16 +225,20 @@ export default { |
|
|
|
getUrl() { |
|
|
|
if (this.imgList01.length > 0) { |
|
|
|
console.log('imgList01', this.imgList01) |
|
|
|
const img01_list = [] |
|
|
|
for (var i = 0; i < this.imgList01.length; i++) { |
|
|
|
this.temp.carInspectedImage.push(this.imgList01[i].url) |
|
|
|
img01_list.push(this.imgList01[i].url) |
|
|
|
this.temp.carInspectedImage = img01_list |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.temp.carInspectedImage = [] |
|
|
|
} |
|
|
|
if (this.imgList02.length > 0) { |
|
|
|
console.log('imgList02', this.imgList02) |
|
|
|
const img02_list = [] |
|
|
|
for (var i = 0; i < this.imgList02.length; i++) { |
|
|
|
this.temp.factoryImage.push(this.imgList02[i].url) |
|
|
|
img02_list.push(this.imgList02[i].url) |
|
|
|
this.temp.factoryImage = img02_list |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.temp.factoryImage = [] |
|
|
@ -227,8 +256,10 @@ export default { |
|
|
|
vin: '', |
|
|
|
config: '', |
|
|
|
model: '', |
|
|
|
inspectedSid:'' |
|
|
|
inspectedSid: '' |
|
|
|
} |
|
|
|
this.imgList01 = [] |
|
|
|
this.imgList02 = [] |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
// 提交添加数据 |
|
|
@ -237,6 +268,22 @@ export default { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true |
|
|
|
if (this.temp.carInspectedImage.length == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请上传验车相关照片!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.temp.factoryImage.length == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请上传厂家验车单照片!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
// 只需添加和修改 |
|
|
|
saveCarInspectedInfo(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
@ -244,22 +291,39 @@ export default { |
|
|
|
this.dialogFormVisible = false |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '添加失败!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handlePass() { |
|
|
|
this.getUrl() |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
submitCarInspectedInfo(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (this.temp.carInspectedImage.length == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请上传验车相关照片!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
console.log('照片02',this.temp.factoryImage) |
|
|
|
if (this.temp.factoryImage.length == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请上传厂家验车单照片!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
if (response.code === '200') { |
|
|
|
this.dialogFormVisible = false |
|
|
|
this.handleReturn('true') |
|
|
|