cmy 6 月之前
父節點
當前提交
75ab5b044f

+ 2 - 0
src/pages/order/orderList/components/tableFrom.vue

@@ -78,6 +78,8 @@
               placeholder="全部"
             >
               <Option value="0">普通订单</Option>
+              <!-- <Option value="901">抢购订单</Option> -->
+              <!-- <Option value="902">报单订单</Option> -->
               <Option value="1">秒杀订单</Option>
               <Option value="2">砍价订单</Option>
               <Option value="3">拼团订单</Option>

+ 40 - 0
src/pages/product/productAdd/index.vue

@@ -653,6 +653,13 @@
 					      class="priceBox"
 					  ></InputNumber>
 					</template>
+					<template slot-scope="{ row, index }" slot="award_price">
+					  <InputNumber
+					      v-model="oneFormBatch[0].award_price"
+					      :min="0"
+					      class="priceBox"
+					  ></InputNumber>
+					</template>
                     <template slot-scope="{ row, index }" slot="cost">
                       <InputNumber
                           v-model="oneFormBatch[0].cost"
@@ -767,6 +774,13 @@
 					      class="priceBox"
 					  ></InputNumber>
 					</template>
+					<template slot-scope="{ row, index }" slot="award_price">
+					  <InputNumber
+					      v-model="manyFormValidate[index].award_price"
+					      :min="0"
+					      class="priceBox"
+					  ></InputNumber>
+					</template>
                     <template slot-scope="{ row, index }" slot="cost">
                       <InputNumber
                           v-model="manyFormValidate[index].cost"
@@ -919,6 +933,17 @@
                 ></InputNumber>
               </FormItem>
             </Col>
+			<Col span="24" class="asterisk">
+			  <div class="asteriskInfo on">*</div>
+			  <FormItem label="奖金结算:">
+			    <InputNumber
+			        v-model="oneFormValidate[0].award_price"
+			        :min="0"
+			        :max="99999999"
+			        v-width="'50%'"
+			    ></InputNumber>
+			  </FormItem>
+			</Col>
             <Col span="24" class="asterisk">
               <div class="asteriskInfo on">*</div>
               <FormItem label="成本价:">
