lhl 1 year ago
parent
commit
009eaf1c10

+ 60 - 1
src/api/erp.js

@@ -641,7 +641,7 @@ export function listing(data) {
 }
 
 /**
- * @description 入库上架
+ * @description 入库详情
  * @param {Object} param data {Object} 传值参数
  */
 export function getInInfo(id) {
@@ -711,6 +711,65 @@ export function getBatchList(data) {
 	});
 }
 
+/**
+ * @description 报损单列表
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getLossList(data) {
+	return request({
+	  url: "/erp/loss/lst",
+	  method: "get",
+	  params:data
+	});
+}
+
+/**
+ * @description 创建报损单
+ * @param {Object} param data {Object} 传值参数
+ */
+export function createLoss(data) {
+	return request({
+	  url: "/erp/loss/save",
+	  method: "post",
+	  data
+	});
+}
+
+//
+
+/**
+ * @description 报损理由
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getYlist() {
+	return request({
+	  url: "/setting/group_data?status=1&gid=70",
+	  method: "get"
+	});
+}
+
+/**
+ * @description 报损详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getLossDetail(id) {
+	return request({
+	  url: "/erp/loss/info/" + id,
+	  method: "get"
+	});
+}
+
+/**
+ * @description 报损详情
+ * @param {Object} param data {Object} 传值参数
+ */
+export function getlqList(data) {
+	return request({
+	  url: "/erp/warehouse/position_info_lst",
+	  method: "get",
+	  params:data
+	});
+}
 /*
 Route::get('user/list', 'v1.erp.User/index')->option(['real_name' => '用户列表']);
 Route::get('user/info/:id', 'v1.erp.User/info')->option(['real_name' => '用户详情']);

+ 475 - 0
src/components/printing/index.vue

@@ -0,0 +1,475 @@
+<template>
+  <!-- 支付订单 -->
+  <div class="order-bgc">
+    <div class="putSupplier" v-for="(item,index) in newArrayData" :key="index">
+      <div class="header acea-row row-between-wrapper">
+        <div class="left acea-row row-middle">
+          <div class="pictrue" :id="'qrCodeUrl'+index"></div>
+          <div class="info">
+            <div v-if="type == 'want'"><span class="name" >要货单号:</span>{{item.want_order_id}}</div>
+			<div v-if="type == 'purchase'"><span class="name" >采购单号:</span>{{item.purchase_order_id}}</div>
+			<div v-if="type == 'out'"><span class="name" >出库单号:</span>{{item.out_order_id}}</div>
+			<div v-if="type == 'in'"><span class="name" >入库单号:</span>{{item.in_order_id}}</div>
+			<div><span class="name">创建人:</span>{{item.cuser && item.cuser.id ? item.cuser.staff_name : ''}}</div>
+           <div><span class="name">审核人:</span>{{item.auser && item.auser.id ? item.auser.staff_name : ''}}</div>
+          </div>
+        </div>
+        <div class="info">
+          <div v-if="type=='want'"><span class="name">要货门店:</span>{{item.my_store_id ? item.mystore.name:''}}</div>
+          <div v-if="type=='want'"><span class="name">出货{{item.wid?'仓库':'门店'}}:</span>{{item.wid?item.ware.title:(item.store_id?item.store.name: '')}}</div>
+		  <div v-if="type=='purchase'"><span class="name">供应商:</span>{{item.supplier ? item.supplier.supplier_name:''}}</div>
+		  <div v-if="type=='purchase'"><span class="name">采购人:</span>{{item.puser ? item.puser.staff_name:''}}</div>
+		  <div v-if="type=='out'"><span class="name">调出{{item.wid?'仓库': '门店'}}:</span>{{item.wid ? item.ware.title:item.store.name}}</div>
+		  <div v-if="type=='in'"><span class="name">仓库:</span>{{item.ware.title}}</div>
+          <div><span class="name">状态:</span>{{item.status == 0?'待审核':(item.status == 1? '通过': (item.status == 2?'部分完成':(item.status == 3? '完成': (item.status == -1 ?'拒绝':(item.status == -2?'无效':'')))))}}</div>
+        </div>
+      </div>
+      <div class="mt20">
+        <Table border :columns="columns" :data="item.goodsList" :disabled-hover="true">
+          <template slot-scope="{ row }" slot="batch_code">
+            <div class="line1">{{row.product_name? (row.batch_code?row.batch_code:'/'): ''}}</div>
+          </template>
+		  <template slot-scope="{ row }" slot="product_name">
+		    <div class="line1">{{row.product_name || row.store_name}}</div>
+		  </template>
+          <template slot-scope="{ row }" slot="suk">
+            <div class="line1">{{row.suk}}</div>
+          </template>
+        </Table>
+      </div>
+      <!-- <div class="bottom acea-row row-between-wrapper">
+        <div class="acea-row row-middle">
+          <div class="item"><span class="name">运费:</span>{{item.freight_price}}</div>
+          <div class="item"><span class="name">优惠:</span>{{item.coupon_price}}</div>
+          <div class="item"><span class="name">会员折扣:</span>{{item.vip_true_price}}</div>
+          <div class="item"><span class="name">积分抵扣:</span>{{item.deduction_price}}</div>
+        </div>
+        <div class="pricePay">实付金额:{{item.pay_price}}</div>
+      </div> -->
+      <!-- <div class="bottom acea-row">
+        <div class="name">用户备注:<span class="con">{{item.mark || '-'}}</span></div>
+      </div> -->
+      <div class="h50">
+        <div class="delivery" v-if="site_name || refund_address || refund_phone">
+          <div v-if="site_name">店铺信息:{{ site_name }}</div>
+          <div v-if="refund_address">地址:{{ refund_address }}</div>
+          <div v-if="refund_phone">联系方式:{{ refund_phone }}</div>
+        </div>
+		<div class="delivery" >
+		  <div v-if="type == 'purchase'">采购{{item.wid?'仓库': '门店'}}:{{ item.wid? item.ware.title: item.store.name }}</div>
+		  <div v-if="type == 'want'">要货{{item.wid?'仓库': '门店'}}:{{ item.wid? item.ware.title: item.store.name }}</div>
+		  <div v-if="type == 'out'">调出{{item.wid?'仓库': '门店'}}:{{ item.wid? item.ware.title: item.store.name }}</div>
+		  <div v-if="type == 'in'">仓库:{{item.ware.title }}</div>
+		  <div>地址:{{ item.wid? item.ware.detailed_address: item.store.detailed_address }}</div>
+		  <div >联系方式:{{ item.wid? item.ware.phone: item.store.phone }}</div>
+		</div>
+      </div>
+    </div>
+<!--  注意:后续要是加内容使页面撑大,记得查看下打印是否在同一张  -->
+  </div>
+</template>
+<script>
+import { distributionInfo } from '@/api/supplier'
+import { distributionOrder } from '@/api/order'
+import { getWantInfo,getPurchaseInfo,getOutInfo,getInInfo  } from '@/api/erp';
+import QRCode from 'qrcodejs2';
+import Setting from '@/setting';
+export default {
+  data (){
+    return {
+		id:[],
+		type: '',
+      columns:[
+      ],
+      data:{},
+      goods:[],
+      BaseURL: Setting.apiBaseURL.replace(/adminapi/, ""),
+      newArrayData:[],
+      site_name: '',
+      refund_phone: '',
+      refund_address: ''
+    }
+  },
+  created() {
+	  this.type = this.$route.query.type
+	  this.id = this.$route.query.id.split(',')
+	  this.id.forEach(item => {
+		  this.getDistribution(item);
+	  })
+  },
+  mounted() {
+    this.$nextTick(function () {
+      let that = this;
+      setTimeout(function () {
+        that.creatQrCode();
+      },200)
+    })
+  },
+  methods:{
+    // 生成二维码
+    creatQrCode() {
+      let url= this.BaseURL;
+      let qrcode = '';
+      this.newArrayData.forEach((item,index)=>{
+        let obj = document.getElementById('qrCodeUrl'+index);
+        qrcode = new QRCode(obj, {
+          text: url, // 需要转换为二维码的内容
+          width: 90,
+          height: 90,
+          colorDark: '#000000',
+          colorLight: '#ffffff',
+          correctLevel: QRCode.CorrectLevel.H
+        })
+      });
+
+    },
+    getDistribution(id){
+		let getInfo;
+		try{
+			switch (this.$route.query.type){
+				case 'want':
+					getInfo = getWantInfo;
+					this.columns = [
+						{
+						  title: '商品编号',
+						  key: 'product_id',
+						  align: 'center',
+						  width: 60
+						},
+						{
+						  title: '商品名称',
+						  slot: 'product_name',
+						  align: 'center',
+						  minWidth: 200
+						},
+						{
+						  title: '要货数量',
+						  key: 'want_product_num',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '商品单位',
+						  key: 'unit_name',
+						  align: 'center',
+						  width: 80
+						}
+					]
+					break;
+				case 'purchase':
+					getInfo = getPurchaseInfo;
+					this.columns = [
+						{
+						  title: '商品编号',
+						  key: 'product_id',
+						  align: 'center',
+						  width: 60
+						},
+						{
+						  title: '商品名称',
+						  slot: 'product_name',
+						  align: 'center',
+						  width: 200
+						},
+						{
+						  title: '采购数量',
+						  key: 'product_num',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '商品单位',
+						  key: 'unit_name',
+						  align: 'center',
+						  width: 80
+						},
+						{
+						  title: '净重(kg)',
+						  key: 'net_weight',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '毛重(kg)',
+						  key: 'tare_weight',
+						  align: 'center',
+						  width: 120
+						}
+					]
+					break;
+				case 'out':
+					getInfo = getOutInfo;
+					this.columns = [
+						{
+						  title: '商品编号',
+						  key: 'product_id',
+						  align: 'center',
+						  width: 60
+						},
+						{
+						  title: '商品名称',
+						  slot: 'product_name',
+						  align: 'center',
+						  minWidth: 200
+						},
+						{
+						  title: '批次编号',
+						  slot: 'batch_code',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '数量',
+						  key: 'pur_number',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '商品单位',
+						  key: 'unit_name',
+						  align: 'center',
+						  width: 80
+						},
+						{
+						  title: '总重(kg)',
+						  key: 'weight',
+						  align: 'center',
+						  width: 120
+						},
+					]
+					break;
+				case 'in':
+					getInfo = getInInfo;
+					this.columns = [
+						{
+						  title: '商品编号',
+						  key: 'product_id',
+						  align: 'center',
+						  width: 60
+						},
+						{
+						  title: '商品名称',
+						  slot: 'product_name',
+						  align: 'center',
+						  minWidth: 200
+						},
+						{
+						  title: '批次编号',
+						  slot: 'batch_code',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '数量',
+						  key: 'product_num',
+						  align: 'center',
+						  width: 120
+						},
+						{
+						  title: '商品单位',
+						  key: 'unit_name',
+						  align: 'center',
+						  width: 80
+						},
+						{
+						  title: '净重(kg)',
+						  key: 'net_weight',
+						  align: 'center',
+						  width: 120
+						},
+					]
+					break;
+				default:
+					break;
+			}
+			getInfo(id).then(res => {
+				
+				let item = res.data
+				if(this.type == 'out') {
+					// item.info = item.product
+					let arr = []
+					item.product.forEach(e => {
+						e.group.forEach(i => {
+							let obj = {
+								batch_code:i.batch_code,
+								bin_number: i.bin_number,
+								product_id: e.id,
+								product_name: e.store_name,
+								product_num: i.product_num,
+								unit_name: i.unit_name,
+								pur_number: i.pur_number,
+								rate: i.rate,
+								weight: i.weight,
+								is_weigh:i.is_weigh
+							}
+							arr.push(obj)
+						})
+					})
+					item.infos = arr
+				}else if(this.type == 'in') {
+					let arr = []
+					item.info.forEach(e => {
+						e.batchs.forEach(i => {
+							let obj = {
+								batch_code:i.batch_code,
+								bin_number: e.bin_number,
+								product_id: i.product_id,
+								product_name: i.product_name,
+								product_num: i.product_num,
+								unit_name: i.unit_name,
+								weight: i.weight,
+								is_weigh:e.is_weigh,
+								tare_weight: i.tare_weight,
+								net_weight: i.net_weight,
+								price: i.price
+							}
+							console.log(obj,'obj');
+							arr.push(obj)
+						})
+					})
+					item.infos = arr
+				}else {
+					item.infos = item.info
+				}
+				let len = 6-item.infos.length
+				if(len > 0) {
+					for(let z = 0; z < len; z++){
+					  item.infos.push({
+					    product_id:'',
+					    product_name:'',
+					    want_product_num:'',
+					    unit_name:'',
+					  })
+					}
+				}
+				item.goodsList = item.infos
+				this.newArrayData.push(item)
+			})
+		}catch(e){
+			console.log(e,'err');
+			//TODO handle the exception
+		}
+		
+	}
+  }
+}
+
+</script>
+<style lang="less" scoped>
+.order-bgc {
+  background-color: #fff;
+}
+/deep/.ivu-table th{
+  background-color: #fff!important;
+}
+/deep/.ivu-table-header thead tr th:nth-of-type(1){
+  padding-left:0!important;
+}
+/deep/.ivu-table-header thead tr th{
+  border-top: 1px solid #333;
+}
+/deep/.ivu-table td:nth-of-type(1){
+  padding-left:0!important;
+}
+/deep/.ivu-table-header table{
+  //border-top:0!important;
+}
+/deep/.ivu-table-border th, /deep/.ivu-table-border td{
+  border-right: 1px solid #333!important;
+}
+/deep/.ivu-table-border th:nth-of-type(1), /deep/.ivu-table-border td:nth-of-type(1){
+  border-left: 1px solid #333!important;
+}
+/deep/.ivu-table th, /deep/.ivu-table td{
+  border-bottom: 1px solid #333!important;
+  height: 47px!important;
+}
+/deep/.ivu-table-wrapper-with-border{
+  border-color: #333!important;
+  border: unset;
+  //border-bottom: 1px solid #333;
+  //border-right: 1px solid #333;
+}
+/deep/.ivu-table-border:after{
+  background-color: #333;
+  width: 0!important;
+  height: 0!important;
+}
+/deep/.ivu-table:before{
+  background-color: #333;
+  width: 0!important;
+  height: 0!important;
+}
+/deep/.ivu-table{
+  color: #000;
+}
+.pricePay{
+  font-weight: bold;
+}
+.bottom{
+  color: rgba(0, 0, 0, 0.85);
+  font-size: 12px;
+  font-weight: 400;
+  margin-top: 10px;
+  .item{
+    margin-right: 30px;
+  }
+  .name{
+    font-weight: 600;
+  }
+  .con{
+    width: 740px;
+    font-weight: unset;
+  }
+}
+.putSupplier{
+  width: 794px;
+  height: 1150px;
+  background-color: #fff;
+  margin: 0 auto;
+  padding-top: 10px;
+  /*padding: 20px 20px 450px 20px;*/
+  /*box-sizing: border-box;*/
+  .header{
+    .info{
+      font-size: 12px;
+      color: rgba(0, 0, 0, 0.85);
+      .name{
+        font-weight: 600;
+      }
+      div~div{
+        margin-top: 10px;
+      }
+    }
+    .left{
+      width: 500px;
+      .pictrue{
+        width: 90px;
+        height: 90px;
+        margin-right: 20px;
+        img{
+          width: 100%;
+          height: 100%;
+        }
+      }
+      .info{
+        flex: 1;
+      }
+    }
+  }
+}
+.delivery {
+  display: flex;
+  justify-content: center;
+  width: 794px;
+  padding-top: 14px;
+  border-top: 1px solid #DDDDDD;
+  margin: 11px auto;
+  font-size: 10px;
+  color: #333333;
+
+  div + div {
+    margin-left: 30px;
+  }
+}
+</style>

