Browse Source

报表edit

lucky 2 years ago
parent
commit
f08ab6903b

+ 2 - 0
src/apis/service/reportQuery/purchaseReport/index.js

@@ -63,6 +63,8 @@ export default {
 
 
    
+   //退货台账-业务口径导出
+   reportreturnexport: (data, params) => http(api + "reportreturnexport", data, "post", params),
 };
 
 

+ 167 - 52
src/views/reportQuery/purchaseReport/components/columns.js

@@ -842,8 +842,29 @@ const table14 = [
 
 ]
 
-
-
+//产品修改报表
+const table15 = [
+  // {
+  //   type: "expand",
+  //   _slot_: "expand",
+  //   fixed: "left",
+  //   _noset_: true,
+  // },
+  {
+    type: "selection",
+    fixed: "left",
+    _noset_: true
+  },
+  
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    _noset_: true,
+    width: "80px",
+    _slot_: "operation",
+  },
+]
 
 
 //产品修改报表,修改具体内容
@@ -881,14 +902,19 @@ const editTable13 = [
     label: "商品名称",
     minWidth: "200px",
   },
+  {
+    prop: "brandid",
+    label: "商品品牌",
+    minWidth: "200px",
+  },
   {
     prop: "brand_id",
-    label: "品牌id",
+    label: "商品品牌",
     minWidth: "200px",
   },
   {
     prop: "cat_id",
-    label: "分类id",
+    label: "商品分类",
     minWidth: "200px",
   },
   {
@@ -896,11 +922,7 @@ const editTable13 = [
     label: "规格集合",
     minWidth: "200px",
   },
-  {
-    prop: "unit_id",
-    label: "单位",
-    minWidth: "200px",
-  },
+
   {
     prop: "cost_desc",
     label: "工艺描述",
@@ -918,7 +940,7 @@ const editTable13 = [
   },
   {
     prop: "good_img",
-    label: "商品详情主图",
+    label: "商品主图",
     minWidth: "200px",
   },
   {
@@ -933,7 +955,7 @@ const editTable13 = [
   },
   {
     prop: "supplierNo",
-    label: "供应商编号",
+    label: "供应商",
     minWidth: "200px",
   },
   {
@@ -941,11 +963,7 @@ const editTable13 = [
     label: "支付方式",
     minWidth: "200px",
   },
-  {
-    prop: "tax",
-    label: "税率",
-    minWidth: "200px",
-  },
+
   {
     prop: "send_way",
     label: "发货方式",
@@ -958,22 +976,22 @@ const editTable13 = [
   },
   {
     prop: "is_gold_price",
-    label: "是否使用金价",
+    label: "是否启用实时金价",
     minWidth: "200px",
   },
   {
     prop: "config",
-    label: "基础配置",
+    label: "配置要求",
     minWidth: "200px",
   },
   {
     prop: "weight",
-    label: "克重",
+    label: "商品总重量",
     minWidth: "200px",
   },
   {
     prop: "is_diff",
-    label: "是否有公差",
+    label: "有无工差",
     minWidth: "200px",
   },
 
@@ -1052,21 +1070,7 @@ const editTable13 = [
     label: "状态",
     minWidth: "200px",
   },
-  {
-    prop: "是否删除",
-    label: "is_del",
-    minWidth: "200px",
-  },
-  {
-    prop: "创建时间",
-    label: "addtime",
-    minWidth: "200px",
-  },
-  {
-    prop: "更新时间",
-    label: "updatetime",
-    minWidth: "200px",
-  },
+  
   {
     prop: "unit",
     label: "单位",
@@ -1099,11 +1103,6 @@ const editTable13 = [
     minWidth: "200px",
   },
 
-
-
-
-
-
   {
     prop: "good_code",
     label: "商品code",
@@ -1115,11 +1114,9 @@ const editTable13 = [
     minWidth: "200px",
   },
 
-
-
   {
     prop: "good_type",
-    label: "商品类型",
+    label: "是否定制",
     minWidth: "200px",
   },
   {
@@ -1127,9 +1124,14 @@ const editTable13 = [
     label: "业务企业",
     minWidth: "200px",
   },
+  {
+      prop: "company_id",
+      label: "业务公司",
+      minWidth: "200px",
+    },
   {
     prop: "moq",
-    label: "起订量",
+    label: "定制起订量",
     minWidth: "200px",
   },
   {
@@ -1145,7 +1147,7 @@ const editTable13 = [
 
   {
     prop: "is_auth",
-    label: "是否有销售权限",
+    label: "销售权限",
     minWidth: "200px",
   },
   {
@@ -1235,15 +1237,126 @@ const editTable13 = [
   },
   {
     prop: "good_info_img",
-    label: "商品详情图",
+    label: "详情介绍",
     minWidth: "200px",
   },
 
-  // {
-  //   prop: "测试",
-  //   label: "测试",
-  //   minWidth: "200px",
-  // },
+  {
+    prop: "is_del",
+    label: "是否删除",
+    minWidth: "200px",
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    minWidth: "200px",
+  },
+  {
+    prop: "updatetime",
+    label: "更新时间",
+    minWidth: "200px",
+  },
+  //////////////////////////////
+  {
+    prop: "is_exclusive",
+    label: "专属类型",
+    minWidth: "200px",
+  },
+  {
+      prop: "noble_weight",
+      label: "贵金属重量",
+      minWidth: "200px",
+    },
+    {
+      prop: "noble_metal",
+      label: "贵金属种类",
+      minWidth: "200px",
+    },
+    {
+      prop: "other_config",
+      label: "其他配置要求",
+      minWidth: "200px",
+    },
+    {
+      prop: "spec_value",
+      label: "规格类型",
+      minWidth: "200px",
+    },
+    {
+      prop: "spec_value_value",
+      label: "规格值",
+      minWidth: "200px",
+    },
+    {
+      prop: "market_price",
+      label: "市场价",
+      minWidth: "200px",
+    },
+    {
+      prop: "cgd_gold_price",
+      label: "供应商采购金价",
+      minWidth: "200px",
+    },
+    {
+      prop: "noble_price",
+      label: "当前金价",
+      minWidth: "200px",
+    },
+    {
+      prop: "min_num",
+      label: "起订量(>=)",
+      minWidth: "200px",
+    },
+    {
+      prop: "package_fee",
+      label: "包装费",
+      minWidth: "200px",
+    },
+    {
+      prop: "other_fee",
+      label: "其他费用",
+      minWidth: "200px",
+    },
+    {
+      prop: "nake_total",
+      label: "成本合计",
+      minWidth: "200px",
+    },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
+  //   {
+  //     prop: "测试",
+  //     label: "测试",
+  //     minWidth: "200px",
+  //   },
 
  
 
@@ -1254,4 +1367,6 @@ const editTable13 = [
 
 
 ]
-export { table1, table2, table3, table4, table5,table6,table7,table8,table9,table10,table11,table12,table13,editTable13,table14}
+
+
+export { table1, table2, table3, table4, table5,table6,table7,table8,table9,table10,table11,table12,table13,editTable13,table14,table15}

+ 55 - 2
src/views/reportQuery/purchaseReport/components/table13.vue

@@ -154,7 +154,28 @@
                 style="width: 30px; height: 30px"
               />
             </div>
-
+            <div v-else-if="scope.row.key === 'good_info_img'">
+              <img
+                v-for="(si, sii) in scope.row.after"
+                :key="si + sii"
+                :src="si"
+                alt=""
+                v-viewer
+                 class="fl"
+                style="width: 30px; height: 30px"
+              />
+            </div>
+            <div v-else-if="scope.row.key === 'good_thumb_img'">
+              <img
+                v-for="(si, sii) in scope.row.after"
+                :key="si + sii"
+                :src="si"
+                alt=""
+                v-viewer
+                 class="fl"
+                style="width: 30px; height: 30px"
+              />
+            </div>
             <div v-else>{{ scope.row.before }}</div>
           </template>
         </el-table-column>
@@ -171,6 +192,28 @@
                 style="width: 30px; height: 30px"
               />
             </div>
+            <div v-else-if="scope.row.key === 'good_info_img'">
+              <img
+                v-for="(si, sii) in scope.row.after"
+                :key="si + sii"
+                :src="si"
+                alt=""
+                v-viewer
+                 class="fl"
+                style="width: 30px; height: 30px"
+              />
+            </div>
+            <div v-else-if="scope.row.key === 'good_thumb_img'">
+              <img
+                v-for="(si, sii) in scope.row.after"
+                :key="si + sii"
+                :src="si"
+                alt=""
+                v-viewer
+                 class="fl"
+                style="width: 30px; height: 30px"
+              />
+            </div>
             <div v-else>{{ scope.row.after }}</div>
           </template>
         </el-table-column>
@@ -251,6 +294,7 @@ export default {
       }
 
       for (let i = 0; i < keyList.length; i++) {
+        
         let model = {
           key: keyList[i],
           key_name:
@@ -259,15 +303,24 @@ export default {
           before: this.get_key_value(keyList[i], before_info),
           after: this.get_key_value(keyList[i], after_info),
         };
+        // console.log(model.key_name)
         this.showData.push(model);
       }
-      console.log(this.showData);
       this.dialogTableVisible = true;
     },
     get_key_value(key, info) {
       if (key === "good_img") {
         return info[key] ? (info[key] || "").split(",") : [];
       }
+      else if(key === "good_info_img") {
+        return info[key] ? (info[key] || "").split(",") : [];
+      }
+      else if(key === "good_thumb_img") {
+        return info[key] ? (info[key] || "").split(",") : [];
+      }
+      // else if(key === "cat_id") {
+      //   return info[key] ? (info[key] || "").split(",") : [];
+      // }
       return info[key];
     },
     //初始化http请求

+ 1 - 1
src/views/reportQuery/purchaseReport/components/table14.vue

@@ -183,7 +183,7 @@ export default {
     };
   },
   mounted() {
-
+    alert("暂无数据,未修改")
     this.searchList();
   },
 

+ 332 - 0
src/views/reportQuery/purchaseReport/components/table15.vue

@@ -0,0 +1,332 @@
+<template>
+    <div>
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="table15"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+        @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+        @selection="selection_change"
+      >
+        <template #table-header="{}">
+          <div style="width: 100%">
+            <el-row style="padding: 0 0 0 80px">
+             
+               <el-col :span="6" style="width: 383px;">
+                <periodDatePickerActive
+                      :start="parmValue.start_date"
+                      :end="parmValue.end_date"
+                      :placeholder="'出入库'"
+                      :width="'175px'"
+                      :size="searchSize"
+                      @timeReturned="time"
+                    />
+              </el-col>  
+              <el-col :span="6" style="width: 150px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.select"
+                  filterable
+                  clearable
+                  placeholder="出入库类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option label="假的" value="1"></el-option>
+                    <el-option label="假的" value="2"></el-option>
+                    <el-option label="假的" value="3"></el-option>
+                    <el-option label="假的" value="4"></el-option>
+                    <el-option label="假的" value="5"></el-option>
+                    <el-option label="假的" value="6"></el-option>
+                    <el-option label="假的" value="7"></el-option>
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 66px; float: right">       
+                <el-button type="primary" style="margin-left:30px;" @click="download" :size="searchSize"  class="fr">
+                    导出
+                </el-button>
+              </el-col>
+              <el-col :span="3" style="width: 66px; float: right">
+                <el-button
+                  :size="searchSize"
+                  type="primary"
+                  style="float: right; margin-left: 5px"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+              
+            </el-row>
+            <el-row style="padding: 10px 0 0 0" gutter="10">
+              <el-col :span="6" style="width: 240px">
+                <el-input
+                  clearable
+                  placeholder="产品名称"
+                  v-model="parmValue.xiugai1"
+                  maxlength="40"
+                  :size="searchSize"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="6" style="width: 240px">
+                <el-input
+                  clearable
+                  placeholder="产品编码"
+                  v-model="parmValue.xiugai2"
+                  maxlength="40"
+                  :size="searchSize"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="4" style="width: 66px; float: right">
+                <el-button
+                  type="warning"
+                  class="fr"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>     
+            </el-row>
+          </div>
+       </template>
+        <template #operation="{ scope }">
+            <el-tooltip effect="dark" content="修改" placement="top">
+                <i class="el-icon-edit tb-icon"></i>
+            </el-tooltip>
+
+            <el-tooltip effect="dark" content="下载" placement="top">
+                <i class="el-icon-download tb-icon"></i>
+            </el-tooltip>
+        </template>
+        
+      </ex-table>
+    </div>
+
+  
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import urlConfig from "@/apis/url-config";
+import asyncRequest from "@/apis/service/reportQuery/purchaseReport";
+import periodDatePickerActive from "../period-date-picker/main.vue";
+import { table15} from "./columns";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "purchaseOrder",
+  mixins: [mixinPage, resToken],
+  components: {
+    periodDatePickerActive
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    
+  },
+  data() {
+    return {
+      //选中数组
+      changeList: [],
+      //全局url
+      fileUrl: urlConfig.baseURL,
+      //loading
+      loading: false,
+      //请求参数集合
+      parmValue: {
+          select:"",
+        xiugai1:"", //咨询订单号
+        xiugai2:"",
+        start_date: "", //起始时间
+        end_date: "", // 结束时间
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+       
+      },
+      // 表格 - 数据集合
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格表头 - 列参数
+      table15: table15,
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    //初始化http请求
+    async searchList() {
+      if (
+        (this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
+        (this.parmValue.start_date === "" && this.parmValue.end_date !== "")
+      ) {
+        this.$message.warning("时间区间不完整!");
+        return;
+      }
+      return;
+      this.loading = true;
+      
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+   
+    //重置
+    restSearch() {
+      this.parmValue = {
+        start_date: "", //新建起始时间
+        end_date: "", // 新建结束时间
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.searchList();
+    },
+    
+    // 时间函数
+    async time(e) {
+      this.parmValue.start_date = e.startTime || "";
+      this.parmValue.end_date = e.endTime || "";
+      await this.searchList();
+    },
+
+     //选中触发函数
+    selection_change(e) {
+      const { list } = e;
+      //选中的数组集合
+      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
+    },
+     //导出文件 
+    async download() {
+      // if(this.changeList.length<=0){
+      //   this.$message.warning("请选择有效数据")
+      //   return;
+      // }
+      let start_date = new Date(this.parmValue.start_date).valueOf();
+      let end_date = new Date(this.parmValue.end_date).valueOf();
+      let flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000;
+      if(this.parmValue.start_date != "" && this.parmValue.end_date != ""){
+        if(flag){
+          this.$message.warning("导出文件的时间区间不能超过30天")
+          return;
+        }
+      }else{
+        this.$message.warning("请选择导出文件的时间区间")
+        return;
+      }
+      let model = JSON.parse(JSON.stringify(this.parmValue))
+      // model.is_export = 1;
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `aplication/zip`;
+        axios({
+          method: "post",
+          url: this.fileUrl + "admin/reportreturnexport",
+          responseType: "blob",
+          data: model,
+          headers: {
+            // 'Content-Type': 'multipart/form-data',
+            // Accept: "application/vnd.ms-excel"
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            // console.log(res)
+            // console.log(this.fileUrl)
+            // return;
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], {
+                  // type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
+                  type: httpType
+                })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "退货台账-业务口径.zip";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              this.$message.success(`导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            console.log(error);
+            this.loading = false;
+          });
+      }
+    },
+  },
+};
+</script>
+   <style lang="scss" scoped>
+.purchaseOrder {
+  // text-align: right;
+}
+</style>
+   

+ 3 - 0
src/views/reportQuery/purchaseReport/index.vue

@@ -20,6 +20,7 @@
             <el-tab-pane label="产品下线报表" name="table12"><table12 v-if="activeName == 'table12'"></table12></el-tab-pane>
             <el-tab-pane label="产品修改报表" name="table13"><table13 v-if="activeName == 'table13'"></table13></el-tab-pane>
             <el-tab-pane label="出入库明细报表" name="table14"><table14 v-if="activeName == 'table14'"></table14></el-tab-pane>
+            <el-tab-pane label="退货台账-业务口径" name="table15"><table15 v-if="activeName == 'table15'"></table15></el-tab-pane>
 
           
         </el-tabs>
@@ -50,6 +51,7 @@ const table11 = ()=>import(/* webpackChunkName:'mycomp' */ "./components/table11
 const table12 = ()=>import(/* webpackChunkName:'mycomp' */ "./components/table12")
 const table13 = ()=>import(/* webpackChunkName:'mycomp' */ "./components/table13")
 const table14 = ()=>import(/* webpackChunkName:'mycomp' */ "./components/table14")
+const table15 = ()=>import(/* webpackChunkName:'mycomp' */ "./components/table15")
 export default {
 mixins: [mixinPage, resToken],
 components:{
@@ -67,6 +69,7 @@ components:{
     table12,
     table13,
     table14,
+    table15,
 },
 
   computed: {