作者 朱兆平

条形码

@@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
37 "vue": "^2.5.2", 37 "vue": "^2.5.2",
38 "vue-count-to": "^1.0.13", 38 "vue-count-to": "^1.0.13",
39 "vue-i18n": "^8.14.0", 39 "vue-i18n": "^8.14.0",
  40 + "vue-print-nb": "^1.7.5",
40 "vue-quill-editor": "^3.0.6", 41 "vue-quill-editor": "^3.0.6",
41 "vue-router": "^2.3.0", 42 "vue-router": "^2.3.0",
42 "vuex": "^3.6.2", 43 "vuex": "^3.6.2",
  1 +<template>
  2 + <div>
  3 + <el-button type='primary' @click='printClick'>打印</el-button>
  4 + <!-- 打印 start -->
  5 + <div style="display: none;">
  6 + <el-button id="trueBtn" v-print="printObj" type="info" size="mini" icon="el-icon-printer">打印</el-button>
  7 + <!-- <div style="display: none"> -->
  8 + <div v-if="printFlag" id="printId" style="width: 100%;">
  9 + <!-- 打印 (打印元素有边距时,会打印出2张纸;使用svg或img)start-->
  10 + <div class="print-box" style='margin-bottom: 50px;'>
  11 + <div class="flex align-center border-bottom">
  12 + <div class="title">单证号</div>
  13 + <div class="flex-1 center">
  14 + <span>{{wmsInfo.waybill}}</span><span v-if="wmsInfo.billfhl">_{{wmsInfo.billfhl}}</span>
  15 + </div>
  16 + </div>
  17 + <div class="flex align-center border-bottom">
  18 + <div class="title">件数</div>
  19 + <div class="flex-1 center">{{wmsInfo.pcs}}</div>
  20 + </div>
  21 + <div class="flex align-center border-bottom">
  22 + <div class="title">重量</div>
  23 + <div class="flex-1 center">{{wmsInfo.billweight}}</div>
  24 + </div>
  25 + <div class="flex align-center border-bottom">
  26 + <div class="title">计费重量</div>
  27 + <div class="flex-1 center">{{wmsInfo.feeweight}}</div>
  28 + </div>
  29 + <div class="flex justify-center py-1">
  30 + <barcode
  31 + :value="wmsInfo.serialnumber"
  32 + :options="barcodeOptions1"
  33 + >
  34 + 条形码显示失败时的内容
  35 + </barcode>
  36 + </div>
  37 + </div>
  38 + <!-- 打印单个 end -->
  39 + <!-- 打印多个,一张纸一个 start-->
  40 +<!-- <div class="print-box" style='margin-bottom: 50px;page-break-after: always' v-for="(item, index) in selection" :key="index">-->
  41 +<!-- <div class="flex align-center border-bottom">-->
  42 +<!-- <div class="title">模具编码</div>-->
  43 +<!-- <div class="flex-1 center">{{item.moldCode}}</div>-->
  44 +<!-- </div>-->
  45 +<!-- <div class="flex align-center border-bottom">-->
  46 +<!-- <div class="title">规格</div>-->
  47 +<!-- <div class="flex-1 center">{{item.moldSpec}}</div>-->
  48 +<!-- </div>-->
  49 +<!-- <div class="flex justify-center py-1">-->
  50 +<!-- <img :id="'barcodeId' + index" class="img-print"></img>-->
  51 +<!-- <VueBarcode-->
  52 +<!-- value="172-12345678"-->
  53 +<!-- :options="{ widht:100,height:50,background:'rgba(255,255,255,.0)'}"-->
  54 +<!-- >-->
  55 +<!-- 条形码显示失败时的内容-->
  56 +<!-- </VueBarcode>-->
  57 +<!-- </div>-->
  58 +<!-- </div>-->
  59 + <!-- 打印多个 end -->
  60 + </div>
  61 + <!-- </div> -->
  62 + </div>
  63 + <!-- 打印 end -->
  64 + </div>
  65 +</template>
  66 +
  67 +<script>
  68 + import jsutil from "@/common/js/util";
  69 + export default {
  70 + components: {
  71 + },
  72 + props:['wmsInfo'],
  73 + data() {
  74 + return {
  75 + printFlag: false,
  76 + printObj: {
  77 + id: "printId",
  78 + popTitle: "打印条形码", //页眉,不传文字默认显示项目名
  79 + extraCss: "https://www.google.com,https://www.google.com",
  80 + extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>,<style>html{ margin:0},body:{margin:0} <style>',
  81 + },
  82 + barcodeOptions: {
  83 + format: "CODE39",
  84 + height: 60,
  85 + displayValue: true,
  86 + // text: barCode,
  87 + font: "fantasy",
  88 + textAlign: "center",
  89 + textPosition: "bottom",
  90 + textMargin: 10,
  91 + fontSize: 14,
  92 + // width:100,
  93 + // background: "#eee",
  94 + lineColor: "#333333",
  95 + margin: 20
  96 + },
  97 + barcodeOptions1:{
  98 + widht:100,
  99 + height:50,
  100 + background:'rgba(255,255,255,.0)',
  101 + margin: 20
  102 + },
  103 + wmsData:{},
  104 + // 条形码长度是6位数
  105 + selection:[
  106 + {
  107 + moldCode:'000001',
  108 + moldSpec:'56*22'
  109 + },
  110 + {
  111 + moldCode:'000002',
  112 + moldSpec:'26*20'
  113 + },
  114 + {
  115 + moldCode:'000003',
  116 + moldSpec:'56*22'
  117 + },
  118 + {
  119 + moldCode:'000004',
  120 + moldSpec:'26*20'
  121 + },
  122 + {
  123 + moldCode:'000005',
  124 + moldSpec:'56*22'
  125 + },
  126 + {
  127 + moldCode:'000006',
  128 + moldSpec:'26*20'
  129 + },
  130 + ]
  131 +
  132 + }
  133 + },
  134 + mounted() {
  135 + let itemAttr = "{\"材质\":\"3\",\"厚\":\"4\",\"宽\":\"56\",\"长\":\"1\"}";
  136 + let data = JSON.parse(itemAttr)
  137 + let list1 = Object.entries(data)
  138 + // console.log(2, list1)
  139 + let list = [];
  140 + for (let key in data) {
  141 + list.push({
  142 + name: key,
  143 + value: data[key]
  144 + })
  145 + }
  146 + // console.log(1, list)
  147 +
  148 + },
  149 + methods: {
  150 + printClick() {
  151 + this.printFlag = true;
  152 + //多个
  153 + // this.$nextTick(() => {
  154 + // this.selection.forEach((v,index)=>{
  155 + // let options = {
  156 + // format: 'CODE39',
  157 + // height: 30,
  158 + // displayValue:true,
  159 + // text:v.moldCode,
  160 + // font:"fantasy",
  161 + // textAlign:"center",
  162 + // textPosition:"bottom",
  163 + // textMargin:2,
  164 + // fontSize:12,
  165 + // background:"#eee",
  166 + // lineColor:"#333333",
  167 + // // margin:20
  168 + // }
  169 + // // JsBarcode('#barcodeId' + index, v.moldCode,options)
  170 + // })
  171 + // })
  172 + // 单个
  173 + let barCode = this.selection[0].moldCode;
  174 + let options = {
  175 + format: "CODE39",
  176 + height: 60,
  177 + displayValue: true,
  178 + text: barCode,
  179 + font: "fantasy",
  180 + textAlign: "center",
  181 + textPosition: "bottom",
  182 + textMargin: 10,
  183 + fontSize: 14,
  184 + background: "#eee",
  185 + lineColor: "#333333",
  186 + margin: 20
  187 + }
  188 + this.$nextTick(() => {
  189 + // JsBarcode("#barcodeId", barCode, options);
  190 + });
  191 + setTimeout(() => {
  192 + document.getElementById("trueBtn").click();
  193 + this.printFlag = false;
  194 + }, 1000);
  195 + },
  196 + },
  197 + watch: {
  198 + wmsInfo(value) {
  199 + if (jsutil.checkNull(value)){
  200 + this.wmsData = value;
  201 + }
  202 + console.log("仓库数据已传递:"+value)
  203 + }
  204 + }
  205 + }
  206 +</script>
  207 +<style media="print">
  208 + @page {
  209 + size: auto;
  210 + margin: 0;
  211 + padding: 0;
  212 + }
  213 + html {
  214 + /* margin: 0; */
  215 + }
  216 + #printId {
  217 + margin: 0;
  218 + padding: 0;
  219 + height: 98%;
  220 + }
  221 + body {
  222 + /* margin: 0; */
  223 + }
  224 +</style>
  225 +<style scoped>
  226 + /* 大小可根据打印纸调整 */
  227 + .flex{
  228 + display: flex;
  229 + }
  230 + .align-center{
  231 + align-items: center;
  232 + }
  233 + .justify-center{
  234 + justify-content: center;
  235 + }
  236 + .center{
  237 + text-align: center;
  238 + }
  239 + .flex-1{
  240 + flex: 1;
  241 + }
  242 + .py-1{
  243 + /* padding: 4px 0; */
  244 + }
  245 + .print-box {
  246 + margin: 0 !important;
  247 + padding: 0 !important;
  248 + width: 330px;
  249 + border: 1px solid black;
  250 + font-size: 12px;
  251 + transform: scale(0.7);
  252 + }
  253 + .img-print{
  254 + transform: scale(0.8);
  255 + }
  256 + .title {
  257 + width: 90px;
  258 + height: 20px;
  259 + font-size: 12px;
  260 + line-height: 20px;
  261 + text-align: center;
  262 + border-right: 1px solid black;
  263 + }
  264 +
  265 + .border-bottom {
  266 + border-bottom: 1px solid black;
  267 + }
  268 +</style>
