|
@@ -1,22 +1,32 @@
|
|
|
<template>
|
|
|
<div class="form">
|
|
|
<van-tabs v-model:active="active">
|
|
|
- <van-tab :title="proxy.t('funds.basicInformation')"> </van-tab>
|
|
|
- <van-tab :title="proxy.t('funds.claimDetails')"> </van-tab>
|
|
|
- <van-tab :title="proxy.t('funds.receiptPaymentInformation')"> </van-tab>
|
|
|
+ <van-tab :title="proxy.t('contract.transactionInformation')" />
|
|
|
+ <van-tab :title="proxy.t('contract.commodityInformation')" />
|
|
|
+ <van-tab :title="proxy.t('contract.otherCharges')" />
|
|
|
+ <van-tab :title="proxy.t('contract.deliveryInformation')" />
|
|
|
+ <van-tab :title="proxy.t('contract.shipmentPlan')" />
|
|
|
<div class="common-process-card" v-show="active == 0">
|
|
|
- <div class="common-title">{{ proxy.t("funds.basicInformation") }}</div>
|
|
|
+ <div class="common-title">{{ proxy.t("contract.transactionInformation") }}</div>
|
|
|
<testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" ref="formDom1"> </testForm>
|
|
|
</div>
|
|
|
<div class="common-process-card" v-show="active == 1">
|
|
|
- <div class="common-title">{{ proxy.t("funds.claimDetails") }}</div>
|
|
|
- <testForm v-model="formData.data" :formOption="formDetailOption" :formConfig="formDetailConfig" :rules="rules" ref="formDom2"> </testForm>
|
|
|
- <testForm v-model="formData.data" :formOption="formDetailTwoOption" :formConfig="formDetailTwoConfig" :rules="rules" ref="formDom3"> </testForm>
|
|
|
+ <div class="common-title">{{ proxy.t("contract.commodityInformation") }}</div>
|
|
|
+ <testForm v-model="formData.data" :formOption="formGoodsOption" :formConfig="formEmptyConfig" :rules="rules" ref="formDom2"> </testForm>
|
|
|
+ <testForm v-model="formData.data" :formOption="formOption" :formConfig="formAmountProductConfig" :rules="rules" ref="formDom3"> </testForm>
|
|
|
</div>
|
|
|
<div class="common-process-card" v-show="active == 2">
|
|
|
- <div class="common-title">{{ proxy.t("funds.receiptPaymentInformation") }}</div>
|
|
|
- <testForm v-model="formData.data" :formOption="formReceiptPaymentOption" :formConfig="formReceiptPaymentConfig" :rules="rules" ref="formDom4">
|
|
|
- </testForm>
|
|
|
+ <div class="common-title">{{ proxy.t("contract.otherCharges") }}</div>
|
|
|
+ <testForm v-model="formData.data" :formOption="formProjectOption" :formConfig="formEmptyConfig" :rules="rules" ref="formDom4"> </testForm>
|
|
|
+ <testForm v-model="formData.data" :formOption="formOption" :formConfig="formAmountProjectConfig" :rules="rules" ref="formDom5"> </testForm>
|
|
|
+ </div>
|
|
|
+ <div class="common-process-card" v-show="active == 3">
|
|
|
+ <div class="common-title">{{ proxy.t("contract.deliveryInformation") }}</div>
|
|
|
+ <testForm v-model="formData.data" :formOption="formOption" :formConfig="formDeliveryConfig" :rules="rulesTwo" ref="formDom6"> </testForm>
|
|
|
+ </div>
|
|
|
+ <div class="common-process-card" v-show="active == 4">
|
|
|
+ <div class="common-title">{{ proxy.t("contract.shipmentPlan") }}</div>
|
|
|
+ <testForm v-model="formData.data" :formOption="formShipmentOption" :formConfig="formEmptyConfig" :rules="rules" ref="formDom7"> </testForm>
|
|
|
</div>
|
|
|
</van-tabs>
|
|
|
</div>
|
|
@@ -24,7 +34,6 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch, reactive } from "vue";
|
|
|
-import { showSuccessToast, showFailToast } from "vant";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import testForm from "@/components/testForm/index.vue";
|
|
|
import { getUserInfo } from "@/utils/auth";
|
|
@@ -35,33 +44,24 @@ const props = defineProps({
|
|
|
});
|
|
|
const proxy = getCurrentInstance().proxy;
|
|
|
const route = useRoute();
|
|
|
-const active = ref(0);
|
|
|
-const oldType = ref("");
|
|
|
+const active = ref(4);
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
- corporationId: null,
|
|
|
- departmentId: null,
|
|
|
- type: null,
|
|
|
- advanceId: null,
|
|
|
- currency: null,
|
|
|
- paymentRemarks: null,
|
|
|
- accountRequestFundsDetailList: [],
|
|
|
- total: null,
|
|
|
- quantity: null,
|
|
|
- paymentMethod: null,
|
|
|
- accountManagementId: null,
|
|
|
- username: null,
|
|
|
- accountOpening: null,
|
|
|
- openingBank: null,
|
|
|
- interbankNumber: null,
|
|
|
+ contractType: "1",
|
|
|
+ contractProductList: [],
|
|
|
+ contractProjectList: [],
|
|
|
+ contractShipmentList: [],
|
|
|
},
|
|
|
});
|
|
|
const formDom1 = ref(null);
|
|
|
const formDom2 = ref(null);
|
|
|
const formDom3 = ref(null);
|
|
|
const formDom4 = ref(null);
|
|
|
+const formDom5 = ref(null);
|
|
|
+const formDom6 = ref(null);
|
|
|
+const formDom7 = ref(null);
|
|
|
const formOption = reactive({
|
|
|
- readonly: false, //用于控制整个表单是否只读
|
|
|
+ readonly: false,
|
|
|
disabled: false,
|
|
|
labelAlign: "top",
|
|
|
scroll: true,
|
|
@@ -71,8 +71,8 @@ const formOption = reactive({
|
|
|
const formConfig = reactive([
|
|
|
{
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.corporationId"),
|
|
|
- prop: "corporationId",
|
|
|
+ label: proxy.t("contract.contractType"),
|
|
|
+ prop: "contractType",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
|
fieldNames: {
|
|
@@ -80,24 +80,11 @@ const formConfig = reactive([
|
|
|
value: "value",
|
|
|
},
|
|
|
data: [],
|
|
|
- changeFn: (val, item) => {
|
|
|
- formData.data.corporationId = val.selectedValues[0];
|
|
|
- let list = item.data.filter((aa) => aa[item.fieldNames.value] == val.selectedValues[0]);
|
|
|
- if (list && list.length > 0) {
|
|
|
- formData.data.corporationIdName = list[0][item.fieldNames.text];
|
|
|
- } else {
|
|
|
- formData.data.corporationIdName = "";
|
|
|
- }
|
|
|
- if (formData.data.type == "3") {
|
|
|
- getAdvanceList();
|
|
|
- }
|
|
|
- item.showPicker = false;
|
|
|
- },
|
|
|
},
|
|
|
{
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.departmentId"),
|
|
|
- prop: "departmentId",
|
|
|
+ label: proxy.t("contract.contractTemplateId"),
|
|
|
+ prop: "contractTemplateId",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
|
fieldNames: {
|
|
@@ -107,9 +94,13 @@ const formConfig = reactive([
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
+ type: "title",
|
|
|
+ title: proxy.t("contract.sellerInformation"),
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.type"),
|
|
|
- prop: "type",
|
|
|
+ label: proxy.t("contract.sellCorporationId"),
|
|
|
+ prop: "sellCorporationId",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
|
fieldNames: {
|
|
@@ -117,92 +108,40 @@ const formConfig = reactive([
|
|
|
value: "value",
|
|
|
},
|
|
|
data: [],
|
|
|
- changeFn: (val, item) => {
|
|
|
- if (val.selectedValues[0] === "3" || oldType.value === "3") {
|
|
|
- for (let text in formData.data) {
|
|
|
- if (text === "advanceId") {
|
|
|
- formData.data.advanceId = "";
|
|
|
- } else if (["corporationId", "corporationIdName", "type", "typeName", "paymentTime", "paymentTimeName"].includes(text)) {
|
|
|
- } else if (text === "accountRequestFundsDetailList") {
|
|
|
- formData.data.accountRequestFundsDetailList = [];
|
|
|
- } else if (text === "fileList") {
|
|
|
- formData.data.fileList = [];
|
|
|
- } else {
|
|
|
- delete formData.data[text];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- oldType.value = JSON.parse(JSON.stringify(val.selectedValues[0]));
|
|
|
- formData.data.type = JSON.parse(JSON.stringify(val.selectedValues[0]));
|
|
|
- let list = item.data.filter((aa) => aa[item.fieldNames.value] == val.selectedValues[0]);
|
|
|
- if (list && list.length > 0) {
|
|
|
- formData.data.typeName = list[0][item.fieldNames.text];
|
|
|
- } else {
|
|
|
- formData.data.typeName = "";
|
|
|
- }
|
|
|
- if (val.selectedValues[0] === "3") {
|
|
|
- formConfig[3].type = "picker";
|
|
|
- getAdvanceList();
|
|
|
- } else {
|
|
|
- formConfig[3].type = "pickerAAA";
|
|
|
- }
|
|
|
- item.showPicker = false;
|
|
|
- },
|
|
|
},
|
|
|
{
|
|
|
- type: "pickerAAA",
|
|
|
- label: proxy.t("funds.advanceId"),
|
|
|
- prop: "advanceId",
|
|
|
- itemType: "onePicker",
|
|
|
+ type: "cascader",
|
|
|
+ label: proxy.t("contract.cityText"),
|
|
|
+ prop: "sellCity",
|
|
|
+ itemType: "city",
|
|
|
showPicker: false,
|
|
|
- fieldNames: {
|
|
|
- text: "label",
|
|
|
- value: "value",
|
|
|
- },
|
|
|
- data: [],
|
|
|
- changeFn: (val, item) => {
|
|
|
- formData.data.advanceId = val.selectedValues[0];
|
|
|
- let list = item.data.filter((aa) => aa[item.fieldNames.value] == val.selectedValues[0]);
|
|
|
- if (list && list.length > 0) {
|
|
|
- formData.data.advanceIdName = list[0][item.fieldNames.text];
|
|
|
- } else {
|
|
|
- formData.data.advanceIdName = "";
|
|
|
- }
|
|
|
- if (val.selectedValues && val.selectedValues.length > 0) {
|
|
|
- proxy.post("/accountRequestFunds/detail", { id: val.selectedValues[0] }).then((res) => {
|
|
|
- formData.data.departmentId = res.data.departmentId;
|
|
|
- formData.data.currency = res.data.currency;
|
|
|
- formData.data.paymentRemarks = res.data.paymentRemarks;
|
|
|
- formData.data.accountRequestFundsDetailList = res.data.accountRequestFundsDetailList.map((item) => {
|
|
|
- return {
|
|
|
- costType: item.costType,
|
|
|
- amount: item.amount,
|
|
|
- contractId: item.contractId,
|
|
|
- advanceAmount: item.amount,
|
|
|
- remarks: item.remarks,
|
|
|
- };
|
|
|
- });
|
|
|
- handleChangeAmount();
|
|
|
- formData.data.advanceAmounts = res.data.total;
|
|
|
- formData.data.quantity = res.data.quantity;
|
|
|
- formData.data.paymentMethod = res.data.paymentMethod;
|
|
|
- formData.data.accountManagementId = res.data.accountManagementId;
|
|
|
- formData.data.name = res.data.name;
|
|
|
- formData.data.accountOpening = res.data.accountOpening;
|
|
|
- formData.data.openingBank = res.data.openingBank;
|
|
|
- formData.data.interbankNumber = res.data.interbankNumber;
|
|
|
- formDom1.value.formDataShowLabelOne();
|
|
|
- formDom2.value.formDataListShowLabelOne();
|
|
|
- formDom4.value.formDataShowLabelOne();
|
|
|
- });
|
|
|
- }
|
|
|
- item.showPicker = false;
|
|
|
- },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.address"),
|
|
|
+ prop: "sellAddress",
|
|
|
+ itemType: "textarea",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.contactName"),
|
|
|
+ prop: "sellContactName",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.contactNumber"),
|
|
|
+ prop: "sellContactNumber",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: proxy.t("contract.buyerInformation"),
|
|
|
},
|
|
|
{
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.currency"),
|
|
|
- prop: "currency",
|
|
|
+ label: proxy.t("contract.buyCorporationId"),
|
|
|
+ prop: "buyCorporationId",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
|
fieldNames: {
|
|
@@ -212,14 +151,39 @@ const formConfig = reactive([
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
+ type: "cascader",
|
|
|
+ label: proxy.t("contract.cityText"),
|
|
|
+ prop: "buyCity",
|
|
|
+ itemType: "city",
|
|
|
+ showPicker: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.paymentRemarks"),
|
|
|
- prop: "paymentRemarks",
|
|
|
+ label: proxy.t("contract.address"),
|
|
|
+ prop: "buyAddress",
|
|
|
itemType: "textarea",
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.postalCode"),
|
|
|
+ prop: "buyPostalCode",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.contactName"),
|
|
|
+ prop: "buyContactName",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.contactNumber"),
|
|
|
+ prop: "buyContactNumber",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
]);
|
|
|
-const formDetailOption = reactive({
|
|
|
- readonly: false, //用于控制整个表单是否只读
|
|
|
+const formGoodsOption = reactive({
|
|
|
+ readonly: false,
|
|
|
disabled: false,
|
|
|
labelAlign: "top",
|
|
|
scroll: true,
|
|
@@ -227,14 +191,14 @@ const formDetailOption = reactive({
|
|
|
hiddenSubmitBtn: true,
|
|
|
btnConfig: {
|
|
|
isNeed: true,
|
|
|
- prop: "accountRequestFundsDetailList",
|
|
|
+ prop: "contractProductList",
|
|
|
plain: true,
|
|
|
- listTitle: proxy.t("funds.claimDetails"),
|
|
|
+ listTitle: proxy.t("contract.commodityInformation"),
|
|
|
listConfig: [
|
|
|
{
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.costType"),
|
|
|
- prop: "costType",
|
|
|
+ label: proxy.t("contract.productId"),
|
|
|
+ prop: "productId",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
|
readonly: false,
|
|
@@ -245,95 +209,191 @@ const formDetailOption = reactive({
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
- type: "picker",
|
|
|
- label: proxy.t("funds.contractId"),
|
|
|
- prop: "contractId",
|
|
|
- itemType: "onePicker",
|
|
|
- showPicker: false,
|
|
|
- readonly: false,
|
|
|
- fieldNames: {
|
|
|
- text: "label",
|
|
|
- value: "value",
|
|
|
- },
|
|
|
- data: [],
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.productName"),
|
|
|
+ prop: "productName",
|
|
|
+ itemType: "text",
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.amount"),
|
|
|
- prop: "amount",
|
|
|
+ label: proxy.t("contract.productModel"),
|
|
|
+ prop: "productModel",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.quantity"),
|
|
|
+ prop: "quantity",
|
|
|
itemType: "number",
|
|
|
changeFn: () => {
|
|
|
- handleChangeAmount();
|
|
|
+ calculatedAmount();
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.remarks"),
|
|
|
- prop: "remarks",
|
|
|
- itemType: "textarea",
|
|
|
+ label: proxy.t("contract.price"),
|
|
|
+ prop: "price",
|
|
|
+ itemType: "number",
|
|
|
+ changeFn: () => {
|
|
|
+ calculatedAmount();
|
|
|
+ },
|
|
|
},
|
|
|
],
|
|
|
clickFn: () => {
|
|
|
- if (formData.data.accountRequestFundsDetailList && formData.data.accountRequestFundsDetailList.length > 0) {
|
|
|
- formData.data.accountRequestFundsDetailList.push({
|
|
|
- costType: null,
|
|
|
- contractId: null,
|
|
|
+ if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
|
+ formData.data.contractProductList.push({
|
|
|
+ productId: null,
|
|
|
+ productName: null,
|
|
|
+ productModel: null,
|
|
|
+ quantity: null,
|
|
|
+ price: null,
|
|
|
amount: null,
|
|
|
- remarks: null,
|
|
|
+ remark: null,
|
|
|
+ });
|
|
|
+ formData.data.contractShipmentList.push({
|
|
|
+ productId: null,
|
|
|
+ productName: null,
|
|
|
+ shipmentTime: null,
|
|
|
+ quantity: null,
|
|
|
+ remark: null,
|
|
|
});
|
|
|
} else {
|
|
|
- formData.data.accountRequestFundsDetailList = [
|
|
|
+ formData.data.contractProductList = [
|
|
|
{
|
|
|
- costType: null,
|
|
|
- contractId: null,
|
|
|
+ productId: null,
|
|
|
+ productName: null,
|
|
|
+ productModel: null,
|
|
|
+ quantity: null,
|
|
|
+ price: null,
|
|
|
amount: null,
|
|
|
- remarks: null,
|
|
|
+ remark: null,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ formData.data.contractShipmentList = [
|
|
|
+ {
|
|
|
+ productId: null,
|
|
|
+ productName: null,
|
|
|
+ shipmentTime: null,
|
|
|
+ quantity: null,
|
|
|
+ remark: null,
|
|
|
},
|
|
|
];
|
|
|
}
|
|
|
},
|
|
|
deleteFn: (index) => {
|
|
|
- formData.data.accountRequestFundsDetailList.splice(index, 1);
|
|
|
+ formData.data.contractProductList.splice(index, 1);
|
|
|
+ formData.data.contractShipmentList.splice(index, 1);
|
|
|
handleChangeAmount();
|
|
|
},
|
|
|
},
|
|
|
});
|
|
|
-const formDetailConfig = reactive([]);
|
|
|
-const formDetailTwoOption = reactive({
|
|
|
- readonly: false, //用于控制整个表单是否只读
|
|
|
- disabled: false,
|
|
|
- labelAlign: "top",
|
|
|
- scroll: true,
|
|
|
- labelWidth: "62pk",
|
|
|
- hiddenSubmitBtn: true,
|
|
|
-});
|
|
|
-const formDetailTwoConfig = reactive([
|
|
|
+const formEmptyConfig = reactive([]);
|
|
|
+const formAmountProductConfig = reactive([
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.total"),
|
|
|
- prop: "total",
|
|
|
- itemType: "number",
|
|
|
+ label: proxy.t("contract.amountProduct"),
|
|
|
+ prop: "amountProduct",
|
|
|
+ itemType: "text",
|
|
|
readonly: true,
|
|
|
+ placeholder: proxy.t("contract.amountProductPlaceholder"),
|
|
|
},
|
|
|
+]);
|
|
|
+const formAmountProjectConfig = reactive([
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.quantity"),
|
|
|
- prop: "quantity",
|
|
|
- itemType: "number",
|
|
|
+ label: proxy.t("contract.amountProject"),
|
|
|
+ prop: "amountProject",
|
|
|
+ itemType: "text",
|
|
|
+ readonly: true,
|
|
|
+ placeholder: proxy.t("contract.amountProjectPlaceholder"),
|
|
|
},
|
|
|
]);
|
|
|
-const formReceiptPaymentOption = reactive({
|
|
|
- readonly: false, //用于控制整个表单是否只读
|
|
|
+const formProjectOption = reactive({
|
|
|
+ readonly: false,
|
|
|
disabled: false,
|
|
|
labelAlign: "top",
|
|
|
scroll: true,
|
|
|
labelWidth: "62pk",
|
|
|
hiddenSubmitBtn: true,
|
|
|
+ btnConfig: {
|
|
|
+ isNeed: true,
|
|
|
+ prop: "contractProjectList",
|
|
|
+ plain: true,
|
|
|
+ listTitle: proxy.t("contract.chargeItem"),
|
|
|
+ listConfig: [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.chargeItem"),
|
|
|
+ prop: "payName",
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.amount"),
|
|
|
+ prop: "amount",
|
|
|
+ itemType: "number",
|
|
|
+ changeFn: () => {
|
|
|
+ handleChangeAmount();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.remark"),
|
|
|
+ prop: "remark",
|
|
|
+ itemType: "textarea",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ clickFn: () => {
|
|
|
+ if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
|
|
|
+ formData.data.contractProjectList.push({
|
|
|
+ payName: null,
|
|
|
+ amount: null,
|
|
|
+ remark: null,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.contractProjectList = [
|
|
|
+ {
|
|
|
+ payName: null,
|
|
|
+ amount: null,
|
|
|
+ remark: null,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deleteFn: (index) => {
|
|
|
+ formData.data.contractProjectList.splice(index, 1);
|
|
|
+ handleChangeAmount();
|
|
|
+ },
|
|
|
+ },
|
|
|
});
|
|
|
-const formReceiptPaymentConfig = reactive([
|
|
|
+const formDeliveryConfig = reactive([
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: proxy.t("contract.collectionInformation"),
|
|
|
+ },
|
|
|
{
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.paymentMethod"),
|
|
|
+ label: proxy.t("contract.currency"),
|
|
|
+ prop: "currency",
|
|
|
+ itemType: "onePicker",
|
|
|
+ showPicker: false,
|
|
|
+ fieldNames: {
|
|
|
+ text: "label",
|
|
|
+ value: "value",
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.amountAll"),
|
|
|
+ prop: "amount",
|
|
|
+ itemType: "text",
|
|
|
+ readonly: true,
|
|
|
+ placeholder: proxy.t("contract.amountAllPlaceholder"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
+ label: proxy.t("contract.paymentMethod"),
|
|
|
prop: "paymentMethod",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
@@ -344,9 +404,52 @@ const formReceiptPaymentConfig = reactive([
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.advanceRatio"),
|
|
|
+ prop: "advanceRatio",
|
|
|
+ itemType: "number",
|
|
|
+ inputFn: (val) => {
|
|
|
+ if (val) {
|
|
|
+ if (val > 100) {
|
|
|
+ formData.data.advanceRatio = 100;
|
|
|
+ } else if (val < 0) {
|
|
|
+ formData.data.advanceRatio = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "picker",
|
|
|
- label: proxy.t("funds.accountManagementId"),
|
|
|
- prop: "accountManagementId",
|
|
|
+ label: proxy.t("contract.shroffAccountId"),
|
|
|
+ prop: "shroffAccountId",
|
|
|
+ itemType: "onePicker",
|
|
|
+ showPicker: false,
|
|
|
+ fieldNames: {
|
|
|
+ text: "label",
|
|
|
+ value: "value",
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: proxy.t("contract.deliveryInformation"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
+ label: proxy.t("contract.tradeMethods"),
|
|
|
+ prop: "tradeMethods",
|
|
|
+ itemType: "onePicker",
|
|
|
+ showPicker: false,
|
|
|
+ fieldNames: {
|
|
|
+ text: "label",
|
|
|
+ value: "value",
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
+ label: proxy.t("contract.transportMethod"),
|
|
|
+ prop: "transportMethod",
|
|
|
itemType: "onePicker",
|
|
|
showPicker: false,
|
|
|
fieldNames: {
|
|
@@ -357,64 +460,100 @@ const formReceiptPaymentConfig = reactive([
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.username"),
|
|
|
- prop: "name",
|
|
|
+ label: proxy.t("contract.transportRemark"),
|
|
|
+ prop: "transportRemark",
|
|
|
itemType: "text",
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.accountOpening"),
|
|
|
- prop: "accountOpening",
|
|
|
- itemType: "text",
|
|
|
+ label: proxy.t("contract.remarks"),
|
|
|
+ prop: "remark",
|
|
|
+ itemType: "textarea",
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.openingBank"),
|
|
|
- prop: "openingBank",
|
|
|
- itemType: "text",
|
|
|
+ label: proxy.t("contract.warranty"),
|
|
|
+ prop: "warranty",
|
|
|
+ itemType: "digit",
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: proxy.t("funds.interbankNumber"),
|
|
|
- prop: "interbankNumber",
|
|
|
- itemType: "text",
|
|
|
+ label: proxy.t("contract.deliveryTime"),
|
|
|
+ prop: "deliveryTime",
|
|
|
+ itemType: "digit",
|
|
|
},
|
|
|
]);
|
|
|
+const formShipmentOption = reactive({
|
|
|
+ readonly: false,
|
|
|
+ disabled: false,
|
|
|
+ labelAlign: "top",
|
|
|
+ scroll: true,
|
|
|
+ labelWidth: "62pk",
|
|
|
+ hiddenSubmitBtn: true,
|
|
|
+ btnConfig: {
|
|
|
+ isNeed: false,
|
|
|
+ prop: "contractShipmentList",
|
|
|
+ plain: true,
|
|
|
+ listTitle: proxy.t("contract.commodity"),
|
|
|
+ listConfig: [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.productName"),
|
|
|
+ prop: "productName",
|
|
|
+ itemType: "text",
|
|
|
+ readonly: true,
|
|
|
+ placeholder: proxy.t("contract.productNamePlaceholder"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
+ label: proxy.t("contract.shipmentTime"),
|
|
|
+ prop: "shipmentTime",
|
|
|
+ itemType: "datePicker",
|
|
|
+ showPicker: false,
|
|
|
+ split: "-",
|
|
|
+ columnsType: ["year", "month", "day"],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: proxy.t("contract.quantityShipment"),
|
|
|
+ prop: "quantity",
|
|
|
+ itemType: "number",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+});
|
|
|
const rules = {
|
|
|
- corporationId: [{ required: true, message: proxy.t("funds.corporationIdMsg") }],
|
|
|
- departmentId: [{ required: true, message: proxy.t("funds.departmentIdMsg") }],
|
|
|
- type: [{ required: true, message: proxy.t("funds.typeMsg") }],
|
|
|
- advanceId: [{ required: true, message: proxy.t("funds.advanceIdMsg") }],
|
|
|
- currency: [{ required: true, message: proxy.t("funds.currencyMsg") }],
|
|
|
- costType: [{ required: true, message: proxy.t("funds.costTypeMsg") }],
|
|
|
- contractId: [{ required: true, message: proxy.t("funds.contractIdMsg") }],
|
|
|
- amount: [{ required: true, message: proxy.t("funds.amountMsg") }],
|
|
|
- remarks: [{ required: true, message: proxy.t("funds.remarksMsg") }],
|
|
|
- quantity: [{ required: true, message: proxy.t("funds.quantityMsg") }],
|
|
|
- paymentMethod: [{ required: true, message: proxy.t("funds.paymentMethodMsg") }],
|
|
|
- accountManagementId: [{ required: true, message: proxy.t("funds.accountManagementIdMsg") }],
|
|
|
+ contractType: [{ required: true, message: proxy.t("contract.contractTypeMsg") }],
|
|
|
+ contractTemplateId: [{ required: true, message: proxy.t("contract.contractTemplateIdMsg") }],
|
|
|
+ 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") }],
|
|
|
+ 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") }],
|
|
|
+ buyContactName: [{ required: true, message: proxy.t("contract.contactNameMsg") }],
|
|
|
+ buyContactNumber: [{ required: true, message: proxy.t("contract.contactNumberMsg") }],
|
|
|
+ productId: [{ required: true, message: proxy.t("contract.productIdMsg") }],
|
|
|
+ productName: [{ required: true, message: proxy.t("contract.productNameMsg") }],
|
|
|
+ productModel: [{ required: true, message: proxy.t("contract.productModelMsg") }],
|
|
|
+ quantity: [{ required: true, message: proxy.t("contract.quantityMsg") }],
|
|
|
+ price: [{ required: true, message: proxy.t("contract.priceMsg") }],
|
|
|
+ payName: [{ required: true, message: proxy.t("contract.chargeItemMsg") }],
|
|
|
+ amount: [{ required: true, message: proxy.t("contract.amountMsg") }],
|
|
|
+ shipmentTime: [{ required: true, message: proxy.t("contract.shipmentTimeMsg") }],
|
|
|
};
|
|
|
-const getAdvanceList = () => {
|
|
|
- proxy
|
|
|
- .post("/accountRequestFunds/page", {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- type: "1",
|
|
|
- writeOffStatus: "0",
|
|
|
- corporationId: formData.data.corporationId,
|
|
|
- status: "30",
|
|
|
- createUser: getUserInfo().userId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formConfig[3].data = res.data.rows.map((item) => {
|
|
|
- return {
|
|
|
- label: item.createTime.substr(0, 10) + " " + item.currency + " " + item.total,
|
|
|
- value: item.id,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+const rulesTwo = {
|
|
|
+ currency: [{ required: true, message: proxy.t("contract.currencyMsg") }],
|
|
|
+ paymentMethod: [{ required: true, message: proxy.t("contract.paymentMethodMsg") }],
|
|
|
+ advanceRatio: [{ required: true, message: proxy.t("contract.advanceRatioMsg") }],
|
|
|
+ shroffAccountId: [{ required: true, message: proxy.t("contract.shroffAccountIdMsg") }],
|
|
|
+ tradeMethods: [{ required: true, message: proxy.t("contract.tradeMethodsMsg") }],
|
|
|
+ transportMethod: [{ required: true, message: proxy.t("contract.transportMethodMsg") }],
|
|
|
+ transportRemark: [{ required: true, message: proxy.t("contract.transportRemarkMsg") }],
|
|
|
+ remark: [{ required: true, message: proxy.t("contract.remarksMsg") }],
|
|
|
};
|
|
|
const getDict = () => {
|
|
|
let query = {
|
|
@@ -422,41 +561,70 @@ const getDict = () => {
|
|
|
pageSize: 999,
|
|
|
tenantId: getUserInfo().tenantId,
|
|
|
};
|
|
|
- proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
|
|
|
+ proxy.post("/dictTenantData/page", { ...query, dictCode: "contract_type" }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
formConfig[0].data = res.data.rows.map((item) => {
|
|
|
return {
|
|
|
+ label: item.dictValue,
|
|
|
+ value: item.dictKey,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ proxy.post("/contractTemplate/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ if (res.data.rows && res.data.rows.length > 0) {
|
|
|
+ formConfig[1].data = res.data.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.templateName,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ if (res.data.rows && res.data.rows.length > 0) {
|
|
|
+ formConfig[3].data = res.data.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
label: item.name,
|
|
|
value: item.id,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy.get("/tenantDept/list", query).then((res) => {
|
|
|
- if (res.data && res.data.length > 0) {
|
|
|
- formConfig[1].data = res.data
|
|
|
- .filter((item) => item.parentId != "0")
|
|
|
- .map((item) => {
|
|
|
- return {
|
|
|
- label: item.deptName,
|
|
|
- value: item.deptId,
|
|
|
- };
|
|
|
- });
|
|
|
+ proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ if (res.data.rows && res.data.rows.length > 0) {
|
|
|
+ formConfig[9].data = res.data.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
- proxy.post("/dictTenantData/page", { ...query, dictCode: "founds_type" }).then((res) => {
|
|
|
+ proxy.post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "1" }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formConfig[2].data = res.data.rows.map((item) => {
|
|
|
+ formGoodsOption.btnConfig.listConfig[0].data = res.data.rows.map((item) => {
|
|
|
+ let name = item.name;
|
|
|
+ if (item.standardJson) {
|
|
|
+ let standardJson = JSON.parse(item.standardJson);
|
|
|
+ if (standardJson && standardJson.englishName) {
|
|
|
+ name = standardJson.englishName;
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
- label: item.dictValue,
|
|
|
- value: item.dictKey,
|
|
|
+ ...item,
|
|
|
+ label: name,
|
|
|
+ value: item.id,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
proxy.post("/dictTenantData/page", { ...query, dictCode: "account_currency" }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formConfig[4].data = res.data.rows.map((item) => {
|
|
|
+ formDeliveryConfig[1].data = res.data.rows.map((item) => {
|
|
|
return {
|
|
|
label: item.dictValue,
|
|
|
value: item.dictKey,
|
|
@@ -464,9 +632,9 @@ const getDict = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy.post("/dictTenantData/page", { ...query, dictCode: "funds_cost_type" }).then((res) => {
|
|
|
+ proxy.post("/dictTenantData/page", { ...query, dictCode: "funds_payment_method" }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formDetailOption.btnConfig.listConfig[0].data = res.data.rows.map((item) => {
|
|
|
+ formDeliveryConfig[3].data = res.data.rows.map((item) => {
|
|
|
return {
|
|
|
label: item.dictValue,
|
|
|
value: item.dictKey,
|
|
@@ -474,19 +642,20 @@ const getDict = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy.post("/contract/page1", { pageNum: 1, pageSize: 9999, status: 30 }).then((res) => {
|
|
|
+ proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formDetailOption.btnConfig.listConfig[1].data = res.data.rows.map((item) => {
|
|
|
+ formDeliveryConfig[5].data = res.data.rows.map((item) => {
|
|
|
return {
|
|
|
- label: item.code,
|
|
|
+ ...item,
|
|
|
+ label: item.alias,
|
|
|
value: item.id,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy.post("/dictTenantData/page", { ...query, dictCode: "funds_payment_method" }).then((res) => {
|
|
|
+ proxy.post("/dictTenantData/page", { ...query, dictCode: "trade_mode" }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formReceiptPaymentConfig[0].data = res.data.rows.map((item) => {
|
|
|
+ formDeliveryConfig[7].data = res.data.rows.map((item) => {
|
|
|
return {
|
|
|
label: item.dictValue,
|
|
|
value: item.dictKey,
|
|
@@ -494,27 +663,53 @@ const getDict = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
|
|
|
+ proxy.post("/dictTenantData/page", { ...query, dictCode: "shipping_method" }).then((res) => {
|
|
|
if (res.data.rows && res.data.rows.length > 0) {
|
|
|
- formReceiptPaymentConfig[1].data = res.data.rows.map((item) => {
|
|
|
+ formDeliveryConfig[8].data = res.data.rows.map((item) => {
|
|
|
return {
|
|
|
- label: item.alias,
|
|
|
- value: item.id,
|
|
|
+ label: item.dictValue,
|
|
|
+ value: item.dictKey,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
getDict();
|
|
|
+const calculatedAmount = () => {
|
|
|
+ if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
+ let money = 0;
|
|
|
+ if (formData.data.contractProductList[i].quantity && formData.data.contractProductList[i].price) {
|
|
|
+ money = parseFloat(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price)).toFixed(2);
|
|
|
+ }
|
|
|
+ formData.data.contractProductList[i].amount = money;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ handleChangeAmount();
|
|
|
+};
|
|
|
const handleChangeAmount = () => {
|
|
|
- let sum = 0;
|
|
|
- for (let i = 0; i < formData.data.accountRequestFundsDetailList.length; i++) {
|
|
|
- const e = formData.data.accountRequestFundsDetailList[i];
|
|
|
- if (e.amount) {
|
|
|
- sum = Number(parseFloat(Number(sum) + Number(e.amount)).toFixed(2));
|
|
|
+ let money = 0;
|
|
|
+ let amountProduct = 0;
|
|
|
+ let amountProject = 0;
|
|
|
+ if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
+ if (formData.data.contractProductList[i].amount) {
|
|
|
+ money = parseFloat(Number(money) + Number(formData.data.contractProductList[i].amount)).toFixed(2);
|
|
|
+ amountProduct = parseFloat(Number(amountProduct) + Number(formData.data.contractProductList[i].amount)).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.contractProjectList.length; i++) {
|
|
|
+ if (formData.data.contractProjectList[i].amount) {
|
|
|
+ money = parseFloat(Number(money) + Number(formData.data.contractProjectList[i].amount)).toFixed(2);
|
|
|
+ amountProject = parseFloat(Number(amountProject) + Number(formData.data.contractProjectList[i].amount)).toFixed(2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- formData.data.total = sum;
|
|
|
+ formData.data.amount = money;
|
|
|
+ formData.data.amountProduct = amountProduct;
|
|
|
+ formData.data.amountProject = amountProject;
|
|
|
};
|
|
|
const handleSubmit = async () => {
|
|
|
return formData.data;
|