Преглед на файлове

开票申请、外包加工账单

cz преди 1 година
родител
ревизия
396154e1a8

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

@@ -482,7 +482,7 @@ loadInit();
   box-sizing: border-box;
 }
 .by-form .el-form--inline > .el-form-item {
-  padding: 0 10px 0 0px;
+  padding: 0 15px 0 0px;
 }
 .by-form .el-form--inline .formTitle {
   padding: 0px !important;

+ 4 - 62
src/components/byTable/ElementsMapping.vue

@@ -3,7 +3,7 @@
 
     <el-button v-for="(i,index) in getCellList" @click="i.click()" :key="index" v-bind="i.attrs" v-debounce
                v-show="index < 2">{{ i.attrs.label }}</el-button>
-    <el-dropdown>
+    <el-dropdown v-show="getCellList && getCellList.length>2">
       <span class="el-dropdown-link">
         <span class="more-btn">更多</span>
 
@@ -52,70 +52,12 @@ export default defineComponent({
   },
   setup(props) {
     const { proxy } = getCurrentInstance();
-
-    proxy.$.components = props.parent.$options.components;
-    proxy.$.directives = props.parent.$options.directives;
-    const elementsMapping = ref({
-      button: "el-button",
-    });
+    console.log(props, "awdwa");
     const getCellList = computed(() => {
       return props.cellList.filter((cell) => cell && Object.keys(cell).length);
     });
-    const getAttrsValue = (item) => {
-      if (!item.attrs) {
-        item.attrs = {};
-      }
-      const {
-        class: className = null,
-        style = null,
-        directives = null,
-        ...attrs
-      } = item.attrs;
-      return {
-        class: className,
-        style,
-        directives,
-        props: attrs,
-      };
-    };
-    if (getCellList.value.length > 3) {
-      return {
-        getCellList,
-      };
-    }
-    return () => {
-      return h(
-        "div",
-        getCellList.value.map((cellItem) => {
-          const comp = resolveComponent(
-            elementsMapping.value[cellItem.el] || cellItem.el
-          );
-          const attributes = getAttrsValue(cellItem);
-          const { label, ...others } = attributes.props;
-          const { directives } = attributes;
-          let onClick;
-          if (cellItem.click) {
-            onClick = cellItem.click.bind(props.parent, props.row);
-          }
-          let resultVNode = h(comp, {
-            onClick,
-            innerHTML: label,
-            ...others,
-          });
-          if (directives) {
-            resultVNode = withDirectives(resultVNode, [
-              ...directives.map((directiveItem) => {
-                return [
-                  resolveDirective(directiveItem.name),
-                  directiveItem.value,
-                  directiveItem.arg,
-                ];
-              }),
-            ]);
-          }
-          return resultVNode;
-        })
-      );
+    return {
+      getCellList,
     };
   },
 });

+ 1 - 1
src/components/process/SF/ActivityPriceInventory.vue

@@ -112,7 +112,7 @@ const judgeStatus = () => {
 };
 const formOption = reactive({
   inline: true,
-  labelWidth: 130,
+  labelWidth: 110,
   itemWidth: 100,
   disabled: false,
 });

+ 1 - 1
src/components/process/SF/InvoiceTaxDeduction.vue

@@ -77,7 +77,7 @@ const judgeStatus = () => {
 };
 const formOption = reactive({
   inline: true,
-  labelWidth: 120,
+  labelWidth: 110,
   itemWidth: 100,
   disabled: false,
 });

+ 968 - 0
src/components/process/SF/InvoicingApplication.vue

@@ -0,0 +1,968 @@
+<template>
+  <div style="width: 100%; padding: 0px 15px">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
+
+      <template #contractDetail>
+        <div style="width:100%">
+          <el-button type="primary" @click="openSelectContrct=true" plain style="margin-bottom: 16px" v-if="!judgeStatus()">选择</el-button>
+          <el-table :data="formData.data.invoiceApplyContractDetailList" style="width: 100%;">
+            <el-table-column label="合同号" prop="contractCode" />
+            <el-table-column label="收款金额" prop="sumClaimMoney" />
+            <el-table-column label="已开票金额" prop="invoiceAmount" />
+            <el-table-column label="未开票金额" prop="unInvoiceAmount" />
+            <el-table-column label="开票金额" prop="amount" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'invoiceApplyContractDetailList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入" style="width: 100%" :precision="2"
+                                     :controls="false" :min="0" @change="amountChange" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleRemove($index,1)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+
+      <template #customer>
+        <div style="width:100%">
+          <el-select v-model="formData.data.customerId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
+                     :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer">
+            <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
+          </el-select>
+        </div>
+      </template>
+      <template #detail>
+        <div style="width:100%">
+          <el-button type="primary" @click="handleAdd()" plain style="margin-bottom: 16px" v-if="!judgeStatus()">添加</el-button>
+          <el-table :data="formData.data.invoiceApplyDetailList" style="width: 100%;">
+            <el-table-column label="货物或应税劳务名称、服务名称" prop="name">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.name'" :rules="rules.name" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input v-model="row.name" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="规格型号" prop="spec" width="160">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.spec'" :rules="rules.spec" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input v-model="row.spec" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="单位" prop="unit" width="140">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.unit'" :rules="rules.unit" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input v-model="row.unit" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="数量" prop="quantity" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                     :controls="false" :min="0" @change="totalAmount()" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="priceIncludingTax" label="单价(含税)" width="120" />
+            <el-table-column label="金额(含税)" prop="amountIncludingTax" width="120">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.amountIncludingTax'" :rules="rules.amountIncludingTax"
+                                :inline-message="true" class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.amountIncludingTax" placeholder="请输入" style="width: 100%"
+                                     :precision="2" :controls="false" :min="0" @change="totalAmount()" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="taxRate" label="税率(%)" width="100" />
+            <el-table-column prop="taxAmount" label="税额" width="100" />
+            <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleRemove($index,2)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+    </byForm>
+    <el-dialog v-if="openSelectContrct" v-model="openSelectContrct" title="合同选择" width="90%" append-to-body>
+      <ContractSelect @handleSelectContrct="handleSelectContrct"></ContractSelect>
+      <template #footer>
+        <el-button @click="openSelectContrct = false" size="defualt" v-debounce>关 闭</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+import ContractSelect from "@/views/salesMange/saleContract/contractSelect/index";
+import { useRoute } from "vue-router";
+const { proxy } = getCurrentInstance();
+const route = useRoute();
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const openSelectContrct = ref(false);
+const internalOrderChannels = computed(
+  () => proxy.useUserStore().allDict["internal_order_channels"]
+);
+const applicatioScenario = computed(
+  () => proxy.useUserStore().allDict["applicatio_scenario"]
+);
+const paymentSituation = computed(
+  () => proxy.useUserStore().allDict["payment_situation"]
+);
+const customerList = ref([]);
+const accountList = ref([]);
+const userList = ref([]);
+const deptData = ref([]);
+const isData = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
+const invoiceType = ref([
+  {
+    label: "1%电子普票",
+    value: 1,
+  },
+  {
+    label: "1%纸质普票",
+    value: 0,
+  },
+]);
+
+const formData = reactive({
+  data: {
+    invoiceApplyContractDetailList: [],
+    invoiceApplyDetailList: [],
+    fileList: [],
+    jstOrderFileList: [],
+    shopTradeFileList: [],
+    invoicerFileList: [],
+  },
+});
+const formDom = ref(null);
+const judgeStatus = () => {
+  if (route.query.processType == 20 || route.query.processType == 10) {
+    return true;
+  }
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter(
+      (item) => item.status === 2 && item.nodeType !== 1
+    );
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
+const formOption = reactive({
+  inline: true,
+  labelPosition: "top",
+  labelWidth: 150,
+  itemWidth: 100,
+  disabled: false,
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title",
+      title: "基本信息",
+      haveLine: false,
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "申请单号",
+      placeholder: " ",
+      itemWidth: 33.33,
+      disabled: true,
+    },
+
+    {
+      type: "select",
+      prop: "createUser",
+      label: "申请人",
+      required: true,
+      filterable: true,
+      data: userList.value,
+      itemWidth: 33.33,
+      disabled: true,
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "开票部门",
+      data: deptData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 33.33,
+      disabled: true,
+    },
+    {
+      type: "date",
+      prop: "applyTime",
+      itemType: "date",
+      label: "申请日期",
+      itemWidth: 33.33,
+      disabled: false,
+    },
+    // {
+    //   type: "treeSelect",
+    //   prop: "companyId",
+    //   label: "所属公司",
+    //   data: proxy.useUserStore().allDict["tree_all_company_data"],
+    //   propsTreeLabel: "deptName",
+    //   propsTreeValue: "deptId",
+    //   itemWidth: 33.33,
+    //   fn: (val) => {},
+    //   disabled: true,
+    // },
+
+    {
+      type: "select",
+      prop: "applyScenario",
+      label: "申请场景",
+      filterable: true,
+      multiple: false,
+      data: applicatioScenario.value,
+      itemWidth: 33.33,
+    },
+    {
+      type: "select",
+      prop: "orderingChannels",
+      label: "内部下单渠道",
+      filterable: true,
+      multiple: false,
+      data: internalOrderChannels.value,
+      itemWidth: 33.33,
+    },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "财务主管驳回原因",
+    //   itemWidth: 33.33,
+    //   disabled: true,
+    // },
+    {
+      type: "upload",
+      listType: "text",
+      aisInventorySupportept: "",
+      prop: "fileList",
+      label: "相关审批附件",
+    },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "关联系统销售合同",
+    //   itemWidth: 33.33,
+    //   disabled: true,
+    //   isShow: formData.data.orderingChannels == "10",
+    // },
+    {
+      type: "slot",
+      slotName: "contractDetail",
+      label: "关联系统销售合同",
+      isShow: formData.data.orderingChannels == "10",
+    },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "关联系统销售合同单号y",
+    //   itemWidth: 33.33,
+    //   disabled: true,
+    //   isShow: formData.data.orderingChannels == "10",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "合同累计收款金额",
+    //   itemWidth: 33.33,
+    //   placeholder: " ",
+    //   disabled: true,
+    //   isShow: formData.data.orderingChannels == "10",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "合同累计收款金额",
+    //   itemWidth: 33.33,
+    //   placeholder: " ",
+    //   disabled: true,
+    //   isShow: formData.data.orderingChannels == "10",
+    // },
+    {
+      type: "input",
+      prop: "contractAmount",
+      itemType: "text",
+      label: "合同开票总金额",
+      itemWidth: 50,
+      placeholder: " ",
+      disabled: true,
+      isShow: formData.data.orderingChannels == "10",
+    },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "未开票金额",
+    //   itemWidth: 33.33,
+    //   placeholder: " ",
+    //   disabled: true,
+    //   isShow: formData.data.orderingChannels == "10",
+    // },
+    {
+      type: "select",
+      prop: "isMatchOrder",
+      label: "是否匹配订单",
+      filterable: true,
+      multiple: false,
+      data: isData.value,
+      itemWidth: 33.33,
+      isShow: formData.data.orderingChannels == "30",
+    },
+    {
+      type: "select",
+      prop: "paymentSituation",
+      label: "收款情况",
+      filterable: true,
+      multiple: false,
+      data: paymentSituation.value,
+      itemWidth: 33.33,
+      isShow: formData.data.orderingChannels == "30",
+    },
+    {
+      type: "input",
+      prop: "jstOrderCode",
+      itemType: "text",
+      label: "关联聚水潭单号",
+      itemWidth: 33.33,
+      disabled: false,
+      isShow: ["20", "30", "40", "50"].includes(formData.data.orderingChannels),
+    },
+    {
+      type: "uploadImg",
+      // listType: "picture-card",
+      // limit: 1,
+      // accept: ".gif, .jpeg, .jpg, .png",
+      prop: "jstOrderFileList",
+      imgProp: "imageUrl",
+      label: "聚水潭订单界面金额截图(需有订单号和金额)",
+      itemWidth: 100,
+      isShow: ["20", "30", "40", "50"].includes(formData.data.orderingChannels),
+    },
+    {
+      type: "uploadImg",
+      // listType: "picture-card",
+      // limit: 1,
+      // accept: ".gif, .jpeg, .jpg, .png",
+      prop: "shopTradeFileList",
+      imgProp: "imageUrlOne",
+      label: "店铺交易截图(含店铺名称、订单编号)",
+      itemWidth: 100,
+      isShow: ["20", "40"].includes(formData.data.orderingChannels),
+    },
+
+    {
+      type: "input",
+      prop: "askRemark",
+      itemType: "textarea",
+      label: "开票要求备注",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "isCashNoted",
+      itemType: "text",
+      label: "是否在票面备注上‘现金’两个字",
+      itemWidth: 33.33,
+      disabled: false,
+      placeholder: " ",
+      isShow: ["20", "40"].includes(formData.data.orderingChannels),
+    },
+    {
+      type: "title",
+      title: "开票信息&税点结算",
+      haveLine: true,
+    },
+    {
+      type: "input",
+      prop: "taxPointSettle",
+      itemType: "text",
+      label: "税点结算(%)",
+      placeholder: " ",
+      itemWidth: 25,
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "taxPointSettleAmount",
+      itemType: "text",
+      label: "税点结算金额",
+      placeholder: " ",
+      itemWidth: 25,
+      disabled: true,
+    },
+    {
+      type: "slot",
+      prop: "customerId",
+      slotName: "customer",
+      label: "客户开票信息",
+      itemWidth: 25,
+    },
+    {
+      type: "select",
+      prop: "billingType",
+      label: "开票类型",
+      filterable: false,
+      multiple: false,
+      data: invoiceType.value,
+      itemWidth: 25,
+    },
+    {
+      type: "select",
+      prop: "sellerCompanyId",
+      label: "名称(销售方)",
+      filterable: false,
+      multiple: false,
+      data: accountList.value,
+      itemWidth: 50,
+      fn: (val) => {
+        changeShroffAccount(val);
+      },
+    },
+    {
+      type: "input",
+      prop: "buyerCompanyName",
+      itemType: "text",
+      label: "名称(购买方)",
+      itemWidth: 50,
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "sellerTaxpayerCode",
+      itemType: "text",
+      label: "纳税人识别号(销售方)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "buyerTaxpayerCode",
+      itemType: "text",
+      label: "纳税人识别号(购买方)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "sellerAddress",
+      itemType: "text",
+      label: "地址、电话(销售方)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "buyerAddress",
+      itemType: "text",
+      label: "地址、电话(购买方)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "sellerAccountBank",
+      itemType: "text",
+      label: "开户行及账号(销售方)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "buyerAccountBank",
+      itemType: "text",
+      label: "开户行及账号(购买方)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "title",
+      title: "开票内容",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "detail",
+      prop: "",
+      label: "开票明细",
+    },
+    {
+      type: "input",
+      prop: "amountIncludingTax",
+      itemType: "text",
+      label: "合计开票总金额(含税)",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: true,
+    },
+    // {
+    //   type: "input",
+    //   prop: "activityName",
+    //   itemType: "text",
+    //   label: "客户确认结果",
+    //   placeholder: " ",
+    //   itemWidth: 50,
+    //   disabled: true,
+    // },
+    {
+      type: "input",
+      prop: "ticketRemark",
+      itemType: "textarea",
+      label: "票面备注内容",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "upload",
+      listType: "text",
+      aisInventorySupportept: "",
+      prop: "invoicerFileList",
+      label: "开票员上传发票附件",
+    },
+  ];
+});
+
+const rules = ref({
+  applyTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
+  companyId: [{ required: true, message: "请选择所属公司", trigger: "change" }],
+  deptId: [{ required: true, message: "请选择所属部门", trigger: "change" }],
+  createUser: [{ required: true, message: "请选择申请人", trigger: "change" }],
+  applyScenario: [
+    { required: true, message: "请选择申请场景", trigger: "change" },
+  ],
+  orderingChannels: [
+    { required: true, message: "请选择内部下单渠道", trigger: "change" },
+  ],
+  isMatchOrder: [
+    { required: true, message: "请选择是否匹配订单", trigger: "change" },
+  ],
+  paymentSituation: [
+    { required: true, message: "请选择收款情况", trigger: "change" },
+  ],
+  jstOrderFileList: [{ required: true, message: "请上传", trigger: "change" }],
+  shopTradeFileList: [{ required: true, message: "请上传", trigger: "change" }],
+  jstOrderCode: [
+    { required: true, message: "请输入聚水潭单号", trigger: "blur" },
+  ],
+  // askRemark: [
+  //   { required: true, message: "请输入开票要求备注", trigger: "blur" },
+  // ],
+  sellerCompanyId: [
+    { required: true, message: "请选择销售方", trigger: "change" },
+  ],
+  customerId: [
+    { required: true, message: "请选择客户开票信息", trigger: "change" },
+  ],
+  name: [{ required: true, message: "请输入", trigger: "blur" }],
+  spec: [{ required: true, message: "请输入规格型号", trigger: "blur" }],
+  unit: [{ required: true, message: "请输入单位", trigger: "blur" }],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  amountIncludingTax: [
+    { required: true, message: "请输入金额(含税)", trigger: "blur" },
+  ],
+  amount: [{ required: true, message: "请输入开票金额", trigger: "blur" }],
+});
+const isFormDetail = ref(false);
+if (route.query && route.query.processType && route.query.processType == 20) {
+  isFormDetail.value = true;
+}
+const getDeptData = () => {
+  proxy
+    .get(isFormDetail.value ? "/tenantUser/listAll" : "/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      // ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDeptData();
+
+const getDict = () => {
+  proxy
+    .post("/accountManagement/page", {
+      pageNum: 1,
+      pageSize: 999,
+    })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
+
+  proxy
+    .post("/customer/selPage", {
+      pageNum: 1,
+      pageSize: 50,
+    })
+    .then((res) => {
+      customerList.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+getDict();
+
+const loadingSearch = ref(false);
+const remoteMethod = (keyword) => {
+  if (keyword && typeof keyword === "string") {
+    loadingSearch.value = true;
+    proxy.post("/customer/selPage", { keyword }).then((res) => {
+      customerList.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+      loadingSearch.value = false;
+    });
+  }
+  return;
+};
+
+const changeCustomer = (val) => {
+  if (val) {
+    proxy.post("/customer/detail", { id: val }).then(
+      (res) => {
+        formData.data.buyerCompanyName = res.name;
+        formData.data.buyerTaxpayerCode = res.dutyParagraph;
+        formData.data.buyerAddress = res.accountAddress + " " + res.accountTel;
+        formData.data.buyerAccountBank =
+          res.accountBank + " " + res.accountNumber;
+      },
+      (err) => {}
+    );
+  }
+};
+
+const changeShroffAccount = (val) => {
+  if (val) {
+    let data = accountList.value.find((item) => item.value == val);
+    if (data) {
+      formData.data.taxPointSettle = data.taxPoints;
+      formData.data.sellerTaxpayerCode = data.taxpayerCode;
+      formData.data.sellerAddress =
+        data.beneficiaryAddress + " " + data.beneficiaryTel;
+      formData.data.sellerAccountBank =
+        data.openingBank + " " + data.accountOpening;
+      for (let i = 0; i < formData.data.invoiceApplyDetailList.length; i++) {
+        formData.data.invoiceApplyDetailList[i].taxRate =
+          formData.data.taxPointSettle;
+      }
+      totalAmount();
+    }
+  }
+};
+
+const totalAmount = () => {
+  let money = 0;
+  let moneyTwo = 0;
+  if (
+    formData.data.invoiceApplyDetailList &&
+    formData.data.invoiceApplyDetailList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.invoiceApplyDetailList.length; i++) {
+      let row = formData.data.invoiceApplyDetailList[i];
+      row.priceIncludingTax = parseFloat(
+        Number(row.amountIncludingTax) / Number(row.quantity)
+      ).toFixed(2);
+      money = parseFloat(
+        Number(money) + Number(row.amountIncludingTax)
+      ).toFixed(2);
+      if (row.taxRate) {
+        row.taxAmount = parseFloat(
+          Number(row.amountIncludingTax) * (Number(row.taxRate) / 100)
+        ).toFixed(2);
+        moneyTwo = parseFloat(Number(moneyTwo) + Number(row.taxAmount)).toFixed(
+          2
+        );
+      }
+    }
+  }
+  formData.data.amountIncludingTax = money;
+  formData.data.taxPointSettleAmount = moneyTwo;
+};
+
+const amountChange = () => {
+  let money = 0;
+  if (
+    formData.data.invoiceApplyContractDetailList &&
+    formData.data.invoiceApplyContractDetailList.length > 0
+  ) {
+    for (
+      let i = 0;
+      i < formData.data.invoiceApplyContractDetailList.length;
+      i++
+    ) {
+      let row = formData.data.invoiceApplyContractDetailList[i];
+
+      money = parseFloat(Number(money) + Number(row.amount)).toFixed(2);
+    }
+  }
+  formData.data.contractAmount = money;
+};
+
+const handleSelectContrct = async (row) => {
+  formData.data.invoiceApplyContractDetailList.push({
+    contractId: row.id,
+    contractCode: row.code,
+    sumClaimMoney: row.sumClaimMoney,
+    invoiceAmount: row.invoiceAmount,
+    unInvoiceAmount: row.unInvoiceAmount,
+    amount: null,
+  });
+  return proxy.msgTip("选择成功", 1);
+};
+
+const handleAdd = () => {
+  formData.data.invoiceApplyDetailList.push({
+    name: "",
+    spec: "",
+    unit: "",
+    quantity: null,
+    priceIncludingTax: "",
+    amountIncludingTax: "",
+    taxRate: formData.data.taxPointSettle ? formData.data.taxPointSettle : "",
+    taxAmount: "",
+  });
+};
+
+const handleRemove = (index, type) => {
+  if (type == 1) {
+    formData.data.invoiceApplyContractDetailList.splice(index, 1);
+  } else {
+    formData.data.invoiceApplyDetailList.splice(index, 1);
+  }
+};
+
+const handleSubmit = async (isStag = false) => {
+  if (isStag) {
+    return true;
+  }
+  let flag = await formDom.value.handleSubmit(() => {});
+  if (flag) {
+    if (formData.data.orderingChannels == "10") {
+      if (
+        !(
+          formData.data.invoiceApplyContractDetailList &&
+          formData.data.invoiceApplyContractDetailList.length > 0
+        )
+      ) {
+        proxy.msgTip("请关联销售合同", 2);
+        return false;
+      }
+    }
+    if (
+      !(
+        formData.data.invoiceApplyDetailList &&
+        formData.data.invoiceApplyDetailList.length > 0
+      )
+    ) {
+      proxy.msgTip("请添加开票明细", 2);
+      return false;
+    }
+    if (formData.data.orderingChannels == "10") {
+      if (
+        !(
+          Number(formData.data.contractAmount) ==
+          Number(formData.data.amountIncludingTax)
+        )
+      ) {
+        proxy.msgTip("合同开票总金额必须等于合计开票总金额(含税)", 2);
+        return false;
+      }
+    }
+    return true;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClorderingChannelsName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
+  }
+  return flag;
+};
+
+const getFormData = () => {
+  return proxy.deepClone(formData.data);
+};
+// 向父组件暴露
+defineExpose({
+  getFormData,
+  handleSubmit,
+});
+
+const getAllData = (businessId) => {
+  if (businessId) {
+    proxy.post("/invoiceApply/detail", { id: businessId }).then((res) => {
+      formData.data = res;
+      amountChange();
+      proxy
+        .post("/fileInfo/getList", { businessIdList: [businessId] })
+        .then((fileObj) => {
+          if (fileObj[businessId] && fileObj[businessId].length > 0) {
+            formData.data.fileList = fileObj[businessId]
+              .filter((x) => x.businessType == "10")
+              .map((item) => {
+                return {
+                  ...item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+            formData.data.jstOrderFileList = fileObj[businessId]
+              .filter((x) => x.businessType == "20")
+              .map((item) => {
+                return {
+                  ...item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+            if (
+              formData.data.jstOrderFileList &&
+              formData.data.jstOrderFileList.length > 0
+            ) {
+              formData.data.imageUrl =
+                formData.data.jstOrderFileList[0].fileUrl;
+            }
+            formData.data.shopTradeFileList = fileObj[businessId]
+              .filter((x) => x.businessType == "30")
+              .map((item) => {
+                return {
+                  ...item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+            if (
+              formData.data.shopTradeFileList &&
+              formData.data.shopTradeFileList.length > 0
+            ) {
+              formData.data.imageUrlOne =
+                formData.data.shopTradeFileList[0].fileUrl;
+            }
+            formData.data.invoicerFileList = fileObj[businessId]
+              .filter((x) => x.businessType == "40")
+              .map((item) => {
+                return {
+                  ...item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+          } else {
+            formData.data.fileList = [];
+            formData.data.jstOrderFileList = [];
+            formData.data.shopTradeFileList = [];
+            formData.data.invoicerFileList = [];
+          }
+        });
+    });
+  }
+};
+
+onMounted(() => {
+  formOption.disabled = judgeStatus();
+  formData.data.applyTime = proxy.parseTime(new Date());
+  formData.data.companyId = proxy.useUserStore().user.companyId;
+  formData.data.deptId = proxy.useUserStore().user.dept.deptId;
+  formData.data.createUser = proxy.useUserStore().user.userId;
+  if (route.query.businessId) {
+    getAllData(route.query.businessId);
+  }
+  // 删除莫名多出的一个textarea
+  nextTick(() => {
+    setTimeout(() => {
+      let dom = document.getElementsByTagName("textarea");
+      if (dom && dom.length > 0) {
+        for (let i = 0; i < dom.length; i++) {
+          if (!dom[i].className) {
+            dom[i].style.display = "none";
+          }
+        }
+      }
+    }, 100);
+  });
+});
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 1 - 1
src/components/process/SF/PersonalInvoice.vue

@@ -40,7 +40,7 @@ const judgeStatus = () => {
 };
 const formOption = reactive({
   inline: true,
-  labelWidth: 120,
+  labelWidth: 100,
   itemWidth: 100,
   disabled: false,
 });

+ 2 - 2
src/views/customer/addCustomer.vue

@@ -326,7 +326,7 @@ const formData = reactive({
 });
 const getDict = () => {
   proxy
-    .get("/tenantUser/list", {
+    .get("/tenantUser/listAll", {
       pageNum: 1,
       pageSize: 10000,
       tenantId: proxy.useUserStore().user.tenantId,
@@ -357,7 +357,7 @@ const getDict = () => {
       pageNum: 1,
       pageSize: 9999,
       keyword: "",
-      ancestors: proxy.useUserStore().user.companyId,
+      // ancestors: proxy.useUserStore().user.companyId,
       tenantId: proxy.useUserStore().user.tenantId,
       // type: 2,
     })

+ 32 - 0
src/views/finance/fundManage/account/index.vue

@@ -295,6 +295,37 @@ const formConfig = computed(() => {
       itemWidth: 50,
       itemType: "text",
     },
+    {
+      type: "number",
+      prop: "taxPoints",
+      label: "税点",
+      precision: 2,
+      min: 0,
+      max: 100,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "taxpayerCode",
+      label: "纳税人识别号",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryAddress",
+      label: "地址",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryTel",
+      label: "电话",
+      itemWidth: 50,
+      itemType: "text",
+    },
     // {
     //   type: "title1",
     //   title: "外汇信息",
@@ -369,6 +400,7 @@ const rules = ref({
     { required: true, message: "请选择业务公司", trigger: "change" },
   ],
   type: [{ required: true, message: "请选择类型", trigger: "change" }],
+  taxPoints: [{ required: true, message: "请输入税点", trigger: "blur" }],
 });
 const formData = reactive({
   data: {

+ 574 - 0
src/views/oa/application/invoicingApplication/index.vue

@@ -0,0 +1,574 @@
+<template>
+  <div class="pageIndexClass">
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" :loading="loading"
+               highlight-current-row :action-list="[
+          {
+            text: '添加',
+            action: () => openModal('add'),
+          },
+        ]" @get-list="getList">
+
+        <template #code="{item}">
+          <div style="width:100%">
+            <span class="el-click" @click="getDtl(item)">{{item.code}}</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog :title="modalType == 'add' ? '归还' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="500">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import moment from "moment";
+// import $bus from "@/bus/index.js";
+import useRefreshTableData from "@/hooks/refreshTableData";
+
+const { proxy } = getCurrentInstance();
+const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
+const internalOrderChannels = computed(
+  () => proxy.useUserStore().allDict["internal_order_channels"]
+);
+const applicatioScenario = computed(
+  () => proxy.useUserStore().allDict["applicatio_scenario"]
+);
+const paymentSituation = computed(
+  () => proxy.useUserStore().allDict["payment_situation"]
+);
+const isData = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
+const userList = ref([]);
+const deptData = ref([]);
+const typeData = ref([
+  {
+    label: "收入",
+    value: "10",
+  },
+  {
+    label: "支出",
+    value: "20",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const statusData = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "审批驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "作废",
+    value: 88,
+  },
+]);
+const isReturnedData = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
+
+const useMethodData = ref([
+  {
+    dictValue: "借章",
+    dictKey: "1",
+  },
+  {
+    dictValue: "盖章",
+    dictKey: "2",
+  },
+]);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "审批状态",
+      prop: "status",
+      data: statusData.value,
+    },
+    // {
+    //   label: "是否归还",
+    //   prop: "isReturned",
+    //   data: isReturnedData.value,
+    // },
+    // {
+    //   label: "使用方式",
+    //   prop: "useMethod",
+    //   data: useMethodData.value,
+    // },
+    // {
+    //   label: "印章类型",
+    //   prop: "sealType",
+    //   data: sealType.value,
+    // },
+    // {
+    //   label: "盖章类别",
+    //   prop: "stampedType",
+    //   data: sealCategory.value,
+    // },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "流水号",
+        slot: "code",
+        width: 130,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "申请人",
+        prop: "createUserName",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "申请日期",
+        prop: "applyTime",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "申请场景",
+        prop: "applyScenario",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, applicatioScenario.value);
+      },
+    },
+    {
+      attrs: {
+        label: "下单渠道",
+        prop: "orderingChannels",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, internalOrderChannels.value);
+      },
+    },
+    {
+      attrs: {
+        label: "是否匹配订单",
+        prop: "isMatchOrder",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, isData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "收款情况",
+        prop: "paymentSituation",
+        width: 150,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, paymentSituation.value);
+      },
+    },
+    {
+      attrs: {
+        label: "聚水潭订单号",
+        prop: "jstOrderCode",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "销售方",
+        prop: "sellerCompanyName",
+        // width: 130,
+        "min-width": 150,
+      },
+    },
+    {
+      attrs: {
+        label: "税点(%)",
+        prop: "taxPointSettle",
+        width: 90,
+      },
+    },
+    {
+      attrs: {
+        label: "税点结算金额",
+        prop: "taxPointSettleAmount",
+        width: 110,
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        prop: "buyerCompanyName",
+        // width: 130,
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "总金额(含税)",
+        prop: "amountIncludingTax",
+        width: 110,
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "审批状态",
+        prop: "status",
+        width: 100,
+        fixed: "right",
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, statusData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return row.createUser == proxy.useUserStore().user.userId
+          ? [
+              row.status == 0
+                ? {
+                    attrs: {
+                      label: "修改",
+                      type: "primary",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      clickUpdate(row);
+                    },
+                  }
+                : {},
+              row.status == 0
+                ? {
+                    attrs: {
+                      label: "删除",
+                      type: "danger",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      proxy
+                        .msgConfirm()
+                        .then((res) => {
+                          proxy
+                            .post("/invoiceApply/delete", {
+                              id: row.id,
+                            })
+                            .then((res) => {
+                              proxy.msgTip("操作成功", 1);
+                              getList();
+                            });
+                        })
+                        .catch((err) => {});
+                    },
+                  }
+                : {},
+              row.status == 10 || row.status == 30
+                ? {
+                    attrs: {
+                      label: "作废",
+                      type: "danger",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      proxy
+                        .msgConfirm()
+                        .then((res) => {
+                          proxy
+                            .post("/invoiceApply/cancellation", {
+                              id: row.id,
+                            })
+                            .then((res) => {
+                              proxy.msgTip("操作成功", 1);
+                              getList();
+                            });
+                        })
+                        .catch((err) => {});
+                    },
+                  }
+                : {},
+            ]
+          : [];
+      },
+    },
+  ];
+});
+const corporationList = ref([]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/invoiceApply/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const getDeptData = (val) => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDeptData();
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "date",
+      prop: "realityReturnedTime",
+      itemType: "date",
+      label: "归还日期",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+const rules = ref({
+  realityReturnedTime: [
+    { required: true, message: "请选择归还日期", trigger: "change" },
+  ],
+});
+const formData = reactive({
+  data: {
+    accountRemainderList: [{ currency: "", remainder: undefined }],
+  },
+});
+const openModal = (val) => {
+  // modalType.value = val;
+  // formData.data = {
+  //   accountRemainderList: [{ currency: "", remainder: undefined }],
+  // };
+  // loadingDialog.value = false;
+  // dialogVisible.value = true;
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "invoice_apply_flow",
+      flowName: "开票申请发起流程",
+      random: proxy.random(),
+    },
+  });
+};
+const clickBalance = () => {
+  if (
+    formData.data.accountRemainderList &&
+    formData.data.accountRemainderList.length > 0
+  ) {
+    formData.data.accountRemainderList.push({
+      currency: "",
+      remainder: undefined,
+    });
+  } else {
+    formData.data.accountRemainderList = [
+      { currency: "", remainder: undefined },
+    ];
+  }
+};
+const handleRemove = (index) => {
+  formData.data.accountRemainderList.splice(index, 1);
+};
+const isRepeat = (arr) => {
+  var hash = {};
+  for (var i in arr) {
+    if (hash[arr[i].currency]) return true;
+    hash[arr[i].currency] = true;
+  }
+  return false;
+};
+
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/invoiceApply/returned", formData.data).then(
+      () => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        loadingDialog.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+    // if (
+    //   formData.data.accountRemainderList &&
+    //   formData.data.accountRemainderList.length > 0
+    // ) {
+    //   if (isRepeat(formData.data.accountRemainderList)) {
+    //     return ElMessage("请勿重复添加货币余额");
+    //   } else {
+    //     loadingDialog.value = true;
+    //     proxy.post("/accountManagement/" + modalType.value, formData.data).then(
+    //       () => {
+    //         ElMessage({
+    //           message: modalType.value == "add" ? "添加成功" : "编辑成功",
+    //           type: "success",
+    //         });
+    //         dialogVisible.value = false;
+    //         getList();
+    //       },
+    //       (err) => {
+    //         console.log(err);
+    //         loadingDialog.value = false;
+    //       }
+    //     );
+    //   }
+    // } else {
+    //   return ElMessage("请添加至少一条类型余额");
+    // }
+  });
+};
+
+const update = (row) => {
+  loadingDialog.value = false;
+  modalType.value = "edit";
+  formData.data = proxy.deepClone(row);
+  dialogVisible.value = true;
+};
+
+const clickUpdate = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "invoice_apply_flow",
+      flowName: "开票申请发起流程",
+      random: proxy.random(),
+      businessId: row.id,
+    },
+  });
+};
+
+const getDtl = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "invoice_apply_flow",
+      flowName: "开票申请流程查看",
+      random: proxy.random(),
+      businessId: row.id,
+      processType: 20,
+    },
+  });
+};
+
+const handleReturn = (row) => {
+  modalType.value = "add";
+  formData.data = {
+    id: row.id,
+    realityReturnedTime: moment().format("YYYY-HH-MM"),
+  };
+  dialogVisible.value = true;
+};
+
+useRefreshTableData(getList);
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 515 - 0
src/views/oa/application/processingBill/index.vue

