zhangqiOMG преди 2 години
родител
ревизия
7b83d31c41
променени са 26 файла, в които са добавени 1081 реда и са изтрити 69 реда
  1. 22 10
      src/HDrpManagement/ProductGroupMag/index.vue
  2. 4 5
      src/HDrpManagement/ProductGroupMag/modules/addGroup.vue
  3. 94 0
      src/HDrpManagement/ProductGroupMag/modules/addGroupDetail.vue
  4. 105 0
      src/HDrpManagement/ProductGroupMag/modules/addGroupDetailBtn.vue
  5. 194 0
      src/HDrpManagement/ProductGroupMag/modules/editGroup.vue
  6. 108 0
      src/HDrpManagement/ProductGroupMag/modules/editGroupDetailBtn.vue
  7. 2 1
      src/HDrpManagement/ProductGroupMag/modules/list.vue
  8. 2 4
      src/HDrpManagement/ProductGroupMag/modules/table.vue
  9. 1 1
      src/HDrpManagement/ProductMag/modules/saleClass.vue
  10. 18 2
      src/HManagement/marketing/agent/modules/edit_agent.vue
  11. 54 0
      src/HManagement/marketing/agent/modules/saleclass/index.vue
  12. 135 0
      src/HManagement/marketing/agent/modules/saleclass/modules/addSaleClass.vue
  13. 32 0
      src/HManagement/marketing/agent/modules/saleclass/modules/del.vue
  14. 10 2
      src/SDrpManagement/Products/index.vue
  15. 52 10
      src/SDrpManagement/Products/modules/ProductDetails.vue
  16. 41 7
      src/SDrpManagement/Products/modules/Select.vue
  17. 12 7
      src/SDrpManagement/Products/modules/list.vue
  18. 39 0
      src/SDrpManagement/shopCart/index.vue
  19. 30 0
      src/SDrpManagement/shopCart/modules/del.vue
  20. 16 20
      src/SDrpManagement/shopCart/modules/list.vue
  21. 80 0
      src/SDrpManagement/shopCart/modules/total.vue
  22. BIN
      src/assets/Empty.png
  23. BIN
      src/assets/icons/Empty state_money.png
  24. 10 0
      src/router/SDrpManagement.js
  25. 3 0
      src/style/style.css
  26. 17 0
      src/utils/tool.js

+ 22 - 10
src/HDrpManagement/ProductGroupMag/index.vue

@@ -1,20 +1,23 @@
 <template>
   <div>
     <div class="container normal-panel normal-margin" style="display:flex">
-      <add type="add" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" v-if="tool.checkAuth($route.name,'update')"></add>
-      <Up type="all" style="margin-left:16px" @upSuccess="onSuccess()" :id="checkboxData.map(item => item.sa_itemgroupid)" v-if="Object.keys(checkboxData).length > 0 && checkboxData[0].isonsale == 0 && tool.checkAuth($route.name,'up_sales')"></Up>
-      <Down type="all" style="margin-left:16px" @downSuccess="onSuccess()" :id="checkboxData.map(item => item.sa_itemgroupid)" v-if="Object.keys(checkboxData).length > 0 && checkboxData[0].isonsale == 1 && tool.checkAuth($route.name,'down_sales')"></Down>
+      <add-group type="add" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" v-if="tool.checkAuth($route.name,'update')"></add-group>
+      <Up type="all" style="margin-left:16px" @upSuccess="$refs.list.listData()" :id="checkboxData.map(item => item.sa_itemgroupid)" v-if="Object.keys(checkboxData).length > 0 && checkboxData[0].isonsale == 0 && tool.checkAuth($route.name,'up_sales')"></Up>
+      <Down type="all" style="margin-left:16px" @downSuccess="$refs.list.listData()" :id="checkboxData.map(item => item.sa_itemgroupid)" v-if="Object.keys(checkboxData).length > 0 && checkboxData[0].isonsale == 1 && tool.checkAuth($route.name,'down_sales')"></Down>
     </div>
     <div class="container normal-panel normal-margin">
       <list ref="list" @checkboxCallBack="checkboxCallBack">
         <template v-slot:detail="scope">
           <product_detail :data="scope.data"  :type="'text'"></product_detail>
         </template>
+        <template v-slot:groupDetail="scope">
+          <add-group-detail :rowData="scope.data"/>
+        </template>
         <template v-slot:edit="scope">
-          <add v-if="tool.checkAuth($route.name,'update')" type="edit" @addSuccess="onSuccess()" :productData="productList" :brandData="brandList" :groupData="scope.data"></add>
+          <edit-group v-if="tool.checkAuth($route.name,'update')" type="edit" @addSuccess="$refs.list.listData()" :productData="productList" :brandData="brandList" :groupData="scope.data"></edit-group>
         </template>
         <template v-slot:del="scope">
-          <Del v-if="tool.checkAuth($route.name,'delete') && scope.data.isonsale == 0" type="group" @deleteSuccess="onSuccess()" :id="scope.data.sa_itemgroupid"></Del>
+          <Del v-if="tool.checkAuth($route.name,'delete')" type="group" @deleteSuccess="onSuccess()" :id="scope.data.sa_itemgroupid"></Del>
         </template>
         <template v-slot:up="scope">
           <Up type="one" @upSuccess="onSuccess()" :id="[scope.data.sa_itemgroupid]" v-if="scope.data.isonsale == 0 && tool.checkAuth($route.name,'up_sales')"></Up>
@@ -34,21 +37,25 @@ import product_detail from './modules/details.vue';
 
 import list from './modules/list'
 
