|
|
@ -644,7 +644,7 @@ export default { |
|
|
|
this.form = { |
|
|
|
this.form = { |
|
|
|
..._data, |
|
|
|
..._data, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
this.form.jobType= this.form.jobTypeString |
|
|
|
this.form.bindVehicles = _data.bindVehicles && _data.bindVehicles.split(','); |
|
|
|
this.form.bindVehicles = _data.bindVehicles && _data.bindVehicles.split(','); |
|
|
|
this.form.warehouseIds = _data.warehouses.map(val => val.warehouseId); |
|
|
|
this.form.warehouseIds = _data.warehouses.map(val => val.warehouseId); |
|
|
|
console.log('_data :>> ', _data); |
|
|
|
console.log('_data :>> ', _data); |
|
|
@ -657,6 +657,7 @@ export default { |
|
|
|
const submitData = { ...this.form }; |
|
|
|
const submitData = { ...this.form }; |
|
|
|
submitData.bindVehicles = this.form.bindVehicles && this.form.bindVehicles.join(','); |
|
|
|
submitData.bindVehicles = this.form.bindVehicles && this.form.bindVehicles.join(','); |
|
|
|
submitData.phone = this.form.phone.trim(); |
|
|
|
submitData.phone = this.form.phone.trim(); |
|
|
|
|
|
|
|
submitData.jobType = submitData.jobType.join(',') |
|
|
|
|
|
|
|
|
|
|
|
const res = await add(submitData); |
|
|
|
const res = await add(submitData); |
|
|
|
const { code, msg } = res.data; |
|
|
|
const { code, msg } = res.data; |
|
|
@ -670,6 +671,7 @@ export default { |
|
|
|
type: 'warning', |
|
|
|
type: 'warning', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
|
|
|
|
submitData.jobType=[] |
|
|
|
this.$refs.formRef.resetFields(); |
|
|
|
this.$refs.formRef.resetFields(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => this.back()); |
|
|
|
.catch(() => this.back()); |
|
|
@ -687,7 +689,7 @@ export default { |
|
|
|
const submitData = { ...this.form }; |
|
|
|
const submitData = { ...this.form }; |
|
|
|
submitData.bindVehicles = this.form.bindVehicles && this.form.bindVehicles.join(','); |
|
|
|
submitData.bindVehicles = this.form.bindVehicles && this.form.bindVehicles.join(','); |
|
|
|
submitData.phone = this.form.phone.trim(); |
|
|
|
submitData.phone = this.form.phone.trim(); |
|
|
|
|
|
|
|
submitData.jobType = submitData.jobType.join(',') |
|
|
|
const res = await update(submitData); |
|
|
|
const res = await update(submitData); |
|
|
|
const { code, msg } = res.data; |
|
|
|
const { code, msg } = res.data; |
|
|
|
if (code !== 200) return; |
|
|
|
if (code !== 200) return; |
|
|
|