|
@@ -1202,97 +1202,101 @@ const props = defineProps({
|
|
});
|
|
});
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
formOption.disabled = judgeStatus();
|
|
formOption.disabled = judgeStatus();
|
|
- if (route.query && route.query.priceSheetId) {
|
|
|
|
- proxy
|
|
|
|
- .post("/saleQuotation/detail", { id: route.query.priceSheetId })
|
|
|
|
- .then((res) => {
|
|
|
|
- res.countryId = res.buyCountryId;
|
|
|
|
- res.provinceId = res.buyProvinceId;
|
|
|
|
- res.cityId = res.buyCityId;
|
|
|
|
- for (var text in res) {
|
|
|
|
- formData.data[text] = res[text];
|
|
|
|
- }
|
|
|
|
- if (formData.data.ehsdJson) {
|
|
|
|
- let ehsdJson = JSON.parse(formData.data.ehsdJson);
|
|
|
|
- if (ehsdJson.deliveryTime) {
|
|
|
|
- formData.data.deliveryTime = ehsdJson.deliveryTime;
|
|
|
|
- }
|
|
|
|
|
|
+ if (
|
|
|
|
+ (route.query && route.query.priceSheetId) ||
|
|
|
|
+ (route.query && route.query.businessId)
|
|
|
|
+ ) {
|
|
|
|
+ let businessId = route.query.priceSheetId
|
|
|
|
+ ? route.query.priceSheetId
|
|
|
|
+ : route.query.businessId;
|
|
|
|
+ proxy.post("/saleQuotation/detail", { id: businessId }).then((res) => {
|
|
|
|
+ res.countryId = res.buyCountryId;
|
|
|
|
+ res.provinceId = res.buyProvinceId;
|
|
|
|
+ res.cityId = res.buyCityId;
|
|
|
|
+ for (var text in res) {
|
|
|
|
+ formData.data[text] = res[text];
|
|
|
|
+ }
|
|
|
|
+ if (formData.data.ehsdJson) {
|
|
|
|
+ let ehsdJson = JSON.parse(formData.data.ehsdJson);
|
|
|
|
+ if (ehsdJson.deliveryTime) {
|
|
|
|
+ formData.data.deliveryTime = ehsdJson.deliveryTime;
|
|
}
|
|
}
|
|
- if (
|
|
|
|
- formData.data.quotationProductList &&
|
|
|
|
- formData.data.quotationProductList.length > 0
|
|
|
|
- ) {
|
|
|
|
- for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
|
- if (formData.data.quotationProductList[i].ehsdJson) {
|
|
|
|
- let ehsdJsonProduct = JSON.parse(
|
|
|
|
- formData.data.quotationProductList[i].ehsdJson
|
|
|
|
- );
|
|
|
|
- if (ehsdJsonProduct.packMethod) {
|
|
|
|
- formData.data.quotationProductList[i].packMethod =
|
|
|
|
- ehsdJsonProduct.packMethod;
|
|
|
|
- }
|
|
|
|
- if (ehsdJsonProduct.tradeMethods) {
|
|
|
|
- formData.data.quotationProductList[i].tradeMethods =
|
|
|
|
- ehsdJsonProduct.tradeMethods;
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ formData.data.quotationProductList &&
|
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
|
+ if (formData.data.quotationProductList[i].ehsdJson) {
|
|
|
|
+ let ehsdJsonProduct = JSON.parse(
|
|
|
|
+ formData.data.quotationProductList[i].ehsdJson
|
|
|
|
+ );
|
|
|
|
+ if (ehsdJsonProduct.packMethod) {
|
|
|
|
+ formData.data.quotationProductList[i].packMethod =
|
|
|
|
+ ehsdJsonProduct.packMethod;
|
|
|
|
+ }
|
|
|
|
+ if (ehsdJsonProduct.tradeMethods) {
|
|
|
|
+ formData.data.quotationProductList[i].tradeMethods =
|
|
|
|
+ ehsdJsonProduct.tradeMethods;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- let fileIds = formData.data.quotationProductList.map(
|
|
|
|
- (item) => item.productId
|
|
|
|
- );
|
|
|
|
- proxy
|
|
|
|
- .post("/fileInfo/getList", { businessIdList: fileIds })
|
|
|
|
- .then((resFile) => {
|
|
|
|
- for (
|
|
|
|
- let i = 0;
|
|
|
|
- i < formData.data.quotationProductList.length;
|
|
|
|
- i++
|
|
|
|
|
|
+ }
|
|
|
|
+ let fileIds = formData.data.quotationProductList.map(
|
|
|
|
+ (item) => item.productId
|
|
|
|
+ );
|
|
|
|
+ proxy
|
|
|
|
+ .post("/fileInfo/getList", { businessIdList: fileIds })
|
|
|
|
+ .then((resFile) => {
|
|
|
|
+ for (
|
|
|
|
+ let i = 0;
|
|
|
|
+ i < formData.data.quotationProductList.length;
|
|
|
|
+ i++
|
|
|
|
+ ) {
|
|
|
|
+ if (
|
|
|
|
+ resFile[formData.data.quotationProductList[i].productId] &&
|
|
|
|
+ resFile[formData.data.quotationProductList[i].productId]
|
|
|
|
+ .length > 0
|
|
) {
|
|
) {
|
|
- if (
|
|
|
|
- resFile[formData.data.quotationProductList[i].productId] &&
|
|
|
|
- resFile[formData.data.quotationProductList[i].productId]
|
|
|
|
- .length > 0
|
|
|
|
- ) {
|
|
|
|
- formData.data.quotationProductList[i].fileUrl =
|
|
|
|
- resFile[
|
|
|
|
- formData.data.quotationProductList[i].productId
|
|
|
|
- ][0].fileUrl;
|
|
|
|
- }
|
|
|
|
|
|
+ formData.data.quotationProductList[i].fileUrl =
|
|
|
|
+ resFile[
|
|
|
|
+ formData.data.quotationProductList[i].productId
|
|
|
|
+ ][0].fileUrl;
|
|
}
|
|
}
|
|
- });
|
|
|
|
- }
|
|
|
|
- delete formData.data.id;
|
|
|
|
- delete formData.data.code;
|
|
|
|
- getCityData(formData.data.countryId, "20");
|
|
|
|
- if (formData.data.provinceId) {
|
|
|
|
- getCityData(formData.data.provinceId, "30");
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- formData.data.quotationProductList &&
|
|
|
|
- formData.data.quotationProductList.length > 0
|
|
|
|
- ) {
|
|
|
|
- formData.data.quotationProductList =
|
|
|
|
- formData.data.quotationProductList.map((item) => {
|
|
|
|
- delete item.id;
|
|
|
|
- return {
|
|
|
|
- ...item,
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- formData.data.quotationPayList &&
|
|
|
|
- formData.data.quotationPayList.length > 0
|
|
|
|
- ) {
|
|
|
|
- formData.data.quotationPayList = formData.data.quotationPayList.map(
|
|
|
|
- (item) => {
|
|
|
|
- delete item.id;
|
|
|
|
- return {
|
|
|
|
- ...item,
|
|
|
|
- };
|
|
|
|
}
|
|
}
|
|
- );
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ delete formData.data.id;
|
|
|
|
+ delete formData.data.code;
|
|
|
|
+ getCityData(formData.data.countryId, "20");
|
|
|
|
+ if (formData.data.provinceId) {
|
|
|
|
+ getCityData(formData.data.provinceId, "30");
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ formData.data.quotationProductList &&
|
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ formData.data.quotationProductList =
|
|
|
|
+ formData.data.quotationProductList.map((item) => {
|
|
|
|
+ delete item.id;
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ formData.data.quotationPayList &&
|
|
|
|
+ formData.data.quotationPayList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ formData.data.quotationPayList = formData.data.quotationPayList.map(
|
|
|
|
+ (item) => {
|
|
|
|
+ delete item.id;
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const clickCustomerProduct = () => {
|
|
const clickCustomerProduct = () => {
|