Browse Source

提交商品类别和上架商品列表

caojunjie 3 years ago
parent
commit
a9fedc3bc9

+ 35 - 0
src/api/mallManagement/commodity/configuration.js

@@ -0,0 +1,35 @@
+import request from '@/router/axios';
+
+//商城商品类别列表查询
+export function customerList(data) {
+    return request({
+        url: '/api/store-goods/goodstype/page',
+        method: 'get',
+        params: data
+    })
+}
+//商城商品类别列表修改和新增
+export function typeSave(data) {
+    return request({
+        url: '/api/store-goods/goodstype/submit',
+        method: 'post',
+        data: data
+    })
+}
+//商城商品类别列表查看明细
+export function detail(data) {
+    return request({
+        url: '/api/store-goods/goodstype/detail?id='+data,
+        method: 'get'
+    })
+}
+//商城商品类别列表删除
+export function deleteDetails(data) {
+    return request({
+        url: '/api/store-goods/goodstype/remove',
+        method: 'post',
+        params: {
+            ids:data
+        }
+    })
+}

+ 170 - 0
src/api/mallManagement/commodity/productList.js

@@ -0,0 +1,170 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params, goodsTypeId) => {
+    return request({
+        url: '/api/store-goods/goodsdesc/list',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size,
+            goodsTypeId,
+        }
+    })
+}
+
+export const remove = (id) => {
+    return request({
+        url: '/api/store-goods/goodsdesc/remove',
+        method: 'post',
+        params: {
+            ids:id
+        }
+    })
+}
+
+export const add = (row) => {
+    return request({
+        url: '/api/blade-client/goodsdesc/submit',
+        method: 'post',
+        data: row
+    })
+}
+
+export const update = (row) => {
+    return request({
+        url: '/api/blade-client/goodsdesc/update',
+        method: 'post',
+        data: row
+    })
+}
+
+export const updatePlatform = (userId, userType, userExt) => {
+    return request({
+        url: '/api/blade-user/update-platform',
+        method: 'post',
+        params: {
+            userId,
+            userType,
+            userExt,
+        }
+    })
+}
+
+export const getUser = (id) => {
+    return request({
+        url: '/api/blade-client/goodsdesc/detail',
+        method: 'get',
+        params: {
+            id,
+        }
+    })
+}
+
+export const getUserPlatform = (id) => {
+    return request({
+        url: '/api/blade-user/platform-detail',
+        method: 'get',
+        params: {
+            id,
+        }
+    })
+}
+
+export const getUserInfo = () => {
+    return request({
+        url: '/api/blade-user/info',
+        method: 'get',
+    })
+}
+
+export const resetPassword = (userIds) => {
+    return request({
+        url: '/api/blade-user/reset-password',
+        method: 'post',
+        params: {
+            userIds,
+        }
+    })
+}
+
+export const updatePassword = (oldPassword, newPassword, newPassword1) => {
+    return request({
+        url: '/api/blade-user/update-password',
+        method: 'post',
+        params: {
+            oldPassword,
+            newPassword,
+            newPassword1,
+        }
+    })
+}
+
+export const updateInfo = (row) => {
+    return request({
+        url: '/api/blade-user/update-info',
+        method: 'post',
+        data: row
+    })
+}
+
+export const grant = (userIds, roleIds) => {
+    return request({
+        url: '/api/blade-user/grant',
+        method: 'post',
+        params: {
+            userIds,
+            roleIds,
+        }
+    })
+}
+
+export const getDeptLazyTree = (parentId) => {
+    return request({
+        url: '/api/store-goods/goodstype/page',
+        method: 'get',
+        params: {
+            parentId
+        }
+    })
+}
+
+export const getDeptTree = (tenantId) => {
+    return request({
+        url: '/api/blade-client/goodstype/tree',
+        method: 'get',
+        params: {
+            tenantId,
+        }
+    })
+}
+
+export const updateDetail = (params) => {
+    return request({
+        url: '/api/store-goods/goodsdesc/modify',
+        method: 'post',
+        data:params
+    })
+}
+
+export const getDetail = (id) => {
+    return request({
+        url: '/api/store-goods/goodsdesc/detail',
+        method: 'get',
+        params:{
+            id:id
+        }
+    })
+}
+
+export const priceDelete = (id) => {
+    return request({
+        url: '/api/blade-client/goodsdesc/priceDelete',
+        method: 'delete',
+        params: {
+            id:id
+        }
+    })
+}
+
+

+ 31 - 0
src/router/views/index.js

@@ -102,6 +102,22 @@ export default [{
             }
         ]
     },
+    //商城管理
+    //商品列表详情页
+    {
+        path: '/productList_detailsPageEdit',
+        component: Layout,
+        hidden: true,
+        children: [
+            {
+                path: '/productList_detailsPageEdit',
+                meta: {
+                    i18n: 'productList_detailsPageEdit'
+                },
+                component: () => import( /* webpackChunkName: "views" */ '@/views/mallManagement/commodity/productList/detailsPageEdit')
+            }
+        ]
+    },
   //产品
   {
     path: '/productInfo_detailsPageEdit',
@@ -199,6 +215,21 @@ export default [{
             }
         ]
     },
