Explorar el Código

feat:开票类目设置修改

snow hace 1 año
padre
commit
6cdc2726ce

+ 19 - 9
src/views/InvoiceSaleSettings/_component/execl-files-upload/columns-config.ts

@@ -1,5 +1,10 @@
 const initheaders = [
   "商品编码",
+  "商品名称",
+  "买入方公司编码",
+  "买入方公司名称",
+  "卖出方公司编码",
+  "卖出方公司名称",
   "采购税率",
   "采购类目编码",
   "采购开票商品名称",
@@ -13,15 +18,20 @@ const initheaders = [
 
 export const mapProp = {
   value0: "spuCode",
-  value1: "cg_tax",
-  value2: "cg_cat_code",
-  value3: "cg_inv_good_name",
-  value4: "tax",
-  value5: "cat_code",
-  value6: "inv_good_name",
-  value7: "inv_tag",
-  value8: "is_discount",
-  value9: "addTax"
+  value1: "spuName",
+  value2: "buyerCompanyCode",
+  value3: "buyerCompanyName",
+  value4: "sellerCompanyCode",
+  value5: "sellerCompanyName",
+  value6: "cg_tax",
+  value7: "cg_cat_code",
+  value8: "cg_inv_good_name",
+  value9: "tax",
+  value10: "cat_code",
+  value11: "inv_good_name",
+  value12: "inv_tag",
+  value13: "is_discount",
+  value14: "addTax"
 };
 
 export const requireHeaders = [

+ 24 - 1
src/views/InvoiceSaleSettings/_component/finance-setting.vue

@@ -139,6 +139,10 @@ const handleTaxChange = () => {
   formData.inv_tag = "";
 };
 
+function handleLabel(item) {
+  return item.merge_code + " / " + item.cat_name;
+}
+
 watch(
   () => formData.addTax,
   addTax => {
@@ -159,11 +163,14 @@ watch(
     const {
       cgd_inv_good_name,
       cgd_inv_cat_code,
+      inv_cat_code,
       is_discount,
       good_name,
       cgd_inv_tax,
+      inv_tax,
       inv_tag,
-      addTax
+      addTax,
+      status
     } = props.detail;
 
     formData.inv_good_name = cgd_inv_good_name ? cgd_inv_good_name : good_name;
@@ -187,6 +194,18 @@ watch(
       const { tax } = result[0];
       taxs.value = tax;
     }
+
+    if (Number(status) === 2 && remoteSelectRef.value) {
+      const params = { cat_code: inv_cat_code }
+      const result = await remoteSelectRef.value.initalData(params);
+      if (!result || !Array.isArray(result)) return;
+      const { tax } = result[0];
+      taxs.value = tax;
+      formData.tax = inv_tax;
+      formData.is_discount = String(is_discount);
+      formData.inv_tag = String(inv_tag) !== "0" ? String(inv_tag) : "";
+      formData.addTax = addTax;
+    }
   },
   {
     immediate: true
@@ -209,6 +228,7 @@ watch(
           is-root
           :api="httpCatlist"
           v-model="formData.cat_code"
+          :getLabel="handleLabel"
           placeholder="请选择商品类目"
           response-label-prop="cat_name"
           response-val-prop="merge_code"
@@ -218,6 +238,9 @@ watch(
           @inital="code => (formData.cat_code = code)"
         />
       </el-form-item>
+    </div>
+
+    <div>
       <el-form-item label="开票商品名称" prop="inv_good_name" flex-1>
         <el-input
           w-full

+ 14 - 4
src/views/InvoiceSaleSettings/_component/procure-import/columns-config.ts

@@ -1,5 +1,10 @@
 const initheaders = [
   "商品编码",
+  "商品名称",
+  "买入方公司编码",
+  "买入方公司名称",
+  "卖出方公司编码",
+  "卖出方公司名称",
   "税率",
   "类目编码",
   "开票商品名称",
@@ -7,9 +12,14 @@ const initheaders = [
 
 export const mapProp = {
   value0: "spuCode",
-  value1: "tax",
-  value2: "cat_code",
-  value3: "inv_good_name",
+  value1: "spuName",
+  value2: "companyNo",
+  value3: "companyName",
+  value4: "suppplierNo",
+  value5: "supplierName",
+  value6: "tax",
+  value7: "cat_code",
+  value8: "inv_good_name",
 };
 
 export const requireHeaders = [
@@ -31,7 +41,7 @@ const columns = () => {
     list.push({
       prop: "value" + sii,
       label: si,
-      minWidth: sii === 0 || sii === 1 ? "120px" : "90px"
+      minWidth: sii === 0 || sii === 1 ? "120px" : "120px"
     });
   });
 

+ 9 - 1
src/views/InvoiceSaleSettings/_component/procure-setting.vue

@@ -81,10 +81,14 @@ function handleSelectCategory(category) {
   formData.tax = "";
 }
 
+function handleLabel(item) {
+  return item.merge_code + " / " + item.cat_name;
+}
+
+
 watch(
   () => props.detail,
   async () => {
-    console.log(props.detail);
     if (!props.detail) return;
     const { inv_good_name, inv_cat_code, good_name, inv_tax } = props.detail;
 
@@ -122,6 +126,7 @@ watch(
           ref="remoteSelectRef"
           w-full
           is-root
+          :getLabel="handleLabel"
           :api="httpCatlist"
           v-model="formData.cat_code"
           placeholder="请选择商品类目"
@@ -133,6 +138,9 @@ watch(
           @inital="code => (formData.cat_code = code)"
         />
       </el-form-item>
+    </div>
+
+    <div>
       <el-form-item label="开票商品名称" prop="inv_good_name" flex-1>
         <el-input
           w-full

+ 10 - 0
src/views/InvoiceSaleSettings/_config/xls-template.ts

@@ -1,5 +1,10 @@
 export const template = {
   商品编码: "",
+  商品名称: "",
+  买入方公司编码: "",
+  买入方公司名称: "",
+  卖出方公司编码: "",
+  卖出方公司名称: "",
   采购税率: "",
   采购类目编码: "",
   采购开票商品名称: "",
@@ -14,6 +19,11 @@ export const template = {
 
 export const procureTemplate = {
   商品编码: "",
+  商品名称: "",
+  买入方公司编码: "",
+  买入方公司名称: "",
+  卖出方公司编码: "",
+  卖出方公司名称: "",
   税率: "",
   类目编码: "",
   开票商品名称: "",

+ 2 - 2
src/views/InvoiceSaleSettings/basic-settings.vue

@@ -37,7 +37,7 @@ const actives = ref(["1", "2"]);
     <div v-else v-loading="true" h-100px>详情加载中...</div>
     <ElCollapse v-model="actives">
       <ElCollapseItem
-        v-if="detail && detail.status === '0' && hasPermissionWithCode('043')"
+        v-if="detail && Number(detail.status) < 2 && hasPermissionWithCode('043')"
         title="待采购设置类目"
         name="1"
       >
@@ -52,7 +52,7 @@ const actives = ref(["1", "2"]);
       </ElCollapseItem>
 
       <ElCollapseItem
-        v-if="detail && detail.status === '1' && hasPermissionWithCode('044')"
+        v-if="detail && Number(detail.status) >= 1 && hasPermissionWithCode('044')"
         title="待财务设置类目"
         name="2"
       >

+ 10 - 0
src/views/InvoiceSaleSettings/commodityCost/config/content.config.ts

@@ -55,6 +55,11 @@ const columns = [
     width: 55,
     cellRenderer: ({ row }) => renderGoodImage(row.good_img)
   },
+  {
+    label: "采购类目编码",
+    width: 155,
+    prop: "cgd_inv_cat_code"
+  },
   {
     label: "采购类目名称",
     width: 120,
@@ -65,6 +70,11 @@ const columns = [
     prop: "cgd_inv_good_name",
     width: 165
   },
+  {
+    label: "财务类目编码",
+    width: 155,
+    prop: "inv_cat_code"
+  },
   {
     label: "财务类目名称",
     width: 120,

+ 25 - 1
src/views/InvoiceSaleSettings/commodityCost/index.vue

@@ -39,6 +39,17 @@ function toDetail(spuCode) {
   });
 }
 
+const mapTag = {
+  "1": "免税",
+  "2": "不征税",
+  "3": "零税率"
+};
+
+const mapDiscount = {
+  "1": "是",
+  "0": "否"
+};
+        
 function onDownloadTemplate(isProcure = false) {
   if (selects.value.length === 0) {
     ElMessage.warning("请选择至少一个商品");
@@ -54,16 +65,29 @@ 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.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_good_name;
       _template['采购税率'] = item.cgd_inv_tax ? (((item.cgd_inv_tax.split("%"))[0]) / 100).toFixed(2) : "";
-
       _template['财务类目编码'] = item.inv_cat_code;
       _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);

+ 10 - 0
src/views/InvoiceSaleSettings/consultingCost/config/content.config.ts

@@ -54,6 +54,11 @@ const columns = [
     width: 55,
     cellRenderer: ({ row }) => renderGoodImage(row.good_img)
   },
+  {
+    label: "采购类目编码",
+    width: 155,
+    prop: "cgd_inv_cat_code"
+  },
   {
     label: "采购类目名称",
     width: 120,
@@ -64,6 +69,11 @@ const columns = [
     prop: "cgd_inv_good_name",
     width: 165
   },
+  {
+    label: "财务类目编码",
+    width: 155,
+    prop: "inv_cat_code"
+  },
   {
     label: "财务类目名称",
     width: 120,

+ 26 - 17
src/views/InvoiceSaleSettings/consultingCost/index.vue

@@ -36,27 +36,23 @@ function toDetail(spuCode) {
   });
 }
 
+const mapTag = {
+  "1": "免税",
+  "2": "不征税",
+  "3": "零税率"
+};
+
+const mapDiscount = {
+  "1": "是",
+  "0": "否"
+};
+
 function onDownloadTemplate(isProcure = false) {
   if (selects.value.length === 0) {
     ElMessage.warning("请选择至少一个商品");
     return;
   }
 
-  // // 状态是否全部为待采购设置
-  // const isAllProduct = selects.value.every(({ status }) => status === "0");
-  // // 状态是否全部为待财务设置
-  // const isAllFinance = selects.value.every(({ status }) => status === "1");
-  // // 采购导出且选中商品中包含不是待采购设置的
-  // if (isProcure && !isAllProduct) {
-  //   ElMessage.warning("请选择状态为 待采购设置税务类目 的商品");
-  //   return
-  // }
-  // 财务导出且选中商品中包含不是待财务设置的
-  // if (!isProcure && !isAllFinance) { 
-  //   ElMessage.warning("请选择状态为 待财务设置税务类目 的商品");
-  //   return
-  // }
-
   const judieTemplate = isProcure ? procureTemplate : template
   const judieFilename = isProcure ? "采购批量设置类目模板" : "财务批量设置类目模板"
 
@@ -66,18 +62,31 @@ 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.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_good_name;
       _template['采购税率'] = item.cgd_inv_tax ? (((item.cgd_inv_tax.split("%"))[0]) / 100).toFixed(2) : "";
-
       _template['财务类目编码'] = item.inv_cat_code;
       _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);
   });