snow 1 anno fa
parent
commit
5a26c8c08e

BIN
.DS_Store


File diff suppressed because it is too large
+ 0 - 0
.gitignore


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.e6c2e236.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.b553c56e.js


BIN
dist/static/js/app.b553c56e.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.dd1ec87e.js


BIN
dist/static/js/app.dd1ec87e.js.gz


+ 18 - 0
package-lock.json

@@ -0,0 +1,18 @@
+// 物业管理员
+import http from "@/api/axios";
+import { newReportApi } from "@/config";
+const api = "report/Stats/";
+
+export default {
+  //业绩统计
+  zxOrder: (data, params) => http(newReportApi + api + "zxorder", data, "post", params),
+  saleOrder: (data, params) => http(newReportApi + api + "saleOrder", data, "post", params),
+  bkOrder: (data, params) => http(newReportApi + api + "bkOrder", data, "post", params),
+  cgdOrder: (data, params) => http(newReportApi + api + "cgdOrder", data, "post", params),
+  bidsOrder: (data, params) => http(newReportApi + api + "bidsOrder", data, "post", params),
+  bidsFail: (data, params) => http(newReportApi + api + "bidsFail", data, "post", params),
+  salestock: (data, params) => http(newReportApi + "admin/salestock", data, "post", params),
+  outChildOrder: (data, params) => http(newReportApi + api + "outChildOrder", data, "post", params),
+  outOrder: (data, params) => http(newReportApi + api + "outOrder", data, "post", params),
+  wsendOrder: (data, params) => http(newReportApi + api + "wsendOrder", data, "post", params),
+};

+ 0 - 0
src/api/report.js


+ 99 - 0
src/components/newReport/src/PurchaseBack.vue

