chenrui пре 1 година
родитељ
комит
2cdc6941c6

+ 25 - 0
src/config/router.config.js

@@ -3833,6 +3833,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/setting/erpAllotSettings',
+            redirect: '/setting/erpAllotSettings/list',
+            name: 'erpAllotSettings',
+            component: BlankLayout,
+            meta: {
+              title: 'ERP调拨配置',
+              icon: 'sketch',
+              permission: 'M_erpAllotMessage'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'M_erpAllotSettingsList',
+                component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/erpAllotSettings/list.vue'),
+                meta: {
+                  title: 'ERP调拨配置',
+                  icon: 'sketch',
+                  hidden: true,
+                  permission: 'M_erpAllotMessageList'
+                }
+              }
+            ]
+          },
           {
             path: '/setting/checkDingTask',
             redirect: '/setting/checkDingTask/list',

+ 2 - 0
src/views/reportData/salesDetails/list.vue

@@ -179,6 +179,8 @@
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">优惠金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24">毛利率(减促销费用):{{ (totalData && (totalData.realGrossMargin || totalData.realGrossMargin==0)) ? (totalData.realGrossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
+              <a-col :md="4" :sm="24">实际毛利率:{{ (totalData && (totalData.grossMargin || totalData.grossMargin==0)) ? (totalData.grossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
             <!--  <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col> -->
             </a-row>

+ 141 - 0
src/views/setting/erpAllotSettings/list.vue

@@ -0,0 +1,141 @@
+<template>
+  <a-card size="small" :bordered="false" class="erpAllotSettings-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+70+'px'}"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :showPagination="false"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        childrenColumnName="sonList"
+        bordered>
+        <template slot="titles" slot-scope="text, record">
+          {{ record.name }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <v-select
+            v-if="record.root==1"
+            size="small"
+            style="width:30%;"
+            code="ERP_PRICE_TYPE"
+            id="erpAllotSettings-erpPriceType"
+            v-model="record.erpPriceType"
+            placeholder="请选择"
+            @change="e=>handleType(record,e)"></v-select>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { allocateTypeTreeList, allocateTypeSave } from '@/api/allocateType.js'
+export default {
+  name: 'ErpAllotSettings',
+  mixins: [commonMixin],
+  components: { STable, VSelect },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      columns: [
+        { title: '费用/调拨类型', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
+        { title: '同步ERP价格类型', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return allocateTypeTreeList(parameter).then(res => {
+          let data
+          if (res.status == 200) {
+            const newData = this.findChild(res.data)
+            data = newData
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      itemId: null,
+      parentData: null
+    }
+  },
+  methods: {
+    // 查找树的子节点
+    findChild (treeList) {
+      treeList.forEach(item => {
+        if (item.sonList && item.sonList.length > 0) {
+          this.findChild(item.sonList)
+        } else {
+          item.root = this.$hasPermissions('B_erpAllotSettings_erpPriceType') ? 1 : 0
+        }
+      })
+      return treeList
+    },
+    // 价格类型选择
+    handleType (row, val) {
+      const params = {
+        allocateTypeSn: row.allocateTypeSn,
+        erpPriceType: val,
+        name: row.name,
+        allocateCategory: row.allocateCategory,
+        treeLevel: row.treeLevel
+      }
+      allocateTypeSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('操作成功')
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .erpAllotSettings-wrap{
+    height: 100%;
+  }
+</style>