@@ -15,8 +15,7 @@ import 'font-awesome/css/font-awesome.min.css' @@ -15,8 +15,7 @@ import 'font-awesome/css/font-awesome.min.css'
15 import * as socketApi from './api/socket' 15 import * as socketApi from './api/socket'
16 import '@/styles/index.scss' 16 import '@/styles/index.scss'
17 import sys_init from '@/common/init/sys_init' 17 import sys_init from '@/common/init/sys_init'
18 -  
19 - 18 +import Print from 'vue-print-nb'
20 // 条形组件 19 // 条形组件
21 import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件 20 import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件
22 Vue.component('barcode', VueBarcode); 21 Vue.component('barcode', VueBarcode);
@@ -42,6 +41,7 @@ Vue.use(ElementUI, @@ -42,6 +41,7 @@ Vue.use(ElementUI,
42 // 注册组件库 41 // 注册组件库
43 Vue.use(VueRouter) 42 Vue.use(VueRouter)
44 Vue.use(Vuex) 43 Vue.use(Vuex)
  44 +Vue.use(Print)
45 Vue.prototype.$axios = axios; 45 Vue.prototype.$axios = axios;
46 46
47 //NProgress.configure({ showSpinner: false }); 47 //NProgress.configure({ showSpinner: false });
@@ -566,8 +566,8 @@ @@ -566,8 +566,8 @@
566 566
567 watch: { 567 watch: {
568 parentHouseId(value) { 568 parentHouseId(value) {
569 - if (jsutil.checkNull(this.parentHouseId)){  
570 - this.queryInfo.houseid = this.parentHouseId; 569 + if (jsutil.checkNull(value)){
  570 + this.queryInfo.houseid = value;
571 } 571 }
572 this.getList(); 572 this.getList();
573 } 573 }
@@ -109,6 +109,20 @@ @@ -109,6 +109,20 @@
109 </el-input> 109 </el-input>
110 </el-form-item> 110 </el-form-item>
111 </el-col> 111 </el-col>
  112 + <el-col :span="6">
  113 + <el-form-item label=" " :label-width="formLabelWidth" prop="remark1">
  114 + <div class="my-text-area">
  115 + <div class="el-input-group__prepend prepand">备&emsp;&emsp;注</div>
  116 + <el-input v-model="addForm.remark1"
  117 + type="textarea"
  118 + autosize
  119 + placeholder="备注信息"
  120 + style="float: left;width:calc(100% - 89px)"
  121 + >
  122 + </el-input>
  123 + </div>
  124 + </el-form-item>
  125 + </el-col>
112 </el-row> 126 </el-row>
113 <el-divider content-position="left"><i class="el-icon-house"></i> 入库相关</el-divider> 127 <el-divider content-position="left"><i class="el-icon-house"></i> 入库相关</el-divider>
114 <el-row> 128 <el-row>
@@ -166,7 +180,7 @@ @@ -166,7 +180,7 @@
166 :fetch-suggestions="crmQuerySearch" 180 :fetch-suggestions="crmQuerySearch"
167 placeholder="请输入客户代码" 181 placeholder="请输入客户代码"
168 :trigger-on-focus="false" 182 :trigger-on-focus="false"
169 - value-key = "roleName" 183 + value-key = "departmentid"
170 clearable 184 clearable
171 highlight-first-item 185 highlight-first-item
172 style="width: 100%" 186 style="width: 100%"
@@ -267,18 +281,19 @@ @@ -267,18 +281,19 @@
267 <!-- </el-row>--> 281 <!-- </el-row>-->
268 <el-divider content-position="left"><i class="el-icon-picture-outline"></i>图像操作</el-divider> 282 <el-divider content-position="left"><i class="el-icon-picture-outline"></i>图像操作</el-divider>
269 <el-row> 283 <el-row>
270 - <el-col :span="6"> 284 + <el-col :span="12">
271 <el-form-item label=" " :label-width="formLabelWidth" prop="annex"> 285 <el-form-item label=" " :label-width="formLabelWidth" prop="annex">
272 <el-input v-model="addForm.annex" autocomplete="off" suffix-icon="el-icon-document" clearable> 286 <el-input v-model="addForm.annex" autocomplete="off" suffix-icon="el-icon-document" clearable>
273 <template slot="prepend">图片地址</template> 287 <template slot="prepend">图片地址</template>
274 </el-input> 288 </el-input>
  289 +
275 </el-form-item> 290 </el-form-item>
276 </el-col> 291 </el-col>
277 - <el-col :span="6">  
278 - <el-button type="success" icon="el-icon-edit" @click="imgdrawerVisible = true">入库图像</el-button>  
279 - </el-col>  
280 - <el-col :span="6"> 292 + <el-col :span="12">
  293 + <el-button-group style="float:right">
  294 + <el-button type="success" icon="el-icon-camera" @click="imgdrawerVisible = true">入库图像采集</el-button>
281 <el-button type="warning" icon="el-icon-edit" @click="otherDrawerVisible = true">其他入库信息</el-button> 295 <el-button type="warning" icon="el-icon-edit" @click="otherDrawerVisible = true">其他入库信息</el-button>
  296 + </el-button-group>
282 </el-col> 297 </el-col>
283 298
284 <!-- <el-col :span="8">--> 299 <!-- <el-col :span="8">-->
@@ -312,31 +327,12 @@ @@ -312,31 +327,12 @@
312 </el-col> 327 </el-col>
313 </el-row>--> 328 </el-row>-->
314 </el-form> 329 </el-form>
315 - <div slot="footer" class="dialog-footer">  
316 - <el-button @click="apply_dialog.addDialog = false" >取 消</el-button>  
317 - <el-button type="primary" @click="dialogApply==='create'?add():edit()" >提 交</el-button>  
318 - </div>  
319 </el-row> 330 </el-row>
320 <!-- 搜索区域--> 331 <!-- 搜索区域-->
321 - <el-row :gutter="10" class="toolbar">  
322 - <el-col :span="5.5">  
323 - <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search"  
324 - placeholder="货物单号" clearable>  
325 - <template slot="prepend">货物单号</template>  
326 - </el-input>  
327 - </el-col>  
328 - <el-col :span="5.5" :offset="1">  
329 - <el-input v-model="queryInfo.serialnumber" prefix-icon="el-icon-search"  
330 - placeholder="流水" clearable>  
331 - <template slot="prepend">流&emsp;&emsp;水</template>  
332 - </el-input>  
333 - </el-col>  
334 - <el-col :span="8">  
335 - <el-button type="primary" icon="el-icon-search" @click="getList()">  
336 - 查询  
337 - </el-button>  
338 - <el-button type="success" icon="el-icon-edit" @click="applyAdd()">直接入库</el-button>  
339 - <el-button type="success" icon="el-icon-edit" @click="batchAdd()">批量入库</el-button> 332 + <el-row class="toolbar">
  333 + <el-col :span="24">
  334 + <el-button type="success" icon="el-icon-download" @click="batchAdd()">批量入库</el-button>
  335 + <el-button type="primary" icon="el-icon-right" @click="nextBill()" style="float:right">下一票</el-button>
340 </el-col> 336 </el-col>
341 </el-row> 337 </el-row>
342 <!-- 列表区域--> 338 <!-- 列表区域-->
@@ -384,12 +380,12 @@ @@ -384,12 +380,12 @@
384 <el-table-column 380 <el-table-column
385 prop="pcs" 381 prop="pcs"
386 label="入库件数" 382 label="入库件数"
387 - width="60"> 383 + width="70">
388 </el-table-column> 384 </el-table-column>
389 <el-table-column 385 <el-table-column
390 prop="billweight" 386 prop="billweight"
391 label="入库重量" 387 label="入库重量"
392 - width="60"> 388 + width="70">
393 </el-table-column> 389 </el-table-column>
394 <el-table-column 390 <el-table-column
395 prop="feeweight" 391 prop="feeweight"
@@ -404,7 +400,7 @@ @@ -404,7 +400,7 @@
404 <el-table-column 400 <el-table-column
405 prop="goodsvol" 401 prop="goodsvol"
406 label="入库体积" 402 label="入库体积"
407 - width="60"> 403 + width="100">
408 </el-table-column> 404 </el-table-column>
409 <!-- <el-table-column--> 405 <!-- <el-table-column-->
410 <!-- prop="area"--> 406 <!-- prop="area"-->
@@ -488,24 +484,32 @@ @@ -488,24 +484,32 @@
488 fixed="right" 484 fixed="right"
489 label="操作" 485 label="操作"
490 width="160"> 486 width="160">
  487 + <template slot="header" slot-scope="scope">
  488 + <el-button type="success" icon="el-icon-check" @click="applyAdd()">入&emsp;&emsp;库</el-button>
  489 + </template>
491 <template slot-scope="scope"> 490 <template slot-scope="scope">
  491 + <el-row>
  492 + <Print :wmsInfo = "scope.row"></Print>
  493 + </el-row>
  494 + <el-row>
492 <el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button> 495 <el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>
493 - <el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">删除</el-button> 496 + <el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">移除</el-button>
  497 + </el-row>
494 </template> 498 </template>
495 </el-table-column> 499 </el-table-column>
496 </el-table> 500 </el-table>
497 </el-row> 501 </el-row>
498 - <el-row style="margin-top: 10px" class="toolbar">  
499 - <el-pagination  
500 - @size-change="handleSizeChange"  
501 - @current-change="handleCurrentChange"  
502 - :current-page="queryInfo.pageNum"  
503 - :page-size="queryInfo.pageSize"  
504 - :page-sizes="[10, 50, 100, 500]"  
505 - layout="total, sizes, prev, pager, next, jumper"  
506 - :total="total">  
507 - </el-pagination>  
508 - </el-row> 502 +<!-- <el-row style="margin-top: 10px" class="toolbar">-->
  503 +<!-- <el-pagination-->
  504 +<!-- @size-change="handleSizeChange"-->
  505 +<!-- @current-change="handleCurrentChange"-->
  506 +<!-- :current-page="queryInfo.pageNum"-->
  507 +<!-- :page-size="queryInfo.pageSize"-->
  508 +<!-- :page-sizes="[10, 50, 100, 500]"-->
  509 +<!-- layout="total, sizes, prev, pager, next, jumper"-->
  510 +<!-- :total="total">-->
  511 +<!-- </el-pagination>-->
  512 +<!-- </el-row>-->
509 </el-card> 513 </el-card>
510 <el-drawer 514 <el-drawer
511 title="我是标题" 515 title="我是标题"
@@ -646,10 +650,12 @@ @@ -646,10 +650,12 @@
646 import packge from '@/api/nmms/packge' 650 import packge from '@/api/nmms/packge'
647 import unusualOP from '@/api/wms/unusualOptions' 651 import unusualOP from '@/api/wms/unusualOptions'
648 import damageOP from '@/api/wms/damageOptions' 652 import damageOP from '@/api/wms/damageOptions'
  653 + import Print from '@/components/Print'
649 654
650 655
651 export default { 656 export default {
652 name: "inventroyrecord", 657 name: "inventroyrecord",
  658 + components:{Print},
653 data() { 659 data() {
654 var checkInputArea = (rule, value, callback) => { 660 var checkInputArea = (rule, value, callback) => {
655 let err = { 661 let err = {
@@ -720,7 +726,7 @@ @@ -720,7 +726,7 @@
720 otherDrawerVisible: false, 726 otherDrawerVisible: false,
721 addForm: { 727 addForm: {
722 area: '', 728 area: '',
723 - feeweight: '', 729 + feeweight: 0,
724 custel: '', 730 custel: '',
725 customer: '', 731 customer: '',
726 custcode: '', 732 custcode: '',
@@ -730,7 +736,7 @@ @@ -730,7 +736,7 @@
730 location:'', 736 location:'',
731 opter:'', 737 opter:'',
732 opttime: '', 738 opttime: '',
733 - pcs: '', 739 + pcs: 0,
734 totalpcs:0, 740 totalpcs:0,
735 serialnumber: '', 741 serialnumber: '',
736 station: '', 742 station: '',
@@ -841,7 +847,6 @@ @@ -841,7 +847,6 @@
841 const _this = this 847 const _this = this
842 selectInventroyrecords(this.queryInfo).then((response) => { 848 selectInventroyrecords(this.queryInfo).then((response) => {
843 const res = response.data 849 const res = response.data
844 - console.log(response.data)  
845 if (res.code !== '200') { 850 if (res.code !== '200') {
846 return _this.$message.error('获取消息收发记录,失败!') 851 return _this.$message.error('获取消息收发记录,失败!')
847 } 852 }
@@ -868,6 +873,7 @@ @@ -868,6 +873,7 @@
868 } 873 }
869 // 添加,成功 874 // 添加,成功
870 this.$message.success(res.msg); 875 this.$message.success(res.msg);
  876 + this.tableData = [];
871 }).catch(error => { 877 }).catch(error => {
872 this.$message.error(error.toString()); 878 this.$message.error(error.toString());
873 }).finally(()=>{ 879 }).finally(()=>{
@@ -879,9 +885,9 @@ @@ -879,9 +885,9 @@
879 // 未通过,表单预校验 885 // 未通过,表单预校验
880 if (!valid) return; 886 if (!valid) return;
881 const wmslog = Object.assign({},this.addForm) 887 const wmslog = Object.assign({},this.addForm)
  888 + wmslog.opttime = new Date().format('yyyy-MM-dd hh:mm:ss')
882 this.tableData.push(wmslog) 889 this.tableData.push(wmslog)
883 this.addForm.serialnumber = this.serialNumber() 890 this.addForm.serialnumber = this.serialNumber()
884 - console.log(JSON.stringify(wmslog))  
885 }) 891 })
886 }, 892 },
887 // 添加功能 893 // 添加功能
@@ -1226,6 +1232,12 @@ @@ -1226,6 +1232,12 @@
1226 this.$message.error("合并体积录入数据出错") 1232 this.$message.error("合并体积录入数据出错")
1227 } 1233 }
1228 }, 1234 },
  1235 + nextBill(){
  1236 + this.$refs.addForm.resetFields()
  1237 + this.initUserInfo()
  1238 + this.tableData = []
  1239 +
  1240 + },
1229 getSummaries(param) { 1241 getSummaries(param) {
1230 const { columns, data } = param; 1242 const { columns, data } = param;
1231 const sums = []; 1243 const sums = [];
@@ -1245,7 +1257,8 @@ @@ -1245,7 +1257,8 @@
1245 sums[index] = values.reduce((prev, curr) => { 1257 sums[index] = values.reduce((prev, curr) => {
1246 const value = Number(curr); 1258 const value = Number(curr);
1247 if (!isNaN(value)) { 1259 if (!isNaN(value)) {
1248 - return prev + curr; 1260 + const r = Number(prev) + Number(curr)
  1261 + return new Number(r).toFixed(2);
1249 } else { 1262 } else {
1250 return prev; 1263 return prev;
1251 } 1264 }
@@ -1257,21 +1270,65 @@ @@ -1257,21 +1270,65 @@
1257 }); 1270 });
1258 1271
1259 return sums; 1272 return sums;
1260 - }  
1261 }, 1273 },
1262 - mounted() {  
1263 - this.getAreaList();  
1264 - this.getLocationList();  
1265 - this.getRoles();  
1266 - this.getSPHCode()  
1267 - this.addForm.serialnumber = this.serialNumber() 1274 + initUserInfo(){
1268 let userinfo = loginedUserInfo(); 1275 let userinfo = loginedUserInfo();
1269 if (!jsutil.checkNull(userinfo) && !jsutil.checkNull(userinfo.username)){ 1276 if (!jsutil.checkNull(userinfo) && !jsutil.checkNull(userinfo.username)){
1270 this.$message.error("获取用户信息出错") 1277 this.$message.error("获取用户信息出错")
1271 }else{ 1278 }else{
1272 this.addForm.opter = userinfo.username 1279 this.addForm.opter = userinfo.username
1273 } 1280 }
  1281 + }
  1282 + },
  1283 + mounted() {
  1284 + this.addForm = {
  1285 + area: '',
  1286 + feeweight: 22.68,
  1287 + custel: '',
  1288 + customer: '',
  1289 + custcode: 'APX',
  1290 + goodstype: '运单',
  1291 + house:'',
  1292 + ietype:'I',
  1293 + location:'hx001',
  1294 + opter:'wuliu',
  1295 + opttime: '',
  1296 + pcs: 17,
  1297 + totalpcs:113,
  1298 + serialnumber: '',
  1299 + station: '',
  1300 + status: '',
  1301 + licenseplate: '豫A61CR7',
  1302 + transtype:'销售入库',
  1303 + goodssize:'120x230x78x17',
  1304 + goodsvol:36.60,
  1305 + waybill:'172-12345678',
  1306 + billfhl:'FILE788',
  1307 + //随货文件
  1308 + hasFiles:false,
  1309 + hasUnusual:false,
  1310 + unusuals:[],
  1311 + files:[],
  1312 + damages:[],
  1313 + sphCodes:[],
  1314 + billweight:12.34,
  1315 + totalweight:2573,
  1316 + packingid:'PK',
  1317 + remark:'',
  1318 + remark1:'备注',
  1319 + remark2:'',
  1320 + remark3:'',
  1321 + remark4:'',
  1322 + remark5:'',
  1323 + annex:''
  1324 + }
1274 1325
  1326 + this.getAreaList();
  1327 + this.getLocationList();
  1328 + this.getRoles();
  1329 + this.getSPHCode()
  1330 + this.addForm.serialnumber = this.serialNumber()
  1331 + this.initUserInfo()
1275 }, 1332 },
1276 computed: { 1333 computed: {
1277 }, 1334 },