ソースを参照

Merge branch 'develop_yh9' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh10

# Conflicts:
#	public/version.json
#	src/views/salesManagement/sendOutOrder/chooseImportModal.vue
lilei 2 年 前
コミット
b5f31c9131

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.1.69",
+    "version": "2.1.63",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 10 - 0
src/libs/tools.js

@@ -232,6 +232,16 @@ export const numberToFixed = function (val, num) {
 
   return _value
 }
+export const toFixedDecimal = function (num, decimal) {
+  let newNum= null;
+  let patrn=/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/gi;
+  if(!patrn.exec(num)){
+  newNum=parseFloat(num).toFixed(decimal)
+  }else{
+   newNum =num
+ }
+  return newNum
+}
 // 保留decimal位小数(不四舍五入)  num 数值,decimal要保留的小数位数
 export const formatDecimal = function (num, decimal) {
   num = num.toString()

+ 19 - 18
src/views/salesManagement/sendOutOrder/chooseImportModal.vue

@@ -10,7 +10,7 @@
     width="80%">
     <div class="chooseImport-con">
       <!-- 可导入数据 -->
-      <p class="" v-if="paramsData&&paramsData.rightList">可导入数据{{ paramsData.rightList.length }}条</p>
+      <p class="">可导入数据{{ paramsData.rightList?paramsData.rightList.length:0 }}条</p>
       <a-table
         class="sTable"
         ref="table"
@@ -23,9 +23,10 @@
         :pagination="false"
         bordered>
       </a-table>
+
       <a-divider />
       <!-- 不可导入数据 -->
-      <p class="red" v-if="paramsData&&paramsData.errorList">不可导入数据{{ paramsData.errorList.length }}条</p>
+      <p class="red">不可导入数据{{ paramsData.errorList?paramsData.errorList.length :0 }}条</p>
       <a-table
         class="unTable"
         ref="unTable"
@@ -71,7 +72,7 @@
 <script>
 import { hdExportExcel } from '@/libs/exportExcel'
 import { sendBillInsertBatch, exportImportError } from '@/api/sendBill'
-import { toThousands } from '@/libs/tools.js'
+import { toThousands, toFixedDecimal } from '@/libs/tools.js'
 export default {
   name: 'ChooseImportModal',
   props: {
@@ -125,14 +126,14 @@ export default {
         { title: '交货方式', dataIndex: 'handoverTypeDictValue', width: '6%', align: 'center', customRender: renderContent },
         { title: '货物名称', dataIndex: 'goodsName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '件数', dataIndex: 'goodsQtyStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '体积(m3)', dataIndex: 'goodsVolumeStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
+        { title: '体积(m3)', dataIndex: 'goodsVolumeStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '立方/元', dataIndex: 'cubeAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '重量(kg)', dataIndex: 'goodsWeightStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
+        { title: '重量(kg)', dataIndex: 'goodsWeightStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '每吨/元', dataIndex: 'tonAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '运费(元)', dataIndex: 'transportAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '送货费(元)', dataIndex: 'sendAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
-        { title: '其他(元)', dataIndex: 'otherAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
-        { title: '保价(万)', dataIndex: 'supportValueStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } }
+        { title: '运费(元)', dataIndex: 'transportAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
+        { title: '送货费(元)', dataIndex: 'sendAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
+        { title: '其他(元)', dataIndex: 'otherAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
+        { title: '保价(万)', dataIndex: 'supportValueStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } }
       ],
       loadData: [],
       nowUnColumns: [
@@ -140,23 +141,23 @@ export default {
         { title: '客户名称', dataIndex: 'customeName', width: '8%', align: 'left', customRender: renderContent },
         { title: '物流单号', dataIndex: 'transportNo', width: '8%', align: 'center', customRender: renderContent },
         { title: '物流电话', dataIndex: 'transportTele', width: '8%', align: 'center', customRender: renderContent },
-        { title: '托运日期', dataIndex: 'sendDate', width: '8%', align: 'center', customRender: renderContent },
+        { title: '托运日期', dataIndex: 'sendDateStr', width: '8%', align: 'center', customRender: renderContent },
         { title: '收货人', dataIndex: 'customerCacateName', width: '6%', align: 'left', customRender: renderContent },
         { title: '收货电话', dataIndex: 'customerCacatePhone', width: '8%', align: 'center', customRender: renderContent },
         { title: '收货地址', dataIndex: 'customerAddressDetail', width: '8%', align: 'center', customRender: renderContent },
         { title: '目的地', dataIndex: 'customerAddress', width: '6%', align: 'center', customRender: renderContent },
-        { title: '付款方式', dataIndex: 'payTypeDictValue', width: '6%', align: 'center', customRender: renderContent },
-        { title: '交货方式', dataIndex: 'handoverTypeDictValue', width: '6%', align: 'center', customRender: renderContent },
+        { title: '付款方式', dataIndex: 'payTypeStr', width: '6%', align: 'center', customRender: renderContent },
+        { title: '交货方式', dataIndex: 'handoverTypeStr', width: '6%', align: 'center', customRender: renderContent },
         { title: '货物名称', dataIndex: 'goodsName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '件数', dataIndex: 'goodsQtyStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '体积(m3)', dataIndex: 'goodsVolumeStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
+        { title: '体积(m3)', dataIndex: 'goodsVolumeStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '立方/元', dataIndex: 'cubeAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '重量(kg)', dataIndex: 'goodsWeightStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
+        { title: '重量(kg)', dataIndex: 'goodsWeightStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '每吨/元', dataIndex: 'tonAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '运费(元)', dataIndex: 'transportAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '送货费(元)', dataIndex: 'sendAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
-        { title: '其他(元)', dataIndex: 'otherAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
-        { title: '保价(万)', dataIndex: 'supportValueStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toThousands(text,2) : '--') } },
+        { title: '运费(元)', dataIndex: 'transportAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
+        { title: '送货费(元)', dataIndex: 'sendAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
+        { title: '其他(元)', dataIndex: 'otherAmountStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
+        { title: '保价(万)', dataIndex: 'supportValueStr', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '错误说明', dataIndex: 'importErrorMsgList', width: '10%', align: 'center', customRender: renderContentError }
       ],
       unLoadData: [],