lhl 1 vuosi sitten
vanhempi
commit
1dea428c68
4 muutettua tiedostoa jossa 428 lisäystä ja 298 poistoa
  1. 25 0
      src/api/erp.js
  2. 399 296
      src/pages/erp/godown/godownDetail.vue
  3. 3 2
      src/pages/erp/godown/list.vue
  4. 1 0
      src/pages/erp/out/index.vue

+ 25 - 0
src/api/erp.js

@@ -92,6 +92,7 @@ export function getGodownList(data) {
   });
 }
 
+
 /**
  * @description 创建/编辑仓库
  * @param {Object} param data {Object} 传值参数 
@@ -407,6 +408,30 @@ export function createRuku(data,id) {
 	});
 }
 
+/**
+ * @description 盘点单列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getInventoryList(data) {
+	return request({
+	  url: "/erp/Warehouse/inventory_lst",
+	  method: "get",
+	  params:data
+	});
+}
+
+//
+/**
+ * @description 仓库仓位商品列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getGoodsList(data) {
+	return request({
+	  url: "/erp/Warehouse/position_info_list",
+	  method: "get",
+	  params:data
+	});
+}
 /*
 Route::get('user/list', 'v1.erp.User/index')->option(['real_name' => '用户列表']);
 Route::get('user/info/:id', 'v1.erp.User/info')->option(['real_name' => '用户详情']);

+ 399 - 296
src/pages/erp/godown/godownDetail.vue

@@ -2,39 +2,88 @@
 	<!-- <div style="width: 100%"> -->
 	<Drawer :closable="false" width="1000" class-name="order_box" v-model="modals" :styles="{ padding: 0 }">
 		<div class="acea-row user-row">
-			
+
 		</div>
-		
+
 		<Tabs v-model="activeName">
-			<TabPane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.val">
-				<template v-if="item.val === 'position'">
-					<div>顶顶顶顶顶</div>
-					<!-- <user-form v-if="isEdit" ref="userForm" :ps-info="psInfo" @change-menu="changeMenu"></user-form>
+			<TabPane v-for="(item, index) in list" :key="index" :label="item.label + '('+wareInfo.count[item.tit]+')'"
+				:name="item.val">
+				<div style="height: 20px;"></div>
+				<Table :columns="columns" :data="userLists" ref="table" :loading="loading" no-userFrom-text="暂无数据"
+					no-filtered-userFrom-text="暂无筛选结果">
+					<template slot-scope="{ row, index }" slot="passageway">
+						<span> {{ row.bin_number.slice(0,2) }}</span>
+					</template>
+					<template slot-scope="{ row, index }" slot="control">
+						<span> {{ row.bin_number.slice(2,3) }}</span>
+					</template>
+					<template slot-scope="{ row, index }" slot="layer">
+						<span> {{ row.bin_number.slice(3,4) }}</span>
+					</template>
+					<template slot-scope="{ row, index }" slot="number">
+						<span> {{ row.bin_number.slice(4) }}</span>
+					</template>
+					<template slot-scope="{ row, index }" slot="supplier">
+						<!-- <span v-if="row.auth_time"> {{ row.auth_time | formatDate }}</span> -->
+						<div>名称:{{row.supplier.supplier_name}}</div>
+						<div>ID:{{row.supplier.id}}</div>
+						<div>手机:{{row.supplier.phone}}</div>
+					</template>
+					<template slot-scope="{ row, index }" slot="info">
+						<div v-for="item in row.info" class="info">
+							<div>
+								商品名称:{{item.product_name}}
+							</div>
+							<div>
+								商品ID:{{item.product_id}}
+							</div>
+							<div>
+								数量:{{item.product_num*1 || item.want_product_num*1}}{{' '}}{{item.unit_name}}
+							</div>
+						</div>
+					</template>
+					<template slot-scope="{ row, index }" slot="mystore">
+						<viewer style="display: flex;">
+							<div class="tabBox_img">
+								<img v-lazy="row.mystore.image" />
+							</div>
+							<div>门店:{{row.mystore.name}}<br>ID:{{row.mystore.id}}</div>
+						</viewer>
+
+					</template>
+					<template slot-scope="{ row, index }" slot="store">
+						<viewer style="display: flex;">
+							<div class="tabBox_img">
+								<img v-lazy="row.store.image" />
+							</div>
+							<div>门店:{{row.store.name}}<br>ID:{{row.store.id}}</div>
+						</viewer>
+
+					</template>
+					<template slot-scope="{ row, index }" slot="status">
+						<Tag color="default" v-if="row.status == 0">待审核</Tag>
+						<Tag color="primary" v-if="row.status == 1">通过</Tag>
+						<Tag color="success" v-if="row.status == 3">完成</Tag>
+						<Tag color="error" v-if="row.status == -1">拒绝</Tag>
+						<Tag color="warning" v-if="row.status == 2">部分完成</Tag>
+						<Tag color="magenta" v-if="row.status == -2">无效</Tag>
+					</template>
+					<template slot-scope="{ row, index }" slot="image">
+						<viewer>
+							<div class="tabBox_img">
+								<img v-lazy="row.avatar" />
+							</div>
+						</viewer>
+					</template>
+				</Table>
+				<div class="acea-row row-right page">
+					<Page :total="total" :current.sync="userFrom.page" show-elevator show-total @on-change="pageChange"
+						:page-size="userFrom.limit" />
+				</div>
+				<!-- <user-form v-if="isEdit" ref="userForm" :ps-info="psInfo" @change-menu="changeMenu"></user-form>
 					<user-info v-else :ps-info="psInfo" :workMemberInfo="workMemberInfo"
 						:workClientInfo="workClientInfo"></user-info> -->
-				</template>
-				<template v-else>
-					<Table :columns="columns" :data="userLists" ref="table" :loading="loading" no-userFrom-text="暂无数据"
-						no-filtered-userFrom-text="暂无筛选结果">
-						<template slot-scope="{ row }" slot="coupon_price">
-							<span v-if="row.coupon_type==1">{{row.coupon_price}}元</span>
-							<span
-								v-if="row.coupon_type==2">{{parseFloat(row.coupon_price)/10}}折({{row.coupon_price.toString().split(".")[0]}}%)</span>
-						</template>
-						<template slot-scope="{ row }" slot="product">
-							<div class="product">
-								<div class="image" v-viewer>
-									<img v-lazy="row.image">
-								</div>
-								<div class="title">{{ row.store_name }}</div>
-							</div>
-						</template>
-					</Table>
-					<div class="acea-row row-right page">
-						<Page :total="total" :current.sync="userFrom.page" show-elevator show-total
-							@on-change="pageChange" :page-size="userFrom.limit" />
-					</div>
-				</template>
+
 			</TabPane>
 		</Tabs>
 	</Drawer>
@@ -80,6 +129,16 @@
 		visitList,
 		spreadList
 	} from '@/api/user';
+	import {
+		getGodownInfo,
+		getPositionList,
+		getInList,
+		getUserList,
+		getWantList,
+		getPurchaselist,
+		getInventoryList,
+		getGoodsList
+	} from '@/api/erp'
 	// import userForm from './userForm';
 	// import userInfo from './userInfo';
 
@@ -92,43 +151,49 @@
 		props: ['levelList', 'labelList', 'groupList', 'fromType'],
 		data() {
 			return {
+				id: 0,
+				wareInfo: {}, //仓库详情
 				theme2: 'light',
 				list: [{
 						val: 'position',
+						tit: 'position_count',
 						label: '仓位列表'
 					},
 					{
-						val: 'order',
-						label: '消费记录'
+						val: 'outbound',
+						tit: 'outbound_count',
+						label: '出库列表'
 					},
 					{
-						val: 'integral',
-						label: '积分明细'
+						val: 'warehousing',
+						tit: 'warehousing_count',
+						label: '入库列表'
 					},
 					{
-						val: 'sign',
-						label: '签到记录'
+						val: 'position_info',
+						tit: 'position_info_count',
+						label: '商品列表'
 					},
 					{
-						val: 'coupon',
-						label: '持有优惠券'
+						val: 'purchase',
+						tit: 'purchase_count',
+						label: '采购列表'
 					},
 					{
-						val: 'balance_change',
-						label: '余额变动'
+						val: 'user',
+						tit: 'user_count',
+						label: '用户列表'
 					},
 					{
-						val: 'spread',
-						label: '好友关系'
+						val: 'want',
+						tit: 'want_count',
+						label: '要货列表'
 					},
 					{
-						val: 'visit',
-						label: '浏览足迹'
+						val: 'inventory',
+						tit: 'inventory_count',
+						label: '盘点单列表'
 					},
-					{
-						val: 'spread_change',
-						label: '推荐人变更记录'
-					}
 				],
 				modals: false,
 				spinShow: false,
@@ -167,6 +232,13 @@
 		},
 		created() {},
 		methods: {
+			getGodownInfo(id) {
+				getGodownInfo(id).then(res => {
+					console.log(res);
+					this.wareInfo = res.data
+					this.changeType('position');
+				})
+			},
 			changeMenu(value) {
 				if (value === '99') {
 					this.getDetails(this.userId);
@@ -340,262 +412,273 @@
 			},
 			// tab选项
 			changeType(name) {
+				console.log('zhizxin');
 				this.loading = true;
 				this.userFrom.type = name;
 				this.activeName = name;
-				let data = {
-					id: this.userId,
-					datas: this.userFrom
-				}
-				infoApi(data).then(async res => {
-					if (res.status === 200) {
-						let data = res.data
-						this.userLists = data.list;
-						this.total = data.count;
-						switch (this.userFrom.type) {
-							case 'order':
-								this.columns = [{
-										title: '订单ID',
-										key: 'order_id',
-										minWidth: 160
-									},
-									{
-										title: '收货人',
-										key: 'real_name',
-										minWidth: 100
-									},
-									{
-										title: '商品数量',
-										key: 'total_num',
-										minWidth: 90
-									},
-									{
-										title: '商品总价',
-										key: 'total_price',
-										minWidth: 110
-									},
-									{
-										title: '实付金额',
-										key: 'pay_price',
-										minWidth: 120
-									},
-									{
-										title: '交易完成时间',
-										key: 'pay_time',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'integral':
-								this.columns = [{
-										title: '来源/用途',
-										key: 'title',
-										minWidth: 120
-									},
-									{
-										title: '积分变化',
-										key: 'number',
-										minWidth: 120
-									},
-									{
-										title: '变化后积分',
-										key: 'balance',
-										minWidth: 120
-									},
-									{
-										title: '日期',
-										key: 'add_time',
-										minWidth: 120
-									},
-									{
-										title: '备注',
-										key: 'mark',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'sign':
-								this.columns = [
-									// {
-									//     title: '动作',
-									//     key: 'title',
-									//     minWidth: 120
-									// },
-									{
-										title: '获得积分',
-										key: 'number',
-										minWidth: 120
-									},
-									{
-										title: '签到时间',
-										key: 'add_time',
-										minWidth: 120
-									},
-									{
-										title: '备注',
-										key: 'mark',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'coupon':
-								this.columns = [{
-										title: '优惠券名称',
-										key: 'coupon_title',
-										minWidth: 120
-									},
-									{
-										title: '面值',
-										slot: 'coupon_price',
-										minWidth: 120
-									},
-									{
-										title: '有效期(天)',
-										key: 'coupon_time',
-										minWidth: 120
-									},
-									{
-										title: '兑换时间',
-										key: '_add_time',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'balance_change':
-								this.columns = [{
-										title: '动作',
-										key: 'title',
-										minWidth: 120
-									},
-									{
-										title: '变动金额',
-										key: 'number',
-										minWidth: 120
-									},
-									{
-										title: '变动后',
-										key: 'balance',
-										minWidth: 120
-									},
-									{
-										title: '创建时间',
-										key: 'add_time',
-										minWidth: 120
-									},
-									{
-										title: '备注',
-										key: 'mark',
-										minWidth: 120
-									}
-								]
-								break;
-							case 'visit':
-								this.columns = [{
-										title: '商品信息',
-										slot: 'product',
-										minWidth: 400,
-									},
-									{
-										title: '价格',
-										key: 'product_price',
-										minWidth: 120,
-										render: (h, params) => {
-											return h('div', `¥${params.row.product_price}`)
-										},
-									},
-									{
-										title: '浏览时间',
-										key: 'add_time',
-										minWidth: 120,
-									},
-								]
-								break
-							case 'spread_change':
-								this.columns = [{
-										title: '推荐人ID',
-										key: 'spread_uid',
-										minWidth: 120,
-									},
-									{
-										title: '推荐人',
-										key: 'nickname',
-										minWidth: 120,
-										render: (h, params) => {
-											return h('div', [
-												h('img', {
-													style: {
-														borderRadius: '50%',
-														marginRight: '10px',
-														verticalAlign: 'middle',
-													},
-													attrs: {
-														with: 38,
-														height: 38,
-													},
-													directives: [{
-															name: 'lazy',
-															value: params.row.avatar,
-														},
-														{
-															name: 'viewer',
-														},
-													],
-												}),
-												h(
-													'span', {
-														style: {
-															verticalAlign: 'middle',
-														},
-													},
-													params.row.nickname
-												),
-											])
-										},
-									},
-									{
-										title: '变更方式',
-										key: 'type',
-										minWidth: 120,
-									},
-									{
-										title: '变更时间',
-										key: 'spread_time',
-										minWidth: 120,
-									},
-								]
-								break;
-							default:
-								this.columns = [{
-										title: 'ID',
-										key: 'uid',
-										minWidth: 120
-									},
-									{
-										title: '昵称',
-										key: 'nickname',
-										minWidth: 120
-									},
-									{
-										title: '等级',
-										key: 'type',
-										minWidth: 120
-									},
-									{
-										title: '加入时间',
-										key: 'add_time',
-										minWidth: 120
-									}
-								]
-						}
-						this.loading = false;
-					} else {
-						this.loading = false;
-						this.$Message.error(res.msg);
+				let getList;
+				try {
+					if (name == 'position') {
+						getList = getPositionList
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+							{
+								title: "仓位名称",
+								key: "title",
+								minWidth: 90,
+							},
+							{
+								title: "通道",
+								slot: "passageway",
+								minWidth: 90,
+							},
+							{
+								title: "左右",
+								slot: "control",
+								minWidth: 90,
+							},
+							{
+								title: "层数",
+								slot: "layer",
+								minWidth: 90,
+							},
+							{
+								title: "仓位编号",
+								slot: "number",
+								minWidth: 90,
+							},
+							{
+								title: "编号",
+								key: "bin_number",
+								minWidth: 90,
+							},
+						]
+					} else if (name == 'outbound') {
+
+					} else if (name == 'warehousing') {
+						getList = getInList
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+							{
+								title: "入库单号",
+								key: "in_order_id",
+								minWidth: 200,
+							},
+							{
+								title: "商品",
+								slot: "info",
+								width: 200,
+							},
+							{
+								title: "总数量",
+								key: "total_num",
+								minWidth: 90,
+							},
+							{
+								title: "总价格",
+								key: "total_price",
+								minWidth: 90,
+							},
+						]
+					} else if (name == 'position_info') {
+						getList = getGoodsList
+						this.columns = [{
+								title: "ID",
+								key: "product_id",
+								width: 80,
+							},
+							{
+								title: '商品名称',
+								key: 'product_name',
+								width: 200,
+							},
+							{
+								title: '数量',
+								key: 'product_num',
+								width: 200,
+							},
+							{
+								title: '单位',
+								key: 'unit_name',
+								width: 200,
+							},
+							{
+								title: '单价',
+								key: 'price',
+								width: 200,
+							}
+						
+						]
+					} else if (name == 'purchase') {
+						getList = getPurchaselist
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+
+							{
+								title: "采购单号",
+								key: "purchase_order_id",
+								minWidth: 200,
+							},
+							{
+								title: "要货单号",
+								key: "want_order_id",
+								minWidth: 200,
+							},
+							{
+								title: "供应商",
+								slot: "supplier",
+								minWidth: 200,
+							},
+							{
+								title: "门店",
+								slot: "store",
+								minWidth: 200,
+							},
+							{
+								title: "订单数量",
+								key: "order_num",
+								minWidth: 90,
+							},
+							{
+								title: "订单金额",
+								key: "order_price",
+								minWidth: 90,
+							},
+							{
+								title: "运费",
+								key: "freight",
+								minWidth: 90,
+							},
+							{
+								title: "审核状态",
+								slot: "status",
+								minWidth: 200,
+							}
+
+						]
+					} else if (name == 'user') {
+						getList = getUserList
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+							{
+								title: "账号",
+								key: "account",
+								minWidth: 90,
+							},
+							{
+								title: "用户头像",
+								slot: "image",
+								minWidth: 90,
+							},
+							{
+								title: "ERP用户名称",
+								key: "staff_name",
+								minWidth: 90,
+							},
+							{
+								title: "手机号",
+								key: "phone",
+								minWidth: 90,
+							},
+						]
+					} else if (name == 'want') {
+						getList = getWantList
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+							{
+								title: "要货单号",
+								key: "want_order_id",
+								minWidth: 150,
+							},
+							{
+								title: '商品信息',
+								slot: 'info',
+								minWidth: 300,
+							},
+							{
+								title: "出货门店",
+								slot: "store",
+								minWidth: 200,
+							},
+							{
+								title: "要货门店",
+								slot: "mystore",
+								minWidth: 200,
+							},
+							{
+								title: "状态",
+								slot: "status",
+								minWidth: 100,
+							},
+
+						]
+					} else if (name == 'inventory') {
+						getList = getInventoryList
+						this.columns = [{
+								title: "ID",
+								key: "id",
+								width: 80,
+							},
+							// {
+							// 	title: "要货单号",
+							// 	key: "want_order_id",
+							// 	minWidth: 150,
+							// },
+							// {
+							// 	title: '商品信息',
+							// 	slot: 'info',
+							// 	minWidth: 300,
+							// },
+							// {
+							// 	title: "出货门店",
+							// 	slot: "store",
+							// 	minWidth: 200,
+							// },
+							// {
+							// 	title: "要货门店",
+							// 	slot: "mystore",
+							// 	minWidth: 200,
+							// },
+							{
+								title: "状态",
+								slot: "status",
+								minWidth: 100,
+							},
+						
+						]
 					}
+				} catch (e) {
+					console.log('err', e);
+					//TODO handle the exception
+				}
+				getList({
+					wid: this.id,
+					page: this.userFrom.page,
+					limit: this.userFrom.limit
+				}).then(res => {
+					this.loading = false;
+					this.total = res.data.count
+					this.userLists = res.data.data
+
 				}).catch(res => {
 					this.loading = false;
-					this.$Message.error(res.msg);
 				})
+
 			}
 		}
 	}
@@ -870,4 +953,24 @@
 	.user_menu>>>.ivu-menu {
 		width 100% !important;
 	}
+
+	.info {
+		padding-top: 10px;
+		border-bottom: 1px dashed #515a6e;
+
+		&:last-of-type {
+			border: none;
+		}
+	}
+
+	/deep/ .tabBox_img {
+		width 36px;
+		height 36px;
+		border-radius: 4px cursor pointer;
+
+		img {
+			width 100%;
+			height 100%;
+		}
+	}
 </style>

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

@@ -194,10 +194,11 @@
 			this.getList();
 		},
 		methods: {
-			lookMore() {
+			lookMore(row) {
 				this.$refs.godownDetail.modals = true;
+				this.$refs.godownDetail.id = row.id
 				this.$refs.godownDetail.activeName = "position";
-				this.$refs.godownDetail.getDetails(row.uid);
+				this.$refs.godownDetail.getGodownInfo(row.id);
 			},
 			// 商品分类;
 			goodsCategory() {

+ 1 - 0
src/pages/erp/out/index.vue

@@ -230,6 +230,7 @@
 				}
 				if(this.currentTab == 0){
 					getList = getReceiveList
+					this.tableFrom.type = ''
 				}
 				console.log(this.tableFrom,'this.tableFrom')
 				getList(this.tableFrom)