|
|
|
@ -124,7 +124,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="仓库地址" prop="warehouseAddress"> |
|
|
|
|
<el-form-item label="仓库地址" prop="address"> |
|
|
|
|
<avue-input-map |
|
|
|
|
:params="warehouseAddress" |
|
|
|
|
placeholder="请选择地图" |
|
|
|
@ -457,7 +457,7 @@ const rules = reactive({
|
|
|
|
|
contactNumber: [{ required: true, message: '请输入联系电话', trigger: 'change' }], |
|
|
|
|
addressInfo: [{ required: true, message: '请选择仓库地区', trigger: 'change' }], |
|
|
|
|
department: [{ required: true, message: '请选择所属部门', trigger: 'change' }], |
|
|
|
|
warehouseAddress: [{ required: true, message: '请选择仓库地址', trigger: 'change' }], |
|
|
|
|
address: [{ required: true, message: '请选择仓库地址', trigger: 'change' }], |
|
|
|
|
}); |
|
|
|
|
const Topquery = ref({}); //顶部搜索参数 |
|
|
|
|
const newlyaddload = ref(false); //新增弹窗 |
|
|
|
@ -976,40 +976,49 @@ const newlyaddSubmit = () => {
|
|
|
|
|
let data = { |
|
|
|
|
...Addform.value, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 处理图片 |
|
|
|
|
let imgURl = []; |
|
|
|
|
const isValid = Addform.value.paymentCodeUrl.every(item => { |
|
|
|
|
if (item.url && !item.response) { |
|
|
|
|
// 这里是回显的图片 |
|
|
|
|
imgURl.push(item.url); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
if (item.response?.code === 200 && item.response.data?.link) { |
|
|
|
|
// 这里是最新上传的图片 |
|
|
|
|
imgURl.push(item.response.data.link); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (!isValid) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '图片上传错误,请移除图片重新上传', |
|
|
|
|
type: 'warning', |
|
|
|
|
plain: true, |
|
|
|
|
if (Addform.value.paymentCodeUrl?.length) { |
|
|
|
|
const isValid = Addform.value.paymentCodeUrl.every(item => { |
|
|
|
|
if (item.url && !item.response) { |
|
|
|
|
// 这里是回显的图片 |
|
|
|
|
imgURl.push(item.url); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
if (item.response?.code === 200 && item.response.data?.link) { |
|
|
|
|
// 这里是最新上传的图片 |
|
|
|
|
imgURl.push(item.response.data.link); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isValid) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '图片上传错误,请移除图片重新上传', |
|
|
|
|
type: 'warning', |
|
|
|
|
plain: true, |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
data.paymentCodeUrl = imgURl.join(','); |
|
|
|
|
}else{ |
|
|
|
|
delete data.paymentCodeUrl |
|
|
|
|
} |
|
|
|
|
data.warehouseAddress = Addform.value.address[2]; //地址 |
|
|
|
|
console.log(Addform.value, 'Addform.value'); |
|
|
|
|
data.daterange[0] = dayjs(data.daterange[0]).format('YYYY-MM-DD'); |
|
|
|
|
data.daterange[1] = dayjs(data.daterange[1]).format('YYYY-MM-DD'); |
|
|
|
|
data.paymentCodeUrl = imgURl.join(','); |
|
|
|
|
if (data.daterange?.length) { |
|
|
|
|
data.daterange[0] = dayjs(data.daterange[0]).format('YYYY-MM-DD'); |
|
|
|
|
data.daterange[1] = dayjs(data.daterange[1]).format('YYYY-MM-DD'); |
|
|
|
|
}else{ |
|
|
|
|
delete data.daterange |
|
|
|
|
} |
|
|
|
|
data.administrativeAreas = data.administrativeAreas.join(','); |
|
|
|
|
data.startDate = Addform.value['daterange'][0]; |
|
|
|
|
data.endDate = Addform.value['daterange'][1]; |
|
|
|
|
if (Addform.value.daterange?.length) { |
|
|
|
|
data.startDate = Addform.value['daterange'][0]; |
|
|
|
|
data.endDate = Addform.value['daterange'][1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
data.provinceCode = Addform.value['addressInfo'][0]; //仓库地区-省 |
|
|
|
|
data.cityCode = Addform.value['addressInfo'][1]; //仓库地区-市 |
|
|
|
|
data.code = Addform.value['addressInfo'][2]; //仓库地区-区 |
|
|
|
|