Browse Source

销售合同

lxf 1 year ago
parent
commit
d95f2c08c6

+ 11 - 3
src/components/testForm/index.vue

@@ -30,7 +30,12 @@
             :required="getRequired(i.prop)"
             :right-icon="i.isNeedRightBtn ? i.rightIcon : ''"
             @click-right-icon="i.isNeedRightBtn ? i.rightIconClick() : () => {}"
-            @blur="i.isNeedBlurMethon ? i.blurMethon(formData[i.prop]) : () => {}">
+            @blur="i.isNeedBlurMethon ? i.blurMethon(formData[i.prop]) : () => {}"
+            @input="
+              () => {
+                return i.inputFn ? i.inputFn(formData[i.prop]) : () => {};
+              }
+            ">
           </van-field>
           <!-- switch -->
           <van-field v-if="i.type == 'switch'" :label="i.label" :name="i.prop" :required="getRequired(i.prop)">
@@ -515,9 +520,11 @@ const formDataInit = () => {
     }
   }
   // 初始化默认值
+  let cityStatus = true;
   for (let i = 0; i < formConfig.value.length; i++) {
     const element = formConfig.value[i];
-    if (element.type === "cascader" && element.itemType === "city") {
+    if (element.type === "cascader" && element.itemType === "city" && cityStatus) {
+      cityStatus = false;
       cityOptionInit();
       // formData.value[element.prop] = map[element.type];
       // formData.value[element.prop + "Name"] = map[element.type];
@@ -786,9 +793,10 @@ defineExpose({
 
 <style lang="scss" scoped>
 .btn-box {
-  margin-top: 10px;
   width: 100%;
   text-align: center;
+  background: #f2f2f2;
+  padding: 10px 0;
 }
 .row {
   color: #999999;

+ 69 - 0
src/lang/cnLXF.js

@@ -161,9 +161,78 @@ export function cnLXF() {
       name: "销售合同",
       sellCorporation: "归属公司",
       contractType: "合同类型",
+      contractTypeMsg: "请选择合同类型",
       code: "合同编码",
       buyCorporation: "客户名称",
       amount: "合同金额",
+      transactionInformation: "交易信息",
+      commodityInformation: "商品信息",
+      otherCharges: "其他收费",
+      deliveryInformation: "交付信息",
+      shipmentPlan: "出货计划",
+      contractTemplateId: "合同模板",
+      contractTemplateIdMsg: "请选择合同模板",
+      sellerInformation: "卖方信息",
+      buyerInformation: "买方信息",
+      sellCorporationId: "卖方公司",
+      sellCorporationIdMsg: "请选择卖方公司",
+      buyCorporationId: "买方公司",
+      buyCorporationIdMsg: "请选择买方公司",
+      cityText: "所在城市",
+      cityMsg: "请选择所在城市",
+      address: "详细地址",
+      addressMsg: "请输入详细地址",
+      contactName: "联系人",
+      contactNameMsg: "请输入联系人",
+      contactNumber: "联系电话",
+      contactNumberMsg: "请输入联系电话",
+      postalCode: "邮编",
+      postalCodeMsg: "请输入邮编",
+      productId: "商品名称",
+      productIdMsg: "请选择商品",
+      productName: "商品英文名",
+      productNameMsg: "请输入商品英文名",
+      productModel: "规格型号",
+      productModelMsg: "请输入规格型号",
+      quantity: "数量",
+      quantityMsg: "请输入数量",
+      price: "单价",
+      priceMsg: "请输入单价",
+      chargeItem: "收费项目",
+      chargeItemMsg: "请输入收费项目",
+      amount: "金额",
+      amountMsg: "请输入金额",
+      remark: "备注",
+      amountProduct: "合计金额",
+      amountProductPlaceholder: "根据报价明细自动统计",
+      amountProject: "合计金额",
+      amountProjectPlaceholder: "根据收费项目自动统计",
+      collectionInformation: "收款信息",
+      currency: "币种",
+      currencyMsg: "请选择币种",
+      amountAll: "报价总金额",
+      amountAllPlaceholder: "根据报价明细、收费项目自动统计",
+      paymentMethod: "付款方式",
+      paymentMethodMsg: "请选择付款方式",
+      advanceRatio: "预付款比例 (%)",
+      advanceRatioMsg: "请输入预付款比例",
+      shroffAccountId: "收款账号",
+      shroffAccountIdMsg: "请选择收款账号",
+      tradeMethods: "贸易方式",
+      tradeMethodsMsg: "请选择贸易方式",
+      transportMethod: "运输方式",
+      transportMethodMsg: "请选择运输方式",
+      transportRemark: "运输说明",
+      transportRemarkMsg: "请输入运输说明",
+      remarks: "付款条件",
+      remarksMsg: "请输入付款条件",
+      warranty: "质保期 (天)",
+      deliveryTime: "交货期限 (天)",
+      commodity: "商品",
+      productNamePlaceholder: "根据商品信息自动回填",
+      shipmentTime: "出货日期",
+      shipmentTimeMsg: "请选择出货日期",
+      quantityShipment: "出货数量",
     },
   };
   return cnLXF;

+ 457 - 262
src/views/processApproval/components/Contract.vue

@@ -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;

+ 0 - 1
src/views/processApproval/components/SendFunds.vue

@@ -24,7 +24,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";

+ 1 - 1
src/views/salesContract/contract/index.vue

@@ -78,7 +78,7 @@ const listConfig = ref([
   },
   {
     label: proxy.t("contract.contractType"),
-    prop: "contractType",
+    prop: "contractTypeVal",
   },
   {
     label: proxy.t("contract.code"),