xiaol 5 months ago
parent
commit
7aa764907b
3 changed files with 82 additions and 99 deletions
  1. 13 0
      src/api/erpAdmin.js
  2. 31 15
      src/pages/erp/in/addInList.vue
  3. 38 84
      src/pages/erp/in/index.vue

+ 13 - 0
src/api/erpAdmin.js

@@ -0,0 +1,13 @@
+import request from "@/plugins/request";
+
+/**
+ * @description erp设置
+ * @param {Object} param data {Object} 传值参数
+ */
+//采购单查询入库状态
+export function in_status(id) {
+  return request({
+    url: "erp/purchase/in_status/" + id,
+    method: "get",
+  });
+}

+ 31 - 15
src/pages/erp/in/addInList.vue

@@ -84,6 +84,7 @@
 	import { mapState,mapMutations } from "vuex";
 	import Setting from "@/setting";
 	import { getPurchaseId,batch_save,getPositionList,createRuku } from "@/api/erp";
+	import { in_status } from "@/api/erpAdmin";
 	import { formatDate } from "@/utils/validate";
 	export default {
 		name: "addInList",
@@ -233,23 +234,34 @@
 			},
 			//根据采购单号获取商品
 			getGoods() {
-				console.log('zhix');
-				getPurchaseId(this.formValidate.orderNumber).then(res => {
-					if(res.status == 200){
-						this.info = res.data
-						this.info.info.forEach(item => {
-							item.batch_code = ''
-							item.tare_weight = ''
-							item.net_weight = ''
-							item.timeValue = ''
-							item.bin_number_value = ''
-						})
-						this.goodsList = this.info.info
-						this.getBin()
-						console.log(this.goodsList,'this.goodsList')
+				in_status(this.formValidate.orderNumber).then(res => {
+					console.log(res,'根据采购单号获取商品')
+					if(res.data.status == true){
+					   getPurchaseId(this.formValidate.orderNumber).then(res => {
+					   	if(res.status == 200){
+					   		this.info = res.data
+					   		this.info.info.forEach(item => {
+					   			item.batch_code = ''
+					   			item.tare_weight = ''
+					   			item.net_weight = ''
+					   			item.timeValue = ''
+					   			item.bin_number_value = ''
+					   		})
+					   		this.goodsList = this.info.info
+					   		this.getBin()
+					   		console.log(this.goodsList,'this.goodsList')
+					   	}else{
+					   		this.$Message.error('订单号异常');
+					   	}
+					   }).catch(err => {
+					   	this.$Message.error(err.msg);
+					   })
 					}else{
-						this.$Message.error(res.msg);
+						this.goodsList = []
+						this.$Message.error('采购单号状态异常');
 					}
+				}).catch(err => {
+					this.$Message.error(err.msg);
 				})
 			},
 			//选择批次的时间
@@ -268,6 +280,8 @@
 					}else{
 						this.$Message.error(res.msg);
 					}
+				}).catch(err => {
+					this.$Message.error(err.msg);
 				})
 			},
 			//获取仓位列表
@@ -283,6 +297,8 @@
 					}else{
 						this.$Message.error(res.msg);
 					}
+				}).catch(err => {
+					this.$Message.error(err.msg);
 				})
 			},
 		},

+ 38 - 84
src/pages/erp/in/index.vue

@@ -14,9 +14,9 @@
 							<Option value="-3">全部</Option>
 							<Option value="0">待审核</Option>
 							<Option value="1">通过</Option>
-							<Option value="2">部分完成</Option>
-							<Option value="3">完成</Option>
 							<Option value="-1">拒绝</Option>
+							<Option value="2">部分上架</Option>
+							<Option value="3">已上架</Option>
 						</Select>
 					</FormItem>
 				</Form>
@@ -25,24 +25,15 @@
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
 			<Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">创建入库单</Button>
-			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
 				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
