|
@@ -195,8 +195,8 @@ const printDetails = ref({});
|
|
|
const props = defineProps({
|
|
|
rowData: Object,
|
|
|
});
|
|
|
-const getPdfData = (row) => {
|
|
|
- proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
|
|
|
+const getPdfData = (query) => {
|
|
|
+ proxy.post("/contract/getContractPdfInfo", query).then((res) => {
|
|
|
printDetails.value = res;
|
|
|
});
|
|
|
};
|
|
@@ -223,10 +223,6 @@ const statisticsTwo = (label, index) => {
|
|
|
return num;
|
|
|
};
|
|
|
|
|
|
-if (props.rowData && props.rowData.id) {
|
|
|
- getPdfData(props.rowData);
|
|
|
-}
|
|
|
-
|
|
|
const productUnit = ref([]);
|
|
|
const tradeMethods = ref([]);
|
|
|
const shippingMethod = ref([]);
|
|
@@ -249,11 +245,17 @@ const getDict = () => {
|
|
|
};
|
|
|
getDict();
|
|
|
watch(
|
|
|
- () => props.rowData.id,
|
|
|
- (val) => {
|
|
|
- if (props.rowData && props.rowData.id) {
|
|
|
- getPdfData(props.rowData);
|
|
|
+ props.rowData,
|
|
|
+ () => {
|
|
|
+ if (props.rowData.id) {
|
|
|
+ getPdfData({ id: props.rowData.id });
|
|
|
+ } else if (props.rowData.code) {
|
|
|
+ getPdfData({ code: props.rowData.code });
|
|
|
}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
}
|
|
|
);
|
|
|
</script>
|