2 Commits 20c8ad4f6a ... 4f8570da66

Autor SHA1 Mensaje Fecha
  xiaodai2017 4f8570da66 Merge branch 'v3.0' of http://120.46.155.214:3000/xiaodai2022/accout-vue3-ui into v3.0 hace 1 año
  xiaodai2017 401611c17c 修改供应商端 hace 1 año

+ 8 - 7
src/views/InvoiceSaleSettings/abnormalProduct/config/configs.ts

@@ -4,29 +4,30 @@ import { createTooltip } from "/@/utils/tootip";
 
 import { verification, required } from "/@/utils/verification";
 
-
 export const diffCatOptions = [
   { value: "0", label: "无" },
   { value: "1", label: "类目一致" },
   { value: "2", label: "类目不一致" }
-]
-
+];
 
 export const diffTaxOptions = [
   { value: "0", label: "无" },
   { value: "1", label: "税率一致" },
   { value: "2", label: "税率不一致" }
-]
-
+];
 
 export const good_type = [
   {
     value: "0",
-    label: "设置"
+    label: "待采购设置"
   },
   {
     value: "1",
-    label: "已设置"
+    label: "待财务设置"
+  },
+  {
+    value: "2",
+    label: "已设置完成"
   }
 ];
 

+ 23 - 9
src/views/InvoiceSales/sheetOrderPool/config/content.config.ts

@@ -1,8 +1,7 @@
 import { ContentConfig } from "/@/components/PageContent";
 import { httpList } from "/@/api/InvoiceSales/sheetOrderPool";
 
-
-import { inv_open_status, retrun_status } from "./search.config";
+import { inv_open_status, retrun_status, cat_status } from "./search.config";
 import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
 import { ElImage, ElTag } from "element-plus";
 import { h } from "vue";
@@ -14,7 +13,6 @@ import {
   useTypeOptions
 } from "/@/utils/status";
 
