Browse Source

采购付款、交接单

cz 1 year ago
parent
commit
a0e394a73e

+ 73 - 0
src/lang/cnLXF.js

@@ -236,6 +236,79 @@ export function cnLXF() {
       productRepeat: "商品选择重复",
       pleaseAddProduct: "请添加商品",
     },
+    priceSheet: {
+      name: "报价单",
+      sellCorporation: "归属公司",
+      code: "报价单号",
+      buyCorporation: "客户名称",
+      amount: "报价金额",
+      status: "审批状态",
+      transactionInformation: "交易信息",
+      quotationDetails: "报价明细",
+      commodityInformation: "商品信息",
+      otherCharges: "其他收费",
+      otherInformation: "其他信息",
+      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: "备注",
+      productRepeat: "商品选择重复",
+      pleaseAddProduct: "请添加商品",
+      amountProduct: "合计金额",
+      amountProductPlaceholder: "根据报价明细自动统计",
+      amountProject: "合计金额",
+      amountProjectPlaceholder: "根据收费项目自动统计",
+      quotedAmount: "报价金额",
+      currency: "币种",
+      currencyMsg: "请选择币种",
+      amountAll: "报价总金额",
+      amountAllPlaceholder: "根据报价明细、收费项目自动统计",
+      effective: "报价有效期 (天)",
+      effectiveMsg: "请输入报价有效期",
+      paymentMethod: "付款方式",
+      paymentMethodMsg: "请选择付款方式",
+      advanceRatio: "预付款比例 (%)",
+      advanceRatioMsg: "请输入预付款比例",
+      deliveryInformation: "交付信息",
+      tradeMethods: "贸易方式",
+      tradeMethodsMsg: "请选择贸易方式",
+      transportMethod: "运输方式",
+      transportMethodMsg: "请选择运输方式",
+      transportRemark: "运输说明",
+      transportRemarkMsg: "请输入运输说明",
+      remarks: "付款条件",
+      remarksMsg: "请输入付款条件",
+      warranty: "质保期 (天)",
+    },
   };
   return cnLXF;
 }

+ 1 - 1
src/views/processApproval/components/Contract.vue

@@ -37,7 +37,7 @@ import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch, r
 import { useRoute } from "vue-router";
 import testForm from "@/components/testForm/index.vue";
 import { getUserInfo } from "@/utils/auth";
