Browse Source

统一登录平台应用管理,节点管理

kk.shi 3 years ago
parent
commit
fd626408db

+ 28 - 1
src/router/index.js

@@ -137,7 +137,7 @@ export const asyncRoutes = [
       {
         path: 'userinfoList',
         name: 'userinfoList',
-        component: () => import('@/views/userInfo/userinfoList'),
+        component: () => import('@/views/userInfo/userInfoList'),
         meta: {
           title: '用户列表',
         },
@@ -154,6 +154,33 @@ export const asyncRoutes = [
     ],
   },
   {
+    path: '/nodeInfo',
+    component: Layout,
+    redirect: 'noRedirect',
+    name: 'nodeInfo',
+    alwaysShow: true,
+    meta: { title: '节点管理', icon: 'credit-card' },
+    children: [
+      {
+        path: 'nodeInfoList',
+        name: 'nodeInfoList',
+        component: () => import('@/views/nodeInfo/nodeInfoList'),
+        meta: {
+          title: '节点列表',
+        },
+      },
+      {
+        path: 'addNodeInfo',
+        name: 'addNodeInfo',
+        hidden: true,
+        component: () => import('@/views/nodeInfo/addNodeInfo'),
+        meta: {
+          title: '编辑节点',
+        },
+      },
+    ],
+  },
+  {
     path: '/error',
     component: EmptyLayout,
     redirect: 'noRedirect',

+ 599 - 0
src/views/nodeInfo/addNodeInfo.vue

@@ -0,0 +1,599 @@
+<template>
+  <div class="app-container">
+    <el-form
+      ref="form"
+      :rules="rules"
+      :model="form"
+      label-position="left"
+      label-width="100px"
+    >
+      <el-form-item label="注解名称" class="is-required" prop="name">
+        <el-input
+          v-model="form.name"
+          type="text"
+          :disabled="disable"
+          style="width: 300px"
+        />
+      </el-form-item>
+
+      <el-form-item label="备注" class="is-required" prop="remark">
+        <el-input
+          v-model="form.remark"
+          type="textarea"
+          :disabled="disable"
+          style="width: 300px"
+          autocomplete="off"
+          maxlength="500"
+          show-word-limit
+        />
+      </el-form-item>
+      <el-form-item label="应用" class="is-required" prop="remark">
+        <el-select
+          v-model="form.addStock"
+          clearable
+          filterable
+          value-key="value"
+          style="width: 300px; margin-right: 20px"
+          placeholder=""
+          class="filter-item"
+        >
+          <el-option
+            v-for="(item, index) in typeOption"
+            :key="index"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <div v-if="$route.query.editType === '1'">
+        <el-button type="primary" :hidden="disable" @click="updateData('form')">
+          保存
+        </el-button>
+        <el-button @click="resetUpdateForm('form')">重置</el-button>
+        <el-button @click="closePage()">关闭</el-button>
+      </div>
+      <div v-else>
+        <el-button
+          type="primary"
+          :hidden="disable"
+          @click="saveEditData('form')"
+        >
+          保存
+        </el-button>
+        <el-button @click="resetForm('form')">重置</el-button>
+        <el-button @click="closePage()">关闭</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import {
+    getCouponList,
+    getCouponPageList,
+    getEventInfo,
+    getSourceListApi,
+    saveEventInfo,
+    updateEventInfo,
+    uploadPic,
+  } from '../../axios/api'
+  import * as CouponPageListVo from '../../axios/vo/coupon-list-vo.js'
+  import { Message } from 'element-ui'
+  import { activity } from '@/api'
+
+  const toolbarOptions = [
+    ['bold', 'italic', 'underline', 'strike'], // toggled buttons
+    ['blockquote', 'code-block'],
+
+    [{ header: 1 }, { header: 2 }], // custom button values
+    [{ list: 'ordered' }, { list: 'bullet' }],
+    [{ script: 'sub' }, { script: 'super' }], // superscript/subscript
+    [{ indent: '-1' }, { indent: '+1' }], // outdent/indent
+    [{ direction: 'rtl' }], // text direction
+
+    [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown
+    [{ header: [1, 2, 3, 4, 5, 6, false] }],
+
+    [{ color: [] }, { background: [] }], // dropdown with defaults from theme
+    [{ font: [] }],
+    [{ align: [] }],
+    ['link', 'image'],
+    ['clean'], // remove formatting button
+  ]
+  export default {
+    name: 'UserInfoList',
+    components: {},
+    data() {
+      return {
+        editorOption: {
+          placeholder: '',
+          theme: 'snow', // or 'bubble'
+          modules: {
+            toolbar: {
+              container: toolbarOptions, // 工具栏
+              handlers: {
+                image: function (value) {
+                  if (value) {
+                    document.querySelector('#quill-upload input').click()
+                  } else {
+                    this.quill.format('image', false)
+                  }
+                },
+              },
+            },
+          },
+        },
+
+        quillUpdateImg: false, // 根据图片上传状态来确定是否显示loading动画,刚开始是false,不显示
+
+        activityId: null,
+        listLoading: true,
+        dialogFormVisibleChoose: false,
+        disable: false,
+        timestamp: '',
+        useLimitType: 0,
+        costLimitType: 0,
+        showCoverImg: '',
+        couponList: [],
+
+        optionsMerchant: [
+          {
+            merchantId: '1605064954',
+            merchantName: '厐睿',
+          },
+          {
+            merchantId: '1609190004',
+            merchantName: '庞嘉',
+          },
+        ],
+        typeSource: [],
+
+        form: {
+          showPrice: 1,
+          name: '',
+          balanceMchid: '',
+          coverImg: '',
+          stock: '',
+          getLimit: '',
+          timestamp: '',
+          beginTimestamp: '',
+          endTimestamp: '',
+          isPay: 0,
+          isForever: 0,
+          price: 1,
+          remark: '',
+          buyRemark: '',
+          refundType: 1,
+          status: 1,
+          script: 0,
+          supplement: 0,
+          couponIdList: [
+            {
+              couponId: '',
+              num: '1',
+              price: '1',
+            },
+          ],
+
+          payMainType: 1,
+          merchantId: '',
+          source: '',
+        },
+        typeOption: [
+          {
+            value: '1',
+            label: '卡券',
+          },
+          {
+            value: '2',
+            label: '招商',
+          },
+        ],
+        rules: {
+          name: [
+            { required: true, message: '请输入活动名称', trigger: 'blur' },
+            {
+              min: 1,
+              max: 80,
+              message: '长度在 1 到 80 个字符',
+              trigger: 'blur',
+            },
+          ],
+          remark: [
+            { required: true, message: '请输入活动备注', trigger: 'blur' },
+          ],
+        },
+      }
+    },
+    async created() {
+      ;(this.form = {
+        showPrice: 1,
+        name: '',
+        coverImg: '',
+        stock: '',
+        getLimit: '',
+        timestamp: '',
+        beginTimestamp: '',
+        endTimestamp: '',
+        isPay: 0,
+        isForever: 0,
+        price: 1,
+        remark: '',
+        status: 1,
+        refundType: 1,
+        script: 0,
+        supplement: 0,
+        couponIdList: [
+          {
+            couponId: '',
+            num: '1',
+            price: '1',
+          },
+        ],
+
+        payMainType: 1,
+        merchantId: '',
+      }),
+        this.loadCouponList()
+      let copyActivityId = this.$route.query.copyActivityId
+
+      if (copyActivityId) {
+        let copyActivity = await activity.getDetail(copyActivityId)
+        let editType = this.$route.query.editType
+        if (editType && editType === '1') {
+          console.log(editType)
+          this.dealUpdateAct(copyActivity)
+        } else {
+          console.log(123)
+          this.dealCopyActivity(copyActivity)
+        }
+      }
+
+      this.geSourceList()
+    },
+
+    methods: {
+      geSourceList() {
+        const data = {
+          page: 1,
+          pageSize: 1000,
+        }
+        getSourceListApi(data)
+          .then((res) => {
+            let result = res.data.data
+            console.log(result)
+            let sourceList = result.list
+            let typeSource = []
+
+            for (let i in sourceList) {
+              typeSource.push({
+                value: sourceList[i]['sourceValue'],
+                label: sourceList[i]['sourceValue'],
+              })
+            }
+            this.typeSource = typeSource
+            console.log(this.typeSource)
+          })
+          .catch((err) => Message.error(err))
+      },
+      uploadQuillImg(file) {
+        let formData = new window.FormData()
+        formData.append('file', file.raw)
+        formData.append('isPublic', 'true')
+        this.quillUpdateImg = true
+        uploadPic(formData)
+          .then((res) => {
+            this.quillUpdateImg = false
+            if (res.data.code != 200) {
+              Message.error(res.data.msg)
+            } else {
+              Message.success('上传成功')
+              this.uploadSuccess(res.data.data.destPath)
+            }
+          })
+          .catch((err) => Message.error(err))
+      },
+
+      // 上传图片成功
+      uploadSuccess(res) {
+        // res为图片服务器返回的数据
+        // 获取富文本组件实例
+        let quill = this.$refs.myQuillEditor.quill
+        // 获取光标所在位置
+        let length = quill.getSelection().index
+        // 插入图片  res.info为服务器返回的图片地址
+        quill.insertEmbed(length, 'image', res)
+        // 调整光标到最后
+        quill.setSelection(length + 1)
+      },
+
+      loadCouponList() {
+        let pageQuery = new CouponPageListVo.CouponPageListVo()
+        let condition = new CouponPageListVo.Condition()
+        condition.state = { value: '2', text: '' }
+
+        pageQuery.condition = condition
+        // 以后优化
+        pageQuery.pageSize = 1000
+        getCouponPageList(pageQuery)
+          .then((res) => {
+            this.couponList = res.data.data.list
+          })
+          .catch((err) => Message.error(err))
+      },
+      resetForm(formName) {
+        this.$refs[formName].resetFields()
+      },
+      resetUpdateForm() {
+        ;(this.form.name = ''),
+          (this.form.coverImg = ''),
+          (this.form.remark = ''),
+          (this.form.buyRemark = '')
+      },
+      saveEditData(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            var couponIdList = this.form.couponIdList
+
+            var obj = {}
+            var numIsEmpty = false
+            var mustPrice = false
+            var couponTotalPrice = 0
+            for (var i in couponIdList) {
+              console.log(couponIdList[i].couponId)
+              obj[couponIdList[i].couponId] = couponIdList[i].couponId
+              if (!couponIdList[i].num) {
+                numIsEmpty = true
+              }
+              if (!couponIdList[i].price) {
+                mustPrice = true
+              } else {
+                couponTotalPrice += couponIdList[i].price * 100
+              }
+            }
+            couponTotalPrice = couponTotalPrice / 100
+
+            console.log(couponTotalPrice)
+            console.log(this.form.price)
+            if (numIsEmpty) {
+              this.$message({
+                message: '券的数量必须要填写',
+                type: 'warning',
+              })
+
+              return
+            }
+            if (mustPrice && this.form.isPay == 1) {
+              this.$message({
+                message: '付费活动中券的价格需要填写',
+                type: 'warning',
+              })
+
+              return
+            }
+
+            if (Object.keys(obj).length != couponIdList.length) {
+              this.$message({
+                message: '选择的券不能重复',
+                type: 'warning',
+              })
+              return
+            }
+            if (!this.form.price && this.form.isPay == 1) {
+              this.$message({
+                message: '付费活动需要设置活动金额',
+                type: 'warning',
+              })
+              return
+            }
+            if (this.form.isPay == 1 && this.form.price != couponTotalPrice) {
+              this.$message({
+                message: '券的总价格和活动金额不相等',
+                type: 'warning',
+              })
+
+              return
+            }
+            if (!this.form.merchantId && this.form.isPay == 1) {
+              this.$message({
+                message: '付费活动需要设置默认商户号',
+                type: 'warning',
+              })
+              return
+            }
+            this.saveEditData1()
+          } else {
+            console.log('error submit!!')
+            return false
+          }
+        })
+      },
+      saveEditData1: function () {
+        let coupon = JSON.parse(JSON.stringify(this.form))
+        // copy数据
+        // 格式化时间条件
+        // 把数字解析成时间格式
+
+        coupon.price = (this.form.price * 100).toFixed(0)
+        coupon.showPrice = (this.form.showPrice * 100).toFixed(0)
+        for (var i in coupon.couponIdList) {
+          coupon.couponIdList[i].price = (
+            coupon.couponIdList[i].price * 100
+          ).toFixed(0)
+        }
+        coupon.beginTimestamp = this.form.timestamp[0]
+        coupon.endTimestamp = this.form.timestamp[1]
+        console.log(coupon)
+
+        saveEventInfo(coupon)
+          .then((res) => {
+            if (res.data.code == 200) {
+              Message.success('保存成功')
+              this.closePage()
+            } else {
+              Message.error(res.data.msg)
+            }
+            // this.loadData()
+          })
+          .catch((err) => Message.error(err))
+      },
+      updateData(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this.updateData1()
+          } else {
+            console.log('error submit!!')
+            return false
+          }
+        })
+      },
+      updateData1: function () {
+        let coupon = JSON.parse(JSON.stringify(this.form))
+        let data = {
+          activityId: this.$route.query.copyActivityId,
+          name: coupon.name,
+          coverImg: coupon.coverImg,
+          remark: coupon.remark,
+          buyRemark: coupon.buyRemark,
+          script: coupon.script,
+          supplement: coupon.supplement,
+          beginTimestamp: this.form.timestamp[0],
+          endTimestamp: this.form.timestamp[1],
+        }
+
+        updateEventInfo(data)
+          .then((res) => {
+            if (res.data.code == 200) {
+              Message.success('修改成功')
+              this.closePage()
+            } else {
+              Message.error(res.data.msg)
+            }
+            // this.loadData()
+          })
+          .catch((err) => Message.error(err))
+      },
+      handleChange(file) {
+        let formData = new window.FormData()
+        formData.append('file', file.raw)
+        formData.append('isPublic', 'true')
+        uploadPic(formData)
+          .then((res) => {
+            if (res.data.code != 200) {
+              Message.error(res.data.msg)
+            } else {
+              Message.success('上传成功')
+              this.showCoverImg = res.data.data.destPath
+              this.form.coverImg = res.data.data.url
+            }
+          })
+          .catch((err) => Message.error(err))
+      },
+      removeDomain(item) {
+        var index = this.form.couponIdList.indexOf(item)
+        if (index !== -1) {
+          this.form.couponIdList.splice(index, 1)
+        }
+        this.updateFormPrice()
+      },
+      addDomain() {
+        this.form.couponIdList.push({
+          couponId: '',
+          num: '1',
+          price: '1',
+          key: Date.now(),
+        })
+        this.updateFormPrice()
+      },
+      closePage() {
+        this.$router.go(-1)
+      },
+      updateFormPrice() {
+        let couponIdList = this.form.couponIdList
+        let total = 0
+        for (let i in couponIdList) {
+          let price = couponIdList[i]['price'] ? couponIdList[i]['price'] : 1
+          total += Number(price)
+        }
+        this.form.price = Number(total)
+      },
+
+      //处理修改的数据
+      dealUpdateAct(copyActivity) {
+        console.log(copyActivity)
+        this.showCoverImg = copyActivity.fullCoverImg
+        let date1 = new Date(copyActivity.beginTimestamp)
+        let beginTimestamp = date1.getTime()
+
+        let date2 = new Date(copyActivity.endTimestamp)
+        let endTimestamp = date2.getTime()
+        this.form = {
+          name: copyActivity.name,
+          coverImg: copyActivity.coverImg,
+          remark: copyActivity.remark,
+          buyRemark: copyActivity.buyRemark,
+          script: copyActivity.script || 0,
+          supplement: copyActivity.supplement || 0,
+          timestamp: [beginTimestamp, endTimestamp],
+          beginTimestamp: beginTimestamp,
+          endTimestamp: endTimestamp,
+        }
+      },
+
+      /**
+       * 活动源改变活动类型
+       * @param e
+       */
+      changeFormSource(e) {
+        let _self = this
+        if (e == 'FREE_MINI_APP') {
+          _self.form.isPay = 0
+        }
+      },
+    },
+  }
+</script>
+<style>
+  .active {
+    display: inline-block;
+  }
+  .timeActive {
+    display: block;
+    line-height: 50px;
+  }
+  .pTitle {
+    border-left: 3px solid #1890ff;
+    padding-left: 5px;
+    line-height: 25px;
+    font-size: 15px;
+    font-weight: bold;
+  }
+  .coupon_num {
+    width: 100px;
+    margin-left: 10px;
+    margin-right: 20px;
+  }
+  .coupon_price {
+    width: 100px;
+    margin-left: 10px;
+    margin-right: 20px;
+  }
+  .coupon_name {
+    margin-left: 10px;
+    margin-right: 20px;
+  }
+  .coupon_p {
+    display: flex;
+    flex-flow: row nowrap;
+    justify-content: left;
+    align-items: center;
+  }
+  .ql-editor {
+    min-height: 360px;
+  }
+  .el-upload-list--text {
+    width: 300px;
+  }
+</style>

