Parcourir la source

部分功能完善,费控pdf打印功能

cz il y a 1 an
Parent
commit
3446c3c31f

+ 613 - 0
src/components/PDF/CostControlPDF.vue

@@ -0,0 +1,613 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="padding: 0px 20px; text-align: center;font-size:12px;color:#333333" v-loading="loading">
+      <!-- <div class="title">
+        费控
+      </div> -->
+      <div class="title-info">
+        <div class="vertical-bar"></div>
+        <div class="content">费控</div>
+      </div>
+
+      <table border="1" style="width: 100%;" class="table">
+        <tr>
+          <td :colspan="4">
+            <div style="font-weight:700;text-align:center;font-size:16px">
+              基本信息
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td style="width:15%">收付款类型</td>
+          <td style="width:35%">{{pdfData.costTypeName}}</td>
+          <td style="width:15%">记账凭证号</td>
+          <td style="width:35%">{{pdfData.voucherNo}}</td>
+        </tr>
+        <tr>
+          <td style="width:15%">申请日期</td>
+          <td style="width:35%">{{pdfData.applyTime}}</td>
+          <td style="width:15%">流水号</td>
+          <td style="width:35%">{{pdfData.code}}</td>
+        </tr>
+        <tr v-if="isShowAtt('isAdvance', 'mainObj') || isShowAtt('isVoucher', 'mainObj') ">
+          <td style="width:15%" v-if="isShowAtt('isAdvance', 'mainObj')">是否预付</td>
+          <td style="width:35%" v-if="isShowAtt('isAdvance', 'mainObj')" :colspan="isShowAtt('isVoucher', 'mainObj')?1:3">
+            {{dictValueLabel(pdfData.isAdvance ,isAfterSubmit)}}</td>
+          <td style="width:15%" v-if="isShowAtt('isVoucher', 'mainObj')">是否后提交凭证</td>
+          <td style="width:35%" v-if="isShowAtt('isVoucher', 'mainObj')" :colspan="isShowAtt('isAdvance', 'mainObj')?1:3">
+            {{dictValueLabel(pdfData.isVoucher ,isAfterSubmit)}}</td>
+        </tr>
+        <tr>
+          <td style="width:15%">业务公司</td>
+          <td style="width:35%">{{pdfData.companyName}}</td>
+          <td style="width:15%">业务部门</td>
+          <td style="width:35%">{{pdfData.deptName}}</td>
+        </tr>
+        <tr>
+          <td style="width:15%">申请人</td>
+          <td style="width:35%" :colspan="3">{{pdfData.applyUserName}}</td>
+        </tr>
+        <tr>
+          <td :colspan="4">
+            <div style="font-weight:700;text-align:center;font-size:16px">
+              收付款明细
+            </div>
+          </td>
+        </tr>
+      </table>
+      <!-- <div style="border-left:1px solid gray;border-right:1px solid gray;font-weight:700;text-align:center;padding: 2px 4px;font-size:16px">
+        收付款明细
+      </div> -->
+      <table style="width: 100%;" class="tableOne">
+        <tr>
+          <td v-if="isShowAtt('remark','detailObj' )">
+            收付款说明
+          </td>
+          <td v-if="isShowAtt('applyRemark','detailObj' )">
+            申请事由
+          </td>
+          <td v-if="isShowAtt('deductionMonth','detailObj' )">
+            抵扣工资月份
+          </td>
+          <td v-if="isShowAtt('logisticsCompanyId','detailObj' )">
+            快递公司
+          </td>
+          <td v-if="isShowAtt('supplierId','detailObj' )">
+            供应商
+          </td>
+          <td v-if="isShowAtt('payeeAccountId','detailObj' )">
+            收款单位
+          </td>
+          <td v-if="isShowAtt('invoiceTaxPoint','detailObj' )">
+            开票税点
+          </td>
+          <td v-if="isShowAtt('balancePrepaidTax','detailObj' )">
+            结存预付款(含税)
+          </td>
+          <td v-if="isShowAtt('balancePrepaid','detailObj' )">
+            结存预付款(不含税)
+          </td>
+          <td v-if="isShowAtt('currentPrepaidTax','detailObj' )">
+            本期预付款(含税)
+          </td>
+          <td v-if="isShowAtt('currentPrepaid','detailObj' )">
+            本期预付款(不含税)
+          </td>
+          <td v-if="isShowAtt('accountPeriod','detailObj' )">
+            账期
+          </td>
+          <td v-if="isShowAtt('accountPeriodAmountTax','detailObj' )">
+            本账期金额(含税)
+          </td>
+          <td v-if="isShowAtt('accountPeriodAmount','detailObj' )">
+            本账期金额(不含税)
+          </td>
+          <td v-if="isShowAtt('accountPeriodAdjustAmount','detailObj' )">
+            本账期调整金额
+          </td>
+          <td v-if="isShowAtt('deductionPrepaidTax','detailObj' )">
+            抵扣预付款(含税)
+          </td>
+          <td v-if="isShowAtt('deductionPrepaid','detailObj' )">
+            抵扣预付款(不含税)
+          </td>
+          <td v-if="isShowAtt('taxation','detailObj' )">
+            税费
+          </td>
+          <td v-if="isShowAtt('shopId','detailObj' )">
+            店铺名称
+          </td>
+          <td v-if="isShowAtt('costType','detailObj' )">
+            费用类型
+          </td>
+          <td v-if="isShowAtt('brushingTime','detailObj' )||isShowAtt( 'promotionFeeType','detailObj' )">
+            刷单时间/推广费类别
+          </td>
+          <td v-if="isShowAtt('currentPayableDeductionBefore','detailObj' )">
+            本期应付(抵扣前)
+          </td>
+          <td v-if="isShowAtt('currentPayableDeduction','detailObj' )">
+            本期应付(抵扣后)
+          </td>
+          <td v-if="isShowAtt('currentPayable','detailObj' )">
+            本期应付
+          </td>
+          <td v-if="isShowAtt('returnAmount','detailObj' )">
+            归还金额
+          </td>
+          <td v-if="isShowAtt('costMoneyTax','detailObj' )">
+            费用金额(含税)
+          </td>
+          <td v-if="isShowAtt('costMoney','detailObj' )">
+            费用金额(不含税)
+          </td>
+          <!-- <td v-if="isShowAtt('costMoneySum','detailObj' )">
+            费用合计
+          </td> -->
+          <td v-if="isShowAtt('paymentAccountNumber','detailObj' )">
+            汇款账号
+          </td>
+          <td v-if="isShowAtt('paymentAccountName','detailObj' )">
+            汇款账户名
+          </td>
+          <td v-if="isShowAtt('paymentAccountBank','detailObj' )">
+            汇款银行
+          </td>
+          <td v-if="isShowAtt('accountSubjectsId','detailObj' )">
+            记账科目
+          </td>
+          <td v-if="isShowAtt('accountSubjectsId','detailObj' )">
+            核算项目名称
+          </td>
+          <td v-if="isShowAtt('accountSubjectsId','detailObj' )">
+            核算项目
+          </td>
+          <td v-if="isShowAtt('money','detailObj' )">
+            记账金额
+          </td>
+        </tr>
+        <tr v-if="pdfData.costControlDetailList && pdfData.costControlDetailList.length > 0" v-for="(item, index) in pdfData.costControlDetailList"
+            :key="item.id" :class="{isLastRow:index==pdfData.costControlDetailList.length-1}">
+          <td v-if="isShowAtt('remark','detailObj' )">
+            {{item.remark}}
+          </td>
+          <td v-if="isShowAtt('applyRemark','detailObj' )">
+            {{item.applyRemark}}
+          </td>
+          <td v-if="isShowAtt('deductionMonth','detailObj' )">
+            {{item.deductionMonth}}
+          </td>
+          <td v-if="isShowAtt('logisticsCompanyId','detailObj' )">
+            {{item.businessName}}
+          </td>
+          <td v-if="isShowAtt('supplierId','detailObj' )">
+            {{item.businessName}}
+          </td>
+          <td v-if="isShowAtt('payeeAccountId','detailObj' )">
+            {{item.businessName}}
+          </td>
+          <td v-if="isShowAtt('invoiceTaxPoint','detailObj' )">
+            {{item.invoiceTaxPoint}}
+          </td>
+          <td v-if="isShowAtt('balancePrepaidTax','detailObj' )">
+            {{item.balancePrepaidTax}}
+          </td>
+          <td v-if="isShowAtt('balancePrepaid','detailObj' )">
+            {{item.balancePrepaid}}
+          </td>
+          <td v-if="isShowAtt('currentPrepaidTax','detailObj' )">
+            {{item.currentPrepaidTax}}
+          </td>
+          <td v-if="isShowAtt('currentPrepaid','detailObj' )">
+            {{item.currentPrepaid}}
+          </td>
+          <td v-if="isShowAtt('accountPeriod','detailObj' )">
+            {{item.accountPeriod}}
+          </td>
+          <td v-if="isShowAtt('accountPeriodAmountTax','detailObj' )">
+            {{item.accountPeriodAmountTax}}
+          </td>
+          <td v-if="isShowAtt('accountPeriodAmount','detailObj' )">
+            {{item.accountPeriodAmount}}
+          </td>
+          <td v-if="isShowAtt('accountPeriodAdjustAmount','detailObj' )">
+            {{item.accountPeriodAdjustAmount}}
+          </td>
+          <td v-if="isShowAtt('deductionPrepaidTax','detailObj' )">
+            {{item.deductionPrepaidTax}}
+          </td>
+          <td v-if="isShowAtt('deductionPrepaid','detailObj' )">
+            {{item.deductionPrepaid}}
+          </td>
+          <td v-if="isShowAtt('taxation','detailObj' )">
+            {{item.taxation}}
+          </td>
+          <td v-if="isShowAtt('shopId','detailObj' )">
+            {{item.businessName}}
+          </td>
+          <td v-if="isShowAtt('costType','detailObj' )">
+            {{dictKeyValue(item.costType,expenseType)}}
+          </td>
+          <td v-if="isShowAtt('brushingTime','detailObj' ) || isShowAtt('promotionFeeType','detailObj' )">
+            <span v-if="item.costType=='1'">{{item.brushingTime}}</span>
+            <span v-if="item.costType=='2'">{{dictKeyValue(item.promotionFeeType,promotionFeeType)}}</span>
+          </td>
+          <td v-if="isShowAtt('currentPayableDeductionBefore','detailObj' )">
+            {{item.currentPayableDeductionBefore}}
+          </td>
+          <td v-if="isShowAtt('currentPayableDeduction','detailObj' )">
+            {{item.currentPayableDeduction}}
+          </td>
+          <td v-if="isShowAtt('currentPayable','detailObj' )">
+            {{item.currentPayable}}
+          </td>
+          <td v-if="isShowAtt('returnAmount','detailObj' )">
+            {{item.returnAmount}}
+          </td>
+          <td v-if="isShowAtt('costMoneyTax','detailObj' )">
+            {{item.costMoneyTax}}
+          </td>
+          <td v-if="isShowAtt('costMoney','detailObj' )">
+            {{item.costMoney}}
+          </td>
+          <!-- <td v-if="isShowAtt('costMoneySum','detailObj' )">
+            {{item.costMoneySum}}
+          </td> -->
+          <td v-if="isShowAtt('paymentAccountNumber','detailObj' )">
+            {{item.paymentAccountNumber}}
+          </td>
+          <td v-if="isShowAtt('paymentAccountName','detailObj' )">
+            {{item.paymentAccountName}}
+          </td>
+          <td v-if="isShowAtt('paymentAccountBank','detailObj' )">
+            {{item.paymentAccountBank}}
+          </td>
+          <td v-if="isShowAtt('accountSubjectsId','detailObj' )">
+            {{item.accountSubjectsName}}
+          </td>
+          <td v-if="isShowAtt('accountSubjectsId','detailObj' )">
+            {{item.accountSubjectsNames}}
+          </td>
+          <td v-if="isShowAtt('accountSubjectsId','detailObj' )">
+            <!-- {{item.subjectsCalculateItemNameList}} -->
+            <div v-for="e in item.calculateItemList" :key="e.id">
+              {{e.type}}:{{e.businessName}}
+            </div>
+          </td>
+          <td v-if="isShowAtt('money','detailObj' )">
+            {{item.money}}
+          </td>
+        </tr>
+
+      </table>
+      <!-- <div style="border-left:1px solid gray;border-right:1px solid gray;font-weight:700;text-align:center;padding: 2px 4px;font-size:16px"
+           v-if="isShowAtt('isPublicTransfer', 'mainObj') || isShowAtt('paymentMethod', 'mainObj')">
+        付款信息
+      </div> -->
+      <table border="1" style="width: 100%;" class="table">
+        <tr v-if="isShowAtt('isPublicTransfer', 'mainObj') || isShowAtt('paymentMethod', 'mainObj')">
+          <td :colspan="4">
+            <div style="font-weight:700;text-align:center;font-size:16px">
+              付款信息
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td style="width:15%" v-if="isShowAtt('isPublicTransfer', 'mainObj')">是否公户转出</td>
+          <td style="width:35%" v-if="isShowAtt('isPublicTransfer', 'mainObj')" :colspan="isShowAtt('paymentMethod', 'mainObj')?1:3">
+            {{dictValueLabel(pdfData.isPublicTransfer ,isAfterSubmit)}}</td>
+          <td style="width:15%" v-if="isShowAtt('paymentMethod', 'mainObj')">付款方式</td>
+          <td style="width:35%" v-if="isShowAtt('paymentMethod', 'mainObj')" :colspan="isShowAtt('isPublicTransfer', 'mainObj')?1:3">
+            {{dictKeyValue(pdfData.paymentMethod ,paymentMethod)}}</td>
+        </tr>
+        <tr v-if="(isShowAtt('paymentMethod', 'mainObj') && pdfData.paymentMethod == '1') || isShowAtt('paymentAccountId', 'mainObj')">
+          <td style="width:15%" v-if="isShowAtt('paymentMethod', 'mainObj') &&  pdfData.paymentMethod == '1'">充值店铺名称</td>
+          <td style="width:35%" v-if="isShowAtt('paymentMethod', 'mainObj') &&  pdfData.paymentMethod == '1'"
+              :colspan="isShowAtt('paymentAccountId', 'mainObj')?1:3">{{pdfData.shopName}}</td>
+          <td style="width:15%" v-if="isShowAtt('paymentAccountId', 'mainObj')">公司账户</td>
+          <td style="width:35%" v-if="isShowAtt('paymentAccountId', 'mainObj')"
+              :colspan="(isShowAtt('paymentMethod', 'mainObj') && pdfData.paymentMethod == '1')?1:3">{{pdfData.paymentAccountId}}</td>
+        </tr>
+        <tr v-if="isShowAtt('paymentAccountId', 'mainObj')">
+          <td style="width:15%">开户行</td>
+          <td style="width:35%">{{pdfData.paymentAccountBank}}</td>
+          <td style="width:15%">开户名</td>
+          <td style="width:35%">{{pdfData.paymentAccountName}}</td>
+        </tr>
+        <tr v-if="isShowAtt('paymentAccountId', 'mainObj')">
+          <td style="width:15%">账号</td>
+          <td style="width:35%" :colspan="3">{{pdfData.paymentAccountNumber}}</td>
+        </tr>
+        <tr v-if="getIsShowData('accountBank')">
+          <td :colspan="4">
+            <div style="font-weight:700;text-align:center;font-size:16px">
+              收款信息
+            </div>
+          </td>
+        </tr>
+        <tr v-if="getIsShowData('accountBank')">
+          <td style="width:15%">开户行</td>
+          <td style="width:35%">{{pdfData.accountBank}}</td>
+          <td style="width:15%">开户名</td>
+          <td style="width:35%">{{pdfData.accountName}}</td>
+        </tr>
+        <tr v-if="getIsShowData('accountBank')">
+          <td style="width:15%">账号</td>
+          <td style="width:35%" :colspan="3">{{pdfData.accountNumber}}</td>
+        </tr>
+      </table>
+    </div>
+    <div style="text-align: center;margin-top:20px">
+      <el-button type="primary" v-print="printObj" size="default" v-debounce>打印</el-button>
+      <el-button type="primary" @click="clickDownload()" size="default" v-debounce>下载PDF</el-button>
+      <el-button type="primary" @click="exportExcel()" size="default" v-debounce>导出Excel</el-button>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { NumberToChinese } from "@/utils/util.js";
+import { calculationWeek } from "@/utils/util.js";
+import { async } from "@antv/x6/lib/registry/marker/main";
+import $ from "jquery";
+import { nextTick } from "vue";
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+
+const paymentMethod = computed(
+  () => proxy.useUserStore().allDict["payment_method"]
+);
+const promotionFeeType = computed(
+  () => proxy.useUserStore().allDict["promotion_fee_type"]
+);
+const expenseType = computed(
+  () => proxy.useUserStore().allDict["expense_type"]
+);
+const isAfterSubmit = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
+const loading = ref(false);
+const checkBoxMap = ref({});
+const getCheckBoxMap = (val) => {
+  if (!val) return;
+  proxy.post("/paymentType/detail", { id: val }).then((res) => {
+    if (res && res.dynamicFieldJson) {
+      let obj = JSON.parse(res.dynamicFieldJson);
+      obj.mainObj = {};
+      obj.detailObj = {};
+      if (obj.mainCheckList) {
+        obj.mainCheckList.map((x) => (obj.mainObj[x] = true));
+      }
+      if (obj.detailCheckList) {
+        obj.detailCheckList.map((x) => (obj.detailObj[x] = true));
+      }
+      checkBoxMap.value = obj;
+    }
+  });
+};
+const paymentTypeData = ref([]);
+const currentCostTypeData = ref({});
+const getPdfData = async (query) => {
+  loading.value = true;
+  const { rows } = await proxy.post("/paymentType/page", {
+    pageNum: 1,
+    pageSize: 999,
+  });
+  paymentTypeData.value = rows.map((item) => {
+    return {
+      ...item,
+      name: item.name,
+      label: item.name,
+      value: item.id,
+    };
+  });
+
+  proxy.post("/costControl/detail", query).then((res) => {
+    if (res.costControlDetailList && res.costControlDetailList.length) {
+      for (let i = 0; i < res.costControlDetailList.length; i++) {
+        const row = res.costControlDetailList[i];
+        row.fileList = [];
+        row.invoiceFileList = [];
+        // 名称列表
+        if (row.subjectsCalculateItemName) {
+          row.subjectsCalculateItemNameList =
+            row.subjectsCalculateItemName.split(",");
+        }
+      }
+    }
+    getCheckBoxMap(res.costType);
+    if (paymentTypeData.value && paymentTypeData.value.length > 0) {
+      currentCostTypeData.value = paymentTypeData.value.find(
+        (x) => x.value == res.costType
+      );
+      if (
+        currentCostTypeData.value.name &&
+        currentCostTypeData.value.name.indexOf("店铺") != -1
+      ) {
+        res.shopName = res.costControlDetailList[0].businessName;
+      }
+    }
+    pdfData.value = res;
+    loading.value = false;
+  });
+};
+
+const isShowAtt = (formAtt, att = "mainObj") => {
+  if (checkBoxMap.value[att]) {
+    return checkBoxMap.value[att][formAtt] != undefined;
+  } else {
+    return true;
+  }
+};
+
+const getIsShowData = (formAtt, att = "mainObj") => {
+  if (
+    currentCostTypeData.value &&
+    currentCostTypeData.value.name &&
+    currentCostTypeData.value.name.indexOf("店铺") != -1
+  ) {
+    if (
+      pdfData.value &&
+      pdfData.value.paymentMethod &&
+      pdfData.value.paymentMethod == "2"
+    ) {
+      return true;
+    }
+    return false;
+  } else {
+    return isShowAtt(formAtt, att);
+  }
+};
+
+const getHtmlVal = (val) => {
+  if (val) {
+    return val.replace(/<p>/g, "<div>").replace(/<\/p>/g, "</div>");
+  }
+  return "";
+};
+
+watch(
+  () => props.rowData,
+  (val) => {
+    if (props.rowData.id) {
+      getPdfData({ id: props.rowData.id });
+    }
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
+
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+
+const clickDownload = () => {
+  proxy.getPdf("费控PDF文件");
+};
+
+const pdfDom = ref(null);
+const exportExcel = () => {
+  // pdfDom.value.exportExcel();
+  // isShowImg.value = false;
+  loading.value = true;
+  setTimeout(() => {
+    $("#pdfDom").table2excel({
+      exclude: ".noExl",
+      sheetName: `费控${pdfData.value.code}`,
+      filename: `费控${pdfData.value.code}`,
+      exclude_img: false,
+      exclude_links: false,
+      exclude_inputs: true,
+    });
+    // isShowImg.value = true;
+    loading.value = false;
+  }, 500);
+};
+</script>
+
+<style lang="scss" scoped>
+.title {
+  font-size: 28px;
+  // font-weight: 700;
+  text-align: center;
+}
+.title-info {
+  text-align: center;
+  width: 100%;
+  margin: 20px 0 50px 0;
+  .vertical-bar {
+    width: 6px;
+    height: 18px;
+    background-color: #0084ff;
+    // background-color: #000;
+    margin-right: 9px;
+    display: inline-block;
+  }
+  .content {
+    // font-weight: 600;
+    font-size: 32px;
+    color: #333333;
+    display: inline-block;
+  }
+}
+.row {
+  display: flex;
+  // line-height: 28px;
+  .left {
+    width: 120px;
+    text-align: justify;
+    display: inline-block;
+    &::after {
+      content: "";
+      display: inline-block;
+      width: 100%;
+    }
+  }
+  .right {
+    width: calc(100% - 120px);
+    text-align: left;
+    line-height: 18px;
+  }
+}
+.rowOne {
+  display: flex;
+  line-height: 32px;
+  .left {
+    width: 120px;
+    text-align: left;
+    // text-align: justify;
+    // display: inline-block;
+    // &::after {
+    //   content: "";
+    //   display: inline-block;
+    //   width: 100%;
+    // }
+  }
+  .right {
+    width: calc(100% - 120px);
+    text-align: left;
+  }
+}
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+
+  td {
+    text-align: left;
+    padding: 2px 4px;
+    // padding: 5px 10px;
+  }
+}
+.tableOne {
+  border-collapse: collapse;
+  border-spacing: 0;
+  border-left: 1px solid gray;
+  border-right: 1px solid gray;
+  td {
+    text-align: left;
+    padding: 2px 4px;
+    // padding: 5px 10px;
+    border-right: 1px solid gray;
+    border-bottom: 1px solid gray;
+  }
+  .isLastRow td {
+    border-bottom: none;
+  }
+}
+</style>

+ 1 - 2
src/components/notice/index.vue

@@ -149,7 +149,6 @@ const readFn = (item) => {
 };
 const commonRead = (ids, type) => {
   proxy.post("/pushInfo/read", { idList: ids }).then((res) => {
-    console.log(res);
     ElMessage({
       message: "已读成功",
       type: "success",
@@ -252,7 +251,7 @@ const socketInit = () => {
     //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
     //在data.value前面插入
     const res = JSON.parse(e.data);
-    console.log(res, "socket-message");
+    // console.log(res, "socket-message");
     if (res.type == 1) {
       index.value = 0;
       data.value = res.list;

+ 116 - 39
src/components/process/SF/CostControl.vue

@@ -1,7 +1,6 @@
 <template>
   <div style="width: 100%; padding: 0px 15px">
     <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="loading">
-
       <template #order>
         <div style="width:100%;display:flex">
           <div style="width:calc(100% - 65px)">
@@ -21,7 +20,7 @@
             <!-- <el-table-column prop="contractTaxTransportationWay" label="税运方式" width="150"
                              :formatter="(row)=>dictKeyValue(row.contractTaxTransportationWay,contractTaxTransportationWay)" /> -->
             <el-table-column prop="code" label="出货单号" width="150" />
-            <el-table-column prop="sumQuantity" label="出货件数" width="150" />
+            <el-table-column prop="sumTruckQuantity" label="出货件数" width="150" />
             <el-table-column label="出货单图片">
               <template #default="{ row, $index }">
                 <div style="width:100%" v-if="row.fileList && row.fileList.length>0">
@@ -46,7 +45,7 @@
         <div style="width: 100%">
           <el-button type="primary" @click="clickAdd()" plain :disabled="getBtnDisabled()" style="margin-bottom: 16px"
                      v-if="!judgeStatus()">添加</el-button>
-          <el-table :data="formData.data.costControlDetailList" style="width: 100%; ">
+          <el-table :data="formData.data.costControlDetailList" style="width: 100%;" show-summary :summary-method="getSummaries">
             <el-table-column prop="remark" label="收付款说明" min-width="250" v-if="isShowAtt('remark','detailObj')" fixed="left">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true" class="margin-b-0">
@@ -356,7 +355,7 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="costMoneySum" label="费用合计" width="140" v-if="isShowAtt('costMoneySum','detailObj')">
+            <!-- <el-table-column prop="costMoneySum" label="费用合计" width="140" v-if="isShowAtt('costMoneySum','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.costMoneySum'" :rules="rules.costMoneySum" :inline-message="true"
                               class="margin-b-0">
@@ -364,7 +363,7 @@
                                    :controls="false" :min="0" :disabled="isDisabled" @change="handleGetRemark($index)" />
                 </el-form-item>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column prop="paymentAccountNumber" label="汇款账号" width="150" v-if="isShowAtt('paymentAccountNumber','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.paymentAccountNumber'" :rules="rulesTwo.paymentAccountNumber"
@@ -402,14 +401,23 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="核算项目名称" width="200" prop="subjectsCalculateItemName" v-if="isShowAtt('accountSubjectsId','detailObj')">
+            <!-- <el-table-column label="核算项目名称" width="200" prop="subjectsCalculateItemName" v-if="isShowAtt('accountSubjectsId','detailObj')">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   <el-input v-model="row.subjectsCalculateItemName" placeholder=" ">
                   </el-input>
                 </div>
               </template>
+            </el-table-column> -->
+            <el-table-column label="核算项目名称" width="200" prop="accountSubjectsNames" v-if="isShowAtt('accountSubjectsId','detailObj')">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-input v-model="row.accountSubjectsNames" placeholder=" ">
+                  </el-input>
+                </div>
+              </template>
             </el-table-column>
+
             <el-table-column label="核算项目" width="200" prop="subjectsCalculateItemNameList" v-if="isShowAtt('accountSubjectsId','detailObj')">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
@@ -551,7 +559,6 @@ const formData = reactive({
   data: {
     applyTime: moment().format("yyyy-MM-DD"),
     companyId: proxy.useUserStore().user.companyId,
-    companyIdSet: [],
     deptId: proxy.useUserStore().user.dept.deptId,
     applyUserId: proxy.useUserStore().user.userId,
     costControlDetailList: [
@@ -710,24 +717,6 @@ const formConfig = computed(() => {
     },
     {
       type: "treeSelect",
-      prop: "companyIdSet",
-      label: "业务公司",
-      data: treeData.value,
-      propsTreeLabel: "deptName",
-      propsTreeValue: "deptId",
-      itemWidth: 25,
-      // fn: (val) => {
-      //   getDeptData(val);
-      // },
-      multiple: true,
-      disabled: true,
-      isShow:
-        isShowAtt("companyId", "mainObj") &&
-        currentCostTypeData.value.name == "采购货款",
-    },
-
-    {
-      type: "treeSelect",
       prop: "deptId",
       label: "业务部门",
       data: deptData.value,
@@ -759,6 +748,23 @@ const formConfig = computed(() => {
       isShow: isShowAtt("contractId", "mainObj"),
     },
     {
+      type: "treeSelect",
+      prop: "companyId",
+      label: "业务公司",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      // fn: (val) => {
+      //   getDeptData(val);
+      // },
+      multiple: true,
+      // disabled: true,
+      isShow:
+        isShowAtt("companyId", "mainObj") &&
+        currentCostTypeData.value.name == "采购货款",
+    },
+    {
       type: "title",
       title: "出货明细",
       haveLine: true,
@@ -956,9 +962,6 @@ const rules = ref({
   isVoucher: [
     { required: true, message: "请选择是否后提交凭证", trigger: "change" },
   ],
-  companyIdSet: [
-    { required: true, message: "请选择业务公司", trigger: "change" },
-  ],
   companyId: [{ required: true, message: "请选择业务公司", trigger: "change" }],
   deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
   invoiceTaxPoint: [
@@ -1175,6 +1178,7 @@ const accountPeriodDisabled = ref(true);
 // 记帐科目一些字段
 const accountSubjectsId = ref("");
 const subjectsCalculateItemName = ref("");
+const accountSubjectsNames = ref("");
 const subjectsCalculateItemNameList = ref([]);
 const requestUrl = {
   核算中心: "/tenantDept/list",
@@ -1202,7 +1206,7 @@ const getCorrespondSelectData = () => {
         break;
       }
       if (["核算中心", "部门"].includes(key)) {
-        let type = "";
+        let type = 2;
         if (key == "核算中心") {
           type = 0;
         }
@@ -1316,12 +1320,19 @@ const changeAccountSubjectsId = (val, index) => {
       (x) => x.id == accountSubjectsId.value
     );
     if (currentAccountSubjects) {
+      // 核算项目名称
       subjectsCalculateItemName.value =
         currentAccountSubjects.calculateItemName;
+
       subjectsCalculateItemNameList.value =
         currentAccountSubjects.calculateItemName.split(",");
       formData.data.costControlDetailList[index].subjectsCalculateItemName =
         subjectsCalculateItemName.value;
+      // 核算项目名称 带父级
+      accountSubjectsNames.value = currentAccountSubjects.accountSubjectsNames;
+      formData.data.costControlDetailList[index].accountSubjectsNames =
+        accountSubjectsNames.value;
+
       formData.data.costControlDetailList[index].subjectsCalculateItemNameList =
         subjectsCalculateItemNameList.value;
       getCorrespondSelectData();
@@ -1347,6 +1358,7 @@ const changeCostType = (val) => {
         currentAccountSubjects.calculateItemName;
       subjectsCalculateItemNameList.value =
         currentAccountSubjects.calculateItemName.split(",");
+      accountSubjectsNames.value = currentAccountSubjects.accountSubjectsNames;
       getCorrespondSelectData();
     }
   }
@@ -1356,6 +1368,12 @@ const changeCostType = (val) => {
   }
   formData.data.applyTime = moment().format("yyyy-MM-DD");
   formData.data.companyId = proxy.useUserStore().user.companyId;
+  if (
+    currentCostTypeData.value.name &&
+    currentCostTypeData.value.name == "采购货款"
+  ) {
+    formData.data.companyId = [proxy.useUserStore().user.companyId];
+  }
   formData.data.deptId = proxy.useUserStore().user.dept.deptId;
   formData.data.apapplyUserIdplyTime = proxy.useUserStore().user.userId;
   formData.data.isAdvance = 0;
@@ -1774,7 +1792,7 @@ const handleGetRemark = (index) => {
     ].remark = `支付${row.businessName}供应商${currentCostTypeData.value.name}${money}`;
   } else if (currentCostTypeData.value.name.indexOf("订单") != -1) {
     formData.data.costControlDetailList[index].money = parseFloat(
-      Number(row.costMoneySum)
+      Number(row.costMoney)
     ).toFixed(2);
   }
 };
@@ -1792,6 +1810,7 @@ const clickAdd = () => {
       deductionMonth: "",
       accountSubjectsId: accountSubjectsId.value,
       subjectsCalculateItemName: subjectsCalculateItemName.value,
+      accountSubjectsNames: accountSubjectsNames.value,
       subjectsCalculateItemNameList: subjectsCalculateItemNameList.value,
       submitMapData: {},
       logisticsCompanyId: "",
@@ -1828,6 +1847,7 @@ const clickAdd = () => {
         deductionMonth: "",
         accountSubjectsId: accountSubjectsId.value,
         subjectsCalculateItemName: subjectsCalculateItemName.value,
+        accountSubjectsNames: accountSubjectsNames.value,
         subjectsCalculateItemNameList: subjectsCalculateItemNameList.value,
         submitMapData: {},
         logisticsCompanyId: "",
@@ -1914,6 +1934,7 @@ const handleSelectContrct = async (row) => {
         contractTaxTransportationWay: x.contractTaxTransportationWay || "",
         code: x.code,
         sumQuantity: x.sumQuantity,
+        sumTruckQuantity: x.sumTruckQuantity,
         id: x.id,
         fileList: [],
         truckFileList: [],
@@ -2011,9 +2032,9 @@ const handleSubmit = async (isStag = false) => {
             }
           }
         }
-
         row.calculateItemList = calculateItemList;
       }
+      formData.data.companyId = formData.data.companyId.join(",");
       return true;
     } else {
       proxy.msgTip("请添加收付款明细");
@@ -2037,6 +2058,51 @@ defineExpose({
   handleSubmit,
 });
 
+const getSummaries = (param) => {
+  const { columns, data } = param; //columns是每列的信息,data是每行的信息
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = "合计"; //此处是在index=0的这一列显示为“合计”
+      return;
+    }
+    const values = data.map((item) => Number(item[column.property]));
+    if (
+      [
+        "balancePrepaidTax",
+        "balancePrepaid",
+        "currentPrepaidTax",
+        "currentPrepaid",
+        "accountPeriodAmountTax",
+        "accountPeriodAmount",
+        "accountPeriodAdjustAmount",
+        "deductionPrepaidTax",
+        "deductionPrepaid",
+        "taxation",
+        "currentPayableDeductionBefore",
+        "currentPayableDeduction",
+        "currentPayable",
+        "returnAmount",
+        "costMoneyTax",
+        "costMoney",
+        "costMoneySum",
+        "money",
+      ].includes(column.property)
+    ) {
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
+        if (!isNaN(value)) {
+          return Number(parseFloat(prev + curr).toFixed(4));
+        } else {
+          return prev;
+        }
+      }, 0);
+      sums[index];
+    }
+  });
+  return sums;
+};
+
 const getCheckBoxMap = (val) => {
   if (!val) return;
   proxy.post("/paymentType/detail", { id: val }).then((res) => {
@@ -2059,6 +2125,7 @@ const getAllData = (businessId) => {
   loading.value = true;
   proxy.post("/costControl/detail", { id: businessId }).then(async (res) => {
     if (res && res.costControlDetailList && res.costControlDetailList.length) {
+      let arr = [];
       for (let i = 0; i < res.costControlDetailList.length; i++) {
         const row = res.costControlDetailList[i];
         row.fileList = [];
@@ -2067,14 +2134,15 @@ const getAllData = (businessId) => {
         if (row.subjectsCalculateItemName) {
           row.subjectsCalculateItemNameList =
             row.subjectsCalculateItemName.split(",");
+          arr = arr.concat(row.subjectsCalculateItemNameList);
         }
 
         // 第一条
-        if (i == 0) {
-          subjectsCalculateItemNameList.value =
-            row.subjectsCalculateItemNameList;
-          getCorrespondSelectData();
-        }
+        // if (i == 0) {
+        //   subjectsCalculateItemNameList.value =
+        //     row.subjectsCalculateItemNameList;
+        //   getCorrespondSelectData();
+        // }
         //  数据处理并回显
         row.submitMapData = {};
         if (row.calculateItemList && row.calculateItemList.length > 0) {
@@ -2087,11 +2155,17 @@ const getAllData = (businessId) => {
           }
         }
       }
+      if (arr && arr.length > 0) {
+        subjectsCalculateItemNameList.value = Array.from(new Set(arr));
+        getCorrespondSelectData();
+      }
     }
     for (const key in res) {
       formData.data[key] = res[key];
     }
-
+    if (formData.data.companyId && formData.data.companyId.indexOf(",") != -1) {
+      formData.data.companyId = formData.data.companyId.split(",");
+    }
     if (formData.data.isPublicTransfer != undefined) {
       proxy
         .post("/accountManagement/page", {
@@ -2133,8 +2207,12 @@ const getAllData = (businessId) => {
         checkDisabled();
       }
     }, 1000);
+    if (Array.isArray(formData.data.companyId)) {
+      getDeptData(proxy.useUserStore().user.companyId);
+    } else {
+      getDeptData(formData.data.companyId);
+    }
 
-    getDeptData(formData.data.companyId);
     getCheckBoxMap(formData.data.costType);
     if (
       formData.data.costControlDetailList &&
@@ -2190,7 +2268,6 @@ const isHaveAccount = ref(false);
 const isHaveFinance = ref(false);
 
 onMounted(() => {
-  formData.data.companyIdSet.push(proxy.useUserStore().user.companyId);
   getDeptData(formData.data.companyId);
   isDisabled.value = judgeStatus();
   // formOption.disabled = judgeStatus();

+ 6 - 1
src/views/EHSD/saleContract/accountingSubjects/index.vue

@@ -310,7 +310,12 @@ const checkIsTopData = (parentId) => {
 
 const getDtl = (row) => {
   formData.data = proxy.deepClone(row);
-  formData.data.calculateItemName = formData.data.calculateItemName.split(",");
+  if (formData.data.calculateItemName) {
+    formData.data.calculateItemName =
+      formData.data.calculateItemName.split(",");
+  } else {
+    formData.data.calculateItemName = [];
+  }
   modalType.value = "edit";
   dialogVisible.value = true;
 };

+ 34 - 0
src/views/finance/fundManage/costControl/index.vue

@@ -33,6 +33,17 @@
         </el-button> -->
       </template>
     </el-dialog>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="920">
+      <CostControlPDF :rowData="rowData"></CostControlPDF>
+      <!-- <ContractPDFOneNew :rowData="rowData" ref="PdfDom"></ContractPDFOneNew> -->
+      <!-- <template #footer>
+        <el-button @click="openPrint = false" size="default">取消</el-button>
+        <el-button type="primary" v-print="printObj" size="default">打印</el-button>
+        <el-button type="primary" @click="clickDownload()" size="default">下载PDF</el-button>
+        <el-button type="primary" @click="exportExcel()" size="default">导出Excel</el-button>
+      </template> -->
+    </el-dialog>
   </div>
 </template>
 
@@ -43,6 +54,7 @@ import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 import $bus from "@/bus/index.js";
+import CostControlPDF from "@/components/PDF/CostControlPDF.vue";
 
 const { proxy } = getCurrentInstance();
 const fundsPaymentMethod = computed(
@@ -329,6 +341,19 @@ const config = computed(() => {
                 },
               }
             : {},
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "打印",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickPrint(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -692,6 +717,15 @@ const getDtl = (row) => {
       dialogVisible.value = true;
     });
 };
+
+const openPrint = ref(false);
+const rowData = ref({});
+const clickPrint = (row) => {
+  rowData.value = {
+    id: row.id,
+  };
+  openPrint.value = true;
+};
 </script>
 
 <style lang="scss" scoped>

+ 12 - 4
src/views/process/processConfig/vueFlow.vue

@@ -174,7 +174,7 @@ const formConfig = computed(() => {
       //1用户 2部门负责人 3部门总监 4岗位 5角色
       data: [
         {
-          label: "用户",
+          label: "指定用户",
           value: 1,
         },
         // {
@@ -190,9 +190,13 @@ const formConfig = computed(() => {
         //   value: 4,
         // },
         {
-          label: "角色",
+          label: "指定角色",
           value: 5,
         },
+        {
+          label: "动态用户",
+          value: 6,
+        },
       ],
     },
     // {
@@ -209,7 +213,9 @@ const formConfig = computed(() => {
       prop: "handleObjectId",
       placeholder: "请选择办理人",
       data: selectHanleData.value,
-      isShow: formData.data.handleObjectType !== 5,
+      isShow:
+        formData.data.handleObjectType !== 5 &&
+        formData.data.handleObjectType !== 6,
     },
     {
       type: "select",
@@ -219,7 +225,9 @@ const formConfig = computed(() => {
       multiple: true,
       placeholder: "请选择办理人",
       data: selectHanleData.value,
-      isShow: formData.data.handleObjectType === 5,
+      isShow:
+        formData.data.handleObjectType === 5 &&
+        formData.data.handleObjectType !== 6,
     },
     {
       type: "input",