-import { showSuccessToast, showFailToast } from "vant";
+import { showFailToast } from "vant";
 
 // 接收父组件的传值
 const props = defineProps({

+ 773 - 0
src/views/processApproval/components/PriceSheet.vue

@@ -0,0 +1,773 @@
+<template>
+  <div class="form">
+    <van-tabs v-model:active="active">
+      <van-tab :title="proxy.t('priceSheet.transactionInformation')" />
+      <van-tab :title="proxy.t('priceSheet.quotationDetails')" />
+      <van-tab :title="proxy.t('priceSheet.otherCharges')" />
+      <van-tab :title="proxy.t('priceSheet.otherInformation')" />
+      <div class="common-process-card" v-show="active == 0">
+        <div class="common-title">{{ proxy.t("priceSheet.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("priceSheet.quotationDetails") }}</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("priceSheet.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("priceSheet.otherInformation") }}</div>
+        <testForm v-model="formData.data" :formOption="formOption" :formConfig="formDeliveryConfig" :rules="rulesTwo" ref="formDom6"> </testForm>
+      </div>
+    </van-tabs>
+  </div>
+</template>
+
+<script setup>
+import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch, reactive } from "vue";
+import { useRoute } from "vue-router";
+import testForm from "@/components/testForm/index.vue";
+import { getUserInfo } from "@/utils/auth";
+import { showFailToast } from "vant";
+
+// 接收父组件的传值
+const props = defineProps({
+  queryData: String,
+});
+const proxy = getCurrentInstance().proxy;
+const route = useRoute();
+const active = ref(0);
+const formData = reactive({
+  data: {
+    quotationProductList: [],
+    quotationPayList: [],
+  },
+});
+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 formOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+});
+const formConfig = reactive([
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.contractTemplateId"),
+    prop: "contractTemplateId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, data) => {
+      proxy.formChange(val, data, formData);
+      formData.data.sellCorporationId = "";
+      formData.data.sellCountryName = "";
+      formData.data.sellProvinceName = "";
+      formData.data.sellCityName = "";
+      formData.data.sellAddress = "";
+      formData.data.sellContactName = "";
+      formData.data.sellContactNumber = "";
+      if (val.selectedValues[0]) {
+        proxy.post("/contractTemplate/detail", { id: val.selectedValues[0] }).then((res) => {
+          formData.data.sellCorporationId = res.data.corporationId;
+          if (res.data.corporationId) {
+            proxy.post("/corporation/detail", { id: res.data.corporationId }).then((detailCorporation) => {
+              let sellCity = "";
+              if (detailCorporation.data.countryEnStr) {
+                formData.data.sellCountryName = detailCorporation.data.countryEnStr;
+                sellCity = detailCorporation.data.countryEnStr;
+              }
+              if (detailCorporation.data.provinceEnStr) {
+                formData.data.sellProvinceName = detailCorporation.data.provinceEnStr;
+                sellCity = sellCity + " " + detailCorporation.data.provinceEnStr;
+              }
+              if (detailCorporation.data.cityEnStr) {
+                formData.data.sellCityName = detailCorporation.data.cityEnStr;
+                sellCity = sellCity + " " + detailCorporation.data.cityEnStr;
+              }
+              if (detailCorporation.data.addressEn) {
+                formData.data.sellAddress = detailCorporation.data.addressEn;
+              }
+              formData.data.sellCity = sellCity;
+              formDom1.value.formDataShowLabelOne();
+            });
+          }
+          formData.data.sellContactName = res.data.contactName;
+          formData.data.sellContactNumber = res.data.contactNumber;
+          formDom1.value.formDataShowLabelOne();
+        });
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "title",
+    title: proxy.t("priceSheet.sellerInformation"),
+  },
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.sellCorporationId"),
+    prop: "sellCorporationId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    readonly: true,
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.cityText"),
+    prop: "sellCity",
+    itemType: "text",
+    readonly: true,
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.address"),
+    prop: "sellAddress",
+    itemType: "textarea",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.contactName"),
+    prop: "sellContactName",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.contactNumber"),
+    prop: "sellContactNumber",
+    itemType: "text",
+  },
+  {
+    type: "title",
+    title: proxy.t("priceSheet.buyerInformation"),
+  },
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.buyCorporationId"),
+    prop: "buyCorporationId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, data) => {
+      proxy.formChange(val, data, formData);
+      formData.data.buyContactName = "";
+      formData.data.buyContactNumber = "";
+      if (val.selectedValues[0]) {
+        proxy.post("/customer/detail", { id: val.selectedValues[0] }).then((res) => {
+          if (res.data.customerUserList && res.data.customerUserList.length > 0) {
+            formData.data.buyContactName = res.data.customerUserList[0].name;
+            if (res.data.customerUserList[0].contactJson) {
+              let contactJson = JSON.parse(res.data.customerUserList[0].contactJson);
+              if (contactJson && contactJson.length > 0) {
+                formData.data.buyContactNumber = contactJson[0].contactNo;
+              }
+            }
+          }
+          let cityName = "";
+          if (res.data.countryName) {
+            cityName = res.data.countryName;
+            if (res.data.provinceName) {
+              cityName = cityName + " " + res.data.provinceName;
+              if (res.data.cityName) {
+                cityName = cityName + " " + res.data.cityName;
+              }
+            }
+          }
+          formData.data.cityName = cityName;
+          if (res.data.cityId) {
+            formData.data.city = res.data.cityId;
+          } else if (res.data.provinceId) {
+            formData.data.city = res.data.provinceId;
+          } else if (res.data.countryId) {
+            formData.data.city = res.data.countryId;
+          } else {
+            formData.data.city = "";
+          }
+          formData.data.countryId = res.data.countryId;
+          formData.data.provinceId = res.data.provinceId;
+          formData.data.cityId = res.data.cityId;
+          formData.data.buyPostalCode = res.data.zipCode;
+          formData.data.buyAddress = res.data.address;
+        });
+      } else {
+        formData.data.countryId = "";
+        formData.data.provinceId = "";
+        formData.data.cityId = "";
+        formData.data.buyPostalCode = "";
+        formData.data.buyAddress = "";
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "cascader",
+    label: proxy.t("priceSheet.cityText"),
+    prop: "city",
+    itemType: "city",
+    showPicker: false,
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.address"),
+    prop: "buyAddress",
+    itemType: "textarea",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.postalCode"),
+    prop: "buyPostalCode",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.contactName"),
+    prop: "buyContactName",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.contactNumber"),
+    prop: "buyContactNumber",
+    itemType: "text",
+  },
+]);
+const formGoodsOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+  btnConfig: {
+    isNeed: true,
+    prop: "quotationProductList",
+    plain: true,
+    listTitle: proxy.t("priceSheet.commodityInformation"),
+    listConfig: [
+      {
+        type: "picker",
+        label: proxy.t("priceSheet.productId"),
+        prop: "productId",
+        itemType: "onePicker",
+        showPicker: false,
+        readonly: false,
+        fieldNames: {
+          text: "label",
+          value: "value",
+        },
+        data: [],
+        changeFn: (val, data, index, indexTwo, propName) => {
+          let selectList = formData.data[propName].filter((item, itemIndex) => item[data.prop] === val.selectedValues[0] && itemIndex !== index);
+          if (selectList && selectList.length > 0) {
+            return showFailToast(proxy.t("priceSheet.productRepeat"));
+          }
+          formData.data[propName][index][data.prop] = val.selectedValues[0];
+          let list = data.data.filter((item) => item[data.fieldNames.value] == val.selectedValues[0]);
+          if (list && list.length > 0) {
+            formData.data[propName][index][data.prop + "Name"] = list[0][data.fieldNames.text];
+            let name = list[0].name;
+            if (list[0].standardJson) {
+              let standardJson = JSON.parse(list[0].standardJson);
+              if (standardJson && standardJson.englishName) {
+                name = standardJson.englishName;
+              }
+            }
+            formData.data[propName][index].productName = name;
+            formData.data[propName][index].productModel = list[0].spec;
+          } else {
+            formData.data[propName][index][data.prop + "Name"] = "";
+          }
+          formData.data[propName][index].quantity = null;
+          formData.data[propName][index].price = null;
+          formData.data[propName][index].amount = null;
+          formData.data[propName][index].remark = null;
+          data.showPicker = false;
+        },
+      },
+      {
+        type: "input",
+        label: proxy.t("priceSheet.productName"),
+        prop: "productName",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: proxy.t("priceSheet.productModel"),
+        prop: "productModel",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: proxy.t("priceSheet.quantity"),
+        prop: "quantity",
+        itemType: "number",
+        changeFn: () => {
+          calculatedAmount();
+        },
+      },
+      {
+        type: "input",
+        label: proxy.t("priceSheet.price"),
+        prop: "price",
+        itemType: "number",
+        changeFn: () => {
+          calculatedAmount();
+        },
+      },
+    ],
+    clickFn: () => {
+      if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+        formData.data.quotationProductList.push({
+          productId: null,
+          productName: null,
+          productModel: null,
+          quantity: null,
+          price: null,
+          amount: null,
+          remark: null,
+        });
+      } else {
+        formData.data.quotationProductList = [
+          {
+            productId: null,
+            productName: null,
+            productModel: null,
+            quantity: null,
+            price: null,
+            amount: null,
+            remark: null,
+          },
+        ];
+      }
+    },
+    deleteFn: (index) => {
+      formData.data.quotationProductList.splice(index, 1);
+      handleChangeAmount();
+    },
+  },
+});
+const formEmptyConfig = reactive([]);
+const formAmountProductConfig = reactive([
+  {
+    type: "input",
+    label: proxy.t("priceSheet.amountProduct"),
+    prop: "amountProduct",
+    itemType: "text",
+    readonly: true,
+    placeholder: proxy.t("priceSheet.amountProductPlaceholder"),
+  },
+]);
+const formAmountProjectConfig = reactive([
+  {
+    type: "input",
+    label: proxy.t("priceSheet.amountProject"),
+    prop: "amountProject",
+    itemType: "text",
+    readonly: true,
+    placeholder: proxy.t("priceSheet.amountProjectPlaceholder"),
+  },
+]);
+const formProjectOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+  btnConfig: {
+    isNeed: true,
+    prop: "quotationPayList",
+    plain: true,
+    listTitle: proxy.t("priceSheet.chargeItem"),
+    listConfig: [
+      {
+        type: "input",
+        label: proxy.t("priceSheet.chargeItem"),
+        prop: "payName",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: proxy.t("priceSheet.amount"),
+        prop: "amount",
+        itemType: "number",
+        changeFn: () => {
+          handleChangeAmount();
+        },
+      },
+      {
+        type: "input",
+        label: proxy.t("priceSheet.remark"),
+        prop: "remark",
+        itemType: "textarea",
+      },
+    ],
+    clickFn: () => {
+      if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
+        formData.data.quotationPayList.push({
+          payName: null,
+          amount: null,
+          remark: null,
+        });
+      } else {
+        formData.data.quotationPayList = [
+          {
+            payName: null,
+            amount: null,
+            remark: null,
+          },
+        ];
+      }
+    },
+    deleteFn: (index) => {
+      formData.data.quotationPayList.splice(index, 1);
+      handleChangeAmount();
+    },
+  },
+});
+const formDeliveryConfig = reactive([
+  {
+    type: "title",
+    title: proxy.t("priceSheet.quotedAmount"),
+  },
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.currency"),
+    prop: "currency",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.amountAll"),
+    prop: "amount",
+    itemType: "text",
+    readonly: true,
+    placeholder: proxy.t("priceSheet.amountAllPlaceholder"),
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.effective"),
+    prop: "effective",
+    itemType: "digit",
+  },
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.paymentMethod"),
+    prop: "paymentMethod",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.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: "title",
+    title: proxy.t("priceSheet.deliveryInformation"),
+  },
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.tradeMethods"),
+    prop: "tradeMethods",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "picker",
+    label: proxy.t("priceSheet.transportMethod"),
+    prop: "transportMethod",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.transportRemark"),
+    prop: "transportRemark",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.remarks"),
+    prop: "remark",
+    itemType: "textarea",
+  },
+  {
+    type: "input",
+    label: proxy.t("priceSheet.warranty"),
+    prop: "warranty",
+    itemType: "digit",
+  },
+]);
+const rules = {
+  contractTemplateId: [{ required: true, message: proxy.t("priceSheet.contractTemplateIdMsg") }],
+  sellCorporationId: [{ required: true, message: proxy.t("priceSheet.sellCorporationIdMsg") }],
+  buyCorporationId: [{ required: true, message: proxy.t("priceSheet.buyCorporationIdMsg") }],
+  sellCity: [{ required: true, message: proxy.t("priceSheet.cityMsg") }],
+  city: [{ required: true, message: proxy.t("priceSheet.cityMsg") }],
+  sellAddress: [{ required: true, message: proxy.t("priceSheet.addressMsg") }],
+  buyAddress: [{ required: true, message: proxy.t("priceSheet.addressMsg") }],
+  sellContactName: [{ required: true, message: proxy.t("priceSheet.contactNameMsg") }],
+  sellContactNumber: [{ required: true, message: proxy.t("priceSheet.contactNumberMsg") }],
+  buyPostalCode: [{ required: true, message: proxy.t("priceSheet.postalCodeMsg") }],
+  buyContactName: [{ required: true, message: proxy.t("priceSheet.contactNameMsg") }],
+  buyContactNumber: [{ required: true, message: proxy.t("priceSheet.contactNumberMsg") }],
+  productId: [{ required: true, message: proxy.t("priceSheet.productIdMsg") }],
+  productName: [{ required: true, message: proxy.t("priceSheet.productNameMsg") }],
+  productModel: [{ required: true, message: proxy.t("priceSheet.productModelMsg") }],
+  quantity: [{ required: true, message: proxy.t("priceSheet.quantityMsg") }],
+  price: [{ required: true, message: proxy.t("priceSheet.priceMsg") }],
+  payName: [{ required: true, message: proxy.t("priceSheet.chargeItemMsg") }],
+  amount: [{ required: true, message: proxy.t("priceSheet.amountMsg") }],
+};
+const rulesTwo = {
+  currency: [{ required: true, message: proxy.t("priceSheet.currencyMsg") }],
+  effective: [{ required: true, message: proxy.t("priceSheet.effectiveMsg") }],
+  paymentMethod: [{ required: true, message: proxy.t("priceSheet.paymentMethodMsg") }],
+  advanceRatio: [{ required: true, message: proxy.t("priceSheet.advanceRatioMsg") }],
+  tradeMethods: [{ required: true, message: proxy.t("priceSheet.tradeMethodsMsg") }],
+  transportMethod: [{ required: true, message: proxy.t("priceSheet.transportMethodMsg") }],
+  transportRemark: [{ required: true, message: proxy.t("priceSheet.transportRemarkMsg") }],
+  remark: [{ required: true, message: proxy.t("priceSheet.remarksMsg") }],
+};
+const getDict = () => {
+  let query = {
+    pageNum: 1,
+    pageSize: 999,
+    tenantId: getUserInfo().tenantId,
+  };
+  proxy.post("/contractTemplate/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formConfig[0].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[2].data = res.data.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formConfig[8].data = res.data.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "1" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formGoodsOption.btnConfig.listConfig[0].data = res.data.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "account_currency" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formDeliveryConfig[1].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "funds_payment_method" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formDeliveryConfig[4].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "trade_mode" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formDeliveryConfig[7].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "shipping_method" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formDeliveryConfig[8].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+};
+getDict();
+const calculatedAmount = () => {
+  if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+      let money = 0;
+      if (formData.data.quotationProductList[i].quantity && formData.data.quotationProductList[i].price) {
+        money = parseFloat(Number(formData.data.quotationProductList[i].quantity) * Number(formData.data.quotationProductList[i].price)).toFixed(2);
+      }
+      formData.data.quotationProductList[i].amount = money;
+    }
+  }
+  handleChangeAmount();
+};
+const handleChangeAmount = () => {
+  let money = 0;
+  let amountProduct = 0;
+  let amountProject = 0;
+  if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+      if (formData.data.quotationProductList[i].amount) {
+        money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
+        amountProduct = parseFloat(Number(amountProduct) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
+      }
+    }
+  }
+  if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
+    for (let i = 0; i < formData.data.quotationPayList.length; i++) {
+      if (formData.data.quotationPayList[i].amount) {
+        money = parseFloat(Number(money) + Number(formData.data.quotationPayList[i].amount)).toFixed(2);
+        amountProject = parseFloat(Number(amountProject) + Number(formData.data.quotationPayList[i].amount)).toFixed(2);
+      }
+    }
+  }
+  formData.data.amount = money;
+  formData.data.amountProduct = amountProduct;
+  formData.data.amountProject = amountProject;
+};
+const handleSubmit = async () => {
+  const flag = await formDom1.value.validateForm().then((status) => {
+    if (status) {
+      active.value = 3;
+      return false;
+    } else {
+      if (!(formData.data.quotationProductList && formData.data.quotationProductList.length > 0)) {
+        active.value = 1;
+        showFailToast(proxy.t("priceSheet.pleaseAddProduct"));
+        return false;
+      }
+      return formDom2.value.validateForm().then((status1) => {
+        if (status1) {
+          active.value = 1;
+          return false;
+        } else {
+          return formDom4.value.validateForm().then((status2) => {
+            if (status2) {
+              active.value = 2;
+              return false;
+            } else {
+              return formDom6.value.validateForm().then((status3) => {
+                if (status3) {
+                  active.value = 3;
+                  return false;
+                } else {
+                  return true;
+                }
+              });
+            }
+          });
+        }
+      });
+    }
+  });
+  if (flag) {
+    return formData.data;
+  }
+};
+watch(
+  props.queryData,
+  () => {
+    if (props.queryData && [10, 20, 30].includes(route.query.processType)) {
+      for (const key in props.queryData) {
+        formData.data[key] = props.queryData[key];
+      }
+    }
+  },
+  {
+    deep: true,
+  }
+);
+defineExpose({
+  handleSubmit,
+});
+onMounted(() => {});
+</script>
+<style lang="scss" scoped></style>