+ 61 - 27
src/pages/erp/expired/index.vue

@@ -6,6 +6,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="userSearchss" 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="user_time">
             <DatePicker
                 :editable="false"
@@ -30,10 +37,10 @@
               <Option value="0">下架</Option>
             </Select>
           </FormItem> -->
-					<FormItem label="仓位搜索:" label-for="store_name">
+					<!-- <FormItem label="仓位搜索:" label-for="store_name">
 						<Input class="input-add mr14" placeholder="请输入仓位名称" v-model="tableFrom.key" />
 						<Button type="primary" @click="tableSearchs()">查询</Button>
-					</FormItem>
+					</FormItem> -->
 					<!-- <Button
             v-auth="['marketing-store_seckill-create']"
             type="primary"
@@ -48,7 +55,7 @@
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['admin-erp-add_position']" type="primary" @click="add" class="mr10">添加仓位</Button>
+			<!-- <Button v-auth="['admin-erp-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">
@@ -64,11 +71,16 @@
 				<template slot-scope="{ row, index }" slot="number">
 					<span> {{ row.bin_number.slice(4) }}</span>
 				</template>
+				<template slot-scope="{ row, index }" slot="create_day">
+					<div> {{ row.batch_code ? row.batch_code.slice(0,4) + '-' + row.batch_code.slice(4,6) + '-' + row.batch_code.slice(6,8) : '/'}}</div>
+				</template>
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<!-- {{row.wid }} -->
+					{{data1.find(item =>item.id == row.wid).title}}
+					<!-- <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="action">
 					<a @click="look(row)">详情</a>
@@ -100,7 +112,9 @@
 	import {
 		getGoodsList,
 		getUserInfo,
-		getPosition
+		getPosition,
+		getGodownList,
+		getlqList
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -122,6 +136,7 @@
 		},
 		data() {
 			return {
+				data1:[],
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
@@ -131,33 +146,33 @@
 						width: 80,
 					},
 					{
-						title: "仓位名称",
-						key: "title",
+						title: "商品名称",
+						key: "product_name",
 						minWidth: 90,
 					},
 					{
-						title: "通道",
-						slot: "passageway",
+						title: "批次编号",
+						key: "batch_code",
 						minWidth: 90,
 					},
 					{
-						title: "层数",
-						slot: "layer",
+						title: "生产日期",
+						slot: "create_day",
 						minWidth: 90,
 					},
 					{
-						title: "左右",
-						slot: "control",
+						title: "保质期(天)",
+						key: "shelf_life",
 						minWidth: 90,
 					},
 					{
-						title: "仓位编号",
-						slot: "number",
+						title: "单位",
+						key: "unit_name",
 						minWidth: 90,
 					},
 					{
-						title: "编号",
-						key: "bin_number",
+						title: "库存",
+						key: "net_weight",
 						minWidth: 90,
 					},
 					{
@@ -166,11 +181,16 @@
 						minWidth: 90,
 					},
 					{
-						title: "操作",
-						slot: "action",
-						fixed: "right",
-						width: 200,
+						title: "仓位",
+						key: "bin_number",
+						minWidth: 90,
 					},
+					// {
+					// 	title: "操作",
+					// 	slot: "action",
+					// 	fixed: "right",
+					// 	width: 200,
+					// },
 				],
 				tableList: [],
 				timeVal: [],