-import add from './modules/add'
+import addGroup from './modules/addGroup'
+import editGroup from './modules/editGroup'
 import Del from './modules/delete'
 import Up from './modules/up'
 import Down from './modules/down'
-
-
+import detail from './modules/details.vue'
+import addGroupDetail from './modules/addGroupDetail'
 export default {
   name:"index",
   components:{
     list,
-    add,
-    product_detail,
+    addGroup,
+    editGroup,
+    detail,
     Del,
     Up,
     Down,
+    addGroupDetail,
+    product_detail
   },
   data() {
     return {
@@ -63,6 +70,11 @@ export default {
     this.getProductList()
     this.getBrandList()
   },
+  provide() {
+    return {
+      productList: () => this.productList
+    }
+  },
   methods: {
     /* 可选择的商品列表 */
     async getProductList() {

+ 4 - 5
src/HDrpManagement/ProductGroupMag/modules/add.vue → src/HDrpManagement/ProductGroupMag/modules/addGroup.vue

@@ -1,8 +1,7 @@
 <template>
-  <div class="inline-16">
-    <el-button type="primary" size="small" @click="dialogTableVisible=true" v-if="type == 'add'">新增产品组</el-button>
-    <el-button type="text" size="small" @click="editBtn" v-else>编 辑</el-button>
-    <el-dialog title="新增产品" :visible.sync="dialogTableVisible" width="30%">
+  <div>
+    <el-button type="primary" size="small" @click="dialogTableVisible=true">新增产品组</el-button>
+    <el-dialog title="新增产品组" append-to-body :visible.sync="dialogTableVisible" width="30%">
       <el-row :gutter="20">
         <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
           <el-col :span="24">
@@ -114,7 +113,7 @@ export default {
             "id": "20220922164303",
             "version":1,
             "content": {
-                "sa_itemgroupid":this.type == 'add' ? 0 : this.groupData.sa_itemgroupid,    
+                "sa_itemgroupid":0,    
                 "sa_brandid":this.form.sa_brandid,
                 "groupname":this.form.groupname,
                 "itemno":this.form.itemno,

+ 94 - 0
src/HDrpManagement/ProductGroupMag/modules/addGroupDetail.vue

@@ -0,0 +1,94 @@
+<template>
+  <div class="inline-16">
+    <el-button type="text" size="small" @click="detailBtn">明 细</el-button>
+    <el-dialog title="产品组明细" append-to-body :visible.sync="dialogTableVisible" width="70%">
+      <add-btn v-if="tool.checkAuth($route.name,'insert')" @onSuccess="getDetail" style="margin-bottom:16px" :id="rowData.sa_itemgroupid" />
+      <tableLayout v-if="dialogTableVisible" :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
+        <template v-slot:customcol="scope">
+            <span v-if="scope.column.data[scope.column.columnname]">{{scope.column.data[scope.column.columnname]}}</span>
+            <span v-else-if="scope.column.columnname != 'operation'">--</span>
+        </template>
+        <template v-slot:opreation="scope">
+          <div style="display:flex;justify-content:space-around">
+            <Del type="detail" v-if="tool.checkAuth($route.name,'delete')" :id="rowData.sa_itemgroupid" @deleteSuccess="getDetail" :detailId="scope.data.sa_itemgroupmxid"/>
+            <editBtn v-if="tool.checkAuth($route.name,'update')" :id="rowData.sa_itemgroupid" @onSuccess="getDetail" :rowData="scope.data"/>
+          </div>
+        </template>
+      </tableLayout>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import AddBtn from './addGroupDetailBtn'
+import editBtn from './editGroupDetailBtn'
+import { log } from '@antv/g2plot/lib/utils'
+import Del from './delete'
+
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      list:[],
+      form: {
+        product:[]
+      },
+      tablecols:[],
+      rules: {
+        product: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  props:['rowData'],
+  components:{AddBtn,Del,editBtn},
+
+  watch: {
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).groupDetailTable.tablecols
+  },
+  methods: {
+    async getDetail() {
+      let res = await this.$api.requested({
+        "id": "20220923101603",
+        "version":1,
+        "content": {
+          "sa_itemgroupid":this.rowData.sa_itemgroupid
+
+        }
+      })
+      this.list = res.data
+    },
+    detailBtn() {
+      this.getDetail()
+      this.dialogTableVisible = true
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-top: 10px !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-input{
+  width: 100% !important;
+}
+</style>

+ 105 - 0
src/HDrpManagement/ProductGroupMag/modules/addGroupDetailBtn.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <el-button type="primary" size="small" @click="dialogTableVisible=true">新增明细</el-button>
+    <el-dialog title="产品组明细" append-to-body :visible.sync="dialogTableVisible" width="30%">
+      <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
+        <el-form-item label="商品" prop="product">
+          <el-select v-model="form.product" multiple placeholder="请选择商品">
+            <el-option
+              v-for="item in productList()"
+              :key="item.itemid"
+              :label="item.itemname"
+              :value="item.itemid">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="submit" size="small">确 定</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      form: {
+        product:[]
+      },
+      rules: {
+        product: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  inject: ['productList'],
+  props:['id'],
+  watch: {
+    
+  },
+  created() {
+    
+  },
+  methods: {
+    submit() {
+     this.$refs.form.validate(async val => {
+        if(val) {
+          this.form.product = this.form.product.map(item => {
+            return {
+              sa_itemgroupmxid:0,
+              itemid:item
+            }
+          })
+          let res = await this.$api.requested({
+            "accesstoken": "69f1a508bad99ddffdce4bc3c919a0d0",
+            "id": "20220923110303",
+            "version":1,
+            "content": {
+              "sa_itemgroupid":this.id,
+              "itemclassinfos":this.form.product
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.dialogTableVisible = false
+            this.$emit('onSuccess')
+          })
+        }
+     })
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+    
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-bottom: 0 !important;
+  padding-top: 10px !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-input{
+  width: 100% !important;
+}
+</style>

+ 194 - 0
src/HDrpManagement/ProductGroupMag/modules/editGroup.vue

@@ -0,0 +1,194 @@
+<template>
+  <div class="inline-16">
+    <el-button type="text" size="small" @click="editBtn">编 辑</el-button>
+    <el-dialog title="编辑产品组" append-to-body :visible.sync="dialogTableVisible" width="30%">
+      <el-row :gutter="20">
+        <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
+          <el-col :span="24">
+            <el-form-item label="产品组名称" prop="groupname">
+              <el-input v-model="form.groupname" placeholder="请输入商品组名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="品牌" prop="sa_brandid">
+              <el-select v-model="form.sa_brandid" placeholder="请选择品牌">
+                <el-option
+                  v-for="item in brandData"
+                  :key="item.sa_brandid"
+                  :label="item.brandname"
+                  :value="item.sa_brandid"
+                  size="small">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="商品" prop="itemno">
+              <el-select v-model="form.itemno" placeholder="请选择商品">
+                <el-option
+                  v-for="item in productData"
+                  :key="item.itemno"
+                  :label="item.itemname"
+                  :value="item.itemno"
+                  size="small">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="自定义标签" prop="tag" style="margin-bottom:0px; !important">
+              <el-tag
+                :key="tag"
+                v-for="tag in form.tag"
+                closable
+                :disable-transitions="false"
+                @close="handleClose(tag)">
+                {{tag}}
+              </el-tag>
+              <el-input
+                class="input-new-tag"
+                v-if="inputVisible"
+                v-model="inputValue"
+                ref="saveTagInput"
+                size="small"
+                @keyup.enter.native="handleInputConfirm"
+                @blur="handleInputConfirm"
+              >
+              </el-input>
+              <el-button v-else class="button-new-tag" size="small" @click="showInput">+ New 标签</el-button>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="submit" size="small">确 定</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      /* 当前选择的组 */
+      seleteGroup:'',
+      inputVisible: false,
+      inputValue: '',
+      form:{
+        sa_brandid:'',
+        groupname:'',
+        itemno:'',
+        tag:[]
+      },
+      rules:{
+        sa_brandid: [
+          { required: true, message: '请选择品牌', trigger: 'blur' },
+        ],
+        groupname: [
+          { required: true, message: '请输入商品组名称', trigger: 'blur' },
+        ],
+        itemno: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ]
+      }
+    }
+  },
+  props:['type','brandData','productData','groupData'],
+  watch: {
+    
+  },
+  created() {
+    
+  },
+  methods: {
+    submit() {
+      this.$refs.form.validate(async val => {
+        if(val) {
+          let res = await this.$api.requested({
+            "id": "20220922164303",
+            "version":1,
+            "content": {
+                "sa_itemgroupid":this.groupData.sa_itemgroupid,    
+                "sa_brandid":this.form.sa_brandid,
+                "groupname":this.form.groupname,
+                "itemno":this.form.itemno,
+                "tag": this.form.tag
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.$emit('addSuccess')
+            this.dialogTableVisible = false
+          })
+        }
+      })
+    },
+    editBtn() {      
+      this.dialogTableVisible = true
+      this.seleteGroup = this.groupData
+      let temp = JSON.parse(JSON.stringify(this.seleteGroup))
+      this.form = {
+        sa_brandid:temp.sa_brandid,
+        groupname:temp.groupname,
+        itemno:temp.itemno,
+        tag:temp.tag1
+      }
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+    showInput() {
+      this.inputVisible = true;
+      this.$nextTick(_ => {
+        this.$refs.saveTagInput.$refs.input.focus();
+      });
+    },
+    handleInputConfirm() {
+      let inputValue = this.inputValue;
+      if (inputValue) {
+        this.form.tag.push(inputValue);
+      }
+      this.inputVisible = false;
+      this.inputValue = '';
+    }
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-top: 10px !important;
+  padding-bottom: 0 !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+.el-tag + .el-tag {
+  margin-left: 10px;
+  margin-bottom: 10px;
+}
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+}
+</style>

+ 108 - 0
src/HDrpManagement/ProductGroupMag/modules/editGroupDetailBtn.vue

@@ -0,0 +1,108 @@
+<template>
+  <div>
+    <el-button type="text" size="small" @click="editBtn">编辑</el-button>
+    <el-dialog title="产品组明细" append-to-body :visible.sync="dialogTableVisible" width="30%">
+      <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
+        <el-form-item label="商品" prop="product">
+          <el-select v-model="form.product" placeholder="请选择商品">
+            <el-option
+              v-for="item in productList()"
+              :key="item.itemid"
+              :label="item.itemname"
+              :value="item.itemid">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="submit" size="small">确 定</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  data () {
+    return {
+      dialogTableVisible:false,
+      form: {
+        product:''
+      },
+      rules: {
+        product: [
+          { required: true, message: '请选择商品', trigger: 'blur' },
+        ],
+      }
+    }
+  },
+  inject: ['productList'],
+  props:['id','rowData'],
+  watch: {
+    
+  },
+  created() {
+    
+  },
+  methods: {
+    editBtn() {
+      this.form.product = this.rowData.itemid
+      this.dialogTableVisible = true
+    },
+    submit() {
+     this.$refs.form.validate(async val => {
+        if(val) {
+          let res = await this.$api.requested({
+            "accesstoken": "69f1a508bad99ddffdce4bc3c919a0d0",
+            "id": "20220923110303",
+            "version":1,
+            "content": {
+              "sa_itemgroupid":this.id,
+              "itemclassinfos":[
+                {
+                  sa_itemgroupmxid:this.rowData.sa_itemgroupmxid,
+                  itemid:this.form.product
+                }
+              ]
+            }
+          })
+          this.tool.showMessage(res,() => {
+            this.dialogTableVisible = false
+            this.$emit('onSuccess')
+          })
+        }
+     })
+    },
+    handleClose(tag) {
+      this.form.tag.splice(this.form.tag.indexOf(tag), 1);
+    },
+    
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-dialog__body {
+  padding-bottom: 0 !important;
+  padding-top: 10px !important;
+}
+/deep/.dialog-footer {
+  margin-top: 10px !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px) !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-input{
+  width: 100% !important;
+}
+</style>

+ 2 - 1
src/HDrpManagement/ProductGroupMag/modules/list.vue

@@ -14,8 +14,9 @@
         <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
       </template>
       <template v-slot:opreation="scope">
-        <div>
+        <div style="display:flex;justify-content:space-around">
           <slot name="detail" :data="scope.data"></slot>
+          <slot name="groupDetail" :data="scope.data"></slot>
           <slot name="edit" :data="scope.data"></slot>
           <slot name="up" :data="scope.data"></slot>
           <slot name="down" :data="scope.data"></slot>

+ 2 - 4
src/HDrpManagement/ProductGroupMag/modules/table.vue

@@ -5,7 +5,7 @@
         type="selection"
         width="55" @handleSelectionChange="handleSelectionChange" @select-all="selectAll" v-if="checkbox" :selectable="isCheck">
       </el-table-column>
-      <el-table-column :show-overflow-tooltip="col.title == '来源' || col.title == '地址' || col.title == '备注'" v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="col.width">
+      <el-table-column :show-overflow-tooltip="col.title == '来源' || col.title == '地址' || col.title == '备注'" v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="col.width" :fixed="col.columnname === fixedName?'right':false">
         <template slot-scope="scope">
           <!-- 自定义表格显示内容 -->
           <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>
@@ -28,7 +28,7 @@ export default {
     custom:是否启用自定义结构;
     opwidth:操作列宽度
   */
-  props:['layout','data','custom','height','checkbox'],
+  props:['layout','data','custom','height','checkbox','fixedName'],
   data () {
     return {
       list:[],
@@ -49,14 +49,12 @@ export default {
     },
     handleSelectionChange(val) {
       this.upOrDown = val[0] ? val[0].isonsale : ''
-      console.log(this.upOrDown);
       this.$emit('checkboxCallBack',val)      
     },
     selectAll(val) {
 
     },
     cellClass(row){
-      console.log(row)
       if (row.columnIndex === 0) {
         if(this.upOrDown === '') {
           return 'DisableSelection'

+ 1 - 1
src/HDrpManagement/ProductMag/modules/saleClass.vue

@@ -162,6 +162,6 @@ export default {
   cursor: pointer;
 }
 .act{
-  color: #4F7BFD;
+  color: red;
 }
 </style>

+ 18 - 2
src/HManagement/marketing/agent/modules/edit_agent.vue

@@ -89,6 +89,7 @@
         <el-tab-pane label="经销商团队" name="first"></el-tab-pane>
         <el-tab-pane label="业绩目标" name="second"></el-tab-pane>
         <el-tab-pane label="代理区域" name="third"></el-tab-pane>
+        <el-tab-pane label="营销类别" name="saleclass"></el-tab-pane>
       </el-tabs>
     </div>
     <div class="container normal-panel" v-if="activeName === 'first'">
@@ -98,18 +99,24 @@
     <div class="container normal-panel" v-if="activeName === 'third'">
       <salescope></salescope>
     </div>
+    <!--营销类别-->
+    <div class="container normal-panel" v-if="activeName === 'saleclass'">
+      <sale-class></sale-class>
+    </div>
   </div>
 </template>
 
 <script>
 import salescope from './salescope/list.vue'
+import SaleClass from './saleclass/index'
 import selectAgent from '../../../../components/selectAgent/index.vue'
 import arealist from '../../area/list.vue'
 export default {
   components:{
     selectAgent,
     arealist,
-    salescope
+    salescope,
+    SaleClass
   },
   data () {
     return {
@@ -149,7 +156,14 @@ export default {
       arealist:[],
       agent_type:[],
       agent_level:[],
-      tablecols:[]
+      tablecols:[],
+      sys_enterpriseid:''
+    }
+  },
+  /* 企业id */
+  provide() {
+    return {
+      sys_enterpriseid: () => this.sys_enterpriseid
     }
   },
   methods:{
@@ -161,6 +175,8 @@ export default {
             "sa_agentsid": this.$route.query.id
         }
       })
+      this.sys_enterpriseid = res.data.sys_enterpriseid
+      
       let arr = ['province','city','county']
       res.data.value = []
       arr.forEach(e=>{

+ 54 - 0
src/HManagement/marketing/agent/modules/saleclass/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <div>
+    <add-sale-class class="normal-margin" @addSuccess="getClassList" v-if="tool.checkAuth($route.name,'add_saleClass')"/>
+    <tableLayout v-if="saleClassList" :layout="tablecols" :data="saleClassList" :custom="false" height="calc(100vh - 495px)" fixedName="operation">
+      <template v-slot:opreation="scope">
+        <Del v-if="tool.checkAuth($route.name,'delete')" :id="scope.data.sys_enterprise_saleclassid" @onSuccess="getClassList"/>
+      </template>
+    </tableLayout>
+  </div>
+</template>
+
+<script>
+import addSaleClass from './modules/addSaleClass'
+import Del from './modules/del'
+export default {
+  name: '',
+  data() {
+    return {
+      saleClassList:'',
+      tablecols:[]
+    };
+  },
+  components:{addSaleClass,Del},
+  computed:{
+  },
+  watch:{
+  },
+  created() {
+    this.getClassList()
+    this.tablecols = this.tool.tabelCol(this.$route.name)['saleClassTable'].tablecols
+  },
+  methods: {
+    /* 获取类别数据 */
+    async getClassList() {
+      let res = await this.$api.requested({
+        "id": 20220924134502,
+        "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+                "condition": ""
+            }
+        },
+      })
+      console.log(res);
+      this.saleClassList = res.data
+    }
+  },
+};
+</script>
+
+<style scoped>
+
+</style>

+ 135 - 0
src/HManagement/marketing/agent/modules/saleclass/modules/addSaleClass.vue

@@ -0,0 +1,135 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" icon="el-icon-plus" @click="dialogVisible = true">新建
+    </el-button>
+    <el-dialog title="营销类别授权" :visible.sync="dialogVisible" width="400px">
+      <el-cascader v-model="selectArr" ref="select" @change="change" :options="deplist" :props="{ multiple: true, checkStrictly: true }" clearable size="small">
+      </el-cascader>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+        <el-button size="small" type="primary" @click="submit()" :disabled="selectArr.length == 0">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils';
+export default {
+  props: ['data'],
+  data () {
+    return {
+      dialogVisible: false,
+      deplist:[],
+      result:'',
+      selectArr:[]
+    }
+  },
+  created() {
+    this.department()
+  },
+  inject: ['sys_enterpriseid'],
+  methods: {
+    async department () {
+      const res = await this.$api.requested({
+        "id": "20220922110403",
+        "version": 1,
+        "content": {
+          "sa_brandid": 0
+        }
+      })
+      // // 数据格式转换成elementui-tree所需的格式
+      res.data = res.data.map(item => {
+        return {
+          brandname: item.brandname,
+          rowindex: item.rowindex,
+          sa_brandid: item.sa_brandid,
+          itemclassid:item.sa_brandid,
+          value:item.sa_brandid,
+          subdep: item.ttemclass
+        }
+      })
+      this.deplist = this.createMenu(res.data)
+      console.log(this.deplist);
+      
+    },
+    createMenu (array) {
+      var that = this
+      let arr = []
+      function convertToElementTree (node) {
+        // 新节点
+        var elNode = {
+          label: node["brandname"] || node['itemclassname'],
+          parentid: node['parentid'],
+          value: node['itemclassid'],
+          sa_brandid: node['sa_brandid'],
+          changeby: node["changeby"],
+          changedate: node['changedate'],
+          createby: node['createby'],
+          createdate: node['createdate'],
+          itemclassfullname: node['itemclassfullname'],
+          itemclassfullnum: node["itemclassfullnum"],
+          itemclassid: node['itemclassid'],
+          itemclassname: node['itemclassname'],
+          itemclassnum: node['itemclassnum'],
+          children: []
+        }
+        if(elNode.sa_brandid) elNode.disabled = true
+        if (node.subdep && node.subdep.length > 0) {
+          // 如果存在子节点
+          for (var index = 0; index < node.subdep.length; index++) {
+            // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
+            elNode.children.push(convertToElementTree(node.subdep[index]));
+          }
+        }
+        if(elNode.children.length == 0) {
+            delete elNode.children
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        arr.push(convertToElementTree(element))
+      });
+      return arr
+    },
+    async submit() {
+      if(this.selectArr.length == 0) return
+      let res = await this.$api.requested({
+          "id": 20220924134302,
+          "content": {
+              "sys_enterpriseid": this.sys_enterpriseid(), //企业id
+              "itemclassid":this.result
+          },
+      })
+      console.log(res);
+      this.tool.showMessage(res,() => {
+        this.dialogVisible = false
+        this.selectArr = []
+        this.$emit('addSuccess')
+      })
+    },
+    change(data) {
+      let temp = JSON.parse(JSON.stringify(data))
+      temp.forEach(item => {
+        item.shift()
+      })    
+      let temp2 = []
+      temp.forEach(item => {
+        temp2.push(...item)
+      })    
+      temp2 = [...new Set(temp2)]
+      this.result = temp2
+    }
+  }
+}
+
+</script>
+<style scoped>
+/deep/.el-cascader {
+  width: 100%;
+}
+/deep/.el-dialog__body {
+  padding-top: 10px !important;
+  padding-bottom: 0 !important;
+}
+</style>

+ 32 - 0
src/HManagement/marketing/agent/modules/saleclass/modules/del.vue

@@ -0,0 +1,32 @@
+<template>
+  <div class="inline-16">
+    <el-popconfirm
+      title="确定删除吗?"
+      @confirm="deleteRow">
+      <el-button size="small" type="text" slot="reference">删 除</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['id'],
+  methods:{
+    deleteRow () {
+      this.$api.requested({
+        "id": 20220924134402,
+        "content": {
+            "sys_enterprise_saleclassids": [this.id]
+        },
+      }).then(res=>{
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+        })
+      })
+    },
+  }
+}
+
+</script>
+<style>
+</style>

+ 10 - 2
src/SDrpManagement/Products/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <select-class></select-class>
-    <list></list>
+    <select-class @selectClick="selectClick"></select-class>
+    <list ref="list"></list>
   </div>
 </template>
 
@@ -13,6 +13,14 @@ export default {
   components:{
     list,
     selectClass
+  },
+  methods:{
+    selectClick (brandid,itemclassid) {
+      this.$refs['list'].params.content.pageNumber = 1
+      this.$refs['list'].params.content.brandids = [brandid]
+      this.$refs['list'].params.content.itemclassids = [itemclassid]
+      this.$refs['list'].listData()
+    }
   }
 }
 

+ 52 - 10
src/SDrpManagement/Products/modules/ProductDetails.vue

@@ -3,24 +3,24 @@
   <div class="product-detail container">
     <el-row :gutter="20">
       <el-col :span="7">
-        <img style="width:100%" src="http://oms.idcgroup.com.cn:8082/samex/servlet/attchdown/3459" alt="">
+        <img style="width:100%" :src="mainData.attinfos?mainData.attinfos[0].url:''">
       </el-col>
       <el-col :span="17">
         <div>
-          <p class="productName normal-margin">铜本色等径直通</p>
-          <p class="normal-margin" style="color:#888;">编码:&emsp;BM8270 0540000</p>
-          <p class="normal-margin">价格:<span style="color:red;font-size:1.25rem">&emsp;¥199</span></p>
+          <p class="productName normal-margin">{{mainData.itemname}}</p>
+          <p class="normal-margin" style="color:#888;">编码:&emsp;{{mainData.itemno}}</p>
+          <p class="normal-margin">价格:&emsp;<span class="product-price">¥{{mainData.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{mainData.gradeprice}}</span></p>
           <div class="line normal-margin"></div>
           <div>
-            <p class="normal-margin">规格:</p>
+            <p class="normal-margin">规格:{{mainData.spec}}</p>
           </div>
           <div class="flex-align-center" style="margin-bottom:30px">
             <p>数量:&emsp;</p>
-            <el-input-number v-model="num" :min="1" :max="10" label="描述文字"></el-input-number>
+            <el-input-number v-model="num" :min="mainData.orderminqty" :step="mainData.orderaddqty" label="描述文字"></el-input-number>
           </div>
-          <p class="normal-margin">型号:&emsp;--</p>
-          <p class="normal-margin">材质:&emsp;--</p>
-          <el-button class="normal-margin" type="primary" style="width:200px">加入购物车</el-button>
+          <p class="normal-margin">型号:&emsp;{{mainData.model}}</p>
+          <p class="normal-margin">材质:&emsp;{{mainData.model}}</p>
+          <el-button class="normal-margin" type="primary" style="width:200px" @click="insertToShopCart">加入购物车</el-button>
           <div>
             <p>相关链接</p>
           </div>
@@ -35,8 +35,36 @@
 export default {
   data () {
     return {
-      num:0
+      num:0,
+      mainData:{}
     }
+  },
+  methods:{
+    async productDetailData () {
+      const res = await this.$api.requested({
+        "id": 20220927130202,
+        "content": {
+          "itemid": this.$route.query.id
+        }
+      })
+      this.mainData = res.data
+      this.num = res.data.orderminqty
+    },
+    async insertToShopCart () {
+      const res = await this.$api.requested({
+        "id": 20220924095102,
+        "content": {
+            "sa_brandid": this.mainData.sa_brandid, //品牌id
+            "itemid": this.mainData.itemid, //货品id
+            "qty": this.num, //数量
+            "itemno": this.mainData.itemno //货品编号
+        },
+      })
+      this.tool.showMessage(res)
+    }
+  },
+  mounted () {
+    this.productDetailData()
   }
 }
 
@@ -64,4 +92,18 @@ export default {
 .border-left {
   border-left:1px solid #e3e5ea
 }
+.product-price {
+  font-size: 1.25rem !important;
+  color: red;
+}
+.product-itemno{
+  font-size: 12px;
+  color:#888;
+  margin-bottom: 20px;
+}
+.text-throughline{
+  font-size: 14px;
+  text-decoration: line-through;
+  color:#999
+}
 </style>

+ 41 - 7
src/SDrpManagement/Products/modules/Select.vue

@@ -1,10 +1,12 @@
 <template>
   <div class="container border-bottom">
     <ul class="flex-align-center normal-margin">
-      <li :class="brand_act === item.sa_brandid?'act':''" class="brand-item" v-for="item in brands" :key="item.sa_brandid" @click="(brand_act = item.sa_brandid)">{{item.brandname}}</li>
+      <li :class="brand_act === item.sa_brandid?'act':''" class="brand-item" v-for="item in brands" :key="item.sa_brandid" @click="selectClick(brand_act = item.sa_brandid)">{{item.brandname}}</li>
     </ul>
-    <div>
-
+    <div style="font-size:14px">
+      <ul class="flex-align-center normal-margin">
+        <li :class="class_act === item.itemclassid?'act':''" class="class-item" v-for="item in classlist" :key="item.itemclassid" @click="selectClick(class_act = item.itemclassid)">{{item.itemclassname}}</li>
+      </ul>
     </div>
   </div>
 </template>
@@ -14,11 +16,13 @@ export default {
   data () {
     return {
       brands:[],
-      brand_act:0
+      classlist:[],
+      brand_act:0,
+      class_act:0
     }
   },
   methods:{
-    async queryBrands () {
+    async queryBrands (fn) {
       const res = await this.$api.requested({
         "id": "20220924163702",
         "version":1,
@@ -30,10 +34,31 @@ export default {
         }
       })
       this.brands = res.data
+      this.brand_act = res.data[0].sa_brandid
+      fn()
+    },
+    async querySaleClass () {
+      const res = await this.$api.requested({
+        "id": "20220926095202",
+        "version":1,
+        "content": {
+          "pageSize":1000,
+          "where":{
+            "condition":""
+          }
+        }
+      })
+      this.classlist = res.data
+      this.class_act = res.data[0].itemclassid
+      this.selectClick()
+     
+    },
+    selectClick () {
+      this.$emit('selectClick',this.brand_act,this.class_act)
     }
   },
   mounted () {
-    this.queryBrands()
+    this.queryBrands(this.querySaleClass)
   }
 }
 
@@ -46,9 +71,18 @@ export default {
   color: #768093;
   cursor: pointer;
   transition: .2s all linear;
+  font-weight: 700;
+}
+.class-item{
+  margin-right: 20px;
+  color: #8491a9;
+  cursor: pointer;
+  transition: .2s all linear;
+  font-size: 13px;
+  font-weight: 400;
 }
 .act{
-  color:#000;
+  color:red;
 }
 .border-bottom{
   border-bottom: 1px solid #e3e5ea;

+ 12 - 7
src/SDrpManagement/Products/modules/list.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <div class="container">
-      <el-row :gutter="20">
-        <el-col @click.native="$router.push({path:'/ProductDetails'})" :span="4" v-for="item in list" :key="item.index">
+    <div class="container" v-if="list.length > 0">
+      <el-row style="height:calc(100vh - 300px);overflow-y:scroll" :gutter="20">
+        <el-col @click.native="$router.push({path:'/ProductDetails',query:{id:item.itemid}})" :span="4" v-for="item in list" :key="item.index">
           <div class="product-card">
             <div class="product-image">
               <img style="width:100%" :src="item.attinfos[0]?item.attinfos[0].url:''" alt="">
@@ -11,7 +11,7 @@
               <p>{{item.itemname}}</p>
               <p class="product-itemno">编码:{{item.itemno}}</p>
               <div class="flex-align-center flex-between">
-                <p><span class="product-price">¥{{item.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{item.gradeprice}}</span></p>
+                <p><span class="product-price">¥{{item.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{item.oldprice}}</span></p>
                 <div class="shopcart-btn">
                   <i @click.stop="insertToShopCart(item)" style="font-size:1.5rem;color:#666" class="el-icon-shopping-cart-2"></i>
                 </div>
@@ -33,6 +33,9 @@
         </el-pagination>
     </div>
     </div>
+    <div style="height:calc(100vh - 300px)" class="flex-align-center flex-around" v-else>
+      <el-empty :image="emptyUrl" description="暂无商品"></el-empty>
+    </div>
   </div>
 </template>
 
@@ -49,8 +52,10 @@ export default {
             "condition": ''
           },
           "brandids":[],
+          "itemclassids": [],
         }
       },
+      emptyUrl:require('../../../assets/Empty.png'),
       list:[],
       total:0,
       currentPage:0
@@ -78,9 +83,9 @@ export default {
       const res = await this.$api.requested({
         "id": 20220924095102,
         "content": {
-          "sa_brandid": item.sa_brandid, //品牌id
+          "sa_brandid": this.params.content.brandids[0], //品牌id
           "itemid": item.itemid, //货品id
-          "qty": 1, //数量
+          "qty": item.orderminqty, //数量
           "itemno": item.itemno //货品编号
         }
       })
@@ -92,7 +97,7 @@ export default {
     }
   },
   mounted () {
-    this.listData()
+    // this.listData()
   }
 }
 

+ 39 - 0
src/SDrpManagement/shopCart/index.vue

@@ -1 +1,40 @@
+<template>
+  <div>
+    <list ref="list" @selection="selection">
+      <template v-slot:del="scope">
+        <on-del :data="scope.data" @onSuccess="onSuccess"></on-del>
+      </template>
+    </list>
+    <total ref="total" :data="selectedProduct" @onSuccess="onSuccess"></total>
+  </div>
+</template>
 
+<script>
+import list from './modules/list'
+import onDel from './modules/del'
+import total from './modules/total'
+export default {
+  components:{
+    list,
+    onDel,
+    total
+  },
+  data () {
+    return {
+      selectedProduct:[]
+    }
+  },
+  methods:{
+    onSuccess () {
+      this.$refs['list'].listData()
+    },
+    selection (val) {
+      this.selectedProduct = val
+      this.$refs['total'].totalPrice(val)
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 30 - 0
src/SDrpManagement/shopCart/modules/del.vue

@@ -0,0 +1,30 @@
+<template>
+  <div style="display:inline;margin:0 16px">
+    <el-popconfirm
+      title="确定删除当前商品吗?"
+      @confirm="deleteRow()">
+      <el-button slot="reference" size="small" type="text">删 除</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data'],
+  methods:{
+    deleteRow () {
+      this.$api.requested({
+        "id": 20220924095202,
+        "content": {
+          "sa_shoppingcartids": [this.data.sa_shoppingcartid]
+        },
+      }).then(res=>{
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+        })
+      })
+    },
+  }
+}
+
+</script>

+ 16 - 20
src/SDrpManagement/shopCart/modules/list.vue

@@ -1,5 +1,5 @@
 <template>
-<div class="container"> 
+<div class="container normal-panel"> 
   <div class="flex-align-center flex-between normal-margin">
     <slot name="operation"></slot>
     <div class="flex-align-center">
@@ -11,7 +11,7 @@
     <el-table
       ref="multipleTable"
       :data="tableData"
-      style="width: 100%"
+      style="width: 100%;height:calc(100vh - 296px)"
       :header-cell-style="{height:'50px',color:'#768093',fontWeight:'100'}"
       :cell-style="{height:'50px',color:'#768093',fontWeight:'200'}"
       @selection-change="selectionChange">
@@ -19,15 +19,6 @@
         type="selection"
         width="55">
       </el-table-column>
-      <el-table-column
-        align="center"
-        prop="isonsale"
-        label="上架状态"
-        width="80">
-        <template slot-scope="scope">
-          <slot name="onsale" :data="scope.row"></slot>
-        </template>
-      </el-table-column>
       <el-table-column
         align="center"
         label="产品图"
@@ -53,11 +44,10 @@
         </template>
       </el-table-column>
       <el-table-column
-        prop="unitid"
-        label="起订量/增量"
+        label="数量"
         width="150">
         <template slot-scope="scope">
-          <p><span>{{scope.row.orderminqty}}</span>&nbsp;/&nbsp;<span>{{scope.row.orderaddqty}}</span></p>
+        <el-input-number size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" :step="scope.row.orderaddqty" label="输入数量"></el-input-number>
         </template>
       </el-table-column>
       <el-table-column
@@ -69,17 +59,22 @@
         </template>
       </el-table-column>
       <el-table-column
-        prop="status"
-        label="状态"
+        prop="gradeprice"
+        label="价格"
         width="90">
         <template slot-scope="scope">
-          <span :style="scope.row.status === '新建'?{color:'#52C41A'}:{color:'red'}">{{scope.row.status}}</span>
+          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.gradeprice,2)}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="小计"
+        width="150">
+        <template slot-scope="scope">
+          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.gradeprice * scope.row.qty,2)}}</p>
         </template>
       </el-table-column>
-      <el-table-column width="280">
+      <el-table-column width="90">
         <template slot-scope="scope">
-          <slot name="setimage" :data="scope.row"></slot>
-          <slot name="edit" :data="scope.row"></slot>
           <slot name="del" :data="scope.row"></slot>
         </template>
       </el-table-column>
@@ -144,6 +139,7 @@ export default {
     },
     selectionChange (val) {
       this.tableSelectData = val
+      this.$emit('selection',val)
     },
     clearSelection () {
       this.$refs.multipleTable.clearSelection();

+ 80 - 0
src/SDrpManagement/shopCart/modules/total.vue

@@ -0,0 +1,80 @@
+<template>
+  <div class="total-panel normal-panel flex-align-center flex-between">
+    <p class="text-grey" @click="deleSelectProd">删除选中商品</p>
+    <div class="flex-align-center">
+      <div class="prcieInfo">
+        <p>共&nbsp;{{data.length}}&nbsp;件商品&emsp;总价 : <span class="price">¥&nbsp;{{tool.formatAmount(total,2)}}</span></p>
+        <p class="text-grey">已节省:-¥0.00</p>
+      </div>
+      <div class="submitBtn">生成订单</div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data'],
+  data () {
+    return {
+      total:0
+    }
+  },
+  methods:{
+    totalPrice (val) {
+      this.total = 0
+      val.forEach(element => {
+        this.total += element.gradeprice * element.qty
+      });
+    },
+    async deleSelectProd ()  {
+      const res = this.$api.requested({
+        "id": 20220924095202,
+        "content": {
+          "sa_shoppingcartids": this.data.map(e=>{return e.sa_shoppingcartid})
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.$emit('onSuccess')
+      })
+    }
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.total-panel{
+  height: 60px;
+  text-align: right;
+  border-top:1px solid rgb(0 0 0 / 5%);
+  padding-left:10px
+}
+.submitBtn{
+  width: 150px;
+  height: 60px;
+  line-height: 60px;
+  text-align: center;
+  color:#fff;
+  background: red;
+  cursor: pointer;
+}
+.prcieInfo{
+  height: 50px;
+  font-size: 14px;
+  padding: 5px 0;
+  margin-right: 10px;
+}
+.text-grey{
+  font-size: 12px;
+  color: #999;
+  cursor: pointer;
+}
+.deletBtn:hover{
+  color: red;
+}
+.price{
+  font-size: 1.25rem;
+  color: red;
+}
+</style>

BIN
src/assets/Empty.png


BIN
src/assets/icons/Empty state_money.png


+ 10 - 0
src/router/SDrpManagement.js

@@ -18,5 +18,15 @@ const SDrpManagement = [
     },
     component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/Products/modules/ProductDetails.vue')
   },
+  {
+    path: '/shopCart',
+    name: 'shopCart',
+    meta: {
+      title: '购物车',
+      ast_nav:true,
+      keeproute: true
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/shopCart/index.vue')
+  },
 ]
 export default SDrpManagement

+ 3 - 0
src/style/style.css

@@ -46,6 +46,9 @@ ul{
 .flex-between{
   justify-content: space-between;
 }
+.flex-around{
+  justify-content: space-around;
+}
 .flex-end{
   justify-content: flex-end;
 }

+ 17 - 0
src/utils/tool.js

@@ -105,4 +105,21 @@ export default {
     const res = new Map();
     return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
   },
+  
+  // 金额格式化
+  formatAmount(amount, decimalDigits = 0) {
+    const amountStr = String(Number(amount).toFixed(decimalDigits))
+    const reg = /\B(?=(?:\d{3})+$)/g
+    // 是否是小数
+    const isDecimal = amountStr.indexOf('.') > -1
+    if (isDecimal) {
+       // 整数部分
+       const integerPart = amountStr.substring(0, amountStr.indexOf('.'))
+       // 小数部分
+       const decimalPart = amountStr.substring(amountStr.length, amountStr.indexOf('.'))
+       return `${integerPart.replace(reg, ',')}${decimalPart}`
+    } else {
+      return amountStr.replace(reg, ',')
+    }
+  }
 }