正在显示
1 个修改的文件
包含
144 行增加
和
53 行删除
| @@ -681,7 +681,7 @@ Handling Information | @@ -681,7 +681,7 @@ Handling Information | ||
| 681 | </el-row> | 681 | </el-row> |
| 682 | <el-row style="padding-top: 20px"> | 682 | <el-row style="padding-top: 20px"> |
| 683 | <el-col :span="7" style="border-right: 1px solid #a5a5a5"> | 683 | <el-col :span="7" style="border-right: 1px solid #a5a5a5"> |
| 684 | - <el-input :disabled="form.cvd.cvd_charge_prepaid=='CC'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="计费重量" size="mini"></el-input> | 684 | + <el-input :disabled="form.cvd.cvd_charge_prepaid=='CC'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="毛重" size="mini"></el-input> |
| 685 | </el-col> | 685 | </el-col> |
| 686 | <el-col :span="10" style="border-right: 1px solid #a5a5a5;text-align: center"> | 686 | <el-col :span="10" style="border-right: 1px solid #a5a5a5;text-align: center"> |
| 687 | <span style="font-size: 12px"> | 687 | <span style="font-size: 12px"> |
| @@ -689,7 +689,7 @@ Handling Information | @@ -689,7 +689,7 @@ Handling Information | ||
| 689 | </span> | 689 | </span> |
| 690 | </el-col> | 690 | </el-col> |
| 691 | <el-col :span="7"> | 691 | <el-col :span="7"> |
| 692 | - <el-input :disabled="form.cvd.cvd_charge_prepaid=='PP'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="计费重量" size="mini"></el-input> | 692 | + <el-input :disabled="form.cvd.cvd_charge_prepaid=='PP'" v-model="form.ppd.ppd_weight_amount" auto-complete="off" placeholder="毛重" size="mini"></el-input> |
| 693 | </el-col> | 693 | </el-col> |
| 694 | </el-row> | 694 | </el-row> |
| 695 | </el-col> | 695 | </el-col> |
| @@ -1844,55 +1844,75 @@ Handling Information | @@ -1844,55 +1844,75 @@ Handling Information | ||
| 1844 | </el-tab-pane> | 1844 | </el-tab-pane> |
| 1845 | </el-tabs> | 1845 | </el-tabs> |
| 1846 | <!-- 主单获取尺寸信息--> | 1846 | <!-- 主单获取尺寸信息--> |
| 1847 | - <el-dialog title="尺寸信息" :visible.sync="dialogTableVisible"> | ||
| 1848 | - <el-table :data="gridData" :cell-style="{textAlign:'center'}" show-summary | ||
| 1849 | - :summary-method="getSummaries" | ||
| 1850 | - style="border-radius: 10px 10px 0px 0px;line-height: 25px" border | ||
| 1851 | - :header-cell-style="{background:'#6F8294',color:'#FFFFFF',textAlign:'center'}"> | ||
| 1852 | - <el-table-column label="长(CM)" width="" prop="long"> | ||
| 1853 | - <template slot-scope="scope"> | ||
| 1854 | - <el-input v-model="scope.row.long" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1855 | - </template> | ||
| 1856 | - </el-table-column> | ||
| 1857 | - <el-table-column label="宽(CM)" width="" prop="wide"> | ||
| 1858 | - <template slot-scope="scope"> | ||
| 1859 | - <el-input v-model="scope.row.wide" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1860 | - </template> | ||
| 1861 | - </el-table-column> | ||
| 1862 | - <el-table-column label="高(CM)" prop="height"> | ||
| 1863 | - <template slot-scope="scope"> | ||
| 1864 | - <el-input v-model="scope.row.height" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1865 | - </template> | ||
| 1866 | - </el-table-column> | ||
| 1867 | - <el-table-column label="件数" width="" prop="pic"> | ||
| 1868 | - <template slot-scope="scope"> | ||
| 1869 | - <el-input v-model="scope.row.pic" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1870 | - </template> | ||
| 1871 | - </el-table-column> | ||
| 1872 | - <el-table-column label="体积(M³)" width="" prop="vol"> | ||
| 1873 | - <template slot-scope="scope"> | ||
| 1874 | - <el-input v-model="scope.row.vol" placeholder="" :disabled="true"/> | ||
| 1875 | - </template> | ||
| 1876 | - </el-table-column> | ||
| 1877 | - <el-table-column label="重量" prop="weight"> | ||
| 1878 | - <template slot-scope="scope"> | ||
| 1879 | - <el-input v-model="scope.row.weight" placeholder=""/> | ||
| 1880 | - </template> | ||
| 1881 | - </el-table-column> | ||
| 1882 | - <el-table-column fixed="right" label="操作"> | ||
| 1883 | - <template slot-scope="scope"> | ||
| 1884 | - <!-- v-if="scope.$index < gridData.length - 1"--> | ||
| 1885 | - <el-button type="danger" plain @click="deleteRows(scope)">删 除</el-button> | ||
| 1886 | - </template> | ||
| 1887 | - </el-table-column> | ||
| 1888 | - </el-table> | ||
| 1889 | - <div align="center" style="margin: 10px"> | ||
| 1890 | - <el-button @click="addRows()" size="mini" plain style="width: 100%">+添 加</el-button> | ||
| 1891 | - </div> | ||
| 1892 | - <div align="center" style="margin: 15px"> | ||
| 1893 | - <el-button type="primary" size="small" @click="dialogTableVisible = false">取 消</el-button> | ||
| 1894 | - <el-button type="success" size="small" @click="addVol()">保 存</el-button> | ||
| 1895 | - </div> | 1847 | + <el-dialog title="尺寸信息" :visible.sync="dialogTableVisible" width="80%"> |
| 1848 | + <el-row :gutter="10"> | ||
| 1849 | + <el-col :span="18"> | ||
| 1850 | + <el-table :data="gridData" :cell-style="{textAlign:'center'}" show-summary | ||
| 1851 | + :summary-method="getSummaries" | ||
| 1852 | + style="border-radius: 10px 10px 0px 0px;line-height: 25px" border | ||
| 1853 | + :header-cell-style="{background:'#6F8294',color:'#FFFFFF',textAlign:'center'}"> | ||
| 1854 | + <el-table-column label="长(CM)" width="" prop="long"> | ||
| 1855 | + <template slot-scope="scope"> | ||
| 1856 | + <el-input v-model="scope.row.long" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1857 | + </template> | ||
| 1858 | + </el-table-column> | ||
| 1859 | + <el-table-column label="宽(CM)" width="" prop="wide"> | ||
| 1860 | + <template slot-scope="scope"> | ||
| 1861 | + <el-input v-model="scope.row.wide" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1862 | + </template> | ||
| 1863 | + </el-table-column> | ||
| 1864 | + <el-table-column label="高(CM)" prop="height"> | ||
| 1865 | + <template slot-scope="scope"> | ||
| 1866 | + <el-input v-model="scope.row.height" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1867 | + </template> | ||
| 1868 | + </el-table-column> | ||
| 1869 | + <el-table-column label="件数" width="" prop="pic"> | ||
| 1870 | + <template slot-scope="scope"> | ||
| 1871 | + <el-input v-model="scope.row.pic" placeholder="" @input="handleEdit(scope.$index, scope.row)"/> | ||
| 1872 | + </template> | ||
| 1873 | + </el-table-column> | ||
| 1874 | + <el-table-column label="体积(M³)" width="" prop="vol"> | ||
| 1875 | + <template slot-scope="scope"> | ||
| 1876 | + <el-input v-model="scope.row.vol" placeholder="" :disabled="true"/> | ||
| 1877 | + </template> | ||
| 1878 | + </el-table-column> | ||
| 1879 | + <el-table-column label="重量" prop="weight"> | ||
| 1880 | + <template slot-scope="scope"> | ||
| 1881 | + <el-input v-model="scope.row.weight" placeholder=""/> | ||
| 1882 | + </template> | ||
| 1883 | + </el-table-column> | ||
| 1884 | + <el-table-column fixed="right" label="操作"> | ||
| 1885 | + <template slot-scope="scope"> | ||
| 1886 | + <!-- v-if="scope.$index < gridData.length - 1"--> | ||
| 1887 | + <el-button type="danger" plain @click="deleteRows(scope)">删 除</el-button> | ||
| 1888 | + </template> | ||
| 1889 | + </el-table-column> | ||
| 1890 | + </el-table> | ||
| 1891 | + <div align="center" style="margin: 10px"> | ||
| 1892 | + <el-button @click="addRows()" size="mini" plain style="width: 100%">+添 加</el-button> | ||
| 1893 | + </div> | ||
| 1894 | + <div align="center" style="margin: 15px"> | ||
| 1895 | + <el-button type="primary" size="small" @click="dialogTableVisible = false">取 消</el-button> | ||
| 1896 | + <el-button type="success" size="small" @click="addVol()">保 存</el-button> | ||
| 1897 | + </div> | ||
| 1898 | + </el-col> | ||
| 1899 | + <el-col :span="6"> | ||
| 1900 | + <el-tooltip class="item" effect="dark" content="可以将整体的尺寸信息复制进来,一行一个尺寸信息,系统会自动识别" placement="top-start"> | ||
| 1901 | + <el-input | ||
| 1902 | + rows="6" | ||
| 1903 | + resize = "vertical" | ||
| 1904 | + type="textarea" | ||
| 1905 | + placeholder="快速尺寸信息录入生成" | ||
| 1906 | + v-model="dimension_textarea" | ||
| 1907 | + @change="convertAndCalculateVolume" | ||
| 1908 | + > | ||
| 1909 | + </el-input> | ||
| 1910 | + </el-tooltip> | ||
| 1911 | + | ||
| 1912 | + </el-col> | ||
| 1913 | + </el-row> | ||
| 1914 | + <el-row> </el-row> | ||
| 1915 | + | ||
| 1896 | </el-dialog> | 1916 | </el-dialog> |
| 1897 | <!-- 列表区域 获取发货人--> | 1917 | <!-- 列表区域 获取发货人--> |
| 1898 | <el-dialog :visible.sync="dialogVisible" width="70%"> | 1918 | <el-dialog :visible.sync="dialogVisible" width="70%"> |
| @@ -1929,6 +1949,7 @@ Handling Information | @@ -1929,6 +1949,7 @@ Handling Information | ||
| 1929 | hidden: ['a1', 'a2', 'a3', 'a4', 'a5','a6'], | 1949 | hidden: ['a1', 'a2', 'a3', 'a4', 'a5','a6'], |
| 1930 | // 主单 | 1950 | // 主单 |
| 1931 | activeName: 'first', | 1951 | activeName: 'first', |
| 1952 | + dimension_textarea: '', | ||
| 1932 | form:{ | 1953 | form:{ |
| 1933 | acc:[], | 1954 | acc:[], |
| 1934 | agt:{ | 1955 | agt:{ |
| @@ -2239,11 +2260,11 @@ Handling Information | @@ -2239,11 +2260,11 @@ Handling Information | ||
| 2239 | const value = Number(curr) | 2260 | const value = Number(curr) |
| 2240 | if (!isNaN(value)) { | 2261 | if (!isNaN(value)) { |
| 2241 | // 保存了两位小数点 | 2262 | // 保存了两位小数点 |
| 2242 | - return Math.round((prev + curr) * 1000) / 1000; | 2263 | + return Math.round((prev + curr) * 100) / 100; |
| 2243 | 2264 | ||
| 2244 | } else { | 2265 | } else { |
| 2245 | // 保存了两位小数点 | 2266 | // 保存了两位小数点 |
| 2246 | - return Math.round(prev * 1000) / 1000; | 2267 | + return Math.round(prev * 100) / 100; |
| 2247 | } | 2268 | } |
| 2248 | }, 0) | 2269 | }, 0) |
| 2249 | sums[index] += ''; | 2270 | sums[index] += ''; |
| @@ -2689,6 +2710,76 @@ Handling Information | @@ -2689,6 +2710,76 @@ Handling Information | ||
| 2689 | }) | 2710 | }) |
| 2690 | // console.log("获取分单的方法执行了") | 2711 | // console.log("获取分单的方法执行了") |
| 2691 | }, | 2712 | }, |
| 2713 | + //批量尺寸信息识别 | ||
| 2714 | + convertAndCalculateVolume() { | ||
| 2715 | + let _this= this; | ||
| 2716 | + this.$confirm('是否需要根据录入的尺寸信息生成详细的尺寸计算数据表,此操作会往表里面添加新的尺寸数据', '提示', { | ||
| 2717 | + confirmButtonText: '确定', | ||
| 2718 | + cancelButtonText: '取消', | ||
| 2719 | + type: 'warning' | ||
| 2720 | + }).then(() => { | ||
| 2721 | + let text = this.dimension_textarea.trim().replaceAll("*","x"); | ||
| 2722 | + text = text.replaceAll("CM",""); | ||
| 2723 | + text = text.replaceAll("cm",""); | ||
| 2724 | + text = text.replaceAll("X","x"); | ||
| 2725 | + text = text.replaceAll("-","x"); | ||
| 2726 | + //去掉空白字符 | ||
| 2727 | + text = text.replaceAll("/\s/g",""); | ||
| 2728 | + const lines = text.split('\n'); | ||
| 2729 | + let output = ''; | ||
| 2730 | + let totalVolume = 0; | ||
| 2731 | + | ||
| 2732 | + for (const line of lines) { | ||
| 2733 | + //正则校验每行格式 | ||
| 2734 | + const regex = /^([\d\.]+)x([\d\.]+)x([\d\.]+)x([\d\.]+)$/; | ||
| 2735 | + let l = line.replace(/\s/g, ""); | ||
| 2736 | + if (regex.test(l)) { | ||
| 2737 | + let dim_form = { | ||
| 2738 | + long:"", | ||
| 2739 | + wide:"", | ||
| 2740 | + height:"", | ||
| 2741 | + pic:"", | ||
| 2742 | + vol:"", | ||
| 2743 | + weight:"" | ||
| 2744 | + }; | ||
| 2745 | + | ||
| 2746 | + const dimensions = l.trim().split('x'); | ||
| 2747 | + dim_form.long = Number(dimensions[0]); | ||
| 2748 | + dim_form.wide = Number(dimensions[1]); | ||
| 2749 | + dim_form.height = Number(dimensions[2]); | ||
| 2750 | + dim_form.pic = Number(dimensions[3]); | ||
| 2751 | + | ||
| 2752 | + dim_form.vol = dim_form.long * dim_form.wide * dim_form.height * dim_form.pic / 1000000; | ||
| 2753 | + | ||
| 2754 | + _this.gridData.push(dim_form) | ||
| 2755 | + totalVolume += dim_form.vol; | ||
| 2756 | + | ||
| 2757 | + const formattedDimensions = `${dim_form.long}-${dim_form.wide}-${dim_form.height }/${dim_form.pic}`; | ||
| 2758 | + | ||
| 2759 | + output += formattedDimensions + '\n'; | ||
| 2760 | + } else { | ||
| 2761 | + this.$message({ | ||
| 2762 | + type: 'error', | ||
| 2763 | + message: '行:'+ line +'尺寸格式错误! 录入信息支持 数字和Xx*- ' | ||
| 2764 | + }); | ||
| 2765 | + return ; | ||
| 2766 | + } | ||
| 2767 | + } | ||
| 2768 | + if (totalVolume>0){ | ||
| 2769 | + totalVolume = Math.floor(totalVolume * 100) / 100; | ||
| 2770 | + } | ||
| 2771 | + | ||
| 2772 | + return { | ||
| 2773 | + converted: output.trim(), | ||
| 2774 | + totalVolume: totalVolume | ||
| 2775 | + }; | ||
| 2776 | + }).catch(() => { | ||
| 2777 | + this.$message({ | ||
| 2778 | + type: 'info', | ||
| 2779 | + message: '已取消' | ||
| 2780 | + }); | ||
| 2781 | + }); | ||
| 2782 | + }, | ||
| 2692 | cancleBtn(){ | 2783 | cancleBtn(){ |
| 2693 | Object.assign(this.$data, this.$options.data()); | 2784 | Object.assign(this.$data, this.$options.data()); |
| 2694 | } | 2785 | } |
-
请 注册 或 登录 后发表评论