+ 399 - 0
src/views/nodeInfo/nodeInfoList.vue

@@ -0,0 +1,399 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container" style="margin-bottom: 20px">
+      注解名称:
+      <el-input
+        v-model="condition.name"
+        clearable
+        placeholder="用户名称"
+        style="width: 200px; margin-right: 20px"
+        class="filter-item"
+      />
+      应用名称:
+      <el-select
+        v-model="condition.source"
+        clearable
+        filterable
+        value-key="value"
+        style="width: 200px; margin-right: 20px"
+        placeholder=""
+        class="filter-item"
+      >
+        <el-option
+          v-for="(item, index) in typeSource"
+          :key="index"
+          :label="item.label"
+          :value="item.value"
+        ></el-option>
+      </el-select>
+      <el-button
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="search"
+      >
+        搜索
+      </el-button>
+      <el-button
+        class="filter-item"
+        type="primary"
+        icon="el-icon-refresh-right"
+        @click="resetInput"
+      >
+        重置
+      </el-button>
+
+      <el-button
+        class="filter-item"
+        type="danger"
+        icon="el-icon-circle-plus-outline"
+        @click="add"
+      >
+        新增节点
+      </el-button>
+    </div>
+    <el-table
+      :key="tableKey"
+      v-loading="listLoading"
+      :data="couponEventList"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%"
+    >
+      <el-table-column label="节点ID" align="center" width="150" fixed="left">
+        <template slot-scope="{ row }">
+          <span>{{ row.activityId }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="注解名称" align="center" fixed="left">
+        <template slot-scope="{ row }">
+          <span>{{ row.name }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" fixed="left">
+        <template slot-scope="{ row }">
+          <span>{{ row.name }}测试</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应用" align="center" fixed="left">
+        <template slot-scope="{ row }">
+          <span>{{ row.name }}医用</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="创建时间"
+        align="center"
+        width="100"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="{ row }">
+          <span>{{ row.createdAt }}</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="操作"
+        align="center"
+        width="300"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="{ row }">
+          <el-button type="primary" size="mini" @click="updateDetail(row)">
+            修改
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      :background="background"
+      :current-page="queryForm.pageNo"
+      :layout="layout"
+      :page-size="queryForm.pageSize"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
+    ></el-pagination>
+  </div>
+</template>
+
+<script>
+  import {
+    getCouponEventList,
+    changeCouponEventStatus,
+    activityCacheRefresh,
+    getSourceListApi,
+    editActivityOnlineStatus,
+    editActivity,
+    updateScript,
+  } from '../../axios/api'
+  import { Message } from 'element-ui'
+
+  export default {
+    name: 'UserInfoList',
+    components: {},
+    data() {
+      return {
+        tableKey: 0,
+        couponEventListString: '',
+        couponEventList: [],
+        listLoading: true,
+        layout: 'total, sizes, prev, pager, next, jumper',
+        total: 0,
+        dialogFormVisible: false,
+        condition: {
+          name: null,
+          source: null,
+          activityId: null,
+        },
+        queryForm: {
+          pageNo: 1,
+          pageSize: 20,
+          title: '',
+        },
+        timeRange: [],
+        background: true,
+        form: {
+          weight: 0,
+          addStock: '2',
+          round: 0,
+          supplement: 0,
+          sn: '',
+          couponId: '',
+          beginTimestamp: '',
+          endTimestamp: '',
+          coupon: {
+            title: '',
+          },
+          mobile: '',
+          state: {
+            showText: '',
+          },
+        },
+        typeSource: [],
+        rowData: {},
+        typeOption: [
+          {
+            value: '1',
+            label: '管理员',
+          },
+          {
+            value: '2',
+            label: '员工',
+          },
+        ],
+      }
+    },
+    async created() {
+      this.loadData()
+      this.geSourceList()
+    },
+    methods: {
+      geSourceList() {
+        const data = {
+          page: 1,
+          pageSize: 1000,
+        }
+        getSourceListApi(data)
+          .then((res) => {
+            let result = res.data.data
+            console.log(result)
+            let sourceList = result.list
+            let typeSource = [
+              {
+                value: null,
+                label: '全部',
+              },
+            ]
+
+            for (let i in sourceList) {
+              typeSource.push({
+                value: sourceList[i]['sourceValue'],
+                label: sourceList[i]['sourceValue'],
+              })
+            }
+            this.typeSource = typeSource
+          })
+          .catch((err) => Message.error(err))
+      },
+      loadData() {
+        for (let key in this.condition) {
+          this.condition[key] = this.condition[key] ? this.condition[key] : null
+        }
+        const data = {
+          nextPage: this.queryForm.pageNo,
+          pageSize: this.queryForm.pageSize,
+          condition: this.condition,
+        }
+        let couponEventList = []
+        if (this.couponEventListString !== '') {
+          couponEventList = this.couponEventListString.split(',')
+          data.couponEventList = couponEventList
+        }
+        getCouponEventList(data)
+          .then((res) => {
+            let result = res.data.data
+            this.couponEventList = result.list
+            this.total = result.count
+            this.listLoading = false
+          })
+          .catch((err) => Message.error(err))
+      },
+      resetData() {
+        this.condition.name = null
+        this.condition.source = null
+      },
+      search: function () {
+        this.loadData()
+      },
+      resetInput: function () {
+        this.resetData()
+      },
+      handleSizeChange(val) {
+        this.queryForm.pageSize = val
+        this.loadData()
+      },
+      handleCurrentChange(val) {
+        this.queryForm.pageNo = val
+        this.loadData()
+      },
+      appletSet(row) {
+        this.$router.push({
+          path: '/signIn/appletCodeSet',
+          query: { activityId: row.activityId },
+        })
+      },
+      deleteButton(row) {
+        this.$confirm('此操作将永久删除活动, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(() => {
+            this.handleEdit(row)
+          })
+          .catch(() => {
+            // this.$message({
+            //   type: 'info',
+            //   message: '已取消删除',
+            // })
+          })
+      },
+      handleEdit(row) {
+        let data = {
+          activityId: row.activityId,
+        }
+        changeCouponEventStatus(data)
+          .then((res) => {
+            this.loadData()
+            Message.success('删除成功')
+          })
+          .catch((err) => Message.error(err))
+      },
+      //修改活动的上下架的流程
+      editOnLine(row) {
+        let data = {
+          activityId: row.activityId,
+        }
+        this.listLoading = true
+        editActivityOnlineStatus(data)
+          .then((res) => {
+            this.loadData()
+            Message.success('更新成功')
+          })
+          .catch((err) => Message.error(err))
+      },
+      add() {
+        this.$router.push('/nodeInfo/addNodeInfo')
+      },
+      updateDetail(row) {
+        this.$router.push({
+          path: '/nodeInfo/addNodeInfo',
+          query: { copyActivityId: row.activityId, editType: '1' },
+        })
+      },
+      formatTime: function (timeStamp) {
+        if (!timeStamp || timeStamp.length === 0) {
+          return ''
+        }
+        let time = new Date(timeStamp)
+        let y = time.getFullYear()
+        let m = time.getMonth() + 1
+        let d = time.getDate()
+        let h = time.getHours()
+        let mm = time.getMinutes()
+        let s = time.getSeconds()
+        return (
+          y +
+          '-' +
+          this.fixed0(m) +
+          '-' +
+          this.fixed0(d) +
+          ' ' +
+          this.fixed0(h) +
+          ':' +
+          this.fixed0(mm) +
+          ':' +
+          this.fixed0(s)
+        )
+      },
+      fixed0: function (m) {
+        return m < 10 ? '0' + m : m
+      },
+
+      saveRowDataStock(row) {
+        this.dialogFormCouponStock = true
+
+        this.rowData = row
+      },
+
+      editScript(row) {
+        this.rowData = Object.assign(row)
+        this.dialogFormScript = true
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate()
+        })
+      },
+      renderHeader(h, { column }) {
+        const paymentContent = h(
+          'div',
+          {
+            slot: 'content',
+          },
+          '0不显示,1-99更多,>99首页'
+        )
+        return h('div', [
+          h('span', column.label),
+          h(
+            'el-tooltip',
+            {
+              props: {
+                placement: 'bottom',
+              },
+            },
+            [
+              column.label != '权重' ? '' : paymentContent,
+              h('i', {
+                class: 'el-icon-warning-outline',
+                style: 'color:orange;margin-left:5px;',
+              }),
+            ]
+          ),
+        ])
+      },
+    },
+  }
+</script>
+<style>
+  .cell {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    /*width: 200px;*/
+    height: 50px;
+  }
+
+  .el-dropdown-style {
+    margin-bottom: 10px;
+  }
+</style>

