|
@@ -44,7 +44,7 @@ const props = defineProps({
|
|
|
});
|
|
|
const proxy = getCurrentInstance().proxy;
|
|
|
const route = useRoute();
|
|
|
-const active = ref(4);
|
|
|
+const active = ref(0);
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
contractType: "1",
|
|
@@ -92,6 +92,47 @@ const formConfig = reactive([
|
|
|
value: "value",
|
|
|
},
|
|
|
data: [],
|
|
|
+ changeFn: (val, data) => {
|
|
|
+ proxy.formChange(val, data, formData);
|
|
|
+ formData.data.sellCorporationId = "";
|
|
|
+ formData.data.sellCountryName = "";
|
|
|
+ formData.data.sellProvinceName = "";
|
|
|
+ formData.data.sellCityName = "";
|
|
|
+ formData.data.sellAddress = "";
|
|
|
+ formData.data.sellContactName = "";
|
|
|
+ formData.data.sellContactNumber = "";
|
|
|
+ if (val.selectedValues[0]) {
|
|
|
+ proxy.post("/contractTemplate/detail", { id: val.selectedValues[0] }).then((res) => {
|
|
|
+ formData.data.sellCorporationId = res.data.corporationId;
|
|
|
+ if (res.data.corporationId) {
|
|
|
+ proxy.post("/corporation/detail", { id: res.data.corporationId }).then((detailCorporation) => {
|
|
|
+ let sellCity = "";
|
|
|
+ if (detailCorporation.data.countryEnStr) {
|
|
|
+ formData.data.sellCountryName = detailCorporation.data.countryEnStr;
|
|
|
+ sellCity = detailCorporation.data.countryEnStr;
|
|
|
+ }
|
|
|
+ if (detailCorporation.data.provinceEnStr) {
|
|
|
+ formData.data.sellProvinceName = detailCorporation.data.provinceEnStr;
|
|
|
+ sellCity = sellCity + " " + detailCorporation.data.provinceEnStr;
|
|
|
+ }
|
|
|
+ if (detailCorporation.data.cityEnStr) {
|
|
|
+ formData.data.sellCityName = detailCorporation.data.cityEnStr;
|
|
|
+ sellCity = sellCity + " " + detailCorporation.data.cityEnStr;
|
|
|
+ }
|
|
|
+ if (detailCorporation.data.addressEn) {
|
|
|
+ formData.data.sellAddress = detailCorporation.data.addressEn;
|
|
|
+ }
|
|
|
+ formData.data.sellCity = sellCity;
|
|
|
+ formDom1.value.formDataShowLabelOne();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ formData.data.sellContactName = res.data.contactName;
|
|
|
+ formData.data.sellContactNumber = res.data.contactNumber;
|
|
|
+ formDom1.value.formDataShowLabelOne();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ data.showPicker = false;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
type: "title",
|
|
@@ -108,13 +149,14 @@ const formConfig = reactive([
|
|
|
value: "value",
|
|
|
},
|
|
|
data: [],
|
|
|
+ readonly: true,
|
|
|
},
|
|
|
{
|
|
|
- type: "cascader",
|
|
|
+ type: "input",
|
|
|
label: proxy.t("contract.cityText"),
|
|
|
prop: "sellCity",
|
|
|
- itemType: "city",
|
|
|
- showPicker: false,
|
|
|
+ itemType: "text",
|
|
|
+ readonly: true,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
@@ -149,11 +191,61 @@ const formConfig = reactive([
|
|
|
value: "value",
|
|
|
},
|
|
|
data: [],
|
|
|
+ changeFn: (val, data) => {
|
|
|
+ proxy.formChange(val, data, formData);
|
|
|
+ formData.data.buyContactName = "";
|
|
|
+ formData.data.buyContactNumber = "";
|
|
|
+ if (val.selectedValues[0]) {
|
|
|
+ proxy.post("/customer/detail", { id: val.selectedValues[0] }).then((res) => {
|
|
|
+ if (res.data.customerUserList && res.data.customerUserList.length > 0) {
|
|
|
+ formData.data.buyContactName = res.data.customerUserList[0].name;
|
|
|
+ if (res.data.customerUserList[0].contactJson) {
|
|
|
+ let contactJson = JSON.parse(res.data.customerUserList[0].contactJson);
|
|
|
+ if (contactJson && contactJson.length > 0) {
|
|
|
+ formData.data.buyContactNumber = contactJson[0].contactNo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let cityName = "";
|
|
|
+ if (res.data.countryName) {
|
|
|
+ cityName = res.data.countryName;
|
|
|
+ if (res.data.provinceName) {
|
|
|
+ cityName = cityName + " " + res.data.provinceName;
|
|
|
+ if (res.data.cityName) {
|
|
|
+ cityName = cityName + " " + res.data.cityName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.cityName = cityName;
|
|
|
+ if (res.data.cityId) {
|
|
|
+ formData.data.city = res.data.cityId;
|
|
|
+ } else if (res.data.provinceId) {
|
|
|
+ formData.data.city = res.data.provinceId;
|
|
|
+ } else if (res.data.countryId) {
|
|
|
+ formData.data.city = res.data.countryId;
|
|
|
+ } else {
|
|
|
+ formData.data.city = "";
|
|
|
+ }
|
|
|
+ formData.data.countryId = res.data.countryId;
|
|
|
+ formData.data.provinceId = res.data.provinceId;
|
|
|
+ formData.data.cityId = res.data.cityId;
|
|
|
+ formData.data.buyPostalCode = res.data.zipCode;
|
|
|
+ formData.data.buyAddress = res.data.address;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.countryId = "";
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.buyPostalCode = "";
|
|
|
+ formData.data.buyAddress = "";
|
|
|
+ }
|
|
|
+ data.showPicker = false;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
type: "cascader",
|
|
|
label: proxy.t("contract.cityText"),
|
|
|
- prop: "buyCity",
|
|
|
+ prop: "city",
|
|
|
itemType: "city",
|
|
|
showPicker: false,
|
|
|
},
|
|
@@ -207,6 +299,10 @@ const formGoodsOption = reactive({
|
|
|
value: "value",
|
|
|
},
|
|
|
data: [],
|
|
|
+ changeFn: (val, data, index, indexTwo, propName) => {
|
|
|
+ proxy.formChangeTwo(val, data, index, indexTwo, propName, formData);
|
|
|
+ data.showPicker = false;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
@@ -528,7 +624,7 @@ const rules = {
|
|
|
sellCorporationId: [{ required: true, message: proxy.t("contract.sellCorporationIdMsg") }],
|
|
|
buyCorporationId: [{ required: true, message: proxy.t("contract.buyCorporationIdMsg") }],
|
|
|
sellCity: [{ required: true, message: proxy.t("contract.cityMsg") }],
|
|
|
- buyCity: [{ required: true, message: proxy.t("contract.cityMsg") }],
|
|
|
+ city: [{ required: true, message: proxy.t("contract.cityMsg") }],
|
|
|
sellAddress: [{ required: true, message: proxy.t("contract.addressMsg") }],
|
|
|
buyAddress: [{ required: true, message: proxy.t("contract.addressMsg") }],
|
|
|
sellContactName: [{ required: true, message: proxy.t("contract.contactNameMsg") }],
|
|
@@ -712,7 +808,8 @@ const handleChangeAmount = () => {
|
|
|
formData.data.amountProject = amountProject;
|
|
|
};
|
|
|
const handleSubmit = async () => {
|
|
|
- return formData.data;
|
|
|
+ console.log(formDom1.value.testForm.submit());
|
|
|
+ // return formData.data;
|
|
|
};
|
|
|
watch(
|
|
|
props.queryData,
|