+    //上架商品详情页
+    {
+        path: '/goodsOnTheShelves_detailsPageEdit',
+        component: Layout,
+        hidden: true,
+        children: [
+            {
+                path: '/goodsOnTheShelves_detailsPageEdit',
+                meta: {
+                    i18n: 'goodsOnTheShelves_detailsPageEdit'
+                },
+                component: () => import( /* webpackChunkName: "views" */ '@/views/maintenance/goodsOnTheShelves/detailsPageEdit')
+            }
+        ]
+    },
     //收货单详情页
     {
         path: '/businessManagement/receipt/index',

+ 4 - 40
src/views/maintenance/goodsOnTheShelves/configuration/specification.json

@@ -3,7 +3,7 @@
   "border": true,
   "index": true,
   "viewBtn": false,
-  "editBtn": false,
+  "editBtn": true,
   "delBtn": false,
   "addBtn": true,
   "addBtnText": "新增明细",
@@ -17,54 +17,24 @@
       "cell": true
     },
     {
-      "label": "材质",
-      "prop": "texture",
-      "minWidth": 100,
-      "cell": true
-    },
-    {
-      "label": "颜色",
-      "prop": "colour",
-      "minWidth": 100,
-      "cell": true
-    },
-    {
-      "label": "描述",
+      "label": "商品名称",
       "prop": "desgasdacribe",
       "minWidth": 100,
       "cell": true
     },
     {
-      "label": "选择活动",
-      "prop": "desfasdacribe",
-      "minWidth": 100,
-      "cell": true
-    },
-    {
-      "label": "原始价格",
+      "label": "价格",
       "prop": "descasdaribe",
       "minWidth": 100,
       "cell": true
     },
     {
-      "label": "活动价格",
-      "prop": "deadsdscribe",
-      "minWidth": 100,
-      "cell": true
-    },
-    {
-      "label": "活动库存",
+      "label": "库存",
       "prop": "descrdasdibe",
       "minWidth": 100,
       "cell": true
     },
     {
-      "label": "普通库存",
-      "prop": "describdasde",
-      "minWidth": 100,
-      "cell": true
-    },
-    {
       "label": "标签",
       "prop": "describeads",
       "minWidth": 100,
@@ -90,12 +60,6 @@
           "trigger": "blur"
         }
       ]
-    },
-    {
-      "label": "备注",
-      "prop": "remarks",
-      "minWidth": 100,
-      "cell": true
     }
   ]
 }

+ 18 - 105
src/views/maintenance/goodsOnTheShelves/detailsPageEdit.vue

@@ -42,14 +42,6 @@
                 size="small"
                 icon="el-icon-edit"
                 type="text"
-                @click.stop="rowSftEdit(row, index)"
-            >
-              {{ row.$cellEdit ? "保存" : "编辑" }}
-            </el-button>
-            <el-button
-                size="small"
-                icon="el-icon-edit"
-                type="text"
                 @click.stop="rowSftDel(row, index)">
               删除
             </el-button>
@@ -153,19 +145,7 @@ export default {
         labelWidth: 100,
         column: [
           {
-            label: "产品编码",
-            prop: "code",
-            span: 8,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ],
-          },
-          {
-            label: "产品名称",
+            label: "宝贝标题",
             prop: "cname",
             span: 8,
             rules: [
@@ -178,7 +158,7 @@ export default {
             slot: true
           },
           {
-            label: "产品分类",
+            label: "宝贝类型",
             prop: "goodsTypeId",
             span: 8,
             rules: [
@@ -190,8 +170,8 @@ export default {
             ],
           },
           {
-            label: "花纹",
-            prop: "brandItem",
+            label: "产品分类",
+            prop: "goodsTypeId",
             span: 8,
             rules: [
               {
@@ -214,89 +194,29 @@ export default {
             ],
           },
           {
-            label: "状态",
-            prop: "status",
-            span: 8,
-            type: 'select',
-            dicData: [{
-              label: '正常',
-              value: 0
-            }, {
-              label: '停用',
-              value: 1
-            }],
-          },
-          {
-            label: "规格",
-            prop: "specs",
-            span: 8,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ],
-          },
-          {
-            label: "规格1",
-            prop: "specsOne",
-            span: 8,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ],
-          },
-          {
-            label: "规格2",
-            prop: "specsTwo",
+            label: "库存计数",
+            prop: "sex",
             span: 8,
-            rules: [
+            type: "radio",
+            dicData: [
               {
-                required: true,
-                message: " ",
-                trigger: "blur"
+                label: '拍下减库存',
+                value: 0
+              }, {
+                label: '付款减库存',
+                value: 1
               }
             ],
-          },
-          {
-            label: "级别",
-            prop: "level",
-            span: 8,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ],
-          },
-          {
-            label: "产地",
-            prop: "placeProduction",
-            span: 8,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ],
-          },
-          {
-            label: "三包",
-            prop: "threeGuarantees",
-            span: 8,
+            mock:{
+              type:'dic'
+            }
           },
           {
             label: "备注",
             prop: "remarks",
             type: "textarea",
             minRows: 2,
-            span: 24
+            span: 8
           }
         ]
       },
@@ -389,13 +309,6 @@ export default {
       };
       img.src = _URL.createObjectURL(file);
     },