+ 27 - 10
src/views/userInfo/addUserInfo.vue

@@ -45,12 +45,22 @@
       </el-form-item>
 
       <el-form-item label="角色" class="is-required" prop="name">
-        <el-input
-          v-model="form.name"
-          type="text"
-          :disabled="disable"
-          style="width: 300px"
-        />
+        <el-select
+          v-model="form.addStock"
+          clearable
+          filterable
+          value-key="value"
+          style="width: 300px; margin-right: 20px"
+          placeholder=""
+          class="filter-item"
+        >
+          <el-option
+            v-for="(item, index) in typeOption"
+            :key="index"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer">
@@ -78,9 +88,7 @@
 
 <script>
   import {
-    getCouponList,
     getCouponPageList,
-    getEventInfo,
     getSourceListApi,
     saveEventInfo,
     updateEventInfo,
@@ -110,7 +118,7 @@
     ['clean'], // remove formatting button
   ]
   export default {
-    name: 'CouponList',
+    name: 'UserInfoList',
     components: {},
     data() {
       return {
@@ -156,7 +164,16 @@
           },
         ],
         typeSource: [],
-
+        typeOption: [
+          {
+            value: '1',
+            label: '管理员',
+          },
+          {
+            value: '2',
+            label: '员工',
+          },
+        ],
         form: {
           showPrice: 1,
           name: '',

+ 28 - 15
src/views/userInfo/userinfoList.vue

@@ -179,20 +179,28 @@
     </el-dialog>
 
     <el-dialog
-      title="增加库存"
+      title="绑定角色"
       :visible.sync="dialogFormCouponStock"
       width="20%"
     >
       <el-form :model="form">
         <el-form-item label="" label-width="10%">
-          <span>输入要增加的库存数</span>
-          <el-input
+          <el-select
             v-model="form.addStock"
-            autocomplete="off"
-            type="number"
-            placeholder="请输入要增加的库存数"
-            oninput="value=value.replace(/[^\d]/g,'');if(value.length>9)value=value.slice(0,9)"
-          ></el-input>
+            clearable
+            filterable
+            value-key="value"
+            style="width: 200px; margin-right: 20px"
+            placeholder=""
+            class="filter-item"
+          >
+            <el-option
+              v-for="(item, index) in typeOption"
+              :key="index"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -268,20 +276,15 @@
     getCouponEventList,
     changeCouponEventStatus,
     activityCacheRefresh,
-    getCouponSNInfo,
     getSourceListApi,
     editActivityOnlineStatus,
-    sendCouponSn,
     editActivity,
     updateScript,
-    executeCript,
   } from '../../axios/api'
   import { Message } from 'element-ui'
-  import http from '../../axios/http'
-  import { isPhone } from '@/utils/validate'
 
   export default {
-    name: 'UserinfoList',
+    name: 'UserInfoList',
     components: {},
     data() {
       return {
@@ -309,7 +312,7 @@
         background: true,
         form: {
           weight: 0,
-          addStock: 0,
+          addStock: '2',
           round: 0,
           supplement: 0,
           sn: '',
@@ -327,6 +330,16 @@
         typeSource: [],
         rowData: {},
         dialogFormCouponRound: false,
+        typeOption: [
+          {
+            value: '1',
+            label: '管理员',
+          },
+          {
+            value: '2',
+            label: '员工',
+          },
+        ],
       }
     },
     async created() {