@@ -2113,6 +2138,7 @@ export default {
           pic: "",
           price: 0,
 		  settle_price: 0,
+		  award_price:0,
           cost: 0,
           ot_price: 0,
           stock: 0,
@@ -2155,6 +2181,12 @@ export default {
           align: "center",
           minWidth: 95,
         },
+		{
+		  title: "奖金结算",
+		  slot: "award_price",
+		  align: "center",
+		  minWidth: 95,
+		},
         {
           title: "原价",
           slot: "ot_price",
@@ -2299,6 +2331,7 @@ export default {
           pic: "",
           price: 0,
 		  settle_price: 0,
+		  award_price:0,
           cost: 0,
           ot_price: 0,
           stock: 0,
@@ -2609,6 +2642,7 @@ export default {
                     pic: data.slider_image[0],
                     price: 0,
 					settle_price: 0,
+					award_price:0,
                     cost: 0,
                     ot_price: 0,
                     stock: 0,
@@ -2879,6 +2913,7 @@ export default {
       j.pic = '';
       j.price = 0;
 	  j.settle_price = 0;
+	  j.award_price = 0;
       j.cost = 0;
       j.ot_price = 0;
       j.stock = 0;
@@ -3219,6 +3254,7 @@ export default {
             pic: "",
             price: 0,
 			settle_price: 0,
+			award_price:0,
             cost: 0,
             ot_price: 0,
             stock: 0,
@@ -3476,6 +3512,7 @@ export default {
           pic: "",
           price: 0,
 		  settle_price: 0,
+		  award_price:0,
           cost: 0,
           ot_price: 0,
           stock: 0,
@@ -3547,6 +3584,9 @@ export default {
 		  if (this.oneFormBatch[0].settle_price > 0 && this.merchantType == 2) {
 		    this.$set(val, "settle_price", this.oneFormBatch[0].settle_price);
 		  }
+		  if (this.oneFormBatch[0].award_price > 0 ) {
+		    this.$set(val, "award_price", this.oneFormBatch[0].award_price);
+		  }
           if (this.oneFormBatch[0].cost > 0) {
             this.$set(val, "cost", this.oneFormBatch[0].cost);
           }

+ 618 - 478
src/pages/statistic/order/index.vue

@@ -1,485 +1,625 @@
 <template>
-  <div>
-    <Card :bordered="false" dis-hover class="ivu-mt">
-      <Form ref="formInline"
-        :label-width="labelWidth"
-        :label-position="labelPosition"
-        inline>
-        <FormItem label="选择时间:">
-          <DatePicker
-            :editable="false"
-            :clearable="false"
-            @on-change="onchangeTime"
-            :value="timeVal"
-            format="yyyy/MM/dd"
-            type="datetimerange"
-            placement="bottom-start"
-            placeholder="请选择时间"
-            style="width: 200px"
-            :options="options"
-            class="mr20"
-          ></DatePicker>
-        </FormItem>
-      </Form>
-    </Card>
-    <cards-data
-      :cardLists="cardLists"
-      v-if="cardLists.length >= 0"
-    ></cards-data>
-    <Card :bordered="false" dis-hover>
-      <h3>营业趋势</h3>
-      <echarts-new
-        :option-data="optionData"
-        :styles="style"
-        height="100%"
-        width="100%"
-        v-if="optionData"
-      ></echarts-new>
-    </Card>
-    <Spin size="large" fix v-if="spinShow"></Spin>
-    <div class="code-row-bg">
-      <Card :bordered="false" dis-hover class="ivu-mt">
-        <div class="acea-row row-between-wrapper">
-          <h3 class="header-title">订单来源分析</h3>
-          <div class="change-style" @click="echartLeft = !echartLeft">
-            切换样式
-          </div>
-        </div>
-        <div class="ech-box">
-          <echarts-from
-            v-if="echartLeft"
-            ref="visitChart"
-            :infoList="infoList"
-            echartsTitle="circle"
-          ></echarts-from>
-          <Table
-            v-show="!echartLeft"
-            ref="selection"
-            :columns="columns1"
-            :data="tabList"
-            :loading="loading"
-            no-data-text="暂无数据"
-            highlight-row
-            no-filtered-data-text="暂无筛选结果"
-          >
-            <template slot-scope="{ row }" slot="percent">
-              <div class="percent-box">
-                <div class="line">
-                  <div class="bg"></div>
-                  <div
-                    class="percent"
-                    :style="'width:' + row.percent + '%;'"
-                  ></div>
-                </div>
-                <div class="num">{{ row.percent }}%</div>
-              </div>
-            </template>
-          </Table>
-        </div>
-      </Card>
-      <Card :bordered="false" dis-hover class="ivu-mt">
-        <div class="acea-row row-between-wrapper">
-          <h3 class="header-title">订单类型分析</h3>
-          <div class="change-style" @click="echartRight = !echartRight">
-            切换样式
-          </div>
-        </div>
-        <div class="ech-box" style="max-height:350px;overflow:auto;">
-          <echarts-from
-            v-if="echartRight"
-            ref="visitChart"
-            :infoList="infoList2"
-            echartsTitle="circle"
-          ></echarts-from>
-          <Table
-            v-show="!echartRight"
-            ref="selection"
-            :columns="columns"
-            :data="tabList2"
-            :loading="loading2"
-            no-data-text="暂无数据"
-            highlight-row
-            no-filtered-data-text="暂无筛选结果"
-          >
-            <template slot-scope="{ row }" slot="percent">
-              <div class="percent-box">
-                <div class="line">
-                  <div class="bg"></div>
-                  <div
-                    class="percent"
-                    :style="'width:' + row.percent + '%;'"
-                  ></div>
-                </div>
-                <div class="num">{{ row.percent }}%</div>
-              </div>
-            </template>
-          </Table>
-        </div>
-      </Card>
-    </div>
-  </div>
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form ref="formInline" :label-width="labelWidth" :label-position="labelPosition" inline>
+				<FormItem label="选择时间:">
+					<DatePicker :editable="false" :clearable="false" @on-change="onchangeTime" :value="timeVal"
+						format="yyyy/MM/dd" type="datetimerange" placement="bottom-start" placeholder="请选择时间"
+						style="width: 200px" :options="options" class="mr20"></DatePicker>
+				</FormItem>
+				<!-- <FormItem label="运营中心:">
+					<Select v-model="formValidate.area_admin" @on-change='changearea'>
+						<Option :value="0">无</Option>
+						<Option :value="3">省</Option>
+						<Option :value="2">市</Option>
+						<Option :value="1">区</Option>
+					</Select>
+				</FormItem> -->
+				<FormItem label="管理区域:">
+					<Cascader v-model="addressSelectDl" :data="addresData2" :load-data="loadData2"
+						@on-change="addchack2"></Cascader>
+				</FormItem>
+				<FormItem>
+					<Button
+					    type="primary"
+					    label="default"
+					    class="mr15"
+					    @click="getBasic()"
+					>搜索</Button>
+				</FormItem>
+			</Form>
+		</Card>
+
+		<cards-data :cardLists="cardLists" v-if="cardLists.length >= 0"></cards-data>
+		<Card :bordered="false" dis-hover>
+			<h3>营业趋势</h3>
+			<echarts-new :option-data="optionData" :styles="style" height="100%" width="100%"
+				v-if="optionData"></echarts-new>
+		</Card>
+		<Spin size="large" fix v-if="spinShow"></Spin>
+		<div class="code-row-bg">
+			<Card :bordered="false" dis-hover class="ivu-mt">
+				<div class="acea-row row-between-wrapper">
+					<h3 class="header-title">订单来源分析</h3>
+					<div class="change-style" @click="echartLeft = !echartLeft">
+						切换样式
+					</div>
+				</div>
+				<div class="ech-box">
+					<echarts-from v-if="echartLeft" ref="visitChart" :infoList="infoList"
+						echartsTitle="circle"></echarts-from>
+					<Table v-show="!echartLeft" ref="selection" :columns="columns1" :data="tabList" :loading="loading"
+						no-data-text="暂无数据" highlight-row no-filtered-data-text="暂无筛选结果">
+						<template slot-scope="{ row }" slot="percent">
+							<div class="percent-box">
+								<div class="line">
+									<div class="bg"></div>
+									<div class="percent" :style="'width:' + row.percent + '%;'"></div>
+								</div>
+								<div class="num">{{ row.percent }}%</div>
+							</div>
+						</template>
+					</Table>
+				</div>
+			</Card>
+			<Card :bordered="false" dis-hover class="ivu-mt">
+				<div class="acea-row row-between-wrapper">
+					<h3 class="header-title">订单类型分析</h3>
+					<div class="change-style" @click="echartRight = !echartRight">
+						切换样式
+					</div>
+				</div>
+				<div class="ech-box" style="max-height:350px;overflow:auto;">
+					<echarts-from v-if="echartRight" ref="visitChart" :infoList="infoList2"
+						echartsTitle="circle"></echarts-from>
+					<Table v-show="!echartRight" ref="selection" :columns="columns" :data="tabList2" :loading="loading2"
+						no-data-text="暂无数据" highlight-row no-filtered-data-text="暂无筛选结果">
+						<template slot-scope="{ row }" slot="percent">
+							<div class="percent-box">
+								<div class="line">
+									<div class="bg"></div>
+									<div class="percent" :style="'width:' + row.percent + '%;'"></div>
+								</div>
+								<div class="num">{{ row.percent }}%</div>
+							</div>
+						</template>
+					</Table>
+				</div>
+			</Card>
+		</div>
+	</div>
 </template>
 
 <script>
-import cardsData from '@/components/cards/cards';
-import echartsNew from '@/components/echartsNew/index';
-import { getBasic, getTrend, getChannel, getType } from '@/api/statistic';
-import { formatDate } from '@/utils/validate';
-import echartsFrom from '@/components/echarts/index';
-import timeOptions from '@/utils/timeOptions';
-import { mapState } from "vuex";
-
-export default {
-  name: 'index',
-  components: { cardsData, echartsNew, echartsFrom },
-  data() {
-    return {
-      timeVal: [],
-      style: { height: '400px' },
-      infoList: {},
-      infoList2: {},
-      echartLeft: true,
-      echartRight: false,
-      loading: false,
-      loading2: false,
-      fromList: {
-        title: '选择时间',
-        custom: true,
-        fromTxt: [
-          { text: '全部', val: '' },
-          { text: '今天', val: 'today' },
-          { text: '本周', val: 'week' },
-          { text: '本月', val: 'month' },
-          { text: '本季度', val: 'quarter' },
-          { text: '本年', val: 'year' },
-        ],
-      },
-      formValidate: {
-        time: '',
-      },
-      cardLists: [
-        {
-          col: 4,
-          count: 0,
-          name: '支付订单数',
-          className: 'md-rose',
-        },
-        {
-          col: 4,
-          count: 0,
-          name: '实付金额',
-          className: 'ios-speedometer-outline',
-        },
-        {
-          col: 4,
-          count: 0,
-          name: '退款订单量',
-          className: 'ios-speedometer-outline',
-        },
-        {
-          col: 4,
-          count: 0,
-          name: '退款金额',
-          className: 'md-rose',
-        },
-        {
-          col: 4,
-          count: 0,
-          name: '用券金额',
-          className: 'md-ribbon',
-        },
-        {
-          col: 4,
-          count: 0,
-          name: '用券数量',
-          className: 'md-ribbon',
-        },
-      ],
-      optionData: {},
-      spinShow: false,
-      options: timeOptions,
-      columns: [
-        {
-          title: '序号',
-          type: 'index',
-          width: 60,
-          align: 'center',
-        },
-        {
-          title: '来源',
-          key: 'name',
-          minWidth: 80,
-          align: 'center',
-        },
-        {
-          title: '金额',
-          width: 180,
-          key: 'value',
-          align: 'center',
-        },
-        {
-          title: '占比率',
-          slot: 'percent',
-          minWidth: 100,
-          align: 'center',
-        },
-      ],
-	  columns1:[],
-      tabList: [],
-      tabList2: [],
-    };
-  },
-  computed:{
-     ...mapState("admin/layout", ["isMobile"]),
-    labelWidth() {
-      return this.isMobile ? undefined : 96;
-    },
-    labelPosition() {
-      return this.isMobile ? "top" : "right";
-    },
-  },
-  created() {
-	  let obj = {
-		  title: '订单量',
-		  width: 180,
-		  key: 'value',
-		  align: 'center',
-	  }
-	let columns = JSON.parse(JSON.stringify(this.columns));
-	columns.splice(2,1,obj);
-	this.columns1 = columns;
-    // this.getTrend();
-    const end = new Date();
-    const start = new Date();
-    start.setTime(
-      start.setTime(
-        new Date(
-          new Date().getFullYear(),
-          new Date().getMonth(),
-          new Date().getDate() - 29
-        )
-      )
-    );
-    this.timeVal = [start, end];
-    this.formValidate.time =
-      formatDate(start, 'yyyy/MM/dd') + '-' + formatDate(end, 'yyyy/MM/dd');
-    this.onInit();
-  },
-  methods: {
-    onInit() {
-      this.getBasic();
-      this.getTrend();
-      this.getChannel();
-      this.getType();
-    },
-    onSelectDate(e) {
-      this.formValidate.time = e;
-      this.onInit();
-    },
-    timeG(dd) {
-      var d = new Date(dd);
-      var datetime =
-        d.getFullYear() +
-        '-' +
-        (d.getMonth() + 1) +
-        '-' +
-        d.getDate() +
-        ' ' +
-        d.getHours() +
-        ':' +
-        d.getMinutes() +
-        ':' +
-        d.getSeconds();
-      return datetime;
-    },
-    getBasic() {
-      getBasic(this.formValidate).then((res) => {
-        let arr = [
-          'pay_count',
-          'pay_price',
-          'refund_count',
-          'refund_price',
-          'coupon_price',
-          'coupon_count',
-        ];
-        this.cardLists.map((i, index) => {
-          i.count = res.data[arr[index]];
-        });
-      });
-    },
-    getChannel() {
-      this.loading = true;
-      getChannel(this.formValidate).then((res) => {
-        this.infoList = res.data;
-        this.tabList = res.data.list;
-        this.loading = false;
-      });
-    },
-    getType() {
-      this.loading2 = true;
-      getType(this.formValidate).then((res) => {
-        this.infoList2 = res.data;
-        this.tabList2 = res.data.list;
-        this.loading2 = false;
-      });
-    },
-    selectChange(e) {
-      console.log(this.timeG(e.split(',')[0]), this.timeG(e.split(',')[1]));
-    },
-    // 具体日期
-    onchangeTime(e) {
-      this.timeVal = e;
-      this.formValidate.time = this.timeVal[0] ? this.timeVal.join('-') : '';
-      this.name = this.formValidate.time;
-      this.getBasic();
-      if (this.formValidate.time) {
-        this.getTrend();
-      }
-      this.getChannel();
-      this.getType();
-    },
-    // 统计图
-    getTrend() {
-      this.spinShow = true;
-      getTrend(this.formValidate)
-        .then(async (res) => {
-          let legend = res.data.series.map((item) => {
-            return item.name;
-          });
-          let xAxis = res.data.xAxis;
-          let col = ['#5B8FF9', '#5AD8A6', '#FFAB2B', '#5D7092'];
-          let series = [];
-          res.data.series.map((item, index) => {
-            series.push({
-              name: item.name,
-              type: 'line',
-              data: item.data,
-              itemStyle: {
-                normal: {
-                  color: col[index],
-                },
-              },
-              smooth: 0,
-            });
-          });
-          this.optionData = {
-            tooltip: {
-              trigger: 'axis',
-              axisPointer: {
-                type: 'cross',
-                label: {
-                  backgroundColor: '#6a7985',
-                },
-              },
-            },
-            legend: {
-              x: 'center',
-              data: legend,
-            },
-            grid: {
-              left: '3%',
-              right: '4%',
-              bottom: '3%',
-              containLabel: true,
-            },
-            toolbox: {
-              feature: {
-                saveAsImage: {},
-              },
-              right: '5%'
-            },
-            xAxis: {
-              type: 'category',
-              boundaryGap: true,
-              axisLabel: {
-                interval: 0,
-                rotate: 40,
-                textStyle: {
-                  color: '#000000',
-                },
-              },
-              data: xAxis,
-            },
-            yAxis: {
-              type: 'value',
-              axisLine: {
-                show: false,
-              },
-              axisTick: {
-                show: false,
-              },
-              axisLabel: {
-                textStyle: {
-                  color: '#7F8B9C',
-                },
-              },
-              splitLine: {
-                show: true,
-                lineStyle: {
-                  color: '#F5F7F9',
-                },
-              },
-            },
-            series: series,
-          };
-          this.spinShow = false;
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-          this.spinShow = false;
-        });
-    },
-  },
-};
+	import cardsData from '@/components/cards/cards';
+	import echartsNew from '@/components/echartsNew/index';
+	import {
+		getBasic,
+		getTrend,
+		getChannel,
+		getType
+	} from '@/api/statistic';
+	import {
+		formatDate
+	} from '@/utils/validate';
+	import echartsFrom from '@/components/echarts/index';
+	import timeOptions from '@/utils/timeOptions';
+	import {
+		mapState
+	} from "vuex";
+	import {
+		cityApi
+	} from '@/api/store';
+	export default {
+		name: 'index',
+		components: {
+			cardsData,
+			echartsNew,
+			echartsFrom
+		},
+		data() {
+			return {
+				timeVal: [],
+				style: {
+					height: '400px'
+				},
+				infoList: {},
+				infoList2: {},
+				echartLeft: true,
+				echartRight: false,
+				loading: false,
+				loading2: false,
+				fromList: {
+					title: '选择时间',
+					custom: true,
+					fromTxt: [{
+							text: '全部',
+							val: ''
+						},
+						{
+							text: '今天',
+							val: 'today'
+						},
+						{
+							text: '本周',
+							val: 'week'
+						},
+						{
+							text: '本月',
+							val: 'month'
+						},
+						{
+							text: '本季度',
+							val: 'quarter'
+						},
+						{
+							text: '本年',
+							val: 'year'
+						},
+					],
+				},
+				formValidate: {
+					time: '',
+					area_admin: "1",
+					order_province: 0,
+					order_city: 0,
+					order_district: 0,
+				},
+				cardLists: [{
+						col: 4,
+						count: 0,
+						name: '支付订单数',
+						className: 'md-rose',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '实付金额',
+						className: 'ios-speedometer-outline',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '退款订单量',
+						className: 'ios-speedometer-outline',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '退款金额',
+						className: 'md-rose',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '用券金额',
+						className: 'md-ribbon',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '用券数量',
+						className: 'md-ribbon',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '支付宝支付',
+						className: 'ios-at',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '微信支付',
+						className: 'ios-chatboxes-outline',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '余额支付',
+						className: 'logo-yen',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '使用消费分',
+						className: 'logo-vimeo',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '线下支付',
+						className: 'ios-woman',
+					},
+					{
+						col: 4,
+						count: 0,
+						name: '报单金额',
+						className: 'ios-thumbs-up',
+					},
+				],
+				optionData: {},
+				spinShow: false,
+				options: timeOptions,
+				columns: [{
+						title: '序号',
+						type: 'index',
+						width: 60,
+						align: 'center',
+					},
+					{
+						title: '来源',
+						key: 'name',
+						minWidth: 80,
+						align: 'center',
+					},
+					{
+						title: '金额',
+						width: 180,
+						key: 'value',
+						align: 'center',
+					},
+					{
+						title: '占比率',
+						slot: 'percent',
+						minWidth: 100,
+						align: 'center',
+					},
+				],
+				columns1: [],
+				tabList: [],
+				tabList2: [],
+				// 代理区域
+				addressSelectDl: [],
+				// 三级地质系
+				addresData2: [],
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			let obj = {
+				title: '订单量',
+				width: 180,
+				key: 'value',
+				align: 'center',
+			}
+			let columns = JSON.parse(JSON.stringify(this.columns));
+			columns.splice(2, 1, obj);
+			this.columns1 = columns;
+			// this.getTrend();
+			const end = new Date();
+			const start = new Date();
+			start.setTime(
+				start.setTime(
+					new Date(
+						new Date().getFullYear(),
+						new Date().getMonth(),
+						new Date().getDate() - 29
+					)
+				)
+			);
+			this.timeVal = [start, end];
+			this.formValidate.time =
+				formatDate(start, 'yyyy/MM/dd') + '-' + formatDate(end, 'yyyy/MM/dd');
+			this.onInit();
+			// 加載省市區
+			this.cityInfo({
+				pid: 0
+			},"addresData2");
+		},
+		methods: {
+			// 省市区数据
+			cityInfo(data, name) {
+				cityApi(data).then(res => {
+					this[name] = res.data
+				})
+			},
+			// 选择运营中心
+			changearea(e, type = 'reload') {
+				try {
+					console.log(type);
+					if (type == 'reload') {
+						this.addressSelectDl = [];
+					}
+					// if (type == 'init') {
+					// 	this.addressSelectDl = this.psInfo.area_provincials.split('/').map((re) => {
+					// 		return +re
+					// 	});
+					// }
+					console.log(type);
+					if (e == 3) {
+						this.cityInfo({
+							pid: 0,
+							type: 4
+						}, "addresData2")
+					} else
+					if (e == 2) {
+						this.cityInfo({
+							pid: 0,
+							type: 1
+						}, "addresData2")
+					} else
+					if (e == 1) {
+						this.cityInfo({
+							pid: 0,
+							type: 2
+						}, "addresData2")
+					}
+				} catch (e) {
+					console.log(e);
+					//TODO handle the exception
+				}
+			},
+			getCityData(item, callback, type = 0) {
+				item.loading = true;
+				cityApi({
+					pid: item.value,
+					type
+				}).then(res => {
+					item.children = res.data;
+					item.loading = false;
+					callback();
+				});
+			},
+			// 代理省市区选择
+			loadData2(item, callback) {
+				console.log(item,)
+				if (this.formValidate.area_admin == "2") {
+					this.getCityData(item, callback, 1)
+				} else if (this.formValidate.area_admin == "1") {
+					this.getCityData(item, callback, 2)
+				}
+			},
+			// 選中地址
+			addchack2(e, selectedData) {
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formValidate.order_province = selectedData[index].label
+					} else if (index == 1) {
+						this.formValidate.order_city = selectedData[index].label
+					} else if (index == 2) {
+						this.formValidate.order_district = selectedData[index].label
+					}
+				})
+				this.formValidate.area_provincials = (selectedData.map(o => o.id)).join("/");
+			},
+			onInit() {
+				this.getBasic();
+				this.getTrend();
+				this.getChannel();
+				this.getType();
+			},
+			onSelectDate(e) {
+				this.formValidate.time = e;
+				this.onInit();
+			},
+			timeG(dd) {
+				var d = new Date(dd);
+				var datetime =
+					d.getFullYear() +
+					'-' +
+					(d.getMonth() + 1) +
+					'-' +
+					d.getDate() +
+					' ' +
+					d.getHours() +
+					':' +
+					d.getMinutes() +
+					':' +
+					d.getSeconds();
+				return datetime;
+			},
+			getBasic() {
+				getBasic(this.formValidate).then((res) => {
+					let arr = [
+						'pay_count',
+						'pay_price',
+						'refund_count',
+						'refund_price',
+						'coupon_price',
+						'coupon_count',
+						'ali_pay_price',
+						'wechat_pay_price',
+						'yue_pay_price',
+						'integral_pay_price',
+						'offline_pay_price',
+						'award_price',
+					];
+					this.cardLists.map((i, index) => {
+						i.count = res.data[arr[index]];
+					});
+				});
+			},
+			getChannel() {
+				this.loading = true;
+				getChannel(this.formValidate).then((res) => {
+					this.infoList = res.data;
+					this.tabList = res.data.list;
+					this.loading = false;
+				});
+			},
+			getType() {
+				this.loading2 = true;
+				getType(this.formValidate).then((res) => {
+					this.infoList2 = res.data;
+					this.tabList2 = res.data.list;
+					this.loading2 = false;
+				});
+			},
+			selectChange(e) {
+				console.log(this.timeG(e.split(',')[0]), this.timeG(e.split(',')[1]));
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.formValidate.time = this.timeVal[0] ? this.timeVal.join('-') : '';
+				this.name = this.formValidate.time;
+				this.getBasic();
+				if (this.formValidate.time) {
+					this.getTrend();
+				}
+				this.getChannel();
+				this.getType();
+			},
+			// 统计图
+			getTrend() {
+				this.spinShow = true;
+				getTrend(this.formValidate)
+					.then(async (res) => {
+						let legend = res.data.series.map((item) => {
+							return item.name;
+						});
+						let xAxis = res.data.xAxis;
+						let col = ['#5B8FF9', '#5AD8A6', '#FFAB2B', '#5D7092'];
+						let series = [];
+						res.data.series.map((item, index) => {
+							series.push({
+								name: item.name,
+								type: 'line',
+								data: item.data,
+								itemStyle: {
+									normal: {
+										color: col[index],
+									},
+								},
+								smooth: 0,
+							});
+						});
+						this.optionData = {
+							tooltip: {
+								trigger: 'axis',
+								axisPointer: {
+									type: 'cross',
+									label: {
+										backgroundColor: '#6a7985',
+									},
+								},
+							},
+							legend: {
+								x: 'center',
+								data: legend,
+							},
+							grid: {
+								left: '3%',
+								right: '4%',
+								bottom: '3%',
+								containLabel: true,
+							},
+							toolbox: {
+								feature: {
+									saveAsImage: {},
+								},
+								right: '5%'
+							},
+							xAxis: {
+								type: 'category',
+								boundaryGap: true,
+								axisLabel: {
+									interval: 0,
+									rotate: 40,
+									textStyle: {
+										color: '#000000',
+									},
+								},
+								data: xAxis,
+							},
+							yAxis: {
+								type: 'value',
+								axisLine: {
+									show: false,
+								},
+								axisTick: {
+									show: false,
+								},
+								axisLabel: {
+									textStyle: {
+										color: '#7F8B9C',
+									},
+								},
+								splitLine: {
+									show: true,
+									lineStyle: {
+										color: '#F5F7F9',
+									},
+								},
+							},
+							series: series,
+						};
+						this.spinShow = false;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+						this.spinShow = false;
+					});
+			},
+		},
+	};
 </script>
 
 <style scoped>
-.cl {
-  margin-right: 20px;
-}
-.code-row-bg {
-  display: flex;
-  flex-wrap: nowrap;
-}
-.code-row-bg .ivu-mt {
-  width: 100%;
-  margin: 0 5px;
-}
-.ech-box {
-  margin-top: 10px;
-}
-.change-style {
-  border: 1px solid #ccc;
-  border-radius: 15px;
-  padding: 0px 10px;
-  cursor: pointer;
-}
-.percent-box {
-  display: flex;
-  align-items: center;
-  padding-right: 10px;
-}
-.line {
-  flex: 1;
-  position: relative;
-}
-.bg {
-  position: absolute;
-  width: 100%;
-  height: 8px;
-  border-radius: 8px;
-  background-color: #f2f2f2;
-}
-.percent {
-  position: absolute;
-  border-radius: 5px;
-  height: 8px;
-  background-color: cornflowerblue;
-  z-index: 9999;
-}
-.num {
-  white-space: nowrap;
-  margin: 0 0 0 10px;
-  width: 50px;
-}
-</style>
+	.cl {
+		margin-right: 20px;
+	}
+
+	.code-row-bg {
+		display: flex;
+		flex-wrap: nowrap;
+	}
+
+	.code-row-bg .ivu-mt {
+		width: 100%;
+		margin: 0 5px;
+	}
+
+	.ech-box {
+		margin-top: 10px;
+	}
+
+	.change-style {
+		border: 1px solid #ccc;
+		border-radius: 15px;
+		padding: 0px 10px;
+		cursor: pointer;
+	}
+
+	.percent-box {
+		display: flex;
+		align-items: center;
+		padding-right: 10px;
+	}
+
+	.line {
+		flex: 1;
+		position: relative;
+	}
+
+	.bg {
+		position: absolute;
+		width: 100%;
+		height: 8px;
+		border-radius: 8px;
+		background-color: #f2f2f2;
+	}
+
+	.percent {
+		position: absolute;
+		border-radius: 5px;
+		height: 8px;
+		background-color: cornflowerblue;
+		z-index: 9999;
+	}
+
+	.num {
+		white-space: nowrap;
+		margin: 0 0 0 10px;
+		width: 50px;
+	}
+</style>

+ 18 - 2
src/pages/supplier/supplier-supplier_list/index.vue

@@ -47,7 +47,9 @@
             <span slot="close">关闭</span>
           </i-switch>
         </template>
-
+		<template slot-scope="{ row, index }" slot="valid_time">
+			{{row.valid_time|formatDate}}
+		</template>
         <!-- 操作 -->
         <template slot-scope="{ row, index }" slot="action">
           <a @click="goSupplier(row)">进入</a>
@@ -83,10 +85,19 @@ import util from '@/libs/util'
 import Setting from '@/setting'
 import { supplierList, putSupplierStatus, supplierLogin } from '@/api/supplier'
 import Template from '../../setting/devise/template.vue'
+import {formatDate} from "../../../utils/validate.js"
 export default {
   name: '',
   components: { Template },
   props: {},
+  filters: {
+      formatDate(time) {
+          if (time !== 0) {
+              let date = new Date(time * 1000)
+              return formatDate(date, 'yyyy-MM-dd hh:mm')
+          }
+      }
+  },
   data() {
     return {
       roterPre: Setting.roterPre,
@@ -135,8 +146,13 @@ export default {
         {
           title: '创建时间',
           key: '_add_time',
-          minWidth: 100,
+          minWidth: 130,
         },
+		{
+		  title: '有效时间',
+		  slot: 'valid_time',
+		  minWidth: 130,
+		},
         {
           title: '备注',
           key: 'mark',

+ 321 - 361
src/pages/supplier/supplierAdd/index.vue

@@ -1,371 +1,331 @@
 <template>
-<!-- 添加供应商 -->
-  <div class="article-manager video-icon form-submit" id="shopp-manager">
-    <div class="i-layout-page-header">
-      <PageHeader class="product_tabs" hidden-breadcrumb>
-        <div slot="title" class="acea-row row-middle">
-          <router-link :to="{ path: `${roterPre}/supplier/menu/list` }">
-            <div class="font-sm after-line">
-              <span class="iconfont iconfanhui"></span>
-              <span class="pl10">返回</span>
-            </div>
-          </router-link>
-          <span
-            v-text="$route.params.id ? '编辑供应商' : '添加供应商'"
-            class="mr20 ml16"
-          ></span>
-        </div>
-      </PageHeader>
-    </div>
-    <Card :bordered="false" dis-hover class="ivu-mt">
-      <Form
-        class="formValidate mt20"
-        ref="formValidate"
-        :rules="ruleValidate"
-        :model="formValidate"
-        :label-width="width"
-        :label-position="labelPosition"
-        @submit.native.prevent
-      >
-        <Row :gutter="24" type="flex">
-          <Col span="24">
-            <FormItem label="供应商名称:" prop="supplier_name">
-              <Input
-                v-model="formValidate.supplier_name"
-                placeholder="请输入供应商名称"
-             v-width="460"
-              />
-            </FormItem>
-          </Col>
+	<!-- 添加供应商 -->
+	<div class="article-manager video-icon form-submit" id="shopp-manager">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title" class="acea-row row-middle">
+					<router-link :to="{ path: `${roterPre}/supplier/menu/list` }">
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="$route.params.id ? '编辑供应商' : '添加供应商'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form class="formValidate mt20" ref="formValidate" :rules="ruleValidate" :model="formValidate"
+				:label-width="width" :label-position="labelPosition" @submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="24">
+					<FormItem label="供应商名称:" prop="supplier_name">
+						<Input v-model="formValidate.supplier_name" placeholder="请输入供应商名称" v-width="460" />
+					</FormItem>
+					</Col>
 
-          <!-- <Row :gutter="24" type="flex"> -->
-          <Col span="24">
-            <FormItem label="联系人姓名:" prop="name">
-              <Input
-                v-model="formValidate.name"
-                placeholder="请输入联系人姓名"
-          v-width="460"
-              />
-            </FormItem>
-          </Col>
-          <!-- </Row> -->
+					<!-- <Row :gutter="24" type="flex"> -->
+					<Col span="24">
+					<FormItem label="联系人姓名:" prop="name">
+						<Input v-model="formValidate.name" placeholder="请输入联系人姓名" v-width="460" />
+					</FormItem>
+					</Col>
+					<!-- </Row> -->
 
-          <Col span="24">
-            <FormItem label="联系电话:" prop="phone">
-              <Input
-                v-model="formValidate.phone"
-                placeholder="请输入联系电话"
-               v-width="460"
-              />
-            </FormItem>
-          </Col>
+					<Col span="24">
+					<FormItem label="联系电话:" prop="phone">
+						<Input v-model="formValidate.phone" placeholder="请输入联系电话" v-width="460" />
+					</FormItem>
+					</Col>
 
-      
-          <Col span="24">
-            <FormItem label="省市区地址" prop="addressSelect">
-              <Cascader
-                :data="addresData"
-                :load-data="loadData"
-                v-model="formValidate.addressSelect"
-                @on-change="addchack"
-                v-width="460"
-              ></Cascader>
-            </FormItem>
-          </Col>
-              <Col span="24">
-            <FormItem label="供应商地址:" prop="detailed_address">
-              <Input
-                v-model="formValidate.detailed_address"
-                placeholder="请输入供应商地址"
-             v-width="460"
-              />
-            </FormItem>
-          </Col>
 
-          <Col span="24">
-            <FormItem label="供应商邮箱:" prop="email">
-              <Input
-                v-model="formValidate.email"
-                placeholder="请输入供应商邮箱"
-               v-width="460"
-              />
-            </FormItem>
-          </Col>
-          <Col span="24">
-            <FormItem label="备注:" prop="mark">
-              <Input
-                type="textarea"
-                v-model="formValidate.mark"
-                placeholder="请输入..."
-              v-width="460"
-              />
-            </FormItem>
-          </Col>
-          <Col span="24">
-            <FormItem label="供应商登录用户名:" prop="account">
-              <Input
-                v-model="formValidate.account"
-                placeholder="请输入登录名称"
-               v-width="460"
-              />
-            </FormItem>
-          </Col>
-          <Col span="24">
-            <FormItem label="供应商登录密码 :" prop="pwd">
-              <Input
-                v-model="formValidate.pwd"
-                placeholder="请输入登录密码"
-              v-width="460"
-              />
-            </FormItem>
-          </Col>
-          <Col span="24">
-            <FormItem label="确认登录密码 :" prop="conf_pwd">
-              <Input
-                v-model="formValidate.conf_pwd"
-                placeholder="请确认登录密码"
-            v-width="460"
-              />
-            </FormItem>
-          </Col>
-          <Col span="24">
-            <FormItem label="排序:">
-              <InputNumber
-               v-width="460"
-                :min="0"
-                :max="999999"
-                v-model="formValidate.sort"
-                placeholder="请输入排序"
-              />
-            </FormItem>
-          </Col>
-          <Col span="24">
-            <FormItem label="是否开启:">
-              <i-switch
-                v-model="formValidate.is_show"
-                :true-value="1"
-                :false-value="0"
-                size="large"
-              >
-                <span slot="open">开启</span>
-                <span slot="close">关闭</span>
-              </i-switch>
-            </FormItem>
-          </Col>
-        </Row>
-      </Form>
-    </Card>
-    <Card
-      :bordered="false"
-      dis-hover
-      class="fixed-card"
-      :style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }"
-    >
-      <Form>
-        <FormItem>
-          <Button
-            type="primary"
-            class="submission"
-            @click="handleSubmit('formValidate')"
-            >保存</Button
-          >
-        </FormItem>
-      </Form>
-    </Card>
-  </div>
+					<Col span="24">
+					<FormItem label="省市区地址" prop="addressSelect">
+						<Cascader :data="addresData" :load-data="loadData" v-model="formValidate.addressSelect"
+							@on-change="addchack" v-width="460"></Cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="供应商地址:" prop="detailed_address">
+						<Input v-model="formValidate.detailed_address" placeholder="请输入供应商地址" v-width="460" />
+					</FormItem>
+					</Col>
+
+					<Col span="24">
+					<FormItem label="供应商邮箱:" prop="email">
+						<Input v-model="formValidate.email" placeholder="请输入供应商邮箱" v-width="460" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="备注:" prop="mark">
+						<Input type="textarea" v-model="formValidate.mark" placeholder="请输入..." v-width="460" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="供应商登录用户名:" prop="account">
+						<Input v-model="formValidate.account" placeholder="请输入登录名称" v-width="460" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="供应商登录密码 :" prop="pwd">
+						<Input v-model="formValidate.pwd" placeholder="请输入登录密码" v-width="460" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="确认登录密码 :" prop="conf_pwd">
+						<Input v-model="formValidate.conf_pwd" placeholder="请确认登录密码" v-width="460" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="排序:">
+						<InputNumber v-width="460" :min="0" :max="999999" v-model="formValidate.sort"
+							placeholder="请输入排序" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="有效期:" prop="valid_time">
+						<DatePicker :editable="false" type="date" format="yyyy-MM-dd HH:mm"
+							placeholder="请选择活动时间" @on-change="onchangeTime" class="perW30"
+							v-model="formValidate.valid_time"></DatePicker>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="是否开启:">
+						<i-switch v-model="formValidate.is_show" :true-value="1" :false-value="0" size="large">
+							<span slot="open">开启</span>
+							<span slot="close">关闭</span>
+						</i-switch>
+					</FormItem>
+					</Col>
+				</Row>
+			</Form>
+		</Card>
+		<Card :bordered="false" dis-hover class="fixed-card"
+			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
+			<Form>
+				<FormItem>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+	</div>
 </template>
 <script>
-import { mapState, mapMutations } from 'vuex'
-import { getSupplier, addSupplier, putSupplier } from '@/api/supplier'
-import { cityApi } from '@/api/store'
-import Setting from "@/setting";
-export default {
-  name: '',
-  components: {},
-  props: {},
-  data() {
-    return {
-      roterPre: Setting.roterPre,
-      width: 150,
-      addresData: [],
-      formValidate: {
-        supplier_name: '',
-        name: '',
-        phone: '',
-        detailed_address: '',
-        address: '',
-        addressSelect: [],
-        email: '',
-        mark: '',
-        account: '',
-        pwd: '',
-        conf_pwd: '',
-        is_show: 0,
-        province: 0,
-        city: 0,
-        area: 0,
-        street: 0,
-      },
-      ruleValidate: {
-        supplier_name: [
-          {
-            required: true,
-            message: '供应商不能为空',
-            trigger: 'blur',
-          },
-        ],
-        phone: [
-          { required: true, message: '联系电话不能为空', trigger: 'blur' },
-          {
-            pattern: /^1[3456789]\d{9}$/,
-            message: '手机号码格式不正确',
-            trigger: 'blur',
-          },
-        ],
-        account: [
-          {
-            required: true,
-            message: '请输入用户名',
-            trigger: 'blur',
-          },
-        ],
-        address: [
-          {
-            required: true,
-            message: '请填写具体地址',
-            trigger: 'blur',
-          },
-        ],
-        addressSelect: [
-          {
-            required: true,
-            message: '请选择省市区',
-            trigger: 'blur',
-          },
-        ],
-        pwd: [
-          {
-            required: true,
-            message: '请输入密码',
-            trigger: 'blur',
-          },
-        ],
-        conf_pwd: [
-          {
-            required: true,
-            message: '密码不能为空',
-            trigger: 'blur',
-          },
-        ],
-      },
-    }
-  },
-  computed: {
-    ...mapState('admin/layout', ['isMobile', 'menuCollapse']),
-    labelPosition() {
-      return this.isMobile ? 'top' : 'right'
-    },
-  },
-  watch: {},
-  created() {
-    let data = { pid: 0 }
-    this.cityInfo(data)
-    if (this.$route.params.id) {
-      this.getSupplier()
-    }
-  },
-  mounted() {},
-  methods: {
-    // 获取省市区
-    cityInfo(data) {
-      cityApi(data).then((res) => {
-        this.addresData = res.data
-      })
-    },
-    loadData(item, callback) {
-      item.loading = true
-      cityApi({ pid: item.value }).then((res) => {
-        item.children = res.data
-        item.loading = false
-        callback()
-      })
-    },
-    // 选择省市区
-    addchack(e, selectedData) {
-      e.forEach((i, index) => {
-        if (index == 0) {
-          this.formValidate.province = i
-        } else if (index == 1) {
-          this.formValidate.city = i
-        } else if (index == 2) {
-          this.formValidate.area = i
-        } else {
-          this.formValidate.street = i
-        }
-      })
-      (this.formValidate.addressSelect)
-      this.formValidate.address = selectedData.map((o) => o.label).join('')
-    },
-    // 添加供应商
-    handleSubmit() {
-      if (this.$route.params.id) {
-        putSupplier(this.$route.params.id,this.formValidate)
-          .then(async (res) => {
-               this.$Message.success(res.msg)
-                   this.$router.push({ path: this.roterPre + '/supplier/menu/list' })
-          })
-          .catch((res) => {
-            this.$Message.error(res.msg)
-          })
-      } else {
-        addSupplier(this.formValidate)
-          .then(async (res) => {
-            this.$Message.success(res.msg)
-            this.$router.push({ path: this.roterPre + '/supplier/menu/list' })
-          })
-          .catch((res) => {
-            this.$Message.error(res.msg)
-            
-          })
-      }
-    },
-    // 获取供应商信息
-    getSupplier() {
-      getSupplier(this.$route.params.id)
-        .then(async (res) => {
-          this.formValidate = res.data
-          let addressSelect = []
-          if (res.data.province) {
-            addressSelect.push(res.data.province)
-          }
-          if (res.data.city) {
-            addressSelect.push(res.data.city)
-          }
-          if (res.data.area) {
-            addressSelect.push(res.data.area)
-          }
-          if (res.data.street) {
-            addressSelect.push(res.data.street)
-          }
-          this.formValidate.addressSelect = addressSelect
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg)
-        })
-    },
-  },
-}
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
+	import {
+		getSupplier,
+		addSupplier,
+		putSupplier
+	} from '@/api/supplier'
+	import {
+		cityApi
+	} from '@/api/store'
+	import Setting from "@/setting";
+	export default {
+		name: '',
+		components: {},
+		props: {},
+		data() {
+			return {
+				roterPre: Setting.roterPre,
+				width: 150,
+				addresData: [],
+				formValidate: {
+					valid_time: '',
+					supplier_name: '',
+					name: '',
+					phone: '',
+					detailed_address: '',
+					address: '',
+					addressSelect: [],
+					email: '',
+					mark: '',
+					account: '',
+					pwd: '',
+					conf_pwd: '',
+					is_show: 0,
+					province: 0,
+					city: 0,
+					area: 0,
+					street: 0,
+				},
+				ruleValidate: {
+					supplier_name: [{
+						required: true,
+						message: '供应商不能为空',
+						trigger: 'blur',
+					}, ],
+					phone: [{
+							required: true,
+							message: '联系电话不能为空',
+							trigger: 'blur'
+						},
+						{
+							pattern: /^1[3456789]\d{9}$/,
+							message: '手机号码格式不正确',
+							trigger: 'blur',
+						},
+					],
+					account: [{
+						required: true,
+						message: '请输入用户名',
+						trigger: 'blur',
+					}, ],
+					address: [{
+						required: true,
+						message: '请填写具体地址',
+						trigger: 'blur',
+					}, ],
+					addressSelect: [{
+						required: true,
+						message: '请选择省市区',
+						trigger: 'blur',
+					}, ],
+					pwd: [{
+						required: true,
+						message: '请输入密码',
+						trigger: 'blur',
+					}, ],
+					conf_pwd: [{
+						required: true,
+						message: '密码不能为空',
+						trigger: 'blur',
+					}, ],
+					valid_time:[{
+						required: true,
+						message: '请选择时间',
+						trigger: 'blur',
+					}, ]
+				},
+			}
+		},
+		computed: {
+			...mapState('admin/layout', ['isMobile', 'menuCollapse']),
+			labelPosition() {
+				return this.isMobile ? 'top' : 'right'
+			},
+		},
+		watch: {},
+		created() {
+			let data = {
+				pid: 0
+			}
+			this.cityInfo(data)
+			if (this.$route.params.id) {
+				this.getSupplier()
+			}
+		},
+		mounted() {},
+		methods: {
+			// 具体日期
+			onchangeTime(e) {
+				this.$nextTick(() => {
+					this.$set(this.formValidate, "valid_time", e);
+				});
+			},
+			// 获取省市区
+			cityInfo(data) {
+				cityApi(data).then((res) => {
+					this.addresData = res.data
+				})
+			},
+			loadData(item, callback) {
+				item.loading = true
+				cityApi({
+					pid: item.value
+				}).then((res) => {
+					item.children = res.data
+					item.loading = false
+					callback()
+				})
+			},
+			// 选择省市区
+			addchack(e, selectedData) {
+				e.forEach((i, index) => {
+						if (index == 0) {
+							this.formValidate.province = i
+						} else if (index == 1) {
+							this.formValidate.city = i
+						} else if (index == 2) {
+							this.formValidate.area = i
+						} else {
+							this.formValidate.street = i
+						}
+					})
+					(this.formValidate.addressSelect)
+				this.formValidate.address = selectedData.map((o) => o.label).join('')
+			},
+			// 添加供应商
+			handleSubmit() {
+				if (this.$route.params.id) {
+					putSupplier(this.$route.params.id, this.formValidate)
+						.then(async (res) => {
+							this.$Message.success(res.msg)
+							this.$router.push({
+								path: this.roterPre + '/supplier/menu/list'
+							})
+						})
+						.catch((res) => {
+							this.$Message.error(res.msg)
+						})
+				} else {
+					addSupplier(this.formValidate)
+						.then(async (res) => {
+							this.$Message.success(res.msg)
+							this.$router.push({
+								path: this.roterPre + '/supplier/menu/list'
+							})
+						})
+						.catch((res) => {
+							this.$Message.error(res.msg)
+
+						})
+				}
+			},
+			// 获取供应商信息
+			getSupplier() {
+				getSupplier(this.$route.params.id)
+					.then(async (res) => {
+						this.formValidate = res.data
+						let addressSelect = []
+						if (res.data.province) {
+							addressSelect.push(res.data.province)
+						}
+						if (res.data.city) {
+							addressSelect.push(res.data.city)
+						}
+						if (res.data.area) {
+							addressSelect.push(res.data.area)
+						}
+						if (res.data.street) {
+							addressSelect.push(res.data.street)
+						}
+						this.formValidate.addressSelect = addressSelect
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg)
+					})
+			},
+		},
+	}
 </script>
 <style scoped lang="less">
-.fixed-card {
-  position: fixed;
-  right: 0;
-  bottom: 0;
-  left: 200px;
-  z-index: 99;
-  box-shadow: 0 -1px 2px rgb(240, 240, 240);
-}
-.submission {
-  margin-left: 50%;
-}
+	.fixed-card {
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 200px;
+		z-index: 99;
+		box-shadow: 0 -1px 2px rgb(240, 240, 240);
+	}
+
+	.submission {
+		margin-left: 50%;
+	}
+	#shopp-manager{
+		padding-bottom:85px ;
+	}
 </style>

+ 95 - 39
src/pages/user/list/handle/userDetails.vue

@@ -70,6 +70,26 @@
 								<Button type="success" v-if="row.status==1" >已出局</Button>
 							</div>
 						</template>
+						<template slot-scope="{ row }" slot="sent_day">
+							<div>
+								{{(row.sent_day)}} / {{row.send_day}}天
+							</div>
+						</template>
+						<template slot-scope="{ row }" slot="extracted_num">
+							<div>
+								{{row.extracted_num}} / {{row.sent_num}}
+							</div>
+						</template>
+						<template slot-scope="{ row }" slot="reorder_count">
+							<div>
+								{{row.reorder_count}}次
+							</div>
+						</template>
+						<!-- <template slot-scope="{ row }" slot="addTIme">
+							<div>
+								{{item.add_time|formatDate}}
+							</div>
+						</template> -->
                     </Table>
                     <div class="acea-row row-right page">
                         <Page :total="total" :current.sync="userFrom.page" show-elevator show-total @on-change="pageChange" :page-size="userFrom.limit"  />
@@ -117,13 +137,21 @@
     import { detailsApi, infoApi, visitList, spreadList } from '@/api/user';
     import userForm from './userForm';
     import userInfo from './userInfo';
-
+import {formatDate} from "@/utils/validate.js"
     export default {
         name: 'userDetails',
         components: {
             userForm,
             userInfo
         },
+		filters: {
+		    formatDate(time) {
+		        if (time !== 0) {
+		            let date = new Date(time * 1000)
+		            return formatDate(date, 'yyyy-MM-dd hh:mm')
+		        }
+		    }
+		},
         props: ['levelList', 'labelList', 'groupList', 'fromType'],
         data () {
             return {
@@ -135,8 +163,8 @@
                     { val: 'sign', label: '签到记录' },
                     { val: 'coupon', label: '持有优惠券' },
                     { val: 'balance_change', label: '余额变动' },
-                    { val: 'static_integral', label: '消费分' },
                     { val: 'action_integral', label: '贡献分' },
+                    { val: 'award_integral', label: '参考分' },
                     { val: 'energy', label: '能量值' },
                     { val: 'spread', label: '好友关系' },
                     { val: 'visit', label: '浏览足迹' },
@@ -375,6 +403,29 @@
                         let data = res.data
                         this.userLists = data.list;
                         this.total = data.count;
+						if(this.userFrom.type=='award_integral'){
+							this.userLists = data.list.map((e)=>{
+							e.up_speed = +e.up_speed;
+							e.day_send = +e.day_send;
+							e.extract_num = +e.extract_num;
+							e.sent_num = +e.sent_num;
+							e.num = +e.num;
+							e.extracted_num = +e.extracted_num;
+							e.computedNum = 0;
+							if (e.up_speed > 0) {
+								if (e.send_day > e.sent_day) {
+									e.computedNum = (e.up_speed - e.up_speed_used) / (e.send_day - e
+										.sent_day)
+								}
+							}
+							e.sendValue = (e.day_send+e.computedNum).toFixed(2) * 1;
+							return e
+					});
+						}else{
+							this.userLists = data.list;
+						}
+						
+						
                         switch (this.userFrom.type) {
                         case 'order':
                             this.columns = [
@@ -463,20 +514,20 @@
                                 }
                             ]
                             break;
-						case 'static_integral':
+						case 'action_integral':
 						    this.columns = [
-						        {
-						            title: '获得数量',
-						            key: 'num',
-						            minWidth: 100
-						        },
+						        // {
+						        //     title: '获得数量',
+						        //     key: 'num',
+						        //     minWidth: 100
+						        // },
+								// {
+								//     title: '进场价格',
+								//     key: 'price',
+								//     minWidth: 120
+								// },
 								{
-								    title: '进场价格',
-								    key: 'price',
-								    minWidth: 120
-								},
-								{
-								    title: '出局总价',
+								    title: '奖励金额',
 								    key: 'extract_sum',
 								    minWidth: 120
 								},
@@ -490,45 +541,50 @@
 						            key: 'mark',
 						            minWidth: 120
 						        },
-								{
-								    title: '状态',
-								    slot: 'status_type',
-								    minWidth: 80
-								}
+								// {
+								//     title: '状态',
+								//     slot: 'status_type',
+								//     minWidth: 80
+								// }
 						    ]
 						    break;
-						case 'action_integral':
+						case 'award_integral':
 						    this.columns = [
 						        {
-						            title: '获得数量',
-						            key: 'num',
-						            minWidth: 100
+						            title: '说明',
+						            key: 'mark',
+						            minWidth: 120
 						        },
 								{
-								    title: '进场价格',
-								    key: 'price',
-								    minWidth: 120
+								    title: '释放',
+								     slot: 'sent_day',
+								    minWidth: 80
 								},
 								{
-								    title: '出局总价',
-								    key: 'extract_sum',
-								    minWidth: 120
+								    title: '释放值',
+								    key: 'sendValue',
+								    minWidth: 59
+								},
+								{
+								    title: '提取',
+								     slot: 'extracted_num',
+								    minWidth: 100
 								},
 						        {
-						            title: '获得时间',
-						            key: '_add_time',
-						            minWidth: 100
+						            title: '复投',
+						            slot: 'reorder_count',
+						            minWidth: 50
 						        },
+								{
+								    title: '总量',
+								    key: 'num',
+								    minWidth: 50
+								},
 						        {
-						            title: '备注',
-						            key: 'mark',
+						            title: '购买时间',
+						            key: '_add_time',
 						            minWidth: 120
 						        },
-								{
-								    title: '状态',
-								    slot: 'status_type',
-								    minWidth: 80
-								}
 						    ]
 						    break;
 						case 'energy':

+ 2 - 2
src/pages/user/list/index.vue

@@ -459,8 +459,8 @@
         <vxe-column field="user_type" title="用户类型" min-width="100"></vxe-column>
         <vxe-column field="spread_uid_nickname" title="推荐人" min-width="100"></vxe-column>
         <vxe-column field="now_money" title="余额" min-width="100"></vxe-column>
-        <vxe-column field="static_integral" title="消费分" min-width="100"></vxe-column>
-        <vxe-column field="action_integral" title="贡献分" min-width="100"></vxe-column>
+        <!-- <vxe-column field="static_integral" title="消费分" min-width="100"></vxe-column> -->
+        <!-- <vxe-column field="action_integral" title="贡献分" min-width="100"></vxe-column> -->
         <vxe-column field="energy" title="能量值" min-width="100"></vxe-column>
         <vxe-column field="action" title="操作" align="center" width="180" fixed="right">
           <template v-slot="{ row }">