|
@@ -164,6 +164,12 @@ const formOption = reactive({
|
|
|
),
|
|
|
readonly: true,
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "备注",
|
|
|
+ prop: "productRemark",
|
|
|
+ },
|
|
|
],
|
|
|
clickFn: () => {
|
|
|
if (
|
|
@@ -188,6 +194,88 @@ const formOption = reactive({
|
|
|
const formConfig = reactive([
|
|
|
{
|
|
|
type: "picker",
|
|
|
+ label: "卖方公司",
|
|
|
+ prop: "sellCorporationId",
|
|
|
+ itemType: "onePicker",
|
|
|
+ showPicker: false,
|
|
|
+ fieldNames: {
|
|
|
+ text: "label",
|
|
|
+ value: "value",
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ changeFn: (val, data) => {
|
|
|
+ proxy.formChange(val, data, formData);
|
|
|
+ changeSellId(val.selectedValues[0]);
|
|
|
+ data.showPicker = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "国家",
|
|
|
+ prop: "sellCountryName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "省",
|
|
|
+ prop: "sellProvinceName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "城市",
|
|
|
+ prop: "sellCityName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "textarea",
|
|
|
+ label: "详细地址",
|
|
|
+ prop: "sellAddress",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
+ label: "收款账号",
|
|
|
+ prop: "shroffAccountId",
|
|
|
+ itemType: "onePicker",
|
|
|
+ showPicker: false,
|
|
|
+ fieldNames: {
|
|
|
+ text: "label",
|
|
|
+ value: "value",
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ changeFn: (val, data) => {
|
|
|
+ proxy.formChange(val, data, formData);
|
|
|
+ changeShroffAccount(val.selectedValues[0]);
|
|
|
+ data.showPicker = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "账户名",
|
|
|
+ prop: "sellAccountName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "开户行",
|
|
|
+ prop: "sellOpeningBank",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "账号",
|
|
|
+ prop: "sellAccountOpening",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "银行号",
|
|
|
+ prop: "sellInterbankNumber",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
label: proxy.t("salesContract.customerName"),
|
|
|
prop: "customerId",
|
|
|
itemType: "onePicker",
|
|
@@ -248,6 +336,18 @@ const formConfig = reactive([
|
|
|
{
|
|
|
type: "input",
|
|
|
itemType: "textarea",
|
|
|
+ label: "交货期限备注",
|
|
|
+ prop: "deliveryDateRemark",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "textarea",
|
|
|
+ label: "付款方式备注",
|
|
|
+ prop: "payMethodRemark",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "textarea",
|
|
|
label: proxy.t("salesContract.remarks"),
|
|
|
prop: "remark",
|
|
|
},
|
|
@@ -255,13 +355,15 @@ const formConfig = reactive([
|
|
|
type: "input",
|
|
|
itemType: "number",
|
|
|
label: proxy.t("salesContract.contractTotalAmount"),
|
|
|
- prop: "total",
|
|
|
+ prop: "contractAmount",
|
|
|
readonly: true,
|
|
|
},
|
|
|
]);
|
|
|
const onClickLeft = () => history.back();
|
|
|
const fundsPaymentMethod = ref([]);
|
|
|
const customerData = ref([]);
|
|
|
+const accountList = ref([]);
|
|
|
+const corporationList = ref([]);
|
|
|
const productData = ref([]);
|
|
|
const getDict = () => {
|
|
|
proxy.getDictOne(["funds_payment_method"]).then((res) => {
|
|
@@ -269,17 +371,17 @@ const getDict = () => {
|
|
|
label: x.dictValue,
|
|
|
value: x.dictKey,
|
|
|
}));
|
|
|
- formConfig[2].data = fundsPaymentMethod.value;
|
|
|
+ formConfig[12].data = fundsPaymentMethod.value;
|
|
|
});
|
|
|
proxy.post("/customer/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
|
|
|
customerData.value = res.data.rows.map((x) => ({
|
|
|
label: x.name,
|
|
|
value: x.id,
|
|
|
}));
|
|
|
- formConfig[0].data = customerData.value;
|
|
|
+ formConfig[10].data = customerData.value;
|
|
|
});
|
|
|
proxy
|
|
|
- .post("/productInfo/page", { pageNum: 1, pageSize: 50, definition: "1" })
|
|
|
+ .post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "1" })
|
|
|
.then((res) => {
|
|
|
productData.value = res.data.rows.map((x) => ({
|
|
|
label: x.name + ` (${x.spec})`,
|
|
@@ -287,6 +389,30 @@ const getDict = () => {
|
|
|
}));
|
|
|
formOption.btnConfig.listConfig[0].data = productData.value;
|
|
|
});
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
|
|
|
+ .then((res) => {
|
|
|
+ accountList.value = res.data.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.alias,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ formConfig[5].data = accountList.value;
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ corporationList.value = res.data.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ formConfig[0].data = corporationList.value;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const getProductData = (keyword) => {
|
|
@@ -355,6 +481,37 @@ const onSubmit = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const changeSellId = (val) => {
|
|
|
+ if (val) {
|
|
|
+ proxy.post("/corporation/detail", { id: val }).then((res) => {
|
|
|
+ let detailCorporation = res.data;
|
|
|
+ if (detailCorporation.countryName) {
|
|
|
+ formData.data.sellCountryName = detailCorporation.countryName;
|
|
|
+ }
|
|
|
+ if (detailCorporation.provinceName) {
|
|
|
+ formData.data.sellProvinceName = detailCorporation.provinceName;
|
|
|
+ }
|
|
|
+ if (detailCorporation.cityName) {
|
|
|
+ formData.data.sellCityName = detailCorporation.cityName;
|
|
|
+ }
|
|
|
+ if (detailCorporation.address) {
|
|
|
+ formData.data.sellAddress = detailCorporation.address;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const changeShroffAccount = (val) => {
|
|
|
+ if (val) {
|
|
|
+ let data = accountList.value.filter((item) => item.value === val);
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ formData.data.sellAccountName = data[0].name;
|
|
|
+ formData.data.sellOpeningBank = data[0].openingBank;
|
|
|
+ formData.data.sellInterbankNumber = data[0].interbankNumber;
|
|
|
+ formData.data.sellAccountOpening = data[0].accountOpening;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const changeAmount = (index) => {
|
|
|
let total = 0;
|
|
|
for (let i = 0; i < formData.data.salesContractDetailsList.length; i++) {
|
|
@@ -367,7 +524,7 @@ const changeAmount = (index) => {
|
|
|
}
|
|
|
}
|
|
|
if (total) {
|
|
|
- formData.data.total = total.toFixed(2);
|
|
|
+ formData.data.contractAmount = total.toFixed(2);
|
|
|
}
|
|
|
};
|
|
|
</script>
|