Ver Fonte

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

chenrui há 2 meses atrás
pai
commit
c048547ed7

+ 5 - 5
src/views/reportData/allocationOrderTotal/list.vue

@@ -228,18 +228,18 @@ export default {
         { title: '调拨类型', dataIndex: 'allocateSortName', width: '15%', align: 'center', scopedSlots: { customRender: 'allocateType' } },
         { title: '费用归属品牌', dataIndex: 'productBrandName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '费用归属品类', dataIndex: 'productTypeName1', width: '15%', align: 'center', scopedSlots: { customRender: 'productType' } },
-        { title: '调拨数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调拨数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '成本价', dataIndex: 'totalCost', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '毛利', dataIndex: 'totalGrossProfit', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'creatorName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
       if (this.$hasPermissions('M_allocationOrderTotalList_salesPrice')) { //  成本价权限
-        arr.splice(10, 0, { title: '售价', dataIndex: 'totalPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '售价', dataIndex: 'totalPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_allocationOrderTotalList_costPrice')) { //  成本价权限
-        arr.splice(11, 0, { title: '成本价', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(12, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '成本价', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '毛利', dataIndex: 'totalGrossProfit', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
+      arr.push({ title: '操作员', dataIndex: 'creatorName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       return arr
     }
   },

+ 32 - 14
src/views/reportData/regionTypeBusinessReport/list.vue

@@ -91,18 +91,21 @@ import getDate from '@/libs/getDate'
 // 接口
 import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
 const strongRow = []
+const redRow = []
 const renderContent = (value, row, index) => {
-  const ret = value || value == 0 ? value : '--'
+  const ret = value || value == 0 ? value : ''
   const retVal = ret == 0 ? '0.00' : ret
-  if (strongRow.indexOf(index) >= 0) {
+  const isStrong = strongRow.indexOf(index) >= 0
+  const isRed = redRow.indexOf(index) >= 0
+  if (isStrong || isRed) {
     return {
-      children: retVal,
+      children: retVal == '--' ? '' : retVal,
       attrs: {
         style: 'font-weight: bold;color:red;font-size:14px;'
       }
     }
   }
-  return retVal
+  return retVal == '--' ? '' : retVal
 }
 export default {
   name: 'RegionTypeBusinessReportList',
@@ -143,12 +146,21 @@ export default {
             // 计算表格序号
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              data[i].grossMargin = data[i].grossMargin ? data[i].grossMargin + '%' : '0.00%'
-              data[i].promoRatio = data[i].promoRatio ? data[i].promoRatio + '%' : '0.00%'
+              const isqml = data[i].category === '全品类'
+              data[i].grossMargin = (data[i].grossMargin || data[i].grossMargin == 0) && data[i].amount ? data[i].grossMargin.toFixed(2) + '%' : '--'
+              data[i].promoRatio = (data[i].promoRatio || data[i].promoRatio == 0) && data[i].amount ? data[i].promoRatio.toFixed(2) + '%' : '--'
+              data[i].cost = data[i].cost ? data[i].cost.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].amount = data[i].amount ? data[i].amount.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].gross = data[i].gross ? data[i].gross.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].promo = data[i].promo || data[i].promo == 0 ? data[i].promo.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].removePromoGross = data[i].removePromoGross ? data[i].removePromoGross.toFixed(2) : (isqml ? '--' : '0.00')
 
               if (data[i].category.indexOf('合计') >= 0) {
                 strongRow.push(i)
               }
+              if (data[i].category == '全品类(含NGK)' || data[i].category == '箭牌喇叭' || data[i].category == '轮胎') {
+                redRow.push(i)
+              }
               ret.push(data[i])
             }
           }
@@ -175,17 +187,23 @@ export default {
       const arr = [
         { title: '类别',
           dataIndex: 'category',
-          width: '25%',
+          width: '15%',
           align: 'center',
           customRender: (text, row, index) => {
-            return row.category.indexOf('合计') < 0 ? <a-button type="link" class="button-default">{text}</a-button> : (<a-button type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>)
-          } },
-        { title: '成本', dataIndex: 'cost', width: '10%', align: 'right', customRender: renderContent },
-        { title: '销售额', dataIndex: 'amount', width: '10%', align: 'right', customRender: renderContent },
-        { title: '毛利', dataIndex: 'gross', width: '10%', align: 'right', customRender: renderContent },
+            const isStrong = row.category.indexOf('合计') >= 0
+            const isRed = row.category == '全品类(含NGK)' || row.category == '箭牌喇叭' || row.category == '轮胎'
+            if (isStrong || isRed) {
+              return <a-button size="small" type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>
+            }
+            return <a-button size="small" type="link" class="button-default">{text}</a-button>
+          }
+        },
+        { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: renderContent },
+        { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: renderContent },
+        { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },
         { title: '毛利率', dataIndex: 'grossMargin', width: '10%', align: 'center', customRender: renderContent },
-        { title: '促销费用', dataIndex: 'promo', width: '10%', align: 'right', customRender: renderContent },
-        { title: '减促销费用的毛利', dataIndex: 'removePromoGross', width: '10%', align: 'right', customRender: renderContent },
+        { title: '促销费用', dataIndex: 'promo', width: '10%', align: 'center', customRender: renderContent },
+        { title: '减促销费用的毛利', dataIndex: 'removePromoGross', width: '10%', align: 'center', customRender: renderContent },
         { title: '促销费用占比', dataIndex: 'promoRatio', width: '10%', align: 'center', customRender: renderContent }
       ]
       return arr