Browse Source

Merge branch 'stage' of http://36.137.93.232:3000/hf/byte-sailing-new into stage

cz 1 year ago
parent
commit
1072b0bdcd

File diff suppressed because it is too large
+ 0 - 0
src/assets/styles/iconfont.js


+ 7 - 0
src/assets/styles/index.scss

@@ -221,4 +221,11 @@ aside {
 .public_height_dialog {
   height: calc(100vh - 260px);
   overflow: auto;
+}
+
+.icon {
+  width: 1em; height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
 }

+ 1 - 1
src/components/byForm/index.vue

@@ -113,7 +113,7 @@
             @change="(e) => commonsEmit(e, i)"
             :disabled="i.disabled ? i.disabled : false"
             :format="i.format ? i.format : dateFormatInit(i.itemType)"
-            :value-format="i.format ? i.format : dateFormatInit(i.itemType)" />
+            :value-format="i.format ? i.format : dateFormatInit(i.itemType)" :style="i.style" />
           <el-switch
             :disabled="i.disabled ? i.disabled : false"
             v-else-if="i.type == 'switch'"

+ 1 - 1
src/main.js

@@ -13,7 +13,7 @@ import App from './App'
 import store from './store'
 import router from './router'
 import directive from './directive' // directive
-
+import './assets/styles/iconfont.js'
 
 
 // 注册指令

+ 5 - 2
src/views/customer/portrait/com/CustomerInfo.vue

@@ -16,8 +16,11 @@
     </div>
     <div class="line" style="word-break: break-all">
       <span class="title_">地址:</span>
-      <i :class="'iconfont icon-' + detailsData.countryIcon" style="margin-right: 10px"></i>
-      <span>
+      <svg class="icon" aria-hidden="true">
+          <use :xlink:href="'#' + detailsData.countryIcon"></use>
+      </svg>
+      <!-- <i :class="'iconfont ' + detailsData.countryIcon" style="margin-right: 10px"></i> -->
+      <span style="margin-left:5px;">
         {{ detailsData.countryName }} , {{ detailsData.provinceName }} , {{ detailsData.cityName }}
         <span v-show="detailsData.address"> , {{ detailsData.address }}</span>
       </span>

+ 14 - 2
src/views/dataBoard/board/salesAnalysis/index.vue

@@ -90,6 +90,18 @@
             :hidePagination="true"
             :selectConfig="[]"
           >
+          <template #flag="{ item }">
+          <div>
+            <div>
+              <svg class="icon" aria-hidden="true">
+                  <use :xlink:href="'#' + item.countryIcon"></use>
+              </svg>
+              
+              {{ item.countryName }}
+            </div>
+            
+          </div>
+        </template>
           </byTable>
         </el-col>
       </el-row>
@@ -350,8 +362,8 @@ const scatterConfig = computed(() => {
     },
     {
       attrs: {
-        label: "国",
-        prop: "countryName",
+        label: "国",
+        slot: "flag",
       },
     },
     {

+ 410 - 0
src/views/finance/fundManage/accountStatement/index.vue

@@ -10,6 +10,14 @@
         highlight-current-row
         :action-list="[
           {
+            text: '添加借款',
+            action: () => addloan(),
+          },
+          {
+            text: '导出Excel',
+            action: () => deriveExcel(),
+          },
+          {
             text: '内部转账',
             action: () => openTransferMoney('add'),
           },
@@ -21,6 +29,10 @@
             text: '添加流水',
             action: () => openModal('add'),
           },
+          {
+            text: '结汇',
+            action: () => openSettlementModal('add'),
+          },
         ]"
         @get-list="getList"
       >
@@ -83,6 +95,29 @@
         >
       </template>
     </el-dialog>
+    <!-- 结汇 -->
+    <el-dialog
+      title="结汇" 
+      v-if="settlementModal"
+      v-model="settlementModal"
+      width="600"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="settlementFormConfig"
+        :formOption="formOption"
+        v-model="formData3.data"
+        :rules="rules"
+        ref="submit"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
     <el-dialog
       :title="modalType == 'add' ? '添加流水' : '编辑流水'"
       v-if="dialogVisible"
@@ -279,6 +314,48 @@
         >
       </template>
     </el-dialog>
+
+    <el-dialog
+      :title="submitType == 'add' ? '添加借款' : '还款'"
+      v-if="openLoanDialog"
+      v-model="openLoanDialog"
+      width="500"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="loanFormConfig"
+        :formOption="formOption"
+        :rules="loanRules"
+        v-model="formData.loanData"
+        ref="byform"
+      >
+        <template #loanUserName>
+          <div style="width: 100%">
+            <el-autocomplete
+              v-model="formData.loanData.loanUserName"
+              value-key="loanUserName"
+              :fetch-suggestions="querySearch"
+              :disabled="submitType == 'edit'"
+              clearable
+              class="inline-input w-50"
+              placeholder="请输入"
+            />
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openLoanDialog = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="handleSubmitLoan()"
+          size="large"
+          :loading="submitLoading"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -295,6 +372,7 @@ const { proxy } = getCurrentInstance();
 const accountCurrency = ref([]);
 const accountList = ref([]);
 const contractList = ref([]);
+const corporationList = ref([]);
 const status = ref([
   {
     label: "收入",
@@ -662,10 +740,23 @@ const getDict = () => {
       contractList.value = res.rows;
     });
 
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      corporationList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+
   Promise.all([getCurrency(), getAccountList()]).then(() => {
     getList();
   });
 };
+
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -698,6 +789,112 @@ const formData = reactive({
     taxRefundDetailsList: [],
   },
 });
+
+const settlementModal = ref(false);
+const openSettlementModal = (type, row) => {
+  modalType.value = type;
+  if (type == "add") {
+    formData2.data = {
+      transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
+    };
+  } else {
+    formData2.data = { ...row };
+  }
+  settlementModal.value = true;
+};
+
+const formData3 = reactive({
+  data: {},
+});
+
+const settlementFormConfig = computed(() => {
+  return [
+    {
+      type: "title",
+      title: "结汇信息",
+    },
+    {
+      type: "select",
+      prop: "accountManagementId",
+      label: "汇出账户",
+      data: accountList.value,
+    },
+    {
+      type: "selectInput",
+      label: "汇出金额",
+      prop: "amount",
+      itemWidth: 60,
+      data: accountCurrency.value,
+      placeholder: "请输入",
+      selectPlaceholder: "币种",
+      selectProp: "currency",
+      fn: (value) => {
+        //判断value的类型
+        if (isNaN(value)) {
+          formData3.data.inCurrency = formData3.data.currency;
+          formData3.data.commissionCurrency = formData3.data.currency;
+        } else {
+          if (value != "") {
+            if (value.indexOf(".") > -1) {
+              formData3.data.amount = value.slice(0, value.indexOf(".") + 3);
+            } else {
+              formData3.data.amount = value;
+            }
+          }
+          formData3.data.inAmount = formData3.data.amount;
+        }
+      },
+    },
+    {
+      type: "select",
+      prop: "inAccountManagementId",
+      label: "汇入账户",
+      data: accountList.value,
+    },
+    {
+      type: "selectInput",
+      label: "汇出金额",
+      prop: "inAmount",
+      itemWidth: 60,
+      data: accountCurrency.value,
+      placeholder: "请输入",
+      selectPlaceholder: "币种",
+      selectProp: "inCurrency",
+      fn: (value) => {
+        //判断value的类型
+        if (isNaN(value)) {
+          formData2.data.inCurrency = formData2.data.currency;
+          formData2.data.commissionCurrency = formData2.data.currency;
+        } else {
+          if (value != "") {
+            if (value.indexOf(".") > -1) {
+              formData2.data.amount = value.slice(0, value.indexOf(".") + 3);
+            } else {
+              formData2.data.amount = value;
+            }
+          }
+          formData2.data.inAmount = formData2.data.amount;
+        }
+      },
+    },
+    {
+      type: "input",
+      prop: "rate",
+      label: "汇率",
+      itemType: "text",
+    },
+    {
+      type: "selectInput",
+      label: "手续费",
+      prop: "commissionAmount",
+      itemWidth: 60,
+      data: accountCurrency.value,
+      placeholder: "请输入",
+      selectPlaceholder: "币种",
+      selectProp: "commissionCurrency",
+    },
+  ];
+});
 const formConfig = computed(() => {
   return [
     {
@@ -1151,6 +1348,219 @@ const printObj = ref({
 const clickDownload = () => {
   proxy.getPdf("外销合同PDF文件");
 };
+
+const loanRules = ref({
+  corporationId: [
+    { required: true, message: "请选择归属公司", trigger: "change" },
+  ],
+  loanUserName: [{ required: true, message: "请输入借款人", trigger: "blur" }],
+  loanTime: [{ required: true, message: "请选择借款时间", trigger: "change" }],
+  currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  amount: [{ required: true, message: "请输入借款金额", trigger: "blur" }],
+  loanAccountId: [
+    { required: true, message: "请选择付款账户", trigger: "change" },
+  ],
+  repaymentAccountId: [
+    { required: true, message: "请选择收款账户", trigger: "change" },
+  ],
+  amountOne: [{ required: true, message: "请输入还款金额", trigger: "blur" }],
+  repaymentTime: [
+    { required: true, message: "请选择还款时间", trigger: "change" },
+  ],
+});
+const loanFormConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "corporationId",
+      label: "归属公司",
+      data: corporationList.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "slot",
+      prop: "loanUserName",
+      label: "借款人",
+      slotName: "loanUserName",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "loanTime",
+      label: "借款时间",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "借款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 25,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amount",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      disabled: submitType.value != "add",
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "loanAccountId",
+      label: "付款账户",
+      data: accountList.value,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      clearable: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarks",
+      label: "备注",
+      disabled: submitType.value != "add",
+    },
+    submitType.value != "add"
+      ? {
+          type: "title",
+          title: "还款信息",
+        }
+      : {},
+    {
+      type: "select",
+      prop: "repaymentAccountId",
+      label: "收款账户",
+      data: accountList.value,
+      itemWidth: 100,
+      clearable: true,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "还款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      itemWidth: 25,
+      isShow: submitType.value != "add",
+      disabled: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amountOne",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 30,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "repaymentTime",
+      label: "还款时间",
+      itemWidth: 100,
+      isShow: submitType.value != "add",
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarksOne",
+      label: "备注",
+      isShow: submitType.value != "add",
+    },
+  ];
+});
+
+const openLoanDialog = ref(false);
+const byform = ref(null);
+const submitLoading = ref(false);
+const submitType = ref("add");
+const historyData = ref([]);
+const addloan = () => {
+  proxy.get("/loanInfo/getLoanUserList").then((res) => {
+    historyData.value = res.data;
+  });
+  formData.loanData = {};
+  openLoanDialog.value = true;
+};
+
+const querySearch = (queryString, cb) => {
+  const results = queryString
+    ? historyData.value.filter(createFilter(queryString))
+    : historyData.value;
+  cb(results);
+};
+
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+
+const handleSubmitLoan = () => {
+  byform.value.handleSubmit(() => {
+    submitLoading.value = true;
+    let requestUrl = "/loanInfo/add";
+    proxy.post(requestUrl, formData.loanData).then(
+      () => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        getList();
+        openLoanDialog.value = false;
+        submitLoading.value = false;
+      },
+      () => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 274 - 0
src/views/finance/fundManage/flow/index.vue

@@ -10,6 +10,10 @@
         highlight-current-row
         :action-list="[
           {
+            text: '添加借款',
+            action: () => addloan(),
+          },
+          {
             text: '导出Excel',
             action: () => deriveExcel(),
           },
@@ -266,6 +270,48 @@
         >
       </template>
     </el-dialog>
+
+    <el-dialog
+      :title="submitType == 'add' ? '添加借款' : '还款'"
+      v-if="openLoanDialog"
+      v-model="openLoanDialog"
+      width="500"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="loanFormConfig"
+        :formOption="formOption"
+        :rules="loanRules"
+        v-model="formData.loanData"
+        ref="byform"
+      >
+        <template #loanUserName>
+          <div style="width: 100%">
+            <el-autocomplete
+              v-model="formData.loanData.loanUserName"
+              value-key="loanUserName"
+              :fetch-suggestions="querySearch"
+              :disabled="submitType == 'edit'"
+              clearable
+              class="inline-input w-50"
+              placeholder="请输入"
+            />
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openLoanDialog = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="handleSubmitLoan()"
+          size="large"
+          :loading="submitLoading"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -281,6 +327,7 @@ import ContractPDF from "@/components/PDF/contractPDF.vue";
 const { proxy } = getCurrentInstance();
 const accountCurrency = ref([]);
 const accountList = ref([]);
+const corporationList = ref([]);
 const status = ref([
   {
     label: "收入",
@@ -476,6 +523,19 @@ const getDict = () => {
         });
       }
     });
+
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      corporationList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+
   proxy
     .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
     .then((res) => {
@@ -526,6 +586,7 @@ const formData = reactive({
   data: {
     isTransaction: "1",
   },
+  loanData: {},
 });
 const formData2 = reactive({
   data: {},
@@ -1065,6 +1126,219 @@ const printObj = ref({
 const clickDownload = () => {
   proxy.getPdf("外销合同PDF文件");
 };
+
+const loanRules = ref({
+  corporationId: [
+    { required: true, message: "请选择归属公司", trigger: "change" },
+  ],
+  loanUserName: [{ required: true, message: "请输入借款人", trigger: "blur" }],
+  loanTime: [{ required: true, message: "请选择借款时间", trigger: "change" }],
+  currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  amount: [{ required: true, message: "请输入借款金额", trigger: "blur" }],
+  loanAccountId: [
+    { required: true, message: "请选择付款账户", trigger: "change" },
+  ],
+  repaymentAccountId: [
+    { required: true, message: "请选择收款账户", trigger: "change" },
+  ],
+  amountOne: [{ required: true, message: "请输入还款金额", trigger: "blur" }],
+  repaymentTime: [
+    { required: true, message: "请选择还款时间", trigger: "change" },
+  ],
+});
+const loanFormConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "corporationId",
+      label: "归属公司",
+      data: corporationList.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "slot",
+      prop: "loanUserName",
+      label: "借款人",
+      slotName: "loanUserName",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "loanTime",
+      label: "借款时间",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "借款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 25,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amount",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      disabled: submitType.value != "add",
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "loanAccountId",
+      label: "付款账户",
+      data: accountList.value,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      clearable: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarks",
+      label: "备注",
+      disabled: submitType.value != "add",
+    },
+    submitType.value != "add"
+      ? {
+          type: "title",
+          title: "还款信息",
+        }
+      : {},
+    {
+      type: "select",
+      prop: "repaymentAccountId",
+      label: "收款账户",
+      data: accountList.value,
+      itemWidth: 100,
+      clearable: true,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "还款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      itemWidth: 25,
+      isShow: submitType.value != "add",
+      disabled: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amountOne",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 30,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "repaymentTime",
+      label: "还款时间",
+      itemWidth: 100,
+      isShow: submitType.value != "add",
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarksOne",
+      label: "备注",
+      isShow: submitType.value != "add",
+    },
+  ];
+});
+
+const openLoanDialog = ref(false);
+const byform = ref(null);
+const submitLoading = ref(false);
+const submitType = ref("add");
+const historyData = ref([]);
+const addloan = () => {
+  proxy.get("/loanInfo/getLoanUserList").then((res) => {
+    historyData.value = res.data;
+  });
+  formData.loanData = {};
+  openLoanDialog.value = true;
+};
+
+const querySearch = (queryString, cb) => {
+  const results = queryString
+    ? historyData.value.filter(createFilter(queryString))
+    : historyData.value;
+  cb(results);
+};
+
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+
+const handleSubmitLoan = () => {
+  byform.value.handleSubmit(() => {
+    submitLoading.value = true;
+    let requestUrl = "/loanInfo/add";
+    proxy.post(requestUrl, formData.loanData).then(
+      () => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        getList();
+        openLoanDialog.value = false;
+        submitLoading.value = false;
+      },
+      () => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 558 - 0
src/views/finance/fundManage/loan/index.vue

@@ -0,0 +1,558 @@
+<template>
+  <div class="tenant">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      highlight-current-row
+      :selectConfig="selectConfig"
+      :action-list="[
+        {
+          text: '添加借款',
+          action: () => openModal(),
+        },
+      ]"
+      @moreSearch="moreSearch"
+      @get-list="getList"
+    >
+      <template #money="{ item }">
+        <div style="width: 100%">
+          <span>{{ item.currency }} {{ moneyFormat(item.amount, 2) }}</span>
+        </div>
+      </template>
+      <template #repaymentStatus="{ item }">
+        <div style="width: 100%">
+          <span
+            style="color: #409eff; cursor: pointer"
+            @click="lookRecords(item)"
+            >{{ dictValueLabel(item.repaymentStatus, status) }}</span
+          >
+        </div>
+      </template>
+    </byTable>
+
+    <el-dialog
+      :title="submitType == 'add' ? '添加借款' : '还款'"
+      v-if="openAddDialog"
+      v-model="openAddDialog"
+      width="500"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        :rules="rules"
+        v-model="formData.data"
+        ref="byform"
+      >
+        <template #loanUserName>
+          <div style="width: 100%">
+            <el-autocomplete
+              v-model="formData.data.loanUserName"
+              value-key="loanUserName"
+              clearable
+              :fetch-suggestions="querySearch"
+              :disabled="submitType == 'edit'"
+              class="inline-input w-50"
+              placeholder="请输入"
+            />
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openAddDialog = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="handleSubmit()"
+          size="large"
+          :loading="submitLoading"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      :title="'还款记录'"
+      v-if="openRecordsDialog"
+      v-model="openRecordsDialog"
+      width="500"
+    >
+      <div
+        v-for="(item, index) in recordsData"
+        :key="item.id"
+        style="margin-bottom: 20px"
+      >
+        <div style="margin-top: 5px; color: #bbbbbb">
+          {{ item.repaymentTime }}
+        </div>
+        <div style="margin-top: 5px">
+          还款金额:{{ item.currency }} {{ moneyFormat(item.amount, 2) }}
+        </div>
+        <div style="margin-top: 5px">登记人:{{ item.createUserName }}</div>
+      </div>
+      <template #footer>
+        <el-button @click="openRecordsDialog = false" size="large"
+          >关 闭</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import useUserStore from "@/store/modules/user";
+import { reactive, ref } from "vue";
+import byForm from "@/components/byForm/index";
+import FundsPDF from "@/components/PDF/fundsPDF.vue";
+import { ElMessage } from "element-plus";
+
+const loading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    repaymentStatus: "",
+    keyword: "",
+    corporationId: "",
+  },
+});
+const { proxy } = getCurrentInstance();
+const userList = ref([]);
+const accountCurrency = ref([]);
+const accountList = ref([]);
+const corporationList = ref([]);
+const status = ref([
+  {
+    label: "未还款",
+    value: "0",
+  },
+  {
+    label: "部分还款",
+    value: "1",
+  },
+  {
+    label: "已还款",
+    value: "2",
+  },
+]);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "归属公司",
+      prop: "corporationId",
+      data: corporationList.value,
+    },
+    {
+      label: "还款状态",
+      prop: "repaymentStatus",
+      data: status.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "归属公司",
+        prop: "corporationName",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "借款人",
+        prop: "loanUserName",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "借款金额",
+        width: 150,
+        slot: "money",
+      },
+    },
+    {
+      attrs: {
+        label: "还款状态",
+        width: 100,
+        slot: "repaymentStatus",
+      },
+    },
+    {
+      attrs: {
+        label: "借款时间",
+        prop: "loanTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
+        prop: "remarks",
+      },
+    },
+
+    {
+      attrs: {
+        label: "创建人",
+        prop: "createUserName",
+        width: 120,
+      },
+    },
+
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "80",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          row.repaymentStatus != 2
+            ? {
+                attrs: {
+                  label: "还款",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleEdit(row);
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/loanInfo/page", sourceList.value.pagination).then((message) => {
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const getDictData = () => {
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      corporationList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        userList.value = res.rows.map((item) => {
+          return {
+            deptId: item.deptId,
+            label: item.nickName,
+            value: item.userId,
+          };
+        });
+      }
+    });
+
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountList.value = res.rows.map((item) => {
+          return {
+            label: item.alias + " (" + item.name + ")",
+            value: item.id,
+          };
+        });
+      }
+    });
+
+  proxy.getDictOne(["account_currency"]).then((res) => {
+    accountCurrency.value = res["account_currency"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDictData();
+getList();
+
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const rules = ref({
+  corporationId: [
+    { required: true, message: "请选择归属公司", trigger: "change" },
+  ],
+  loanUserName: [{ required: true, message: "请输入借款人", trigger: "blur" }],
+  loanTime: [{ required: true, message: "请选择借款时间", trigger: "change" }],
+  currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  amount: [{ required: true, message: "请输入借款金额", trigger: "blur" }],
+  loanAccountId: [
+    { required: true, message: "请选择付款账户", trigger: "change" },
+  ],
+  repaymentAccountId: [
+    { required: true, message: "请选择收款账户", trigger: "change" },
+  ],
+  amountOne: [{ required: true, message: "请输入还款金额", trigger: "blur" }],
+  repaymentTime: [
+    { required: true, message: "请选择还款时间", trigger: "change" },
+  ],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "corporationId",
+      label: "归属公司",
+      data: corporationList.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "slot",
+      prop: "loanUserName",
+      label: "借款人",
+      slotName: "loanUserName",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "loanTime",
+      label: "借款时间",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "借款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 25,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amount",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      disabled: submitType.value != "add",
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "loanAccountId",
+      label: "付款账户",
+      data: accountList.value,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      clearable: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarks",
+      label: "备注",
+      disabled: submitType.value != "add",
+    },
+    submitType.value != "add"
+      ? {
+          type: "title",
+          title: "还款信息",
+        }
+      : {},
+    {
+      type: "select",
+      prop: "repaymentAccountId",
+      label: "收款账户",
+      data: accountList.value,
+      itemWidth: 100,
+      clearable: true,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "还款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      itemWidth: 25,
+      isShow: submitType.value != "add",
+      disabled: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amountOne",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 30,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "repaymentTime",
+      label: "还款时间",
+      itemWidth: 100,
+      isShow: submitType.value != "add",
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarksOne",
+      label: "备注",
+      isShow: submitType.value != "add",
+    },
+  ];
+});
+const formData = reactive({
+  data: {},
+});
+const openAddDialog = ref(false);
+const byform = ref(null);
+const submitLoading = ref(false);
+const submitType = ref("add");
+const historyData = ref([]);
+const openModal = () => {
+  proxy.get("/loanInfo/getLoanUserList").then((res) => {
+    historyData.value = res.data;
+  });
+  submitType.value = "add";
+  formData.data = {};
+  openAddDialog.value = true;
+};
+
+const querySearch = (queryString, cb) => {
+  const results = queryString
+    ? historyData.value.filter(createFilter(queryString))
+    : historyData.value;
+  cb(results);
+};
+
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+
+const handleSubmit = () => {
+  byform.value.handleSubmit(() => {
+    submitLoading.value = true;
+    let requestUrl = "/loanInfo/add";
+    if (submitType.value != "add") {
+      requestUrl = "/repaymentRecords/add";
+      formData.data.amount = formData.data.amountOne;
+      formData.data.remarks = formData.data.remarksOne;
+    }
+    proxy.post(requestUrl, formData.data).then(
+      () => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        openAddDialog.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      () => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+const handleEdit = (row) => {
+  submitType.value = "edit";
+  proxy.post("/loanInfo/detail", { id: row.id }).then((res) => {
+    formData.data = { ...res, loanId: row.id };
+  });
+  openAddDialog.value = true;
+};
+const openRecordsDialog = ref(false);
+const recordsData = ref([]);
+const lookRecords = (row) => {
+  proxy.post("/repaymentRecords/list", { loanId: row.id }).then((res) => {
+    recordsData.value = res;
+  });
+  openRecordsDialog.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 2 - 2
src/views/process/processApproval/index.vue

@@ -166,11 +166,11 @@
           
           <ul class="flow-chart">
             <li
-              v-for="item in recordList"
+              v-for="(item,index) in recordList"
               :key="item.id"
               :class="
                 !route.query.id
-                  ? ''
+                  ? (index == 0) ? '' : 'flow-grey'
                   : item.status == 2
                   ? 'flow-orange'
                   : item.status == 3 && !route.query.id

+ 13 - 6
src/views/process/processConfig/vueFlow.vue

@@ -452,9 +452,12 @@ const gethandleObjectList = (e,data) => {
 						value: item.userId,
 					}
 				})
-				formData.data = {
-					...data,
+				if(data) {
+					formData.data = {
+						...data,
+					}
 				}
+				
 				if(!data) formData.data.handleObjectId = ''
 			})
 		
@@ -473,8 +476,10 @@ const gethandleObjectList = (e,data) => {
 						value: item.deptId,
 					}
 				})
-				formData.data = {
-					...data,
+				if(data) {
+					formData.data = {
+						...data,
+					}
 				}
 				if(!data) formData.data.handleObjectId = ''
 			})
@@ -495,8 +500,10 @@ const gethandleObjectList = (e,data) => {
 						value: item.roleId,
 					}
 				})
