切换导航条
此项目
正在载入...
登录
朱兆平
/
vue_cli
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
朱兆平
2 years ago
提交
be9ed3ae29ac99c9d5b8132cd090ea20a57cfd44
1 个父辈
483e3aea
增加尺寸信息批量录入及智能识别
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
96 行增加
和
5 行删除
src/views/nav3/Way.vue
src/views/nav3/Way.vue
查看文件 @
be9ed3a
...
...
@@ -681,7 +681,7 @@ Handling Information
</el-row>
<el-row style="padding-top: 20px">
<el-col :span="7" style="border-right: 1px solid #a5a5a5">
<el-input :disabled="form.cvd.cvd_charge_prepaid=='CC'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="
计费重量
" size="mini"></el-input>
<el-input :disabled="form.cvd.cvd_charge_prepaid=='CC'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="
毛重
" size="mini"></el-input>
</el-col>
<el-col :span="10" style="border-right: 1px solid #a5a5a5;text-align: center">
<span style="font-size: 12px">
...
...
@@ -689,7 +689,7 @@ Handling Information
</span>
</el-col>
<el-col :span="7">
<el-input :disabled="form.cvd.cvd_charge_prepaid=='PP'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="
计费重量
" size="mini"></el-input>
<el-input :disabled="form.cvd.cvd_charge_prepaid=='PP'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="
毛重
" size="mini"></el-input>
</el-col>
</el-row>
</el-col>
...
...
@@ -1844,7 +1844,9 @@ Handling Information
</el-tab-pane>
</el-tabs>
<!-- 主单获取尺寸信息-->
<el-dialog title="尺寸信息" :visible.sync="dialogTableVisible">
<el-dialog title="尺寸信息" :visible.sync="dialogTableVisible" width="80%">
<el-row :gutter="10">
<el-col :span="18">
<el-table :data="gridData" :cell-style="{textAlign:'center'}" show-summary
:summary-method="getSummaries"
style="border-radius: 10px 10px 0px 0px;line-height: 25px" border
...
...
@@ -1893,6 +1895,24 @@ Handling Information
<el-button type="primary" size="small" @click="dialogTableVisible = false">取 消</el-button>
<el-button type="success" size="small" @click="addVol()">保 存</el-button>
</div>
</el-col>
<el-col :span="6">
<el-tooltip class="item" effect="dark" content="可以将整体的尺寸信息复制进来,一行一个尺寸信息,系统会自动识别" placement="top-start">
<el-input
rows="6"
resize = "vertical"
type="textarea"
placeholder="快速尺寸信息录入生成"
v-model="dimension_textarea"
@change="convertAndCalculateVolume"
>
</el-input>
</el-tooltip>
</el-col>
</el-row>
<el-row> </el-row>
</el-dialog>
<!-- 列表区域 获取发货人-->
<el-dialog :visible.sync="dialogVisible" width="70%">
...
...
@@ -1929,6 +1949,7 @@ Handling Information
hidden: ['a1', 'a2', 'a3', 'a4', 'a5','a6'],
// 主单
activeName: 'first',
dimension_textarea: '',
form:{
acc:[],
agt:{
...
...
@@ -2239,11 +2260,11 @@ Handling Information
const value = Number(curr)
if (!isNaN(value)) {
// 保存了两位小数点
return Math.round((prev + curr) * 100
0) / 10
00;
return Math.round((prev + curr) * 100
) / 1
00;
} else {
// 保存了两位小数点
return Math.round(prev * 100
0) / 10
00;
return Math.round(prev * 100
) / 1
00;
}
}, 0)
sums[index] += '';
...
...
@@ -2689,6 +2710,76 @@ Handling Information
})
// console.log("获取分单的方法执行了")
},
//批量尺寸信息识别
convertAndCalculateVolume() {
let _this= this;
this.$confirm('是否需要根据录入的尺寸信息生成详细的尺寸计算数据表,此操作会往表里面添加新的尺寸数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let text = this.dimension_textarea.trim().replaceAll("*","x");
text = text.replaceAll("CM","");
text = text.replaceAll("cm","");
text = text.replaceAll("X","x");
text = text.replaceAll("-","x");
//去掉空白字符
text = text.replaceAll("/\s/g","");
const lines = text.split('\n');
let output = '';
let totalVolume = 0;
for (const line of lines) {
//正则校验每行格式
const regex = /^([\d\.]+)x([\d\.]+)x([\d\.]+)x([\d\.]+)$/;
let l = line.replace(/\s/g, "");
if (regex.test(l)) {
let dim_form = {
long:"",
wide:"",
height:"",
pic:"",
vol:"",
weight:""
};
const dimensions = l.trim().split('x');
dim_form.long = Number(dimensions[0]);
dim_form.wide = Number(dimensions[1]);
dim_form.height = Number(dimensions[2]);
dim_form.pic = Number(dimensions[3]);
dim_form.vol = dim_form.long * dim_form.wide * dim_form.height * dim_form.pic / 1000000;
_this.gridData.push(dim_form)
totalVolume += dim_form.vol;
const formattedDimensions = `${dim_form.long}-${dim_form.wide}-${dim_form.height }/${dim_form.pic}`;
output += formattedDimensions + '\n';
} else {
this.$message({
type: 'error',
message: '行:'+ line +'尺寸格式错误! 录入信息支持 数字和Xx*- '
});
return ;
}
}
if (totalVolume>0){
totalVolume = Math.floor(totalVolume * 100) / 100;
}
return {
converted: output.trim(),
totalVolume: totalVolume
};
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
cancleBtn(){
Object.assign(this.$data, this.$options.data());
}
...
...
请
注册
或
登录
后发表评论