@@ -0,0 +1,515 @@
+<template>
+  <div class="pageIndexClass">
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row :action-list="[
+          {
+            text: '添加',
+            action: () => openModal('add'),
+          },
+        ]" @get-list="getList">
+      </byTable>
+    </div>
+
+    <el-dialog :title="modalType == 'add' ? '添加' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="50%">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import { ElMessage, ElMessageBox } from "element-plus";
+import moment from "moment";
+
+const { proxy } = getCurrentInstance();
+const accountCurrency = ref([]);
+const typeData = ref([
+  {
+    label: "收入",
+    value: "10",
+  },
+  {
+    label: "支出",
+    value: "20",
+  },
+]);
+const userList = ref([]);
+const deptData = ref([]);
+const contractorData = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "提交人",
+        prop: "createUserName",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "提交日期",
+        prop: "applyTime",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "所属中心",
+        prop: "companyName",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "所属部门",
+        prop: "deptName",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "承包单位",
+        prop: "contractorName",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "账期",
+        prop: "accountPeriod",
+        width: 90,
+      },
+    },
+    {
+      attrs: {
+        label: "账期金额",
+        prop: "accountPeriodAmount",
+        width: 100,
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "预付金额",
+        prop: "prepaidAmount",
+        width: 100,
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "最终金额",
+        prop: "finalAmount",
+        width: 100,
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "说明",
+        prop: "remark",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              update(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              proxy
+                .msgConfirm()
+                .then((res) => {
+                  proxy
+                    .post("/epibolyBill/delete", {
+                      id: row.id,
+                    })
+                    .then((res) => {
+                      proxy.msgTip("操作成功", 1);
+                      getList();
+                    });
+                })
+                .catch((err) => {});
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const corporationList = ref([]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/epibolyBill/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+
+const getDeptData = () => {
+  proxy
+    .get("/tenantUser/listAll", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      // ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+
+  proxy
+    .post("/contractor/page", {
+      pageNum: 1,
+      pageSize: 999,
+    })
+    .then((res) => {
+      contractorData.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    });
+};
+getDeptData();
+
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 110,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title1",
+      title: "基本信息",
+    },
+    // {
+    //   type: "input",
+    //   prop: "code",
+    //   label: "流水号",
+    //   placeholder: " ",
+    //   itemWidth: 50,
+    //   disabled: true,
+    // },
+    {
+      type: "date",
+      prop: "applyTime",
+      itemType: "date",
+      label: "提交时间",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "select",
+      prop: "createUser",
+      label: "提交人",
+      required: true,
+      filterable: true,
+      data: userList.value,
+      itemWidth: 50,
+      disabled: true,
+    },
+    {
+      type: "treeSelect",
+      prop: "companyId",
+      label: "所属公司",
+      data: proxy.useUserStore().allDict["tree_all_company_data"],
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      fn: (val) => {},
+      disabled: true,
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "所属部门",
+      data: deptData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      disabled: true,
+    },
+    {
+      type: "select",
+      prop: "contractorId",
+      label: "承包单位",
+      required: true,
+      filterable: true,
+      data: contractorData.value,
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "date",
+      prop: "accountPeriod",
+      itemType: "month",
+      label: "账期",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "number",
+      prop: "accountPeriodAmount",
+      label: "账期金额",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "number",
+      prop: "prepaidAmount",
+      label: "预付金额",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "number",
+      prop: "finalAmount",
+      label: "最终金额",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "fileList",
+      label: "账单附件",
+    },
+    {
+      type: "input",
+      prop: "remark",
+      itemType: "textarea",
+      label: "说明",
+      itemWidth: 100,
+      disabled: false,
+    },
+    // {
+    //   type: "title1",
+    //   title: "流程异常备注",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "remark",
+    //   itemType: "textarea",
+    //   label: "明细备注",
+    //   itemWidth: 100,
+    //   disabled: false,
+    // },
+  ];
+});
+const rules = ref({
+  applyTime: [{ required: true, message: "请选择提交时间", trigger: "change" }],
+  createUser: [{ required: true, message: "请选择提交人", trigger: "change" }],
+  companyId: [{ required: true, message: "请选择所属公司", trigger: "change" }],
+  deptId: [{ required: true, message: "请选择所属部门", trigger: "change" }],
+  contractorId: [
+    { required: true, message: "请选择承包单位", trigger: "change" },
+  ],
+  accountPeriod: [{ required: true, message: "请选择账期", trigger: "change" }],
+  accountPeriodAmount: [
+    { required: true, message: "请输入账期金额", trigger: "blur" },
+  ],
+  fileList: [{ required: true, message: "请上传账单附件", trigger: "change" }],
+  remark: [{ required: true, message: "请输入说明", trigger: "blur" }],
+});
+const formData = reactive({
+  data: {},
+});
+const openModal = (val) => {
+  modalType.value = val;
+  formData.data = {
+    applyTime: moment().format("YYYY-MM-DD"),
+    companyId: proxy.useUserStore().user.companyId,
+    deptId: proxy.useUserStore().user.dept.deptId,
+    createUser: proxy.useUserStore().user.userId,
+    fileList: [],
+  };
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const clickBalance = () => {
+  if (
+    formData.data.accountRemainderList &&
+    formData.data.accountRemainderList.length > 0
+  ) {
+    formData.data.accountRemainderList.push({
+      currency: "",
+      remainder: undefined,
+    });
+  } else {
+    formData.data.accountRemainderList = [
+      { currency: "", remainder: undefined },
+    ];
+  }
+};
+const handleRemove = (index) => {
+  formData.data.accountRemainderList.splice(index, 1);
+};
+const isRepeat = (arr) => {
+  var hash = {};
+  for (var i in arr) {
+    if (hash[arr[i].currency]) return true;
+    hash[arr[i].currency] = true;
+  }
+  return false;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/epibolyBill/" + modalType.value, formData.data).then(
+      () => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+    // if (
+    //   formData.data.accountRemainderList &&
+    //   formData.data.accountRemainderList.length > 0
+    // ) {
+    //   if (isRepeat(formData.data.accountRemainderList)) {
+    //     return ElMessage("请勿重复添加货币余额");
+    //   } else {
+    //     loadingDialog.value = true;
+    //     proxy.post("/accountManagement/" + modalType.value, formData.data).then(
+    //       () => {
+    //         ElMessage({
+    //           message: modalType.value == "add" ? "添加成功" : "编辑成功",
+    //           type: "success",
+    //         });
+    //         dialogVisible.value = false;
+    //         getList();
+    //       },
+    //       (err) => {
+    //         console.log(err);
+    //         loadingDialog.value = false;
+    //       }
+    //     );
+    //   }
+    // } else {
+    //   return ElMessage("请添加至少一条类型余额");
+    // }
+  });
+};
+
+const update = (row) => {
+  loadingDialog.value = false;
+  modalType.value = "edit";
+  proxy.post("/epibolyBill/detail", { id: row.id }).then((res) => {
+    formData.data = res;
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        if (fileObj[row.id] && fileObj[row.id].length > 0) {
+          formData.data.fileList = fileObj[row.id]
+            .filter((x) => x.businessType == "0")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
+        } else {
+          formData.data.fileList = [];
+        }
+      });
+  });
+  dialogVisible.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 16 - 0
src/views/process/processApproval/index.vue

