正在显示
1 个修改的文件
包含
98 行增加
和
39 行删除
| @@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
| 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-divider> | 6 | + <el-divider content-position="left"><i class="el-icon-document"></i> 货物信息 <el-tag type="info">流水号: {{addForm.serialnumber}}</el-tag></el-divider> |
| 7 | <el-row> | 7 | <el-row> |
| 8 | - <el-col :span="6"> | 8 | + <el-col :span="6" v-if="false"> |
| 9 | <el-form-item label=" " :label-width="formLabelWidth" prop="serialnumber"> | 9 | <el-form-item label=" " :label-width="formLabelWidth" prop="serialnumber"> |
| 10 | <el-input v-model="addForm.serialnumber" autocomplete="off" suffix-icon="el-icon-files" disabled> | 10 | <el-input v-model="addForm.serialnumber" autocomplete="off" suffix-icon="el-icon-files" disabled> |
| 11 | <template slot="prepend">流  水</template> | 11 | <template slot="prepend">流  水</template> |
| @@ -29,14 +29,30 @@ | @@ -29,14 +29,30 @@ | ||
| 29 | <el-col :span="6"> | 29 | <el-col :span="6"> |
| 30 | <el-form-item label=" " :label-width="formLabelWidth" prop="pcs"> | 30 | <el-form-item label=" " :label-width="formLabelWidth" prop="pcs"> |
| 31 | <el-input v-model.number="addForm.pcs" autocomplete="off" suffix-icon="el-icon-files" clearable > | 31 | <el-input v-model.number="addForm.pcs" autocomplete="off" suffix-icon="el-icon-files" clearable > |
| 32 | - <template slot="prepend">件  数</template> | 32 | + <template slot="prepend">总 件 数</template> |
| 33 | </el-input> | 33 | </el-input> |
| 34 | </el-form-item> | 34 | </el-form-item> |
| 35 | </el-col> | 35 | </el-col> |
| 36 | <el-col :span="6"> | 36 | <el-col :span="6"> |
| 37 | <el-form-item label=" " :label-width="formLabelWidth" prop="weight"> | 37 | <el-form-item label=" " :label-width="formLabelWidth" prop="weight"> |
| 38 | <el-input v-model="addForm.weight" autocomplete="off" suffix-icon="el-icon-files" clearable> | 38 | <el-input v-model="addForm.weight" autocomplete="off" suffix-icon="el-icon-files" clearable> |
| 39 | - <template slot="prepend">重  量</template> | 39 | + <template slot="prepend">总 重 量</template> |
| 40 | + </el-input> | ||
| 41 | + </el-form-item> | ||
| 42 | + </el-col> | ||
| 43 | + </el-row> | ||
| 44 | + <el-row> | ||
| 45 | + <el-col :span="6"> | ||
| 46 | + <el-form-item label=" " :label-width="formLabelWidth" prop="pcs"> | ||
| 47 | + <el-input v-model.number="addForm.pcs" autocomplete="off" suffix-icon="el-icon-files" clearable > | ||
| 48 | + <template slot="prepend">入库件数</template> | ||
| 49 | + </el-input> | ||
| 50 | + </el-form-item> | ||
| 51 | + </el-col> | ||
| 52 | + <el-col :span="6"> | ||
| 53 | + <el-form-item label=" " :label-width="formLabelWidth" prop="weight"> | ||
| 54 | + <el-input v-model="addForm.weight" autocomplete="off" suffix-icon="el-icon-files" clearable> | ||
| 55 | + <template slot="prepend">入库重量</template> | ||
| 40 | </el-input> | 56 | </el-input> |
| 41 | </el-form-item> | 57 | </el-form-item> |
| 42 | </el-col> | 58 | </el-col> |
| @@ -68,43 +84,54 @@ | @@ -68,43 +84,54 @@ | ||
| 68 | </div> | 84 | </div> |
| 69 | </el-form-item> | 85 | </el-form-item> |
| 70 | </el-col> | 86 | </el-col> |
| 87 | + </el-row> | ||
| 88 | + <el-row> | ||
| 71 | <el-col :span="6"> | 89 | <el-col :span="6"> |
| 72 | <el-form-item label=" " :label-width="formLabelWidth" prop="vol"> | 90 | <el-form-item label=" " :label-width="formLabelWidth" prop="vol"> |
| 73 | - <div class="my-text-area"> | ||
| 74 | - <div class="el-input-group__prepend prepand">体  积</div> | ||
| 75 | - <el-input v-model="addForm.vol" | ||
| 76 | - type="textarea" | ||
| 77 | - autosize | ||
| 78 | - placeholder="请输入体积" | ||
| 79 | - style="float: left;width:calc(100% - 89px)" | ||
| 80 | - > | ||
| 81 | - </el-input> | ||
| 82 | - </div> | 91 | + <el-tooltip class="item" effect="dark" content="单位:厘米,每行录入一个体积信息格式如:1x2x3x4(长x宽x高x件数),回车换行" placement="right"> |
| 92 | + <div class="my-text-area"> | ||
| 93 | + <div class="el-input-group__prepend prepand">体  积</div> | ||
| 94 | + <el-input v-model="addForm.vol" | ||
| 95 | + type="textarea" | ||
| 96 | + autosize | ||
| 97 | + placeholder="请输入体积" | ||
| 98 | + style="float: left;width:calc(100% - 89px)" | ||
| 99 | + > | ||
| 100 | + </el-input> | ||
| 101 | + </div> | ||
| 102 | + </el-tooltip> | ||
| 83 | </el-form-item> | 103 | </el-form-item> |
| 84 | </el-col> | 104 | </el-col> |
| 85 | - </el-row> | ||
| 86 | - <el-divider content-position="left"><i class="el-icon-house"></i> 入库相关</el-divider> | ||
| 87 | - <el-row> | ||
| 88 | <el-col :span="6"> | 105 | <el-col :span="6"> |
| 89 | - <el-form-item label=" " :label-width="formLabelWidth" prop="area"> | ||
| 90 | - <el-autocomplete | ||
| 91 | - v-model="addForm.area" | ||
| 92 | - :fetch-suggestions="areaQuerySearch" | ||
| 93 | - placeholder="请输入库区编号" | ||
| 94 | - :trigger-on-focus="false" | ||
| 95 | - value-key = "areano" | ||
| 96 | - clearable | ||
| 97 | - highlight-first-item | ||
| 98 | - style="width: 100%" | ||
| 99 | - > | ||
| 100 | - <template slot="prepend">库  区</template> | ||
| 101 | - <template slot-scope="{ item }"> | ||
| 102 | - <div class="name" style="float: left">{{ item.areano }}</div> | ||
| 103 | - <div class="addr" style="float: right">{{ item.areaname }}</div> | ||
| 104 | - </template> | ||
| 105 | - </el-autocomplete> | 106 | + <el-form-item label=" " :label-width="formLabelWidth" prop="volValue"> |
| 107 | + <el-input v-model="addForm.volValue" autocomplete="off" suffix-icon="el-icon-files" disabled> | ||
| 108 | + <template slot="prepend">入库体积</template> | ||
| 109 | + </el-input> | ||
| 106 | </el-form-item> | 110 | </el-form-item> |
| 107 | </el-col> | 111 | </el-col> |
| 112 | + </el-row> | ||
| 113 | + <el-divider content-position="left"><i class="el-icon-house"></i> 入库相关</el-divider> | ||
| 114 | + <el-row> | ||
| 115 | +<!-- <el-col :span="6">--> | ||
| 116 | +<!-- <el-form-item label=" " :label-width="formLabelWidth" prop="area">--> | ||
| 117 | +<!-- <el-autocomplete--> | ||
| 118 | +<!-- v-model="addForm.area"--> | ||
| 119 | +<!-- :fetch-suggestions="areaQuerySearch"--> | ||
| 120 | +<!-- placeholder="请输入库区编号"--> | ||
| 121 | +<!-- :trigger-on-focus="false"--> | ||
| 122 | +<!-- value-key = "areano"--> | ||
| 123 | +<!-- clearable--> | ||
| 124 | +<!-- highlight-first-item--> | ||
| 125 | +<!-- style="width: 100%"--> | ||
| 126 | +<!-- >--> | ||
| 127 | +<!-- <template slot="prepend">库  区</template>--> | ||
| 128 | +<!-- <template slot-scope="{ item }">--> | ||
| 129 | +<!-- <div class="name" style="float: left">{{ item.areano }}</div>--> | ||
| 130 | +<!-- <div class="addr" style="float: right">{{ item.areaname }}</div>--> | ||
| 131 | +<!-- </template>--> | ||
| 132 | +<!-- </el-autocomplete>--> | ||
| 133 | +<!-- </el-form-item>--> | ||
| 134 | +<!-- </el-col>--> | ||
| 108 | <el-col :span="6"> | 135 | <el-col :span="6"> |
| 109 | <el-form-item label=" " :label-width="formLabelWidth" prop="location"> | 136 | <el-form-item label=" " :label-width="formLabelWidth" prop="location"> |
| 110 | <el-autocomplete | 137 | <el-autocomplete |
| @@ -606,6 +633,27 @@ | @@ -606,6 +633,27 @@ | ||
| 606 | export default { | 633 | export default { |
| 607 | name: "inventroyrecord", | 634 | name: "inventroyrecord", |
| 608 | data() { | 635 | data() { |
| 636 | + var checkInputArea = (rule, value, callback) => { | ||
| 637 | + let tempVol = 0 | ||
| 638 | + if (!value) { | ||
| 639 | + return callback(new Error('体积信息必填')); | ||
| 640 | + } | ||
| 641 | + setTimeout(() => { | ||
| 642 | + var lineStr = value.replace('\r').split('\n') | ||
| 643 | + lineStr.forEach(((v,index) => { | ||
| 644 | + var pattern = /^[0-9\.]+x[0-9\.]+x[0-9\.]+x[0-9\.]+$/; | ||
| 645 | + if(!pattern.test(v)){ | ||
| 646 | + callback(new Error('行:'+index+'的值:'+v+'的体积格式输入错误,格式为1x1x1x1支持小数点')); | ||
| 647 | + }else { | ||
| 648 | + const volV = this.multiply(v) | ||
| 649 | + tempVol += volV | ||
| 650 | + } | ||
| 651 | + })) | ||
| 652 | + | ||
| 653 | + callback(); | ||
| 654 | + this.addForm.volValue = (tempVol/1000000).toFixed(2) | ||
| 655 | + }, 200); | ||
| 656 | + }; | ||
| 609 | return { | 657 | return { |
| 610 | queryInfo: { | 658 | queryInfo: { |
| 611 | waybill:'', | 659 | waybill:'', |
| @@ -658,6 +706,7 @@ | @@ -658,6 +706,7 @@ | ||
| 658 | transcar: '', | 706 | transcar: '', |
| 659 | transtype:'销售入库', | 707 | transtype:'销售入库', |
| 660 | vol:'', | 708 | vol:'', |
| 709 | + volValue:0, | ||
| 661 | waybillmaster:'', | 710 | waybillmaster:'', |
| 662 | waybillsub:'', | 711 | waybillsub:'', |
| 663 | //随货文件 | 712 | //随货文件 |
| @@ -734,6 +783,11 @@ | @@ -734,6 +783,11 @@ | ||
| 734 | ], | 783 | ], |
| 735 | opter: [ | 784 | opter: [ |
| 736 | { required: true, message: '必须包含经办人信息', trigger: 'blur' } | 785 | { required: true, message: '必须包含经办人信息', trigger: 'blur' } |
| 786 | + ], | ||
| 787 | + vol:[ | ||
| 788 | + // { required: true, message: '体积信息必填', trigger: 'blur' }, | ||
| 789 | + { validator: checkInputArea, trigger: 'blur' }, | ||
| 790 | + // { pattern: /^[0-9\.x]+$/gm, message: '体积信息只能输入数字和(.)点符号与x小写字母' } | ||
| 737 | ] | 791 | ] |
| 738 | }, | 792 | }, |
| 739 | } | 793 | } |
| @@ -874,8 +928,8 @@ | @@ -874,8 +928,8 @@ | ||
| 874 | const res = response.data | 928 | const res = response.data |
| 875 | this.$message.success(res.msg) | 929 | this.$message.success(res.msg) |
| 876 | this.getList() | 930 | this.getList() |
| 877 | - }).catch(error => { | ||
| 878 | - this.$message.error(res.msg) | 931 | + }).catch(err => { |
| 932 | + this.$message.error(err.toString()) | ||
| 879 | }) | 933 | }) |
| 880 | }).catch(() => { | 934 | }).catch(() => { |
| 881 | }) | 935 | }) |
| @@ -1077,9 +1131,6 @@ | @@ -1077,9 +1131,6 @@ | ||
| 1077 | let ld = this.$loading({ | 1131 | let ld = this.$loading({ |
| 1078 | text:"图片数据上传中..." | 1132 | text:"图片数据上传中..." |
| 1079 | }) | 1133 | }) |
| 1080 | - const para = { | ||
| 1081 | - file:formData | ||
| 1082 | - } | ||
| 1083 | upfileWithPost(formData).then((response)=>{ | 1134 | upfileWithPost(formData).then((response)=>{ |
| 1084 | let res = response.data; | 1135 | let res = response.data; |
| 1085 | if (res.code !== '200') { | 1136 | if (res.code !== '200') { |
| @@ -1121,6 +1172,14 @@ | @@ -1121,6 +1172,14 @@ | ||
| 1121 | } | 1172 | } |
| 1122 | 1173 | ||
| 1123 | 1174 | ||
| 1175 | + }, | ||
| 1176 | + multiply(str){ | ||
| 1177 | + var everyNum = str.replace('X','x').split('x'); | ||
| 1178 | + let tempNum = 1; | ||
| 1179 | + everyNum.forEach(item =>{ | ||
| 1180 | + tempNum = tempNum*item | ||
| 1181 | + }) | ||
| 1182 | + return tempNum; | ||
| 1124 | } | 1183 | } |
| 1125 | }, | 1184 | }, |
| 1126 | mounted() { | 1185 | mounted() { |
-
请 注册 或 登录 后发表评论