cmy 1 vuosi sitten
vanhempi
commit
5435e6f89f

+ 10 - 5
src/api/agent.js

@@ -1,8 +1,3 @@
-
-
-
-
-
 import request from '@/plugins/request';
 
 /**
@@ -100,3 +95,13 @@ export function agentSpreadApi (data) {
         data
     })
 }
+/**
+ * @description 分销 -- 团队统计
+ */
+export function performanceList (data) {
+    return request({
+        url: `agent/performance`,
+        method: 'get',
+        params: data
+    });
+}

+ 291 - 251
src/api/order.js

@@ -1,4 +1,3 @@
-
 import request from '@/plugins/request';
 
 /**
@@ -6,11 +5,11 @@ import request from '@/plugins/request';
  * @param {Object} param data {Object} 传值参数
  */
 export function orderList(data) {
-    return request({
-        url: '/order/list',
-        method: 'get',
-        params: data
-    });
+	return request({
+		url: '/order/list',
+		method: 'get',
+		params: data
+	});
 };
 
 /**
@@ -18,22 +17,22 @@ export function orderList(data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function getOrdes(data) {
-    return request({
-        url: '/order/chart',
-        method: 'get',
-        params: data
-    });
+	return request({
+		url: '/order/chart',
+		method: 'get',
+		params: data
+	});
 };
 
 /**
  * @description 积分商城订单 -- 导出
  */
 export function storeIntegralOrder(data) {
-    return request({
-        url: `export/storeIntegralOrder`,
-        method: 'get',
-        params: data
-    });
+	return request({
+		url: `export/storeIntegralOrder`,
+		method: 'get',
+		params: data
+	});
 }
 
 /**
@@ -41,10 +40,10 @@ export function storeIntegralOrder(data) {
  * @param {Number} param id {Number} 订单id
  */
 export function getOrdeDatas(id) {
-    return request({
-        url: `/order/edit/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/edit/${id}`,
+		method: 'get'
+	});
 };
 
 /**
@@ -52,21 +51,21 @@ export function getOrdeDatas(id) {
  * @param {Number} param id {Number} 订单id
  */
 export function getDataInfo(id) {
-    return request({
-        url: `/order/info/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/info/${id}`,
+		method: 'get'
+	});
 };
 
 /**
  * @description 订单表单详情数据-退款详情
  * @param {Number} param id {Number} 订单id
  */
