|
@@ -33,7 +33,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch, reactive } from "vue";
|
|
|
+import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch, reactive, toRefs } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import testForm from "@/components/testForm/index.vue";
|
|
|
import { getUserInfo } from "@/utils/auth";
|
|
@@ -41,8 +41,9 @@ import { showFailToast } from "vant";
|
|
|
|
|
|
// 接收父组件的传值
|
|
|
const props = defineProps({
|
|
|
- queryData: String,
|
|
|
+ queryData: Object,
|
|
|
});
|
|
|
+const refProps = toRefs(props);
|
|
|
const proxy = getCurrentInstance().proxy;
|
|
|
const route = useRoute();
|
|
|
const active = ref(0);
|
|
@@ -207,25 +208,25 @@ const formConfig = reactive([
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let cityName = "";
|
|
|
+ let countryCityName = "";
|
|
|
if (res.data.countryName) {
|
|
|
- cityName = res.data.countryName;
|
|
|
+ countryCityName = res.data.countryName;
|
|
|
if (res.data.provinceName) {
|
|
|
- cityName = cityName + " " + res.data.provinceName;
|
|
|
+ countryCityName = countryCityName + " " + res.data.provinceName;
|
|
|
if (res.data.cityName) {
|
|
|
- cityName = cityName + " " + res.data.cityName;
|
|
|
+ countryCityName = countryCityName + " " + res.data.cityName;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- formData.data.cityName = cityName;
|
|
|
+ formData.data.countryCityName = countryCityName;
|
|
|
if (res.data.cityId) {
|
|
|
- formData.data.city = res.data.cityId;
|
|
|
+ formData.data.countryCity = res.data.cityId;
|
|
|
} else if (res.data.provinceId) {
|
|
|
- formData.data.city = res.data.provinceId;
|
|
|
+ formData.data.countryCity = res.data.provinceId;
|
|
|
} else if (res.data.countryId) {
|
|
|
- formData.data.city = res.data.countryId;
|
|
|
+ formData.data.countryCity = res.data.countryId;
|
|
|
} else {
|
|
|
- formData.data.city = "";
|
|
|
+ formData.data.countryCity = "";
|
|
|
}
|
|
|
formData.data.countryId = res.data.countryId;
|
|
|
formData.data.provinceId = res.data.provinceId;
|
|
@@ -246,7 +247,7 @@ const formConfig = reactive([
|
|
|
{
|
|
|
type: "cascader",
|
|
|
label: proxy.t("contract.cityText"),
|
|
|
- prop: "city",
|
|
|
+ prop: "countryCity",
|
|
|
itemType: "city",
|
|
|
showPicker: false,
|
|
|
},
|
|
@@ -653,12 +654,12 @@ 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") }],
|
|
|
- city: [{ required: true, message: proxy.t("contract.cityMsg") }],
|
|
|
+ countryCity: [{ 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") }],
|
|
|
sellContactNumber: [{ required: true, message: proxy.t("contract.contactNumberMsg") }],
|
|
|
- buyPostalCode: [{ required: true, message: proxy.t("contract.postalCodeMsg") }],
|
|
|
+ // buyPostalCode: [{ required: true, message: proxy.t("contract.postalCodeMsg") }],
|
|
|
buyContactName: [{ required: true, message: proxy.t("contract.contactNameMsg") }],
|
|
|
buyContactNumber: [{ required: true, message: proxy.t("contract.contactNumberMsg") }],
|
|
|
productId: [{ required: true, message: proxy.t("contract.productIdMsg") }],
|
|
@@ -868,11 +869,22 @@ const handleSubmit = async () => {
|
|
|
}
|
|
|
};
|
|
|
watch(
|
|
|
- props.queryData,
|
|
|
+ refProps.queryData,
|
|
|
() => {
|
|
|
- if (props.queryData && [10, 20, 30].includes(route.query.processType)) {
|
|
|
- for (const key in props.queryData) {
|
|
|
- formData.data[key] = props.queryData[key];
|
|
|
+ if (refProps.queryData.value && ["10", "20", "30"].includes(route.query.processType)) {
|
|
|
+ for (const key in refProps.queryData.value) {
|
|
|
+ formData.data[key] = refProps.queryData.value[key];
|
|
|
+ }
|
|
|
+ formDom1.value.formDataShowLabelOne();
|
|
|
+ formDom2.value.formDataListShowLabelOne();
|
|
|
+ formDom6.value.formDataShowLabelOne();
|
|
|
+ if (["10", "20"].includes(route.query.processType)) {
|
|
|
+ formOption.readonly = true;
|
|
|
+ formGoodsOption.readonly = true;
|
|
|
+ formGoodsOption.btnConfig.isNeed = false;
|
|
|
+ formProjectOption.readonly = true;
|
|
|
+ formProjectOption.btnConfig.isNeed = false;
|
|
|
+ formShipmentOption.readonly = true;
|
|
|
}
|
|
|
}
|
|
|
},
|