作者 朱兆平

根据商品信息进行快速入库

@@ -3,19 +3,49 @@ @@ -3,19 +3,49 @@
3 <el-card style="background-color: #F5F7FA"> 3 <el-card style="background-color: #F5F7FA">
4 <el-row class="toolbar" style="height:auto"> 4 <el-row class="toolbar" style="height:auto">
5 <el-form :model="addForm" :rules="rules" ref="addForm" :inline="true"> 5 <el-form :model="addForm" :rules="rules" ref="addForm" :inline="true">
6 - <el-divider content-position="left"><i class="el-icon-document"></i> 商品 <el-tag>流水号: {{addForm.serialnumber}}</el-tag></el-divider> 6 + <el-divider content-position="left"><i class="el-icon-box"></i> 商品 <el-tag>流水号: {{addForm.serialnumber}}</el-tag></el-divider>
7 <el-row> 7 <el-row>
8 <el-col :span="6"> 8 <el-col :span="6">
9 - <el-form-item prop="waybill">  
10 - <el-input v-model="addForm.waybill" autocomplete="off" suffix-icon="el-icon-shopping-cart-full" clearable> 9 + <el-form-item>
  10 + <el-autocomplete
  11 + v-model="goodsInfo.gdebc"
  12 + :fetch-suggestions="goodsSearch"
  13 + @select="goodsSearchSelect"
  14 + placeholder="快速入库商品时录入的商品简码"
  15 + :trigger-on-focus="false"
  16 + value-key = "gdebc"
  17 + clearable
  18 + highlight-first-item
  19 + style="width: 100%"
  20 + >
  21 + <template slot="prepend">商品简码</template>
  22 + <template slot-scope="{ item }">
  23 + <div class="name" style="float: left">{{ item.gdebc }}</div>
  24 + <div class="addr" style="float: right">{{ item.gdsnm }}</div>
  25 + </template>
  26 + </el-autocomplete>
  27 + </el-form-item>
  28 + </el-col>
  29 + <el-col :span="6">
  30 + <el-form-item>
  31 + <el-input v-model="goodsInfo.grosswt" autocomplete="off" suffix-icon="el-icon-document" clearable>
  32 + <template slot="prepend">
  33 + 商品毛重
  34 + </template>
  35 + </el-input>
  36 + </el-form-item>
  37 + </el-col>
  38 + <el-col :span="6">
  39 + <el-form-item>
  40 + <el-input v-model="goodsInfo.newwt" autocomplete="off" suffix-icon="el-icon-document" clearable>
11 <template slot="prepend"> 41 <template slot="prepend">
12 - &emsp;商品简码 42 + 商品净重
13 </template> 43 </template>
14 </el-input> 44 </el-input>
15 </el-form-item> 45 </el-form-item>
16 </el-col> 46 </el-col>
17 </el-row> 47 </el-row>
18 - <el-divider content-position="left"><i class="el-icon-document"></i> 货物信息</el-tag></el-divider> 48 + <el-divider content-position="left"><i class="el-icon-document"></i> 货物信息 </el-divider>
19 <el-row> 49 <el-row>
20 <el-col :span="6" v-if="false"> 50 <el-col :span="6" v-if="false">
21 <el-form-item prop="serialnumber"> 51 <el-form-item prop="serialnumber">
@@ -58,7 +88,7 @@ @@ -58,7 +88,7 @@
58 <el-row> 88 <el-row>
59 <el-col :span="6"> 89 <el-col :span="6">
60 <el-form-item prop="pcs"> 90 <el-form-item prop="pcs">
61 - <el-input v-model.number="addForm.pcs" autocomplete="off" suffix-icon="el-icon-files" clearable > 91 + <el-input v-model.number="addForm.pcs" autocomplete="off" suffix-icon="el-icon-files" clearable @blur="pcsBlur">
62 <template slot="prepend"> 92 <template slot="prepend">
63 <i v-if="rules.hasOwnProperty('pcs')" style="color:red;">*</i> 入库件数 93 <i v-if="rules.hasOwnProperty('pcs')" style="color:red;">*</i> 入库件数
64 </template> 94 </template>
@@ -665,7 +695,8 @@ @@ -665,7 +695,8 @@
665 ediInventroyrecord, 695 ediInventroyrecord,
666 selectAreas, 696 selectAreas,
667 selectLocations, 697 selectLocations,
668 - getSPHCode 698 + getSPHCode,
  699 + selectGoodsManagement
