|
@@ -818,14 +818,93 @@ const changeCustomer = (val) => {
|
|
|
formData.data.buyPostalCode = "";
|
|
|
formData.data.buyAddress = "";
|
|
|
}
|
|
|
- getDecisionAids()
|
|
|
+ getDecisionAids();
|
|
|
};
|
|
|
+let auxiliaryData = ref([
|
|
|
+ {
|
|
|
+ label: "最近合同",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品价格",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+]);
|
|
|
+const emit = defineEmits(["auxiliaryChange"]);
|
|
|
const getDecisionAids = () => {
|
|
|
let data = {
|
|
|
-
|
|
|
+ buyCorporationId: formData.data.buyCorporationId,
|
|
|
+ productIdList: [],
|
|
|
+ };
|
|
|
+ if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
|
+ data.productIdList = formData.data.contractProductList.map((item) => item.productId);
|
|
|
}
|
|
|
- // Pubsub.publish("refreshDecisionAids", formData.data.buyCorporationId);
|
|
|
-}
|
|
|
+ proxy.post("/contract/decisionAid", data).then((res) => {
|
|
|
+ if (res.lastContractList && res.lastContractList.length > 0) {
|
|
|
+ auxiliaryData.value[0].data = res.lastContractList.map((item) => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: "合同编号",
|
|
|
+ value: item.code,
|
|
|
+ style: {
|
|
|
+ color: "#0084FF",
|
|
|
+ },
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ // fn: () => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "下单日期",
|
|
|
+ value: item.createTime,
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "合同金额",
|
|
|
+ value: item.currency + item.amount,
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ auxiliaryData.value[0].data = [];
|
|
|
+ }
|
|
|
+ if (res.productPriceList && res.productPriceList.length > 0) {
|
|
|
+ auxiliaryData.value[1].data = res.productPriceList.map((item) => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: "产品名称",
|
|
|
+ value: item.name,
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "最近价格",
|
|
|
+ value: item.lastPrice,
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "历史最高",
|
|
|
+ value: item.maxPrice,
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "历史最低",
|
|
|
+ value: item.minPrice,
|
|
|
+ id: item.id,
|
|
|
+ num: 1,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ auxiliaryData.value[1].data = [];
|
|
|
+ }
|
|
|
+ emit("auxiliaryChange", auxiliaryData.value);
|
|
|
+ });
|
|
|
+};
|
|
|
const createFilter = (queryString) => {
|
|
|
return (restaurant) => {
|
|
|
return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
|
|
@@ -904,7 +983,7 @@ const pushGoods = (goods) => {
|
|
|
type: "success",
|
|
|
});
|
|
|
openProduct.value = false;
|
|
|
- getDecisionAids()
|
|
|
+ getDecisionAids();
|
|
|
} else {
|
|
|
ElMessage("请选择至少一件商品");
|
|
|
}
|
|
@@ -1028,7 +1107,7 @@ const handleRemove = async (index, row) => {
|
|
|
formData.data.contractShipmentList = formData.data.contractShipmentList.filter((item) => item.productId !== row.productId);
|
|
|
await formData.data.contractProductList.splice(index, 1);
|
|
|
totalAmount();
|
|
|
- getDecisionAids()
|
|
|
+ getDecisionAids();
|
|
|
};
|
|
|
const calculationAmount = () => {
|
|
|
nextTick(() => {
|