lhl há 1 ano atrás
pai
commit
cadd9046b1

+ 24 - 4
src/api/erp.js

@@ -142,7 +142,7 @@ export function createPosition(data) {
 
 //Warehouse/position_info/
 /**
- * @description 添加/编辑仓位
+ * @description 仓位详情
  * @param {Object} param data {Object} 传值参数
  */
 export function getPosition(id) {
@@ -240,6 +240,18 @@ export function getAdjustList(data) {
   });
 }
 
+//goods/adjust_price
+/**
+ * @description 创建修改调价
+ * @param {Object} param data {Object} 传值参数
+ */
+export function createAdjust(data) {
+  return request({
+    url: "/erp/goods/adjust_price",
+    method: "post",
+    data,
+  });
+}
 /**
  * @description 要货商品列表
  * @param {Object} param data {Object} 传值参数
@@ -687,9 +699,8 @@ export function addProduct(id,data) {
 	});
 }
 
-//Product/batch_lst
 /**
- * @description 创建商品
+ * @description 批次列表
  * @param {Object} param data {Object} 传值参数
  */
 export function getBatchList(data) {
@@ -699,6 +710,7 @@ export function getBatchList(data) {
 	  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' => '用户详情']);
@@ -793,4 +805,12 @@ Route::get('stock/info', 'v1.erp.stock/info')->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');//批次列表
+// Route::get('Product/batch_lst', 'v1.erp.Goods/batch_lst')->name('batch_lst');//批次列表
+
+
+// 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' => '调价详情']);

+ 6 - 4
src/api/setting.js

@@ -381,20 +381,22 @@ export function roleCreatApi (data) {
  * @description 设置 身份管理 ==详情
  * @param {Number} param id {Number} 身份管理id
  */
-export function roleInfoApi (id) {
+export function roleInfoApi (id,data) {
     return request({
         url: `setting/role/${id}/edit`,
-        method: 'get'
+        method: 'get',
+		params:data
     });
 }
 
 /**
  * @description 设置 身份管理 ==权限列表
  */
-export function menusListApi () {
+export function menusListApi (data) {
     return request({
         url: `setting/role/create`,
-        method: 'get'
+        method: 'get',
+		params:data
     });
 }
 

+ 680 - 0
src/pages/erp/adjust/addAdjust.vue

@@ -0,0 +1,680 @@
+<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/adjust_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="ruleValidate" :model="formValidate"
+				:label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
+				<Row :gutter="24" type="flex">
+					<Col span="24">
+					<FormItem label="调价类型:" prop="control">
+						<RadioGroup v-model="formValidate.type" @on-change="typeChange">
+							<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="store_id">
+						<el-cascader placeholder="请选择门店" class="input-add" size="mini"
+							v-model="formValidate.store_id" :options="staffData" :props="propss"
+							@change="userSearchse" filterable v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					
+					<Col span="24">
+					<FormItem label="创建人:" prop="create_uid" v-if="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'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="调价比例:" prop="scale" v-if="formValidate.type == 1">
+						<Input v-model="formValidate.scale" placeholder="请输入调价比例" v-width="'150'" type="number"/>
+					</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 }" 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> -->
+							<!-- want_product_num -->
+							<!-- //chooseUnit -->
+							<!-- <template slot-scope="{ row,index }" slot="want_product_num">
+								<Input v-model="chooseGoods[index].want_product_num" placeholder="请输入要货数量" v-width="'150'" type="number"/>
+							</template> -->
+							<template slot-scope="{ row,index }" slot="price">
+								<Input v-model="chooseGoods[index].price" placeholder="请输入价格" v-width="'150'" type="number" v-if="formValidate.type == 0"/>
+								<div v-else>{{(row.ot_price * (1 + formValidate.scale*0.01)).toFixed(2)}}</div>
+							</template>
+							<!-- <template slot-scope="{ row,index }" slot="ot_price">
+								<Input v-model="chooseGoods[index].ot_price" 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>
+							<!-- <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> -->
+						</Table>
+						<Button type="primary" class="submission" style="margin-top:20px;" @click="getGoods()" v-if="formValidate.id == 0">选择商品</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,
+		createAdjust,
+		getWantInfo
+	} 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: "adjustAdd",
+		components: {
+			goodDetail
+		},
+		data() {
+			return {
+				scale: 0,
+				loading: false,
+				authList: [],
+				columnss: [{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 160
+					},
+					{
+						title: '要货数量',
+						slot: 'want_product_num',
+						minWidth: 90
+					},
+					{
+						title: '要货单位',
+						key: 'unit_name',
+						minWidth: 150
+					},
+					{
+						title: '操作',
+						slot: 'action',
+						minWidth: 120
+					},],
+				columns: [{
+						title: 'ID',
+						key: 'product_id',
+						minWidth: 160
+					},{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 160
+					},
+					// {
+					// 	title: '单位',
+					// 	key: 'unit_name',
+					// 	minWidth: 150
+					// },
+					{
+						title: '修改前价格',
+						key: 'ot_price',
+						minWidth: 90
+					},
+					{
+						title: '修改后价格',
+						slot: 'price',
+						minWidth: 150
+					},
+					
+					// {
+					// 	title: '门店库存',
+					// 	slot: 'store_num',
+					// 	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: {
+					type: 0,
+					id: 0,
+					wid: 0,
+					store_id: 0,
+					goods: [],
+					my_store_id: 0,
+					create_uid: 0,
+					create_admin_id: 0,
+					scale: "",
+				},
+				ruleValidate: {
+					store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择门店",
+						trigger: "blur"
+					}, ],
+					my_store_id: [{
+						type: "number",
+						required: true,
+						message: "请选择门店",
+						trigger: "blur"
+					}, ],
+					wid: [{
+						type: "number",
+						required: true,
+						message: "请选择仓库",
+						trigger: "blur"
+					}, ],
+					create_uid: [{
+						type: "number",
+						required: true,
+						message: "请选择创建人",
+						trigger: "blur"
+					}, ],
+					//integer
+					// scale: [{
+					// 	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.getWantInfo(this.$route.query.id)
+			}
+		},
+		destroyed() {
+			// this.setCopyrightShow({
+			// 	value: true
+			// });
+		},
+		methods: {
+			...mapMutations("admin/layout", ["setCopyrightShow"]),
+			typeChange() {
+				this.chooseGoods = []
+			},
+			getWantInfo(id) {
+				getWantInfo(id).then(res => {
+					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.type = 0
+						this.formValidate.wid = data.wid
+						this.getUserList({
+							wid: this.formValidate.wid
+						})
+					}else {
+						this.formValidate.type = 1
+						this.getUserList({
+							store_id: this.formValidate.store_id
+						})
+					}
+				})
+			},
+			setGoods(e) {
+				console.log(e, 'ddd');
+				let arr = this.chooseGoods.concat(e.map(e => {
+					let good = {
+						product_name:e.product_name,
+						product_id:e.product_id,
+						price:e.my.price,
+						ot_price: e.my.price
+					}
+					return good
+				}))
+				
+				//
+				let uniqueArray = arr.reverse().filter(function(item, index, self) {
+					return !self.slice(index + 1).some(function(otherItem) {
+						return item.product_id === otherItem.product_id
+					});
+				});
+				this.chooseGoods = uniqueArray.reverse()
+				// 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_2
+				// 			})
+				// 		}
+				// 		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');
+			},
+			getGoods() {
+				if(!this.formValidate.store_id) {
+					return this.$Message.error('请选择门店')
+				}
+				this.$refs.goodDetail.formValidate.store_id = this.formValidate.store_id
+				this.$refs.goodDetail.modals = true
+				this.$refs.goodDetail.getList()
+				
+			},
+			getUserList() {
+				getUserList({
+					store_id: this.formValidate.store_id
+				}).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.chooseGoods = []
+				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.goods = []
+				this.getUserList()
+			},
+			userSearchsss(e) {
+				if(e) {
+					let obj = this.authList.find(item => item.id == e)
+					this.formValidate.create_admin_id = obj.admin_id
+				}
+				
+			},
+			handleSubmit(name) {
+				// 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
+				// }
+				
+				
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						this.formValidate.id = this.$route.query.id;
+						let errIndex = 0
+						let arr = []
+						if(this.formValidate.type == 1 ) {
+							if(!this.formValidate.scale) return this.$Message.error('请输入调价比例')
+							if(this.formValidate.scale % 1 !== 0) return this.$Message.error('调价比例须为整数')
+						}
+						this.chooseGoods.forEach(item => {
+							if(item.price < 0) {
+								errIndex++
+							}
+							if(this.formValidate.type == 1) {
+								item.price = (item.price*(1 + this.formValidate.scale*0.01)).toFixed(2)
+								item.scale = this.formValidate.scale
+							}
+							if(item.price != item.ot_price) {
+								arr.push(item)
+							}
+						})
+						if(errIndex> 0) {
+							return this.$Message.error('调整后的价格不能为负值')
+						}
+						if(arr.length == 0) {
+							return this.$Message.error('请选择商品进行调价')
+						}
+						if(this.formValidate.type == 1) {
+							
+						}
+						createAdjust({
+							id: this.formValidate.id,
+							body: arr,
+							type: this.formValidate.type,
+							store_id: this.formValidate.store_id,
+							create_admin_id: this.formValidate.create_admin_id,
+							create_uid: this.formValidate.create_uid
+						}).then(res => {
+							this.$Message.success(res.msg);
+							this.$router.push({
+								path: this.roterPre + "/erp/adjust_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;
+	}
+</style>

+ 266 - 0
src/pages/erp/adjust/goodDetail.vue

@@ -0,0 +1,266 @@
+<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="price">
+					<span> {{ row.my.price }}</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: 10 ,// 每页显示条数
+					key: '',
+					wid: '',
+					my_store_id: '',
+					store_id: '',
+					type: 0,
+				},
+				total: 0,
+				columns: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					},
+					{
+						title: 'ID',
+						key: 'product_id',
+						minWidth: 50
+					},
+					{
+						title: '商品名称',
+						key: 'product_name',
+						minWidth: 200
+					},
+					{
+						title: '单位',
+						key: 'unit_name',
+						minWidth: 150
+					},
+					{
+						title: '价格',
+						slot: 'price',
+						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.tabList = []
+				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() {
+				this.loading = true;
+				let qdata = {
+					key: this.formValidate.key,
+					my_store_id: this.formValidate.store_id,
+					store_id: this.formValidate.store_id,
+					page: this.formValidate.page,
+					limit: this.formValidate.limit
+				}
+				// 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
+				// }
+				
+				getOutGoodList(qdata).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>

+ 19 - 14
src/pages/erp/adjust/index.vue

@@ -67,14 +67,16 @@
 			<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="cuser">
-					<div>名称:{{row.cuser.title}}</div>
+					<div>{{row.cuser.staff_name}}</div>
+					<!-- <div>名称:{{row.cuser.title}}</div>
 					<div>ID:{{row.cuser.id}}</div>
-					<div>手机:{{row.cuser.phone}}</div>
+					<div>手机:{{row.cuser.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
-					<div>名称:{{row.store.name}}</div>
+					<div>{{row.store.name}}</div>
+					<!-- <div>名称:{{row.store.name}}</div>
 					<div>ID:{{row.store.id}}</div>
-					<div>手机:{{row.store.phone}}</div>
+					<div>手机:{{row.store.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="type">
 					<div>{{row.type == 1?"比例调整": "价格调整"}}</div>
@@ -85,8 +87,10 @@
 				<template slot-scope="{ row, index }" slot="body">
 					<div v-for="(item,index) in row.body" class="info">
 						<div>名称:{{item.product_name}}</div>
-						<div>ID:{{item.product_id}}</div>
-						<div>价格:{{item.price}}</div>
+						<!-- <div>ID:{{item.product_id}}</div> -->
+						<div v-if="item.ot_price">调价前价格:{{item.ot_price*1}}</div>
+						<div v-if="item.price">调价后价格:{{item.price*1}}</div>
+						<div v-if="item.scale">比例:{{item.scale}}%</div>
 					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="status">
@@ -118,7 +122,8 @@
 	import {
 		getBatchList,
 		getUserInfo,
-		getUserList
+		getUserList,
+		getAdjustList
 	} from "@/api/erp";
 	import {staffListInfo} from '@/api/store'
 	import {
@@ -171,11 +176,11 @@
 						slot: "body",
 						minWidth: 200,
 					},
-					{
-						title: "备注",
-						slot: "auth_remark",
-						minWidth: 200,
-					},
+					// {
+					// 	title: "备注",
+					// 	slot: "auth_remark",
+					// 	minWidth: 200,
+					// },
 					{
 						title: "创建时间",
 						slot: "add_time",
@@ -254,7 +259,7 @@
 			// 添加
 			add() {
 				this.$router.push({
-					path: this.roterPre + "/erp/add_position?id=0"
+					path: this.roterPre + "/erp/adjust_add?id=0"
 				});
 			},
 			addMore() {
@@ -326,7 +331,7 @@
 				this.loading = true;
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
-				getBatchList(this.tableFrom)
+				getAdjustList(this.tableFrom)
 					.then(async (res) => {
 						let data = res.data;
 						this.tableList = data.data;

+ 8 - 0
src/pages/erp/admin/index.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 345 - 0
src/pages/erp/expired/index.vue

@@ -0,0 +1,345 @@
+<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="layer">
+					<span> {{ row.bin_number.slice(2,3) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="control">
+					<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="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="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>
+		<!-- <positionDetail ref="positionDetail"></positionDetail> -->
+	</div>
+</template>
+
+<script>
+	// import positionDetail from './positionDetail.vue'
+	import {
+		mapState
+	} from "vuex";
+	import {
+		integralProductListApi,
+		integralIsShowApi,
+		storeSeckillApi,
+	} from "@/api/marketing";
+	import {
+		getGoodsList,
+		getUserInfo,
+		getPosition
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import timeOptions from "@/utils/timeOptions";
+	import Setting from "@/setting";
+	export default {
+		name: "expired",
+		components: {
+			// positionDetail
+		},
+		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: "title",
+						minWidth: 90,
+					},
+					{
+						title: "通道",
+						slot: "passageway",
+						minWidth: 90,
+					},
+					{
+						title: "层数",
+						slot: "layer",
+						minWidth: 90,
+					},
+					{
+						title: "左右",
+						slot: "control",
+						minWidth: 90,
+					},
+					{
+						title: "仓位编号",
+						slot: "number",
+						minWidth: 90,
+					},
+					{
+						title: "编号",
+						key: "bin_number",
+						minWidth: 90,
+					},
+					{
+						title: "仓库信息",
+						slot: "ware",
+						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) {
+				// getPosition(row.id).then(res => {
+					
+				// })
+				this.$refs.positionDetail.getInfo(row.id)
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/erp/add_position?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 || "";
+				getGoodsList(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>

+ 21 - 7
src/pages/erp/godown/position.vue

@@ -55,10 +55,10 @@
 				<template slot-scope="{ row, index }" slot="passageway">
 					<span> {{ row.bin_number.slice(0,2) }}</span>
 				</template>
-				<template slot-scope="{ row, index }" slot="control">
+				<template slot-scope="{ row, index }" slot="layer">
 					<span> {{ row.bin_number.slice(2,3) }}</span>
 				</template>
-				<template slot-scope="{ row, index }" slot="layer">
+				<template slot-scope="{ row, index }" slot="control">
 					<span> {{ row.bin_number.slice(3,4) }}</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="number">
@@ -71,6 +71,8 @@
 					<div>地址:{{row.ware.detailed_address}}</div>
 				</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>
@@ -81,10 +83,12 @@
 					:page-size="tableFrom.limit" />
 			</div>
 		</Card>
+		<positionDetail ref="positionDetail"></positionDetail>
 	</div>
 </template>
 
 <script>
+	import positionDetail from './positionDetail.vue'
 	import {
 		mapState
 	} from "vuex";
@@ -95,7 +99,8 @@
 	} from "@/api/marketing";
 	import {
 		getPositionList,
-		getUserInfo
+		getUserInfo,
+		getPosition
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -104,6 +109,9 @@
 	import Setting from "@/setting";
 	export default {
 		name: "godownList",
+		components: {
+			positionDetail
+		},
 		filters: {
 			formatDate(time) {
 				if (time !== 0) {
@@ -133,13 +141,13 @@
 						minWidth: 90,
 					},
 					{
-						title: "左右",
-						slot: "control",
+						title: "层数",
+						slot: "layer",
 						minWidth: 90,
 					},
 					{
-						title: "层数",
-						slot: "layer",
+						title: "左右",
+						slot: "control",
 						minWidth: 90,
 					},
 					{
@@ -197,6 +205,12 @@
 			this.getList();
 		},
 		methods: {
+			look(row) {
+				// getPosition(row.id).then(res => {
+					
+				// })
+				this.$refs.positionDetail.getInfo(row.id)
+			},
 			// 添加
 			add() {
 				this.$router.push({

+ 525 - 0
src/pages/erp/godown/positionDetail.vue

@@ -0,0 +1,525 @@
+<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.title}}</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">
+								<div class="section-hd">{{goods.product_name}}</span> </div>
+								<div  class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ goods.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>商品编号:</div>
+											<div class="value">{{ goods.bar_code}}</div>
+										</div>
+										<div class="item">
+											<div>生产日期:</div>
+											<div class="value">{{ goods.batch_code ? goods.batch_code.slice(0,4) + '年' + goods.batch_code.slice(4,6) + '月' + goods.batch_code.slice(6,8) + '日': '/'}}</div>
+										</div>
+										<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>
+										<!-- shelf_life -->
+										<div class="item">
+											<div>保质期:</div>
+											<div class="value">{{ goods.shelf_life == -1 ? '/': goods.shelf_life}}</div>
+										</div>
+										<!-- <div class="item" v-if="goods.is_weigh == 1">
+											<div>皮重(kg):</div>
+											<div class="value">{{ goods.tare_weight}}</div>
+										</div> -->
+										<div class="item" v-if="goods.is_weigh == 1">
+											<div>净重(kg):</div>
+											<div class="value">{{ goods.net_weight}}</div>
+										</div>
+									</div>
+								</div>
+							</div>
+						</Card>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<div class="section" >
+								<div class="section-bd">
+									<div class="item">
+										<div>通道:</div>
+										<div class="value">{{ info.bin_number.slice(0,2)}}</div>
+									</div>
+									<div class="item">
+										<div>左右:</div>
+										<div class="value">{{ info.bin_number.slice(2,3)}}</div>
+									</div>
+									<div class="item">
+										<div>层数:</div>
+										<div class="value">{{ info.bin_number.slice(3,4)}}</div>
+									</div>
+									<div class="item">
+										<div>仓位编号:</div>
+										<div class="value">{{ info.bin_number.slice(4)}}</div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getPurchaseInfo,
+		getOutInfo,
+		getPosition
+	} from "@/api/erp";
+	import Setting from "@/setting";
+
+	export default {
+		name: 'positionDetail',
+		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) {
+				getPosition(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>

+ 551 - 0
src/pages/erp/in/inDetail.vue

@@ -0,0 +1,551 @@
+<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.in_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.info">
+								<div class="section-hd">{{goods.product_name}} ( 仓位: {{goods.bin_number}} )</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.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.product_num}}</div>
+										</div>
+										<div class="item" v-if="goods.is_weigh == 1">
+											<div>皮重(kg):</div>
+											<div class="value">{{ item.tare_weight}}</div>
+										</div>
+										<div class="item" v-if="goods.is_weigh == 1">
+											<div>净重(kg):</div>
+											<div class="value">{{ item.net_weight}}</div>
+										</div>
+									</div>
+								</div>
+							</div>
+						</Card>
+					</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>名称:</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.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>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getPurchaseInfo,
+		getOutInfo,
+		getInInfo
+	} from "@/api/erp";
+	import Setting from "@/setting";
+
+	export default {
+		name: 'inDetail',
+		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) {
+				getInInfo(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>

+ 40 - 17
src/pages/erp/in/index.vue

@@ -8,6 +8,13 @@
 				<!-- 查询条件 -->
 				<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>
 					<FormItem label="状态:" label-for="status">
 						<Select v-model="tableFrom.status" placeholder="请选择" clearable @on-change="userSearchs"
 							class="input-add">
@@ -33,25 +40,28 @@
 					<div v-if="row.info.length >2">{{row.info[2].product_name}}</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="cuser">
-					<div>名称:{{row.cuser.staff_name}}</div>
+					<div>{{row.cuser.staff_name}}</div>
+					<!-- <div>名称:{{row.cuser.staff_name}}</div>
 					<div>ID:{{row.cuser.id}}</div>
-					<div>手机:{{row.cuser.phone}}</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> -->
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<div>{{row.ware.title}}</div>
+					<!-- <div>名称:{{row.ware.title}}</div>
 					<div>ID:{{row.ware.id}}</div>
 					<div>手机:{{row.ware.phone}}</div>
-					<div>地址:{{row.ware.detailed_address}}</div>
+					<div>地址:{{row.ware.detailed_address}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
-					<div>名称:{{row.store.name}}</div>
+					<div>{{row.store.name}}</div>
+					<!-- <div>名称:{{row.store.name}}</div>
 					<div>ID:{{row.store.id}}</div>
 					<div>手机:{{row.store.phone}}</div>
-					<div>地址:{{row.store.detailed_address}}</div>
+					<div>地址:{{row.store.detailed_address}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="status">
 					<Tag color="default" v-if="row.status == 0">待审核</Tag>
@@ -141,17 +151,20 @@
 				<Button @click="cancels()">取消</Button>
 			</div>
 		</Modal>
+		<inDetail ref="inDetail"></inDetail>
 	</div>
 </template>
 
 <script>
+	import inDetail from './inDetail.vue'
 	import {
 		mapState
 	} from "vuex";
 	import {
 		getInList,
 		getInInfo,
-		listing
+		listing,
+		getGodownList
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -163,7 +176,6 @@
 		createPosition,
 		getPositionList
 	} from "@/api/erp";
-
 	const jy = (min, max) => {
 		return {
 			validator(rule, value) {
@@ -179,6 +191,9 @@
 	}
 	export default {
 		name: "inList",
+		components: {
+			inDetail
+		},
 		filters: {
 			formatDate(time) {
 				if (time !== 0) {
@@ -189,6 +204,7 @@
 		},
 		data() {
 			return {
+				data1: [],
 				modalPosition: false,
 				remarks: {
 					id: 0,
@@ -242,6 +258,11 @@
 						key: "out_order_id",
 						minWidth: 160,
 					},
+					{
+						title: "仓库",
+						slot: "ware",
+						minWidth: 150,
+					},
 					{
 						title: "入库商品",
 						slot: "info",
@@ -257,11 +278,6 @@
 						slot: "auser",
 						minWidth: 150,
 					},
-					{
-						title: "仓库",
-						slot: "ware",
-						minWidth: 150,
-					},
 					{
 						title: "总数量",
 						key: "total_num",
@@ -327,7 +343,7 @@
 					page: 1,
 					limit: 10,
 					status: -3,
-					total: 0,
+					// total: 0,
 				},
 				inInfo: {},
 				infoList: [],
@@ -346,8 +362,15 @@
 		},
 		created() {
 			this.getList();
+			this.getGodownList()
 		},
 		methods: {
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+				})
+			},
 			putRemark() {
 				this.$refs.remarks.validate((valid) => {
 					if (valid) {
@@ -478,7 +501,7 @@
 			},
 			// 详情
 			info(row) {
-
+				this.$refs.inDetail.getInfo(row.id)
 			},
 			// 删除
 			del(row, tit, num) {

+ 3 - 2
src/pages/erp/inventory/stocktaking.vue

@@ -35,10 +35,11 @@
 					<span> {{ row.add_time |formatDate }}</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<div>{{row.ware.title}}</div>
+					<!-- <div>名称:{{row.ware.title}}</div>
 					<div>ID:{{row.ware.id}}</div>
 					<div>手机:{{row.ware.phone}}</div>
-					<div>地址:{{row.ware.detailed_address}}</div>
+					<div>地址:{{row.ware.detailed_address}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="status">
 					<Tag color="default" v-if="row.status == 0">待审核</Tag>

+ 8 - 0
src/pages/erp/losses/addLosses.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
src/pages/erp/losses/index.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 346 - 0
src/pages/erp/low/index.vue

@@ -0,0 +1,346 @@
+<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="layer">
+					<span> {{ row.bin_number.slice(2,3) }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="control">
+					<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="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="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>
+		<!-- <positionDetail ref="positionDetail"></positionDetail> -->
+	</div>
+</template>
+
+<script>
+	// import positionDetail from './positionDetail.vue'
+	import {
+		mapState
+	} from "vuex";
+	import {
+		integralProductListApi,
+		integralIsShowApi,
+		storeSeckillApi,
+	} from "@/api/marketing";
+	import {
+		getGoodsList,
+		getUserInfo,
+		getPosition
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import timeOptions from "@/utils/timeOptions";
+	import Setting from "@/setting";
+	export default {
+		name: "expired",
+		components: {
+			// positionDetail
+		},
+		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: "product_name",
+						minWidth: 90,
+					},
+					{
+						title: "通道",
+						slot: "passageway",
+						minWidth: 90,
+					},
+					{
+						title: "层数",
+						slot: "layer",
+						minWidth: 90,
+					},
+					{
+						title: "左右",
+						slot: "control",
+						minWidth: 90,
+					},
+					{
+						title: "仓位编号",
+						slot: "number",
+						minWidth: 90,
+					},
+					{
+						title: "编号",
+						key: "bin_number",
+						minWidth: 90,
+					},
+					{
+						title: "仓库信息",
+						slot: "ware",
+						minWidth: 90,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						width: 200,
+					},
+				],
+				tableList: [],
+				timeVal: [],
+				grid: {
+					xl: 7,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				tableFrom: {
+					low: 1,
+					// 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) {
+				// getPosition(row.id).then(res => {
+					
+				// })
+				this.$refs.positionDetail.getInfo(row.id)
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/erp/add_position?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 || "";
+				getGoodsList(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>

+ 2 - 2
src/pages/erp/out/addOut.vue

@@ -22,7 +22,7 @@
 			<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">
+					<!-- <Col span="24">
 					<FormItem label="调出类型:" prop="outType">
 						<RadioGroup v-model="formValidate.outType" @on-change="changeOutType">
 							<Radio :label="0" :disabled="formValidate.id != 0">
@@ -35,7 +35,7 @@
 							</Radio>
 						</RadioGroup>
 					</FormItem>
-					</Col>
+					</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"

+ 963 - 0
src/pages/erp/out/addOutT.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: 1,
+					outType: 1,
+					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>

+ 30 - 21
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" v-if="currentTab == 0">
 			<div class="new_card_pd">
 				<!-- 查询条件 -->
 				<Form ref="tableFrom" inline :model="tableFrom" :label-width="labelWidth"
@@ -33,6 +33,7 @@
 			</div>
 			<!-- 操作 -->
 			<Button v-auth="['admin-erp-out_add']" type="primary" @click="add" class="mr10">创建出库单</Button>
+			<Button v-auth="['admin-erp-out_addt']" type="primary" @click="addt" class="mr10">创建调出单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
@@ -49,10 +50,10 @@
 					<span> {{ row.bin_number.slice(4) }}</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="cuser">
-					<div>名称:{{row.cuser.staff_name}}</div>
-					<!-- <div>管理员ID:{{row.cuser.admin_id}}</div> -->
+					<div>{{row.cuser.staff_name}}</div>
+					<!-- <div>名称:{{row.cuser.staff_name}}</div>
 					<div>ID:{{row.cuser.id}}</div>
-					<div>手机:{{row.cuser.phone}}</div>
+					<div>手机:{{row.cuser.phone}}</div> -->
 				</template>
 				<!-- <template slot-scope="{ row, index }" slot="cadmin">
 					<div>名称:{{row.cadmin.account}}</div>
@@ -60,10 +61,11 @@
 				</template> -->
 				<template slot-scope="{ row, index }" slot="product">
 					<div v-for="item in row.product" class="info">
-						<div>
+						{{item.store_name}}
+						<!-- <div>
 							商品名称:{{item.store_name}}
-						</div>
-						<div>
+						</div> -->
+						<!-- <div>
 							<div v-for="goods in item.group">
 								<div v-if="goods.pur_number != 0">
 									<span>
@@ -72,33 +74,33 @@
 									<Tag color="primary" >{{goods.pur_number *1}} {{goods.unit_name}}</Tag>
 								</div>
 							</div>
-						</div>
+						</div> -->
 				
 					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<div>{{row.ware.title}}</div>
+					<!-- <div>名称:{{row.ware.title}}</div>
 					<div>ID:{{row.ware.id}}</div>
-					<div>手机:{{row.ware.phone}}</div>
-					<!-- <div>地址:{{row.ware.detailed_address}}</div> -->
+					<div>手机:{{row.ware.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="tware">
-					<div>名称:{{row.tware.title}}</div>
+					<div>{{row.tware.title}}</div>
+					<!-- <div>名称:{{row.tware.title}}</div>
 					<div>ID:{{row.tware.id}}</div>
-					<div>手机:{{row.tware.phone}}</div>
-					<!-- <div>地址:{{row.tware.detailed_address}}</div> -->
+					<div>手机:{{row.tware.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
-					<div>名称:{{row.store.name}}</div>
+					<div>{{row.store.name}}</div>
+					<!-- <div>名称:{{row.store.name}}</div>
 					<div>ID:{{row.store.id}}</div>
-					<div>手机:{{row.store.phone}}</div>
-					<!-- <div>地址:{{row.store.detailed_address}}</div> -->
+					<div>手机:{{row.store.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="tstore">
-					<div>名称:{{row.tstore.name}}</div>
+					<div>{{row.tstore.name}}</div>
+					<!-- <div>名称:{{row.tstore.name}}</div>
 					<div>ID:{{row.tstore.id}}</div>
-					<div>手机:{{row.tstore.phone}}</div>
-					<!-- <div>地址:{{row.tstore.detailed_address}}</div> -->
+					<div>手机:{{row.tstore.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="create_time">
 					<div>{{row.create_time|formatDate}}</div>
@@ -385,6 +387,7 @@
 							key: this.tableFrom.key,
 							page:this.tableFrom.page,
 							limit: this.tableFrom.limit,
+							type: this.currentTab
 						}
 					}
 					if(this.currentTab == 0){
@@ -394,6 +397,7 @@
 							key: this.tableFrom.key,
 							page:this.tableFrom.page,
 							limit: this.tableFrom.limit,
+							type: this.currentTab
 						}
 					}
 				}catch(e){
@@ -419,6 +423,11 @@
 					path: this.roterPre + "/erp/out_add?id=0"
 				});
 			},
+			addt() {
+				this.$router.push({
+					path: this.roterPre + "/erp/out_addt?id=0"
+				});
+			},
 			addMore() {
 				this.$router.push({
 					path: this.roterPre + "/marketing/store_integral/add_store_integral",
@@ -530,7 +539,7 @@
 	}
 	.info {
 		padding-top: 10px;
-		border-bottom: 1px dashed #515a6e;
+		// border-bottom: 1px dashed #515a6e;
 	
 		&:last-of-type {
 			border: none;

+ 1 - 1
src/pages/erp/out/outDetail.vue

@@ -85,7 +85,7 @@
 								</div>
 							</div>
 							<div class="section" v-if="info.ware && info.ware.id">
-								<div class="section-hd">调出门店</div>
+								<div class="section-hd">调出仓库</div>
 								<div class="section-bd" >
 									<div class="item">
 										<div>名称:</div>

+ 10 - 2
src/pages/erp/product/addProduct.vue

@@ -86,7 +86,7 @@
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="大单位转化率:" prop="unit_rate_1">
+					<FormItem label="大单位转化率:" prop="unit_rate_1" v-if="formValidate.unit_name_1">
 						<Input v-model="formValidate.unit_rate_1" placeholder="请输入大单位转化率" v-width="'50%'" />
 					</FormItem>
 					</Col>
@@ -102,7 +102,7 @@
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="超大单位转化率:" prop="unit_rate_2">
+					<FormItem label="超大单位转化率:" prop="unit_rate_2" v-if="formValidate.unit_name_2">
 						<Input v-model="formValidate.unit_rate_2" placeholder="请输入超大单位转化率" v-width="'50%'" />
 					</FormItem>
 					</Col>
@@ -565,6 +565,14 @@
 						required: true,
 						message: "请选择输入条形码",
 					}],
+					unit_rate_1: [{
+						required: true,
+						message: "请输入大单位转化率",
+					}],
+					unit_rate_2: [{
+						required: true,
+						message: "请输入超大单位转化率",
+					}]
 					// delivery_type:[
 					//   { required: true, type: 'array', min: 1, message: '请选择配送方式', trigger: 'change' },
 					// ]

+ 39 - 24
src/pages/erp/purchase/index.vue

@@ -92,36 +92,46 @@
 			<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="auser">
-					<!-- <span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span> -->
-					<div>名称:{{row.auser.staff_name}}</div>
+					<div v-if="row.auser">{{row.auser.staff_name}}</div>
+					<div v-if="row.auth_time">{{row.auth_time |formatDate }}</div>
+					<!-- <div>名称:{{row.auser.staff_name}}</div>
 					<div>管理员ID:{{row.auser.admin_id}}</div>
 					<div>ID:{{row.auser.id}}</div>
-					<div>手机:{{row.auser.phone}}</div>
+					<div>手机:{{row.auser.phone}}</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>{{row.supplier.supplier_name}}</div>
+					<!-- <div>名称:{{row.supplier.supplier_name}}</div>
 					<div>ID:{{row.supplier.id}}</div>
-					<div>手机:{{row.supplier.phone}}</div>
+					<div>手机:{{row.supplier.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
-					<!-- <span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span> -->
-					<div>名称:{{row.store.name}}</div>
+					<div>{{row.store.name}}</div>
+					<!-- <div>名称:{{row.store.name}}</div>
 					<div>ID:{{row.store.id}}</div>
-					<div>手机:{{row.store.phone}}</div>
+					<div>手机:{{row.store.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="cuser">
-					<!-- <span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span> -->
-					<div>名称:{{row.cuser.staff_name}}</div>
+					<div>{{row.cuser.staff_name}}</div>
+					<div>{{row.create_time |formatDate }}</div>
+					<!-- <div>名称:{{row.cuser.staff_name}}</div>
 					<div>管理员ID:{{row.cuser.admin_id}}</div>
 					<div>ID:{{row.cuser.id}}</div>
-					<div>手机:{{row.cuser.phone}}</div>
+					<div>手机:{{row.cuser.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<div>{{row.ware.title}}</div>
+					<!-- <div>名称:{{row.ware.title}}</div>
 					<div>ID:{{row.ware.id}}</div>
 					<div>手机:{{row.ware.phone}}</div>
-					<div>地址:{{row.ware.detailed_address}}</div>
+					<div>地址:{{row.ware.detailed_address}}</div> -->
+				</template>
+				<template slot-scope="{ row, index }" slot="puser">
+					<div>{{row.puser.staff_name}}</div>
+					<!-- <div>名称:{{row.ware.title}}</div>
+					<div>ID:{{row.ware.id}}</div>
+					<div>手机:{{row.ware.phone}}</div>
+					<div>地址:{{row.ware.detailed_address}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="status">
 					<Tag color="default" v-if="row.status == 0">待审核</Tag>
@@ -138,8 +148,8 @@
 					<a @click="pass(row)" v-if="row.status == 0">审核</a>
 					<Divider type="vertical" v-if="row.status == 1" />
 					<a @click="end(row)" v-if="row.status == 1">完成</a>
-					<Divider type="vertical" />
-					<a @click="del(row, '删除采购单', index)">删除</a>
+					<Divider type="vertical" v-if="row.status <1"/>
+					<a @click="del(row, '删除采购单', index)" v-if="row.status <1">删除</a>
 				</template>
 			</Table>
 			<div class="acea-row row-right page">
@@ -343,18 +353,18 @@
 						minWidth: 200,
 					},
 					{
-						title: "仓库信息",
+						title: "采购仓库",
 						slot: "ware",
 						minWidth: 200,
 					},
 					{
-						title: "供应商",
-						slot: "supplier",
+						title: "采购门店",
+						slot: "store",
 						minWidth: 200,
 					},
 					{
-						title: "门店",
-						slot: "store",
+						title: "供应商",
+						slot: "supplier",
 						minWidth: 200,
 					},
 					{
@@ -373,13 +383,18 @@
 						minWidth: 90,
 					},
 					{
-						title: "审核人消息",
+						title: "创建人",
+						slot: "cuser",
+						minWidth: 200,
+					},
+					{
+						title: "审核人",
 						slot: "auser",
 						minWidth: 200,
 					},
 					{
-						title: "创建人消息",
-						slot: "cuser",
+						title: "采购人",
+						slot: "puser",
 						minWidth: 200,
 					},
 					{

+ 34 - 0
src/pages/erp/purchase/purchaseDetail.vue

@@ -90,6 +90,40 @@
 									</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>审核人ID:</div>
+										<div class="value">{{ info.auser.id}}</div>
+									</div>
+									<div class="item">
+										<div>审核人名称:</div>
+										<div class="value">{{ info.auser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.auser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.puser && info.puser.id">
+								<div class="section-hd">采购人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>采购ID:</div>
+										<div class="value">{{ info.puser.id}}</div>
+									</div>
+									<div class="item">
+										<div>采购名称:</div>
+										<div class="value">{{ info.puser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.puser.phone}}</div>
+									</div>
+								</div>
+							</div>
 						</div>
 					</template>
 				</TabPane>

+ 513 - 0
src/pages/erp/role/index.vue

@@ -0,0 +1,513 @@
+<template>
+<!-- 角色管理 -->
+  <div>
+    <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
+      <div class="new_card_pd">
+        <Form
+          ref="formValidate"
+          :model="formValidate"
+          inline
+          :label-width="labelWidth"
+          :label-position="labelPosition"
+          @submit.native.prevent
+        >
+          <FormItem label="状态:" label-for="status">
+            <Select
+              v-model="formValidate.status"
+              placeholder="请选择"
+              clearable
+              class="input-add"
+            >
+              <Option value="1">显示</Option>
+              <Option value="0">不显示</Option>
+            </Select>
+          </FormItem>
+          <FormItem label="身份昵称:" label-for="role_name">
+            <Input
+              placeholder="请输入身份昵称"
+              v-model="formValidate.role_name"
+              class="input-add mr14"
+            />
+            <Button type="primary" @click="userSearchs()">查询</Button>
+          </FormItem>
+        </Form>
+      </div>
+    </Card>
+    <Card :bordered="false" dis-hover class="ivu-mt">
+      <Button
+        v-auth="['setting-system_role-add']"
+        type="primary"
+        @click="add('添加')"
+        >添加身份</Button
+      >
+      <Table
+        :columns="columns1"
+        :data="tableList"
+        ref="table"
+        class="mt25"
+        :loading="loading"
+        highlight-row
+        no-userFrom-text="暂无数据"
+        no-filtered-userFrom-text="暂无筛选结果"
+      >
+        <template slot-scope="{ row, index }" slot="is_shows">
+          <i-switch
+            v-model="row.status"
+            :value="row.status"
+            :true-value="1"
+            :false-value="0"
+            @on-change="onchangeIsShow(row)"
+            size="large"
+          >
+            <span slot="open">显示</span>
+            <span slot="close">隐藏</span>
+          </i-switch>
+        </template>
+        <template slot-scope="{ row, index }" slot="action">
+          <a @click="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="formValidate.page"
+          show-elevator
+          show-total
+          @on-change="pageChange"
+          :page-size="formValidate.limit"
+        />
+      </div>
+    </Card>
+    <!-- 新增编辑-->
+    <Modal
+      v-model="modals"
+      @on-cancel="onCancel"
+      scrollable
+      footer-hide
+      closable
+      :title="`${modelTit}身份`"
+      :mask-closable="false"
+      width="600"
+    >
+      <Form
+        ref="formInline"
+        :model="formInline"
+        :rules="ruleValidate"
+        :label-width="100"
+        :label-position="labelPosition2"
+        @submit.native.prevent
+      >
+        <FormItem label="身份名称:" label-for="role_name" prop="role_name">
+          <Input placeholder="请输入身份昵称" v-model="formInline.role_name" />
+        </FormItem>
+        <FormItem label="是否开启:" prop="status">
+          <RadioGroup v-model="formInline.status">
+            <Radio :label="1">开启</Radio>
+            <Radio :label="0">关闭</Radio>
+          </RadioGroup>
+        </FormItem>
+        <FormItem label="权限:">
+          <div class="trees-coadd">
+            <div class="scollhide">
+              <div class="iconlist">
+                <Tree :data="menusList" show-checkbox ref="tree"></Tree>
+              </div>
+            </div>
+          </div>
+        </FormItem>
+        <Spin size="large" fix v-if="spinShow"></Spin>
+        <Button
+          type="primary"
+          size="large"
+          long
+          @click="handleSubmit('formInline')"
+          >提交</Button
+        >
+      </Form>
+    </Modal>
+  </div>
+</template>
+<script>
+import { mapState } from 'vuex'
+import {
+  roleListApi,
+  roleSetStatusApi,
+  menusListApi,
+  roleCreatApi,
+  roleInfoApi,
+} from '@/api/setting'
+export default {
+  name: 'erpRole',
+  data() {
+    return {
+      spinShow: false,
+      modals: false,
+      total: 0,
+      grid: {
+        xl: 7,
+        lg: 7,
+        md: 12,
+        sm: 24,
+        xs: 24,
+      },
+      loading: false,
+      formValidate: {
+        status: '',
+        role_name: '',
+        page: 1,
+        limit: 20,
+		type: 3
+      },
+      columns1: [
+        {
+          title: 'ID',
+          key: 'id',
+          width: 80,
+        },
+        {
+          title: '身份昵称',
+          key: 'role_name',
+          minWidth: 120,
+        },
+        {
+          title: '权限',
+          key: 'rules',
+          tooltip: true,
+          width: 1000,
+        },
+        {
+          title: '状态',
+          slot: 'is_shows',
+          minWidth: 120,
+        },
+        {
+          title: '操作',
+          slot: 'action',
+          fixed: 'right',
+          minWidth: 120,
+        },
+      ],
+      tableList: [],
+      formInline: {
+        role_name: '',
+        status: 0,
+        checked_menus: [],
+        id: 0,
+		type: 3
+      },
+      menusList: [],
+      modelTit: '',
+      ruleValidate: {
+        role_name: [
+          { required: true, message: '请输入身份昵称', trigger: 'blur' },
+        ],
+        status: [
+          {
+            required: true,
+            type: 'number',
+            message: '请选择是否开启',
+            trigger: 'change',
+          },
+        ],
+        // checked_menus: [
+        //     { required: true, validator: validateStatus, trigger: 'change' }
+        // ]
+      },
+    }
+  },
+  computed: {
+    ...mapState('admin/layout', ['isMobile']),
+    labelWidth() {
+      return this.isMobile ? undefined : 96
+    },
+    labelPosition() {
+      return this.isMobile ? 'top' : 'right'
+    },
+    labelPosition2() {
+      return this.isMobile ? 'top' : 'right'
+    },
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 添加
+    add(name) {
+      this.formInline.id = 0
+      this.modelTit = name
+      this.modals = true
+      this.getmenusList()
+    },
+    // 删除
+    del(row, tit, num) {
+      let delfromData = {
+        title: tit,
+        num: num,
+        url: `setting/role/${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.formValidate.page =
+                this.formValidate.page == 1 ? 1 : this.formValidate.page - 1;
+          }
+          this.getList();
+        })
+        .catch((res) => {
+          this.$Message.error(res.msg)
+        })
+    },
+    // 修改是否显示
+    onchangeIsShow(row) {
+      let data = {
+        id: row.id,
+        status: row.status,
+      }
+      roleSetStatusApi(data)
+        .then(async (res) => {
+          this.$Message.success(res.msg)
+        })
+        .catch((res) => {
+          this.$Message.error(res.msg)
+        })
+    },
+    // 列表
+    getList() {
+      this.loading = true
+      this.formValidate.status = this.formValidate.status || ''
+      roleListApi(this.formValidate)
+        .then(async (res) => {
+          let data = res.data
+          this.tableList = data.list
+          this.total = res.data.count
+          this.loading = false
+        })
+        .catch((res) => {
+          this.loading = false
+          this.$Message.error(res.msg)
+        })
+    },
+    pageChange(index) {
+      this.formValidate.page = index
+      this.getList()
+    },
+    // 表格搜索
+    userSearchs() {
+      this.formValidate.page = 1
+      this.getList()
+    },
+    // 编辑
+    edit(row, name) {
+      this.modelTit = name
+      this.formInline.id = row.id
+      this.modals = true
+      this.rows = row
+      this.getIofo(row)
+    },
+    //默认首页被选中并禁止更改
+    checkedFun(data) {
+      // data.forEach((item) => {
+      //   if (item.title == '运营') {
+      //     item.disabled = true
+      //     if (item.children.length) {
+      //       item.children.forEach((j) => {
+      //         if (j.title == '首页') {
+      //           this.formInline.checked_menus.push(j.id)
+      //           j.checked = true
+      //           j.disabled = true
+      //           if (j.children.length) {
+      //             j.children.forEach((v) => {
+      //               v.checked = true
+      //               v.disabled = true
+      //             })
+      //           }
+      //         }
+      //       })
+      //     }
+      //   }
+      //   item.expand = false
+      // })
+      for (let i = 0; i < data.length; i++) {
+        if (data[i].title != '运营') {
+          break;
+        }
+        for (let j = 0; j < data[i].children.length; j++) {
+          if (data[i].children[j].title != '首页') {
+            break;
+          }
+          if (typeof this.formInline.checked_menus == 'string') {
+            this.formInline.checked_menus = this.formInline.checked_menus.split(',');
+          }
+          this.formInline.checked_menus.push(data[i].children[j].id);
+          this.formInline.checked_menus = this.formInline.checked_menus.join();
+          data[i].children[j].disabled = true;
+          data[i].children[j].checked = true;
+          for (let k = 0; k < data[i].children[j].children.length; k++) {
+            data[i].children[j].children[k].disabled = true;
+            data[i].children[j].children[k].checked = true;
+          }
+        }
+      }
+    },
+    // 菜单列表
+    getmenusList() {
+      this.spinShow = true
+      menusListApi({
+		  type: 3
+	  })
+        .then(async (res) => {
+          let data = res.data
+          // const mList = data.menus[0].children.splice(0,1);
+          this.menusList = data.menus
+          this.checkedFun(res.data.menus)
+          // this.menusList.map((item, index) => {
+          //   if (item.title === '主页') {
+          //     item.checked = true
+          //     item.disableCheckbox = true
+          //     if (item.children.length) {
+          //       item.children.map((v) => {
+          //         v.checked = true
+          //         v.disableCheckbox = true
+          //       })
+          //     }
+          //   }
+          //   item.expand = false
+          // })
+          this.spinShow = false
+        })
+        .catch((res) => {
+          this.spinShow = false
+          this.$Message.error(res.msg)
+        })
+    },
+    // 详情
+    getIofo(row) {
+      this.spinShow = true
+      roleInfoApi(row.id,{type: 3})
+        .then(async (res) => {
+          let data = res.data
+          this.formInline = data.role || this.formInline
+          this.formInline.checked_menus = this.formInline.rules
+          this.tidyRes(data.menus)
+          this.spinShow = false
+        })
+        .catch((res) => {
+          this.spinShow = false
+          this.$Message.error(res.msg)
+        })
+    },
+    tidyRes(menus) {
+      let data = []
+      menus.map((menu) => {
+        data.push(this.initMenu(menu))
+      })
+      this.checkedFun(data);
+      this.$set(this, 'menusList', data)
+      // this.menusList.map((item, index) => {
+      //     if (item.title === '主页') {
+      //         item.checked = true;
+      //         item.disableCheckbox = true;
+      //         if (item.children.length) {
+      //             item.children.map(v => {
+      //                 v.checked = true;
+      //                 v.disableCheckbox = true;
+      //             });
+      //         }
+      //     }
+      // });
+    },
+    initMenu(menu) {
+      let data = {},
+        checkMenus = ',' + this.formInline.checked_menus + ','
+      data.title = menu.title
+      data.id = menu.id
+      if (menu.children && menu.children.length > 0) {
+        data.children = []
+        menu.children.map((child) => {
+          data.children.push(this.initMenu(child))
+        })
+      } else {
+        data.checked = checkMenus.indexOf(String(',' + data.id + ',')) !== -1
+        data.expand = !data.checked
+      }
+      return data
+    },
+    // 递归函数
+    // getNestedChildren(arr, parent) {
+    //   var out = []
+    //   for (var i in arr) {
+    //     if (arr[i].parent == parent) {
+    //       var children = getNestedChildren(arr, arr[i].id)
+
+    //       if (children.length) {
+    //         arr[i].children = children
+    //       }
+    //       out.push(arr[i])
+    //     }
+    //   }
+    //   return out
+    // },
+    // 提交
+    handleSubmit(name) {
+      this.$refs[name].validate((valid) => {
+        if (valid) {
+          this.formInline.checked_menus = []
+          this.$refs.tree.getCheckedAndIndeterminateNodes().map((node) => {
+            this.formInline.checked_menus.push(node.id)
+          })
+
+          if (this.formInline.checked_menus.length === 0)
+            return this.$Message.warning('请至少选择一个权限')
+          roleCreatApi(this.formInline)
+            .then(async (res) => {
+              this.$Message.success(res.msg)
+              this.modals = false
+              this.getList()
+              this.$refs[name].resetFields()
+              this.formInline.checked_menus = []
+            })
+            .catch((res) => {
+              this.$Message.error(res.msg)
+            })
+        } else {
+          return false
+        }
+      })
+    },
+    onCancel() {
+      this.$refs['formInline'].resetFields()
+      this.formInline.checked_menus = []
+    },
+  },
+}
+</script>
+
+<style scoped lang="stylus">
+.input-add {
+ width: 250px;
+}
+.mr14 {
+ margin-right: 14px;
+}
+.trees-coadd {
+  width: 100%;
+  height: 385px;
+
+  .scollhide {
+    width: 100%;
+    height: 100%;
+    overflow-x: hidden;
+    overflow-y: scroll;
+  }
+}
+
+.scollhide::-webkit-scrollbar {
+  display: none;
+}
+</style>

+ 63 - 13
src/pages/erp/user/addUser.vue

@@ -65,8 +65,8 @@
 					</FormItem>
 					</Col>
 					<Col span="24">
-					<FormItem label="登录账号:" prop="account" v-if="formValidate.id == 0">
-						<Input v-model="formValidate.account" placeholder="请输入账号" v-width="'400'" />
+					<FormItem label="登录账号:" prop="account" >
+						<Input v-model="formValidate.account" placeholder="请输入账号" v-width="'400'" :disabled="formValidate.id != 0"/>
 					</FormItem>
 					</Col>
 					<Col span="24">
@@ -98,6 +98,10 @@
 					<FormItem label="账号归属:" prop="wid">
 						<RadioGroup v-model="formValidate.type">
 							<!-- :disabled="formValidate.id != 0" -->
+							<Radio :label="0" >
+								<Icon type="social-apple"></Icon>
+								<span>系统</span>
+							</Radio>
 							<Radio :label="1" >
 								<Icon type="social-apple"></Icon>
 								<span>仓库</span>
@@ -124,6 +128,15 @@
 						</el-cascader>
 					</FormItem>
 					</Col>
+					<!-- tableList -->
+					<Col span="24">
+					<FormItem label="角色身份:" prop="roles" >
+						<el-cascader placeholder="请选择角色身份" class="input-add" size="mini" v-model="formValidate.roles"
+							:options="tableList" :props="propsss" @change="userSearchs" filterable clearable
+							v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
 					<Col span="24">
 					<FormItem label="手机号码:" prop="phone">
 						<Input v-model="formValidate.phone" placeholder="请输入手机号码" v-width="'400'" />
@@ -184,6 +197,9 @@
 		productSpecsInfo
 	} from "@/api/product";
 	import Setting from "@/setting";
+	import {
+	  roleListApi,
+	} from '@/api/setting'
 	export default {
 		name: "userAdd",
 		components: {
@@ -194,6 +210,7 @@
 		},
 		data() {
 			return {
+				tableList: [],
 				avshow: true,
 				ushow: true,
 				customerShow: false,
@@ -209,6 +226,13 @@
 					value: "id",
 					label: "name"
 				},
+				propsss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "role_name"
+				},
 				addresData: [],
 				props: {
 					emitPath: false,
@@ -227,7 +251,7 @@
 					xs: 24,
 				},
 				formValidate: {
-					type: 1,
+					type: 0,
 					avatar: "",
 					uid: 0,
 					nickname: "",
@@ -243,7 +267,8 @@
 					staff_id: 0,
 					admin_name: "",
 					is_system: 0,
-					admin_id: 0
+					admin_id: 0,
+					roles: 0
 				},
 				gridBtn: {
 					xl: 4,
@@ -301,6 +326,11 @@
 						message: '请输入手机号码',
 						trigger: 'blur',
 					}, ],
+					roles: [{
+						required: true,
+						type: 'number',
+						message: '请选择角色身份',
+					}, ],
 				},
 			};
 		},
@@ -320,6 +350,7 @@
 			// this.cityInfo(data);
 		},
 		mounted() {
+			this.getList()
 			// this.setCopyrightShow({
 			// 	value: false
 			// });
@@ -344,21 +375,22 @@
 					let data = res.data
 					this.formValidate = {
 						uid: data.user.uid,
-						nickname: data.user.nickname,
+						nickname: data.user ? data.user.nickname :'',
 						id: id,
-						account: data.account,
-						wid: data.wid,
-						staff_name: data.staff_name,
+						account: data.account || '',
+						wid: data.wid || 0,
+						staff_name: data.staff_name || '',
 						store_id: data.store_id,
 						is_manager: data.is_manager,
 						phone: data.phone,
-						kefu: data.staff.nickname,
-						staff_id: data.staff.id,
-						admin_name: data.admin.real_name,
+						kefu: data.staff ? data.staff.nickname:'',
+						staff_id: data.staff ?data.staff.id:0,
+						admin_name: data.admin? data.admin.real_name: '',
 						is_system: data.is_system + '',
-						admin_id: data.admin.id,
+						admin_id:  data.admin?data.admin.id: 0,
 						avatar: data.avatar,
-						type: data.wid?1:2
+						type: data.wid?1:(data.store_id?2:0),
+						roles: data.roles*1 || 0
 					}
 
 				})
@@ -510,6 +542,24 @@
 					}
 				});
 			},
+			getList() {
+			  this.loading = true
+			  roleListApi({
+				  page: 1,
+				  limit:100,
+				  type: 3
+			  })
+			    .then(async (res) => {
+			      let data = res.data
+			      this.tableList = data.list
+			      // this.total = res.data.count
+			      // this.loading = false
+			    })
+			    .catch((res) => {
+			      this.loading = false
+			      this.$Message.error(res.msg)
+			    })
+			},
 		},
 	};
 </script>

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

@@ -155,7 +155,7 @@
 	import Setting from "@/setting";
 	import goodDetail from './goodDetail.vue'
 	export default {
-		name: "specsAdd",
+		name: "wantAdd",
 		components: {
 			goodDetail
 		},

+ 3 - 1
src/pages/erp/want/goodDetail.vue

@@ -66,7 +66,7 @@
 				loading: false,
 				formValidate: {
 					page: 1, // 当前页
-					limit: 20 ,// 每页显示条数
+					limit: 10 ,// 每页显示条数
 					key: '',
 					wid: '',
 					my_store_id: '',
@@ -163,6 +163,8 @@
 				let qdata = {
 					key: this.formValidate.key,
 					my_store_id: this.formValidate.my_store_id,
+					page: this.formValidate.page,
+					limit: this.formValidate.limit
 				}
 				if (this.formValidate.type == 1) {
 					this.formValidate.wid = ''

+ 26 - 32
src/pages/erp/want/index.vue

@@ -51,18 +51,6 @@
 							</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>
@@ -87,53 +75,58 @@
 					<span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="auser">
-					<div>名称:{{row.auser.staff_name}}</div>
+					<div>{{row.auser.staff_name}}</div>
+					<!-- <div>名称:{{row.auser.staff_name}}</div>
 					<div>管理员ID:{{row.auser.admin_id}}</div>
 					<div>ID:{{row.auser.id}}</div>
-					<div>手机:{{row.auser.phone}}</div>
+					<div>手机:{{row.auser.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="cuser">
-					<div>名称:{{row.cuser.staff_name}}</div>
+					<div>{{row.cuser.staff_name}}</div>
+					<!-- <div>名称:{{row.cuser.staff_name}}</div>
 					<div>管理员ID:{{row.cuser.admin_id}}</div>
 					<div>ID:{{row.cuser.id}}</div>
-					<div>手机:{{row.cuser.phone}}</div>
+					<div>手机:{{row.cuser.phone}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<div>{{row.ware.title}}</div>
+					<!-- <div>名称:{{row.ware.title}}</div>
 					<div>ID:{{row.ware.id}}</div>
 					<div>手机:{{row.ware.phone}}</div>
-					<div>地址:{{row.ware.detailed_address}}</div>
+					<div>地址:{{row.ware.detailed_address}}</div> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="info">
 					<!-- {{row.info}} -->
 					<div v-for="item in row.info" class="info">
+						<!-- 商品名称: -->
 						<div>
-							商品名称:{{item.product_name}}
+							{{item.product_name}}<a>{{item.want_product_num*1}}{{' '}}{{item.unit_name}}</a>
 						</div>
-						<div>
+					<!-- 	<div>
 							商品ID:{{item.product_id}}
 						</div>
 						<div>
 							数量:{{item.want_product_num*1}}{{' '}}{{item.unit_name}}
-						</div>
+						</div> -->
 					</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="mystore">
-					<viewer style="display: flex;">
+					<div>{{row.mystore.name}}</div>
+					<!-- <viewer style="display: flex;">
 						<div class="tabBox_img">
 							<img v-lazy="row.mystore.image" />
 						</div>
 						<div>门店:{{row.mystore.name}}<br>ID:{{row.mystore.id}}</div>
-					</viewer>
-
+					</viewer> -->
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
-					<viewer style="display: flex;">
+					<div>{{row.store.name}}</div>
+					<!-- <viewer style="display: flex;">
 						<div class="tabBox_img">
 							<img v-lazy="row.store.image" />
 						</div>
 						<div>门店:{{row.store.name}}<br>ID:{{row.store.id}}</div>
-					</viewer>
+					</viewer> -->
 				
 				</template>
 				<template slot-scope="{ row, index }" slot="is_system">
@@ -313,6 +306,11 @@
 						slot: 'info',
 						minWidth: 300,
 					},
+					{
+						title: "出货仓库",
+						slot: "ware",
+						minWidth: 200,
+					},
 					{
 						title: "出货门店",
 						slot: "store",
@@ -329,11 +327,7 @@
 						minWidth: 200,
 					},
 
-					{
-						title: "仓库信息",
-						slot: "ware",
-						minWidth: 200,
-					},
+					
 					{
 						title: "审核人信息",
 						slot: "auser",
@@ -603,7 +597,7 @@
 
 	.info {
 		padding-top: 10px;
-		border-bottom: 1px dashed #515a6e;
+		// border-bottom: 1px dashed #515a6e;
 
 		&:last-of-type {
 			border: none;

+ 28 - 11
src/pages/erp/want/wantDetail.vue

@@ -15,7 +15,7 @@
 					<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-hd">货仓库</div>
 								<div class="section-bd" >
 									<div class="item">
 										<div>仓库ID:</div>
@@ -35,8 +35,8 @@
 									</div>
 								</div>
 							</div>
-							<div class="section" v-if=" info.tware && info.tware.id">
-								<div class="section-hd">货仓库</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>
@@ -55,9 +55,9 @@
 										<div class="value">{{info.tware.detailed_address}}</div>
 									</div>
 								</div>
-							</div>
+							</div> -->
 							<div class="section" v-if=" info.store && info.store.id">
-								<div class="section-hd">要货仓库</div>
+								<div class="section-hd">出货门店</div>
 								<div class="section-bd" >
 									<div class="item">
 										<div>仓库ID:</div>
@@ -77,24 +77,24 @@
 									</div>
 								</div>
 							</div>
-							<div class="section" v-if=" info.tstore && info.tstore.id">
-								<div class="section-hd">出货仓库</div>
+							<div class="section" v-if=" info.mystore && info.mystore.id">
+								<div class="section-hd">要货门店</div>
 								<div class="section-bd" >
 									<div class="item">
 										<div>仓库ID:</div>
-										<div class="value">{{ info.tstore.id}}</div>
+										<div class="value">{{ info.mystore.id}}</div>
 									</div>
 									<div class="item">
 										<div>仓库名称:</div>
-										<div class="value">{{ info.tstore.name}}</div>
+										<div class="value">{{ info.mystore.name}}</div>
 									</div>
 									<div class="item">
 										<div>手机号码:</div>
-										<div class="value">{{ info.tstore.phone}}</div>
+										<div class="value">{{ info.mystore.phone}}</div>
 									</div>
 									<div class="item">
 										<div>详细地址:</div>
-										<div class="value">{{info.tstore.detailed_address}}</div>
+										<div class="value">{{info.mystore.detailed_address}}</div>
 									</div>
 								</div>
 							</div>
@@ -115,6 +115,23 @@
 									</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>创建人ID:</div>
+										<div class="value">{{ info.auser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.auser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.auser.phone}}</div>
+									</div>
+								</div>
+							</div>
 						</div>
 					</template>
 				</TabPane>

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

@@ -93,6 +93,15 @@ export default {
 			},
 			component: () => import('@/pages/erp/out/addOut')
 		},
+		{
+			path:'out_addt',
+			name: `${pre}out_addt`,
+			meta: {
+				auth: ['admin-erp-out_addt'],
+				title: '添加调出'
+			},
+			component: () => import('@/pages/erp/out/addOutT')
+		},
 		{
 			path:'out_store',
 			name: `${pre}out_store`,
@@ -138,6 +147,15 @@ export default {
 			},
 			component: () => import('@/pages/erp/adjust/index')
 		},
+		{
+			path:'adjust_add',
+			name: `${pre}adjust_add`,
+			meta: {
+				auth: ['admin-erp-adjust_add'],
+				title: '添加调价单'
+			},
+			component: () => import('@/pages/erp/adjust/addAdjust')
+		},
 		{
 			path:'add_godown/:id?',
 			name: `${pre}add_godown`,
@@ -272,6 +290,60 @@ export default {
 				title: '库位管理'
 			},
 			component: () => import('@/pages/store/capital/index')
-		}
+		},
+		{
+			path: 'role',
+			name: `${pre}role`,
+			meta: {
+				auth: ['admin-erp-role'],
+				title: '角色管理'
+			},
+			component: () => import('@/pages/erp/role/index')
+		},
+		{
+			path: 'admin',
+			name: `${pre}admin`,
+			meta: {
+				auth: ['admin-erp-admin'],
+				title: '角色列表'
+			},
+			component: () => import('@/pages/erp/admin/index')
+		},
+		{
+			path: 'losses',
+			name: `${pre}losses`,
+			meta: {
+				auth: ['admin-erp-losses'],
+				title: '角色列表'
+			},
+			component: () => import('@/pages/erp/losses/index')
+		},
+		{
+			path: 'losses_add',
+			name: `${pre}losses_add`,
+			meta: {
+				auth: ['admin-erp-losses_add'],
+				title: '角色列表'
+			},
+			component: () => import('@/pages/erp/losses/addLosses')
+		},
+		{
+			path: 'expired',
+			name: `${pre}expired`,
+			meta: {
+				auth: ['admin-erp-expired'],
+				title: '临期商品'
+			},
+			component: () => import('@/pages/erp/expired/index')
+		},
+		{
+			path: 'low',
+			name: `${pre}low`,
+			meta: {
+				auth: ['admin-erp-low'],
+				title: '低点位商品'
+			},
+			component: () => import('@/pages/erp/low/index')
+		},
 	]
 };