@@ -182,9 +202,8 @@
 					xs: 24,
 				},
 				tableFrom: {
-					// integral_time: "",
-					// is_show: "",
-					// store_name: "",
+					end: 1,
+					wid: 0,
 					key: '',
 					page: 1,
 					limit: 10,
@@ -202,9 +221,24 @@
 			},
 		},
 		created() {
-			this.getList();
+			this.getGodownList()
 		},
 		methods: {
+			userSearchss(e) {
+				console.log(e,'eee');
+				// this.tableFrom.status = e
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+					this.getList();
+				}).catch(res => {
+					this.getList();
+				})
+			},
 			look(row) {
 				// getPosition(row.id).then(res => {
 					
@@ -286,7 +320,7 @@
 				this.loading = true;
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
-				getGoodsList(this.tableFrom)
+				getlqList(this.tableFrom)
 					.then(async (res) => {
 						let data = res.data;
 						this.tableList = data.data;

+ 186 - 5
src/pages/erp/in/addInList.vue

@@ -24,12 +24,13 @@
 				<Row :gutter="24" type="flex">
 					<Col span="24">
 						<FormItem label="采购单号:" prop="orderNumber">
-							<Input v-model="formValidate.orderNumber" placeholder="请输入采购单号" v-width="'400'" @keyup.enter.native="getGoods" @submit.native.prevent />
+							<Input v-model="formValidate.orderNumber" placeholder="请输入采购单号" v-width="'400'" @submit.native.prevent />
+							<a @click="getGoods" style="margin-left: 20px;">确认</a>
 						</FormItem>
 					</Col>
 					<Col span="24">
 						<FormItem label="运费:" prop="freight">
-							<Input v-model="formValidate.freight" placeholder="请输入运费" v-width="'400'" />
+							<Input v-model="formValidate.freight" placeholder="请输入运费" v-width="'400'" type="number"/>
 						</FormItem>
 					</Col>
 					<Col span="24" v-if="showWid">
@@ -39,6 +40,14 @@
 							</el-cascader>
 						</FormItem>
 					</Col>
+					<Col span="24">
+					<FormItem label="创建人:" prop="create_uid" v-if="formValidate.wid != 0">
+						<el-cascader placeholder="请选择创建人" class="input-add" size="mini"
+							v-model="formValidate.create_uid" :options="authList" :props="propsss"
+							@change="userSearchsss" filterable clearable v-width="'400'" :disabled="formValidate.id != 0">
+						</el-cascader>
+					</FormItem>
+					</Col>
 					<Col span="24" v-if="goodsList.length > 0">
 						<FormItem label="商品:">
 							<Table :columns="columns" :data="goodsList" ref="table" :loading="loading"
@@ -69,6 +78,7 @@
 											<Option v-for="item in binList" :value="item.bin_number" :key="item.bin_number">
 												{{ item.bin_number }}</Option>
 										</Select>
+										<a @click="addPosition">添加仓位</a>
 									</div>
 								</template>
 							</Table>
@@ -81,23 +91,132 @@
 			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
 			<Form>
 				<FormItem>
-					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')" >保存</Button>
 				</FormItem>
 			</Form>
 		</Card>
+		<Modal v-model="modalPosition" scrollable title="添加仓位" class="order_box" :closable="false"
+			:mask-closable="false">
+			<Form ref="remarks" :model="remarks" :rules="rulePosition" :label-width="100" @submit.native.prevent>
+				<Col span="24">
+				<FormItem label="仓位名称:" prop="title">
+					<Input v-model="remarks.title" placeholder="请输入仓位名称/编号" v-width="'200'" />
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="通道:" prop="passageway">
+					<Input v-model="remarks.passageway" placeholder="请输入通道" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~99)
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="左右:" prop="control">
+					<RadioGroup v-model="remarks.control">
+						<Radio label="L" :disabled="remarks.id != 0">
+							<Icon type="social-apple"></Icon>
+							<span>左</span>
+						</Radio>
+						<Radio label="R" :disabled="remarks.id != 0">
+							<Icon type="social-android"></Icon>
+							<span>右</span>
+						</Radio>
+					</RadioGroup>
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="层数:" prop="layer">
+					<Input v-model="remarks.layer" placeholder="请输入层数" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~9)
+				</FormItem>
+				</Col>
+				<Col span="24">
+				<FormItem label="仓位编号:" prop="number">
+					<Input v-model="remarks.number" placeholder="请输入仓位编号" type="number" v-width="'200'"
+						:disabled="remarks.id != 0" /> (1~999)
+				</FormItem>
+				</Col>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putRemark()">提交</Button>
+				<Button @click="cancels()">取消</Button>
+			</div>
+		</Modal>
 	</div>
 </template>
 
 <script>
 	import { mapState,mapMutations } from "vuex";
 	import Setting from "@/setting";
-	import { getPurchaseId,batch_save,getPositionList,createRuku ,getGodownList} from "@/api/erp";
+	import { getPurchaseId,batch_save,getPositionList,createRuku ,getGodownList,createPosition,getUserList} from "@/api/erp";
 	import { in_status } from "@/api/erpAdmin";
 	import { formatDate } from "@/utils/validate";
+	const jy = (min, max) => {
+		return {
+			validator(rule, value) {
+				if (!value || value > max || value < min) {
+					return [{
+						message: `范围为${min}~${max}`
+					}];
+				} else {
+					return [];
+				}
+			}
+		}
+	}
 	export default {
 		name: "addInList",
 		data() {
 			return {
+				authList:[],
+				propsss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "staff_name"
+				},
+				modalPosition: false,
+				rulePosition: {
+					title: [{
+						required: true,
+						message: "请输入仓位名称",
+						trigger: "blur"
+					}, ],
+					wid: [{
+						required: true,
+						message: "请选择仓库",
+						trigger: "blur"
+					}, ],
+					passageway: [{
+						required: true,
+						message: "请输入通道",
+						trigger: "blur"
+					}, jy(1, 99)],
+					control: [{
+						required: true,
+						message: "请选择左右",
+						trigger: "blur"
+					}, ],
+					layer: [{
+						required: true,
+						message: '请输入层数',
+						trigger: 'blur',
+					}, jy(1, 9)],
+					number: [{
+						required: true,
+						message: '请输入仓位编号',
+						trigger: 'blur',
+					}, jy(1, 999)],
+				},
+				remarks: {
+					id: 0,
+					title: "",
+					wid: '0',
+					passageway: '',
+					control: "L",
+					layer: '',
+					number: ''
+				},
 				props: {
 					emitPath: false,
 					multiple: false,
@@ -151,6 +270,8 @@
 					},
 				],
 				formValidate: {
+					create_admin_id:0,
+					create_uid: 0,
 					id: 0,
 					orderNumber:'',
 					freight:'',
@@ -181,6 +302,63 @@
 			}
 		},
 		methods: {
+			userSearchsss(e) {
+				if (e) {
+					let obj = this.authList.find(item => item.id == e)
+					this.formValidate.create_admin_id = obj.admin_id
+				}
+			},
+			getUserList() {
+				getUserList({
+					wid: this.formValidate.wid
+				}).then(res => {
+					this.authList = res.data.data
+				})
+			},
+			addPosition() {
+				this.modalPosition = true
+				this.remarks.wid = this.inInfo.wid
+			},
+			cancels() {
+				this.modalPosition = false
+				this.remarks = {
+					id: 0,
+					title: "",
+					wid: '0',
+					passageway: '',
+					control: "L",
+					layer: '',
+					number: ''
+				}
+			},
+			putRemark() {
+				this.$refs.remarks.validate((valid) => {
+					if (valid) {
+						// this.remarks.id = this.$route.query.id;
+						createPosition({
+							id: this.remarks.id,
+							title: this.remarks.title,
+							wid: this.info.wid,
+							passageway: this.remarks.passageway,
+							control: this.remarks.control,
+							layer: this.remarks.layer,
+							number: this.remarks.number
+						}).then(res => {
+							this.$Message.success(res.msg);
+							this.getBin(this.info.wid)
+			
+							this.cancels()
+							// this.$router.push({
+							// 	path: this.roterPre + "/erp/position_list"
+							// });
+						}).catch(err => {
+							this.$Message.error(err.msg);
+						})
+					} else {
+						// this.$Message.error("请输入参数模板名称");
+					}
+				});
+			},
 			getGodownList() {
 				getGodownList().then(res => {
 					console.log(res);
@@ -190,7 +368,7 @@
 			//提交数据
 			handleSubmit(name) {
 				if(!this.formValidate.wid) {
-					this.$Message.error("请选择门店");
+					this.$Message.error("请选择仓库");
 					return
 				}
 				if(this.formValidate.id == 0) {
@@ -240,6 +418,8 @@
 					})
 				})
 				createRuku({
+					create_uid: this.formValidate.create_uid,
+					create_admin_id: this.formValidate.create_admin_id,
 					info:list,
 					total_num:total_num,
 					total_price:total_price,
@@ -270,6 +450,7 @@
 							}else {
 								this.formValidate.wid = this.info.wid
 							}
+							this.getUserList()
 					   		this.info.info.forEach(item => {
 					   			item.batch_code = ''
 					   			item.tare_weight = ''

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

@@ -32,8 +32,9 @@
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
 			<Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">创建入库单</Button>
+			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('in')" class="mr10">打印入库单</Button>
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
-				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
+				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt" @on-selection-change="checkItem">
 				<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>
@@ -243,7 +244,12 @@
 					},
 
 				],
-				columns1: [{
+				columns1: [
+					{
+							type: 'selection',
+							width: 60,
+							align: 'center'
+						},{
 						title: "ID",
 						key: "id",
 						width: 80,
@@ -273,11 +279,11 @@
 						slot: "cuser",
 						minWidth: 150,
 					},
-					{
-						title: "审核人",
-						slot: "auser",
-						minWidth: 150,
-					},
+					// {
+					// 	title: "审核人",
+					// 	slot: "auser",
+					// 	minWidth: 150,
+					// },
 					{
 						title: "总数量",
 						key: "total_num",
@@ -348,7 +354,7 @@
 				inInfo: {},
 				infoList: [],
 				positionList: [],
-				basePosition:[]
+				basePosition: []
 			};
 		},
 		computed: {
@@ -365,6 +371,25 @@
 			this.getGodownList()
 		},
 		methods: {
+			checkItem(e) {
+				this.checKList = e
+			},
+			printing(name) {
+				if (this.checKList.length == 0) {
+					return this.$Message.error('请选择要打印的要货单')
+				}
+				let id = this.checKList.map(e => {
+					return e.id
+				})
+				let routeData = this.$router.resolve(({
+					path: this.roterPre + '/erp/printing',
+					query: {
+						type: name,
+						id: id.join(','),
+					}
+				}))
+				window.open(routeData.href, '_blank')
+			},
 			getGodownList() {
 				getGodownList().then(res => {
 					console.log(res);
@@ -421,8 +446,8 @@
 					not_used: 1
 				}).then(res => {
 					this.positionList = res.data.data.concat(this.basePosition).filter((obj, index, arr) =>
-  arr.map(mapObj => mapObj.bin_number).indexOf(obj.bin_number) === index
-)
+						arr.map(mapObj => mapObj.bin_number).indexOf(obj.bin_number) === index
+					)
 				})
 			},
 			cancel() {
@@ -434,10 +459,10 @@
 			},
 			listing(row) {
 				console.log(row);
-				if(row.bin_number == '') {
+				if (row.bin_number == '') {
 					return this.$Message.error('请选择仓位')
 				}
-				
+
 				// listing({
 				// 	in_order_id: this.inInfo.in_order_id,
 				// 	info: this.inInfo.info
@@ -459,15 +484,15 @@
 				getInInfo(row.in_order_id).then(res => {
 					this.inInfo = res.data
 					this.infoList = res.data.info.filter(item => {
-						if(item.bin_number) {
+						if (item.bin_number) {
 							this.basePosition.push({
 								bin_number: item.bin_number
 							})
 						}
 						return item.status == 0
 					})
-					 // this.basePosition= this.basePosition;
-					console.log(this.basePosition,'this.basePosition');
+					// this.basePosition= this.basePosition;
+					console.log(this.basePosition, 'this.basePosition');
 					this.getPositionList(this.inInfo.wid)
 					this.modal = true
 				})

+ 691 - 1
src/pages/erp/losses/addLosses.vue

@@ -1,8 +1,698 @@
 <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/losses` }">
+						<!-- <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="title">
+						<Input v-model="formValidate.title" placeholder="请输入仓位名称/编号" v-width="'400'" />
+					</FormItem>
+					</Col>
+					<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">
+								<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> -->
+					<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="userSearchs" filterable clearable v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					
+					<Col span="24">
+					<FormItem label="门店:" prop="store_id" v-if="formValidate.outType == 1">
+						<el-cascader placeholder="请选择门店" class="input-add" size="mini"
+							v-model="formValidate.store_id" :options="staffData" :props="propss"
+							@change="userSearchse" filterable clearable v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<Col span="24">
+					<FormItem label="创建人:" prop="create_uid" v-if="formValidate.store_id != 0 || formValidate.wid != 0">
+						<el-cascader placeholder="请选择创建人" class="input-add" size="mini"
+							v-model="formValidate.create_uid" :options="authList" :props="propsss" @change="userSearchsss"
+							filterable clearable v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col>
+					<!-- <Col span="24">
+					<FormItem label="报损原因:" prop="type" >
+						<el-cascader placeholder="请选择报损原因" class="input-add" size="mini"
+							v-model="formValidate.type" :options="yList" :props="propses" 
+							filterable clearable v-width="'400'">
+						</el-cascader>
+					</FormItem>
+					</Col> -->
+					<Col span="24">
+					<FormItem label="商品:" prop="goods">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in chooseGoods">
+								<Button type="primary" @click="delGood(gindex)" class="del-btn">删除</Button>
+								<div class="section-hd">{{goods.product_name}}</span> 								</div>
+								<div  class="section" v-for="(item,index) in goods.batchs">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>库存({{item.unit_name}}):</div>
+											<div class="value">{{ item.product_num}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>报损数量({{item.unit_name}}):</div>
+											<div class="value"><Input
+													v-model="chooseGoods[gindex].batchs[index].pur_number"
+													placeholder="请输入数量" v-width="'150'" type="number"/>
+											</div>
+										</div>
+										<div class="item">
+											<div>报损原因:</div>
+											<div class="value">
+												<!-- <Select v-model="chooseGoods[gindex].batchs[index].type" style="width:200px">
+													<Option v-for="items in yList" :value="items.type" :key="items.type" label="name">
+														{{ item.label }}
+													</Option>
+												</Select> -->
+												<el-cascader placeholder="请选择报损原因" class="input-add" size="mini"
+													v-model="chooseGoods[gindex].batchs[index].type" :options="yList" :props="propses" 
+													filterable clearable >
+												</el-cascader>
+											</div>
+										</div>
+										<!-- <div class="item" >
+											<div>皮重(kg):</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].tare_weight"
+													placeholder="请输入重量" v-width="'150'" type="number" /></div>
+										</div>
+										<div class="item " >
+											<div>净重(kg):</div>
+											<div class="value"><Input v-model="chooseGoods[gindex].net_weight"
+													placeholder="请输入重量" v-width="'150'" type="number" /></div>
+										</div> -->
+										<a v-if="goods.batchs.length > 1" @click="delBatch(gindex,index)" class=" del-btn-1">删除</a>
+									</div>
+								</div>
+							</div>
+						</Card>
+						<Button type="primary" class="submission" style="margin-top:20px;" @click="getGoods()"
+							>添加商品</Button>
+					</FormItem>
+					</Col>
+				</Row>
+			</Form>
+		</Card>
+		<Card :bordered="false" dis-hover class="fixed-card"
+			:style="{ left: `${!menuCollapse ? '200px' : isMobile ? '0' : '80px'}` }">
+			<Form>
+				<FormItem>
+					<Button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</Button>
+				</FormItem>
+			</Form>
+		</Card>
+		<good-detail ref="goodDetail" @setGoods="setGoods"></good-detail>
+	</div>
 </template>
 
 <script>
+	import {
+		staffListInfo
+	} from "@/api/store";
+	import {
+		mapState,
+		mapMutations
+	} from "vuex";
+	import {
+		getGodownList,
+		createGodown,
+		getGodownInfo,
+		createPosition,
+		getPosition,
+		getUserList,
+		createLoss,
+		getYlist,
+		getProductBatch
+	} from "@/api/erp";
+	import {
+		keyApi,
+		storeGetInfoApi,
+		cityApi,
+		storeUpdateApi,
+		cascaderList
+	} from '@/api/store';
+	import {
+		productSpecs,
+		productSpecsInfo
+	} from "@/api/product";
+	import Setting from "@/setting";
+	import goodDetail from './goodDetail.vue'
+	const jy = (min,max)=>{
+		return {
+	        validator(rule, value){
+	            if (!value || value > max || value < min) {
+	                return [{message:`范围为${min}~${max}`}];
+	            } else {
+	                return [];
+	            }
+	        }
+	    }
+	}
+	
+
+	export default {
+		name: "lossesAdd",
+		components: {
+			goodDetail
+		},
+		data() {
+			return {
+				yList: [],
+				chooseGoods:[],
+				authList:[],
+				addresData: [],
+				props: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "title"
+				},
+				propses: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "type",
+					label: "name"
+				},
+				roterPre: Setting.roterPre,
+				data1: [],
+				grid: {
+					xl: 7,
+					lg: 7,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				formValidate: {
+					create_uid: 0,
+					create_admin_id: 0,
+					store_id: 0,
+					outType: 0,
+					id: 0,
+					title: "",
+					wid:0,
+					passageway:'',
+					control: "L",
+					layer: '',
+					number:''
+				},
+				propss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "name"
+				},
+				propsss: {
+					emitPath: false,
+					multiple: false,
+					checkStrictly: true,
+					value: "id",
+					label: "staff_name"
+				},
+				staffData:[],
+				ruleValidate: {
+					wid: [{
+						required: true,
+						message: "请选择仓库"
+					}, ],
+					store_id: [{
+						type: 'number',
+						required: true,
+						message: "请选择门店",
+						trigger: "blur"
+					}, ],
+					create_uid: [{
+						type: 'number',
+						required: true,
+						message: "请选择创建人",
+						trigger: "blur"
+					}, ],
+					type: [{
+						required: true,
+						message: "请选择报损原因",
+						trigger: "blur"
+					}, ],
+				},
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile", "menuCollapse"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 120;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getGodownList()
+			this.staffList()
+			this.getYlist()
+		},
+		mounted() {
+			// this.setCopyrightShow({
+			// 	value: false
+			// });
+			if(this.$route.query.id != 0) {
+				// this.getPosition(this.$route.query.id)
+			}else {
+				this.formValidate.id = 0
+			}
+		},
+		destroyed() {
+			// this.setCopyrightShow({
+			// 	value: true
+			// });
+		},
+		methods: {
+			...mapMutations("admin/layout", ["setCopyrightShow"]),
+			getYlist() {
+				getYlist().then(res => {
+					this.yList = res.data.list
+				})
+			},
+			jyNum(a = 0, b = 0, item) {
+				if (a * 1 < b * 1) {
+					item.pur_number = 0
+					return this.$Message.error('输入值大于可商品的库存')
+				}
+			},
+			setGoods(e) {
+				// 校验商品是否重复
+				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;
+					if (this.formValidate.outType == 1) {
+							qdata = {
+								store_id: this.formValidate.store_id,
+								product_id: e.product_id
+							}
+				
+					} else {
+						qdata = {
+							wid: this.formValidate.wid,
+							product_id: e.product_id
+						}
+					}
+					getProductBatch(qdata).then(res => {
+						if (res.data.length > 0) {
+							console.log(res.data,'pici');
+							try{
+								this.chooseGoods = this.chooseGoods.concat({
+									bar_code: e.bar_code,
+									batchs: res.data.map(item => {
+										let obj = {
+											bar_code: item.bar_code,
+											batch_code: item.batch_code,
+											is_weigh: item.is_weigh,
+											product_id: item.product_id,
+											product_name: item.product_name,
+											product_num: item.product_num,
+											pur_number: 0,
+											rate: item.rate,
+											type: '',
+											unit_name: item.unit_name,
+											unit_type: item.unit_type,
+											wid: item.wid
+										}
+										return obj
+									}),
+									product: e.info,
+									product_id: e.product_id,
+									product_name: e.product_name,
+									product_num: e.product_num,
+									unit_name: e.unit_name,
+									think_count: e.think_count,
+									wid: e.wid
+								})
+							}catch(e){
+								console.log(e,'err');
+								//TODO handle the exception
+							}
+							
+						}
+					})
+					// this.chooseGoods = this.chooseGoods.concat(e)
+				
+				}
+			},
+			getGoods() {
+				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);
+				}
+			
+			},
+			delGood(index) {
+				this.chooseGoods.splice(index, 1)
+			},
+			userSearchse(e) {
+				this.formValidate.create_uid = "";
+				this.authList = []
+				this.getUserList()
+			},
+			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() {
+				console.log('kais');
+				try{
+					staffListInfo()
+						.then((res) => {
+							this.staffData = res.data
+						})
+						.catch((err) => {
+							this.$Message.error(err.msg);
+						});
+				}catch(e){
+					console.log(e,'eee');
+					//TODO handle the exception
+				}
+				
+			},
+			changeOutType() {
+				this.chooseGoods = []
+				this.formValidate.store_id = 0
+				this.formValidate.wid = 0
+				this.formValidate.create_uid = 0
+				this.formValidate.create_admin_id = 0
+			},
+			
+			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({
+					page: 1,
+					limit: 10000
+				}).then(res => {
+					console.log(res);
+					this.data1 = res.data.data.map(item => {
+						item.id = item.id + ''
+						return item
+					})
+					console.log(this.data1,'this.data1');
+				})
+			},
+			del(index) {
+				this.data.splice(index, 1);
+			},
+			userSearchsss(e) {
+				if(e) {
+					let obj = this.authList.find(item => item.id == e)
+					this.formValidate.create_admin_id = obj.admin_id
+				}
+				
+			},
+			userSearchs(e) {
+				this.getUserList()
+			},
+			handleSubmit(name) {
+				let arr = []
+				let goods = JSON.parse(JSON.stringify(this.chooseGoods))
+					//过滤
+					goods.forEach(item => {
+						item.batchs = item.batchs.filter(items => {
+							return items.pur_number && items.type
+						})
+						if(item.batchs.length > 0) {
+							arr.push(item)
+						}
+					})
+				
+				
+				console.log(arr,'this.chooseGoods');
+				if(arr.length == 0) {
+					return this.$Message.error('请至少填写一项报损数量和报损原因')
+				}
+				console.log(goods,'goods');
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						this.formValidate.id = this.$route.query.id;
+						let pdata = {}
+						
+						pdata = {
+							create_uid: this.formValidate.create_uid,
+							create_admin_id: this.formValidate.create_admin_id,
+							// type: this.formValidate.type,
+							info: arr
+						}
+						if(this.formValidate.outType == 1) {
+							pdata.store_id = this.formValidate.store_id
+						}else {
+							pdata.wid = this.formValidate.wid
+						}
+						createLoss(pdata).then(res => {
+							this.$Message.success(res.msg);
+									this.$router.push({
+										path: this.roterPre + "/erp/losses"
+									});
+						}).catch(err => {
+							this.$Message.error(err.msg);
+						})
+					}
+				});
+			},
+		},
+	};
 </script>
 
-<style>
+<style scoped lang="stylus">
+	.table {
+		/deep/.ivu-table-header table {
+			border: 0 !important;
+		}
+
+		/deep/.ivu-table-header thead tr th:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table td:nth-of-type(1) {
+			padding-left: 16px;
+		}
+
+		/deep/.ivu-table-cell {
+			padding: 0 !important;
+		}
+
+		/deep/.ivu-table-border th,
+		/deep/.ivu-table-border td {
+			border-right: unset;
+		}
+
+		/deep/.ivu-table td {
+			height: 59px;
+		}
+	}
+
+	.form-submit {
+		/deep/.ivu-card {
+			border-radius: 0;
+		}
+
+		margin-bottom: 79px;
+
+		.fixed-card {
+			position: fixed;
+			right: 0;
+			bottom: 0;
+			left: 200px;
+			z-index: 99;
+			box-shadow: 0 -1px 2px rgb(240, 240, 240);
+
+			/deep/ .ivu-card-body {
+				padding: 15px 16px 14px;
+			}
+
+			.ivu-form-item {
+				margin-bottom: 0;
+			}
+
+			/deep/ .ivu-form-item-content {
+				margin-right: 124px;
+				text-align: center;
+			}
+
+			.ivu-btn {
+				height: 36px;
+				padding: 0 20px;
+			}
+		}
+	}
+
+	.after-line {
+		display: inline-block;
+		position: relative;
+		margin-right: 16px;
+	}
+
+	.ml16 {
+		margin-left: 16px;
+	}
+	.user-info {
+		position: relative;
+		padding: 20px;
+	
+		.section {
+			padding: 25px 25px;
+			border-bottom: 1px dashed #EEEEEE;
+			position: relative;
+	
+			&-hd {
+				padding-left: 10px;
+				border-left: 3px solid #1890FF;
+				font-weight: 500;
+				font-size: 14px;
+				line-height: 16px;
+				color: #303133;
+			}
+	
+			&-bd {
+				display: flex;
+				flex-wrap: wrap;
+			}
+	
+			.item {
+				// flex: 0 0 calc(~"(100% - 60px) / 3");
+				width: 25%;
+				min-width: 250px;
+				display: flex;
+				margin: 16px 30px 0 0;
+				font-size: 13px;
+				color: #606266;
+	
+				&:nth-child(3n+3) {
+					margin: 16px 0 0;
+				}
+			}
+	
+			.value {
+				flex: 1;
+			}
+	
+			.avatar {
+				width: 60px;
+				height: 60px;
+				overflow: hidden;
+	
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+	}
+	.del-btn {
+		position: absolute;
+		right: 20px;
+		top: 10px;
+	}
+	.del-btn-1 {
+		position: absolute;
+		right: 80px;
+		bottom: 20px;
+	}
 </style>

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

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

+ 355 - 1
src/pages/erp/losses/index.vue

@@ -1,8 +1,362 @@
 <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="where">
+					<span> {{ row.tware.title || row.tstore.name }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="cuser">
+					<span> {{ row.cuser.staff_name }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="auser">
+					<span> {{ row.auser.staff_name }}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="product">
+					<div v-for="item in row.stockinfo">
+						<div>{{item.product_name}} <a>{{item.collect_product_num}}{{item.unit_name}}</a></div>
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="create_time">
+					<div>
+						{{row.create_time|formatDate}}
+					</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="status">
+					<Tag color="default" v-if="row.status == 0">待审核</Tag>
+					<Tag color="primary" v-if="row.status == 1">通过</Tag>
+					<Tag color="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="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>
+		<lossDetail ref="lossDetail"></lossDetail>
+		<!-- <productDetail ref="productDetail"></productDetail> -->
+	</div>
 </template>
 
 <script>
+	import lossDetail from './lossDetail.vue'
+	import {
+		mapState
+	} from "vuex";
+	import {
+		integralProductListApi,
+		integralIsShowApi,
+		storeSeckillApi,
+	} from "@/api/marketing";
+	import {
+		getGoods,
+		getUserInfo,
+		getGoodInfo,
+		getLossList
+	} from "@/api/erp";
+	import {
+		formatDate
+	} from "@/utils/validate";
+	import timeOptions from "@/utils/timeOptions";
+	import Setting from "@/setting";
+	// import productDetail from './productDetail.vue'
+	export default {
+		name: "losses",
+		components: {
+			lossDetail
+			// productDetail
+		},
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd");
+				}
+			},
+		},
+		data() {
+			return {
+				roterPre: Setting.roterPre,
+				loading: false,
+				options: timeOptions,
+				columns1: [{
+						title: "ID",
+						key: "id",
+						width: 80,
+					},
+					{
+						title: "报损单位",
+						slot: "where",
+						minWidth: 90,
+					},
+
+					{
+						title: "创建人",
+						slot: "cuser",
+						minWidth: 90,
+					},
+					{
+						title: "审核人",
+						slot: "auser",
+						minWidth: 90,
+					},
+					{
+						title: "商品",
+						slot: "product",
+						minWidth: 90,
+					},
+					//
+					{
+						title: "报损时间",
+						slot: "create_time",
+						minWidth: 90,
+					},
+					{
+						title: "状态",
+						slot: "status",
+						minWidth: 90,
+					},
+					{
+						title: "操作",
+						slot: "action",
+						fixed: "right",
+						width: 200,
+					},
+				],
+				tableList: [],
+				timeVal: [],
+				grid: {
+					xl: 7,
+					lg: 10,
+					md: 12,
+					sm: 24,
+					xs: 24,
+				},
+				tableFrom: {
+					// integral_time: "",
+					// is_show: "",
+					// store_name: "",
+					key: '',
+					page: 1,
+					limit: 10,
+				},
+				total: 0,
+			};
+		},
+		computed: {
+			...mapState("admin/layout", ["isMobile"]),
+			labelWidth() {
+				return this.isMobile ? undefined : 96;
+			},
+			labelPosition() {
+				return this.isMobile ? "top" : "right";
+			},
+		},
+		created() {
+			this.getList();
+		},
+		methods: {
+			look(row) {
+				try {
+					this.$refs.lossDetail.getInfo(row.id)
+				} catch (e) {
+					//TODO handle the exception
+
+				}
+				// getGoodInfo(row.id).then(res=> {
+				// 	console.log(res,'商品详情');
+				// })
+
+			},
+			// 添加
+			add() {
+				this.$router.push({
+					path: this.roterPre + "/erp/losses_add?id=0"
+				});
+			},
+			addMore() {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/add_store_integral",
+				});
+			},
+			orderList(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/order_list",
+					query: {
+						product_id: row.id,
+					},
+				});
+			},
+			// 导出
+			exports() {
+				let formValidate = this.tableFrom;
+				let data = {
+					start_status: formValidate.start_status,
+					status: formValidate.status,
+					store_name: formValidate.store_name,
+				};
+				storeSeckillApi(data)
+					.then((res) => {
+						location.href = res.data[0];
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 编辑
+			edit(row) {
+				this.$router.push({
+					path: this.roterPre + "/erp/product_add?id=" + row.id
+				});
+			},
+			// 一键复制
+			copy(row) {
+				this.$router.push({
+					path: this.roterPre + "/marketing/store_integral/create/" + row.id + "/1",
+				});
+			},
+			// 删除
+			del(row, tit, num) {
+				let delfromData = {
+					title: tit,
+					num: num,
+					url: `/erp/Warehouse/position_del/${row.id}`,
+					method: "DELETE",
+					ids: "",
+				};
+				this.$modalSure(delfromData)
+					.then((res) => {
+						this.$Message.success(res.msg);
+						this.tableList.splice(num, 1);
+						if (!this.tableList.length) {
+							this.tableFrom.page =
+								this.tableFrom.page == 1 ? 1 : this.tableFrom.page - 1;
+						}
+						this.getList();
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+			// 列表
+			getList() {
+				this.loading = true;
+				// this.tableFrom.start_status = this.tableFrom.start_status || "";
+				// this.tableFrom.is_show = this.tableFrom.is_show || "";
+				getLossList(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>
+<style scoped lang="stylus">
+	.tabBox_img {
+		width: 36px;
+		height: 36px;
+		border-radius: 4px;
+		cursor: pointer;
+
+		img {
+			width: 100%;
+			height: 100%;
+		}
+	}
 </style>

+ 654 - 0
src/pages/erp/losses/lossDetail.vue

@@ -0,0 +1,654 @@
+<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.order_id}}</div>
+				<div class="section-bd">
+					<div class="item">
+						<div>报损时间:</div>
+						<div class="value">{{ info.create_time | formatDate }}</div>
+					</div>
+					<div class="item" v-if="info.auth_time">
+						<div>审核时间:</div>
+						<div class="value">{{ info.auth_time | formatDate}}</div>
+					</div>
+				</div>
+			</div>
+	</div>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Tabs v-model="activeName">
+				<TabPane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.val">
+					<template v-if="item.val === 'info'">
+						<Card>
+							<div class="user-info" v-for="(goods,gindex) in info.body">
+								<!-- <a @click="delGood(gindex)" class="del-btn">删除</a> -->
+								<div class="section-hd">{{goods.store_name}}</span> </div>
+								<div v-if="goods.batchs.length > 0" v-for="(item,index) in goods.batchs" class="section">
+									<div class="section-bd">
+										<div class="item">
+											<div>批次编号:</div>
+											<div class="value">{{ item.batch_code || '/'}}</div>
+										</div>
+										<div class="item">
+											<div>单位:</div>
+											<div class="value">{{ item.unit_name}}</div>
+										</div>
+										<div class="item">
+											<div>报损原因:</div>
+											<div class="value">{{ item.type_value}}</div>
+										</div>
+										<div class="item">
+											<div>报损数量:</div>
+											<div class="value">{{ item.pur_number}}</div>
+										</div>
+										<div class="item">
+											<div>库存:</div>
+											<div class="value">{{ item.stock}}</div>
+										</div>
+									</div>
+								</div>
+							</div>
+						</Card>
+					</template>
+					<template v-if="item.val === 'base'">
+						<div class="user-info">
+							<!-- <div class="section">
+								<div class="section-hd">出库单号:{{info.out_order_id}}</div>
+							</div> -->
+							<!-- <div class="section" v-if="">
+								<div class="section-hd">调出仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>供应商ID:</div>
+										<div class="value">{{ info.supplier.id}}</div>
+									</div>
+									<div class="item">
+										<div>供应商名称:</div>
+										<div class="value">{{ info.supplier.supplier_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.supplier.phone}}</div>
+									</div>
+								</div>
+							</div> -->
+							
+							<div class="section" v-if="info.store && info.store.id">
+								<div class="section-hd">调出门店</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.store.name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.store.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.store.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.ware && info.ware.id">
+								<div class="section-hd">调出仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.ware.title}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.ware.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.ware.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.tstore && info.tstore.id">
+								<div class="section-hd">调入门店</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.tstore.name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.tstore.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tstore.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.tware && info.tware.id">
+								<div class="section-hd">调入仓库</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.tware.title}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.tware.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.tware.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.cuser && info.cuser.id">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<div class="section" v-if="info.auser && info.auser.id">
+								<div class="section-hd">审核人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>名称:</div>
+										<div class="value">{{ info.auser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>ID:</div>
+										<div class="value">{{ info.auser.id}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.auser.phone}}</div>
+									</div>
+								</div>
+							</div>
+							<!-- <div class="section">
+								<div class="section-hd">创建人</div>
+								<div class="section-bd" >
+									<div class="item">
+										<div>创建人ID:</div>
+										<div class="value">{{ info.cuser.id}}</div>
+									</div>
+									<div class="item">
+										<div>创建人名称:</div>
+										<div class="value">{{ info.cuser.staff_name}}</div>
+									</div>
+									<div class="item">
+										<div>手机号码:</div>
+										<div class="value">{{ info.cuser.phone}}</div>
+									</div>
+								</div>
+							</div> -->
+						</div>
+					</template>
+				</TabPane>
+			</Tabs>
+		</Card>
+	</Drawer>
+
+</template>
+
+<script>
+	import {
+		getGodownList,
+		createUser,
+		getUserInfo,
+		getPurchaseInfo,
+		getOutInfo,
+		getLossDetail
+	} from "@/api/erp";
+	import Setting from "@/setting";
+import {
+		formatDate
+	} from "@/utils/validate";
+	export default {
+		name: 'lossDetail',
+		filters: {
+			formatDate(time) {
+				if (time !== 0) {
+					let date = new Date(time * 1000);
+					return formatDate(date, "yyyy-MM-dd");
+				}
+			},
+		},
+		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) {
+				getLossDetail(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>

+ 58 - 39
src/pages/erp/low/index.vue

@@ -6,6 +6,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="userSearchss" 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="user_time">
             <DatePicker
                 :editable="false"
@@ -30,10 +37,10 @@
               <Option value="0">下架</Option>
             </Select>
           </FormItem> -->
-					<FormItem label="仓位搜索:" label-for="store_name">
+					<!-- <FormItem label="仓位搜索:" label-for="store_name">
 						<Input class="input-add mr14" placeholder="请输入仓位名称" v-model="tableFrom.key" />
 						<Button type="primary" @click="tableSearchs()">查询</Button>
-					</FormItem>
+					</FormItem> -->
 					<!-- <Button
             v-auth="['marketing-store_seckill-create']"
             type="primary"
@@ -48,7 +55,7 @@
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
-			<Button v-auth="['admin-erp-add_position']" type="primary" @click="add" class="mr10">添加仓位</Button>
+			<!-- <Button v-auth="['admin-erp-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">
@@ -65,10 +72,15 @@
 					<span> {{ row.bin_number.slice(4) }}</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="ware">
-					<div>名称:{{row.ware.title}}</div>
+					<!-- {{row.wid }} -->
+					{{data1.find(item =>item.id == row.wid).title}}
+					<!-- <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="batchs">
+					<div v-for="item in row.batchs">批次编号:<a >{{item.batch_code}}</a> 库存:<a>{{item.product_num}}{{item.unit_name}}</a></div>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="look(row)">详情</a>
@@ -100,7 +112,9 @@
 	import {
 		getGoodsList,
 		getUserInfo,
-		getPosition
+		getPosition,
+		getGodownList,
+		getlqList
 	} from "@/api/erp";
 	import {
 		formatDate
@@ -122,55 +136,47 @@
 		},
 		data() {
 			return {
+				data1:[],
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
-				columns1: [{
-						title: "ID",
-						key: "id",
-						width: 80,
-					},
+				columns1: [
 					{
 						title: "商品名称",
 						key: "product_name",
 						minWidth: 90,
 					},
 					{
-						title: "通道",
-						slot: "passageway",
+						title: "单位",
+						key: "unit_name",
 						minWidth: 90,
 					},
 					{
-						title: "层数",
-						slot: "layer",
+						title: "总库存",
+						key: "product_num",
 						minWidth: 90,
 					},
 					{
-						title: "左右",
-						slot: "control",
-						minWidth: 90,
-					},
-					{
-						title: "仓位编号",
-						slot: "number",
-						minWidth: 90,
-					},
-					{
-						title: "编号",
-						key: "bin_number",
-						minWidth: 90,
+						title: '批次库存',
+						slot: 'batchs',
+						minWidth: 200,
 					},
 					{
 						title: "仓库信息",
 						slot: "ware",
 						minWidth: 90,
 					},
-					{
-						title: "操作",
-						slot: "action",
-						fixed: "right",
-						width: 200,
-					},
+					// {
+					// 	title: "仓位",
+					// 	key: "bin_number",
+					// 	minWidth: 90,
+					// },
+					// {
+					// 	title: "操作",
+					// 	slot: "action",
+					// 	fixed: "right",
+					// 	width: 200,
+					// },
 				],
 				tableList: [],
 				timeVal: [],
@@ -183,9 +189,7 @@
 				},
 				tableFrom: {
 					low: 1,
-					// integral_time: "",
-					// is_show: "",
-					// store_name: "",
+					wid: 0,
 					key: '',
 					page: 1,
 					limit: 10,
@@ -203,9 +207,24 @@
 			},
 		},
 		created() {
-			this.getList();
+			this.getGodownList()
 		},
 		methods: {
+			userSearchss(e) {
+				console.log(e,'eee');
+				// this.tableFrom.status = e
+				this.tableFrom.page = 1;
+				this.getList();
+			},
+			getGodownList() {
+				getGodownList().then(res => {
+					console.log(res);
+					this.data1 = res.data.data
+					this.getList();
+				}).catch(res => {
+					this.getList();
+				})
+			},
 			look(row) {
 				// getPosition(row.id).then(res => {
 					
@@ -287,7 +306,7 @@
 				this.loading = true;
 				// this.tableFrom.start_status = this.tableFrom.start_status || "";
 				// this.tableFrom.is_show = this.tableFrom.is_show || "";
-				getGoodsList(this.tableFrom)
+				getlqList(this.tableFrom)
 					.then(async (res) => {
 						let data = res.data;
 						this.tableList = data.data;

+ 5 - 5
src/pages/erp/out/goodDetail.vue

@@ -25,10 +25,10 @@
 					<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">
+			<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> -->
+					:page-size="formValidate.limit" />
+			</div>
 			<!-- <Button type="primary"  @click="ok" style="width: 100%;margin-top:20px;">确认</Button> -->
 		</Modal>
 	</div>
@@ -66,8 +66,8 @@
 				Ids: 0,
 				loading: false,
 				formValidate: {
-					// page: 1, // 当前页
-					// limit: 20 ,// 每页显示条数
+					page: 1, // 当前页
+					limit: 10 ,// 每页显示条数
 					key: '',
 					wid: '',
 					store_id: '',

+ 30 - 2
src/pages/erp/out/index.vue

@@ -34,9 +34,11 @@
 			<!-- 操作 -->
 			<Button v-auth="['admin-erp-out_add']" type="primary" @click="add" class="mr10">创建出库单</Button>
 			<Button v-auth="['admin-erp-out_addt']" type="primary" @click="addt" class="mr10">创建调出单</Button>
+			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('out')"
+				class="mr10">打印出库单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
-				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
+				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt" @on-selection-change="checkItem">
 				<template slot-scope="{ row, index }" slot="passageway">
 					<span> {{ row.bin_number.slice(0,2) }}</span>
 				</template>
@@ -220,7 +222,12 @@
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
-				columns1: [{
+				columns1: [
+					{
+							type: 'selection',
+							width: 60,
+							align: 'center'
+						},{
 						title: "ID",
 						key: "id",
 						width: 80,
@@ -297,6 +304,7 @@
 					limit: 10,
 				},
 				total: 0,
+				checKList:[]
 			};
 		},
 		computed: {
@@ -312,6 +320,26 @@
 			this.getList();
 		},
 		methods: {
+			checkItem(e) {
+				this.checKList = e
+			},
+			printing(name) {
+				if (this.checKList.length == 0) {
+					return this.$Message.error('请选择要打印的要货单')
+				}
+				let id = this.checKList.map(e => {
+					return e.id
+				})
+				let routeData = this.$router.resolve(({
+					path: this.roterPre + '/erp/printing',
+					query: {
+						type: name,
+						id: id.join(','),
+					}
+				}))
+				window.open(routeData.href, '_blank')
+			
+			},
 			storeReceipt(row,type) {
 				let url;
 				this.$router.push({

+ 289 - 0
src/pages/erp/printing/index.vue

@@ -0,0 +1,289 @@
+<template>
+  <!-- 支付订单 -->
+  <div class="order-bgc">
+    <div class="putSupplier" v-for="(item,index) in newArrayData" :key="index">
+      <div class="header acea-row row-between-wrapper">
+        <div class="left acea-row row-middle">
+          <div class="pictrue" :id="'qrCodeUrl'+index"></div>
+          <div class="info">
+            <div><span class="name">收货人:</span>{{item.real_name}}</div>
+            <div><span class="name">收货地址:</span>{{item.user_address}}</div>
+            <div><span class="name">手机号:</span><span>{{item.user_phone}}</span></div>
+          </div>
+        </div>
+        <div class="info">
+          <div><span class="name">订单编号:</span>{{item.order_id}}</div>
+          <div><span class="name">支付时间:</span>{{item.pay_time}}</div>
+          <div><span class="name">支付方式:</span>{{item.pay_type_name}}</div>
+        </div>
+      </div>
+      <div class="mt20">
+        <Table border :columns="columns" :data="item.goodsList" :disabled-hover="true">
+          <template slot-scope="{ row }" slot="store_name">
+            <div class="line1">{{row.store_name}}</div>
+          </template>
+          <template slot-scope="{ row }" slot="suk">
+            <div class="line1">{{row.suk}}</div>
+          </template>
+        </Table>
+      </div>
+      <div class="bottom acea-row row-between-wrapper">
+        <div class="acea-row row-middle">
+          <div class="item"><span class="name">运费:</span>{{item.freight_price}}</div>
+          <div class="item"><span class="name">优惠:</span>{{item.coupon_price}}</div>
+          <div class="item"><span class="name">会员折扣:</span>{{item.vip_true_price}}</div>
+          <div class="item"><span class="name">积分抵扣:</span>{{item.deduction_price}}</div>
+        </div>
+        <div class="pricePay">实付金额:{{item.pay_price}}</div>
+      </div>
+      <div class="bottom acea-row">
+        <div class="name">用户备注:<span class="con">{{item.mark || '-'}}</span></div>
+      </div>
+      <div class="h50">
+        <div class="delivery" v-if="site_name || refund_address || refund_phone">
+          <div v-if="site_name">店铺信息:{{ site_name }}</div>
+          <div v-if="refund_address">地址:{{ refund_address }}</div>
+          <div v-if="refund_phone">联系方式:{{ refund_phone }}</div>
+        </div>
+      </div>
+    </div>
+<!--  注意:后续要是加内容使页面撑大,记得查看下打印是否在同一张  -->
+  </div>
+</template>
+<script>
+import { distributionInfo } from '@/api/supplier'
+import { distributionOrder } from '@/api/order'
+import { getWantInfo } from '@/api/erp';
+import QRCode from 'qrcodejs2';
+import Setting from '@/setting';
+export default {
+  data (){
+    return {
+      columns:[
+        {
+          title: '商品编号',
+          key: 'index',
+          align: 'center',
+          width: 60
+        },
+        {
+          title: '商品名称',
+          slot: 'store_name',
+          align: 'center',
+          minWidth: 253
+        },
+        {
+          title: '商品规格',
+          slot: 'suk',
+          align: 'center',
+          width: 219
+        },
+        // {
+        //     title: '商品条码',
+        //     key: 'bar_code',
+        //     align: 'center',
+        //     width: 109
+        // },
+        // {
+        //     title: '商品编码',
+        //     key: 'code',
+        //     align: 'center',
+        //     width: 109
+        // },
+        {
+          title: '单价',
+          key: 'truePrice',
+          align: 'center',
+          width: 100
+        },
+        {
+          title: '数量',
+          key: 'cart_num',
+          align: 'center',
+          width: 60
+        },
+        {
+          title: '金额',
+          key: 'subtotal',
+          align: 'center',
+          width: 100
+        },
+      ],
+      data:{},
+      goods:[],
+      BaseURL: Setting.apiBaseURL.replace(/adminapi/, ""),
+      newArrayData:[],
+      site_name: '',
+      refund_phone: '',
+      refund_address: ''
+    }
+  },
+  created() {
+    this.getDistribution();
+  },
+  mounted() {
+    this.$nextTick(function () {
+      let that = this;
+      setTimeout(function () {
+        that.creatQrCode();
+      },200)
+    })
+  },
+  methods:{
+    // 生成二维码
+    creatQrCode() {
+      let url= this.BaseURL;
+      let qrcode = '';
+      this.newArrayData.forEach((item,index)=>{
+        let obj = document.getElementById('qrCodeUrl'+index);
+        qrcode = new QRCode(obj, {
+          text: url, // 需要转换为二维码的内容
+          width: 90,
+          height: 90,
+          colorDark: '#000000',
+          colorLight: '#ffffff',
+          correctLevel: QRCode.CorrectLevel.H
+        })
+      });
+
+    },
+    getDistribution(){
+		let getInfo;
+		try{
+			switch (this.$route.query.type){
+				case 'want':
+					getInfo = getWantInfo
+					break;
+				default:
+					break;
+			}
+			getInfo(this.$route.query.id).then(res => {
+				
+			})
+		}catch(e){
+			console.log(e,'err');
+			//TODO handle the exception
+		}
+		
+	}
+  }
+}
+
+</script>
+<style lang="less" scoped>
+.order-bgc {
+  background-color: #fff;
+}
+/deep/.ivu-table th{
+  background-color: #fff!important;
+}
+/deep/.ivu-table-header thead tr th:nth-of-type(1){
+  padding-left:0!important;
+}
+/deep/.ivu-table-header thead tr th{
+  border-top: 1px solid #333;
+}
+/deep/.ivu-table td:nth-of-type(1){
+  padding-left:0!important;
+}
+/deep/.ivu-table-header table{
+  //border-top:0!important;
+}
+/deep/.ivu-table-border th, /deep/.ivu-table-border td{
+  border-right: 1px solid #333!important;
+}
+/deep/.ivu-table-border th:nth-of-type(1), /deep/.ivu-table-border td:nth-of-type(1){
+  border-left: 1px solid #333!important;
+}
+/deep/.ivu-table th, /deep/.ivu-table td{
+  border-bottom: 1px solid #333!important;
+  height: 47px!important;
+}
+/deep/.ivu-table-wrapper-with-border{
+  border-color: #333!important;
+  border: unset;
+  //border-bottom: 1px solid #333;
+  //border-right: 1px solid #333;
+}
+/deep/.ivu-table-border:after{
+  background-color: #333;
+  width: 0!important;
+  height: 0!important;
+}
+/deep/.ivu-table:before{
+  background-color: #333;
+  width: 0!important;
+  height: 0!important;
+}
+/deep/.ivu-table{
+  color: #000;
+}
+.pricePay{
+  font-weight: bold;
+}
+.bottom{
+  color: rgba(0, 0, 0, 0.85);
+  font-size: 12px;
+  font-weight: 400;
+  margin-top: 10px;
+  .item{
+    margin-right: 30px;
+  }
+  .name{
+    font-weight: 600;
+  }
+  .con{
+    width: 740px;
+    font-weight: unset;
+  }
+}
+.putSupplier{
+  width: 794px;
+  background-color: #fff;
+  margin: 0 auto;
+  padding-top: 10px;
+  /*padding: 20px 20px 450px 20px;*/
+  /*box-sizing: border-box;*/
+  .header{
+    .info{
+      font-size: 12px;
+      color: rgba(0, 0, 0, 0.85);
+      .name{
+        font-weight: 600;
+      }
+      div~div{
+        margin-top: 10px;
+      }
+    }
+    .left{
+      width: 500px;
+      .pictrue{
+        width: 90px;
+        height: 90px;
+        margin-right: 20px;
+        img{
+          width: 100%;
+          height: 100%;
+        }
+      }
+      .info{
+        flex: 1;
+      }
+    }
+  }
+}
+.delivery {
+  display: flex;
+  justify-content: center;
+  width: 794px;
+  padding-top: 14px;
+  border-top: 1px solid #DDDDDD;
+  margin: 11px auto;
+  font-size: 10px;
+  color: #333333;
+
+  div + div {
+    margin-left: 30px;
+  }
+}
+</style>

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

@@ -30,10 +30,10 @@
               <Option value="0">下架</Option>
             </Select>
           </FormItem> -->
-					<FormItem label="仓位搜索:" label-for="store_name">
+					<!-- <FormItem label="仓位搜索:" label-for="store_name">
 						<Input class="input-add mr14" placeholder="请输入仓位名称" v-model="tableFrom.key" />
 						<Button type="primary" @click="tableSearchs()">查询</Button>
-					</FormItem>
+					</FormItem> -->
 					<!-- <Button
             v-auth="['marketing-store_seckill-create']"
             type="primary"
@@ -92,6 +92,7 @@
 					:page-size="tableFrom.limit" />
 			</div>
 		</Card>
+		
 		<productDetail ref="productDetail"></productDetail>
 	</div>
 </template>

+ 5 - 0
src/pages/erp/purchase/addPurchase.vue

@@ -544,6 +544,11 @@
 				if(this.formValidate_2.want_order_id) {
 					getWantInfo(this.formValidate_2.want_order_id).then(res => {
 						if(res.data && res.data.id) {
+							if(res.data.status == 0) {
+								return this.$Message.error('当前要货单审核中,请审核后再试');
+							}else if(res.data.status == 3 ) {
+								return this.$Message.error('当前要货单已完成');
+							}
 							let data = res.data
 							this.formValidate_2.wid = data.wid
 							this.goodss = data.info

+ 50 - 20
src/pages/erp/purchase/index.vue

@@ -88,9 +88,11 @@
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
 			<Button v-auth="['admin-erp-add_position']" type="primary" @click="add" class="mr10">添加采购单</Button>
+			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('purchase')"
+				class="mr10">打印采购单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
-				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
+				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt" @on-selection-change="checkItem">
 				<template slot-scope="{ row, index }" slot="auser">
 					<div v-if="row.auser">{{row.auser.staff_name}}</div>
 					<div v-if="row.auth_time">{{row.auth_time |formatDate }}</div>
@@ -142,13 +144,13 @@
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="look(row)">详情</a>
-	<!-- 				<Divider type="vertical" v-if="row.status == 0" />
+					<!-- 				<Divider type="vertical" v-if="row.status == 0" />
 					<a @click="edit(row)" v-if="row.status == 0">编辑</a> -->
 					<Divider type="vertical" v-if="row.status == 0" />
 					<a @click="pass(row)" v-if="row.status == 0">审核</a>
 					<Divider type="vertical" v-if="row.status == 1" />
 					<a @click="end(row)" v-if="row.status == 1">完成</a>
-					<Divider type="vertical" v-if="row.status <1"/>
+					<Divider type="vertical" v-if="row.status <1" />
 					<a @click="del(row, '删除采购单', index)" v-if="row.status <1">删除</a>
 				</template>
 			</Table>
@@ -191,7 +193,8 @@
 			width="1090">
 			<Form ref="endobj" :model="endobj" :label-width="80" @submit.native.prevent>
 				<FormItem label="审核人:">
-					<Select v-model="endobj.purchasing_person_uid" clearable filterable @on-change="userSearchsess" class="input-add">
+					<Select v-model="endobj.purchasing_person_uid" clearable filterable @on-change="userSearchsess"
+						class="input-add">
 						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
 						</Option>
 					</Select>
@@ -211,7 +214,7 @@
 				<template slot-scope="{ row, index }" slot="tare_weight">
 					<Input v-model="list[index].tare_weight" placeholder="请输入净重" v-width="'120'" type="number" />
 				</template>
-				
+
 			</Table>
 			<div slot="footer">
 				<Button type="primary" @click="putRemark1()">提交</Button>
@@ -272,7 +275,7 @@
 			return {
 				list: [],
 				endobj: {
-					id:0,
+					id: 0,
 					purchasing_person_admin_id: "",
 					purchasing_person_uid: "",
 					loading: false,
@@ -336,7 +339,12 @@
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
-				columns1: [{
+				columns1: [
+					{
+							type: 'selection',
+							width: 60,
+							align: 'center'
+						}, {
 						title: "ID",
 						key: "id",
 						width: 80,
@@ -430,6 +438,7 @@
 					limit: 10,
 				},
 				total: 0,
+				checKList: []
 			};
 		},
 		computed: {
@@ -451,6 +460,26 @@
 			this.getGodownList()
 		},
 		methods: {
+			printing(name) {
+				if (this.checKList.length == 0) {
+					return this.$Message.error('请选择要打印的要货单')
+				}
+				let id = this.checKList.map(e => {
+					return e.id
+				})
+				let routeData = this.$router.resolve(({
+					path: this.roterPre + '/erp/printing',
+					query: {
+						type: name,
+						id: id.join(','),
+					}
+				}))
+				window.open(routeData.href, '_blank')
+
+			},
+			checkItem(e) {
+				this.checKList = e
+			},
 			end(row) {
 				// console.log(row);
 				this.endobj.id = row.id
@@ -461,8 +490,9 @@
 						obj.is_weigh = item.is_weigh
 						obj.net_weight = item.net_weight
 						obj.product_id = item.product_id;
-						obj.pur_num = item.pur_num ? item.pur_num*1: 0
-						obj.rate = item.unit_type == 1?item.p_unit_rate_1:item.unit_type == 2?item.p_unit_rate_2:1
+						obj.pur_num = item.pur_num ? item.pur_num * 1 : 0
+						obj.rate = item.unit_type == 1 ? item.p_unit_rate_1 : item.unit_type == 2 ? item
+							.p_unit_rate_2 : 1
 						obj.shelf_life = item.shelf_list
 						obj.tare_weight = item.tare_weight
 						obj.total_price = item.total_price
@@ -474,23 +504,23 @@
 						console.log(obj);
 						return obj
 					})
-					if(row.wid) {
+					if (row.wid) {
 						getUserList({
 							wid: row.wid
 						}).then(res => {
 							this.authLists = res.data.data
 						})
-					}else {
+					} else {
 						getUserList({
 							store_id: row.store_id
 						}).then(res => {
 							this.authLists = res.data.data
 						})
 					}
-					
+
 					this.modalend = true
 				})
-				
+
 			},
 			putRemark() {
 				sevePurchase(this.remarks.id, this.remarks).then(res => {
@@ -501,15 +531,15 @@
 			putRemark1() {
 				// console.log(this.list);
 				let arr = this.list.map(item => {
-					if(item.is_weigh == 0) {
+					if (item.is_weigh == 0) {
 						item.pur_weigh = item.pur_num * 1 * item.rate
-					}else {
+					} else {
 						item.pur_weigh = item.tare_weight * 1 + item.net_weight * 1
 					}
 					return item
 				})
-				console.log('arr',arr);
-				savePurchase(this.endobj.id,{
+				console.log('arr', arr);
+				savePurchase(this.endobj.id, {
 					info: arr,
 					purchasing_person_admin_id: this.endobj.purchasing_person_admin_id,
 					purchasing_person_uid: this.endobj.purchasing_person_uid,
@@ -537,9 +567,9 @@
 			},
 			cancel1() {
 				this.modalend = false
-				this.endobj.id=0
-				this.endobj.purchasing_person_admin_id= ""
-				this.endobj.purchasing_person_uid=""
+				this.endobj.id = 0
+				this.endobj.purchasing_person_admin_id = ""
+				this.endobj.purchasing_person_uid = ""
 				this.list = []
 			},
 			userSearchse(e) {

+ 1 - 1
src/pages/erp/purchase/purchaseDetail.vue

@@ -8,7 +8,7 @@
 						<Table :columns="columns" :data="info.info" ref="table" 
 							no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
 							<template slot-scope="{ row,index }" slot="price">
-								<div >{{row.price*1}}元/{{row.unit_name}}</div>
+								<div v-if="row.price">{{row.price*1}}元/{{row.unit_name}}</div>
 							</template>
 						</Table>
 					</template>

+ 16 - 10
src/pages/erp/user/index.vue

@@ -35,6 +35,12 @@
 				<template slot-scope="{ row, index }" slot="is_manager">
 					<span> {{ row.is_manager ? '是': '否'}}</span>
 				</template>
+				<template slot-scope="{ row, index }" slot="ware">
+					<span> {{row.ware && row.ware.id ? row.ware.title: ''}}</span>
+				</template>
+				<template slot-scope="{ row, index }" slot="store">
+					<span> {{row.store && row.store.id ? row.store.name: ''}}</span>
+				</template>
 				<template slot-scope="{ row, index }" slot="is_show">
 					<i-switch v-model="row.is_show" :value="row.is_show" :true-value="1" :false-value="0"
 						@on-change="onchangeIsShow(row)" size="large">
@@ -119,16 +125,16 @@
 						key: "phone",
 						minWidth: 90,
 					},
-					// {
-					// 	title: "级别",
-					// 	key: "level",
-					// 	minWidth: 80,
-					// },
-					// {
-					// 	title: "管理员id",
-					// 	key: "admin_id",
-					// 	minWidth: 80,
-					// },
+					{
+						title: "所属仓库",
+						slot: "ware",
+						minWidth: 80,
+					},
+					{
+						title: "所属门店",
+						slot: "store",
+						minWidth: 80,
+					},
 					{
 						title: "是否系统用户",
 						slot: "is_system",

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

@@ -58,9 +58,10 @@
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 操作 -->
 			<Button v-auth="['marketing-store_seckill-create']" type="primary" @click="add" class="mr10">添加要货</Button>
+			<Button v-auth="['admin-erp-printing']" type="primary" @click="printing('want')" class="mr10">打印要货单</Button>
 			<!-- 积分商品-表格 -->
 			<Table :columns="columns1" :data="tableList" :loading="loading" highlight-row no-userFrom-text="暂无数据"
-				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt">
+				no-filtered-userFrom-text="暂无筛选结果" class="ivu-mt" @on-selection-change="checkItem">
 				<template slot-scope="{ row, index }" slot="image">
 					<viewer>
 						<div class="tabBox_img">
@@ -102,7 +103,7 @@
 						<div>
 							{{item.product_name}}<a>{{item.want_product_num*1}}{{' '}}{{item.unit_name}}</a>
 						</div>
-					<!-- 	<div>
+						<!-- 	<div>
 							商品ID:{{item.product_id}}
 						</div>
 						<div>
@@ -127,7 +128,7 @@
 						</div>
 						<div>门店:{{row.store.name}}<br>ID:{{row.store.id}}</div>
 					</viewer> -->
-				
+
 				</template>
 				<template slot-scope="{ row, index }" slot="is_system">
 					<span> {{ row.is_system ? '是': '否'}}</span>
@@ -157,7 +158,7 @@
 						<Divider type="vertical" />
 						<a @click="del(row, '删除要货单', index)">删除</a>
 					</template>
-					
+
 				</template>
 			</Table>
 			<div class="acea-row row-right page">
@@ -165,22 +166,10 @@
 					:page-size="tableFrom.limit" />
 			</div>
 		</Card>
-		<Modal
-		  v-model="modalpass"
-		  scrollable
-		  title="审核"
-		  class="order_box"
-		  :closable="false"
-		  :mask-closable="false"
-		>
-		  <Form
-		    ref="remarks"
-		    :model="remarks"
-		    :label-width="80"
-		    @submit.native.prevent
-		  >
-		    <FormItem label="审核人:">
-		     <!-- <Input
+		<Modal v-model="modalpass" scrollable title="审核" class="order_box" :closable="false" :mask-closable="false">
+			<Form ref="remarks" :model="remarks" :label-width="80" @submit.native.prevent>
+				<FormItem label="审核人:">
+					<!-- <Input
 		        v-model="remarks.mark"
 		        maxlength="200"
 		        show-word-limit
@@ -188,27 +177,25 @@
 		        placeholder="请填写备注~"
 		        style="width: 100%"
 		      /> -->
-			  <Select v-model="remarks.auth_uid" clearable filterable @on-change="userSearchse"
-			  	class="input-add">
-			  	<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
-			  	</Option>
-			  </Select>
-		    </FormItem>
-			<FormItem label="状态:">
-			  <Select v-model="remarks.status" clearable filterable 
-			  	class="input-add">
-			  	<Option :value="1" >通过</Option>
-				<Option :value="-1" >拒绝</Option>
-				<!-- <Option :value="2" >部分完成</Option>
+					<Select v-model="remarks.auth_uid" clearable filterable @on-change="userSearchse" class="input-add">
+						<Option v-for="item in authLists" :value="item.id" :key="item.id">{{ item.staff_name }}
+						</Option>
+					</Select>
+				</FormItem>
+				<FormItem label="状态:">
+					<Select v-model="remarks.status" clearable filterable class="input-add">
+						<Option :value="1">通过</Option>
+						<Option :value="-1">拒绝</Option>
+						<!-- <Option :value="2" >部分完成</Option>
 				<Option :value="3" >完成</Option>
 				<Option :value="-2" >无效</Option> -->
-			  </Select>
-			</FormItem>
-		  </Form>
-		  <div slot="footer">
-		    <Button type="primary" @click="putRemark()">提交</Button>
-		    <Button @click="cancel()">取消</Button>
-		  </div>
+					</Select>
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="putRemark()">提交</Button>
+				<Button @click="cancel()">取消</Button>
+			</div>
 		</Modal>
 		<wantDetail ref="wantDetail"></wantDetail>
 	</div>
@@ -229,7 +216,8 @@
 		getUserInfo,
 		getGodownList,
 		getUserList,
-		seveWant
+		seveWant,
+		getWantInfo
 	} from "@/api/erp";
 	import {
 		staffListInfo
@@ -287,11 +275,15 @@
 					auth_uid: "",
 					auth_admin_id: "",
 				},
-				modalpass:false,
+				modalpass: false,
 				roterPre: Setting.roterPre,
 				loading: false,
 				options: timeOptions,
 				columns1: [{
+						type: 'selection',
+						width: 60,
+						align: 'center'
+					}, {
 						title: "ID",
 						key: "id",
 						width: 80,
@@ -327,7 +319,7 @@
 						minWidth: 200,
 					},
 
-					
+
 					{
 						title: "审核人信息",
 						slot: "auser",
@@ -369,17 +361,18 @@
 					// is_show: "",
 					// store_name: "",
 					// key: '',
-					create_uid:"",
-					store_id:"",
-					wid:"",
+					create_uid: "",
+					store_id: "",
+					wid: "",
 					page: 1,
 					limit: 15,
 				},
 				total: 0,
-				staffData:[],
-				data1:[],
-				authList:[],
-				authLists: []
+				staffData: [],
+				data1: [],
+				authList: [],
+				authLists: [],
+				checKList: [], //选中的列表
 			};
 		},
 		computed: {
@@ -400,23 +393,44 @@
 			this.getUserList()
 		},
 		methods: {
+			checkItem(e) {
+				this.checKList = e
+				console.log(e, 'e');
+			},
 			look(row) {
 				this.$refs.wantDetail.getInfo(row.id);
 			},
+			printing(name) {
+				if (this.checKList.length == 0) {
+					return this.$Message.error('请选择要打印的要货单')
+				}
+				let id = this.checKList.map(e => {
+					return e.id
+				})
+				let routeData = this.$router.resolve(({
+					path: this.roterPre + '/erp/printing',
+					query: {
+						type: name,
+						id: id.join(','),
+					}
+				}))
+				window.open(routeData.href, '_blank')
+			},
 			putRemark() {
-				seveWant(this.remarks.id,this.remarks).then(res => {
+				seveWant(this.remarks.id, this.remarks).then(res => {
 					this.cancel()
 					this.getList();
 				})
-				
+
 			},
 			cancel() {
 				this.remarks = {
-					id:0,
+					id: 0,
 					status: '',
 					auth_uid: "",
-					auth_admin_id: "",}
-					this.modalpass = false
+					auth_admin_id: "",
+				}
+				this.modalpass = false
 			},
 			getUserList() {
 				getUserList().then(res => {
@@ -430,7 +444,7 @@
 			},
 			userSearchse(e) {
 				let auth = this.authLists.find(item => item.id == e)
-				console.log(auth,'auth');
+				console.log(auth, 'auth');
 				this.remarks.auth_admin_id = auth.admin_id
 			},
 			getGodownList() {
@@ -520,9 +534,9 @@
 			},
 			pass(row) {
 				let qdata = {}
-				if(row.wid) {
+				if (row.wid) {
 					qdata.wid = row.wid
-				}else {
+				} else {
 					qdata.store_id = row.store_id
 				}
 				this.authLists = []
@@ -577,7 +591,7 @@
 						this.$Message.error(res.msg);
 					});
 			},
-			
+
 		},
 	};
 </script>
@@ -589,6 +603,7 @@
 		border-radius: 4px;
 		cursor: pointer;
 		margin-right: 10px;
+
 		img {
 			width: 100%;
 			height: 100%;

+ 326 - 0
src/pages/erp/want/printing.vue

@@ -0,0 +1,326 @@
+<template>
+  <!-- 支付订单 -->
+  <div class="order-bgc">
+    <div class="putSupplier" v-for="(item,index) in newArrayData" :key="index">
+      <div class="header acea-row row-between-wrapper">
+        <div class="left acea-row row-middle">
+          <div class="pictrue" :id="'qrCodeUrl'+index"></div>
+          <div class="info">
+            <div><span class="name">收货人:</span>{{item.real_name}}</div>
+            <div><span class="name">收货地址:</span>{{item.user_address}}</div>
+            <div><span class="name">手机号:</span><span>{{item.user_phone}}</span></div>
+          </div>
+        </div>
+        <div class="info">
+          <div><span class="name">订单编号:</span>{{item.order_id}}</div>
+          <div><span class="name">支付时间:</span>{{item.pay_time}}</div>
+          <div><span class="name">支付方式:</span>{{item.pay_type_name}}</div>
+        </div>
+      </div>
+      <div class="mt20">
+        <Table border :columns="columns" :data="item.goodsList" :disabled-hover="true">
+          <template slot-scope="{ row }" slot="store_name">
+            <div class="line1">{{row.store_name}}</div>
+          </template>
+          <template slot-scope="{ row }" slot="suk">
+            <div class="line1">{{row.suk}}</div>
+          </template>
+        </Table>
+      </div>
+      <div class="bottom acea-row row-between-wrapper">
+        <div class="acea-row row-middle">
+          <div class="item"><span class="name">运费:</span>{{item.freight_price}}</div>
+          <div class="item"><span class="name">优惠:</span>{{item.coupon_price}}</div>
+          <div class="item"><span class="name">会员折扣:</span>{{item.vip_true_price}}</div>
+          <div class="item"><span class="name">积分抵扣:</span>{{item.deduction_price}}</div>
+        </div>
+        <div class="pricePay">实付金额:{{item.pay_price}}</div>
+      </div>
+      <div class="bottom acea-row">
+        <div class="name">用户备注:<span class="con">{{item.mark || '-'}}</span></div>
+      </div>
+      <div class="h50">
+        <div class="delivery" v-if="site_name || refund_address || refund_phone">
+          <div v-if="site_name">店铺信息:{{ site_name }}</div>
+          <div v-if="refund_address">地址:{{ refund_address }}</div>
+          <div v-if="refund_phone">联系方式:{{ refund_phone }}</div>
+        </div>
+      </div>
+    </div>
+<!--  注意:后续要是加内容使页面撑大,记得查看下打印是否在同一张  -->
+  </div>
+</template>
+<script>
+import { distributionInfo } from '@/api/supplier'
+import { distributionOrder } from '@/api/order'
+import QRCode from 'qrcodejs2';
+import Setting from '@/setting';
+export default {
+  data (){
+    return {
+      columns:[
+        {
+          title: '商品编号',
+          key: 'index',
+          align: 'center',
+          width: 60
+        },
+        {
+          title: '商品名称',
+          slot: 'store_name',
+          align: 'center',
+          minWidth: 253
+        },
+        {
+          title: '商品规格',
+          slot: 'suk',
+          align: 'center',
+          width: 219
+        },
+        // {
+        //     title: '商品条码',
+        //     key: 'bar_code',
+        //     align: 'center',
+        //     width: 109
+        // },
+        // {
+        //     title: '商品编码',
+        //     key: 'code',
+        //     align: 'center',
+        //     width: 109
+        // },
+        {
+          title: '单价',
+          key: 'truePrice',
+          align: 'center',
+          width: 100
+        },
+        {
+          title: '数量',
+          key: 'cart_num',
+          align: 'center',
+          width: 60
+        },
+        {
+          title: '金额',
+          key: 'subtotal',
+          align: 'center',
+          width: 100
+        },
+      ],
+      data:{},
+      goods:[],
+      BaseURL: Setting.apiBaseURL.replace(/adminapi/, ""),
+      newArrayData:[],
+      site_name: '',
+      refund_phone: '',
+      refund_address: ''
+    }
+  },
+  created() {
+    this.getDistribution();
+  },
+  mounted() {
+    this.$nextTick(function () {
+      let that = this;
+      setTimeout(function () {
+        that.creatQrCode();
+      },200)
+    })
+  },
+  methods:{
+    // 生成二维码
+    creatQrCode() {
+      let url= this.BaseURL;
+      let qrcode = '';
+      this.newArrayData.forEach((item,index)=>{
+        let obj = document.getElementById('qrCodeUrl'+index);
+        qrcode = new QRCode(obj, {
+          text: url, // 需要转换为二维码的内容
+          width: 90,
+          height: 90,
+          colorDark: '#000000',
+          colorLight: '#ffffff',
+          correctLevel: QRCode.CorrectLevel.H
+        })
+      });
+
+    },
+    getDistribution(){
+      let header = this.$route.query.status == 1?distributionInfo:distributionOrder;
+      header(this.$route.query.id).then(res=>{
+        this.data = res.data;
+        this.goods = res.data.list
+        let data = res.data;
+        let newArray = [];
+        this.site_name = data.site_name;
+        this.refund_phone = data.refund_phone;
+        this.refund_address = data.refund_address;
+        data.list.forEach((i,indexi)=>{
+          let listArray = [];
+          let goods = i.list;
+          let count = Math.ceil(goods.length / 6);
+          for(let j = 0; j < count; j++){
+            let list = goods.slice(j * 6, j * 6 + 6);
+            if (list.length){
+              listArray.push(list)
+            }
+          }
+          let num = 6 - listArray[listArray.length-1].length;
+          if(num){
+            for(let z = 0; z < num; z++){
+              listArray[listArray.length-1].push({
+                cart_num:'',
+                index:'',
+                store_name:'',
+                subtotal:'',
+                suk:'',
+                truePrice:''
+              })
+            }
+          }
+          listArray.forEach((x)=>{
+            newArray.push({
+              real_name : i.real_name,
+              user_address : i.user_address,
+              user_phone : i.user_phone,
+              freight_price : i.freight_price,
+              coupon_price : i.coupon_price,
+              vip_true_price : i.vip_true_price,
+              deduction_price : i.deduction_price,
+              use_integral : i.use_integral,
+              pay_price : i.pay_price,
+              mark : i.mark,
+              order_id: i.order_id,
+              pay_time: i.pay_time,
+              pay_type_name: i.pay_type_name,
+              goodsList : x
+            });
+          })
+        })
+        this.newArrayData = newArray;
+      }).catch(err=>{
+        this.$Message.error(err.msg)
+      })
+    }
+  }
+}
+
+</script>
+<style lang="less" scoped>
+.order-bgc {
+  background-color: #fff;
+}
+/deep/.ivu-table th{
+  background-color: #fff!important;
+}
+/deep/.ivu-table-header thead tr th:nth-of-type(1){
+  padding-left:0!important;
+}
+/deep/.ivu-table-header thead tr th{
+  border-top: 1px solid #333;
+}
+/deep/.ivu-table td:nth-of-type(1){
+  padding-left:0!important;
+}
+/deep/.ivu-table-header table{
+  //border-top:0!important;
+}
+/deep/.ivu-table-border th, /deep/.ivu-table-border td{
+  border-right: 1px solid #333!important;
+}
+/deep/.ivu-table-border th:nth-of-type(1), /deep/.ivu-table-border td:nth-of-type(1){
+  border-left: 1px solid #333!important;
+}
+/deep/.ivu-table th, /deep/.ivu-table td{
+  border-bottom: 1px solid #333!important;
+  height: 47px!important;
+}
+/deep/.ivu-table-wrapper-with-border{
+  border-color: #333!important;
+  border: unset;
+  //border-bottom: 1px solid #333;
+  //border-right: 1px solid #333;
+}
+/deep/.ivu-table-border:after{
+  background-color: #333;
+  width: 0!important;
+  height: 0!important;
+}
+/deep/.ivu-table:before{
+  background-color: #333;
+  width: 0!important;
+  height: 0!important;
+}
+/deep/.ivu-table{
+  color: #000;
+}
+.pricePay{
+  font-weight: bold;
+}
+.bottom{
+  color: rgba(0, 0, 0, 0.85);
+  font-size: 12px;
+  font-weight: 400;
+  margin-top: 10px;
+  .item{
+    margin-right: 30px;
+  }
+  .name{
+    font-weight: 600;
+  }
+  .con{
+    width: 740px;
+    font-weight: unset;
+  }
+}
+.putSupplier{
+  width: 794px;
+  background-color: #fff;
+  margin: 0 auto;
+  padding-top: 10px;
+  /*padding: 20px 20px 450px 20px;*/
+  /*box-sizing: border-box;*/
+  .header{
+    .info{
+      font-size: 12px;
+      color: rgba(0, 0, 0, 0.85);
+      .name{
+        font-weight: 600;
+      }
+      div~div{
+        margin-top: 10px;
+      }
+    }
+    .left{
+      width: 500px;
+      .pictrue{
+        width: 90px;
+        height: 90px;
+        margin-right: 20px;
+        img{
+          width: 100%;
+          height: 100%;
+        }
+      }
+      .info{
+        flex: 1;
+      }
+    }
+  }
+}
+.delivery {
+  display: flex;
+  justify-content: center;
+  width: 794px;
+  padding-top: 14px;
+  border-top: 1px solid #DDDDDD;
+  margin: 11px auto;
+  font-size: 10px;
+  color: #333333;
+
+  div + div {
+    margin-left: 30px;
+  }
+}
+</style>

+ 2 - 2
src/pages/erp/want/wantDetail.vue

@@ -81,11 +81,11 @@
 								<div class="section-hd">要货门店</div>
 								<div class="section-bd" >
 									<div class="item">
-										<div>仓库ID:</div>
+										<div>门店ID:</div>
 										<div class="value">{{ info.mystore.id}}</div>
 									</div>
 									<div class="item">
-										<div>仓库名称:</div>
+										<div>门店名称:</div>
 										<div class="value">{{ info.mystore.name}}</div>
 									</div>
 									<div class="item">

+ 11 - 2
src/router/modules/erp.js

@@ -314,7 +314,7 @@ export default {
 			name: `${pre}losses`,
 			meta: {
 				auth: ['admin-erp-losses'],
-				title: '角色列表'
+				title: '报损单列表'
 			},
 			component: () => import('@/pages/erp/losses/index')
 		},
@@ -323,7 +323,7 @@ export default {
 			name: `${pre}losses_add`,
 			meta: {
 				auth: ['admin-erp-losses_add'],
-				title: '角色列表'
+				title: '添加报损单'
 			},
 			component: () => import('@/pages/erp/losses/addLosses')
 		},
@@ -345,5 +345,14 @@ export default {
 			},
 			component: () => import('@/pages/erp/low/index')
 		},
+		// {
+		// 	path: 'printing',
+		// 	name: `${pre}printing`,
+		// 	meta: {
+		// 		auth: ['admin-erp-printing'],
+		// 		title: '打印'
+		// 	},
+		// 	component: () => import('@/pages/erp/printing/index')
+		// },
 	]
 };

+ 9 - 0
src/router/routes.js

@@ -140,6 +140,15 @@ const frameIn = [
         },
         component: () => import('@/components/distribution')
     },
+	{
+	    path: `${Setting.roterPre}/erp/printing`,
+	    name: `distribution`,
+	    meta: {
+	        auth: true,
+	        title: '打印'
+	    },
+	    component: () => import('@/components/printing')
+	},
     {
         path: `${Setting.roterPre}/widget.widgets/icon.html`,
         name: `imagesIcon`,