snow 10 months ago
parent
commit
67c41c410a

BIN
dist-zip/build.zip


+ 10 - 3
src/components/PageContent/src/hooks/use-request.ts

@@ -32,7 +32,7 @@ export function useRequeset(props: PageContentProps) {
 
   async function onSearch() {
     const { contentConfig } = props;
-    const { apis, isTree, mockData, listNoRelation, transformCompany } = contentConfig;
+    const { apis, isTree, mockData, listNoRelation, transformCompany, transformField } = contentConfig;
     const hasCompanyFilter = !notNeedCompanyFilter;
     const vm = getCurrentInstance();
 
@@ -46,9 +46,9 @@ export function useRequeset(props: PageContentProps) {
 
 
     let transCompany = ""
-    if (transformCompany) {
+    if (transformCompany || transformField) {
       const { data } = await httpSupplierList({ name: currentCompany.value?.companyName })
-      const item = currentCompany.value?.companyName ? data.list[0] || {} : {};
+      const item = currentCompany.value?.companyName ? data.list.find(item => item.name === currentCompany.value?.companyName) || {} : {};
       transCompany = item.code;
     }
 
@@ -60,6 +60,13 @@ export function useRequeset(props: PageContentProps) {
         : {}
     });
 
+    if (transformField) {
+      params[transformField] = transCompany;
+      delete params[companyProp]
+    }
+
+
+
     const { code, data, message } = await apis.httpList({
       ...params,
       ...(listNoRelation ? { noRela: true } : {})

+ 210 - 0
src/views/InvoiceSaleSettings/consultingChildCost/config/configs.ts

@@ -0,0 +1,210 @@
+import { h } from "vue";
+import { ElImage, ElTag } from "element-plus";
+import { createTooltip } from "/@/utils/tootip";
+
+export const good_type = [
+  {
+    value: "0",
+    label: "待采购设置税务类目"
+  },
+  {
+    value: "1",
+    label: "待财务设置税务类目"
+  },
+  {
+    value: "2",
+    label: "税务类目设置完成"
+  }
+];
+
+export const stock_type = [
+  {
+    value: "0",
+    label: "非库存商品"
+  },
+  {
+    value: "1",
+    label: "库存商品"
+  }
+];
+
+//类目新增校验规则
+export const cost_rules = {
+  cat_code: [{ required: true, trigger: "change", message: "请选择类目" }],
+  inv_tag: [{ required: true, trigger: "change", message: "请选择税率标识" }],
+  is_discount: [
+    { required: true, trigger: "change", message: "请选择是否包含优惠政策" }
+  ],
+  inv_good_name: [
+    { required: true, trigger: "change", message: "请选择商品名称" }
+  ],
+  tax: [{ required: true, trigger: "change", message: "请选择税率" }],
+  addTax: [
+    { required: true, trigger: "change", message: "请选择增值税管理内容" }
+  ]
+};
+
+export const good_detail_columns = [
+  {
+    field: "spuCode",
+    span: 6,
+    label: "商品编码"
+  },
+  {
+    field: "good_name",
+    span: 18,
+    label: "商品名称"
+  },
+  {
+    field: "is_stock",
+    label: "商品类型",
+    span: 6,
+    render(stock, { isZx, is_stock }) {
+      return h(ElTag, null, {
+        default: () => Number(isZx) == 1 ? "反馈商品" : stock_type.find(({ value }) => value === String(is_stock))?.label || "--"
+      });
+    }
+  },
+  {
+    field: "good_img",
+    label: "商品图",
+    span: 18,
+    render(imgSrc) {
+      return imgSrc.split(",").map(src =>
+        h(ElImage, {
+          src,
+          previewSrcList: [src],
+          style: {
+            height: "20px",
+            marginRight: "5px"
+          }
+        })
+      );
+    }
+  },
+  {
+    field: "cgd_inv_good_name",
+    span: 24,
+    label: "采购开票商品名称"
+  },
+  {
+    field: "cgd_inv_cat_name",
+    label: "采购类目名称",
+    span: 12
+  },
+  {
+    field: "cgd_inv_cat_code",
+    label: "采购类目编码"
+  },
+  {
+    field: "cgd_inv_tax",
+    label: "采购类目税率额"
+  },
+  {
+    field: "inv_good_name",
+    span: 24,
+    label: "财务开票商品名称"
+  },
+  {
+    field: "inv_cat_name",
+    label: "财务类目名称",
+    span: 12
+  },
+  {
+    field: "inv_cat_code",
+    label: "财务类目编码"
+  },
+  {
+    field: "inv_tax",
+    label: "财务类目税率额"
+  },
+  {
+    field: "companyName",
+    label: "业务公司名称",
+    render: (companyName, { companyNo }) =>
+      createTooltip(companyName, "业务公司编码 : " + companyNo, 270),
+    span: 12
+  },
+  {
+    field: "supplierName",
+    label: "供应商名称",
+    render: (supplierName, { supplierNo }) =>
+      createTooltip(supplierName, "供应商编码 : " + supplierNo, 270),
+    span: 12
+  },
+
+  {
+    field: "cat_name",
+    span: 12,
+    label: "分类名称"
+  },
+  {
+    field: "unit_name",
+    label: "单位名称"
+  },
+  {
+    field: "status",
+    label: "状态",
+    render(status) {
+      return h(
+        ElTag,
+        {
+          type: status === "2" ? "success" : ""
+        },
+        {
+          default: () => good_type.find(s => s.value === String(status))?.label
+        }
+      );
+    }
+  },
+  {
+    field: "creater",
+    label: "创建人",
+    span: 12,
+  },
+  {
+    field: "addtime",
+    label: "申请时间",
+    span: 12,
+  },
+  {
+    field: "after_sales",
+    span: 24,
+    label: "售后说明"
+  },
+  {
+    field: "craft_desc",
+    span: 24,
+    label: "工艺说明"
+  }
+];
+
+export const inv_tag = [
+  {
+    value: "0",
+    label: "非零税率"
+  },
+  {
+    value: "1",
+    label: "免税"
+  },
+  {
+    value: "2",
+    label: "不征税"
+  },
+  {
+    value: "3",
+    label: "零税率"
+  }
+];
+
+export const add_tax = [
+  {
+    value: "免税",
+    label: "免税"
+  },
+  {
+    value: "不征税",
+    label: "不征税"
+  }
+];

+ 138 - 0
src/views/InvoiceSaleSettings/consultingChildCost/config/content.config.ts

@@ -0,0 +1,138 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList } from "/@/api/InvoiceSaleSettings/consultingCost";
+
+import { h } from "vue";
+import dayjs from "dayjs";
+import { ElImage, ElTag } from "element-plus";
+import { good_type } from "./configs";
+import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
+
+function renderGoodImage(imgSrc: string) {
+  const imgs = imgSrc.split(",");
+  return h(ElImage, {
+    src: imgs[0],
+    previewTeleported: true,
+    previewSrcList: [imgs[0]],
+    style: {
+      height: "20px",
+      width: "20px"
+    }
+  });
+}
+
+const columns = [
+  {
+    type: "selection",
+    width: 40,
+    align: "center"
+  },
+  {
+    label: "商品编码",
+    prop: "spuCode",
+    width: 150
+  },
+  {
+    label: "卖出方公司",
+    prop: "cgd_supplierName",
+    width: 175,
+    ...renderIconLabelLeft("cgd_supplierNo", "cgd_supplierName", "卖出方公司编码:")
+  },
+  {
+    label: "买入方公司",
+    prop: "supplierName",
+    width: 195,
+    ...renderIconLabelLeft("supplierNo", "supplierName", "买入方公司编码:")
+  },
+  {
+    label: "商品名称",
+    prop: "good_name",
+    minWidth: 195
+  },
+  {
+    label: "主图",
+    prop: "good_img",
+    width: 55,
+    cellRenderer: ({ row }) => renderGoodImage(row.good_img)
+  },
+  {
+    label: "采购类目编码",
+    width: 155,
+    prop: "cgd_inv_cat_code"
+  },
+  {
+    label: "采购类目名称",
+    width: 120,
+    prop: "cgd_inv_cat_name"
+  },
+  {
+    label: "采购开票商品名称",
+    prop: "cgd_inv_good_name",
+    width: 165
+  },
+  {
+    label: "财务类目编码",
+    width: 155,
+    prop: "inv_cat_code"
+  },
+  {
+    label: "财务类目名称",
+    width: 120,
+    prop: "inv_cat_name"
+  },
+  {
+    label: "财务开票商品名称",
+    prop: "inv_good_name",
+    width: 165
+  },
+  {
+    label: "状态",
+    prop: "status",
+    width: 150,
+    cellRenderer: ({ row }) => {
+      return h(
+        ElTag,
+        {
+          type: row.status === "2" ? "success" : ""
+        },
+        {
+          default: () =>
+            good_type.find(t => t.value === String(row.status))?.label
+        }
+      );
+    }
+  },
+  {
+    label: "增值税管理内容",
+    prop: "addTax",
+    width: "140px"
+  },
+  {
+    label: "创建时间",
+    prop: "createTime",
+    width: 140,
+    formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
+  },
+  {
+    label: "创建人",
+    width: 80,
+    prop: "creater"
+  },
+  {
+    label: "操作",
+    fixed: "right",
+    width: 80,
+    slot: "operation"
+  }
+];
+
+const contentConfig: ContentConfig = {
+  title: "销售成本类目设置",
+  superUserNoPerview: true,
+  columns,
+  transformField: 'supplierNo',
+  apis: {
+    httpList: (params = {}) => httpList({ ...params, isChild: 1, noRela: true })
+  }
+};
+
+export default contentConfig;

+ 40 - 0
src/views/InvoiceSaleSettings/consultingChildCost/config/modal.config.ts

@@ -0,0 +1,40 @@
+import { ModalConfig } from "../../../../components/PageModal/src/types";
+
+const modalConfig: ModalConfig = {
+  title: "客户",
+  itemStyle: {},
+  formItems: [
+    {
+      field: "companyNo",
+      type: "input",
+      label: "客户编码",
+      labelWidth: "120px"
+    },
+    {
+      field: "companyName",
+      type: "input",
+      labelWidth: "120px",
+      label: "客户名称"
+    },
+    {
+      field: "parent",
+      type: "input",
+      labelWidth: "120px",
+      label: "归属集团"
+    },
+    {
+      field: "contactor",
+      type: "input",
+      labelWidth: "120px",
+      label: "联系人"
+    },
+    {
+      field: "createTime",
+      type: "input",
+      labelWidth: "120px",
+      label: "创建时间"
+    }
+  ]
+};
+
+export default modalConfig;

+ 45 - 0
src/views/InvoiceSaleSettings/consultingChildCost/config/search.config.ts

@@ -0,0 +1,45 @@
+import { good_type } from "./configs";
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "group",
+      type_field: "group_type",
+      type: "input_group",
+      otherOptions: {
+        inputGroupOptions: [
+          { value: "spuCode", label: "商品编码" },
+          { value: "good_name", label: "商品名称" },
+          // { value: "supplierNo", label: "卖方公司编码" },
+          // { value: "supplierName", label: "卖方公司名称" },
+          { value: "creater", label: "创建人" }
+        ]
+      }
+    },
+    {
+      field: "timer",
+      type: "date_picker",
+      trigger: 'change',
+      otherOptions: {
+        type: "daterange",
+        startProp: "start",
+        endProp: "end",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期"
+      }
+    },
+    {
+      field: "supplierNo",
+      type: "supplier-query"
+    },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "状态",
+      options: good_type
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 40 - 0
src/views/InvoiceSaleSettings/consultingChildCost/detail.vue

@@ -0,0 +1,40 @@
+<script setup lang="ts">
+import { computed, onMounted, ref } from "vue";
+import BasicSettings from "../basic-settings.vue";
+import { good_detail_columns } from "./config/configs";
+import { useResponseHandle } from "/@/hooks";
+import { useRoute } from "vue-router";
+
+import {
+  type IGoodDetail,
+  httpDetail
+} from "/@/api/InvoiceSaleSettings/commodityCost";
+
+const { query } = useRoute();
+const spuCode = computed(() => query.id);
+const goodDetail = ref<IGoodDetail | null>(null);
+const responseHandle = useResponseHandle();
+
+//请求商品详情
+async function requesetGoodDetail() {
+  const { code, message, data } = await httpDetail({ spuCode: spuCode.value });
+  responseHandle({
+    code,
+    message,
+    handler: () => (goodDetail.value = data)
+  });
+}
+
+onMounted(() => requesetGoodDetail());
+</script>
+
+<template>
+  <BasicSettings
+    title="咨询成交子商品类目设置"
+    back-route="/InvoiceSaleSettings/consultingCost"
+    :detail="goodDetail"
+    :columns="good_detail_columns"
+    @refresh="requesetGoodDetail()"
+    pageName="consultingChildCostDetail"
+  />
+</template>

+ 186 - 0
src/views/InvoiceSaleSettings/consultingChildCost/index.vue

@@ -0,0 +1,186 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import { useRouter } from "vue-router";
+import { PageSearch, usePageSearch } from "/@/components/PageSearch";
+import { PageContent } from "/@/components/PageContent";
+import searchFormConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+import PagePower from "/@/components/PagePower/PagePower.vue";
+import { usePermission } from "/@/hooks/core/usePermission";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import ExeclUploadModal from "./../_component/execl-files-upload/index.vue";
+import ProcureImport from "./../_component/procure-import/index.vue";
+import { template, procureTemplate } from "./../_config/xls-template";
+import { utils, writeFile } from "xlsx";
+import { ElMessage } from "element-plus";
+import { useUserInfo } from "/@/hooks/core/useUser";
+
+import { httpRequsetExport } from "/@/utils/export";
+
+import dayjs from "dayjs"
+import { useCompany } from "/@/hooks/core/useCompany";
+
+const execlUploadModalRef = ref<InstanceType<typeof ExeclUploadModal>>(null);
+const procureUploadModalRef = ref<InstanceType<typeof ProcureImport>>(null);
+
+const { permissions, hasPermissionWithCode } = usePermission("consultingChildCost");
+const selects = ref([]);
+
+const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch(
+  undefined,
+  undefined,
+  searchFormConfig
+);
+const { push } = useRouter();
+const { isSuperUser } = useUserInfo();
+
+const { currentCompany } = useCompany()
+
+function toDetail(spuCode) {
+  push({
+    path: "/InvoiceSaleSettings/consultingCostDetail",
+    query: { id: spuCode }
+  });
+}
+
+const mapTag = {
+  "1": "免税",
+  "2": "不征税",
+  "3": "零税率"
+};
+
+const mapDiscount = {
+  "1": "是",
+  "0": "否"
+};
+
+function onDownloadTemplate(isProcure = false) {
+  if (selects.value.length === 0) {
+    ElMessage.warning("请选择至少一个商品");
+    return;
+  }
+
+  const judieTemplate = isProcure ? procureTemplate : template
+  const judieFilename = isProcure ? "批量设置采购类目模板" : "批量设置财务类目模板"
+
+  const data: any[] = [];
+  selects.value.forEach((item) => {
+    const _template = { ...judieTemplate };
+
+    if (isProcure) { // 采购
+      _template["商品编码"] = item.spuCode;
+      _template["商品名称"] = item.good_name;
+      _template["买入方公司编码"] = item.companyNo;
+      _template["买入方公司名称"] = item.companyName;
+      _template["卖出方公司编码"] = item.supplierNo;
+      _template["卖出方公司名称"] = item.supplierName;
+      _template["开票商品名称"] = item.cgd_inv_good_name;
+    } else {  // 财务
+      _template["商品编码"] = item.spuCode;
+      _template["商品名称"] = item.good_name;
+      _template["买入方公司编码"] = item.companyNo;
+      _template["买入方公司名称"] = item.companyName;
+      _template["卖出方公司编码"] = item.supplierNo;
+      _template["卖出方公司名称"] = item.supplierName;
+      _template["采购类目编码"] = item.cgd_inv_cat_code;
+      _template['采购类目名称'] = item.cgd_inv_cat_name;
+      _template["采购开票商品名称"] = item.cgd_inv_good_name;
+      _template['采购税率'] = item.cgd_inv_tax ? (((item.cgd_inv_tax.split("%"))[0]) / 100).toFixed(2) : "";
+      _template['财务类目编码'] = item.inv_cat_code;
+      _template['财务类目名称'] = item.inv_cat_name;
+      _template['财务开票商品名称'] = item.inv_good_name;
+      _template['财务税率'] = item.inv_tax ? (((item.inv_tax.split("%"))[0]) / 100).toFixed(2) : ""
+
+      _template['税率标识'] = item.inv_tag && item.inv_tag !== "0" ? mapTag[item.inv_tag] : "";
+      _template["是否有优惠政策"] = Number(item.status) >= 2 ? mapDiscount[item.is_discount] : "";
+      _template["增值税管理内容"] = item.addTax;
+    }
+
+    data.push(_template);
+  });
+
+  //创建数据表
+  const workBook = utils.book_new();
+  const workSheet = utils.json_to_sheet(data);
+  utils.book_append_sheet(workBook, workSheet, "sheet");
+
+  //导出模板
+  writeFile(workBook, `${judieFilename}.xlsx`, {
+    bookType: "xlsx"
+  });
+}
+
+const _loading = ref(false);
+async function handleExportPage() {
+  const params = pageContentRef.value.getBasicParams();
+  if (!params.start || !params.end) {
+    ElMessage.warning('请选择导出的时间区间')
+    return
+  }
+
+  const start = dayjs(params.start);
+  const end = dayjs(params.end);
+  const diffDay = start.diff(end, 'days')
+  const startDays = start.daysInMonth();
+  const endDays = end.daysInMonth();
+
+  if (Math.abs(diffDay) > (startDays + endDays)) {
+    ElMessage.warning('导出的时间区间不能超过两个月')
+    return
+  }
+
+  await httpRequsetExport({
+    url: "/admin/good/export",
+    name: "咨询成交类目",
+    onStart: () => (_loading.value = true),
+    onSuccess: () => (_loading.value = false),
+    onFail: () => (_loading.value = false),
+    params: { isZx: 1, ...params,companyNo:currentCompany.value.companyNo },
+    admin: false
+  });
+}
+</script>
+
+<template>
+  <div class="main role">
+    <PagePower :is-show="hasPermissionWithCode('001')">
+      <div w-full>
+        <PageSearch :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick" />
+
+        <PageContent ref="pageContentRef" :powers="permissions" :content-config="contentConfig"
+          @preview-btn-click="({ spuCode }) => toDetail(spuCode)" @selection-change="nodes => (selects = nodes)">
+          <template #header>
+            <ElButton size="small" v-if="hasPermissionWithCode('041')" :icon="useRenderIcon('arrow-down-line')"
+              @click="() => onDownloadTemplate(true)">下载采购设置类目模板</ElButton>
+
+            <ElButton size="small" type="primary" v-if="hasPermissionWithCode('042') && !isSuperUser"
+              :icon="useRenderIcon('arrow-up-line')" @click="() => procureUploadModalRef.onDisplay()">批量导入采购设置类目结果
+            </ElButton>
+
+            <ElButton size="small" v-if="hasPermissionWithCode('036')" :icon="useRenderIcon('arrow-down-line')"
+              @click="() => onDownloadTemplate()">下载财务设置类目模板</ElButton>
+
+            <ElButton size="small" type="primary" :icon="useRenderIcon('arrow-up-line') "
+              v-if="hasPermissionWithCode('037') && !isSuperUser" @click="() => execlUploadModalRef.onDisplay()">
+              批量导入财务设置类目结果</ElButton>
+
+            <ElButton type="primary" @click="handleExportPage" size="small" v-if="hasPermissionWithCode('048')"
+              :loading="_loading">导出
+            </ElButton>
+          </template>
+        </PageContent>
+
+        <ExeclUploadModal ref="execlUploadModalRef" @on-success="() => pageContentRef.onSearch()" />
+
+        <ProcureImport ref="procureUploadModalRef" @on-success="() => pageContentRef.onSearch()" />
+      </div>
+    </PagePower>
+  </div>
+</template>
+
+<style scoped lang="scss">
+:deep(.el-dropdown-menu__item i) {
+  margin: 0;
+}
+</style>

+ 1 - 1
src/views/InvoiceSaleSettings/consultingCost/config/content.config.ts

@@ -130,7 +130,7 @@ const contentConfig: ContentConfig = {
   superUserNoPerview: true,
   columns,
   apis: {
-    httpList
+    httpList: (params = {}) => httpList({ ...params, isChild: 0 })
   }
 };
 

+ 8 - 8
src/views/InvoiceSaleSettings/consultingCost/index.vue

@@ -70,18 +70,18 @@ function onDownloadTemplate(isProcure = false) {
     if (isProcure) { // 采购
       _template["商品编码"] = item.spuCode;
       _template["商品名称"] = item.good_name;
-      _template["买入方公司编码"] = item.companyNo;
-      _template["买入方公司名称"] = item.companyName;
-      _template["卖出方公司编码"] = item.supplierNo;
-      _template["卖出方公司名称"] = item.supplierName;
+      _template["买入方公司编码"] = item.supplierNo;
+      _template["买入方公司名称"] = item.supplierName;
+      _template["卖出方公司编码"] = item.cgd_supplierNo;
+      _template["卖出方公司名称"] = item.cgd_supplierName;
       _template["开票商品名称"] = item.cgd_inv_good_name;
     } else {  // 财务
       _template["商品编码"] = item.spuCode;
       _template["商品名称"] = item.good_name;
-      _template["买入方公司编码"] = item.companyNo;
-      _template["买入方公司名称"] = item.companyName;
-      _template["卖出方公司编码"] = item.supplierNo;
-      _template["卖出方公司名称"] = item.supplierName;
+      _template["买入方公司编码"] = item.supplierNo;
+      _template["买入方公司名称"] = item.supplierName;
+      _template["卖出方公司编码"] = item.cgd_supplierNo;
+      _template["卖出方公司名称"] = item.cgd_supplierName;
       _template["采购类目编码"] = item.cgd_inv_cat_code;
       _template['采购类目名称'] = item.cgd_inv_cat_name;
       _template["采购开票商品名称"] = item.cgd_inv_good_name;

+ 210 - 0
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/config/configs.ts

@@ -0,0 +1,210 @@
+import { h } from "vue";
+import { ElImage, ElTag } from "element-plus";
+import { createTooltip } from "/@/utils/tootip";
+
+export const good_type = [
+  {
+    value: "0",
+    label: "待采购设置税务类目"
+  },
+  {
+    value: "1",
+    label: "待财务设置税务类目"
+  },
+  {
+    value: "2",
+    label: "税务类目设置完成"
+  }
+];
+
+export const stock_type = [
+  {
+    value: "0",
+    label: "非库存"
+  },
+  {
+    value: "1",
+    label: "库存"
+  }
+];
+
+//类目新增校验规则
+export const cost_rules = {
+  cat_code: [{ required: true, trigger: "change", message: "请选择类目" }],
+  inv_tag: [{ required: true, trigger: "change", message: "请选择税率标识" }],
+  is_discount: [
+    { required: true, trigger: "change", message: "请选择是否包含优惠政策" }
+  ],
+  inv_good_name: [
+    { required: true, trigger: "change", message: "请选择商品名称" }
+  ],
+  tax: [{ required: true, trigger: "change", message: "请选择税率" }],
+  addTax: [
+    { required: true, trigger: "change", message: "请选择增值税管理内容" }
+  ]
+};
+
+export const good_detail_columns = [
+  {
+    field: "spuCode",
+    span: 6,
+    label: "商品编码"
+  },
+  {
+    field: "good_name",
+    span: 18,
+    label: "商品名称"
+  },
+  {
+    field: "is_stock",
+    label: "商品类型",
+    span: 6,
+    render(stock) {
+      return h(ElTag, null, {
+        default: () => stock_type.find(s => s.value === String(stock))?.label
+      });
+    }
+  },
+  {
+    field: "good_img",
+    label: "商品图",
+    span: 18,
+    render(imgSrc) {
+      return imgSrc.split(",").map(src =>
+        h(ElImage, {
+          src,
+          previewSrcList: [src],
+          style: {
+            height: "20px",
+            marginRight: "5px"
+          }
+        })
+      );
+    }
+  },
+  {
+    field: "cgd_inv_good_name",
+    span: 24,
+    label: "采购开票商品名称"
+  },
+  {
+    field: "cgd_inv_cat_name",
+    label: "采购类目名称",
+    span: 12
+  },
+  {
+    field: "cgd_inv_cat_code",
+    label: "采购类目编码"
+  },
+  {
+    field: "cgd_inv_tax",
+    label: "采购类目税率额"
+  },
+  {
+    field: "inv_good_name",
+    span: 24,
+    label: "财务开票商品名称"
+  },
+  {
+    field: "inv_cat_name",
+    label: "财务类目名称",
+    span: 12
+  },
+  {
+    field: "inv_cat_code",
+    label: "财务类目编码"
+  },
+  {
+    field: "inv_tax",
+    label: "财务类目税率额"
+  },
+  {
+    field: "companyName",
+    label: "业务公司名称",
+    render: (companyName, { companyNo }) =>
+      createTooltip(companyName, "业务公司编码 : " + companyNo, 270),
+    span: 12
+  },
+  {
+    field: "supplierName",
+    label: "供应商名称",
+    render: (supplierName, { supplierNo }) =>
+      createTooltip(supplierName, "供应商编码 : " + supplierNo, 270),
+    span: 12
+  },
+
+  {
+    field: "cat_name",
+    span: 12,
+    label: "分类名称"
+  },
+  {
+    field: "unit_name",
+    label: "单位名称"
+  },
+  {
+    field: "status",
+    label: "状态",
+    render(status) {
+      return h(
+        ElTag,
+        {
+          type: status === "2" ? "success" : ""
+        },
+        {
+          default: () => good_type.find(s => s.value === String(status))?.label
+        }
+      );
+    }
+  },
+  {
+    field: "creater",
+    label: "创建人",
+    span: 12,
+  },
+  {
+    field: "addtime",
+    label: "申请时间",
+    span: 12,
+  },
+  {
+    field: "after_sales",
+    span: 24,
+    label: "售后说明"
+  },
+  {
+    field: "craft_desc",
+    span: 24,
+    label: "工艺说明"
+  }
+];
+
+export const inv_tag = [
+  {
+    value: "0",
+    label: "非零税率"
+  },
+  {
+    value: "1",
+    label: "免税"
+  },
+  {
+    value: "2",
+    label: "不征税"
+  },
+  {
+    value: "3",
+    label: "零税率"
+  }
+];
+
+export const add_tax = [
+  {
+    value: "免税",
+    label: "免税"
+  },
+  {
+    value: "不征税",
+    label: "不征税"
+  }
+];

+ 129 - 0
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/config/content.config.ts

@@ -0,0 +1,129 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList } from "/@/api/InvoiceSaleSettings/consultingCost";
+
+import { h } from "vue";
+import dayjs from "dayjs";
+import { ElImage, ElTag } from "element-plus";
+import { good_type } from "./configs";
+import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
+
+function renderGoodImage(imgSrc: string) {
+  const imgs = imgSrc.split(",");
+  return h(ElImage, {
+    src: imgs[0],
+    previewTeleported: true,
+    previewSrcList: [imgs[0]],
+    style: {
+      height: "20px",
+      width: "20px"
+    }
+  });
+}
+
+const columns = [
+  {
+    type: "selection",
+    width: 40,
+    align: "center"
+  },
+  {
+    label: "商品编码",
+    prop: "spuCode",
+    width: 150
+  },
+  {
+    label: "卖出方公司",
+    prop: "cgd_supplierName",
+    width: 175,
+    ...renderIconLabelLeft("cgd_supplierNo", "cgd_supplierName", "卖出方公司编码:")
+  },
+  {
+    label: "买入方公司",
+    prop: "supplierName",
+    width: 195,
+    ...renderIconLabelLeft("supplierNo", "supplierName", "买入方公司编码:")
+  },
+  {
+    label: "商品名称",
+    prop: "good_name",
+    minWidth: 195
+  },
+  {
+    label: "主图",
+    prop: "good_img",
+    width: 55,
+    cellRenderer: ({ row }) => renderGoodImage(row.good_img)
+  },
+  {
+    label: "采购类目名称",
+    width: 120,
+    prop: "cgd_inv_cat_name"
+  },
+  {
+    label: "采购开票商品名称",
+    prop: "cgd_inv_good_name",
+    width: 165
+  },
+  {
+    label: "财务类目名称",
+    width: 120,
+    prop: "inv_cat_name"
+  },
+  {
+    label: "财务开票商品名称",
+    prop: "inv_good_name",
+    width: 165
+  },
+  {
+    label: "状态",
+    prop: "status",
+    width: 150,
+    cellRenderer: ({ row }) => {
+      return h(
+        ElTag,
+        {
+          type: row.status === "2" ? "success" : ""
+        },
+        {
+          default: () =>
+            good_type.find(t => t.value === String(row.status))?.label
+        }
+      );
+    }
+  },
+  {
+    label: "增值税管理内容",
+    prop: "addTax",
+    width: "140px"
+  },
+  {
+    label: "创建时间",
+    prop: "createTime",
+    width: 140,
+    formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
+  },
+  {
+    label: "创建人",
+    width: 80,
+    prop: "creater"
+  },
+  {
+    label: "操作",
+    fixed: "right",
+    width: 80,
+    slot: "operation"
+  }
+];
+
+const contentConfig: ContentConfig = {
+  title: "销售成本类目设置",
+  superUserNoPerview: true,
+  transformField: 'cgd_supplierNo',
+  companyProp: "supplierNo",
+  columns,
+  apis: {
+    httpList: (params = {}) => httpList({ ...params, isChild: 1, noRela: true })
+  }
+};
+
+export default contentConfig;

+ 40 - 0
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/config/modal.config.ts

@@ -0,0 +1,40 @@
+import { ModalConfig } from "../../../../components/PageModal/src/types";
+
+const modalConfig: ModalConfig = {
+  title: "客户",
+  itemStyle: {},
+  formItems: [
+    {
+      field: "companyNo",
+      type: "input",
+      label: "客户编码",
+      labelWidth: "120px"
+    },
+    {
+      field: "companyName",
+      type: "input",
+      labelWidth: "120px",
+      label: "客户名称"
+    },
+    {
+      field: "parent",
+      type: "input",
+      labelWidth: "120px",
+      label: "归属集团"
+    },
+    {
+      field: "contactor",
+      type: "input",
+      labelWidth: "120px",
+      label: "联系人"
+    },
+    {
+      field: "createTime",
+      type: "input",
+      labelWidth: "120px",
+      label: "创建时间"
+    }
+  ]
+};
+
+export default modalConfig;

+ 32 - 0
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/config/search.config.ts

@@ -0,0 +1,32 @@
+import { good_type } from "./configs";
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "group",
+      type_field: "group_type",
+      type: "input_group",
+      otherOptions: {
+        inputGroupOptions: [
+          { value: "spuCode", label: "商品编码" },
+          { value: "good_name", label: "商品名称" },
+          // { value: "companyNo", label: "买方公司编码" },
+          { value: "creater", label: "创建人" }
+        ]
+      }
+    },
+    {
+      field: "companyNo",
+      type: "business-query"
+    },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "状态",
+      options: good_type
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 40 - 0
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/detail.vue

@@ -0,0 +1,40 @@
+<script setup lang="ts">
+import { computed, onMounted, ref } from "vue";
+import BasicSettings from "../basic-settings.vue";
+import { good_detail_columns } from "./config/configs";
+import { useResponseHandle } from "/@/hooks";
+import { useRoute } from "vue-router";
+
+import {
+  type IGoodDetail,
+  httpDetail
+} from "/@/api/InvoiceSaleSettings/commodityCost";
+
+const { query } = useRoute();
+const spuCode = computed(() => query.id);
+const goodDetail = ref<IGoodDetail | null>(null);
+const responseHandle = useResponseHandle();
+
+//请求商品详情
+async function requesetGoodDetail() {
+  const { code, message, data } = await httpDetail({ spuCode: spuCode.value });
+  responseHandle({
+    code,
+    message,
+    handler: () => (goodDetail.value = data)
+  });
+}
+
+onMounted(() => requesetGoodDetail());
+</script>
+
+<template>
+  <BasicSettings
+    title="咨询成交类目设置"
+    back-route="/supplyInvoiceSaleSettings/supplyConsultingCostDetail"
+    :detail="goodDetail"
+    :columns="good_detail_columns"
+    @refresh="requesetGoodDetail()"
+    pageName="supplyConsultingCostDetail"
+  />
+</template>

+ 140 - 0
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/index.vue

@@ -0,0 +1,140 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import { useRouter } from "vue-router";
+import { PageSearch, usePageSearch } from "/@/components/PageSearch";
+import { PageContent } from "/@/components/PageContent";
+import searchFormConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+import PagePower from "/@/components/PagePower/PagePower.vue";
+import { usePermission } from "/@/hooks/core/usePermission";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import ExeclUploadModal from "./../_component/execl-files-upload/index.vue";
+import ProcureImport from "./../_component/procure-import/index.vue";
+import { template, procureTemplate } from "./../_config/xls-template";
+import { utils, writeFile } from "xlsx";
+import { ElMessage } from "element-plus";
+import { useUserInfo } from "/@/hooks/core/useUser";
+
+const execlUploadModalRef = ref<InstanceType<typeof ExeclUploadModal>>(null);
+const procureUploadModalRef = ref<InstanceType<typeof ProcureImport>>(null);
+
+const { permissions, hasPermissionWithCode } = usePermission("supplyConsultingCost");
+const selects = ref([]);
+
+const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch(
+  undefined,
+  undefined,
+  searchFormConfig
+);
+const { push } = useRouter();
+const { isSuperUser } = useUserInfo();
+
+function toDetail(spuCode) {
+  push({
+    path: "/supplyInvoiceSaleSettings/supplyConsultingCostDetail",
+    query: { id: spuCode }
+  });
+}
+
+const mapTag = {
+  "1": "免税",
+  "2": "不征税",
+  "3": "零税率"
+};
+
+const mapDiscount = {
+  "1": "是",
+  "0": "否"
+};
+
+function onDownloadTemplate(isProcure = false) {
+  if (selects.value.length === 0) {
+    ElMessage.warning("请选择至少一个商品");
+    return;
+  }
+
+  const judieTemplate = isProcure ? procureTemplate : template
+  const judieFilename = isProcure ? "批量设置采购类目模板" : "批量设置财务类目模板"
+
+  const data: any[] = [];
+  selects.value.forEach((item) => {
+    const _template = { ...judieTemplate };
+
+    if (isProcure) { // 采购
+      _template["商品编码"] = item.spuCode;
+      _template["商品名称"] = item.good_name;
+      _template["买入方公司编码"] = item.companyNo;
+      _template["买入方公司名称"] = item.companyName;
+      _template["卖出方公司编码"] = item.supplierNo;
+      _template["卖出方公司名称"] = item.supplierName;
+      _template["开票商品名称"] = item.cgd_inv_good_name;
+    } else {  // 财务
+      _template["商品编码"] = item.spuCode;
+      _template["商品名称"] = item.good_name;
+      _template["买入方公司编码"] = item.companyNo;
+      _template["买入方公司名称"] = item.companyName;
+      _template["卖出方公司编码"] = item.supplierNo;
+      _template["卖出方公司名称"] = item.supplierName;
+      _template["采购类目编码"] = item.cgd_inv_cat_code;
+      _template['采购类目名称'] = item.cgd_inv_cat_name;
+      _template["采购开票商品名称"] = item.cgd_inv_good_name;
+      _template['采购税率'] = item.cgd_inv_tax ? (((item.cgd_inv_tax.split("%"))[0]) / 100).toFixed(2) : "";
+      _template['财务类目编码'] = item.inv_cat_code;
+      _template['财务类目名称'] = item.inv_cat_name;
+      _template['财务开票商品名称'] = item.inv_good_name;
+      _template['财务税率'] = item.inv_tax ? (((item.inv_tax.split("%"))[0]) / 100).toFixed(2) : ""
+
+      _template['税率标识'] = item.inv_tag && item.inv_tag !== "0" ? mapTag[item.inv_tag] : "";
+      _template["是否有优惠政策"] = Number(item.status) >= 2 ? mapDiscount[item.is_discount] : "";
+      _template["增值税管理内容"] = item.addTax;
+    }
+
+    data.push(_template);
+  });
+
+  //创建数据表
+  const workBook = utils.book_new();
+  const workSheet = utils.json_to_sheet(data);
+  utils.book_append_sheet(workBook, workSheet, "sheet");
+
+  //导出模板
+  writeFile(workBook, `${judieFilename}.xlsx`, {
+    bookType: "xlsx"
+  });
+}
+</script>
+
+<template>
+  <div class="main role">
+    <PagePower :is-show="hasPermissionWithCode('001')">
+      <div w-full>
+        <PageSearch :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick" />
+        <PageContent ref="pageContentRef" :powers="permissions" :content-config="contentConfig"
+          @preview-btn-click="({ spuCode }) => toDetail(spuCode)" @selection-change="nodes => (selects = nodes)">
+          <template #header>
+            <ElButton size="small" v-if="hasPermissionWithCode('041')" :icon="useRenderIcon('arrow-down-line')"
+              @click="() => onDownloadTemplate(true)">下载采购设置类目模板</ElButton>
+            <ElButton size="small" type="primary" v-if="hasPermissionWithCode('042') && !isSuperUser"
+              :icon="useRenderIcon('arrow-up-line')" @click="() => procureUploadModalRef.onDisplay()">批量导入采购设置类目结果
+            </ElButton>
+            <ElButton size="small" v-if="hasPermissionWithCode('036')" :icon="useRenderIcon('arrow-down-line')"
+              @click="() => onDownloadTemplate()">下载财务设置类目模板</ElButton>
+            <ElButton size="small" type="primary" :icon="useRenderIcon('arrow-up-line')"
+              v-if="hasPermissionWithCode('037') && !isSuperUser" @click="() => execlUploadModalRef.onDisplay()">
+              批量导入财务设置类目结果</ElButton>
+          </template>
+        </PageContent>
+
+        <ExeclUploadModal ref="execlUploadModalRef" @on-success="() => pageContentRef.onSearch()" />
+        <ProcureImport ref="procureUploadModalRef" @on-success="() => pageContentRef.onSearch()" />
+      </div>
+    </PagePower>
+  </div>
+</template>
+
+<style scoped lang="scss">
+:deep(.el-dropdown-menu__item i) {
+  margin: 0;
+}
+</style>

+ 1 - 1
src/views/supplyInvoiceSaleSettings/supplyConsultingCost/config/content.config.ts

@@ -121,7 +121,7 @@ const contentConfig: ContentConfig = {
   companyProp: "supplierNo",
   columns,
   apis: {
-    httpList
+    httpList: (params = {}) => httpList({ ...params, isChild: 0 })
   }
 };
 

+ 1 - 1
src/views/system/menuOperator/components/edit-dialog.vue

@@ -40,7 +40,7 @@ const ruleForm = ref({ ...initform });
 const rules = reactive<FormRules>({
   menu_name: [
     { required: true, message: "请输入菜单名称", trigger: "blur" },
-    { min: 1, max: 10, message: "长度在 1 到 10 个字符", trigger: "blur" }
+    // { min: 1, max: 10, message: "长度在 1 到 10 个字符", trigger: "blur" }
   ],
   menu_type: [
     {