669 } from '../../api/consigner/station'; 700 } from '../../api/consigner/station';
670 import dateUtil from "@/utils/index" 701 import dateUtil from "@/utils/index"
671 import jsutil from "@/common/js/util"; 702 import jsutil from "@/common/js/util";
@@ -727,11 +758,17 @@ @@ -727,11 +758,17 @@
727 // 每页大小 758 // 每页大小
728 pageSize: 10, 759 pageSize: 10,
729 }, 760 },
  761 + goodsInfo:{
  762 + gdebc:'',
  763 + grosswt:0,
  764 + newwt:0
  765 + },
730 total: 0, 766 total: 0,
731 tableData:[], 767 tableData:[],
732 areaData:[], 768 areaData:[],
733 locationData:[], 769 locationData:[],
734 roles:[], 770 roles:[],
  771 + goodsCode:'',
735 imgBase64:'', 772 imgBase64:'',
736 imgUploadPath:uploadPath, 773 imgUploadPath:uploadPath,
737 uploadFileList:[], 774 uploadFileList:[],
@@ -812,6 +849,9 @@ @@ -812,6 +849,9 @@
812 }, { 849 }, {
813 value: '销售入库', 850 value: '销售入库',
814 label: '交易类型-销售入库' 851 label: '交易类型-销售入库'
  852 + },{
  853 + value: '物流入库',
  854 + label: '交易类型-物流入库'
815 }], 855 }],
816 formLabelWidth: '5px', 856 formLabelWidth: '5px',
817 flieOptions:['报关单证','关封','运单','信封','保函','安检申报清单','随机文件','备案清单','放行通知书','货物运输条件鉴定书(磁化/化工品)','其他'], 857 flieOptions:['报关单证','关封','运单','信封','保函','安检申报清单','随机文件','备案清单','放行通知书','货物运输条件鉴定书(磁化/化工品)','其他'],
@@ -1120,6 +1160,38 @@ @@ -1120,6 +1160,38 @@
1120 } 1160 }
1121 }; 1161 };
1122 }, 1162 },
  1163 + goodsSearch(queryString, cb){
  1164 + let _this=this
  1165 + let para = {
  1166 + gdebc:queryString,
  1167 + pageNum: 1,
  1168 + pageSize: 10,
  1169 + }
  1170 + let goodsInfo = [];
  1171 + selectGoodsManagement(para).then((response) => {
  1172 + const res = response.data
  1173 + if (res.code !== '200') {
  1174 + return _this.$message.error('获取商品信息,失败!')
  1175 + }
  1176 + // 获取列表数据
  1177 + goodsInfo = res.data.list
  1178 + _this.$message.success('获取消息收发记录,成功!')
  1179 + cb(goodsInfo);
  1180 + }).catch(error => {
  1181 + _this.$message.error(error.toString())
  1182 + })
  1183 + },
  1184 + goodsSearchSelect(item){
  1185 + this.addForm.waybill = item.gdecd
  1186 + this.goodsInfo.grosswt = item.grosswt
  1187 + this.goodsInfo.newwt = item.newwt
  1188 + },
  1189 + pcsBlur(e){
  1190 + const inputPcs = e.target.value;
  1191 + if (inputPcs && inputPcs>0 && this.goodsInfo.grosswt && this.goodsInfo.grosswt>0){
  1192 + this.addForm.billweight = (Number.parseFloat(inputPcs)*Number.parseFloat(this.goodsInfo.grosswt)).toFixed(2)
  1193 + }
  1194 + },
1123 screenshot(){ 1195 screenshot(){
1124 let video = document.getElementById('videos') 1196 let video = document.getElementById('videos')
1125 html2canvas(video, { 1197 html2canvas(video, {