lilei před 4 roky
rodič
revize
6e09ff8086

+ 1 - 1
.env

@@ -2,4 +2,4 @@ NODE_ENV=production
 VUE_APP_PREVIEW=false
 VUE_APP_API_BASE_URL=https://aitour-it.zyucgj.com/at-it
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=可回收资源运营后台
+VUE_APP_PRO_NAME=可回收资源后台

+ 1 - 1
.env.development

@@ -2,4 +2,4 @@ NODE_ENV=development
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=可回收资源运营后台-dev
+VUE_APP_PRO_NAME=可回收资源后台-dev

+ 1 - 1
.env.preview

@@ -2,4 +2,4 @@ NODE_ENV=production
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=https://aitour-it.test.zyucgj.com/at-it
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=可回收资源运营后台-pro
+VUE_APP_PRO_NAME=可回收资源后台-pro

+ 6 - 6
src/config/router.config.js

@@ -70,7 +70,7 @@ export const asyncRouterMap = [{
         path: '/shop/orderDetail',
         name: 'shopOrderDetail',
         hidden: true,
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/orderDetail.vue'),
         meta: {
           title: '订单详情',
           icon: 'profile'
@@ -80,7 +80,7 @@ export const asyncRouterMap = [{
       {
         path: '/shop/goods',
         name: 'goodsList',
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsList.vue'),
         meta: {
           title: '商品管理',
           icon: 'shopping'
@@ -90,7 +90,7 @@ export const asyncRouterMap = [{
       {
         path: '/shop/goodsShelves',
         name: 'goodsShelves',
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsShelves.vue'),
         meta: {
           title: '商品上架',
           icon: 'flag'
@@ -100,7 +100,7 @@ export const asyncRouterMap = [{
       {
         path: '/shop/bannerSetting',
         name: 'bannerSetting',
-        component: () => import(/* webpackChunkName: "appSetting" */ '@/views/appSetting/bannerSetting.vue'),
+        component: () => import(/* webpackChunkName: "appSetting" */ '@/views/shop/bannerSetting.vue'),
         meta: {
           title: '营销图设置',
           icon: 'file-image'
@@ -122,7 +122,7 @@ export const asyncRouterMap = [{
       {
         path: '/shopSetting/goodsClass',
         name: 'goodsClass',
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shopSetting/goodsClass.vue'),
         meta: {
           title: '商品分类管理',
           icon: 'folder'
@@ -132,7 +132,7 @@ export const asyncRouterMap = [{
       {
         path: '/shopSetting/supplier',
         name: 'supplier',
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shopSetting/supplier.vue'),
         meta: {
           title: '供货商管理',
           icon: 'solution'

+ 0 - 0
src/views/appSetting/bannerSetting.vue → src/views/shop/bannerSetting.vue


+ 249 - 0
src/views/shop/goodsList.vue

@@ -0,0 +1,249 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="企业名称">
+              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="负责人手机">
+              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="ENABLE_FLAG"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-button type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
+    </div>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
+        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
+      </template>
+    </s-table>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getTenantsList,
+  tenantsDelete
+} from '@/api/tenants.js'
+import moment from 'moment'
+export default {
+  name: 'GoodsList',
+  components: {
+    STable,
+    VSelect
+  },
+  data () {
+    return {
+      moment,
+      pageNo: 1,
+      pageSize: 10,
+      openTenantsModal: false, // 打开授权弹窗
+      itemId: '', // 要编辑的租户id
+      // 查询参数
+      queryParam: {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '200',
+        align: 'center'
+      },
+      {
+        title: '企业名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '负责人名称',
+        dataIndex: 'contactName',
+        width: '120',
+        align: 'center',
+        customRender: (text) => {
+		  return text || '--'
+        }
+      },
+      {
+        title: '负责人手机',
+        width: '120',
+        align: 'center',
+        dataIndex: 'contactPhone'
+      },
+      {
+        title: '有效期至',
+        width: '200',
+        align: 'center',
+        dataIndex: 'expireDate'
+      },
+      {
+        title: '启用状态',
+        width: '200',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res, 'rrrrrrr')
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.reset()
+    })
+  },
+  methods: {
+    // 打开新增/编辑 弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
+      this.openTenantsModal = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后原数据不可恢复,是否删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          tenantsDelete({
+          	id: row.id
+          }).then(res => {
+          	if (res.status == 200) {
+          		_this.$message.success('res.message')
+          		_this.$refs.table.refresh()
+          	}
+          })
+        }
+      })
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.textCount {
+		border: 1px solid #91d5ff;
+		background-color: #e6f7ff;
+		padding: 10px 0;
+		border-radius: 5px;
+		padding-left: 20px;
+		margin: 10px 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
+</style>

+ 249 - 0
src/views/shop/goodsShelves.vue

@@ -0,0 +1,249 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="企业名称">
+              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="负责人手机">
+              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="ENABLE_FLAG"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-button type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
+    </div>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
+        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
+      </template>
+    </s-table>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getTenantsList,
+  tenantsDelete
+} from '@/api/tenants.js'
+import moment from 'moment'
+export default {
+  name: 'GoodsList',
+  components: {
+    STable,
+    VSelect
+  },
+  data () {
+    return {
+      moment,
+      pageNo: 1,
+      pageSize: 10,
+      openTenantsModal: false, // 打开授权弹窗
+      itemId: '', // 要编辑的租户id
+      // 查询参数
+      queryParam: {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '200',
+        align: 'center'
+      },
+      {
+        title: '企业名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '负责人名称',
+        dataIndex: 'contactName',
+        width: '120',
+        align: 'center',
+        customRender: (text) => {
+		  return text || '--'
+        }
+      },
+      {
+        title: '负责人手机',
+        width: '120',
+        align: 'center',
+        dataIndex: 'contactPhone'
+      },
+      {
+        title: '有效期至',
+        width: '200',
+        align: 'center',
+        dataIndex: 'expireDate'
+      },
+      {
+        title: '启用状态',
+        width: '200',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res, 'rrrrrrr')
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.reset()
+    })
+  },
+  methods: {
+    // 打开新增/编辑 弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
+      this.openTenantsModal = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后原数据不可恢复,是否删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          tenantsDelete({
+          	id: row.id
+          }).then(res => {
+          	if (res.status == 200) {
+          		_this.$message.success('res.message')
+          		_this.$refs.table.refresh()
+          	}
+          })
+        }
+      })
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.textCount {
+		border: 1px solid #91d5ff;
+		background-color: #e6f7ff;
+		padding: 10px 0;
+		border-radius: 5px;
+		padding-left: 20px;
+		margin: 10px 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
+</style>

+ 249 - 0
src/views/shop/orderDetail.vue

@@ -0,0 +1,249 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="企业名称">
+              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="负责人手机">
+              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="ENABLE_FLAG"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-button type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
+    </div>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
+        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
+      </template>
+    </s-table>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getTenantsList,
+  tenantsDelete
+} from '@/api/tenants.js'
+import moment from 'moment'
+export default {
+  name: 'OrderDetail',
+  components: {
+    STable,
+    VSelect
+  },
+  data () {
+    return {
+      moment,
+      pageNo: 1,
+      pageSize: 10,
+      openTenantsModal: false, // 打开授权弹窗
+      itemId: '', // 要编辑的租户id
+      // 查询参数
+      queryParam: {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '200',
+        align: 'center'
+      },
+      {
+        title: '企业名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '负责人名称',
+        dataIndex: 'contactName',
+        width: '120',
+        align: 'center',
+        customRender: (text) => {
+		  return text || '--'
+        }
+      },
+      {
+        title: '负责人手机',
+        width: '120',
+        align: 'center',
+        dataIndex: 'contactPhone'
+      },
+      {
+        title: '有效期至',
+        width: '200',
+        align: 'center',
+        dataIndex: 'expireDate'
+      },
+      {
+        title: '启用状态',
+        width: '200',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res, 'rrrrrrr')
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.reset()
+    })
+  },
+  methods: {
+    // 打开新增/编辑 弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
+      this.openTenantsModal = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后原数据不可恢复,是否删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          tenantsDelete({
+          	id: row.id
+          }).then(res => {
+          	if (res.status == 200) {
+          		_this.$message.success('res.message')
+          		_this.$refs.table.refresh()
+          	}
+          })
+        }
+      })
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.textCount {
+		border: 1px solid #91d5ff;
+		background-color: #e6f7ff;
+		padding: 10px 0;
+		border-radius: 5px;
+		padding-left: 20px;
+		margin: 10px 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
+</style>

+ 386 - 0
src/views/shopSetting/goodsClass.vue

@@ -0,0 +1,386 @@
+<template>
+  <a-card :bordered="false">
+    <div class="add"><a-button type="primary" icon="plus" class="addBtn" @click="showModal" id="bannerSetting-showModal">新增</a-button></div>
+    <v-select ref="position" style="display: none;" code="ADVERT_POSITION"></v-select>
+    <!-- table列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="row => row.id"
+      :showPagination="false"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 广告图位置 -->
+      <span slot="position" slot-scope="text">{{ $refs.position.getNameByCode(text) }}</span>
+      <span slot="action" slot-scope="text, record">
+        <a-icon
+          type="eye"
+          id="bannerSetting-handleView"
+          title="查看"
+          class="actionBtn icon-green"
+          @click="handleEdit(record, 1)" />
+        <a-icon
+          type="edit"
+          id="bannerSetting-handleEdit"
+          v-if="record.status == '0'"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record, 0)" />
+        <a-icon
+          type="delete"
+          id="bannerSetting-delect"
+          v-if="record.status == '0'"
+          title="删除"
+          class="actionBtn icon-red"
+          @click="delect(record)" />
+      </span>
+      <span slot="status" slot-scope="text, record">
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          id="bannerSetting-changeFlagHandle"
+          v-model="record.status == 1 ? true : false"
+          @change="changeFlagHandle(text, record)"
+        />
+      </span>
+    </s-table>
+    <!-- 弹窗 -->
+    <a-modal
+      :title="title"
+      :visible="visible"
+      :footer="null"
+      :closable="closable"
+      :centered="true"
+      @cancel="close"
+      width="45%">
+      <a-form
+        id="components-form-demo-validate-other"
+        :form="form"
+        ref="form"
+        v-bind="formItemLayout"
+        @submit="handleSubmit"
+        :hideRequiredMark="hideRequiredMark">
+        <a-form-item label="名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-input
+            id="bannerSetting-title"
+            :maxLength="30"
+            v-decorator="['formData.title', { initialValue: formData.title,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入轮播图名称(最多30个字符)!' }] }]"
+            :disabled="disabled"
+            placeholder="请输入轮播图名称(最多30个字符)"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="广告图位置" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <v-select
+            ref="position"
+            code="ADVERT_POSITION"
+            allowClear
+            id="bannerSetting-position"
+            placeholder="请选择广告图位置"
+            :disabled="disabled"
+            v-decorator="['formData.position', { initialValue: formData.position, rules: [{ required: true, message: '请选择广告图位置!' }] }]"
+          ></v-select>
+        </a-form-item>
+        <a-form-item label="跳转链接" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-textarea
+            :maxLength="300"
+            v-decorator="['formData.url', { initialValue: formData.url, rules: [{ required: false, message: '请输入跳转链接(最多300字符)!' }] }]"
+            :disabled="disabled"
+            id="bannerSetting-url"
+            placeholder="请输入跳转链接(最多300字符)"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="排序" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-input
+            type="number"
+            oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+            v-decorator="['formData.sort', { initialValue: formData.sort,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入(0~999999)之间的序号值!' }] }]"
+            :disabled="disabled"
+            id="bannerSetting-sort"
+            placeholder="请输入(0~999999)之间的序号值"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-radio-group
+            :disabled="disabled"
+            id="bannerSetting-status"
+            v-decorator="['formData.status', { initialValue: formData.status, rules: [{ required: true, message: '请选择状态!' }] }]"
+          >
+            <a-radio value="1">启用</a-radio>
+            <a-radio value="0">禁用</a-radio>
+          </a-radio-group>
+        </a-form-item>
+        <a-form-item label="上传图片" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <Upload
+            v-if="title != '查看详情'"
+            id="bannerSetting-photoPath"
+            v-decorator="[
+              'formData.photoPath',
+              {
+                initialValue: formData.photoPath,
+                rules: [{ required: true, message: '请上传轮播图!' }]
+              }
+            ]"
+            ref="bannerImage"
+            :fileSize="0.25"
+            :disabled="disabled"
+            @change="getbannerImage"
+            listType="picture-card"
+            upText="上传"
+          ></Upload>
+          <img v-else :src="formData.photoPath" style="width:100px ;height: auto;" />
+        </a-form-item>
+        <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
+          <a-button type="primary" html-type="submit" v-if="!disabled" id="bannerSetting-submit" style="margin-right: 15px">保存</a-button>
+          <a-button @click="close()" v-if="!disabled" style="margin-left: 15px" id="bannerSetting-close">取消</a-button>
+        </a-form-item>
+      </a-form>
+    </a-modal>
+  </a-card>
+</template>
+
+<script>
+import { Upload, STable, VSelect } from '@/components'
+import { getBannerSettingList, changeStatus, deleteItem, saveItem } from '@/api/bannerSetting.js'
+
+export default {
+  components: {
+    STable,
+    Upload,
+    VSelect
+  },
+  data () {
+    return {
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: 60,
+          align: 'center'
+        },
+        {
+          title: '广告图位置',
+          width: 200,
+          dataIndex: 'position',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'position'
+          }
+        },
+        {
+          title: '名称',
+          width: 100,
+          dataIndex: 'title',
+          align: 'center'
+        },
+        {
+          title: '排序',
+          width: 100,
+          dataIndex: 'sort',
+          align: 'center'
+        },
+        {
+          title: '跳转链接',
+          width: 100,
+          dataIndex: 'url',
+          align: 'center',
+          customRender: (text) => {
+            return text || '--'
+          }
+        },
+        {
+          title: '状态',
+          width: 100,
+          dataIndex: 'status',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'status'
+          }
+        },
+        {
+          title: '操作',
+          align: 'center',
+          width: 200,
+          scopedSlots: {
+            customRender: 'action'
+          }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getBannerSettingList({
+          bannerType: 'app'
+        }).then(res => {
+          // console.log(res, '1111')
+          const no = 0
+          for (let i = 0; i < res.data.length; i++) {
+            const _item = res.data[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
+      },
+
+      title: '编辑',
+      closable: true,
+      visible: false,
+      confirmLoading: false,
+      formLayout: 'horizontal',
+      hideRequiredMark: false, // 是否显示必填的* 默认显示
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: {
+          span: 6
+        },
+        wrapperCol: {
+          span: 14
+        }
+      },
+      formData: {
+        title: '', // 标题
+        url: '', // 图片路径
+        status: '', // 状态
+        sort: '', // 排序
+        position: '', // 广告图位置
+        photoPath: '', // banner地址
+        createDate: ''
+      },
+      bannerType: 'app',
+      disabled: false,
+      value: '',
+      id: '',
+      isShow: true
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'validate_other'
+    })
+  },
+  methods: {
+    showModal () {
+      this.disabled = false
+      delete this.formData.id
+      delete this.formData.createDate
+      this.visible = true
+      this.title = '新增'
+      this.hideRequiredMark = false
+    },
+    // 轮播图change
+    getbannerImage (data) {
+      this.formData.photoPath = data
+    },
+    // 点击保存;
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log('Received values of form: ', values, this.formData)
+          const formData = Object.assign({}, this.formData, values.formData, {
+            bannerType: 'app'
+          })
+          console.log(formData, _this.radioGroup)
+          saveItem(formData, _this.radioGroup).then(res => {
+            console.log(res, 'rrrrrrrrr')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.close()
+            }
+          })
+        }
+      })
+    },
+    close () {
+      this.visible = false
+      this.formData.title = ''
+      this.photo = ''
+      this.formData.url = ''
+      this.formData.status = ''
+      this.formData.sort = ''
+      this.formData.position = ''
+      this.formData.photoBasePath = ''
+      this.formData.photoPath = ''
+      this.title = '新增'
+      this.$refs.bannerImage.setFileList('')
+      this.form.resetFields()
+    },
+    // 赋值
+    assignment (row) {
+      this.formData.id = row.id
+      this.formData.title = row.title
+      this.formData.photoPath = row.photoPath
+      this.formData.url = row.url
+      this.formData.status = row.status
+      this.formData.sort = row.sort
+      this.formData.position = row.position
+      this.formData.createDate = row.createDate
+    },
+    // 0 修改,1 查看详情
+    handleEdit (row, type) {
+      const _this = this
+      console.log(row)
+      if (type == 1) {
+        this.title = '查看详情'
+        this.hideRequiredMark = true
+      } else if (type == 0) {
+        this.title = '编辑'
+        this.hideRequiredMark = false
+      }
+      this.assignment(row)
+      this.disabled = type == 1
+      this.visible = true
+      setTimeout(() => {
+        _this.$refs.bannerImage.setFileList(this.formData.photoPath)
+      }, 500)
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteItem({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    // 更改启用禁用状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        id: record.id,
+        flag: record.status == 1 ? '0' : '1'
+      }
+      changeStatus(_data).then(res => {
+        if (res.status == '200') {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+        } else {
+          record.status = !record.status
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.addBtn {
+  margin-bottom: 20px;
+}
+</style>

+ 386 - 0
src/views/shopSetting/supplier.vue

@@ -0,0 +1,386 @@
+<template>
+  <a-card :bordered="false">
+    <div class="add"><a-button type="primary" icon="plus" class="addBtn" @click="showModal" id="bannerSetting-showModal">新增</a-button></div>
+    <v-select ref="position" style="display: none;" code="ADVERT_POSITION"></v-select>
+    <!-- table列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="row => row.id"
+      :showPagination="false"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 广告图位置 -->
+      <span slot="position" slot-scope="text">{{ $refs.position.getNameByCode(text) }}</span>
+      <span slot="action" slot-scope="text, record">
+        <a-icon
+          type="eye"
+          id="bannerSetting-handleView"
+          title="查看"
+          class="actionBtn icon-green"
+          @click="handleEdit(record, 1)" />
+        <a-icon
+          type="edit"
+          id="bannerSetting-handleEdit"
+          v-if="record.status == '0'"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record, 0)" />
+        <a-icon
+          type="delete"
+          id="bannerSetting-delect"
+          v-if="record.status == '0'"
+          title="删除"
+          class="actionBtn icon-red"
+          @click="delect(record)" />
+      </span>
+      <span slot="status" slot-scope="text, record">
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          id="bannerSetting-changeFlagHandle"
+          v-model="record.status == 1 ? true : false"
+          @change="changeFlagHandle(text, record)"
+        />
+      </span>
+    </s-table>
+    <!-- 弹窗 -->
+    <a-modal
+      :title="title"
+      :visible="visible"
+      :footer="null"
+      :closable="closable"
+      :centered="true"
+      @cancel="close"
+      width="45%">
+      <a-form
+        id="components-form-demo-validate-other"
+        :form="form"
+        ref="form"
+        v-bind="formItemLayout"
+        @submit="handleSubmit"
+        :hideRequiredMark="hideRequiredMark">
+        <a-form-item label="名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-input
+            id="bannerSetting-title"
+            :maxLength="30"
+            v-decorator="['formData.title', { initialValue: formData.title,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入轮播图名称(最多30个字符)!' }] }]"
+            :disabled="disabled"
+            placeholder="请输入轮播图名称(最多30个字符)"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="广告图位置" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <v-select
+            ref="position"
+            code="ADVERT_POSITION"
+            allowClear
+            id="bannerSetting-position"
+            placeholder="请选择广告图位置"
+            :disabled="disabled"
+            v-decorator="['formData.position', { initialValue: formData.position, rules: [{ required: true, message: '请选择广告图位置!' }] }]"
+          ></v-select>
+        </a-form-item>
+        <a-form-item label="跳转链接" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-textarea
+            :maxLength="300"
+            v-decorator="['formData.url', { initialValue: formData.url, rules: [{ required: false, message: '请输入跳转链接(最多300字符)!' }] }]"
+            :disabled="disabled"
+            id="bannerSetting-url"
+            placeholder="请输入跳转链接(最多300字符)"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="排序" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-input
+            type="number"
+            oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+            v-decorator="['formData.sort', { initialValue: formData.sort,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入(0~999999)之间的序号值!' }] }]"
+            :disabled="disabled"
+            id="bannerSetting-sort"
+            placeholder="请输入(0~999999)之间的序号值"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-radio-group
+            :disabled="disabled"
+            id="bannerSetting-status"
+            v-decorator="['formData.status', { initialValue: formData.status, rules: [{ required: true, message: '请选择状态!' }] }]"
+          >
+            <a-radio value="1">启用</a-radio>
+            <a-radio value="0">禁用</a-radio>
+          </a-radio-group>
+        </a-form-item>
+        <a-form-item label="上传图片" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <Upload
+            v-if="title != '查看详情'"
+            id="bannerSetting-photoPath"
+            v-decorator="[
+              'formData.photoPath',
+              {
+                initialValue: formData.photoPath,
+                rules: [{ required: true, message: '请上传轮播图!' }]
+              }
+            ]"
+            ref="bannerImage"
+            :fileSize="0.25"
+            :disabled="disabled"
+            @change="getbannerImage"
+            listType="picture-card"
+            upText="上传"
+          ></Upload>
+          <img v-else :src="formData.photoPath" style="width:100px ;height: auto;" />
+        </a-form-item>
+        <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
+          <a-button type="primary" html-type="submit" v-if="!disabled" id="bannerSetting-submit" style="margin-right: 15px">保存</a-button>
+          <a-button @click="close()" v-if="!disabled" style="margin-left: 15px" id="bannerSetting-close">取消</a-button>
+        </a-form-item>
+      </a-form>
+    </a-modal>
+  </a-card>
+</template>
+
+<script>
+import { Upload, STable, VSelect } from '@/components'
+import { getBannerSettingList, changeStatus, deleteItem, saveItem } from '@/api/bannerSetting.js'
+
+export default {
+  components: {
+    STable,
+    Upload,
+    VSelect
+  },
+  data () {
+    return {
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: 60,
+          align: 'center'
+        },
+        {
+          title: '广告图位置',
+          width: 200,
+          dataIndex: 'position',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'position'
+          }
+        },
+        {
+          title: '名称',
+          width: 100,
+          dataIndex: 'title',
+          align: 'center'
+        },
+        {
+          title: '排序',
+          width: 100,
+          dataIndex: 'sort',
+          align: 'center'
+        },
+        {
+          title: '跳转链接',
+          width: 100,
+          dataIndex: 'url',
+          align: 'center',
+          customRender: (text) => {
+            return text || '--'
+          }
+        },
+        {
+          title: '状态',
+          width: 100,
+          dataIndex: 'status',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'status'
+          }
+        },
+        {
+          title: '操作',
+          align: 'center',
+          width: 200,
+          scopedSlots: {
+            customRender: 'action'
+          }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getBannerSettingList({
+          bannerType: 'app'
+        }).then(res => {
+          // console.log(res, '1111')
+          const no = 0
+          for (let i = 0; i < res.data.length; i++) {
+            const _item = res.data[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
+      },
+
+      title: '编辑',
+      closable: true,
+      visible: false,
+      confirmLoading: false,
+      formLayout: 'horizontal',
+      hideRequiredMark: false, // 是否显示必填的* 默认显示
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: {
+          span: 6
+        },
+        wrapperCol: {
+          span: 14
+        }
+      },
+      formData: {
+        title: '', // 标题
+        url: '', // 图片路径
+        status: '', // 状态
+        sort: '', // 排序
+        position: '', // 广告图位置
+        photoPath: '', // banner地址
+        createDate: ''
+      },
+      bannerType: 'app',
+      disabled: false,
+      value: '',
+      id: '',
+      isShow: true
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'validate_other'
+    })
+  },
+  methods: {
+    showModal () {
+      this.disabled = false
+      delete this.formData.id
+      delete this.formData.createDate
+      this.visible = true
+      this.title = '新增'
+      this.hideRequiredMark = false
+    },
+    // 轮播图change
+    getbannerImage (data) {
+      this.formData.photoPath = data
+    },
+    // 点击保存;
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log('Received values of form: ', values, this.formData)
+          const formData = Object.assign({}, this.formData, values.formData, {
+            bannerType: 'app'
+          })
+          console.log(formData, _this.radioGroup)
+          saveItem(formData, _this.radioGroup).then(res => {
+            console.log(res, 'rrrrrrrrr')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.close()
+            }
+          })
+        }
+      })
+    },
+    close () {
+      this.visible = false
+      this.formData.title = ''
+      this.photo = ''
+      this.formData.url = ''
+      this.formData.status = ''
+      this.formData.sort = ''
+      this.formData.position = ''
+      this.formData.photoBasePath = ''
+      this.formData.photoPath = ''
+      this.title = '新增'
+      this.$refs.bannerImage.setFileList('')
+      this.form.resetFields()
+    },
+    // 赋值
+    assignment (row) {
+      this.formData.id = row.id
+      this.formData.title = row.title
+      this.formData.photoPath = row.photoPath
+      this.formData.url = row.url
+      this.formData.status = row.status
+      this.formData.sort = row.sort
+      this.formData.position = row.position
+      this.formData.createDate = row.createDate
+    },
+    // 0 修改,1 查看详情
+    handleEdit (row, type) {
+      const _this = this
+      console.log(row)
+      if (type == 1) {
+        this.title = '查看详情'
+        this.hideRequiredMark = true
+      } else if (type == 0) {
+        this.title = '编辑'
+        this.hideRequiredMark = false
+      }
+      this.assignment(row)
+      this.disabled = type == 1
+      this.visible = true
+      setTimeout(() => {
+        _this.$refs.bannerImage.setFileList(this.formData.photoPath)
+      }, 500)
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteItem({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    // 更改启用禁用状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        id: record.id,
+        flag: record.status == 1 ? '0' : '1'
+      }
+      changeStatus(_data).then(res => {
+        if (res.status == '200') {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+        } else {
+          record.status = !record.status
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.addBtn {
+  margin-bottom: 20px;
+}
+</style>