@@ -0,0 +1,99 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="[...tableData, {
+      creater:'合计',
+      name:'--',
+      num: total,
+      participation:'--'
+    }]" size="mini" border>
+      <el-table-column label="采购员" prop="creater" />
+      <el-table-column label="采购部门" prop="name" />
+      <el-table-column label="反馈单数" prop="num" />
+      <el-table-column label="竞价参与度" prop="participation">
+        <template slot-scope="scope">
+          {{getParticipation(scope.row.num, total)}}
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+import { addition, division, multiplication } from "./_utils";
+
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  computed:{
+    total(){
+      if(!this.tableData || this.tableData.length === 0) return 0
+      const total =  this.tableData.reduce((prev,curr) => (
+        addition(prev, curr.num || 0)
+      ),0)
+
+      this.$emit("getZXTotal", total)
+      return total
+    }
+  },
+  data() {
+    return {
+      loading:false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    getParticipation(num, total){
+      if(Number(num) === 0 && total === 0) {
+        return "0%"
+      }
+
+      return multiplication(division(num, total), 100).toFixed(2) + "%"
+    },
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.bidsOrder({
+        start:this.date[0] || "",
+        end:this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        this.tableData = res.data.reduce((prev,curr = { name:"", result: {}}) => {
+          return [
+            ...prev,
+            ...Object.keys(curr.result).map(key => {
+              return {  name:curr.name,  ...curr.result[key] }
+            })]
+        },[])
+      } else {
+        this.tableData = [];
+      }
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 63 - 0
src/components/newReport/src/Stock.vue

@@ -0,0 +1,63 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border>
+      <el-table-column label="备库部门" prop="name" />
+      <el-table-column label="备库单数" prop="num" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      loading: false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.bkOrder({
+        start: this.date[0] || "",
+        end: this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        this.tableData = res.data
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 95 - 0
src/components/newReport/src/_utils.js

@@ -0,0 +1,95 @@
+export const mapReponseType = {
+  '1':'自营',
+  '2':'渠道',
+  '3':'供应商端'
+}
+
+export const mapResponseCompanyName = {
+  '泓源':'泓源广诚',
+  '普润':'普润心堂',
+  '百辰':'百辰荣达',
+  '平台':'平台部'
+}
+
+export const mapResponseCompletionCompanyName = {
+  '泓源':'泓源广诚',
+  '普润':'普润心堂&锦兴弘昌',
+  '百辰':'百辰荣达',
+  '平台':'平台部'
+}
+
+export const getTypeLabel = value => mapReponseType[String(value)]
+export const getCompanyCompletionLabel = value => mapResponseCompletionCompanyName[String(value)]
+export const getCompanyLabel = value => mapResponseCompanyName[String(value)]
+
+/* 加法 **/ 
+export function addition(arg1, arg2) {
+  var r1, r2, m;
+  try {
+    r1 = arg1.toString().split(".")[1].length;
+  } catch (e) {
+    r1 = 0;
+  }
+  try {
+    r2 = arg2.toString().split(".")[1].length;
+  } catch (e) {
+    r2 = 0;
+  }
+  m = Math.pow(10, Math.max(r1, r2));
+  return (arg1 * m + arg2 * m) / m;
+}
+
+/* 除法 **/
+export function division(arg1, arg2) {
+  var t1 = 0,
+  t2 = 0,
+  r1,
+  r2;
+  try {
+    t1 = arg1.toString().split('.')[1].length;
+  } catch (e) {}
+  try {
+    t2 = arg2.toString().split('.')[1].length;
+  } catch (e) {}
+  r1 = Number(arg1.toString().replace('.', ''));
+  r2 = Number(arg2.toString().replace('.', ''));
+  return multiplication(r1 / r2, Math.pow(10, t2 - t1));
+}
+
+/* 乘法 **/
+export function multiplication(arg1,arg2){
+  var m = 0,
+    s1 = arg1.toString(),
+    s2 = arg2.toString();
+  try {
+    m += s1.split('.')[1].length;
+  } catch (e) {}
+  try {
+    m += s2.split('.')[1].length;
+  } catch (e) {}
+  return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / Math.pow(10, m);
+}
+
+/* 减法 **/
+export function subtraction(arg1, arg2) {
+  var r1, r2, m, n;
+  try {
+    r1 = arg1.toString().split(".")[1].length;
+  } catch (e) {
+    r1 = 0;
+  }
+  try {
+    r2 = arg2.toString().split(".")[1].length;
+  } catch (e) {
+    r2 = 0;
+  }
+  m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
+  n = r1 >= r2 ? r1 : r2;
+  return ((arg1 * m - arg2 * m) / m).toFixed(n);
+}
+
+export function unit2TenThousand(value){
+  if(value === NaN || value === "NaN" || Number(value) === 0) return '0'
+  if(value < 1000 && value > 0 || value < 0 && value > -1000) return value
+  return division(value, 10000).toFixed(2) + 'W'
+}

+ 56 - 0
src/components/newReport/src/consult.vue

@@ -0,0 +1,56 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border>
+      <el-table-column label="部门" prop="name" />
+      <el-table-column label="数量" prop="num" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+     tableData:[],
+     loading: false
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+      const res = await asyncRequest.zxOrder({ start:this.date[0] || "", end:this.date[1] || "" });
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        this.tableData = res.data
+      } else {
+        this.tableData = [];
+      }
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 79 - 0
src/components/newReport/src/emptyReturn.vue

@@ -0,0 +1,79 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border>
+      <el-table-column label="空返订单状态">
+        <template slot-scope="scope">
+          {{ (statusOptions.find(({id}) => String(id) === scope.row.status)|| {}).label || '--'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="竞价单空返数量" prop="num" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      tableData:[],
+      loading:false,
+      statusOptions: [
+        { id: '0', label: '待发布竞标' },
+        { id: '1', label: '招标进行中' },
+        { id: '2', label: '招标已结束' },
+        { id: '3', label: '待选择商品' },
+        { id: '4', label: '已选商品待下单' },
+        { id: '5', label: '已成功转单' },
+        { id: '6', label: '已取消转单' },
+        { id: '7', label: '招标已暂停' }
+      ]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.bidsFail({
+        start: this.date[0],
+        end: this.date[1]
+      });
+
+      if (res.code === 0 && res.data && res.data.result) {
+        this.tableData = Object.keys(res.data.result  || {}).map(key => {
+          const { status, num } = res.data.result[key]
+          return { status, num }
+        })
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 139 - 0
src/components/newReport/src/notDeliverGood.vue

@@ -0,0 +1,139 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border>
+      <el-table-column label="计数项:订单编号">
+        <el-table-column width="120px" label="申请人所属部门" prop="name" />
+      </el-table-column>
+      <el-table-column label="订单状态" width="110px">
+        <template slot-scope="scope">
+          {{ getStatus(scope.row) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="下单月份" align="center">
+        <el-table-column label="01">
+          <template slot-scope="scope">
+            {{getField('1',scope.row)}}
+          </template>
+        </el-table-column>
+        <el-table-column label="02">
+          <template slot-scope="scope">
+            {{getField('2',scope.row)}}
+          </template>
+        </el-table-column>
+        <el-table-column label="03">
+          <template slot-scope="scope">
+            {{getField('3',scope.row)}}
+          </template>
+        </el-table-column>
+
+        <el-table-column label="04">
+          <template slot-scope="scope">
+            {{getField('4',scope.row)}}
+          </template>
+        </el-table-column>
+
+        <el-table-column label="05">
+          <template slot-scope="scope">
+            {{getField('5',scope.row)}}
+          </template>
+        </el-table-column>
+        
+        <el-table-column label="06">
+          <template slot-scope="scope">
+            {{getField('6',scope.row)}}
+          </template>
+        </el-table-column>
+
+        <el-table-column label="07">
+          <template slot-scope="scope">
+            {{getField('7',scope.row)}}
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column label="总计">
+        <template slot-scope="scope">
+          {{getTotal(scope.row)}}
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+import { addition } from "./_utils";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      tableData:[],
+      loading:false,
+      statusOptions: [
+        { id: "0", label: "待发货" },
+        { id: "1", label: "待发货完成" },
+        { id: "2", label: "发货已完成" },
+        { id: "3", label: "订单已取消" }
+      ]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    getStatus(row){
+      const key = Object.keys(row.result).find(month => row.result[month] && row.result[month]['1'] && row.result[month]['1'].send_status)
+      if(!key) return '--'
+      return (this.statusOptions.find(({id}) => {
+        return id === row.result[key]['1'].send_status
+      }) || {}).label || '--'
+    },
+    getTotal(row){
+      const keys = ['1','2','3','4','5','6','7'];
+      return keys.reduce((prev, key) => {
+        return addition(prev, (row.result[key]['1'] || {}).num || 0)
+      },0)
+    },
+    getField(month,row){
+      if(Array.isArray(row.result[month])) return 0
+      return row.result[month]['1'].num || 0
+    },
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.wsendOrder({
+        start: this.date[0] || "",
+        end: this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.result.length > 0) {
+        this.tableData = res.data.result
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 97 - 0
src/components/newReport/src/order.vue

@@ -0,0 +1,97 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border>
+      <el-table-column prop="name" />
+      <el-table-column label="备库">
+        <template slot-scope="scope">
+          {{ getResultWithType(scope.row,'1') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="非库存">
+        <template slot-scope="scope">
+        {{ getResultWithType(scope.row, '2') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="咨询采反">
+        <template slot-scope="scope">
+          {{ getResultWithType(scope.row, '3') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="总计">
+        <template slot-scope="scope">
+          {{ getRowTotal(scope.row)}}
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+import { addition } from "./_utils";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      loading:false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    getRowTotal(row){
+      if(Array.isArray(row.result)) return '0'
+      const result = Object.keys(row.result).map((key) => row.result[key])
+      const total = (result || []).reduce((prev, curr = {}) => {
+        return addition(prev,curr.order_type === '4' ? 0 : curr.num || 0)
+      },0)
+      return total
+    },
+    getResultWithType(row, type){
+      if(Array.isArray(row.result)) return '0'
+      const result = Object.keys(row.result).map((key) => row.result[key])
+      const item = result.find(({order_type}) => order_type === type) || {};
+      return  item.num || 0
+    },
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.saleOrder({
+        start: this.date[0] || "",
+        end: this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        this.tableData = res.data
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 78 - 0
src/components/newReport/src/purchase.vue

@@ -0,0 +1,78 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border>
+      <el-table-column label="采购员" prop="cgder" width="60px" />
+      <el-table-column label="采购部门" prop="name" width="120px" />
+      <el-table-column width="110px" label="采购单总量" prop="total_cgd" />
+      <el-table-column label="库存品" prop="tag_1" />
+      <el-table-column label="非库存品" prop="tag_2" />
+      <el-table-column label="采返" prop="tag_zx"/>
+      <el-table-column label="TOB" prop="tag_b" />
+      <el-table-column label="TOC" prop="tag_c" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+export default {
+  name: "Purchasee",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      loading:false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.cgdOrder({
+        start: this.date[0] || "",
+        end: this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        this.tableData = res.data.reduce((prev,curr = { name:"", result: {}}) => {
+          return [
+            ...prev,
+            ...Object.keys(curr.result).map(key => {
+              return {
+                name:curr.name,
+                ...curr.result[key]
+              }
+            })]
+        },[])
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 143 - 0
src/components/newReport/src/sendExp.vue

@@ -0,0 +1,143 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border :span-method="objectSpanMethod">
+      <el-table-column label="计数项:发货单编号">
+        <el-table-column width="140px" label="部门" prop="name" />
+      </el-table-column>
+      <el-table-column width="140px" show-overflow-tooltip label="仓库负责人" prop="0" />
+      
+      <el-table-column label="时效" align="center">
+        <el-table-column label="A24小时" prop="1" />
+        <el-table-column label="B48小时" prop="2" />
+        <el-table-column label="C3-7天内" prop="3" />
+        <el-table-column label="D14天内" prop="4" />
+        <el-table-column label="E30天内" prop="5" />
+        <el-table-column label="F超30天" prop="5" />
+      </el-table-column>
+
+      <el-table-column label="总计">
+        <template slot-scope="scope">
+          {{getTotal(scope.row)}}
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+import { addition } from "./_utils";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      loading:false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+
+    this.searchList();
+  },
+  methods: {
+    getTotal(row){
+      const keys = ['1','2','3','4','5','6']
+      return keys.reduce((prev,key) => (
+        addition(row[key], prev)
+      ),0)
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex == 0) {
+        //合并相同的名字
+        let nameSpan = this.getSpanNumber(this.tableData, "name");
+        return {
+          rowspan: nameSpan[rowIndex],
+          colspan: 1,
+        };
+      }
+    },
+    //获取要合并的行数
+    getSpanNumber(data, prop) {
+      //data要处理的数组,prop要合并的属性,比如name
+
+      //数组的长度,有时候后台可能返回个null而不是[]
+      let length = Array.isArray(data) ? data.length : 0;
+      if (length > 0) {
+        //用于标识位置
+        let position = 0;
+        //用于对比的数据
+        let temp = data[0][prop];
+        //要返回的结果
+        let result = [1];
+        //假设数据是AABCC,我们的目标就是返回20120
+        for (let i = 1; i < length; i++) {
+          if (data[i][prop] == temp) {
+            //标识位置的数据加一
+            result[position] += 1;
+            //当前位置添0
+            result[i] = 0;
+          } else {
+            //不相同时,修改标识位置,该位置设为1,修改对比值
+            position = i;
+            result[i] = 1;
+            temp = data[i][prop];
+          }
+        }
+        //返回结果
+        return result;
+      } else {
+        return [0];
+      }
+    },
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.outOrder({
+        start: this.date[0] || "",
+        end: this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        const list = []
+        Object.keys(res.data).forEach(key => {
+          const { name , result = {}} = res.data[key]
+          if(result.length === 0){
+            list.push({name, 0: '--',  1:0, 2:0, 3:0,  4:0, 5:0, 6:0 })
+          }else{
+            Object.keys(result).forEach(key => {
+            list.push({ name, ...result[key] })
+          })
+          }
+        })
+
+        this.tableData = list
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 140 - 0
src/components/newReport/src/sendOrder.vue

@@ -0,0 +1,140 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border :span-method="objectSpanMethod">
+      <el-table-column label="计数项:发货工单号">
+        <el-table-column  width="140"  label="部门" prop="name" />
+      </el-table-column>
+      <el-table-column width="140px" label="仓库负责人"  prop="0"  />
+      <el-table-column label="时效" align="center">
+        <el-table-column label="A24小时" prop="1" />
+        <el-table-column label="B48小时" prop="2" />
+        <el-table-column label="C7天内" prop="3" />
+        <el-table-column label="D14天内" prop="4" />
+        <el-table-column label="E30天内" prop="5" />
+        <el-table-column label="F超30天" prop="6" />
+      </el-table-column>
+      <el-table-column label="总计">
+        <template slot-scope="scope">
+          {{ getTotal(scope.row) }}
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+import { addition } from "./_utils";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      loading:false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex == 0) {
+        //合并相同的名字
+        let nameSpan = this.getSpanNumber(this.tableData, "name");
+        return {
+          rowspan: nameSpan[rowIndex],
+          colspan: 1,
+        };
+      }
+    },
+    //获取要合并的行数
+    getSpanNumber(data, prop) {
+      //data要处理的数组,prop要合并的属性,比如name
+
+      //数组的长度,有时候后台可能返回个null而不是[]
+      let length = Array.isArray(data) ? data.length : 0;
+      if (length > 0) {
+        //用于标识位置
+        let position = 0;
+        //用于对比的数据
+        let temp = data[0][prop];
+        //要返回的结果
+        let result = [1];
+        //假设数据是AABCC,我们的目标就是返回20120
+        for (let i = 1; i < length; i++) {
+          if (data[i][prop] == temp) {
+            //标识位置的数据加一
+            result[position] += 1;
+            //当前位置添0
+            result[i] = 0;
+          } else {
+            //不相同时,修改标识位置,该位置设为1,修改对比值
+            position = i;
+            result[i] = 1;
+            temp = data[i][prop];
+          }
+        }
+        //返回结果
+        return result;
+      } else {
+        return [0];
+      }
+    },
+    getTotal(row){
+      const keys = ['1','2','3','4','5','6']
+      return keys.reduce((prev,key) => (
+        addition(row[key], prev)
+      ),0)
+    },
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.outChildOrder({
+        start: this.date[0] || "",
+        end: this.date[1] || ""
+      });
+
+      if (res.code === 0 && res.data && res.data.length > 0) {
+        const list = []
+        Object.keys(res.data).forEach(key => {
+          const { name , result = {}} = res.data[key]
+          if(result.length === 0){
+            list.push({name, 0: '--',  1:0, 2:0, 3:0,  4:0, 5:0, 6:0 })
+          }else{
+            Object.keys(result).forEach(key => {
+            list.push({ name, ...result[key] })
+          })
+          }
+        })
+
+        this.tableData = list
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 81 - 0
src/components/newReport/src/theSales.vue

@@ -0,0 +1,81 @@
+<template>
+  <div class="SalesReportRejectedNew" v-loading="loading">
+    <el-table :data="tableData" size="mini" border max-height="300px">
+      <el-table-column label="产品编码" prop="good_code" width="160px" />
+      <el-table-column label="产品名称" prop="good_name" min-width="160px" show-overflow-tooltip />
+      <el-table-column label="当日库存销售" prop="good_num" min-width="160px" show-overflow-tooltip />
+      <el-table-column label="当日库存发货" prop="send_num" width="100px" />
+      <el-table-column label="当前剩余可用库存" prop="stock_num" width="120px" />
+      <el-table-column label="业务公司名称" prop="supplierName" width="190px" />
+      <el-table-column label="库存采购单" prop="good_price" width="90px" />
+      <el-table-column label="当前库存消耗金额" prop="total_fee" width="130px" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/api/newReport";
+import setHeight from "@/mixins/index";
+import { addition } from "./_utils";
+export default {
+  name: "Consult",
+  mixins: [setHeight],
+  props: ['date'],
+  watch: {
+    date: function(val) {
+      this.dataTime = val;
+      if (val && val.length === 2) {
+        this.searchList();
+      }
+    }
+  },
+  data() {
+    return {
+      loading: false,
+      tableData:[]
+    };
+  },
+  async created() {
+    window.onresize = () => {
+      this.getHeight();
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHeight();
+    });
+    this.searchList();
+  },
+  methods: {
+    async searchList() {
+      this.loading = true;
+      this.tableData = [];
+
+      const res = await asyncRequest.salestock({
+        start_day: this.date[0] || "",
+        end_day: this.date[1] || "",
+        page:1,
+        size: 10000
+      });
+
+      if (res.code === 0 && res.data && res.data.list.length > 0) {
+        this.tableData = res.data.list
+
+        const totalItem = Number(res.data.list.reduce((prev,{total_fee}) => {
+          return addition(prev, total_fee,)
+        },0)).toFixed(2)
+
+        this.tableData.push({
+          good_code: '合计',
+          total_fee:totalItem
+        })
+      } else {
+        this.tableData = [];
+      }
+
+      this.getHeight();
+      this.loading = false;
+    }
+  }
+};
+</script>

+ 2 - 0
src/components/period-date-picker/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 147 - 0
src/components/period-date-picker/main.vue

@@ -0,0 +1,147 @@
+<template>
+  <div class="fl time">
+    <el-date-picker
+      v-model="startTime"
+      style="margin: 0"
+      class="date-picker"
+      type="date"
+      :size="size"
+      :style="{ width: width }"
+      :placeholder="(placeholder||'') + '开始日期'"
+      value-format="yyyy-MM-dd"
+      :picker-options="pickerOptions1"
+      :editable="false"
+      :clearable="true"
+      :disabled="isEdit"
+      @change="timeChange"
+    />
+    <samp style="padding: 0 3px; margin: 0">至</samp>
+    <el-date-picker
+      style="margin: 0"
+      :size="size"
+      v-model="endTime"
+      class="date-picker"
+      :style="{ width: width }"
+      type="date"
+      :placeholder="(placeholder||'') + '结束日期'"
+      :disabled="isEdit"
+      :picker-options="pickerOptions2"
+      :editable="false"
+      value-format="yyyy-MM-dd"
+      :clearable="true"
+      @change="timeChange"
+    />
+  </div>
+</template>
+
+<script>
+// 选择时间段(只有日期)组件
+// timeReturned 返回值{startTime: Number,endTime: Number}
+export default {
+  name: "PeriodDatePicker",
+  props: ["start", "end", "disabled", "size", "width", "type", "placeholder"],
+  data() {
+    return {
+      startTime: this.start,
+      endTime: this.end,
+      isEdit: this.disabled,
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (this.endTime != null && this.endTime != "" && time) {
+            return time.getTime() > new Date(this.endTime).valueOf();
+          }
+        },
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          if (this.startTime != null && this.startTime != "" && time) {
+            return time.getTime() < new Date(this.startTime).valueOf();
+          }
+        },
+      },
+    };
+  },
+  watch: {
+    disabled: function (val) {
+      this.isEdit = val;
+    },
+    start(val) {
+      this.startTime = val;
+    },
+    end(val) {
+      this.endTime = val;
+    },
+  },
+  mounted() {},
+  methods: {
+    timeChange() {
+      if (
+        this.startTime !== "" &&
+        this.startTime !== null &&
+        this.endTime !== "" &&
+        this.endTime !== null
+      ) {
+        if (this.type + "" === "1" && !this.setType(365)) {
+          this.showMessage("时间跨度不能超过一年!");
+          return;
+        } else if (this.type + "" === "2" && !this.setType(90)) {
+          this.showMessage("时间跨度不能超过90天!");
+          return;
+        }else if (this.type + "" === "3" && !this.setType(30)) {
+          this.showMessage("时间跨度不能超过30天!");
+          return;
+        } else if (
+          new Date(this.endTime).valueOf() < new Date(this.startTime).valueOf()
+        ) {
+          this.showMessage("结束时间不大于开始时间!");
+          return;
+        } else {
+          this.timeReturned();
+        }
+      } else {
+        this.timeReturned();
+      }
+    },
+    timeReturned() {
+      let s = this.startTime == null ? "" : this.startTime;
+      let e = this.endTime == null ? "" : this.endTime;
+      let model = {
+        startTime: s == "" ? "" : this.transformTime(s),
+        endTime: e == "" ? "" : this.transformTime(e),
+      };
+
+      this.$emit("timeReturned", model);
+    },
+
+    transformTime(tTime) {
+      let time = new Date(tTime);
+      let y = time.getFullYear();
+      let M = time.getMonth() + 1;
+      let d = time.getDate();
+      return y + "-" + (M < 10 ? "0" + M : M) + "-" + (d < 10 ? "0" + d : d);
+    },
+    showMessage(message) {
+      this.$message.error(message);
+      this.startTime = "";
+      this.endTime = "";
+      this.timeReturned();
+    },
+    setType(days) {
+      let step = 24 * 3600 * 1000;
+      let sDay = new Date(this.startTime).valueOf();
+      let eDay = new Date(this.endTime).valueOf();
+      let isok = true;
+      if (eDay - sDay > step * days) {
+        isok = false;
+      }
+
+      return isok;
+    },
+  },
+};
+</script>
+<style lang="scss">
+.date-picker.el-input {
+  // width: 150px !important;
+}
+</style>

+ 0 - 0
src/components/period-date-picker/日期选择区间


+ 1 - 0
src/components/reports/src/CompanyGrossMargin.vue

@@ -8,6 +8,7 @@ module.exports = {
   reportApi: "http://cxinv.api.caixiao365.com/",
   appId: "wxfa1f1a0211edf630",
   redirect:'http://depart.test241.wanyuhengtong.com/',
+  newReportApi:"http://stock.api.caixiao365.com/",
   ding: {
     //企业id
     CorpId: "dingc78fa4301e1a424a35c2f4657eb6378f",

+ 1 - 0
src/config/env.prod.js

@@ -8,6 +8,7 @@ module.exports = {
   reportApi: "http://cxinv.api.caixiao365.com/",
   appId: "wxfa1f1a0211edf630",
   redirect:'http://cxinv.api.caixiao365.com/',
+  newReportApi:"http://stocknew.test241.wanyuhengtong.com/",
   ding: {
     //企业id
     CorpId: "dingc78fa4301e1a424a35c2f4657eb6378f",

+ 2 - 1
src/config/env.production.js

@@ -4,9 +4,10 @@ module.exports = {
   baseApi: "http://inv.sitw.wanyuhengtong.com/",
   cxApi: "http://stock.api.wanyuhengtong.com/",
   fileURL: `https://api2.edu.futurelab.tv`,
-  reportApi: "http://cxinv.api.caixiao365.com/",
   appId: "wxfa1f1a0211edf630",
   redirect:'http://depart.test241.wanyuhengtong.com/',
+  reportApi: "http://cxinv.api.caixiao365.com/",
+  newReportApi:"http://stock.api.caixiao365.com/",
   ding: {
     //企业id
     CorpId: "dingc78fa4301e1a424a35c2f4657eb6378f",

+ 40 - 42
src/config/env.staging.js

@@ -128,49 +128,47 @@ export default {
     async requestUserinfo(){
        this.state.loading = true;
        const code = getParameterByName('code')
-       const result = await userRequest.userinfo({
-         code
-       })
+       const result = await userRequest.userinfo({ code })
 
-       // const result ={
-       // "code": 0,
-       // "message": "获取成功",
-       // "data": {
-		   //     "id": "1",
-		   //     "openid": "oOpc26KiZFBKIm7SB8knFGvov1qg",
-		   //     "mobile": "",
-		   //     "gender": "0",
-		   //     "nickname": "雪寒",
-		   //     "avatar": "",
-		   //     "subscribe_time": "2022-12-21 15:52:14",
-		   //     "addr": "\/\/",
-		   //     "status": "1",
-		   //     "is_show": ["1", "2"],
-		   //     "companyArr": [{
-		   //     	"companyNo": "GS2302231125079621",
-		   //     	"companyName": "北京百辰荣达国际科贸有限公司",
-		   //     	"info": [1,2]
-		   //     }, {
-		   //     	"companyNo": "GS2302231323386950",
-		   //     	"companyName": "北京泓源广诚国际商贸有限公司",
-		   //     	"info": [1,2]
-		   //     }, {
-		   //     	"companyNo": "GS2304031312553746",
-		   //     	"companyName": "北京锦兴弘昌科技有限公司",
-		   //     	"info": [1, 2]
-		   //     }, {
-		   //     	"companyNo": "GS2302231124114965",
-		   //     	"companyName": "北京普润心堂商贸有限公司",
-		   //     	"info": [1, 2]
-		   //     }, {
-		   //     	"companyNo": "GS2203161855277894",
-		   //     	"companyName": "北京万宇恒通国际科贸有限公司",
-		   //     	"info": [1, 2]
-		   //     }],
-		   //     "addtime": "2023-04-10 18:11:07",
-		   //     "updatetime": "2023-05-09 16:22:33"
-       // 	}
-       // }
+      //  const result ={
+      //  "code": 0,
+      //  "message": "获取成功",
+      //  "data": {
+		  //      "id": "1",
+		  //      "openid": "oOpc26KiZFBKIm7SB8knFGvov1qg",
+		  //      "mobile": "",
+		  //      "gender": "0",
+		  //      "nickname": "雪寒",
+		  //      "avatar": "",
+		  //      "subscribe_time": "2022-12-21 15:52:14",
+		  //      "addr": "\/\/",
+		  //      "status": "1",
+		  //      "is_show": ["1", "2"],
+		  //      "companyArr": [{
+		  //      	"companyNo": "GS2302231125079621",
+		  //      	"companyName": "北京百辰荣达国际科贸有限公司",
+		  //      	"info": [1,2]
+		  //      }, {
+		  //      	"companyNo": "GS2302231323386950",
+		  //      	"companyName": "北京泓源广诚国际商贸有限公司",
+		  //      	"info": [1,2]
+		  //      }, {
+		  //      	"companyNo": "GS2304031312553746",
+		  //      	"companyName": "北京锦兴弘昌科技有限公司",
+		  //      	"info": [1, 2]
+		  //      }, {
+		  //      	"companyNo": "GS2302231124114965",
+		  //      	"companyName": "北京普润心堂商贸有限公司",
+		  //      	"info": [1, 2]
+		  //      }, {
+		  //      	"companyNo": "GS2203161855277894",
+		  //      	"companyName": "北京万宇恒通国际科贸有限公司",
+		  //      	"info": [1, 2]
+		  //      }],
+		  //      "addtime": "2023-04-10 18:11:07",
+		  //      "updatetime": "2023-05-09 16:22:33"
+      //  	}
+      //  }
       
         this.state.loading = false
         switch(Number(result.code)){

+ 3 - 1
src/pages/login.vue

@@ -8,7 +8,9 @@ export default {
   name:'login',
   async mounted () {
       const path = (this.$route.query || {}).path
-      const redirect_url = encodeURIComponent('http://stat.caixiao365.com/' + (path ? `#/${path}` : ''))
+      const source = 'http://stat.caixiao365.com/'
+      const local = "http://localhost:8081/"
+      const redirect_url = encodeURIComponent(source + (path ? `#/${path}` : ''))
       var state = 'wx_' + Math.random().toString(36).substr(2, 15)
       const scope = 'snsapi_userinfo'
       const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.appId}&redirect_uri=${redirect_url}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`

+ 226 - 0
src/pages/newReport.vue

@@ -0,0 +1,226 @@
+<template>
+  <div class="new-report" v-loading="state.loading">
+    <div v-if="!state.error && isShow">
+      <div style="display:flex;justify-content:flex-end">
+        <period-date-picker size="mini" width="150px" @timeReturned="time($event)" />
+      </div>
+
+      <el-row gutter="20">
+        <el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
+          <p class="title">1.咨询单情况</p>
+          <consult :date="date" />
+        </el-col>
+
+        <el-col :xs="24" :sm="16" :md="16" :lg="16" :xl="16">
+          <p class="title">2.订单情况 </p>
+          <order :date="date" />
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
+          <p class="title">3.备库单情况</p>
+          <stock :date="date" />
+        </el-col>
+
+        <el-col :xs="24" :sm="16" :md="16" :lg="16" :xl="16">
+          <p class="title">4.采购员采购单情况</p>
+          <purchase :date="date" />
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+          <p class="title">5.采购员竞价反馈情况 : 竞价单总量 : {{ zxTotal }}</p>
+          <purchase-back :date="date" @getZXTotal="getZXTotal" />
+        </el-col>
+
+        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+          <p class="title">6.竞价单空返情况统计:</p>
+          <empty-return :date="date" />
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+          <p class="title">7.当日库存销售情况表:</p>
+          <the-sales :date="date" />
+        </el-col>
+
+        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+          <p class="title">8.发货工单时效:</p>
+          <send-order :date="date" />
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+          <p class="title">9.发货单时效:</p>
+          <send-exp :date="date" />
+        </el-col>
+
+        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+          <p class="title">10.订单未发货情况:</p>
+          <not-deliver-good :date="date" />
+        </el-col>
+      </el-row>
+    </div>
+
+    <template v-else-if="state.error && isShow">
+      <unusual-state :message="state.message" path="newReport" />
+    </template>
+  </div>
+</template>
+
+<script>
+import NotDeliverGood from "../components/newReport/src/notDeliverGood.vue";
+import PurchaseBack from "../components/newReport/src/PurchaseBack.vue";
+import EmptyReturn from "../components/newReport/src/emptyReturn.vue";
+import SendOrder from "../components/newReport/src/sendOrder.vue";
+import TheSales from "../components/newReport/src/theSales.vue";
+import Purchase from "../components/newReport/src/purchase.vue";
+import PeriodDatePicker from "../components/period-date-picker";
+import Consult from '../components/newReport/src/consult.vue';
+import SendExp from "../components/newReport/src/sendExp.vue";
+import Order from '../components/newReport/src/order.vue';
+import Stock from "../components/newReport/src/Stock.vue";
+
+import UnusualState from "@/components/unusual/index.vue";
+import { getParameterByName } from "../utils/auth";
+import userRequest from "@/api/index";
+
+export default {
+  name: "newReport",
+  components: {
+    PeriodDatePicker,
+    NotDeliverGood,
+    UnusualState,
+    PurchaseBack,
+    EmptyReturn,
+    SendOrder,
+    TheSales,
+    Purchase,
+    SendExp,
+    Consult,
+    Stock,
+    Order
+  },
+  data() {
+    return {
+      date: [],
+      zxTotal: 0,
+      isDisplay: false,
+      state:{
+        message: '',
+        error: false,
+        loading: false
+      }
+    };
+  },
+  mounted() {
+    if(!getParameterByName('code')){
+      this.login()
+    }else{
+      this.requestUserinfo()
+    }
+  },
+  methods: {
+    getZXTotal(zxTotal) {
+      this.zxTotal = zxTotal;
+    },
+    async time(e) {
+      const { startTime, endTime } = e;
+      this.start = startTime || "";
+      this.end = endTime || "";
+
+      const { start, end } = this;
+      if ((start !== "" && end === "") || (start === "" && end !== "")) {
+        this.$message.warning("时间区间不完整!");
+        this.date = []
+        return;
+      }
+
+      this.date = [this.start, this.end]
+    },
+    async requestUserinfo(){
+       this.state.loading = true;
+       const code = getParameterByName('code')
+       const result = await userRequest.userinfo({ code })
+
+      // const result ={
+      //   "code": 0,
+      //  "message": "获取成功",
+      //  "data": {
+		  //      "id": "1",
+		  //      "openid": "oOpc26KiZFBKIm7SB8knFGvov1qg",
+		  //      "mobile": "",
+		  //      "gender": "0",
+		  //      "nickname": "雪寒",
+		  //      "avatar": "",
+		  //      "subscribe_time": "2022-12-21 15:52:14",
+		  //      "addr": "\/\/",
+		  //      "status": "1",
+		  //      "is_show": ["1", "2", "4"],
+		  //      "companyArr": [{
+		  //      	"companyNo": "GS2302231125079621",
+		  //      	"companyName": "北京百辰荣达国际科贸有限公司",
+		  //      	"info": [1,2]
+		  //      }, {
+		  //      	"companyNo": "GS2302231323386950",
+		  //      	"companyName": "北京泓源广诚国际商贸有限公司",
+		  //      	"info": [1,2]
+		  //      }, {
+		  //      	"companyNo": "GS2304031312553746",
+		  //      	"companyName": "北京锦兴弘昌科技有限公司",
+		  //      	"info": [1, 2]
+		  //      }, {
+		  //      	"companyNo": "GS2302231124114965",
+		  //      	"companyName": "北京普润心堂商贸有限公司",
+		  //      	"info": [1, 2]
+		  //      }, {
+		  //      	"companyNo": "GS2203161855277894",
+		  //      	"companyName": "北京万宇恒通国际科贸有限公司",
+		  //      	"info": [1, 2]
+		  //      }],
+		  //      "addtime": "2023-04-10 18:11:07",
+		  //      "updatetime": "2023-05-09 16:22:33"
+      //  	}
+      //  }
+      
+        this.state.loading = false
+        switch(Number(result.code)){
+          case 0:
+          this.isShow =  (result.data.is_show || []).includes(4) || (result.data.is_show || []).includes('4')
+          if(!this.isShow){
+            return
+          }
+
+           break
+          default:
+           this.state.error = true
+           this.state.message = result.message
+           break
+        }
+      },
+    login(){
+      const redirect_url = encodeURIComponent('http://stat.caixiao365.com/accountsReceivable')
+      var state = 'wx_' + Math.random().toString(36).substr(2, 15)
+      const scope = 'snsapi_userinfo'
+      const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.appId}&redirect_uri=${redirect_url}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`
+      window.location.href = url
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.new-report {
+  padding: 10px;
+  box-sizing: border-box;
+
+  .title {
+    padding-left: 5px;
+  }
+}
+</style>
+

+ 3 - 1
src/pages/report.vue

@@ -1,12 +1,14 @@
 import Report from "./../pages/report.vue"
 import Login from "./../pages/login.vue"
 import AccountsReceivable from "./../pages/accountsReceivable.vue"
+import NewReport from "./../pages/newReport.vue"
 import { getParameterByName } from "../utils/auth"
 
 const routes = [
   { path: '/', component: Report},
   { path:'/login', component: Login},
-  { path:'/accountsReceivable', component: AccountsReceivable},
+  { path:'/newReport', component: NewReport},
+  { path:'/accountsReceivable', component: AccountsReceivable}
 ]
 
 const router = new VueRouter({routes ,mode:'hash'})

+ 0 - 0
src/styles/index.scss


Some files were not shown because too many files changed in this diff