-				<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 slot-scope="{ row, index }" slot="info">
+					<div>{{row.info[0].product_name}}</div>
+					<div v-if="row.info.length >1">{{row.info[1].product_name}}</div>
+					<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>管理员ID:{{row.cuser.admin_id}}</div> -->
 					<div>ID:{{row.cuser.id}}</div>
 					<div>手机:{{row.cuser.phone}}</div>
 				</template>
@@ -54,41 +45,31 @@
 					<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="tware">
-					<div>名称:{{row.tware.title}}</div>
-					<div>ID:{{row.tware.id}}</div>
-					<div>手机:{{row.tware.phone}}</div>
-					<!-- <div>地址:{{row.tware.detailed_address}}</div> -->
+					<div>地址:{{row.ware.detailed_address}}</div>
 				</template>
 				<template slot-scope="{ row, index }" slot="store">
 					<div>名称:{{row.store.name}}</div>
 					<div>ID:{{row.store.id}}</div>
 					<div>手机:{{row.store.phone}}</div>
-					<!-- <div>地址:{{row.store.detailed_address}}</div> -->
-				</template>
-				<template slot-scope="{ row, index }" slot="tstore">
-					<div>名称:{{row.tstore.name}}</div>
-					<div>ID:{{row.tstore.id}}</div>
-					<div>手机:{{row.tstore.phone}}</div>
-					<!-- <div>地址:{{row.tstore.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>
 					<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="success" v-if="row.status == 2">部分上架</Tag>
+					<Tag color="warning" v-if="row.status == 3">已上架</Tag>
 				</template>
 				<template slot-scope="{ row, index }" slot="create_time">
 					<div>{{row.create_time | formatDate}}</div>
 				</template>
-				<!-- <template slot-scope="{ row, index }" slot="action">
-					<a @click="edit(row)">编辑</a>
-					<Divider type="vertical" />
-					<a @click="del(row, '删除仓位', index)">删除</a>
-				</template> -->
+				<template slot-scope="{ row, index }" slot="action">
+					<a v-if="row.status == 0" @click="auditing(row, index)">审核</a>
+					<Divider v-if="row.status == 0" type="vertical" />
+					<a @click="info(row, index)">详情</a>
+					<Divider v-if="row.status == 3" type="vertical" />
+					<a v-if="row.status == 3" @click="del(row, index)">删除</a>
+				</template>
 			</Table>
 			<div class="acea-row row-right page">
 				<Page :total="tableFrom.total" :current="tableFrom.page" show-elevator show-total @on-change="pageChange"
@@ -128,37 +109,47 @@
 					{
 						title: "入库单号",
 						key: "in_order_id",
-						minWidth: 200,
+						minWidth: 160,
+					},
+					{
+						title: "入库商品",
+						slot: "info",
+						minWidth: 180,
 					},
 					{
 						title: "创建人",
 						slot: "cuser",
-						minWidth: 200,
+						minWidth: 150,
+					},
+					{
+						title: "审核人",
+						slot: "auser",
+						minWidth: 150,
 					},
 					{
 						title: "仓库",
 						slot: "ware",
-						minWidth: 100,
+						minWidth: 150,
 					},
 					{
 						title: "总数量",
 						key: "total_num",
-						minWidth: 90,
+						minWidth: 100,
 					},
 					{
 						title: "总价格",
 						key: "total_price",
-						minWidth: 90,
+						minWidth: 100,
 					},
 					{
 						title: "审核状态",
 						slot: "status",
-						minWidth: 200,
+						minWidth: 120,
 					},
 					{
 						title: "创建时间",
 						slot: "create_time",
-						minWidth: 90,
+						minWidth: 100,
 					},
 					{
 						title: "操作",
@@ -210,52 +201,15 @@
 				this.tableFrom.page = 1;
 				this.getList();
 			},
-			// 添加
+			// 添加入库单
 			add() {
 				this.$router.push({
 					path: this.roterPre + "/erp/add_inList?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",
-				});
+			// 详情
+			info(row) {
+				
 			},
 			// 删除
 			del(row, tit, num) {