lhl 1 tháng trước cách đây
mục cha
commit
b85cbffa4a

+ 41 - 0
src/api/marketing.js

@@ -1231,5 +1231,46 @@ export function seckillSetStatus(row) {
     });
 }
 
+/**
+ * 添加修改至尊卡
+ * @param {*} id
+ * @param {*} params
+ * @returns
+ */
+export function addSuper(data) {
+    return request({
+        url: `/user/user_supreme/save`,
+        method: 'post',
+		data
+    });
+}
+
+/**
+ * 添加修改至尊卡
+ * @param {*} id
+ * @param {*} params
+ * @returns
+ */
+export function superList(data) {
+    return request({
+        url: `/user/user_supreme/list`,
+        method: 'get',
+		params: data
+    });
+}
+
+/**
+ * 至尊卡详情
+ * @param {*} id
+ * @param {*} params
+ * @returns
+ */
+export function superInfo(id) {
+    return request({
+        url: `/user/user_supreme/read/` + id,
+        method: 'get',
+    });
+}
+
 
 

+ 20 - 0
src/api/store.js

@@ -635,3 +635,23 @@ export function cascaderList (type) {
 }
 
 
+//门店余额记录
+export function openYue (data) {
+    return request({
+        url: `store/store/bill`,
+        method: 'get',
+		params: data
+    });
+}
+
+//
+export function changeYue (data) {
+    return request({
+        url: `store/store/AddMoney`,
+        method: 'get',
+		params: data
+    });
+}
+// Route::get('store/AddMoney', 'v1.store.SystemStore/AddMoney')->option(['real_name' => '门店调整余额']);
+// Route::post('store/AddMoney:id', 'v1.store.SystemStore/MoneySave')->option(['real_name' => '门店余额保存']);
+// Route::get('store/bill', 'v1.store.SystemStore/bill')->option(['real_name' => '门店余额记录']);

+ 1 - 1
src/pages/erp/adjust/index.vue

@@ -62,7 +62,7 @@
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['admin-erp-add_position']" type="primary" @click="add" class="mr10">添加调价单</Button>
+			<Button v-auth="['admin-erp-adjust_add']" type="primary" @click="add" class="mr10">添加调价单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">

+ 3 - 3
src/pages/erp/godown/list.vue

@@ -29,7 +29,7 @@
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 相关操作 -->
 			<div>
-				<Button v-auth="['product-save-cate']" type="primary" class="bnt" @click="addClass">添加仓库</Button>
+				<Button v-auth="['admin-erp-add_godown']" type="primary" class="bnt" @click="addClass">添加仓库</Button>
 			</div>
 			<!-- 商品分类表格 -->
 			<vxe-table :data="tableData" ref="xTable" class="ivu-mt" highlight-hover-row :loading="loading"
@@ -58,8 +58,8 @@
 				</vxe-table-column>
 				<vxe-table-column field="date" title="操作" width="250" align="left">
 					<template v-slot="{ row, index }">
-						<a @click="edit(row)">编辑</a>
-						<Divider type="vertical" />
+						<a @click="edit(row)" v-auth="['admin-erp-add_godown']">编辑</a>
+						<Divider type="vertical" v-auth="['admin-erp-add_godown']"/>
 						<a @click="lookMore(row)">详情</a>
 						<!-- <a @click="del(row,'删除商品分类',index)">删除</a> -->
 					</template>

+ 2 - 2
src/pages/erp/godown/position.vue

@@ -72,8 +72,8 @@
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="look(row)">详情</a>
-					<Divider type="vertical" />
-					<a @click="edit(row)">编辑</a>
+					<Divider type="vertical" v-auth="['admin-erp-add_position']"/>
+					<a @click="edit(row)" v-auth="['admin-erp-add_position']">编辑</a>
 					<Divider type="vertical" />
 					<a @click="del(row, '删除仓位', index)">删除</a>
 				</template>

+ 48 - 5
src/pages/erp/in/index.vue

@@ -15,6 +15,14 @@
 							</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="商品:">
+						<Select v-model="tableFrom.product_id" filterable :remote-method="getGoodList"
+							:loading="loading1" clearable class="input-add">
+							<Option v-for="(option, index) in options1" :value="option.value" :key="option.value">
+								{{option.label}}
+							</Option>
+						</Select>
+					</FormItem>
 					<FormItem label="状态:" label-for="status">
 						<Select v-model="tableFrom.status" placeholder="请选择" clearable @on-change="userSearchs"
 							class="input-add">
@@ -26,12 +34,18 @@
 							<Option value="3">已上架</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="创建时间:" label-for="data">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="mr20 input-add"
+							:options="options"></DatePicker>
+					</FormItem>
+					<Button type="primary" @click="tableSearchs()">查询</Button>
 				</Form>
 			</div>
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">创建入库单</Button>
+			<Button v-auth="['admin-erp-add_inList']" type="primary" @click="add" class="mr10">创建入库单</Button>
 			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('in')" class="mr10">打印入库单</Button>
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt" @on-selection-change="checkItem">
@@ -75,8 +89,8 @@
 					<div>{{row.create_time | formatDate}}</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
-					<a v-if="row.status == 0" @click="auditing(row, index)">审核</a>
-					<Divider v-if="row.status == 0" type="vertical" />
+					<a v-if="row.status == 0" @click="auditing(row, index)" v-auth="['admin-erp-inList_sh']">审核</a>
+					<Divider v-if="row.status == 0" type="vertical" v-auth="['admin-erp-inList_sh']"/>
 					<a @click="info(row, index)">详情</a>
 					<Divider v-if="row.status == 3" type="vertical" />
 					<template v-if="row.status == 1 || row.status == 2">
@@ -165,7 +179,8 @@
 		getInList,
 		getInInfo,
 		listing,
-		getGodownList
+		getGodownList,
+		getGoods
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -349,12 +364,17 @@
 					page: 1,
 					limit: 10,
 					status: -3,
+					product_id: '',
+					
 					// total: 0,
 				},
 				inInfo: {},
 				infoList: [],
 				positionList: [],