- export function getRefundDataInfo (id) {
-    return request({
-        url: `/refund/detail/${id}`,
-        method: 'get'
-    })
+export function getRefundDataInfo(id) {
+	return request({
+		url: `/refund/detail/${id}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -75,11 +74,11 @@ export function getDataInfo(id) {
  * @param {String} param data.remark {String} 备注信息
  */
 export function putRemarkData(data) {
-    return request({
-        url: `/order/remark/${data.id}`,
-        method: 'put',
-        data: data.remark
-    });
+	return request({
+		url: `/order/remark/${data.id}`,
+		method: 'put',
+		data: data.remark
+	});
 };
 
 /**
@@ -87,12 +86,12 @@ export function putRemarkData(data) {
  * @param {Number} param data.id {Number} 订单id
  * @param {String} param data.remark {String} 备注信息
  */
- export function putRefundRemarkData(data) {
-    return request({
-        url: `/refund/remark/${data.id}`,
-        method: 'put',
-        data: data.remark
-    });
+export function putRefundRemarkData(data) {
+	return request({
+		url: `/refund/remark/${data.id}`,
+		method: 'put',
+		data: data.remark
+	});
 };
 
 /**
@@ -101,11 +100,11 @@ export function putRemarkData(data) {
  * @param {String} param data.datas {String} 分页参数
  */
 export function getOrderRecord(data) {
-    return request({
-        url: `/order/status/${data.id}`,
-        method: 'get',
-        params: data.datas
-    });
+	return request({
+		url: `/order/status/${data.id}`,
+		method: 'get',
+		params: data.datas
+	});
 };
 
 /**
@@ -113,31 +112,31 @@ export function getOrderRecord(data) {
  * @param {Number} param id {Number} 订单id
  */
 export function getRefundFrom(id) {
-    return request({
-        url: `/order/refund/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/refund/${id}`,
+		method: 'get'
+	});
 };
 
 /**
  * @description 获取售后退款表单数据
  * @param {Number} param id {Number} 订单id
  */
- export function getRefundOrderFrom(id) {
-    return request({
-        url: `/refund/refund/${id}`,
-        method: 'get'
-    });
+export function getRefundOrderFrom(id) {
+	return request({
+		url: `/refund/refund/${id}`,
+		method: 'get'
+	});
 };
 
 /**
  * @description 获取快递公司
  */
 export function getExpressData(status) {
-    return request({
-        url: `/order/express_list?status=` + status,
-        method: 'get'
-    })
+	return request({
+		url: `/order/express_list?status=` + status,
+		method: 'get'
+	})
 };
 
 /**
@@ -145,10 +144,10 @@ export function getExpressData(status) {
  * @param {Number} param id {Number} 订单id
  */
 export function getnoRefund(id) {
-    return request({
-        url: `/order/no_refund/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/no_refund/${id}`,
+		method: 'get'
+	});
 };
 
 /**
@@ -157,11 +156,11 @@ export function getnoRefund(id) {
  * @param {Object} param data.datas {Object} 表单信息
  */
 export function putDelivery(data) {
-    return request({
-        url: `/order/delivery/${data.id}`,
-        method: 'put',
-        data: data.datas
-    });
+	return request({
+		url: `/order/delivery/${data.id}`,
+		method: 'put',
+		data: data.datas
+	});
 };
 
 /**
@@ -170,11 +169,11 @@ export function putDelivery(data) {
  * @param {Object} param data.datas {Object} 表单信息
  */
 export function splitDelivery(data) {
-    return request({
-        url: `/order/split_delivery/${data.id}`,
-        method: 'put',
-        data: data.datas
-    });
+	return request({
+		url: `/order/split_delivery/${data.id}`,
+		method: 'put',
+		data: data.datas
+	});
 };
 
 /**
@@ -182,10 +181,10 @@ export function splitDelivery(data) {
  * @param {Number} param id {Number} 订单id
  */
 export function refundIntegral(id) {
-    return request({
-        url: `/order/refund_integral/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/refund_integral/${id}`,
+		method: 'get'
+	});
 };
 
 /**
@@ -194,10 +193,10 @@ export function refundIntegral(id) {
  * @param {String} param method {String} 请求方式
  */
 export function payOffline(path, method) {
-    return request({
-        url: path,
-        method: method
-    });
+	return request({
+		url: path,
+		method: method
+	});
 };
 
 /**
@@ -205,10 +204,10 @@ export function payOffline(path, method) {
  * @param {Number} param id {Number} 订单id
  */
 export function getDistribution(id) {
-    return request({
-        url: `/order/distribution/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/distribution/${id}`,
+		method: 'get'
+	});
 };
 
 /**
@@ -216,10 +215,10 @@ export function getDistribution(id) {
  * @param {Number} param id {Number} 订单id
  */
 export function getExpress(id) {
-    return request({
-        url: `/order/express/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/express/${id}`,
+		method: 'get'
+	});
 };
 
 /**
@@ -227,32 +226,32 @@ export function getExpress(id) {
  * @param {String} param data {String} 核销内容
  */
 export function putWrite(data) {
-    return request({
-        url: '/order/write',
-        method: 'post',
-        data: data
-    });
+	return request({
+		url: '/order/write',
+		method: 'post',
+		data: data
+	});
 }
 
 /**
  * @description 订单管理 -- 导出
  */
 export function storeOrderApi(data) {
-    return request({
-        url: `export/storeOrder`,
-        method: 'get',
-        params: data
-    });
+	return request({
+		url: `export/storeOrder`,
+		method: 'get',
+		params: data
+	});
 }
 
 /**
  * @description 订单核销
  */
 export function writeUpdate(id) {
-    return request({
-        url: `/order/write_update/${id}`,
-        method: 'put'
-    });
+	return request({
+		url: `/order/write_update/${id}`,
+		method: 'put'
+	});
 }
 
 /**
@@ -260,52 +259,52 @@ export function writeUpdate(id) {
  * @param {com} data 快递公司编号
  */
 export function orderExpressTemp(data) {
-    return request({
-        url: '/order/express/temp',
-        method: 'get',
-        params: data
-    });
+	return request({
+		url: '/order/express/temp',
+		method: 'get',
+		params: data
+	});
 }
 
 /**
  * 配送员列表
  */
 export function orderDeliveryIndex() {
-    return request({
-        url: '/order/delivery/index',
-        method: 'get'
-    });
+	return request({
+		url: '/order/delivery/index',
+		method: 'get'
+	});
 }
 
 /**
  * 所有配送员列表
  */
 export function deliveryList(data) {
-    return request({
-        url: '/order/delivery/index',
-        method: 'get',
-        params: data
-    });
+	return request({
+		url: '/order/delivery/index',
+		method: 'get',
+		params: data
+	});
 }
 
 /**
  * 订单时获取所有配送员列表
  */
 export function orderDeliveryList() {
-    return request({
-        url: '/order/delivery/list',
-        method: 'get'
-    });
+	return request({
+		url: '/order/delivery/list',
+		method: 'get'
+	});
 }
 
 /**
  * 新增配送员表单
  */
 export function orderDeliveryAdd() {
-    return request({
-        url: '/order/delivery/add',
-        method: 'get'
-    });
+	return request({
+		url: '/order/delivery/add',
+		method: 'get'
+	});
 }
 
 /**
@@ -313,10 +312,10 @@ export function orderDeliveryAdd() {
  * @param {*} id id
  */
 export function orderDeliveryEdit(id) {
-    return request({
-        url: `/order/delivery/${id}/edit`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/delivery/${id}/edit`,
+		method: 'get'
+	});
 }
 
 /**
@@ -324,10 +323,10 @@ export function orderDeliveryEdit(id) {
  * @param {*} id id
  */
 export function orderDeliveryDel(id) {
-    return request({
-        url: `/order/delivery/del/${id}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/delivery/del/${id}`,
+		method: 'get'
+	});
 }
 
 /**
@@ -335,39 +334,39 @@ export function orderDeliveryDel(id) {
  * @param {*} data data
  */
 export function orderDeliveryStatus(data) {
-    return request({
-        url: `/order/delivery/set_status/${data.id}/${data.status}`,
-        method: 'get'
-    });
+	return request({
+		url: `/order/delivery/set_status/${data.id}/${data.status}`,
+		method: 'get'
+	});
 }
 
 export function orderSheetInfo() {
-    return request({
-        url: '/order/sheet_info',
-        method: 'get'
-    });
+	return request({
+		url: '/order/sheet_info',
+		method: 'get'
+	});
 }
 
 /**
  * 收银订单
  */
 export function orderScanList(data) {
-    return request({
-        url: 'order/scan_list',
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: 'order/scan_list',
+		method: 'get',
+		params: data
+	})
 }
 
 /**
  * 线下收款码
  */
 export function orderOfflineScan(id) {
-    return request({
-        url: 'order/offline_scan',
-        method: 'get',
-        params: id
-    })
+	return request({
+		url: 'order/offline_scan',
+		method: 'get',
+		params: id
+	})
 }
 
 /**
@@ -375,10 +374,10 @@ export function orderOfflineScan(id) {
  * @param {Object} param data {Object} 传值参数
  */
 export function orderInvoiceChart() {
-    return request({
-        url: 'order/invoice/chart',
-        method: 'get'
-    })
+	return request({
+		url: 'order/invoice/chart',
+		method: 'get'
+	})
 };
 
 /**
@@ -386,11 +385,11 @@ export function orderInvoiceChart() {
  * @param {Object} param data {Object} 传值参数
  */
 export function orderInvoiceList(data) {
-    return request({
-        url: 'order/invoice/list',
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: 'order/invoice/list',
+		method: 'get',
+		params: data
+	})
 };
 
 /**
@@ -398,11 +397,11 @@ export function orderInvoiceList(data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function orderInvoiceSet(id, data) {
-    return request({
-        url: `order/invoice/set/${id}`,
-        method: 'post',
-        data
-    })
+	return request({
+		url: `order/invoice/set/${id}`,
+		method: 'post',
+		data
+	})
 };
 
 /**
@@ -410,10 +409,10 @@ export function orderInvoiceSet(id, data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function orderInvoiceInfo(id) {
-    return request({
-        url: `order/invoice_order_info/${id}`,
-        method: 'get'
-    })
+	return request({
+		url: `order/invoice_order_info/${id}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -421,11 +420,11 @@ export function orderInvoiceInfo(id) {
  * @param {Object} param data {Object} 传值参数
  */
 export function handBatchDelivery(data) {
-    return request({
-        url: 'order/hand/batch_delivery',
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: 'order/hand/batch_delivery',
+		method: 'get',
+		params: data
+	})
 };
 
 /**
@@ -433,11 +432,11 @@ export function handBatchDelivery(data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function otherBatchDelivery(data) {
-    return request({
-        url: 'order/other/batch_delivery',
-        method: 'post',
-        data
-    })
+	return request({
+		url: 'order/other/batch_delivery',
+		method: 'post',
+		data
+	})
 };
 
 /**
@@ -445,11 +444,11 @@ export function otherBatchDelivery(data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function queueIndex(data) {
-    return request({
-        url: 'queue/index',
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: 'queue/index',
+		method: 'get',
+		params: data
+	})
 };
 
 /**
@@ -457,11 +456,11 @@ export function queueIndex(data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function deliveryLog(id, type, data) {
-    return request({
-        url: `queue/delivery/log/${id}/${type}`,
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: `queue/delivery/log/${id}/${type}`,
+		method: 'get',
+		params: data
+	})
 };
 
 /**
@@ -469,10 +468,10 @@ export function deliveryLog(id, type, data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function queueAgain(id, type) {
-    return request({
-        url: `queue/again/do_queue/${id}/${type}`,
-        method: 'get'
-    })
+	return request({
+		url: `queue/again/do_queue/${id}/${type}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -480,10 +479,10 @@ export function queueAgain(id, type) {
  * @param {Object} param data {Object} 传值参数
  */
 export function queueDel(id, type) {
-    return request({
-        url: `queue/del/wrong_queue/${id}/${type}`,
-        method: 'get'
-    })
+	return request({
+		url: `queue/del/wrong_queue/${id}/${type}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -491,10 +490,10 @@ export function queueDel(id, type) {
  * @param {Object} param data {Object} 传值参数
  */
 export function queueRepair(id, type) {
-    return request({
-        url: `queue/repair/wrong_queue/${id}/${type}`,
-        method: 'get'
-    })
+	return request({
+		url: `queue/repair/wrong_queue/${id}/${type}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -502,10 +501,10 @@ export function queueRepair(id, type) {
  * @param {Object} param data {Object} 传值参数
  */
 export function batchOrderDelivery(id, type, catchType) {
-    return request({
-        url: `export/batchOrderDelivery/${id}/${type}/${catchType}`,
-        method: 'get'
-    })
+	return request({
+		url: `export/batchOrderDelivery/${id}/${type}/${catchType}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -513,10 +512,10 @@ export function batchOrderDelivery(id, type, catchType) {
  * @param {Object} param data {Object} 传值参数
  */
 export function exportExpressList(id) {
-    return request({
-        url: 'export/expressList',
-        method: 'get'
-    })
+	return request({
+		url: 'export/expressList',
+		method: 'get'
+	})
 };
 
 /**
@@ -524,10 +523,10 @@ export function exportExpressList(id) {
  * @param {Object} param data {Object} 传值参数
  */
 export function stopWrongQueue(id) {
-    return request({
-        url: `queue/stop/wrong_queue/${id}`,
-        method: 'get'
-    })
+	return request({
+		url: `queue/stop/wrong_queue/${id}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -535,20 +534,20 @@ export function stopWrongQueue(id) {
  * @param {Object} param data {Object} 传值参数
  */
 export function splitCartInfo(id) {
-    return request({
-        url: `order/split_cart_info/${id}`,
-        method: 'get'
-    })
+	return request({
+		url: `order/split_cart_info/${id}`,
+		method: 'get'
+	})
 };
 /**
  * @description 提醒发货
  * @param {Object} param data {Object} 传值参数
  */
 export function remindOrder(data) {
-    return request({
-        url: `order/deliver_remind/${data.supplier_id}/${data.id}`,
-        method: 'put',
-    })
+	return request({
+		url: `order/deliver_remind/${data.supplier_id}/${data.id}`,
+		method: 'put',
+	})
 };
 
 /**
@@ -556,10 +555,10 @@ export function remindOrder(data) {
  * @param {Object} param data {Object} 传值参数
  */
 export function splitOrderList(id) {
-    return request({
-        url: `order/split_order/${id}`,
-        method: 'get'
-    })
+	return request({
+		url: `order/split_order/${id}`,
+		method: 'get'
+	})
 };
 
 /**
@@ -567,11 +566,13 @@ export function splitOrderList(id) {
  * @param {Object} param data {Object} 传值参数
  */
 export function distributionOrder(id) {
-    return request({
-        url: `/order/distribution_info`,
-        method: 'get',
-        params:{ids:id}
-    })
+	return request({
+		url: `/order/distribution_info`,
+		method: 'get',
+		params: {
+			ids: id
+		}
+	})
 };
 
 /**
@@ -579,11 +580,11 @@ export function distributionOrder(id) {
  * @param {Object} param data {Object} 传值参数
  */
 export function orderRefundList(data) {
-    return request({
-        url: 'refund/list',
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: 'refund/list',
+		method: 'get',
+		params: data
+	})
 };
 
 ///export/invoiceExport
@@ -591,12 +592,12 @@ export function orderRefundList(data) {
  * @description 发票导出
  * @param {Object} param data {Object} 传值参数
  */
- export function exportInvoiceList(data) {
-    return request({
-        url: 'export/invoiceExport',
-        method: 'get',
-        params: data
-    })
+export function exportInvoiceList(data) {
+	return request({
+		url: 'export/invoiceExport',
+		method: 'get',
+		params: data
+	})
 };
 
 
@@ -604,12 +605,12 @@ export function orderRefundList(data) {
  * @description 发货记录
  * @param {Object} param data {Object} 传值参数
  */
- export function splitOrder(id,data) {
-    return request({
-        url: 'order/split_order/'+id,
-        method: 'get',
-				params: data	
-    })
+export function splitOrder(id, data) {
+	return request({
+		url: 'order/split_order/' + id,
+		method: 'get',
+		params: data
+	})
 };
 
 /**
@@ -618,9 +619,48 @@ export function orderRefundList(data) {
  * @returns 
  */
 export function putOpenRefund(data) {
-  return request({
-      url: `/order/open/refund/${data.id}`,
-      method: 'post',
-      data
-  })
+	return request({
+		url: `/order/open/refund/${data.id}`,
+		method: 'post',
+		data
+	})
+};
+
+/**
+ * 货架订单
+ * @param {*} data 
+ * @returns 
+ */
+export function shelves_log(data) {
+	return request({
+		url: `/store/shelves_log`,
+		method: 'get',
+		params: data
+	})
+};
+
+/**
+ * 优先单审核列表
+ * @param {*} data 
+ * @returns 
+ */
+export function first_list(data) {
+	return request({
+		url: `/store/first/list`,
+		method: 'get',
+		params: data
+	})
+};
+
+/**
+ * 优先单审核
+ * @param {*} data 
+ * @returns 
+ */
+export function first_examine(data) {
+	return request({
+		url: `/store/first/examine`,
+		method: 'post',
+		data
+	})
 };

+ 603 - 659
src/pages/agent/agentManage.vue

@@ -1,680 +1,624 @@
 <template>
-<!-- 分销-分销员管理 -->
-  <div>
-    <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
-      <div class="new_card_pd">
-        <!-- 查询条件 -->
-        <Form
-        ref="formValidate"
-        :model="formValidate"
-        :label-width="labelWidth"
-        :label-position="labelPosition"
-        @submit.native.prevent
-        inline
-      >
-            <FormItem label="时间选择:">
-              <DatePicker
-                :editable="false"
-                @on-change="onchangeTime"
-                :value="timeVal"
-                format="yyyy/MM/dd"
-                type="datetimerange"
-                placement="bottom-start"
-                placeholder="自定义时间"
-                class="input-add"
-                :options="options"
-              ></DatePicker>
-            </FormItem>
-            <FormItem label="搜索:" label-for="status">
-              <Input
-                placeholder="请输入用户信息、电话、ID"
-                v-model="formValidate.nickname"
-                class="input-add mr14"
-              />
-              <Button 
-              type="primary" 
-              @click="userSearchs"
-              class="mr14"
-            >查询</Button>
-            <Button
-              v-auth="['export-userAgent']"
-              class="export"
-              @click="exports"
-              >导出</Button>
-            </FormItem>
-      </Form>
-      </div>
-    </Card>
-    <cards-data
-      :cardLists="cardLists"
-      v-if="cardLists.length >= 0"
-    ></cards-data>
-    <Card :bordered="false" dis-hover>
-      <Table
-        ref="selection"
-        :columns="columns"
-        :data="tableList"
-        class="ivu-mt"
-        :loading="loading"
-        no-data-text="暂无数据"
-        highlight-row
-        no-filtered-data-text="暂无筛选结果"
-      >
-        <template slot-scope="{ row }" slot="nickname">
-          <div class="name">
-            <div class="item">昵称:{{ row.nickname }}</div>
-            <div class="item">姓名:{{ row.real_name }}</div>
-            <div class="item">电话:{{ row.phone }}</div>
-          </div>
-        </template>
-        <template slot-scope="{ row }" slot="agentLevel">
-          <div>{{ row.agentLevel ? row.agentLevel.name : "--" }}</div>
-        </template>
-        <template slot-scope="{ row, index }" slot="right">
-          <a @click="promoters(row, 'man')">推广人</a>
-          <Divider type="vertical" />
-          <template>
-            <Dropdown @on-click="changeMenu(row, $event, index)">
-              <a href="javascript:void(0)">
-                更多
-                <Icon type="ios-arrow-down"></Icon>
-              </a>
-              <DropdownMenu slot="list">
-                <DropdownItem name="1">推广订单</DropdownItem>
-                <DropdownItem name="2">推广方式</DropdownItem>
-                <DropdownItem name="3">赠送分销等级</DropdownItem>
-                <!-- <DropdownItem name="3">清除上级推广人</DropdownItem> -->
-              </DropdownMenu>
-            </Dropdown>
-          </template>
-        </template>
-      </Table>
-      <div class="acea-row row-right page">
-        <Page
-          :total="total"
-          :current="formValidate.page"
-          show-elevator
-          show-total
-          @on-change="pageChange"
-          :page-size="formValidate.limit"
-        />
-      </div>
-    </Card>
-    <!-- 推广人列表-->
-    <promoters-list ref="promotersLists"></promoters-list>
-    <!-- 推广方式-->
-    <Modal
-      v-model="modals"
-      scrollable
-      footer-hide
-      closable
-      title="推广二维码"
-      :mask-closable="false"
-      width="600"
-    >
-      <div class="acea-row row-around">
-        <div class="acea-row row-column-around row-between-wrapper">
-          <div class="QRpic" v-if="code_src"><img v-lazy="code_src" /></div>
-          <span class="QRpic_sp1 mt10" @click="getWeChat"
-            >公众号推广二维码</span
-          >
-        </div>
-        <div class="acea-row row-column-around row-between-wrapper">
-          <div class="QRpic" v-if="code_xcx"><img v-lazy="code_xcx" /></div>
-          <span class="QRpic_sp2 mt10" @click="getXcx">小程序推广二维码</span>
-        </div>
-        <div class="acea-row row-column-around row-between-wrapper">
-          <div class="QRpic" v-if="code_h5"><img v-lazy="code_h5" /></div>
-          <span class="QRpic_sp2 mt10" @click="getH5">H5推广二维码</span>
-        </div>
-      </div>
-      <Spin size="large" fix v-if="spinShow"></Spin>
-    </Modal>
-    <!--修改推广人-->
-    <Modal
-            v-model="promoterShow"
-            scrollable
-            title="修改推广人"
-            class="order_box"
-            :closable="false"
-    >
-      <Form
-              ref="formInline"
-              :model="formInline"
-              :label-width="100"
-              @submit.native.prevent
-      >
-        <FormItem label="用户头像:" prop="image">
-          <div class="picBox" @click="customer">
-            <div class="pictrue" v-if="formInline.image">
-              <img v-lazy="formInline.image" />
-            </div>
-            <div class="upLoad acea-row row-center-wrapper" v-else>
-              <Icon type="ios-camera-outline" size="26" />
-            </div>
-          </div>
-        </FormItem>
-      </Form>
-      <div slot="footer">
-        <Button type="primary" @click="putSend('formInline')">提交</Button>
-        <Button @click="cancel('formInline')">取消</Button>
-      </div>
-    </Modal>
-    <Modal
-            v-model="customerShow"
-            scrollable
-            title="请选择商城用户"
-            :closable="false"
-            width="50%"
-    >
-      <customerInfo @imageObject="imageObject"></customerInfo>
-    </Modal>
-  </div>
+	<!-- 分销-分销员管理 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 查询条件 -->
+				<Form ref="formValidate" :model="formValidate" :label-width="labelWidth" :label-position="labelPosition"
+					@submit.native.prevent inline>
+					<FormItem label="时间选择:">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="input-add"
+							:options="options"></DatePicker>
+					</FormItem>
+					<FormItem label="搜索:" label-for="status">
+						<Input placeholder="请输入用户信息、电话、ID" v-model="formValidate.nickname" class="input-add mr14" />
+						<Button type="primary" @click="userSearchs" class="mr14">查询</Button>
+						<Button v-auth="['export-userAgent']" class="export" @click="exports">导出</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<cards-data :cardLists="cardLists" v-if="cardLists.length >= 0"></cards-data>
+		<Card :bordered="false" dis-hover>
+			<Table ref="selection" :columns="columns" :data="tableList" class="ivu-mt" :loading="loading"
+				no-data-text="暂无数据" highlight-row no-filtered-data-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="nickname">
+					<div class="name">
+						<div class="item">昵称:{{ row.nickname }}</div>
+						<div class="item">姓名:{{ row.real_name }}</div>
+						<div class="item">电话:{{ row.phone }}</div>
+					</div>
+				</template>
+				<template slot-scope="{ row }" slot="agentLevel">
+					<div>{{ row.agentLevel ? row.agentLevel.name : "--" }}</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="right">
+					<a @click="promoters(row, 'man')">推广人</a>
+					<Divider type="vertical" />
+					<template>
+						<Dropdown @on-click="changeMenu(row, $event, index)">
+							<a href="javascript:void(0)">
+								更多
+								<Icon type="ios-arrow-down"></Icon>
+							</a>
+							<DropdownMenu slot="list">
+								<DropdownItem name="1">推广订单</DropdownItem>
+								<DropdownItem name="2">推广方式</DropdownItem>
+								<!-- <DropdownItem name="3">赠送分销等级</DropdownItem> -->
+								<!-- <DropdownItem name="3">清除上级推广人</DropdownItem> -->
+							</DropdownMenu>
+						</Dropdown>
+					</template>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="formValidate.page" show-elevator show-total @on-change="pageChange"
+					:page-size="formValidate.limit" />
+			</div>
+		</Card>
+		<!-- 推广人列表-->
+		<promoters-list ref="promotersLists"></promoters-list>
+		<!-- 推广方式-->
+		<Modal v-model="modals" scrollable footer-hide closable title="推广二维码" :mask-closable="false" width="600">
+			<div class="acea-row row-around">
+				<div class="acea-row row-column-around row-between-wrapper">
+					<div class="QRpic" v-if="code_src"><img v-lazy="code_src" /></div>
+					<span class="QRpic_sp1 mt10" @click="getWeChat">公众号推广二维码</span>
+				</div>
+				<div class="acea-row row-column-around row-between-wrapper">
+					<div class="QRpic" v-if="code_xcx"><img v-lazy="code_xcx" /></div>
+					<span class="QRpic_sp2 mt10" @click="getXcx">小程序推广二维码</span>
+				</div>
+				<div class="acea-row row-column-around row-between-wrapper">
+					<div class="QRpic" v-if="code_h5"><img v-lazy="code_h5" /></div>
+					<span class="QRpic_sp2 mt10" @click="getH5">H5推广二维码</span>
+				</div>
+			</div>
+			<Spin size="large" fix v-if="spinShow"></Spin>
+		</Modal>
+		<!--修改推广人-->
+		<Modal v-model="promoterShow" scrollable title="修改推广人" class="order_box" :closable="false">
+			<Form ref="formInline" :model="formInline" :label-width="100" @submit.native.prevent>
+				<FormItem label="用户头像:" prop="image">
+					<div class="picBox" @click="customer">
+						<div class="pictrue" v-if="formInline.image">
+							<img v-lazy="formInline.image" />
+						</div>
+						<div class="upLoad acea-row row-center-wrapper" v-else>
+							<Icon type="ios-camera-outline" size="26" />
+						</div>
+					</div>
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putSend('formInline')">提交</Button>
+				<Button @click="cancel('formInline')">取消</Button>
+			</div>
+		</Modal>
+		<Modal v-model="customerShow" scrollable title="请选择商城用户" :closable="false" width="50%">
+			<customerInfo @imageObject="imageObject"></customerInfo>
+		</Modal>
+	</div>
 </template>
 
 <script>
-import cardsData from "@/components/cards/cards";
-import searchFrom from "@/components/publicSearchFrom";
-import { mapState } from "vuex";
-import exportExcel from "@/utils/newToExcel.js";
-import { membershipDataAddApi } from "@/api/membershipLevel";
-import {
-  agentListApi,
-  statisticsApi,
-  lookCodeApi,
-  lookxcxCodeApi,
-  lookh5CodeApi,
-  userAgentApi,
-  agentSpreadApi,
-} from "@/api/agent";
-import promotersList from "./handle/promotersList";
-import customerInfo from "@/components/customerInfo";
-import timeOptions from "@/utils/timeOptions";
-export default {
-  name: "agentManage",
-  components: { cardsData, searchFrom, promotersList, customerInfo },
-  data() {
-    return {
-      customerShow: false,
-      promoterShow: false,
-      modals: false,
-      spinShow: false,
-      grid: {
-        xl: 7,
-        lg: 10,
-        md: 12,
-        sm: 24,
-        xs: 24,
-      },
-      options: timeOptions,
-      formValidate: {
-        nickname: "",
-        data: "",
-        page: 1,
-        limit: 15,
-      },
-      date: "all",
-      total: 0,
-      cardLists: [],
-      loading: false,
-      tableList: [],
-      timeVal: [],
-      columns: [
-        // {
-        //     type: 'selection',
-        //     width: 60,
-        //     align: 'center'
-        // },
-        {
-          title: "ID",
-          key: "uid",
-          sortable: true,
-          width: 80,
-        },
-        {
-          title: "头像",
-          key: "headimgurl",
-          minWidth: 60,
-          render: (h, params) => {
-            return h("viewer", [
-              h(
-                "div",
-                {
-                  style: {
-                    width: "36px",
-                    height: "36px",
-                    borderRadius: "4px",
-                    cursor: "pointer",
-                  },
-                },
-                [
-                  h("img", {
-                    attrs: {
-                      src: params.row.headimgurl
-                        ? params.row.headimgurl
-                        : require("../../assets/images/moren.jpg"),
-                    },
-                    style: {
-                      width: "100%",
-                      height: "100%",
-                    },
-                  }),
-                ]
-              ),
-            ]);
-          },
-        },
-        {
-          title: "用户信息",
-          slot: "nickname",
-          minWidth: 120,
-        },
-        {
-          title: "推广用户数量",
-          key: "spread_count",
-          minWidth: 125,
-        },
-        {
-          title: "订单数量",
-          key: "order_count",
-          minWidth: 90,
-        },
-        {
-          title: "订单金额",
-          key: "order_price",
-          minWidth: 120,
-        },
-        {
-          title: "分销等级",
-          slot: "agentLevel",
-          minWidth: 120,
-        },
-        {
-          title: "账户佣金",
-          key: "brokerage_money",
-          minWidth: 120,
-        },
-        {
-          title: "已提现金额",
-          key: "extract_count_price",
-          minWidth: 120,
-        },
-        {
-          title: "提现次数",
-          key: "extract_count_num",
-          minWidth: 100,
-        },
-        {
-          title: "未提现金额",
-          key: "new_money",
-          minWidth: 105,
-        },
-        {
-          title: "上级推广人",
-          key: "spread_name",
-          minWidth: 105,
-        },
-        {
-          title: "操作",
-          slot: "right",
-          // fixed: "right",
-          minWidth: 130,
-        },
-      ],
-      code_src: "",
-      code_xcx: "",
-      code_h5: "",
-      formInline: {
-        uid: 0,
-        spread_uid: 0,
-        image: "",
-      },
-    };
-  },
-  computed: {
-    ...mapState("admin/layout", ["isMobile"]),
-    labelWidth() {
-      return this.isMobile ? undefined : 96;
-    },
-    labelPosition() {
-      return this.isMobile ? "top" : "right";
-    },
-  },
-  created() {
-		 // const end = new Date();
-		 //    const start = new Date();
-		 //    start.setTime(
-		 //      start.setTime(
-		 //        new Date(
-		 //          new Date().getFullYear(),
-		 //          new Date().getMonth(),
-		 //          new Date().getDate()
-		 //        )
-		 //      )
-		 //    );
-		 //    this.timeVal = [start, end];
-    this.getList();
-    this.getStatistics();
-  },
-  methods: {
-    // 导出
-    // exports() {
-    //   let formValidate = this.formValidate;
-    //   let data = {
-    //     data: formValidate.data,
-    //     nickname: formValidate.nickname,
-    //   };
-    //   userAgentApi(data)
-    //     .then((res) => {
-    //       location.href = res.data[0];
-    //     })
-    //     .catch((res) => {
-    //       this.$Message.error(res.msg);
-    //     });
-    // },
-    // 提交
-    putSend(name) {
-      this.$refs[name].validate((valid) => {
-        if (valid) {
-          if (!this.formInline.spread_uid) {
-            return this.$Message.error("请上传用户");
-          }
-          agentSpreadApi(this.formInline)
-                  .then((res) => {
-                    this.promoterShow = false;
-                    this.$Message.success(res.msg);
-                    this.getList();
-                    this.$refs[name].resetFields();
-                  })
-                  .catch((res) => {
-                    this.$Message.error(res.msg);
-                  });
-        }
-      });
-    },
-    // 数据导出;
-    async exports() {
-      let [th, filekey, data] = [[], [], []];
-      let fileName = "";
-      let excelData = JSON.parse(JSON.stringify(this.formValidate));
-      excelData.page = 1;
-      for (let i = 0; i < excelData.page + 1; i++) {
-        let lebData = await this.getExcelData(excelData);
-        if (!fileName) fileName = lebData.filename;
-        if (!filekey.length) {
-          filekey = lebData.filekey;
-        }
-        if (!th.length) th = lebData.header;
-        if (lebData.export.length) {
-          data = data.concat(lebData.export);
-          excelData.page++;
-        } else {
-          exportExcel(th, filekey, fileName, data);
-          return;
-        }
-      }
-    },
-    getExcelData(excelData) {
-      return new Promise((resolve, reject) => {
-        userAgentApi(excelData).then((res) => {
-          return resolve(res.data);
-        });
-      });
-    },
-    // 操作
-    changeMenu(row, name, index) {
-      switch (name) {
-        case "1":
-          this.promoters(row, "order");
-          break;
-        case "2":
-          this.spreadQR(row);
-          break;
-        case "3":
-          this.$modalForm(
-            membershipDataAddApi({ uid: row.uid }, "/agent/get_level_form")
-          ).then(() => this.getList());
-          break;
-        // default:
-        //     this.del(row, '解除【 ' + row.nickname + ' 】的上级推广人', index);
-      }
-    },
-    customer() {
-      this.customerShow = true;
-    },
-    imageObject(e) {
-      this.customerShow = false;
-      this.formInline.spread_uid = e.uid;
-      this.formInline.image = e.image;
-    },
-    // 删除
-    del(row, tit, num) {
-      let delfromData = {
-        title: tit,
-        num: num,
-        url: `agent/stair/delete_spread/${row.uid}`,
-        method: "PUT",
-        ids: "",
-      };
-      this.$modalSure(delfromData)
-        .then((res) => {
-          this.$Message.success(res.msg);
-          this.getList();
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    edit(row) {
-      this.promoterShow = true;
-      this.formInline.uid = row.uid;
-    },
-    cancel(name) {
-      this.promoterShow = false;
-      this.$refs[name].resetFields();
-    },
-    // 推广人列表 订单
-    promoters(row, tit) {
-      this.$refs.promotersLists.modals = true;
-      this.$refs.promotersLists.getList(row, tit);
-    },
-    // 统计
-    getStatistics() {
-      let data = {
-        nickname: this.formValidate.nickname,
-        data: this.formValidate.data,
-      };
-      statisticsApi(data)
-        .then(async (res) => {
-          let data = res.data;
-          data.res.forEach(value => value.col = 4)
-          this.cardLists = data.res;
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    // 具体日期
-    onchangeTime(e) {
-      this.timeVal = e;
-	  this.formValidate.data = this.timeVal[0] ? this.timeVal.join("-") : "";
-      this.formValidate.page = 1;
-      if (!e[0]) {
-        this.formValidate.data = "";
-      }
-      this.getList();
-      this.getStatistics();
-    },
-    // 选择时间
-    selectChange(tab) {
-      this.formValidate.page = 1;
-      this.formValidate.data = tab;
-      this.timeVal = [];
-      this.getList();
-      this.getStatistics();
-    },
-    // 列表
-    getList() {
-      this.loading = true;
-      agentListApi(this.formValidate)
-        .then(async (res) => {
-          let data = res.data;
-          this.tableList = data.list;
-          this.total = res.data.count;
-          this.loading = false;
-        })
-        .catch((res) => {
-          this.loading = false;
-          this.$Message.error(res.msg);
-        });
-    },
-    pageChange(index) {
-      this.formValidate.page = index;
-      this.getList();
-    },
-    // 表格搜索
-    userSearchs() {
-      this.formValidate.page = 1;
-      this.getList();
-      this.getStatistics();
-    },
-    // 二维码
-    spreadQR(row) {
-      this.modals = true;
-      this.rows = row;
-      // this.getWeChat(row);
-      // this.getXcx(row);
-    },
-    // 公众号推广二维码
-    getWeChat() {
-      this.spinShow = true;
-      let data = {
-        uid: this.rows.uid,
-        action: "wechant_code",
-      };
-      lookCodeApi(data)
-        .then(async (res) => {
-          let data = res.data;
-          this.code_src = data.code_src;
-          this.spinShow = false;
-        })
-        .catch((res) => {
-          this.spinShow = false;
-          this.$Message.error(res.msg);
-        });
-    },
-    // 小程序推广二维码
-    getXcx() {
-      this.spinShow = true;
-      let data = {
-        uid: this.rows.uid,
-      };
-      lookxcxCodeApi(data)
-        .then(async (res) => {
-          let data = res.data;
-          this.code_xcx = data.code_src;
-          this.spinShow = false;
-        })
-        .catch((res) => {
-          this.spinShow = false;
-          this.$Message.error(res.msg);
-        });
-    },
-    getH5() {
-      this.spinShow = true;
-      let data = {
-        uid: this.rows.uid,
-      };
-      lookh5CodeApi(data)
-        .then(async (res) => {
-          let data = res.data;
-          this.code_h5 = data.code_src;
-          this.spinShow = false;
-        })
-        .catch((res) => {
-          this.spinShow = false;
-          this.$Message.error(res.msg);
-        });
-    },
-  },
-};
+	import cardsData from "@/components/cards/cards";
+	import searchFrom from "@/components/publicSearchFrom";
+	import {
+		mapState
+	} from "vuex";
+	import exportExcel from "@/utils/newToExcel.js";
+	import {
+		membershipDataAddApi
+	} from "@/api/membershipLevel";
+	import {
+		agentListApi,
+		statisticsApi,
+		lookCodeApi,
+		lookxcxCodeApi,
+		lookh5CodeApi,
+		userAgentApi,
+		agentSpreadApi,
+	} from "@/api/agent";
+	import promotersList from "./handle/promotersList";
+	import customerInfo from "@/components/customerInfo";
+	import timeOptions from "@/utils/timeOptions";
+	export default {
+		name: "agentManage",
+		components: {
+			cardsData,
+			searchFrom,
+			promotersList,
+			customerInfo
+		},
+		data() {
+			return {
+				customerShow: false,
+				promoterShow: false,
+				modals: false,
+				spinShow: false,
+				grid: {
+					xl: 7,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				options: timeOptions,
+				formValidate: {
+					nickname: "",
+					data: "",
+					page: 1,
+					limit: 15,
+				},
+				date: "all",
+				total: 0,
+				cardLists: [],
+				loading: false,
+				tableList: [],
+				timeVal: [],
+				columns: [
+					// {
+					//     type: 'selection',
+					//     width: 60,
+					//     align: 'center'
+					// },
+					{
+						title: "ID",
+						key: "uid",
+						sortable: true,
+						width: 80,
+					},
+					{
+						title: "头像",
+						key: "headimgurl",
+						minWidth: 60,
+						render: (h, params) => {
+							return h("viewer", [
+								h(
+									"div", {
+										style: {
+											width: "36px",
+											height: "36px",
+											borderRadius: "4px",
+											cursor: "pointer",
+										},
+									},
+									[
+										h("img", {
+											attrs: {
+												src: params.row.headimgurl ?
+													params.row.headimgurl :
+													require("../../assets/images/moren.jpg"),
+											},
+											style: {
+												width: "100%",
+												height: "100%",
+											},
+										}),
+									]
+								),
+							]);
+						},
+					},
+					{
+						title: "用户信息",
+						slot: "nickname",
+						minWidth: 120,
+					},
+					{
+						title: "推广用户数量",
+						key: "spread_count",
+						minWidth: 125,
+					},
+					{
+						title: "订单数量",
+						key: "order_count",
+						minWidth: 90,
+					},
+					{
+						title: "订单金额",
+						key: "order_price",
+						minWidth: 120,
+					},
+					// {
+					// 	title: "分销等级",
+					// 	slot: "agentLevel",
+					// 	minWidth: 120,
+					// },
+					{
+						title: "账户佣金",
+						key: "brokerage_money",
+						minWidth: 120,
+					},
+					{
+						title: "已提现金额",
+						key: "extract_count_price",
+						minWidth: 120,
+					},
+					{
+						title: "提现次数",
+						key: "extract_count_num",
+						minWidth: 100,
+					},
+					{
+						title: "未提现金额",
+						key: "new_money",
+						minWidth: 105,
+					},
+					{
+						title: "上级推广人",
+						key: "spread_name",
+						minWidth: 105,
+					},
+					{
+						title: "操作",
+						slot: "right",
+						fixed: "right",
+						minWidth: 130,
+					},
+				],
+				code_src: "",
+				code_xcx: "",
+				code_h5: "",
+				formInline: {
+					uid: 0,
+					spread_uid: 0,
+					image: "",
+				},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			// const end = new Date();
+			//    const start = new Date();
+			//    start.setTime(
+			//      start.setTime(
+			//        new Date(
+			//          new Date().getFullYear(),
+			//          new Date().getMonth(),
+			//          new Date().getDate()
+			//        )
+			//      )
+			//    );
+			//    this.timeVal = [start, end];
+			this.getList();
+			this.getStatistics();
+		},
+		methods: {
+			// 导出
+			// exports() {
+			//   let formValidate = this.formValidate;
+			//   let data = {
+			//     data: formValidate.data,
+			//     nickname: formValidate.nickname,
+			//   };
+			//   userAgentApi(data)
+			//     .then((res) => {
+			//       location.href = res.data[0];
+			//     })
+			//     .catch((res) => {
+			//       this.$Message.error(res.msg);
+			//     });
+			// },
+			// 提交
+			putSend(name) {
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						if (!this.formInline.spread_uid) {
+							return this.$Message.error("请上传用户");
+						}
+						agentSpreadApi(this.formInline)
+							.then((res) => {
+								this.promoterShow = false;
+								this.$Message.success(res.msg);
+								this.getList();
+								this.$refs[name].resetFields();
+							})
+							.catch((res) => {
+								this.$Message.error(res.msg);
+							});
+					}
+				});
+			},
+			// 数据导出;
+			async exports() {
+				let [th, filekey, data] = [
+					[],
+					[],
+					[]
+				];
+				let fileName = "";
+				let excelData = JSON.parse(JSON.stringify(this.formValidate));
+				excelData.page = 1;
+				for (let i = 0; i < excelData.page + 1; i++) {
+					let lebData = await this.getExcelData(excelData);
+					if (!fileName) fileName = lebData.filename;
+					if (!filekey.length) {
+						filekey = lebData.filekey;
+					}
+					if (!th.length) th = lebData.header;
+					if (lebData.export.length) {
+						data = data.concat(lebData.export);
+						excelData.page++;
+					} else {
+						exportExcel(th, filekey, fileName, data);
+						return;
+					}
+				}
+			},
+			getExcelData(excelData) {
+				return new Promise((resolve, reject) => {
+					userAgentApi(excelData).then((res) => {
+						return resolve(res.data);
+					});
+				});
+			},
+			// 操作
+			changeMenu(row, name, index) {
+				switch (name) {
+					case "1":
+						this.promoters(row, "order");
+						break;
+					case "2":
+						this.spreadQR(row);
+						break;
+					case "3":
+						this.$modalForm(
+							membershipDataAddApi({
+								uid: row.uid
+							}, "/agent/get_level_form")
+						).then(() => this.getList());
+						break;
+						// default:
+						//     this.del(row, '解除【 ' + row.nickname + ' 】的上级推广人', index);
+				}
+			},
+			customer() {
+				this.customerShow = true;
+			},
+			imageObject(e) {
+				this.customerShow = false;
+				this.formInline.spread_uid = e.uid;
+				this.formInline.image = e.image;
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `agent/stair/delete_spread/${row.uid}`,
+					method: "PUT",
+					ids: "",
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			edit(row) {
+				this.promoterShow = true;
+				this.formInline.uid = row.uid;
+			},
+			cancel(name) {
+				this.promoterShow = false;
+				this.$refs[name].resetFields();
+			},
+			// 推广人列表 订单
+			promoters(row, tit) {
+				this.$refs.promotersLists.modals = true;
+				this.$refs.promotersLists.getList(row, tit);
+			},
+			// 统计
+			getStatistics() {
+				let data = {
+					nickname: this.formValidate.nickname,
+					data: this.formValidate.data,
+				};
+				statisticsApi(data)
+					.then(async (res) => {
+						let data = res.data;
+						data.res.forEach(value => value.col = 4)
+						this.cardLists = data.res;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.formValidate.data = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.formValidate.page = 1;
+				if (!e[0]) {
+					this.formValidate.data = "";
+				}
+				this.getList();
+				this.getStatistics();
+			},
+			// 选择时间
+			selectChange(tab) {
+				this.formValidate.page = 1;
+				this.formValidate.data = tab;
+				this.timeVal = [];
+				this.getList();
+				this.getStatistics();
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				agentListApi(this.formValidate)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.list;
+						this.total = res.data.count;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.formValidate.page = index;
+				this.getList();
+			},
+			// 表格搜索
+			userSearchs() {
+				this.formValidate.page = 1;
+				this.getList();
+				this.getStatistics();
+			},
+			// 二维码
+			spreadQR(row) {
+				this.modals = true;
+				this.rows = row;
+				// this.getWeChat(row);
+				// this.getXcx(row);
+			},
+			// 公众号推广二维码
+			getWeChat() {
+				this.spinShow = true;
+				let data = {
+					uid: this.rows.uid,
+					action: "wechant_code",
+				};
+				lookCodeApi(data)
+					.then(async (res) => {
+						let data = res.data;
+						this.code_src = data.code_src;
+						this.spinShow = false;
+					})
+					.catch((res) => {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// 小程序推广二维码
+			getXcx() {
+				this.spinShow = true;
+				let data = {
+					uid: this.rows.uid,
+				};
+				lookxcxCodeApi(data)
+					.then(async (res) => {
+						let data = res.data;
+						this.code_xcx = data.code_src;
+						this.spinShow = false;
+					})
+					.catch((res) => {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			getH5() {
+				this.spinShow = true;
+				let data = {
+					uid: this.rows.uid,
+				};
+				lookh5CodeApi(data)
+					.then(async (res) => {
+						let data = res.data;
+						this.code_h5 = data.code_src;
+						this.spinShow = false;
+					})
+					.catch((res) => {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					});
+			},
+		},
+	};
 </script>
 <style scoped lang="stylus">
-.picBox {
-  display: inline-block;
-  cursor: pointer;
+	.picBox {
+		display: inline-block;
+		cursor: pointer;
 
-  .upLoad {
-    width: 58px;
-    height: 58px;
-    line-height: 58px;
-    border: 1px dotted rgba(0, 0, 0, 0.1);
-    border-radius: 4px;
-    background: rgba(0, 0, 0, 0.02);
-  }
+		.upLoad {
+			width: 58px;
+			height: 58px;
+			line-height: 58px;
+			border: 1px dotted rgba(0, 0, 0, 0.1);
+			border-radius: 4px;
+			background: rgba(0, 0, 0, 0.02);
+		}
 
-  .pictrue {
-    width: 60px;
-    height: 60px;
-    border: 1px dotted rgba(0, 0, 0, 0.1);
-    margin-right: 10px;
+		.pictrue {
+			width: 60px;
+			height: 60px;
+			border: 1px dotted rgba(0, 0, 0, 0.1);
+			margin-right: 10px;
 
-    img {
-      width: 100%;
-      height: 100%;
-    }
-  }
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
 
-  .iconfont {
-    color: #898989;
-  }
-}
+		.iconfont {
+			color: #898989;
+		}
+	}
 
-.QRpic {
-  width: 180px;
-  height: 180px;
+	.QRpic {
+		width: 180px;
+		height: 180px;
 
-  img {
-    width: 100%;
-    height: 100%;
-  }
-}
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
 
-.QRpic_sp1 {
-  font-size: 13px;
-  color: #19be6b;
-  cursor: pointer;
-}
+	.QRpic_sp1 {
+		font-size: 13px;
+		color: #19be6b;
+		cursor: pointer;
+	}
 
-.QRpic_sp2 {
-  font-size: 13px;
-  color: #2d8cf0;
-  cursor: pointer;
-}
+	.QRpic_sp2 {
+		font-size: 13px;
+		color: #2d8cf0;
+		cursor: pointer;
+	}
 
-img {
-  height: 36px;
-  display: block;
-}
+	img {
+		height: 36px;
+		display: block;
+	}
 
-.ivu-mt .name .item {
-  margin: 3px 0;
-}
+	.ivu-mt .name .item {
+		margin: 3px 0;
+	}
 
-.tabform {
-  margin-bottom: 10px;
-}
+	.tabform {
+		margin-bottom: 10px;
+	}
 
-.Refresh {
-  font-size: 12px;
-  color: #1890FF;
-  cursor: pointer;
-}
+	.Refresh {
+		font-size: 12px;
+		color: #1890FF;
+		cursor: pointer;
+	}
 
-.ivu-form-item {
-  margin-bottom: 10px;
-}
+	.ivu-form-item {
+		margin-bottom: 10px;
+	}
 
-/* .ivu-mt >>> .ivu-table-header */
-/* border-top:1px dashed #ddd!important */
+	/* .ivu-mt >>> .ivu-table-header */
+	/* border-top:1px dashed #ddd!important */
 </style>

+ 193 - 0
src/pages/agent/allitem/index.vue

@@ -0,0 +1,193 @@
+<template>
+<!-- 订单-收款订单 -->
+  <div>
+    <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+      <div class="new_card_pd">
+        <!-- 筛选条件 -->
+        <Form
+          ref="pagination"
+          :model="pagination"
+          :label-width="labelWidth"
+          inline
+          :label-position="labelPosition"
+          @submit.native.prevent
+        >
+          <FormItem label="搜索:" label-for="title">
+            <Input
+              v-model="pagination.nickname"
+              placeholder="请输入用户信息、电话、ID"
+             class="input-add"
+            />
+          </FormItem>
+          <FormItem label="创建时间:">
+            <DatePicker
+              @on-change="onchangeTime"
+              :value="timeVal"
+              format="yyyy/MM/dd"
+              type="datetimerange"
+              placement="bottom-start"
+              placeholder="自定义时间"
+              style="width: 250px;margin-right:14px"
+              class="mr20"
+              :options="options"
+            ></DatePicker>
+            <Button type="primary" @click="search()">查询</Button>
+          </FormItem>
+        </Form>
+      </div>
+    </Card>
+    <Card :bordered="false" dis-hover class="ivu-mt">
+      <!-- 收款订单表格 -->
+      <Table
+        :columns="thead"
+        :data="tbody"
+        ref="table"
+        :loading="loading"
+        highlight-row
+        class="ivu-mt"
+        no-userFrom-text="暂无数据"
+        no-filtered-userFrom-text="暂无筛选结果"
+      >
+	  <template slot-scope="{ row }" slot="nickname">
+	    <div class="name">
+	      <div class="item">昵称:{{ row.nickname }}</div>
+	      <div class="item">姓名:{{ row.real_name }}</div>
+	      <div class="item">电话:{{ row.phone }}</div>
+	    </div>
+	  </template>
+      </Table>
+      <div class="acea-row row-right page">
+        <Page
+          :total="total"
+          :current="pagination.page"
+          show-elevator
+          show-total
+          @on-change="pageChange"
+          :page-size="pagination.limit"
+        />
+      </div>
+    </Card>
+  </div>
+</template>
+
+<script>
+import { mapState } from "vuex";
+import { performanceList } from "@/api/agent";
+import timeOptions from "@/utils/timeOptions";
+export default {
+  data() {
+    return {
+      grid: {
+        xl: 7,
+        lg: 7,
+        md: 12,
+        sm: 24,
+        xs: 24,
+      },
+      thead: [
+        {
+          title: "ID",
+          key: "uid",
+          sortable: true,
+          width: 80,
+        },
+        {
+          title: "用户信息",
+          slot: "nickname",
+          minWidth: 120,
+        },
+        {
+          title: "订单金额",
+          key: "son_total",
+          minWidth: 90,
+        },
+        {
+          title: "进货金额",
+          key: "son_shelves_total",
+          minWidth: 120,
+        }
+      ],
+      tbody: [],
+      loading: false,
+      total: 0,
+      animal: 1,
+      pagination: {
+        page: 1,
+        limit: 30,
+        nickname: "",
+		start_time:'',
+		end_time:'',
+      },
+      options: timeOptions,
+      timeVal: [],
+    };
+  },
+  computed: {
+    ...mapState("admin/layout", ["isMobile"]),
+    labelWidth() {
+      return this.isMobile ? undefined : 96;
+    },
+    labelPosition() {
+      return this.isMobile ? "top" : "right";
+    },
+  },
+  created() {
+    this.getOrderList();
+  },
+  methods: {
+    // 具体日期搜索();
+    onchangeTime(e) {
+		console.log(e)
+      this.pagination.page = 1;
+      this.timeVal = e;
+      // this.pagination.add_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+	  this.pagination.start_time = this.timeVal[0]||'';
+	  this.pagination.end_time = this.timeVal[1]||'';
+	  
+    },
+    // 订单列表
+    getOrderList() {
+      this.loading = true;
+      performanceList(this.pagination)
+        .then((res) => {
+          this.loading = false;
+          const { count, list } = res.data;
+          this.total = count;
+          this.tbody = list;
+        })
+        .catch((err) => {
+          this.loading = false;
+          this.$Message.error(err.msg);
+        });
+    },
+    // 分页
+    pageChange(index) {
+      this.pagination.page = index;
+      this.getOrderList();
+    },
+    search() {
+      this.pagination.page = 1;
+      this.getOrderList();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.input-add {
+ width: 250px
+}
+.code {
+  position: relative;
+}
+
+.QRpic {
+  width: 180px;
+  height: 259px;
+
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+</style>

+ 246 - 0
src/pages/order/firstList/index.vue

@@ -0,0 +1,246 @@
+<template>
+	<!-- 订单-收款订单 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 筛选条件 -->
+				<Form ref="pagination" :model="pagination" :label-width="labelWidth" inline
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="状态:" label-for="status">
+						<Select v-model="pagination.status" placeholder="请选择" element-id="status" clearable class="input-add"
+							@on-change="search">
+							<Option value="">全部</Option>
+							<Option value="0">审核中</Option>
+							<Option value="1">已通过</Option>
+							<Option value="2">已拒绝</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="用户ID:">
+						<Input v-model="pagination.uid" placeholder="请输入用户ID" class="input-add" />
+						<Button type="primary" @click="search()">查询</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 收款订单表格 -->
+			<Table :columns="thead" :data="tbody" ref="table" :loading="loading" highlight-row class="ivu-mt"
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+
+				<template slot-scope="{ row, index }" slot="nickname">
+					{{row.nickname}}(ID:{{row.uid}})<br />
+					手机号:{{row.phone}}
+				</template>
+				<template slot-scope="{ row, index }" slot="orderList">
+					<div v-for="ls in row.orderList">
+						订单:{{ls.order_id}}
+						<Divider type="vertical" />
+						用户:{{ls.nickname}}(UID:{{ls.uid}})
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="checkedSend(row)">审核</a>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="pagination.page" show-elevator show-total @on-change="pageChange"
+					:page-size="pagination.limit" />
+			</div>
+		</Card>
+		<Modal v-model="showSend" title="优先单审核" width="900">
+			<Form :label-width="labelWidth" :label-position="labelPosition" ref="showSend" :model="sendData"
+				class="tabform">
+				<FormItem label="来源订单">
+					<div class="alertflex">
+						<div class="tabBox" v-for="ls in actionSendData.orderList"
+							>
+							订单:{{ls.order_id}}
+							<Divider type="vertical" />
+							用户:{{ls.nickname}}(UID:{{ls.uid}})
+							<Divider type="vertical" />
+							手机:{{ls.phone}}
+						</div>
+					</div>
+				</FormItem>
+				<FormItem label="备注:">
+					<Input v-model="sendData.mark" placeholder="备注" element-id="name" clearable style="width:500px;"
+						maxlength="20">
+					</Input>
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button @click="sendOrderChecked(2)">拒绝</Button>
+				<Button type="primary" @click="sendOrderChecked(1)">通过</Button>
+			</div>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import {
+		first_list,
+		first_examine
+	} from "@/api/order";
+	import {
+		membershipDataListApi,
+	} from "@/api/membershipLevel";
+	import {
+		formatDate
+	} from "@/filters/index.js";
+	export default {
+		data() {
+			return {
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				thead: [{
+						title: "用户",
+						slot: 'nickname',
+					},
+					{
+						title: "类型",
+						key: "type",
+						width: "80px",
+						align: "center"
+					},
+					{
+						title: "状态",
+						key: "status",
+						width: "80px",
+						align: "center"
+					},
+					{
+						title: "产生订单",
+						slot: "orderList",
+						minWidth: 180,
+					},
+					{
+						title: "创建时间",
+						key: "add_time",
+						width: 150,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						width: 80,
+						align: "center",
+					},
+				],
+				tbody: [],
+				loading: false,
+				total: 0,
+				pagination: {
+					page: 1,
+					limit: 30,
+					status:'0'
+				},
+				treeData: [], //货架列表
+				showSend: false, //显示审核弹窗
+				actionSendData: {}, //保存点击的商品
+				sendData: {
+					id: '',
+					status: "",
+					mark: '',
+				},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getOrderList();
+		},
+		methods: {
+			// 通过拒绝审核
+			sendOrderChecked(type) {
+				if (type == 2 && this.sendData.mark == "") {
+					this.$Message.error("请填写拒绝原因");
+					return
+				}
+				this.sendData.status = type;
+				first_examine(this.sendData)
+					.then((res) => {
+						this.showSend = false;
+						this.getOrderList();
+						this.$Message.success(res.msg);
+					})
+					.catch((res) => {
+						this.showSend = false;
+						this.$Message.error(res.msg);
+					});
+
+			},
+			// 点击显示弹窗
+			checkedSend(item) {
+				this.showSend = true;
+				this.actionSendData = item;
+				this.sendData.id = item.id;
+			},
+			// 订单列表
+			getOrderList() {
+				this.loading = true;
+				first_list(this.pagination)
+					.then((res) => {
+						this.loading = false;
+						const {
+							count,
+							list
+						} = res.data;
+
+						this.total = count;
+						this.tbody = list.map((ee) => {
+							ee.add_time = formatDate(ee.add_time)
+							return ee
+						});
+					})
+					.catch((err) => {
+						this.loading = false;
+						this.$Message.error(err.msg);
+					});
+			},
+			// 分页
+			pageChange(index) {
+				this.pagination.page = index;
+				this.getOrderList();
+			},
+			search() {
+				this.pagination.page = 1;
+				this.getOrderList();
+			},
+		},
+	};
+</script>
+
+<style lang="less" scoped>
+	.input-add {
+		width: 250px
+	}
+
+	.code {
+		position: relative;
+	}
+
+	.QRpic {
+		width: 180px;
+		height: 259px;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 241 - 0
src/pages/order/shelves/index.vue

@@ -0,0 +1,241 @@
+<template>
+	<!-- 订单-收款订单 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+			<div class="new_card_pd">
+				<!-- 筛选条件 -->
+				<Form ref="pagination" :model="pagination" :label-width="labelWidth" inline
+					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="货架:" label-for="level_id">
+						<Select v-model="pagination.level_id" placeholder="请选择" element-id="level_id" clearable
+							class="input-add" @on-change="search">
+							<Option :value="item.id" v-for="(item,index) in treeData" :key="index">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="订单类型:" label-for="type">
+						<Select v-model="pagination.type" placeholder="请选择" element-id="type" clearable
+							class="input-add" @on-change="search">
+							<Option value="">全部</Option>
+							<Option value="1">普通订单</Option>
+							<Option value="2">进货订单</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="变化:" label-for="pm">
+						<Select v-model="pagination.pm" placeholder="请选择" element-id="pm" clearable class="input-add"
+							@on-change="search">
+							<Option value="">全部</Option>
+							<Option value="1">增加</Option>
+							<Option value="2">减少</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="用户ID:">
+						<Input v-model="pagination.uid" placeholder="请输入用户ID" class="input-add" />
+					</FormItem>
+					<FormItem label="店铺ID:">
+						<Input v-model="pagination.store_id" placeholder="请输入店铺ID" class="input-add" />
+					</FormItem>
+					<FormItem label="供应商ID:">
+						<Input v-model="pagination.supplier_id" placeholder="请输入供货商ID" class="input-add" />
+						<Button type="primary" @click="search()">查询</Button>
+					</FormItem>
+				</Form>
+			</div>
+		</Card>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 收款订单表格 -->
+			<Table :columns="thead" :data="tbody" ref="table" :loading="loading" highlight-row class="ivu-mt"
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row, index }" slot="nickname">
+					{{row.nickname}}
+					(UID:{{row.uid}})<br />
+					{{row.store_name}}
+					(门店ID:{{row.store_id}})
+				</template>
+				<template slot-scope="{ row, index }" slot="supplier_id">
+					<span v-if="row.supplier_id">
+						供货商(ID:{{row.supplier_id}})<br />
+						<span v-if="row.order_id">单号:{{row.order_id}}</span>
+						<span v-else-if='row.oid'>单号:{{row.oid}}</span>
+					</span>
+					<span v-else>
+						门店(ID:{{row.delivery_pid}})<br />
+						订单:{{row.order_id}}
+					</span>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="pagination.page" show-elevator show-total @on-change="pageChange"
+					:page-size="pagination.limit" />
+			</div>
+		</Card>
+
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import {
+		shelves_log
+	} from "@/api/order";
+	import timeOptions from "@/utils/timeOptions";
+	import {
+		membershipDataListApi,
+	} from "@/api/membershipLevel";
+	export default {
+		data() {
+			return {
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				thead: [{
+						title: "购买",
+						slot: 'nickname',
+					},
+					{
+						title: "卖出",
+						slot: 'supplier_id',
+					},
+					{
+						title: "类型",
+						key: "type",
+						width: "80px",
+						align:"center"
+					},
+					{
+						title: "库存类型",
+						key: "stock_type",
+						width: "80px",
+						align:"center"
+					},
+					{
+						title: "货架",
+						key: "level_name",
+						width: "80px",
+						align:"center"
+					},
+					{
+						title: "数量",
+						key: "number",
+						width: "50px",
+						align:"center"
+					},
+					{
+						title: "增减",
+						key: "pm",
+						width: "50px",
+						align:"center"
+					},
+					{
+						title: "时间",
+						key: "add_time",
+					}
+				],
+				tbody: [],
+				loading: false,
+				total: 0,
+				animal: 1,
+				pagination: {
+					page: 1,
+					limit: 30,
+					uid: "",
+					store_id: "",
+					level_id:'',
+					type:'',
+					pm:'',
+					supplier_id:''
+				},
+				options: timeOptions,
+				timeVal: [],
+				modal: false,
+				qrcode: null,
+				name: "",
+				spin: false,
+				treeData: [], //货架列表
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getOrderList();
+			this.getLevel();
+		},
+		methods: {
+			// 获取货架等级
+			getLevel() {
+				membershipDataListApi(this.formValidate)
+					.then(async (res) => {
+						let data = res.data;
+						this.treeData = data.list;
+					})
+					.catch((res) => {});
+			},
+			// 具体日期搜索();
+			// onchangeTime(e) {
+			// 	this.pagination.page = 1;
+			// 	this.timeVal = e;
+			// 	this.pagination.add_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+			// },
+			// 订单列表
+			getOrderList() {
+				this.loading = true;
+				shelves_log(this.pagination)
+					.then((res) => {
+						this.loading = false;
+						const {
+							count,
+							list
+						} = res.data;
+						this.total = count;
+						this.tbody = list;
+					})
+					.catch((err) => {
+						this.loading = false;
+						this.$Message.error(err.msg);
+					});
+			},
+			// 分页
+			pageChange(index) {
+				this.pagination.page = index;
+				this.getOrderList();
+			},
+			search() {
+				this.pagination.page = 1;
+				this.getOrderList();
+			},
+		},
+	};
+</script>
+
+<style lang="less" scoped>
+	.input-add {
+		width: 250px
+	}
+
+	.code {
+		position: relative;
+	}
+
+	.QRpic {
+		width: 180px;
+		height: 259px;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 365 - 316
src/pages/store/storeList/index.vue

@@ -1,325 +1,374 @@
 <template>
-<!-- 门店-门店列表 -->
-  <div>
-    <Card :bordered="false" dis-hover class="ivu-mt tablebox" :padding="16">
-      <div class="new_tab">
-        <!-- Tab栏切换 -->
-        <Tabs @on-click="onClickTab">
-          <TabPane label="全部" name="all" />
-          <TabPane label="营业中" name="1" />
-          <!-- <TabPane label="休息中" name="0"/> -->
-          <TabPane label="已停业" name="-1" />
-        </Tabs>
-      </div>
-	    <Button type="primary" @click="add">添加门店</Button>
-      <div class="table">
-        <Table
-          :columns="columns"  
-          :data="orderList"
-          ref="table"
-          class="ivu-mt"
-          :loading="loading"
-          highlight-row
-          no-userFrom-text="暂无数据"
-          no-filtered-userFrom-text="暂无筛选结果"
-        >
-          <template slot-scope="{ row }" slot="image">
-            <img :src="row.image" />
-          </template>
-          <template slot-scope="{ row, index }" slot="action">
-            <a @click="gostore(row)">进入门店</a>
-            <Divider type="vertical" />
-            <a @click="reset(row)">重置</a>
-            <Divider type="vertical" />
-            <a @click="operation(row)">{{
+	<!-- 门店-门店列表 -->
+	<div>
+		<Card :bordered="false" dis-hover class="ivu-mt tablebox" :padding="16">
+			<div class="new_tab">
+				<!-- Tab栏切换 -->
+				<Tabs @on-click="onClickTab">
+					<TabPane label="全部" name="all" />
+					<TabPane label="营业中" name="1" />
+					<!-- <TabPane label="休息中" name="0"/> -->
+					<TabPane label="已停业" name="-1" />
+				</Tabs>
+			</div>
+			<div class="new_card_pd">
+				<!-- 筛选条件 -->
+				<Form ref="pagination" :model="formValidate" :label-width="labelWidth" inline :label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="货架:" label-for="level_id">
+						<Select v-model="formValidate.level_id" placeholder="请选择" element-id="level_id" clearable
+							class="input-add" @on-change="searchs">
+							<Option :value="item.id" v-for="(item,index) in treeData" :key="index">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="用户ID:">
+						<Input v-model="formValidate.uid" placeholder="请输入用户ID" class="input-add" />
+					</FormItem>
+					<FormItem label="用户昵称:">
+						<Input v-model="formValidate.nickname " placeholder="请输入用户昵称" class="input-add" />
+					</FormItem>
+					<FormItem label="手机号:">
+						<Input v-model="formValidate.phone" placeholder="请输入用户手机号" class="input-add" />
+						<Button type="primary" @click="searchs()">查询</Button>
+					</FormItem>
+				</Form>
+			</div>
+
+			<Button type="primary" @click="add">添加门店</Button>
+			<div class="table">
+				<Table :columns="columns" :data="orderList" ref="table" class="ivu-mt" :loading="loading" highlight-row
+					no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+					<template slot-scope="{ row }" slot="image">
+						<img :src="row.image" />
+					</template>
+					<template slot-scope="{ row, index }" slot="action">
+						<a @click="gostore(row)">进入门店</a>
+						<Divider type="vertical" />
+						<a @click="reset(row)">重置</a>
+						<Divider type="vertical" />
+						<a @click="operation(row)">{{
               row.is_show == 0 ? "开业" : "停业"
             }}</a>
-            <Divider type="vertical" />
-            <a @click="edit(row)">编辑</a>
-            <Divider type="vertical" />
-            <a @click="delte(row, '删除门店(同步删除商品)', index)">删除</a>
-          </template>
-        </Table>
-        <div class="acea-row row-right page">
-          <Page
-            :total="total"
-            :current="formValidate.page"
-            show-elevator
-            show-total
-            @on-change="pageChange"
-            :page-size="formValidate.limit"
-          />
-        </div>
-      </div>
-    </Card>
-    <add-store ref="template"></add-store>
-  </div>
+						<Divider type="vertical" />
+						<a @click="edit(row)">编辑</a>
+						<Divider type="vertical" />
+						<a @click="delte(row, '删除门店(同步删除商品)', index)">删除</a>
+					</template>
+				</Table>
+				<div class="acea-row row-right page">
+					<Page :total="total" :current="formValidate.page" show-elevator show-total @on-change="pageChange"
+						:page-size="formValidate.limit" />
+				</div>
+			</div>
+		</Card>
+		<add-store ref="template"></add-store>
+	</div>
 </template>
 
 <script>
-import util from "@/libs/util";
-import Setting from "@/setting";
-import addStore from "../components/addStore";
-import {
-  storeListApi,
-  storeLogin,
-  storeSetShowApi,
-  resetApi,
-} from "@/api/store";
-export default {
-  name: "storeList",
-  components: {
-    addStore,
-  },
-  data() {
-    return {
-      BaseURL: '',
-      total: 0,
-      loading: false,
-      formValidate: {
-        type: "all",
-        page: 1,
-        limit: 15,
-      },
-      columns: [
-        {
-          title: "ID",
-          key: "id",
-          width: 60,
-        },
-        {
-          title: "门店图片",
-          slot: "image",
-          minWidth: 80,
-        },
-        {
-          title: "门店名称",
-          key: "name",
-          minWidth: 80,
-        },
-        {
-          title: "门店分类",
-          key: "cate_name",
-          minWidth: 80,
-        },
-        {
-          title: "联系电话",
-          key: "phone",
-          minWidth: 90,
-        },
-        {
-          title: "门店地址",
-          key: "address",
-          ellipsis: true,
-          minWidth: 150,
-        },
-        {
-          title: "营业时间",
-          key: "day_time",
-          minWidth: 120,
-        },
-        {
-          title: "营业状态",
-          key: "status_name",
-          minWidth: 80,
-        },
-        {
-          title: "操作",
-          slot: "action",
-          fixed: "right",
-          minWidth: 240,
-          align: "center",
-        },
-      ],
-      orderList: [
-        {
-          id: "1",
-          order_id: "12",
-          pay_price: "12",
-          status: 1,
-          phone: "13000000000",
-          address: "陕西省西安市莲湖区大兴西路啊餐厨",
-        },
-      ],
-    };
-  },
-  mounted() {
-    this.getList();
-  },
-  methods: {
-    getList() {
-      this.loading = true;
-      storeListApi(this.formValidate).then((res) => {
-        this.orderList = res.data.list;
-        this.total = res.data.count;
-        this.loading = false;
-      });
-    },
-    reset(row) {
-      this.$modalForm(resetApi(row.id)).then(() => this.getList());
-    },
-    add() {
-      this.$refs.template.title = "添加门店";
-      this.$refs.template.add = 1;
-      this.$refs.template.isTemplate = true;
-      this.$refs.template.cityInfo({ pid: 0 });
-    },
-    edit(row) {
-      this.$refs.template.title = "编辑门店";
-      this.$refs.template.isTemplate = true;
-      this.$refs.template.getInfo(row.id);
-    },
-    getExpiresTime(expiresTime) {
-      let nowTimeNum = Math.round(new Date() / 1000);
-      let expiresTimeNum = expiresTime - nowTimeNum;
-      return parseFloat(parseFloat(parseFloat(expiresTimeNum / 60) / 60) / 24);
-    },
-    // 进入门店
-    gostore(item) {
-      storeLogin(item.id)
-        .then((res) => {
-          let data = res.data;
-          let expires = data.expires_time;
-          util.cookies.setStore("token", data.token, {
-            expires: expires,
-          });
-          util.cookies.setStore("uuid", data.user_info.id, {
-            expires: expires,
-          });
-          util.cookies.setStore("expires_time", expires, {
-            expires: expires,
-          });
-          util.makeMenu(`/${data.prefix}`, data.menus);
-          let storage = window.localStorage;
-          storage.setItem("menuListStore", JSON.stringify(data.menus));
-          storage.setItem("uniqueAuthStore", JSON.stringify(data.unique_auth));
-          let userInfoStore = {
-            account: data.user_info.account,
-            head_pic: data.user_info.avatar,
-            logo: data.logo,
-            logoSmall: data.logo_square,
-            version: data.version,
-          };
-          storage.setItem("userInfoStore", JSON.stringify(userInfoStore));
-          // menuListStore
-          this.BaseURL = Setting.apiBaseURL.replace(/adminapi/, `${item.prefix}/home/`);
-          window.open(this.BaseURL);
-        })
-        .catch((err) => {
-          this.$Message.error(err.msg);
-        });
-    },
-    delte(row, tit, num) {
-      let delfromData = {
-        title: tit,
-        num: num,
-        url: `store/store/del/${row.id}`,
-        method: "DELETE",
-        ids: "",
-      };
-      this.$modalSure(delfromData)
-        .then((res) => {
-          this.$Message.success(res.msg);
-          this.orderList.splice(num, 1);
-          if (!this.orderList.length) {
-            this.formValidate.page =
-                this.formValidate.page == 1 ? 1 : this.formValidate.page - 1;
-          }
-          this.getList();
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    operation(row) {
-      let a = 0; //修改营业状态的反值
-      if (row.is_show == 0) {
-        a = 1;
-      }
-      if (row.is_show == 1) {
-        a = 0;
-      }
-      storeSetShowApi(row.id, a)
-        .then((res) => {
-          this.getList();
-          this.$Message.success(res.msg);
-        })
-        .catch((err) => {
-          this.$Message.error(res.msg);
-        });
-    },
-    searchs() {},
-    onClickTab(e) {
-      this.formValidate.page = 1;
-      this.formValidate.type = e;
-      this.getList();
-    },
-    //分页
-    pageChange(status) {
-      this.formValidate.page = status;
-      this.getList();
-    },
-  },
-};
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import addStore from "../components/addStore";
+	import {
+		membershipDataListApi,
+	} from "@/api/membershipLevel";
+	import {
+		mapState
+	} from "vuex";
+	import {
+		storeListApi,
+		storeLogin,
+		storeSetShowApi,
+		resetApi,
+	} from "@/api/store";
+	export default {
+		name: "storeList",
+		components: {
+			addStore,
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		data() {
+			return {
+				BaseURL: '',
+				total: 0,
+				loading: false,
+				formValidate: {
+					type: "all",
+					nickname : "",
+					uid: "",
+					phone: "",
+					level_id: "",
+					page: 1,
+					limit: 15,
+				},
+				columns: [{
+						title: "ID",
+						key: "id",
+						width: 60,
+					},
+					{
+						title: "门店图片",
+						slot: "image",
+						minWidth: 80,
+					},
+					{
+						title: "门店名称",
+						key: "name",
+						minWidth: 80,
+					},
+					{
+						title: "门店分类",
+						key: "cate_name",
+						minWidth: 80,
+					},
+					{
+						title: "联系电话",
+						key: "phone",
+						minWidth: 90,
+					},
+					{
+						title: "门店地址",
+						key: "address",
+						ellipsis: true,
+						minWidth: 150,
+					},
+					{
+						title: "营业时间",
+						key: "day_time",
+						minWidth: 120,
+					},
+					{
+						title: "营业状态",
+						key: "status_name",
+						minWidth: 80,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						minWidth: 240,
+						align: "center",
+					},
+				],
+				orderList: [{
+					id: "1",
+					order_id: "12",
+					pay_price: "12",
+					status: 1,
+					phone: "13000000000",
+					address: "陕西省西安市莲湖区大兴西路啊餐厨",
+				}, ],
+				treeData:[],
+			};
+		},
+		mounted() {
+			this.getList();
+			this.getLevel();
+		},
+		methods: {
+			// 获取货架等级
+			getLevel() {
+				membershipDataListApi(this.formValidate)
+					.then(async (res) => {
+						let data = res.data;
+						this.treeData = data.list;
+					})
+					.catch((res) => {});
+			},
+			getList() {
+				this.loading = true;
+				storeListApi(this.formValidate).then((res) => {
+					this.orderList = res.data.list;
+					this.total = res.data.count;
+					this.loading = false;
+				});
+			},
+			reset(row) {
+				this.$modalForm(resetApi(row.id)).then(() => this.getList());
+			},
+			add() {
+				this.$refs.template.title = "添加门店";
+				this.$refs.template.add = 1;
+				this.$refs.template.isTemplate = true;
+				this.$refs.template.cityInfo({
+					pid: 0
+				});
+			},
+			edit(row) {
+				this.$refs.template.title = "编辑门店";
+				this.$refs.template.isTemplate = true;
+				this.$refs.template.getInfo(row.id);
+			},
+			getExpiresTime(expiresTime) {
+				let nowTimeNum = Math.round(new Date() / 1000);
+				let expiresTimeNum = expiresTime - nowTimeNum;
+				return parseFloat(parseFloat(parseFloat(expiresTimeNum / 60) / 60) / 24);
+			},
+			// 进入门店
+			gostore(item) {
+				storeLogin(item.id)
+					.then((res) => {
+						let data = res.data;
+						let expires = data.expires_time;
+						util.cookies.setStore("token", data.token, {
+							expires: expires,
+						});
+						util.cookies.setStore("uuid", data.user_info.id, {
+							expires: expires,
+						});
+						util.cookies.setStore("expires_time", expires, {
+							expires: expires,
+						});
+						util.makeMenu(`/${data.prefix}`, data.menus);
+						let storage = window.localStorage;
+						storage.setItem("menuListStore", JSON.stringify(data.menus));
+						storage.setItem("uniqueAuthStore", JSON.stringify(data.unique_auth));
+						let userInfoStore = {
+							account: data.user_info.account,
+							head_pic: data.user_info.avatar,
+							logo: data.logo,
+							logoSmall: data.logo_square,
+							version: data.version,
+						};
+						storage.setItem("userInfoStore", JSON.stringify(userInfoStore));
+						// menuListStore
+						this.BaseURL = Setting.apiBaseURL.replace(/adminapi/, `${item.prefix}/home/`);
+						window.open(this.BaseURL);
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			delte(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `store/store/del/${row.id}`,
+					method: "DELETE",
+					ids: "",
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.orderList.splice(num, 1);
+						if (!this.orderList.length) {
+							this.formValidate.page =
+								this.formValidate.page == 1 ? 1 : this.formValidate.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			operation(row) {
+				let a = 0; //修改营业状态的反值
+				if (row.is_show == 0) {
+					a = 1;
+				}
+				if (row.is_show == 1) {
+					a = 0;
+				}
+				storeSetShowApi(row.id, a)
+					.then((res) => {
+						this.getList();
+						this.$Message.success(res.msg);
+					})
+					.catch((err) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			searchs() {
+				this.formValidate.page=1;
+				this.getList() 
+			},
+			onClickTab(e) {
+				this.formValidate.page = 1;
+				this.formValidate.type = e;
+				this.getList();
+			},
+			//分页
+			pageChange(status) {
+				this.formValidate.page = status;
+				this.getList();
+			},
+		},
+	};
 </script>
 
 <style scoped lang="stylus">
-/deep/.ivu-tabs-nav {
-  height: 45px;
-}
-.tablebox {
-  margin-top: 15px;
-}
-.btnbox {
-  padding: 20px 0px 0px 30px;
-  .btns {
-    width: 99px;
-    height: 32px;
-    background: #1890ff;
-    border-radius: 4px;
-    text-align: center;
-    line-height: 32px;
-    color: #ffffff;
-    cursor: pointer;
-  }
-}
-.table {
-  padding: 0;
-  img {
-    width: 40px;
-    height: 40px;
-  }
-}
-.search {
-  width: 86px;
-  height: 32px;
-  background: #1890ff;
-  border-radius: 4px;
-  text-align: center;
-  line-height: 32px;
-  font-size: 13px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #ffffff;
-  cursor: pointer;
-}
-.reset {
-  width: 86px;
-  height: 32px;
-  border-radius: 4px;
-  border: 1px solid rgba(151, 151, 151, 0.36);
-  text-align: center;
-  line-height: 32px;
-  font-size: 13px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: rgba(0, 0, 0, 0.85);
-  cursor: pointer;
-}
-.new_tab {
-    >>>.ivu-tabs-nav .ivu-tabs-tab{
-        padding:4px 16px 20px !important;
-        font-weight: 500;
-    }
-  }
-</style>
+	/deep/.ivu-tabs-nav {
+		height: 45px;
+	}
+
+	.tablebox {
+		margin-top: 15px;
+	}
+
+	.btnbox {
+		padding: 20px 0px 0px 30px;
+
+		.btns {
+			width: 99px;
+			height: 32px;
+			background: #1890ff;
+			border-radius: 4px;
+			text-align: center;
+			line-height: 32px;
+			color: #ffffff;
+			cursor: pointer;
+		}
+	}
+
+	.table {
+		padding: 0;
+
+		img {
+			width: 40px;
+			height: 40px;
+		}
+	}
+
+	.search {
+		width: 86px;
+		height: 32px;
+		background: #1890ff;
+		border-radius: 4px;
+		text-align: center;
+		line-height: 32px;
+		font-size: 13px;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #ffffff;
+		cursor: pointer;
+	}
+
+	.reset {
+		width: 86px;
+		height: 32px;
+		border-radius: 4px;
+		border: 1px solid rgba(151, 151, 151, 0.36);
+		text-align: center;
+		line-height: 32px;
+		font-size: 13px;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: rgba(0, 0, 0, 0.85);
+		cursor: pointer;
+	}
+
+	.new_tab {
+		>>>.ivu-tabs-nav .ivu-tabs-tab {
+			padding: 4px 16px 20px !important;
+			font-weight: 500;
+		}
+	}
+</style>

+ 71 - 6
src/pages/user/list/handle/userDetails.vue

@@ -59,7 +59,24 @@
 							</div>
 						</template>
 						<template slot-scope="{ row }" slot="productTotal">
-								{{row.total == 0?'无上限':row.total}}
+							{{row.total == 0?'无上限':row.total}}
+						</template>
+						<template slot-scope="{ row }" slot="supplier_id">
+							<span v-if="row.supplier_id">
+								供货商(ID:{{row.supplier_id}})<br />
+								<span v-if="row.order_id">单号:{{row.order_id}}</span>
+								<span v-else-if='row.oid'>单号:{{row.oid}}</span>
+							</span>
+							<span v-else>
+								门店(ID:{{row.delivery_pid}})<br />
+								订单:{{row.order_id}}
+							</span>
+						</template>
+						<template slot-scope="{ row, index }" slot="nickname">
+							{{row.nickname}}
+							(UID:{{row.uid}})<br />
+							{{row.store_name}}
+							(门店ID:{{row.store_id}})
 						</template>
 					</Table>
 					<div class="acea-row row-right page">
@@ -153,6 +170,10 @@
 						val: 'shelves',
 						label: '货架'
 					},
+					{
+						val: 'shelves_num_log',
+						label: '货架变更'
+					},
 					// { val: 'balance_change', label: '余额变动' },
 					{
 						val: 'spread',
@@ -584,12 +605,12 @@
 								break;
 							case 'shelves':
 								this.columns = [
-									
+
 									{
-										title:'ID',
+										title: 'ID',
 										key: 'id',
 										minWidth: 80
-									},{
+									}, {
 										title: '本地库存',
 										key: 'number',
 										minWidth: 120
@@ -611,8 +632,52 @@
 									},
 								]
 								break;
-
-
+							case 'shelves_num_log':
+								this.columns = [
+									{
+											title: "购买",
+											slot: 'nickname',
+										},
+									{
+										title: "卖出",
+										slot: 'supplier_id',
+									},
+									{
+										title: "类型",
+										key: "type",
+										width: "80px",
+										align: "center"
+									},
+									{
+										title: "库存类型",
+										key: "stock_type",
+										width: "80px",
+										align: "center"
+									},
+									{
+										title: "货架",
+										key: "level_name",
+										width: "80px",
+										align: "center"
+									},
+									{
+										title: "数量",
+										key: "number",
+										width: "50px",
+										align: "center"
+									},
+									{
+										title: "增减",
+										key: "pm",
+										width: "50px",
+										align: "center"
+									},
+									{
+										title: "时间",
+										key: "add_time",
+									}
+								]
+								break;
 							case 'spread_change':
 								this.columns = [{
 										title: '推荐人ID',

+ 10 - 1
src/router/modules/agent.js

@@ -33,6 +33,15 @@ export default {
                 title: '分销说明'
             },
             component: () => import('@/pages/agent/agreement')
-        }
+        },
+		{
+		    path: 'allitem',
+		    name: `${pre}allitem`,
+		    meta: {
+		        auth: ['admin-order-allitem'],
+		        title: '团队统计'
+		    },
+		    component: () => import('@/pages/agent/allitem/index')
+		},
     ]
 };

+ 18 - 0
src/router/modules/order.js

@@ -40,6 +40,24 @@ export default {
             },
             component: () => import('@/pages/order/offline/index')
         },
+		{
+		    path: 'shelves',
+		    name: `${pre}shelves`,
+		    meta: {
+		        auth: ['admin-order-shelves'],
+		        title: '货架订单'
+		    },
+		    component: () => import('@/pages/order/shelves/index')
+		},
+		{
+		    path: 'firstList',
+		    name: `${pre}firstList`,
+		    meta: {
+		        auth: ['admin-order-firstList'],
+		        title: '奖励审核'
+		    },
+		    component: () => import('@/pages/order/firstList/index')
+		},
         {
             path: 'refund',
             name: `${pre}refund`,