Browse Source

godownDetail

lhl 1 year ago
parent
commit
62d3cbdd1c
38 changed files with 16436 additions and 247 deletions
  1. 301 1
      src/api/erp.js
  2. 2 2
      src/pages/erp/adjust/index.vue
  3. 27 4
      src/pages/erp/batch/index.vue
  4. 230 45
      src/pages/erp/godown/godownDetail.vue
  5. 39 8
      src/pages/erp/in/addInList.vue
  6. 281 8
      src/pages/erp/in/index.vue
  7. 712 0
      src/pages/erp/inventory/addStocktaking.vue
  8. 258 0
      src/pages/erp/inventory/pdgoods.vue
  9. 413 0
      src/pages/erp/inventory/stocktaking.vue
  10. 541 0
      src/pages/erp/inventory/stocktakingDetail.vue
  11. 963 0
      src/pages/erp/out/addOut.vue
  12. 269 0
      src/pages/erp/out/goodDetail.vue
  13. 213 36
      src/pages/erp/out/index.vue
  14. 637 0
      src/pages/erp/out/outDetail.vue
  15. 1049 0
      src/pages/erp/out/storeReceipt.vue
  16. 2438 0
      src/pages/erp/product/addProduct.vue
  17. 236 0
      src/pages/erp/product/components/addCarMy.vue
  18. 258 0
      src/pages/erp/product/components/addReply.vue
  19. 101 0
      src/pages/erp/product/components/attrList.vue
  20. 3951 0
      src/pages/erp/product/components/productDetails.vue
  21. 292 0
      src/pages/erp/product/components/replyList.vue
  22. 285 0
      src/pages/erp/product/components/stockEdit.vue
  23. 371 0
      src/pages/erp/product/index.vue
  24. 577 0
      src/pages/erp/product/productDetail.vue
  25. 118 36
      src/pages/erp/purchase/addPurchase.vue
  26. 260 0
      src/pages/erp/purchase/goodDetail.vue
  27. 15 5
      src/pages/erp/purchase/index.vue
  28. 136 45
      src/pages/erp/purchase/purchaseDetail.vue
  29. 106 22
      src/pages/erp/receive/index.vue
  30. 695 0
      src/pages/erp/receive/receiveDetail.vue
  31. 27 19
      src/pages/erp/user/addUser.vue
  32. 3 3
      src/pages/erp/user/userDetails.vue
  33. 1 1
      src/pages/erp/want/addWant.vue
  34. 10 2
      src/pages/erp/want/goodDetail.vue
  35. 9 1
      src/pages/erp/want/index.vue
  36. 545 0
      src/pages/erp/want/wantDetail.vue
  37. 21 8
      src/pages/product/productBrand/components/menusFrom.vue
  38. 46 1
      src/router/modules/erp.js

+ 301 - 1
src/api/erp.js

@@ -420,7 +420,53 @@ export function getInventoryList(data) {
 	});
 }
 
-//
+/**
+ * @description 盘点单审核
+ * @param {Object} param data {Object} 传值参数
+ */
+export function authInventory(data) {
+	return request({
+	  url: "/erp/Warehouse/inventory_auth",
+	  method: "post",
+	  data
+	});
+}
+
+/**
+ * @description 创建盘点单
+ * @param {Object} param data {Object} 传值参数
+ */
+export function saveInventory(data) {
+	return request({
+	  url: "/erp/Warehouse/inventory_save",
+	  method: "post",
+	  data
+	});
+}
+
+/**
+ * @description 盘点商品列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getInventoryGoods(data) {
+	return request({
+	  url: "/erp/Warehouse/position_info_lst",
+	  method: "get",
+	  params:data
+	});
+}
+
+/**
+ * @description 盘点单详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getInventoryInfo(id) {
+	return request({
+	  url: "/erp/Warehouse/inventory_info/"+ id,
+	  method: "get"
+	});
+}
+
 /**
  * @description 仓库仓位商品列表
  * @param {Object} param data {Object} 传值参数
@@ -432,6 +478,227 @@ export function getGoodsList(data) {
 	  params:data
 	});
 }
+
+
+//Warehouse/ware_out
+//
+/**
+ * @description 出库列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getOutLists(data) {
+	return request({
+	  url: "/erp/Warehouse/ware_out",
+	  method: "get",
+	  params:data
+	});
+}
+
+/**
+ * @description 入库列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getInLists(data) {
+	return request({
+	  url: "/erp/Warehouse/ware_in",
+	  method: "get",
+	  params:data
+	});
+}
+
+/**
+ * @description 调出商品列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getOutGoodList(data) {
+	return request({
+	  url: "/erp/out_lst",
+	  method: "get",
+	  params:data
+	});
+}
+
+/**
+ * @description 创建调出
+ * @param {Object} param data {Object} 传值参数
+ */
+export function createOut(data) {
+	return request({
+	  url: "/erp/out/create",
+	  method: "post",
+	  data
+	});
+}
+
+/**
+ * @description 调出单详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getOutInfo(id) {
+	return request({
+	  url: "/erp/out/info/" + id,
+	  method: "get",
+	});
+}
+
+/**
+ * @description 调出单详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function editOut(id,data) {
+	return request({
+	  url: "/erp/out/update/" + id,
+	  method: "post",
+	  data
+	});
+}
+
+/**
+ * @description 调出单详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function outSave(id,data) {
+	return request({
+	  url: "/erp/out/auth_save/" + id,
+	  method: "post",
+	  data
+	});
+}
+
+//store_delivery
+/**
+ * @description 调出单详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function storeReceipt(data) {
+	return request({
+	  url: "/erp/store_delivery",
+	  method: "post",
+	  data
+	});
+}
+//stock/auth
+/**
+ * @description 门店收货审核
+ * @param {Object} param data {Object} 传值参数
+ */
+export function storeAuth(data) {
+	return request({
+	  url: "/erp/stock/auth",
+	  method: "post",
+	  data
+	});
+}
+
+//stock/info
+/**
+ * @description 门店收货审核
+ * @param {Object} param data {Object} 传值参数
+ */
+export function storeInfo(data) {
+	return request({
+	  url: "/erp/stock/info",
+	  method: "get",
+	  params:data
+	});
+}
+
+//ware_delivery
+/**
+ * @description 库间收货
+ * @param {Object} param data {Object} 传值参数
+ */
+export function wareDelivery(data) {
+	return request({
+	  url: "/erp/ware_delivery",
+	  method: "post",
+	 data
+	});
+}
+
+/**
+ * @description 入库上架
+ * @param {Object} param data {Object} 传值参数
+ */
+export function listing(data) {
+	return request({
+	  url: "/erp/in/in_stock",
+	  method: "post",
+	 data
+	});
+}
+
+/**
+ * @description 入库上架
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getInInfo(id) {
+	return request({
+	  url: "/erp/in/info/" + id,
+	  method: "get",
+	});
+}
+
+/**
+ * @description 商品列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getGoods(data) {
+	return request({
+	  url: "/erp/goods/list",
+	  method: "get",
+	  params: data
+	});
+}
+
+//goods/info/
+/**
+ * @description 商品详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getGoodInfo(id) {
+	return request({
+	  url: "/erp/goods/info/" + id,
+	  method: "get"
+	});
+}
+
+/**
+ * @description 创建批次
+ * @param {Object} param data {Object} 传值参数
+ */
+export function batch_save(data) {
+	return request({
+	  url: "/erp/Product/batch_save",
+	  method: "post",
+	  data
+	});
+}
+
+/**
+ * @description 创建商品
+ * @param {Object} param data {Object} 传值参数
+ */
+export function addProduct(id,data) {
+	return request({
+	  url: "/erp/goods/create/" + id,
+	  method: "post",
+	  data
+	});
+}
+
+//Product/batch_lst
+/**
+ * @description 创建商品
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getBatchList(data) {
+	return request({
+	  url: "/erp/Product/batch_lst",
+	  method: "get",
+	  params:data
+	});
+}
 /*
 Route::get('user/list', 'v1.erp.User/index')->option(['real_name' => '用户列表']);
 Route::get('user/info/:id', 'v1.erp.User/info')->option(['real_name' => '用户详情']);
@@ -494,3 +761,36 @@ Route::post('stock/auth', 'v1.erp.stock/auth')->option(['real_name' => '门店
 Route::get('stock/info', 'v1.erp.stock/info')->option(['real_name' => '门店收货详情']);//门店收货详情
 
 */
+
+
+// Route::get('Warehouse/list', 'v1.erp.Warehouse/index')->option(['real_name' => '仓库列表']);
+// Route::get('Warehouse/info/:id', 'v1.erp.Warehouse/info')->option(['real_name' => '仓库详情']);
+// Route::post('Warehouse/create/:id', 'v1.erp.Warehouse/create')->option(['real_name' => '创建仓库']);
+// Route::delete('Warehouse/del/:id', 'v1.erp.Warehouse/del')->option(['real_name' => '删除仓库']);
+// Route::get('Warehouse/position', 'v1.erp.Warehouse/position')->option(['real_name' => '仓库位置']);
+// Route::post('Warehouse/position_save', 'v1.erp.Warehouse/position_save')->option(['real_name' =>'仓位保存']);
+// Route::delete('Warehouse/position_del/:id', 'v1.erp.Warehouse/position_del')->option(['real_name' => '删除仓位']);
+// Route::get('Warehouse/position_info/:id', 'v1.erp.Warehouse/position_info')->option(['real_name' => '仓位详情']);
+// Route::get('Warehouse/position_info_list', 'v1.erp.Warehouse/position_info_list')->option(['real_name' => '仓位商品列表']);
+// Route::get('Warehouse/position_info_lst', 'v1.erp.Warehouse/position_info_lst')->option(['real_name' => '仓位商品列表1']);
+// Route::get('Warehouse/out_goods_lst', 'v1.erp.Warehouse/out_goods_lst')->option(['real_name' => '出库商品列表']);
+// Route::get('Warehouse/product_batch', 'v1.erp.Warehouse/product_batch')->option(['real_name' => '商品批次列表']);
+// Route::get('Warehouse/inventory_lst', 'v1.erp.Warehouse/inventory_lst')->option(['real_name' => '盘点单列表']);
+// Route::post('Warehouse/inventory_save', 'v1.erp.Warehouse/inventory_save')->option(['real_name' => '盘点单保存']);
+// Route::post('Warehouse/inventory_auth', 'v1.erp.Warehouse/inventory_auth')->option(['real_name' => '盘点单审核']);
+// Route::get('Warehouse/inventory_info/:id', 'v1.erp.Warehouse/inventory_info')->option(['real_name' => '盘点单详情']);
+// Route::get('Warehouse/ware_user', 'v1.erp.Warehouse/ware_user')->option(['real_name' =>'仓库用户列表']);
+// Route::get('Warehouse/ware_purchase', 'v1.erp.Warehouse/ware_purchase')->option(['real_name' =>'仓库采购订单']);
+// Route::get('Warehouse/ware_out', 'v1.erp.Warehouse/ware_out')->option(['real_name' =>'仓库出库订单']);
+// Route::get('Warehouse/ware_in', 'v1.erp.Warehouse/ware_in')-
+
+
+// Route::get('goods/list', 'v1.erp.Goods/index')->option(['real_name' => '商品列表']);
+// Route::get('goods/info/:id', 'v1.erp.Goods/info')->option(['real_name' => '商品详情']);
+// Route::post('goods/create/:id', 'v1.erp.Goods/create')->option(['real_name' => '创建商品']);
+// Route::get('goods/adjust_price_lst', 'v1.erp.Goods/adjust_price_lst')->option(['real_name' => '商品调价']);
+// Route::post('goods/adjust_price', 'v1.erp.Goods/adjust_price')->option(['real_name' => '商品调价保存']);
+// Route::get('goods/adjust_price_info', 'v1.erp.Goods/adjust_price_info')->option(['real_name' => '调价详情']);
+
+// Route::post('Product/batch_save', 'v1.erp.Goods/batch_save')->name('batch_save');//创建批次
+// Route::get('Product/batch_lst', 'v1.erp.Goods/batch_lst')->name('batch_lst');//批次列表

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

@@ -116,7 +116,7 @@
 		storeSeckillApi,
 	} from "@/api/marketing";
 	import {
-		getAdjustList,
+		getBatchList,
 		getUserInfo,
 		getUserList
 	} from "@/api/erp";
@@ -326,7 +326,7 @@
 				this.loading = true;
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
-				getAdjustList(this.tableFrom)
+				getBatchList(this.tableFrom)
 					.then(async (res) => {
 						let data = res.data;
 						this.tableList = data.data;

+ 27 - 4
src/pages/erp/batch/index.vue

@@ -6,6 +6,13 @@
 				<!-- 查询条件 -->
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
+					<FormItem label="商品:" prop="product_id" label-for="product_id">
+						<Select v-model="tableFrom.product_id" @on-change="userSearchs" clearable class="input-add">
+							<Option v-for="item in goods" :value="item.id + ''">
+								{{ item.store_name }}
+							</Option>
+						</Select>
+					</FormItem>
 					<!-- <FormItem label="创建时间:" label-for="user_time">
             <DatePicker
                 :editable="false"
@@ -30,10 +37,10 @@
               <Option value="0">下架</Option>
             </Select>
           </FormItem> -->
-					<FormItem label="仓位搜索:" label-for="store_name">
+					<!-- <FormItem label="批次搜索:" label-for="store_name">
 						<Input class="input-add mr14" placeholder="请输入仓位名称" v-model="tableFrom.key" />
 						<Button type="primary" @click="tableSearchs()">查询</Button>
-					</FormItem>
+					</FormItem> -->
 					<!-- <Button
             v-auth="['marketing-store_seckill-create']"
             type="primary"
@@ -96,7 +103,8 @@
 	import {
 		getPositionList,
 		getUserInfo,
-		getProductBatch
+		getBatchList,
+		getGoods
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -118,6 +126,7 @@
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
+				goods: [],
 				columns1: [{
 						title: "ID",
 						key: "id",
@@ -179,6 +188,7 @@
 					// is_show: "",
 					// store_name: "",
 					key: '',
+					product_id: 0,
 					page: 1,
 					limit: 10,
 				},
@@ -196,8 +206,21 @@
 		},
 		created() {
 			this.getList();
+			this.getGoods()
 		},
 		methods: {
+			userSearchs(e) {
+				this.tableFrom.page = 1
+				this.getList()
+			},
+			getGoods() {
+				getGoods({
+					page:1,
+					limit: 1000
+				}).then(res => {
+					this.goods = res.data.data
+				})
+			},
 			// 添加
 			add() {
 				this.$router.push({
@@ -273,7 +296,7 @@
 				this.loading = true;
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
-				getProductBatch(this.tableFrom)
+				getBatchList(this.tableFrom)
 					.then(async (res) => {
 						let data = res.data;
 						this.tableList = data.data;

+ 230 - 45
src/pages/erp/godown/godownDetail.vue

@@ -1,10 +1,41 @@
 <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="user-info">
+			<div class="section">
+				<div class="section-hd">仓库详情</div>
+				<div class="section-bd" v-for="item in wareInfo.info">
+					<div class="item">
+						<div>仓库ID:</div>
+						<div class="value">{{ item.id}}</div>
+					</div>
+					<div class="item">
+						<div>仓库名称:</div>
+						<div class="value">{{ item.title}}</div>
+					</div>
+					<div class="item">
+						<div>省市区:</div>
+						<div class="value">{{ item.address }}</div>
+					</div>
+					<div class="item">
+						<div>详细地址:</div>
+						<div class="value">{{ item.detailed_address }}</div>
+					</div>
+					<div class="item">
+						<div>手机号码:</div>
+						<div class="value">{{ item.phone}}</div>
+					</div>
+					<div class="item">
+						<div>是否显示:</div>
+						<div class="value">{{ item.is_show? '是': '否' }}</div>
+					</div>
+					<div class="item">
+						<div>经纬度:</div>
+						<div class="value">{{ item.latitude + ',' + item.longitude}}</div>
+					</div>
+				</div>
+			</div>
 		</div>
-
 		<Tabs v-model="activeName">
 			<TabPane v-for="(item, index) in list" :key="index" :label="item.label + '('+wareInfo.count[item.tit]+')'"
 				:name="item.val">
@@ -23,23 +54,67 @@
 					<template slot-scope="{ row, index }" slot="number">
 						<span> {{ row.bin_number.slice(4) }}</span>
 					</template>
+					<template slot-scope="{ row, index }" slot="add_time">
+						<span> {{ row.add_time | formatDate }}</span>
+					</template>
+					<template slot-scope="{ row, index }" slot="num">
+						<!-- <span> {{ row.body }}</span> -->
+						<div v-for="item in row.body">{{item.product_name}}</div>
+					</template>
 					<template slot-scope="{ row, index }" slot="supplier">
 						<!-- <span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span> -->
 						<div>名称:{{row.supplier.supplier_name}}</div>
 						<div>ID:{{row.supplier.id}}</div>
 						<div>手机:{{row.supplier.phone}}</div>
 					</template>
+					<template slot-scope="{ row, index }" slot="cuser">
+						<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="tware">
+						<div>名称:{{row.tware.title}}</div>
+						<div>ID:{{row.tware.id}}</div>
+						<div>手机:{{row.tware.phone}}</div>
+					</template>
+					<template slot-scope="{ row, index }" slot="store">
+						<div>名称:{{row.store.name}}</div>
+						<div>ID:{{row.store.id}}</div>
+						<div>手机:{{row.store.phone}}</div>
+					</template>
+					<template slot-scope="{ row, index }" slot="tstore">
+						<div>名称:{{row.tstore.name}}</div>
+						<div>ID:{{row.tstore.id}}</div>
+						<div>手机:{{row.tstore.phone}}</div>
+					</template>
 					<template slot-scope="{ row, index }" slot="info">
 						<div v-for="item in row.info" class="info">
 							<div>
 								商品名称:{{item.product_name}}
 							</div>
+						<!-- 	<div>
+								商品ID:{{item.product_id}}
+							</div> -->
+							<div>
+								数量:{{item.product_num*1 || item.want_product_num*1}}{{' '}}{{item.unit_name}}
+							</div>
+						</div>
+					</template>
+					<template slot-scope="{ row, index }" slot="product">
+						<div v-for="item in row.product" class="info">
+							<div>
+								商品名称:{{item.store_name}}
+							</div>
 							<div>
 								商品ID:{{item.product_id}}
 							</div>
 							<div>
-								数量:{{item.product_num*1 || item.want_product_num*1}}{{' '}}{{item.unit_name}}
+								数量:<div v-for="goods in item.group">
+									<Tag color="primary" v-if="goods.pur_number != 0">{{goods.pur_number *1}} {{goods.unit_name}}</Tag>
+								</div>
 							</div>
+
 						</div>
 					</template>
 					<template slot-scope="{ row, index }" slot="mystore">
@@ -132,18 +207,30 @@
 	import {
 		getGodownInfo,
 		getPositionList,
-		getInList,
+		getInLists,
 		getUserList,
 		getWantList,
 		getPurchaselist,
 		getInventoryList,
-		getGoodsList
+		getGoodsList,
+		getOutLists
 	} from '@/api/erp'
+	import {
+		formatDate
+	} from "@/utils/validate";
 	// import userForm from './userForm';
 	// import userInfo from './userInfo';
 
 	export default {
 		name: 'userDetails',
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd");
+				}
+			},
+		},
 		components: {
 			// userForm,
 			// userInfo
@@ -220,7 +307,6 @@
 		watch: {
 			activeName(value) {
 				this.userFrom.page = 1;
-				if (value == 'position') return;
 				this.isEdit = false;
 				this.changeType(value);
 			},
@@ -457,9 +543,53 @@
 							},
 						]
 					} else if (name == 'outbound') {
+						getList = getOutLists
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+							{
+								title: "出库单号",
+								key: "out_order_id",
+								minWidth: 200,
+							},
+							{
+								title: "出库商品",
+								slot: "product",
+								minWidth: 200,
+							},
+							
+							{
+								title: "接收仓库",
+								slot: "tware",
+								minWidth: 120,
+							},
+							
+							{
+								title: "接收门店",
+								slot: "tstore",
+								minWidth: 120,
+							},
+							{
+								title: "创建人",
+								slot: "cuser",
+								minWidth: 200,
+							},
+							// {
+							// 	title: "总数量",
+							// 	key: "total_num",
+							// 	minWidth: 90,
+							// },
+							{
+								title: "总价格",
+								key: "total_price",
+								minWidth: 90,
+							},
 
+						]
 					} else if (name == 'warehousing') {
-						getList = getInList
+						getList = getInLists
 						this.columns = [{
 								title: "ID",
 								key: "id",
@@ -513,7 +643,7 @@
 								key: 'price',
 								width: 200,
 							}
-						
+
 						]
 					} else if (name == 'purchase') {
 						getList = getPurchaselist
@@ -629,38 +759,48 @@
 						]
 					} else if (name == 'inventory') {
 						getList = getInventoryList
-						this.columns = [{
-								title: "ID",
-								key: "id",
-								width: 80,
-							},
-							// {
-							// 	title: "要货单号",
-							// 	key: "want_order_id",
-							// 	minWidth: 150,
-							// },
-							// {
-							// 	title: '商品信息',
-							// 	slot: 'info',
-							// 	minWidth: 300,
-							// },
-							// {
-							// 	title: "出货门店",
-							// 	slot: "store",
-							// 	minWidth: 200,
-							// },
-							// {
-							// 	title: "要货门店",
-							// 	slot: "mystore",
-							// 	minWidth: 200,
-							// },
-							{
-								title: "状态",
-								slot: "status",
-								minWidth: 100,
-							},
-						
-						]
+						this.columns= [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "订单编号",
+						key: "order_id",
+						minWidth: 90,
+					},
+					{
+						title: "商品种类",
+						slot: "num",
+						minWidth: 90,
+					},
+					// {
+					// 	title: "所属仓库",
+					// 	slot: "ware",
+					// 	minWidth: 90,
+					// },
+					{
+						title: "盘点时间",
+						slot: "add_time",
+						minWidth: 90,
+					},
+					{
+						title: "状态",
+						slot: "status",
+						minWidth: 90,
+					},
+					// {
+					// 	title: "备注",
+					// 	key: "auth_remark",
+					// 	minWidth: 90,
+					// },
+					// {
+					// 	title: "操作",
+					// 	slot: "action",
+					// 	fixed: "right",
+					// 	width: 200,
+					// },
+				]
 					}
 				} catch (e) {
 					console.log('err', e);
@@ -689,10 +829,6 @@
 		padding: 0;
 	}
 
-	.user-info {
-		// padding: 15px;
-	}
-
 	.user-row {
 		padding: 30px 35px 0;
 
@@ -973,4 +1109,53 @@
 			height 100%;
 		}
 	}
+
+	.user-info {
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+
+			.value {
+				flex: 1;
+			}
+
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
 </style>

+ 39 - 8
src/pages/erp/in/addInList.vue

@@ -32,6 +32,13 @@
 							<Input v-model="formValidate.freight" placeholder="请输入运费" v-width="'400'" />
 						</FormItem>
 					</Col>
+					<Col span="24" v-if="showWid">
+						<FormItem label="仓库:" prop="wid">
+							<el-cascader placeholder="请选择仓库" class="input-add" size="mini" v-model="formValidate.wid"
+								:options="data1" :props="props" filterable v-width="'400'">
+							</el-cascader>
+						</FormItem>
+					</Col>
 					<Col span="24" v-if="goodsList.length > 0">
 						<FormItem label="商品:">
 							<Table :columns="columns" :data="goodsList" ref="table" :loading="loading"
@@ -57,7 +64,8 @@
 								<template slot-scope="{ row,index }" slot="bin_number">
 									<div v-if="row.bin_number">{{goodsList[index].bin_number}}</div>
 									<div v-else>
-										<Select v-model="goodsList[index].bin_number_value" style="width:150px">
+										<!-- <Select v-model="goodsList[index].bin_number_value" style="width:150px"> -->
+											<Select v-model="goodsList[index].bin_number" style="width:150px">
 											<Option v-for="item in binList" :value="item.bin_number" :key="item.bin_number">
 												{{ item.bin_number }}</Option>
 										</Select>
@@ -83,14 +91,22 @@
 <script>
 	import { mapState,mapMutations } from "vuex";
 	import Setting from "@/setting";
-	import { getPurchaseId,batch_save,getPositionList,createRuku } from "@/api/erp";
+	import { getPurchaseId,batch_save,getPositionList,createRuku ,getGodownList} from "@/api/erp";
 	import { in_status } from "@/api/erpAdmin";
 	import { formatDate } from "@/utils/validate";
 	export default {
 		name: "addInList",
 		data() {
 			return {
+				props: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "title"
+				},
 				loading: false,
+				showWid: false,
 				roterPre: Setting.roterPre,
 				columns: [{
 						title: '商品名称',
@@ -139,10 +155,12 @@
 					orderNumber:'',
 					freight:'',
 					goods: [],
+					wid: 0
 				},
 				info:'',//采购单信息
 				goodsList:[],//采购单商品
 				binList:[],//仓位列表
+				data1: [],
 			};
 		},
 		computed: {
@@ -156,9 +174,6 @@
 		},
 		created() {
 			this.getGodownList()
-			let data = {
-				pid: 0
-			}
 		},
 		mounted() {
 			if (this.$route.query.id != 0) {
@@ -166,8 +181,18 @@
 			}
 		},
 		methods: {
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+				})
+			},
 			//提交数据
 			handleSubmit(name) {
+				if(!this.formValidate.wid) {
+					this.$Message.error("请选择门店");
+					return
+				}
 				if(this.formValidate.id == 0) {
 					if(!this.formValidate.freight){
 						this.$Message.error("请输入运费");
@@ -206,7 +231,7 @@
 						tare_weight:item.tare_weight,
 						unit_name:item.unit_name,
 						unit_type:item.unit_type,
-						wid:item.wid,
+						wid:item.wid || this.formValidate.wid,
 						price:item.price,
 						total_price:item.total_price,
 						is_weigh:item.is_weigh,
@@ -220,7 +245,7 @@
 					total_price:total_price,
 					freight:this.formValidate.freight,
 					purchase_order_id:this.formValidate.orderNumber,
-					wid:this.info.wid
+					wid:this.formValidate.wid
 				},0).then(res => {
 					if(res.status == 200){
 						this.$Message.success(res.msg);
@@ -240,12 +265,18 @@
 					   getPurchaseId(this.formValidate.orderNumber).then(res => {
 					   	if(res.status == 200){
 					   		this.info = res.data
+							if(!this.info.wid) {
+								this.showWid = true
+							}else {
+								this.formValidate.wid = this.info.wid
+							}
 					   		this.info.info.forEach(item => {
 					   			item.batch_code = ''
 					   			item.tare_weight = ''
 					   			item.net_weight = ''
 					   			item.timeValue = ''
-					   			item.bin_number_value = ''
+					   			// item.bin_number_value = ''
+								item.bin_number = ''
 					   		})
 					   		this.goodsList = this.info.info
 					   		this.getBin()

+ 281 - 8
src/pages/erp/in/index.vue

@@ -2,7 +2,7 @@
 	<!-- 营销-积分商品 -->
 	<div>
 		<!-- tab切换栏 -->
-		
+
 		<Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
 			<div class="new_card_pd">
 				<!-- 查询条件 -->
@@ -68,23 +68,115 @@
 					<Divider v-if="row.status == 0" type="vertical" />
 					<a @click="info(row, index)">详情</a>
 					<Divider v-if="row.status == 3" type="vertical" />
+					<template v-if="row.status == 1 || row.status == 2">
+						<Divider type="vertical" />
+						<a @click="openInfo(row)">上架</a>
+						<Divider type="vertical" />
+					</template>
 					<a v-if="row.status == 3" @click="del(row, index)">删除</a>
 				</template>
 			</Table>
 			<div class="acea-row row-right page">
-				<Page :total="tableFrom.total" :current="tableFrom.page" show-elevator show-total @on-change="pageChange"
-					:page-size="tableFrom.limit" />
+				<Page :total="tableFrom.total" :current="tableFrom.page" show-elevator show-total
+					@on-change="pageChange" :page-size="tableFrom.limit" />
 			</div>
 		</Card>
+		<Modal v-model="modal" title="上架" @on-ok="ok" @on-cancel="cancel" footer-hide>
+			<Table :columns="infoColumns" :data="infoList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
+				<template slot-scope="{ row, index }" slot="position">
+					<el-cascader placeholder="请选择仓位" class="value" size="mini" v-model="infoList[index].bin_number"
+						:options="positionList" :props="props" filterable v-width="'150'">
+					</el-cascader>
+					<a @click="addPosition">添加仓位</a>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="listing(row)">上架</a>
+				</template>
+			</Table>
+		</Modal>
+		<Modal v-model="modalPosition" scrollable title="添加仓位" class="order_box" :closable="false"
+			:mask-closable="false">
+			<Form ref="remarks" :model="remarks" :rules="rulePosition" :label-width="100" @submit.native.prevent>
+				<Col span="24">
+				<FormItem label="仓位名称:" prop="title">
+					<Input v-model="remarks.title" placeholder="请输入仓位名称/编号" v-width="'200'" />
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="通道:" prop="passageway">
+					<Input v-model="remarks.passageway" placeholder="请输入通道" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~99)
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="左右:" prop="control">
+					<RadioGroup v-model="remarks.control">
+						<Radio label="L" :disabled="remarks.id != 0">
+							<Icon type="social-apple"></Icon>
+							<span>左</span>
+						</Radio>
+						<Radio label="R" :disabled="remarks.id != 0">
+							<Icon type="social-android"></Icon>
+							<span>右</span>
+						</Radio>
+					</RadioGroup>
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="层数:" prop="layer">
+					<Input v-model="remarks.layer" placeholder="请输入层数" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~9)
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="仓位编号:" prop="number">
+					<Input v-model="remarks.number" placeholder="请输入仓位编号" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~999)
+				</FormItem>
+				</Col>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putRemark()">提交</Button>
+				<Button @click="cancels()">取消</Button>
+			</div>
+		</Modal>
 	</div>
 </template>
 
 <script>
-	import { mapState } from "vuex";
-	import { getInList } from "@/api/erp";
-	import { formatDate } from "@/utils/validate";
+	import {
+		mapState
+	} from "vuex";
+	import {
+		getInList,
+		getInInfo,
+		listing
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
 	import timeOptions from "@/utils/timeOptions";
 	import Setting from "@/setting";
+	import {
+		getPosition,
+		createPosition,
+		getPositionList
+	} from "@/api/erp";
+
+	const jy = (min, max) => {
+		return {
+			validator(rule, value) {
+				if (!value || value > max || value < min) {
+					return [{
+						message: `范围为${min}~${max}`
+					}];
+				} else {
+					return [];
+				}
+			}
+		}
+	}
 	export default {
 		name: "inList",
 		filters: {
@@ -97,10 +189,44 @@
 		},
 		data() {
 			return {
+				modalPosition: false,
+				remarks: {
+					id: 0,
+					title: "",
+					wid: '0',
+					passageway: '',
+					control: "L",
+					layer: '',
+					number: ''
+				},
+				modal: false,
 				currentTab: 0,
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
+				props: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "bin_number",
+					label: "bin_number"
+				},
+				infoColumns: [{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 200,
+					},
+					{
+						title: '仓位',
+						slot: 'position',
+						minWidth: 250,
+					}, {
+						title: "操作",
+						slot: "action",
+						width: 80,
+					},
+
+				],
 				columns1: [{
 						title: "ID",
 						key: "id",
@@ -111,6 +237,11 @@
 						key: "in_order_id",
 						minWidth: 160,
 					},
+					{
+						title: "出库单号",
+						key: "out_order_id",
+						minWidth: 160,
+					},
 					{
 						title: "入库商品",
 						slot: "info",
@@ -158,14 +289,50 @@
 						width: 200,
 					},
 				],
+				rulePosition: {
+					title: [{
+						required: true,
+						message: "请输入仓位名称",
+						trigger: "blur"
+					}, ],
+					wid: [{
+						required: true,
+						message: "请选择仓库",
+						trigger: "blur"
+					}, ],
+					passageway: [{
+						required: true,
+						message: "请输入通道",
+						trigger: "blur"
+					}, jy(1, 99)],
+					control: [{
+						required: true,
+						message: "请选择左右",
+						trigger: "blur"
+					}, ],
+					layer: [{
+						required: true,
+						message: '请输入层数',
+						trigger: 'blur',
+					}, jy(1, 9)],
+					number: [{
+						required: true,
+						message: '请输入仓位编号',
+						trigger: 'blur',
+					}, jy(1, 999)],
+				},
 				tableList: [],
 				tableFrom: {
 					key: '',
 					page: 1,
 					limit: 10,
-					status:-3,
+					status: -3,
 					total: 0,
 				},
+				inInfo: {},
+				infoList: [],
+				positionList: [],
+				basePosition:[]
 			};
 		},
 		computed: {
@@ -181,9 +348,111 @@
 			this.getList();
 		},
 		methods: {
+			putRemark() {
+				this.$refs.remarks.validate((valid) => {
+					if (valid) {
+						// this.remarks.id = this.$route.query.id;
+						createPosition({
+							id: this.remarks.id,
+							title: this.remarks.title,
+							wid: this.remarks.wid,
+							passageway: this.remarks.passageway,
+							control: this.remarks.control,
+							layer: this.remarks.layer,
+							number: this.remarks.number
+						}).then(res => {
+							this.$Message.success(res.msg);
+							this.getPositionList(this.inInfo.wid)
+
+							this.cancel()
+							// this.$router.push({
+							// 	path: this.roterPre + "/erp/position_list"
+							// });
+						}).catch(err => {
+							this.$Message.error(err.msg);
+						})
+					} else {
+						// this.$Message.error("请输入参数模板名称");
+					}
+				});
+			},
+			cancels() {
+				this.modalPosition = false
+				this.remarks = {
+					id: 0,
+					title: "",
+					wid: '0',
+					passageway: '',
+					control: "L",
+					layer: '',
+					number: ''
+				}
+			},
+			addPosition() {
+				this.modalPosition = true
+				this.remarks.wid = this.inInfo.wid
+			},
+			getPositionList(id) {
+				getPositionList({
+					wid: id,
+					not_used: 1
+				}).then(res => {
+					this.positionList = res.data.data.concat(this.basePosition).filter((obj, index, arr) =>
+  arr.map(mapObj => mapObj.bin_number).indexOf(obj.bin_number) === index
+)
+				})
+			},
+			cancel() {
+				this.inInfo = {}
+				this.getList()
+			},
+			ok() {
+
+			},
+			listing(row) {
+				console.log(row);
+				if(row.bin_number == '') {
+					return this.$Message.error('请选择仓位')
+				}
+				
+				// listing({
+				// 	in_order_id: this.inInfo.in_order_id,
+				// 	info: this.inInfo.info
+
+				// })
+				listing({
+					in_order_id: this.inInfo.in_order_id,
+					purchase_order_id: this.inInfo.purchase_order_id,
+					wid: this.inInfo.wid,
+					info: {
+						item: row
+					}
+				}).then(res => {
+					this.openInfo(this.inInfo)
+				})
+			},
+			openInfo(row) {
+				this.basePosition = []
+				getInInfo(row.in_order_id).then(res => {
+					this.inInfo = res.data
+					this.infoList = res.data.info.filter(item => {
+						if(item.bin_number) {
+							this.basePosition.push({
+								bin_number: item.bin_number
+							})
+						}
+						return item.status == 0
+					})
+					 // this.basePosition= this.basePosition;
+					console.log(this.basePosition,'this.basePosition');
+					this.getPositionList(this.inInfo.wid)
+					this.modal = true
+				})
+			},
 			// 列表
 			getList() {
 				this.loading = true;
+				this.tableList = []
 				getInList(this.tableFrom)
 					.then(async (res) => {
 						let data = res.data;
@@ -209,7 +478,7 @@
 			},
 			// 详情
 			info(row) {
-				
+
 			},
 			// 删除
 			del(row, tit, num) {
@@ -273,4 +542,8 @@
 			height: 100%;
 		}
 	}
+
+	/deep/ .ivu-modal {
+		width: 650px !important;
+	}
 </style>

+ 712 - 0
src/pages/erp/inventory/addStocktaking.vue

@@ -0,0 +1,712 @@
+<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}/erp/out_list` }">
+						<!-- <Button icon="ios-arrow-back" size="small" class="mr20"
+              >返回</Button
+            > -->
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="
+              $route.query.id !== '0' ? '编辑盘点单' : '添加盘点单'
+            " class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form class="formValidate mt20" ref="formValidate" :rules="formValidate.id == 0?ruleValidate:ruleValidate1" :model="formValidate"
+				:label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="24">
+					<FormItem label="仓库:" prop="wid" v-if="formValidate.outType == 0">
+						<el-cascader placeholder="请选择仓库" class="input-add" size="mini" v-model="formValidate.wid"
+							:options="data1" :props="props" @change="checkOutWare" filterable clearable v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="创建人:" prop="create_uid" v-if="formValidate.wid != 0">
+						<el-cascader placeholder="请选择创建人" class="input-add" size="mini"
+							v-model="formValidate.create_uid" :options="authList" :props="propsss"
+							@change="userSearchsss" filterable clearable v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品:" prop="goods">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in chooseGoods">
+								<Button type="primary" @click="delGood(gindex)" class="del-btn">删除</Button>
+								<div class="section-hd">{{goods.product_name}}</span> </div>
+								<div v-if="goods.batchs.length > 0" v-for="(item,index) in goods.batchs" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>库存:</div>
+											<div class="value">{{ item.product_num}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>实盘:</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].batchs[index].stockValue"
+													placeholder="请输入数量" v-width="'150'" type="number"
+													@on-blur="jyNum(item.product_num,chooseGoods[gindex].batchs[index].stockValue,item)" />
+											</div>
+										</div>
+										
+									</div>
+
+								</div>
+							</div>
+						</Card>
+						<Button type="primary" class="submission" style="margin-top:20px;" @click="getGoods()"
+							>添加商品</Button>
+					</FormItem>
+					</Col>
+				</Row>
+			</Form>
+		</Card>
+		<Card :bordered="false" dis-hover class="fixed-card"
+			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
+			<Form>
+				<FormItem>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+		<pdgoods ref="pdgoods" @setGoods="setGoods"></pdgoods>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from "vuex";
+	import {
+		staffListInfo
+	} from "@/api/store";
+	import {
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		getUserList,
+		getOutGoods,
+		createWant,
+		getWantInfo,
+		getProductBatch,
+		createOut,
+		editOut,
+		getOutInfo,
+		saveInventory
+	} from "@/api/erp";
+	import {
+		keyApi,
+		storeGetInfoApi,
+		cityApi,
+		storeUpdateApi,
+		cascaderList
+	} from '@/api/store';
+	import {
+		productSpecs,
+		productSpecsInfo
+	} from "@/api/product";
+	import Setting from "@/setting";
+	import pdgoods from './pdgoods.vue'
+	export default {
+		name: "stocktakingAdd",
+		components: {
+			pdgoods
+		},
+		data() {
+			return {
+				loading: false,
+				authList: [],
+				columnss: [{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 160
+					},
+					{
+						title: '要货数量',
+						slot: 'want_product_num',
+						minWidth: 90
+					},
+					{
+						title: '要货单位',
+						slot: 'unit_types',
+						minWidth: 150
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						minWidth: 120
+					},
+				],
+				columns: [{
+						title: '商品名称',
+						key: 'name',
+						minWidth: 160
+					},
+					{
+						title: '库存',
+						key: 'product_num',
+						minWidth: 90
+					},
+					{
+						title: '单位',
+						key: 'unit_name',
+						minWidth: 90
+					},
+					{
+						title: '数量',
+						slot: 'pur_number',
+						minWidth: 150
+					},
+					{
+						title: '重量(kg)',
+						slot: 'weight',
+						minWidth: 120
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						minWidth: 120
+					},
+
+				],
+				chooseGoods: [],
+				staffData: [],
+				addresData: [],
+				props: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "title"
+				},
+				propss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "name"
+				},
+				propsss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "staff_name"
+				},
+				roterPre: Setting.roterPre,
+				data1: [],
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				formValidate: {
+					inType: 0,
+					outType: 0,
+					id: 0,
+					wid: 0,
+					store_id: 0,
+					goods: [],
+					my_store_id: 0,
+					create_uid: 0,
+					create_admin_id: 0,
+				},
+				ruleValidate1: {
+					
+				},
+				ruleValidate: {
+					store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择门店",
+						trigger: "blur"
+					}, ],
+					to_store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择调入门店",
+						trigger: "blur"
+					}, ],
+					wid: [{
+						type: "number",
+						required: true,
+						message: "请选择调出仓库",
+						trigger: "blur"
+					}, ],
+					to_wid: [{
+						type: "number",
+						required: true,
+						message: "请选择调入仓库",
+						trigger: "blur"
+					}, ],
+					create_uid: [{
+						type: "number",
+						required: true,
+						message: "请选择创建人",
+						trigger: "blur"
+					}, ],
+					// goods: [{
+					// 	type: "array",
+					// 	required: true,
+					// 	message: "请选择商品",
+					// 	trigger: "change"
+					// }, ],
+				},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getGodownList()
+			let data = {
+				pid: 0
+			}
+			// this.cityInfo(data);
+		},
+		mounted() {
+			// this.setCopyrightShow({
+			// 	value: false
+			// });
+			this.staffList()
+			if (this.$route.query.id != 0) {
+				this.formValidate.id = this.$route.query.id
+				this.getOutInfo(this.$route.query.id)
+			}
+		},
+		destroyed() {
+			// this.setCopyrightShow({
+			// 	value: true
+			// });
+		},
+		methods: {
+			...mapMutations("admin/layout", ["setCopyrightShow"]),
+			delGood(index) {
+				this.chooseGoods.splice(index, 1)
+			},
+			delBatch(in1, in2) {
+				console.log((in1, in2));
+				this.chooseGoods[in1].batch.splice(in2, 1)
+			},
+			jyNum(a = 0, b = 0, item) {
+				console.log(a, b, 'jiaoyan');
+				if (a * 1 < b * 1) {
+					item.pur_number = 0
+					return this.$Message.error('输入值大于可调出商品的库存')
+				}
+			},
+			getOutInfo(id) {
+				getOutInfo(id).then(res => {
+					let data = res.data
+					if (data.wid) {
+						this.formValidate.outType = 0
+						this.formValidate.wid = data.wid*1
+					} else {
+						this.formValidate.outType = 1
+						this.formValidate.store_id = data.store_id*1
+					}
+					if (data.to_wid) {
+						this.formValidate.to_wid = data.to_wid*1
+						this.formValidate.inType == 0
+					} else {
+						this.formValidate.inType == 1
+						this.formValidate.to_store_id = data.to_store_id*1
+					}
+					this.getUserList()
+					this.formValidate.create_uid = data.create_uid
+					this.formValidate.create_admin_id = data.create_admin_id
+					this.chooseGoods = data.product.map(item => {
+						item.name = item.store_name
+						item.product_id = item.id
+						if(item.group.length > 0) {
+							item.batch = item.group
+						}else {
+							item.batch = []
+						}
+						return item
+					})
+					// console.log(res, 'ddddd');
+					// let data = res.data
+					// this.formValidate.id = data.id
+					// this.formValidate.create_uid = data.create_uid
+					// this.chooseGoods = data.info
+					// this.formValidate.store_id = data.store_id
+					// console.log(this.formValidate.goods, 'this.formValidate.goods');
+					// if (data.wid) {
+					// 	this.formValidate.inType = 0
+					// 	this.formValidate.wid = data.wid
+					// 	this.getUserList({
+					// 		wid: this.formValidate.wid
+					// 	})
+					// } else {
+					// 	this.formValidate.inType = 1
+					// 	this.getUserList({
+					// 		store_id: this.formValidate.store_id
+					// 	})
+					// }
+				})
+			},
+			setGoods(e) {
+				console.log(e, '选择');
+				// 校验商品是否重复
+				if (this.chooseGoods.find(item => e.product_id == item.product_id)) {
+					console.log('55');
+					this.$refs.pdgoods.clearAll()
+					return this.$Message.error('该商品已选择');
+				} else {
+					this.$refs.pdgoods.modals = false
+					this.chooseGoods.push(e)
+					console.log(this.chooseGoods,'this.chooseGoods');
+
+				}
+			},
+			getGoods() {
+				if(!this.formValidate.wid) {
+					return this.$Message.error('请选择仓库')
+				}
+				this.$refs.pdgoods.formValidate.wid = this.formValidate.wid
+				this.$refs.pdgoods.modals = true
+				this.$refs.pdgoods.getList()
+
+			},
+			getUserList() {
+				let qdata = {}
+				if (this.formValidate.outType == 1) {
+					qdata.store_id = this.formValidate.store_id
+				} else {
+					qdata.wid = this.formValidate.wid
+				}
+				getUserList(qdata).then(res => {
+					// console.log(res);
+					this.authList = res.data.data
+					// .map(item => {
+					// 		item.id += ''
+					// 		return item
+					// 	});
+				})
+			},
+			staffList() {
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data
+						// .map(item => {
+						// 	item.id += ''
+						// 	return item
+						// });
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			getGodownInfo(id) {
+				getGodownInfo(id).then(res => {
+					this.formValidate = res.data
+					this.formValidate.addressSelect = this.formValidate.addressSelect.map(item => item * 1)
+					console.log(this.formValidate.addressSelect);
+				})
+			},
+			addchack(e, selectedData) {
+				console.log(selectedData, 'selectedData');
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formValidate.province = i
+					} else if (index == 1) {
+						this.formValidate.city = i
+					} else if (index == 2) {
+						this.formValidate.area = i
+					} else {
+						this.formValidate.street = i
+					}
+				})
+				this.formValidate.address = (selectedData.map(o => o.label)).join('/')
+				// console.log('this.formValidate.addressSelect',this.formValidate.addressSelect);
+
+			},
+			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();
+				});
+
+
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+					// .map(item => {
+					// 		item.id += ''
+					// 		return item
+					// 	});
+				})
+			},
+			del(index) {
+				this.chooseGoods.splice(index, 1);
+			},
+			userSearchse(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.getUserList()
+			},
+			userSearchs(e) {
+				this.formValidate.wid = 0
+				this.goods = []
+			},
+			userSearchss(e) {
+				this.formValidate.create_uid = "";
+				this.formValidate.store_id = 0
+				this.authList = []
+				this.getUserList()
+			},
+			checkOutWare(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.chooseGoods = []
+				if (e) {
+					this.getUserList()
+				}
+			},
+			changeOutType(e) {
+				this.formValidate.wid = 0
+				this.formValidate.store_id = 0
+				this.checkOutWare(0)
+			},
+			userSearchsss(e) {
+				if (e) {
+					let obj = this.authList.find(item => item.id == e)
+					this.formValidate.create_admin_id = obj.admin_id
+				}
+			},
+			checkWid(e) {
+
+			},
+			handleSubmit(name) {
+				let that = this
+				console.log(this.chooseGoods, '最后');
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						this.formValidate.id = this.$route.query.id;
+
+						// 校验商品数量和重量是否为0
+						let errIndex = 0;
+						that.chooseGoods.forEach(item => {
+							if (item.batchs.length > 0) {
+								// let errIndexs = 0;
+								item.batchs.forEach(e => {
+									console.log(e.stockValue,'e.stockValue');
+									if (e.stockValue === undefined || e.stockValue === '') {
+										errIndex++
+									}
+								})
+							} else {
+								// if (item.pur_number == 0) {
+								// 	errIndex++
+								// }
+								// if (item.is_weigh == 1 && e.weight == 0) {
+								// 	errIndex++
+								// }
+							}
+						})
+						if (errIndex > 0) {
+							return that.$Message.error("实盘数量不能为空");
+						}
+						
+						// pdata.product_list = that.chooseGoods
+						console.log(that.chooseGoods,'that.chooseGoods');
+						saveInventory({
+							wid: this.formValidate.wid,
+							body: this.chooseGoods,
+							create_uid: this.formValidate.create_uid,
+							create_admin_id: this.formValidate.create_admin_id
+						}).then(res => {
+								this.$Message.success(res.msg);
+								this.$router.push({
+									path: this.roterPre + "/erp/stocktaking"
+								});
+							}).catch(err => {
+								this.$Message.error(err.msg);
+							})
+						
+					} else {
+						// this.$Message.error("请输入参数模板名称");
+					}
+				});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.table {
+		/deep/.ivu-table-header table {
+			border: 0 !important;
+		}
+
+		/deep/.ivu-table-header thead tr th:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table td:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table-cell {
+			padding: 0 !important;
+		}
+
+		/deep/.ivu-table-border th,
+		/deep/.ivu-table-border td {
+			border-right: unset;
+		}
+
+		/deep/.ivu-table td {
+			height: 59px;
+		}
+	}
+
+	.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;
+			}
+		}
+	}
+
+	.after-line {
+		display: inline-block;
+		position: relative;
+		margin-right: 16px;
+	}
+
+	.ml16 {
+		margin-left: 16px;
+	}
+
+	.user-info {
+		position: relative;
+		padding: 20px;
+
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+			position: relative;
+
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				min-width: 250px;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+
+			.value {
+				flex: 1;
+			}
+
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.del-btn {
+		position: absolute;
+		right: 20px;
+		top: 10px;
+	}
+
+	.del-btn-1 {
+		position: absolute;
+		right: 80px;
+		bottom: 20px;
+	}
+</style>

+ 258 - 0
src/pages/erp/inventory/pdgoods.vue

@@ -0,0 +1,258 @@
+<template>
+	<div style="width: 100%">
+		<Modal v-model="modals" scrollable footer-hide closable title="商品列表" :mask-closable="false" width="700">
+			<Form ref="formValidate" :label-width="labelWidth" :label-position="labelPosition" class="tabform"
+				@submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="12">
+					<FormItem label="关键字:">
+						<Input enter-button placeholder="请输入商品名称" element-id="name" v-model="formValidate.key" clearable />
+					</FormItem>
+					</Col>
+					<Col span="4">
+					<Button type="primary" icon="ios-search" @click="userSearchs">搜索</Button>
+					</Col>
+				</Row>
+			</Form>
+			<!-- <Divider dashed/> -->
+			<Table highlight-row :columns="columns" :data="tabList" ref="table" :loading="loading" no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果" class="table" @on-current-change="change">
+				<template slot-scope="{ row, index }" slot="store">
+					<span> {{ row.my.stock }}{{row.my.unit_name}}</span>
+				</template>
+				<!-- product_num -->
+				<template slot-scope="{ row, index }" slot="product_num">
+					<span> {{ row.product_num }}{{row.unit_name || row.info['unit_name' + (row.unit_type == 0 ? '':(row.unit_type == 1?"_1":"_2"))]}}</span>
+				</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> -->
+			<!-- <Button type="primary"  @click="ok" style="width: 100%;margin-top:20px;">确认</Button> -->
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		commissionDetailApi,
+		extractlistApi
+	} from '@/api/finance';
+	import {
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		getUserList,
+		getOutGoods,
+		getOutGoodList,
+		getInventoryGoods
+	} from "@/api/erp";
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		name: 'commissionDetails',
+		data() {
+			return {
+				chooseGoods:[],
+				key: '',
+				wid: '',
+				my_store_id: '',
+				store_id: '',
+				type: 0,
+				modals: false,
+				spinShow: false,
+				detailsData: {},
+				Ids: 0,
+				loading: false,
+				formValidate: {
+					// page: 1, // 当前页
+					// limit: 20 ,// 每页显示条数
+					key: '',
+					wid: '',
+				},
+				total: 0,
+				columns: [
+					{
+						title: 'ID',
+						key: 'product_id',
+						minWidth: 50
+					},
+					{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 200
+					},
+					{
+						title: '库存',
+						key: 'product_num',
+						minWidth: 200
+					},
+					{
+						title: '单位',
+						key: 'unit_name',
+						minWidth: 200
+					},
+					// {
+					// 	title: '出货门店/仓库库存',
+					// 	slot: 'product_num',
+					// 	minWidth: 150
+					// },
+					// {
+					// 	title: '门店库存',
+					// 	slot: 'store',
+					// 	minWidth: 330
+					// }
+				],
+				tabList: []
+
+			}
+		},
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'left';
+			}
+		},
+		mounted() {
+			// if (this.Ids) {
+			//     this.getList();
+			// }
+			this.chooseGoods = []
+		},
+		methods: {
+			clearChoose() {
+				this.modals = false
+				this.chooseGoods = []
+				this.tabList = []
+				this.clearAll()
+			},
+			clearAll() {
+				this.$refs.table.clearCurrentRow();
+			},
+			change(e) {
+				this.$emit('setGoods',e);
+			},
+			ok() {
+				this.modals = false;
+			},
+			// 时间
+			onchangeTime(e) {
+				this.formValidate.start_time = e[0];
+				this.formValidate.end_time = e[1];
+			},
+			// 详情
+			getDetails(id) {
+				this.Ids = id;
+				this.spinShow = true;
+				commissionDetailApi(id).then(async res => {
+					if (res.status === 200) {
+						let data = res.data
+						this.detailsData = data.user_info;
+						this.spinShow = false;
+					} else {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					}
+				}).catch(res => {
+					this.spinShow = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				getInventoryGoods(this.formValidate).then(async res => {
+					let data = res.data;
+					this.tabList = data.data;
+					this.total = data.count;
+					this.loading = false;
+				}).catch(res => {
+					this.loading = false;
+					this.modals = false
+					this.tabList = []
+					this.$Message.error(res.msg);
+				})
+			},
+			pageChange(index) {
+				this.formValidate.page = index
+				this.getList();
+			},
+			// 搜索
+			userSearchs() {
+				this.formValidate.page = 1;
+				this.getList();
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	.table {
+		.ivu-table-default {
+			overflow-y: auto;
+			max-height: 350px;
+		}
+	}
+
+	.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: 12px;
+						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>

+ 413 - 0
src/pages/erp/inventory/stocktaking.vue

@@ -0,0 +1,413 @@
+<template>
+	<!-- 营销-积分商品 -->
+	<div>
+		<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>
+					<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>
+				</Form>
+			</div>
+		</Card>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<!-- 操作 -->
+			<Button v-auth="['admin-erp-stocktaking_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">
+				<template slot-scope="{ row, index }" slot="passageway">
+					<span> {{ row.bin_number.slice(0,2) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="control">
+					<span> {{ row.bin_number.slice(2,3) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="num">
+					<span> {{ row.body.length }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="add_time">
+					<span> {{ row.add_time |formatDate }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="ware">
+					<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="status">
+					<Tag color="default" v-if="row.status == 0">待审核</Tag>
+					<Tag color="primary" v-if="row.status == 1">通过</Tag>
+					<Tag color="error" v-if="row.status == -1">拒绝</Tag>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+					<a @click="look(row)">详情</a>
+					<template v-if="row.status == 0">
+						<Divider type="vertical" />
+						<a @click="pass(row)">审核</a>
+					</template>
+					<!-- <a @click="del(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="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>
+			<FormItem label="备注:">
+			  <Input
+			      v-model="remarks.auth_remark"
+			      maxlength="200"
+			      show-word-limit
+			      type="textarea"
+			      placeholder="请填写备注~"
+			      style="width: 100%"
+			    />
+			</FormItem>
+		  </Form>
+		  <div slot="footer">
+		    <Button type="primary" @click="putRemark()">提交</Button>
+		    <Button @click="cancel()">取消</Button>
+		  </div>
+		  </Modal>
+		  <stocktakingDetail ref="stocktakingDetail"></stocktakingDetail>
+	</div>
+</template>
+
+<script>
+	import stocktakingDetail from './stocktakingDetail.vue'
+	import {
+		mapState
+	} from "vuex";
+	import {
+		integralProductListApi,
+		integralIsShowApi,
+		storeSeckillApi,
+	} from "@/api/marketing";
+	import {
+		getPositionList,
+		getUserInfo,
+		getInventoryList,
+		getGodownList,
+		getUserList,
+		authInventory,
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import timeOptions from "@/utils/timeOptions";
+	import Setting from "@/setting";
+	export default {
+		name: "stocktaking",
+		components: {
+			stocktakingDetail
+		},
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd");
+				}
+			},
+		},
+		data() {
+			return {
+				modalpass:false,
+				authLists: [],//审核员列表
+				remarks: {
+					id: 0,
+					status: '',
+					auth_uid: "",
+					auth_admin_id: "",
+					auth_remark: '',
+				},
+				data1: [],//仓库列表
+				roterPre: Setting.roterPre,
+				loading: false,
+				options: timeOptions,
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "订单编号",
+						key: "order_id",
+						minWidth: 90,
+					},
+					{
+						title: "商品数量",
+						slot: "num",
+						minWidth: 90,
+					},
+					{
+						title: "所属仓库",
+						slot: "ware",
+						minWidth: 90,
+					},
+					{
+						title: "盘点时间",
+						slot: "add_time",
+						minWidth: 90,
+					},
+					{
+						title: "状态",
+						slot: "status",
+						minWidth: 90,
+					},
+					{
+						title: "备注",
+						key: "auth_remark",
+						minWidth: 90,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						width: 200,
+					},
+				],
+				tableList: [],
+				timeVal: [],
+				grid: {
+					xl: 7,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				tableFrom: {
+					// integral_time: "",
+					// is_show: "",
+					// store_name: "",
+					wid: '',
+					key: '',
+					page: 1,
+					limit: 10,
+				},
+				total: 0,
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getGodownList()
+			this.getList();
+		},
+		methods: {
+			look(row) {
+				this.$refs.stocktakingDetail.getInfo(row.id);
+			},
+			putRemark() {
+				authInventory(this.remarks).then(res => {
+					this.cancel()
+					this.getList();
+				})
+			},
+			cancel() {
+				this.remarks = {
+					id:0,
+					status: '',
+					auth_uid: "",
+					auth_admin_id: "",}
+					this.modalpass = false
+			},
+			userSearchse(e) {
+				let auth = this.authLists.find(item => item.id == e)
+				this.remarks.auth_admin_id = auth.admin_id
+			},
+			//审核
+			pass(row) {
+				this.remarks.id = row.id
+				getUserList({
+					wid: row.wid
+				}).then(res => {
+					this.authLists = res.data.data
+					this.modalpass = true;
+				})
+			},
+			userSearchs(e) {
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+				})
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/erp/stocktaking_add?id=0"
+				});
+			},
+			addMore() {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/add_store_integral",
+				});
+			},
+			orderList(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/order_list",
+					query: {
+						product_id: row.id,
+					},
+				});
+			},
+			// 导出
+			exports() {
+				let formValidate = this.tableFrom;
+				let data = {
+					start_status: formValidate.start_status,
+					status: formValidate.status,
+					store_name: formValidate.store_name,
+				};
+				storeSeckillApi(data)
+					.then((res) => {
+						location.href = res.data[0];
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 编辑
+			edit(row) {
+				this.$router.push({
+					path: this.roterPre + "/erp/add_position?id=" + row.id
+				});
+			},
+			// 一键复制
+			copy(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/create/" + row.id + "/1",
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `/erp/Warehouse/position_del/${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.start_status = this.tableFrom.start_status || "";
+				// this.tableFrom.is_show = this.tableFrom.is_show || "";
+				getInventoryList(this.tableFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.data;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+			// 表格搜索
+			tableSearchs() {
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+			},
+			// 修改是否显示
+			onchangeIsShow(row) {
+				let data = {
+					id: row.id,
+					is_show: row.is_show,
+				};
+				integralIsShowApi(data)
+					.then(async (res) => {
+						this.$Message.success(res.msg);
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 541 - 0
src/pages/erp/inventory/stocktakingDetail.vue

@@ -0,0 +1,541 @@
+<template>
+	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
+
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<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'">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in info.body">
+								<!-- <a @click="delGood(gindex)" class="del-btn">删除</a> -->
+								<div class="section-hd">{{goods.product_name}} ( 总库存 {{goods.total_num *1 }} {{goods.unit_name}} )</span> </div>
+								<div v-if="goods.batchs.length > 0" v-for="(item,index) in goods.batchs" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>编号:</div>
+											<div class="value">{{ item.bar_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										
+										<div class="item">
+											<div>数量:</div>
+											<div class="value">{{ item.product_num}}</div>
+										</div>
+										<div class="item">
+											<div>实盘:</div>
+											<div class="value">{{ item.stockValue || ''}}</div>
+										</div>
+										<!-- <div class="item" v-if="item.weight">
+											<div>总重量(kg):</div>
+											<div class="value">{{ item.weight}}</div>
+										</div>
+										<div class="item" v-if="item.bin_number">
+											<div>仓位编号:</div>
+											<div class="value">{{ item.bin_number}}</div>
+										</div> -->
+									</div>
+								</div>
+							</div>
+						</Card>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<div class="section">
+								<div class="section-hd">仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.ware.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.cuser&&info.cuser.id">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getInventoryInfo,
+		
+	} from "@/api/erp";
+	import Setting from "@/setting";
+
+	export default {
+		name: 'stocktakingDetail',
+		data() {
+			return {
+				info: {},
+				roterPre: Setting.roterPre,
+				psInfo: {},
+				modals: false,
+				activeName: 'base',
+				list: [{
+						val: 'base',
+						label: '基础信息'
+					},{
+						val: 'info',
+						label: '商品信息'
+					},
+					
+				],
+				ckColumns: [
+					{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "title",
+						key: "title",
+						width: 200,
+					},
+				],
+				columns: [{
+					title: "ID",
+					key: "id",
+					width: 80,
+				},
+				{
+					title: "商品名称",
+					key: "product_name",
+					width: 150,
+				},
+				{
+					title: "采购数量",
+					key: "product_num",
+					width: 120,
+				},
+				{
+					title: "实际采购数量",
+					key: "pur_num",
+					width: 120,
+				},
+				{
+					title: "单位",
+					key: "unit_name",
+					width: 75,
+				},
+				{
+					title: "单价",
+					slot: "price",
+					width: 75,
+				},
+				{
+					title: "净重",
+					key: "net_weight",
+					width: 80,
+				},
+				{
+					title: "皮重",
+					key: "tare_weight",
+					width: 80,
+				},
+				{
+					title: "总价(元)",
+					key: "total_price",
+					width: 80,
+				},
+				 ]
+			}
+		},
+		watch: {
+
+		},
+		created() {},
+		methods: {
+			deit() {
+				this.$router.push({
+					path: this.roterPre + "/erp/user_add?id=" + this.formValidate.id
+				});
+			},
+			getInfo(id) {
+				getInventoryInfo(id).then(res => {
+					console.log(res, 'res');
+					this.modals = true
+					this.info = res.data
+				}).catch(err => {
+					this.modals = false
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	/deep/.ivu-modal-body {
+		padding: 0;
+	}
+
+	.user-info {
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+	
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+	
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+	
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+	
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+	
+			.value {
+				flex: 1;
+			}
+	
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+	
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.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;
+						}
+
+						span:last-child {
+							color: #808695;
+						}
+					}
+
+					p:last-child {
+						font-size: 22px;
+					}
+				}
+			}
+		}
+	}
+</style>
+<style scoped lang="stylus">
+	.user_menu>>>.ivu-menu {
+		width 100% !important;
+	}
+
+	/deep/ .ivu-form-item {
+		margin: 20px 0 0 0 !important;
+	}
+
+	.info-list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 0 0 20px;
+
+		div {
+			width: 50%
+		}
+	}
+
+	.tit {
+		font-weight: bold;
+		padding: 20px 0 10px 0;
+	}
+</style>

+ 963 - 0
src/pages/erp/out/addOut.vue

@@ -0,0 +1,963 @@
+<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}/erp/out_list` }">
+						<!-- <Button icon="ios-arrow-back" size="small" class="mr20"
+              >返回</Button
+            > -->
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="
+              $route.query.id !== '0' ? '编辑出库单' : '添加出库单'
+            " class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form class="formValidate mt20" ref="formValidate" :rules="formValidate.id == 0?ruleValidate:ruleValidate1" :model="formValidate"
+				:label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="24">
+					<FormItem label="调出类型:" prop="outType">
+						<RadioGroup v-model="formValidate.outType" @on-change="changeOutType">
+							<Radio :label="0" :disabled="formValidate.id != 0">
+								<Icon type="social-apple"></Icon>
+								<span>仓库</span>
+							</Radio>
+							<Radio :label="1" :disabled="formValidate.id != 0">
+								<Icon type="social-android"></Icon>
+								<span>门店</span>
+							</Radio>
+						</RadioGroup>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="调出仓库:" prop="wid" v-if="formValidate.outType == 0">
+						<el-cascader placeholder="请选择调出仓库" class="input-add" size="mini" v-model="formValidate.wid"
+							:options="data1" :props="props" @change="checkOutWare" filterable clearable v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="调出门店:" prop="wid" v-if="formValidate.outType == 1">
+						<el-cascader placeholder="请选择调出门店" class="input-add" size="mini" v-model="formValidate.store_id"
+							:options="staffData" :props="propss" @change="checkOutWare" filterable clearable
+							v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="调入类型:" prop="inType">
+						<RadioGroup v-model="formValidate.inType">
+							<Radio :label="0" :disabled="formValidate.id != 0">
+								<Icon type="social-apple"></Icon>
+								<span>仓库</span>
+							</Radio>
+							<Radio :label="1" :disabled="formValidate.id != 0">
+								<Icon type="social-android"></Icon>
+								<span>门店</span>
+							</Radio>
+						</RadioGroup>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="调入仓库:" prop="to_wid" v-if="formValidate.inType == 0">
+						<el-cascader placeholder="请选择调入仓库" class="input-add" size="mini" v-model="formValidate.to_wid"
+							:options="data1" :props="props" filterable clearable v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="调入门店:" prop="to_store_id" v-if="formValidate.inType == 1">
+						<el-cascader placeholder="请选择到货门店" class="input-add" size="mini"
+							v-model="formValidate.to_store_id" :options="staffData" :props="propss" filterable clearable
+							v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="创建人:" prop="create_uid" v-if="formValidate.wid != 0 || formValidate.store_id != 0">
+						<el-cascader placeholder="请选择创建人" class="input-add" size="mini"
+							v-model="formValidate.create_uid" :options="authList" :props="propsss"
+							@change="userSearchsss" filterable clearable v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品:" prop="goods">
+						<!-- 						<Table :columns="formValidate.id == 0 ?columns:columnss" :data="chooseGoods" ref="table" :loading="loading"
+							no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+							<template slot-scope="{ row,index }" slot="pur_number">
+								<Input v-model="chooseGoods[index].pur_number" placeholder="请输入数量" v-width="'150'" type="number" />
+							</template>
+							<template slot-scope="{ row,index }" slot="weight">
+								<Input v-model="chooseGoods[index].weight" placeholder="请输入重量" v-width="'150'" type="number" />
+							</template>
+							<template slot-scope="{ row,index }" slot="unit_type" >
+								<Select v-model="chooseGoods[index].unit_type" style="width:200px" >
+									<Option v-for="item in row.unitList" :value="item.value" :key="item.value">
+										{{ item.label }}</Option>
+								</Select>
+							</template>
+							<template slot-scope="{ row,index }" slot="unit_types">
+								{{row.unit_name}}
+							</template>
+							<template slot-scope="{ row,index }" slot="store_num">
+								<span> {{ row.my.stock }}{{row.my.unit_name}}</span>
+							</template>
+							<template slot-scope="{ row, index }" slot="action">
+								<a @click="del(index)">删除</a>
+							</template>
+						</Table> -->
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in chooseGoods">
+								<Button type="primary" @click="delGood(gindex)" class="del-btn">删除</Button>
+								<div class="section-hd">{{goods.name}}</span> </div>
+								<div v-if="goods.batch.length > 0" v-for="(item,index) in goods.batch" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>库存:</div>
+											<div class="value">{{ item.product_num}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>数量:</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].batch[index].pur_number"
+													placeholder="请输入数量" v-width="'150'" type="number"
+													@on-blur="jyNum(item.product_num,chooseGoods[gindex].batch[index].pur_number,item)" />
+											</div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>总重量:</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].batch[index].weight"
+													placeholder="请输入重量" v-width="'150'" type="number" /></div>
+										</div>
+										<a v-if="goods.batch.length > 1" @click="delBatch(gindex,index)" class=" del-btn-1">删除</a>
+									</div>
+
+								</div>
+								<div v-if="goods.batch.length == 0" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>库存:</div>
+											<div class="value">{{ goods.product_num}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ goods.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>数量:</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].pur_number"
+													placeholder="请输入数量" v-width="'150'" type="number" /></div>
+										</div>
+										<div class="item">
+											<div>总重量:</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].weight"
+													placeholder="请输入重量" v-width="'150'" type="number" /></div>
+										</div>
+									</div>
+								</div>
+
+							</div>
+						</Card>
+						<Button type="primary" class="submission" style="margin-top:20px;" @click="getGoods()"
+							>添加商品</Button>
+					</FormItem>
+					</Col>
+				</Row>
+			</Form>
+		</Card>
+		<Card :bordered="false" dis-hover class="fixed-card"
+			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
+			<Form>
+				<FormItem>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+		<good-detail ref="goodDetail" @setGoods="setGoods"></good-detail>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from "vuex";
+	import {
+		staffListInfo
+	} from "@/api/store";
+	import {
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		getUserList,
+		getOutGoods,
+		createWant,
+		getWantInfo,
+		getProductBatch,
+		createOut,
+		editOut,
+		getOutInfo
+	} from "@/api/erp";
+	import {
+		keyApi,
+		storeGetInfoApi,
+		cityApi,
+		storeUpdateApi,
+		cascaderList
+	} from '@/api/store';
+	import {
+		productSpecs,
+		productSpecsInfo
+	} from "@/api/product";
+	import Setting from "@/setting";
+	import goodDetail from './goodDetail.vue'
+	export default {
+		name: "specsAdd",
+		components: {
+			goodDetail
+		},
+		data() {
+			return {
+				loading: false,
+				authList: [],
+				columnss: [{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 160
+					},
+					{
+						title: '要货数量',
+						slot: 'want_product_num',
+						minWidth: 90
+					},
+					{
+						title: '要货单位',
+						slot: 'unit_types',
+						minWidth: 150
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						minWidth: 120
+					},
+				],
+				columns: [{
+						title: '商品名称',
+						key: 'name',
+						minWidth: 160
+					},
+					{
+						title: '库存',
+						key: 'product_num',
+						minWidth: 90
+					},
+					{
+						title: '单位',
+						key: 'unit_name',
+						minWidth: 90
+					},
+					{
+						title: '数量',
+						slot: 'pur_number',
+						minWidth: 150
+					},
+					{
+						title: '重量(kg)',
+						slot: 'weight',
+						minWidth: 120
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						minWidth: 120
+					},
+
+				],
+				chooseGoods: [],
+				staffData: [],
+				addresData: [],
+				props: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "title"
+				},
+				propss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "name"
+				},
+				propsss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "staff_name"
+				},
+				roterPre: Setting.roterPre,
+				data1: [],
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				formValidate: {
+					inType: 0,
+					outType: 0,
+					id: 0,
+					wid: 0,
+					store_id: 0,
+					goods: [],
+					my_store_id: 0,
+					create_uid: 0,
+					create_admin_id: 0,
+				},
+				ruleValidate1: {
+					
+				},
+				ruleValidate: {
+					store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择门店",
+						trigger: "blur"
+					}, ],
+					to_store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择调入门店",
+						trigger: "blur"
+					}, ],
+					wid: [{
+						type: "number",
+						required: true,
+						message: "请选择调出仓库",
+						trigger: "blur"
+					}, ],
+					to_wid: [{
+						type: "number",
+						required: true,
+						message: "请选择调入仓库",
+						trigger: "blur"
+					}, ],
+					create_uid: [{
+						type: "number",
+						required: true,
+						message: "请选择创建人",
+						trigger: "blur"
+					}, ],
+					// goods: [{
+					// 	type: "array",
+					// 	required: true,
+					// 	message: "请选择商品",
+					// 	trigger: "change"
+					// }, ],
+				},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getGodownList()
+			let data = {
+				pid: 0
+			}
+			// this.cityInfo(data);
+		},
+		mounted() {
+			// this.setCopyrightShow({
+			// 	value: false
+			// });
+			this.staffList()
+			if (this.$route.query.id != 0) {
+				this.formValidate.id = this.$route.query.id
+				this.getOutInfo(this.$route.query.id)
+			}
+		},
+		destroyed() {
+			// this.setCopyrightShow({
+			// 	value: true
+			// });
+		},
+		methods: {
+			...mapMutations("admin/layout", ["setCopyrightShow"]),
+			delGood(index) {
+				this.chooseGoods.splice(index, 1)
+			},
+			delBatch(in1, in2) {
+				console.log((in1, in2));
+				this.chooseGoods[in1].batch.splice(in2, 1)
+			},
+			jyNum(a = 0, b = 0, item) {
+				console.log(a, b, 'jiaoyan');
+				if (a * 1 < b * 1) {
+					item.pur_number = 0
+					return this.$Message.error('输入值大于可调出商品的库存')
+				}
+			},
+			getOutInfo(id) {
+				getOutInfo(id).then(res => {
+					let data = res.data
+					if (data.wid) {
+						this.formValidate.outType = 0
+						this.formValidate.wid = data.wid*1
+					} else {
+						this.formValidate.outType = 1
+						this.formValidate.store_id = data.store_id*1
+					}
+					if (data.to_wid) {
+						this.formValidate.to_wid = data.to_wid*1
+						this.formValidate.inType == 0
+					} else {
+						this.formValidate.inType == 1
+						this.formValidate.to_store_id = data.to_store_id*1
+					}
+					this.getUserList()
+					this.formValidate.create_uid = data.create_uid
+					this.formValidate.create_admin_id = data.create_admin_id
+					this.chooseGoods = data.product.map(item => {
+						item.name = item.store_name
+						item.product_id = item.id
+						if(item.group.length > 0) {
+							item.batch = item.group
+						}else {
+							item.batch = []
+						}
+						return item
+					})
+					// console.log(res, 'ddddd');
+					// let data = res.data
+					// this.formValidate.id = data.id
+					// this.formValidate.create_uid = data.create_uid
+					// this.chooseGoods = data.info
+					// this.formValidate.store_id = data.store_id
+					// console.log(this.formValidate.goods, 'this.formValidate.goods');
+					// if (data.wid) {
+					// 	this.formValidate.inType = 0
+					// 	this.formValidate.wid = data.wid
+					// 	this.getUserList({
+					// 		wid: this.formValidate.wid
+					// 	})
+					// } else {
+					// 	this.formValidate.inType = 1
+					// 	this.getUserList({
+					// 		store_id: this.formValidate.store_id
+					// 	})
+					// }
+				})
+			},
+			setGoods(e) {
+				console.log(e, 'ddd');
+				// try {
+				// 	let arr = e.map(item => {
+				// 		item.unitList = [{
+				// 			value: 0,
+				// 			label: item.info.unit_name
+				// 		}]
+				// 		if (item.info.unit_name_1) {
+				// 			item.unitList.push({
+				// 				value: 1,
+				// 				label: item.info.unit_name_1
+				// 			})
+				// 		}
+				// 		if (item.info.unit_name_2) {
+				// 			item.unitList.push({
+				// 				value: 2,
+				// 				label: item.info.unit_name_1
+				// 			})
+				// 		}
+				// 		item.want_product_num = 0
+				// 		return item
+				// 	})
+				// 	this.chooseGoods = this.chooseGoods.concat(arr)
+				// } catch (e) {
+				// 	//TODO handle the exception
+				// 	console.log('err', e);
+				// }
+				// console.log(this.chooseGoods, 'this.chooseGoods');
+
+				// 校验商品是否重复
+				if (this.chooseGoods.find(item => e.product_id == item.product_id)) {
+					console.log('55');
+					this.$refs.goodDetail.clearAll()
+					return this.$Message.error('该商品已选择');
+				} else {
+					this.$refs.goodDetail.modals = false
+					let qdata;
+					console.log('this.formValidate.outType', this.formValidate.outType);
+					if (this.formValidate.outType == 1) {
+						try {
+							qdata = {
+								store_id: this.formValidate.store_id,
+								product_id: e.product_id
+							}
+						} catch (e) {
+							//TODO handle the exception
+							console.log('err', e);
+						}
+
+					} else {
+						qdata = {
+							wid: this.formValidate.wid,
+							product_id: e.product_id
+						}
+					}
+					console.log(qdata, 'qdata');
+					getProductBatch(qdata).then(res => {
+						if (res.data.length > 0) {
+							this.chooseGoods = this.chooseGoods.concat({
+								bar_code: e.bar_code,
+								is_weigh: e.info.is_weigh,
+								name: e.product_name,
+								product_id: e.product_id,
+								product_num: e.product_num,
+								pur_number: '',
+								unit_name: e.unit_name,
+								weight: '',
+								batch: res.data.map(item => {
+									item.weight = 0
+									item.pur_number = 0
+									return item
+								})
+							})
+						} else {
+							this.chooseGoods = this.chooseGoods.concat({
+								bar_code: e.bar_code,
+								is_weigh: e.info.is_weigh,
+								name: e.product_name,
+								product_id: e.product_id,
+								product_num: e.product_num,
+								pur_number: 0,
+								unit_name: e.unit_name,
+								weight: 0,
+								batch: []
+							})
+						}
+					})
+					// this.chooseGoods = this.chooseGoods.concat(e)
+
+				}
+			},
+			getGoods() {
+				console.log(this.formValidate.store_id, this.formValidate.wid);
+				if (this.formValidate.wid == 0 && this.formValidate.store_id == 0) {
+					return this.$Message.error('请选择调出仓库或门店');
+				}
+				try {
+					this.$refs.goodDetail.formValidate.outType = this.formValidate.outType
+					this.$refs.goodDetail.formValidate.wid = this.formValidate.wid
+					this.$refs.goodDetail.formValidate.store_id = this.formValidate.store_id
+					this.$refs.goodDetail.modals = true
+					this.$refs.goodDetail.getList()
+
+				} catch (e) {
+					//TODO handle the exception
+					console.log('err', e);
+				}
+
+			},
+			getUserList() {
+				let qdata = {}
+				if (this.formValidate.outType == 1) {
+					qdata.store_id = this.formValidate.store_id
+				} else {
+					qdata.wid = this.formValidate.wid
+				}
+				getUserList(qdata).then(res => {
+					// console.log(res);
+					this.authList = res.data.data
+					// .map(item => {
+					// 		item.id += ''
+					// 		return item
+					// 	});
+				})
+			},
+			staffList() {
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data
+						// .map(item => {
+						// 	item.id += ''
+						// 	return item
+						// });
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			getGodownInfo(id) {
+				getGodownInfo(id).then(res => {
+					this.formValidate = res.data
+					this.formValidate.addressSelect = this.formValidate.addressSelect.map(item => item * 1)
+					console.log(this.formValidate.addressSelect);
+				})
+			},
+			addchack(e, selectedData) {
+				console.log(selectedData, 'selectedData');
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formValidate.province = i
+					} else if (index == 1) {
+						this.formValidate.city = i
+					} else if (index == 2) {
+						this.formValidate.area = i
+					} else {
+						this.formValidate.street = i
+					}
+				})
+				this.formValidate.address = (selectedData.map(o => o.label)).join('/')
+				// console.log('this.formValidate.addressSelect',this.formValidate.addressSelect);
+
+			},
+			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();
+				});
+
+
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+					// .map(item => {
+					// 		item.id += ''
+					// 		return item
+					// 	});
+				})
+			},
+			del(index) {
+				this.chooseGoods.splice(index, 1);
+			},
+			userSearchse(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.getUserList()
+			},
+			userSearchs(e) {
+				this.formValidate.wid = 0
+				this.goods = []
+			},
+			userSearchss(e) {
+				this.formValidate.create_uid = "";
+				this.formValidate.store_id = 0
+				this.authList = []
+				this.getUserList()
+			},
+			checkOutWare(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.chooseGoods = []
+				if (e) {
+					this.getUserList()
+				}
+			},
+			changeOutType(e) {
+				this.formValidate.wid = 0
+				this.formValidate.store_id = 0
+				this.checkOutWare(0)
+			},
+			userSearchsss(e) {
+				if (e) {
+					let obj = this.authList.find(item => item.id == e)
+					this.formValidate.create_admin_id = obj.admin_id
+				}
+			},
+			checkWid(e) {
+
+			},
+			handleSubmit(name) {
+				let that = this
+				//判断调出仓库和调入仓库是否一致
+
+				// if(this.formValidate.id == 0) {
+				// 	let arr = []
+				// 	let arr1 = JSON.parse(JSON.stringify(this.chooseGoods))
+				// 	let uniqueArray = arr1.filter(function(item, index, self) {
+				// 	  return !self.slice(index + 1).some(function(otherItem) {
+				// 	    return item.product_id === otherItem.product_id && item.unit_type === otherItem.unit_type;
+				// 	  });
+				// 	});
+				// 	arr = uniqueArray.map(item => {
+				// 		let want = 0;
+				// 		for (let i = 0; i < arr1.length; i++) {
+				// 			if(item.product_id === arr1[i].product_id && item.unit_type === arr1[i].unit_type) {
+				// 				console.log(arr1[i].want_product_num*1,i,'i');
+				// 				want += arr1[i].want_product_num*1
+				// 			}
+				// 		}
+				// 		item.want_product_num = want
+				// 		return item
+				// 	})
+				// 	this.formValidate.goods = arr.map(item => {
+				// 		item.unit_name = item.info['unit_name' + (item.unit_type == 0 ? '':(item.unit_type == 1?"_1":"_2"))]
+				// 		return item
+				// 	})
+				// }else {
+				// 	this.formValidate.goods = this.chooseGoods
+				// }
+				console.log(this.chooseGoods, '最后');
+				console.log(this.formValidate.to_wid,'towid');
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						this.formValidate.id = this.$route.query.id;
+						if (that.formValidate.outType == 1 && that.formValidate.inType == 1 && that.formValidate
+							.store_id == that.formValidate.to_store_id) {
+							return that.$Message.error("调出门店和调入门店不能一致");
+						}
+						if (that.formValidate.outType == 0 && that.formValidate.inType == 0 && that.formValidate
+							.wid == that.formValidate.to_wid) {
+							return that.$Message.error("调出仓库和调入仓库不能一致");
+						}
+
+						// 校验商品数量和重量是否为0
+						let errIndex = 0;
+						that.chooseGoods.forEach(item => {
+							if (item.batch.length > 0) {
+								// let errIndexs = 0;
+								item.batch.forEach(e => {
+									if (e.pur_number == 0) {
+										errIndex++
+									}
+									if (e.is_weigh == 1 && e.weight == 0) {
+										errIndex++
+									}
+								})
+							} else {
+								if (item.pur_number == 0) {
+									errIndex++
+								}
+								if (item.is_weigh == 1 && e.weight == 0) {
+									errIndex++
+								}
+							}
+						})
+						if (errIndex > 0) {
+							return that.$Message.error("商品数量或重量不能为空");
+						}
+						let pdata = {
+							create_uid: that.formValidate.create_uid,
+							create_admin_id: that.formValidate.create_admin_id,
+						}
+						if (that.formValidate.outType == 1) {
+							pdata.store_id = that.formValidate.store_id
+							if (that.formValidate.inType == 1) {
+								pdata.to_store_id = that.formValidate.to_store_id
+							} else {
+								pdata.to_wid = that.formValidate.to_wid
+							}
+						} else {
+							pdata.wid = that.formValidate.wid
+							if (that.formValidate.inType == 1) {
+								pdata.to_store_id = that.formValidate.to_store_id
+							} else {
+								pdata.to_wid = that.formValidate.to_wid
+							}
+						}
+						pdata.product_list = that.chooseGoods
+						if(that.formValidate.id == 0) {
+							createOut(pdata).then(res => {
+								this.$Message.success(res.msg);
+								this.$router.push({
+									path: this.roterPre + "/erp/out_list"
+								});
+							}).catch(err => {
+								this.$Message.error(err.msg);
+							})
+						}else {
+							editOut(that.formValidate.id,pdata).then(res => {
+								this.$Message.success(res.msg);
+								this.$router.push({
+									path: this.roterPre + "/erp/out_list"
+								});
+							}).catch(err => {
+								this.$Message.error(err.msg);
+							})
+						}
+						
+					} else {
+						// this.$Message.error("请输入参数模板名称");
+					}
+				});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.table {
+		/deep/.ivu-table-header table {
+			border: 0 !important;
+		}
+
+		/deep/.ivu-table-header thead tr th:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table td:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table-cell {
+			padding: 0 !important;
+		}
+
+		/deep/.ivu-table-border th,
+		/deep/.ivu-table-border td {
+			border-right: unset;
+		}
+
+		/deep/.ivu-table td {
+			height: 59px;
+		}
+	}
+
+	.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;
+			}
+		}
+	}
+
+	.after-line {
+		display: inline-block;
+		position: relative;
+		margin-right: 16px;
+	}
+
+	.ml16 {
+		margin-left: 16px;
+	}
+
+	.user-info {
+		position: relative;
+		padding: 20px;
+
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+			position: relative;
+
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				min-width: 250px;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+
+			.value {
+				flex: 1;
+			}
+
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.del-btn {
+		position: absolute;
+		right: 20px;
+		top: 10px;
+	}
+
+	.del-btn-1 {
+		position: absolute;
+		right: 80px;
+		bottom: 20px;
+	}
+</style>

+ 269 - 0
src/pages/erp/out/goodDetail.vue

@@ -0,0 +1,269 @@
+<template>
+	<div style="width: 100%">
+		<Modal v-model="modals" scrollable footer-hide closable title="商品列表" :mask-closable="false" width="700">
+			<Form ref="formValidate" :label-width="labelWidth" :label-position="labelPosition" class="tabform"
+				@submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="12">
+					<FormItem label="关键字:">
+						<Input enter-button placeholder="请输入商品名称" element-id="name" v-model="formValidate.key" clearable />
+					</FormItem>
+					</Col>
+					<Col span="4">
+					<Button type="primary" icon="ios-search" @click="userSearchs">搜索</Button>
+					</Col>
+				</Row>
+			</Form>
+			<!-- <Divider dashed/> -->
+			<Table highlight-row :columns="columns" :data="tabList" ref="table" :loading="loading" no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果" class="table" @on-current-change="change">
+				<template slot-scope="{ row, index }" slot="store">
+					<span> {{ row.my.stock }}{{row.my.unit_name}}</span>
+				</template>
+				<!-- product_num -->
+				<template slot-scope="{ row, index }" slot="product_num">
+					<span> {{ row.product_num }}{{row.unit_name || row.info['unit_name' + (row.unit_type == 0 ? '':(row.unit_type == 1?"_1":"_2"))]}}</span>
+				</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> -->
+			<!-- <Button type="primary"  @click="ok" style="width: 100%;margin-top:20px;">确认</Button> -->
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		commissionDetailApi,
+		extractlistApi
+	} from '@/api/finance';
+	import {
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		getUserList,
+		getOutGoods,
+		getOutGoodList
+	} from "@/api/erp";
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		name: 'commissionDetails',
+		data() {
+			return {
+				chooseGoods:[],
+				key: '',
+				wid: '',
+				my_store_id: '',
+				store_id: '',
+				type: 0,
+				modals: false,
+				spinShow: false,
+				detailsData: {},
+				Ids: 0,
+				loading: false,
+				formValidate: {
+					// page: 1, // 当前页
+					// limit: 20 ,// 每页显示条数
+					key: '',
+					wid: '',
+					store_id: '',
+					type: 0,
+					outType: 0
+				},
+				total: 0,
+				columns: [
+					{
+						title: 'ID',
+						key: 'product_id',
+						minWidth: 50
+					},
+					{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 200
+					},
+					{
+						title: '库存',
+						key: 'product_num',
+						minWidth: 200
+					},
+					{
+						title: '单位',
+						key: 'unit_name',
+						minWidth: 200
+					},
+					// {
+					// 	title: '出货门店/仓库库存',
+					// 	slot: 'product_num',
+					// 	minWidth: 150
+					// },
+					// {
+					// 	title: '门店库存',
+					// 	slot: 'store',
+					// 	minWidth: 330
+					// }
+				],
+				tabList: []
+
+			}
+		},
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'left';
+			}
+		},
+		mounted() {
+			// if (this.Ids) {
+			//     this.getList();
+			// }
+			this.chooseGoods = []
+		},
+		methods: {
+			clearChoose() {
+				this.modals = false
+				this.chooseGoods = []
+				this.tabList = []
+				this.clearAll()
+			},
+			clearAll() {
+				this.$refs.table.clearCurrentRow();
+			},
+			change(e) {
+				this.$emit('setGoods',e);
+			},
+			ok() {
+				this.modals = false;
+			},
+			// 时间
+			onchangeTime(e) {
+				this.formValidate.start_time = e[0];
+				this.formValidate.end_time = e[1];
+			},
+			// 详情
+			getDetails(id) {
+				this.Ids = id;
+				this.spinShow = true;
+				commissionDetailApi(id).then(async res => {
+					if (res.status === 200) {
+						let data = res.data
+						this.detailsData = data.user_info;
+						this.spinShow = false;
+					} else {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					}
+				}).catch(res => {
+					this.spinShow = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				console.log();
+				if (this.formValidate.outType == 1) {
+					this.formValidate.wid = ''
+					this.formValidate.type = 1
+					// delete this.formValidate.type
+				} else {
+					this.formValidate.store_id = ''
+					this.formValidate.type = 1
+				}
+				getOutGoodList(this.formValidate).then(async res => {
+					let data = res.data;
+					this.tabList = data.data;
+					this.total = data.count;
+					this.loading = false;
+				}).catch(res => {
+					this.loading = false;
+					this.modals = false
+					this.tabList = []
+					this.$Message.error(res.msg);
+				})
+			},
+			pageChange(index) {
+				this.formValidate.page = index
+				this.getList();
+			},
+			// 搜索
+			userSearchs() {
+				this.formValidate.page = 1;
+				this.getList();
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	.table {
+		.ivu-table-default {
+			overflow-y: auto;
+			max-height: 350px;
+		}
+	}
+
+	.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: 12px;
+						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>

+ 213 - 36
src/pages/erp/out/index.vue

@@ -3,7 +3,7 @@
 	<div>
 		<!-- tab切换栏 -->
 		
-		<Card :bordered="false" dis-hover class="ivu-mt" :padding="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"
@@ -13,10 +13,10 @@
 						<FormItem label="状态:" label-for="status">
 							<Select v-model="tableFrom.status" placeholder="请选择" clearable @on-change="userSearchs"
 								class="input-add">
-								<Option value="-3">全部</Option>
-								<Option value="0">待审核</Option>
-								<Option value="1">通过</Option>
-								<Option value="-1">拒绝</Option>
+								<Option :value="-3">全部</Option>
+								<Option :value="0">待审核</Option>
+								<Option :value="1">通过</Option>
+								<Option :value="-1">拒绝</Option>
 							</Select>
 						</FormItem>
 					</Form>
@@ -27,12 +27,12 @@
 			<div class="new_tab">
 			  <Tabs v-model="currentTab" @on-click="onClickTab">
 			    <TabPane label="门店订单" name="0" />
-			    <TabPane label="库间流转" name="2" />
 				<TabPane label="商品在途" name="1" />
+				<TabPane label="库间流转" name="2" />
 			  </Tabs>
 			</div>
 			<!-- 操作 -->
-			<Button v-auth="['admin-erp-add_position']" type="primary" @click="add" class="mr10">创建出库单</Button>
+			<Button v-auth="['admin-erp-out_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">
@@ -54,9 +54,27 @@
 					<div>ID:{{row.cuser.id}}</div>
 					<div>手机:{{row.cuser.phone}}</div>
 				</template>
-				<template slot-scope="{ row, index }" slot="cadmin">
+				<!-- <template slot-scope="{ row, index }" slot="cadmin">
 					<div>名称:{{row.cadmin.account}}</div>
 					<div>ID:{{row.cadmin.id}}</div>
+				</template> -->
+				<template slot-scope="{ row, index }" slot="product">
+					<div v-for="item in row.product" class="info">
+						<div>
+							商品名称:{{item.store_name}}
+						</div>
+						<div>
+							<div v-for="goods in item.group">
+								<div v-if="goods.pur_number != 0">
+									<span>
+										批次:{{goods.batch_code || '/'}}
+									</span>
+									<Tag color="primary" >{{goods.pur_number *1}} {{goods.unit_name}}</Tag>
+								</div>
+							</div>
+						</div>
+				
+					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
 					<div>名称:{{row.ware.title}}</div>
@@ -85,10 +103,30 @@
 				<template slot-scope="{ row, index }" slot="create_time">
 					<div>{{row.create_time|formatDate}}</div>
 				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<Tag color="default" v-if="row.status == 0">待审核</Tag>
+					<Tag color="primary" v-if="row.status == 1">通过</Tag>
+					<Tag color="error" v-if="row.status == -1">拒绝</Tag>
+					<Tag color="success" v-if="row.status == 2">部分上架</Tag>
+					<Tag color="warning" v-if="row.status == 3">已上架</Tag>
+				</template>
 				<template slot-scope="{ row, index }" slot="action">
-					<a @click="edit(row)">编辑</a>
-					<Divider type="vertical" />
-					<a @click="del(row, '删除仓位', index)">删除</a>
+					<a @click="look(row.id)">详情</a>
+					<template v-if="row.status == 0">
+						<Divider type="vertical" />
+						<a @click="edit(row)" v-if="row.status == 0">编辑</a>
+						<Divider type="vertical" />
+						<a @click="pass(row)">审核</a>
+					</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>
+					</template>
+					<template v-if="row.status <= 0">
+						<Divider type="vertical" />
+						<a @click="del(row, '删除出库单', index)">删除</a>
+					</template>
 				</template>
 			</Table>
 			<div class="acea-row row-right page">
@@ -96,17 +134,68 @@
 					:page-size="tableFrom.limit" />
 			</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="审核人:">
+		     <!-- <Input
+		        v-model="remarks.mark"
+		        maxlength="200"
+		        show-word-limit
+		        type="textarea"
+		        placeholder="请填写备注~"
+		        style="width: 100%"
+		      /> -->
+			  <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>
+		</Modal>
 	</div>
 </template>
 
 <script>
+	import  outDetails from './outDetail.vue'
+	
 	import {mapState} from "vuex";
-	import {getOutSimpleList,getReceiveList} from "@/api/erp";
+	import {getOutSimpleList,getReceiveList,getOutLists,getOutInfo,getUserList,outSave,wareDelivery} from "@/api/erp";
 	import {formatDate} from "@/utils/validate";
 	import timeOptions from "@/utils/timeOptions";
 	import Setting from "@/setting";
 	export default {
 		name: "outList",
+		components: {
+			outDetails
+		},
 		filters: {
 			formatDate(time) {
 				if (time !== 0) {
@@ -117,6 +206,14 @@
 		},
 		data() {
 			return {
+				authLists:[],
+				remarks: {
+					id: 0,
+					status: '',
+					auth_uid: "",
+					auth_admin_id: "",
+				},
+				modalpass:false,
 				currentTab: 0,
 				roterPre: Setting.roterPre,
 				loading: false,
@@ -131,33 +228,35 @@
 						key: "out_order_id",
 						minWidth: 200,
 					},
+					{
+						title: '商品信息',
+						slot: 'product',
+						minWidth: 250,
+					},
 					{
 						title: "创建人",
 						slot: "cuser",
 						minWidth: 200,
 					},
 					{
-						title: "系统创建人",
-						slot: "cadmin",
-						minWidth: 100,
-					},
-					{
-						title: "出货仓库",
+						title: "调出仓库",
 						slot: "ware",
 						minWidth: 100,
 					},
+					
 					{
-						title: "接收仓库",
-						slot: "tware",
+						title: "调出门店",
+						slot: "store",
 						minWidth: 100,
 					},
+					
 					{
-						title: "出货门店",
-						slot: "store",
+						title: "调入仓库",
+						slot: "tware",
 						minWidth: 100,
 					},
 					{
-						title: "接收门店",
+						title: "调入门店",
 						slot: "tstore",
 						minWidth: 100,
 					},
@@ -176,6 +275,11 @@
 						slot: "create_time",
 						minWidth: 90,
 					},
+					{
+						title: "状态",
+						slot: "status",
+						minWidth: 90,
+					},
 					{
 						title: "操作",
 						slot: "action",
@@ -206,6 +310,53 @@
 			this.getList();
 		},
 		methods: {
+			storeReceipt(row,type) {
+				let url;
+				this.$router.push({
+					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 => {
+					this.cancel()
+					this.getList();
+				})
+			},
+			cancel() {
+				this.remarks = {
+					id:0,
+					status: '',
+					auth_uid: "",
+					auth_admin_id: "",}
+					this.modalpass = false
+			},
+			pass(row) {
+				let qdata = {}
+				if(row.wid) {
+					qdata.wid = row.wid
+				}else {
+					qdata.store_id = row.store_id
+				}
+				this.authLists = []
+				this.remarks.id = row.id
+				getUserList(qdata).then(res => {
+					this.authLists = res.data.data
+					this.modalpass = true;
+				})
+			},
+			userSearchse(e) {
+				let auth = this.authLists.find(item => item.id == e)
+				console.log(auth,'auth');
+				this.remarks.auth_admin_id = auth.admin_id
+			},
+			look(id) {
+					this.$refs.outDetail.getInfo(id);
+				// this.
+				// getOutInfo(id).then(res => {
+				// 	console.log(id);
+				// })
+			},
 			//切换订单  
 			onClickTab(e) {
 				console.log(e);
@@ -215,6 +366,7 @@
 			},
 			//切换状态
 			userSearchs(e) {
+				console.log(e,'status');
 				this.tableFrom.status = e
 				this.tableFrom.page = 1;
 				this.getList();
@@ -223,17 +375,33 @@
 			getList() {
 				this.loading = true;
 				let getList = getReceiveList;
-				console.log(this.currentTab,'this.currentTab')
-				if(this.currentTab == 1 || this.currentTab == 2) {
-					this.tableFrom.type = this.currentTab
-					getList = getOutSimpleList
-				}
-				if(this.currentTab == 0){
-					getList = getReceiveList
-					this.tableFrom.type = ''
+				let qdata;
+				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,
+						}
+					}
+					if(this.currentTab == 0){
+						getList = getOutLists
+						qdata = {
+							status:this.tableFrom.status,
+							key: this.tableFrom.key,
+							page:this.tableFrom.page,
+							limit: this.tableFrom.limit,
+						}
+					}
+				}catch(e){
+					//TODO handle the exception
+					console.log(e,'err');
 				}
-				console.log(this.tableFrom,'this.tableFrom')
-				getList(this.tableFrom)
+				
+				getList(qdata)
 					.then(async (res) => {
 						let data = res.data;
 						this.tableList = data.data;
@@ -248,7 +416,7 @@
 			// 添加
 			add() {
 				this.$router.push({
-					path: this.roterPre + "/erp/add_position?id=0"
+					path: this.roterPre + "/erp/out_add?id=0"
 				});
 			},
 			addMore() {
@@ -283,7 +451,7 @@
 			// 编辑
 			edit(row) {
 				this.$router.push({
-					path: this.roterPre + "/erp/add_position?id=" + row.id
+					path: this.roterPre + "/erp/out_add?id=" + row.id
 				});
 			},
 			// 一键复制
@@ -297,7 +465,7 @@
 				let delfromData = {
 					title: tit,
 					num: num,
-					url: `/erp/Warehouse/position_del/${row.id}`,
+					url: `/erp/out/del/${row.id}`,
 					method: "DELETE",
 					ids: "",
 				};
@@ -317,6 +485,7 @@
 			},
 			pageChange(index) {
 				this.tableFrom.page = index;
+				this.tableList = []
 				this.getList();
 			},
 			// 表格搜索
@@ -359,4 +528,12 @@
 			height: 100%;
 		}
 	}
+	.info {
+		padding-top: 10px;
+		border-bottom: 1px dashed #515a6e;
+	
+		&:last-of-type {
+			border: none;
+		}
+	}
 </style>

+ 637 - 0
src/pages/erp/out/outDetail.vue

@@ -0,0 +1,637 @@
+<template>
+	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
+	<div class="user-info">
+		<div class="section">
+			<div class="section-hd">出库单号:{{info.out_order_id}}</div>
+		</div>
+	</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<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'">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in info.product">
+								<!-- <a @click="delGood(gindex)" class="del-btn">删除</a> -->
+								<div class="section-hd">{{goods.store_name}}</span> </div>
+								<div v-if="goods.group.length > 0" v-for="(item,index) in goods.group" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>价格:</div>
+											<div class="value">{{ item.price}}</div>
+										</div>
+										<div class="item">
+											<div>数量:</div>
+											<div class="value">{{ item.pur_number}}</div>
+										</div>
+										<div class="item" v-if="item.weight">
+											<div>总重量(kg):</div>
+											<div class="value">{{ item.weight}}</div>
+										</div>
+										<div class="item" v-if="item.bin_number">
+											<div>仓位编号:</div>
+											<div class="value">{{ item.bin_number}}</div>
+										</div>
+									</div>
+								</div>
+							</div>
+						</Card>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<!-- <div class="section">
+								<div class="section-hd">出库单号:{{info.out_order_id}}</div>
+							</div> -->
+							<!-- <div class="section" v-if="">
+								<div class="section-hd">调出仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>供应商ID:</div>
+										<div class="value">{{ info.supplier.id}}</div>
+									</div>
+									<div class="item">
+										<div>供应商名称:</div>
+										<div class="value">{{ info.supplier.supplier_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.supplier.phone}}</div>
+									</div>
+								</div>
+							</div> -->
+							
+							<div class="section" v-if="info.store && info.store.id">
+								<div class="section-hd">调出门店</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.store.name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.store.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.store.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.ware && info.ware.id">
+								<div class="section-hd">调出门店</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.tstore && info.tstore.id">
+								<div class="section-hd">调入门店</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.tstore.name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.tstore.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tstore.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.tware && info.tware.id">
+								<div class="section-hd">调入仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.tware.title}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.tware.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tware.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.cuser && info.cuser.id">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.auser && info.auser.id">
+								<div class="section-hd">审核人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.auser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.auser.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.auser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<!-- <div class="section">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div> -->
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getPurchaseInfo,
+		getOutInfo
+	} from "@/api/erp";
+	import Setting from "@/setting";
+
+	export default {
+		name: 'outDetail',
+		data() {
+			return {
+				info: {},
+				roterPre: Setting.roterPre,
+				psInfo: {},
+				modals: false,
+				activeName: 'base',
+				list: [{
+						val: 'base',
+						label: '基础信息'
+					},{
+						val: 'info',
+						label: '商品信息'
+					},
+					
+				],
+				ckColumns: [
+					{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "title",
+						key: "title",
+						width: 200,
+					},
+				],
+				columns: [{
+					title: "ID",
+					key: "id",
+					width: 80,
+				},
+				{
+					title: "商品名称",
+					key: "product_name",
+					width: 200,
+				},
+				{
+					title: "采购数量0",
+					key: "product_num",
+					width: 150,
+				},
+				{
+					title: "采购数量1",
+					key: "pur_num",
+					width: 150,
+				},
+				{
+					title: "单位",
+					key: "unit_name",
+					width: 150,
+				},
+				{
+					title: "净重",
+					key: "net_weight",
+					width: 80,
+				},
+				{
+					title: "皮重",
+					key: "tare_weight",
+					width: 80,
+				},
+				{
+					title: "总重",
+					key: "pur_weight",
+					width: 80,
+				},
+				 ]
+			}
+		},
+		watch: {
+
+		},
+		created() {},
+		methods: {
+			deit() {
+				this.$router.push({
+					path: this.roterPre + "/erp/user_add?id=" + this.formValidate.id
+				});
+			},
+			getInfo(id) {
+				getOutInfo(id).then(res => {
+					console.log(res, 'res');
+					this.modals = true
+					this.info = res.data
+				}).catch(err => {
+					this.modals = false
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	/deep/.ivu-modal-body {
+		padding: 0;
+	}
+
+	.user-info {
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+	
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+	
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+	
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+	
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+	
+			.value {
+				flex: 1;
+			}
+	
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+	
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.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;
+						}
+
+						span:last-child {
+							color: #808695;
+						}
+					}
+
+					p:last-child {
+						font-size: 22px;
+					}
+				}
+			}
+		}
+	}
+</style>
+<style scoped lang="stylus">
+	.user_menu>>>.ivu-menu {
+		width 100% !important;
+	}
+
+	/deep/ .ivu-form-item {
+		margin: 20px 0 0 0 !important;
+	}
+
+	.info-list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 0 0 20px;
+
+		div {
+			width: 50%
+		}
+	}
+
+	.tit {
+		font-weight: bold;
+		padding: 20px 0 10px 0;
+	}
+</style>

+ 1049 - 0
src/pages/erp/out/storeReceipt.vue

@@ -0,0 +1,1049 @@
+<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}/erp/out_list` }">
+						<!-- <Button icon="ios-arrow-back" size="small" class="mr20"
+              >返回</Button
+            > -->
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="type == 1 ?'门店收货':'添加入库'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form class="formValidate mt20" ref="formValidate" :rules="ruleValidate" :model="formValidate"
+				:label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="24">
+					<FormItem label="出库单号: " prop="out_order_id">
+						<div>{{formValidate.out_order_id}}</div>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="运费: " prop="freight">
+						<Input v-model="formValidate.freight" placeholder="请输入运费" v-width="'150'" type="number" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="创建人:" prop="create_uid" v-if="type == 1">
+						<el-cascader placeholder="请选择创建人" class="input-add" size="mini"
+							v-model="formValidate.create_uid" :options="authList" :props="propsss"
+							@change="userSearchsss" filterable clearable v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品:" prop="goods">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in chooseGoods">
+								<!-- <Button type="primary" @click="delGood(gindex)" class="del-btn">删除</Button> -->
+								<div class="section-hd">{{goods.product_name}}</span> </div>
+								<div v-if="goods.group.length > 0 && type == 1" v-for="(item,index) in goods.group"
+									class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>单价(元/{{item.unit_name}}):</div>
+											<div class="value">{{ item.price}}</div>
+										</div>
+										<!-- <div class="item">
+											<div>是否称重:</div>
+											<div class="value">{{ item.is_weigh == 1? '是':'否'}}</div>
+										</div> -->
+										<div class="item">
+											<div>数量({{ item.unit_name}}):</div>
+											<div class="value">
+												{{item.pur_number}}
+											</div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>总重量(kg):</div>
+											<div class="value">{{item.weight}}</div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>皮重(kg):</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].group[index].tare_weight"
+													placeholder="请输入皮重" v-width="'150'" type="number" /></div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>净重(kg):</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].group[index].net_weight"
+													placeholder="请输入净重" v-width="'150'" type="number" /></div>
+										</div>
+										<!-- <a v-if="goods.group.length > 1" @click="delBatch(gindex,index)" class=" del-btn-1">删除</a> -->
+									</div>
+
+								</div>
+								<div class="section" v-if="type == 2">
+									<div class="section-bd">
+										<div class="item">
+											<div>仓位:</div>
+											<div class="value" v-if="goods.bin_number">{{goods.bin_number}}</div>
+											<el-cascader placeholder="请选择仓位" v-if="!goods.bin_number" class="value"
+												size="mini" v-model="goods.bin_number" :options="positionList"
+												:props="props" filterable clearable v-width="'400'">
+											</el-cascader>
+											<a @click="addPosition" v-if="!goods.bin_number">添加仓位</a>
+										</div>
+									</div>
+								</div>
+
+								<div v-if="goods.batchs.length > 0 && type == 2" v-for="(item,index) in goods.batchs"
+									class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>单价(元/{{item.unit_name}}):</div>
+											<div class="value">{{ item.price}}</div>
+										</div>
+
+										<div class="item">
+											<div>数量({{ item.unit_name}}):</div>
+											<div class="value">
+												{{item.pur_number}}
+											</div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>总重量(kg):</div>
+											<div class="value">{{item.weight}}</div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>皮重(kg):</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].batchs[index].tare_weight"
+													placeholder="请输入皮重" v-width="'150'" type="number" /></div>
+										</div>
+										<div class="item" v-if="item.is_weigh == 1">
+											<div>净重(kg):</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].batchs[index].net_weight"
+													placeholder="请输入净重" v-width="'150'" type="number" /></div>
+										</div>
+										<!-- <a v-if="goods.group.length > 1" @click="delBatch(gindex,index)" class=" del-btn-1">删除</a> -->
+									</div>
+
+								</div>
+							</div>
+						</Card>
+						<!-- <Button type="primary" class="submission" style="margin-top:20px;" @click="getGoods()"
+							>添加商品</Button> -->
+					</FormItem>
+					</Col>
+				</Row>
+			</Form>
+		</Card>
+		<Card :bordered="false" dis-hover class="fixed-card"
+			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
+			<Form>
+				<FormItem>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+		<good-detail ref="goodDetail" @setGoods="setGoods"></good-detail>
+		<Modal v-model="modalPosition" scrollable title="添加仓位" class="order_box" :closable="false"
+			:mask-closable="false">
+			<Form ref="remarks" :model="remarks" :rules="rulePosition" :label-width="100" @submit.native.prevent>
+				<Col span="24">
+				<FormItem label="仓位名称:" prop="title">
+					<Input v-model="remarks.title" placeholder="请输入仓位名称/编号" v-width="'200'" />
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="通道:" prop="passageway">
+					<Input v-model="remarks.passageway" placeholder="请输入通道" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~99)
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="左右:" prop="control">
+					<RadioGroup v-model="remarks.control">
+						<Radio label="L" :disabled="remarks.id != 0">
+							<Icon type="social-apple"></Icon>
+							<span>左</span>
+						</Radio>
+						<Radio label="R" :disabled="remarks.id != 0">
+							<Icon type="social-android"></Icon>
+							<span>右</span>
+						</Radio>
+					</RadioGroup>
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="层数:" prop="layer">
+					<Input v-model="remarks.layer" placeholder="请输入层数" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~9)
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="仓位编号:" prop="number">
+					<Input v-model="remarks.number" placeholder="请输入仓位编号" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~999)
+				</FormItem>
+				</Col>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putRemark()">提交</Button>
+				<Button @click="cancel()">取消</Button>
+			</div>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from "vuex";
+	import {
+		staffListInfo
+	} from "@/api/store";
+	import {
+		wareDelivery,
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		getUserList,
+		getOutGoods,
+		createWant,
+		getWantInfo,
+		getProductBatch,
+		createOut,
+		storeReceipt,
+		getOutInfo,
+		getOutSimpleList,
+		getPositionList,
+		createPosition
+	} from "@/api/erp";
+	import {
+		keyApi,
+		storeGetInfoApi,
+		cityApi,
+		storeUpdateApi,
+		cascaderList
+	} from '@/api/store';
+	import {
+		productSpecs,
+		productSpecsInfo
+	} from "@/api/product";
+	import Setting from "@/setting";
+	import goodDetail from './goodDetail.vue'
+
+	const jy = (min, max) => {
+		return {
+			validator(rule, value) {
+				if (!value || value > max || value < min) {
+					return [{
+						message: `范围为${min}~${max}`
+					}];
+				} else {
+					return [];
+				}
+			}
+		}
+	}
+	export default {
+		name: "specsAdd",
+		components: {
+			goodDetail
+		},
+		data() {
+			return {
+				type: 0,
+				info: {},
+				loading: false,
+				authList: [],
+				chooseGoods: [],
+				staffData: [],
+				addresData: [],
+				props: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "bin_number",
+					label: "bin_number"
+				},
+				propss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "name"
+				},
+				propsss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "staff_name"
+				},
+				roterPre: Setting.roterPre,
+				data1: [],
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				formValidate: {
+					freight: 0,
+					out_order_id: '',
+					id: 0,
+					wid: 0,
+					store_id: 0,
+					goods: [],
+					my_store_id: 0,
+					create_uid: 0,
+					create_admin_id: 0,
+				},
+				ruleValidate: {
+					// freight: [{
+					// 	type: "number",
+					// 	required: true,
+					// 	message: "输入运费",
+					// 	trigger: "blur"
+					// }, ],
+				},
+				rulePosition: {
+					title: [{
+						required: true,
+						message: "请输入仓位名称",
+						trigger: "blur"
+					}, ],
+					wid: [{
+						required: true,
+						message: "请选择仓库",
+						trigger: "blur"
+					}, ],
+					passageway: [{
+						required: true,
+						message: "请输入通道",
+						trigger: "blur"
+					}, jy(1, 99)],
+					control: [{
+						required: true,
+						message: "请选择左右",
+						trigger: "blur"
+					}, ],
+					layer: [{
+						required: true,
+						message: '请输入层数',
+						trigger: 'blur',
+					}, jy(1, 9)],
+					number: [{
+						required: true,
+						message: '请输入仓位编号',
+						trigger: 'blur',
+					}, jy(1, 999)],
+				},
+				positionList: [],
+				modalPosition: false,
+				remarks: {
+					id: 0,
+					title: "",
+					wid: '0',
+					passageway: '',
+					control: "L",
+					layer: '',
+					number: ''
+				},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getGodownList()
+			let data = {
+				pid: 0
+			}
+			// this.cityInfo(data);
+		},
+		mounted() {
+			// this.setCopyrightShow({
+			// 	value: false
+			// });
+			this.staffList()
+			if (this.$route.query.id != 0) {
+				this.formValidate.out_order_id = this.$route.query.id
+				this.type = this.$route.query.type
+				this.getOutSimpleList(this.$route.query.id)
+
+			}
+		},
+		destroyed() {
+			// this.setCopyrightShow({
+			// 	value: true
+			// });
+		},
+		methods: {
+			...mapMutations("admin/layout", ["setCopyrightShow"]),
+			addPosition() {
+				this.modalPosition = true
+				this.remarks.wid = this.formValidate.wid
+			},
+			putRemark() {
+				this.$refs.remarks.validate((valid) => {
+					if (valid) {
+						// this.remarks.id = this.$route.query.id;
+						createPosition({
+							id: this.remarks.id,
+							title: this.remarks.title,
+							wid: this.remarks.wid,
+							passageway: this.remarks.passageway,
+							control: this.remarks.control,
+							layer: this.remarks.layer,
+							number: this.remarks.number
+						}).then(res => {
+							this.$Message.success(res.msg);
+							this.getPositionList()
+							this.cancel()
+							// this.$router.push({
+							// 	path: this.roterPre + "/erp/position_list"
+							// });
+						}).catch(err => {
+							this.$Message.error(err.msg);
+						})
+					} else {
+						// this.$Message.error("请输入参数模板名称");
+					}
+				});
+			},
+			cancel() {
+				this.modalPosition = false
+				this.remarks = {
+					id: 0,
+					title: "",
+					wid: '0',
+					passageway: '',
+					control: "L",
+					layer: '',
+					number: ''
+				}
+			},
+			getPositionList() {
+				getPositionList({
+					wid: this.formValidate.wid,
+					not_used: 1,
+					page: 1,
+					limit: 1000
+				}).then(res => {
+					this.positionList = res.data.data
+				})
+			},
+			delGood(index) {
+				this.chooseGoods.splice(index, 1)
+			},
+			delBatch(in1, in2) {
+				console.log((in1, in2));
+				this.chooseGoods[in1].batch.splice(in2, 1)
+			},
+			jyNum(a = 0, b = 0, item) {
+				console.log(a, b, 'jiaoyan');
+				if (a * 1 < b * 1) {
+					item.pur_number = 0
+					return this.$Message.error('输入值大于可调出商品的库存')
+				}
+			},
+			getOutSimpleList(id) {
+				getOutSimpleList(id).then(res => {
+					getOutSimpleList({
+						out_order_id: id,
+						type: this.type
+					}).then(res => {
+						console.log(res);
+						this.info = res.data.data[0]
+						if (this.type == 1) {
+							this.chooseGoods = this.info.product.map(item => {
+								let obj = {
+									bar_code: item.bar_code,
+									product_code: item.product_code || "",
+									product_id: item.id,
+									product_name: item.store_name,
+									group: item.group.map(e => {
+										let ob = {
+											batch_code: e.batch_code,
+											is_weigh: e.is_weigh,
+											net_weight: '',
+											price: e.price,
+											pur_number: e.pur_number,
+											rate: e.rate,
+											shelf_life: e.shelf_life,
+											tare_weight: '',
+											unit_name: e.unit_name,
+											unit_type: e.unit_type,
+											weight: e.weight,
+										}
+
+										return ob
+									})
+								}
+								return obj
+							})
+						} else {
+							this.chooseGoods = this.info.product.map(item => {
+								let obj = {
+									bin_number: item.bin_number,
+									bar_code: item.bar_code,
+									product_code: item.product_code || "",
+									product_id: item.id,
+									product_name: item.store_name,
+									total_price: item.total_price,
+									pur_number: item.pur_number,
+									unit_type: 0,
+									unit_name: item.p_unit_name,
+									batchs: item.group.map(e => {
+										let ob = {
+											batch_code: e.batch_code,
+											is_weigh: e.is_weigh,
+											net_weight: '',
+											price: e.price,
+											pur_number: e.pur_number,
+											rate: e.rate,
+											shelf_life: e.shelf_life,
+											tare_weight: '',
+											unit_name: e.unit_name,
+											unit_type: e.unit_type,
+											weight: e.weight,
+										}
+
+										return ob
+									})
+								}
+								return obj
+							})
+							console.log(this.chooseGoods, 'batchs');
+						}
+
+						if (this.type == 1) {
+							this.formValidate.to_store_id = this.info.to_store_id * 1
+							this.getUserList()
+						} else {
+							this.formValidate.wid = this.info.to_wid * 1
+							this.getPositionList()
+							this.getUserList()
+						}
+						// that
+					})
+					// let data = res.data
+					// if (data.wid) {
+					// 	this.formValidate.outType = 0
+					// 	this.formValidate.wid = data.wid*1
+					// } else {
+					// 	this.formValidate.outType = 1
+					// 	this.formValidate.store_id = data.store_id*1
+					// }
+					// if (data.to_wid) {
+					// 	this.formValidate.to_wid = data.to_wid*1
+					// 	this.formValidate.inType == 0
+					// } else {
+					// 	this.formValidate.inType == 1
+					// 	
+					// }
+					// this.getUserList()
+					// this.formValidate.create_uid = data.create_uid
+					// this.formValidate.create_admin_id = data.create_admin_id
+					// this.chooseGoods = data.product.map(item => {
+					// 	item.name = item.store_name
+					// 	item.product_id = item.id
+					// 	if(item.group.length > 0) {
+					// 		item.batch = item.group
+					// 	}else {
+					// 		item.batch = []
+					// 	}
+					// 	return item
+					// })
+					// console.log(res, 'ddddd');
+					// let data = res.data
+					// this.formValidate.id = data.id
+					// this.formValidate.create_uid = data.create_uid
+					// this.chooseGoods = data.info
+					// this.formValidate.store_id = data.store_id
+					// console.log(this.formValidate.goods, 'this.formValidate.goods');
+					// if (data.wid) {
+					// 	this.formValidate.inType = 0
+					// 	this.formValidate.wid = data.wid
+					// 	this.getUserList({
+					// 		wid: this.formValidate.wid
+					// 	})
+					// } else {
+					// 	this.formValidate.inType = 1
+					// 	this.getUserList({
+					// 		store_id: this.formValidate.store_id
+					// 	})
+					// }
+				})
+			},
+			setGoods(e) {
+				console.log(e, 'ddd');
+				// try {
+				// 	let arr = e.map(item => {
+				// 		item.unitList = [{
+				// 			value: 0,
+				// 			label: item.info.unit_name
+				// 		}]
+				// 		if (item.info.unit_name_1) {
+				// 			item.unitList.push({
+				// 				value: 1,
+				// 				label: item.info.unit_name_1
+				// 			})
+				// 		}
+				// 		if (item.info.unit_name_2) {
+				// 			item.unitList.push({
+				// 				value: 2,
+				// 				label: item.info.unit_name_1
+				// 			})
+				// 		}
+				// 		item.want_product_num = 0
+				// 		return item
+				// 	})
+				// 	this.chooseGoods = this.chooseGoods.concat(arr)
+				// } catch (e) {
+				// 	//TODO handle the exception
+				// 	console.log('err', e);
+				// }
+				// console.log(this.chooseGoods, 'this.chooseGoods');
+
+				// 校验商品是否重复
+				if (this.chooseGoods.find(item => e.product_id == item.product_id)) {
+					console.log('55');
+					this.$refs.goodDetail.clearAll()
+					return this.$Message.error('该商品已选择');
+				} else {
+					this.$refs.goodDetail.modals = false
+					let qdata;
+					console.log('this.formValidate.outType', this.formValidate.outType);
+					if (this.formValidate.outType == 1) {
+						try {
+							qdata = {
+								store_id: this.formValidate.store_id,
+								product_id: e.product_id
+							}
+						} catch (e) {
+							//TODO handle the exception
+							console.log('err', e);
+						}
+
+					} else {
+						qdata = {
+							wid: this.formValidate.wid,
+							product_id: e.product_id
+						}
+					}
+					console.log(qdata, 'qdata');
+					getProductBatch(qdata).then(res => {
+						if (res.data.length > 0) {
+							this.chooseGoods = this.chooseGoods.concat({
+								bar_code: e.bar_code,
+								is_weigh: e.info.is_weigh,
+								name: e.product_name,
+								product_id: e.product_id,
+								product_num: e.product_num,
+								pur_number: '',
+								unit_name: e.unit_name,
+								weight: '',
+								batch: res.data.map(item => {
+									item.weight = 0
+									item.pur_number = 0
+									return item
+								})
+							})
+						} else {
+							this.chooseGoods = this.chooseGoods.concat({
+								bar_code: e.bar_code,
+								is_weigh: e.info.is_weigh,
+								name: e.product_name,
+								product_id: e.product_id,
+								product_num: e.product_num,
+								pur_number: 0,
+								unit_name: e.unit_name,
+								weight: 0,
+								batch: []
+							})
+						}
+					})
+					// this.chooseGoods = this.chooseGoods.concat(e)
+
+				}
+			},
+			getGoods() {
+				console.log(this.formValidate.store_id, this.formValidate.wid);
+				if (this.formValidate.wid == 0 && this.formValidate.store_id == 0) {
+					return this.$Message.error('请选择调出仓库或门店');
+				}
+				try {
+					this.$refs.goodDetail.formValidate.outType = this.formValidate.outType
+					this.$refs.goodDetail.formValidate.wid = this.formValidate.wid
+					this.$refs.goodDetail.formValidate.store_id = this.formValidate.store_id
+					this.$refs.goodDetail.modals = true
+					this.$refs.goodDetail.getList()
+
+				} catch (e) {
+					//TODO handle the exception
+					console.log('err', e);
+				}
+
+			},
+			getUserList() {
+				let qdata = {}
+				if (this.type == 1) {
+					// if (this.formValidate.outType == 1) {
+					// 	qdata.store_id = this.formValidate.store_id
+					// } else {
+					// 	qdata.wid = this.formValidate.wid
+					// }
+					qdata.store_id = this.formValidate.to_store_id
+				} else {
+					qdata.wid = this.formValidate.wid
+				}
+
+				getUserList(qdata).then(res => {
+					// console.log(res);
+					this.authList = res.data.data
+					// .map(item => {
+					// 		item.id += ''
+					// 		return item
+					// 	});
+				})
+			},
+			staffList() {
+				staffListInfo()
+					.then((res) => {
+						this.staffData = res.data
+						// .map(item => {
+						// 	item.id += ''
+						// 	return item
+						// });
+					})
+					.catch((err) => {
+						this.$Message.error(err.msg);
+					});
+			},
+			getGodownInfo(id) {
+				getGodownInfo(id).then(res => {
+					this.formValidate = res.data
+					this.formValidate.addressSelect = this.formValidate.addressSelect.map(item => item * 1)
+					console.log(this.formValidate.addressSelect);
+				})
+			},
+			addchack(e, selectedData) {
+				console.log(selectedData, 'selectedData');
+				e.forEach((i, index) => {
+					if (index == 0) {
+						this.formValidate.province = i
+					} else if (index == 1) {
+						this.formValidate.city = i
+					} else if (index == 2) {
+						this.formValidate.area = i
+					} else {
+						this.formValidate.street = i
+					}
+				})
+				this.formValidate.address = (selectedData.map(o => o.label)).join('/')
+				// console.log('this.formValidate.addressSelect',this.formValidate.addressSelect);
+
+			},
+			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();
+				});
+
+
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+					// .map(item => {
+					// 		item.id += ''
+					// 		return item
+					// 	});
+				})
+			},
+			del(index) {
+				this.chooseGoods.splice(index, 1);
+			},
+			userSearchse(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.getUserList()
+			},
+			userSearchs(e) {
+				this.formValidate.wid = 0
+				this.goods = []
+			},
+			userSearchss(e) {
+				this.formValidate.create_uid = "";
+				this.formValidate.store_id = 0
+				this.authList = []
+				this.getUserList()
+			},
+			checkOutWare(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.chooseGoods = []
+				if (e) {
+					this.getUserList()
+				}
+			},
+			changeOutType(e) {
+				this.formValidate.wid = 0
+				this.formValidate.store_id = 0
+				this.checkOutWare(0)
+			},
+			userSearchsss(e) {
+				if (e) {
+					let obj = this.authList.find(item => item.id == e)
+					this.formValidate.create_admin_id = obj.admin_id
+				}
+			},
+			checkWid(e) {
+
+			},
+			handleSubmit(name) {
+				let that = this
+				let errIndex = 0
+				let err1 = 0
+				this.chooseGoods.forEach(item => {
+					// if(item)
+					if (that.type == 1) {
+						item.group.forEach(e => {
+							if (e.is_weigh == 1 && e.net_weight == 0) {
+								errIndex++
+							}
+						})
+					} else {
+						item.batchs.forEach(e => {
+							if (e.is_weigh == 1 && e.net_weight == 0) {
+								errIndex++
+							}
+						})
+						if(!item.bin_number) {
+							err1++
+						}
+					}
+
+				})
+				if (errIndex > 0) {
+					return this.$Message.error('称重商品需填写净重')
+				}
+				if(err1 > 0) {
+					return this.$Message.error('请选择仓位')
+				}
+				console.log(this.chooseGoods, '最后');
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						try {
+							let pdata = {
+								freight: this.formValidate.freight,
+								info: this.chooseGoods,
+								out_order_id: this.formValidate.out_order_id,
+							}
+							console.log('2');
+							let pf;
+							if (that.type == 1) {
+								pf = storeReceipt
+								pdata.store_id = that.formValidate.to_store_id
+							} else {
+								pf = wareDelivery
+								pdata.wid = that.formValidate.wid
+								pdata.create_uid = this.formValidate.create_uid
+								pdata.create_admin_id = this.formValidate.create_admin_id
+							}
+							pf(pdata).then(res => {
+								this.$Message.success(res.msg);
+								this.$router.push({
+									path: this.roterPre + "/erp/out_list"
+								});
+							}).catch(err => {
+								this.$Message.error(err.msg);
+							})
+						} catch (e) {
+							//TODO handle the exception
+							console.log(e, 'errr');
+						}
+
+
+					} else {
+						// this.$Message.error("请输入参数模板名称");
+					}
+				});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.table {
+		/deep/.ivu-table-header table {
+			border: 0 !important;
+		}
+
+		/deep/.ivu-table-header thead tr th:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table td:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table-cell {
+			padding: 0 !important;
+		}
+
+		/deep/.ivu-table-border th,
+		/deep/.ivu-table-border td {
+			border-right: unset;
+		}
+
+		/deep/.ivu-table td {
+			height: 59px;
+		}
+	}
+
+	.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;
+			}
+		}
+	}
+
+	.after-line {
+		display: inline-block;
+		position: relative;
+		margin-right: 16px;
+	}
+
+	.ml16 {
+		margin-left: 16px;
+	}
+
+	.user-info {
+		position: relative;
+		padding: 20px;
+
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+			position: relative;
+
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				min-width: 250px;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+
+			.value {
+				flex: 1;
+			}
+
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.del-btn {
+		position: absolute;
+		right: 20px;
+		top: 10px;
+	}
+
+	.del-btn-1 {
+		position: absolute;
+		right: 80px;
+		bottom: 20px;
+	}
+
+	/deep/ .ivu-modal-content {
+		// width: 600px;
+	}
+</style>

+ 2438 - 0
src/pages/erp/product/addProduct.vue

@@ -0,0 +1,2438 @@
+<template>
+	<div class="article-manager video-icon form-submit" id="shopp-manager">
+		<div class="i-layout-page-header">
+			<PageHeader class="product_tabs" hidden-breadcrumb>
+				<div slot="title" class="acea-row row-middle">
+					<router-link :to="{ path: `${roterPre}/erp/product` }">
+						<div class="font-sm after-line">
+							<span class="iconfont iconfanhui"></span>
+							<span class="pl10">返回</span>
+						</div>
+					</router-link>
+					<span v-text="$route.query.id ? '编辑商品' : '添加商品'" class="mr20 ml16"></span>
+				</div>
+			</PageHeader>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt mh">
+			<Form class="formValidate mt20" ref="formValidate" :rules="ruleValidate" :model="formValidate"
+				:label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<!-- 商品信息-->
+					<Col span="24">
+					<FormItem label="商品类型:" props="product_type">
+						<div class="productType" :class="formValidate.product_type == item.id ? 'on' : ''"
+							v-for="(item, index) in productType" :key="item.id" @click="productTypeTap(1,item)">
+							<div class="name">{{ item.name }}</div>
+							<!-- <div class="title">({{ item.title }})</div> -->
+							<div v-if="formValidate.product_type == item.id" class="jiao"></div>
+							<div v-if="formValidate.product_type == item.id" class="iconfont iconduihao"></div>
+						</div>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品分类:" prop="cate_id">
+						<el-cascader placeholder="请选择商品分类" v-width="'50%'" size="mini" v-model="formValidate.cate_id"
+							:options="treeSelect" :props="props" filterable clearable>
+						</el-cascader>
+						<span class="addClass" @click="addClass" v-if="merchantType!=1">新增分类</span>
+
+					</FormItem>
+					</Col>
+					<Col span="24" class="brandName">
+					<FormItem label="商品品牌:" prop="">
+						<Cascader :data="brandData" placeholder="请选择商品品牌" change-on-select
+							v-model="formValidate.brand_id" filterable v-width="'50%'"></Cascader>
+						<span class="addClass" @click="addBrand" >新增品牌</span>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品名称:" prop="store_name">
+						<Input v-model="formValidate.store_name" placeholder="请输入商品名称" v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品简介:" prop="">
+						<Input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介"
+							v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品关键字:" prop="">
+						<Input v-model="formValidate.keyword" placeholder="请输入商品关键字" v-width="'50%'" />
+						<div class="tips">通过命中关键字搜索对应商品,方便用户查找</div>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="单位:" prop="unit_name">
+						<Select v-model="formValidate.unit_name" clearable filterable v-width="'50%'"
+							placeholder="请输入单位">
+							<Option v-for="(item, index) in unitNameList" :value="item.name" :key="item.id">
+								{{ item.name }}
+							</Option>
+						</Select>
+						<span class="addClass" @click="addUnit" v-if="merchantType!=1">新增单位</span>
+					</FormItem>
+					</Col>
+
+					<Col span="24">
+					<FormItem label="大单位:" prop="unit_name_1">
+						<Select v-model="formValidate.unit_name_1" clearable filterable v-width="'50%'"
+							placeholder="请输入大单位">
+							<Option v-for="(item, index) in unitNameList" :value="item.name" :key="item.id">
+								{{ item.name }}
+							</Option>
+						</Select>
+						<span class="addClass" @click="addUnit" v-if="merchantType!=1">新增单位</span>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="大单位转化率:" prop="unit_rate_1">
+						<Input v-model="formValidate.unit_rate_1" placeholder="请输入大单位转化率" v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="超大单位:" prop="unit_name_2">
+						<Select v-model="formValidate.unit_name_2" clearable filterable v-width="'50%'"
+							placeholder="请输入超大单位">
+							<Option v-for="(item, index) in unitNameList" :value="item.name" :key="item.id">
+								{{ item.name }}
+							</Option>
+						</Select>
+						<span class="addClass" @click="addUnit" v-if="merchantType!=1">新增单位</span>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="超大单位转化率:" prop="unit_rate_2">
+						<Input v-model="formValidate.unit_rate_2" placeholder="请输入超大单位转化率" v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品推荐图:">
+						<div class="acea-row">
+							<div v-if="formValidate.recommend_image" class="pictrue">
+								<img v-lazy="formValidate.recommend_image" />
+								<Button shape="circle" icon="md-close" @click.native="formValidate.recommend_image = ''"
+									class="btndel"></Button>
+							</div>
+							<div v-else class="upLoad acea-row row-center-wrapper"
+								@click="modalPicTap('dan', 'recommend_image')">
+								<Icon type="ios-camera-outline" size="26" />
+							</div>
+							<Input v-model="formValidate.recommend_image" class="input-display"></Input>
+						</div>
+						<div class="tips">在特殊的商品分类样式中显示(建议图片比例5:2)
+							<Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
+								<a>查看示例</a>
+								<div class="exampleImg" slot="content">
+									<img :src="`${baseURL}/statics/system/productRecommendImage.png`" alt="" />
+								</div>
+							</Poptip>
+						</div>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品轮播图:" prop="slider_image">
+						<div class="acea-row">
+							<div class="pictrue" v-for="(item, index) in formValidate.slider_image" :key="index+'img'"
+								draggable="true" @dragstart="handleDragStart($event, item)"
+								@dragover.prevent="handleDragOver($event, item)"
+								@dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)">
+								<img v-lazy="item" />
+								<Button shape="circle" icon="md-close" @click.native="handleRemove(index)"
+									class="btndel"></Button>
+							</div>
+							<div v-if="formValidate.slider_image.length < 10" class="upLoad acea-row row-center-wrapper"
+								@click="modalPicTap('duo')">
+								<Icon type="ios-camera-outline" size="26" />
+							</div>
+							<Input v-model="formValidate.slider_image[0]" class="input-display"></Input>
+						</div>
+						<div class="tips"> 建议尺寸:800 * 800px,可拖拽改变图片顺序,默认首张图为主图,最多上传10张</div>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="排序:">
+						<InputNumber :min="0" :max="999999" v-width="'50%'" v-model="formValidate.sort"
+							placeholder="请输入排序" />
+					</FormItem>
+					</Col>
+					<Col span="24" class="goodsShow">
+					<FormItem label="是否上架:">
+						<Switch v-model="formValidate.is_show" :true-value="1" :false-value="0" size="large"
+							@on-change="goodsOff">
+							<span slot="open">是</span>
+							<span slot="close">否</span>
+						</Switch>
+					</FormItem>
+					</Col>
+					<Col span="24" class="goodsShow">
+					<FormItem label="是否称重:">
+						<Switch v-model="formValidate.is_weigh" :true-value="1" :false-value="0" size="large"
+							@on-change="goodsOff">
+							<span slot="open">是</span>
+							<span slot="close">否</span>
+						</Switch>
+					</FormItem>
+					</Col>
+					<Col span="24" class="goodsShow">
+					<FormItem label="是否可调价:">
+						<Switch v-model="formValidate.is_dicker" :true-value="1" :false-value="0" size="large"
+							@on-change="goodsOff">
+							<span slot="open">是</span>
+							<span slot="close">否</span>
+						</Switch>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品详情:" prop="description">
+						<Input v-model="formValidate.description" type="textarea" :rows="3" placeholder="请输入商品详情"
+							v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品条形码:" prop="bar_code">
+						<Input v-model="formValidate.bar_code" placeholder="请输入商品条形码" v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="价格:" prop="price">
+						<Input v-model="formValidate.price" placeholder="请输入价格" v-width="'50%'" type="number" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="VIP价格:" prop="vip_price">
+						<Input v-model="formValidate.vip_price" placeholder="请输入VIP价格" v-width="'50%'" type="number" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="成本价:" prop="cost">
+						<Input v-model="formValidate.cost" placeholder="请输入成本价" v-width="'50%'" type="number" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="保质期(天):" prop="shelf_life">
+						<Input v-model="formValidate.shelf_life" placeholder="请输入成本价" v-width="'50%'" type="number" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="商品编码:" prop="">
+						<Input v-model="formValidate.code" placeholder="请输入商品编码" v-width="'50%'" />
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="仅会员可见:">
+						<i-switch v-model="formValidate.is_vip_product" :true-value="1" :false-value="0" size="large">
+							<span slot="open">开启</span>
+							<span slot="close">关闭</span>
+						</i-switch>
+						<div class="tips">开启后仅付费会员可以看见并购买此商品</div>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="是否限购:">
+						<i-switch v-model="formValidate.is_limit" :true-value="1" :false-value="0" size="large"
+							@on-change="limitTap">
+							<span slot="open">开启</span>
+							<span slot="close">关闭</span>
+						</i-switch>
+					</FormItem>
+					</Col>
+					<Col span="24" v-if="formValidate.is_limit">
+					<FormItem label="限购类型:">
+						<RadioGroup v-model="formValidate.limit_type">
+							<Radio :label="1">单次限购</Radio>
+							<Radio :label="2">长期限购</Radio>
+						</RadioGroup>
+						<div class="tips">
+							单次限购是限制每次下单最多购买的数量,长期限购是限制一个用户总共可以购买的数量
+						</div>
+					</FormItem>
+					</Col>
+					<Col span="24" v-if="formValidate.is_limit">
+					<FormItem label="限购数量:">
+						<InputNumber :min="1" v-model="formValidate.limit_num" placeholder="请输入限购数量"
+							class="perW20 maxW" />
+					</FormItem>
+					</Col>
+				</Row>
+			</Form>
+			<Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传商品图" :mask-closable="false"
+				:z-index="1">
+				<uploadPictures :isChoice="isChoice" @getPic="getPic" @getPicD="getPicD" :gridBtn="gridBtn"
+					:gridPic="gridPic" v-if="modalPic"></uploadPictures>
+			</Modal>
+			<menus-from :formValidate="formBrand" :fromName='1' ref="menusFrom" @reload="getBrandList"></menus-from>
+		</Card>
+		<Card :bordered="false" dis-hover class="fixed-card"
+			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
+			<Form>
+				<FormItem>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+	</div>
+</template>
+
+<script>
+	// import COS from 'cos-js-sdk-v5'
+	import {
+		mapState,
+		mapMutations
+	} from "vuex";
+	import Setting from "@/setting";
+	import util from "@/libs/util";
+	import vuedraggable from "vuedraggable";
+	import uploadPictures from "@/components/uploadPictures";
+	import freightTemplate from "@/components/freightTemplate";
+	import wangeditor from "@/components/wangEditor/index.vue";
+	import storeList from "@/components/storeList";
+	import menusFrom from "../../product/productBrand/components/menusFrom";
+	import userLabel from "@/components/labelList";
+	import storeLabelList from "@/components/storeLabelList";
+	import couponList from "@/components/couponList";
+	import goodsList from '@/components/goodsList/index';
+	// import addAttr from "../productAttr/addAttr";
+	// import attrList from "../components/attrList";
+	// import addCarMy from "../components/addCarMy";
+	// import taoBao from './taoBao'
+
+	import {
+		addProduct,
+		getGoodInfo
+	} from "@/api/erp"
+	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 {
+		erpGoods
+	} from '@/api/erp'
+	import {
+		systemFormInfo
+	} from '@/api/setting'
+	import {
+		getSupplierList
+	} from '@/api/supplier'
+	import {
+		erpConfig
+	} from "@/api/erp";
+	import {
+		uploadByPieces
+	} from "@/utils/upload"; //引入uploadByPieces方法
+	export default {
+		name: "addProduct",
+		components: {
+			storeList,
+			uploadPictures,
+			freightTemplate,
+			goodsList,
+			// addAttr,
+			couponList,
+			// taoBao,
+			userLabel,
+			menusFrom,
+			// attrList,
+			// addCarMy,
+			storeLabelList,
+			wangeditor,
+			draggable: vuedraggable,
+		},
+		data() {
+			return {
+				formTypeList: [],
+				storesList: [],
+				tableData: [],
+				storeModals: false,
+				roterPre: Setting.roterPre,
+				specsList: [],
+				supplierList: [],
+				productType: [{
+						name: "普通商品",
+						// title: "物流发货",
+						id: 0
+					},
+					{
+						name: "生鲜",
+						// title: "到店核销",
+						id: 5
+					},
+				],
+				virtualList: [],
+				carMyShow: false, //是否开启卡密弹窗
+				recommend: [], //商品推荐
+				customBtn: false, //自定义留言开关
+				attrShow: false,
+				content: "",
+				contents: "",
+				seletVideo: 0,
+				fileUrl: Setting.apiBaseURL + "/file/upload",
+				fileUrl2: Setting.apiBaseURL + "/file/video_upload",
+				baseURL: Setting.apiBaseURL.replace(/adminapi/, ''),
+				upload_type: "", //视频上传类型 1 本地上传 2 3 4 OSS上传
+				uploadData: {}, // 上传参数
+				header: {},
+				dataLabel: [],
+				storeDataLabel: [],
+				labelShow: false,
+				storeLabelShow: false,
+				props: {
+					emitPath: false,
+					multiple: true,
+					checkStrictly: true
+				},
+				type: 0,
+				goodsModals: false,
+				off_show: 0,
+				modals: false,
+				spinShow: false,
+				openSubimit: false,
+				grid2: {
+					xl: 10,
+					lg: 12,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				grid3: {
+					xl: 18,
+					lg: 18,
+					md: 20,
+					sm: 24,
+					xs: 24,
+				},
+				// 批量设置表格data
+				oneFormBatch: [{
+					attr: "全部",
+					pic: "",
+					price: 0,
+					settle_price: 0,
+					cost: 0,
+					ot_price: 0,
+					erp_product_id: 0,
+					unit: 0,
+					uint_to_erp_unit: 0,
+					// stock: 0,
+					bar_code: "",
+					code: "",
+					weight: 0,
+					volume: 0,
+				}, ],
+				// 规格数据
+				formDynamic: {
+					attrsName: "",
+					attrsVal: "",
+				},
+				formDynamicNameData: [],
+				gridPic: {
+					xl: 6,
+					lg: 8,
+					md: 12,
+					sm: 12,
+					xs: 12,
+				},
+				gridBtn: {
+					xl: 4,
+					lg: 8,
+					md: 8,
+					sm: 8,
+					xs: 8,
+				},
+				formValidate: {
+					product_type: 0,
+					cate_id: [],
+					store_name: '',
+					store_info: '',
+					keyword: '',
+					unit_name: '',
+					recommend_image: '',
+					slider_image: [],
+					sort: 0,
+					is_show: 0,
+					is_dicker: 1,
+					description: "",
+					brand_id: [],
+					bar_code: "",
+					is_vip_product: 0,
+					vip_price: "",
+					is_weigh: 0,
+					price: "",
+					cost: "",
+					unit_name: "",
+					unit_name_1: "",
+					unit_name_2: "",
+					unit_rate_1: "",
+					unit_rate_2: "",
+					shelf_life: "",
+					is_limit: 0, //是否限购
+					limit_type: 0, //限购类型
+					limit_num: 0, //限购数量
+				},
+				images: [],
+				imagesTable: "",
+				currentTab: "1",
+				isChoice: "",
+				grid: {
+					xl: 8,
+					lg: 8,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				loading: false,
+				modalPic: false,
+				template: false,
+				uploadList: [],
+				treeSelect: [],
+				labelSelect: [],
+				ensureData: [],
+				specsData: [],
+				picTit: "",
+				tableIndex: 0,
+				ruleValidate: {
+					store_name: [{
+						required: true,
+						message: "请输入商品名称",
+						trigger: "blur"
+					}, ],
+					keyword: [{
+						required: true,
+						message: "请输入商品关键字",
+						trigger: "blur"
+					}, ],
+					unit_name: [{
+						required: true,
+						message: "请输入单位",
+						trigger: "change",
+					}, ],
+					store_info: [{
+						required: true,
+						message: "请输入商品简介",
+						trigger: "blur"
+					}, ],
+					//image: [{ required: true, message: "请上传商品图", trigger: "change" }],
+					slider_image: [{
+						required: true,
+						message: "请上传商品轮播图",
+						type: "array",
+						trigger: "change",
+					}, ],
+					spec_type: [{
+						required: true,
+						message: "请选择商品规格",
+						trigger: "change"
+					}, ],
+					selectRule: [{
+						required: true,
+						message: "请选择商品规格属性",
+						trigger: "change"
+					}, ],
+					give_integral: [{
+						type: "integer",
+						message: "请输入整数"
+					}],
+					bar_code: [{
+						required: true,
+						message: "请选择输入条形码",
+					}],
+					price: [{
+						required: true,
+						message: "请选择输入条形码",
+					}],
+					vip_price: [{
+						required: true,
+						message: "请选择输入条形码",
+					}],
+					cost: [{
+						required: true,
+						message: "请选择输入条形码",
+					}],
+					// delivery_type:[
+					//   { required: true, type: 'array', min: 1, message: '请选择配送方式', trigger: 'change' },
+					// ]
+				},
+				manyBrokerage: 0,
+				manyBrokerageTwo: 0,
+				manyVipPrice: 0,
+				upload: {
+					videoIng: false, // 是否显示进度条;
+				},
+				videoIng: false, // 是否显示进度条;
+				progress: 0, // 进度条默认0
+				videoLink: "",
+				attrs: [],
+				activity: {
+					默认: "colorBlue",
+					秒杀: "colorBlue",
+					砍价: "colorBlue",
+					拼团: "colorBlue"
+				},
+				couponName: [],
+				updateIds: [],
+				updateName: [],
+				rakeBack: [{
+						title: "一级返佣",
+						slot: "brokerage",
+						align: "center",
+						width: 95,
+					},
+					{
+						title: "二级返佣",
+						slot: "brokerage_two",
+						align: "center",
+						width: 95,
+					},
+				],
+				member: [{
+					title: "会员价",
+					slot: "vip_price",
+					align: "center",
+					width: 95,
+				}, ],
+				headerCarMy: {
+					title: "卡密设置",
+					slot: "fictitious",
+					align: "center",
+					width: 95,
+				},
+				columnsInstalM: [],
+				moveIndex: "",
+				goodsData: [],
+				brandData: [],
+				unitNameList: [],
+				formBrand: {},
+				attrsList: [],
+				activeAtter: [],
+				tabIndex: 0,
+				tabName: "",
+				attrData: [],
+				datePickerOptions: {
+					disabledDate(date) {
+						return date && date.valueOf() < Date.now() - 86400000;
+					}
+				},
+				openErp: false,
+				merchantType: 0, //0:平台商品;1:门店商品;2:供应商商品
+				formList: [],
+				storeColumns: [{
+						title: "ID",
+						key: "id",
+						width: 60,
+					},
+					{
+						title: "门店图片",
+						slot: "image",
+						minWidth: 80,
+					},
+					{
+						title: "门店分类",
+						key: "cate_name",
+						minWidth: 80,
+					},
+					{
+						title: "门店名称",
+						key: "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",
+						width: 100,
+					}
+				],
+				// 仓库查询商品列表
+				warehouseList: [],
+				// 是否载入中
+				warehouseListLoding: false
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+			labelBottom() {
+				return this.isMobile ? undefined : 15;
+			},
+		},
+		created() {
+			// this.getSupplierList();
+			// this.columns = this.columns2.slice(1, 10);
+			// let data = JSON.parse(JSON.stringify(this.columns2));
+			// data.splice(8, 2, this.headerCarMy);
+			// this.columnsCarMy = data;
+			// let fictitious = JSON.parse(JSON.stringify(this.columns2));
+			// fictitious.splice(8, 2);
+			// this.columnsFictitious = fictitious;
+			this.getToken();
+			this.getErpConfig();
+			// this.columnsInstall = this.columns2.slice(0, 4).concat(this.columnsInstall);
+			// this.columnsInsta8 = this.columns2.slice(0, 4).concat(this.columnsInsta8);
+		},
+		watch: {
+			formValidate(n, o) {
+				console.log(n, 'new');
+			}
+		},
+		mounted() {
+
+			this.goodsCategory();
+			// this.productGetRule();
+			// this.productGetTemplate();
+			this.getBrandList();
+			this.getAllUnit();
+			// this.uploadType();
+			// this.getProductAllEnsure();
+			// this.getProductAllSpecs();
+			if (this.$route.query.id != 0) {
+				this.getGoodInfo(this.$route.query.id)
+			}
+		},
+		destroyed() {
+			this.setCopyrightShow({
+				value: true
+			});
+		},
+		methods: {
+			...mapMutations('admin/layout', [
+				'setCopyrightShow'
+			]),
+			getData() {
+				// this.$refs.menusFrom.modals = false
+				this.getBrandList()
+			},
+			getGoodInfo(id) {
+				getGoodInfo(id).then(res => {
+					let data = res.data
+					this.formValidate = {
+						product_type: data.product_type,
+						cate_id: data.cate_id ? (data.cate_id + '').split(','): [],
+						store_name: data.store_name,
+						store_info: data.store_info,
+						keyword: data.keyword,
+						unit_name: data.unit_name,
+						recommend_image: data.recommend_image,
+						slider_image: data.slider_image ? data.slider_image.split(',') : [],
+						sort: data.sort,
+						is_show: data.is_show,
+						is_dicker: data.is_dicker,
+						description: data.description,
+						brand_id: data.brand_id ? data.brand_id.split(','): [],
+						bar_code: data.bar_code,
+						is_vip_product: data.is_vip_product,
+						vip_price: data.vip_price,
+						is_weigh: data.is_weigh,
+						price: data.price,
+						cost: data.cost,
+						unit_name: data.unit_name,
+						unit_name_1: data.unit_name_1,
+						unit_name_2: data.unit_name_2,
+						unit_rate_1: data.unit_rate_1,
+						unit_rate_2: data.unit_rate_2,
+						shelf_life: data.shelf_life,
+						is_limit: data.is_limit, //是否限购
+						limit_type: data.limit_type, //限购类型
+						limit_num: data.limit_num, //限购数量
+					}
+					console.log(this.formValidate, 'formValidate');
+				})
+			},
+			changeForm(e) {
+				this.getSystemFormInfo(e, {
+					type: 1
+				});
+			},
+			getSystemFormInfo(e, data) {
+				systemFormInfo(e, data).then(res => {
+					this.formTypeList = res.data.info;
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			//删除门店
+			delte(index) {
+				this.storesList.splice(index, 1)
+			},
+			//添加门店
+			addStore() {
+				this.storeModals = true;
+			},
+			//关闭门店弹窗
+			cancelStore() {
+				this.storeModals = false;
+			},
+
+			limitTap(e) {
+				if (e) {
+					this.formValidate.limit_type = (this.formValidate.is_limit && !this.formValidate.limit_type) ? 1 : 0
+					this.formValidate.limit_num = (this.formValidate.is_limit && this.formValidate.limit_num == 0) ? 1 : 0
+				} else {
+					this.formValidate.limit_type = 0;
+					this.formValidate.limit_num = 0;
+				}
+			},
+			//erp配置
+			getErpConfig() {
+				erpConfig().then(res => {
+					this.openErp = res.data.open_erp;
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			delSpecs(index) {
+				this.specsList.splice(index, 1);
+			},
+			addSpecs() {
+				let obj = {
+					'name': '',
+					'value': '',
+					'sort': 0
+				}
+				this.specsList.push(obj)
+			},
+			specsInfo(e) {
+				this.specsData.forEach(item => {
+					if (item.id == e) {
+						this.specsList = item.specs
+					}
+				})
+			},
+			getProductAllSpecs() {
+				productAllSpecs().then(res => {
+					this.specsData = res.data
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			getProductAllEnsure() {
+				productAllEnsure().then(res => {
+					this.ensureData = res.data
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			seeVirtual(data, name, index) {
+				this.tabName = name;
+				this.tabIndex = index;
+				this.virtualListClear();
+				this.$refs.addCarMy.fixedCar = {
+					disk_info: '',
+					// stock: 0
+				}
+				if (data.virtual_list && data.virtual_list.length) {
+					this.$refs.addCarMy.cartMyType = 2;
+					this.virtualList = data.virtual_list;
+				} else if (data.disk_info) {
+					this.$refs.addCarMy.cartMyType = 1;
+					this.$refs.addCarMy.fixedCar.disk_info = data.disk_info;
+					// this.$refs.addCarMy.fixedCar.stock = data.stock;
+				}
+				this.carMyShow = true;
+			},
+			//动态添加组件
+			addAssembly() {
+				this.formValidate.custom_form.push({
+					title: "",
+					label: "text",
+					value: "",
+					status: 0,
+				});
+			},
+			customMessBtn(e) {
+				if (!e) {
+					this.formValidate.system_form_id = 0;
+				}
+			},
+			addcustom() {
+				if (this.formValidate.custom_form.length > 9) {
+					this.$Message.warning("最多添加10条");
+				} else {
+					this.addAssembly();
+				}
+			},
+			delcustom(index) {
+				this.formValidate.custom_form.splice(index, 1);
+			},
+			doCombination(arr) {
+				var count = arr.length - 1; //数组长度(从0开始)
+				var tmp = [];
+				var totalArr = []; // 总数组
+
+				return doCombinationCallback(arr, 0); //从第一个开始
+				//js 没有静态数据,为了避免和外部数据混淆,需要使用闭包的形式
+				function doCombinationCallback(arr, curr_index) {
+					for (let val of arr[curr_index]) {
+						tmp[curr_index] = val; //以curr_index为索引,加入数组
+						//当前循环下标小于数组总长度,则需要继续调用方法
+						if (curr_index < count) {
+							doCombinationCallback(arr, curr_index + 1); //继续调用
+						} else {
+							totalArr.push(tmp.join(',')); //(直接给push进去,push进去的不是值,而是值的地址)
+						}
+
+						//js  对象都是 地址引用(引用关系),每次都需要重新初始化,否则 totalArr的数据都会是最后一次的 tmp 数据;
+						let oldTmp = tmp;
+						tmp = [];
+						for (let index of oldTmp) {
+							tmp.push(index);
+						}
+					}
+					return totalArr;
+				}
+			},
+			goodsOn(e) {
+				if (e == 0 || e == 1) {
+					this.formValidate.auto_on_time = '';
+				}
+			},
+			goodsOff(e) {
+				if (!e) {
+					this.formValidate.auto_off_time = '';
+				}
+			},
+			addBrand() {
+				this.$refs.menusFrom.modals = true
+				this.$refs.menusFrom.titleFrom = "添加品牌分类"
+				this.formBrand = {
+					sort: 0,
+					is_show: 1
+				}
+				this.formBrand.fid = [0];
+				this.$refs.menusFrom.type = 1
+			},
+			getAllUnit() {
+				productAllUnit().then(res => {
+					this.unitNameList = res.data;
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			addClass() {
+				this.$modalForm(productCreateApi()).then(() => this.goodsCategory());
+			},
+			addUnit() {
+				this.$modalForm(productUnitCreate()).then(() => this.getAllUnit());
+			},
+			addStoreLabel() {
+				this.$modalForm(productLabelAdd()).then(() => {});
+			},
+			productTypeTap(num, item) {
+				if (num == 1) {
+					if (this.$route.params.id) return this.$Message.error('商品类型不能切换!');
+					this.formValidate.product_type = item.id;
+				}
+				if (this.formValidate.product_type && this.formValidate.product_type != 4) {
+					this.headTab = [{
+							title: "基础信息",
+							name: "1"
+						},
+						{
+							title: "规格库存",
+							name: "2"
+						},
+						{
+							title: "商品详情",
+							name: "3"
+						},
+						{
+							title: "营销设置",
+							name: "5"
+						},
+						{
+							title: "其他设置",
+							name: "6"
+						},
+					]
+					this.formValidate.postage = 0;
+					// this.formValidate.supplier_id = 0;
+				} else if (this.formValidate.product_type == 4) {
+					this.headTab = [{
+							title: "基础信息",
+							name: "1"
+						},
+						{
+							title: "规格库存",
+							name: "2"
+						},
+						{
+							title: "商品详情",
+							name: "3"
+						},
+						{
+							title: "营销设置",
+							name: "5"
+						},
+						{
+							title: "其他设置",
+							name: "6"
+						},
+						{
+							title: "适用门店",
+							name: "7"
+						},
+					]
+				} else {
+					this.headTab = [{
+							title: "基础信息",
+							name: "1"
+						},
+						{
+							title: "规格库存",
+							name: "2"
+						},
+						{
+							title: "商品详情",
+							name: "3"
+						},
+						{
+							title: "物流设置",
+							name: "4"
+						},
+						{
+							title: "营销设置",
+							name: "5"
+						},
+						{
+							title: "其他设置",
+							name: "6"
+						},
+						{
+							title: "适用门店",
+							name: "7"
+						},
+					]
+				}
+			},
+			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(row) {
+				this.labelShow = true;
+				this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
+			},
+			// 标签弹窗关闭
+			labelClose() {
+				this.labelShow = false;
+			},
+			closeStoreLabel(label) {
+				let index = this.storeDataLabel.indexOf(this.storeDataLabel.filter(d => d.id == label.id)[0]);
+				this.storeDataLabel.splice(index, 1);
+			},
+			activeStoreData(storeDataLabel) {
+				this.storeLabelShow = false;
+				this.storeDataLabel = storeDataLabel;
+			},
+			openStoreLabel(row) {
+				this.storeLabelShow = true;
+				this.$refs.storeLabel.storeLabel(JSON.parse(JSON.stringify(this.storeDataLabel)));
+			},
+			// 标签弹窗关闭
+			storeLabelClose() {
+				this.storeLabelShow = false;
+			},
+			// 品牌列表
+			getBrandList() {
+				brandList().then(res => {
+					//initBran()函数作用iview中规定value必须是字符串,后台返回成了数字,用于处理这个,给了个递归;
+					this.initBran(res.data);
+					this.brandData = res.data
+				}).catch(err => {
+					this.$Message.error(err.msg);
+				})
+			},
+			initBran(data) {
+				data.map(item => {
+					item.value = item.value.toString();
+					if (item.children && item.children.length) {
+						this.initBran(item.children);
+					}
+				})
+			},
+			getProductId(e) {
+				this.goodsModals = false;
+				let nArr = this.goodsData.concat(e).filter((element, index, self) => {
+					return self.findIndex(x => x.product_id == element.product_id) == index
+				})
+				this.goodsData = nArr.slice(0, 12);
+			},
+			goodCancel() {
+				this.goodsModals = false;
+			},
+			goodsTap() {
+				this.goodsModals = true;
+				this.$refs.goodslist.handleSelectAll();
+			},
+			bindDelete(index) {
+				this.goodsData.splice(index, 1)
+			},
+			cancel() {
+				this.$router.push({
+					path: this.roterPre + '/product/product_list'
+				});
+			},
+
+			videoSaveToUrl(file) {
+				let imgTypeArr = ["video/mp4"];
+				let imgType = imgTypeArr.indexOf(file.type) !== -1
+				if (!imgType) {
+					return this.$Message.warning({
+						content: '文件  ' + file.name + '  格式不正确, 请选择格式正确的视频',
+						duration: 5
+					});
+				}
+				uploadByPieces({
+					randoms: "", // 随机数,这里作为给后端处理分片的标识 根据项目看情况 是否要加
+					file: file, // 视频实体
+					pieceSize: 3, // 分片大小
+					success: (data) => {
+						this.formValidate.video_link = data.file_path;
+						this.progress = 100;
+					},
+					error: (e) => {
+						this.$Message.error(e.msg);
+					},
+					uploading: (chunk, allChunk) => {
+						this.videoIng = true;
+						let st = Math.floor((chunk / allChunk) * 100);
+						this.progress = st;
+					},
+				});
+				return false;
+			},
+
+			// 上传头部token
+			getToken() {
+				this.header["Authori-zation"] = "Bearer " + util.cookies.get("token");
+			},
+			// beforeUpload() {
+			//   this.uploadData = {};
+			//   let promise = new Promise((resolve) => {
+			//     this.$nextTick(function () {
+			//       resolve(true);
+			//     });
+			//   });
+			//   return promise;
+			// },
+			// 上传成功
+			handleSuccess(res, file, fileList) {
+				if (res.status === 200) {
+					this.formValidate.video_link = res.data.src;
+					this.$Message.success(res.msg);
+				} else {
+					this.$Message.error(res.msg);
+				}
+			},
+
+			getEditorContent(data) {
+				this.content = data;
+			},
+
+
+
+			checkMove(evt) {
+				this.moveIndex = evt.draggedContext.index;
+			},
+			end() {
+				this.moveIndex = "";
+			},
+			checkAllGroupChange(data) {
+				this.checkAllGroup(data);
+			},
+			checkAllGroup(data) {
+				if (this.formValidate.spec_type === 0) {
+					if (data.indexOf(0) > -1) {
+						this.columnsInstall = this.columns2.slice(1, 5).concat(this.member);
+					} else if (data.indexOf(1) > -1) {
+						this.columnsInstall = this.columns2.slice(1, 5).concat(this.rakeBack);
+					} else {
+						this.columnsInstall = this.columns2.slice(1, 5);
+					}
+					if (data.length === 2) {
+						this.columnsInstall = this.columns2
+							.slice(1, 5)
+							.concat(this.rakeBack)
+							.concat(this.member);
+					}
+				} else {
+					if (data.indexOf(0) > -1) {
+						this.columnsInstal2 = this.columnsInstalM
+							.slice(0, 4)
+							.concat(this.member);
+					} else if (data.indexOf(1) > -1) {
+						this.columnsInstal2 = this.columnsInstalM
+							.slice(0, 4)
+							.concat(this.rakeBack);
+					} else {
+						this.columnsInstal2 = this.columnsInstalM.slice(0, 4);
+					}
+					if (data.length === 2) {
+						this.columnsInstal2 = this.columnsInstalM
+							.slice(0, 4)
+							.concat(this.rakeBack)
+							.concat(this.member);
+					}
+				}
+			},
+			// 添加优惠券
+			addCoupon() {
+				this.$refs.couponTemplates.isTemplate = true;
+				this.$refs.couponTemplates.tableList();
+			},
+			//对象数组去重;
+			unique(arr) {
+				const res = new Map();
+				return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
+			},
+			nameId(id, names) {
+				this.formValidate.coupon_ids = id;
+				this.couponName = this.unique(names);
+			},
+			handleClose(name) {
+				let index = this.couponName.indexOf(name);
+				this.couponName.splice(index, 1);
+				let couponIds = this.formValidate.coupon_ids;
+				couponIds.splice(index, 1);
+				this.updateIds = couponIds;
+				this.updateName = this.couponName;
+			},
+			getStoreId(data) {
+				this.storeModals = false;
+				let list = this.storesList.concat(data);
+				let uni = this.unique(list);
+				this.storesList = uni;
+			},
+			// 运费模板
+			getList() {
+				this.productGetTemplate();
+			},
+			// 添加运费模板
+			addTemp() {
+				this.$refs.templates.isTemplate = true;
+			},
+			//查看、编辑运费模板
+			editTemp() {
+				this.$refs.templates.isTemplate = true;
+				this.$refs.templates.editFrom(this.formValidate.temp_id);
+			},
+			// 删除视频;
+			delVideo() {
+				let that = this;
+				that.$set(that.formValidate, "video_link", "");
+				that.$set(that, "progress", 0);
+				that.videoIng = false;
+				that.upload.videoIng = false;
+				that.$refs.refid.value = '';
+			},
+			zh_uploadFile() {
+				if (this.seletVideo == 1) {
+					if (this.videoLink && this.$getFileType(this.videoLink) == 'video') {
+						this.formValidate.video_link = this.videoLink;
+					} else {
+						return this.$Message.error("请输入正确的视频链接")
+					}
+				} else {
+					this.$refs.refid.click();
+				}
+			},
+			zh_uploadFile_change(evfile) {
+				let that = this;
+				let suffix = evfile.target.files[0].name.substr(
+					evfile.target.files[0].name.indexOf(".")
+				);
+				if (suffix.indexOf(".mp4") === -1) {
+					return that.$Message.error("只能上传MP4文件");
+				}
+				productGetTempKeysApi()
+					.then((res) => {
+						that.$videoCloud
+							.videoUpload({
+								type: res.data.type,
+								evfile: evfile,
+								res: res,
+								uploading(status, progress) {
+									that.upload.videoIng = status;
+									if (res.status == 200) {
+										that.progress = 100;
+									}
+								},
+							})
+							.then((res) => {
+								that.formValidate.video_link = res.url;
+								that.$Message.success("视频上传成功");
+								that.upload.videoIng = false;
+							})
+							.catch((res) => {
+								that.$Message.error(res);
+							});
+					})
+					.catch((res) => {
+						that.$Message.error(res.msg);
+					});
+			},
+			// 上一页;
+			upTab() {
+				if (this.currentTab == 5 && this.formValidate.product_type != 0) {
+					this.currentTab = (Number(this.currentTab) - 2).toString();
+				} else {
+					this.currentTab = (Number(this.currentTab) - 1).toString();
+				}
+			},
+			// 下一页;
+			downTab(name) {
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						if (this.formValidate.is_show == 2 && !this.formValidate.auto_on_time) {
+							return this.$Message.warning("请填写定时上架时间");
+						}
+						if (this.off_show == 1 && !this.formValidate.auto_off_time) {
+							return this.$Message.warning("请填写定时下架时间");
+						}
+						if (this.currentTab == 4 && !this.formValidate.delivery_type.length) {
+							return this.$Message.warning("请选择配送方式");
+						}
+						if (this.currentTab == 3 && this.formValidate.product_type != 0) {
+							this.currentTab = (Number(this.currentTab) + 2).toString();
+						} else {
+							this.currentTab = (Number(this.currentTab) + 1).toString();
+						}
+					} else {
+						this.$Message.warning("请完善数据");
+					}
+				})
+			},
+			// 属性弹窗回调函数;
+			userSearchs() {
+				this.productGetRule();
+			},
+			userSearchss(e) {
+				console.log(e);
+				this.formValidate.cate_id = e
+			},
+			// 添加规则;
+			addRule() {
+				this.$refs.addattr.modal = true;
+			},
+			// 批量设置分佣;
+			brokerageSetUp() {
+				let that = this;
+				if (that.formValidate.is_sub.indexOf(1) > -1) {
+					if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
+						return that.$Message.error("请填写返佣金额后进行批量添加");
+					}
+				} else if (that.formValidate.is_sub.indexOf(0) > -1) {
+					if (that.manyVipPrice <= 0) {
+						return that.$Message.error("请填写会员价后进行批量添加");
+					}
+				}
+				if (this.formValidate.is_sub.length === 2) {
+					if (
+						that.manyBrokerage <= 0 ||
+						that.manyBrokerageTwo <= 0 ||
+						that.manyVipPrice <= 0
+					) {
+						return that.$Message.error("请填写完金额后进行批量添加");
+					}
+				}
+				for (let val of that.manyFormValidate) {
+					this.$set(val, "brokerage", that.manyBrokerage);
+					this.$set(val, "brokerage_two", that.manyBrokerageTwo);
+					this.$set(val, "vip_price", that.manyVipPrice);
+				}
+				// let that = this;
+				// if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
+				//     return that.$Message.error('请填写返佣金额在进行批量添加');
+				// } else {
+				//     for (let val of that.manyFormValidate) {
+				//         this.$set(val, 'brokerage', that.manyBrokerage);
+				//         this.$set(val, 'brokerage_two', that.manyBrokerageTwo);
+				//     }
+				// }
+			},
+			// 批量设置会员价
+			vipPriceSetUp() {
+				let that = this;
+				if (that.manyVipPrice <= 0) {
+					return that.$Message.error("请填写会员价在进行批量添加");
+				} else {
+					for (let val of that.manyFormValidate) {
+						this.$set(val, "vip_price", that.manyVipPrice);
+					}
+				}
+			},
+			batchDel() {
+				this.oneFormBatch = [{
+					attr: "全部",
+					pic: "",
+					price: 0,
+					settle_price: 0,
+					cost: 0,
+					ot_price: 0,
+					erp_product_id: 0,
+					unit: '',
+					uint_to_erp_unit: 0,
+					// stock: 0,
+					bar_code: "",
+					code: "",
+					weight: 0,
+					volume: 0,
+					virtualList: [],
+					disk_info: ''
+				}, ];
+				this.activeAtter = [];
+				for (let val of this.manyFormValidate) {
+					val.select = true;
+				}
+			},
+			confirm() {
+				let that = this;
+				that.createBnt = true;
+				if (that.formValidate.selectRule.trim().length <= 0) {
+					return that.$Message.error("请选择属性");
+				}
+				that.ruleList.forEach(function(item, index) {
+					if (item.rule_name === that.formValidate.selectRule) {
+						that.attrs = item.rule_value;
+					}
+				});
+			},
+			// 获取商品属性模板;
+			productGetRule() {
+				productGetRuleApi().then((res) => {
+					this.ruleList = res.data;
+				});
+			},
+			// 获取运费模板;
+			productGetTemplate() {
+				let id = this.$route.params.id;
+				productGetTemplateApi({
+					id: id
+				}).then((res) => {
+					this.templateList = res.data;
+				});
+			},
+			// 删除表格中的属性
+			delAttrTable(index) {
+				let id = this.$route.params.id;
+				if (id) {
+					checkActivityApi(id)
+						.then((res) => {
+							this.manyFormValidate.splice(index, 1);
+							this.$Message.success(res.msg);
+						})
+						.catch((res) => {
+							this.$Message.error(res.msg);
+						});
+				} else {
+					this.manyFormValidate.splice(index, 1);
+				}
+			},
+			// 批量添加
+			batchAdd() {
+				for (let val of this.manyFormValidate) {
+					//this.manyEmpty(val);
+					if (val.select) {
+						if (this.oneFormBatch[0].pic) {
+							this.$set(val, "pic", this.oneFormBatch[0].pic);
+						}
+						if (this.oneFormBatch[0].price > 0) {
+							this.$set(val, "price", this.oneFormBatch[0].price);
+						}
+						if (this.oneFormBatch[0].settle_price > 0 && this.merchantType == 2) {
+							this.$set(val, "settle_price", this.oneFormBatch[0].settle_price);
+						}
+						if (this.oneFormBatch[0].cost > 0) {
+							this.$set(val, "cost", this.oneFormBatch[0].cost);
+						}
+						if (this.oneFormBatch[0].ot_price > 0) {
+							this.$set(val, "ot_price", this.oneFormBatch[0].ot_price);
+						}
+						if (this.oneFormBatch[0].erp_product_id > 0) {
+							this.$set(val, "erp_product_id", this.oneFormBatch[0].erp_product_id);
+						}
+						if (this.oneFormBatch[0].unit) {
+							this.$set(val, "unit", this.oneFormBatch[0].unit);
+						}
+						if (this.oneFormBatch[0].uint_to_erp_unit > 0) {
+							this.$set(val, "uint_to_erp_unit", this.oneFormBatch[0].uint_to_erp_unit);
+						}
+						// if (this.oneFormBatch[0].stock > 0) {
+						// 	this.$set(val, "stock", this.oneFormBatch[0].stock);
+						// }
+						if (this.oneFormBatch[0].bar_code !== "") {
+							this.$set(val, "bar_code", this.oneFormBatch[0].bar_code);
+						}
+						if (this.oneFormBatch[0].code !== "") {
+							this.$set(val, "code", this.oneFormBatch[0].code);
+						}
+						if (this.oneFormBatch[0].weight > 0) {
+							this.$set(val, "weight", this.oneFormBatch[0].weight);
+						}
+						if (this.oneFormBatch[0].volume > 0) {
+							this.$set(val, "volume", this.oneFormBatch[0].volume);
+						}
+						if (this.formValidate.product_type == 1) {
+							if (this.oneFormBatch[0].virtual_list && this.oneFormBatch[0].virtual_list.length) {
+								this.$set(val, "virtual_list", this.oneFormBatch[0].virtual_list);
+							} else if (this.oneFormBatch[0].disk_info) {
+								this.$refs.addCarMy.cartMyType = 1;
+								this.$set(val, "disk_info", this.oneFormBatch[0].disk_info);
+							}
+						}
+					}
+				}
+			},
+			// 添加按钮
+			addBtn() {
+				let id = this.$route.params.id;
+				checkActivityApi(id)
+					.then((res) => {
+						this.clearAttr();
+						this.createBnt = false;
+						this.showIput = true;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			addmanyData(data, type) {
+				if (type == 1) {
+					this.oneFormBatch[0].pic = this.formValidate.image
+					data.forEach(item => {
+						item.select = true,
+							item.pic = this.formValidate.image
+					})
+				} else {
+					data.forEach(item => {
+						item.select = true
+					})
+				}
+				this.manyFormValidate = data;
+			},
+			// 立即生成
+			generate(type) {
+				generateAttrApi({
+						attrs: this.attrs,
+						product_type: this.formValidate.product_type
+					}, this.formValidate.id, type)
+					.then((res) => {
+						let info = res.data.info,
+							header1 = JSON.parse(JSON.stringify(info.header));
+						if ((this.$route.params.id !== "0" && this.type != -1) || type == 1) {
+							this.addmanyData(info.value, type);
+						}
+						this.formValidate.header = header1;
+						this.attrData = res.data.info.attr;
+						let header = info.header;
+						header.pop();
+						this.columnsInstalM = info.header;
+						this.checkAllGroup(this.formValidate.is_sub);
+						if (!this.$route.params.id && this.formValidate.spec_type === 1 && this.type != -1) {
+							this.manyFormValidate.map((item) => {
+								item.pic = this.formValidate.slider_image[0];
+							});
+							this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
+						} else if (this.$route.params.id) {
+							this.manyFormValidate.map((item) => {
+								if (!item.pic) {
+									item.pic = this.formValidate.slider_image[0];
+								}
+							});
+							this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
+						}
+						this.getAttr();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 取消
+			offAttrName() {
+				this.showIput = false;
+				this.createBnt = true;
+			},
+			clearAttr() {
+				this.formDynamic.attrsName = "";
+				this.formDynamic.attrsVal = "";
+			},
+			// 添加规则名称
+			createAttrName() {
+				if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
+					let data = {
+						value: this.formDynamic.attrsName,
+						detail: [this.formDynamic.attrsVal],
+					};
+					this.attrs.push(data);
+					var hash = {};
+					this.attrs = this.attrs.reduce(function(item, next) {
+						/* eslint-disable */
+						hash[next.value] ? "" : (hash[next.value] = true && item.push(next));
+						return item;
+					}, []);
+					this.clearAttr();
+					this.showIput = false;
+					this.createBnt = true;
+				} else {
+					this.$Message.warning("请添加完整的规格!");
+				}
+			},
+			// 添加属性
+			createAttr(num, idx) {
+				if (num) {
+					this.attrs[idx].detail.push(num);
+					var hash = {};
+					this.attrs[idx].detail = this.attrs[idx].detail.reduce(function(
+							item,
+							next
+						) {
+							/* eslint-disable */
+							hash[next] ? "" : (hash[next] = true && item.push(next));
+							return item;
+						},
+						[]);
+				} else {
+					this.$Message.warning("请添加属性");
+				}
+			},
+			// 商品分类;
+			goodsCategory() {
+				cascaderListApi(1)
+					.then((res) => {
+						this.treeSelect = res.data;
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			//视视上传类型
+			changeVideo(e) {
+				this.formValidate.video_link = "";
+				this.videoLink = "";
+			},
+			// 改变规格
+			changeSpec() {
+				this.formValidate.is_sub = [];
+				let id = this.$route.params.id;
+				if (id) {
+					checkActivityApi(id)
+						.then((res) => {})
+						.catch((res) => {
+							this.formValidate.spec_type = this.spec_type;
+							this.$Message.error(res.msg);
+						});
+				}
+			},
+			// 详情
+			getInfo() {
+				let that = this;
+				that.spinShow = true;
+				productInfoApi(that.$route.params.id || this.$route.query.copy)
+					.then(async (res) => {
+						let data = res.data.productInfo;
+						this.merchantType = parseInt(data.type);
+						if (this.merchantType == 2) {
+							let obj = {
+								title: "结算价",
+								slot: "settle_price",
+								align: "center",
+								minWidth: 95,
+							}
+							this.columns2.splice(3, 0, obj)
+						}
+						this.infoData(data);
+						this.spinShow = false;
+					})
+					.catch((res) => {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			// tab切换
+			onhangeTab(name) {
+				this.currentTab = name;
+			},
+			handleRemove(i) {
+				this.images.splice(i, 1);
+				this.formValidate.slider_image.splice(i, 1);
+				this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
+			},
+			// 关闭图片上传模态框
+			changeCancel(msg) {
+				this.modalPic = false;
+			},
+			// 点击商品图
+			modalPicTap(tit, picTit, index) {
+				this.modalPic = true;
+				this.isChoice = tit === "dan" ? "单选" : "多选";
+				this.picTit = picTit;
+				this.tableIndex = index;
+			},
+			// 获取单张图片信息
+			getPic(pc) {
+				switch (this.picTit) {
+					case "danFrom":
+						this.formValidate.image = pc.att_dir;
+						if (!this.$route.params.id) {
+							if (this.formValidate.spec_type === 0) {
+								this.oneFormValidate[0].pic = pc.att_dir;
+							} else {
+								this.manyFormValidate.map((item) => {
+									item.pic = pc.att_dir;
+								});
+								this.oneFormBatch[0].pic = pc.att_dir;
+							}
+						}
+						break;
+					case "danTable":
+						this.oneFormValidate[this.tableIndex].pic = pc.att_dir;
+						break;
+					case "duopi":
+						this.oneFormBatch[this.tableIndex].pic = pc.att_dir;
+						break;
+					case "recommend_image":
+						this.formValidate.recommend_image = pc.att_dir;
+						break;
+					case "video":
+						this.formValidate.video_link = pc.att_dir;
+						break;
+					default:
+						this.manyFormValidate[this.tableIndex].pic = pc.att_dir;
+				}
+				this.modalPic = false;
+			},
+			// 获取多张图信息
+			getPicD(pc) {
+				this.images = pc;
+				this.images.map((item) => {
+					this.formValidate.slider_image.push(item.att_dir);
+					this.formValidate.slider_image = this.formValidate.slider_image.splice(
+						0,
+						10
+					);
+				});
+				// this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
+				this.modalPic = false;
+			},
+			// 提交
+			handleSubmit(name) {
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						if (!this.formValidate.store_name.trim()) {
+							return this.$Message.warning("商品名称不能为空");
+						}
+						this.formValidate.id = this.$route.query.id
+						console.log(this.formValidate);
+						let pdata = JSON.parse(JSON.stringify(this.formValidate))
+						try{
+							pdata.cate_id = this.formValidate.cate_id.join(',')
+							pdata.brand_id = this.formValidate.brand_id.length > 0 ? this.formValidate.brand_id.join(','): ""
+							pdata.slider_image = this.formValidate.slider_image.join(',')
+						}catch(e){
+							//TODO handle the exception
+							console.log(e,'err');
+						}
+						
+						console.log('formValidate', pdata);
+						addProduct(pdata.id, pdata)
+							.then(async (res) => {
+								this.openSubimit = true;
+								this.$Message.success(res.msg);
+								setTimeout(() => {
+									this.$router.push({
+										path: this.roterPre + "/erp/product"
+									});
+								}, 500);
+							})
+							.catch((res) => {
+								this.openSubimit = false;
+								this.$Message.error(res.msg);
+							});
+					} else {
+						// if (!this.formValidate.store_name) {
+						// 	return this.$Message.warning("基础信息-商品名称不能为空");
+						// } else if (!this.formValidate.cate_id.length) {
+						// 	return this.$Message.warning("基础信息-商品分类不能为空");
+						// } else if (!this.formValidate.unit_name) {
+						// 	return this.$Message.warning("基础信息-商品单位不能为空");
+						// } else if (!this.formValidate.slider_image.length) {
+						// 	return this.$Message.warning("基础信息-商品轮播图不能为空");
+						// }
+						//    if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
+						//    || !this.formValidate.unit_name || !this.formValidate.store_info
+						//        || !this.formValidate.image || !this.formValidate.slider_image){
+						//        this.$Message.warning("请填写完整商品信息!");
+						//    }
+					}
+				});
+			},
+			changeTemplate(msg) {
+				this.template = msg;
+			},
+			// 表单验证
+			validate(prop, status, error) {
+				if (status === false) {
+					this.$Message.warning(error);
+				}
+			},
+			// 移动
+			handleDragStart(e, item) {
+				this.dragging = item;
+			},
+			handleDragEnd(e, item) {
+				this.dragging = null;
+			},
+			handleDragOver(e) {
+				e.dataTransfer.dropEffect = "move";
+			},
+			handleDragEnter(e, item) {
+				e.dataTransfer.effectAllowed = "move";
+				if (item === this.dragging) {
+					return;
+				}
+				const newItems = [...this.formValidate.slider_image];
+				const src = newItems.indexOf(this.dragging);
+				const dst = newItems.indexOf(item);
+				newItems.splice(dst, 0, ...newItems.splice(src, 1));
+				this.formValidate.slider_image = newItems;
+			},
+
+
+		},
+	};
+</script>
+<style scoped lang="stylus">
+	.storeTable img {
+		width 36px;
+		height 36px;
+	}
+
+	.storeTable /deep/.ivu-table-wrapper {
+		border: 0 !important
+	}
+
+	.radioGroup .ivu-radio-wrapper {
+		margin-right 20px;
+	}
+
+	.video-style {
+		width: 100%;
+		height: 100% !important;
+		border-radius: 10px;
+	}
+
+	.select-add {
+		width: 200px;
+		margin-left: 6px;
+		margin-right: 10px
+	}
+
+	.input-display {
+		display: none
+	}
+
+	.width-add {
+		width: 200px;
+	}
+
+	.custom-input {
+		width: 100px;
+		margin-right: 10px
+	}
+
+	.asterisk {
+		position relative;
+
+		.asteriskInfo {
+			position absolute;
+			color #ed4014;
+			left 73px;
+			top 8px;
+
+			&.on {
+				left: 62px;
+			}
+
+			&.on2 {
+				left: 50px;
+			}
+		}
+	}
+
+	.specsList {
+		/deep/.ivu-table-header table {
+			border: 0 !important
+		}
+
+		/deep/.ivu-table-header thead tr th {
+			padding 0 !important background-color #EEEEEE !important;
+		}
+
+		/deep/.ivu-table-cell {
+			padding 0 !important
+		}
+
+		/deep/.ivu-table-border th,
+		/deep/.ivu-table-border td {
+			border-right unset;
+		}
+
+		/deep/.ivu-table td {
+			height 59px;
+		}
+
+		&.on {
+			width 50% !important;
+
+			/deep/.ivu-table {
+				width 100% !important;
+			}
+
+			/deep/.ivu-table td {
+				height 40px;
+				padding 0 !important;
+			}
+
+			/deep/.ivu-table-cell {
+				padding 0 16px !important;
+			}
+		}
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 45;
+			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;
+			}
+		}
+	}
+
+	.seeCatMy {
+		color: #2d8cf0;
+		cursor: pointer;
+	}
+
+	.addCustom_content {
+		margin-top: 20px;
+
+		.custom_box {
+			margin-bottom: 10px;
+		}
+
+		.addfont {
+			display: inline-block;
+			font-size: 13px;
+			font-weight: 400;
+			color: #1890FF;
+			cursor: pointer;
+		}
+	}
+
+	.addCustomBox {
+		margin-top: 12px;
+		font-size: 13px;
+		font-weight: 400;
+		color: #1890FF;
+
+		.btn {
+			cursor: pointer;
+			width: max-content;
+		}
+	}
+
+	.checkAlls /deep/.ivu-checkbox-inner {
+		width 14px;
+		height 14px;
+	}
+
+	.checkAlls /deep/.ivu-checkbox-wrapper {
+		font-size 12px;
+	}
+
+	.lines {
+		border-bottom: 1px dashed #eee;
+		margin-bottom: 20px;
+	}
+
+	.iosfont {
+		font-size 20px !important;
+	}
+
+	.selectOn {
+		color #2d8cf0;
+	}
+
+	.ifam {
+		width: 344px;
+		height: 644px;
+		background: url('../../../assets/images/phonebg.png') no-repeat center top;
+		background-size: 344px 644px;
+		padding: 40px 20px;
+		padding-top: 50px;
+		margin: 0 auto 0 20px;
+
+		.content {
+			height: 560px;
+			overflow: hidden;
+			scrollbar-width: none;
+			/* firefox */
+			-ms-overflow-style: none;
+			/* IE 10+ */
+			overflow-x: hidden;
+			overflow-y: auto;
+		}
+
+		.content::-webkit-scrollbar {
+			display: none;
+			/* Chrome Safari */
+		}
+	}
+
+	.offShow {
+		position absolute
+	}
+
+	.goodsShow /deep/.ivu-radio-group-vertical .ivu-radio-wrapper {
+		height 35px;
+		line-height 35px;
+	}
+
+	.videbox {
+		width: 60px;
+		height: 60px;
+		background: rgba(0, 0, 0, 0.02);
+		border-radius: 4px;
+		border: 1px dashed #DDDDDD;
+		line-height: 50px;
+		text-align: center;
+		color: #898989;
+		font-size: 30px;
+		font-weight: 400;
+		cursor: pointer;
+	}
+
+	.brandName {
+		/deep/.ivu-cascader {
+			display inline-block
+		}
+	}
+
+	.formValidate {
+		.addClass {
+			color: #1890FF;
+			margin-left 14px;
+			padding 9px 0;
+			cursor pointer;
+		}
+	}
+
+	.productType {
+		width: 120px;
+		height: 45px;
+		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);
+		}
+
+		.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;
+		}
+
+	}
+
+	.labelInput {
+		border: 1px solid #dcdee2;
+		width 50%;
+		padding 0 5px;
+		border-radius 5px;
+		min-height 30px;
+		cursor pointer;
+
+		.span {
+			color: #c5c8ce;
+		}
+
+		.iconxiayi {
+			font-size 12px
+		}
+	}
+
+	.labelClass {
+		/deep/.ivu-form-item-content {
+			line-height unset;
+		}
+	}
+
+	.ivu-checkbox-wrapper {
+		margin-right 19px;
+	}
+
+	.list-group {
+		margin-left: -8px;
+	}
+
+	.borderStyle {
+		border: 1px solid #ccc;
+		padding: 8px;
+		border-radius: 4px;
+	}
+
+	.drag {
+		cursor: move;
+	}
+
+	.move-icon {
+		width: 30px;
+		cursor: move;
+		margin-right: 10px;
+	}
+
+	.move-icon .icondrag2 {
+		font-size: 26px;
+		color: #d8d8d8;
+	}
+
+	.maxW /deep/.ivu-select-dropdown {
+		max-width: 600px;
+	}
+
+	#shopp-manager .ivu-table-wrapper {
+		border-left: 1px solid #dcdee2;
+		border-top: 1px solid #dcdee2;
+	}
+
+	.noLeft {
+		>>>.ivu-form-item-content {
+			margin-left: 0 !important;
+		}
+	}
+
+	.tips {
+		display: inline-bolck;
+		font-size: 12px;
+		font-weight: 400;
+		color: #999999;
+		margin-top: 6px;
+	}
+
+	.iview-video-style {
+		width: 40%;
+		height: 180px;
+		border-radius: 10px;
+		background-color: #707070;
+		margin-top: 10px;
+		position: relative;
+		overflow: hidden;
+	}
+
+	.iview-video-style .iconv {
+		color: #fff;
+		line-height: 180px;
+		width: 50px;
+		height: 50px;
+		display: inherit;
+		font-size: 26px;
+		position: absolute;
+		top: -74px;
+		left: 50%;
+		margin-left: -25px;
+	}
+
+	.iview-video-style .mark {
+		position: absolute;
+		width: 100%;
+		height: 30px;
+		top: 0;
+		background-color: rgba(0, 0, 0, 0.5);
+		text-align: center;
+	}
+
+	.uploadVideo {
+		margin-left: 10px;
+	}
+
+	.submission {
+		margin-left: 10px;
+	}
+
+	.form-submit .fixed-card .ivu-btn {
+		height: 32px;
+	}
+
+	.color-list .tip {
+		color: #c9c9c9;
+	}
+
+	.color-list .color-item {
+		width 70px;
+		height: 28px;
+		line-height: 28px;
+		color: #fff;
+		margin-right: 10px;
+		border-radius 2px;
+
+		text-align center .num {
+			color #1890FF;
+			width 14px;
+			height 14px;
+			text-align center;
+			line-height 14px;
+			border-radius 50%;
+			background-color #fff;
+			margin-right 6px;
+		}
+	}
+
+	.color-list .color-item.blue {
+		background-color: #1E9FFF;
+	}
+
+	.color-list .color-item.yellow {
+		background-color: rgb(254, 185, 0);
+	}
+
+	.color-list .color-item.green {
+		background-color: #009688;
+	}
+
+	.color-list .color-item.red {
+		background-color: #ed4014;
+	}
+
+	.color-list .color-item.colorBlue {
+		background: linear-gradient(270deg, #5ECFFF 0%, #0084FF 100%);
+	}
+
+	.columnsBox {
+		margin-right: 10px;
+	}
+
+	.priceBox {
+		width: 100%;
+	}
+
+	.rulesBox {
+		display: flex;
+		flex-wrap: wrap;
+	}
+
+	.pictrueBox {
+		display: inline-block;
+	}
+
+	.pictrueTab {
+		width: 40px !important;
+		height: 40px !important;
+	}
+
+	.pictrue {
+		width: 60px;
+		height: 60px;
+		border: 1px dotted rgba(0, 0, 0, 0.1);
+		margin-right: 15px;
+		margin-bottom 10px;
+		display: inline-block;
+		position: relative;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+
+		.btndel {
+			position: absolute;
+			z-index: 1;
+			width: 20px !important;
+			height: 20px !important;
+			left: 46px;
+			top: -4px;
+		}
+	}
+
+	.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);
+		cursor: pointer;
+	}
+
+	.curs {
+		cursor: pointer;
+	}
+
+	.inpWith {
+		width: 60%;
+	}
+
+	.labeltop {
+		>>>.ivu-form-item-label {
+			float: none !important;
+			display: inline-block !important;
+			margin-left: 120px !important;
+			width: auto !important;
+		}
+
+		.icondrop-down {
+			font-size: 12px;
+			margin-left: 5px;
+		}
+	}
+
+	.video-icon {
+		background-image: url('https://cdn.oss.9gt.net/prov1.1/1/icons.png'); // cdn.oss.9gt.net/prov1.1/1/icons.png);
+		// background-color: #fff;
+		background-position: -9999px;
+		background-repeat: no-repeat;
+	}
+
+	.progress {
+		margin-top: 10px;
+	}
+
+	.new_tab {
+		>>>.ivu-tabs-nav .ivu-tabs-tab {
+			padding: 4px 16px 20px !important;
+			font-weight: 500;
+		}
+	}
+</style>
+<!-- product_type', 0],//商品类型
+    cate_id', []],
+    store_name', ''],
+    store_info', ''],
+    keyword', ''],
+    unit_name', '件'],
+    recommend_image', ''],
+    slider_image', []],
+    sort', 0],
+    is_show', 0],
+    is_dicker', 1],
+    description', ''],
+    brand_id', []],
+    bar_code', ''],
+    is_vip_product', 0],//是否付费会员商品
+    vip_price', 0],
+    is_weigh', 0],//是否称重
+    price', 0],
+    cost', 0],
+    unit_name', ''],
+    unit_name_1', ''],
+    unit_name_2', ''],
+    unit_rate_1', 1],
+    unit_rate_2', 10],
+    shelf_life', -1],
+    is_limit', 0],//是否限购
+    limit_type', 0],//限购类型
+    limit_num', 0],//限购数量 -->

+ 236 - 0
src/pages/erp/product/components/addCarMy.vue

@@ -0,0 +1,236 @@
+<template>
+    <div class="carMywrapper">
+		<div class="type-radio">
+		  <Form :label-width="80">
+		    <FormItem label="卡密类型:">
+		      <RadioGroup v-model="cartMyType" size="large">
+		        <Radio :label="1">固定卡密</Radio>
+		        <Radio :label="2">一次性卡密</Radio>
+		      </RadioGroup>
+		      <div v-if="cartMyType == 1">
+				  <div class="stock-disk">
+					  <Input
+					    v-model="fixedCar.disk_info"
+					    size="large"
+					    type="textarea"
+					    :rows="4"
+					    placeholder="填写卡密信息"
+					  />
+				  </div>
+				  <div class="stock-input">
+					  <Input
+					    type="number"
+					    v-model="fixedCar.stock"
+					    size="large"
+					    placeholder="填写库存数量"
+					  >
+					    <span slot="append">件</span>
+					  </Input>
+				  </div>
+		      </div>
+		      <div class="scroll-virtual" v-if="cartMyType == 2">
+		        <div
+		          class="acea-row row-middle mb10"
+		          v-for="(item, index) in virtualList"
+		          :key="index"
+		        >
+		          <span class="mr10 virtual-title">卡号{{ index + 1 }}:</span>
+		          <Input
+		            class="mr10 width15"
+		            type="text"
+		            v-model.trim="item.key"
+		            placeholder="请输入卡号(非必填)"
+		          ></Input>
+		          <span class="mr10 virtual-title">卡密{{ index + 1 }}:</span>
+		          <Input
+		            class="mr10 width15"
+		            type="text"
+		            v-model.trim="item.value"
+		            placeholder="请输入卡密"
+		          ></Input>
+		          <span class="deteal-btn" @click="removeVirtual(index)"
+		            >删除</span
+		          >
+		        </div>
+		      </div>
+		      <div class="add-more" v-if="cartMyType == 2">
+		        <Button type="primary" @click="handleAdd"
+		          >添加卡密</Button
+		        >
+		        <Upload
+				  ref="upload"
+		          class="ml10"
+		          :action="cardUrl"
+		          :before-upload="beforeUpload"
+		          :headers="header"
+		          :on-success="upFile"
+				  :format="['xlsx']"
+				  :on-format-error="handleFormatError"
+		        >
+		          <Button type="success">导入卡密</Button>
+		        </Upload>
+				<Button class="download" type="default" icon="ios-download-outline" @click="getCarMyList">下载卡密模板</Button>
+		      </div>
+		    </FormItem>
+		  </Form>
+		</div>
+        <div class="footer">
+			<Button type="primary" class="btns" ghost @click="cancel">取消</Button>
+            <Button type="primary" class="btns" @click="subBtn">确定</Button>
+        </div>
+    </div>
+</template>
+<script>
+	import Setting from "@/setting";
+	import util from "@/libs/util";
+	import exportExcel from "@/utils/newToExcel.js";
+	import {
+	  importCard,
+	  exportProductCard
+	} from "@/api/product";
+    export default {
+        name: "addCarMy",
+        props:{
+			virtualList: {
+			  type: Array,
+			  default: function () {
+			    return [];
+			  }
+			}
+        },
+        data(){
+            return {
+				cartMyType:1,
+				fixedCar:{
+					disk_info:'',
+					stock:0
+				},
+				cardUrl: Setting.apiBaseURL + "/file/upload/1",
+				header: {} //请求头部信息
+            }
+        },
+		created() {
+		    this.getToken();
+		},
+        mounted() {
+        },
+        methods:{
+			// 下载卡密
+			async getCarMyList() {
+			  let [th, filekey, data, fileName] = [[], [], [], ""];
+			  let lebData = await this.getExcelData();
+			  if (!fileName) fileName = lebData.filename;
+			  if (!filekey.length) {
+			    filekey = lebData.filekey;
+			  }
+			  if (!th.length) th = lebData.header;
+			  data = lebData.export;
+			  exportExcel(th, filekey, fileName, data);
+			},
+			getExcelData() {
+			  return new Promise((resolve, reject) => {
+			    exportProductCard().then((res) => {
+			      return resolve(res.data);
+			    });
+			  });
+			},
+			removeVirtual(index) {
+			  this.virtualList.splice(index, 1);
+			},
+			upFile(res) {
+			  importCard({ file: res.data.src }).then((res) => {
+				this.$emit('changeVirtual',JSON.parse(JSON.stringify(res.data))) 
+			   //this.$refs.upload.clearFiles();	
+			  }).catch(err=>{
+				  return this.$Message.error(err.msg);
+			  })
+			},
+			handleFormatError(file){
+				return this.$Message.error('必须上传xlsx格式文件');
+			},
+			// 上传头部token
+			getToken() {
+			  this.header["Authori-zation"] = "Bearer " + util.cookies.get("token");
+			},
+			cancel(){
+				this.$emit('closeCarMy')
+			},
+			handleAdd() {
+			  this.virtualList.push({
+			    key: "",
+			    value: "",
+			  });
+			},
+			beforeUpload() {
+			  let promise = new Promise((resolve) => {
+			    this.$nextTick(function () {
+			      resolve(true);
+			    });
+			  });
+			  return promise;
+			},
+			subBtn(){
+				if(this.cartMyType==1){
+					this.fixedCar.cartMyType = 1;
+					if(this.fixedCar.disk_info == ''){
+						return this.$Message.error("请填写卡密信息");
+					}
+					if(!this.fixedCar.stock){
+						return this.$Message.error("请填写库存数量");
+					}
+					this.$emit('fixdBtn',JSON.parse(JSON.stringify(this.fixedCar)))
+				}else{
+					let data = {
+						cartMyType:2,
+						virtualList:this.virtualList
+					}
+					for (let i = 0; i < this.virtualList.length; i++) {
+					  const element = this.virtualList[i];
+					  if (!element.value) {
+					    return this.$Message.error("请输入所有卡密");
+					  }
+					}
+					this.$emit('fixdBtn',JSON.parse(JSON.stringify(data)))
+				}
+			}
+        }
+    }
+</script>
+
+<style lang="stylus" scoped>
+	.carMywrapper{
+		.download{
+			position absolute;
+			top:2px;
+			left:180px;
+		}
+		.stock-disk{
+			margin 10px 0 15px 0;
+		}
+		.scroll-virtual {
+		  max-height: 320px;
+		  overflow-y: auto;
+		  margin-top: 10px;
+		}
+		.virtual-title {
+		  width: 50px;
+		}
+		.deteal-btn {
+		  color: #5179ea;
+		  cursor pointer;
+		}
+		.add-more {
+		  margin-top: 20px;
+		  display: flex;
+		  position relative;
+		}
+		.footer{
+				 display flex
+				 justify-content flex-end
+				 margin-top 40px
+				 button{
+					  margin-left 10px
+				 }
+		}
+	}
+</style>

+ 258 - 0
src/pages/erp/product/components/addReply.vue

@@ -0,0 +1,258 @@
+<template>
+  <Modal
+    :value="visible"
+    :z-index="2"
+    title="添加自评"
+    width="700"
+    @on-ok="onOk"
+    @on-cancel="onCancel"
+  >
+    <Form :model="formData" :label-width="125">
+      <FormItem label="商品" required>
+        <div class="upload-box" @click="callGoods">
+          <img v-if="goods.id" :src="goods.image" class="image" />
+          <Icon v-else type="ios-add" />
+        </div>
+      </FormItem>
+      <FormItem v-if="goods.id" label="商品规格" required>
+        <div class="upload-box" @click="callAttr">
+          <img v-if="attr.unique" :src="attr.image" class="image" />
+          <Icon v-else type="ios-add" />
+        </div>
+      </FormItem>
+      <FormItem label="用户头像" required>
+        <div class="upload-box" @click="callPicture('单选')">
+          <img v-if="avatar.att_dir" :src="avatar.att_dir" class="image" />
+          <Button
+            v-if="avatar.att_dir"
+            shape="circle"
+            icon="md-close"
+            class="btn"
+            @click.stop="removeUser"
+          ></Button>
+          <Icon v-else type="ios-add" />
+        </div>
+      </FormItem>
+      <FormItem label="用户名称" required>
+        <Input v-model="formData.nickname" placeholder="请输入用户名称"></Input>
+      </FormItem>
+      <FormItem label="评价文字" required>
+        <Input
+          v-model="formData.comment"
+          type="textarea"
+          :autosize="{ minRows: 2 }"
+          placeholder="请输入评价文字"
+        ></Input>
+      </FormItem>
+      <FormItem label="商品分数" required>
+        <Rate v-model="product_score" />
+      </FormItem>
+      <FormItem label="服务分数" required>
+        <Rate v-model="service_score" />
+      </FormItem>
+      <FormItem label="评价图片">
+        <div v-for="item in picture" :key="item.att_id" class="upload-box">
+          <img :src="item.att_dir" class="image" />
+          <Button
+            shape="circle"
+            icon="md-close"
+            class="btn"
+            @click="removePicture(item.att_id)"
+          ></Button>
+        </div>
+        <div
+          v-if="picture.length < 8"
+          class="upload-box"
+          @click="callPicture('多选')"
+        >
+          <Icon type="ios-add" />
+        </div>
+      </FormItem>
+      <FormItem label="评价时间">
+        <DatePicker
+          :value="add_time"
+          type="datetime"
+          placeholder="请选择评论时间(不选择默认当前添加时间)"
+          style="width: 200px"
+          @on-change="onChange"
+        />
+      </FormItem>
+    </Form>
+    <template slot="footer">
+      <Button @click="onCancel">取消</Button>
+      <Button type="primary" @click="onOk">确定</Button>
+    </template>
+  </Modal>
+</template>
+
+<script>
+import { saveFictitiousReply } from '@/api/product';
+export default {
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    goods: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+    attr: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+    avatar: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+    picture: {
+      type: Array,
+      default() {
+        return [];
+      },
+    },
+  },
+  data() {
+    return {
+      formData: {
+        avatar: '',
+        nickname: '',
+        comment: '',
+      },
+      product_score: 0,
+      service_score: 0,
+      pics: [],
+      add_time: '',
+    };
+  },
+  watch: {
+    picture(value) {
+      this.pics = value.map((item) => {
+        return item.att_dir;
+      });
+    },
+    visible(value) {
+      if (!value) {
+        this.formData.nickname = '';
+        this.formData.comment = '';
+        this.product_score = 0;
+        this.service_score = 0;
+        this.add_time = '';
+      }
+    },
+  },
+  methods: {
+    removeUser() {
+      this.avatar.att_dir = '';
+    },
+    removePicture(att_id) {
+      this.$emit('removePicture', att_id);
+    },
+    onChange(date) {
+      this.add_time = date;
+    },
+    callGoods() {
+      this.$emit('callGoods');
+    },
+    callAttr() {
+      this.$emit('callAttr');
+    },
+    callPicture(type) {
+      this.$emit('callPicture', type);
+    },
+    onOk() {
+      if (!this.goods.id) {
+        return this.$Message.error('请选择商品');
+      }
+      if (!this.attr.unique) {
+        return this.$Message.error('请选择商品规格');
+      }
+      if (!this.avatar.att_dir) {
+        return this.$Message.error('请选择用户头像');
+      }
+      if (!this.formData.nickname) {
+        return this.$Message.error('请填写用户昵称');
+      }
+      if (!this.formData.comment) {
+        return this.$Message.error('请填写评论内容');
+      }
+      if (!this.product_score) {
+        return this.$Message.error('商品分数必须是1-5之间的整数');
+      }
+      if (!this.service_score) {
+        return this.$Message.error('服务分数必须是1-5之间的整数');
+      }
+      let data = {
+        image: {
+          image: this.goods.image,
+          product_id: this.goods.id,
+        },
+        unique: this.attr.unique,
+        avatar: this.avatar.att_dir,
+        nickname: this.formData.nickname,
+        comment: this.formData.comment,
+        product_score: this.product_score,
+        service_score: this.service_score,
+        pics: this.pics,
+        add_time: this.add_time,
+      };
+      saveFictitiousReply(data)
+        .then((res) => {
+          this.$Message.success(res.msg);
+          this.$emit('update:visible', false);
+        })
+        .catch((res) => {
+          this.$Message.error(res.msg);
+        });
+    },
+    onCancel() {
+      this.$emit('update:visible', false);
+    },
+  },
+};
+</script>
+
+<style lang="stylus" scoped>
+.upload-box {
+  position: relative;
+  display: inline-block;
+  width: 58px;
+  height: 58px;
+  border: 1px dashed #c0ccda;
+  border-radius: 4px;
+  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
+  vertical-align: middle;
+  text-align: center;
+  line-height: 58px;
+  cursor: pointer;
+
+  + .upload-box {
+    margin-left: 10px;
+  }
+
+  .ivu-icon {
+    vertical-align: middle;
+    font-size: 20px;
+  }
+
+  .image {
+    width: 100%;
+    height: 100%;
+  }
+
+  .btn {
+    position: absolute;
+    top: 0;
+    right: 0;
+    width: 20px;
+    height: 20px;
+    transform: translate(50%, -50%);
+  }
+}
+</style>

+ 101 - 0
src/pages/erp/product/components/attrList.vue

@@ -0,0 +1,101 @@
+<template>
+    <div class="label-wrapper">
+				<div class="list-box">
+					<div class="label-box" v-for="(item,index) in attrs" :key="index">
+					    <div class="title">{{item.value}}</div>
+					    <div class="list">
+					        <div class="label-item" :class="label.select?'on':''" v-for="(label,j) in item.details" :key="j" @click="selectAttr(label,j)">{{label.name}}</div>
+					    </div>
+					</div>
+				</div>
+        <div class="footer">
+			<Button type="primary" class="btns" ghost @click="cancel">取消</Button>
+			<Button type="primary" class="btns" ghost @click="reset">重置</Button>
+            <Button type="primary" class="btns" @click="subBtn">确定</Button>
+        </div>
+    </div>
+</template>
+
+<script>
+    export default {
+        name: "attrList",
+        props:{
+			attrs: {
+			  type: Array,
+			  default: function () {
+			    return [];
+			  }
+			}
+        },
+        data(){
+            return {
+            }
+        },
+        mounted() {
+        },
+        methods:{
+			selectAttr(label,index){
+				label.select = !label.select;
+				this.$emit('activeData',JSON.parse(JSON.stringify(this.attrs)))
+			},
+			cancel(){
+				this.$emit('close')
+			},
+			reset(){
+				let data = this.attrs;
+				data.map(el=>{
+					el.details.map(label=>{
+						label.select = false
+					})
+				})
+				this.attrs = data;
+			},
+			subBtn(){
+				this.$emit('subAttrs')
+			}
+        }
+    }
+</script>
+<style lang="stylus" scoped>
+.label-wrapper{
+	 .list{
+		 display flex
+		 flex-wrap wrap
+		 .label-item{
+			 margin 10px 8px 10px 0
+			 padding: 3px 14px;
+			 background #EEEEEE
+			 color #333333
+			 border-radius 2px
+			 cursor pointer
+			 font-size 12px
+			 border 1px solid #EEEEEE
+			 &.on{
+				 color #1890FF
+				 border-color #1890FF
+				 background-color #fff;
+			 }
+		 }
+	 }
+	 .footer{
+		 display flex
+		 justify-content flex-end
+		 margin-top 40px
+		 button{
+			  margin-left 10px
+		 }
+	 }
+}
+.btn{
+	width 60px
+	height 24px
+}	
+.title{
+	font-size 13px
+}
+.list-box{
+	overflow-y auto
+	overflow-x hidden
+	max-height 240px
+}	
+</style>

+ 3951 - 0
src/pages/erp/product/components/productDetails.vue

@@ -0,0 +1,3951 @@
+<template>
+  <Drawer :value="visible" :closable="true" :styles="{ padding: '0 0 60px' }" width="1000"
+          @on-visible-change="drawerChange">
+    <div class="header">
+      <Icon custom="iconfont iconmanjianmanzhe" size="60" />
+      <div>
+        <div class="title">{{ formValidate.store_name }}</div>
+        <div>商品ID:{{ productId }}</div>
+      </div>
+    </div>
+    <Tabs v-model="currentTab">
+      <TabPane v-for="(item, index) in headTab" v-if="index !=6 || (index==6 && merchantType==0)" :key="item.name" :label="item.title" :name="item.name">
+      </TabPane>
+    </Tabs>
+    <Form class="formValidate" ref="formValidate" :model="formValidate" :label-width="labelWidth"
+          :label-position="labelPosition" @submit.native.prevent>
+      <Row type="flex" v-show="currentTab === '1'">
+        <!-- 商品信息-->
+        <Col span="24">
+          <FormItem label="商品类型:" props="is_virtual">
+            <RadioGroup v-model="formValidate.product_type">
+              <Radio v-for="item in productType" :key="item.id" :label="item.id" disabled>{{ item.name }}</Radio>
+            </RadioGroup>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品分类:" prop="cate_id">
+            <el-cascader placeholder="请选择商品分类" v-width="'50%'" size="mini" v-model="formValidate.cate_id"
+                         :options="treeSelect" :props="props" filterable clearable>
+            </el-cascader>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品名称:" prop="store_name">
+            <Input v-model="formValidate.store_name" placeholder="请输入商品名称" v-width="'50%'" />
+          </FormItem>
+        </Col>
+        <Col span="24" class="brandName">
+          <FormItem label="商品品牌:" prop="">
+            <Cascader :data="brandData" placeholder="请选择商品品牌" change-on-select v-model="formValidate.brand_id" filterable
+                      v-width="'50%'"></Cascader>
+            <!-- <span class="addClass" @click="addBrand">新增品牌</span> -->
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="单位:" prop="unit_name">
+            <Select v-model="formValidate.unit_name" clearable filterable v-width="'50%'" placeholder="请输入单位">
+              <Option v-for="(item, index) in unitNameList" :value="item.name" :key="item.id">{{ item.name }}</Option>
+            </Select>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品编码:" prop="">
+            <Input v-model="formValidate.code" placeholder="请输入商品编码" v-width="'50%'" />
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品轮播图:" prop="slider_image">
+            <div class="acea-row">
+              <div class="pictrue" v-for="(item, index) in formValidate.slider_image" :key="index+'img'" draggable="true"
+                   @dragstart="handleDragStart($event, item)" @dragover.prevent="handleDragOver($event, item)"
+                   @dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)">
+                <img v-lazy="item" />
+                <Button shape="circle" icon="md-close" @click.native="handleRemove(index)" class="btndel"></Button>
+              </div>
+              <div v-if="formValidate.slider_image.length < 10" class="upLoad acea-row row-center-wrapper"
+                   @click="modalPicTap('duo')">
+                <Icon type="ios-camera-outline" size="26" />
+              </div>
+              <Input v-model="formValidate.slider_image[0]" class="input-display"></Input>
+            </div>
+            <div class="tips">
+              建议尺寸:800
+              *800px,可拖拽改变图片顺序,默认首张图为主图,最多上传10张
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品标签:" prop="store_label_id" class="labelClass">
+            <div class="acea-row row-middle">
+              <div class="labelInput acea-row row-between-wrapper" @click="openStoreLabel">
+                <div v-if="storeDataLabel.length">
+                  <Tag closable v-for="(item, index) in storeDataLabel" :key="item.id" @on-close="closeStoreLabel(item)">{{
+                      item.label_name
+                    }}</Tag>
+                </div>
+                <span class="span" v-else>选择商品标签</span>
+              </div>
+            </div>
+          </FormItem>
+        </Col>
+        <!-- <Col span="24">
+          <FormItem label="供应商:" prop="supplier_id" v-if="formValidate.product_type == 0 && merchantType!=1">
+            <Select v-model="formValidate.supplier_id" clearable filterable v-width="'50%'" placeholder="请选择供应商">
+              <Option v-for="(item, index) in supplierList" :value="item.id" :key="item.id">{{ item.supplier_name }}
+              <Option v-for="(item, index) in supplierList" :value="item.id" :key="item.id">{{ item.supplier_name }}
+              </Option>
+            </Select>
+          </FormItem>
+        </Col> -->
+        <Col span="24">
+          <FormItem label="添加视频:">
+            <i-switch v-model="formValidate.video_open" size="large">
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </i-switch>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.video_open">
+          <FormItem label="视频类型:">
+            <RadioGroup v-model="seletVideo" @on-change="changeVideo">
+              <Radio :label="0" class="radio">本地视频</Radio>
+              <Radio :label="1">视频链接</Radio>
+            </RadioGroup>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.video_open">
+          <FormItem label="" prop="video_link">
+            <Input v-if="seletVideo == 1 && !formValidate.video_link" v-width="'50%'" v-model="videoLink"
+                   placeholder="请输入视频链接" />
+            <input type="file" ref="refid" @change="zh_uploadFile_change" class="input-display" />
+            <div v-if="
+            seletVideo == 0 &&
+            (upload_type !== '1' || videoLink) &&
+            !formValidate.video_link
+          " class="ml10 videbox" @click="zh_uploadFile">
+              +
+            </div>
+            <Button v-if="
+            seletVideo == 1 &&
+            (upload_type !== '1' || videoLink) &&
+            !formValidate.video_link
+          " type="primary" icon="ios-cloud-upload-outline" class="uploadVideo" @click="zh_uploadFile">确认添加</Button>
+            <Upload v-if="upload_type === '1' && !formValidate.video_link" :show-upload-list="false" :action="fileUrl2"
+                    :before-upload="videoSaveToUrl" :data="uploadData" :headers="header" :multiple="true"
+                    style="display: inline-block">
+              <div v-if="seletVideo === 0 && !formValidate.video_link" class="videbox">
+                +
+              </div>
+            </Upload>
+            <div class="iview-video-style" v-if="formValidate.video_link">
+              <video class="video-style" :src="formValidate.video_link" controls="controls">
+                您的浏览器不支持 video 标签。
+              </video>
+              <div class="mark"></div>
+              <Icon type="ios-trash-outline" class="iconv" @click="delVideo" />
+            </div>
+            <Progress class="progress" :percent="progress" :stroke-width="5" v-if="upload.videoIng || videoIng" />
+            <div class="tips">建议时长:9~30秒,视频宽高比16:9</div>
+          </FormItem>
+        </Col>
+        <Col span="24" class="goodsShow">
+          <FormItem label="上架时间:">
+            <RadioGroup v-model="formValidate.is_show" @on-change="goodsOn">
+              <Radio :label="1">
+                <Icon type="social-apple"></Icon>
+                <span>立即上架</span>
+              </Radio>
+              <Radio :label="2">
+                <Icon type="social-android"></Icon>
+                <span>定时上架</span>
+              </Radio>
+              <Radio :label="0">
+                <Icon type="social-windows"></Icon>
+                <span>放入仓库</span>
+              </Radio>
+            </RadioGroup>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.is_show == 2">
+          <FormItem label="">
+            <DatePicker type="datetime" @on-change="onchangeShow" :options="startPickOptions"
+                        :value="formValidate.auto_on_time" v-model="formValidate.auto_on_time" placeholder="请选择上架时间"
+                        format="yyyy-MM-dd HH:mm" style="width: 260px"></DatePicker>
+          </FormItem>
+        </Col>
+        <Col span="24" class="goodsShow">
+          <FormItem label="定时下架:">
+            <Switch v-model="off_show" :true-value="1" :false-value="0" size="large" @on-change="goodsOff">
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </Switch>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="off_show == 1">
+          <FormItem label="">
+            <DatePicker type="datetime" @on-change="onchangeOff" :options="endPickOptions"
+                        :value="formValidate.auto_off_time" v-model="formValidate.auto_off_time" placeholder="请选择下架时间"
+                        format="yyyy-MM-dd HH:mm" style="width: 260px"></DatePicker>
+            <div class="tips">
+              开启定时下架后,系统会在设置时间下架该商品。下架时间需晚于开售时间,商品才能定时开售。
+            </div>
+          </FormItem>
+        </Col>
+      </Row>
+      <Row :gutter="24" type="flex" v-show="currentTab === '2'">
+        <Col span="24" v-if="formValidate.product_type != 4">
+          <FormItem label="商品规格:" props="spec_type">
+            <RadioGroup v-model="formValidate.spec_type" @on-change="changeSpec">
+              <Radio :label="0" class="radio">单规格</Radio>
+              <Radio :label="1">多规格</Radio>
+            </RadioGroup>
+          </FormItem>
+        </Col>
+        <!-- 多规格添加-->
+        <Col span="24" v-if="formValidate.spec_type === 1  && formValidate.product_type != 4" class="noForm">
+          <Col span="24">
+            <FormItem label="选择规格:" prop="">
+              <div class="acea-row row-middle">
+                <Select v-model="formValidate.selectRule" style="width: 23%">
+                  <Option v-for="(item, index) in ruleList" :value="item.rule_name" :key="item.id">{{ item.rule_name }}
+                  </Option>
+                </Select>
+                <Button type="primary" class="mr20" @click="confirm">确认</Button>
+                <Button @click="addRule">添加规格模板</Button>
+              </div>
+            </FormItem>
+          </Col>
+          <Col span="24">
+            <FormItem v-if="attrs.length !== 0">
+              <draggable class="dragArea list-group" :list="attrs" group="peoples" handle=".move-icon" :move="checkMove"
+                         @end="end">
+                <div v-for="(item, index) in attrs" :key="index+'attrs'" class="acea-row row-middle mb10">
+                  <div class="move-icon">
+                    <span class="iconfont icondrag2"></span>
+                  </div>
+                  <div style="width: 90%" :class="moveIndex === index ? 'borderStyle' : ''">
+                    <div class="acea-row row-middle">
+                      <span class="mr5">{{ item.value }}</span>
+                      <Icon type="ios-close-circle" size="14" class="curs" @click="handleRemoveRole(index)" />
+                    </div>
+                    <div class="rulesBox">
+                      <draggable :list="item.detail" handle=".drag">
+                        <Tag type="dot" closable color="primary" v-for="(j, indexn) in item.detail" :key="indexn" :name="j"
+                             class="mr20 drag" @on-close="handleRemove2(item.detail, indexn)">{{ j }}</Tag>
+                      </draggable>
+                      <Input search enter-button="添加" placeholder="请输入属性名称" v-model="item.detail.attrsVal"
+                             @on-search="createAttr(item.detail.attrsVal, index)" class="width-add" />
+                    </div>
+                  </div>
+                </div>
+              </draggable>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="createBnt">
+            <FormItem>
+              <Button type="primary" icon="md-add" @click="addBtn" class="mr15">添加新规格</Button>
+              <Button type="success" @click="generate(1)">立即生成</Button>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="showIput">
+            <Col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
+              <FormItem label="规格:">
+                <Input placeholder="请输入规格" v-model="formDynamic.attrsName" />
+              </FormItem>
+            </Col>
+            <Col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
+              <FormItem label="规格值:">
+                <Input v-model="formDynamic.attrsVal" placeholder="请输入规格值" />
+              </FormItem>
+            </Col>
+            <Col :xl="6" :lg="5" :md="10" :sm="24" :xs="24">
+              <FormItem>
+                <Button type="primary" class="mr15" @click="createAttrName">确定</Button>
+                <Button @click="offAttrName">取消</Button>
+              </FormItem>
+            </Col>
+          </Col>
+          <!-- 多规格设置-->
+          <Col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="
+          manyFormValidate.length &&
+          formValidate.header.length !== 0 &&
+          attrs.length !== 0
+        ">
+            <!-- 批量设置-->
+            <Col span="24">
+              <FormItem label="批量设置:" class="labeltop">
+                <Table :data="oneFormBatch" :columns="
+            formValidate.product_type == 1
+              ? columnsCarMy
+              : formValidate.product_type == 3
+                ? columnsFictitious
+                : columns2
+          " border>
+                  <template slot-scope="{ row, index }" slot="attr">
+                    <div @click="batchAttr" class="acea-row row-between-wrapper" style="cursor: pointer">
+                      <div style="width: 41px">{{ oneFormBatch[0].attr }}</div>
+                      <span class="iconfont icondrop-down"></span>
+                    </div>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="pic">
+                    <div class="acea-row row-middle row-center-wrapper" @click="modalPicTap('dan', 'duopi', index)">
+                      <div class="pictrue pictrueTab" v-if="oneFormBatch[0].pic">
+                        <img v-lazy="oneFormBatch[0].pic" />
+                      </div>
+                      <div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
+                        <Icon type="ios-camera-outline" size="26" class="iosfont" />
+                      </div>
+                    </div>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="price">
+                    <InputNumber v-model="oneFormBatch[0].price" :min="0" class="priceBox"></InputNumber>
+                  </template>
+				  <template slot-scope="{ row, index }" slot="settle_price" v-if='merchantType == 2'>
+				    <InputNumber
+				        v-model="oneFormBatch[0].settle_price"
+				        :min="0"
+				        class="priceBox"
+				    ></InputNumber>
+				  </template>
+                  <template slot-scope="{ row, index }" slot="cost">
+                    <InputNumber v-model="oneFormBatch[0].cost" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="ot_price">
+                    <InputNumber v-model="oneFormBatch[0].ot_price" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="stock">
+                    <InputNumber v-model="oneFormBatch[0].stock" :min="0"
+                                 :disabled="formValidate.product_type == 1 || openErp" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="bar_code">
+                    <Input v-model="oneFormBatch[0].bar_code"></Input>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="code">
+                    <Input v-model="oneFormBatch[0].code"></Input>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="weight">
+                    <InputNumber v-model="oneFormBatch[0].weight" :step="0.1" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="volume">
+                    <InputNumber v-model="oneFormBatch[0].volume" :step="0.1" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="fictitious" v-if="formValidate.product_type == 1">
+                    <Button v-if="!row.virtual_list && !row.stock" @click="addVirtual(0, 'oneFormBatch')">添加卡密</Button>
+                    <span v-else class="seeCatMy" @click="seeVirtual(oneFormBatch[0], 'oneFormBatch', 0)">已设置</span>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="action">
+                    <a @click="batchAdd">批量设置</a>
+                    <Divider type="vertical" />
+                    <a @click="batchDel">清空</a>
+                  </template>
+                </Table>
+              </FormItem>
+            </Col>
+            <!-- 多规格表格-->
+            <Col span="24">
+              <FormItem label="商品属性:" class="labeltop">
+                <Table :data="manyFormValidate" :columns="formValidate.header" border>
+                  <template slot-scope="{ row, index }" v-for="(item, i) in attrData.length" :slot="'value' + (i + 1)">
+                    <div :class="manyFormValidate[index].select ? 'selectOn' : ''">
+                      {{ manyFormValidate[index]['value' + (i + 1)] }}
+                    </div>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="pic">
+                    <div class="acea-row row-middle row-center-wrapper" @click="modalPicTap('dan', 'duoTable', index)">
+                      <div class="pictrue pictrueTab" v-if="manyFormValidate[index].pic">
+                        <img v-lazy="manyFormValidate[index].pic" />
+                      </div>
+                      <div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
+                        <Icon type="ios-camera-outline" size="21" />
+                      </div>
+                    </div>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="price">
+                    <InputNumber v-model="manyFormValidate[index].price" :min="0" class="priceBox"></InputNumber>
+                  </template>
+				  <template slot-scope="{ row, index }" slot="settle_price" v-if="merchantType == 2">
+				    <InputNumber
+				        v-model="manyFormValidate[index].settle_price"
+				        :min="0"
+				        class="priceBox"
+				    ></InputNumber>
+				  </template>
+                  <template slot-scope="{ row, index }" slot="cost">
+                    <InputNumber v-model="manyFormValidate[index].cost" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="ot_price">
+                    <InputNumber v-model="manyFormValidate[index].ot_price" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="stock">
+                    <InputNumber v-model="manyFormValidate[index].stock" :min="0" :precision="0"
+                                 :disabled="formValidate.product_type == 1 || openErp" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="fictitious" v-if="formValidate.product_type == 1">
+                    <Button v-if="
+                (!row.virtual_list || !row.virtual_list.length) &&
+                !row.stock
+              " @click="addVirtual(index, 'manyFormValidate')">添加卡密</Button>
+                    <span v-else class="seeCatMy" @click="seeVirtual(row, 'manyFormValidate', index)">已设置</span>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="bar_code">
+                    <Input v-model="manyFormValidate[index].bar_code"></Input>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="code">
+                    <Input v-model="manyFormValidate[index].code"></Input>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="weight">
+                    <InputNumber v-model="manyFormValidate[index].weight" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="volume">
+                    <InputNumber v-model="manyFormValidate[index].volume" :min="0" class="priceBox"></InputNumber>
+                  </template>
+                  <template slot-scope="{ row, index }" slot="action">
+                    <a @click="delAttrTable(index)">删除</a>
+                  </template>
+                </Table>
+              </FormItem>
+            </Col>
+          </Col>
+        </Col>
+        <!-- 单规格表格-->
+        <div v-if="formValidate.spec_type === 0 || formValidate.product_type == 4" style="width: 100%">
+          <Col span="24" v-if="formValidate.product_type != 4">
+            <FormItem label="图片:" prop="image">
+              <div class="pictrueBox" @click="modalPicTap('dan', 'danTable', 0)">
+                <div class="pictrue" v-if="oneFormValidate[0].pic">
+                  <img v-lazy="oneFormValidate[0].pic" />
+                </div>
+                <div class="upLoad acea-row row-center-wrapper" v-else>
+                  <Input v-model="oneFormValidate[0].pic" class="input-display"></Input>
+                  <Icon type="ios-camera-outline" size="26" />
+                </div>
+              </div>
+            </FormItem>
+          </Col>
+          <Col class="asterisk" span="24" v-if="formValidate.product_type == 4">
+            <div class="asteriskInfo on2">*</div>
+            <FormItem label="核销次数:">
+              <InputNumber
+                  v-model="oneFormValidate[0].write_times"
+                  :min="1"
+                  :max="99999999"
+                  :precision="0"
+                  v-width="'50%'"
+                  placeholder="请输入核销次数"
+              ></InputNumber>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="formValidate.product_type == 4">
+            <FormItem required label="核销时效:">
+              <RadioGroup v-model="oneFormValidate[0].write_valid">
+                <Radio :label="1">永久有效</Radio>
+                <Radio :label="2">购买后几天有效</Radio>
+                <Radio :label="3">固定有效期</Radio>
+              </RadioGroup>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="oneFormValidate[0].write_valid==2">
+            <FormItem
+                label=""
+                prop="freight"
+            >
+              <div class="acea-row row-middle">
+                <InputNumber
+                    :min="1"
+                    v-model="oneFormValidate[0].days"
+                    placeholder="请输入有效天数"
+                    v-width="'50%'"
+                />
+                <span class="ml10">天</span>
+              </div>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="oneFormValidate[0].write_valid==3">
+            <FormItem
+                label=""
+                prop="freight"
+            >
+              <div class="acea-row row-middle">
+                <DatePicker :editable="false" type="daterange" format="yyyy-MM-dd" placeholder="请选择固定有效期"
+                            @on-change="onchangeTime" v-width="'50%'" :value="oneFormValidate[0].section_time" v-model="oneFormValidate[0].section_time"></DatePicker>
+              </div>
+            </FormItem>
+          </Col>
+          <Col span="24" class="asterisk">
+            <!-- <div class="asteriskInfo">*</div> -->
+            <FormItem label="售价:">
+              <InputNumber v-model="oneFormValidate[0].price" :min="0" :max="99999999" v-width="'50%'"></InputNumber>
+            </FormItem>
+          </Col>
+		  <Col span="24" class="asterisk" v-if="merchantType == 2">
+		    <!-- <div class="asteriskInfo on">*</div> -->
+		    <FormItem label="结算价:">
+		      <InputNumber
+		          v-model="oneFormValidate[0].settle_price"
+		          :min="0"
+		          :max="99999999"
+		          v-width="'50%'"
+		      ></InputNumber>
+		    </FormItem>
+		  </Col>
+          <Col span="24" class="asterisk">
+            <!-- <div class="asteriskInfo on">*</div> -->
+            <FormItem label="成本价:">
+              <InputNumber v-model="oneFormValidate[0].cost" :min="0" :max="99999999" v-width="'50%'"></InputNumber>
+            </FormItem>
+          </Col>
+          <Col span="24">
+            <FormItem label="原价:">
+              <InputNumber v-model="oneFormValidate[0].ot_price" :min="0" :max="99999999" v-width="'50%'"></InputNumber>
+            </FormItem>
+          </Col>
+          <Col span="24" class="asterisk">
+            <!-- <div class="asteriskInfo">*</div> -->
+            <FormItem label="库存:">
+              <InputNumber v-model="oneFormValidate[0].stock" :min="0" :max="99999999"
+                           :disabled="formValidate.product_type == 1 || openErp" :precision="0" v-width="'50%'"></InputNumber>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="formValidate.product_type != 4">
+            <FormItem label="商品条形码:">
+              <Input v-model.trim="oneFormValidate[0].bar_code" v-width="'50%'" placeholder="请输入商品条形码"></Input>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="formValidate.product_type != 4">
+            <FormItem label="商品编号:">
+              <Input v-model.trim="oneFormValidate[0].code" v-width="'50%'" placeholder="请输入商品编码"></Input>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="formValidate.product_type == 0">
+            <FormItem label="重量(KG):">
+              <InputNumber v-model="oneFormValidate[0].weight" :min="0" :max="99999999" v-width="'50%'"></InputNumber>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="formValidate.product_type == 0">
+            <FormItem label="体积(m³):">
+              <InputNumber v-model="oneFormValidate[0].volume" :min="0" :max="99999999" v-width="'50%'"></InputNumber>
+            </FormItem>
+          </Col>
+          <Col span="24" v-if="formValidate.product_type == 1">
+            <FormItem label="卡密设置:">
+              <Button v-if="
+              !oneFormValidate[0].virtual_list.length &&
+              !oneFormValidate[0].stock
+            " @click="addVirtual(0, 'oneFormValidate')">添加卡密</Button>
+              <span v-else class="seeCatMy" @click="seeVirtual(oneFormValidate[0], 'oneFormValidate', 0)">已设置</span>
+            </FormItem>
+          </Col>
+        </div>
+      </Row>
+      <!-- 商品详情 -->
+      <Row v-if="currentTab === '3'">
+        <Col span="20">
+          <wangeditor style="width: 100%" :content="contents" @editorContent="getEditorContent"></wangeditor>
+        </Col>
+        <!-- <Col span="6">
+        <div class="ifam">
+          <div class="content" v-html="content"></div>
+        </div>
+        </Col> -->
+      </Row>
+      <!-- 物流设置 -->
+      <Row v-show="currentTab === '4'">
+        <Col v-bind="grid3">
+          <FormItem label="配送方式:" prop="" required>
+            <CheckboxGroup v-model="formValidate.delivery_type">
+              <Checkbox label="1" v-if="merchantType!=1">快递</Checkbox>
+              <Checkbox label="3">门店配送</Checkbox>
+              <Checkbox label="2">到店自提</Checkbox>
+            </CheckboxGroup>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="运费设置:">
+            <RadioGroup v-model="formValidate.freight">
+              <Radio :label="1">包邮</Radio>
+              <Radio :label="2">固定邮费</Radio>
+              <Radio :label="3">运费模板</Radio>
+            </RadioGroup>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.freight == 2">
+          <FormItem label="" prop="freight">
+            <div class="acea-row row-middle">
+              <InputNumber :min="0" v-model="formValidate.postage" placeholder="请输入金额" class="perW20 maxW" />
+              <span class="ml10">元</span>
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.freight == 3">
+          <FormItem label="" prop="">
+            <div class="acea-row">
+              <Select v-model="formValidate.temp_id" clearable class="perW20 maxW">
+                <Option v-for="(item, index) in templateList" :value="item.id" :key="item.id">{{ item.name }}</Option>
+              </Select>
+              <!-- <Button @click="addTemp" class="ml15">添加运费模板</Button> -->
+            </div>
+          </FormItem>
+        </Col>
+      </Row>
+      <!-- 营销设置 -->
+      <Row v-show="currentTab === '5'">
+        <Col span="24">
+          <FormItem label="虚拟销量:">
+            <InputNumber v-width="'50%'" :min="0" :max="999999" v-model="formValidate.ficti" placeholder="请输入虚拟销量" />
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="排序:">
+            <InputNumber :min="0" :max="999999" v-width="'50%'" v-model="formValidate.sort" placeholder="请输入排序" />
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <div class="lines"></div>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+          <FormItem label="赠送积分:" prop="give_integral">
+            <InputNumber v-width="'50%'" v-model="formValidate.give_integral" :min="0" :max="999999"
+                         placeholder="请输入积分" />
+          </FormItem>
+        </Col>
+        <Col v-bind="grid3" v-if="merchantType==0">
+          <FormItem label="赠送优惠券:">
+            <div v-if="couponName.length" class="mb20">
+              <Tag closable v-for="(item, index) in couponName" :key="index+'coupon'" @on-close="handleClose(item)">{{ item.title
+                }}</Tag>
+            </div>
+            <Button type="primary" @click="addCoupon">添加优惠券</Button>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+          <FormItem label="关联用户标签:" prop="label_id" class="labelClass">
+            <div class="labelInput acea-row row-between-wrapper" @click="openLabel">
+              <div>
+                <div v-if="dataLabel.length">
+                  <Tag closable v-for="(item, index) in dataLabel" :key="item.id" @on-close="closeLabel(item)">{{ item.label_name }}
+                  </Tag>
+                </div>
+                <span class="span" v-else>选择用户关联标签</span>
+              </div>
+              <Icon type="ios-arrow-down" />
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+          <FormItem label="仅会员可见:">
+            <i-switch v-model="formValidate.is_vip_product" :true-value="1" :false-value="0" size="large">
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </i-switch>
+            <div class="tips">开启后仅付费会员可以看见并购买此商品</div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+          <FormItem label="单独设置:">
+            <CheckboxGroup class="checkAlls" v-model="formValidate.is_sub" @on-change="checkAllGroupChange">
+              <Checkbox :label="1">佣金设置(数字即返佣金额)</Checkbox>
+              <Checkbox :label="0">付费会员价</Checkbox>
+            </CheckboxGroup>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.is_sub.length">
+          <!--单规格返佣-->
+          <FormItem label="商品属性:" v-if="formValidate.spec_type === 0">
+            <Table :data="oneFormValidate" :columns="columnsInstall" border>
+              <template slot-scope="{ row, index }" slot="pic">
+                <div class="pictrue pictrueTab">
+                  <img v-lazy="oneFormValidate[0].pic" />
+                </div>
+              </template>
+              <template slot-scope="{ row, index }" slot="price">{{
+                  oneFormValidate[0].price
+                }}</template>
+              <template slot-scope="{ row, index }" slot="cost">{{
+                  oneFormValidate[0].cost
+                }}</template>
+              <template slot-scope="{ row, index }" slot="ot_price">{{
+                  oneFormValidate[0].ot_price
+                }}</template>
+              <template slot-scope="{ row, index }" slot="stock">{{
+                  oneFormValidate[0].stock
+                }}</template>
+              <template slot-scope="{ row, index }" slot="bar_code">{{
+                  oneFormValidate[0].bar_code
+                }}</template>
+              <template slot-scope="{ row, index }" slot="code">{{
+                  oneFormValidate[0].code
+                }}</template>
+              <template slot-scope="{ row, index }" slot="weight">{{
+                  oneFormValidate[0].weight
+                }}</template>
+              <template slot-scope="{ row, index }" slot="volume">{{
+                  oneFormValidate[0].volume
+                }}</template>
+              <template slot-scope="{ row, index }" slot="brokerage">
+                <InputNumber v-model="oneFormValidate[0].brokerage" :min="0" class="priceBox"></InputNumber>
+              </template>
+              <template slot-scope="{ row, index }" slot="brokerage_two">
+                <InputNumber v-model="oneFormValidate[0].brokerage_two" :min="0" class="priceBox"></InputNumber>
+              </template>
+              <template slot-scope="{ row, index }" slot="vip_price">
+                <InputNumber v-model="oneFormValidate[0].vip_price" :min="0" class="priceBox"></InputNumber>
+              </template>
+            </Table>
+          </FormItem>
+          <!--多规格返佣-->
+          <FormItem label="批量设置:" v-if="formValidate.spec_type === 1">
+          <span v-if="formValidate.is_sub.indexOf(1) > -1">
+            一级返佣:<InputNumber placeholder="请输入一级返佣" :min="0" class="columnsBox perW20" v-model="manyBrokerage">
+            </InputNumber>
+            二级返佣:<InputNumber placeholder="请输入二级返佣" :min="0" class="columnsBox perW20" v-model="manyBrokerageTwo">
+            </InputNumber>
+          </span>
+            <span v-if="formValidate.is_sub.indexOf(0) > -1">
+            会员价:<InputNumber placeholder="请输入会员价" :min="0" class="columnsBox perW20" v-model="manyVipPrice">
+            </InputNumber>
+          </span>
+            <Button type="primary" @click="brokerageSetUp">批量设置</Button>
+          </FormItem>
+          <FormItem label="商品属性:" v-if="formValidate.spec_type === 1 && manyFormValidate.length">
+            <Table v-if="formValidate.is_sub && visible" :data="manyFormValidate" :columns="columnsInstal2" border>
+              <template slot-scope="{ row, index }" v-for="(item, i) in attrData.length" :slot="'value' + (i + 1)">
+                <div>{{ manyFormValidate[index]['value' + (i + 1)] }}</div>
+              </template>
+              <template slot-scope="{ row, index }" slot="pic">
+                <div class="pictrue pictrueTab">
+                  <img v-lazy="manyFormValidate[index].pic" />
+                </div>
+              </template>
+              <template slot-scope="{ row, index }" slot="price">{{
+                  manyFormValidate[index].price
+                }}</template>
+              <template slot-scope="{ row, index }" slot="cost">{{
+                  manyFormValidate[index].cost
+                }}</template>
+              <template slot-scope="{ row, index }" slot="ot_price">{{
+                  manyFormValidate[index].ot_price
+                }}</template>
+              <template slot-scope="{ row, index }" slot="stock">{{
+                  manyFormValidate[index].stock
+                }}</template>
+              <template slot-scope="{ row, index }" slot="bar_code">{{
+                  manyFormValidate[index].bar_code
+                }}</template>
+              <template slot-scope="{ row, index }" slot="code">{{
+                  manyFormValidate[index].code
+                }}</template>
+              <template slot-scope="{ row, index }" slot="weight">{{
+                  manyFormValidate[index].weight
+                }}</template>
+              <template slot-scope="{ row, index }" slot="volume">{{
+                  manyFormValidate[index].volume
+                }}</template>
+              <template slot-scope="{ row, index }" slot="brokerage">
+                <InputNumber v-model="manyFormValidate[index].brokerage" :min="0" class="priceBox"></InputNumber>
+              </template>
+              <template slot-scope="{ row, index }" slot="brokerage_two">
+                <InputNumber v-model="manyFormValidate[index].brokerage_two" :min="0" class="priceBox"></InputNumber>
+              </template>
+              <template slot-scope="{ row, index }" slot="vip_price">
+                <InputNumber v-model="manyFormValidate[index].vip_price" :min="0" class="priceBox"></InputNumber>
+              </template>
+            </Table>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+          <div class="lines"></div>
+        </Col>
+        <Col span="24">
+          <FormItem label="是否限购:">
+            <i-switch v-model="formValidate.is_limit" :true-value="1" :false-value="0" size="large" @on-change="limitTap">
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </i-switch>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.is_limit">
+          <FormItem label="限购类型:">
+            <RadioGroup v-model="formValidate.limit_type">
+              <Radio :label="1">单次限购</Radio>
+              <Radio :label="2">长期限购</Radio>
+            </RadioGroup>
+            <div class="tips">
+              单次限购是限制每次下单最多购买的数量,长期限购是限制一个用户总共可以购买的数量
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.is_limit">
+          <FormItem label="限购数量:">
+            <InputNumber :min="1" v-model="formValidate.limit_num" placeholder="请输入限购数量" class="perW20 maxW" />
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.product_type == 0 && merchantType==0">
+          <FormItem label="预售商品:">
+            <i-switch v-model="formValidate.is_presale_product" :true-value="1" :false-value="0" size="large">
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </i-switch>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="
+          formValidate.product_type == 0 && formValidate.is_presale_product
+        ">
+          <FormItem label="预售活动时间:" prop="presale_time">
+            <div class="acea-row row-middle">
+              <DatePicker :editable="false" :options="datePickerOptions" type="datetimerange" format="yyyy-MM-dd HH:mm"
+                          placeholder="请选择活动时间" @on-change="onchangeTime" :value="formValidate.presale_time"
+                          v-model="formValidate.presale_time" v-width="'50%'"></DatePicker>
+            </div>
+            <div class="tips">
+              设置活动开启结束时间,用户可以在设置时间内发起参与预售
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="
+          formValidate.product_type == 0 && formValidate.is_presale_product
+        ">
+          <FormItem label="发货时间:" prop="presale_day">
+            <div class="acea-row row-middle">
+              <span class="mr10">预售活动结束后</span>
+              <InputNumber placeholder="请输入发货时间" :precision="0" :min="1" style="width: 100px"
+                           v-model="formValidate.presale_day" />
+              <span class="ml10">天之内</span>
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+			<FormItem label="优品推荐:">
+			  <i-switch v-model="formValidate.is_good" :true-value="1" :false-value="0" size="large">
+			    <span slot="open">开启</span>
+			    <span slot="close">关闭</span>
+			  </i-switch>
+			</FormItem>
+          <!-- <FormItem label="商品推荐:">
+            <CheckboxGroup v-model="formValidate.recommend" class="checkAlls">
+              <Checkbox label="is_hot">热卖单品</Checkbox>
+              <Checkbox label="is_benefit">促销单品</Checkbox>
+              <Checkbox label="is_best">精品推荐</Checkbox>
+              <Checkbox label="is_new">首发新品</Checkbox>
+              <Checkbox label="is_good">优品推荐</Checkbox>
+            </CheckboxGroup>
+          </FormItem> -->
+        </Col>
+        <Col v-bind="grid3" v-if="merchantType==0">
+          <FormItem label="活动优先级:">
+            <div class="color-list acea-row row-middle">
+              <div class="color-item acea-row row-center-wrapper" :class="activity[color]"
+                   v-for="(color, index) in formValidate.activity" v-dragging="{
+                item: color,
+                list: formValidate.activity,
+                group: 'color',
+              }" :key="color">
+                <div class="num">{{ index + 1 }}</div>
+                <div>{{ color }}</div>
+              </div>
+              <div class="tips">可拖动按钮调整活动的优先展示顺序</div>
+            </div>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="merchantType==0">
+          <FormItem label="选择优品推荐商品:">
+            <div class="acea-row">
+              <div class="pictrue" v-for="(item, index) in goodsData" :key="index+'goods'">
+                <img v-lazy="item.image" />
+                <Button shape="circle" icon="md-close" @click.native="bindDelete(index)" class="btndel"></Button>
+              </div>
+              <div v-if="goodsData.length < 12" class="upLoad acea-row row-center-wrapper" @click="goodsTap">
+                <Icon type="ios-camera-outline" size="26" />
+              </div>
+            </div>
+          </FormItem>
+        </Col>
+      </Row>
+      <!-- 其他设置-->
+      <Row v-show="currentTab === '6'">
+        <Col span="24">
+          <FormItem label="商品关键字:" prop="">
+            <Input v-model="formValidate.keyword" placeholder="请输入商品关键字" v-width="'50%'" />
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品简介:" prop="">
+            <Input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介" v-width="'50%'" />
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品口令:">
+            <Input v-model="formValidate.command_word" type="textarea" :rows="3" placeholder="请输入商品口令" v-width="'50%'" />
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品推荐图:">
+            <div class="pictrueBox" @click="modalPicTap('dan', 'recommend_image')">
+              <div class="pictrue" v-if="formValidate.recommend_image">
+                <img v-lazy="formValidate.recommend_image" />
+                <Input v-model="formValidate.recommend_image" class="input-display"></Input>
+              </div>
+              <div class="upLoad acea-row row-center-wrapper" v-else>
+                <Input v-model="formValidate.recommend_image" class="input-display"></Input>
+                <Icon type="ios-camera-outline" size="26" />
+              </div>
+            </div>
+            <div class="tips">(建议图片比例5:2)</div>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="服务保障:">
+            <CheckboxGroup v-model="formValidate.ensure_id" class="checkAlls">
+              <Checkbox :label="item.id" v-for="(item, index) in ensureData" :key="item.id">{{
+                  item.name
+                }}</Checkbox>
+            </CheckboxGroup>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="商品参数:" prop="">
+            <Select v-model="formValidate.specs_id" clearable filterable v-width="'50%'" placeholder="请输入商品参数"
+                    @on-change="specsInfo">
+              <Option v-for="(item, index) in specsData" :value="item.id" :key="item.id">{{ item.name }}</Option>
+            </Select>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.specs_id">
+          <FormItem label="" props="">
+            <Table border :columns="specsColumns" :data="specsList" ref="table" class="specsList" width="700">
+              <template slot-scope="{ row, index }" slot="action">
+                <a @click="delSpecs(index)" v-if="index > 0">删除</a>
+              </template>
+            </Table>
+            <Button class="mt20" @click="addSpecs">添加参数</Button>
+          </FormItem>
+        </Col>
+        <Col span="24" v-if="formValidate.product_type">
+          <FormItem label="支持退款:" props="status" label-for="status">
+            <i-switch v-model="formValidate.is_support_refund" :true-value="1" :false-value="0" size="large">
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </i-switch>
+          </FormItem>
+        </Col>
+        <Col span="24">
+          <FormItem label="自定义留言:">
+            <i-switch
+                v-model="customBtn"
+                @on-change="customMessBtn"
+                size="large"
+            >
+              <span slot="open">开启</span>
+              <span slot="close">关闭</span>
+            </i-switch>
+            <div class="mt10" v-if="customBtn">
+              <Select
+                  v-model="formValidate.system_form_id"
+                  clearable
+                  filterable
+                  v-width="'50%'"
+                  placeholder="请选择"
+                  @on-change="changeForm"
+              >
+                <Option
+                    v-for="(item, index) in formList"
+                    :value="item.id"
+                    :key="item.id"
+                >{{ item.name }}</Option
+                >
+              </Select>
+            </div>
+          </FormItem>
+<!--          <FormItem label="自定义留言:">-->
+<!--            <i-switch v-model="customBtn" @on-change="customMessBtn" size="large">-->
+<!--              <span slot="open">开启</span>-->
+<!--              <span slot="close">关闭</span>-->
+<!--            </i-switch>-->
+<!--            <div class="addCustom_content" v-if="customBtn">-->
+<!--              <div v-for="(item, index) in formValidate.custom_form" type="flex" :key="index+'custom'" class="custom_box">-->
+<!--                <Input v-model.trim="item.title" :placeholder="'留言标题' + (index + 1)" class="custom-input" />-->
+<!--                <Select v-model="item.label" class="select-add">-->
+<!--                  <Option v-for="items in customList" :value="items.value" :key="items.value">{{ items.label }}</Option>-->
+<!--                </Select>-->
+<!--                <Checkbox v-model="item.status" :true-value="1" :false-value="0">必填</Checkbox>-->
+<!--                <div class="addfont" @click="delcustom(index)">删除</div>-->
+<!--              </div>-->
+<!--            </div>-->
+<!--            <div class="addCustomBox" v-show="customBtn">-->
+<!--              <div class="btn" @click="addcustom">+ 添加表单</div>-->
+<!--              <div class="tips">用户下单时需填写的信息,最多可设置10条</div>-->
+<!--            </div>-->
+<!--          </FormItem>-->
+        </Col>
+        <Col span="24" v-if="customBtn && formValidate.system_form_id">
+          <FormItem label="" props="">
+            <Table border :columns="formColumns" :data="formTypeList" ref="table" class="specsList on">
+              <template slot-scope="{ row }" slot="require">
+                <span>{{row.require?'必填':'不必填'}}</span>
+              </template>
+            </Table>
+          </FormItem>
+        </Col>
+      </Row>
+      <Row v-show="currentTab === '8' && merchantType==0" class="storeModule">
+        <Col span="24">
+          <RadioGroup v-model="formValidate.applicable_type" class="radioGroup">
+            <Radio :label="1">全部门店</Radio>
+            <Radio :label="2">部分门店</Radio>
+            <Radio :label="0">仅平台适用</Radio>
+          </RadioGroup>
+          <div class="tips on">可选择将商品同步到哪些门店使用,选择“仅平台适用“则商品不同步任何门店</div>
+        </Col>
+        <Col span="24" class="mt20 mb20" v-if="formValidate.applicable_type == 2">
+          <Button type="primary" @click="addStore">添加门店</Button>
+        </Col>
+        <Col span="24">
+          <div class="storeTable" v-if="formValidate.applicable_type == 2">
+            <Table
+                :columns="storeColumns"
+                :data="storesList"
+                ref="table"
+                class="ivu-mt"
+                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="delte(index)">删除</a>
+              </template>
+            </Table>
+          </div>
+        </Col>
+      </Row>
+      <Spin size="large" fix v-if="spinShow"></Spin>
+    </Form>
+    <!-- 商品评论表格 -->
+    <Table width="940" v-if="currentTab === '7'" ref="table" :columns="replyColumns" :data="replyData" class="ivu-mt"
+           :loading="replyLoading" no-data-text="暂无数据" no-filtered-data-text="暂无筛选结果">
+      <template slot-scope="{ row }" slot="info">
+        <div class="imgPic acea-row row-middle">
+          <viewer>
+            <div class="pictrue"><img v-lazy="row.image" /></div>
+          </viewer>
+          <div class="info line2">{{ row.store_name }}</div>
+        </div>
+      </template>
+      <template slot-scope="{ row }" slot="content">
+        <div>用户:{{ row.nickname }}</div>
+        <div>评分:{{ row.score }}</div>
+        <div>
+          <div class="mb5 content_font">{{ row.comment }}</div>
+          <viewer>
+            <div class="pictrue mr10" v-for="(item, index) in row.pics || []" :key="index+'pics'">
+              <img v-lazy="item" />
+            </div>
+          </viewer>
+        </div>
+      </template>
+      <!-- <template slot-scope="{ row }" slot="reply">
+        <Tooltip max-width="200" placement="bottom">
+          <span class="line2">{{
+              row.replyComment ? row.replyComment.content : ''
+          }}</span>
+          <p slot="content">
+            {{ row.replyComment ? row.replyComment.content : '' }}
+          </p>
+        </Tooltip>
+      </template> -->
+      <template slot-scope="{ row, index }" slot="action">
+        <a @click="seeReply(row)">查看</a>
+        <Divider type="vertical" />
+        <a @click="reply(row)">回复</a>
+        <Divider type="vertical" />
+        <a @click="delReply(row, '删除评论', index)">删除</a>
+      </template>
+    </Table>
+    <div class="drawer-footer">
+      <Button type="primary" @click="handleSubmit('formValidate')">保存</Button>
+    </div>
+    <Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传商品图" :mask-closable="false">
+      <uploadPictures :isChoice="isChoice" @getPic="getPic" @getPicD="getPicD" :gridBtn="gridBtn" :gridPic="gridPic"
+                      v-if="modalPic"></uploadPictures>
+    </Modal>
+    <coupon-list ref="couponTemplates" @nameId="nameId" :couponids="formValidate.coupon_ids" :updateIds="updateIds"
+                 :updateName="updateName"></coupon-list>
+    <!-- 商品列表 -->
+    <Modal v-model="goodsModals" title="商品列表" footerHide scrollable width="900" @on-cancel="goodCancel">
+      <goods-list v-if="goodsModals" ref="goodslist" @getProductId="getProductId" :ischeckbox="true"></goods-list>
+    </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>
+    <!-- 商品标签 -->
+    <Modal v-model="storeLabelShow" scrollable title="请选择商品标签" :closable="true" width="540" :footer-hide="true"
+           :mask-closable="false">
+      <storeLabelList ref="storeLabel" @activeData="activeStoreData" @close="storeLabelClose"></storeLabelList>
+    </Modal>
+    <replyList ref="replyList"></replyList>
+    <Modal v-model="replyModal" scrollable title="回复内容" closable>
+      <Form ref="replyForm" :model="replyForm" :rules="ruleInline" :label-position="labelPosition"
+            @submit.native.prevent>
+        <FormItem prop="content">
+          <Input v-model="replyForm.content" type="textarea" :rows="4" placeholder="请输入回复内容" />
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" @click="oks">确定</Button>
+        <Button @click="cancels">取消</Button>
+      </div>
+    </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>
+  </Drawer>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex';
+import Setting from '@/setting';
+import util from '@/libs/util';
+import vuedraggable from 'vuedraggable';
+import uploadPictures from '@/components/uploadPictures';
+import freightTemplate from '@/components/freightTemplate';
+import wangeditor from '@/components/wangEditor/index.vue';
+import storeList from "@/components/storeList";
+import menusFrom from '../productBrand/components/menusFrom';
+import userLabel from '@/components/labelList';
+import storeLabelList from '@/components/storeLabelList';
+import couponList from '@/components/couponList';
+import goodsList from '@/components/goodsList/index';
+import addAttr from '../productAttr/addAttr';
+import attrList from './attrList';
+import addCarMy from './addCarMy';
+import taoBao from '../productAdd/taoBao';
+import replyList from './replyList.vue';
+import {
+  productInfoApi,
+  cascaderListApi,
+  productAddApi,
+  generateAttrApi,
+  productGetRuleApi,
+  productGetTemplateApi,
+  productGetTempKeysApi,
+  checkActivityApi,
+  labelListApi,
+  productCache,
+  cacheDelete,
+  brandList,
+  productCreateApi,
+  productAllUnit,
+  productUnitCreate,
+  uploadType,
+  productAllEnsure,
+  productLabelAdd,
+  productAllSpecs,
+  setReplyApi,
+  replyListApi,
+  allSystemForm
+} from '@/api/product';
+import { systemFormInfo } from '@/api/setting'
+import { getSupplierList } from '@/api/supplier';
+import { erpConfig } from '@/api/erp';
+import { uploadByPieces } from '@/utils/upload'; //引入uploadByPieces方法
+export default {
+  name: 'product_productAdd',
+  components: {
+    storeList,
+    uploadPictures,
+    freightTemplate,
+    goodsList,
+    addAttr,
+    couponList,
+    taoBao,
+    userLabel,
+    menusFrom,
+    attrList,
+    addCarMy,
+    storeLabelList,
+    wangeditor,
+    draggable: vuedraggable,
+    replyList,
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    productId: {
+      type: Number,
+      default: 0,
+    },
+  },
+  data() {
+    return {
+      formTypeList: [],
+      formColumns: [
+        {
+          title: '表单标题',
+          key: 'title',
+          // align:'center',
+          minWidth: 100
+        },
+        {
+          title: '表单类型',
+          key: 'name',
+          // align:'center',
+          minWidth: 100
+        },
+        {
+          title: '是否必填',
+          slot: 'require',
+          // align:'center',
+          minWidth: 100
+        }
+      ],
+      storesList:[],
+      tableData:[],
+      storeModals: false,
+      roterPre: Setting.roterPre,
+      specsList: [],
+      supplierList: [],
+      specsColumns: [
+        {
+          title: '参数名称',
+          key: 'name',
+          align: 'center',
+          width: 150,
+          render: (h, params) => {
+            return h('div', [
+              h('Input', {
+                props: {
+                  value: params.row.name,
+                  placeholder: '请输入参数名称',
+                },
+                on: {
+                  'on-change': (e) => {
+                    params.row.name = e.target.value;
+                    this.specsList[params.index].name = e.target.value;
+                  },
+                },
+              }),
+            ]);
+          },
+        },
+        {
+          title: '参数值',
+          key: 'value',
+          align: 'center',
+          width: 300,
+          render: (h, params) => {
+            return h('div', [
+              h('Input', {
+                props: {
+                  value: params.row.value,
+                  placeholder: '请输入参数值',
+                },
+                on: {
+                  'on-change': (e) => {
+                    params.row.value = e.target.value;
+                    this.specsList[params.index].value = e.target.value;
+                  },
+                },
+              }),
+            ]);
+          },
+        },
+        {
+          title: '排序',
+          key: 'sort',
+          align: 'center',
+          width: 100,
+          render: (h, params) => {
+            return h('div', [
+              h('InputNumber', {
+                props: {
+                  value: parseInt(params.row.sort) || 0,
+                  placeholder: '排序',
+                  precision: 0,
+                },
+                on: {
+                  'on-change': (e) => {
+                    params.row.sort = e;
+                    this.specsList[params.index].sort = e;
+                  },
+                },
+              }),
+            ]);
+          },
+        },
+        {
+          title: '操作',
+          slot: 'action',
+          align: 'center',
+          minWidth: 120,
+        },
+      ],
+      //自定义留言下拉选择
+      customList: [
+        {
+          value: 'text',
+          label: '文本框',
+        },
+        {
+          value: 'number',
+          label: '数字',
+        },
+        {
+          value: 'email',
+          label: '邮件',
+        },
+        {
+          value: 'data',
+          label: '日期',
+        },
+        {
+          value: 'time',
+          label: '时间',
+        },
+        {
+          value: 'id',
+          label: '身份证',
+        },
+        {
+          value: 'phone',
+          label: '手机号',
+        },
+        {
+          value: 'img',
+          label: '图片',
+        },
+      ],
+      headTab: [
+        { title: '基础信息', name: '1' },
+        { title: '规格库存', name: '2' },
+        { title: '商品详情', name: '3' },
+        { title: '物流设置', name: '4' },
+        { title: '营销设置', name: '5' },
+        { title: '其他设置', name: '6' },
+        { title: "适用门店", name: "8" },
+        { title: '商品评论', name: '7' },
+      ],
+      productType: [
+        { name: '普通商品', title: '物流发货', id: 0 },
+        { name: '卡密/网盘', title: '自动发货', id: 1 },
+        { name: '虚拟商品', title: '虚拟发货', id: 3 },
+        { name: "次卡商品", title: "到店核销", id: 4 },
+      ],
+      virtualList: [],
+      carMyShow: false, //是否开启卡密弹窗
+      recommend: [], //商品推荐
+      customBtn: false, //自定义留言开关
+      attrShow: false,
+      content: '',
+      contents: '',
+      seletVideo: 0,
+      fileUrl: Setting.apiBaseURL + '/file/upload',
+      fileUrl2: Setting.apiBaseURL + '/file/video_upload',
+      upload_type: '', //视频上传类型 1 本地上传 2 3 4 OSS上传
+      uploadData: {}, // 上传参数
+      header: {},
+      dataLabel: [],
+      storeDataLabel: [],
+      labelShow: false,
+      storeLabelShow: false,
+      props: { emitPath: false, multiple: true, checkStrictly: true },
+      type: 0,
+      goodsModals: false,
+      off_show: 0,
+      modals: false,
+      spinShow: false,
+      openSubimit: false,
+      grid2: {
+        xl: 10,
+        lg: 12,
+        md: 12,
+        sm: 24,
+        xs: 24,
+      },
+      grid3: {
+        xl: 18,
+        lg: 18,
+        md: 20,
+        sm: 24,
+        xs: 24,
+      },
+      // 批量设置表格data
+      oneFormBatch: [
+        {
+          attr: '全部',
+          pic: '',
+          price: 0,
+		  settle_price: 0,
+          cost: 0,
+          ot_price: 0,
+          stock: 0,
+          bar_code: '',
+          code: '',
+          weight: 0,
+          volume: 0,
+        },
+      ],
+      // 规格数据
+      formDynamic: {
+        attrsName: '',
+        attrsVal: '',
+      },
+      formDynamicNameData: [],
+      isBtn: false,
+      columnsCarMy: [],
+      columns2: [
+        {
+          title: '商品规格',
+          slot: 'attr',
+          align: 'center',
+          minWidth: 80,
+        },
+        {
+          title: '图片',
+          slot: 'pic',
+          align: 'center',
+          minWidth: 80,
+        },
+        {
+          title: '售价',
+          slot: 'price',
+          align: 'center',
+          minWidth: 95,
+        },
+        {
+          title: '成本价',
+          slot: 'cost',
+          align: 'center',
+          minWidth: 95,
+        },
+        {
+          title: '原价',
+          slot: 'ot_price',
+          align: 'center',
+          minWidth: 95,
+        },
+        {
+          title: '库存',
+          slot: 'stock',
+          align: 'center',
+          minWidth: 95,
+        },
+        {
+          title: '商品条形码',
+          slot: 'bar_code',
+          align: 'center',
+          minWidth: 120,
+        },
+        {
+          title: '商品编号',
+          slot: 'code',
+          align: 'center',
+          minWidth: 120,
+        },
+        {
+          title: '重量(KG)',
+          slot: 'weight',
+          align: 'center',
+          minWidth: 95,
+        },
+        {
+          title: '体积(m³)',
+          slot: 'volume',
+          align: 'center',
+          minWidth: 95,
+        },
+        {
+          title: '操作',
+          slot: 'action',
+          // fixed: "right",
+          align: 'center',
+          minWidth: 140,
+        },
+      ],
+      columns: [],
+      columnsInstall: [],
+      columnsInstal2: [],
+      gridPic: {
+        xl: 6,
+        lg: 8,
+        md: 12,
+        sm: 12,
+        xs: 12,
+      },
+      gridBtn: {
+        xl: 4,
+        lg: 8,
+        md: 8,
+        sm: 8,
+        xs: 8,
+      },
+      formValidate: {
+        system_form_id: 0, //自定义表单
+        supplier_id: 0, //供应商
+        is_presale_product: 0, //预售商品开关
+        is_limit: 0, //是否限购开关
+        limit_type: 1, //1单次限购,2长期限购
+        limit_num: 1, //限购数量
+        is_vip_product: 0, //付费会员专属开关
+        is_support_refund: 0,
+        disk_info: '', //卡密简介
+        presale_day: 1, //预售发货时间-结束
+        presale_time: [],
+        auto_on_time: '',
+        video_open: false, //视频按钮是否显示
+        store_name: '',
+        freight: 1, //运费设置
+        postage: 0, //设置运费金额
+        custom_form: [], //自定义留言
+        cate_id: [],
+        label_id: [],
+        ensure_id: [],
+        keyword: '',
+        applicable_type: 1,
+        unit_name: '',
+        specs_id: 0,
+        store_info: '',
+        bar_code: '',
+        code: '',
+        image: '',
+        recommend_image: '',
+        slider_image: [],
+        description: '',
+        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: [],
+        items: [
+          {
+            pic: '',
+            price: 0,
+            cost: 0,
+            ot_price: 0,
+            stock: 0,
+            bar_code: '',
+            code: '',
+          },
+        ],
+        activity: ['默认', '秒杀', '砍价', '拼团'],
+        couponName: [],
+        header: [],
+        selectRule: '',
+        coupon_ids: [],
+        command_word: '',
+        delivery_type: ['1'],
+        specs: [],
+        recommend_list: [],
+        brand_id: [],
+        product_type: 0,
+      },
+      ruleList: [],
+      templateList: [],
+      createBnt: false,
+      showIput: false,
+      manyFormValidate: [],
+      // 单规格表格data
+      oneFormValidate: [
+        {
+          pic: '',
+          price: 0,
+		  settle_price: 0,
+          cost: 0,
+          ot_price: 0,
+          stock: 0,
+          bar_code: '',
+          code: '',
+          weight: 0,
+          volume: 0,
+          brokerage: 0,
+          brokerage_two: 0,
+          vip_price: 0,
+          virtual_list: [],
+          write_times: 0, //核销次数
+          write_valid: 1, //核销时效
+          days: 1
+        },
+      ],
+      images: [],
+      imagesTable: '',
+      currentTab: '1',
+      isChoice: '',
+      grid: {
+        xl: 8,
+        lg: 8,
+        md: 12,
+        sm: 24,
+        xs: 24,
+      },
+      loading: false,
+      modalPic: false,
+      template: false,
+      uploadList: [],
+      treeSelect: [],
+      labelSelect: [],
+      ensureData: [],
+      specsData: [],
+      picTit: '',
+      tableIndex: 0,
+      ruleValidate: {
+        store_name: [
+          { required: true, message: '请输入商品名称', trigger: 'blur' },
+        ],
+        cate_id: [
+          {
+            required: true,
+            message: '请选择商品分类',
+            trigger: 'change',
+            type: 'array',
+          },
+        ],
+        keyword: [
+          { required: true, message: '请输入商品关键字', trigger: 'blur' },
+        ],
+        unit_name: [
+          {
+            required: true,
+            message: '请输入单位',
+            trigger: 'change',
+          },
+        ],
+        store_info: [
+          { required: true, message: '请输入商品简介', trigger: 'blur' },
+        ],
+        //image: [{ required: true, message: "请上传商品图", trigger: "change" }],
+        slider_image: [
+          {
+            required: true,
+            message: '请上传商品轮播图',
+            type: 'array',
+            trigger: 'change',
+          },
+        ],
+        spec_type: [
+          { required: true, message: '请选择商品规格', trigger: 'change' },
+        ],
+        selectRule: [
+          { required: true, message: '请选择商品规格属性', trigger: 'change' },
+        ],
+        give_integral: [{ type: 'integer', message: '请输入整数' }],
+        // delivery_type:[
+        //   { required: true, type: 'array', min: 1, message: '请选择配送方式', trigger: 'change' },
+        // ]
+      },
+      manyBrokerage: 0,
+      manyBrokerageTwo: 0,
+      manyVipPrice: 0,
+      upload: {
+        videoIng: false, // 是否显示进度条;
+      },
+      videoIng: false, // 是否显示进度条;
+      progress: 0, // 进度条默认0
+      videoLink: '',
+      attrs: [],
+      activity: {
+        默认: 'colorBlue',
+        秒杀: 'colorBlue',
+        砍价: 'colorBlue',
+        拼团: 'colorBlue',
+      },
+      couponName: [],
+      updateIds: [],
+      updateName: [],
+      rakeBack: [
+        {
+          title: '一级返佣',
+          slot: 'brokerage',
+          align: 'center',
+          width: 95,
+        },
+        {
+          title: '二级返佣',
+          slot: 'brokerage_two',
+          align: 'center',
+          width: 95,
+        },
+      ],
+      member: [
+        {
+          title: '会员价',
+          slot: 'vip_price',
+          align: 'center',
+          width: 95,
+        },
+      ],
+      headerCarMy: {
+        title: '卡密设置',
+        slot: 'fictitious',
+        align: 'center',
+        width: 95,
+      },
+      columnsInstalM: [],
+      moveIndex: '',
+      goodsData: [],
+      brandData: [],
+      unitNameList: [],
+      formBrand: {},
+      attrsList: [],
+      activeAtter: [],
+      tabIndex: 0,
+      tabName: '',
+      attrData: [],
+      datePickerOptions: {
+        disabledDate(date) {
+          return date && date.valueOf() < Date.now() - 86400000;
+        },
+      },
+      openErp: false,
+      replyColumns: [
+        {
+          title: '评论ID',
+          key: 'id',
+          width: 80,
+        },
+        {
+          title: '商品信息',
+          slot: 'info',
+          minWidth: 250,
+        },
+        // {
+        //   title: '用户名称',
+        //   key: 'nickname',
+        //   minWidth: 150,
+        // },
+        // {
+        //   title: '评分',
+        //   key: 'score',
+        //   sortable: true,
+        //   minWidth: 70,
+        // },
+        {
+          title: '评价内容',
+          slot: 'content',
+          minWidth: 300,
+        },
+        // {
+        //   title: '回复内容',
+        //   slot: 'reply',
+        //   minWidth: 160,
+        // },
+        {
+          title: '评价时间',
+          key: 'add_time',
+          sortable: true,
+          width: 150,
+        },
+        {
+          title: '操作',
+          slot: 'action',
+          // fixed: 'right',
+          width: 150,
+        },
+      ],
+      replyData: [],
+      replyLoading: false,
+      replyModal: false,
+      rows: {},
+      replyForm: {
+        content: '',
+      },
+      ruleInline: {
+        content: [
+          { required: true, message: '请输入回复内容', trigger: 'blur' },
+        ],
+      },
+      replyValidate: {
+        is_reply: '',
+        data: '',
+        store_name: '',
+        account: '',
+        product_id: this.productId,
+        page: 1,
+        limit: 15,
+      },
+      total: 0,
+      merchantType: 0,
+      formList: [],
+      storeColumns: [
+        {
+          title: "ID",
+          key: "id",
+          width: 60,
+        },
+        {
+          title: "门店图片",
+          slot: "image",
+          minWidth: 80,
+        },
+        {
+          title: "门店分类",
+          key: "cate_name",
+          minWidth: 80,
+        },
+        {
+          title: "门店名称",
+          key: "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",
+          width: 100,
+        }
+      ]
+    };
+  },
+  computed: {
+    ...mapState('admin/layout', ['isMobile', 'menuCollapse']),
+    labelWidth() {
+      return this.isMobile ? undefined : 120;
+    },
+    labelPosition() {
+      return this.isMobile ? 'top' : 'right';
+    },
+    labelBottom() {
+      return this.isMobile ? undefined : 15;
+    },
+    startPickOptions() {
+      const that = this;
+      return {
+        disabledDate(time) {
+          if (that.formValidate.auto_off_time) {
+            return (
+                time.getTime() >
+                new Date(that.formValidate.auto_off_time).getTime() - 86400000
+            );
+          }
+          return '';
+        },
+      };
+    },
+    endPickOptions() {
+      const that = this;
+      return {
+        disabledDate(time) {
+          if (that.formValidate.is_show == '1') {
+            return time.getTime() < Date.now();
+          }
+          if (that.formValidate.auto_on_time) {
+            return (
+                time.getTime() <
+                new Date(that.formValidate.auto_on_time).getTime() + 86400000
+            );
+          }
+          return '';
+        },
+      };
+    },
+  },
+  created() {
+    this.getSupplierList();
+    this.columns = this.columns2.slice(1, 10);
+    let data = JSON.parse(JSON.stringify(this.columns2));
+    data.splice(8, 2, this.headerCarMy);
+    this.columnsCarMy = data;
+    let fictitious = JSON.parse(JSON.stringify(this.columns2));
+    fictitious.splice(8, 2);
+    this.columnsFictitious = fictitious;
+    this.getToken();
+    this.getErpConfig();
+    // this.columnsInstall = this.columns2.slice(0, 4).concat(this.columnsInstall);
+    // this.columnsInsta8 = this.columns2.slice(0, 4).concat(this.columnsInsta8);
+  },
+  mounted() {
+    this.setCopyrightShow({ value: false });
+    // if (this.productId !== '0' && this.productId) {
+    //   this.getInfo();
+    // } else if (this.productId === '0') {
+    //   productCache()
+    //       .then((res) => {
+    //         let data = res.data.info;
+    //         if (!Array.isArray(data)) {
+    //           let cate_id = data.cate_id.map(Number);
+    //           let label_id = data.label_id.map(Number);
+    //           this.attrs = data.items || [];
+    //           let ids = [];
+    //           // let names = [];
+    //           if (data.coupons) {
+    //             data.coupons.map((item) => {
+    //               ids.push(item.id);
+    //               // names.push(item.title);
+    //             });
+    //             this.couponName = data.coupons;
+    //           }
+    //           this.storesList = data.stores || [];
+    //           let brandIds = [];
+    //           data.brand_id.forEach(item=>{
+    //             brandIds.push(item.toString())
+    //           })
+    //           this.formValidate = data;
+    //           // this.couponName = data.coupons;
+    //           // that.couponName = names;
+    //           this.formValidate.brand_id = brandIds;
+    //           this.formValidate.coupon_ids = ids;
+    //           this.formValidate.is_limit = this.formValidate.is_limit ? 1 : 0;
+    //           this.formValidate.limit_type = parseInt(
+    //               this.formValidate.limit_type
+    //           );
+    //           this.formValidate.is_support_refund = parseInt(
+    //               this.formValidate.is_support_refund
+    //           );
+    //           this.updateIds = ids;
+    //           this.updateName = data.coupons;
+    //           this.formValidate.cate_id = cate_id;
+    //           this.dataLabel = data.label_id;
+    //           this.storeDataLabel = data.store_label_id;
+    //           this.specsList = data.specs;
+    //           this.oneFormValidate = data.attrs;
+    //           this.formValidate.header = [];
+    //           this.generate(0);
+    //           this.addmanyData(data.attrs);
+    //           this.productTypeTap(2);
+    //           this.columns = this.columns2.slice(1, 10);
+    //           //this.manyFormValidate = data.attrs;
+    //           this.formValidate.system_form_id = data.system_form_id || 0;
+    //           if (this.formValidate.system_form_id) {
+    //             this.customBtn = true;
+    //           }
+    //           this.spec_type = data.spec_type;
+    //           if (data.spec_type === 0) {
+    //             this.manyFormValidate = [];
+    //           } else {
+    //             this.createBnt = true;
+    //             this.oneFormValidate = [
+    //               {
+    //                 pic: data.slider_image[0],
+    //                 price: 0,
+    //                 cost: 0,
+    //                 ot_price: 0,
+    //                 stock: 0,
+    //                 bar_code: '',
+    //                 code: '',
+    //                 weight: 0,
+    //                 volume: 0,
+    //                 brokerage: 0,
+    //                 brokerage_two: 0,
+    //                 vip_price: 0,
+    //                 virtual_list: [],
+    //                 write_times: 0, //核销次数
+    //                 write_valid: 1, //核销时效
+    //                 days: 1
+    //               },
+    //             ];
+    //           }
+    //           this.spinShow = false;
+    //         }
+    //       })
+    //       .catch((err) => {
+    //         this.$Message.error(err.msg);
+    //       });
+    // }
+  },
+  destroyed() {
+    this.setCopyrightShow({ value: true });
+  },
+  methods: {
+    ...mapMutations('admin/layout', ['setCopyrightShow']),
+    changeForm(e){
+      this.getSystemFormInfo(e,{type:1});
+    },
+    getSystemFormInfo(e,data){
+      systemFormInfo(e,data).then(res=>{
+        this.formTypeList = res.data.info;
+      }).catch(err=>{
+        this.$Message.error(err.msg);
+      })
+    },
+    //删除门店
+    delte(index){
+      this.storesList.splice(index, 1)
+    },
+    //添加门店
+    addStore(){
+      this.storeModals = true;
+    },
+    //关闭门店弹窗
+    cancelStore(){
+      this.storeModals = false;
+    },
+    allFormList(){
+      allSystemForm().then(res=>{
+        this.formList = res.data;
+      }).catch(err=>{
+        this.$Message.error(err.msg);
+      })
+    },
+    limitTap(e) {
+      if (e) {
+        this.formValidate.limit_type =
+            this.formValidate.is_limit && !this.formValidate.limit_type ? 1 : 0;
+        this.formValidate.limit_num =
+            this.formValidate.is_limit && this.formValidate.limit_num == 0
+                ? 1
+                : 0;
+      } else {
+        this.formValidate.limit_type = 0;
+        this.formValidate.limit_num = 0;
+      }
+    },
+    //erp配置
+    getErpConfig() {
+      erpConfig()
+          .then((res) => {
+            this.openErp = res.data.open_erp;
+          })
+          .catch((err) => {
+            this.$Message.error(err.msg);
+          });
+    },
+    delSpecs(index) {
+      this.specsList.splice(index, 1);
+    },
+    addSpecs() {
+      let obj = { name: '', value: '', sort: 0 };
+      this.specsList.push(obj);
+    },
+    specsInfo(e) {
+      this.specsData.forEach((item) => {
+        if (item.id == e) {
+          this.specsList = item.specs;
+        }
+      });
+    },
+    getProductAllSpecs() {
+      productAllSpecs()
+          .then((res) => {
+            this.specsData = res.data;
+          })
+          .catch((err) => {
+            this.$Message.error(err.msg);
+          });
+    },
+    getProductAllEnsure() {
+      productAllEnsure()
+          .then((res) => {
+            this.ensureData = res.data;
+          })
+          .catch((err) => {
+            this.$Message.error(err.msg);
+          });
+    },
+    //添加倒入卡密的值
+    changeVirtual(e) {
+      this.virtualList = this.virtualList.concat(e);
+    },
+    //添加卡密
+    addVirtual(index, name) {
+      this.tabIndex = index;
+      this.tabName = name;
+      this.virtualListClear();
+      this.$refs.addCarMy.fixedCar = {
+        disk_info: '',
+        stock: 0,
+      };
+      this.$refs.addCarMy.cartMyType = 1;
+      this.carMyShow = true;
+    },
+    //确认提交卡密
+    fixdBtn(e) {
+      if (e.cartMyType == 1) {
+        this.$set(this[this.tabName][this.tabIndex], 'disk_info', e.disk_info);
+        this.$set(this[this.tabName][this.tabIndex], 'stock', Number(e.stock));
+        this[this.tabName][this.tabIndex].virtual_list = [];
+      } else {
+        this.$set(
+            this[this.tabName][this.tabIndex],
+            'virtual_list',
+            e.virtualList
+        );
+        this.$set(
+            this[this.tabName][this.tabIndex],
+            'stock',
+            e.virtualList.length
+        );
+        this[this.tabName][this.tabIndex].disk_info = '';
+      }
+      this.carMyShow = false;
+    },
+    closeCarMy() {
+      this.carMyShow = false;
+    },
+    //清空卡密
+    virtualListClear() {
+      this.virtualList = [
+        {
+          key: '',
+          value: '',
+        },
+      ];
+    },
+    seeVirtual(data, name, index) {
+      this.tabName = name;
+      this.tabIndex = index;
+      this.virtualListClear();
+      this.$refs.addCarMy.fixedCar = {
+        disk_info: '',
+        stock: 0,
+      };
+      if (data.virtual_list && data.virtual_list.length) {
+        this.$refs.addCarMy.cartMyType = 2;
+        this.virtualList = data.virtual_list;
+      } else if (data.disk_info) {
+        this.$refs.addCarMy.cartMyType = 1;
+        this.$refs.addCarMy.fixedCar.disk_info = data.disk_info;
+        this.$refs.addCarMy.fixedCar.stock = data.stock;
+      }
+      this.carMyShow = true;
+    },
+    //动态添加组件
+    addAssembly() {
+      this.formValidate.custom_form.push({
+        title: '',
+        label: 'text',
+        value: '',
+        status: 0,
+      });
+    },
+    customMessBtn(e) {
+      if (!e) {
+        this.formValidate.system_form_id = 0;
+      }
+    },
+    addcustom() {
+      if (this.formValidate.custom_form.length > 9) {
+        this.$Message.warning('最多添加10条');
+      } else {
+        this.addAssembly();
+      }
+    },
+    delcustom(index) {
+      this.formValidate.custom_form.splice(index, 1);
+    },
+    // 预售具体日期
+    onchangeTime(e) {
+      this.formValidate.presale_time = e;
+    },
+    //定时上架
+    onchangeShow(e) {
+      this.formValidate.auto_on_time = e;
+    },
+    //定时下架
+    onchangeOff(e) {
+      this.formValidate.auto_off_time = e;
+    },
+    // 获取供应商内容
+    getSupplierList() {
+      getSupplierList()
+          .then(async (res) => {
+            this.supplierList = res.data;
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
+    },
+    //打开属性
+    batchAttr() {
+      this.attrShow = true;
+      // if(!this.activeAtter.length){
+      //  let data = this.attrs;
+      //  data.map(el=>{
+      //  			el.details = [];
+      //  	el.detail.map(label=>{
+      //  		el.details.push({
+      //  			name:label,
+      //  			select:false
+      //  		})
+      //  	})
+      //  })
+      //  this.attrsList = data;
+      // }
+    },
+    //获取属性
+    getAttr() {
+      this.oneFormBatch[0].attr = '全部';
+      let data = this.attrs;
+      data.map((el) => {
+        el.details = [];
+        el.detail.map((label) => {
+          el.details.push({
+            name: label,
+            select: false,
+          });
+        });
+      });
+      this.attrsList = data;
+    },
+    //选中属性
+    activeAttr(e) {
+      this.attrsList = e;
+    },
+    //关闭属性弹窗
+    labelAttr() {
+      this.attrShow = false;
+    },
+    //多属性为空
+    manyEmpty(j) {
+      j.pic = '';
+      j.price = 0;
+	  j.settle_price = 0;
+      j.cost = 0;
+      j.ot_price = 0;
+      j.stock = 0;
+      j.bar_code = '';
+      j.code = '';
+      j.weight = 0;
+      j.volume = 0;
+      j.virtual_list = [];
+    },
+
+    doCombination(arr) {
+      var count = arr.length - 1; //数组长度(从0开始)
+      var tmp = [];
+      var totalArr = []; // 总数组
+
+      return doCombinationCallback(arr, 0); //从第一个开始
+      //js 没有静态数据,为了避免和外部数据混淆,需要使用闭包的形式
+      function doCombinationCallback(arr, curr_index) {
+        for (let val of arr[curr_index]) {
+          tmp[curr_index] = val; //以curr_index为索引,加入数组
+          //当前循环下标小于数组总长度,则需要继续调用方法
+          if (curr_index < count) {
+            doCombinationCallback(arr, curr_index + 1); //继续调用
+          } else {
+            totalArr.push(tmp.join(',')); //(直接给push进去,push进去的不是值,而是值的地址)
+          }
+
+          //js  对象都是 地址引用(引用关系),每次都需要重新初始化,否则 totalArr的数据都会是最后一次的 tmp 数据;
+          let oldTmp = tmp;
+          tmp = [];
+          for (let index of oldTmp) {
+            tmp.push(index);
+          }
+        }
+        return totalArr;
+      }
+    },
+
+    //提交属性值;
+    subAttrs(e) {
+      let selectData = [];
+      this.attrsList.forEach((el, index) => {
+        let obj = [];
+        el.details.forEach((label) => {
+          if (label.select) {
+            obj.push(label.name);
+          }
+        });
+        if (obj.length) {
+          selectData.push(obj);
+        }
+      });
+      let newData = [];
+      if (selectData.length) {
+        newData = this.doCombination(selectData);
+      }
+      this.attrShow = false;
+      this.activeAtter = selectData;
+      this.oneFormBatch[0].attr = newData.length ? newData.join(';') : '全部';
+      this.manyFormValidate.forEach((j) => {
+        j.select = false;
+        if (newData.length) {
+          newData.forEach((item) => {
+            if (j.values.split('').length == item.split('').length) {
+              if (j.values == item) {
+                j.select = true;
+              }
+            } else {
+              if (j.values.indexOf(item) != -1) {
+                j.select = true;
+              }
+            }
+          });
+        } else {
+          j.select = true;
+        }
+      });
+      this.$set(this, 'manyFormValidate', this.manyFormValidate);
+    },
+    goodsOn(e) {
+      if (e == 0 || e == 1) {
+        this.formValidate.auto_on_time = '';
+      }
+    },
+    goodsOff(e) {
+      if (!e) {
+        this.formValidate.auto_off_time = '';
+      }
+    },
+    addBrand() {
+      this.$refs.menusFrom.modals = true;
+      this.$refs.menusFrom.titleFrom = '添加品牌分类';
+      this.formBrand = {
+        sort: 0,
+        is_show: 1,
+      };
+      this.formBrand.fid = [0];
+      this.$refs.menusFrom.type = 1;
+    },
+    getAllUnit() {
+      productAllUnit()
+          .then((res) => {
+            this.unitNameList = res.data;
+          })
+          .catch((err) => {
+            this.$Message.error(err.msg);
+          });
+    },
+    addClass() {
+      this.$modalForm(productCreateApi()).then(() => this.goodsCategory());
+    },
+    addUnit() {
+      this.$modalForm(productUnitCreate()).then(() => this.getAllUnit());
+    },
+    addStoreLabel() {
+      this.$modalForm(productLabelAdd()).then(() => { });
+    },
+    productTypeTap(num, item) {
+      if (num == 1) {
+        if (this.productId) return this.$Message.error('商品类型不能切换!');
+        this.formValidate.product_type = item.id;
+      }
+      if (this.formValidate.product_type && this.formValidate.product_type != 4) {
+        this.headTab = [
+          { title: '基础信息', name: '1' },
+          { title: '规格库存', name: '2' },
+          { title: '商品详情', name: '3' },
+          { title: '营销设置', name: '5' },
+          { title: '其他设置', name: '6' },
+          { title: '商品评论', name: '7' },
+        ];
+        this.formValidate.postage = 0;
+        this.formValidate.supplier_id = 0;
+      } else if(this.formValidate.product_type == 4){
+        this.headTab = [
+          { title: "基础信息", name: "1" },
+          { title: "规格库存", name: "2" },
+          { title: "商品详情", name: "3" },
+          { title: "营销设置", name: "5" },
+          { title: "其他设置", name: "6" },
+          { title: '商品评论', name: '7' },
+          { title: "适用门店", name: "8" },
+        ]
+      }else {
+        this.headTab = [
+          { title: '基础信息', name: '1' },
+          { title: '规格库存', name: '2' },
+          { title: '商品详情', name: '3' },
+          { title: '物流设置', name: '4' },
+          { title: '营销设置', name: '5' },
+          { title: '其他设置', name: '6' },
+          { title: "适用门店", name: "8" },
+          { title: '商品评论', name: '7' },
+        ];
+      }
+    },
+    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(row) {
+      this.labelShow = true;
+      this.$refs.userLabel.userLabel(
+          JSON.parse(JSON.stringify(this.dataLabel))
+      );
+    },
+    // 标签弹窗关闭
+    labelClose() {
+      this.labelShow = false;
+    },
+    closeStoreLabel(label) {
+      let index = this.storeDataLabel.indexOf(
+          this.storeDataLabel.filter((d) => d.id == label.id)[0]
+      );
+      this.storeDataLabel.splice(index, 1);
+    },
+    activeStoreData(storeDataLabel) {
+      this.storeLabelShow = false;
+      this.storeDataLabel = storeDataLabel;
+    },
+    openStoreLabel(row) {
+      this.storeLabelShow = true;
+      this.$refs.storeLabel.storeLabel(
+          JSON.parse(JSON.stringify(this.storeDataLabel))
+      );
+    },
+    // 标签弹窗关闭
+    storeLabelClose() {
+      this.storeLabelShow = false;
+    },
+    // 品牌列表
+    getBrandList() {
+      brandList()
+          .then((res) => {
+            //initBran()函数作用iview中规定value必须是字符串,后台返回成了数字,用于处理这个,给了个递归;
+            this.initBran(res.data);
+            this.brandData = res.data;
+          })
+          .catch((err) => {
+            this.$Message.error(err.msg);
+          });
+    },
+    initBran(data){
+      data.map(item=>{
+        item.value = item.value.toString();
+        if(item.children && item.children.length){
+          this.initBran(item.children);
+        }
+      })
+    },
+    getProductId(e) {
+      this.goodsModals = false;
+      let nArr = this.goodsData.concat(e).filter((element, index, self) => {
+        return (
+            self.findIndex((x) => x.product_id == element.product_id) == index
+        );
+      });
+
+      this.goodsData = nArr.slice(0, 12);
+    },
+    goodCancel() {
+      this.goodsModals = false;
+    },
+    goodsTap() {
+      this.goodsModals = true;
+      this.$refs.goodslist.handleSelectAll();
+    },
+    bindDelete(index) {
+      this.goodsData.splice(index, 1);
+    },
+    cancel() {
+      this.$router.push({ path: this.roterPre + '/product/product_list' });
+    },
+
+    videoSaveToUrl(file) {
+      let imgTypeArr = ['video/mp4'];
+      let imgType = imgTypeArr.indexOf(file.type) !== -1;
+      if (!imgType) {
+        return this.$Message.warning({
+          content: '文件  ' + file.name + '  格式不正确, 请选择格式正确的视频',
+          duration: 5,
+        });
+      }
+      uploadByPieces({
+        randoms: '', // 随机数,这里作为给后端处理分片的标识 根据项目看情况 是否要加
+        file: file, // 视频实体
+        pieceSize: 3, // 分片大小
+        success: (data) => {
+          this.formValidate.video_link = data.file_path;
+          this.progress = 100;
+        },
+        error: (e) => {
+          this.$Message.error(e.msg);
+        },
+        uploading: (chunk, allChunk) => {
+          this.videoIng = true;
+          let st = Math.floor((chunk / allChunk) * 100);
+          this.progress = st;
+        },
+      });
+      return false;
+    },
+
+    // 上传头部token
+    getToken() {
+      this.header['Authori-zation'] = 'Bearer ' + util.cookies.get('token');
+    },
+    // beforeUpload() {
+    //   this.uploadData = {};
+    //   let promise = new Promise((resolve) => {
+    //     this.$nextTick(function () {
+    //       resolve(true);
+    //     });
+    //   });
+    //   return promise;
+    // },
+    // 上传成功
+    handleSuccess(res, file, fileList) {
+      if (res.status === 200) {
+        this.formValidate.video_link = res.data.src;
+        this.$Message.success(res.msg);
+      } else {
+        this.$Message.error(res.msg);
+      }
+    },
+    //获取视频上传类型
+    uploadType() {
+      uploadType().then((res) => {
+        this.upload_type = res.data.upload_type;
+      });
+    },
+    getEditorContent(data) {
+      this.content = data;
+    },
+    infoData(data) {
+      this.storesList = data.stores || [];
+      let cate_id = data.cate_id.map(Number);
+      this.attrs = data.items || [];
+      let ids = [];
+      data.coupons.map((item) => {
+        ids.push(item.id);
+      });
+      this.goodsData = data.recommend_list;
+      if (data.auto_off_time) {
+        this.off_show = 1;
+      } else {
+        this.off_show = 0;
+      }
+      let brandIds = [];
+      data.brand_id.forEach(item=>{
+        brandIds.push(item.toString())
+      })
+      this.formValidate = data;
+      this.formTypeList = data.custom_form_info;
+      this.formValidate.brand_id = brandIds;
+      if (data.type == 2) {
+        this.formValidate.supplier_id = data.relation_id;
+      }
+      this.formValidate.is_limit = this.formValidate.is_limit ? 1 : 0;
+      this.formValidate.limit_type = parseInt(data.limit_type);
+      this.formValidate.is_support_refund = parseInt(
+          this.formValidate.is_support_refund
+      );
+      this.contents = this.content = data.description;
+      this.couponName = data.coupons;
+      this.formValidate.coupon_ids = ids;
+      this.updateIds = ids;
+      this.updateName = data.coupons;
+      this.formValidate.cate_id = cate_id;
+      this.dataLabel = data.label_id;
+      this.storeDataLabel = data.store_label_id;
+      this.specsList = data.specs;
+      if (data.attr) {
+        this.oneFormValidate = [data.attr];
+      }
+      this.formValidate.header = [];
+      this.generate(0);
+      //this.manyFormValidate = data.attrs;
+      this.addmanyData(data.attrs);
+      this.productTypeTap(2);
+      this.formValidate.system_form_id = data.system_form_id || 0;
+      if (this.formValidate.system_form_id) {
+        this.customBtn = true;
+      }else{
+        this.customBtn = false;
+      }
+      this.spec_type = data.spec_type;
+      if (data.spec_type === 0) {
+        this.manyFormValidate = [];
+      } else {
+        this.createBnt = true;
+        this.oneFormValidate = [
+          {
+            pic: '',
+            price: 0,
+			settle_price: 0,
+            cost: 0,
+            ot_price: 0,
+            stock: 0,
+            bar_code: '',
+            code: '',
+            weight: 0,
+            volume: 0,
+            brokerage: 0,
+            brokerage_two: 0,
+            vip_price: 0,
+            virtual_list: [],
+            write_times: 0, //核销次数
+            write_valid: 1, //核销时效
+            days: 1
+          },
+        ];
+      }
+    },
+    //关闭淘宝弹窗并生成数据;
+    onClose(data) {
+      this.modals = false;
+      this.infoData(data);
+    },
+
+    checkMove(evt) {
+      this.moveIndex = evt.draggedContext.index;
+    },
+    end() {
+      this.moveIndex = '';
+    },
+    checkAllGroupChange(data) {
+      this.checkAllGroup(data);
+    },
+    checkAllGroup(data) {
+      if (this.formValidate.spec_type === 0) {
+        if (data.indexOf(0) > -1) {
+          this.columnsInstall = this.columns2.slice(1, 5).concat(this.member);
+        } else if (data.indexOf(1) > -1) {
+          this.columnsInstall = this.columns2.slice(1, 5).concat(this.rakeBack);
+        } else {
+          this.columnsInstall = this.columns2.slice(1, 5);
+        }
+        if (data.length === 2) {
+          this.columnsInstall = this.columns2
+              .slice(1, 5)
+              .concat(this.rakeBack)
+              .concat(this.member);
+        }
+      } else {
+        if (data.indexOf(0) > -1) {
+          this.columnsInstal2 = this.columnsInstalM
+              .slice(0, 4)
+              .concat(this.member);
+        } else if (data.indexOf(1) > -1) {
+          this.columnsInstal2 = this.columnsInstalM
+              .slice(0, 4)
+              .concat(this.rakeBack);
+        } else {
+          this.columnsInstal2 = this.columnsInstalM.slice(0, 4);
+        }
+        if (data.length === 2) {
+          this.columnsInstal2 = this.columnsInstalM
+              .slice(0, 4)
+              .concat(this.rakeBack)
+              .concat(this.member);
+        }
+      }
+    },
+    // 添加优惠券
+    addCoupon() {
+      this.$refs.couponTemplates.isTemplate = true;
+      this.$refs.couponTemplates.tableList();
+    },
+    //对象数组去重;
+    unique(arr) {
+      const res = new Map();
+      return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
+    },
+    nameId(id, names) {
+      this.formValidate.coupon_ids = id;
+      this.couponName = this.unique(names);
+    },
+    handleClose(name) {
+      let index = this.couponName.indexOf(name);
+      this.couponName.splice(index, 1);
+      let couponIds = this.formValidate.coupon_ids;
+      couponIds.splice(index, 1);
+      this.updateIds = couponIds;
+      this.updateName = this.couponName;
+    },
+    getStoreId (data) {
+      this.storeModals = false;
+      let list = this.storesList.concat(data);
+      let uni = this.unique(list);
+      this.storesList = uni;
+    },
+    // 运费模板
+    getList() {
+      this.productGetTemplate();
+    },
+    // 添加运费模板
+    addTemp() {
+      this.$refs.templates.isTemplate = true;
+    },
+    // 删除视频;
+    delVideo() {
+      let that = this;
+      that.$set(that.formValidate, 'video_link', '');
+      that.$set(that, 'progress', 0);
+      that.videoIng = false;
+      that.upload.videoIng = false;
+      that.$refs.refid.value = '';
+    },
+    zh_uploadFile() {
+      if (this.seletVideo == 1) {
+        if (this.videoLink && this.$getFileType(this.videoLink) == 'video') {
+          this.formValidate.video_link = this.videoLink;
+        } else {
+          return this.$Message.error('请输入正确的视频链接');
+        }
+      } else {
+        this.$refs.refid.click();
+      }
+    },
+    zh_uploadFile_change(evfile) {
+      let that = this;
+      let suffix = evfile.target.files[0].name.substr(
+          evfile.target.files[0].name.indexOf('.')
+      );
+      if (suffix.indexOf('.mp4') === -1) {
+        return that.$Message.error('只能上传MP4文件');
+      }
+	  let types = {
+		  key: evfile.target.files[0].name,
+		  contentType: evfile.target.files[0].type,
+	  };
+      productGetTempKeysApi(types)
+          .then((res) => {
+            that.$videoCloud
+                .videoUpload({
+                  type: res.data.type,
+                  evfile: evfile,
+                  res: res,
+                  uploading(status, progress) {
+                    that.upload.videoIng = status;
+                    if (res.status == 200) {
+                      that.progress = 100;
+                    }
+                  },
+                })
+                .then((res) => {
+                  that.formValidate.video_link = res.url;
+                  that.$Message.success('视频上传成功');
+                  that.upload.videoIng = false;
+                })
+                .catch((res) => {
+                  that.$Message.error(res);
+                });
+          })
+          .catch((res) => {
+            that.$Message.error(res.msg);
+          });
+    },
+    // 上一页;
+    upTab() {
+      if (this.currentTab == 5 && this.formValidate.product_type != 0) {
+        this.currentTab = (Number(this.currentTab) - 2).toString();
+      } else {
+        this.currentTab = (Number(this.currentTab) - 1).toString();
+      }
+    },
+    // 下一页;
+    downTab(name) {
+      this.$refs[name].validate((valid) => {
+        if (valid) {
+          if (
+              this.formValidate.is_show == 2 &&
+              !this.formValidate.auto_on_time
+          ) {
+            return this.$Message.warning('请填写定时上架时间');
+          }
+          if (this.off_show == 1 && !this.formValidate.auto_off_time) {
+            return this.$Message.warning('请填写定时下架时间');
+          }
+          if (this.currentTab == 4 && !this.formValidate.delivery_type.length) {
+            return this.$Message.warning('请选择配送方式');
+          }
+          if (this.currentTab == 3 && this.formValidate.product_type != 0) {
+            this.currentTab = (Number(this.currentTab) + 2).toString();
+          } else {
+            this.currentTab = (Number(this.currentTab) + 1).toString();
+          }
+        } else {
+          this.$Message.warning('请完善数据');
+        }
+      });
+    },
+    // 属性弹窗回调函数;
+    userSearchs() {
+      this.productGetRule();
+    },
+    // 添加规则;
+    addRule() {
+      this.$refs.addattr.modal = true;
+    },
+    // 批量设置分佣;
+    brokerageSetUp() {
+      let that = this;
+      if (that.formValidate.is_sub.indexOf(1) > -1) {
+        if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
+          return that.$Message.error('请填写返佣金额后进行批量添加');
+        }
+      } else if (that.formValidate.is_sub.indexOf(0) > -1) {
+        if (that.manyVipPrice <= 0) {
+          return that.$Message.error('请填写会员价后进行批量添加');
+        }
+      }
+      if (this.formValidate.is_sub.length === 2) {
+        if (
+            that.manyBrokerage <= 0 ||
+            that.manyBrokerageTwo <= 0 ||
+            that.manyVipPrice <= 0
+        ) {
+          return that.$Message.error('请填写完金额后进行批量添加');
+        }
+      }
+      for (let val of that.manyFormValidate) {
+        this.$set(val, 'brokerage', that.manyBrokerage);
+        this.$set(val, 'brokerage_two', that.manyBrokerageTwo);
+        this.$set(val, 'vip_price', that.manyVipPrice);
+      }
+      // let that = this;
+      // if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
+      //     return that.$Message.error('请填写返佣金额在进行批量添加');
+      // } else {
+      //     for (let val of that.manyFormValidate) {
+      //         this.$set(val, 'brokerage', that.manyBrokerage);
+      //         this.$set(val, 'brokerage_two', that.manyBrokerageTwo);
+      //     }
+      // }
+    },
+    // 批量设置会员价
+    vipPriceSetUp() {
+      let that = this;
+      if (that.manyVipPrice <= 0) {
+        return that.$Message.error('请填写会员价在进行批量添加');
+      } else {
+        for (let val of that.manyFormValidate) {
+          this.$set(val, 'vip_price', that.manyVipPrice);
+        }
+      }
+    },
+    batchDel() {
+      this.oneFormBatch = [
+        {
+          attr: '全部',
+          pic: '',
+          price: 0,
+		  settle_price: 0,
+          cost: 0,
+          ot_price: 0,
+          stock: 0,
+          bar_code: '',
+          code: '',
+          weight: 0,
+          volume: 0,
+          virtualList: [],
+          disk_info: '',
+        },
+      ];
+      this.activeAtter = [];
+      for (let val of this.manyFormValidate) {
+        val.select = true;
+      }
+    },
+    confirm() {
+      let that = this;
+      that.createBnt = true;
+      if (that.formValidate.selectRule.trim().length <= 0) {
+        return that.$Message.error('请选择属性');
+      }
+      that.ruleList.forEach(function (item, index) {
+        if (item.rule_name === that.formValidate.selectRule) {
+          that.attrs = item.rule_value;
+        }
+      });
+    },
+    // 获取商品属性模板;
+    productGetRule() {
+      productGetRuleApi().then((res) => {
+        this.ruleList = res.data;
+      });
+    },
+    // 获取运费模板;
+    productGetTemplate() {
+      productGetTemplateApi({id:this.productId}).then((res) => {
+        this.templateList = res.data;
+      });
+    },
+    // 删除表格中的属性
+    delAttrTable(index) {
+      let id = this.productId;
+      if (id) {
+        checkActivityApi(id)
+            .then((res) => {
+              this.manyFormValidate.splice(index, 1);
+              this.$Message.success(res.msg);
+            })
+            .catch((res) => {
+              this.$Message.error(res.msg);
+            });
+      } else {
+        this.manyFormValidate.splice(index, 1);
+      }
+    },
+    // 批量添加
+    batchAdd() {
+      for (let val of this.manyFormValidate) {
+        //this.manyEmpty(val);
+        if (val.select) {
+          if (this.oneFormBatch[0].pic) {
+            this.$set(val, 'pic', this.oneFormBatch[0].pic);
+          }
+          if (this.oneFormBatch[0].price > 0) {
+            this.$set(val, 'price', this.oneFormBatch[0].price);
+          }
+		  if (this.oneFormBatch[0].settle_price > 0 && this.merchantType == 2) {
+		    this.$set(val, "settle_price", this.oneFormBatch[0].settle_price);
+		  }
+          if (this.oneFormBatch[0].cost > 0) {
+            this.$set(val, 'cost', this.oneFormBatch[0].cost);
+          }
+          if (this.oneFormBatch[0].ot_price > 0) {
+            this.$set(val, 'ot_price', this.oneFormBatch[0].ot_price);
+          }
+          if (this.oneFormBatch[0].stock > 0) {
+            this.$set(val, 'stock', this.oneFormBatch[0].stock);
+          }
+          if (this.oneFormBatch[0].bar_code !== '') {
+            this.$set(val, 'bar_code', this.oneFormBatch[0].bar_code);
+          }
+          if (this.oneFormBatch[0].code !== '') {
+            this.$set(val, 'code', this.oneFormBatch[0].code);
+          }
+          if (this.oneFormBatch[0].weight > 0) {
+            this.$set(val, 'weight', this.oneFormBatch[0].weight);
+          }
+          if (this.oneFormBatch[0].volume > 0) {
+            this.$set(val, 'volume', this.oneFormBatch[0].volume);
+          }
+          if (this.formValidate.product_type == 1) {
+            if (
+                this.oneFormBatch[0].virtual_list &&
+                this.oneFormBatch[0].virtual_list.length
+            ) {
+              this.$set(val, 'virtual_list', this.oneFormBatch[0].virtual_list);
+            } else if (this.oneFormBatch[0].disk_info) {
+              this.$refs.addCarMy.cartMyType = 1;
+              this.$set(val, 'disk_info', this.oneFormBatch[0].disk_info);
+            }
+          }
+        }
+      }
+    },
+    // 添加按钮
+    addBtn() {
+      let id = this.productId;
+      if (id) {
+        checkActivityApi(id)
+            .then((res) => {
+              this.clearAttr();
+              this.createBnt = false;
+              this.showIput = true;
+            })
+            .catch((res) => {
+              this.$Message.error(res.msg);
+            });
+      }
+    },
+    addmanyData(data) {
+      data.forEach((item) => {
+        item.select = true;
+      });
+      this.manyFormValidate = data;
+    },
+    // 立即生成
+    generate(type) {
+      generateAttrApi(
+          { attrs: this.attrs, product_type: this.formValidate.product_type },
+          this.formValidate.id,
+          type
+      )
+          .then((res) => {
+            let info = res.data.info,
+                header1 = JSON.parse(JSON.stringify(info.header));
+            if (this.productId !== '0') {
+              this.addmanyData(info.value);
+            }
+            this.formValidate.header = header1;
+            this.attrData = res.data.info.attr;
+            let header = info.header;
+            header.pop();
+            this.columnsInstalM = info.header;
+            this.checkAllGroup(this.formValidate.is_sub);
+            if (!this.productId && this.formValidate.spec_type === 1) {
+              this.manyFormValidate.map((item) => {
+                item.pic = this.formValidate.slider_image[0];
+              });
+              this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
+            } else if (this.productId) {
+              this.manyFormValidate.map((item) => {
+                if (!item.pic) {
+                  item.pic = this.formValidate.slider_image[0];
+                }
+              });
+              this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
+            }
+            this.getAttr();
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
+    },
+    // 取消
+    offAttrName() {
+      this.showIput = false;
+      this.createBnt = true;
+    },
+    clearAttr() {
+      this.formDynamic.attrsName = '';
+      this.formDynamic.attrsVal = '';
+    },
+    // 删除规格
+    handleRemoveRole(index) {
+      this.attrs.splice(index, 1);
+      this.manyFormValidate.splice(index, 1);
+    },
+    // 删除属性
+    handleRemove2(item, index) {
+      item.splice(index, 1);
+    },
+    // 添加规则名称
+    createAttrName() {
+      if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
+        let data = {
+          value: this.formDynamic.attrsName,
+          detail: [this.formDynamic.attrsVal],
+        };
+        this.attrs.push(data);
+        var hash = {};
+        this.attrs = this.attrs.reduce(function (item, next) {
+          /* eslint-disable */
+          hash[next.value] ? '' : (hash[next.value] = true && item.push(next));
+          return item;
+        }, []);
+        this.clearAttr();
+        this.showIput = false;
+        this.createBnt = true;
+      } else {
+        this.$Message.warning('请添加完整的规格!');
+      }
+    },
+    // 添加属性
+    createAttr(num, idx) {
+      if (num) {
+        this.attrs[idx].detail.push(num);
+        var hash = {};
+        this.attrs[idx].detail = this.attrs[idx].detail.reduce(function (
+                item,
+                next
+            ) {
+              /* eslint-disable */
+              hash[next] ? '' : (hash[next] = true && item.push(next));
+              return item;
+            },
+            []);
+      } else {
+        this.$Message.warning('请添加属性');
+      }
+    },
+    // 商品分类;
+    goodsCategory() {
+      cascaderListApi(1)
+          .then((res) => {
+            this.treeSelect = res.data;
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
+    },
+    //视视上传类型
+    changeVideo(e) {
+      this.formValidate.video_link = '';
+      this.videoLink = '';
+    },
+    // 改变规格
+    changeSpec() {
+      this.formValidate.is_sub = [];
+      let id = this.productId;
+      if (id) {
+        checkActivityApi(id)
+            .then((res) => { })
+            .catch((res) => {
+              this.formValidate.spec_type = this.spec_type;
+              this.$Message.error(res.msg);
+            });
+      }
+    },
+    // 详情
+    getInfo() {
+      let that = this;
+      that.spinShow = true;
+      productInfoApi(that.productId)
+          .then(async (res) => {
+            let data = res.data.productInfo;
+            this.merchantType = parseInt(data.type);
+			if(this.merchantType == 2){
+				let obj = {
+					  title: "结算价",
+					  slot: "settle_price",
+					  align: "center",
+					  minWidth: 95,
+					}
+				this.columns2.splice(3,0,obj)
+			}
+            this.infoData(data);
+            // let cate_id = data.cate_id.map(Number);
+            // let label_id = data.label_id.map(Number);
+            // this.attrs = data.items || [];
+            // let ids = [];
+            // data.coupons.map((item) => {
+            //   ids.push(item.id);
+            // });
+            // that.formValidate = data;
+            // that.couponName = data.coupons;
+            // that.formValidate.coupon_ids = ids;
+            // that.updateIds = ids;
+            // that.updateName = data.coupons;
+            // that.formValidate.cate_id = cate_id;
+            // that.formValidate.label_id = label_id;
+            // that.oneFormValidate = [data.attr];
+            // that.formValidate.header = [];
+            // that.manyFormValidate = data.attrs;
+            // that.generate(0);
+            // that.spec_type = data.spec_type;
+            // if (data.spec_type === 0) {
+            //   that.manyFormValidate = [];
+            // } else {
+            //   that.createBnt = true;
+            //   that.oneFormValidate = [
+            //     {
+            //       pic: data.image,
+            //       price: 0,
+            //       cost: 0,
+            //       ot_price: 0,
+            //       stock: 0,
+            //       bar_code: "",
+            //       weight: 0,
+            //       volume: 0,
+            //       brokerage: 0,
+            //       brokerage_two: 0,
+            //       vip_price: 0,
+            //     },
+            //   ];
+            // }
+            this.spinShow = false;
+          })
+          .catch((res) => {
+            this.spinShow = false;
+            this.$Message.error(res.msg);
+          });
+    },
+    // tab切换
+    onhangeTab(name) {
+      this.currentTab = name;
+    },
+    handleRemove(i) {
+      this.images.splice(i, 1);
+      this.formValidate.slider_image.splice(i, 1);
+      this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
+    },
+    // 关闭图片上传模态框
+    changeCancel(msg) {
+      this.modalPic = false;
+    },
+    // 点击商品图
+    modalPicTap(tit, picTit, index) {
+      this.modalPic = true;
+      this.isChoice = tit === 'dan' ? '单选' : '多选';
+      this.picTit = picTit;
+      this.tableIndex = index;
+    },
+    // 获取单张图片信息
+    getPic(pc) {
+      switch (this.picTit) {
+        case 'danFrom':
+          this.formValidate.image = pc.att_dir;
+          if (!this.productId) {
+            if (this.formValidate.spec_type === 0) {
+              this.oneFormValidate[0].pic = pc.att_dir;
+            } else {
+              this.manyFormValidate.map((item) => {
+                item.pic = pc.att_dir;
+              });
+              this.oneFormBatch[0].pic = pc.att_dir;
+            }
+          }
+          break;
+        case 'danTable':
+          this.oneFormValidate[this.tableIndex].pic = pc.att_dir;
+          break;
+        case 'duopi':
+          this.oneFormBatch[this.tableIndex].pic = pc.att_dir;
+          break;
+        case 'recommend_image':
+          this.formValidate.recommend_image = pc.att_dir;
+          break;
+        default:
+          this.manyFormValidate[this.tableIndex].pic = pc.att_dir;
+      }
+      this.modalPic = false;
+    },
+    // 获取多张图信息
+    getPicD(pc) {
+      this.images = pc;
+      this.images.map((item) => {
+        this.formValidate.slider_image.push(item.att_dir);
+        this.formValidate.slider_image = this.formValidate.slider_image.splice(
+            0,
+            10
+        );
+      });
+      this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
+      this.modalPic = false;
+    },
+    // 提交
+    handleSubmit(name) {
+      this.$refs[name].validate((valid) => {
+        if (valid) {
+          if (!this.formValidate.store_name.trim()) {
+            return this.$Message.warning('基础信息-商品名称不能为空');
+          }
+          if (
+              this.formValidate.is_show == 2 &&
+              !this.formValidate.auto_on_time
+          ) {
+            return this.$Message.warning('基础信息-定时上架时间不能为空');
+          }
+          if (this.off_show == 1 && !this.formValidate.auto_off_time) {
+            return this.$Message.warning('基础信息-定时下架时间不能为空');
+          }
+          if(this.formValidate.product_type == 4 && !this.oneFormValidate[0].write_times){
+            return this.$Message.warning("规格库存-核销次数必须大于0");
+          }
+          if(this.formValidate.product_type == 4 && this.oneFormValidate[0].write_valid==2 && !this.oneFormValidate[0].days){
+            return this.$Message.warning("规格库存-有效天数必须大于0");
+          }
+          if(this.formValidate.product_type == 4 && this.oneFormValidate[0].write_valid==3 && !this.oneFormValidate[0].section_time.length){
+            return this.$Message.warning("规格库存-请输入固定有效期");
+          }
+          if (
+              this.formValidate.freight == 2 &&
+              this.formValidate.product_type == 0 &&
+              this.formValidate.postage <= 0
+          ) {
+            return this.$Message.warning('物流设置-固定邮费不能为0');
+          }
+          if (
+              this.formValidate.freight == 3 &&
+              this.formValidate.product_type == 0 &&
+              !this.formValidate.temp_id
+          ) {
+            return this.$Message.warning('物流设置-运费模板不能为空');
+          }
+          if (
+              this.formValidate.product_type == 0 &&
+              this.formValidate.is_presale_product &&
+              !this.formValidate.presale_time[0]
+          ) {
+            return this.$Message.warning('营销设置-预售时间不能为空');
+          }
+          // for (let i = 0; i < this.formValidate.custom_form.length; i++) {
+          //   const element = this.formValidate.custom_form[i];
+          //   if (!element.title) {
+          //     return this.$Message.warning('其他设置-留言标题不能为空');
+          //   }
+          // }
+          if(this.customBtn && this.formValidate.system_form_id == 0){
+            return this.$Message.warning('其他设置-请选择自定义表单模板');
+          }
+          let storeId = []
+          this.storesList.forEach(item=>{
+            storeId.push(item.id)
+          })
+          if(this.formValidate.applicable_type==2 && !storeId.length){
+            return this.$Message.warning('适用门店-请选择适用门店');
+          }
+          this.formValidate.applicable_store_id = storeId;
+          this.formValidate.type = this.type;
+          if (this.formValidate.spec_type === 0) {
+            this.formValidate.attrs = this.oneFormValidate;
+            this.formValidate.header = [];
+            this.formValidate.items = [];
+          } else {
+            this.formValidate.items = this.attrs;
+            this.formValidate.attrs = this.manyFormValidate;
+          }
+          if (
+              this.formValidate.spec_type === 1 &&
+              this.manyFormValidate.length === 0
+          ) {
+            return this.$Message.warning('规格库存-请点击生成多规格');
+            // return this.$Message.warning('请点击生成规格!');
+          }
+          let item = this.formValidate.attrs;
+          if (this.formValidate.is_sub.indexOf(1) != -1) {
+            for (let i = 0; i < item.length; i++) {
+              if (
+                  item[i].brokerage === null ||
+                  item[i].brokerage_two === null
+              ) {
+                return this.$Message.warning('营销设置- 一二级返佣不能为空');
+              }
+            }
+          }
+          if (this.formValidate.is_sub.indexOf(0) != -1) {
+            for (let i = 0; i < item.length; i++) {
+              if (item[i].vip_price === null) {
+                return this.$Message.warning('营销设置-会员价不能为空');
+              }
+              if (item[i].vip_price === 0) {
+                return this.$Message.warning('营销设置-会员价不能为0');
+              }
+            }
+          }
+          if (this.formValidate.is_sub.length === 2) {
+            for (let i = 0; i < item.length; i++) {
+              if (
+                  item[i].brokerage === null ||
+                  item[i].brokerage_two === null ||
+                  item[i].vip_price === null
+              ) {
+                return this.$Message.error(
+                    '营销设置- 一二级返佣和会员价不能为空'
+                );
+              }
+            }
+          }
+          for (let i = 0; i < this.specsList.length; i++) {
+            let data = this.specsList[i];
+            if (!data.name.trim()) {
+              return this.$Message.error('请输入参数名称');
+            }
+            if (!data.value.trim()) {
+              return this.$Message.error('请输入参数值');
+            }
+          }
+          if (!this.formValidate.product_type) {
+            this.formValidate.is_support_refund = 1;
+          }
+          this.openSubimit = false;
+          this.formValidate.description = this.formatRichText(this.content);
+          let goodsId = [];
+          this.goodsData.forEach((item) => {
+            goodsId.push(item.product_id);
+          });
+          this.formValidate.recommend_list = goodsId;
+          // 用户标签
+          let activeIds = [];
+          this.dataLabel.forEach((item) => {
+            activeIds.push(item.id);
+          });
+          this.formValidate.label_id = activeIds;
+          // 商品标签
+          let storeActiveIds = [];
+          this.storeDataLabel.forEach((item) => {
+            storeActiveIds.push(item.id);
+          });
+          this.formValidate.store_label_id = storeActiveIds;
+          // 商品参数
+          this.formValidate.specs = this.specsList;
+          if(this.formValidate.product_type == 4){
+            this.formValidate.delivery_type = 2
+          }
+          productAddApi(this.formValidate)
+              .then(async (res) => {
+                this.openSubimit = true;
+                this.$Message.success(res.msg);
+                if (this.productId === '0') {
+                  cacheDelete().catch((err) => {
+                    this.$Message.error(err.msg);
+                  });
+                }
+                // this.$refs[name].resetFields();
+                // setTimeout(() => {
+                //   this.$router.push({ path: '/product/product_list' });
+                // }, 500);
+                this.$emit('saved');
+              })
+              .catch((res) => {
+                this.openSubimit = false;
+                this.$Message.error(res.msg);
+              });
+        } else {
+          if (!this.formValidate.store_name) {
+            return this.$Message.warning('基础信息-商品名称不能为空');
+          } else if (!this.formValidate.cate_id.length) {
+            return this.$Message.warning('基础信息-商品分类不能为空');
+          } else if (!this.formValidate.unit_name) {
+            return this.$Message.warning('基础信息-商品单位不能为空');
+          } else if (!this.formValidate.slider_image.length) {
+            return this.$Message.warning('基础信息-商品轮播图不能为空');
+          }
+          //    if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
+          //    || !this.formValidate.unit_name || !this.formValidate.store_info
+          //        || !this.formValidate.image || !this.formValidate.slider_image){
+          //        this.$Message.warning("请填写完整商品信息!");
+          //    }
+        }
+      });
+    },
+    changeTemplate(msg) {
+      this.template = msg;
+    },
+    // 表单验证
+    validate(prop, status, error) {
+      if (status === false) {
+        this.$Message.warning(error);
+      }
+    },
+    // 移动
+    handleDragStart(e, item) {
+      this.dragging = item;
+    },
+    handleDragEnd(e, item) {
+      this.dragging = null;
+    },
+    handleDragOver(e) {
+      e.dataTransfer.dropEffect = 'move';
+    },
+    handleDragEnter(e, item) {
+      e.dataTransfer.effectAllowed = 'move';
+      if (item === this.dragging) {
+        return;
+      }
+      const newItems = [...this.formValidate.slider_image];
+      const src = newItems.indexOf(this.dragging);
+      const dst = newItems.indexOf(item);
+      newItems.splice(dst, 0, ...newItems.splice(src, 1));
+      this.formValidate.slider_image = newItems;
+    },
+    // 添加自定义弹窗
+    addCustomDialog(editorId) {
+      window.UE.registerUI(
+          'test-dialog',
+          function (editor, uiName) {
+            // 创建 dialog
+            let dialog = new window.UE.ui.Dialog({
+              iframeUrl: '/admin/widget.images/index.html?fodder=dialog',
+              editor: editor,
+              name: uiName,
+              title: '上传图片',
+              cssRules: 'width:1200px;height:500px;padding:20px;',
+            });
+            this.dialog = dialog;
+            let btn = new window.UE.ui.Button({
+              name: 'dialog-button',
+              title: '上传图片',
+              cssRules: `background-image: url(https://cdn.oss.9gt.net/prov1.1/1/icons.png);background-position: -726px -77px;`,
+              onclick: function () {
+                // 渲染dialog
+                dialog.render();
+                dialog.open();
+              },
+            });
+            return btn;
+          },
+          37
+      );
+      window.UE.registerUI(
+          'video-dialog',
+          function (editor, uiName) {
+            let dialog = new window.UE.ui.Dialog({
+              iframeUrl: '/admin/widget.video/index.html?fodder=video',
+              editor: editor,
+              name: uiName,
+              title: '上传视频',
+              cssRules: 'width:1000px;height:500px;padding:20px;',
+            });
+            this.dialog = dialog;
+            let btn = new window.UE.ui.Button({
+              name: 'video-button',
+              title: '上传视频',
+              cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -320px -20px;`,
+              onclick: function () {
+                // 渲染dialog
+                dialog.render();
+                dialog.open();
+              },
+            });
+            return btn;
+          },
+          38
+      );
+    },
+    formatRichText(html) {
+      let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
+        match = match
+            .replace(/style="[^"]+"/gi, '')
+            .replace(/style='[^']+'/gi, '');
+        match = match
+            .replace(/width="[^"]+"/gi, '')
+            .replace(/width='[^']+'/gi, '');
+        match = match
+            .replace(/height="[^"]+"/gi, '')
+            .replace(/height='[^']+'/gi, '');
+        return match;
+      });
+      newContent = newContent.replace(
+          /style="[^"]+"/gi,
+          function (match, capture) {
+            match = match
+                .replace(/width:[^;]+;/gi, 'max-width:100%;')
+                .replace(/width:[^;]+;/gi, 'max-width:100%;');
+            return match;
+          }
+      );
+      // newContent = newContent.replace(/<br[^>]*\/>/gi, '');
+      newContent = newContent.replace(
+          /\<img/gi,
+          '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"'
+      );
+      return newContent;
+    },
+    drawerChange(e) {
+      if (e) {
+        this.currentTab = '1';
+        this.type = 0;
+        this.getInfo();
+        this.getReplyList();
+        this.goodsCategory();
+        this.productGetRule();
+        this.productGetTemplate();
+        this.getBrandList();
+        this.getAllUnit();
+        this.uploadType();
+        this.getProductAllEnsure();
+        this.getProductAllSpecs();
+        this.allFormList();
+      } else {
+        this.$emit('update:visible', false);
+      }
+    },
+    // 查看评论列表
+    seeReply(row) {
+      this.$refs.replyList.modals = true;
+      this.$refs.replyList.getList(row.id);
+    },
+    // 回复评论
+    reply(row) {
+      this.replyModal = true;
+      this.rows = row;
+      this.replyForm.content = row.replyComment ? row.replyComment.content : '';
+    },
+    // 删除评论
+    delReply(row, tit, num) {
+      let delfromData = {
+        title: tit,
+        num: num,
+        url: `product/reply/${row.id}`,
+        method: 'DELETE',
+        ids: '',
+      };
+      this.$modalSure(delfromData)
+          .then((res) => {
+            this.$Message.success(res.msg);
+            this.replyData.splice(num, 1);
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
+    },
+    cancels() {
+      this.replyModal = false;
+      this.$refs['replyForm'].resetFields();
+    },
+    oks() {
+      this.replyModal = true;
+      this.$refs['replyForm'].validate((valid) => {
+        if (valid) {
+          setReplyApi(this.replyForm, this.rows.id)
+              .then(async (res) => {
+                this.$Message.success(res.msg);
+                this.replyModal = false;
+                this.$refs['replyForm'].resetFields();
+                this.getReplyList();
+              })
+              .catch((res) => {
+                this.$Message.error(res.msg);
+              });
+        } else {
+          return false;
+        }
+      });
+    },
+    // 商品评论
+    getReplyList() {
+      this.replyLoading = true;
+      // this.formValidate.is_reply = this.formValidate.is_reply || "";
+      // this.formValidate.store_name = this.formValidate.store_name || "";
+      this.replyValidate.product_id = this.productId;
+      replyListApi(this.replyValidate)
+          .then(async (res) => {
+            let data = res.data;
+            this.replyData = data.list;
+            this.total = res.data.count;
+            this.replyLoading = false;
+          })
+          .catch((res) => {
+            this.replyLoading = false;
+            this.$Message.error(res.msg);
+          });
+    },
+  },
+};
+</script>
+
+<style lang="stylus" scoped>
+.specsList{
+  /deep/.ivu-table th{
+    padding 0 !important
+  }
+  /deep/.ivu-table-cell{
+    padding 5px !important
+  }
+  &.on{
+    width 50% !important;
+    /deep/.ivu-table{
+      width 100% !important;
+    }
+    /deep/.ivu-table table{
+      width 100% !important;
+    }
+    /deep/.ivu-table td{
+      height 40px;
+      padding 0 !important;
+    }
+    /deep/.ivu-table-cell{
+      padding 0 16px !important;
+    }
+  }
+}
+.asterisk{
+  position relative;
+  .asteriskInfo{
+    position absolute;
+    color #ed4014;
+    left 73px;
+    top 5px;
+    font-size 20px;
+    &.on{
+      left:62px;
+    }
+    &.on2{
+      left:54px;
+    }
+  }
+}
+.storeModule{
+  width 950px;
+  margin -10px auto 0 auto;
+}
+.storeTable img{
+  width 36px;
+  height 36px;
+}
+.storeTable /deep/.ivu-table-wrapper{
+  border:0!important
+}
+.radioGroup .ivu-radio-wrapper{
+  margin-right 20px;
+}
+/deep/.ivu-drawer-close{
+  right: 30px;
+}
+.iview-video-style {
+  width: 40%;
+  height: 180px;
+  border-radius: 10px;
+  background-color: #707070;
+  position: relative;
+  overflow: hidden;
+  .video-style{
+    width: 100%;
+    height: 100%;
+  }
+}
+
+.iview-video-style .iconv {
+  color: #fff;
+  line-height: 180px;
+  width: 50px;
+  height: 50px;
+  display: inherit;
+  font-size: 26px;
+  position: absolute;
+  top: -74px;
+  left: 50%;
+  margin-left: -25px;
+}
+
+.iview-video-style .mark {
+  position: absolute;
+  width: 100%;
+  height: 30px;
+  top: 0;
+  background-color: rgba(0, 0, 0, 0.5);
+  text-align: center;
+}
+.ivu-mt{
+  margin: 0 auto!important;
+}
+.header {
+  display: flex;
+  align-items: center;
+  padding: 30px 0 25px 25px;
+  font-size: 13px;
+  color: #606266;
+
+  .iconfont {
+    margin-right: 12px;
+    color: #2D8CF0;
+  }
+
+  .title {
+    font-weight: 500;
+    font-size: 16px;
+    color: #000000;
+  }
+}
+
+.ivu-tabs {
+  >>>.ivu-tabs-bar {
+    border-bottom: 0;
+    margin-bottom: 30px;
+    background-color: #F5F7FA;
+  }
+
+  >>>.ivu-tabs-tab {
+    height: 40px;
+    padding: 0 20px;
+    font-size: 13px;
+    line-height: 40px;
+    color: #000000;
+
+    &:hover {
+      color: #000000 !important;
+    }
+  }
+
+  >>>.ivu-tabs-tab-active {
+    background-color: #FFFFFF;
+  }
+
+  >>>.ivu-tabs-ink-bar {
+    top: 0;
+    bottom: auto;
+  }
+
+  .ivu-tabs-tabpane {
+    padding: 0 24px;
+  }
+}
+
+.ivu-form {
+  >>>.ivu-form-item-label {
+    padding: 10px 6px 10px 0;
+  }
+}
+
+>>>.pictrue {
+  position: relative;
+  display: inline-block;
+  width: 60px;
+  height: 60px;
+  border: 1px dotted rgba(0, 0, 0, 0.1);
+  margin: 0 15px 10px 0;
+  cursor: pointer;
+
+  img {
+    width: 100%;
+    height: 100%;
+  }
+
+  .btndel {
+    position: absolute;
+    top: -4px;
+    left: 46px;
+    width: 20px;
+    height: 20px;
+    z-index: 1;
+  }
+}
+
+>>>.upLoad {
+  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;
+}
+
+.input-display {
+  display: none;
+}
+
+.ifam {
+  width: 344px;
+  height: 644px;
+  background: url('../../../assets/images/phonebg.png') no-repeat center top;
+  background-size: 344px 644px;
+  padding: 40px 20px;
+  padding-top: 50px;
+
+  .content {
+    height: 560px;
+    overflow: hidden;
+    scrollbar-width: none; /* firefox */
+    -ms-overflow-style: none; /* IE 10+ */
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+}
+
+.videbox {
+  width: 60px;
+  height: 60px;
+  background: rgba(0, 0, 0, 0.02);
+  border-radius: 4px;
+  border: 1px dashed #ddd;
+  line-height: 50px;
+  text-align: center;
+  color: #898989;
+  font-size: 30px;
+  font-weight: 400;
+  cursor: pointer;
+}
+.drawer-footer {
+  position fixed
+  right 0
+  bottom 0
+  z-index 2
+  width 1000px
+  padding 13px
+  border-top 1px solid #EEEEEE
+  background-color #FFFFFF
+  text-align center
+}
+.labelInput{
+  position: relative;
+  border: 1px solid #dcdee2;
+  width: 50%;
+  border-radius: 4px;
+  min-height: 32px;
+  padding-right: 24px;
+  padding-left: 8px;
+  cursor: pointer;
+
+  >div{
+    flex: 1;
+    min-height: 30px;
+    font-size: 0;
+    line-height: 30px;
+
+    .span {
+      vertical-align: middle;
+      font-size: 12px;
+      color: #c5c8ce;
+    }
+  }
+
+  .ivu-icon {
+    position: absolute;
+    top: 50%;
+    right: 8px;
+    transform: translateY(-50%);
+    font-size: 14px;
+    line-height: 1;
+    color: #808695;
+  }
+}
+.color-list .color-item{
+  width: 70px;
+  height: 28px;
+  line-height: 28px;
+  color: #fff;
+  margin-right: 10px;
+  border-radius: 2px;
+  text-align: center;
+}
+.color-list .color-item.colorBlue{
+  background: linear-gradient(270deg, #5ecfff 0%, #0084ff 100%);
+}
+.color-list .color-item .num{
+  color: #1890ff;
+  width: 14px;
+  height: 14px;
+  text-align: center;
+  line-height: 14px;
+  border-radius: 50%;
+  background-color: #fff;
+  margin-right: 6px;
+}
+.addCustom_content{
+  margin-top: 20px;
+}
+.addCustom_content .custom_box{
+  margin-bottom: 10px;
+}
+.custom-input{
+  width: 100px;
+  margin-right: 10px;
+}
+.ivu-checkbox-wrapper{
+  margin-right: 19px;
+}
+.addCustom_content .addfont{
+  display: inline-block;
+  font-size: 13px;
+  font-weight: 400;
+  color: #1890ff;
+  cursor: pointer;
+}
+.select-add{
+  width: 200px;
+  margin-left: 6px;
+  margin-right: 10px;
+}
+.addCustomBox{
+  margin-top: 12px;
+  font-size: 13px;
+  font-weight: 400;
+  color: #1890ff;
+}
+.addCustomBox .btn{
+  cursor: pointer;
+  width: max-content;
+}
+.tips{
+  display: inline-bolck;
+  font-size: 12px;
+  font-weight: 400;
+  color: #999;
+  &.on{
+    margin-top: 14px;
+  }
+}
+>>>.wang-editor {
+  margin-left: 20px;
+}
+</style>

+ 292 - 0
src/pages/erp/product/components/replyList.vue

@@ -0,0 +1,292 @@
+<template>
+	<div style="width: 100%">
+		<Modal 
+		v-model="modals" 
+		scrollable footer-hide closable 
+		title="评论回复列表" :mask-closable="false" 
+		width="900"
+		vertical-center-modal>
+			<Form
+			  inline
+			  ref="replyFrom"
+			  :model="replyFrom"
+			  :label-width="labelWidth"
+			  :label-position="labelPosition"
+			  @submit.native.prevent
+			>
+				<FormItem label="时间选择:">
+			        <DatePicker
+			          :editable="false"
+			          @on-change="onchangeTime"
+			          :value="timeVal"
+			          format="yyyy/MM/dd"
+			          type="daterange"
+			          placement="bottom-end"
+			          placeholder="自定义时间"
+			       class="input-add"
+			        ></DatePicker>
+					<Button type="primary" @click="getList(replyId)">查询</Button>
+			    </FormItem>
+			</Form>
+			<Table :loading="loading" highlight-row no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果"
+				ref="selection" :columns="columns" :data="dataList">
+				<template slot-scope="{ row }" slot="info">
+				  <div v-if="fromType">{{row.uid?row.nickname:'作者'}}</div>
+				  <div v-else class="imgPic acea-row row-middle">
+				    <viewer>
+				      <div class="tabBox_img"><img v-lazy="row.user.avatar" /></div>
+				    </viewer>
+				    <div class="info">{{ row.user.nickname }}</div>
+				  </div>
+				</template>
+				<template slot-scope="{ row }" slot="merchantReply">
+				  <div>{{row.children?row.children.content:''}}</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+				  <a @click="reply(row)" v-show="row.pid == 0 || row.uid > 0">回复</a>
+				  <Divider type="vertical" v-show="row.pid == 0 || row.uid > 0" />
+				  <a @click="del(row,'删除评论',index)">删除</a>
+				</template>
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="total" show-elevator show-total :current="replyFrom.page" @on-change="pageChange"
+					:page-size="replyFrom.limit" />
+			</div>
+		</Modal>
+		<Modal v-model="replyModals" scrollable title="回复内容" closable>
+		  <Form
+		    ref="contents"
+		    :model="contents"
+		    :rules="ruleInline"
+		    @submit.native.prevent
+		  >
+		    <FormItem prop="content">
+		      <Input
+		        v-model="contents.content"
+		        type="textarea"
+		        :rows="4"
+		        placeholder="请输入回复内容"
+		      />
+		    </FormItem>
+		  </Form>
+		  <div slot="footer">
+		    <Button type="primary" @click="oks">确定</Button>
+		    <Button @click="cancels">取消</Button>
+		  </div>
+		</Modal>
+	</div>
+</template>
+<script>
+	import { mapState } from "vuex";
+	import {
+		productReplycomment,
+		productReplySave
+	} from "@/api/product"
+	import { videoCommentReply, videoReply } from "@/api/marketing";
+	export default {
+		name: 'userList',
+		props: {
+			fromType: {
+				type: Number,
+				default:0
+			}
+		},
+		data() {
+			return {
+				contents: {
+				  content: "",
+				},
+				ruleInline: {
+				  content: [
+				    { required: true, message: "请输入回复内容", trigger: "blur" },
+				  ],
+				},
+				replyModals: false,
+				modals: false,
+				total: 0,
+				replyFrom: {
+					page: 1,
+					limit: 15
+				},
+				time:'',
+				loading: false,
+				dataList: [],
+				columns: [
+					{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: '评论用户',
+						slot: 'info',
+						minWidth: 90
+					},
+					{
+						title: "评论内容",
+						key: "content",
+						minWidth: 100,
+					},
+					// {
+					// 	title: "后台回复",
+					// 	slot: "merchantReply",
+					// 	minWidth: 100,
+					// },
+					{
+					  title: "操作",
+					  slot: "action",
+					  width: 100,
+					}
+				],
+				rows: {},
+				fromList: {
+				  title: "选择时间",
+				  custom: true,
+				  fromTxt: [
+				    { text: "全部", val: "" },
+				    { text: "今天", val: "today" },
+				    { text: "昨天", val: "yesterday" },
+				    { text: "最近7天", val: "lately7" },
+				    { text: "最近30天", val: "lately30" },
+				    { text: "本月", val: "month" },
+				    { text: "本年", val: "year" },
+				  ],
+				},
+				timeVal: [],
+				replyId: 0
+			}
+		},
+		computed: {
+		  ...mapState("admin/layout", ["isMobile"]),
+		  labelWidth() {
+		    return this.isMobile ? undefined : 75;
+		  },
+		  labelPosition() {
+		    return this.isMobile ? "top" : "left";
+		  },
+		},
+		created() {
+		},
+		methods: {
+			oks() {
+			  this.$refs["contents"].validate((valid) => {
+			    if (valid) {
+			      let apiName = this.fromType?videoReply(this.contents, this.rows.id):
+						  productReplySave(this.contents, this.replyId, this.rows.id);
+					apiName.then(async (res) => {
+			          this.$Message.success(res.msg);
+			          this.replyModals = false;
+			          this.$refs["contents"].resetFields();
+			          this.getList(this.replyId);
+			        })
+			        .catch((res) => {
+			          this.$Message.error(res.msg);
+			        });
+			    } else {
+			      return false;
+			    }
+			  });
+			},
+			// 具体日期
+			onchangeTime(e) {
+			  this.timeVal = e;
+			  this.time = this.timeVal[0] ? this.timeVal.join("-") : "";
+			  this.replyFrom.page = 1;
+			},
+			// 选择时间
+			selectChange(tab) {
+			  this.time = tab;
+			  this.timeVal = [];
+			  this.replyFrom.page = 1;
+			  this.getList(this.replyId);
+			},
+			cancels() {
+			  this.replyModals = false;
+			  this.$refs["contents"].resetFields();
+			},
+			reply(row){
+				this.contents.content = row.children?row.children.content:'';
+				this.rows = row;
+				this.replyModals = true;
+			},
+			// 删除
+			del (row, tit, num) {
+				let urls = '';
+				urls = this.fromType?`/marketing/video/comment/${row.id}`:`product/reply/delete_comment/${row.id}`;
+			    let delfromData = {
+			        title: tit,
+			        num: num,
+			        url: urls,
+			        method: 'DELETE',
+			        ids: ''
+			    };
+			    this.$modalSure(delfromData).then((res) => {
+			        this.$Message.success(res.msg);
+              this.dataList.splice(num, 1);
+              if (!this.dataList.length) {
+                console.log('huhu');
+                this.replyFrom.page =
+                    this.replyFrom.page == 1 ? 1 : this.replyFrom.page - 1;
+              }
+			        this.getList(this.replyId);
+			    }).catch(err => {
+			        this.$Message.error(err.msg);
+			    });
+			},
+			//评论回复列表
+			getList(id) {
+				this.replyId = id;
+				this.loading = true;
+				let apiName = '';
+				if(this.fromType){
+					this.replyFrom.data = this.time;
+					apiName = videoCommentReply;
+				}else {
+					this.replyFrom.time =  this.time;
+					apiName = productReplycomment;
+				}
+				apiName(this.replyFrom,id).then(res => {
+					this.loading = false;
+					this.total = res.data.count;
+					this.dataList = res.data.list;
+				}).catch(err => {
+					this.loading = false;
+					this.$Message.error(err.msg)
+				})
+			},
+			pageChange(page){
+			  this.replyFrom.page = page;
+			  this.getList(this.replyId);
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+.input-add {
+width: 250px;
+margin-right:14px;
+}
+	/deep/.ivu-table {
+		height: 300px;
+		overflow-x: hidden;
+		overflow-y: auto;
+	}
+
+	/deep/.ivu-table-overflowX {
+		overflow-x: hidden !important;
+	}
+
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+		margin-right: 10px;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 285 - 0
src/pages/erp/product/components/stockEdit.vue

@@ -0,0 +1,285 @@
+<template>
+	<Modal v-model="modals"  scrollable title="库存管理" width="800" 
+	 @on-cancel="cancel" footer-hide
+	 class-name="vertical-center-modal">
+	    <Card :bordered="false" dis-hover class="cards">
+					<div class="batch" v-if="specType">
+						<div class="name" @click="batchTap">批量<span class="iconfont iconxiayi"></span></div>
+						<div class="input acea-row row-center-wrapper" v-if="batchShow">
+							  <Input v-model="batchStock" type='number' class="width15" @on-change="inputTap">
+								<Select v-model="batchPm" slot="append" style="width: 60px" @on-change="batchStockTap">
+								   <Option :value="1">入库</Option>
+								   <Option :value="0">出库</Option>
+								</Select>
+							</Input>
+						</div>
+					</div>
+	        <Table :columns="columns" border ref="selection" :data="stockData" :loading="loading" no-data-text="暂无数据"
+	               highlight-row no-filtered-data-text="暂无筛选结果" max-height="450">
+								 <template slot-scope="{ row, index }" slot="image">
+								 	<div class="product-data">
+								 		<img class="image" :src="row.image" />
+								 	</div>
+								 </template>
+								 <template slot-scope="{ row, index }" slot="num">
+									 <div class="acea-row row-middle">
+									 <Input v-model="row.changeNum" type="number" class="width15" @on-change="changeTap(row)">
+										 	<Select v-model="row.pm" slot="append" style="width: 60px" @on-change="stockTap(row)">
+										 	   <Option :value="1">入库</Option>
+										 	   <Option :value="0">出库</Option>
+										 	</Select>
+										 </Input>
+										 <span class="ml20">={{row.resultNum}}</span>
+									 </div>
+								 </template>
+					</Table>
+					<div class="footer acea-row row-right">
+						<Button class="mr" @click="cancel">取消</Button>
+						<Button type="primary" @click="productSaveStocks">提交</Button>
+					</div>
+	    </Card>
+	</Modal>
+</template>
+
+<script>
+	  import { productAttrsApi, productSaveStocksApi } from '@/api/product.js'
+    export default {
+        name: 'stockEdit',
+				props: {
+				},
+        data () {
+            return {
+							id:0,
+							specType:0,
+							batchShow:false,
+							batchStock:0,
+							batchPm:1,
+							modals: false,
+							loading: false,
+							stockData:[],
+							columns: [
+									{
+										title: "图片",
+										slot: "image",
+										minWidth: 20
+									},
+									{
+										title: "产品规格",
+										key: "suk",
+										minWidth: 90
+									},
+									{
+										title: "商品条形码",
+										key: "bar_code",
+										minWidth: 35
+									},
+									{
+										title: "商品编码",
+										key: "code",
+										minWidth: 35
+									},
+									{
+										title: "当前库存",
+										key: "stock",
+										minWidth: 10
+									},
+									{
+										title: "入/出库数量",
+										slot: "num",
+										minWidth: 200
+									}
+								]
+            }
+        },
+        methods: {
+					// 批量设置;
+					countBatch(){
+						this.batchStock = Math.abs(this.batchStock);
+						this.stockData.forEach(item=>{
+							item.changeNum = this.batchStock;
+							if(this.batchPm){
+								item.pm = 1;
+								item.resultNum = parseInt(item.stock) + parseInt(item.changeNum);
+							}else{
+								item.pm = 0;
+								if(parseInt(item.stock)<=0){
+									item.resultNum = 0
+								}else{
+									let num = parseInt(item.stock) - parseInt(item.changeNum)
+									item.resultNum = num<=0?0:num;
+								}
+							}
+						})
+					},
+					// 批量加减库存
+					inputTap(){
+						this.batchStock = this.batchStock.replace(/^\d{10}$/g,"0")
+						this.countBatch();
+					},
+					// 批量设置入库或是出库
+					batchStockTap(){
+						this.countBatch();
+					},
+					// 单个设置
+					countStock(row){
+						if(row.pm){
+							row.resultNum = parseInt(row.stock) + parseInt(row.changeNum);
+						}else{
+							if(parseInt(row.stock)<=0){
+								row.resultNum = 0;
+							}else{
+								let num = parseInt(row.stock) - parseInt(row.changeNum);
+								row.resultNum = num<=0?0:num;
+							}
+						}
+						this.stockData.forEach(item=>{
+							if(row.id==item.id){
+								item.changeNum = row.changeNum;
+								item.resultNum = row.resultNum;
+								item.pm = row.pm;
+							}
+						})
+					},
+					// 设置加减库存
+					stockTap(row){
+						this.countStock(row);
+					},
+					// 设置入库或是出库
+					changeTap(row){
+						row.changeNum = row.changeNum.replace(/^\d{10}$/g,"0")
+						this.countStock(row);
+					},
+					batchTap(){
+						this.batchShow = !this.batchShow;
+					},
+					productAttrs(data){
+						this.specType = data.spec_type;
+						this.id = data.id;
+						productAttrsApi(data.id).then(res=>{
+							let data = res.data;
+							data.forEach(item=>{
+								item.resultNum = item.stock;
+								item.changeNum = 0;
+								item.pm = 1;
+							})
+							this.stockData = data;
+						}).catch(err=>{
+							this.$Message.error(err.msg);
+						})
+					},
+					productSaveStocks(){
+						let attrs = [];
+						this.stockData.forEach(item=>{
+							let data = {
+								"unique":item.unique,
+								"pm":item.pm,
+								"stock":item.changeNum
+							}
+							attrs.push(data)
+						})
+						productSaveStocksApi({attrs:attrs},this.id).then(res=>{
+							this.$Message.success('修改成功');
+							this.cancel();
+							this.$emit('stockChange',res.data.stock)
+						}).catch(err=>{
+							this.$Message.error(err.msg);
+						})
+					},
+					cancel(){
+						this.modals = false;
+						this.batchShow = false;
+						this.batchPm = 1;
+						this.batchStock = 0;
+					}
+        }
+    }
+</script>
+
+<style lang="stylus" scoped>
+	
+	/*定义滑块 内阴影+圆角*/
+	/deep/::-webkit-scrollbar-thumb{
+	  -webkit-box-shadow: inset 0 0 6px #999;
+	}
+	/deep/::-webkit-scrollbar {
+	    width: 4px!important; /*对垂直流动条有效*/
+	}
+	.footer{
+		margin-top 20px;
+	}
+	.product-data .image {
+		width: 50px !important;
+		height: 50px !important;
+	}
+	.cards{
+		position relative;
+	}
+	.batch{
+		position absolute;
+		right -20px;
+		z-index 9;
+		top:18px;
+		width: 176px;
+		.input{
+			width: 176px;
+			height: 56px;
+			background: #FFFFFF;
+			box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05);
+			border-radius: 4px;
+			margin-left -80px;
+		}
+		.name{
+			font-size 13px;
+			color: #1890FF;
+			margin-bottom 10px;
+			cursor pointer;
+			.iconfont{
+				font-size 12px;
+				margin-left 4px;
+			}
+		}
+	}
+	/deep/.ivu-select-single .ivu-select-selection .ivu-select-placeholder,
+	/deep/.ivu-select-single .ivu-select-selection .ivu-select-selected-value{
+		font-size 13px!important;
+	}
+	/deep/.ivu-card-body{
+		padding 0!important;
+	}
+	/deep/.ivu-input:focus{
+		border-color #dcdee2!important;
+		box-shadow unset!important;
+	}
+	/deep/.ivu-input:hover{
+		border-color #dcdee2!important;
+	}
+	/deep/.ivu-input{
+		border-right 0 !important;
+		transition:unset!important;
+	}
+	/deep/.ivu-input-group-append{
+		background-color #fff !important;
+	}
+	/deep/.ivu-table{
+		overflow unset!important;
+	}
+	/deep/.ivu-table-cell{
+		overflow unset!important;
+		font-size 13px!important;
+	}
+	/deep/.ivu-table-border:after{
+		background-color #fff;
+	}
+	/deep/.ivu-table-header table{
+		border-top: 0!important;
+	}
+	/deep/.ivu-modal-body{
+		padding-top 0!important;
+	}
+	.ivu-table-wrapper-with-border{
+		border 0!important;
+	}
+	/deep/.ivu-table-border th, /deep/.ivu-table-border td{
+		border-right 0!important;
+	}
+</style>

+ 371 - 0
src/pages/erp/product/index.vue

@@ -0,0 +1,371 @@
+<template>
+	<!-- 营销-积分商品 -->
+	<div>
+		<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>
+					<!-- <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="仓位搜索:" 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']"
+            type="primary"
+            icon="md-add"
+            @click="addMore"
+            class="mr10"
+            >批量添加积分商品</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="['admin-erp-add_position']" 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">
+				<template slot-scope="{ row, index }" slot="passageway">
+					<span> {{ row.bin_number.slice(0,2) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="control">
+					<span> {{ row.bin_number.slice(2,3) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="layer">
+					<span> {{ row.bin_number.slice(3,4) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="number">
+					<span> {{ row.bin_number.slice(4) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="unit_name_1">
+					<div v-if="row.unit_name_1">
+						<div>名称:{{row.unit_name_1}}</div>
+						<div>转换率:1{{row.unit_name_1}} = {{row.unit_rate_1*1}}{{row.unit_name}}</div>
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="unit_name_2">
+					<div v-if="row.unit_name_2">
+						<div>名称:{{row.unit_name_2}}</div>
+						<div>转换率:1{{row.unit_name_2}} = {{row.unit_rate_2*1}}{{row.unit_name}}</div>
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="is_weigh">
+					{{row.is_weigh == 1?'是': '否'}}
+				</template>
+				<template slot-scope="{ row, index }" slot="action">
+				<!-- 	<a @click="look(row)">详情</a>
+					<Divider type="vertical" /> -->
+					<a @click="edit(row)">编辑</a>
+					<!-- <Divider type="vertical" />
+					<a @click="del(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>
+		<productDetail ref="productDetail"></productDetail>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+	import {
+		integralProductListApi,
+		integralIsShowApi,
+		storeSeckillApi,
+	} from "@/api/marketing";
+	import {
+		getGoods,
+		getUserInfo,
+		getGoodInfo
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import timeOptions from "@/utils/timeOptions";
+	import Setting from "@/setting";
+	import productDetail from './productDetail.vue'
+	export default {
+		name: "godownList",
+		components: {
+			productDetail
+		},
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd");
+				}
+			},
+		},
+		data() {
+			return {
+				roterPre: Setting.roterPre,
+				loading: false,
+				options: timeOptions,
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "商品名称",
+						key: "store_name",
+						minWidth: 90,
+					},
+					
+					{
+						title: "总销量",
+						key: "all_sales",
+						minWidth: 90,
+					},
+					{
+						title: "总库存",
+						key: "stock",
+						minWidth: 90,
+					},
+					{
+						title: "基础单位",
+						key: "unit_name",
+						minWidth: 90,
+					},
+					{
+						title: "大单位",
+						slot: "unit_name_1",
+						minWidth: 90,
+					},
+					{
+						title: "超大单位",
+						slot: "unit_name_2",
+						minWidth: 90,
+					},
+					{
+						title: "商品条码",
+						key: "bar_code",
+						minWidth: 90,
+					},
+					{
+						title: "成本价",
+						key: "cost",
+						minWidth: 90,
+					},
+					{
+						title: "是否称重",
+						slot: "is_weigh",
+						minWidth: 90,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						width: 200,
+					},
+				],
+				tableList: [],
+				timeVal: [],
+				grid: {
+					xl: 7,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				tableFrom: {
+					// integral_time: "",
+					// is_show: "",
+					// store_name: "",
+					key: '',
+					page: 1,
+					limit: 10,
+				},
+				total: 0,
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			look(row) {
+				try{
+					this.$refs.productDetail.getInfo(row.id)
+				}catch(e){
+					//TODO handle the exception
+					
+				}
+				// getGoodInfo(row.id).then(res=> {
+				// 	console.log(res,'商品详情');
+				// })
+				
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/erp/product_add?id=0"
+				});
+			},
+			addMore() {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/add_store_integral",
+				});
+			},
+			orderList(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/order_list",
+					query: {
+						product_id: row.id,
+					},
+				});
+			},
+			// 导出
+			exports() {
+				let formValidate = this.tableFrom;
+				let data = {
+					start_status: formValidate.start_status,
+					status: formValidate.status,
+					store_name: formValidate.store_name,
+				};
+				storeSeckillApi(data)
+					.then((res) => {
+						location.href = res.data[0];
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 编辑
+			edit(row) {
+				this.$router.push({
+					path: this.roterPre + "/erp/product_add?id=" + row.id
+				});
+			},
+			// 一键复制
+			copy(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/create/" + row.id + "/1",
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `/erp/Warehouse/position_del/${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.start_status = this.tableFrom.start_status || "";
+				// this.tableFrom.is_show = this.tableFrom.is_show || "";
+				getGoods(this.tableFrom)
+					.then(async (res) => {
+						let data = res.data;
+						this.tableList = data.data;
+						this.total = data.count;
+						this.loading = false;
+					})
+					.catch((res) => {
+						this.loading = false;
+						this.$Message.error(res.msg);
+					});
+			},
+			pageChange(index) {
+				this.tableFrom.page = index;
+				this.getList();
+			},
+			// 表格搜索
+			tableSearchs() {
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			// 具体日期
+			onchangeTime(e) {
+				this.timeVal = e;
+				this.tableFrom.integral_time = this.timeVal[0] ? this.timeVal.join("-") : "";
+			},
+			// 修改是否显示
+			onchangeIsShow(row) {
+				let data = {
+					id: row.id,
+					is_show: row.is_show,
+				};
+				integralIsShowApi(data)
+					.then(async (res) => {
+						this.$Message.success(res.msg);
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 577 - 0
src/pages/erp/product/productDetail.vue

@@ -0,0 +1,577 @@
+<template>
+	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
+
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Tabs v-model="activeName">
+				<TabPane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.val">
+					<template v-if="item.val === 'pici'">
+						<Table :columns="columns" :data="lists" ref="table" 
+							no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+							<template slot-scope="{ row,index }" slot="price">
+								<div >{{row.price*1}}元/{{row.unit_name}}</div>
+							</template>
+						</Table>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<div class="section" v-if=" info.ware && info.ware.id">
+								<div class="section-hd">要货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.ware.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if=" info.tware && info.tware.id">
+								<div class="section-hd">出货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.tware.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.tware.title}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tware.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.tware.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if=" info.store && info.store.id">
+								<div class="section-hd">要货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.store.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.store.name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.store.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.store.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if=" info.tstore && info.tstore.id">
+								<div class="section-hd">出货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.tstore.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.tstore.name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tstore.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.tstore.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.cuser && info.cuser.id">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getGoodInfo,
+		getWantInfo,
+		getProductBatch
+	} from "@/api/erp";
+	import Setting from "@/setting";
+
+	export default {
+		name: 'productDetail',
+		data() {
+			return {
+				id: 0,
+				info: {},
+				roterPre: Setting.roterPre,
+				psInfo: {},
+				modals: false,
+				activeName: 'base',
+				lists: [],
+				loading: false,
+				list: [{
+						val: 'base',
+						label: '基础信息'
+					},{
+						val: 'pici',
+						label: '批次信息'
+					},
+					
+				],
+				ckColumns: [
+					{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "title",
+						key: "title",
+						width: 200,
+					},
+				],
+				columns: [{
+					title: "ID",
+					key: "product_id",
+					width: 80,
+				},
+				{
+					title: "商品名称",
+					key: "product_name",
+					width: 150,
+				},
+				{
+					title: "要货数量",
+					key: "want_product_num",
+					width: 120,
+				},
+				{
+					title: "单位",
+					key: "unit_name",
+					width: 75,
+				},
+				 ]
+			}
+		},
+		watch: {
+			activeName(n) {
+				console.log(n);
+				if(n=='base') return;
+				this.getList(n)
+			},
+		},
+		created() {},
+		methods: {
+			deit() {
+				this.$router.push({
+					path: this.roterPre + "/erp/user_add?id=" + this.formValidate.id
+				});
+			},
+			getList(name) {
+				this.loading = true
+				let getList,qdata={};
+				try{
+					if(name == 'pici') {
+						getList = getProductBatch
+						qdata = {
+							product_id: this.id
+						}
+					}
+					getList(qdata).then(res => {
+						this.loading = false
+						this.lists = res.data
+					}).catch(res => {
+						this.loading = false
+					})
+				}catch(e){
+					console.log(e,'err');
+					//TODO handle the exception
+				}
+				
+			},
+			getInfo(id) {
+				this.id = id
+				getGoodInfo(id).then(res => {
+					console.log(res, 'res');
+					this.modals = true
+					this.info = res.data
+				}).catch(err => {
+					this.modals = false
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	/deep/.ivu-modal-body {
+		padding: 0;
+	}
+
+	.user-info {
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+	
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+	
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+	
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+	
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+	
+			.value {
+				flex: 1;
+			}
+	
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+	
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.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;
+						}
+
+						span:last-child {
+							color: #808695;
+						}
+					}
+
+					p:last-child {
+						font-size: 22px;
+					}
+				}
+			}
+		}
+	}
+</style>
+<style scoped lang="stylus">
+	.user_menu>>>.ivu-menu {
+		width 100% !important;
+	}
+
+	/deep/ .ivu-form-item {
+		margin: 20px 0 0 0 !important;
+	}
+
+	.info-list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 0 0 20px;
+
+		div {
+			width: 50%
+		}
+	}
+
+	.tit {
+		font-weight: bold;
+		padding: 20px 0 10px 0;
+	}
+</style>

+ 118 - 36
src/pages/erp/purchase/addPurchase.vue

@@ -31,13 +31,35 @@
 				:model="formValidate_0" :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
 				<Row :gutter="24" type="flex">
 					<Col span="24">
-					<FormItem label="仓库:" prop="wid">
+					<FormItem label="采购对象:" prop="control">
+						<RadioGroup v-model="formValidate_0.who"  @on-change="changeWho">
+							<Radio :label="0" :disabled="formValidate_0.id != 0">
+								<Icon type="social-apple"></Icon>
+								<span>仓库采购</span>
+							</Radio>
+							<Radio :label="1" :disabled="formValidate_0.id != 0">
+								<Icon type="social-android"></Icon>
+								<span>门店采购</span>
+							</Radio>
+						</RadioGroup>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="仓库:" prop="wid" v-if="formValidate_0.who == 0">
 						<el-cascader placeholder="请选择仓库" class="input-add" size="mini" v-model="formValidate_0.wid"
 							:options="data1" :props="props" @change="userSearchss" filterable clearable v-width="'400'">
 						</el-cascader>
 					</FormItem>
 					</Col>
 					<Col span="24">
+					<FormItem label="门店:" prop="store_id" v-if="formValidate_0.who== 1">
+						<el-cascader placeholder="请选择门店" class="input-add" size="mini" v-model="formValidate_0.store_id"
+							:options="staffData" :props="propss" @change="userSearchs" filterable clearable
+							v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
 					<FormItem label="供应商:" prop="supplier_id" label-for="supplier_id">
 						<Select v-model="formValidate_0.supplier_id" @on-change="userSearchsss" clearable
 							class="input-add">
@@ -48,7 +70,7 @@
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="创建人:" prop="create_uid" v-if="formValidate_0.wid != 0 ">
+					<FormItem label="创建人:" prop="create_uid" v-if="formValidate_0.wid != 0 || formValidate_0.store_id != 0">
 						<el-cascader placeholder="请选择创建人" class="input-add" size="mini"
 							v-model="formValidate_0.create_uid" :options="authList" :props="propsss" @change="checkAuth"
 							filterable clearable v-width="'400'">
@@ -276,7 +298,8 @@
 		createPurchase,
 		getWantInfo,
 		getPurchaseGoods,
-		getWantList
+		getWantList,
+		getGoods
 	} from "@/api/erp";
 	import {
 		keyApi,
@@ -295,7 +318,7 @@
 	} from '@/api/supplier'
 	import Setting from "@/setting";
 
-	import goodDetail from '@/components/goodDetail.vue'
+	import goodDetail from './goodDetail.vue'
 	export default {
 		name: "specsAdd",
 		components: {
@@ -333,7 +356,7 @@
 				],
 				columns: [{
 						title: '商品名称',
-						key: 'product_name',
+						key: 'store_name',
 						minWidth: 160
 					},
 					{
@@ -429,6 +452,8 @@
 					xs: 24,
 				},
 				formValidate_0: {
+					store_id: 0,
+					who: 0,//0-仓库采购、1-门店采购
 					id: 0,
 					wid: 0,
 					goods: [],
@@ -461,6 +486,12 @@
 						message: "请选择供应商",
 						trigger: "blur"
 					}, ],
+					store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择门店",
+						trigger: "blur"
+					}],
 					wid: [{
 						type: "number",
 						required: true,
@@ -500,6 +531,7 @@
 		mounted() {
 			this.getGodownList()
 			this.getSupplierList()
+			this.staffList()
 		},
 		destroyed() {
 			// this.setCopyrightShow({
@@ -589,18 +621,18 @@
 				let arr = e.map(item => {
 					item.unitList = [{
 						value: 0,
-						label: item.info.unit_name
+						label: item.unit_name
 					}]
-					if (item.info.unit_name_1) {
+					if (item.unit_name_1) {
 						item.unitList.push({
 							value: 1,
-							label: item.info.unit_name_1
+							label: item.unit_name_1
 						})
 					}
-					if (item.info.unit_name_2) {
+					if (item.unit_name_2) {
 						item.unitList.push({
 							value: 2,
-							label: item.info.unit_name_1
+							label: item.unit_name_2
 						})
 					}
 					if (type == 're') {
@@ -611,28 +643,53 @@
 				return arr
 			},
 			setGoods(e) {
+				console.log(e,'选择商品');
 				this.chooseGoods = this.chooseGoods.concat(this.resetGoods(e, 're'))
 			},
 			getGoods() {
-				if (this.formValidate_0.wid == 0) {
+				if (this.formValidate_0.wid == 0 && this.formValidate_0.who == 0) {
 					return this.$Message.error('请选择仓库');
 				}
+				if (this.formValidate_0.store_id == 0 && this.formValidate_0.who == 1) {
+					return this.$Message.error('请选择门店');
+				}
 				this.$refs.goodDetail.clearChoose()
 				this.$refs.goodDetail.modals = true;
-				this.$refs.goodDetail.formValidate.type = 0
+				this.$refs.goodDetail.formValidate.who = 0
 				this.$refs.goodDetail.formValidate.wid = this.formValidate.wid
+				this.$refs.goodDetail.formValidate.store_id = this.formValidate.store_id
+				// this.$refs.goodDetail.getList()
 			},
 			getUserList(id) {
-				getUserList({
-					wid: id
-				}).then(res => {
-					// console.log(res);
-					this.authList = res.data.data
-					// .map(item => {
-					// 		item.id += ''
-					// 		return item
-					// 	});
-				})
+				if(this.currentTab == 0) {
+					let qdata = {}
+					if(this.formValidate_0.who == 0) {
+						qdata.wid = this.formValidate_0.wid
+					}else {
+						qdata.store_id = this.formValidate_0.store_id
+					}
+					getUserList(qdata).then(res => {
+						// console.log(res);
+						this.authList = res.data.data
+						// .map(item => {
+						// 		item.id += ''
+						// 		return item
+						// 	});
+					})
+					
+				}else {
+					getUserList({
+						wid: id
+					}).then(res => {
+						// console.log(res);
+						this.authList = res.data.data
+						// .map(item => {
+						// 		item.id += ''
+						// 		return item
+						// 	});
+					})
+				}
+				
 			},
 			staffList() {
 				staffListInfo()
@@ -685,10 +742,18 @@
 				this.chooseGoods.splice(index, 1);
 			},
 			userSearchs(e) {
-
+this.formValidate_0.create_uid = "";
+				this.authList = []
+				this.goods = []
+				this.getUserList(this.formValidate_0.store_id)
 			},
 			userSearchsss(e) {
 
+			},
+			changeWho() {
+				this.formValidate_0.wid = 0
+				this.formValidate_0.store_id = 0
+				this.chooseGoods = []
 			},
 			userSearchss(e) {
 				this.formValidate_0.create_uid = "";
@@ -717,13 +782,32 @@
 					item.product_num = want
 					return item
 				})
-				return arr.map(item => {
-					item.unit_name = item.info['unit_name' + (item.unit_type == 0 ? '' : (item.unit_type == 1 ?
-						"_1" : "_2"))]
-					return item
-				}).filter(item => {
-					return item.product_num != 0
-				})
+				try{
+					console.log(arr,'arr');
+					return arr.map(item => {
+						let obj = {
+							bar_code: item.bar_code,
+							product_name: item.store_name,
+							product_code: item.product_code,
+							product_id: item.id,
+							product_num: item.product_num,
+							unit_name: item.unitList[item.unit_type].label,
+							unit_type: item.unit_type
+						}
+						// item.unit_name = item.unitList[item.unit_type].label
+						// item.product_name = item.store_name
+						// item.product_id = item.id
+						// item.unit_name = item.info['unit_name' + (item.unit_type == 0 ? '' : (item.unit_type == 1 ?
+						// 	"_1" : "_2"))]
+						return obj
+					}).filter(item => {
+						return item.product_num != 0
+					})
+				}catch(e){
+					//TODO handle the exception
+					console.log('err',e);
+				}
+				
 			},
 			handleSubmit(name) {
 				console.log('开始');
@@ -746,26 +830,26 @@
 						return this.$Message.error('请选择商品并填写采购数量');
 					}
 				}
-
+				console.log(this.formValidate_0.goods,'this.formValidate_0.goods');
 				try{
 					this.$refs[name].validate((valid) => {
 						if (valid) {
 							console.log('校验结束');
-							// this.formValidate.id = this.$route.query.id;
 							let pdata = {}
 							if (this.currentTab == 0) {
 								console.log('自建采购');
 								try {
 									pdata = {
 										id: this.$route.query.id,
-										wid: this.formValidate_0.wid,
+										store_id: this.formValidate_0.who == 1?this.formValidate_0.store_id:'',
+										wid: this.formValidate_0.who == 0?this.formValidate_0.wid: '',
+										type: this.formValidate_0.who==0?0:1,
 										products: this.formValidate_0.goods,
 										supplier_id: this.formValidate_0.supplier_id,
 										create_uid: this.formValidate_0.create_uid,
 										create_admin_id: this.formValidate_0.create_admin_id
 									}
 								} catch (e) {
-									//TODO handle the exception
 									console.log(e, '错误');
 								}
 							}else if(this.currentTab == 1) {
@@ -804,12 +888,10 @@
 								this.$Message.error(err.msg);
 							})
 						} else {
-							// this.$Message.error("请输入参数模板名称");
 						}
 					});
 				}catch(e){
 					console.log('err',e);
-					//TODO handle the exception
 				}
 				
 			},

+ 260 - 0
src/pages/erp/purchase/goodDetail.vue

@@ -0,0 +1,260 @@
+<template>
+	<div style="width: 100%">
+		<Modal v-model="modals" scrollable footer-hide closable title="商品列表" :mask-closable="false" width="700">
+			<Form ref="formValidate" :label-width="labelWidth" :label-position="labelPosition" class="tabform"
+				@submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="12">
+					<FormItem label="关键字:">
+						<Input enter-button placeholder="请输入商品名称" element-id="name" v-model="formValidate.key" clearable />
+					</FormItem>
+					</Col>
+					<Col span="4">
+					<Button type="primary" icon="ios-search" @click="userSearchs">搜索</Button>
+					</Col>
+				</Row>
+			</Form>
+			<!-- <Divider dashed/> -->
+			<Table :columns="columns" :data="tabList" ref="table" :loading="loading" no-userFrom-text="暂无数据"
+				no-filtered-userFrom-text="暂无筛选结果" class="table" @on-selection-change="change">
+				<template slot-scope="{ row, index }" slot="store">
+					<span> {{ row.my.stock }}{{row.my.unit_name}}</span>
+				</template>
+				<!-- product_num -->
+				<template slot-scope="{ row, index }" slot="product_num">
+					<span> {{ row.product_num }}{{row.unit_name || row.info['unit_name' + (row.unit_type == 0 ? '':(row.unit_type == 1?"_1":"_2"))]}}</span>
+				</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>
+			<Button type="primary"  @click="ok" style="width: 100%;margin-top:20px;">确认</Button>
+		</Modal>
+	</div>
+</template>
+
+<script>
+	import {
+		commissionDetailApi,
+		extractlistApi
+	} from '@/api/finance';
+	import {
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		getUserList,
+		getOutGoods,
+		getGoods
+	} from "@/api/erp";
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		name: 'commissionDetails',
+		data() {
+			return {
+				chooseGoods:[],
+				key: '',
+				wid: '',
+				my_store_id: '',
+				store_id: 0,
+				type: 0,
+				modals: false,
+				spinShow: false,
+				detailsData: {},
+				Ids: 0,
+				loading: false,
+				formValidate: {
+					page: 1, // 当前页
+					limit: 10 ,// 每页显示条数
+					key: '',
+					wid: '',
+					my_store_id: '',
+					store_id: 0,
+					who: 0,
+				},
+				total: 0,
+				columns: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					},
+					{
+						title: 'ID',
+						key: 'product_id',
+						minWidth: 50
+					},
+					{
+						title: '商品名称',
+						key: 'store_name',
+						minWidth: 200
+					},
+					{
+						title: '仓库库存',
+						slot: 'product_num',
+						minWidth: 150
+					},
+					{
+						title: '门店库存',
+						key: 'stock',
+						minWidth: 330
+					}
+				],
+				tabList: []
+
+			}
+		},
+		computed: {
+			...mapState('admin/layout', [
+				'isMobile'
+			]),
+			labelWidth() {
+				return this.isMobile ? undefined : 80;
+			},
+			labelPosition() {
+				return this.isMobile ? 'top' : 'left';
+			}
+		},
+		mounted() {
+			// if (this.Ids) {
+			//     this.getList();
+			// }
+			this.chooseGoods = []
+		},
+		methods: {
+			clearChoose() {
+				this.chooseGoods = []
+				this.$refs.table.selectAll(false);
+				
+			},
+			change(e) {
+				this.chooseGoods = e
+			},
+			ok() {
+				this.modals = false;
+				 this.$emit('setGoods',this.chooseGoods);
+			},
+			// 时间
+			onchangeTime(e) {
+				this.formValidate.start_time = e[0];
+				this.formValidate.end_time = e[1];
+			},
+			// 详情
+			getDetails(id) {
+				this.Ids = id;
+				this.spinShow = true;
+				commissionDetailApi(id).then(async res => {
+					if (res.status === 200) {
+						let data = res.data
+						this.detailsData = data.user_info;
+						this.spinShow = false;
+					} else {
+						this.spinShow = false;
+						this.$Message.error(res.msg);
+					}
+				}).catch(res => {
+					this.spinShow = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			// 列表
+			getList() {
+				let getList;
+				if (this.formValidate.who == 1) {
+					this.formValidate.wid = ''
+					
+				} else {
+					this.formValidate.store_id = 0
+					getList = getGoods
+				}
+				if(this.formValidate.key == '') {
+					return this.$Message.error('请输入关键字')
+				}
+				this.loading = true;
+				getList(this.formValidate).then(async res => {
+					let data = res.data;
+					this.tabList = data.data;
+					this.total = data.count;
+					this.loading = false;
+				}).catch(res => {
+					this.loading = false;
+					this.$Message.error(res.msg);
+				})
+			},
+			pageChange(index) {
+				this.formValidate.page = index
+				this.getList();
+			},
+			// 搜索
+			userSearchs() {
+				this.formValidate.page = 1;
+				this.getList();
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	.table {
+		.ivu-table-default {
+			overflow-y: auto;
+			max-height: 350px;
+		}
+	}
+
+	.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: 12px;
+						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>

+ 15 - 5
src/pages/erp/purchase/index.vue

@@ -459,11 +459,20 @@
 						console.log(obj);
 						return obj
 					})
-					getUserList({
-						wid: row.wid
-					}).then(res => {
-						this.authLists = res.data.data
-					})
+					if(row.wid) {
+						getUserList({
+							wid: row.wid
+						}).then(res => {
+							this.authLists = res.data.data
+						})
+					}else {
+						getUserList({
+							store_id: row.store_id
+						}).then(res => {
+							this.authLists = res.data.data
+						})
+					}
+					
 					this.modalend = true
 				})
 				
@@ -663,6 +672,7 @@
 			// 列表
 			getList() {
 				this.loading = true;
+				this.tableList = []
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
 				getPurchaselist(this.tableFrom)

+ 136 - 45
src/pages/erp/purchase/purchaseDetail.vue

@@ -7,49 +7,90 @@
 					<template v-if="item.val === 'info'">
 						<Table :columns="columns" :data="info.info" ref="table" 
 							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 slot-scope="{ row,index }" slot="price">
+								<div >{{row.price*1}}元/{{row.unit_name}}</div>
 							</template>
 						</Table>
 					</template>
 					<template v-if="item.val === 'base'">
-						<Row :gutter="24" type="flex">
-							<Col span="24" v-if="info.ware && info.ware.id">
-							<div class="tit">仓库:</div>
-							<div class="info-list">
-								<div>ID:<span>{{info.ware.id}}</span></div>
-								<div>名称:<span>{{info.ware.title}}</span></div>
-								<div>手机号码:<span>{{info.ware.phone}}</span></div>
-								<div>地址:{{info.ware.detailed_address}}</div>
+						<div class="user-info">
+							<div class="section" v-if="info.ware && info.ware.id">
+								<div class="section-hd">采购仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.ware.detailed_address}}</div>
+									</div>
+								</div>
 							</div>
-							</Col>
-							<Col span="24">
-							<div class="tit">供应商:</div>
-							<div class="info-list">
-								<div>ID:<span>{{info.supplier.id}}</span></div>
-								<div>名称:<span>{{info.supplier.supplier_name}}</span></div>
-								<div>手机号码:<span>{{info.supplier.phone}}</span></div>
+							<div class="section" v-if="info.store && info.store.id">
+								<div class="section-hd">采购门店</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>门店ID:</div>
+										<div class="value">{{ info.store.id}}</div>
+									</div>
+									<div class="item">
+										<div>门店名称:</div>
+										<div class="value">{{ info.store.name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.store.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.store.detailed_address}}</div>
+									</div>
+								</div>
 							</div>
-							</Col>
-							<Col span="24">
-							<div class="tit">创建人:</div>
-							<div class="info-list">
-								<div>ID:<span>{{info.cuser.id}}</span></div>
-								<div>名称:<span>{{info.cuser.staff_name}}</span></div>
-								<div>手机号码:<span>{{info.cuser.phone}}</span></div>
+							<div class="section">
+								<div class="section-hd">供应商</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>供应商ID:</div>
+										<div class="value">{{ info.supplier.id}}</div>
+									</div>
+									<div class="item">
+										<div>供应商名称:</div>
+										<div class="value">{{ info.supplier.supplier_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.supplier.phone}}</div>
+									</div>
+								</div>
 							</div>
-							</Col>
-						</Row>
+							<div class="section">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+						</div>
 					</template>
 				</TabPane>
 			</Tabs>
@@ -105,22 +146,27 @@
 				{
 					title: "商品名称",
 					key: "product_name",
-					width: 200,
+					width: 150,
 				},
 				{
-					title: "采购数量0",
+					title: "采购数量",
 					key: "product_num",
-					width: 150,
+					width: 120,
 				},
 				{
-					title: "采购数量1",
+					title: "实际采购数量",
 					key: "pur_num",
-					width: 150,
+					width: 120,
 				},
 				{
 					title: "单位",
 					key: "unit_name",
-					width: 150,
+					width: 75,
+				},
+				{
+					title: "单价",
+					slot: "price",
+					width: 75,
 				},
 				{
 					title: "净重",
@@ -133,8 +179,8 @@
 					width: 80,
 				},
 				{
-					title: "总",
-					key: "pur_weight",
+					title: "总价(元)",
+					key: "total_price",
 					width: 80,
 				},
 				 ]
@@ -169,7 +215,52 @@
 	}
 
 	.user-info {
-		// padding: 15px;
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+	
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+	
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+	
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+	
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+	
+			.value {
+				flex: 1;
+			}
+	
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+	
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
 	}
 
 	.user-row {

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

@@ -116,9 +116,12 @@
 						<div>
 							商品ID:{{item.product_id}}
 						</div>
-						<!-- <div>
-							数量:{{item.want_product_num*1}}{{' '}}{{item.unit_name}}
-						</div> -->
+						<div v-if="item.is_weigh == 1">
+							净重:{{item.net_weight}}
+						</div>
+						<div v-if="item.is_weigh == 1">
+							皮重:{{item.tare_weight}}
+						</div>
 					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
@@ -146,7 +149,11 @@
 					<Tag color="success" v-if="row.status == 2">完成</Tag>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
-					<a @click="edit(row)">详情</a>
+					<a @click="look(row)">详情</a>
+					<template v-if="row.to_store_id && row.status == 0">
+						<Divider type="vertical" />
+						<a @click="pass(row)">审核</a>
+					</template>
 					<!-- <Divider type="vertical" />
 					<a @click="del(row, '删除积分商品', index)">删除</a> -->
 				</template>
@@ -156,10 +163,35 @@
 					:page-size="tableFrom.limit" />
 			</div>
 		</Card>
+		<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>
+		</Modal>
+		<receiveDetail ref="receiveDetail"></receiveDetail>
 	</div>
 </template>
 
 <script>
+	import receiveDetail from './receiveDetail.vue'
 	import {
 		mapState
 	} from "vuex";
@@ -173,7 +205,8 @@
 		getUserInfo,
 		getGodownList,
 		getUserList,
-		getReceiveList
+		getReceiveList,
+		storeAuth
 	} from "@/api/erp";
 	import {
 		staffListInfo
@@ -184,7 +217,10 @@
 	import timeOptions from "@/utils/timeOptions";
 	import Setting from "@/setting";
 	export default {
-		name: "receive",
+		name: "receiveIndex",
+		components: {
+			receiveDetail
+		},
 		filters: {
 			formatDate(time) {
 				if (time !== 0) {
@@ -195,6 +231,14 @@
 		},
 		data() {
 			return {
+				authLists: [],
+				remarks: {
+					id: 0,
+					status: '',
+					auth_uid: "",
+					auth_admin_id: "",
+				},
+				modalpass: false,
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
@@ -203,9 +247,15 @@
 						key: "id",
 						width: 80,
 					},
+					// {
+					// 	title: "订单编号",
+					// 	key: "order_id",
+					// 	minWidth: 150,
+					// },
+
 					{
-						title: "订单编号",
-						key: "order_id",
+						title: "出库单号",
+						key: "out_order_id",
 						minWidth: 150,
 					},
 					{
@@ -213,11 +263,6 @@
 						slot: "pm",
 						minWidth: 150,
 					},
-					{
-						title: "出库单号",
-						key: "out_order_id",
-						minWidth: 150,
-					},
 					{
 						title: '商品信息',
 						slot: 'info',
@@ -239,8 +284,8 @@
 						minWidth: 90,
 					},
 					{
-						title:"运费",
-						key:"freight",
+						title: "运费",
+						key: "freight",
 						minWidth: 90,
 					},
 					{
@@ -294,17 +339,19 @@
 					// is_show: "",
 					// store_name: "",
 					// key: '',
-					create_uid:"",
-					store_id:"",
-					wid:"",
+					create_uid: "",
+					store_id: "",
+					wid: "",
 					page: 1,
 					limit: 15,
-					type: 1
+					type: -1,
+					status: -3,
+					// store_id: 3
 				},
 				total: 0,
-				staffData:[],
-				data1:[],
-				authList:[]
+				staffData: [],
+				data1: [],
+				authList: []
 			};
 		},
 		computed: {
@@ -325,6 +372,42 @@
 			this.getUserList()
 		},
 		methods: {
+			look(row) {
+				this.$refs.receiveDetail.storeInfo(row.id);
+			},
+			userSearchse(e) {
+				let auth = this.authLists.find(item => item.id == e)
+				this.remarks.auth_admin_id = auth.admin_id
+			},
+			pass(row) {
+				let qdata = {}
+				if (row.to_wid) {
+					qdata.wid = row.to_wid
+				} else {
+					qdata.store_id = row.to_store_id
+				}
+				this.authLists = []
+				this.remarks.id = row.id
+				getUserList(qdata).then(res => {
+					this.authLists = res.data.data
+					this.modalpass = true;
+				})
+			},
+			putRemark() {
+				storeAuth(this.remarks).then(res => {
+					this.cancel()
+					this.getList();
+				})
+			},
+			cancel() {
+				this.remarks = {
+					id: 0,
+					status: '',
+					auth_uid: "",
+					auth_admin_id: "",
+				}
+				this.modalpass = false
+			},
 			getUserList() {
 				getUserList().then(res => {
 					// console.log(res);
@@ -432,6 +515,7 @@
 			// 列表
 			getList() {
 				this.loading = true;
+				this.tableList = []
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
 				getReceiveList(this.tableFrom)

+ 695 - 0
src/pages/erp/receive/receiveDetail.vue

@@ -0,0 +1,695 @@
+<template>
+	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
+		<div class="user-info">
+			<div class="section">
+				<div class="section-hd"></div>
+				<div class="section-bd">
+					<div class="item">
+						<div>出库单号:</div>
+						<div class="value">{{ info.out_order_id }}</div>
+					</div>
+					<div class="item">
+						<div>订单编号:</div>
+						<div class="value">{{ info.order_id }}</div>
+					</div>
+					<div class="item">
+						<div>创建时间:</div>
+						<div class="value">{{ info.create_time | formatDate}}</div>
+					</div>
+					<div class="item">
+						<div>审核时间:</div>
+						<div class="value">{{ info.auth_time | formatDate}}</div>
+					</div>
+				</div>
+			</div>
+		</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<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'">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in info.info">
+								<!-- <a @click="delGood(gindex)" class="del-btn">删除</a> -->
+								<div class="section-hd">{{goods.store_name}}</span> </div>
+								<div v-if="goods.group.length > 0" v-for="(item,index) in goods.group" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>价格:</div>
+											<div class="value">{{ item.price}}</div>
+										</div>
+										<div class="item">
+											<div>数量:</div>
+											<div class="value">{{ item.pur_number}}</div>
+										</div>
+										<div class="item" v-if="item.weight">
+											<div>净重(kg):</div>
+											<div class="value">{{ item.weight}}</div>
+										</div>
+										<div class="item" v-if="item.bin_number">
+											<div>仓位编号:</div>
+											<div class="value">{{ item.bin_number}}</div>
+										</div>
+										<div class="item">
+											<div>保质期:</div>
+											<div class="value">{{ item.shelf_life == -1 ? '/':item.shelf_life}}</div>
+										</div>
+									</div>
+
+								</div>
+								<!-- <div v-if="goods.batch.length == 0" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>库存:</div>
+											<div class="value">{{ goods.product_num}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ goods.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>数量:</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].pur_number"
+													placeholder="请输入数量" v-width="'150'" type="number" /></div>
+										</div>
+										<div class="item">
+											<div>总重量:</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].weight"
+													placeholder="请输入重量" v-width="'150'" type="number" /></div>
+										</div>
+									</div>
+								</div> -->
+
+							</div>
+						</Card>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<!-- <div class="section">
+								<div class="section-hd">出库单号:{{info.out_order_id}}</div>
+							</div> -->
+							<!-- <div class="section" v-if="">
+								<div class="section-hd">调出仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>供应商ID:</div>
+										<div class="value">{{ info.supplier.id}}</div>
+									</div>
+									<div class="item">
+										<div>供应商名称:</div>
+										<div class="value">{{ info.supplier.supplier_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.supplier.phone}}</div>
+									</div>
+								</div>
+							</div> -->
+
+							<div class="section" v-if="info.store && info.store.id">
+								<div class="section-hd">调出门店</div>
+								<div class="section-bd">
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.store.name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.store.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.store.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.ware && info.ware.id">
+								<div class="section-hd">调出门店</div>
+								<div class="section-bd">
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.tstore && info.tstore.id">
+								<div class="section-hd">调入门店</div>
+								<div class="section-bd">
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.tstore.name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.tstore.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tstore.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.tware && info.tware.id">
+								<div class="section-hd">调入仓库</div>
+								<div class="section-bd">
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.tware.title}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.tware.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tware.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.cuser && info.cuser.id">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd">
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.auser && info.auser.id">
+								<div class="section-hd">审核人</div>
+								<div class="section-bd">
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.auser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.auser.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.auser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<!-- <div class="section">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div> -->
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		storeInfo,
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getPurchaseInfo,
+		getOutInfo
+	} from "@/api/erp";
+	import Setting from "@/setting";
+import {
+		formatDate
+	} from "@/utils/validate";
+	export default {
+		name: 'receiveDetail',
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd hh:mm:ss");
+				}
+			},
+		},
+		data() {
+			return {
+				info: {},
+				roterPre: Setting.roterPre,
+				psInfo: {},
+				modals: false,
+				activeName: 'base',
+				list: [{
+						val: 'base',
+						label: '基础信息'
+					}, {
+						val: 'info',
+						label: '商品信息'
+					},
+
+				],
+				ckColumns: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "title",
+						key: "title",
+						width: 200,
+					},
+				],
+				columns: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "商品名称",
+						key: "product_name",
+						width: 200,
+					},
+					{
+						title: "采购数量0",
+						key: "product_num",
+						width: 150,
+					},
+					{
+						title: "采购数量1",
+						key: "pur_num",
+						width: 150,
+					},
+					{
+						title: "单位",
+						key: "unit_name",
+						width: 150,
+					},
+					{
+						title: "净重",
+						key: "net_weight",
+						width: 80,
+					},
+					{
+						title: "皮重",
+						key: "tare_weight",
+						width: 80,
+					},
+					{
+						title: "总重",
+						key: "pur_weight",
+						width: 80,
+					},
+				]
+			}
+		},
+		watch: {
+
+		},
+		created() {},
+		methods: {
+			deit() {
+				this.$router.push({
+					path: this.roterPre + "/erp/user_add?id=" + this.formValidate.id
+				});
+			},
+			storeInfo(id) {
+				storeInfo({
+					id
+				}).then(res => {
+					console.log(res, 'res');
+					this.modals = true
+					this.info = res.data
+				}).catch(err => {
+					this.modals = false
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	/deep/.ivu-modal-body {
+		padding: 0;
+	}
+
+	.user-info {
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+
+			.value {
+				flex: 1;
+			}
+
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.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;
+						}
+
+						span:last-child {
+							color: #808695;
+						}
+					}
+
+					p:last-child {
+						font-size: 22px;
+					}
+				}
+			}
+		}
+	}
+</style>
+<style scoped lang="stylus">
+	.user_menu>>>.ivu-menu {
+		width 100% !important;
+	}
+
+	/deep/ .ivu-form-item {
+		margin: 20px 0 0 0 !important;
+	}
+
+	.info-list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 0 0 20px;
+
+		div {
+			width: 50%
+		}
+	}
+
+	.tit {
+		font-weight: bold;
+		padding: 20px 0 10px 0;
+	}
+</style>

+ 27 - 19
src/pages/erp/user/addUser.vue

@@ -95,14 +95,29 @@
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="所属仓库:" prop="wid">
+					<FormItem label="账号归属:" prop="wid">
+						<RadioGroup v-model="formValidate.type">
+							<!-- :disabled="formValidate.id != 0" -->
+							<Radio :label="1" >
+								<Icon type="social-apple"></Icon>
+								<span>仓库</span>
+							</Radio>
+							<Radio :label="2" >
+								<Icon type="social-android"></Icon>
+								<span>门店</span>
+							</Radio>
+						</RadioGroup>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="所属仓库:" prop="wid" v-if="this.formValidate.type == 1">
 						<el-cascader placeholder="请选择所属仓库" class="input-add" size="mini" v-model="formValidate.wid"
 							:options="data1" :props="props" @change="userSearchs" filterable clearable v-width="'400'">
 						</el-cascader>
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="所属门店:" prop="store_id">
+					<FormItem label="所属门店:" prop="store_id" v-if="this.formValidate.type == 2">
 						<el-cascader placeholder="请选择所属门店" class="input-add" size="mini" v-model="formValidate.store_id"
 							:options="staffData" :props="propss" @change="userSearchs" filterable clearable
 							v-width="'400'">
@@ -212,6 +227,7 @@
 					xs: 24,
 				},
 				formValidate: {
+					type: 1,
 					avatar: "",
 					uid: 0,
 					nickname: "",
@@ -275,18 +291,6 @@
 						message: "请输入登录账号",
 						trigger: "blur"
 					}, ],
-					store_id: [{
-						type: "number",
-						required: true,
-						message: "请选择门店",
-						trigger: "blur"
-					}],
-					wid: [{
-						type: "number",
-						required: true,
-						message: "请选择仓库",
-						trigger: "blur"
-					}],
 					pwd: [{
 						required: true,
 						message: '请输入登录密码',
@@ -343,18 +347,18 @@
 						nickname: data.user.nickname,
 						id: id,
 						account: data.account,
-						wid: data.ware.id,
+						wid: data.wid,
 						staff_name: data.staff_name,
-						store_id: data.store.id,
+						store_id: data.store_id,
 						is_manager: data.is_manager,
-						pwd: "",
 						phone: data.phone,
 						kefu: data.staff.nickname,
 						staff_id: data.staff.id,
 						admin_name: data.admin.real_name,
 						is_system: data.is_system + '',
 						admin_id: data.admin.id,
-						avatar: data.avatar
+						avatar: data.avatar,
+						type: data.wid?1:2
 					}
 
 				})
@@ -487,7 +491,11 @@
 				this.$refs[name].validate((valid) => {
 					if (valid) {
 						this.formValidate.id = this.$route.query.id;
-						let qdata = {}
+						if(this.formValidate.type == 1) {
+							this.formValidate.store_id = ''
+						}else {
+								this.formValidate.wid = ''
+						}
 						createUser(this.formValidate.id, this.formValidate).then(res => {
 							this.$Message.success(res.msg);
 							this.$router.push({

+ 3 - 3
src/pages/erp/user/userDetails.vue

@@ -25,7 +25,7 @@
 						<div>用户类型:<span>{{psInfo.user.user_type}}</span></div>
 					</div>
 					</Col>
-					<Col span="24">
+					<Col span="24" v-if="psInfo.staff&&psInfo.staff.id">
 					<div class="tit">绑定客服:</div>
 					<div class="info-list">
 						<div>ID:<span>{{psInfo.staff.id}}</span></div>
@@ -34,7 +34,7 @@
 					</div>
 					
 					</Col>
-					<Col span="24">
+					<Col span="24" v-if="psInfo.admin && psInfo.admin.id">
 					<div class="tit">绑定后台:</div>
 					<div class="info-list">
 						<div>ID:<span>{{psInfo.admin.id}}</span></div>
@@ -43,7 +43,7 @@
 						<div>手机号码:<span>{{psInfo.admin.phone}}</span></div>
 					</div>
 					</Col>
-					<Col span="24">
+					<Col span="24" v-if="psInfo.ware&&psInfo.ware.id">
 					<div class="tit">所属仓库:</div>
 					<div class="info-list">
 						<div>ID:<span>{{psInfo.ware.id}}</span></div>

+ 1 - 1
src/pages/erp/want/addWant.vue

@@ -359,7 +359,7 @@
 						if (item.info.unit_name_2) {
 							item.unitList.push({
 								value: 2,
-								label: item.info.unit_name_1
+								label: item.info.unit_name_2
 							})
 						}
 						item.want_product_num = 0

+ 10 - 2
src/pages/erp/want/goodDetail.vue

@@ -160,14 +160,22 @@
 			// 列表
 			getList() {
 				this.loading = true;
+				let qdata = {
+					key: this.formValidate.key,
+					my_store_id: this.formValidate.my_store_id,
+				}
 				if (this.formValidate.type == 1) {
 					this.formValidate.wid = ''
+					qdata.store_id = this.formValidate.store_id
+					
 				} else {
 					this.formValidate.store_id = ''
+					qdata.wid =  this.formValidate.wid
 				}
-				getOutGoods(this.formValidate).then(async res => {
+				
+				getOutGoods(qdata).then(async res => {
 					let data = res.data;
-					this.tabList = data;
+					this.tabList = data.data;
 					this.total = data.count;
 					this.loading = false;
 				}).catch(res => {

+ 9 - 1
src/pages/erp/want/index.vue

@@ -175,7 +175,7 @@
 		<Modal
 		  v-model="modalpass"
 		  scrollable
-		  title="请修改内容"
+		  title="审核"
 		  class="order_box"
 		  :closable="false"
 		  :mask-closable="false"
@@ -217,10 +217,12 @@
 		    <Button @click="cancel()">取消</Button>
 		  </div>
 		</Modal>
+		<wantDetail ref="wantDetail"></wantDetail>
 	</div>
 </template>
 
 <script>
+	import wantDetail from './wantDetail.vue'
 	import {
 		mapState
 	} from "vuex";
@@ -246,6 +248,9 @@
 	import Setting from "@/setting";
 	export default {
 		name: "want",
+		components: {
+			wantDetail
+		},
 		filters: {
 			formatDate(time) {
 				if (time !== 0) {
@@ -401,6 +406,9 @@
 			this.getUserList()
 		},
 		methods: {
+			look(row) {
+				this.$refs.wantDetail.getInfo(row.id);
+			},
 			putRemark() {
 				seveWant(this.remarks.id,this.remarks).then(res => {
 					this.cancel()

+ 545 - 0
src/pages/erp/want/wantDetail.vue

@@ -0,0 +1,545 @@
+<template>
+	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
+
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<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'">
+						<Table :columns="columns" :data="info.info" ref="table" 
+							no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
+							<template slot-scope="{ row,index }" slot="price">
+								<div >{{row.price*1}}元/{{row.unit_name}}</div>
+							</template>
+						</Table>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<div class="section" v-if=" info.ware && info.ware.id">
+								<div class="section-hd">要货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.ware.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if=" info.tware && info.tware.id">
+								<div class="section-hd">出货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.tware.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.tware.title}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tware.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.tware.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if=" info.store && info.store.id">
+								<div class="section-hd">要货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.store.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.store.name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.store.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.store.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if=" info.tstore && info.tstore.id">
+								<div class="section-hd">出货仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>仓库ID:</div>
+										<div class="value">{{ info.tstore.id}}</div>
+									</div>
+									<div class="item">
+										<div>仓库名称:</div>
+										<div class="value">{{ info.tstore.name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tstore.phone}}</div>
+									</div>
+									<div class="item">
+										<div>详细地址:</div>
+										<div class="value">{{info.tstore.detailed_address}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.cuser && info.cuser.id">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getWantInfo
+	} from "@/api/erp";
+	import Setting from "@/setting";
+
+	export default {
+		name: 'wantDetail',
+		data() {
+			return {
+				info: {},
+				roterPre: Setting.roterPre,
+				psInfo: {},
+				modals: false,
+				activeName: 'base',
+				list: [{
+						val: 'base',
+						label: '基础信息'
+					},{
+						val: 'info',
+						label: '商品信息'
+					},
+					
+				],
+				ckColumns: [
+					{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "title",
+						key: "title",
+						width: 200,
+					},
+				],
+				columns: [{
+					title: "ID",
+					key: "product_id",
+					width: 80,
+				},
+				{
+					title: "商品名称",
+					key: "product_name",
+					width: 150,
+				},
+				{
+					title: "要货数量",
+					key: "want_product_num",
+					width: 120,
+				},
+				{
+					title: "单位",
+					key: "unit_name",
+					width: 75,
+				},
+				 ]
+			}
+		},
+		watch: {
+
+		},
+		created() {},
+		methods: {
+			deit() {
+				this.$router.push({
+					path: this.roterPre + "/erp/user_add?id=" + this.formValidate.id
+				});
+			},
+			getInfo(id) {
+				getWantInfo(id).then(res => {
+					console.log(res, 'res');
+					this.modals = true
+					this.info = res.data
+				}).catch(err => {
+					this.modals = false
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	/deep/.ivu-modal-body {
+		padding: 0;
+	}
+
+	.user-info {
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+	
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+	
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+	
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+	
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+	
+			.value {
+				flex: 1;
+			}
+	
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+	
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+
+	.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;
+						}
+
+						span:last-child {
+							color: #808695;
+						}
+					}
+
+					p:last-child {
+						font-size: 22px;
+					}
+				}
+			}
+		}
+	}
+</style>
+<style scoped lang="stylus">
+	.user_menu>>>.ivu-menu {
+		width 100% !important;
+	}
+
+	/deep/ .ivu-form-item {
+		margin: 20px 0 0 0 !important;
+	}
+
+	.info-list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 0 0 20px;
+
+		div {
+			width: 50%
+		}
+	}
+
+	.tit {
+		font-weight: bold;
+		padding: 20px 0 10px 0;
+	}
+</style>

+ 21 - 8
src/pages/product/productBrand/components/menusFrom.vue

@@ -102,8 +102,14 @@ export default {
           if (this.type == 2) {
             productBrandrev(this.formValidate.id, this.formValidate).then(res => {
               this.$Message.success(res.msg)
-              this.getAddFrom()
-              this.$parent.getData()
+			  try{
+			  	this.getAddFrom()
+			  	this.$parent.getData()
+			  }catch(e){
+				  console.log(e,'err');
+			  	//TODO handle the exception
+			  }
+            
               this.modals = false
             }).catch(err => {
               this.$Message.error(err.msg)
@@ -112,12 +118,19 @@ export default {
             productBrand(this.formValidate).then(res => {
               this.$Message.success(res.msg)
               this.getAddFrom()
-              if (this.fromName) {
-                this.$parent.getBrandList();
-              } else {
-                this.$parent.getData()
-              }
-              this.modals = false
+			  try{
+			  	if (this.fromName) {
+			  	  this.$parent.getBrandList();
+			  	} else {
+			  	  this.$parent.getData()
+			  	}
+			  }catch(e){
+				  console.log(e,'err2');
+			  	//TODO handle the exception
+				this.$emit('reload')
+			  }
+             this.modals = false
+             
             }).catch(err => {
               this.$Message.error(err.msg)
             })

+ 46 - 1
src/router/modules/erp.js

@@ -84,6 +84,24 @@ export default {
 			},
 			component: () => import('@/pages/erp/out/index')
 		},
+		{
+			path:'out_add',
+			name: `${pre}out_add`,
+			meta: {
+				auth: ['admin-erp-out_add'],
+				title: '添加出库'
+			},
+			component: () => import('@/pages/erp/out/addOut')
+		},
+		{
+			path:'out_store',
+			name: `${pre}out_store`,
+			meta: {
+				auth: ['admin-erp-out_store'],
+				title: '门店收货'
+			},
+			component: () => import('@/pages/erp/out/storeReceipt')
+		},
 		{
 			path:'out_goods',
 			name: `${pre}out_goods`,
@@ -156,6 +174,24 @@ export default {
 			},
 			component: () => import('@/pages/erp/inventory/index')
 		},
+		{
+			path:'stocktaking',
+			name: `${pre}stocktaking`,
+			meta: {
+				auth: ['admin-erp-stocktaking'],
+				title: '盘点单列表'
+			},
+			component: () => import('@/pages/erp/inventory/stocktaking')
+		},
+		{
+			path:'stocktaking_add',
+			name: `${pre}stocktaking_add`,
+			meta: {
+				auth: ['admin-erp-stocktaking_add'],
+				title: '添加编辑盘点单'
+			},
+			component: () => import('@/pages/erp/inventory/addStocktaking')
+		},
 		{
 			path: 'purchase',
 			name: `${pre}purchase`,
@@ -190,7 +226,16 @@ export default {
 				auth: ['admin-erp-product'],
 				title: '商品档案'
 			},
-			component: () => import('@/pages/store/cashierMenus/index')
+			component: () => import('@/pages/erp/product/index')
+		},
+		{
+			path: 'product_add',
+			name: `${pre}product`,
+			meta: {
+				auth: ['admin-erp-product_add'],
+				title: '商品档案'
+			},
+			component: () => import('@/pages/erp/product/addProduct')
 		},
 		{
 			path: 'batch',