Selaa lähdekoodia

修改登入页面为配置页面

linwenxin 1 vuosi sitten
vanhempi
commit
2939c76dff

+ 507 - 0
src/api/policy_list.js

@@ -0,0 +1,507 @@
+import request from '@/utils/request'
+
+// 销售政策
+export function getList(params) {
+  return request({
+    url: '/policy/list',
+    method: 'get',
+    params
+  })
+}
+// 新增政策
+export function addPoliy(params) {
+  return request({
+    url: '/policy/add',
+    method: 'post',
+    data: params
+  })
+}
+// 新增政策条件
+
+export function addPoliyCondition(params) {
+  return request({
+    url: '/policy/condition/add',
+    method: 'post',
+    data: params
+  })
+}
+// 政策条件列表
+export function getConditionList(params) {
+  return request({
+    url: '/policy/condition/list',
+    method: 'get',
+    params
+  })
+}
+
+// 克隆
+export function cloneList(params) {
+  return request({
+    url: '/policy/material/clone',
+    method: 'post',
+    params
+  })
+}
+
+// 弃审
+export function setAbandon(params) {
+  return request({
+    url: '/policy/abandon',
+    method: 'post',
+    params
+  })
+}
+
+// 物料列表
+export function getK3List(params) {
+  return request({
+    url: '/k3/material/list',
+    method: 'get',
+    params
+  })
+}
+
+// 现金钱包(非返利钱包)
+export function getNoRebateWalletList(params) {
+  return request({
+    url: '/wallet/list',
+    method: 'get',
+    params
+  })
+}
+
+// 政策货品-保存(不传id新增,传id修改)
+export function savePolicy(params) {
+  return request({
+    url: '/policy/material/save',
+    method: 'post',
+    data: params
+  })
+}
+
+export function updatePolicy(params) {
+  return request({
+    url: '/policy/update',
+    method: 'post',
+    data: params
+  })
+}
+
+export function deletePolicy(params) {
+  return request({
+    url: '/policy/delete',
+    method: 'post',
+    params
+  })
+}
+
+// 修改条件
+export function updateCondition(params) {
+  return request({
+    url: '/policy/condition/update',
+    method: 'post',
+    params
+  })
+}
+
+export function getConditionMaterialDetail(params) {
+  return request({
+    url: '/policy/condition/detail',
+    method: 'get',
+    params
+  })
+}
+// 政策条件的机型列表
+export function getConditionMaterialList(params) {
+  return request({
+    url: '/policy/condition/material/list',
+    method: 'get',
+    params
+  })
+}
+// 经销商api
+
+export function getCrList(params) {
+  return request({
+    url: '/customer/list',
+    method: 'get',
+    params
+  })
+}
+
+// 政策销售商列表
+export function getCustomerList(params) {
+  return request({
+    url: '/policy/customer/list',
+    method: 'get',
+    params
+  })
+}
+// 获取销售政策编号
+export function getId(params) {
+  return request({
+    url: '/policy/id',
+    method: 'get',
+    params
+  })
+}
+
+export function deleteCondition(params) {
+  return request({
+    url: '/policy/condition/delete',
+    method: 'post',
+    params
+  })
+}
+export function toExamine(params) {
+  return request({
+    url: '/policy/examine',
+    method: 'post',
+    params
+  })
+}
+// 导入政策货品
+// /policy/material/import
+
+// 政策货品列表
+export function getMaterialList(params) {
+  return request({
+    url: '/policy/material/list',
+    method: 'get',
+    params
+  })
+}
+// 提审政策
+export function getpolicySubmit(params) {
+  return request({
+    url: '/policy/policy/submit',
+    method: 'post',
+    params
+  })
+}
+
+// 删除政策货品
+
+export function deleteMaterialPolicy(params) {
+  return request({
+    url: '/policy/material/delete',
+    method: 'post',
+    params
+  })
+}
+
+// 获取经销商详情
+export function getPolicyDetail(params) {
+  return request({
+    url: '/policy/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 对应经销商
+
+export function getCustomerlist(params) {
+  return request({
+    url: '/policy/customer_count/list',
+    method: 'get',
+    params
+  })
+}
+
+export function eidtBatch(params) {
+  return request({
+    url: '/policy/customer_count/batch',
+    method: 'post',
+    params
+  })
+}
+
+// 销售类型
+
+export function getTypeList(params) {
+  return request({
+    url: '/sale/type/list',
+    method: 'get',
+    params
+  })
+}
+
+export function DeleteData(params) {
+  return request({
+    url: '/policy/material/delete',
+    method: 'psot',
+    params
+  })
+}
+
+export function addData(params) {
+  return request({
+    url: '/sale/type/add',
+    method: 'post',
+    data: params
+  })
+}
+
+export function delTypeData(params) {
+  return request({
+    url: '/sale/type/delete',
+    method: 'post',
+    params
+  })
+}
+
+export function getDetail(params) {
+  return request({
+    url: '/sale/type/detail',
+    method: 'post',
+    data: params
+  })
+}
+
+export function updateType(params) {
+  return request({
+    url: '/sale/type/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 返利钱包列表
+
+export function getWalletList(params) {
+  return request({
+    url: '/wallet/rebate/list',
+    method: 'get',
+    params
+  })
+}
+
+export function addWallet(params) {
+  return request({
+    url: '/wallet/add',
+    method: 'post',
+    data: params
+  })
+}
+
+export function getWalletDetail(params) {
+  return request({
+    url: '/wallet/rebate/detail',
+    method: 'get',
+    params
+  })
+}
+
+export function updateWallet(params) {
+  return request({
+    url: '/wallet/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 销售品类
+export function getDictList(params) {
+  return request({
+    url: '/common/dict/list',
+    method: 'get',
+    params
+  })
+}
+
+// 产品类别
+export function getProductList(params) {
+  return request({
+    url: '/product-category/list',
+    method: 'get',
+    params
+  })
+}
+
+// 政策-作废
+export function cancelPolicy(params) {
+  return request({
+    url: '/policy/cancel',
+    method: 'post',
+    params
+  })
+}
+
+// 获取轮播图列表
+export function getImgCarouseList(params) {
+  return request({
+    url: '/record/list',
+    method: 'get',
+    params
+  })
+}
+
+// 轮播图显示与隐藏
+export function handleImgIsShow(params) {
+  return request({
+    url: '/record/updateImgStatus',
+    method: 'post',
+    params
+  })
+}
+
+// 增加轮播图
+export function addImgCarousel(params) {
+  return request({
+    url: '/record/carousel/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 修改轮播图
+export function editImgCarousel(params) {
+  return request({
+    url: '/record/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 批量删除轮播图
+export function delImgData(params) {
+  return request({
+    url: '/record/delete',
+    method: 'post',
+    params
+  })
+}
+
+// 添加公司信息
+export function addCompany(params) {
+  return request({
+    url: '/record/company/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取公司数据
+export function getCompanyList(params) {
+  return request({
+    url: '/record/company/list',
+    method: 'get',
+    params
+  })
+}
+// 返利钱包销售类型-列表
+export function getWalletRebateSaletypelist(params) {
+  return request({
+    url: '/wallet/rebate_saletype/list',
+    method: 'get',
+    params
+  })
+}
+// 返利钱包销售类型-新增
+export function getWalletRebateSaletypeAdd(data) {
+  return request({
+    url: '/wallet/rebate_saletype/add',
+    method: 'POST',
+    data
+  })
+}
+// 返利钱包销售类型-详情
+export function getWalletRebateSaletypeDetail(params) {
+  return request({
+    url: '/wallet/rebate_saletype/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 返利钱包列表
+export function getWalletRebateList(params) {
+  return request({
+    url: '/wallet/rebate/list',
+    method: 'get',
+    params
+  })
+}
+// 返利钱包销售类型-删除
+export function getWalletRebateSaletypeDelete(params) {
+  return request({
+    url: '/wallet/rebate_saletype/delete',
+    method: 'post',
+    params
+  })
+}
+// 返利钱包销售类型-修改
+export function getWalletRebateSaletypeUpdate(data) {
+  return request({
+    url: '/wallet/rebate_saletype/update',
+    method: 'post',
+    data
+  })
+}
+
+// 经销商购买上限-列表
+export function getPolicyList(params) {
+  return request({
+    url: '/policy/limit/list',
+    method: 'get',
+    params
+  })
+}
+// 政策机型-启用/作废
+export function setStauts(params) {
+  return request({
+    url: '/policy/material/status',
+    method: 'post',
+    params
+  })
+}
+//友链-列表
+export function dictAmityPage(data) {
+  return request({
+    url: `/record/amity/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function recordAmityList2(data) {
+  return request({
+    url: `/record/amity/list2`,
+    method: 'post',
+    data
+  })
+}
+
+//友链-添加
+export function dictAmityAdd(data) {
+  return request({
+    url: `/record/amity/add`,
+    method: 'post',
+    data
+  })
+}
+//友链-删除
+export function dictAmityDel(params) {
+  return request({
+    url: `/record/amity/delete`,
+    method: 'post',
+    params
+  })
+}
+//友情链接-修改
+export function dictAmityUpdate(data) {
+  return request({
+    url: `/record/amity/update`,
+    method: 'post',
+    data
+  })
+}
+//友情链接-修改
+export function dictAmityStatus(params) {
+  return request({
+    url: `/record/amity/status`,
+    method: 'post',
+    params
+  })
+}

+ 16 - 0
src/api/user.js

@@ -1,5 +1,21 @@
 import request, { postBlob, getBlob, handleImport } from '@/utils/request'
 
+
+
+export function getCompanyList() {
+  return request({
+    url: '/record/company/list',
+    method: 'get'
+  })
+}
+export function recordAmityList2(data) {
+  return request({
+    url: `/record/amity/list2`,
+    method: 'post',
+    data
+  })
+}
+
 // 登录
 export function login(params) {
   return request({

+ 102 - 0
src/components/Pagination/index.vue

@@ -0,0 +1,102 @@
+<template>
+  <div :class="{ hidden: hidden }" class="pagination-container">
+    <el-pagination
+      :background="background"
+      :current-page.sync="currentPage"
+      :page-size.sync="pageSize"
+      :layout="layout"
+      :page-sizes="pageSizes"
+      :total="total"
+      v-bind="$attrs"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+    />
+  </div>
+</template>
+
+<script>
+import { scrollTo } from '@/utils/scroll-to'
+
+export default {
+  name: 'Pagination',
+  props: {
+    total: {
+      // required: true,
+      type: Number,
+      default: 10
+    },
+    page: {
+      type: Number,
+      default: 1
+    },
+    limit: {
+      type: Number,
+      default: 10
+    },
+    pageSizes: {
+      type: Array,
+      default() {
+        return [10, 20, 30, 50]
+      }
+    },
+    layout: {
+      type: String,
+      default: 'total, sizes, prev, pager, next, jumper'
+    },
+    background: {
+      type: Boolean,
+      default: false
+    },
+    autoScroll: {
+      type: Boolean,
+      default: true
+    },
+    hidden: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    currentPage: {
+      get() {
+        return this.page
+      },
+      set(val) {
+        this.$emit('update:page', val)
+      }
+    },
+    pageSize: {
+      get() {
+        return this.limit
+      },
+      set(val) {
+        this.$emit('update:limit', val)
+      }
+    }
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.$emit('pagination', { page: this.currentPage, limit: val })
+      if (this.autoScroll) {
+        scrollTo(0, 800)
+      }
+    },
+    handleCurrentChange(val) {
+      this.$emit('pagination', { page: val, limit: this.pageSize })
+      if (this.autoScroll) {
+        scrollTo(0, 800)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.pagination-container {
+  background: #fff;
+  padding: 32px 16px;
+}
+.pagination-container.hidden {
+  display: none;
+}
+</style>

+ 88 - 0
src/mixin/index.js

@@ -0,0 +1,88 @@
+/*
+ * @Author: howie
+ * @Date: 2022-06-14 10:14:37
+ * @LastEditors: howie
+ * @LastEditTime: 2022-07-03 17:47:25
+ * @FilePath: \supply-front\src\mixin\index.js
+ * @Description:
+ *
+ * Copyright (c) 2022, All Rights Reserved.
+ */
+export default {
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      listLoading: false, // 加载
+      screenForm: {}, // 筛选表单数据
+      dataList: [], // 表格数据
+      ids: [], // 多选数据id
+      dialogVisible: false, // 弹框
+      conditionList: []
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1
+      this.getList()
+    },
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
+    },
+    hanlePagination(val) {
+      // 更改每页数量
+      this.handleSizeChange(val)
+      // 更改当前页
+      this.handleCurrentChange(val)
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this.getList()
+    },
+
+    // Windows全局打印
+    hanlePrint() {
+      window.print()
+    },
+
+    // 筛选全部数据
+    hanleSelectAll(selection, index) {
+      this.ids = selection.map(k => {
+        return k.id || k.updPriceBillId
+      })
+      console.log(this.ids)
+    },
+
+    /**
+     * @description  单条数据删除 或者 全部数据删除
+     * @author zhou
+     * @param {*} id 删除单条数据传
+     * @return {*}  Promise.resolve(ids)
+     */
+    hanleDeleteAllPromise(id) {
+      return new Promise((resolve, reject) => {
+        const ids = id ? [id] : this.ids
+        if (!ids.length) {
+          this.$errorMsg('请选择删除内容')
+          return
+        }
+        resolve(ids)
+      })
+    }
+  }
+}

+ 505 - 0
src/mixin/print.js

@@ -0,0 +1,505 @@
+import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
+
+disAutoConnect()
+import panel from '@/utils/panel'
+import { addPrint, getDtailPrintDis } from '@/api/supply/pickup'
+import { getDeliverDetail } from '@/api/supply/deliver'
+import { addPrints } from '@/api/supply/pickup'
+import { getCompanyList } from '@/api/user'
+
+export default {
+  data() {
+    return {
+      company: '', // 公司名称
+      clonelData: [], // 克隆数据
+      outputData: [], // 打印数据
+      curPaper: {
+        type: 'A5',
+        width: 500,
+        height: 147.6
+      },
+      paperTypes: {
+        A3: {
+          width: 420,
+          height: 296.6
+        },
+        A4: {
+          width: 210,
+          height: 296.6
+        },
+        A5: {
+          width: 210,
+          height: 147.6
+        },
+        B3: {
+          width: 500,
+          height: 352.6
+        },
+        B4: {
+          width: 250,
+          height: 352.6
+        },
+        B5: {
+          width: 250,
+          height: 175.6
+        }
+      },
+      scaleValue: 1,
+      scaleMax: 5,
+      scaleMin: 0.5,
+      loading: false,
+      hiprintTemplate: '',
+      addIds: []
+    }
+  },
+  computed: {
+    curPaperType() {
+      let type = 'other'
+      const types = this.paperTypes
+      for (const key in types) {
+        const item = types[key]
+        const { width, height } = this.curPaper
+        if (item.width === width && item.height === height) {
+          type = key
+        }
+      }
+      return type
+    }
+  },
+  created() {
+    this.getCompanyLists()
+  },
+  methods: {
+    // 初始化打印模板
+    initPrint() {
+      hiprint.init({
+        providers: [new defaultElementTypeProvider()]
+      })
+      // 替换配置
+      hiprint.setConfig({
+        movingDistance: 2.5,
+        text: {
+          supportOptions: [
+            {
+              name: 'styler',
+              hidden: true
+            },
+            {
+              name: 'formatter',
+              hidden: true
+            }
+          ]
+        }
+      })
+      // eslint-disable-next-line no-undef
+      hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
+      this.hiprintTemplate = new hiprint.PrintTemplate({
+        template: panel,
+        settingContainer: '#PrintElementOptionSetting',
+        paginationContainer: '.hiprint-printPagination'
+      })
+      this.hiprintTemplate.design('#hiprint-printTemplate')
+      // 获取当前放大比例, 当zoom时传true 才会有
+      // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+    },
+    /**
+     * 获取需要打印数据详情
+     * @param {Array} ids
+     */
+    async getDateil(ids, funcType = 'getDeliverDetail', check = null) {
+      this.$startLoading()
+      let loadingLen
+      // 兼容多个打印数据
+      ids = ids instanceof Array ? ids : [ids]
+      console.log(ids)
+      // 清空之前打印的数据
+      this.outputData = []
+      // 筛选id
+      let formatting = []
+
+      // 仓库认证请求接口参数
+      const params = []
+
+      // 获取数据id
+      for (let i = ids.length; i > 0; i--) {
+        formatting.push(ids[i - 1].id || ids[i - 1])
+        if (funcType === 'getDtailPrintDis') {
+          params.push({
+            id: ids[i - 1].id,
+            invoiceId: ids[i - 1].invoiceId
+          })
+          this.addIds.push(ids[i - 1].id)
+        }
+      }
+
+      if (funcType === 'getDtailPrintDis') {
+        const requestParams = params
+        try {
+          const { data } = await getDtailPrintDis(requestParams)
+          loadingLen = data.length
+          for (let i = data.length; i > 0; i--) {
+            const newData = data[i - 1]
+            await this.setPrintData(newData, funcType, check)
+            loadingLen--
+          }
+        } catch (error) {
+          this.$endLoading()
+          console.error('获取打印数据失败')
+        }
+      } else {
+        // id 去重
+        formatting = [...new Set(formatting)]
+        loadingLen = formatting.length
+        for (let i = formatting.length; i > 0; i--) {
+          const requestParams = {
+            id: formatting[i - 1]
+          }
+          try {
+            const { data } = await getDeliverDetail(requestParams)
+            this.setPrintData(data)
+          } catch (error) {
+            this.$endLoading()
+            this.$errorMsg(error)
+            console.error('获取打印数据失败')
+          }
+          loadingLen--
+        }
+      }
+      if (loadingLen == 0) {
+        return Promise.resolve()
+      }
+    },
+    // 获取公司名称
+    async getCompanyLists() {
+      try {
+        const { data } = await getCompanyList()
+        this.company = data ? data[0].companyName : ''
+      } catch (error) {
+        console.error('获取公司名称失败')
+      }
+    },
+    // 获取当前时间
+    nowDate() {
+      var date = new Date()
+      var seperator1 = '-'
+      var year = date.getFullYear()
+      var month = date.getMonth() + 1
+      var strDate = date.getDate()
+      if (month >= 1 && month <= 9) {
+        month = '0' + month
+      }
+      if (strDate >= 0 && strDate <= 9) {
+        strDate = '0' + strDate
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate
+      return currentdate
+    },
+    // 格式化时间
+    dateToDayFilter(date) {
+      if (!date) {
+        return ''
+      }
+      return date.slice(0, 10)
+    },
+    // 添加次数
+    addPrint(funcType = 'getDeliverDetail') {
+      let ids = []
+      for (let i = this.clonelData.length; i > 0; i--) {
+        const tempData = this.clonelData[i - 1].invoicePickBeans
+        if (tempData.length) {
+          for (let e = tempData.length; e > 0; e--) {
+            const newTempData = tempData[e - 1]
+            ids.push(newTempData.id)
+          }
+        } else {
+          return this.clonelData[i - 1].invoiceOrderId || this.clonelData[i - 1].id
+        }
+      }
+      let requestParams = {}
+      try {
+        if (funcType === 'getDtailPrintDis') {
+          ids = [...new Set(this.addIds)]
+          requestParams = {
+            ids: ids.join(',')
+          }
+          funcType = addPrint
+        } else {
+          requestParams = {
+            ids: ids.join(',')
+          }
+          funcType = addPrints
+        }
+
+        funcType(requestParams)
+        // 清空当前克隆数据,避免重复添加次数
+        this.clonelData = []
+      } catch (error) {
+        // console.error('添加打印次数失败')
+        this.clonelData = []
+        this.$errorMsg('添加打印次数失败' + JSON.stringify(requestParams))
+      }
+      return Promise.resolve()
+    },
+    /**
+     * 设置纸张大小
+     * @param type [A3, A4, A5, B3, B4, B5, other]
+     * @param value {width,height} mm
+     */
+    setPaper(type, value) {
+      try {
+        if (Object.keys(this.paperTypes).includes(type)) {
+          this.curPaper = {
+            type: type,
+            width: value.width,
+            height: value.height
+          }
+          this.hiprintTemplate.setPaper(value.width, value.height)
+        } else {
+          this.curPaper = {
+            type: 'other',
+            width: value.width,
+            height: value.height
+          }
+          this.hiprintTemplate.setPaper(value.width, value.height)
+        }
+      } catch (error) {
+        this.$message.error(`操作失败: ${error}`)
+      }
+    },
+    /**
+     * 方法1
+     * 自定义模板数据
+     * @param {object} data
+     * this.outputData 打印数据
+     */
+    setPrintData(data, funcType, check) {
+      let salesOrderId, invoiceId // 出库单号,发货单号 默认数据中的第一个
+      salesOrderId = data.invoicePickBeans[0].salesOrderId
+      invoiceId = data.invoicePickBeans[0].invoiceId
+      let refUseUnit, refEnginRecordNo
+      refUseUnit = data.refUseUnit || data.invoicePickBeans[0].refUseUnit || ''
+      refEnginRecordNo = data.refEnginRecordNo || data.invoicePickBeans[0].refEnginRecordNo || ''
+      let remark
+      remark = funcType === 'getDtailPrintDis' ? data.invoicePickBeans[0].remark || '' : data.remark || ''
+      console.log(data.invoicePickBeans[0], 'oo')
+      const tuiHuoRen = data.createBy
+      // 数量合计
+      let total = 0
+      // 初始化打印次数
+      let printNum = 0
+      // 避免数据发生改变
+      this.clonelData.push(JSON.parse(JSON.stringify(data)))
+      // 需要计算长度和数据裁切
+      const invoicePickBeans = data.invoicePickBeans
+      // 获取length向上取整
+      const len = Math.ceil(invoicePickBeans.length / 5)
+      for (let index = 0; index < len; index++) {
+        const table = []
+        //  length <= 0 则不执行打印
+        if (invoicePickBeans.length) {
+          // 取第一个条数据printNum
+          printNum = invoicePickBeans[0].printNum
+          const newInvoicePickBeans = invoicePickBeans.splice(0, 5)
+          for (let e = newInvoicePickBeans.length; e > 0; e--) {
+            const tempData = newInvoicePickBeans[e - 1]
+            total += Math.abs(+tempData.refundableQty)
+
+            // 添加表格数据
+            table.push({
+              id: tempData.id,
+              createTime: tempData.id ? this.dateToDayFilter(data.createTime) : '',
+              enginOrderType:
+                tempData.orderType == 'HOME' ||
+                tempData.orderType == 'TRADE' ||
+                tempData.orderType === 'REQUISITION_TRADE' ||
+                tempData.orderType === 'REQUISITION_HOME'
+                  ? tempData.enginOrderNo
+                  : tempData.mainOrderId,
+              materialName: tempData.materialName,
+              specification: tempData.specification,
+              refundableQty: tempData.refundableQty,
+              pjxh1Text: tempData.pjxh1Text
+            })
+          }
+        }
+        // 添加print输出数据
+        this.outputData.push({
+          pageNumber: `${len}-${index + 1}`,
+          printNum: printNum + 1,
+          salesId: salesOrderId,
+          invoiceId: invoiceId,
+          refUseUnit: refUseUnit,
+          refEnginRecordNo: refEnginRecordNo,
+          type: data.type,
+          tiTui: data.type === 2 ? `退货人` : `提货人`,
+          takerPhone: data.takerPhone || '',
+          headerRemark: remark,
+          total_num: data.total_num,
+          total: total,
+          company: data.type === 2 ? `${this.company}销售退货单` : `${this.company}销售发货单`,
+          pickOrderWater: data.pickOrderWater,
+          customerNumber: data.customerNumber,
+          takerDa: '',
+          nowDate: this.nowDate(),
+          takerName:
+            data.type === 2
+              ? `退货人:${check == 0 ? data.pickLogistics || '' : tuiHuoRen || ''}`
+              : `提货人:${check == 0 ? data.pickLogistics || '' : data.takerName || ''}`,
+          customerName: data.customerName || '',
+          correspondName: data.correspondName,
+          correspondNames: '',
+          pickCar: data.pickCar || '',
+          createBy: JSON.parse(localStorage.getItem('supply_user')).nickName,
+          table
+        })
+      }
+    },
+    /**
+     * 方法2
+     * 自定义打印模板
+     * @param {object} data
+     * @returns HtmlDom
+     */
+    setPrintDom(data) {
+      return `
+         <div style="font-family:'黑体';">
+            <h1 style="text-align:center">${this.company}其他收款单</h1>
+            <div>
+                <div>
+                  <span style="wdith:50%"></span>
+                  <span style="wdith:50%"></span>
+                </div>
+                <div>
+                  <span style="wdith:50%"></span>
+                  <span style="wdith:50%"></span>
+                </div>
+            </div>
+            <div >
+              <table border=".5" cellspacing="0" width="856" height="250"
+               style="border-color: rgb(0,0,0);
+                border-collapse: collapse;
+                border-style: none;
+                border: 1px solid rgb(0,0,0);
+                font-weight: normal;
+                direction: ltr;
+                padding-bottom: 0pt;
+                padding-left: 4pt;
+                padding-right: 4pt;
+                padding-top: 0pt;
+                text-decoration: none;
+                vertical-align: middle;
+                box-sizing: border-box;
+                word-wrap: break-word;
+                word-break: break-all;">
+                  <tr>
+                    <td>单据编号</td>
+                    <td>${data.billNo}</td>
+                    <td>业务日期</td>
+                    <td>${data.theTime}</td>
+                    <td>打印日期</td>
+                    <td>${data.createTime}</td>
+                  </tr>
+                  <tr>
+                    <td>付款单位</td>
+                    <td colspan="3">${data.customerName}</td>
+                    <td>项目费用名称</td>
+                    <td>${data.customerType}</td>
+                  </tr>
+                  <tr>
+                    <td>钱包</td>
+                    <td>${data.walletName}</td>
+                    <td>实收金额</td>
+                    <td style="text-align:right">${numToFixed(data.amount)}</td>
+                    <td colspan="2">${data.amount}</td>
+                  </tr>
+                  <tr>
+                    <td>备注</td>
+                    <td colspan="5">${data.remark}</td>
+                  </tr>
+              </table>
+            </div>
+            <div style="margin:100px 0 0 0">
+                <div>
+                  <div>
+                    <span style="wdith:50%"></span>
+                    <span style="wdith:50%"></span>
+                  </div>
+                  <div>
+                    <span style="wdith:50%"></span>
+                    <span style="wdith:50%"></span>
+                  </div>
+                </div>
+            </div>
+         </div>
+        `
+    },
+    /**
+     * 备份方法
+     * 获取需要打印数据详情
+     * @param {Array} ids
+     */
+    async getDateils(ids, funcType = 'getDeliverDetail') {
+      this.$startLoading()
+      let loadingLen
+      // 兼容多个打印数据
+      ids = ids instanceof Array ? ids : [ids]
+      console.log(ids)
+      // 清空之前打印的数据
+      this.outputData = []
+      // 筛选id
+      let formatting = []
+
+      // 仓库认证请求接口参数
+      const params = []
+
+      // 获取数据id
+      for (let i = ids.length; i > 0; i--) {
+        formatting.push(ids[i - 1].id || ids[i - 1])
+        if (funcType === 'getDtailPrintDis') {
+          params.push({
+            id: ids[i - 1].id,
+            invoiceId: ids[i - 1].invoiceId
+          })
+          this.addIds.push(ids[i - 1].id)
+        }
+      }
+
+      if (funcType === 'getDtailPrintDis') {
+        const requestParams = params
+        try {
+          const { data } = await getDtailPrintDis(requestParams)
+          loadingLen = data.length
+          for (let i = data.length; i > 0; i--) {
+            const newData = data[i - 1]
+            await this.setPrintData(newData)
+            loadingLen--
+          }
+        } catch (error) {
+          this.$endLoading()
+          console.error('获取打印数据失败')
+        }
+      } else {
+        // id 去重
+        formatting = [...new Set(formatting)]
+        loadingLen = formatting.length
+        for (let i = formatting.length; i > 0; i--) {
+          const requestParams = {
+            id: formatting[i - 1]
+          }
+          try {
+            const { data } = await getDeliverDetail(requestParams)
+            this.setPrintData(data)
+          } catch (error) {
+            this.$endLoading()
+            this.$errorMsg(error)
+            console.error('获取打印数据失败')
+          }
+          loadingLen--
+        }
+      }
+      if (loadingLen == 0) {
+        return Promise.resolve()
+      }
+    }
+  }
+}

+ 372 - 135
src/views/login/index.vue

@@ -1,90 +1,85 @@
 <template>
   <div class="login-container">
-    <el-form
-      ref="loginForm"
-      :model="loginForm"
-      :rules="loginRules"
-      class="login-form"
-      auto-complete="on"
-      label-position="left"
-    >
-      <div class="image-container">
-        <img src="@/assets/login/image.png" alt="" />
-      </div>
-      <div class="right-container">
-        <div class="empty-height" />
-        <div class="form-container">
-          <div class="title">售修宝平台</div>
-          <el-form-item prop="username">
-            <span class="svg-container">
-              <svg-icon icon-class="user" />
-            </span>
-            <el-input
-              ref="username"
-              v-model="loginForm.username"
-              placeholder="请输入用户名"
-              name="username"
-              type="text"
-              tabindex="1"
-              auto-complete="on"
-            />
-          </el-form-item>
-
-          <el-form-item prop="password">
-            <span class="svg-container">
-              <svg-icon icon-class="password" />
-            </span>
-            <el-input
-              :key="passwordType"
-              ref="password"
-              v-model="loginForm.password"
-              :type="passwordType"
-              placeholder="请输入密码"
-              name="password"
-              tabindex="2"
-              auto-complete="off"
-              @keyup.enter.native="handleLogin"
-            />
-            <span class="show-pwd" @click="showPwd">
-              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
-            </span>
-          </el-form-item>
-
-          <el-form-item prop="codeValue">
-            <span class="svg-container">
-              <svg-icon icon-class="password" />
-            </span>
-            <el-input
-              ref="codeValue"
-              v-model="loginForm.codeValue"
-              placeholder="请输入验证码"
-              name="codeValue"
-              type="text"
-              tabindex="3"
-              auto-complete="off"
-              @keyup.enter.native="handleLogin"
-            />
-            <div class="code" @click="getCode"><img :src="'data:image/jpeg;base64,' + codeImage" alt="" /></div>
-          </el-form-item>
-
-          <el-checkbox v-model="isRemenberPw">记住密码</el-checkbox>
-
-          <div class="button-container">
-            <el-button :loading="loading" type="primary" @click.native.prevent="handleLogin">登录</el-button>
+    <div class="flexBox">
+      <div>
+        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on"
+          label-position="left" @submit.native.prevent="handleLogin">
+          <div class="flex">
+            <div class="image-container">
+              <div class="empty-height2 fiexlay">
+                <img v-if="companyList[0] && companyList[0].logo" class="logo" :src="$imageUrl + companyList[0].logo"
+                  alt />
+                {{ companyList[0] && companyList[0].sysName ? companyList[0].sysName : '' }}
+              </div>
+              <el-carousel :interval="5000" arrow="always" height="440px" class="carousel">
+                <el-carousel-item v-for="item in banner" :key="item.id">
+                  <el-image :z-index="1" :src="imageURL + item.imgCarouselUrl" />
+                </el-carousel-item>
+              </el-carousel>
+            </div>
+            <div class="right-container">
+              <div class="empty-height" />
+              <div class="form-container">
+                <div class="title">售修宝平台</div>
+                <el-form-item prop="username">
+                  <span class="svg-container">
+                    <svg-icon icon-class="user" />
+                  </span>
+                  <el-input ref="username" v-model="loginForm.username" placeholder="请输入用户名" name="username" type="text"
+                    tabindex="1" auto-complete="on" />
+                </el-form-item>
+
+                <el-form-item prop="password">
+                  <span class="svg-container">
+                    <svg-icon icon-class="password" />
+                  </span>
+                  <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
+                    placeholder="请输入密码" name="password" tabindex="2" auto-complete="off"
+                    @keyup.enter.native="handleLogin" />
+                  <span class="show-pwd" @click="showPwd">
+                    <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
+                  </span>
+                </el-form-item>
+
+                <el-form-item prop="codeValue">
+                  <span class="svg-container">
+                    <svg-icon icon-class="password" />
+                  </span>
+                  <el-input ref="codeValue" v-model="loginForm.codeValue" placeholder="请输入验证码" name="codeValue"
+                    type="text" tabindex="3" auto-complete="off" @keyup.enter.native="handleLogin" />
+                  <div class="code" @click="getCode"><img :src="'data:image/jpeg;base64,' + codeImage" alt="" /></div>
+                </el-form-item>
+
+                <el-checkbox v-model="isRemenberPw">记住密码</el-checkbox>
+
+                <div class="button-container">
+                  <el-button :loading="loading" type="primary" @click.native.prevent="handleLogin">登录</el-button>
+                </div>
+              </div>
+            </div>
           </div>
-        </div>
+        </el-form>
       </div>
-    </el-form>
-    <div class="info">
-      <div class="info-item">
-        <el-link href="https://beian.miit.gov.cn/" :underline="false" target="_blank">粤ICP备2020090308号 </el-link>
-        <div style="margin: 0 20px">|</div>
-        <el-link href="https://beian.mps.gov.cn/#/query/webSearch" :underline="false" target="_blank">
-          <el-image style="width: 14px; height: 16px" :src="require('@/assets/login/icon_0001.png')" />
-          粤公网安备44010602008477号
-        </el-link>
+      <div v-if="companyList && companyList.length" class="info">
+        <div class="info-item">
+          <el-link :href="companyList[0].icpRecordLink" :underline="false" target="_blank">{{
+            companyList[0].icpRecord
+          }}</el-link>
+          <div v-if="companyList[0].companyName && companyList[0].icpRecordLink" style="margin: 0 20px">|</div>
+          <el-link :href="companyList[0].pubSecurityRecordLink" :underline="false" target="_blank">
+            <el-image style="width: 14px; height: 16px" :src="require('@/assets/login/icon_0001.png')" />
+            {{ companyList[0].pubSecurityRecord }}
+          </el-link>
+        </div>
+        <div>{{ companyList[0] && companyList[0].companyName ? companyList[0].companyName : '' }}</div>
+        <div class="link_gs">
+          <span v-if="dictList.length > 0" :underline="false" target="_blank">友链:</span>
+          <el-link style="margin-left: 10px" v-for="(v, i) in dictList" :key="i" :href="v.amityUrl" :underline="false"
+            target="_blank">
+            <el-image style="width: 14px; height: 16px" :src="$imageUrl + v.amityUrlLogo"></el-image>
+            {{ v.amityUrlName }}</el-link>
+        </div>
       </div>
-      <div>Copyright © 2014-2023 广州众炬科技有限公司 互联网技术开发</div>
     </div>
   </div>
 </template>
@@ -92,7 +87,7 @@
 <script>
 import { validUsername } from '@/utils/validate'
 import Cookies from 'js-cookie'
-import { getCode } from '@/api/user'
+import { getCode, getList, getCompanyList, recordAmityList2 } from '@/api/user'
 
 export default {
   name: 'Login',
@@ -134,7 +129,10 @@ export default {
       passwordType: 'password',
       redirect: undefined,
       isRemenberPw: false,
-      codeImage: ''
+      codeImage: '',
+      banner: [],
+      companyList: [],
+      dictList: []
     }
   },
   watch: {
@@ -157,8 +155,29 @@ export default {
     }
 
     this.getCode()
+    this.getList()
+    this.getCompanyList()
+    this.getDictAmityPage()
   },
   methods: {
+    // 获取轮播图
+    getList() {
+      getList().then(res => {
+        this.banner = res.data
+      })
+    },
+    //获取友情链接列表
+    getDictAmityPage() {
+      recordAmityList2().then(res => {
+        this.dictList = res.data
+      })
+    },
+    // 获取备案信息
+    getCompanyList() {
+      getCompanyList().then(res => {
+        this.companyList = res.data
+      })
+    },
     // 获取验证码
     getCode() {
       getCode().then(res => {
@@ -265,10 +284,16 @@ $back: #333;
   }
 }
 
+.info-item .el-link--inner {
+  color: #ffffff;
+}
+
 /* reset element-ui css */
 .login-container {
   background: url('~@/assets/login/background.png') center center;
   background-size: cover;
+  height: 100vh;
+
   .el-input {
     display: inline-block;
     height: 47px;
@@ -283,7 +308,8 @@ $back: #333;
       color: $back;
       height: 47px;
       caret-color: $back;
-      border-bottom: 1px solid #eaeaea;
+      border-bottom: none !important;
+
       &:-webkit-autofill {
         box-shadow: 0 0 0px 1000px $cursor inset !important;
         -webkit-text-fill-color: $back !important;
@@ -291,22 +317,106 @@ $back: #333;
     }
   }
 
+  .el-carousel__arrow--left,
+  .el-carousel__arrow--right {
+    display: none;
+  }
+
+  .carousel {
+    border-top-left-radius: 15px;
+    border-bottom-left-radius: 15px;
+    overflow: hidden;
+  }
+
   .el-form-item {
     border: 1px solid rgba(255, 255, 255, 0.1);
-    // background: rgba(0, 0, 0, 0.1);
     border-radius: 5px;
     color: #454545;
-    margin-bottom: 10px;
+    margin-bottom: 25px !important;
   }
 
-  .el-checkbox {
-    margin-top: 10px;
-    margin-left: 6px;
+  .el-checkbox__input {
+    display: none;
   }
 
   .el-form-item__error {
     left: 30px;
   }
+
+  .el-form-item__content {
+    display: flex;
+    align-items: center;
+    line-height: 0;
+  }
+
+  .show-pwd {
+    line-height: 40px;
+  }
+
+  .el-checkbox__input.is-checked+.el-checkbox__label {
+    color: #4684f4db;
+  }
+
+  .checkbox {
+    position: relative;
+    display: flex;
+    align-items: center;
+    margin-left: 1px;
+
+    .check-yes {
+      position: relative;
+      line-height: 0;
+    }
+
+    .yes {
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate(-50%, -50%);
+    }
+
+    .el-checkbox {
+      margin: 0 !important;
+    }
+  }
+
+  /* 可以设置不同的进入和离开动画 */
+  /* 设置持续时间和动画函数 */
+  .slide-fade-enter-active {
+    transition: all 0.3s ease;
+  }
+
+  .slide-fade-leave-active {
+    transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
+  }
+
+  .slide-fade-leave-active {
+    transform: translateX(10px);
+    opacity: 0;
+  }
+
+  .wei {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    margin-top: 30px;
+    text-align: center;
+    text-align-last: center;
+
+    &-item-tip {
+      height: 19px;
+      font-size: 20px;
+      margin-top: 17px;
+    }
+
+    &-item-text {
+      height: 12px;
+      font-size: 14px;
+      margin-top: 17px;
+      color: #999;
+    }
+  }
 }
 </style>
 
@@ -315,47 +425,161 @@ $bg: #2d3a4b;
 $dark_gray: #889aa4;
 $light_gray: #eee;
 
+.flex {
+  display: flex;
+  align-items: center;
+}
+
+.info {
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  justify-content: center;
+  width: 1080px;
+  margin-top: 50px;
+  line-height: 30px;
+  text-align: center;
+  text-align-last: center;
+  color: #fff;
+  z-index: 999;
+}
+
+.link_gs {
+  font-size: 14px;
+}
+
+::v-deep .link_gs .el-link--inner {
+  color: #fff;
+  font-weight: initial;
+}
+
+.info-item {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.title-item {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  margin: 0 30px;
+  cursor: pointer;
+  font-size: 22px;
+  color: #666666;
+  line-height: 40px;
+  border-bottom: 3px solid #ffffff;
+}
+
+.acitve {
+  font-weight: bold;
+  color: #4684f4;
+  border-bottom: 3px solid #4684f4;
+}
+
+.flexBox {
+  display: flex;
+  padding-top: calc(50vh - 230px);
+  justify-content: space-between;
+  flex-direction: column;
+  align-items: center;
+}
+
+.input-box {
+  position: relative;
+  width: 360px;
+  height: 50px;
+  margin-bottom: 25px;
+  background: #ffffff;
+  border: 1px solid #e6e6e6 !important;
+  border-radius: 4px;
+}
+
+.input-box:last-child {
+  margin-bottom: 10px;
+}
+
+.flex {
+  display: flex;
+  flex-direction: row;
+}
+
+.empty-height {
+  font-size: 30px;
+  font-weight: bolder;
+  height: 46px;
+  margin: 15px 0;
+  color: #fff;
+}
+
+.empty-height2 {
+  font-size: 30px;
+  font-weight: bolder;
+  height: 42px;
+  margin: 15px 0;
+  color: #fff;
+}
+
+.fiexlay {
+  width: auto;
+  height: 46px;
+  display: flex;
+  align-items: center;
+}
+
+.logo {
+  height: 42px;
+  margin-right: 5px;
+}
+
+.el-carousel__item:nth-child(2n) {
+  background-color: #99a9bf;
+}
+
+.el-carousel__item:nth-child(2n + 1) {
+  background-color: #d3dce6;
+}
+
 .login-container {
   min-height: 100%;
   width: 100%;
+  height: 100vh;
   background-color: $bg;
   overflow: hidden;
 
   .login-form {
     position: relative;
-    width: 1070px;
+    width: 1920px;
     max-width: 100%;
-    padding: 0 35px 0;
-    padding-top: calc(50vh - 230px);
-    margin: 0 auto;
-    overflow: hidden;
+    height: 100%;
+
     display: flex;
+    flex-direction: column;
+    align-items: center;
   }
 
   .image-container {
-    img {
-      width: 560px;
-      height: 460px;
-    }
+    width: 700px;
+    height: 516px;
+    //  overflow: hidden;
   }
 
   .right-container {
     width: 440px;
-    height: 460px;
-    .empty-height {
-      height: 77px;
-    }
+    height: 516px;
+
     .form-container {
+      height: 440px;
       padding: 20px 30px 27px 40px;
       background: #fff;
       border-radius: 0 15px 15px 0;
+
       .title {
-        font-size: 24px;
-        font-weight: bold;
+        justify-content: center;
         letter-spacing: 4px;
         text-align: center;
-        padding: 10px 0 13px;
-        color: #3a8ee6;
+        margin-bottom: 35px;
       }
     }
   }
@@ -373,7 +597,8 @@ $light_gray: #eee;
   }
 
   .svg-container {
-    padding: 6px 5px 6px 5px;
+    margin: 0 0 0 14px;
+    // padding: 6px 5px 6px 5px;
     color: #33aef7;
     vertical-align: middle;
     width: 30px;
@@ -383,6 +608,7 @@ $light_gray: #eee;
   .title-container {
     border-radius: 15px 15px 0 0;
     overflow: hidden;
+
     img {
       width: 100%;
       display: block;
@@ -403,56 +629,67 @@ $light_gray: #eee;
     position: absolute;
     right: 30px;
     top: 7px;
+    z-index: 99;
     cursor: pointer;
+
     img {
       height: 30px;
     }
   }
 
+  .code2 {
+    position: absolute;
+    right: 0;
+    top: -1px;
+
+    .el-button {
+      height: 50px;
+    }
+  }
+
   .button-container {
     text-align: center;
     margin-top: 20px;
+
     button {
       font-size: 16px;
       width: 100%;
       height: 45px;
-      border-radius: 45px;
-      background: #33aef7;
-      box-shadow: 2px 3px 8px 0px rgba(5, 155, 245, 0.75);
+      border-radius: 4px;
+      background: #4684f4;
+      box-shadow: 2px 3px 8px 0px #4684f46b;
     }
   }
 }
 
+.float_right {
+  position: absolute;
+  right: 0;
+  font-size: 14px;
+  cursor: pointer;
+}
+
+::v-deep .el-form-item__error {
+  color: #f56c6c;
+  font-size: 12px;
+  line-height: 1;
+  padding-top: 6px;
+  position: absolute;
+  top: 100%;
+  left: 0;
+}
+
+.el-link.el-link--default:hover {
+  color: #4684f4;
+}
+
 @media only screen and (max-width: 600px) {
   .image-container {
     display: none;
   }
+
   .form-container {
     border-radius: 15px !important;
   }
 }
-
-.info {
-  display: flex;
-  align-items: center;
-  flex-direction: column;
-  justify-content: center;
-  margin-top: 50px;
-  line-height: 30px;
-  text-align: center;
-  text-align-last: center;
-  color: #fff;
-  z-index: 999;
-  ::v-deep .el-link--inner {
-    color: #fff;
-    font-weight: initial;
-  }
-}
-
-.info-item {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  color: #fff;
-}
 </style>

+ 646 - 0
src/views/setting/loginSetting/index.vue

@@ -0,0 +1,646 @@
+<template>
+  <div class="app-container">
+    <div class="page-header">轮播图管理</div>
+    <el-divider></el-divider>
+    <div class="btn-group">
+      <el-button type="primary" size="small" @click=";(dialogVisible = true), (type = 1)">新增</el-button>
+      <el-button size="small" type="danger" @click="batchDelete()">删除</el-button>
+    </div>
+    <div class="mymain-container">
+      <el-table
+        v-loading="listLoading"
+        :data="dataList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column align="center" type="selection" width="55"></el-table-column>
+        <el-table-column
+          align="center"
+          label="轮播图名称"
+          prop="imgCarouselName"
+          min-width="120"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column align="center" label="轮播图" prop="imgCarouselUrl" min-width="120" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <a :href="scope.row.imgCarouselUrl">
+              <img :src="imageURL + scope.row.imgCarouselUrl" alt="轮播图" class="el-image__inner el-image__preview" />
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="排序"
+          prop="imgCarouselOrder"
+          min-width="160"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="创建时间"
+          prop="createTime"
+          min-width="160"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column align="center" label="状态" prop="status" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div style="z-index: 99">
+              <el-tag type="success" v-if="scope.row.status == '1'">显示</el-tag>
+              <el-tag type="danger" v-else-if="scope.row.status == '0'">隐藏 </el-tag>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" fixed="right" label="操作" min-width="160">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="hanleEdit(scope.row)">编辑</el-button>
+            <el-button type="text" size="small" @click="hanleStatus(scope.row.id)" v-if="scope.row.status === '1'"
+              >隐藏</el-button
+            >
+            <el-button type="text" size="small" @click="hanleStatus(scope.row.id)" v-if="scope.row.status === '0'"
+              >显示</el-button
+            >
+            <el-popconfirm
+              title="确定要删除这张轮播图吗?"
+              style="margin-left: 10px"
+              @confirm="hanleDelete(scope.row.id)"
+            >
+              <el-button slot="reference" type="text" size="small">删除</el-button>
+            </el-popconfirm>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div>
+      <div class="setting_title">备案管理</div>
+      <el-divider></el-divider>
+      <el-card shadow="never" class="my-card">
+        <el-form class="my-form" ref="mainForm" :model="comPanyDialogForm" label-width="120px" label-position="right">
+          <el-form-item label="ICP备案:" prop="nickName">
+            <el-input autocomplete="off" placeholder="请输入" v-model="comPanyDialogForm.icpRecord"></el-input>
+          </el-form-item>
+          <el-form-item label="ICP备案链接:" prop="nickName">
+            <el-input autocomplete="off" placeholder="请输入" v-model="comPanyDialogForm.icpRecordLink"></el-input>
+            (填写链接,可跳转至链接页面)
+          </el-form-item>
+          <el-form-item label="公网安备案:" prop="nickName">
+            <el-input autocomplete="off" placeholder="请输入" v-model="comPanyDialogForm.pubSecurityRecord"></el-input>
+          </el-form-item>
+          <el-form-item label="公网安备案链接:" prop="nickName">
+            <el-input
+              autocomplete="off"
+              placeholder="请输入"
+              v-model="comPanyDialogForm.pubSecurityRecordLink"
+            ></el-input>
+            (填写链接,可跳转至链接页面)
+          </el-form-item>
+          <div class="setting_title">公司名称管理</div>
+          <el-divider></el-divider>
+          <el-form-item label="公司名称:" prop="nickName">
+            <el-input autocomplete="off" placeholder="单行输入" v-model="comPanyDialogForm.companyName"></el-input>
+          </el-form-item>
+          <el-form-item label="系统名称:" prop="nickName">
+            <el-input autocomplete="off" placeholder="单行输入" v-model="comPanyDialogForm.sysName"></el-input>
+          </el-form-item>
+          <el-form-item label="logo:" prop="nickName">
+            <ImageUpload :fileList="fileList2" uid="fileList2" />
+          </el-form-item>
+        </el-form>
+      </el-card>
+    </div>
+    <br />
+    <!-- 友链管理--------------- -->
+    <div class="page-header">友链管理</div>
+    <el-divider></el-divider>
+    <div class="btn-group">
+      <el-button type="primary" size="small" @click="addDict">新增</el-button>
+      <el-button size="small" type="danger" @click="delDict">删除</el-button>
+    </div>
+    <div class="mymain-container">
+      <el-table
+        v-loading="listLoading"
+        :data="dictList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+        @selection-change="dictSelectionChange"
+      >
+        <el-table-column align="center" type="selection" width="55"></el-table-column>
+        <el-table-column
+          align="center"
+          label="友链名称"
+          prop="amityUrlName"
+          min-width="120"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column align="center" label="友链地址" prop="amityUrl" min-width="120" show-overflow-tooltip>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="排序"
+          prop="amityUrlSort"
+          min-width="160"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="创建时间"
+          prop="createTime"
+          min-width="160"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column align="center" label="状态" prop="status" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div style="z-index: 99">
+              <el-tag type="success" v-if="scope.row.status == 'ON'">显示</el-tag>
+              <el-tag type="danger" v-else-if="scope.row.status == 'OFF'">隐藏 </el-tag>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" fixed="right" label="操作" min-width="160">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="dictEdit(scope.row)">编辑</el-button>
+            <el-button
+              type="text"
+              size="small"
+              @click="hanleStatusDict(scope.row.amityUrlId, 'OFF')"
+              v-if="scope.row.status === 'ON'"
+              >隐藏</el-button
+            >
+            <el-button
+              type="text"
+              size="small"
+              @click="hanleStatusDict(scope.row.amityUrlId, 'ON')"
+              v-if="scope.row.status === 'OFF'"
+              >显示</el-button
+            >
+            <el-popconfirm title="确定要删除吗?" style="margin-left: 10px" @confirm="dictDelete(scope.row.amityUrlId)">
+              <el-button slot="reference" type="text" size="small">删除</el-button>
+            </el-popconfirm>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button type="primary" @click="addComPany">确定</el-button>
+      </div>
+    </div>
+    <div>
+      <el-dialog :visible.sync="dialogVisible" width="50%" @close="resetForm" :close-on-click-modal="false">
+        <el-form ref="dialogForm" :model="dialogForm" :rules="type == 1 ? rules : {}" label-width="120px" size="normal">
+          <el-form-item label="轮播图名称" prop="saleCode">
+            <el-input v-model="dialogForm.imgCarouselName"></el-input>
+          </el-form-item>
+          <el-form-item label="轮播图" prop="fileUrl">
+            <ImageUpload :fileList="fileList" uid="fileList" />
+          </el-form-item>
+          <el-form-item label="排序" prop="mainId">
+            <el-input v-model="dialogForm.imgCarouselOrder"></el-input>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click=";(dialogVisible = false), resetForm()">取 消</el-button>
+          <el-button type="primary" @click="addImgCarousel">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+    <!-- 友链管理---弹窗 -->
+    <div>
+      <el-dialog
+        :modal="true"
+        title="友情链接"
+        :visible.sync="dictDialog"
+        width="50%"
+        :show-close="false"
+        :close-on-click-modal="false"
+        :modal-append-to-body="false"
+      >
+        <el-form
+          ref="dictForm"
+          size="mini"
+          :rules="dictRules"
+          :model="dictForm"
+          label-width="120px"
+          label-position="left"
+        >
+          <el-form-item label="友链名称:" prop="amityUrlName">
+            <el-input v-model="dictForm.amityUrlName" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="友链地址:" prop="amityUrl">
+            <el-input v-model="dictForm.amityUrl" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="logo:" prop="amityUrlLogo">
+            <ImageUpload :fileList="dictFileList" uid="dictFileList" />
+          </el-form-item>
+          <el-form-item label="排序:" prop="amityUrlSort">
+            <el-input v-model="dictForm.amityUrlSort" placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="dictCancel">取 消</el-button>
+          <el-button size="mini" @click="dictConfirm" type="primary">确 定</el-button>
+        </div>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import Mixin from '@/mixin/index'
+import Pagination from '@/components/Pagination'
+import ImageUpload from '@/components/file-upload'
+import {
+  getImgCarouseList,
+  handleImgIsShow,
+  addImgCarousel,
+  delImgData,
+  addCompany,
+  editImgCarousel,
+  getCompanyList,
+  dictAmityPage,
+  dictAmityAdd,
+  dictAmityDel,
+  dictAmityUpdate,
+  dictAmityStatus
+} from '@/api/policy_list'
+
+export default {
+  mixins: [Mixin],
+  data() {
+    return {
+      imageURL: this.$imageUrl,
+      type: 0, // 0,1
+      screenForm: {
+        companyRecordManageId: '',
+        imgCarouselName: '',
+        imgCarouselUrl: '',
+        imgCarouselOrder: '',
+        status: ''
+      },
+      dialogForm: {
+        id: '',
+        companyRecordManageId: '',
+        imgCarouselName: '',
+        imgCarouselUrl: '',
+        imgCarouselOrder: '',
+        status: '1'
+      },
+      comPanyDialogForm: {
+        id: '',
+        icpRecord: '',
+        icpRecordLink: '',
+        pubSecurityRecord: '',
+        pubSecurityRecordLink: '',
+        companyName: '',
+        sysName: '',
+        logo: ''
+      },
+      dataList: [
+        {
+          date: '2016-05-02',
+          name: '王小虎',
+          label: '姓名',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }
+      ],
+      columns: [
+        {
+          prop: 'imgCarouselName',
+          lable: '轮播图名称',
+          widht: 160
+        },
+        {
+          prop: 'imgCarouselUrl',
+          lable: '轮播图',
+          widht: 200
+        },
+        {
+          prop: 'imgCarouselOrder',
+          lable: '排序',
+          widht: 160
+        },
+        {
+          prop: 'createTime',
+          lable: '创建时间',
+          widht: 160
+        },
+        {
+          prop: 'status',
+          lable: '状态',
+          widht: 120
+        }
+      ],
+      rules: {
+        imgCarouselName: [{ required: true, message: '请输入轮播图名称', trigger: 'blur' }]
+      },
+      productList: [],
+      fileList: [],
+      multipleSelection: [],
+      fileList2: [],
+
+      dictForm: {
+        amityUrlName: '',
+        amityUrl: '',
+        amityUrlLogo: '',
+        amityUrlSort: ''
+      },
+      dictDialog: false,
+      dictRules: {},
+      dictFileList: [],
+      dictList: [],
+      amityUrlId: '',
+      dictSelectList: []
+    }
+  },
+  watch: {
+    fileList2() {
+      if (this.fileList2[0]) {
+        this.comPanyDialogForm.logo = this.fileList2[0].url
+      } else {
+        this.comPanyDialogForm.logo = ''
+      }
+    }
+  },
+  created() {
+    this.getDictAmityPage()
+  },
+  methods: {
+    async hanleStatusDict(id, status) {
+      await dictAmityStatus({
+        amityUrlId: id,
+        status: status
+      })
+      this.$message.success(status === 'OFF' ? '已隐藏' : '已显示')
+      this.getDictAmityPage()
+    },
+    async delDict() {
+      let params = {
+        amityUrlIds: this.dictSelectList.map(v => v.amityUrlId).toString()
+      }
+      await dictAmityDel(params)
+      this.$message.success('删除成功')
+      this.getDictAmityPage()
+    },
+    dictSelectionChange(value) {
+      this.dictSelectList = value
+    },
+    dictEdit(value) {
+      // console.log(value)
+      this.amityUrlId = value.amityUrlId
+      this.dictForm = {
+        amityUrlName: value.amityUrlName,
+        amityUrl: value.amityUrl,
+        amityUrlLogo: '',
+        amityUrlSort: value.amityUrlSort
+      }
+      if (value.amityUrlLogo === '') {
+        this.dictFileList = []
+      } else {
+        this.dictFileList = [
+          {
+            hover: false,
+            name: '',
+            url: value.amityUrlLogo
+          }
+        ]
+      }
+
+      this.dictDialog = true
+    },
+    async dictDelete(amityUrlIds) {
+      console.log(amityUrlIds)
+      await dictAmityDel({ amityUrlIds: amityUrlIds })
+      this.$message.success('删除成功')
+      this.getDictAmityPage()
+    },
+    //
+    addDict() {
+      this.amityUrlId = ''
+      this.dictDialog = true
+    },
+    //
+    dictCancel() {
+      this.dictForm = {
+        amityUrlName: '',
+        amityUrl: '',
+        amityUrlLogo: '',
+        amityUrlSort: ''
+      }
+      this.dictFileList = []
+      this.dictDialog = false
+    },
+    //
+    async dictConfirm() {
+      let params = {
+        amityUrlId: this.amityUrlId,
+        amityUrlName: this.dictForm.amityUrlName,
+        amityUrl: this.dictForm.amityUrl,
+        amityUrlLogo: this.dictFileList.length == 0 ? '' : this.dictFileList[0].url,
+        amityUrlSort: this.dictForm.amityUrlSort
+      }
+
+      if (this.amityUrlId === '') {
+        await dictAmityAdd(params)
+        this.$message.success('新增成功')
+      } else {
+        await dictAmityUpdate(params)
+        this.$message.success('编辑成功')
+      }
+
+      this.getDictAmityPage()
+      this.dictCancel()
+    },
+    //获取友情链接列表
+    async getDictAmityPage() {
+      let params = {
+        pageNum: 1,
+        pageSize: -1
+      }
+      let { data } = await dictAmityPage(params)
+      this.dictList = data.records
+    },
+
+    getList() {
+      this.listLoading = true
+      const params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        saleCode: this.screenForm.saleCode,
+        saleName: this.screenForm.saleName,
+        mainId: '',
+        status: this.screenForm.status
+      }
+      getCompanyList().then(res => {
+        if (res.data) {
+          this.comPanyDialogForm.id = res.data[0].id
+          this.comPanyDialogForm.icpRecord = res.data[0].icpRecord
+          this.comPanyDialogForm.icpRecordLink = res.data[0].icpRecordLink
+          this.comPanyDialogForm.pubSecurityRecord = res.data[0].pubSecurityRecord
+          this.comPanyDialogForm.pubSecurityRecordLink = res.data[0].pubSecurityRecordLink
+          this.comPanyDialogForm.companyName = res.data[0].companyName
+          this.comPanyDialogForm.sysName = res.data[0].sysName
+          this.comPanyDialogForm.logo = res.data[0].logo
+          this.fileList2 = res.data[0].logo ?  [{ url: res.data[0].logo }] : []
+        }
+      })
+      getImgCarouseList(params).then(res => {
+        this.dataList = res.data
+        this.listLoading = false
+      })
+    },
+    handleChange(e) {
+      this.productList.find(k => {
+        if (k.productCategoryNumber == e) {
+          this.dialogForm.mainId = k.productCategoryNumber
+          this.dialogForm.mainName = k.productCategoryName
+          this.screenForm.mainId = k.productCategoryNumber
+          this.screenForm.mainName = k.productCategoryName
+        }
+      })
+    },
+    hanleDelete(id) {
+      this.hanleDeleteAllPromise(id).then(ids => {
+        delImgData({
+          ids: ids[0]
+        }).then(res => {
+          this.$successMsg('删除成功')
+          this.hanleReset()
+        })
+      })
+    },
+    hanleEdit(item) {
+      this.dialogForm = {
+        id: item.id,
+        companyRecordManageId: item.companyRecordManageId,
+        imgCarouselName: item.imgCarouselName,
+        imgCarouselUrl: item.imgCarouselUrl,
+        imgCarouselOrder: item.imgCarouselOrder,
+        status: item.status
+      }
+      this.fileList = [{ url: item.imgCarouselUrl }]
+      this.type = 0
+      this.dialogVisible = true
+    },
+    hanleDateil(item) {
+      this.dialogVisible = true
+      this.dialogForm = {
+        ...item
+      }
+      this.type = 3
+    },
+    hanleStatus(id) {
+      handleImgIsShow({
+        id: id
+      }).then(res => {
+        this.$successMsg('状态已更改')
+        this.hanleReset()
+      })
+    },
+    addImgCarousel() {
+      if (this.type == 1) {
+        this.$refs.dialogForm.validate(valid => {
+          if (valid) {
+            this.dialogForm.imgCarouselUrl = this.fileList[0].url
+            const params = {
+              ...this.dialogForm
+            }
+            addImgCarousel(params).then(res => {
+              this.$successMsg('添加成功')
+              this.hanleReset()
+            })
+          } else {
+            console.log('error submit!!')
+            return false
+          }
+        })
+      } else if (this.type == 0) {
+        const upParams = {
+          ...this.dialogForm,
+          imgCarouselUrl: this.fileList[0].url
+        }
+        editImgCarousel(upParams).then(res => {
+          this.$successMsg('修改成功')
+          this.hanleReset()
+        })
+      } else {
+        this.dialogVisible = false
+      }
+    },
+    // 表格选择
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    },
+    //添加公司信息
+    addComPany() {
+      const params = {
+        ...this.comPanyDialogForm
+      }
+      addCompany(params).then(res => {
+        this.$successMsg('添加成功')
+        this.hanleReset()
+      })
+    },
+    resetForm(formName) {
+      this.$refs.dialogForm.resetFields()
+    },
+    hanleReset() {
+      this.dialogForm = {
+        companyRecordManageId: '',
+        imgCarouselName: '',
+        imgCarouselUrl: '',
+        imgCarouselOrder: '',
+        status: '1'
+      }
+      this.dialogVisible = false
+      this.getList()
+    },
+    batchDelete() {
+      if (this.multipleSelection.length < 1) {
+        return this.$errorMsg('请选择信息')
+      }
+      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          let ids = []
+          this.multipleSelection.forEach(item => {
+            ids.push(item.id)
+          })
+          delImgData({ ids: ids.join(',') }).then(res => {
+            this.$successMsg('删除成功')
+            this.hanleReset()
+          })
+        })
+        .catch(() => {})
+    }
+  },
+  components: {
+    Pagination,
+    ImageUpload
+  }
+}
+</script>
+<style scoped>
+.el-switch.is-disabled {
+  opacity: inherit;
+}
+.page-header {
+  font-size: 18px;
+  padding-bottom: 10px;
+  font-weight: 600;
+}
+.cname-footer {
+  margin-top: 15px;
+}
+.my-form {
+  width: 60%;
+}
+</style>