+ 49 - 21
src/views/processApproval/components/SendPurchase.vue

@@ -248,16 +248,15 @@ const timeOnConfirm = ({ selectedValues }) => {
 
 const getDict = () => {
   proxy
-    .post("/supplierPrice/page", { pageNum: 1, pageSize: 9999 })
+    .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
     .then((res) => {
       supplyList.value = res.data.rows.map((item) => {
         return {
           ...item,
-          text: item.supplierName,
-          value: item.supplierInfoId,
+          text: item.name,
+          value: item.id,
         };
       });
-      console.log(supplyList, 12312312312312);
     });
 
   proxy
@@ -332,26 +331,55 @@ const handleDel = (index) => {
 
 const onClickLeft = () => history.back();
 const formDom = ref(null);
-const handleSubmit = () => {
-  // return formData.value;
+const handleSubmit = async () => {
+  try {
+    const flag = await formDom.value.validate();
+    return { ...formData.value };
+  } catch (error) {
+    return false;
+  }
 };
 const getDtl = (query) => {
-  proxy
-    .post("/subscribeDetail/detail", { ids: JSON.parse(query.ids) })
-    .then((res) => {
-      formData.value.purchaseDetailList = res.data.map((item) => {
-        return {
-          bussinessId: item.bussinessId,
-          productName: item.productName,
-          count2: item.count,
-          subscribeDetailId: item.id,
-          count: null,
-          content: null,
-          price: null,
-          amount: null,
-        };
+  // 是否交接单入口的采购
+  if (query.isReceipt) {
+    proxy
+      .post("/contractProduct/getListDetail", JSON.parse(query.ids))
+      .then((res) => {
+        formData.value.dataResource = "1";
+        formData.value.dataResourceId = query.contractId;
+        formData.value.purchaseDetailList = res.data.map((x) => {
+          let obj = {
+            ...x,
+            dataResource: "1", //来源写死外销合同采购
+            dataResourceId: x.id,
+            bussinessId: x.productId,
+            count2: x.quantity || x.sumPackQuantity || 0,
+            count: x.expendQuantity || 0,
+            price: null,
+            amount: null,
+          };
+          delete obj.id;
+          return obj;
+        });
       });
-    });
+  } else {
+    proxy
+      .post("/subscribeDetail/detail", { ids: JSON.parse(query.ids) })
+      .then((res) => {
+        formData.value.purchaseDetailList = res.data.map((item) => {
+          return {
+            bussinessId: item.bussinessId,
+            productName: item.productName,
+            count2: item.count,
+            subscribeDetailId: item.id,
+            count: null,
+            content: null,
+            price: null,
+            amount: null,
+          };
+        });
+      });
+  }
 };
 defineExpose({
   handleSubmit,

+ 63 - 14
src/views/processApproval/components/SendPurchasePayment.vue

@@ -122,18 +122,23 @@ const formOption = reactive({
         showPicker: false,
         readonly: false,
         fieldNames: {
-          text: "name",
-          value: "id",
+          text: "label",
+          value: "value",
         },
         data: [],
-        changeFn: function (option, item, index, currentSonIndex) {
-          formData.data.list[index][item.prop] = option.selectedOptions[0].id;
-          formData.data.list[index][item.prop + "Name"] =
-            option.selectedOptions[0].name;
+        changeFn: function (option, item, index, currentSonIndex, prop) {
+          proxy.formChangeTwo(
+            option,
+            item,
+            index,
+            currentSonIndex,
+            prop,
+            formData
+          );
           formDom.value.btnConfigCopy.listConfig[
             currentSonIndex
           ].showPicker = false;
-          getStokeQuantity();
+          changePurchaseId(option.selectedValues[0], index);
         },
       },
       {
@@ -163,6 +168,9 @@ const formOption = reactive({
         label: proxy.t("purchasePayment.paymentAmount"),
         prop: "money",
         readonly: false,
+        changeFn: (index, val) => {
+          changeMoney();
+        },
       },
     ],
     clickFn: () => {
@@ -212,8 +220,9 @@ const formConfig = reactive([
     readonly: false,
     needDefault: false,
   },
+  // 先去掉以下选择
   {
-    type: "picker",
+    type: "pickerOne",
     label: proxy.t("purchasePayment.paymentType"),
     prop: "type",
     itemType: "onePicker",
@@ -307,7 +316,7 @@ const formConfigOne = reactive([
     label: proxy.t("purchasePayment.totalPaymentAmount"),
     prop: "amount",
     itemType: "number",
-    readonly: false,
+    readonly: true,
   },
   {
     type: "picker",
@@ -394,12 +403,34 @@ const changeSupply = (val) => {
       } else {
         contractList.value = [];
       }
+      formOption.btnConfig.listConfig[0].data = contractList.value;
     });
   } else {
     contractList.value = [];
   }
   formData.data.payDetailList = [];
 };
+const changeMoney = () => {
+  let money = 0;
+  for (let i = 0; i < formData.data.payDetailList.length; i++) {
+    if (formData.data.payDetailList[i].money) {
+      money = parseFloat(
+        Number(money) + Number(formData.data.payDetailList[i].money)
+      ).toFixed(2);
+    }
+  }
+  formData.data.amount = money;
+};
+const changePurchaseId = (val, index) => {
+  const current = contractList.value.find((x) => x.value === val);
+  if (current) {
+    formData.data.payDetailList[index].amount = current.amount;
+    formData.data.payDetailList[index].sumPayMoney = current.sumPayMoney;
+    formData.data.payDetailList[index].sumInvoiceMoney =
+      current.sumInvoiceMoney;
+  } else {
+  }
+};
 const changeType = (val) => {
   if (val == "1") {
     formConfig[3].type = "picker";
@@ -478,11 +509,29 @@ const getDict = () => {
 getDict();
 
 const handleSubmit = async () => {
-  if (formData.data.payDetailList && formData.data.payDetailList.length > 0) {
-    console.log(formDom.value.testForm.value.submit(), "ss");
-  } else {
-    showFailToast(proxy.t("purchasePayment.pleaseAddPaymentDetails"));
-    return false;
+  const data = await formDom.value.validateForm().then((status) => {
+    if (status) {
+      return false;
+    } else {
+      if (
+        formData.data.payDetailList &&
+        formData.data.payDetailList.length > 0
+      ) {
+        return formDomOne.value.validateForm().then((status1) => {
+          if (status1) {
+            return false;
+          } else {
+            return true;
+          }
+        });
+      } else {
+        showFailToast(proxy.t("purchasePayment.pleaseAddPaymentDetails"));
+        return false;
+      }
+    }
+  });
+  if (data) {
+    return { ...formData.data };
   }
 };
 

+ 8 - 0
src/views/processApproval/processDtl.vue

@@ -94,6 +94,7 @@ import { ref, getCurrentInstance, onMounted, reactive } from 'vue'
 import { useRoute } from 'vue-router'
 import SendSubscribe from './components/SendSubscribe'
 import SendFunds from './components/SendFunds'
+import PriceSheet from './components/PriceSheet'
 import Contract from './components/Contract'
 import SendPurchase from './components/SendPurchase'
 import SendPurchasePayment from './components/SendPurchasePayment'
@@ -139,11 +140,17 @@ let componentObj = ref({
 		component: SendFunds,
 		backUrl: '/main/funds',
 	},
+	sale_quotation_flow: {
+		title: '报价单',
+		component: PriceSheet,
+		backUrl: '/main/priceSheet',
+	},
 	contract_flow: {
 		title: '销售合同',
 		component: Contract,
 		backUrl: '/main/contract',
 	},
+	
 		purchase_flow: {
 		title: '采购',
 		component: SendPurchase,
@@ -187,6 +194,7 @@ const handleSelectUser = () => {
 }
 const handleSubmit = async (_type) => {
 	const childrenData = await makeDom.value.handleSubmit()
+	console.log(childrenData,'www');
 	if (childrenData) {
 		if (route.query.processType == 10 || route.query.processType == 30) {
 			proxy

+ 1 - 1
src/views/procurementManagement/procureList/index.vue

@@ -92,7 +92,7 @@ const onClickRight = () => {
       path: "/main/processDtl",
       query: {
         flowKey: "purchase_flow",
-        // ids: JSON.stringify(ids),
+        ids: JSON.stringify(ids),
       },
     });
   } else {

+ 20 - 8
src/views/procurementManagement/receipt/index.vue

@@ -107,12 +107,19 @@ const getList = (type) => {
 };
 const toDtl = (row) => {};
 const onClickRight = () => {
-  proxy.$router.push({
-    path: "/main/processDtl",
-    query: {
-      flowKey: "pay_flow",
-    },
-  });
+  if (ids && ids.length > 0) {
+    proxy.$router.push({
+      path: "/main/processDtl",
+      query: {
+        isReceipt: true,
+        flowKey: "purchase_flow",
+        ids: JSON.stringify(ids),
+        contractId: selectData.value[0].contractId,
+      },
+    });
+  } else {
+    return showFailToast(proxy.t("procureList.pleaseCheckTheData"));
+  }
 };
 const listConfig = ref([
   {
@@ -136,8 +143,13 @@ const listConfig = ref([
     prop: "expendQuantity",
   },
 ]);
-const handleSelectData = (data) => {
-  console.log(data, "sss");
+let ids = [];
+let selectData = ref([]);
+const handleSelectData = (row) => {
+  selectData.value = row;
+  row.map((i) => {
+    ids.push(i.id);
+  });
 };
 </script>
 

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

@@ -65,7 +65,7 @@ const toDtl = (row) => {
   // proxy.$router.push({
   //   path: "/main/processDtl",
   //   query: {
-  //     flowKey: "account_request_funds_flow",
+  //     flowKey: "contract_flow",
   //     id: row.flowInfoId,
   //     processType: 20,
   //   },

+ 50 - 26
src/views/salesContract/priceSheet/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <van-nav-bar :title="$t('funds.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+  <van-nav-bar :title="$t('priceSheet.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
     <template #right>{{ $t("common.add") }}</template>
   </van-nav-bar>
   <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
@@ -21,7 +21,7 @@ const onClickRight = () => {
   proxy.$router.push({
     path: "/main/processDtl",
     query: {
-      flowKey: "account_request_funds_flow",
+      flowKey: "sale_quotation_flow",
     },
   });
 };
@@ -37,30 +37,50 @@ const onRefresh = () => {
 };
 const loading = ref(false);
 const listData = ref([]);
+const status = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "作废",
+    value: 70,
+  },
+  {
+    label: "终止",
+    value: 99,
+  },
+]);
 const getList = (type) => {
   loading.value = true;
   proxy
-    .post("/accountRequestFunds/page", req.value)
+    .post("/saleQuotation/page", req.value)
     .then((res) => {
       if (res.data.rows && res.data.rows.length > 0) {
         res.data.rows = res.data.rows.map((item) => {
-          let fundsText = "";
-          if (item.status == 10) {
-            fundsText = "审批中";
-          } else if (item.status == 20) {
-            fundsText = "驳回";
-          } else if (item.status == 30) {
-            fundsText = "审批通过";
-          }
-          if (item.accountPaymentStatus == "10") {
-            fundsText = fundsText + ", " + "已打款";
-          } else if (item.accountPaymentStatus == "20") {
-            fundsText = fundsText + ", " + "未打款";
+          let statusText = "";
+          if (item.status) {
+            let list = status.value.filter((itemStatus) => itemStatus.value == item.status);
+            if (list && list.length > 0) {
+              statusText = list[0].label;
+            }
           }
           return {
             ...item,
-            currencyTotal: item.currency + " " + item.total,
-            fundsText: fundsText,
+            currencyAmount: item.currency + " " + item.amount,
+            statusText: statusText,
           };
         });
       }
@@ -79,7 +99,7 @@ const toDtl = (row) => {
   // proxy.$router.push({
   //   path: "/main/processDtl",
   //   query: {
-  //     flowKey: "account_request_funds_flow",
+  //     flowKey: "sale_quotation_flow",
   //     id: row.flowInfoId,
   //     processType: 20,
   //   },
@@ -87,20 +107,24 @@ const toDtl = (row) => {
 };
 const listConfig = ref([
   {
-    label: proxy.t("funds.createTime"),
-    prop: "createTime",
+    label: proxy.t("priceSheet.sellCorporation"),
+    prop: "sellCorporationName",
+  },
+  {
+    label: proxy.t("priceSheet.code"),
+    prop: "code",
   },
   {
-    label: proxy.t("funds.currencyTotal"),
-    prop: "currencyTotal",
+    label: proxy.t("priceSheet.buyCorporation"),
+    prop: "buyCorporationName",
   },
   {
-    label: proxy.t("funds.paymentRemarks"),
-    prop: "paymentRemarks",
+    label: proxy.t("priceSheet.amount"),
+    prop: "currencyAmount",
   },
   {
-    label: proxy.t("funds.fundsText"),
-    prop: "fundsText",
+    label: proxy.t("priceSheet.status"),
+    prop: "statusText",
   },
 ]);
 </script>