-    rowSftEdit(row) {
-      if (row.$cellEdit == true) {
-        this.$set(row, "$cellEdit", false);
-      } else {
-        this.$set(row, "$cellEdit", true);
-      }
-    },
     addSftRow() {
       this.sftData.push({
         $cellEdit: true,
@@ -446,7 +359,7 @@ export default {
     backToList() {
       this.$router.$avueRouter.closeTag();
       this.$router.push({
-        path: '../index',
+        path: '/maintenance/goodsOnTheShelves/index',
         query: {}
       });
     }

+ 3 - 3
src/views/maintenance/goodsOnTheShelves/index.vue

@@ -260,21 +260,21 @@ export default {
     //查看跳转页面
     beforeOpenPage(row, index) {
       this.$router.push({
-        path: "/productInfo_detailsPageEdit",
+        path: "/goodsOnTheShelves_detailsPageEdit",
         query: { id: JSON.stringify(row.id) }
       });
     },
     //新增跳转页面
     beforeOpenE(row, index) {
       this.$router.push({
-        path: "/productInfo_detailsPageEdit",
+        path: "/goodsOnTheShelves_detailsPageEdit",
         query: { id: JSON.stringify(row.id),treeDeptId:this.treeDeptId }
       });
     },
     //编辑跳转页面
     editOpen(row, index) {
       this.$router.push({
-        path: "/productInfo_detailsPageEdit",
+        path: "/goodsOnTheShelves_detailsPageEdit",
         query: { id: JSON.stringify(row.id) }
       });
     },

+ 105 - 0
src/views/mallManagement/commodity/classification/configuration/mainList.json

@@ -0,0 +1,105 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 300,
+  "column": [
+    {
+      "label": "商品类型",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 280,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入商品类型",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTimeA",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "searchRange":true,
+      "hide": true,
+      "addDisplay": false,
+      "viewDisplay": false,
+      "search": true,
+      "editDisplay":false,
+      "index": 2,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入创建时间",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "上级类型",
+      "prop": "parentId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "rules": [{
+        "required": false,
+        "message": "请选择上级机构",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 5,
+      "width": 60,
+      "rules": [{
+        "required": true,
+        "message": "请输入排序",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "状态",
+      "type": "select",
+      "prop": "status",
+      "search": true,
+      "index": 4,
+      "width": 100,
+      "value":0,
+      "dicData": [{
+        "label": "正常",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入状态",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 204 - 0
src/views/mallManagement/commodity/classification/index.vue

@@ -0,0 +1,204 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               @row-del="rowDel"
+               @row-update="rowUpdate"
+               :before-open="beforeOpen"
+               :before-close="beforeClose"
+               :table-loading="loading"
+               @row-save="rowSave"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad"
+               @tree-load="treeLoad">
+      <template slot-scope="scope" slot="menu">
+        <el-button
+            type="text"
+            icon="el-icon-circle-plus-outline"
+            size="small"
+            @click.stop="handleAdd(scope.row,scope.index)"
+        >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import {customerList, typeSave,detail,deleteDetails} from "@/api/mallManagement/commodity/configuration"
+
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      form: {},
+      option: option,
+      loading:false,
+      parentId:0,
+      dataList: [],
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0,
+      },
+      query:{}
+    }
+  },
+  created() {
+
+  },
+  methods: {
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+            return deleteDetails(row.id);
+          }).then(() => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            // 数据回调进行刷新
+            done(row);
+          });
+    },
+    //修改时的修改按钮点击触发
+    rowUpdate(row, index, done, loading) {
+      typeSave(row).then(() => {
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        // 数据回调进行刷新
+        done(row);
+        this.onLoad(this.page);
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    //新增修改时保存触发
+    rowSave(row, done, loading) {
+      typeSave(row).then(res => {
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done(row)
+        this.onLoad(this.page);
+
+      }, error => {
+        window.console.log(error);
+        loading();
+      })
+    },
+    //查询全部
+    initData(){
+      customerList().then(res => {
+        const column = this.findObject(this.option.column, "parentId");
+        column.dicData = res.data.data.records;
+      });
+    },
+    //新增子项触发
+    handleAdd(row) {
+      this.parentId = row.id;
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = row.id;
+      column.addDisabled = true;
+      this.$refs.crud.rowAdd();
+    },
+    //新增子项和新增触发查询所有
+    beforeOpen(done, type) {
+      if (["add", "edit"].includes(type)) {
+        this.initData();
+      }
+      if (["edit", "view"].includes(type)) {
+        detail(this.form.id).then(res => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    //点击新增时触发
+    beforeClose(done) {
+      this.parentId = "";
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = "";
+      column.addDisabled = false;
+      done();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      params.parentId = 0
+      this.onLoad(this.page, params);
+      done()
+    },
+    searchReset() {
+      console.log('1')
+    },
+    selectionChange() {
+      console.log('1')
+    },
+    currentChange() {
+      console.log('1')
+    },
+    sizeChange() {
+      console.log('1')
+    },
+    refreshChange() {
+      console.log('1')
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      const {createTimeA} = this.query;
+      let values = {
+        ...params,
+        size:this.page.pageSize,
+        current:this.page.currentPage
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + ' 00:00:00',
+          endTime: createTimeA[1] + ' 23:59:59',
+          ...this.query,
+          size:this.page.pageSize,
+          current:this.page.currentPage
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0
+      customerList(values).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.loading = false;
+      })
+    },
+    //树桩列点击展开触发
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      customerList({parentId:parentId}).then(res => {
+        resolve(res.data.data.records);
+      });
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 87 - 0
src/views/mallManagement/commodity/productList/configuration/imgUploadList.json

@@ -0,0 +1,87 @@
+{
+  "lazy": true,
+  "align": "center",
+  "menuAlign": "left",
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "dialogWidth": "60%",
+  "tree": true,
+  "refreshBtn": false,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menuWidth": 300,
+  "dialogClickModal": false,
+  "addBtnText": "上  传",
+  "column": [{
+    "label": "文件名称",
+    "prop": "fileName",
+    "index": 1,
+    "width": 100,
+    "rules": [
+      {
+        "required": true,
+        "message": "请输入文件名称",
+        "trigger": "blur"
+      }
+    ]
+  },{
+    "label": "备注",
+    "prop": "remarks",
+    "index": 2,
+    "width": 100,
+    "rules": [
+      {
+        "required": false,
+        "message": "请输入备注",
+        "trigger": "blur"
+      }
+    ]
+  }, {
+    "label": "图片",
+    "prop": "img",
+    "type": "upload",
+    "index": 3,
+    "width": 150,
+    "listType": "picture-img",
+    "span": 24,
+    "tip": "只能上传jpg/png/jpeg文件,且不超过2M,宽高比为1:1",
+    "action": "/api/blade-resource/oss/endpoint/put-file",
+    "dataType": "string",
+    "propsHttp": {
+      "res": "data",
+      "url": "link"
+    },
+    "rules": [
+      {
+        "required": true,
+        "message": "请上传图片",
+        "trigger": "blur"
+      }
+    ]
+  },
+    {
+      "label": "商品详情轮播",
+      "prop": "string",
+      "dataType": "string",
+      "type": "upload",
+      "propsHttp": {
+        "res": "data",
+        "url": "link"
+      },
+      "span": 24,
+      "listType": "picture-card",
+      "tip": "只能上传jpg/png/jpeg文件,且不超过2M,宽为750,高不大于1000",
+      "action": "/api/blade-resource/oss/endpoint/put-file",
+      "rules": [
+        {
+          "required": true,
+          "message": "请上传图片",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 79 - 0
src/views/mallManagement/commodity/productList/configuration/mainList.json

@@ -0,0 +1,79 @@
+
+{
+  "height": "auto",
+  "calcHeight": 80,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuSpan": 12,
+  "searchMenuPosition": "right",
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "dialogClickModal": false,
+  "column": [
+    {
+      "label": "商品主图",
+      "prop": "code",
+      "search": true,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "商品名称",
+      "prop": "cname",
+      "search": true,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "VIP价格",
+      "prop": "brand",
+      "width": 100
+    },
+    {
+      "label": "价格",
+      "prop": "brandItem",
+      "width": 100
+    },
+    {
+      "label": "数据统计",
+      "prop": "specs",
+      "width": 100
+    },
+    {
+      "label": "限时精选",
+      "prop": "specsOne",
+      "width": 100
+    },
+    {
+      "label": "热门推荐",
+      "prop": "specsTwo",
+      "width": 100
+    },
+    {
+      "label": "标签",
+      "prop": "level",
+      "width": 100
+    },
+    {
+      "label": "状态",
+      "prop": "remarks",
+      "width": 100
+    }
+  ]
+}

+ 25 - 0
src/views/mallManagement/commodity/productList/configuration/productParameters.json

@@ -0,0 +1,25 @@
+
+{
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": 130,
+  "column": [
+    {
+      "label": "参数名称",
+      "prop": "cname",
+      "minWidth": 100,
+      "cell": true
+    },
+    {
+      "label": "参数",
+      "prop": "cname",
+      "minWidth": 100,
+      "cell": true
+    }
+  ]
+}

+ 302 - 0
src/views/mallManagement/commodity/productList/configuration/specification.json

@@ -0,0 +1,302 @@
+
+{
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": true,
+  "delBtn": false,
+  "addBtn": true,
+  "addBtnText": "新增明细",
+  "align": "center",
+  "menuWidth": 130,
+  "column": [
+    {
+      "label": "规格名称",
+      "prop": "cname",
+      "minWidth": 100,
+      "span": 24
+    },
+    {
+      "label": "限时精选",
+      "prop": "isHandpick",
+      "type": "checkbox",
+      "minWidth": 100,
+      "cell": true,
+      "dicData": [{
+        "label": "显示",
+        "value": "false"
+      }],
+      "mock":{
+        "type":"dic"
+      },
+      "span": 24
+    },
+    {
+      "label": "热门推荐",
+      "prop": "isRecommended",
+      "type": "checkbox",
+      "minWidth": 100,
+      "cell": true,
+      "dicData": [{
+        "label": "显示",
+        "value": "false"
+      }],
+      "mock":{
+        "type":"dic"
+      },
+      "span": 24
+    },
+    {
+      "label": "商品标签",
+      "prop": "goodsTitel",
+      "type": "checkbox",
+      "minWidth": 100,
+      "cell": true,
+      "dicData": [{
+        "label": "家电",
+        "value": "false"
+      },{
+        "label": "箱包",
+        "value": "false"
+      },{
+        "label": "饰品",
+        "value": "false"
+      },{
+        "label": "服装",
+        "value": "false"
+      },{
+        "label": "手机",
+        "value": "false"
+      },{
+        "label": "轮胎",
+        "value": "false"
+      },{
+        "label": "耗材",
+        "value": "false"
+      },{
+        "label": "数码",
+        "value": "false"
+      }],
+      "mock":{
+        "type":"dic"
+      },
+      "span": 24
+    },
+    {
+      "label": "服务标签",
+      "prop": "serviceTitel",
+      "type": "checkbox",
+      "minWidth": 100,
+      "cell": true,
+      "dicData": [{
+        "label": "假一赔十",
+        "value": "false"
+      },{
+        "label": "假一赔三",
+        "value": "false"
+      },{
+        "label": "极速退款",
+        "value": "false"
+      },{
+        "label": "7天无理由退换",
+        "value": "false"
+      }],
+      "mock":{
+        "type":"dic"
+      },
+      "span": 24
+    },
+    {
+      "label": "商城价",
+      "prop": "price",
+      "minWidth": 100,
+      "type": "number",
+      "span": 24,
+      "precision":2,
+      "mock":{
+        "type":"number",
+        "max":1,
+        "min":2,
+        "precision":2
+      },
+      "minRows": 0,
+      "maxRows": 3,
+      "row":true,
+      "controls":false
+    },
+    {
+      "label": "市场价",
+      "prop": "marketPrice",
+      "type": "number",
+      "span": 24,
+      "precision":2,
+      "mock":{
+        "type":"number",
+        "max":1,
+        "min":2,
+        "precision":2
+      },
+      "minRows": 0,
+      "maxRows": 3,
+      "row":true,
+      "controls":false
+    },
+    {
+      "label": "vip",
+      "span": 24,
+      "prop": "vip",
+      "type": "switch",
+      "dicData": [{
+        "label": "开启",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "mock":{
+        "type":"dic"
+      },
+      "hide": true,
+      "row":true
+    },
+    {
+      "label": "VIP价",
+      "prop": "vipPrice",
+      "type": "number",
+      "span": 24,
+      "precision":2,
+      "mock":{
+        "type":"number",
+        "max":1,
+        "min":2,
+        "precision":2
+      },
+      "minRows": 0,
+      "maxRows": 3,
+      "row":true,
+      "controls":false
+    },
+    {
+      "label": "限购量",
+      "prop": "purchasing",
+      "type": "number",
+      "span": 24,
+      "precision":0,
+      "mock":{
+        "type":"number",
+        "max":1,
+        "min":2,
+        "precision":2
+      },
+      "minRows": 0,
+      "row":true,
+      "controls":false
+    },
+    {
+      "label": "库存",
+      "prop": "stock",
+      "type": "number",
+      "span": 24,
+      "precision":0,
+      "mock":{
+        "type":"number",
+        "max":1,
+        "min":2,
+        "precision":2
+      },
+      "minRows": 0,
+      "row":true,
+      "controls":false
+    },
+    {
+      "label": "已出售数",
+      "prop": "sold",
+      "type": "number",
+      "span": 24,
+      "precision":0,
+      "mock":{
+        "type":"number",
+        "max":1,
+        "min":2,
+        "precision":2
+      },
+      "minRows": 0,
+      "maxRows": 3,
+      "row":true
+    },
+    {
+      "label": "已访问数",
+      "prop": "view",
+      "minWidth": 100,
+      "cell": true,
+      "span": 24
+    },
+    {
+      "label": "已收藏数",
+      "prop": "collection",
+      "minWidth": 100,
+      "cell": true,
+      "span": 24
+    },
+    {
+      "label": "已分享数",
+      "prop": "share",
+      "minWidth": 100,
+      "cell": true,
+      "span": 24
+    },
+    {
+      "label": "下架时间",
+      "prop": "pullTime",
+      "type": "datetime",
+      "format":"yyyy-MM-dd hh:mm:ss",
+      "valueFormat":"yyyy-MM-dd hh:mm:ss",
+      "mock":{
+        "type":"datetime",
+        "format":"yyyy-MM-dd hh:mm:ss",
+        "now":true
+      },
+      "span": 24
+    },
+    {
+      "label": "状态",
+      "prop": "goodsStatus",
+      "type": "radio",
+      "dicData": [{
+        "label": "待审核",
+        "value": 0
+      }, {
+        "label": "销售中",
+        "value": 1
+      }, {
+        "label": "已下架",
+        "value": 2
+      }],
+      "mock":{
+        "type":"dic"
+      },
+      "span": 24
+    },
+    {
+      "label": "主图",
+      "prop": "priture",
+      "type": "upload",
+      "listType": "picture-img",
+      "span": 24,
+      "tip": "只能上传jpg/png/jpeg文件,且不超过2M,宽高比为1:1",
+      "action": "/api/blade-resource/oss/endpoint/put-file",
+      "dataType": "string",
+      "propsHttp": {
+        "res": "data",
+        "url": "link"
+      },
+      "rules": [
+        {
+          "required": false,
+          "message": "请上传图片",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 401 - 0
src/views/mallManagement/commodity/productList/detailsPageEdit.vue

@@ -0,0 +1,401 @@
+<template>
+  <div class="borderless">
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList">返回列表
+        </el-button>
+      </div>
+      <el-button
+          class="el-button--small-yh add-customer-btn"
+          type="primary"
+          :disabled="disabled"
+          @click="editProductInfo"
+      >{{ form.id ? '确认修改' : '确认新增' }}
+      </el-button>
+    </div>
+    <div style="margin-top: 60px">
+      <containerTitle title="基础信息"></containerTitle>
+      <basic-container style="margin-bottom: 10px">
+        <avue-form ref="form" v-model="form" :option="option">
+          <template slot="goodsTypeId" slot-scope="scope">
+            <avue-input-tree
+                v-model="form.goodsTypeId"
+                :props="{ label: 'title', value: 'id' }"
+                multiple
+                placeholder=""
+                type="tree"
+                :dic="dicData"/>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="商品规格"></containerTitle>
+      <basic-container style="margin-bottom: 10px">
+        <avue-crud
+            :data="sftData"
+            :option="sftOption"
+            @row-save="rowSave"
+            @row-del="rowSftDel"
+        >
+<!--          <template slot-scope="{row}" slot="cnameForm">-->
+<!--            <el-checkbox v-model="row.cname">显示</el-checkbox>-->
+<!--          </template>-->
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button
+                size="small"
+                icon="el-icon-edit"
+                type="text"
+                @click.stop="rowSftDel(row, index)">
+              删除
+            </el-button>
+            <el-button
+                size="small"
+                icon="el-icon-close"
+                type="text">
+              下架
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
+      <containerTitle title="产品参数"></containerTitle>
+      <basic-container style="margin-bottom: 10px">
+        <avue-crud
+            :data="sftDataParameters"
+            :option="productParameters"
+            @row-del="rowSftDel"
+        >
+          <template slot="menuLeft" slot-scope="{ row, index }">
+            <el-button
+                type="primary"
+                icon="el-icon-plus"
+                size="small"
+                @click.stop="parameterAddition(row, index)"
+            >新增明细
+            </el-button>
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button
+                size="small"
+                icon="el-icon-edit"
+                type="text"
+                @click.stop="rowSftEdit(row, index)"
+            >
+              {{ row.$cellEdit ? "保存" : "编辑" }}
+            </el-button>
+            <el-button
+                size="small"
+                icon="el-icon-edit"
+                type="text"
+                @click.stop="rowSftDel(row, index)">
+              删除
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
+      <containerTitle title="商品图片"></containerTitle>
+      <basic-container style="margin-bottom: 10px">
+        <avue-crud
+            ref="imgUpload"
+            :option="imgUploadList"
+            :data="imgUploadData"
+            @row-save="imgUploadSave"
+            @row-update="imgUploadUpdate"
+            @row-del="imgUploadDel"
+            :upload-before="uploadBefore"
+        ></avue-crud>
+      </basic-container>
+      <containerTitle title="详情页编辑"></containerTitle>
+      <basic-container style="margin-bottom: 10px">
+        <avue-ueditor v-model="form.details" :options="options"></avue-ueditor>
+      </basic-container>
+    </div>
+  </div>
+</template>
+<script>
+import {getDetail, updateDetail, getDeptTree, priceDelete} from "@/api/mallManagement/commodity/productList";
+import sftOption from "./configuration/specification.json";
+import imgUploadList from "./configuration/imgUploadList.json";
+import productParameters from "./configuration/productParameters.json";
+export default {
+  name: "detailsPage",
+  data() {
+    return {
+      form: {
+        details:'<h1 class="ql-align-center" style="text-align: center;"><a href="https://avuejs.com/doc/plugins/ueditor-plugins" target="_blank" style="font-weight: bold; color: rgb(194, 79, 74);">欢迎使用Avue富文本编辑器</a></h1><p class="ql-align-center" style="text-align: center;"><span style="font-weight: bold; color: rgb(194, 79, 74);"><img src="https://avuejs.com/images/logo-bg.jpg" height="200" width="200"></span></p>'
+      },
+      sftData: [],
+      sftOption: sftOption,
+      imgUploadList: imgUploadList,
+      productParameters: productParameters,
+      options: {
+        //普通图片上传
+        customConfig: {}, //wangEditor编辑的配置
+        action: "/api/blade-resource/oss/endpoint/put-file",
+        props: {
+          res: "data",
+          url: 'link'
+        },
+      },
+      disabled: false,
+      userDialog: false,//供应商导入窗口
+      imgUploadData: [],
+      dicData: [],
+      sftDataParameters: [],
+      detailsSelect: {},
+      option: {
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "分类",
+            prop: "typeId",
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            slot: true
+          },
+          {
+            label: "排序",
+            prop: "sort",
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            slot: true
+          },
+          {
+            label: "商品名称",
+            prop: "cname",
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            slot: true
+          },
+          {
+            label: "推广词",
+            prop: "promote",
+            span: 24,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            slot: true
+          }
+        ]
+      },
+    }
+  },
+  //初始化查询
+  created() {
+    getDeptTree().then(res => {
+      this.dicData = res.data.data;
+    });
+    if (this.$route.query.id) {
+      getDetail(JSON.parse(this.$route.query.id)).then(res => {
+        this.form = res.data.data
+        this.sftData = res.data.data.itemsList
+      })
+    } else {
+      this.$set(this.form, "goodsTypeId", this.$route.query.treeDeptId)
+    }
+  },
+  methods: {
+    // 商品图片上传保存
+    imgUploadSave(row, done, loading) {
+      console.log(row);
+      this.imgUploadData.push(row);
+      done();
+    },
+    imgUploadUpdate(row, index, done, loading) {
+      done();
+    },
+    imgUploadDel(row, index, donerowDel) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        //商品判断是否需要调用删除接口
+        if (row.id) {
+          // corpsattn(row.id).then(res => {
+          //   this.$message({
+          //     type: "success",
+          //     message: "操作成功!"
+          //   });
+          //   this.imgUploadData.splice(index, 1);
+          // })
+        } else {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.imgUploadData.splice(index, 1);
+        }
+      });
+    },
+    // 上传前
+    uploadBefore(file, done, loading, column) {
+      const is2M = file.size / 1024 / 1024 < 2;
+      const isType =
+          file.type === "image/jpeg" ||
+          file.type === "image/png" ||
+          file.type === "image/jpg";
+      if (!isType) {
+        this.$message.error("图片只能是JPG、JPEG、PNG格式");
+        loading();
+      }
+      if (!is2M) {
+        this.$message.error("图片大小不能超过2M");
+        loading();
+      }
+      const img = new Image();
+      const _URL = window.URL || window.webkitURL;
+      let isSize = null;
+      img.onload = () => {
+        if (column.label == "图片") {
+          isSize = img.width === img.height;
+          if (!isSize) {
+            this.$message.error("图片宽高限制比例为1:1");
+          }
+        } else {
+          const width = 750;
+          const height = 1000;
+          isSize = img.width === width && img.height <= height;
+          if (!isSize) {
+            this.$message.error("商品详情轮播图宽为750,高不能超过1000");
+          }
+        }
+        if (is2M && isType && isSize) {
+          done();
+        } else {
+          loading();
+        }
+      };
+      img.src = _URL.createObjectURL(file);
+    },
+    addSftRow() {
+      this.sftData.push({
+        $cellEdit: true,
+        cname: null,
+        texture: null,
+        colour: null,
+        describe: null,
+        remarks: null
+      });
+    },
+    parameterAddition() {
+      this.sftDataParameters.push({
+        $cellEdit: true,
+        cname: null
+      });
+    },
+    rowSave(row, done, loading) {
+      done(row);
+    },
+    rowSftDel(row, index) {
+    },
+    rowContactCell(row, index) {
+      this.$refs.crudContact.rowCell(row, index)
+    },
+    rowPurchaseCell(row, index) {
+      this.$refs.crudPurchase.rowCell(row, index)
+    },
+    //修改提交触发
+    editProductInfo() {
+      this.$refs["form"].validate((valid) => {
+        //校验明细列表
+        if (valid) {
+          console.log(this.form);
+          const params = {
+            ...this.form,
+            type: 0,
+          }
+          updateDetail(params).then(res => {
+            if (res.data.success) {
+              this.$message.success("操作成功!")
+            }
+          })
+        } else {
+          return false;
+        }
+      });
+    },
+    //返回列表
+    backToList() {
+      this.$router.$avueRouter.closeTag();
+      this.$router.push({
+        path: 'mallManagement/commodity/productList/index',
+        query: {}
+      });
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.customer-head {
+  position: fixed;
+  top: 105px;
+  width: 100%;
+  margin-left: -10px;
+  height: 62px;
+  background: #ffffff;
+  box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
+  z-index: 999;
+  /* display: flex;
+  justify-content: left; */
+}
+
+.customer-back {
+  cursor: pointer;
+  line-height: 62px;
+  font-size: 16px;
+  color: #323233;
+  font-weight: 400;
+}
+
+.back-icon {
+  line-height: 64px;
+  font-size: 20px;
+  margin-right: 8px;
+}
+
+.add-customer-btn {
+  position: fixed;
+  right: 36px;
+  top: 115px;
+}
+
+::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.el-dialogDeep {
+  ::v-deep .el-dialog {
+    margin: 1vh auto 0 !important;
+    padding-bottom: 10px !important;
+
+    .el-dialog__body, .el-dialog__footer {
+      padding-bottom: 0 !important;
+      padding-top: 0 !important;
+    }
+  }
+}
+</style>

+ 442 - 0
src/views/mallManagement/commodity/productList/index.vue

@@ -0,0 +1,442 @@
+<template>
+  <el-row>
+    <el-col :span="5">
+      <basic-container>
+        <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+      </basic-container>
+    </el-col>
+    <el-col :span="19">
+      <basic-container>
+        <avue-crud :option="option"
+                   :search.sync="search"
+                   :table-loading="loading"
+                   :data="data"
+                   ref="crud"
+                   v-model="form"
+                   @row-del="rowDel"
+                   @row-update="rowUpdate"
+                   @row-save="rowSave"
+                   :before-open="beforeOpenE"
+                   :page.sync="page"
+                   @search-change="searchChange"
+                   @search-reset="searchReset"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange"
+                   @on-load="onLoad">
+          <template slot="menuLeft">
+            <el-button
+                type="warning"
+                size="small"
+                icon="el-icon-bottom"
+                @click="excelBox = true"
+            >批量上架
+            </el-button>
+            <el-button
+                type="danger"
+                size="small"
+                icon="el-icon-bottom"
+                @click="excelBox = true"
+            >批量下架
+            </el-button>
+          </template>
+          <template slot-scope="scope" slot="menu">
+            <!--            <el-button-->
+            <!--                type="text"-->
+            <!--                icon="el-icon-view"-->
+            <!--                size="small"-->
+            <!--                @click.stop="beforeOpenPage(scope.row, scope.index)"-->
+            <!--            >查看-->
+            <!--            </el-button>-->
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                @click.stop="editOpen(scope.row, scope.index)"
+            >编辑
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-delete"
+                size="small"
+                @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-delete"
+                size="small"
+            >下架
+            </el-button>
+          </template>
+        </avue-crud>
+        <el-dialog title="导入产品"
+                   append-to-body
+                   :visible.sync="excelBox"
+                   width="555px">
+          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+            <template slot="excelTemplate">
+              <el-button type="primary" @click="derivation">
+                点击下载<i class="el-icon-download el-icon--right"></i>
+              </el-button>
+            </template>
+          </avue-form>
+          <p style="text-align: center;color: #DC0505">温馨提示  第一次导入时请先下载模板</p>
+        </el-dialog>
+      </basic-container>
+    </el-col>
+  </el-row>
+</template>
+<script>
+import {getList, getUser, getUserPlatform, remove, updatePlatform, add, grant, getDeptLazyTree, getDeptTree} from "@/api/mallManagement/commodity/productList";
+import {getRoleTree} from "@/api/system/role";
+import {getToken} from '@/util/auth';
+import option from "./configuration/mainList.json";
+export default {
+  data() {
+    return {
+      form: {},
+      search:{},
+      roleBox: false,
+      excelBox: false,
+      platformBox: false,
+      initFlag: true,
+      selectionList: [],
+      query: {},
+      loading: true,
+      platformLoading: false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      platformPage: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      init: {
+        roleTree: [],
+        deptTree: [],
+      },
+      props: {
+        label: "title",
+        value: "key"
+      },
+      roleGrantList: [],
+      roleTreeObj: [],
+      treeDeptId: '',
+      treeData: [],
+      treeOption: {
+        nodeKey: 'id',
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = (node.level === 0) ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            console.log(res.data.data.records)
+            resolve(res.data.data.records.map(item => {
+              return {
+                ...item,
+                leaf: !item.cname
+              }
+            }))
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: 'small',
+        props: {
+          labelText: '标题',
+          label: 'cname',
+          value: 'id',
+          children: 'children'
+        }
+      },
+      option: option,
+      data: [],
+      platformQuery: {},
+      platformSelectionList: [],
+      platformData: [],
+      platformForm: {},
+      excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: '模板下载',
+            prop: 'excelTemplate',
+            formslot: true,
+            span: 24,
+          },
+          {
+            label: '模板上传',
+            prop: 'excelFile',
+            type: 'upload',
+            drag: true,
+            loadText: '模板上传中,请稍等',
+            span: 24,
+            propsHttp: {
+              res: 'data',
+            },
+            tip: '请上传 .xls,.xlsx 标准格式文件',
+            action: "/api/blade-client/goodsdesc/import-desc",
+          },
+        ]
+      }
+    };
+  },
+  methods: {
+    derivation() {
+      window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
+    },
+    uploadAfter(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBox = false;
+      this.refreshChange();
+      done();
+    },
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    initData(tenantId) {
+      getDeptTree().then(res => {
+        const column = this.findObject(this.option.column, "goodsTypeId");
+        column.dicData = res.data.data;
+      });
+    },
+    submitRole() {
+      const roleList = this.$refs.treeRole.getCheckedKeys().join(",");
+      grant(this.ids, roleList).then(() => {
+        this.roleBox = false;
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        this.onLoad(this.page);
+      });
+    },
+    rowSave(row, done, loading) {
+      row.goodsTypeId = row.goodsTypeId.join(",");
+      add(row).then(() => {
+        this.initFlag = false;
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowUpdate(row, index, done, loading) {
+      row.goodsTypeId = row.goodsTypeId.join(",");
+      add(row).then(() => {
+        this.initFlag = false;
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    //查看跳转页面
+    beforeOpenPage(row, index) {
+      this.$router.push({
+        path: "/productList_detailsPageEdit",
+        query: { id: JSON.stringify(row.id) }
+      });
+    },
+    //新增跳转页面
+    beforeOpenE(row, index) {
+      this.$router.push({
+        path: "/productList_detailsPageEdit",
+        query: { id: JSON.stringify(row.id),treeDeptId:this.treeDeptId }
+      });
+    },
+    //编辑跳转页面
+    editOpen(row, index) {
+      this.$router.push({
+        path: "/productList_detailsPageEdit",
+        query: { id: JSON.stringify(row.id) }
+      });
+    },
+    //删除触发
+    rowDel(row, index, done) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            done()
+          });
+    },
+    searchReset() {
+      this.query = {};
+      this.treeDeptId = '';
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleGrant() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.roleTreeObj = [];
+      if (this.selectionList.length === 1) {
+        this.roleTreeObj = this.selectionList[0].roleId.split(",");
+      }
+      getRoleTree().then(res => {
+        this.roleGrantList = res.data.data;
+        this.roleBox = true;
+      });
+    },
+    handlePlatform() {
+      this.platformBox = true;
+    },
+    handleImport() {
+      this.excelBox = true;
+    },
+    handleTemplate() {
+      window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
+    },
+    //新增编辑查看触发
+    async beforeOpen(done, type) {
+      if (["add"].includes(type)) {
+        this.option.column.forEach(e=>{
+          if(e.prop=='goodsTypeId'){
+            this.$set(this.option.column,2,{...e,value:this.treeDeptId})
+          }
+        })
+      }
+      if (["edit", "view"].includes(type)) {
+        await getUser(this.form.id).then(res => {
+          this.form = res.data.data;
+          // this.form.goodsTypeId = [this.form.goodsTypeId.replace(/\"/g,"")]
+          console.log(this.form.hasOwnProperty("goodsTypeId"))
+          if(this.form.hasOwnProperty("goodsTypeId")){
+            this.form.goodsTypeId = this.form.goodsTypeId.split(",");
+          }
+        });
+      }
+      if (["add", "edit"].includes(type)) {
+        this.initData(0);
+      }
+      this.initFlag = true;
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+        const data = res.data.data;
+        this.data = data.records;
+        this.page.total = res.data.data.total
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+    platformRowUpdate(row, index, done, loading) {
+      updatePlatform(row.id, row.userType, row.userExt).then(() => {
+        this.platformOnLoad(this.platformPage);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    platformBeforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getUserPlatform(this.platformForm.id).then(res => {
+          this.platformForm = res.data.data;
+        });
+      }
+      done();
+    },
+    platformSearchReset() {
+      this.platformQuery = {};
+      this.platformOnLoad(this.platformPage);
+    },
+    platformSearchChange(params, done) {
+      this.platformQuery = params;
+      this.platformPage.currentPage = 1;
+      this.platformOnLoad(this.platformPage, params);
+      done();
+    },
+    platformSelectionChange(list) {
+      this.platformSelectionList = list;
+    },
+    platformSelectionClear() {
+      this.platformSelectionList = [];
+      this.$refs.platformCrud.toggleSelection();
+    },
+    platformCurrentChange(currentPage) {
+      this.platformPage.currentPage = currentPage;
+    },
+    platformSizeChange(pageSize) {
+      this.platformPage.pageSize = pageSize;
+    },
+    platformRefreshChange() {
+      this.platformOnLoad(this.platformPage, this.platformQuery);
+    },
+    platformOnLoad(page, params = {}) {
+      this.platformLoading = true;
+      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+        const data = res.data.data;
+        this.platformPage.total = data.total;
+        this.platformData = data.records;
+        this.platformLoading = false;
+        this.selectionClear();
+      });
+    }
+  }
+};
+</script>
+
+<style>
+.el-scrollbar {
+  height: 100%;
+}
+</style>

+ 2 - 2
vue.config.js

@@ -27,9 +27,9 @@ module.exports = {
       '/api': {
         //本地服务接口地址
         // target: 'http://192.168.1.177:1080',
-        // target: 'http://192.168.1.151:1080',
+        target: 'http://192.168.1.151:1080',
         // 打包地址.
-        target: 'http://121.37.83.47:10004',//服务器ip
+        // target: 'http://121.37.83.47:10004',//服务器ip
         // target: 'http://trade.tubaosoft.com:10004',//服务器域名
         ws: true,
         pathRewrite: {