-
 const columns = [
   {
     type: "selection",
@@ -34,7 +32,7 @@ const columns = [
   },
   {
     label: "平台类型",
-    width: 80,
+    width: 70,
     cellRenderer: ({ row }) =>
       h(ElTag, null, {
         default: () =>
@@ -44,19 +42,35 @@ const columns = [
   {
     label: "卖出方公司",
     prop: "companyName",
-    minWidth: 160,
-    ...renderIconLabelLeft('companyNo','companyName','卖出方公司编码:')
+    minWidth: 130,
+    ...renderIconLabelLeft("companyNo", "companyName", "卖出方公司编码:")
   },
   {
     label: "客户公司",
     prop: "customerName",
-    minWidth: 160,
-     ...renderIconLabelLeft('customerNo','customerName','客户公司编码:')
+    minWidth: 130,
+    ...renderIconLabelLeft("customerNo", "customerName", "客户公司编码:")
+  },
+
+  {
+    label: "商品名称",
+    prop: "goodName",
+    minWidth: 130,
+    ...renderIconLabelLeft("goodNo", "goodName", "商品编码:")
   },
   {
     label: "平台名称",
     prop: "platName",
-    width: 100
+    width: 90
+  },
+  {
+    label: "类目设置状态",
+    width: 100,
+    cellRenderer: ({ row }) =>
+      h(ElTag, null, {
+        default: () =>
+          cat_status.find(s => s.value === row.cat_status)?.label || "--"
+      })
   },
   {
     label: "商品类型",

+ 7 - 3
src/views/InvoiceSales/sheetOrderPool/config/search.config.ts

@@ -112,11 +112,15 @@ export const seend_type = [
 export const cat_status = [
   {
     value: "0",
-    label: "设置"
+    label: "待采购设置"
   },
   {
     value: "1",
-    label: "已设置"
+    label: "待财务设置"
+  },
+  {
+    value: "2",
+    label: "已设置完成"
   }
 ];
 
@@ -210,7 +214,7 @@ const searchFormConfig: FormConfig = {
     {
       field: "cat_status",
       type: "select",
-      placeholder: "是否设置类目",
+      placeholder: "类目设置状态",
       options: cat_status,
       span: 4
     },

+ 1 - 1
src/views/purchase/porder/index.vue

@@ -20,7 +20,7 @@ const PageName = "porder";
 const loading = shallowRef(false);
 const selectlist = ref<any[]>([]);
 const purchaseModalRef = ref<InstanceType<typeof PurchaseModal> | null>(null);
-const { permissions, hasPermissionWithCode } = usePermission("porder");
+const {  hasPermissionWithCode } = usePermission("porder");
 const hooks: PageHooks = {
   pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
 };

+ 24 - 8
src/views/supply/porder/config/content.config.ts

@@ -12,17 +12,17 @@ import {
 
 const columns = [
   {
-    type: "selection",
     width: 40,
+    type: "selection",
     align: "center",
-    hide: ({ checkList }) => !checkList.includes("勾选列")
-  },
-  {
-    label: "序号",
-    type: "index",
-    width: 70,
-    hide: ({ checkList }) => !checkList.includes("序号列")
+    fixed: "left"
   },
+  // {
+  //   label: "序号",
+  //   type: "index",
+  //   width: 70,
+  //   hide: ({ checkList }) => !checkList.includes("序号列")
+  // },
   {
     label: "采购单编码",
     prop: "sequenceNo",
@@ -38,6 +38,12 @@ const columns = [
     prop: "qrdCode",
     width: "150px"
   },
+  {
+    label: "状态",
+    prop: "status",
+    width: 95,
+    ...renderProp(cgdStatusOptions, "status")
+  },
   {
     label: "销售单发货状态",
     prop: "qrdSend",
@@ -83,11 +89,21 @@ const columns = [
     prop: "goodName",
     width: "180px"
   },
+  {
+    label: "税率",
+    prop: "tax",
+    width: "45px"
+  },
   {
     label: "商品数量",
     prop: "goodNum",
     width: "80px"
   },
+  {
+    label: "商品单价",
+    prop: "goodPrice",
+    width: "80px"
+  },
   {
     label: "商品总价",
     prop: "totalPrice",

+ 25 - 0
src/views/supply/porder/config/xls-template.ts

@@ -0,0 +1,25 @@
+export const template = {
+  采购单编码: "",
+  采购主单编码: "",
+  销售订单编码: "",
+  供应商端: "",
+  状态: "",
+  销售单发货状态: "",
+  入库状态: "",
+  订单来源: "",
+  商品来源: "",
+  支付方式: "",
+  商品编码: "",
+  商品名称: "",
+  税率: "",
+  商品数量: "",
+  商品单价: "",
+  商品总价: "",
+  卖出方公司编码: "",
+  卖出方公司名称: "",
+  备库单编码: "",
+  采购员: "",
+  买入方公司编号: "",
+  买入方公司名称: "",
+  创建时间: ""
+};

+ 97 - 4
src/views/supply/porder/index.vue

@@ -1,13 +1,26 @@
 <script setup lang="ts">
-import { ref } from "vue";
+import { ref, shallowRef } from "vue";
+import { ElMessage } from "element-plus";
 import contentConfig from "./config/content.config";
 import searchConfig from "./config/search.config";
 import PurchaseModal from "./components/purchase-modal.vue";
+import { usePermission } from "/@/hooks/core/usePermission";
+import { template } from "./config/xls-template";
 import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
-
+import { utils, writeFile } from "xlsx";
+import {
+  cgdStatusOptions,
+  cg_order_source_options,
+  cg_order_type_options,
+  hasAccountOptions,
+  sendStatusOptions,
+  send_status_list
+} from "/@/utils/status";
 const PageName = "supplyPorder";
+const loading = shallowRef(false);
+const selectlist = ref<any[]>([]);
 const purchaseModalRef = ref<InstanceType<typeof PurchaseModal> | null>(null);
-
+const { hasPermissionWithCode } = usePermission(PageName);
 const hooks: PageHooks = {
   pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
 };
@@ -17,6 +30,75 @@ const events: PageEvents = {
     preview: row => purchaseModalRef.value.onDisplay(row)
   }
 };
+async function handleExport() {
+  if (selectlist.value.length === 0) {
+    ElMessage.warning("请选择一条采购单");
+    return;
+  }
+  const judieTemplate = template;
+  const judieFilename = "采购单导出";
+
+  const data: any[] = [];
+  selectlist.value.forEach(item => {
+    const _template = { ...judieTemplate };
+
+    _template["采购单编码"] = item.sequenceNo;
+    _template["采购主单编码"] = item.cxCode;
+    _template["销售订单编码"] = item.qrdCode;
+    _template["供应商端"] = item.has_account
+      ? (hasAccountOptions.find(s => s.value == item.has_account + "") || {})
+          .label || ""
+      : "";
+    _template["状态"] = item.status
+      ? (cgdStatusOptions.find(s => s.value == item.status + "") || {}).label ||
+        ""
+      : "";
+    _template["销售单发货状态"] = item.qrdSend
+      ? (send_status_list.find(s => s.value == item.qrdSend + "") || {})
+          .label || ""
+      : "";
+    _template["入库状态"] = item.sendStatus
+      ? (sendStatusOptions.find(s => s.value == item.sendStatus + "") || {})
+          .label || ""
+      : "";
+    _template["订单来源"] = item.cgdSource
+      ? (
+          cg_order_source_options.find(s => s.value == item.cgdSource + "") ||
+          {}
+        ).label || ""
+      : "";
+    _template["商品来源"] = item.cgdType
+      ? (cg_order_type_options.find(s => s.value == item.cgdType + "") || {})
+          .label || ""
+      : "";
+
+    _template["支付方式"] = item.pay_type;
+    _template["商品编码"] = item.goodNo;
+    _template["商品名称"] = item.goodName;
+    _template["税率"] = item.tax;
+    _template["商品数量"] = item.goodNum;
+    _template["商品单价"] = item.goodPrice;
+    _template["商品总价"] = item.totalPrice;
+    _template["卖出方公司编码"] = item.supplierNo;
+    _template["卖出方公司名称"] = item.supplierName;
+    _template["备库单编码"] = item.bkCode;
+    _template["采购员"] = item.ownerName;
+    _template["买入方公司编号"] = item.companyNo;
+    _template["买入方公司名称"] = item.companyName;
+    _template["创建时间"] = item.addtime;
+
+    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>
@@ -26,7 +108,18 @@ const events: PageEvents = {
       :events="events"
       :contentConfig="contentConfig"
       :search-config="searchConfig"
-    />
+      @content-select-change="items => (selectlist = items)"
+    >
+      <template #content_header>
+        <ElButton
+          type="primary"
+          v-if="hasPermissionWithCode('048')"
+          @click="handleExport"
+          :loading="loading"
+          >导出</ElButton
+        >
+      </template>
+    </PageContainer>
     <PurchaseModal ref="purchaseModalRef" />
   </PageAuth>
 </template>