-				basePosition: []
+				basePosition: [],
+				timeVal: [],
+				loading1: false,
+				options1: [],
 			};
 		},
 		computed: {
@@ -371,6 +391,29 @@
 			this.getGodownList()
 		},
 		methods: {
+			getGoodList(query) {
+				if (query !== '') {
+					this.loading1 = true;
+					getGoods({
+						key: query
+					}).then(res => {
+						this.loading1 = false;
+						this.options1 = res.data.data.map(item => {
+							return {
+								value: item.id,
+								label: item.store_name
+							};
+						})
+					})
+				} else {
+					this.options1 = [];
+				}
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.tableFrom.data = this.timeVal[0] ? this.timeVal.join("-") : "";
+			},
 			checkItem(e) {
 				this.checKList = e
 			},

+ 332 - 261
src/pages/erp/out/index.vue

@@ -2,14 +2,50 @@
 	<!-- 营销-积分商品 -->
 	<div>
 		<!-- tab切换栏 -->
-		
-		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0" v-if="currentTab == 0">
+
+		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
 			<div class="new_card_pd">
 				<!-- 查询条件 -->
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
 					<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 						:label-position="labelPosition" @submit.native.prevent>
+						<FormItem label="调出仓库:" prop="wid" label-for="wid">
+							<Select v-model="tableFrom.wid" @on-change="userSearchs" clearable class="input-add">
+								<Option v-for="item in data1" :value="item.id" :key="item.id">
+									{{ item.title }}
+								</Option>
+							</Select>
+						</FormItem>
+						<FormItem label="调入仓库:" prop="to_wid" label-for="to_wid">
+							<Select v-model="tableFrom.to_wid" @on-change="userSearchs" clearable class="input-add">
+								<Option v-for="item in data1" :value="item.id" :key="item.id">
+									{{ item.title }}
+								</Option>
+							</Select>
+						</FormItem>
+						<FormItem label="调出门店:">
+							<Select v-model="tableFrom.store_id" clearable filterable @on-change="userSearchs"
+								class="input-add">
+								<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+								</Option>
+							</Select>
+						</FormItem>
+						<FormItem label="调入门店:">
+							<Select v-model="tableFrom.to_store_id" clearable filterable @on-change="userSearchs"
+								class="input-add">
+								<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+								</Option>
+							</Select>
+						</FormItem>
+						<FormItem label="商品:">
+							<Select v-model="tableFrom.product_id" filterable :remote-method="getGoodList"
+								:loading="loading1" clearable class="input-add">
+								<Option v-for="(option, index) in options1" :value="option.value" :key="option.value">
+									{{option.label}}
+								</Option>
+							</Select>
+						</FormItem>
 						<FormItem label="状态:" label-for="status">
 							<Select v-model="tableFrom.status" placeholder="请选择" clearable @on-change="userSearchs"
 								class="input-add">
@@ -19,23 +55,28 @@
 								<Option :value="-1">拒绝</Option>
 							</Select>
 						</FormItem>
+						<FormItem label="创建时间:" label-for="data">
+							<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+								type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="mr20 input-add"
+								:options="options"></DatePicker>
+						</FormItem>
+						<Button type="primary" @click="tableSearchs()">查询</Button>
 					</Form>
 				</Form>
 			</div>
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<div class="new_tab">
-			  <Tabs v-model="currentTab" @on-click="onClickTab">
-			    <TabPane label="门店订单" name="0" />
-				<TabPane label="商品在途" name="1" />
-				<TabPane label="库间流转" name="2" />
-			  </Tabs>
+				<Tabs v-model="currentTab" @on-click="onClickTab">
+					<TabPane label="门店订单" name="0" />
+					<TabPane label="商品在途" name="1" />
+					<TabPane label="库间流转" name="2" />
+				</Tabs>
 			</div>
 			<!-- 操作 -->
 			<Button v-auth="['admin-erp-out_add']" type="primary" @click="add" class="mr10">创建出库单</Button>
 			<Button v-auth="['admin-erp-out_addt']" type="primary" @click="addt" class="mr10">创建调出单</Button>
-			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('out')"
-				class="mr10">打印出库单</Button>
+			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('out')" class="mr10">打印出库单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt" @on-selection-change="checkItem">
@@ -77,7 +118,7 @@
 								</div>
 							</div>
 						</div> -->
-				
+
 					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
@@ -112,17 +153,19 @@
 					</template>
 					<template v-if="row.status == 1">
 						<Divider type="vertical" />
-						<a @click="storeReceipt(row,1)" v-if="row.to_store_id">门店收货</a>
-						<a @click="storeReceipt(row,2)" v-if="row.to_wid">添加入库</a>
+						<a @click="storeReceipt(row,1)" v-if="row.to_store_id" v-auth="['admin-erp-out_store']">门店收货</a>
+						<a @click="storeReceipt(row,2)" v-if="row.to_wid" v-auth="['admin-erp-out_ware']">添加入库</a>
 					</template>
 					<template v-if="row.status == 3 && row.is_pay == 0">
 						<Divider type="vertical" />
-						<a @click="updatePay(row)" v-if="row.pay_status != 1 && row.pay_status != 2" v-auth="['admin-erp-adjusts_pjs']">提交结算</a>
-						<a @click="authPay(row)" v-if="row.pay_status == 1 " v-auth="['admin-erp-adjusts_shjs']">结算审核</a>
+						<a @click="updatePay(row)" v-if="row.pay_status != 1 && row.pay_status != 2"
+							v-auth="['admin-erp-adjusts_pjs']">提交结算</a>
+						<a @click="authPay(row)" v-if="row.pay_status == 1 "
+							v-auth="['admin-erp-adjusts_shjs']">结算审核</a>
 					</template>
 					<template v-if="row.status <= 0">
-						<Divider type="vertical" />
-						<a @click="del(row, '删除出库单', index)">删除</a>
+						<Divider type="vertical" v-auth="['admin-erp-out_del']" />
+						<a @click="del(row, '删除出库单', index)" v-auth="['admin-erp-out_del']">删除</a>
 					</template>
 				</template>
 			</Table>
@@ -132,151 +175,99 @@
 			</div>
 		</Card>
 		<outDetails ref="outDetail"></outDetails>
-		<Modal
-		  v-model="modalpass"
-		  scrollable
-		  title="审核"
-		  class="order_box"
-		  :closable="false"
-		  :mask-closable="false"
-		>
-		  <Form
-		    ref="remarks"
-		    :model="remarks"
-		    :label-width="80"
-		    @submit.native.prevent
-		  >
-		    <FormItem label="审核人:">
-		    
-			  <Select v-model="remarks.auth_uid" clearable filterable @on-change="userSearchse"
-			  	class="input-add">
-			  	<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
-			  	</Option>
-			  </Select>
-		    </FormItem>
-			<FormItem label="状态:">
-			  <Select v-model="remarks.status" clearable filterable 
-			  	class="input-add">
-			  	<Option :value="1" >通过</Option>
-				<Option :value="-1" >拒绝</Option>
-				<!-- <Option :value="2" >部分完成</Option>
+		<Modal v-model="modalpass" scrollable title="审核" class="order_box" :closable="false" :mask-closable="false">
+			<Form ref="remarks" :model="remarks" :label-width="80" @submit.native.prevent>
+				<FormItem label="审核人:">
+
+					<Select v-model="remarks.auth_uid" clearable filterable @on-change="userSearchse" class="input-add">
+						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
+						</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="状态:">
+					<Select v-model="remarks.status" clearable filterable class="input-add">
+						<Option :value="1">通过</Option>
+						<Option :value="-1">拒绝</Option>
+						<!-- <Option :value="2" >部分完成</Option>
 				<Option :value="3" >完成</Option>
 				<Option :value="-2" >无效</Option> -->
-			  </Select>
-			</FormItem>
-			
-		  </Form>
-		 
-		  <div slot="footer">
-		    <Button type="primary" @click="putRemark()">提交</Button>
-		    <Button @click="cancel()">取消</Button>
-		  </div>
+					</Select>
+				</FormItem>
+
+			</Form>
+
+			<div slot="footer">
+				<Button type="primary" @click="putRemark()">提交</Button>
+				<Button @click="cancel()">取消</Button>
+			</div>
 		</Modal>
-		<Modal
-		  v-model="modalJs"
-		  scrollable
-		  title="提交结算"
-		  class="order_box"
-		  :closable="false"
-		  :mask-closable="false"
-		>
-		  <Form
-		    ref="jsmodel"
-		    :model="jsData"
-		    :label-width="80"
-		    @submit.native.prevent
-		  >
-		    <FormItem label="结算人:">
-			  <Select v-model="jsData.pay_uid" clearable filterable @on-change="userSearchses"
-			  	class="input-add">
-			  	<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
-			  	</Option>
-			  </Select>
-		    </FormItem>
-			<FormItem label="凭证:">
-			  <div class="acea-row">
-			  	<div v-if="jsData.prove" class="pictrue">
-			  		<img v-lazy="jsData.prove" />
-			  		<Button shape="circle" icon="md-close" @click.native="jsData.prove = ''"
-			  			class="btndel"></Button>
-			  	</div>
-			  	<div v-else class="upLoad acea-row row-center-wrapper"
-			  		@click="modalPicTap('dan')">
-			  		<Icon type="ios-camera-outline" size="26" />
-			  	</div>
-			  	<!-- <Input v-model="jsData.prove" class="input-display"></Input> -->
-			  </div>
-			</FormItem>
-			<FormItem label="支付时间">
-			  <DatePicker
-			    :value="jsData.pay_time"
-			    type="datetime"
-			    placeholder="请选择支付时间"
-			    style="width: 200px"
-			    @on-change="onChange"
-			  />
-			</FormItem>
-		  </Form>
-		  <div slot="footer">
-		    <Button type="primary" @click="putJs()()">提交</Button>
-		    <Button @click="cancels()">取消</Button>
-		  </div>
-		  </Modal>
-		  <Modal
-		    v-model="modalAuthJs"
-		    scrollable
-		    title="提交结算"
-		    class="order_box"
-		    :closable="false"
-		    :mask-closable="false"
-		  >
-		    <Form
-		      ref="authjsmodel"
-		      :model="jsDatas"
-		      :label-width="80"
-		      @submit.native.prevent
-		    >
-		      <FormItem label="审核人:">
-		  	  <Select v-model="jsDatas.pay_auth_uid" clearable filterable @on-change="userSearchsess"
-		  	  	class="input-add">
-		  	  	<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
-		  	  	</Option>
-		  	  </Select>
-		      </FormItem>
-		  	<FormItem label="凭证:">
-		  	  <div class="acea-row">
-		  	  	<!-- <div  class="pictrue">
+		<Modal v-model="modalJs" scrollable title="提交结算" class="order_box" :closable="false" :mask-closable="false">
+			<Form ref="jsmodel" :model="jsData" :label-width="80" @submit.native.prevent>
+				<FormItem label="结算人:">
+					<Select v-model="jsData.pay_uid" clearable filterable @on-change="userSearchses" class="input-add">
+						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
+						</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="凭证:">
+					<div class="acea-row">
+						<div v-if="jsData.prove" class="pictrue">
+							<img v-lazy="jsData.prove" />
+							<Button shape="circle" icon="md-close" @click.native="jsData.prove = ''"
+								class="btndel"></Button>
+						</div>
+						<div v-else class="upLoad acea-row row-center-wrapper" @click="modalPicTap('dan')">
+							<Icon type="ios-camera-outline" size="26" />
+						</div>
+						<!-- <Input v-model="jsData.prove" class="input-display"></Input> -->
+					</div>
+				</FormItem>
+				<FormItem label="支付时间">
+					<DatePicker :value="jsData.pay_time" type="datetime" placeholder="请选择支付时间" style="width: 200px"
+						@on-change="onChange" />
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putJs()()">提交</Button>
+				<Button @click="cancels()">取消</Button>
+			</div>
+		</Modal>
+		<Modal v-model="modalAuthJs" scrollable title="提交结算" class="order_box" :closable="false" :mask-closable="false">
+			<Form ref="authjsmodel" :model="jsDatas" :label-width="80" @submit.native.prevent>
+				<FormItem label="审核人:">
+					<Select v-model="jsDatas.pay_auth_uid" clearable filterable @on-change="userSearchsess"
+						class="input-add">
+						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
+						</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="凭证:">
+					<div class="acea-row">
+						<!-- <div  class="pictrue">
 		  	  		<img v-lazy="jsDatas.prove" :preview-src-list="srcList"/>
 		  	  	</div> -->
-				<viewer>
-				  <div class="tabBox_img">
-				    <img v-lazy="jsDatas.prove" />
-				  </div>
-				</viewer>
-		  	  </div>
-		  	</FormItem>
-			<FormItem label="状态:">
-			  <Select v-model="jsDatas.pay_status" clearable filterable 
-			  	class="input-add">
-			  	<Option :value="2" >通过</Option>
-				<Option :value="-1" >拒绝</Option>
-			  </Select>
-			</FormItem>
-			<FormItem label="驳回原因:">
-			 <Input
-			    v-model="jsDatas.pay_remark"
-			    maxlength="200"
-			    show-word-limit
-			    type="textarea"
-			    placeholder="请填写驳回原因"
-			    style="width: 100%"
-			  />
-			</FormItem>
-		    </Form>
-		  <div slot="footer">
-		    <Button type="primary" @click="pJsAuth()">提交</Button>
-		    <Button @click="cancelss()">取消</Button>
-		  </div>
+						<viewer>
+							<div class="tabBox_img">
+								<img v-lazy="jsDatas.prove" />
+							</div>
+						</viewer>
+					</div>
+				</FormItem>
+				<FormItem label="状态:">
+					<Select v-model="jsDatas.pay_status" clearable filterable class="input-add">
+						<Option :value="2">通过</Option>
+						<Option :value="-1">拒绝</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="驳回原因:">
+					<Input v-model="jsDatas.pay_remark" maxlength="200" show-word-limit type="textarea"
+						placeholder="请填写驳回原因" style="width: 100%" />
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="pJsAuth()">提交</Button>
+				<Button @click="cancelss()">取消</Button>
+			</div>
 		</Modal>
 		<Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传凭证" :mask-closable="false"
 			:z-index="1">
@@ -287,11 +278,30 @@
 </template>
 
 <script>
-	import  outDetails from './outDetail.vue'
+	import outDetails from './outDetail.vue'
 	import uploadPictures from "@/components/uploadPictures";
-	import {mapState} from "vuex";
-	import {getOutSimpleList,getReceiveList,getOutLists,getOutInfo,getUserList,outSave,wareDelivery,pJs,pJsAuth} from "@/api/erp";
-	import {formatDate} from "@/utils/validate";
+	import {
+		mapState
+	} from "vuex";
+	import {
+		staffListInfo
+	} from "@/api/store";
+	import {
+		getOutSimpleList,
+		getReceiveList,
+		getOutLists,
+		getOutInfo,
+		getUserList,
+		outSave,
+		wareDelivery,
+		pJs,
+		pJsAuth,
+		getGodownList,
+		getGoods
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
 	import timeOptions from "@/utils/timeOptions";
 	import Setting from "@/setting";
 	export default {
@@ -310,6 +320,10 @@
 		},
 		data() {
 			return {
+				options1: [],
+				loading1: false,
+				options: timeOptions,
+				timeVal: [],
 				modalAuthJs: false,
 				modalJs: false,
 				isChoice: "",
@@ -330,38 +344,37 @@
 				modalPic: false,
 				jsDatas: {
 					id: 0,
-					prove:'',
-					pay_remark:'',
-					pay_status:1,
-					pay_auth_uid:'',
-					pay_auth_admin_id:''
+					prove: '',
+					pay_remark: '',
+					pay_status: 1,
+					pay_auth_uid: '',
+					pay_auth_admin_id: ''
 				},
 				jsData: {
 					id: 0,
 					is_pay: 0,
-					prove:'',
-					pay_time:'',
-					pay_admin_id:0,
+					prove: '',
+					pay_time: '',
+					pay_admin_id: 0,
 					pay_uid: 0,
 				},
-				authLists:[],
+				authLists: [],
 				remarks: {
 					id: 0,
 					status: '',
 					auth_uid: "",
 					auth_admin_id: "",
 				},
-				modalpass:false,
+				modalpass: false,
 				currentTab: 0,
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
-				columns1: [
-					{
-							type: 'selection',
-							width: 60,
-							align: 'center'
-						},{
+				columns1: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					}, {
 						title: "ID",
 						key: "id",
 						width: 80,
@@ -386,13 +399,13 @@
 						slot: "ware",
 						minWidth: 100,
 					},
-					
+
 					// {
 					// 	title: "调出门店",
 					// 	slot: "store",
 					// 	minWidth: 100,
 					// },
-					
+
 					{
 						title: "调入仓库/门店",
 						slot: "tware",
@@ -432,13 +445,19 @@
 				],
 				tableList: [],
 				tableFrom: {
-					status:-3,
+					to_wid: 0,
+					store_id: 0,
+					to_store_id: 0,
+					status: -3,
 					key: '',
 					page: 1,
 					limit: 10,
+					wid: 0
 				},
 				total: 0,
-				checKList:[]
+				checKList: [],
+				data1: [],
+				staffData: []
 			};
 		},
 		computed: {
@@ -452,21 +471,67 @@
 		},
 		created() {
 			this.getList();
+			this.getGodownList();
+			this.staffList()
 		},
 		methods: {
+			getGoodList(query) {
+				if (query !== '') {
+					this.loading1 = true;
+					// setTimeout(() => {
+					// 	this.loading1 = false;
+					// 	const list = this.list.map(item => {
+					// 		return {
+					// 			value: item,
+					// 			label: item
+					// 		};
+					// 	});
+					// 	this.options1 = list.filter(item => item.label.toLowerCase().indexOf(query.toLowerCase()) >
+					// 		-1);
+					// }, 200);
+					getGoods({
+						key: query
+					}).then(res => {
+						this.loading1 = false;
+						this.options1 = res.data.data.map(item => {
+							return {
+								value: item.id,
+								label: item.store_name
+							};
+						})
+					})
+
+				} else {
+					this.options1 = [];
+				}
+			},
+			staffList() {
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data;
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					this.data1 = res.data.data
+				})
+			},
 			pJsAuth() {
 				let that = this
-				if(!that.jsDatas.pay_auth_uid) {
+				if (!that.jsDatas.pay_auth_uid) {
 					return this.$Message.error('请选择审核人')
 				}
-				if(that.jsDatas.pay_status == 0 && that.jsDatas.pay_remark == '') {
+				if (that.jsDatas.pay_status == 0 && that.jsDatas.pay_remark == '') {
 					return this.$Message.error('请输入驳回原因')
 				}
-				pJsAuth(that.jsDatas.id,{
-					pay_remark:that.jsDatas.pay_remark,
-					pay_status:that.jsDatas.pay_status,
-					pay_auth_uid:that.jsDatas.pay_auth_uid,
-					pay_auth_admin_id:that.jsDatas.pay_auth_admin_id
+				pJsAuth(that.jsDatas.id, {
+					pay_remark: that.jsDatas.pay_remark,
+					pay_status: that.jsDatas.pay_status,
+					pay_auth_uid: that.jsDatas.pay_auth_uid,
+					pay_auth_admin_id: that.jsDatas.pay_auth_admin_id
 				}).then(res => {
 					that.$Message.success(res.msg);
 					that.cancelss()
@@ -475,16 +540,16 @@
 			},
 			putJs() {
 				let that = this
-				if(!that.jsData.pay_uid) {
+				if (!that.jsData.pay_uid) {
 					return this.$Message.error('请选择结算人')
 				}
-				if(!that.jsData.prove) {
+				if (!that.jsData.prove) {
 					return this.$Message.error('请上传凭证')
 				}
-				if(!that.jsData.pay_time) {
+				if (!that.jsData.pay_time) {
 					return this.$Message.error('请选择支付时间')
 				}
-				pJs(that.jsData.id,this.jsData).then(res => {
+				pJs(that.jsData.id, this.jsData).then(res => {
 					that.$Message.success(res.msg);
 					that.cancels()
 					that.getList()
@@ -517,12 +582,12 @@
 				// this.tableIndex = index;
 			},
 			authPay(row) {
-				this.jsDatas.prove= row.prove;
-				 this.jsDatas.id = row.id;
-				 getUserList().then(res => {
-				 	this.authLists = res.data.data
-				 	this.modalAuthJs = true;
-				 })
+				this.jsDatas.prove = row.prove;
+				this.jsDatas.id = row.id;
+				getUserList().then(res => {
+					this.authLists = res.data.data
+					this.modalAuthJs = true;
+				})
 			},
 			updatePay(row) {
 				let qdata = {}
@@ -537,10 +602,10 @@
 					this.authLists = res.data.data
 					this.modalJs = true;
 				})
-				
+
 			},
 			onChange(date) {
-			  this.jsData.pay_time = date;
+				this.jsData.pay_time = date;
 			},
 			checkItem(e) {
 				this.checKList = e
@@ -560,56 +625,57 @@
 					}
 				}))
 				window.open(routeData.href, '_blank')
-			
+
 			},
-			storeReceipt(row,type) {
+			storeReceipt(row, type) {
 				let url;
 				this.$router.push({
-					path: this.roterPre + "/erp/out_store?id=" +row.out_order_id +'&type=' + type,
+					path: this.roterPre + "/erp/out_store?id=" + row.out_order_id + '&type=' + type,
 				});
 			},
 			putRemark() {
 				this.remarks.auth_status = 0
-				outSave(this.remarks.id,this.remarks).then(res => {
+				outSave(this.remarks.id, this.remarks).then(res => {
 					this.cancel()
 					this.getList();
 				})
 			},
 			cancel() {
 				this.remarks = {
-					id:0,
+					id: 0,
 					status: '',
 					auth_uid: "",
-					auth_admin_id: "",}
-					this.modalpass = false
+					auth_admin_id: "",
+				}
+				this.modalpass = false
 			},
 			cancels() {
-				this.jsData= {
-					id: 0,
-					is_pay: 0,
-					prove:'',
-					pay_time:'',
-					pay_admin_id:0,
-					pay_uid: 0,
-				},
-				this.modalJs = false
+				this.jsData = {
+						id: 0,
+						is_pay: 0,
+						prove: '',
+						pay_time: '',
+						pay_admin_id: 0,
+						pay_uid: 0,
+					},
+					this.modalJs = false
 			},
 			cancelss() {
-				this.jsDatas= {
-					id: 0,
-					prove:'',
-					pay_remark:'',
-					pay_status:'',
-					pay_auth_uid:'',
-					pay_auth_admin_id:''
-				},
-				this.modalAuthJs = false
+				this.jsDatas = {
+						id: 0,
+						prove: '',
+						pay_remark: '',
+						pay_status: '',
+						pay_auth_uid: '',
+						pay_auth_admin_id: ''
+					},
+					this.modalAuthJs = false
 			},
 			pass(row) {
 				let qdata = {}
-				if(row.wid) {
+				if (row.wid) {
 					qdata.wid = row.wid
-				}else {
+				} else {
 					qdata.store_id = row.store_id
 				}
 				this.authLists = []
@@ -621,21 +687,21 @@
 			},
 			userSearchse(e) {
 				let auth = this.authLists.find(item => item.id == e)
-				console.log(auth,'auth');
+				console.log(auth, 'auth');
 				this.remarks.auth_admin_id = auth.admin_id
 			},
 			userSearchses(e) {
 				let auth = this.authLists.find(item => item.id == e)
-				console.log(auth,'auth');
+				console.log(auth, 'auth');
 				this.jsData.pay_admin_id = auth.admin_id
 			},
 			userSearchsess(e) {
 				let auth = this.authLists.find(item => item.id == e)
-				console.log(auth,'auth');
+				console.log(auth, 'auth');
 				this.jsDatas.pay_auth_admin_id = auth.admin_id
 			},
 			look(id) {
-					this.$refs.outDetail.getInfo(id);
+				this.$refs.outDetail.getInfo(id);
 				// this.
 				// getOutInfo(id).then(res => {
 				// 	console.log(id);
@@ -650,43 +716,46 @@
 			},
 			//切换状态
 			userSearchs(e) {
-				console.log(e,'status');
-				this.tableFrom.status = e
-				this.tableFrom.page = 1;
-				this.getList();
+				// console.log(e,'status');
+				// this.tableFrom.status = e
+				// this.tableFrom.page = 1;
+				// this.getList();
 			},
 			// 列表
 			getList() {
 				this.loading = true;
 				let getList = getReceiveList;
-				let qdata;
-				try{
-					if(this.currentTab == 1 || this.currentTab == 2) {
+				let qdata = this.tableFrom;
+				try {
+					if (this.currentTab == 1 || this.currentTab == 2) {
 						this.tableFrom.type = this.currentTab
-						getList = getOutSimpleList
-						qdata = {
-							status:-3,
-							key: this.tableFrom.key,
-							page:this.tableFrom.page,
-							limit: this.tableFrom.limit,
-							type: this.currentTab
-						}
+						getList = getOutSimpleList;
+						qdata.type = this.currentTab
+						// qdata = {
+						// 	status:-3,
+						// 	key: this.tableFrom.key,
+						// 	page:this.tableFrom.page,
+						// 	limit: this.tableFrom.limit,
+						// 	type: this.currentTab
+						// }
 					}
-					if(this.currentTab == 0){
+					if (this.currentTab == 0) {
 						getList = getOutLists
-						qdata = {
-							status:this.tableFrom.status,
-							key: this.tableFrom.key,
-							page:this.tableFrom.page,
-							limit: this.tableFrom.limit,
-							type: this.currentTab
-						}
+						qdata.type = this.currentTab;
+						qdata.status = this.tableFrom.status;
+						// qdata = {
+						// 	status:this.tableFrom.status,
+						// 	key: this.tableFrom.key,
+						// 	page:this.tableFrom.page,
+						// 	limit: this.tableFrom.limit,
+						// 	type: this.currentTab
+						// }
 					}
-				}catch(e){
+				} catch (e) {
 					//TODO handle the exception
-					console.log(e,'err');
+					console.log(e, 'err');
 				}
-				
+
 				getList(qdata)
 					.then(async (res) => {
 						let data = res.data;
@@ -787,7 +856,7 @@
 			// 具体日期
 			onchangeTime(e) {
 				this.timeVal = e;
-				this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.tableFrom.data = this.timeVal[0] ? this.timeVal.join("-") : "";
 			},
 			// 修改是否显示
 			onchangeIsShow(row) {
@@ -819,14 +888,16 @@
 			height: 100%;
 		}
 	}
+
 	.info {
 		padding-top: 10px;
 		// border-bottom: 1px dashed #515a6e;
-	
+
 		&:last-of-type {
 			border: none;
 		}
 	}
+
 	.pictrue {
 		width: 60px;
 		height: 60px;
@@ -836,12 +907,12 @@
 		display: inline-block;
 		position: relative;
 		cursor: pointer;
-	
+
 		img {
 			width: 100%;
 			height: 100%;
 		}
-	
+
 		.btndel {
 			position: absolute;
 			z-index: 1;
@@ -851,7 +922,7 @@
 			top: -4px;
 		}
 	}
-	
+
 	.upLoad {
 		width: 58px;
 		height: 58px;

+ 154 - 2
src/pages/erp/product/index.vue

@@ -33,6 +33,9 @@
 					<FormItem label="商品搜索:" label-for="name">
 						<Input class="input-add mr14" placeholder="请输入商品名称" v-model="tableFrom.key" />
 						<Button type="primary" @click="tableSearchs()">查询</Button>
+						<!-- <Input class="input-add mr14" placeholder="请输入商品名称" v-model="jgTime" />
+						<Button type="primary" @click="begin(0)">添加商品</Button>
+						<Button type="primary" @click="loadingss = false">本页结束停止</Button> -->
 					</FormItem>
 					<!-- <Button
             v-auth="['marketing-store_seckill-create']"
@@ -48,7 +51,7 @@
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['admin-erp-add_position']" type="primary" @click="add" class="mr10">添加商品</Button>
+			<Button v-auth="['admin-erp-product_add']" type="primary" @click="add" class="mr10">添加商品</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
@@ -82,7 +85,7 @@
 				<template slot-scope="{ row, index }" slot="action">
 				<!-- 	<a @click="look(row)">详情</a>
 					<Divider type="vertical" /> -->
-					<a @click="edit(row)">编辑</a>
+					<a @click="edit(row)" v-auth="['admin-erp-product_add']">编辑</a>
 					<!-- <Divider type="vertical" />
 					<a @click="del(row, '删除仓位', index)">删除</a> -->
 				</template>
@@ -101,6 +104,28 @@
 	import {
 		mapState
 	} from "vuex";
+	import {
+		productInfoApi,
+		cascaderListApi,
+		productAddApi,
+		generateAttrApi,
+		productGetRuleApi,
+		productGetTemplateApi,
+		productGetTempKeysApi,
+		checkActivityApi,
+		labelListApi,
+		productCache,
+		cacheDelete,
+		brandList,
+		productCreateApi,
+		productAllUnit,
+		productUnitCreate,
+		uploadType,
+		productAllEnsure,
+		productLabelAdd,
+		productAllSpecs,
+		allSystemForm
+	} from "@/api/product";
 	import {
 		integralProductListApi,
 		integralIsShowApi,
@@ -132,6 +157,7 @@
 		},
 		data() {
 			return {
+				jgTime: 50,
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
@@ -211,6 +237,7 @@
 					limit: 10,
 				},
 				total: 0,
+				loadingss: false
 			};
 		},
 		computed: {
@@ -226,6 +253,128 @@
 			this.getList();
 		},
 		methods: {
+			begin(index=0) {
+				// if(this.)
+				let that = this;
+				let len = that.tableList.length;
+				if(index == len) {
+					this.tableFrom.page++;
+					this.loadingss = true
+					this.getList()
+				};
+				console.log('开始');
+				setTimeout(()=> {
+					that.upGoods(that.tableList[index],index)
+				},that.jgTime)
+				// that.upGoods(that.tableList[index],index)
+			},
+			upGoods(good,index) {
+				let qdata = {
+				    "is_weigh": good.is_weigh,
+				    "applicable_store_id": [],
+				    "system_form_id": 0,
+				    "is_presale_product": 0,
+				    "is_limit": 0,
+				    "limit_type": 1,
+				    "limit_num": 1,
+				    "is_vip_product": 0,
+				    "is_support_refund": 1,
+				    "disk_info": "",
+				    "presale_day": 1,
+				    "presale_time": [],
+				    "auto_on_time": "",
+				    "video_open": false,
+				    "store_name": good.store_name,
+				    "freight": 1,
+				    "postage": 0,
+				    "custom_form": [],
+				    "cate_id": [
+				        1,
+				        2
+				    ],
+				    "label_id": [],
+				    "ensure_id": [],
+				    "keyword": "",
+				    "applicable_type": 1,
+				    "unit_name": good.unit_name,
+				    "specs_id": 0,
+				    "store_info": "",
+				    "bar_code": "",
+				    "code": "",
+				    "image": "",
+				    "recommend_image": "",
+				    "slider_image": [
+				        "https://shop.yiqucguoyuan.com/uploads/attach/2024/07/20240724/efb26cf8e741fa950209589f58e0df5a.png"
+				    ],
+				    "description": "<p>"+ good.store_name + "<br/></p>",
+				    "ficti": 0,
+				    "give_integral": 0,
+				    "sort": 0,
+				    "is_show": 1,
+				    "is_hot": 0,
+				    "is_benefit": 0,
+				    "is_best": 0,
+				    "is_new": 0,
+				    "is_good": 0,
+				    "is_postage": 0,
+				    "is_sub": [],
+				    "id": 0,
+				    "spec_type": 0,
+				    "video_link": "",
+				    "temp_id": "",
+				    "attrs": [
+				        {
+				            "pic": "https://shop.yiqucguoyuan.com/uploads/attach/2024/07/20240724/efb26cf8e741fa950209589f58e0df5a.png",
+				            "price": good.price,
+				            "settle_price": 0,
+				            "cost": 0,
+				            "ot_price": 0,
+				            "erp_product_id": good.id,
+				            "unit": good.unit_name,
+				            "uint_to_erp_unit": 1,
+				            "bar_code": good.bar_code,
+				            "code": "",
+				            "weight": good.is_weigh,
+				            "volume": 0,
+				            "brokerage": 0,
+				            "brokerage_two": 0,
+				            "vip_price": good.vip_price,
+				            "virtual_list": [],
+				            "write_times": 0,
+				            "write_valid": 1,
+				            "days": 1
+				        }
+				    ],
+				    "items": [],
+				    "activity": [
+				        "默认",
+				        "秒杀",
+				        "砍价",
+				        "拼团"
+				    ],
+				    "couponName": [],
+				    "header": [],
+				    "selectRule": "",
+				    "coupon_ids": [],
+				    "command_word": "",
+				    "delivery_type": [
+				        "1",
+				        "3",
+				        "2"
+				    ],
+				    "specs": [],
+				    "recommend_list": [],
+				    "brand_id": [],
+				    "product_type": 0,
+				    "type": 0,
+				    "store_label_id": []
+				}
+				productAddApi(qdata).then(res => {
+					this.$Message.success(res.msg);
+					index++;
+					this.begin(index);
+				})
+			},
 			look(row) {
 				try{
 					this.$refs.productDetail.getInfo(row.id)
@@ -319,6 +468,9 @@
 						this.tableList = data.data;
 						this.total = data.count;
 						this.loading = false;
+						if(this.loadingss && this.tableList.length > 0) {
+							this.begin(0)
+						}
 					})
 					.catch((res) => {
 						this.loading = false;

+ 178 - 205
src/pages/erp/purchase/index.vue

@@ -6,30 +6,6 @@
 				<!-- 查询条件 -->
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
-					<!-- <FormItem label="创建时间:" label-for="user_time">
-            <DatePicker
-                :editable="false"
-                @on-change="onchangeTime"
-                :value="timeVal"
-                format="yyyy/MM/dd"
-                type="datetimerange"
-                placement="bottom-start"
-                placeholder="自定义时间"
-                class="mr20 input-add"
-                :options="options"
-            ></DatePicker>
-          </FormItem> -->
-					<!-- <FormItem label="上架状态:">
-            <Select
-                placeholder="请选择"
-                clearable
-                class="input-add"
-                v-model="tableFrom.is_show"
-            >
-              <Option value="1">上架</Option>
-              <Option value="0">下架</Option>
-            </Select>
-          </FormItem> -->
 					<FormItem label="仓库:" prop="pid" label-for="pid">
 						<Select v-model="tableFrom.wid" @on-change="userSearchss" clearable class="input-add">
 							<Option v-for="item in data1" :value="item.id" :key="item.id">
@@ -37,7 +13,7 @@
 							</Option>
 						</Select>
 					</FormItem>
-					<FormItem label="审核人:" v-if="tableFrom.wid">
+					<FormItem label="审核人:" >
 						<Select v-model="tableFrom.auth_uid" clearable filterable @on-change="userSearchs"
 							class="input-add">
 							<Option v-for="item in authList" :value="item.id" :key="item.id">{{ item.staff_name }}
@@ -58,6 +34,14 @@
 							</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="商品:">
+						<Select v-model="tableFrom.product_id" filterable :remote-method="getGoodList"
+							:loading="loading1" clearable class="input-add">
+							<Option v-for="(option, index) in options1" :value="option.value" :key="option.value">
+								{{option.label}}
+							</Option>
+						</Select>
+					</FormItem>
 					<FormItem label="状态:" label-for="status">
 						<Select v-model="tableFrom.status" placeholder="请选择" clearable @on-change="userSearchs"
 							class="input-add">
@@ -69,6 +53,11 @@
 							<Option value="-1">拒绝</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="创建时间:" label-for="data">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="mr20 input-add"
+							:options="options"></DatePicker>
+					</FormItem>
 					<FormItem label="关键字搜索:" label-for="key">
 						<Input class="input-add mr14" placeholder="请输入要货单或采购单" v-model="tableFrom.key" />
 						<Button type="primary" @click="tableSearchs()">查询</Button>
@@ -146,16 +135,18 @@
 					<a @click="look(row)">详情</a>
 					<!-- 				<Divider type="vertical" v-if="row.status == 0" />
 					<a @click="edit(row)" v-if="row.status == 0">编辑</a> -->
-					<Divider type="vertical" v-if="row.status == 0" />
-					<a @click="pass(row)" v-if="row.status == 0">审核</a>
-					<Divider type="vertical" v-if="row.status == 1" />
-					<a @click="end(row)" v-if="row.status == 1">完成</a>
+					<Divider type="vertical" v-if="row.status == 0" v-auth="['admin-erp-purchase_sh']" />
+					<a @click="pass(row)" v-if="row.status == 0" v-auth="['admin-erp-purchase_sh']">审核</a>
+					<Divider type="vertical" v-if="row.status == 1" v-auth="['admin-erp-purchase_wc']" />
+					<a @click="end(row)" v-if="row.status == 1" v-auth="['admin-erp-purchase_wc']">完成</a>
 					<Divider type="vertical" v-if="row.status <1" />
 					<a @click="del(row, '删除采购单', index)" v-if="row.status <1">删除</a>
 					<template v-if="row.status == 3 && row.is_pay == 0">
 						<Divider type="vertical" />
-						<a @click="updatePay(row)" v-if="row.pay_status != 1 && row.pay_status != 2" v-auth="['admin-erp-purchase-pjs']">提交结算</a>
-						<a @click="authPay(row)" v-if="row.pay_status == 1 " v-auth="['admin-erp-purchase-shjs']">结算审核</a>
+						<a @click="updatePay(row)" v-if="row.pay_status != 1 && row.pay_status != 2"
+							v-auth="['admin-erp-purchase-pjs']">提交结算</a>
+						<a @click="authPay(row)" v-if="row.pay_status == 1 "
+							v-auth="['admin-erp-purchase-shjs']">结算审核</a>
 					</template>
 				</template>
 			</Table>
@@ -226,108 +217,70 @@
 				<Button @click="cancel1()">取消</Button>
 			</div>
 		</Modal>
-		<Modal
-		  v-model="modalJs"
-		  scrollable
-		  title="提交结算"
-		  class="order_box"
-		  :closable="false"
-		  :mask-closable="false"
-		>
-		  <Form
-		    ref="jsmodel"
-		    :model="jsData"
-		    :label-width="80"
-		    @submit.native.prevent
-		  >
-		    <FormItem label="结算人:">
-			  <Select v-model="jsData.pay_uid" clearable filterable @on-change="pJsAuthList"
-			  	class="input-add">
-			  	<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
-			  	</Option>
-			  </Select>
-		    </FormItem>
-			<FormItem label="凭证:">
-			  <div class="acea-row">
-			  	<div v-if="jsData.prove" class="pictrue">
-			  		<img v-lazy="jsData.prove" />
-			  		<Button shape="circle" icon="md-close" @click.native="jsData.prove = ''"
-			  			class="btndel"></Button>
-			  	</div>
-			  	<div v-else class="upLoad acea-row row-center-wrapper"
-			  		@click="modalPicTap('dan')">
-			  		<Icon type="ios-camera-outline" size="26" />
-			  	</div>
-			  	<!-- <Input v-model="jsData.prove" class="input-display"></Input> -->
-			  </div>
-			</FormItem>
-			<FormItem label="支付时间">
-			  <DatePicker
-			    :value="jsData.pay_time"
-			    type="datetime"
-			    placeholder="请选择支付时间"
-			    style="width: 200px"
-			    @on-change="onChange"
-			  />
-			</FormItem>
-		  </Form>
-		  <div slot="footer">
-		    <Button type="primary" @click="putJs()">提交</Button>
-		    <Button @click="cancels()">取消</Button>
-		  </div>
-		  </Modal>
-		  <Modal
-		    v-model="modalAuthJs"
-		    scrollable
-		    title="审核结算"
-		    class="order_box"
-		    :closable="false"
-		    :mask-closable="false"
-		  >
-		    <Form
-		      ref="authjsmodel"
-		      :model="jsDatas"
-		      :label-width="80"
-		      @submit.native.prevent
-		    >
-		      <FormItem label="审核人:">
-		  	  <Select v-model="jsDatas.pay_auth_uid" clearable filterable @on-change="pJsAuthAuthList"
-		  	  	class="input-add">
-		  	  	<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
-		  	  	</Option>
-		  	  </Select>
-		      </FormItem>
-		  	<FormItem label="凭证:">
-		  	  <div class="acea-row">
-				<viewer>
-				  <div class="tabBox_img">
-				    <img v-lazy="jsDatas.prove" />
-				  </div>
-				</viewer>
-		  	  </div>
-		  	</FormItem>
-			<FormItem label="状态:">
-			  <Select v-model="jsDatas.pay_status" clearable filterable 
-			  	class="input-add">
-			  	<Option :value="2" >通过</Option>
-				<Option :value="-1" >拒绝</Option>
-			  </Select>
-			</FormItem>
-			<FormItem label="驳回原因:">
-			 <Input
-			    v-model="jsDatas.pay_remark"
-			    maxlength="200"
-			    show-word-limit
-			    type="textarea"
-			    placeholder="请填写驳回原因"
-			    style="width: 100%"
-			  />
-			</FormItem>
-		    </Form>
-		  <div slot="footer">
-		    <Button type="primary" @click="pJsAuth()">提交</Button>
-		    <Button @click="cancelss()">取消</Button>
-		  </div>
+		<Modal v-model="modalJs" scrollable title="提交结算" class="order_box" :closable="false" :mask-closable="false">
+			<Form ref="jsmodel" :model="jsData" :label-width="80" @submit.native.prevent>
+				<FormItem label="结算人:">
+					<Select v-model="jsData.pay_uid" clearable filterable @on-change="pJsAuthList" class="input-add">
+						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
+						</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="凭证:">
+					<div class="acea-row">
+						<div v-if="jsData.prove" class="pictrue">
+							<img v-lazy="jsData.prove" />
+							<Button shape="circle" icon="md-close" @click.native="jsData.prove = ''"
+								class="btndel"></Button>
+						</div>
+						<div v-else class="upLoad acea-row row-center-wrapper" @click="modalPicTap('dan')">
+							<Icon type="ios-camera-outline" size="26" />
+						</div>
+						<!-- <Input v-model="jsData.prove" class="input-display"></Input> -->
+					</div>
+				</FormItem>
+				<FormItem label="支付时间">
+					<DatePicker :value="jsData.pay_time" type="datetime" placeholder="请选择支付时间" style="width: 200px"
+						@on-change="onChange" />
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putJs()">提交</Button>
+				<Button @click="cancels()">取消</Button>
+			</div>
+		</Modal>
+		<Modal v-model="modalAuthJs" scrollable title="审核结算" class="order_box" :closable="false" :mask-closable="false">
+			<Form ref="authjsmodel" :model="jsDatas" :label-width="80" @submit.native.prevent>
+				<FormItem label="审核人:">
+					<Select v-model="jsDatas.pay_auth_uid" clearable filterable @on-change="pJsAuthAuthList"
+						class="input-add">
+						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
+						</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="凭证:">
+					<div class="acea-row">
+						<viewer>
+							<div class="tabBox_img">
+								<img v-lazy="jsDatas.prove" />
+							</div>
+						</viewer>
+					</div>
+				</FormItem>
+				<FormItem label="状态:">
+					<Select v-model="jsDatas.pay_status" clearable filterable class="input-add">
+						<Option :value="2">通过</Option>
+						<Option :value="-1">拒绝</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="驳回原因:">
+					<Input v-model="jsDatas.pay_remark" maxlength="200" show-word-limit type="textarea"
+						placeholder="请填写驳回原因" style="width: 100%" />
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="pJsAuth()">提交</Button>
+				<Button @click="cancelss()">取消</Button>
+			</div>
 		</Modal>
 		<Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传凭证" :mask-closable="false"
 			:z-index="1">
@@ -358,7 +311,8 @@
 		savePurchase,
 		getPurchaseDetail,
 		cJs,
-		cJsAuth
+		cJsAuth,
+		getGoods
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -410,18 +364,18 @@
 				modalPic: false,
 				jsDatas: {
 					id: 0,
-					prove:'',
-					pay_remark:'',
-					pay_status:1,
-					pay_auth_uid:'',
-					pay_auth_admin_id:''
+					prove: '',
+					pay_remark: '',
+					pay_status: 1,
+					pay_auth_uid: '',
+					pay_auth_admin_id: ''
 				},
 				jsData: {
 					id: 0,
 					is_pay: 0,
-					prove:'',
-					pay_time:'',
-					pay_admin_id:0,
+					prove: '',
+					pay_time: '',
+					pay_admin_id: 0,
 					pay_uid: 0,
 				},
 				list: [],
@@ -490,12 +444,11 @@
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
-				columns1: [
-					{
-							type: 'selection',
-							width: 60,
-							align: 'center'
-						}, {
+				columns1: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					}, {
 						title: "ID",
 						key: "id",
 						width: 80,
@@ -581,6 +534,7 @@
 					supplier_id: "",
 					status: '-3',
 					auth_uid: "",
+					data: '',
 					// integral_time: "",
 					// is_show: "",
 					// store_name: "",
@@ -589,7 +543,9 @@
 					limit: 10,
 				},
 				total: 0,
-				checKList: []
+				checKList: [],
+				loading1: false,
+				options1: []
 			};
 		},
 		computed: {
@@ -609,51 +565,70 @@
 			this.getSupplierList()
 			this.staffList()
 			this.getGodownList()
+			this.getUserList()
 		},
 		methods: {
+			getGoodList(query) {
+				if (query !== '') {
+					this.loading1 = true;
+					getGoods({
+						key: query
+					}).then(res => {
+						this.loading1 = false;
+						this.options1 = res.data.data.map(item => {
+							return {
+								value: item.id,
+								label: item.store_name
+							};
+						})
+					})
+				} else {
+					this.options1 = [];
+				}
+			},
 			pJsAuthList(e) {
 				let auth = this.authLists.find(item => item.id == e)
-				console.log(auth,'auth');
+				console.log(auth, 'auth');
 				this.jsData.pay_admin_id = auth.admin_id
 			},
 			pJsAuthAuthList(e) {
 				let auth = this.authLists.find(item => item.id == e)
-				console.log(auth,'auth');
+				console.log(auth, 'auth');
 				this.jsDatas.pay_auth_admin_id = auth.admin_id
 			},
 			putJs() {
 				let that = this
-				if(!that.jsData.pay_uid) {
+				if (!that.jsData.pay_uid) {
 					return this.$Message.error('请选择结算人')
 				}
-				if(!that.jsData.prove) {
+				if (!that.jsData.prove) {
 					return this.$Message.error('请上传凭证')
 				}
-				if(!that.jsData.pay_time) {
+				if (!that.jsData.pay_time) {
 					return this.$Message.error('请选择支付时间')
 				}
-				pJs(that.jsData.id,this.jsData).then(res => {
+				pJs(that.jsData.id, this.jsData).then(res => {
 					that.$Message.success(res.msg);
 					that.cancels()
 					that.getList()
 				})
 			},
 			onChange(date) {
-			  this.jsData.pay_time = date;
+				this.jsData.pay_time = date;
 			},
 			pJsAuth() {
 				let that = this
-				if(!that.jsDatas.pay_auth_uid) {
+				if (!that.jsDatas.pay_auth_uid) {
 					return this.$Message.error('请选择审核人')
 				}
-				if(that.jsDatas.pay_status == 0 && that.jsDatas.pay_remark == '') {
+				if (that.jsDatas.pay_status == 0 && that.jsDatas.pay_remark == '') {
 					return this.$Message.error('请输入驳回原因')
 				}
-				cJsAuth(that.jsDatas.id,{
-					pay_remark:that.jsDatas.pay_remark,
-					pay_status:that.jsDatas.pay_status,
-					pay_auth_uid:that.jsDatas.pay_auth_uid,
-					pay_auth_admin_id:that.jsDatas.pay_auth_admin_id
+				cJsAuth(that.jsDatas.id, {
+					pay_remark: that.jsDatas.pay_remark,
+					pay_status: that.jsDatas.pay_status,
+					pay_auth_uid: that.jsDatas.pay_auth_uid,
+					pay_auth_admin_id: that.jsDatas.pay_auth_admin_id
 				}).then(res => {
 					that.$Message.success(res.msg);
 					that.cancelss()
@@ -662,16 +637,16 @@
 			},
 			putJs() {
 				let that = this
-				if(!that.jsData.pay_uid) {
+				if (!that.jsData.pay_uid) {
 					return this.$Message.error('请选择结算人')
 				}
-				if(!that.jsData.prove) {
+				if (!that.jsData.prove) {
 					return this.$Message.error('请上传凭证')
 				}
-				if(!that.jsData.pay_time) {
+				if (!that.jsData.pay_time) {
 					return this.$Message.error('请选择支付时间')
 				}
-				cJs(that.jsData.id,this.jsData).then(res => {
+				cJs(that.jsData.id, this.jsData).then(res => {
 					that.$Message.success(res.msg);
 					that.cancels()
 					that.getList()
@@ -697,26 +672,26 @@
 				this.modalPic = false;
 			},
 			cancelss() {
-				this.jsDatas= {
-					id: 0,
-					prove:'',
-					pay_remark:'',
-					pay_status:'',
-					pay_auth_uid:'',
-					pay_auth_admin_id:''
-				},
-				this.modalAuthJs = false
+				this.jsDatas = {
+						id: 0,
+						prove: '',
+						pay_remark: '',
+						pay_status: '',
+						pay_auth_uid: '',
+						pay_auth_admin_id: ''
+					},
+					this.modalAuthJs = false
 			},
 			cancels() {
-				this.jsData= {
-					id: 0,
-					is_pay: 0,
-					prove:'',
-					pay_time:'',
-					pay_admin_id:0,
-					pay_uid: 0,
-				},
-				this.modalJs = false
+				this.jsData = {
+						id: 0,
+						is_pay: 0,
+						prove: '',
+						pay_time: '',
+						pay_admin_id: 0,
+						pay_uid: 0,
+					},
+					this.modalJs = false
 			},
 			modalPicTap(tit) {
 				this.isChoice = tit === "dan" ? "单选" : "多选";
@@ -726,29 +701,29 @@
 				// this.tableIndex = index;
 			},
 			authPay(row) {
-				this.jsDatas.prove= row.prove;
-				 this.jsDatas.id = row.id;
-				 getUserList().then(res => {
-				 	this.authLists = res.data.data
-				 	this.modalAuthJs = true;
-				 })
+				this.jsDatas.prove = row.prove;
+				this.jsDatas.id = row.id;
+				getUserList().then(res => {
+					this.authLists = res.data.data
+					this.modalAuthJs = true;
+				})
 			},
 			updatePay(row) {
-				try{
+				try {
 					this.authLists = []
 					this.jsData.id = row.id
 					getUserList().then(res => {
 						this.authLists = res.data.data
 						this.modalJs = true;
 					})
-				}catch(e){
+				} catch (e) {
 					console.log(e)
 					//TODO handle the exception
 				}
-				
-					
-				
-				
+
+
+
+
 			},
 			printing(name) {
 				if (this.checKList.length == 0) {
@@ -889,10 +864,7 @@
 				})
 			},
 			getUserList() {
-				getUserList({
-					wid: this.tableFrom.wid
-				}).then(res => {
-					// console.log(res);
+				getUserList().then(res => {
 					this.authList = res.data.data
 				})
 			},
@@ -1034,7 +1006,7 @@
 			// 具体日期
 			onchangeTime(e) {
 				this.timeVal = e;
-				this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.tableFrom.data = this.timeVal[0] ? this.timeVal.join("-") : "";
 			},
 			// 修改是否显示
 			onchangeIsShow(row) {
@@ -1066,6 +1038,7 @@
 			height: 100%;
 		}
 	}
+
 	.pictrue {
 		width: 60px;
 		height: 60px;
@@ -1075,12 +1048,12 @@
 		display: inline-block;
 		position: relative;
 		cursor: pointer;
-	
+
 		img {
 			width: 100%;
 			height: 100%;
 		}
-	
+
 		.btndel {
 			position: absolute;
 			z-index: 1;
@@ -1090,7 +1063,7 @@
 			top: -4px;
 		}
 	}
-	
+
 	.upLoad {
 		width: 58px;
 		height: 58px;

+ 46 - 22
src/pages/erp/receive/index.vue

@@ -6,19 +6,7 @@
 				<!-- 查询条件 -->
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
-					<!-- <FormItem label="创建时间:" label-for="user_time">
-            <DatePicker
-                :editable="false"
-                @on-change="onchangeTime"
-                :value="timeVal"
-                format="yyyy/MM/dd"
-                type="datetimerange"
-                placement="bottom-start"
-                placeholder="自定义时间"
-                class="mr20 input-add"
-                :options="options"
-            ></DatePicker>
-          </FormItem> -->
+					
 					<!-- <FormItem label="上架状态:">
             <Select
                 placeholder="请选择"
@@ -51,9 +39,23 @@
 							</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="商品:">
+						<Select v-model="tableFrom.product_id" filterable :remote-method="getGoodList"
+							:loading="loading1" clearable class="input-add">
+							<Option v-for="(option, index) in options1" :value="option.value" :key="option.value">
+								{{option.label}}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="创建时间:" label-for="data">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="mr20 input-add"
+							:options="options"></DatePicker>
+					</FormItem>
+					<Button type="primary" @click="tableSearchs()">查询</Button>
 					<!-- <FormItem label="用户搜索:" label-for="store_name">
 						<Input class="input-add mr14" placeholder="请输入用户昵称/手机号" v-model="tableFrom.key" />
-						<Button type="primary" @click="tableSearchs()">查询</Button>
+						
 					</FormItem> -->
 					<!-- <Button
             v-auth="['marketing-store_seckill-create']"
@@ -69,7 +71,7 @@
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">添加要货</Button>
+			<!-- <Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">添加要货</Button> -->
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
@@ -151,8 +153,8 @@
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="look(row)">详情</a>
 					<template v-if="row.to_store_id && row.status == 0">
-						<Divider type="vertical" />
-						<a @click="pass(row)">审核</a>
+						<Divider type="vertical" v-auth="['admin-erp-receive_sh']" />
+						<a @click="pass(row)" v-auth="['admin-erp-receive_sh']">审核</a>
 					</template>
 					<!-- <Divider type="vertical" />
 					<a @click="del(row, '删除积分商品', index)">删除</a> -->
@@ -206,7 +208,8 @@
 		getGodownList,
 		getUserList,
 		getReceiveList,
-		storeAuth
+		storeAuth,
+		getGoods
 	} from "@/api/erp";
 	import {
 		staffListInfo
@@ -339,6 +342,7 @@
 					// is_show: "",
 					// store_name: "",
 					// key: '',
+					data: '',
 					create_uid: "",
 					store_id: "",
 					wid: "",
@@ -351,7 +355,9 @@
 				total: 0,
 				staffData: [],
 				data1: [],
-				authList: []
+				authList: [],
+				loading1: false,
+				options1: [],
 			};
 		},
 		computed: {
@@ -372,6 +378,24 @@
 			this.getUserList()
 		},
 		methods: {
+			getGoodList(query) {
+				if (query !== '') {
+					this.loading1 = true;
+					getGoods({
+						key: query
+					}).then(res => {
+						this.loading1 = false;
+						this.options1 = res.data.data.map(item => {
+							return {
+								value: item.id,
+								label: item.store_name
+							};
+						})
+					})
+				} else {
+					this.options1 = [];
+				}
+			},
 			look(row) {
 				this.$refs.receiveDetail.storeInfo(row.id);
 			},
@@ -415,8 +439,8 @@
 				})
 			},
 			userSearchs(e) {
-				this.tableFrom.page = 1;
-				this.getList();
+				// this.tableFrom.page = 1;
+				// this.getList();
 			},
 			getGodownList() {
 				getGodownList().then(res => {
@@ -542,7 +566,7 @@
 			// 具体日期
 			onchangeTime(e) {
 				this.timeVal = e;
-				this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.tableFrom.data = this.timeVal[0] ? this.timeVal.join("-") : "";
 			},
 			// 修改是否显示
 			onchangeIsShow(row) {

+ 2 - 9
src/pages/erp/user/index.vue

@@ -41,17 +41,10 @@
 				<template slot-scope="{ row, index }" slot="store">
 					<span> {{row.store && row.store.id ? row.store.name: ''}}</span>
 				</template>
-				<template slot-scope="{ row, index }" slot="is_show">
-					<i-switch v-model="row.is_show" :value="row.is_show" :true-value="1" :false-value="0"
-						@on-change="onchangeIsShow(row)" size="large">
-						<span slot="open">上架</span>
-						<span slot="close">下架</span>
-					</i-switch>
-				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="look(row)">详情</a>
-					<Divider type="vertical" />
-					<a @click="edit(row)">编辑</a>
+					<Divider type="vertical" v-auth="['admin-erp-user_add']"/>
+					<a @click="edit(row)" v-auth="['admin-erp-user_add']">编辑</a>
 				</template>
 			</Table>
 			<div class="acea-row row-right page">

+ 60 - 58
src/pages/erp/want/index.vue

@@ -6,19 +6,7 @@
 				<!-- 查询条件 -->
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
-					<!-- <FormItem label="创建时间:" label-for="user_time">
-            <DatePicker
-                :editable="false"
-                @on-change="onchangeTime"
-                :value="timeVal"
-                format="yyyy/MM/dd"
-                type="datetimerange"
-                placement="bottom-start"
-                placeholder="自定义时间"
-                class="mr20 input-add"
-                :options="options"
-            ></DatePicker>
-          </FormItem> -->
+					
 					<!-- <FormItem label="上架状态:">
             <Select
                 placeholder="请选择"
@@ -30,20 +18,35 @@
               <Option value="0">下架</Option>
             </Select>
           </FormItem> -->
-					<FormItem label="仓库:" prop="pid" label-for="pid">
+					<FormItem label="出货仓库:" prop="pid" label-for="pid">
 						<Select v-model="tableFrom.wid" @on-change="userSearchs" clearable class="input-add">
 							<Option v-for="item in data1" :value="item.id" :key="item.id">
 								{{ item.title }}
 							</Option>
 						</Select>
 					</FormItem>
-					<FormItem label="门店:">
+					<FormItem label="出货门店:">
 						<Select v-model="tableFrom.store_id" clearable filterable @on-change="userSearchs"
 							class="input-add">
 							<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
 							</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="要货门店:">
+						<Select v-model="tableFrom.my_store_id" clearable filterable @on-change="userSearchs"
+							class="input-add">
+							<Option v-for="item in staffData" :value="item.id" :key="item.id">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="商品:">
+						<Select v-model="tableFrom.product_id" filterable :remote-method="getGoodList"
+							:loading="loading1" clearable class="input-add">
+							<Option v-for="(option, index) in options1" :value="option.value" :key="option.value">
+								{{option.label}}
+							</Option>
+						</Select>
+					</FormItem>
 					<FormItem label="创建人:">
 						<Select v-model="tableFrom.create_uid" clearable filterable @on-change="userSearchs"
 							class="input-add">
@@ -51,13 +54,22 @@
 							</Option>
 						</Select>
 					</FormItem>
-					<!--<Button v-auth="['export-storeSeckill']" class="export" icon="ios-share-outline" @click="exports">导出</Button>-->
+					<FormItem label="创建时间:" label-for="data">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="datetimerange" placement="bottom-start" placeholder="自定义时间" class="mr20 input-add"
+							:options="options"></DatePicker>
+					</FormItem>
+					<FormItem label="关键字搜索:" label-for="key">
+						<Input class="input-add mr14" placeholder="请输入要货单" v-model="tableFrom.key" />
+					</FormItem>
+					<Button type="primary" @click="tableSearchs()">查询</Button>
+					<!-- <Button v-auth="['export-storeSeckill']" class="export" icon="ios-share-outline" @click="exports">导出</Button> -->
 				</Form>
 			</div>
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">添加要货</Button>
+			<Button v-auth="['admin-erp-want_add']" type="primary" @click="add" class="mr10">添加要货</Button>
 			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('want')" class="mr10">打印要货单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
@@ -77,24 +89,12 @@
 				</template>
 				<template slot-scope="{ row, index }" slot="auser">
 					<div>{{row.auser.staff_name}}</div>
-					<!-- <div>名称:{{row.auser.staff_name}}</div>
-					<div>管理员ID:{{row.auser.admin_id}}</div>
-					<div>ID:{{row.auser.id}}</div>
-					<div>手机:{{row.auser.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="cuser">
 					<div>{{row.cuser.staff_name}}</div>
-					<!-- <div>名称:{{row.cuser.staff_name}}</div>
-					<div>管理员ID:{{row.cuser.admin_id}}</div>
-					<div>ID:{{row.cuser.id}}</div>
-					<div>手机:{{row.cuser.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
 					<div>{{row.ware.title}}</div>
-					<!-- <div>名称:{{row.ware.title}}</div>
-					<div>ID:{{row.ware.id}}</div>
-					<div>手机:{{row.ware.phone}}</div>
-					<div>地址:{{row.ware.detailed_address}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="info">
 					<!-- {{row.info}} -->
@@ -103,32 +103,13 @@
 						<div>
 							{{item.product_name}}<a>{{item.want_product_num*1}}{{' '}}{{item.unit_name}}</a>
 						</div>
-						<!-- 	<div>
-							商品ID:{{item.product_id}}
-						</div>
-						<div>
-							数量:{{item.want_product_num*1}}{{' '}}{{item.unit_name}}
-						</div> -->
 					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="mystore">
 					<div>{{row.mystore.name}}</div>
-					<!-- <viewer style="display: flex;">
-						<div class="tabBox_img">
-							<img v-lazy="row.mystore.image" />
-						</div>
-						<div>门店:{{row.mystore.name}}<br>ID:{{row.mystore.id}}</div>
-					</viewer> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
 					<div>{{row.store.name}}</div>
-					<!-- <viewer style="display: flex;">
-						<div class="tabBox_img">
-							<img v-lazy="row.store.image" />
-						</div>
-						<div>门店:{{row.store.name}}<br>ID:{{row.store.id}}</div>
-					</viewer> -->
-
 				</template>
 				<template slot-scope="{ row, index }" slot="is_system">
 					<span> {{ row.is_system ? '是': '否'}}</span>
@@ -151,12 +132,12 @@
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="look(row)">详情</a>
 					<template v-if="row.status == 0">
-						<Divider type="vertical" />
-						<a @click="edit(row)">编辑</a>
-						<Divider type="vertical" />
-						<a @click="pass(row)">审核</a>
-						<Divider type="vertical" />
-						<a @click="del(row, '删除要货单', index)">删除</a>
+						<Divider type="vertical" v-auth="['admin-erp-want_add']" />
+						<a @click="edit(row)" v-auth="['admin-erp-want_add']">编辑</a>
+						<Divider type="vertical" v-auth="['admin-erp-want_sh']" />
+						<a @click="pass(row)" v-auth="['admin-erp-want_sh']">审核</a>
+						<Divider type="vertical" v-auth="['admin-erp-want_add']" />
+						<a @click="del(row, '删除要货单', index)" v-auth="['admin-erp-want_add']">删除</a>
 					</template>
 
 				</template>
@@ -217,7 +198,8 @@
 		getGodownList,
 		getUserList,
 		seveWant,
-		getWantInfo
+		getWantInfo,
+		getGoods
 	} from "@/api/erp";
 	import {
 		staffListInfo
@@ -373,6 +355,8 @@
 				authList: [],
 				authLists: [],
 				checKList: [], //选中的列表
+				loading1:false,
+				options1: []
 			};
 		},
 		computed: {
@@ -393,6 +377,24 @@
 			this.getUserList()
 		},
 		methods: {
+			getGoodList(query) {
+				if (query !== '') {
+					this.loading1 = true;
+					getGoods({
+						key: query
+					}).then(res => {
+						this.loading1 = false;
+						this.options1 = res.data.data.map(item => {
+							return {
+								value: item.id,
+								label: item.store_name
+							};
+						})
+					})
+				} else {
+					this.options1 = [];
+				}
+			},
 			checkItem(e) {
 				this.checKList = e
 				console.log(e, 'e');
@@ -439,8 +441,8 @@
 				})
 			},
 			userSearchs(e) {
-				this.tableFrom.page = 1;
-				this.getList();
+				// this.tableFrom.page = 1;
+				// this.getList();
 			},
 			userSearchse(e) {
 				let auth = this.authLists.find(item => item.id == e)
@@ -575,7 +577,7 @@
 			// 具体日期
 			onchangeTime(e) {
 				this.timeVal = e;
-				this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.tableFrom.data = this.timeVal[0] ? this.timeVal.join("-") : "";
 			},
 			// 修改是否显示
 			onchangeIsShow(row) {

+ 834 - 0
src/pages/marketing/super/create.vue

@@ -0,0 +1,834 @@
+<template>
+	<div class="form-submit">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title">
+					<router-link :to="{ path: `${roterPre}/marketing/super/index` }">
+						<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 :model="formData" :label-width="150">
+
+				<FormItem label="至尊卡名称" required>
+					<Input v-model="formData.name" v-width="320" placeholder="请输入至尊卡名称"></Input>
+				</FormItem>
+				<FormItem label="至尊卡等级" required>
+					<Input v-model="formData.grade" v-width="320" type="number" placeholder="请输入至尊卡等级"></Input>
+				</FormItem>
+				<FormItem label="全局折扣(%)" required>
+					<Input v-model="formData.discount" v-width="320" type="number" placeholder="请输入全局折扣"></Input>
+				</FormItem>
+				<FormItem label="图标:" prop="icon">
+					<div class="picBox" @click="modalPicTap('icon')">
+						<div class="pictrue" v-if="formData.icon"><img v-lazy="formData.icon"></div>
+						<div class="upLoad" v-else>
+							<div class="iconfont">+</div>
+						</div>
+					</div>
+				</FormItem>
+				<FormItem label="背景:" prop="image">
+					<div class="picBox" @click="modalPicTap('image')">
+						<div class="pictrue" v-if="formData.image"><img v-lazy="formData.image"></div>
+						<div class="upLoad" v-else>
+							<div class="iconfont">+</div>
+						</div>
+					</div>
+				</FormItem>
+				<FormItem label="是否永久">
+					<RadioGroup v-model="formData.is_forever">
+						<Radio :label="0">否</Radio>
+						<Radio :label="1">是</Radio>
+					</RadioGroup>
+				</FormItem>
+				<FormItem v-show="!formData.is_forever" label="">
+					<InputNumber :min="1" v-model="formData.valid_date" :precision="0"></InputNumber>
+					<div class="info">领取后多少天内有效</div>
+				</FormItem>
+				<FormItem label="备注">
+					<Input v-model="formData.mark" v-width="320" placeholder="备注"></Input>
+				</FormItem>
+				<FormItem label="是否显示">
+					<i-switch v-model="formData.is_show" :true-value="1" :false-value="0" size="large">
+						<span slot="open">显示</span>
+						<span slot="close">隐藏</span>
+					</i-switch>
+				</FormItem>
+				<FormItem label="关联商品">
+					<Col span="20">
+					<div class="acea-row row-between-wrapper">
+						<div>
+							<Button type="primary" @click="addGoods">添加商品</Button>
+							<!-- <Button @click="batchSet" class="ml20" :disabled="!isAllChecked && !checkPidList.length">批量设置</Button>
+					      <Button @click="delAll" class="ml20" :disabled="!isAllChecked && !checkPidList.length">批量删除</Button> -->
+						</div>
+						<!-- <div class="goodsWord">
+					      <FormItem label="商品搜索:">
+					        <Input class="w_input240" v-model="keyword" placeholder="请输入商品关键词" @on-change="searchWord"></Input>
+					      </FormItem>
+					    </div> -->
+					</div>
+					</Col>
+					<Col span="20">
+					<div class="vxeTable">
+						<vxe-table border="inner" ref="xTree" :column-config="{resizable: true}" row-id="id"
+							:tree-config="{children: 'attrValue',reserve:true}" @checkbox-all="checkboxAll"
+							@checkbox-change="checkboxItem"
+							:data="(searchTableData.length || keyword)?searchTableData:tableData">
+							<vxe-column title="" width="90" tree-node></vxe-column>
+							<vxe-column field="info" title="商品信息" min-width="300" >
+								<template v-slot="{ row }">
+									<div class="imgPic acea-row row-middle">
+										<viewer>
+											<div class="pictrue"><img v-lazy="row.image" /></div>
+										</viewer>
+										<div class="info">
+											<Tooltip max-width="200" placement="bottom" transfer>
+												<span class="line2">{{ row.store_name }}{{row.suk}}</span>
+												<p slot="content">{{ row.store_name }}{{row.suk}}</p>
+											</Tooltip>
+										</div>
+									</div>
+								</template>
+							</vxe-column>
+							<!-- <vxe-column field="info" title="商品信息" min-width="300" v-if="$route.params.id == 0">
+								<template v-slot="{ row }">
+									<div class="imgPic acea-row row-middle">
+										<div class="info">
+											<Tooltip max-width="200" placement="bottom" transfer>
+												<span class="line2">{{ row.store_name }}{{row.suk}}</span>
+												<p slot="content">{{ row.store_name }}{{row.suk}}</p>
+											</Tooltip>
+										</div>
+									</div>
+								</template>
+							</vxe-column> -->
+							<vxe-column field="price" title="价格" min-width="150">
+								<template v-slot="{ row }">
+									<div v-if="row.parent == 1">——</div>
+									<vxe-input v-else v-model="row.price" min="0" placeholder="请输入价格" type="float"
+										digits="2" step="1"></vxe-input>
+								</template>
+							</vxe-column>
+							<vxe-column field="price" title="限购天数" min-width="150">
+								<template v-slot="{ row }">
+									<div v-if="row.parent == 1">——</div>
+									<vxe-input v-else v-model="row.days" min="0" placeholder="请输入限购天数" type="float"
+										digits="2" step="1"></vxe-input>
+								</template>
+							</vxe-column>
+							<vxe-column field="price" title="限购次数" min-width="150">
+								<template v-slot="{ row }">
+									<div v-if="row.parent == 1">——</div>
+									<vxe-input v-else v-model="row.number" min="0" placeholder="请输入限购次数" type="float"
+										digits="2" step="1"></vxe-input>
+								</template>
+							</vxe-column>
+							<vxe-column field="cost" title="成本价" min-width="80"></vxe-column>
+							<vxe-column field="ot_price" title="原价" min-width="80"></vxe-column>
+							<vxe-column field="is_yue" title="不可用余额" min-width="100">
+								<template v-slot="{ row }">
+									<i-switch v-if="row.parent != 1" v-model="row.is_yue" :value="row.is_yue"
+										@on-change="onchangeIsShow(row)" size="large">
+										<span slot="open">是</span>
+										<span slot="close">否</span>
+									</i-switch>
+									<div v-else>——</div>
+								</template>
+							</vxe-column>
+							<vxe-column field="date" title="操作" min-width="100" fixed="right" align="center">
+								<template v-slot="{ row }">
+									<a @click="del(row)" v-if="row.parent == 1">删除</a>
+								</template>
+							</vxe-column>
+						</vxe-table>
+					</div>
+					</Col>
+				</FormItem>
+			</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="save" :disabled="disabled">{{$route.params.id == 0?'立即创建': '修改'}}</Button>
+				</FormItem>
+			</Form>
+		</Card>
+		<!-- 选择商品-->
+		<Modal v-model="modals" title="商品列表" footerHide scrollable width="900" @on-cancel="cancel">
+			<goods-list ref="goodslist" :ischeckbox="true" :isdiy="true" :goodsType="1" @getProductId="getProductId"
+				v-if="modals"></goods-list>
+		</Modal>
+		<Modal v-model="storeModals" title="门店列表" footerHide scrollable width="900" @on-cancel="cancelStore">
+			<store-list ref="storelist" @getStoreId="getStoreId" v-if="storeModals"></store-list>
+		</Modal>
+
+		<Modal v-model="modalPic" width="960px" scrollable footer-hide closable title='上传' :mask-closable="false"
+			:z-index="1">
+			<uploadPictures :isChoice="isChoice" @getPic="getPic" :gridBtn="gridBtn" :gridPic="gridPic" v-if="modalPic">
+			</uploadPictures>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import storeList from "@/components/storeList";
+	import goodsList from '@/components/goodsList';
+	import {
+		couponCategoryApi,
+		couponSaveApi,
+		addSuper,
+		couponDetailApi,
+		superInfo
+	} from "@/api/marketing";
+	import {
+		brandList
+	} from "@/api/product";
+	// import { formatDate } from '@/utils/validate';
+	import Setting from "@/setting";
+	import uploadPictures from '@/components/uploadPictures';
+	export default {
+		name: "storeCouponCreate",
+		components: {
+			goodsList,
+			storeList,
+			uploadPictures
+		},
+		data() {
+			return {
+				checkPidList: [], //父级有关id集合 (需求禁止删除子级,用于删除整个商品)
+				isAllChecked: false, //表头是否被选中
+				gridPic: {
+					xl: 6,
+					lg: 8,
+					md: 12,
+					sm: 12,
+					xs: 12
+				},
+				gridBtn: {
+					xl: 4,
+					lg: 8,
+					md: 8,
+					sm: 8,
+					xs: 8
+				},
+				isChoice: '单选',
+				modalPic: false,
+				roterPre: Setting.roterPre,
+				disabled: false,
+				storesList: [],
+				formData: {
+					name: "",
+					is_forever: 0,
+					valid_date: 0,
+					grade: '',
+					discount: '',
+					icon: '',
+					image: '',
+					is_show: 1,
+					mark: '',
+					product: [],
+					id: 0,
+				},
+				categoryList: [],
+				brandList: [],
+				productList: [],
+				isMinPrice: 0,
+				isCouponTime: 1,
+				isReceiveTime: 0,
+				modals: false,
+				datetime1: [],
+				datetime2: [],
+				storeModals: false,
+				currentTab: '1',
+				imageType: '',
+				chooseModals: false,
+				keyword: '',
+				searchTableData: [],
+				tableData: [],
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+		},
+		created() {
+			this.getBrandList();
+			this.getCategoryList();
+			if (this.$route.params.id) {
+				this.formData.id = this.$route.params.id
+				this.getCouponDetail();
+			}
+		},
+		methods: {
+			onchangeIsShow(row) {
+				// this.tableData.forEach(item=>{
+				// item.attrValue.forEach(i => {
+				// 	if(row.unique == i.unique) {
+				// 		console.log('i.is_yue:',i.is_yue);
+				// 		// i.is_yue = !i.is_yue;
+				// 	}
+				// })
+				// })
+			},
+			getProductId(data) {
+				this.modals = false;
+				let list = this.tableData.concat(data);
+				let uni = this.unique(list);
+				uni.forEach((i) => {
+					i.parent = 1;
+					i.status = 1;
+					i.attrValue.forEach(j => {
+						j.cate_name = i.cate_name;
+						j.store_label = i.store_label;
+						j.is_yue = j.is_yue ? true : false;
+					})
+				})
+				this.tableData = uni;
+				console.log(uni,'uni')
+			},
+			checkboxItem(e) {
+				let id = parseInt(e.rowid);
+				if (e.row.product_id) {
+					// let index = this.checkUidList.indexOf(id);
+					// if(index !== -1){
+					//   this.checkUidList = this.checkUidList.filter((item)=> item !== id);
+					// }else{
+					//   this.checkUidList.push(id);
+					// }
+					let pIndex = this.checkPidList.indexOf(e.row.product_id);
+					if (pIndex !== -1 && !e.checked) {
+						this.checkPidList = this.checkPidList.filter((item) => item !== e.row.product_id);
+					}
+					if (pIndex === -1 && e.checked) {
+						this.checkPidList.push(e.row.product_id);
+					}
+				} else {
+					let pIndex = this.checkPidList.indexOf(id);
+					if (pIndex !== -1 && !e.checked) {
+						this.checkPidList = this.checkPidList.filter((item) => item !== id);
+					}
+					if (pIndex === -1 && e.checked) {
+						this.checkPidList.push(id);
+					}
+				}
+				this.isAllChecked = this.$refs.xTree.isAllCheckboxChecked();
+			},
+			checkboxAll() {
+				this.isAllChecked = this.$refs.xTree.isAllCheckboxChecked();
+				if (!this.isAllChecked) {
+					this.checkPidList = [];
+				}
+				console.log('fgfg', this.isAllChecked);
+			},
+			searchWord() {
+				let list = []
+				this.tableData.forEach(item => {
+					let obj = item.store_name.indexOf(this.keyword);
+					if (obj != -1) {
+						list.push(item)
+					}
+				})
+				if (this.keyword) {
+					this.searchTableData = list;
+				} else {
+					this.searchTableData = []
+				}
+			},
+			addGoods() {
+				this.modals = true;
+			},
+			// 选择商品
+			changeGoods() {
+				this.modals = true;
+			},
+			// 选择图片
+			modalPicTap(type) {
+				this.imageType = type;
+				this.modalPic = true;
+				this.$refs.formItem.validateField("image")
+			},
+			// 选中图片
+			getPic(pc) {
+				this.formData[this.imageType] = pc.att_dir;
+				this.modalPic = false;
+				// this.$refs.formItem.validateField("image")
+			},
+			//删除门店
+			delte(row) {
+				this.storesList.forEach((item, index) => {
+					if (row.id == item.id) {
+						this.storesList.splice(index, 1)
+					}
+				})
+			},
+
+			//添加门店
+			addStore() {
+				this.storeModals = true;
+			},
+
+			//关闭门店弹窗
+			cancelStore() {
+				this.storeModals = false;
+			},
+			uniqueId(arr) {
+				const res = new Map();
+				return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
+			},
+			unique(arr) {
+				const res = new Map();
+				return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
+			},
+			getStoreId(data) {
+				this.storeModals = false;
+				let list = this.storesList.concat(data);
+				let uni = this.uniqueId(list);
+				this.storesList = uni;
+			},
+			// 品类
+			getCategoryList() {
+				couponCategoryApi(1).then(async (res) => {
+					res.data.forEach((val) => {
+						val.cate_name = `${val.html}${val.cate_name}`;
+					});
+					this.categoryList = res.data;
+				});
+			},
+			//品牌
+			getBrandList() {
+				brandList().then(res => {
+					this.brandList = res.data;
+				})
+			},
+			// 至尊卡
+			getCouponDetail() {
+				superInfo(this.$route.params.id)
+					.then((res) => {
+						let data = res.data[0];
+						this.formData.name = data.name;
+						this.formData.is_forever = data.is_forever;
+						this.formData.grade = data.grade;
+						this.formData.discount = data.discount;
+						this.formData.valid_date = data.valid_date / 60 / 60 / 24;
+						this.formData.icon = data.icon;
+						this.formData.image = data.image;
+						this.formData.is_show = data.is_show;
+						this.formData.mark = data.mark;
+						let list = []
+						data.product.forEach(item => {
+							let obj = {
+								image: item.info[0].attrValue.image,
+								store_name: item.product_name,
+								cost: item.info[0].attrValue.cost,
+								ot_price: item.info[0].attrValue.ot_price,
+								parent: 1,
+								status: 1,
+								id: item.product_id
+							}
+							let arr = []
+							try{
+								item.info.forEach(j => {
+									arr.push({
+										unique: j.unique,
+										price: j.price,
+										ot_price: j.attrValue.ot_price,
+										cost: j.attrValue.cost,
+										image: j.attrValue.image,
+										suk: j.attrValue.suk,
+										is_yue: j.is_yue? true:false,
+										days: j.days || 0,
+										number: j.number|| 0
+									})
+								})
+							}catch(e){
+								console.log(e,'err')
+								//TODO handle the exception
+							}
+							
+							obj.attrValue = arr
+							list.push(obj)
+						})
+						this.tableData = list
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			makeDate(data) {
+				let date = new Date(data);
+				let YY = date.getFullYear() + "-";
+				let MM =
+					(date.getMonth() + 1 < 10 ?
+						"0" + (date.getMonth() + 1) :
+						date.getMonth() + 1) + "-";
+				let DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+				let hh =
+					(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
+				let mm =
+					(date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
+					":";
+				let ss =
+					date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
+				return YY + MM + DD + " " + hh + mm + ss;
+			},
+			// 上一页:
+			upTab() {
+				if (this.currentTab == '2') {
+					this.currentTab = (Number(this.currentTab) - 1).toString();
+				}
+			},
+			// 创建
+			save() {
+				let that = this
+				if (!that.formData.name) {
+					return that.$Message.error("请输入至尊卡名称");
+				}
+				if (!that.formData.grade) {
+					return that.$Message.error("请输入至尊卡等级");
+				}
+				if (!that.formData.is_forever && that.formData.valid_date <= 0) {
+					return that.$Message.error("请输入有效天数");
+				}
+				if (!that.formData.icon) {
+					return that.$Message.error("请选择图标");
+				}
+				if (!that.formData.image) {
+					return that.$Message.error("请选择背景");
+				}
+				if (!that.formData.discount) {
+					return that.$Message.error("请输入全局则扣");
+				}
+				let list = [];
+				that.tableData.forEach(item => {
+					let obj = {
+						product_id: item.id
+					}
+					let info = [];
+					item.attrValue.forEach(i => {
+						info.push({
+							unique: i.unique,
+							price: i.price,
+							is_yue: i.is_yue ? 1 : 0,
+							days: i.days,
+							number: i.number
+						})
+					})
+					obj.info = info;
+					list.push(obj)
+				})
+				addSuper({
+						id: that.formData.id,
+						name: that.formData.name,
+						valid_date: that.is_forever ? 0 : that.formData.valid_date,
+						is_forever: that.formData.is_forever,
+						grade: that.formData.grade,
+						discount: that.formData.discount,
+						icon: that.formData.icon,
+						image: that.formData.image,
+						is_show: that.formData.is_show,
+						mark: that.formData.mark,
+						product: list,
+					})
+					.then((res) => {
+						this.disabled = true;
+						this.$Message.success(res.msg);
+						setTimeout(() => {
+							this.$router.push({
+								path: this.roterPre + "/marketing/super/index",
+							});
+						}, 1000);
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			cancel() {
+				this.modals = false;
+			},
+			// 删除商品
+			remove(productId) {
+				for (let index = 0; index < this.productList.length; index++) {
+					if (this.productList[index].product_id == productId) {
+						this.productList.splice(index, 1);
+					}
+				}
+				this.formData.product_id = "";
+				this.productList.forEach((value) => {
+					if (this.formData.product_id) {
+						this.formData.product_id += `,${value.product_id}`;
+					} else {
+						this.formData.product_id += `${value.product_id}`;
+					}
+				});
+			},
+			//批量设置
+			batchSet() {
+				this.modalsSet = true;
+			},
+			//批量删除
+			delAll() {
+				if (this.isAllChecked && (this.tableData.length == this.searchTableData.length || !this.searchTableData
+						.length)) {
+					this.tableData = []
+				} else {
+					this.tableData = this.tableData.filter(item => !this.checkPidList.some(ele => ele === item.id));
+				}
+				this.checkPidList = [];
+				this.isAllChecked = false;
+			},
+			//删除
+			del(row) {
+				if (this.searchTableData.length) {
+					this.searchTableData.forEach((i, index) => {
+						if (row.id == i.id) {
+							this.searchTableData.splice(index, 1)
+						}
+					})
+					this.tableData.forEach((i, index) => {
+						if (row.id == i.id) {
+							return this.tableData.splice(index, 1)
+						}
+					})
+				} else {
+					this.tableData.forEach((i, index) => {
+						if (row.id == i.id) {
+							return this.tableData.splice(index, 1)
+						}
+					})
+				}
+				if (this.isAllChecked && !this.tableData.length) {
+					this.isAllChecked = false;
+					this.checkPidList = []
+				} else {
+					let index = this.checkPidList.indexOf(row.id);
+					this.checkPidList.splice(index, 1)
+				}
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999999;
+		margin-top: 10px;
+	}
+
+	.imgPic {
+		.info {
+			width: 60%;
+			margin-left: 10px;
+		}
+
+		.pictrue {
+			height: 36px;
+			margin: 7px 3px 0 3px;
+
+			img {
+				height: 100%;
+				display: block;
+			}
+		}
+	}
+
+	.productType {
+		width: 120px;
+		height: 60px;
+		background: #FFFFFF;
+		border-radius: 3px;
+		border: 1px solid #E7E7E7;
+		float: left;
+		text-align: center;
+		padding-top: 8px;
+		position: relative;
+		cursor: pointer;
+		line-height: 23px;
+		margin-right: 12px;
+
+		&.on {
+			border-color: #1890FF;
+		}
+
+		.name {
+			font-size: 14px;
+			font-weight: 600;
+			color: rgba(0, 0, 0, 0.85);
+
+			&.on {
+				color: #1890FF;
+			}
+		}
+
+		.title {
+			font-size: 12px;
+			font-weight: 400;
+			color: #999999;
+		}
+
+		.jiao {
+			position: absolute;
+			bottom: 0;
+			right: 0;
+			width: 0;
+			height: 0;
+			border-bottom: 26px solid #1890FF;
+			border-left: 26px solid transparent;
+		}
+
+		.iconfont {
+			position: absolute;
+			bottom: -3px;
+			right: 1px;
+			color: #FFFFFF;
+			font-size: 12px;
+		}
+	}
+
+	.info {
+		color: #888;
+		font-size: 12px;
+	}
+
+	.ivu-input-wrapper {
+		width: 320px;
+	}
+
+	.ivu-input-number {
+		width: 160px;
+	}
+
+	.ivu-date-picker {
+		width: 320px;
+	}
+
+	.ivu-icon-ios-camera-outline {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		background-color: rgba(0, 0, 0, 0.02);
+		line-height: 58px;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list {
+		width: 58px;
+		height: 58px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		border-radius: 4px;
+		margin-right: 15px;
+		display: inline-block;
+		position: relative;
+		cursor: pointer;
+		vertical-align: middle;
+	}
+
+	.upload-list img {
+		display: block;
+		width: 100%;
+		height: 100%;
+	}
+
+	.ivu-icon-ios-close-circle {
+		position: absolute;
+		top: 0;
+		right: 0;
+		transform: translate(50%, -50%);
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 99;
+			box-shadow: 0 -1px 2px rgb(240, 240, 240);
+
+			/deep/ .ivu-card-body {
+				padding: 15px 16px 14px;
+			}
+
+			.ivu-form-item {
+				margin-bottom: 0;
+			}
+
+			/deep/ .ivu-form-item-content {
+				margin-right: 124px;
+				text-align: center;
+			}
+
+			.ivu-btn {
+				height: 36px;
+				padding: 0 20px;
+			}
+		}
+	}
+
+	/deep/.vxe-tree-cell {
+		padding-left: 0 !important;
+	}
+
+	.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);
+		}
+
+		.pictrue {
+			width: 60px;
+			height: 60px;
+			border: 1px dotted rgba(0, 0, 0, 0.1);
+			margin-right: 10px;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+
+		}
+
+		.iconfont {
+			color: #CCCCCC;
+			font-size 26px;
+			text-align center
+		}
+
+	}
+
+	.vxeTable {
+		border-top: 1px dotted #eee;
+		margin-top 20px;
+	}
+
+	/deep/ .vxe-tree--btn-wrapper {
+		left: 0;
+	}
+</style>

+ 364 - 0
src/pages/marketing/super/index.vue

@@ -0,0 +1,364 @@
+<template>
+	<!-- 营销-优惠券列表 -->
+	<div>
+
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 操作 -->
+			<Button v-auth="['admin-marketing-store_coupon-add']" type="primary" @click="add">添加至尊卡</Button>
+			<!-- 优惠券列表-表格 -->
+			<Table :columns="columns1" :data="tableList" ref="table" class="ivu-mt" :loading="loading" highlight-row
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row }" slot="coupon_price">
+					<span v-if="row.coupon_type==1">{{row.coupon_price}}元</span>
+					<span
+						v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
+				</template>
+				<template slot-scope="{ row }" slot="count">
+					<span v-if="row.is_permanent">不限量</span>
+					<div v-else>
+						<span class="fa">发布:{{row.total_count}}</span>
+						<span class="sheng">剩余:{{row.remain_count}}</span>
+					</div>
+				</template>
+				<template slot-scope="{ row }" slot="coupon_type">
+					<span v-if="row.coupon_type === 1">满减券</span>
+					<span v-else>折扣券</span>
+				</template>
+				<template slot-scope="{ row }" slot="valid_date">
+					<span>{{row.valid_date/60/60/24}}</span>天
+				</template>
+				<template slot-scope="{ row }" slot="coupon_title">
+					<Tooltip max-width="200" placement="bottom">
+						<span class="line2">{{row.coupon_title}}</span>
+						<p slot="content">{{row.coupon_title}}</p>
+					</Tooltip>
+				</template>
+				<!-- <template slot-scope="{ row }" slot="receive_type">
+					<span v-if="row.receive_type === 1">手动领取</span>
+					<span v-else-if="row.receive_type === 3">后台发放</span>
+				</template> -->
+				<!-- <template slot-scope="{ row }" slot="start_time">
+					<div v-if="row.start_time">
+						{{row.start_time | formatDate}} - {{row.end_time | formatDate}}
+					</div>
+					<span v-else>不限时</span>
+				</template> -->
+				<!-- <template slot-scope="{ row }" slot="start_use_time">
+					<div v-if="row.start_use_time">
+						{{row.start_use_time | formatDate}} - {{row.end_use_time | formatDate}}
+					</div>
+					<div v-else>
+						{{ row.coupon_time }}天
+					</div>
+				</template> -->
+				<!-- <template slot-scope="{ row }" slot="status">
+					<i-switch v-model="row.status" :value="row.status" :true-value="1" :false-value="0" size="large"
+						@on-change="openChange(row)">
+						<span slot="open">开启</span>
+						<span slot="close">关闭</span>
+					</i-switch>
+				</template> -->
+				<template slot-scope="{ row, index }" slot="action">
+	<!-- 				<a @click="receive(row)">获取记录</a>
+					<Divider type="vertical" /> -->
+					<a @click="edit(row)">编辑</a>
+					<Divider type="vertical" />
+					<a @click="couponDel(row,'删除至尊卡',index)">删除</a>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" :current="tableFrom.page" show-elevator show-total @on-change="pageChange"
+					:page-size="tableFrom.limit" />
+			</div>
+		</Card>
+		<!-- 领取记录 -->
+		<Modal v-model="modals2" scrollable footer-hide closable title="获取记录" :mask-closable="false" width="700">
+			<Table :columns="columns2" :data="receiveList" ref="table" class="mt25" :loading="loading2" highlight-row
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+				<template slot-scope="{ row, index }" slot="avatar">
+					<viewer>
+						<div class="tabBox_img">
+							<img v-lazy="row.avatar">
+						</div>
+					</viewer>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total2" show-elevator show-total @on-change="receivePageChange"
+					:page-size="receiveFrom.limit" />
+			</div>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import {
+		releasedListApi,
+		releasedissueLogApi,
+		releaseStatusApi,
+		delCouponReleased,
+		couponStatusApi,
+		superList
+	} from "@/api/marketing";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import Setting from "@/setting";
+	export default {
+		name: "storeCouponIssue",
+		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,
+				modals2: false,
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24
+				},
+				loading: false,
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80
+					},
+					{
+						title: "名称",
+						key: "name",
+						minWidth: 150
+					},
+					{
+						title: "等级",
+						key: "grade",
+						minWidth: 100
+					},
+					{
+						title: "有效时间",
+						slot: "valid_date",
+						minWidth: 100
+					},
+					//discount
+					{
+						title: "全局折扣(%)",
+						key: "discount",
+						minWidth: 100
+					},
+					{
+						title: "备注",
+						slot: "mark",
+						minWidth: 90
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						minWidth: 200
+					}
+				],
+				tableFrom: {
+					status: "",
+					coupon_title: "",
+					receive_type: "",
+					coupon_type: "",
+					page: 1,
+					limit: 15
+				},
+				receive_type: "",
+				tableList: [],
+				total: 0,
+				FromData: null,
+				receiveList: [],
+				loading2: false,
+				columns2: [{
+						title: "ID",
+						key: "uid",
+						minWidth: 80
+					},
+					{
+						title: "用户名",
+						key: "nickname",
+						minWidth: 150
+					},
+					{
+						title: "用户头像",
+						slot: "avatar",
+						minWidth: 100
+					},
+					{
+						title: "领取时间",
+						key: "add_time",
+						minWidth: 140
+					}
+				],
+				total2: 0,
+				receiveFrom: {
+					page: 1,
+					limit: 15
+				},
+				rows: {}
+			};
+		},
+		created() {
+			this.getList();
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			}
+		},
+		methods: {
+			// 失效
+			couponInvalid(row, tit, num) {
+				this.delfromData = {
+					title: tit,
+					num: num,
+					url: `marketing/coupon/status/${row.id}`,
+					method: "PUT",
+					ids: ""
+				};
+				this.$refs.modelSure.modals = true;
+			},
+			// 领取记录
+			receive(row) {
+				this.modals2 = true;
+				this.rows = row;
+				this.getReceivelist(row);
+			},
+			getReceivelist(row) {
+				this.loading2 = true;
+				releasedissueLogApi(row.id, this.receiveFrom)
+					.then(async res => {
+						let data = res.data;
+						this.receiveList = data.list;
+						this.total2 = res.data.count;
+						this.loading2 = false;
+					})
+					.catch(res => {
+						this.loading2 = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// 领取记录改变分页
+			receivePageChange(index) {
+				this.receiveFrom.page = index;
+				this.getReceivelist(this.rows);
+			},
+			// 删除
+			couponDel(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `user/user_supreme/delete/${row.id}`,
+					method: "DELETE",
+					ids: "",
+				};
+				this.$modalSure(delfromData)
+					.then(res => {
+						this.$Message.success(res.msg);
+						this.tableList.splice(num, 1);
+						if (!this.tableList.length) {
+							this.tableFrom.page =
+								this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
+						}
+						this.getList();
+					})
+					.catch(res => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				this.tableFrom.receive_type =
+					this.receive_type === "all" ? "" : this.receive_type;
+				this.tableFrom.status = this.tableFrom.status || "";
+				superList(this.tableFrom)
+					.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.tableFrom.page = index;
+				this.getList();
+			},
+			// 表格搜索
+			userSearchs() {
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			// 搜索()
+			orderSearch() {
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			// 添加优惠券
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/marketing/super/create"
+				});
+			},
+			edit(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/super/create/" + row.id
+				});
+			},
+			// 复制
+			copy(data) {
+				this.$router.push({
+					path: `${this.roterPre}/marketing/super/create/${data.id}`
+				});
+			},
+			// 是否开启
+			openChange(data) {
+				couponStatusApi(data).then(() => this.getList());
+			}
+		}
+	};
+</script>
+
+<style scoped lang="stylus">
+	.fa {
+		color: #0a6aa1;
+		display: block;
+	}
+
+	.sheng {
+		color: #ff0000;
+		display: block;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 1 - 1
src/pages/product/productAdd/index.vue

@@ -738,7 +738,7 @@
 						<Col span="24">
 						<FormItem label="规格单位:">
 							<Input v-model.trim="oneFormValidate[0].unit" v-width="'50%'"
-								placeholder="请输入商品条形码"></Input>
+								placeholder="请输入商品规格单位"></Input>
 						</FormItem>
 						</Col>
 						<Col span="24">

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

@@ -1,325 +1,423 @@
 <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>
+			<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 }" slot="balance">
+						<!-- <img :src="row.image" /> -->
+						<a @click="openYue(row)">{{row.balance}}</a>
+					</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" v-auth="['admin-store-change_yue']" />
+						<a @click="changeYue(row)" v-auth="['admin-store-change_yue']">修改余额</a>
+						<Divider type="vertical" />
+						<a @click="delte(row, '删除门店(同步删除商品)', index)">删除</a>
+						<!-- <admin-store-store_list> -->
+					</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>
+		<Modal v-model="modalyue" scrollable title="门店余额记录" width="1200" height="800" footer-hide class="modelBox">
+			<Table :columns="yueColumns" :data="storeYueList" ref="table" class="ivu-mt" :loading="loadings" highlight-row
+				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+				<!-- <template slot-scope="{ row }" slot="image">
+					<img :src="row.image" />
+				</template> -->
+				<template slot-scope="{ row }" slot="number">
+					<div>{{row.pm == 0?'-': '+'}}{{row.balance}}</div>
+				</template>
+				<template slot-scope="{ row }" slot="time">
+					<div>{{row.add_time*1000 |formatDate }}</div>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="totals" :current="formValidates.page" show-elevator show-total @on-change="pageChanges"
+					:page-size="formValidates.limit" />
+			</div>
+		</Modal>
+
+	</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 { formatDate } from '@/utils/validate';
+	import util from "@/libs/util";
+	import Setting from "@/setting";
+	import addStore from "../components/addStore";
+	import {
+		storeListApi,
+		storeLogin,
+		storeSetShowApi,
+		resetApi,
+		openYue,
+		changeYue
+	} from "@/api/store";
+	export default {
+		name: "storeList",
+		components: {
+			addStore,
+		},
+		data() {
+			return {
+				storeYueList: [],
+				modalyue: false,
+				BaseURL: '',
+				total: 0,
+				totals: 0,
+				loading: false,
+				loadings:false,
+				formValidate: {
+					type: "all",
+					page: 1,
+					limit: 15,
+				},
+				formValidates: {
+					store_id: 0,
+					page: 1,
+					limit: 15,
+				},
+				yueColumns: [{
+						title: "ID",
+						key: "id",
+						width: 60,
+					},
+					{
+					  title: "来源",
+					  key: "title",
+					  minWidth: 80,
+					},
+					{
+					  title: "金额",
+					  slot: "number",
+					  minWidth: 80,
+					},
+					{
+					  title: "修改后金额",
+					  key: "balance",
+					  minWidth: 80,
+					},
+					{
+					  title: "备注",
+					  key: "mark",
+					  minWidth: 80,
+					},
+					{
+						title: "修改时间",
+						slot: "time",
+						minWidth: 80,
+					},
+				],
+				columns: [{
+						title: "ID",
+						key: "id",
+						width: 60,
+					},
+					{
+						title: "门店图片",
+						slot: "image",
+						minWidth: 80,
+					},
+					{
+						title: "门店名称",
+						key: "name",
+						minWidth: 80,
+					},
+					{
+						title: "门店分类",
+						key: "cate_name",
+						minWidth: 80,
+					},
+					{
+						title: "余额",
+						slot: "balance",
+						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;
+				});
+			},
+			getLists() {
+				this.loadings = true;
+				openYue(this.formValidates).then((res) => {
+					this.storeYueList = res.data.data;
+					this.totals = res.data.count;
+					this.loadings = 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);
+			},
+			changeYue(row) {
+				try {
+					this.$modalForm(changeYue(row.id)).then(() => this.getList());
+				} catch (e) {
+					//TODO handle the exception
+					console.log(e)
+				}
+			},
+			async openYue(row) {
+				console.log(row, 'open')
+				this.formValidates = {
+					page: 1,
+					limit: 15,
+					store_id: row.id
+				}
+				await this.getLists()
+				this.modalyue = true
+			},
+			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();
+			},
+			pageChanges(status) {
+				this.formValidates.page = status;
+				this.getLists();
+			},
+		},
+	};
 </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>

BIN
src/pages/user/list/handle/handle.rar


+ 1004 - 860
src/pages/user/list/handle/userDetails.vue

@@ -1,75 +1,106 @@
 <template>
-	<!-- <div style="width: 100%"> -->
-	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
-		<div class="acea-row user-row">
-			<div class="avatar mr15">
-				<img :src="psInfo.avatar">
-			</div>
-			<div class="user-row-text">
-				<div>
-					<span class="nickname">{{ psInfo.nickname || '-' }}{{psInfo.delete_time != null?' (已注销)':''}}</span>
-					<i :class="{
+    <!-- <div style="width: 100%"> -->
+  <Drawer :closable="false" width="1100" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
+        <div class="acea-row user-row">
+            <div class="avatar mr15">
+                <img :src="psInfo.avatar">
+            </div>
+            <div class="user-row-text">
+                <div>
+                    <span class="nickname">{{ psInfo.nickname || '-' }}{{psInfo.delete_time != null?' (已注销)':''}}</span>
+                    <i
+                      :class="{
                         iconxiaochengxu: psInfo.user_type === 'routine',
                         icongongzhonghao: psInfo.user_type === 'wechat',
                         iconPC: psInfo.user_type === 'pc',
                         iconh5: psInfo.user_type === 'h5',
                         iconapp: psInfo.user_type === 'app'
-                      }" class="iconfont"></i>
-				</div>
-				<div class="level">
-					<img v-if="psInfo.is_money_level" src="@/assets/images/svip-user.png">
-					<span v-if="psInfo.level" class="vip">V{{ psInfo.level }}</span>
-				</div>
-			</div>
-			<div class="user-row-action" v-if="fromType !== 'order' && psInfo.delete_time == null ">
-				<Button v-show="isEdit" @click="isEdit = false">取消</Button>
-				<Button v-show="isEdit" type="primary" @click="finish">完成</Button>
-				<Button v-show="!isEdit && activeName === 'info'" type="primary" @click="isEdit = true">编辑</Button>
-				<Button type="success" @click="changeMenu('2')">积分余额</Button>
-				<Button @click="changeMenu('3')">赠送会员</Button>
-			</div>
-		</div>
-		<div class="acea-row info-row">
-			<div v-for="(item, index) in detailsData" :key="index" class="info-row-item">
-				<div class="info-row-item-title">{{ item.title }}</div>
-				<div>{{ item.value }}{{ item.key }}</div>
-			</div>
-		</div>
-		<Tabs v-model="activeName">
-			<TabPane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.val">
-				<template v-if="item.val === 'info'">
-					<user-form v-if="isEdit" ref="userForm" :ps-info="psInfo" @change-menu="changeMenu"></user-form>
-					<user-info v-else :ps-info="psInfo" :workMemberInfo="workMemberInfo"
-						:workClientInfo="workClientInfo"></user-info>
-				</template>
-				<template v-else>
-					<Table :columns="columns" :data="userLists" ref="table" :loading="loading" no-userFrom-text="暂无数据"
-						no-filtered-userFrom-text="暂无筛选结果">
-						<template slot-scope="{ row }" slot="coupon_price">
-							<span v-if="row.coupon_type==1">{{row.coupon_price}}元</span>
-							<span
-								v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
+                      }"
+                      class="iconfont"
+                    ></i>
+                </div>
+                <div class="level">
+                    <img v-if="psInfo.is_money_level" src="@/assets/images/svip-user.png">
+                    <span v-if="psInfo.level" class="vip">V{{ psInfo.level }}</span>
+                </div>
+            </div>
+            <div class="user-row-action" v-if="fromType !== 'order' && psInfo.delete_time == null ">
+                <Button v-show="isEdit" @click="isEdit = false">取消</Button>
+                <Button v-show="isEdit" type="primary" @click="finish">完成</Button>
+                <Button v-show="!isEdit && activeName === 'info'" type="primary" @click="isEdit = true">编辑</Button>
+                <Button type="success" @click="changeMenu('2')">积分余额</Button>
+                <Button @click="changeMenu('3')">赠送会员</Button>
+            </div>
+        </div>
+        <div class="acea-row info-row">
+            <div v-for="(item, index) in detailsData" :key="index" class="info-row-item">
+                <div class="info-row-item-title">{{ item.title }}</div>
+                <div>{{ item.value }}{{ item.key }}</div>
+            </div>
+        </div>
+        <Tabs v-model="activeName">
+            <TabPane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.val">
+                <template v-if="item.val === 'info'">
+                    <user-form v-if="isEdit" ref="userForm" :ps-info="psInfo" @change-menu="changeMenu"></user-form>
+                    <user-info v-else :ps-info="psInfo" :workMemberInfo="workMemberInfo" :workClientInfo="workClientInfo"></user-info>
+                </template>
+                <template v-else>
+                    <Table :columns="columns" :data="userLists"
+                        ref="table"
+                        :loading="loading"
+                        no-userFrom-text="暂无数据"
+                        no-filtered-userFrom-text="暂无筛选结果"
+                    >
+										    <template slot-scope="{ row }" slot="coupon_price">
+										       <span v-if="row.coupon_type==1">{{row.coupon_price}}元</span>
+										    	 <span v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
+										    </template>
+                        <template slot-scope="{ row }" slot="product">
+                            <div class="product">
+                                <div class="image" v-viewer>
+                                    <img v-lazy="row.image">
+                                </div>
+                                <div class="title">{{ row.store_name }}</div>
+                            </div>
+                        </template>
+						
+						<template slot-scope="{ row }" slot="status_type">
+							<div>
+								<Button type="waning" v-if="row.status==0" >未出局</Button>
+								<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="product">
-							<div class="product">
-								<div class="image" v-viewer>
-									<img v-lazy="row.image">
-								</div>
-								<div class="title">{{ row.store_name }}</div>
+						<template slot-scope="{ row }" slot="reorder_count">
+							<div>
+								{{row.reorder_count}}次
 							</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" />
-					</div>
-				</template>
-			</TabPane>
-		</Tabs>
-	</Drawer>
-	<!-- <Modal v-model="modals" scrollable footer-hide closable title="用户详情" :mask-closable="false" width="1000" :z-index="2"> -->
-	<!-- <Spin size="large" fix v-if="spinShow"></Spin> -->
-	<!-- <div class="acea-row">
+						<!-- <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"  />
+                    </div>
+                </template>
+            </TabPane>
+        </Tabs>
+    </Drawer>
+        <!-- <Modal v-model="modals" scrollable footer-hide closable title="用户详情" :mask-closable="false" width="1000" :z-index="2"> -->
+            <!-- <Spin size="large" fix v-if="spinShow"></Spin> -->
+            <!-- <div class="acea-row">
                 <div class="avatar mr15"><img :src="psInfo.avatar"></div>
                 <div class="dashboard-workplace-header-tip">
                     <p class="dashboard-workplace-header-tip-title" v-text="psInfo.nickname || '-'"></p>
@@ -78,7 +109,7 @@
                     </div>
                 </div>
             </div> -->
-	<!-- <Row type="flex" justify="space-between" class="mt25">
+            <!-- <Row type="flex" justify="space-between" class="mt25">
                 <Col span="4" class="user_menu">
                     <Menu :theme="theme2" :active-name="activeName" @on-select="changeType">
                         <MenuItem :name="item.val" v-for="(item, index) in list" :key="index" >
@@ -98,812 +129,925 @@
                               :page-size="userFrom.limit"  /></div>
                 </Col>
             </Row> -->
-	<!-- </Modal> -->
-	<!-- </div> -->
+        <!-- </Modal> -->
+    <!-- </div> -->
 </template>
 
 <script>
-	import {
-		detailsApi,
-		infoApi,
-		visitList,
-		spreadList
-	} from '@/api/user';
-	import userForm from './userForm';
-	import userInfo from './userInfo';
-
-	export default {
-		name: 'userDetails',
-		components: {
-			userForm,
-			userInfo
-		},
-		props: ['levelList', 'labelList', 'groupList', 'fromType'],
-		data() {
-			return {
-				theme2: 'light',
-				list: [{
-						val: 'info',
-						label: '用户信息'
-					},
-					{
-						val: 'order',
-						label: '消费记录'
-					},
-					{
-						val: 'integral',
-						label: '积分明细'
-					},
-					{
-						val: 'sign',
-						label: '签到记录'
-					},
-					{
-						val: 'coupon',
-						label: '持有优惠券'
-					},
-					{
-						val: 'balance_change',
-						label: '余额变动'
-					},
-					{
-						val: 'spread',
-						label: '好友关系'
-					},
-					{
-						val: 'visit',
-						label: '浏览足迹'
-					},
-					{
-						val: 'spread_change',
-						label: '推荐人变更记录'
-					}
-				],
-				modals: false,
-				spinShow: false,
-				detailsData: [],
-				userId: 0,
-				loading: false,
-				userFrom: {
-					type: 'info',
-					page: 1, // 当前页
-					limit: 12 // 每页显示条数
-				},
-				total: 0,
-				columns: [],
-				userLists: [],
-				psInfo: {},
-				workMemberInfo: {},
-				workClientInfo: {},
-				activeName: 'info',
-				isEdit: false,
-				groupOptions: [],
-				labelOptions: []
-			}
-		},
-		watch: {
-			activeName(value) {
-				this.userFrom.page = 1;
-				if (value == 'info') return;
-				this.isEdit = false;
-				this.changeType(value);
-				// if (value == 'visit') {
-				//     this.changeType(value);
-				// } else if (value == 'spread_change') {
-				//    this.changeType(value);
-				// } else {
-				//     this.changeType(value);
-				// }
-			},
-			modals(value) {
-				if (value) {
-					this.isEdit = false;
-				}
-			}
+    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')
+		        }
+		    }
 		},
-		created() {},
-		methods: {
-			changeMenu(value) {
-				if (value === '99') {
-					this.getDetails(this.userId);
-					this.$parent.getList();
-					this.isEdit = false;
-					return;
-				}
-				this.$parent.changeMenu(this.psInfo, value);
-			},
-			// 完成
-			finish() {
-				this.$refs.userForm[0].detailsPut();
-			},
-			// 推荐人变更记录
-			getSpreadList() {
-				this.loading = true;
-				spreadList({
-					id: this.userId,
-					datas: {
-						page: this.userFrom.page,
-						limit: this.userFrom.limit
-					}
-				}).then(async res => {
-					if (res.status === 200) {
-						let data = res.data;
-						this.userLists = data.list;
-						this.total = data.count;
-						this.columns = [{
-								title: '推荐人ID',
-								key: 'spread_uid',
-								minWidth: 120
-							},
-							{
-								title: '推荐人',
-								key: 'nickname',
-								minWidth: 120,
-								render: (h, params) => {
-									return h('div', [
-										h('img', {
-											style: {
-												borderRadius: '50%',
-												marginRight: '10px',
-												verticalAlign: 'middle'
-											},
-											attrs: {
-												with: 38,
-												height: 38
-											},
-											directives: [{
-													name: 'lazy',
-													value: params.row.avatar
-												},
-												{
-													name: 'viewer'
-												}
-											]
-										}),
-										h('span', {
-											style: {
-												verticalAlign: 'middle'
-											}
-										}, params.row.nickname)
-									]);
+        props: ['levelList', 'labelList', 'groupList', 'fromType'],
+        data () {
+            return {
+                theme2: 'light',
+                list: [
+                    { val: 'info', label: '用户信息' },
+                    { val: 'order', label: '消费记录' },
+                    { val: 'integral', label: '积分明细' },
+                    { val: 'sign', label: '签到记录' },
+                    { val: 'coupon', label: '持有优惠券' },
+                    { val: 'balance_change', label: '余额变动' },
+                    { val: 'action_integral', label: '贡献分' },
+                    { val: 'award_integral', label: '参考分' },
+                    { val: 'energy', label: '能量值' },
+                    { val: 'spread', label: '好友关系' },
+                    { val: 'visit', label: '浏览足迹' },
+                    { val: 'spread_change', label: '推荐人变更记录' }
+                ],
+                modals: false,
+                spinShow: false,
+                detailsData: [],
+                userId: 0,
+                loading: false,
+                userFrom: {
+                    type: 'info',
+                    page: 1, // 当前页
+                    limit: 12 // 每页显示条数
+                },
+                total: 0,
+                columns: [],
+                userLists: [],
+                psInfo: {},
+                workMemberInfo:{},
+                workClientInfo:{},
+                activeName: 'info',
+                isEdit: false,
+                groupOptions: [],
+                labelOptions: []
+            }
+        },
+        watch: {
+            activeName (value) {
+							  this.userFrom.page = 1;
+                if (value == 'info') return;
+                this.isEdit = false;
+                 this.changeType(value);
+                // if (value == 'visit') {
+                //     this.changeType(value);
+                // } else if (value == 'spread_change') {
+                //    this.changeType(value);
+                // } else {
+                //     this.changeType(value);
+                // }
+            },
+            modals (value) {
+                if (value) {
+                    this.isEdit = false;
+                }
+            }
+        },
+        created () {
+        },
+        methods: {
+            changeMenu (value) {
+                if (value === '99') {
+                    this.getDetails(this.userId);
+                    this.$parent.getList();
+                    this.isEdit = false;
+                    return;
+                }
+                this.$parent.changeMenu(this.psInfo, value);
+            },
+            // 完成
+            finish () {
+                this.$refs.userForm[0].detailsPut();
+            },
+            // 推荐人变更记录
+            getSpreadList () {
+                this.loading = true;
+                spreadList({
+                    id: this.userId,
+                    datas: {
+                        page: this.userFrom.page,
+                        limit: this.userFrom.limit
+                    }
+                }).then(async res => {
+                    if (res.status === 200) {
+                        let data = res.data;
+                        this.userLists = data.list;
+                        this.total = data.count;
+                        this.columns = [
+                            {
+                                title: '推荐人ID',
+                                key: 'spread_uid',
+                                minWidth: 120
+                            },
+                            {
+                                title: '推荐人',
+                                key: 'nickname',
+                                minWidth: 120,
+                                render: (h, params) => {
+                                    return h('div', [
+                                        h('img', {
+                                            style: {
+                                                borderRadius: '50%',
+                                                marginRight: '10px',
+                                                verticalAlign: 'middle'
+                                            },
+                                            attrs: {
+                                                with: 38,
+                                                height: 38
+                                            },
+                                            directives: [
+                                                {
+                                                    name: 'lazy',
+                                                    value: params.row.avatar
+                                                },
+                                                {
+                                                    name: 'viewer'
+                                                }
+                                            ]
+                                        }),
+                                        h('span', {
+                                            style: {
+                                                verticalAlign: 'middle'
+                                            }
+                                        }, params.row.nickname)
+                                    ]);
+                                }
+                            },
+                            {
+                                title: '变更方式',
+                                key: 'type',
+                                minWidth: 120
+                            },
+                            {
+                                title: '变更时间',
+                                key: 'spread_time',
+                                minWidth: 120
+                            }
+                        ];
+                        this.loading = false;
+                    } else {
+                        this.loading = false;
+                        this.$Message.error(res.msg);
+                    }
+                }).catch(res => {
+                    this.loading = false;
+                    this.$Message.error(res.msg);
+                });
+            },
+            // 浏览足迹
+            getVisitList () {
+                this.loading = true;
+                visitList({
+                    id: this.userId,
+                    datas: {
+                        page: this.userFrom.page,
+                        limit: this.userFrom.limit
+                    }
+                }).then(async res => {
+                    if (res.status === 200) {
+                        let data = res.data;
+                        this.userLists = data.list;
+                        this.total = data.count;
+                        this.columns = [
+                            {
+                                title: '商品信息',
+                                slot: 'product',
+                                minWidth: 400
+                            },
+                            {
+                                title: '价格',
+                                key: 'product_price',
+                                minWidth: 120,
+                                render: (h, params) => {
+                                    return h('div', `¥${params.row.product_price}`);
+                                }
+                            },
+                            {
+                                title: '浏览时间',
+                                key: 'add_time',
+                                minWidth: 120
+                            }
+                        ];
+                        this.loading = false;
+                    } else {
+                        this.loading = false;
+                        this.$Message.error(res.msg);
+                    }
+                }).catch(res => {
+                    this.loading = false;
+                    this.$Message.error(res.msg);
+                });
+            },
+            // 会员详情
+            getDetails (id) {
+                this.userId = id;
+                this.spinShow = true;
+                detailsApi(id).then(async res => {
+                    if (res.status === 200) {
+                        let data = res.data
+                        this.detailsData = data.headerList;
+                        if(this.fromType !== 'order'){
+                            let groupItem = this.groupList.find(item => item.id == data.ps_info.group_id);
+                            if (groupItem) {
+                                data.ps_info.group_name = groupItem.group_name;
+                            }
+                        }
+                        this.psInfo = data.ps_info;
+                        this.workMemberInfo = data.workMemberInfo;
+                        this.workClientInfo = data.workClientInfo;
+                        this.spinShow = false;
+                    } else {
+                        this.spinShow = false;
+                        this.$Message.error(res.msg);
+                    }
+                }).catch(res => {
+                    this.spinShow = false;
+                    this.$Message.error(res.msg);
+                })
+            },
+            pageChange (index) {
+                this.userFrom.page = index
+                   this.changeType(this.userFrom.type);
+                // switch (this.activeName) {
+                //     case 'visit':
+                //        this.changeType(this.userFrom.type);
+                //         break;
+                //     case 'spread_change':
+                //        this.changeType(this.userFrom.type);
+                //         break;
+                //     default:
+                //         this.changeType(this.userFrom.type);
+                //         break;
+                // }
+            },
+            // tab选项
+            changeType (name) {
+                this.loading = true;
+                this.userFrom.type = name;
+                this.activeName = name;
+                let data = {
+                    id: this.userId,
+                    datas: this.userFrom
+                }
+                infoApi(data).then(async res => {
+                    if (res.status === 200) {
+                        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)
 								}
-							},
-							{
-								title: '变更方式',
-								key: 'type',
-								minWidth: 120
-							},
-							{
-								title: '变更时间',
-								key: 'spread_time',
-								minWidth: 120
-							}
-						];
-						this.loading = false;
-					} else {
-						this.loading = false;
-						this.$Message.error(res.msg);
-					}
-				}).catch(res => {
-					this.loading = false;
-					this.$Message.error(res.msg);
-				});
-			},
-			// 浏览足迹
-			getVisitList() {
-				this.loading = true;
-				visitList({
-					id: this.userId,
-					datas: {
-						page: this.userFrom.page,
-						limit: this.userFrom.limit
-					}
-				}).then(async res => {
-					if (res.status === 200) {
-						let data = res.data;
-						this.userLists = data.list;
-						this.total = data.count;
-						this.columns = [{
-								title: '商品信息',
-								slot: 'product',
-								minWidth: 400
-							},
-							{
-								title: '价格',
-								key: 'product_price',
-								minWidth: 120,
-								render: (h, params) => {
-									return h('div', `¥${params.row.product_price}`);
-								}
-							},
-							{
-								title: '浏览时间',
-								key: 'add_time',
-								minWidth: 120
-							}
-						];
-						this.loading = false;
-					} else {
-						this.loading = false;
-						this.$Message.error(res.msg);
-					}
-				}).catch(res => {
-					this.loading = false;
-					this.$Message.error(res.msg);
-				});
-			},
-			// 会员详情
-			getDetails(id) {
-				this.userId = id;
-				this.spinShow = true;
-				detailsApi(id).then(async res => {
-					if (res.status === 200) {
-						let data = res.data
-						this.detailsData = data.headerList;
-						if (this.fromType !== 'order') {
-							let groupItem = this.groupList.find(item => item.id == data.ps_info.group_id);
-							if (groupItem) {
-								data.ps_info.group_name = groupItem.group_name;
 							}
+							e.sendValue = (e.day_send+e.computedNum).toFixed(2) * 1;
+							return e
+					});
+						}else{
+							this.userLists = data.list;
 						}
-						this.psInfo = data.ps_info;
-						this.workMemberInfo = data.workMemberInfo;
-						this.workClientInfo = data.workClientInfo;
-						this.spinShow = false;
-					} else {
-						this.spinShow = false;
-						this.$Message.error(res.msg);
-					}
-				}).catch(res => {
-					this.spinShow = false;
-					this.$Message.error(res.msg);
-				})
-			},
-			pageChange(index) {
-				this.userFrom.page = index
-				this.changeType(this.userFrom.type);
-				// switch (this.activeName) {
-				//     case 'visit':
-				//        this.changeType(this.userFrom.type);
-				//         break;
-				//     case 'spread_change':
-				//        this.changeType(this.userFrom.type);
-				//         break;
-				//     default:
-				//         this.changeType(this.userFrom.type);
-				//         break;
-				// }
-			},
-			// tab选项
-			changeType(name) {
-				this.loading = true;
-				this.userFrom.type = name;
-				this.activeName = name;
-				let data = {
-					id: this.userId,
-					datas: this.userFrom
-				}
-				infoApi(data).then(async res => {
-					if (res.status === 200) {
-						let data = res.data
-						this.userLists = data.list;
-						this.total = data.count;
-						switch (this.userFrom.type) {
-							case 'order':
-								this.columns = [{
-										title: '订单ID',
-										key: 'order_id',
-										minWidth: 160
-									},
-									{
-										title: '收货人',
-										key: 'real_name',
-										minWidth: 100
-									},
-									{
-										title: '商品数量',
-										key: 'total_num',
-										minWidth: 90
-									},
-									{
-										title: '商品总价',
-										key: 'total_price',
-										minWidth: 110
-									},
-									{
-										title: '实付金额',
-										key: 'pay_price',
-										minWidth: 120
-									},
-									{
-										title: '交易完成时间',
-										key: 'pay_time',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'integral':
-								this.columns = [{
-										title: '来源/用途',
-										key: 'title',
-										minWidth: 120
-									},
-									{
-										title: '积分变化',
-										key: 'number',
-										minWidth: 120
-									},
-									{
-										title: '变化后积分',
-										key: 'balance',
-										minWidth: 120
-									},
-									{
-										title: '日期',
-										key: 'add_time',
-										minWidth: 120
-									},
-									{
-										title: '备注',
-										key: 'mark',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'sign':
-								this.columns = [
-									// {
-									//     title: '动作',
-									//     key: 'title',
-									//     minWidth: 120
-									// },
-									{
-										title: '获得积分',
-										key: 'number',
-										minWidth: 120
-									},
-									{
-										title: '签到时间',
-										key: 'add_time',
-										minWidth: 120
-									},
-									{
-										title: '备注',
-										key: 'mark',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'coupon':
-								this.columns = [{
-										title: '优惠券名称',
-										key: 'coupon_title',
-										minWidth: 120
-									},
-									{
-										title: '面值',
-										slot: 'coupon_price',
-										minWidth: 120
-									},
-									{
-										title: '有效期(天)',
-										key: 'coupon_time',
-										minWidth: 120
-									},
-									{
-										title: '兑换时间',
-										key: '_add_time',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'balance_change':
-								this.columns = [{
-										title: '动作',
-										key: 'title',
-										minWidth: 120
-									},
-									{
-										title: '变动金额',
-										key: 'number',
-										minWidth: 120
-									},
-									{
-										title: '变动后',
-										key: 'balance',
-										minWidth: 120
-									},
-									{
-										title: '创建时间',
-										key: 'add_time',
-										minWidth: 120
-									},
-									{
-										title: '备注',
-										key: 'mark',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'visit':
-								this.columns = [{
-										title: '商品信息',
-										slot: 'product',
-										minWidth: 400,
-									},
-									{
-										title: '价格',
-										key: 'product_price',
-										minWidth: 120,
-										render: (h, params) => {
-											return h('div', `¥${params.row.product_price}`)
-										},
-									},
-									{
-										title: '浏览时间',
-										key: 'add_time',
-										minWidth: 120,
-									},
-								]
-								break
-							case 'spread_change':
-								this.columns = [{
-										title: '推荐人ID',
-										key: 'spread_uid',
-										minWidth: 120,
-									},
-									{
-										title: '推荐人',
-										key: 'nickname',
-										minWidth: 120,
-										render: (h, params) => {
-											return h('div', [
-												h('img', {
-													style: {
-														borderRadius: '50%',
-														marginRight: '10px',
-														verticalAlign: 'middle',
-													},
-													attrs: {
-														with: 38,
-														height: 38,
-													},
-													directives: [{
-															name: 'lazy',
-															value: params.row.avatar,
-														},
-														{
-															name: 'viewer',
-														},
-													],
-												}),
-												h(
-													'span', {
-														style: {
-															verticalAlign: 'middle',
-														},
-													},
-													params.row.nickname
-												),
-											])
-										},
-									},
-									{
-										title: '变更方式',
-										key: 'type',
-										minWidth: 120,
-									},
-									{
-										title: '变更时间',
-										key: 'spread_time',
-										minWidth: 120,
-									},
-								]
-								break;
-							default:
-								this.columns = [{
-										title: 'ID',
-										key: 'uid',
-										minWidth: 120
-									},
-									{
-										title: '昵称',
-										key: 'nickname',
-										minWidth: 120
-									},
-									{
-										title: '等级',
-										key: 'type',
-										minWidth: 120
-									},
-									{
-										title: '加入时间',
-										key: 'add_time',
-										minWidth: 120
-									}
-								]
-						}
-						this.loading = false;
-					} else {
-						this.loading = false;
-						this.$Message.error(res.msg);
-					}
-				}).catch(res => {
-					this.loading = false;
-					this.$Message.error(res.msg);
-				})
-			}
-		}
-	}
+						
+						
+                        switch (this.userFrom.type) {
+                        case 'order':
+                            this.columns = [
+                                {
+                                    title: '订单ID',
+                                    key: 'order_id',
+                                    minWidth: 160
+                                },
+                                {
+                                    title: '收货人',
+                                    key: 'real_name',
+                                    minWidth: 100
+                                },
+                                {
+                                    title: '商品数量',
+                                    key: 'total_num',
+                                    minWidth: 90
+                                },
+                                {
+                                    title: '商品总价',
+                                    key: 'total_price',
+                                    minWidth: 110
+                                },
+                                {
+                                    title: '实付金额',
+                                    key: 'pay_price',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '交易完成时间',
+                                    key: 'pay_time',
+                                    minWidth: 120
+                                }
+                            ]
+                            break;
+                        case 'integral':
+                            this.columns = [
+                                {
+                                    title: '来源/用途',
+                                    key: 'title',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '积分变化',
+                                    key: 'number',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '变化后积分',
+                                    key: 'balance',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '日期',
+                                    key: 'add_time',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '备注',
+                                    key: 'mark',
+                                    minWidth: 120
+                                }
+                            ]
+                            break;
+                        case 'sign':
+                            this.columns = [
+                                // {
+                                //     title: '动作',
+                                //     key: 'title',
+                                //     minWidth: 120
+                                // },
+                                {
+                                    title: '获得积分',
+                                    key: 'number',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '签到时间',
+                                    key: 'add_time',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '备注',
+                                    key: 'mark',
+                                    minWidth: 120
+                                }
+                            ]
+                            break;
+						case 'action_integral':
+						    this.columns = [
+						        // {
+						        //     title: '获得数量',
+						        //     key: 'num',
+						        //     minWidth: 100
+						        // },
+								// {
+								//     title: '进场价格',
+								//     key: 'price',
+								//     minWidth: 120
+								// },
+								{
+								    title: '奖励金额',
+								    key: 'extract_sum',
+								    minWidth: 120
+								},
+						        {
+						            title: '获得时间',
+						            key: '_add_time',
+						            minWidth: 120
+						        },
+						        {
+						            title: '备注',
+						            key: 'mark',
+						            minWidth: 120
+						        },
+								// {
+								//     title: '状态',
+								//     slot: 'status_type',
+								//     minWidth: 80
+								// }
+						    ]
+						    break;
+						case 'award_integral':
+						    this.columns = [
+						        {
+						            title: '说明',
+						            key: 'mark',
+						            minWidth: 120
+						        },
+								{
+								    title: '释放',
+								     slot: 'sent_day',
+								    minWidth: 80
+								},
+								{
+								    title: '释放值',
+								    key: 'sendValue',
+								    minWidth: 59
+								},
+								{
+								    title: '提取',
+								     slot: 'extracted_num',
+								    minWidth: 100
+								},
+						        {
+						            title: '复投',
+						            slot: 'reorder_count',
+						            minWidth: 50
+						        },
+								{
+								    title: '总量',
+								    key: 'num',
+								    minWidth: 50
+								},
+						        {
+						            title: '购买时间',
+						            key: '_add_time',
+						            minWidth: 120
+						        },
+						    ]
+						    break;
+						case 'energy':
+						    this.columns = [
+								{
+								    title: '来源',
+								    key: 'title',
+								    minWidth: 120
+								},
+						        {
+						            title: '获得数量',
+						            key: 'number',
+						            minWidth: 120
+						        },
+								{
+								    title: '变化后',
+								    key: 'balance',
+								    minWidth: 120
+								},
+						        {
+						            title: '获得时间',
+						            key: 'add_time',
+						            minWidth: 120
+						        },
+						        {
+						            title: '备注',
+						            key: 'mark',
+						            minWidth: 120
+						        }
+						    ]
+						    break;
+                        case 'coupon':
+                            this.columns = [
+                                {
+                                    title: '优惠券名称',
+                                    key: 'coupon_title',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '面值',
+                                    slot: 'coupon_price',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '有效期(天)',
+                                    key: 'coupon_time',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '兑换时间',
+                                    key: '_add_time',
+                                    minWidth: 120
+                                }
+                            ]
+                            break;
+                        case 'balance_change':
+                            this.columns = [
+                                {
+                                    title: '动作',
+                                    key: 'title',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '变动金额',
+                                    key: 'number',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '变动后',
+                                    key: 'balance',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '创建时间',
+                                    key: 'add_time',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '备注',
+                                    key: 'mark',
+                                    minWidth: 120
+                                }
+                            ]
+                            break;
+                              case 'visit':
+                this.columns = [
+                  {
+                    title: '商品信息',
+                    slot: 'product',
+                    minWidth: 400,
+                  },
+                  {
+                    title: '价格',
+                    key: 'product_price',
+                    minWidth: 120,
+                    render: (h, params) => {
+                      return h('div', `¥${params.row.product_price}`)
+                    },
+                  },
+                  {
+                    title: '浏览时间',
+                    key: 'add_time',
+                    minWidth: 120,
+                  },
+                ]
+                break
+              case 'spread_change':
+                this.columns = [
+                  {
+                    title: '推荐人ID',
+                    key: 'spread_uid',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '推荐人',
+                    key: 'nickname',
+                    minWidth: 120,
+                    render: (h, params) => {
+                      return h('div', [
+                        h('img', {
+                          style: {
+                            borderRadius: '50%',
+                            marginRight: '10px',
+                            verticalAlign: 'middle',
+                          },
+                          attrs: {
+                            with: 38,
+                            height: 38,
+                          },
+                          directives: [
+                            {
+                              name: 'lazy',
+                              value: params.row.avatar,
+                            },
+                            {
+                              name: 'viewer',
+                            },
+                          ],
+                        }),
+                        h(
+                          'span',
+                          {
+                            style: {
+                              verticalAlign: 'middle',
+                            },
+                          },
+                          params.row.nickname
+                        ),
+                      ])
+                    },
+                  },
+                  {
+                    title: '变更方式',
+                    key: 'type',
+                    minWidth: 120,
+                  },
+                  {
+                    title: '变更时间',
+                    key: 'spread_time',
+                    minWidth: 120,
+                  },
+                ]
+                break;
+                        default:
+                            this.columns = [
+                                {
+                                    title: 'ID',
+                                    key: 'uid',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '昵称',
+                                    key: 'nickname',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '等级',
+                                    key: 'type',
+                                    minWidth: 120
+                                },
+                                {
+                                    title: '加入时间',
+                                    key: 'add_time',
+                                    minWidth: 120
+                                }
+                            ]
+                        }
+                        this.loading = false;
+                    } else {
+                        this.loading = false;
+                        this.$Message.error(res.msg);
+                    }
+                }).catch(res => {
+                    this.loading = false;
+                    this.$Message.error(res.msg);
+                })
+            }
+        }
+    }
 </script>
 
 <style lang="less" scoped>
-	/deep/.ivu-modal-body {
-		padding: 0;
-	}
-
-	.user-info {
-		// padding: 15px;
-	}
-
-	.user-row {
-		padding: 30px 35px 0;
-
-		&-text {
-			flex: 1;
-			align-self: center;
-		}
-
-		&-action {
-
-			.ivu-btn {
-				margin-left: 12px;
-				font-size: 13px !important;
-				color: rgba(0, 0, 0, 0.85);
-
-				&:first-child {
-					margin-left: 0;
-				}
-
-				&.ivu-btn-primary {
-					border-color: #1890FF;
-					background-color: #1890FF;
-					color: #FFFFFF;
-				}
-
-				&.ivu-btn-success {
-					border-color: #00C050;
-					background-color: #00C050;
-					color: #FFFFFF;
-				}
-			}
-		}
-
-		.nickname {
-			font-weight: 500;
-			font-size: 16px;
-			line-height: 16px;
-			color: rgba(0, 0, 0, 0.85);
-		}
-
-		.iconfont {
-			margin-left: 7px;
-			font-size: 18px;
-
-			&:nth-child(2) {
-				margin-left: 9px;
-			}
-
-			&.iconxiaochengxu {
-				color: #007DFF;
-			}
-
-			&.icongongzhonghao {
-				color: #00BF00;
-			}
-
-			&.iconPC {
-				color: #F69B00;
-			}
-
-			&.iconh5 {
-				color: #9F5CE3;
-			}
-
-			&.iconapp {
-				color: #E36734;
-			}
-		}
-
-		.level {
-			margin-top: 5px;
-
-			img {
-				width: 42px;
-				height: 20px;
-				vertical-align: middle;
-
-				+span {
-					margin-left: 7px;
-				}
-			}
-
-			.vip {
-				display: inline-block;
-				width: 56px;
-				height: 26px;
-				padding-left: 30px;
-				background: url("../../../../assets/images/vip-bg.png") left top/100% 100% no-repeat;
-				font-weight: bold;
-				font-size: 9px;
-				line-height: 26px;
-				color: #5F7DB5;
-				transform-origin: left;
-				transform: scale(0.75, 0.75);
-				vertical-align: middle;
-			}
-		}
-	}
-
-	.info-row {
-		flex-wrap: nowrap;
-		padding: 20px 35px 24px;
-
-		&-item {
-			flex: none;
-			width: 155px;
-			font-size: 14px;
-			line-height: 14px;
-			color: rgba(0, 0, 0, 0.85);
-
-			&-title {
-				margin-bottom: 12px;
-				font-size: 13px;
-				line-height: 13px;
-				color: #666666;
-			}
-		}
-	}
-
-	.ivu-tabs {
-		color: rgba(0, 0, 0, 0.85);
-
-		/deep/ .ivu-tabs-bar {
-			border-bottom: 0;
-			margin-bottom: 0;
-			background-color: #F5F7FA;
-
-			.ivu-tabs-nav-container {
-				font-size: 13px;
-			}
-
-			.ivu-tabs-ink-bar {
-				display: none;
-			}
-
-			.ivu-tabs-tab {
-				padding: 7px 19px !important;
-				margin-right: 0;
-				line-height: 26px;
-			}
-
-			.ivu-tabs-tab-active {
-				background-color: #FFFFFF;
-				color: rgba(0, 0, 0, 0.85);
-
-				&:before {
-					content: "";
-					position: absolute;
-					top: 0;
-					left: 0;
-					width: 100%;
-					height: 2px;
-					background-color: #1890FF;
-				}
-			}
-		}
-
-		/deep/ .ivu-tabs-content {
-			.ivu-tabs-tabpane {
-				padding: 15px 15px !important;
-
-				&:first-child {
-					padding: 0 25px !important;
-				}
-			}
-		}
-
-		.product {
-			display: flex;
-
-			.image {
-				width: 50px;
-				height: 50px;
-			}
-
-			img {
-				width: 100%;
-				height: 100%;
-				border-radius: 4px;
-			}
-
-			.title {
-				flex: 1;
-				padding-left: 13px;
-				text-align: left;
-			}
-		}
-	}
-
-	.avatar {
-		width: 60px;
-		height: 60px;
-		border-radius: 50%;
-		overflow: hidden;
-
-		img {
-			width: 100%;
-			height: 100%;
-		}
-	}
-
-	.dashboard-workplace {
-		&-header {
-			&-avatar {
-				width: 64px;
-				height: 64px;
-				border-radius: 50%;
-				margin-right: 16px;
-				font-weight: 600;
-			}
-
-			&-tip {
-				width: 82%;
-				display: inline-block;
-				vertical-align: middle;
-
-				&-title {
-					font-size: 13px;
-					color: #000000;
-					margin-bottom: 12px;
-				}
-
-				&-desc {
-					&-sp {
-						width: 33.33%;
-						color: #17233D;
-						font-size: 13px;
-						display: inline-block;
-					}
-				}
-			}
-
-			&-extra {
-				.ivu-col {
-					p {
-						text-align: right;
-					}
-
-					p:first-child {
-						span:first-child {
-							margin-right: 4px;
-						}
+    /deep/.ivu-modal-body {
+        padding: 0;
+    }
+    .user-info {
+        // padding: 15px;
+    }
+    .user-row {
+        padding: 30px 35px 0;
 
-						span:last-child {
-							color: #808695;
-						}
-					}
-
-					p:last-child {
-						font-size: 22px;
-					}
-				}
-			}
-		}
-	}
+        &-text {
+            flex: 1;
+            align-self: center;
+        }
+
+        &-action {
+
+            .ivu-btn {
+                margin-left: 12px;
+                font-size: 13px !important;
+                color: rgba(0, 0, 0, 0.85);
+
+                &:first-child {
+                    margin-left: 0;
+                }
+
+                &.ivu-btn-primary {
+                    border-color: #1890FF;
+                    background-color: #1890FF;
+                    color: #FFFFFF;
+                }
+
+                &.ivu-btn-success {
+                    border-color: #00C050;
+                    background-color: #00C050;
+                    color: #FFFFFF;
+                }
+            }
+        }
+
+        .nickname {
+            font-weight: 500;
+            font-size: 16px;
+            line-height: 16px;
+            color: rgba(0, 0, 0, 0.85);
+        }
+
+        .iconfont {
+            margin-left: 7px;
+            font-size: 18px;
+
+            &:nth-child(2) {
+                margin-left: 9px;
+            }
+
+            &.iconxiaochengxu {
+                color: #007DFF;
+            }
+
+            &.icongongzhonghao {
+                color: #00BF00;
+            }
+
+            &.iconPC {
+                color: #F69B00;
+            }
+
+            &.iconh5 {
+                color: #9F5CE3;
+            }
+
+            &.iconapp {
+                color: #E36734;
+            }
+        }
+
+        .level {
+            margin-top: 5px;
+
+            img {
+                width: 42px;
+                height: 20px;
+                vertical-align: middle;
+
+                + span {
+                    margin-left: 7px;
+                }
+            }
+
+            .vip {
+                display: inline-block;
+                width: 56px;
+                height: 26px;
+                padding-left: 30px;
+                background: url("../../../../assets/images/vip-bg.png") left top/100% 100% no-repeat;
+                font-weight: bold;
+                font-size: 9px;
+                line-height: 26px;
+                color: #5F7DB5;
+                transform-origin: left;
+                transform: scale(0.75, 0.75);
+                vertical-align: middle;
+            }
+        }
+    }
+
+    .info-row {
+        flex-wrap: nowrap;
+        padding: 20px 35px 24px;
+
+        &-item {
+            flex: none;
+            width: 155px;
+            font-size: 14px;
+            line-height: 14px;
+            color: rgba(0, 0, 0, 0.85);
+
+            &-title {
+                margin-bottom: 12px;
+                font-size: 13px;
+                line-height: 13px;
+                color: #666666;
+            }
+        }
+    }
+
+    .ivu-tabs {
+        color: rgba(0, 0, 0, 0.85);
+
+        /deep/ .ivu-tabs-bar {
+            border-bottom: 0;
+            margin-bottom: 0;
+            background-color: #F5F7FA;
+
+            .ivu-tabs-nav-container {
+                font-size: 13px;
+            }
+
+            .ivu-tabs-ink-bar {
+                display: none;
+            }
+
+            .ivu-tabs-tab {
+                padding: 7px 19px !important;
+                margin-right: 0;
+                line-height: 26px;
+            }
+
+            .ivu-tabs-tab-active {
+                background-color: #FFFFFF;
+                color: rgba(0, 0, 0, 0.85);
+
+                &:before {
+                    content: "";
+                    position: absolute;
+                    top: 0;
+                    left: 0;
+                    width: 100%;
+                    height: 2px;
+                    background-color: #1890FF;
+                }
+            }
+        }
+
+        /deep/ .ivu-tabs-content {
+            .ivu-tabs-tabpane {
+                padding: 15px 15px !important;
+
+                &:first-child {
+                    padding: 0 25px !important;
+                }
+            }
+        }
+
+        .product {
+            display: flex;
+
+            .image {
+                width: 50px;
+                height: 50px;
+            }
+
+            img {
+                width: 100%;
+                height: 100%;
+                border-radius: 4px;
+            }
+
+            .title {
+                flex: 1;
+                padding-left: 13px;
+                text-align: left;
+            }
+        }
+    }
+
+    .avatar{
+        width: 60px;
+        height: 60px;
+        border-radius: 50%;
+        overflow: hidden;
+        img{
+            width: 100%;
+            height: 100%;
+        }
+    }
+    .dashboard-workplace {
+        &-header {
+            &-avatar {
+                width: 64px;
+                height: 64px;
+                border-radius: 50%;
+                margin-right: 16px;
+                font-weight: 600;
+            }
+
+            &-tip {
+                width: 82%;
+                display: inline-block;
+                vertical-align: middle;
+
+                &-title {
+                    font-size: 13px;
+                    color: #000000;
+                    margin-bottom: 12px;
+                }
+
+                &-desc {
+                    &-sp {
+                        width: 33.33%;
+                        color: #17233D;
+                        font-size: 13px;
+                        display: inline-block;
+                    }
+                }
+            }
+
+            &-extra {
+                .ivu-col {
+                    p {
+                        text-align: right;
+                    }
+
+                    p:first-child {
+                        span:first-child {
+                            margin-right: 4px;
+                        }
+
+                        span:last-child {
+                            color: #808695;
+                        }
+                    }
+
+                    p:last-child {
+                        font-size: 22px;
+                    }
+                }
+            }
+        }
+    }
 </style>
 <style scoped lang="stylus">
-	.user_menu>>>.ivu-menu {
-		width 100% !important;
-	}
-</style>
+    .user_menu >>> .ivu-menu
+       width 100% !important
+</style>

+ 501 - 392
src/pages/user/list/handle/userForm.vue

@@ -1,416 +1,525 @@
 <template>
-    <div>
-        <Form :model="formData" :label-width="76">
-            <div class="section">
-                <div class="section-hd">基本信息</div>
-                <div class="section-bd">
-                    <FormItem label="用户编号:">
-                        <Input v-model="formData.uid" disabled></Input>
-                    </FormItem>
-                    <FormItem label="真实姓名:">
-                        <Input v-model="formData.real_name" placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="手机号码:">
-                        <Input v-model="formData.phone" placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="生日:">
-                        <DatePicker :value="formData.birthday" @on-change="dateChange"></DatePicker>
-                    </FormItem>
-                    <FormItem label="性别:">
-                        <Select v-model="formData.sex">
-                            <Option :value="0">保密</Option>
-                            <Option :value="1">男</Option>
-                            <Option :value="2">女</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="省市区:">
-                        <Cascader v-model="addressSelect" :data="addresData" :load-data="loadData" @on-change="addchack"></Cascader>
-                    </FormItem>
-                    <FormItem label="身份证号:">
-                        <Input v-model="formData.card_id" placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="详细地址:">
-                        <Input v-model="formData.addres" placeholder="请输入"></Input>
-                    </FormItem>
-                </div>
-            </div>
-            <div class="section">
-                <div class="section-hd">密码设置</div>
-                <div class="section-bd">
-                    <FormItem label="登录密码:">
-                        <Input v-model="formData.pwd" type="password" password placeholder="请输入"></Input>
-                    </FormItem>
-                    <FormItem label="确认密码:">
-                        <Input v-model="formData.true_pwd" type="password" password placeholder="请输入"></Input>
-                    </FormItem>
-                </div>
-            </div>
-            <div class="section">
-                <div class="section-hd">用户设置</div>
-                <div class="section-bd">
-                    <FormItem label="推广资格:">
-                        <i-switch v-model="formData.spread_open" :true-value="1" :false-value="0" size="large">
-                            <span slot="open">启用</span>
-                            <span slot="close">禁用</span>
-                        </i-switch>
-                    </FormItem>
-                    <FormItem label="用户状态:">
-                        <i-switch v-model="formData.status" :true-value="1" :false-value="0" size="large">
-                            <span slot="open">开启</span>
-                            <span slot="close">锁定</span>
-                        </i-switch>
-                    </FormItem>
-                    <FormItem label="用户标签:">
-                        <div class="flex-add">
-		                        <div class="labelInput acea-row row-between-wrapper" @click="openLabel">
-		                        	<div class="width-add">
-		                        		<div v-if="dataLabel.length">
-		                        			<Tag closable v-for="(item,index) in dataLabel" @on-close="closeLabel(item)">{{item.label_name}}</Tag>
-		                        		</div>
-		                        		<span class="span" v-else>选择用户关联标签</span>
-		                        	</div>
-		                        	<div class="iconfont iconxiayi"></div>
-		                        </div>
-                            <Button type="text" @click="add(1)">添加标签</Button>
-                        </div>
-                    </FormItem>
-                    <FormItem label="用户分组:">
-                        <div class="flex-add">
-                            <Select v-model="formData.group_id" placeholder="请选择" :transfer="true">
-                                <Option v-for="item in groupList" :key="item.id" :value="item.id">{{ item.group_name }}</Option>
-                            </Select>
-														<Button type="text" @click="add(2)">添加分组</Button>
-                        </div>
-                    </FormItem>
-                    <FormItem label="用户等级:">
-                        <Select v-model="formData.level">
-                            <Option v-for="item in levelOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="推广人:">
-                        <Input v-model="formData.spread_uid_nickname" @on-clear="clearSpread" clearable placeholder="请选择" icon="ios-arrow-down" @on-focus="editSpread"></Input>
-                    </FormItem>
-                </div>
-            </div>
-        </Form>
-				<Modal
-				  v-model="customerShow"
-				  scrollable
-				  title="请选择商城用户"
-				  :closable="false"
-				  width="900"
-				>
-				  <customerInfo v-if="customerShow" @imageObject="imageObject"></customerInfo>
-				</Modal>
-				<!-- 用户标签 -->
-				<Modal
-				  v-model="labelShow"
-				  scrollable
-				  title="选择用户标签"
-				  :closable="true"
-				  width="540"
-				  :footer-hide="true"
-					:mask-closable="false"
-				>
-				  <userLabel ref="userLabel" @activeData="activeData" @close="labelClose"></userLabel>
-				</Modal>
-    </div>
+	<div>
+		<Form :model="formData" :label-width="76">
+			<div class="section">
+				<div class="section-hd">基本信息</div>
+				<div class="section-bd">
+					<FormItem label="用户编号:">
+						<Input v-model="formData.uid" disabled></Input>
+					</FormItem>
+					<FormItem label="真实姓名:">
+						<Input v-model="formData.real_name" placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="手机号码:">
+						<Input v-model="formData.phone" placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="生日:">
+						<DatePicker :value="formData.birthday" @on-change="dateChange"></DatePicker>
+					</FormItem>
+					<FormItem label="性别:">
+						<Select v-model="formData.sex">
+							<Option :value="0">保密</Option>
+							<Option :value="1">男</Option>
+							<Option :value="2">女</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="省市区:">
+						<Cascader v-model="addressSelect" :data="addresData" :load-data="loadData2"
+							@on-change="addchack" change-on-select></Cascader>
+					</FormItem>
+					<FormItem label="身份证号:">
+						<Input v-model="formData.card_id" placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="详细地址:">
+						<Input v-model="formData.addres" placeholder="请输入"></Input>
+					</FormItem>
+				</div>
+			</div>
+			<div class="section">
+				<div class="section-hd">密码设置</div>
+				<div class="section-bd">
+					<FormItem label="登录密码:">
+						<Input v-model="formData.pwd" type="password" password placeholder="请输入"></Input>
+					</FormItem>
+					<FormItem label="确认密码:">
+						<Input v-model="formData.true_pwd" type="password" password placeholder="请输入"></Input>
+					</FormItem>
+				</div>
+			</div>
+			<div class="section">
+				<div class="section-hd">用户设置</div>
+				<div class="section-bd" >
+					<FormItem label="代理等级:">
+						<Select v-model="formData.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 label="用户等级:">
+						<Select v-model="formData.level">
+							<Option v-for="item in levelOptions" :key="item.id" :value="item.id">{{ item.name }}
+							</Option>
+						</Select>
+					</FormItem>
+					<FormItem label="推广资格:">
+						<i-switch v-model="formData.spread_open" :true-value="1" :false-value="0" size="large">
+							<span slot="open">启用</span>
+							<span slot="close">禁用</span>
+						</i-switch>
+					</FormItem>
+					<FormItem label="用户状态:">
+						<i-switch v-model="formData.status" :true-value="1" :false-value="0" size="large">
+							<span slot="open">开启</span>
+							<span slot="close">锁定</span>
+						</i-switch>
+					</FormItem>
+					<FormItem label="用户标签:">
+						<div class="flex-add">
+							<div class="labelInput acea-row row-between-wrapper" @click="openLabel">
+								<div class="width-add">
+									<div v-if="dataLabel.length">
+										<Tag closable v-for="(item,index) in dataLabel" @on-close="closeLabel(item)">
+											{{item.label_name}}
+										</Tag>
+									</div>
+									<span class="span" v-else>选择用户关联标签</span>
+								</div>
+								<div class="iconfont iconxiayi"></div>
+							</div>
+							<Button type="text" @click="add(1)">添加标签</Button>
+						</div>
+					</FormItem>
+					<FormItem label="用户分组:">
+						<div class="flex-add">
+							<Select v-model="formData.group_id" placeholder="请选择" :transfer="true">
+								<Option v-for="item in groupList" :key="item.id" :value="item.id">{{ item.group_name }}
+								</Option>
+							</Select>
+							<Button type="text" @click="add(2)">添加分组</Button>
+						</div>
+					</FormItem>
+					
+					<FormItem label="推广人:">
+						<Input v-model="formData.spread_uid_nickname" @on-clear="clearSpread" clearable
+							placeholder="请选择" icon="ios-arrow-down" @on-focus="editSpread"></Input>
+					</FormItem>
+					
+				</div>
+			</div>
+		</Form>
+		<Modal v-model="customerShow" scrollable title="请选择商城用户" :closable="false" width="900">
+			<customerInfo v-if="customerShow" @imageObject="imageObject"></customerInfo>
+		</Modal>
+		<!-- 用户标签 -->
+		<Modal v-model="labelShow" scrollable title="选择用户标签" :closable="true" width="540" :footer-hide="true"
+			:mask-closable="false">
+			<userLabel ref="userLabel" @activeData="activeData" @close="labelClose"></userLabel>
+		</Modal>
+	</div>
 </template>
 
 <script>
-import { userLabelAddApi, groupAddApi, levelListApi, userGroupApi, userLabelApi, putUserApi } from '@/api/user';
-import { cityApi } from '@/api/store';
-import customerInfo from "@/components/customerInfo";
-import userLabel from "@/components/labelList";
+	import {
+		userLabelAddApi,
+		groupAddApi,
+		levelListApi,
+		userGroupApi,
+		userLabelApi,
+		putUserApi
+	} from '@/api/user';
+	import {
+		cityApi
+	} from '@/api/store';
+	import customerInfo from "@/components/customerInfo";
+	import userLabel from "@/components/labelList";
 
-export default {
-    name: 'userForm',
+	export default {
+		name: 'userForm',
 		components: {
-		  customerInfo,
+			customerInfo,
 			userLabel
 		},
-    props: {
-        psInfo: Object
-    },
-    data() {
-        return {
-					  labelShow:false,
-					  customerShow: false,
-            formData: {
-                uid: this.psInfo.uid,
-                real_name: this.psInfo.real_name,
-                phone: this.psInfo.phone,
-                birthday: this.psInfo.birthday,
-                sex: this.psInfo.sex,
-                card_id: this.psInfo.card_id,
-                addres: this.psInfo.addres,
-                pwd: '',
-                true_pwd: '',
-                spread_open: this.psInfo.spread_open,
-                status: this.psInfo.status,
-                group_id: 0,
-                label_id: [],
-                level: this.psInfo.level,
-                provincials: '',
-                province: 0,
-                city: 0,
-                area: 0,
-                street: 0,
-								spread_uid: 0,
-								spread_uid_nickname:''
-            },
-						dataLabel: [],
-            addressSelect: [],
-            levelOptions: [],
-            labelOptions: [],
-            addresData: [],
-						groupList: []
-        };
-    },
-    watch: {
-        psInfo: {
-          handler(value) {
-            this.formData.uid = value.uid;
-            this.formData.real_name = value.real_name;
-            this.formData.phone = value.phone;
-            this.formData.birthday = value.birthday;
-            this.formData.sex = value.sex;
-            this.formData.card_id = value.card_id;
-            this.formData.addres = value.addres;
-            this.formData.spread_open = value.spread_open;
-            this.formData.status = value.status;
-            this.dataLabel = value.label_id;
-            this.formData.level = value.level;
-            this.formData.provincials = value.provincials;
-            this.formData.province = value.province;
-            this.formData.city = value.city;
-            this.formData.area = value.area;
-            this.formData.street = value.street;
-						this.formData.spread_uid_nickname = value.spread_uid_nickname;
-						this.formData.spread_uid = value.spread_uid;
-            this.formData.group_id = value.group_id;
-          },
-          immediate: true
-        }
-    },
-    created () {
-        this.levelList();
-        this.groupLists();
-        this.labelList();
-        this.cityInfo({ pid: 0 });
-        if (this.psInfo.province) {
-            this.addressSelect.push(this.psInfo.province);
-        }
-        if (this.psInfo.city) {
-            this.addressSelect.push(this.psInfo.city);
-        }
-        if (this.psInfo.area) {
-            this.addressSelect.push(this.psInfo.area);
-        }
-        if (this.psInfo.street) {
-            this.addressSelect.push(this.psInfo.street);
-        }
-    },
-    methods: {
-			  clearSpread(){
-					this.formData.spread_uid = 0;
-					this.formData.spread_uid_nickname = '';
-				},
-				closeLabel(label){
-					let index = this.dataLabel.indexOf(this.dataLabel.filter(d=>d.id == label.id)[0]);
-					this.dataLabel.splice(index,1);
-				},
-				activeData(dataLabel){
-					this.labelShow = false;
-					this.dataLabel = dataLabel;
-				},
-				openLabel() {
-					this.labelShow = true;
-					this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
-				},
-				// 标签弹窗关闭
-				labelClose() {
-				  this.labelShow = false;
-				},
-				editSpread(){
-					this.customerShow = true;
+		props: {
+			psInfo: Object
+		},
+		data() {
+			return {
+				labelShow: false,
+				customerShow: false,
+				formData: {
+					uid: this.psInfo.uid,
+					real_name: this.psInfo.real_name,
+					phone: this.psInfo.phone,
+					birthday: this.psInfo.birthday,
+					sex: this.psInfo.sex,
+					card_id: this.psInfo.card_id,
+					addres: this.psInfo.addres,
+					pwd: '',
+					true_pwd: '',
+					spread_open: this.psInfo.spread_open,
+					status: this.psInfo.status,
+					group_id: 0,
+					label_id: [],
+					level: this.psInfo.level,
+					provincials: '',
+					province: 0,
+					city: 0,
+					area: 0,
+					street: 0,
+					spread_uid: 0,
+					spread_uid_nickname: '',
+					area_admin: "0",
+					area_admin_province: '',
+					area_admin_city: '',
+					area_admin_district: '',
 				},
-				imageObject(e) {
-				  this.customerShow = false;
-				  this.formData.spread_uid = e.uid;
-					this.formData.spread_uid_nickname = e.name
+				dataLabel: [],
+				//省市区
+				addressSelect: [],
+				// 代理区域
+				addressSelectDl: [],
+				levelOptions: [],
+				labelOptions: [],
+				// 基础地址信息
+				addresData: [],
+				// 三级地质系
+				addresData2: [],
+				groupList: []
+			};
+		},
+		watch: {
+			psInfo: {
+				handler(value) {
+					this.formData.uid = value.uid;
+					this.formData.real_name = value.real_name;
+					this.formData.phone = value.phone;
+					this.formData.birthday = value.birthday;
+					this.formData.sex = value.sex;
+					this.formData.card_id = value.card_id;
+					this.formData.addres = value.addres;
+					this.formData.spread_open = value.spread_open;
+					this.formData.status = value.status;
+					this.dataLabel = value.label_id;
+					this.formData.level = value.level;
+					this.formData.provincials = value.provincials;
+					this.formData.province = value.province;
+					this.formData.city = value.city;
+					this.formData.area = value.area;
+					this.formData.street = value.street;
+					this.formData.spread_uid_nickname = value.spread_uid_nickname;
+					this.formData.spread_uid = value.spread_uid;
+					this.formData.group_id = value.group_id;
+					this.formData.area_admin = value.area_admin;
+					this.formData.area_admin_province = value.area_admin_province;
+					this.formData.area_admin_city = value.area_admin_city;
+					this.formData.area_admin_district = value.area_admin_district;
 				},
-        changeMenu (value) {
-            this.$emit('change-menu', value);
-        },
-        // 添加标签、分组
-        add (value) {
-            switch (value) {
-                case 1:
-                    this.$modalForm(userLabelAddApi(0)).then(() => {});
-                    break;
-                case 2:
-                    this.$modalForm(groupAddApi(0)).then(() => {
-											this.groupLists();
-										});
-                    break;
-            }
-        },
-        // 会员等级列表
-        levelList() {
-        let data = {
-            page: 1,
-            limit: "",
-            title: "",
-            is_show: 1,
-        };
-        levelListApi(data).then((res) => {
-            this.levelOptions = res.data.list;
-        });
-        },
-        groupLists() {
-            let data = {
-                page: 1,
-                limit: "",
-            };
-            userGroupApi(data).then((res) => {
-                this.groupList = res.data.list;
-            });
-            },
-        labelList() {
-            let data = {
-                page: 1,
-                limit: "",
-            };
-            userLabelApi(data)
-                .then(async (res) => {
-                let data = res.data;
-                this.labelOptions = data.list;
-                })
-                .catch((res) => {
-                this.loading = false;
-                this.$Message.error(res.msg);
-                });
-            },
-        // 省市区数据
-        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.formData.province = i
-                }else if(index==1){
-                    this.formData.city = i
-                }else if(index==2){
-                    this.formData.area = i
-                }else {
-                    this.formData.street = i
-                }
-            })
-            this.formData.provincials = (selectedData.map(o => o.label)).join("/");
-        },
-        dateChange (value) {
-            this.formData.birthday = value;
-        },
-        // 保存用户信息
-        detailsPut () {
-					  let activeIds = [];
-					  this.dataLabel.forEach((item)=>{
-					  	activeIds.push(item.id)
-					  });
-						this.formData.label_id = activeIds
-						if (this.formData.phone && !/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.formData.phone)) {
-							return this.$Message.error('请填写正确的手机号');
-						}
-            putUserApi(this.formData).then(res => {
-							  this.$Message.success('修改成功');
-                this.$emit('change-menu', '99');
-            }).catch(res => {
-                this.$Message.error(res.msg);
-            });
-        }
-    }
-}
+				immediate: true
+			}
+		},
+		created() {
+			this.levelList();
+			this.groupLists();
+			this.labelList();
+			this.cityInfo({
+				pid: 0
+			}, 'addresData');
+			if (this.psInfo.area_admin) {
+				this.changearea(this.psInfo.area_admin.toString(), "init");
+			}
+			if (this.psInfo.province) {
+				this.addressSelect.push(this.psInfo.province);
+			}
+			if (this.psInfo.city) {
+				this.addressSelect.push(this.psInfo.city);
+			}
+			if (this.psInfo.area) {
+				this.addressSelect.push(this.psInfo.area);
+			}
+			console.log(this.addressSelect, 'addressSelect')
+			if (this.psInfo.street) {
+				this.addressSelect.push(this.psInfo.street);
+			}
+		},
+		methods: {
+			// 选择运营中心
+			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(e,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
+				}
+
+			},
+			clearSpread() {
+				this.formData.spread_uid = 0;
+				this.formData.spread_uid_nickname = '';
+			},
+			closeLabel(label) {
+				let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]);
+				this.dataLabel.splice(index, 1);
+			},
+			activeData(dataLabel) {
+				this.labelShow = false;
+				this.dataLabel = dataLabel;
+			},
+			openLabel() {
+				this.labelShow = true;
+				this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
+			},
+			// 标签弹窗关闭
+			labelClose() {
+				this.labelShow = false;
+			},
+			editSpread() {
+				this.customerShow = true;
+			},
+			imageObject(e) {
+				this.customerShow = false;
+				this.formData.spread_uid = e.uid;
+				this.formData.spread_uid_nickname = e.name
+			},
+			changeMenu(value) {
+				this.$emit('change-menu', value);
+			},
+			// 添加标签、分组
+			add(value) {
+				switch (value) {
+					case 1:
+						this.$modalForm(userLabelAddApi(0)).then(() => {});
+						break;
+					case 2:
+						this.$modalForm(groupAddApi(0)).then(() => {
+							this.groupLists();
+						});
+						break;
+				}
+			},
+			// 会员等级列表
+			levelList() {
+				let data = {
+					page: 1,
+					limit: "",
+					title: "",
+					is_show: 1,
+				};
+				levelListApi(data).then((res) => {
+					this.levelOptions = res.data.list;
+				});
+			},
+			groupLists() {
+				let data = {
+					page: 1,
+					limit: "",
+				};
+				userGroupApi(data).then((res) => {
+					this.groupList = res.data.list;
+				});
+			},
+			labelList() {
+				let data = {
+					page: 1,
+					limit: "",
+				};
+				userLabelApi(data)
+					.then(async (res) => {
+						let data = res.data;
+						this.labelOptions = data.list;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// 省市区数据
+			cityInfo(data, name) {
+				cityApi(data).then(res => {
+					this[name] = res.data
+				})
+			},
+			getCityData(item, callback, type = 0) {
+				item.loading = true;
+				cityApi({
+					pid: item.value,
+					type
+				}).then(res => {
+					item.children = res.data;
+					item.loading = false;
+					callback();
+				});
+			},
+			// 省市区选择
+			loadData(item, callback) {
+				this.getCityData(item, callback, 0)
+			},
+			// 代理省市区选择
+			loadData2(item, callback) {
+				console.log(item,this.formData.area_admin);
+				if (this.formData.area_admin == "2") {
+					this.getCityData(item, callback, 1)
+				} else if (this.formData.area_admin == "1") {
+					this.getCityData(item, callback, 2)
+				}else if(this.formData.area_admin == "3") {
+					this.getCityData(item, callback, 0)
+				}
+			},
+			addchack(e, selectedData) {
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formData.province = i
+					} else if (index == 1) {
+						this.formData.city = i
+					} else if (index == 2) {
+						this.formData.area = i
+					} else {
+						this.formData.street = i
+					}
+				})
+				this.formData.provincials = (selectedData.map(o => o.label)).join("/");
+			},
+			addchack2(e, selectedData) {
+				console.log(e,'eeeeeeee');
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formData.area_admin_province = selectedData[index].label
+					} else if (index == 1) {
+						this.formData.area_admin_city = selectedData[index].label
+					} else if (index == 2) {
+						this.formData.area_admin_district = selectedData[index].label
+					}
+				})
+				this.formData.area_provincials = (selectedData.map(o => o.id)).join("/");
+			},
+			dateChange(value) {
+				this.formData.birthday = value;
+			},
+			// 保存用户信息
+			detailsPut() {
+				let activeIds = [];
+				this.dataLabel.forEach((item) => {
+					activeIds.push(item.id)
+				});
+				this.formData.label_id = activeIds
+				if (this.formData.phone && !/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.formData.phone)) {
+					return this.$Message.error('请填写正确的手机号');
+				}
+				putUserApi(this.formData).then(res => {
+					this.$Message.success('修改成功');
+					this.$emit('change-menu', '99');
+				}).catch(res => {
+					this.$Message.error(res.msg);
+				});
+			}
+		}
+	}
 </script>
 
 <style lang="less" scoped>
-.flex-add {
- display: flex;
-}
-.width-add {
- width: 90%;
-}
-.section {
-    padding: 25px 0 5px;
-    border-top: 1px dashed #EEEEEE;
+	.flex-add {
+		display: flex;
+	}
+
+	.width-add {
+		width: 90%;
+	}
 
-    &:first-child {
-        border-top: 0;
-    }
+	.section {
+		padding: 25px 0 5px;
+		border-top: 1px dashed #EEEEEE;
 
-    &-hd {
-        padding-left: 10px;
-        border-left: 3px solid #1890FF;
-        font-weight: 500;
-        font-size: 14px;
-        line-height: 16px;
-        color: #303133;
-    }
+		&:first-child {
+			border-top: 0;
+		}
 
-    &-bd {
-        display: flex;
-        flex-wrap: wrap;
-        margin-top: 20px;
-    }
+		&-hd {
+			padding-left: 10px;
+			border-left: 3px solid #1890FF;
+			font-weight: 500;
+			font-size: 14px;
+			line-height: 16px;
+			color: #303133;
+		}
 
-    .ivu-form-item {
-        flex: 0 0 50%;
-        margin-bottom: 20px;
+		&-bd {
+			display: flex;
+			flex-wrap: wrap;
+			margin-top: 20px;
+		}
 
-        &:nth-child(odd) {
-            padding-right: 48px;
-        }
+		.ivu-form-item {
+			flex: 0 0 50%;
+			margin-bottom: 20px;
 
-        &:nth-child(even) {
-            padding-left: 48px;
-        }
-    }
+			&:nth-child(odd) {
+				padding-right: 48px;
+			}
 
-    .ivu-date-picker {
-        width: 100%;
-    }
+			&:nth-child(even) {
+				padding-left: 48px;
+			}
+		}
 
-    .ivu-btn-text {
-        color: #1890FF;
+		.ivu-date-picker {
+			width: 100%;
+		}
 
-        &:focus {
-            box-shadow: none;
-        }
-    }
-}
-.labelInput{
-	border: 1px solid #dcdee2;
-	width: 100%;
-	padding: 0 5px;
-	border-radius: 5px;
-	min-height: 30px;
-	cursor: pointer;
-	.span{
-		 color: #c5c8ce;
+		.ivu-btn-text {
+			color: #1890FF;
+
+			&:focus {
+				box-shadow: none;
+			}
+		}
 	}
-	.iconxiayi{
-		font-size: 12px
+
+	.labelInput {
+		border: 1px solid #dcdee2;
+		width: 100%;
+		padding: 0 5px;
+		border-radius: 5px;
+		min-height: 30px;
+		cursor: pointer;
+
+		.span {
+			color: #c5c8ce;
+		}
+
+		.iconxiayi {
+			font-size: 12px
+		}
 	}
-}
-</style>
+</style>

+ 15 - 0
src/pages/user/list/handle/userInfo.vue

@@ -58,6 +58,21 @@
                     <div>用户等级:</div>
                     <div class="value">{{ psInfo.vip_name }}</div>
                 </div>
+				<div class="item" v-if="psInfo.area_admin">
+				    <div>代理等级:</div>
+				    <div class="value" v-if="psInfo.area_admin==3">省</div>
+				    <div class="value" v-if="psInfo.area_admin==2">市</div>
+				    <div class="value" v-if="psInfo.area_admin==1">区</div>
+				</div>
+				<div class="item" v-if="psInfo.area_admin">
+				    <div>代理区域:</div>
+				    <div class="value">
+						<span >{{ psInfo.area_admin_province }}</span>
+						<span v-if="psInfo.area_admin_city">/{{ psInfo.area_admin_city }}</span>
+						<span v-if="psInfo.area_admin_district">/{{ psInfo.area_admin_district }}</span>
+					
+					</div>
+				</div>
                 <div class="item">
                     <div>用户标签:</div>
                     <div class="value">{{ psInfo.label_list }}</div>

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

@@ -82,6 +82,24 @@ export default {
             },
             component: () => import('@/pages/marketing/storeCouponIssue/index')
         },
+		{
+		    path: 'super/index',
+		    name: `${pre}superList`,
+		    meta: {
+		        auth: ['admin-marketing-super_list'],	
+		        title: '至尊卡列表'
+		    },
+		    component: () => import('@/pages/marketing/super/index')
+		},
+		{
+		    path: 'super/create/:id?',
+		    name: `${pre}superCreate`,
+		    meta: {
+		        auth: ['admin-marketing-super_create'],	
+		        title: '添加至尊卡'
+		    },
+		    component: () => import('@/pages/marketing/super/create')
+		},
         {
             path: 'store_coupon_issue/create/:id?',
             name: `${pre}storeCouponCreate`,