-				formData.data = {
-					...data,
+				if(data) {
+					formData.data = {
+						...data,
+					}
 				}
 				if(!data) formData.data.handleObjectId = ''
 			})

+ 1 - 3
src/views/purchaseManage/purchasePayment/payment/index.vue

@@ -114,13 +114,13 @@ const config = computed(() => {
       attrs: {
         label: "付款说明",
         prop: "remark",
+        width: 300,
       },
     },
     {
       attrs: {
         label: "付款类型",
         prop: "type",
-        width: 100,
       },
       render(type) {
         return proxy.dictValueLabel(type, payMethod.value);
@@ -130,7 +130,6 @@ const config = computed(() => {
       attrs: {
         label: "付款方式",
         prop: "payType",
-        width: 160,
       },
       render(type) {
         return proxy.dictValueLabel(type, fundsPaymentMethod.value);
@@ -140,7 +139,6 @@ const config = computed(() => {
       attrs: {
         label: "付款账户",
         prop: "accountManagementId",
-        width: 200,
       },
       render(type) {
         return proxy.dictValueLabel(type, accountList.value);

+ 78 - 1
src/views/salesMange/salesMange/performance/index.vue

@@ -42,6 +42,7 @@
         :pagination="sourceList.pagination"
         :config="config"
         :loading="loading"
+        :statConfig="statConfig"
         :selectConfig="selectConfig"
         highlight-current-row
         :action-list="[]"
@@ -61,7 +62,11 @@
               <template #default="{ row }">
                 <div style="width: 100%">
                   <a
-                    style="color: #409eff; cursor: pointer; word-break: break-all"
+                    style="
+                      color: #409eff;
+                      cursor: pointer;
+                      word-break: break-all;
+                    "
                     @click="openDetails(row)"
                     >{{ row.contractCode }}</a
                   >
@@ -354,6 +359,78 @@ const selectConfig = computed(() => {
     // },
   ];
 });
+const headerData = ref({});
+const statConfig = computed(() => [
+  {
+    label: "统计",
+    data: [
+      //一个卡牌多数据配置
+      {
+        label: "收支统计",
+        type: 2,
+        data: [
+          {
+            label: "收入合计",
+            num: proxy.moneyFormat(headerData.value.totalIncome, 2),
+            color: "#C280FF",
+          },
+          {
+            label: "支出合计",
+            num: proxy.moneyFormat(headerData.value.totalExpenses, 2),
+            color: "#C280FF",
+          },
+          {
+            label: "毛利",
+            num: proxy.moneyFormat(headerData.value.grossGrofit, 2),
+            color: "#C280FF",
+          },
+          {
+            label: "毛利率",
+            num: headerData.value.grossRofitMargin + " %",
+            color: "#C280FF",
+          },
+        ],
+      },
+      {
+        label: "提成统计",
+        type: 1,
+        data: [
+          {
+            label: "售后",
+            num: proxy.moneyFormat(headerData.value.afterSalesAmount, 2),
+            color: "#0084ff",
+          },
+          {
+            label: "公共",
+            num: proxy.moneyFormat(headerData.value.publicAmount, 2),
+            color: "#0084ff",
+          },
+          {
+            label: "总办",
+            num: proxy.moneyFormat(headerData.value.haveOverallAmount, 2),
+            color: "#0084ff",
+          },
+          {
+            label: "部门提成",
+            num: proxy.moneyFormat(headerData.value.departmentalCommission, 2),
+            color: "#0084ff",
+          },
+          {
+            label: "个人提成",
+            num: proxy.moneyFormat(headerData.value.personalCommission, 2),
+            color: "#0084ff",
+          },
+        ],
+      },
+    ],
+  },
+]);
+const getHeaderData = () => {
+  proxy.post("/commission/getHeadStatistics").then((res) => {
+    headerData.value = res;
+  });
+};
+getHeaderData();
 const config = computed(() => {
   return [];
 });

+ 141 - 188
src/views/salesMange/shipmentMange/packing/index.vue

@@ -84,7 +84,7 @@
         </template>
       </byTable>
     </div>
-    <el-dialog title="产品装箱" v-model="dtlModalType" width="80%" v-loading="loading" @close="dtlModalClose">
+    <el-dialog title="产品装箱" v-model="dtlModalType" width="80%" v-loading="loading">
       <el-row :gutter="10">
         <el-col :span="8">
           <div class="common-title">箱规</div>
@@ -169,9 +169,33 @@
           <!-- 添加行 -->
           <div class="add-box" style="margin-bottom: 20px;">
             <el-button type="primary" @click="packDetailProductListPush(boxIndex)"> 添加行 </el-button>
-            <el-button type="primary" @click="packDetailProductListPush(boxIndex)"> 自定义装箱 </el-button>
+            <el-button type="primary" @click="openCustom('2')" v-if='encasementType == "1"'> 自定义装箱 </el-button>
+            <el-button type="primary" @click="openCustom('1')" v-if='encasementType == "2"'> 标准装箱 </el-button>
           </div>
-          <el-table :data="boxFormData.packDetailProductList" @select="handleSelectProduct" @select-all="handleSelectProduct" ref="tableDom">
+          <el-table :data="boxFormData.packDetailGoodsList" ref="tableDom2" v-if='encasementType == "2"'>
+            <el-table-column prop="remark" label="货品描述" min-width="180">
+              <template #default="{ row, $index }">
+                   <el-form-item prop="remark" :inline-message="true">
+                     <el-input  v-model="boxFormData.packDetailGoodsList[$index].remark"  onmousewheel="return false;" />
+                   </el-form-item>
+               </template>
+            </el-table-column>
+            <el-table-column prop="unit" label="单位" min-width="180">
+              <template #default="{ row, $index }">
+                   <el-form-item prop="unit" :inline-message="true">
+                     <el-input  v-model="boxFormData.packDetailGoodsList[$index].unit"  onmousewheel="return false;" />
+                   </el-form-item>
+               </template>
+            </el-table-column>
+            <el-table-column prop="quantity" label="入箱数" min-width="180">
+              <template #default="{ row, $index }">
+                   <el-form-item prop="quantity" :inline-message="true">
+                     <el-input-number v-model="boxFormData.packDetailGoodsList[$index].quantity" :precision="4" :controls="false" :min="0" onmousewheel="return false;" />
+                   </el-form-item>
+               </template>
+            </el-table-column>
+          </el-table>
+          <el-table v-else :data="boxFormData.packDetailProductList" @select="handleSelectProduct" @select-all="handleSelectProduct" ref="tableDom">
               <el-table-column prop="productName" label="产品名称" min-width="180">
                 <template #default="{ row, $index }">
                   <!-- 选择产品 -->
@@ -190,10 +214,10 @@
                   
                 </template>
               </el-table-column>
-              <el-table-column prop="productSpec" label="规格型号" min-width="140" />
-              <el-table-column prop="cpQuantity" label="合同数量" width="140" />
-              <el-table-column prop="waitQuantity" label="待装箱数量" width="140" />
-              <el-table-column prop="quantity" label="装箱数量" width="160">
+              <el-table-column prop="productSpec" label="规格型号" min-width="100" />
+              <el-table-column prop="cpQuantity" label="合同数量" width="100" />
+              <el-table-column prop="waitQuantity" label="待装箱数量" width="100" />
+              <el-table-column prop="quantity" label="装箱数量" width="100">
                 <template #default="{ row, $index }">
                    
                     <el-form-item prop="quantity" :inline-message="true">
@@ -201,6 +225,12 @@
                     </el-form-item>
                 </template>
               </el-table-column>
+              <!-- 删除按钮 -->
+              <el-table-column prop="quantity" label="操作" width="100">
+                <template #default="{ row, $index }">
+                  <el-button type="danger" @click="boxFormData.packDetailProductList.splice($index,1)"> 删除 </el-button>
+                </template>
+              </el-table-column>
           </el-table>
         </el-col>
       </el-row>
@@ -235,151 +265,6 @@
             <i class="iconfont icon-iconm_tianjia1" @click="openDtlModal"></i>
           </div>
         </div>
-        <el-form-item label="合同明细" prop="contractProductData">
-          <el-table :data="formData.data.contractProductData" @select="handleSelectProduct" @select-all="handleSelectProduct" ref="tableDom">
-            <el-table-column type="selection" label="" width="50" />
-            <el-table-column prop="contractCode" label="合同编码" width="160" />
-            <el-table-column prop="productName" label="产品名称" min-width="180" />
-            <el-table-column prop="productSpec" label="规格型号" min-width="140" />
-            <el-table-column prop="cpQuantity" label="合同数量" width="140" />
-            <el-table-column prop="waitQuantity" label="待装箱数量" width="140" />
-            <el-table-column prop="quantity" label="装箱数量" width="160">
-              <template #default="{ row, $index }">
-                <el-form-item :prop="'contractProductData.' + $index + '.quantity'" :inline-message="true">
-                  <el-input-number v-model="row.quantity" :precision="4" :controls="false" :min="0" onmousewheel="return false;" />
-                </el-form-item>
-              </template>
-            </el-table-column>
-          </el-table>
-          <el-button type="primary" style="margin-top: 10px; width: 100%" @click="handleClickPacking"> 装箱 </el-button>
-        </el-form-item>
-        <el-form-item label="装箱明细" prop="packDetailList">
-          <div class="box" v-for="(item, index) in formData.data.packDetailList" :key="index">
-            <div ref="" style="position: relative">
-              <span>箱规</span>
-              <el-button type="primary" style="position: absolute; right: 0px; top: 0px" @click="clickDelete(index)" text>删除</el-button>
-            </div>
-            <el-row :gutter="10">
-              <el-col :span="5">
-                <el-form-item label="箱数" :prop="'packDetailList.' + index + '.packQuantity'" :rules="rules.packQuantity">
-                  <el-input-number
-                    v-model="item.packQuantity"
-                    :precision="0"
-                    :controls="false"
-                    :min="1"
-                    placeholder="请输入"
-                    onmousewheel="return false;"
-                    @change="(val) => handleChangePackQuantity(val, index)" />
-                </el-form-item>
-              </el-col>
-              <el-col :span="5">
-                <el-form-item label="净重(kg)" :prop="'packDetailList.' + index + '.netWeight'" :rules="rules.netWeight">
-                  <el-input-number v-model="item.netWeight" :precision="2" :controls="false" :min="0" placeholder="请输入" onmousewheel="return false;" />
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="5">
-                <el-form-item label="毛重(kg)" :prop="'packDetailList.' + index + '.roughWeight'" :rules="rules.roughWeight">
-                  <el-input-number v-model="item.roughWeight" :precision="2" :controls="false" :min="0" placeholder="请输入" onmousewheel="return false;" />
-                </el-form-item>
-              </el-col>
-              <el-col :span="9">
-                <el-row>
-                  <el-form-item label="尺寸(cm³)" required>
-                    <el-col :span="1"></el-col>
-                    <el-col :span="7">
-                      <el-form-item label="" :prop="'packDetailList.' + index + '.boxLong'" :rules="rules.boxLong">
-                        <el-input-number
-                          v-model="item.boxLong"
-                          placeholder="长"
-                          :precision="2"
-                          :controls="false"
-                          :min="0"
-                          onmousewheel="return false;"></el-input-number>
-                      </el-form-item>
-                    </el-col>
-                    <el-col :span="1" style="text-align: center"> * </el-col>
-                    <el-col :span="7">
-                      <el-form-item label="" :prop="'packDetailList.' + index + '.boxWide'" :rules="rules.boxWide">
-                        <el-input-number
-                          v-model="item.boxWide"
-                          placeholder="宽"
-                          :precision="2"
-                          :controls="false"
-                          :min="0"
-                          onmousewheel="return false;"></el-input-number>
-                      </el-form-item>
-                    </el-col>
-                    <el-col :span="1" style="text-align: center"> * </el-col>
-                    <el-col :span="7">
-                      <el-form-item label="" :prop="'packDetailList.' + index + '.boxHigh'" :rules="rules.boxHigh">
-                        <el-input-number
-                          v-model="item.boxHigh"
-                          placeholder="高"
-                          :precision="2"
-                          :controls="false"
-                          :min="0"
-                          onmousewheel="return false;"></el-input-number>
-                      </el-form-item>
-                    </el-col>
-                  </el-form-item>
-                </el-row>
-              </el-col>
-            </el-row>
-            <div class="line"></div>
-            <el-form-item label="关联合同产品">
-              <div class="flex-box">
-                <div class="item" v-for="(product, j) in item.packDetailProductList" :key="j">
-                  <div>合同编码:{{ product.contractCode }}</div>
-                  <div>产品名称:{{ product.productName }}</div>
-                  <div>每箱数量:{{ product.quantity }}</div>
-                </div>
-              </div>
-            </el-form-item>
-            <div class="bottom-arrow" v-show="!item.isShow" @click="item.isShow = !item.isShow">
-              <span style="margin-right: 5px"> 自定义装箱明细</span>
-              <el-icon><ArrowDownBold /></el-icon>
-            </div>
-            <div class="bottom-arrow" v-show="item.isShow" @click="item.isShow = !item.isShow">
-              <span style="margin-right: 5px"> 收起</span>
-              <el-icon><ArrowUpBold /></el-icon>
-            </div>
-            <el-form-item prop="packDetailGoodsList" v-show="item.isShow">
-              <el-button type="primary" style="margin-bottom: 10px" @click="handleCustomPush(index)"> 添加行 </el-button>
-              <el-table :data="item.packDetailGoodsList">
-                <el-table-column label="货物描述">
-                  <template #default="{ row, $index }">
-                    <el-form-item :prop="['packDetailList', index, 'packDetailGoodsList', $index, 'remark']" :rules="rules.remark" :inline-message="true">
-                      <el-input v-model="row.remark" placeholder="请输入" />
-                    </el-form-item>
-                  </template>
-                </el-table-column>
-                <el-table-column label="单位" width="150">
-                  <template #default="{ row, $index }">
-                    <el-form-item :prop="['packDetailList', index, 'packDetailGoodsList', $index, 'unit']" :rules="rules.unit" :inline-message="true">
-                      <el-input v-model="row.unit" placeholder="请输入" />
-                    </el-form-item>
-                  </template>
-                </el-table-column>
-                <el-table-column label="数量" width="150">
-                  <template #default="{ row, $index }">
-                    <el-form-item
-                      :prop="['packDetailList', index, 'packDetailGoodsList', $index, 'quantity']"
-                      :rules="rules.quantityOne"
-                      :inline-message="true">
-                      <el-input-number v-model="row.quantity" :precision="4" :controls="false" :min="0" onmousewheel="return false;" />
-                    </el-form-item>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="zip" label="操作" width="100">
-                  <template #default="{ $index }">
-                    <el-button type="primary" link @click="handleCustomRemove(index, $index)">删除</el-button>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-form-item>
-          </div>
-        </el-form-item>
       </el-form>
       <template #footer>
         <el-button @click="handleClose" size="large">取 消</el-button>
@@ -421,7 +306,17 @@ const sourceList = ref({
 });
 
 const openDtlUpdata = (index) => {
+  boxFormType = 'updata'
   boxIndex.value = index;
+  boxFormData.value = {...formData.data.packDetailList[index]}
+  formData.data.contractProductData.forEach((item) => {
+    item.disabled = false
+    boxFormData.value.packDetailProductList.forEach((item1) => {
+      if(item.mathId == item1.mathId){
+        item.disabled = true
+      }
+    })
+  });
   dtlModalType.value = true;
 };
 
@@ -439,7 +334,36 @@ let boxFormData = ref({
   id: Math.random().toString(36).substr(2),
 });
 
+const openCustom = (type) => {
+  if(type == '2' && boxFormData.value.packDetailGoodsList.length == 0) {
+    for (let i = 0; i < boxFormData.value.packDetailProductList.length; i++) {
+      const item = boxFormData.value.packDetailProductList[i];
+      if (item.quantity == null) {
+        ElMessage.error("请填写装箱数量");
+        return;
+      }
+      if (item.productId == null) {
+          ElMessage.error("请填写选择产品");
+          return;
+      }
+    }
+    boxFormData.value.packDetailGoodsList = boxFormData.value.packDetailProductList.map(item => {
+      return {
+        remark:item.productName,
+        unit:null,
+        quantity:item.quantity
+      }
+    })
+  }
+  encasementType.value = type
+}
+
 const openDtlModal = () => {
+  console.log(formData.data.contractProductData)
+  if(!formData.data.contractProductData || formData.data.contractProductData.length == 0) {
+    ElMessage.error("请先选择合同");
+    return;
+  }
   boxFormData.value = {
     packQuantity: null,
     netWeight: null,
@@ -453,33 +377,46 @@ const openDtlModal = () => {
     //生成唯一id
     id: Math.random().toString(36).substr(2),
   };
-  boxIndex.value = formData.data.packDetailList.length - 1;
+  boxFormType = 'add'
+  boxIndex.value = formData.data.packDetailList.length;
+  formData.data.contractProductData.forEach((item) => {
+    item.disabled = false
+    boxFormData.value.packDetailProductList.forEach((item1) => {
+      if(item.mathId == item1.mathId){
+        item.disabled = true
+      }
+    })
+  });
   dtlModalType.value = true;
 
 };
 
-const dtlModalClose = () => {
-  dtlModalType.value = false;
-  //如果关闭删除本条数据
-  formData.data.packDetailList.splice(boxIndex.value, 1);
-  boxIndex.value = 0
-  console.log(formData.data.packDetailList)
-};
 
 const boxIndex = ref(0);
 
 const packDetailProductListPush = (index) => {
-  boxFormData.value.packDetailProductList.push({
-    contractId: null,
-    productName: null,
-    contractProductId: null,
-    quantity: null,
-    productId: null,
-    productModel: null,
-    remark:null,
-  });
+  if(encasementType.value == '1') {
+    boxFormData.value.packDetailGoodsList.push({
+      remark:null,
+      unit:null,
+      quantity:null,
+    })
+  }else{
+    boxFormData.value.packDetailProductList.push({
+      contractId: null,
+      productName: null,
+      contractProductId: null,
+      quantity: null,
+      productId: null,
+      productModel: null,
+      remark:null,
+    });
+  }
+  
 };
 
+let boxFormType = 'add'
+
 const submitBox = () => {
   formDom.value.validate((vaild) => {
     if (vaild) {
@@ -487,8 +424,9 @@ const submitBox = () => {
         ElMessage.error("请添加产品");
         return;
       }
+      alert('通过')
       for (let i = 0; i < boxFormData.value.packDetailProductList.length; i++) {
-        const item = boxFormData.value.packDetailProductList[j];
+        const item = boxFormData.value.packDetailProductList[i];
         if (item.quantity == null) {
           ElMessage.error("请填写装箱数量");
           return;
@@ -499,22 +437,16 @@ const submitBox = () => {
         }
       }
       dtlModalType.value = false;
-      formData.data.packDetailList[boxIndex.value] = {
-        packQuantity: boxFormData.value.packQuantity,
-        netWeight: boxFormData.value.netWeight,
-        roughWeight: boxFormData.value.roughWeight,
-        boxLong: boxFormData.value.boxLong,
-        boxWide: boxFormData.value.boxWide,
-        boxHigh: boxFormData.value.boxHigh,
-        packDetailGoodsList: boxFormData.value.packDetailGoodsList,
-        packDetailProductList: boxFormData.value.packDetailProductList,
-        bomVolume: boxFormData.value.bomVolume,
-        id: boxFormData.value.id,
-      };
+      if(boxFormType == 'add') {
+        formData.data.packDetailList.push(
+          {...boxFormData.value}
+        )
+        console.log(formData.data.packDetailList)
+      } else {
+        formData.data.packDetailList[boxIndex.value] = {...boxFormData.value}
+      }
     }
   })
-  console.log(formData.data.packDetailList[boxIndex.value])
-  
 };
 
 const dtlformData = reactive({
@@ -537,18 +469,21 @@ const dtlformData = reactive({
 const selectProduct = (val,index) => {
   let msg  = {...formData.data.contractProductData.find((item) => item.mathId == val)}
   //根据val 禁用相应的下拉数据
-  console.log(msg,index)
+  
   boxFormData.value.packDetailProductList[index] = {
     productId: msg.productId,
     productName: msg.productName,
     productSpec: msg.productSpec,
     contractCode: msg.contractCode,
-    contractProductId: msg.contractProductId,
+    contractProductId: msg.id,
     cpQuantity: msg.cpQuantity,
     waitQuantity: msg.waitQuantity,
     quantity: null,
     mathId: msg.mathId,
+    contractId: msg.contractId,
+    contractProductId: msg.id,
   }
+  console.log(boxFormData.value.packDetailProductList)
   formData.data.contractProductData.forEach((item) => {
     item.disabled = false
     boxFormData.value.packDetailProductList.forEach((item1) => {
@@ -793,6 +728,8 @@ const formConfig = reactive([
   },
 ]);
 
+const encasementType = ref('1')
+
 const getList = async (req) => {
   selectData.value = [];
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -870,12 +807,28 @@ const submitForm = () => {
       }
       submitLoading.value = true;
       loadingOne.value = true;
+      
+      formData.data.contractIds = formData.data.contractIds.join(",");
       for (let i = 0; i < formData.data.packDetailList.length; i++) {
         const e = formData.data.packDetailList[i];
         e.bomVolume = (e.boxLong * e.boxWide * e.boxHigh) / 1000000;
+        e.contractIds = formData.data.contractIds;
+        e.customerId = formData.data.customerId;
       }
-      formData.data.contractIds = formData.data.contractIds.join(",");
-      proxy.post("/pack/" + modalType.value, formData.data).then(
+      console.log(formData.data.packDetailList)
+      formData.data.packDetailList.map((x) => {
+        return{
+          ...x,
+          customerId:formData.data.customerId,
+          contractIds:formData.data.contractIds,
+        }
+      });
+      let reqData = {...formData.data}
+      //删除 reqData.packDetailList 里的id
+      reqData.packDetailList.forEach((item) => {
+        delete item.id
+      })
+      proxy.post("/pack/" + modalType.value, reqData).then(
         (res) => {
           ElMessage({
             message: modalType.value == "add" ? "添加成功" : "编辑成功",

Some files were not shown because too many files changed in this diff