@@ -66,9 +66,13 @@
         </ActivityPriceInventory>
 
         <PersonalInvoice ref="makeDom" v-else-if="flowForm.flowKey == 'personal_invoice_flow'" :queryData="queryData.data"></PersonalInvoice>
+
         <InvoiceTaxDeduction ref="makeDom" v-else-if="flowForm.flowKey == 'invoice_tax_deduction_flow'" :queryData="queryData.data">
         </InvoiceTaxDeduction>
 
+        <InvoicingApplication ref="makeDom" v-else-if="flowForm.flowKey == 'invoice_apply_flow'" :queryData="queryData.data">
+        </InvoicingApplication>
+
         <!-- 取消到账认领 -->
         <!-- <CancelClaim ref="makeDom" v-else-if="flowForm.flowKey == 'claim_del_flow'" :queryData="queryData.data"></CancelClaim> -->
       </div>
@@ -233,6 +237,7 @@ import EncodingCombination from "@/components/process/SF/EncodingCombination";
 import ActivityPriceInventory from "@/components/process/SF/ActivityPriceInventory";
 import PersonalInvoice from "@/components/process/SF/PersonalInvoice";
 import InvoiceTaxDeduction from "@/components/process/SF/InvoiceTaxDeduction";
+import InvoicingApplication from "@/components/process/SF/InvoicingApplication";
 
 import PurchasePayment from "@/components/process/PurchasePayment";
 import SendFunds from "@/components/process/SendFunds";
@@ -264,6 +269,7 @@ const StagFlowKey = ref([
   "activity_price_inventory_flow",
   "personal_invoice_flow",
   "invoice_tax_deduction_flow",
+  "invoice_apply_flow",
 ]);
 // tab切换逻辑
 const activeName = ref("first");
@@ -523,6 +529,15 @@ const handleSubmitStag = async (_type) => {
                 btnLoading.value = false;
               }
             );
+          } else if (flowForm.flowKey == "invoice_apply_flow") {
+            proxy.post("/invoiceApply/add", data).then(
+              (res) => {
+                skipPage();
+              },
+              (err) => {
+                btnLoading.value = false;
+              }
+            );
           }
         }
       });
@@ -555,6 +570,7 @@ const skipPage = () => {
     activity_price_inventory_flow: "ActivityPriceInventory",
     personal_invoice_flow: "PersonalInvoice",
     invoice_tax_deduction_flow: "InvoiceTaxDeduction",
+    invoice_apply_flow: "InvoicingApplication",
   };
   const useTagsStore = useTagsViewStore();
   useTagsStore.delVisitedView(router.currentRoute.value);