zhuxinbo 5 vuotta sitten
vanhempi
commit
d86621b281

+ 3 - 3
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -62,7 +62,7 @@
           :columns="columns"
           :dataSource="dataList"
           bordered
-          :scroll="{ x: true }"
+          :scroll="{ x: 2000 }"
           :customRow="rowClick"
           :pagination="ipagination"
           :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@@ -133,7 +133,7 @@ var columns = [
     align: 'center',
     dataIndex: 'campaignName',
     fixed: 'left',
-    width: 200,
+    width: 300,
     scopedSlots: { customRender: 'campaignName' }
   },
 
@@ -142,7 +142,7 @@ var columns = [
     align: 'center',
     dataIndex: 'dayBudget',
     scopedSlots: { customRender: 'dayBudget' },
-    width: 250
+    width: 200
   },
   {
     title: '计划状态',

+ 17 - 25
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -16,7 +16,7 @@
     <a-row style="margin-top:15px">
       <a-card title="">
         <!-- :tabList="title" :activeTabKey="titleKey" @tabChange="key => onTabChange(key, 'titleKey')" -->
-        <a-tabs v-model="titleKey" type="editable-card" hideAdd @edit="remove">
+        <a-tabs v-model="titleKey" type="editable-card" hideAdd @edit="remove" @change="onTabChange">
           <a-tab-pane v-for="pane in title" :tab="pane.tab" :key="pane.key">
             <a-button @click="dianji" style="margin-bottom:15px;">新增广告组</a-button>
             <a-button @click="showEdit = true" style="margin:0 0 15px 15px;">列表项筛选</a-button>
@@ -56,7 +56,7 @@
               bordered
               :customRow="rowClick"
               :pagination="ipagination"
-              :scroll="{ x: true }"
+              :scroll="{ x: 3000 }"
               :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             >
               <a slot="unitName" slot-scope="text, record" @click="toDetail(record)">{{ text }}</a>
@@ -163,9 +163,9 @@ var columns = [
     title: '预算',
     align: 'center',
     dataIndex: 'dayBudget',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'dayBudget' },
-    width: 200,
+    width: 150,
     fixed: 'left'
   },
   {
@@ -173,7 +173,6 @@ var columns = [
     align: 'center',
     dataIndex: 'bid',
     scopedSlots: { customRender: 'bid' },
-    colSpan: 1,
     width: 150,
     fixed: 'left'
   },
@@ -182,42 +181,37 @@ var columns = [
     align: 'center',
     dataIndex: 'unitName',
     scopedSlots: { customRender: 'unitName' },
-    colSpan: 1,
     fixed: 'left',
-    width: 200
+    width: 250
   },
   {
     title: '广告组状态',
     align: 'center',
     dataIndex: 'status',
-    colSpan: 1,
     scopedSlots: { customRender: 'status' }
   },
   {
     title: '投放状态',
     align: 'center',
     dataIndex: 'putStatus',
-    colSpan: 1,
     scopedSlots: { customRender: 'putStatus' }
   },
   {
     title: '创建渠道',
     align: 'center',
     dataIndex: 'createChannel',
-    colSpan: 1,
     scopedSlots: { customRender: 'createChannel' }
   },
   {
     title: '审核拒绝理由',
     align: 'center',
-    dataIndex: 'reviewDetail',
-    colSpan: 1
+    dataIndex: 'reviewDetail'
   },
   {
     title: '出价类型',
     align: 'center',
     dataIndex: 'bidType',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'bidType' }
   },
   //   {
@@ -230,7 +224,7 @@ var columns = [
     title: '投放方式',
     align: 'center',
     dataIndex: 'speed',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'speed' }
   },
   {
@@ -249,28 +243,28 @@ var columns = [
     title: '广告位',
     align: 'center',
     dataIndex: 'sceneId',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'sceneId' }
   },
   {
     title: '创意展现方式',
     align: 'center',
     dataIndex: 'showModel',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'showModel' }
   },
   {
     title: '创意制作方式',
     align: 'center',
     dataIndex: 'unitType',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'unitType' }
   },
   {
     title: '落地页链接',
     align: 'center',
     dataIndex: 'url',
-    colSpan: 1,
+
     scopedSlots: { customRender: 'url' }
   }
 ]
@@ -428,7 +422,7 @@ export default {
         this.$bus.$emit('remove', '/account/advertisingGroup')
       } else {
         localStorage.setItem('advertisingGroup', JSON.stringify(this.title))
-        localStorage.setItem('advertisingGroupKey', JSON.stringify(this.titleKey))
+        localStorage.setItem('advertisingGroupKey', this.titleKey)
         this.getDataList(activeKey)
       }
     },
@@ -630,11 +624,10 @@ export default {
         this.columns = this.columnsElse
       }
     },
-    onTabChange(key, type) {
+    onTabChange(key) {
       this.ipagination.current = 1
-      this[type] = key
+      this.titleKey = key
       localStorage.setItem('advertisingGroupKey', key)
-      this.titleArr()
       this.getDataList(key)
     },
     getDataList(id) {
@@ -683,12 +676,11 @@ export default {
     this.titleKey = localStorage.getItem('advertisingGroupKey')
     this.title = data.map(item => {
       return {
-        key: item.campaignId + '',
-        tab: '广告计划:' + item.campaignName
+        key: item.campaignId ? item.campaignId + '' : item.key + '',
+        tab: item.campaignName ? '广告计划:' + item.campaignName : '广告计划:' + item.tab
       }
     })
     this.getDataList(localStorage.getItem('advertisingGroupKey'))
-    this.titleArr()
     this.showList = this.columns.map(item => {
       return {
         label: item.title,

+ 71 - 13
src/views/modules/kuaishouapp/account/originality.vue

@@ -13,9 +13,18 @@
     <a-row style="margin-top:15px">
       <a-card title="">
         <!-- :tabList="title" :activeTabKey="titleKey" @tabChange="key => onTabChange(key, 'titleKey')" -->
-        <a-tabs v-model="titleKey" type="editable-card" hideAdd @edit="remove">
+        <a-tabs v-model="titleKey" type="editable-card" hideAdd @edit="remove" @change="onTabChange">
           <a-tab-pane v-for="pane in title" :tab="pane.tab" :key="pane.key">
             <a-button @click="dianji" style="margin-bottom:15px">新增创意</a-button>
+            <div v-show="selectedRowKeys.length > 0">
+              批量操作:
+              <a-select style="width: 120px" v-model="allType">
+                <a-select-option value="1">启动</a-select-option>
+                <a-select-option value="2">暂停</a-select-option>
+                <a-select-option value="3">删除</a-select-option>
+              </a-select>
+              <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary">确认</a-button>
+            </div>
             <a-table
               :columns="columns"
               :dataSource="dataList"
@@ -23,7 +32,11 @@
               :scroll="{ x: true }"
               :customRow="rowClick"
               size="middle"
+              :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             >
+              <span slot="action" slot-scope="text, record">
+                <a-switch v-model="record.showSwich" @change="onChangeSwitch(record)" />
+              </span>
               <span slot="status" slot-scope="text">{{ text | status }}</span>
               <span slot="putStatus" slot-scope="text">{{ text | putStatus }}</span>
               <img slot="coverUrl" slot-scope="text" :src="text" alt="" style="width:100px" />
@@ -40,15 +53,20 @@ import ARow from 'ant-design-vue/es/grid/Row'
 import ACol from 'ant-design-vue/es/grid/Col'
 import moment from 'moment'
 import countTo from 'vue-count-to'
-
-import { deleteAction, getAction } from '@/api/manage'
+import { mapGetters } from 'vuex'
+import { deleteAction, getAction, postAction } from '@/api/manage'
 // import lifting from './components/lifting'
 const columns = [
   {
+    title: '操作',
+    align: 'center',
+    dataIndex: 'action',
+    width: 100,
+    scopedSlots: { customRender: 'action' }
+  },
+  {
     title: '创意名称',
     dataIndex: 'creativeName',
-    fixed: 'left',
-    width: 300,
     align: 'center'
   },
   {
@@ -121,7 +139,10 @@ export default {
       },
       name: null,
       title: [],
-      titleKey: null
+      titleKey: null,
+      selectedRowKeys: [],
+      selectedRowKeysValue: [],
+      allType: '1'
     }
   },
   filters: {
@@ -151,9 +172,45 @@ export default {
     }
   },
   methods: {
-    onTabChange(key, type) {
-      console.log(key, type)
-      this[type] = key
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    onChangeSwitch(item) {
+      console.log(item)
+      var params = {}
+      params.accountId = localStorage.getItem('accountId')
+      params.putStatus = item.showSwich ? 1 : 2
+      params.userId = this.userInfo().id
+      params.creativeIds = [item.creativeId]
+      postAction('/kuaishou/batch/batchUpdateCreativeStatus', params).then(res => {
+        console.log(res)
+      })
+    },
+    editStatus() {
+      var params = {}
+      params.accountId = localStorage.getItem('accountId')
+      params.putStatus = this.allType
+      params.userId = this.userInfo().id
+      params.creativeIds = this.selectedRowKeysValue
+      postAction('/kuaishou/batch/batchUpdateCreativeStatus', params).then(res => {
+        console.log(res)
+        if (res.success) {
+          this.getDataList(localStorage.getItem('originalityKey'))
+          this.$message.success('批量修改成功')
+          this.allType = '1'
+          this.selectedRowKeysValue = []
+          this.selectedRowKeys = []
+        }
+      })
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRowKeysValue = selectionRows.map(item => {
+        return item.creativeId
+      })
+      //    this.selectedRowKeysValue.length > 0 ? this.selectedRowKeysValue :
+    },
+    onTabChange(key) {
+      this.ipagination.current = 1
+      this.titleKey = key
       localStorage.setItem('originalityKey', key)
       this.getDataList(key)
     },
@@ -196,7 +253,8 @@ export default {
             return {
               ...v,
               key: index,
-              edit: false
+              edit: false,
+              showSwich: v.putStatus == 1 ? true : false
             }
           })
         }
@@ -224,7 +282,7 @@ export default {
         this.$bus.$emit('remove', '/account/originality')
       } else {
         localStorage.setItem('originality', JSON.stringify(this.title))
-        localStorage.setItem('originalityKey', JSON.stringify(this.titleKey))
+        localStorage.setItem('originalityKey', this.titleKey)
         this.getDataList(activeKey)
       }
     }
@@ -236,8 +294,8 @@ export default {
     console.log(this.$route.params)
     this.title = JSON.parse(localStorage.getItem('originality')).map(item => {
       return {
-        key: item.unitId + '',
-        tab: '广告组:' + item.unitName,
+        key: item.unitId ? item.unitId + '' : item.key + '',
+        tab: item.unitName ? '广告组:' + item.unitName : '广告组:' + item.tab,
         sceneId: item.sceneId,
         bid_type: item.ocpxActionType
       }

+ 1 - 2
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -349,7 +349,7 @@
                           allForm.groupTypeData.deep_conversion_types.length > 0
                       "
                     >
-                      <a-select v-model="item.deep_conversion_type">
+                      <a-select v-model="item.deep_conversion_type" allowClear>
                         <a-select-option
                           :value="items.deep_conversion_type"
                           v-for="(items, index) of allForm.groupTypeData.deep_conversion_types"
@@ -964,7 +964,6 @@ export default {
     this.getAppList()
     this.getCampaignList()
     getAction('/kuaishou/batch/getIsActivate', { accountId: localStorage.getItem('accountId') }).then(res => {
-      console.log(res)
       if (res.success) {
         this.allForm.groupTypeData = res.result
       }

+ 19 - 2
src/views/modules/material/materialList.vue

@@ -227,13 +227,20 @@ a {
                 <a-badge
                   :count="checkArr.indexOf(items.url) > -1 ? checkArr.indexOf(items.url) + 1 : 0"
                   :numberStyle="{ backgroundColor: '#52c41a' }"
-                  style="width:100%"
+                  style="width:100%;display:flex"
+                  @click.stop
                 >
                   <span
                     style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;"
                   >
                     {{ items.materialName }}
                   </span>
+                  <a-icon
+                    type="close-circle"
+                    @click="deleteData(items.id)"
+                    v-show="active == '0'"
+                    v-if="items.userId == userInfo().id"
+                  />
                 </a-badge>
                 <div style="display:flex;justify-content:center;width:100%;height:200px;position:relative">
                   <div
@@ -598,7 +605,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import UploadToAli from '@femessage/upload-to-ali'
 import { fileCheck, fileInsert, fileEdit } from '@/api/actor'
-import { getAction, postAction, postFile, downFile, downFilePost } from '@/api/manage'
+import { getAction, postAction, postFile, downFile, downFilePost, deleteAction } from '@/api/manage'
 
 import { mapGetters } from 'vuex'
 import moment from 'moment'
@@ -740,6 +747,16 @@ export default {
     }
   },
   methods: {
+    deleteData(id) {
+      deleteAction('/ctop/materialInfo/delete', { id: id }).then(res => {
+        if (res.success) {
+          this.$message.success('删除成功')
+          this.loadData()
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
     moment,
     filterOption(input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 19 - 2
src/views/modules/material/videoMaterial.vue

@@ -242,13 +242,20 @@ a {
                 <a-badge
                   :count="checkArr.indexOf(items.id) > -1 ? checkArr.indexOf(items.id) + 1 : 0"
                   :numberStyle="{ backgroundColor: '#52c41a' }"
-                  style="width:100%"
+                  style="width:100%;display:flex"
+                  @click.stop
                 >
                   <span
                     style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;"
                   >
                     {{ items.materialName }}
                   </span>
+                  <a-icon
+                    type="close-circle"
+                    @click="deleteData(items.id)"
+                    v-show="active == '0'"
+                    v-if="items.userId == userInfo().id"
+                  />
                 </a-badge>
                 <div style="display:flex;justify-content:center;width:100%;height:200px;position:relative">
                   <video
@@ -711,7 +718,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import UploadToAli from '@femessage/upload-to-ali'
 import { fileCheck, fileInsert, fileEdit } from '@/api/actor'
-import { getAction, postAction, postFile } from '@/api/manage'
+import { getAction, postAction, postFile, deleteAction } from '@/api/manage'
 import qs from 'qs'
 import { mapGetters } from 'vuex'
 import moment from 'moment'
@@ -864,6 +871,16 @@ export default {
     }
   },
   methods: {
+    deleteData(id) {
+      deleteAction('/ctop/materialInfo/delete', { id: id }).then(res => {
+        if (res.success) {
+          this.$message.success('删除成功')
+          this.loadData()
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
     filterOption(input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },

+ 180 - 179
src/views/system/modules/SysUserAgentModal.vue

@@ -1,180 +1,181 @@
-<template>
-  <a-modal
-    :title="title"
-    :width="800"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    @ok="handleOk"
-    @cancel="handleCancel"
-    cancelText="关闭">
-
-    <a-spin :spinning="confirmLoading">
-      <a-form :form="form">
-
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="用户名">
-          <a-input placeholder="请输入用户名" v-decorator="['userName', {}]" readOnly/>
-        </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="代理人用户名">
-          <j-select-user-by-dep placeholder="请输入代理人用户名" v-decorator="['agentUserName', validatorRules.agentUserName]"
-                                :trigger-change="true"></j-select-user-by-dep>
-        </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="代理开始时间">
-          <j-date
-            v-decorator="[ 'startTime', validatorRules.startTime]"
-            :trigger-change="true"
-            :showTime="true"
-            date-format="YYYY-MM-DD HH:mm:ss"
-            style="width:100%"
-            placeholder="请选择开始时间">
-          </j-date>
-        </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="代理结束时间">
-          <j-date
-            v-decorator="[ 'endTime', validatorRules.endTime]"
-            :trigger-change="true"
-            :showTime="true"
-            date-format="YYYY-MM-DD HH:mm:ss"
-            style="width:100%"
-            placeholder="请选择结束时间">
-          </j-date>
-        </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="状态">
-          <a-radio-group class="fontiframe" name="radioGroup" v-decorator="[ 'status', {}]">
-            <a-radio class="radioGroup" value="1">有效</a-radio>
-            <a-radio class="radioGroup" value="0">无效</a-radio>
-          </a-radio-group>
-        </a-form-item>
-
-      </a-form>
-    </a-spin>
-  </a-modal>
-</template>
-
-<script>
-  import pick from 'lodash.pick'
-  import {httpAction, getAction} from '@/api/manage'
-  import JDate from '@/components/jeecg/JDate.vue';
-  import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
-
-  export default {
-    name: "SysUserAgentModal",
-    components: {
-      JDate,
-      JSelectUserByDep
-    },
-    data() {
-      return {
-        title: "操作",
-        visible: false,
-        model: {},
-        labelCol: {
-          xs: {span: 24},
-          sm: {span: 5},
-        },
-        wrapperCol: {
-          xs: {span: 24},
-          sm: {span: 16},
-        },
-        username: "",
-        confirmLoading: false,
-        form: this.$form.createForm(this),
-        validatorRules: {
-          agentUserName: {rules: [{required: true, message: '请输入代理人用户名!'}]},
-          startTime: {rules: [{required: true, message: '请输入代理开始时间!'}]},
-          endTime: {rules: [{required: true, message: '请输入代理结束时间!'}]},
-        },
-        url: {
-          add: "/system/sysUserAgent/add",
-          edit: "/system/sysUserAgent/edit",
-          queryByUserName: "/system/sysUserAgent/queryByUserName",
-        },
-      }
-    },
-    created() {
-    },
-    methods: {
-      agentSettings(username) {
-        this.username = username;
-        this.init();
-
-      },
-      init() {
-        var params = {userName: this.username};//查询条件
-        getAction(this.url.queryByUserName, params).then((res) => {
-          if (res.success) {
-            console.log("获取流程节点信息", res);
-            this.edit(res.result);
-          } else {
-            this.edit({userName: this.username, status: "0"});
-          }
-        })
-      },
-      edit(record) {
-        this.form.resetFields();
-        this.model = Object.assign({}, record);
-        this.visible = true;
-        this.$nextTick(() => {
-          this.form.setFieldsValue(pick(this.model, 'userName', 'agentUserName', 'status', 'startTime', 'endTime'))
-        });
-      },
-      close() {
-        this.$emit('close');
-        this.visible = false;
-      },
-      handleOk() {
-        const that = this;
-        // 触发表单验证
-        this.form.validateFields((err, values) => {
-          if (!err) {
-            that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if (!this.model.id) {
-              httpurl += this.url.add;
-              method = 'post';
-            } else {
-              httpurl += this.url.edit;
-              method = 'put';
-            }
-            let formData = Object.assign(this.model, values);
-            httpAction(httpurl, formData, method).then((res) => {
-              if (res.success) {
-                that.$message.success(res.message);
-                //this.init();
-              } else {
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.confirmLoading = false;
-              that.close();
-            })
-
-
-          }
-        })
-      },
-      handleCancel() {
-        this.close()
-      }
-    }
-  }
-</script>
-
-<style scoped>
-
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭">
+
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="用户名">
+          <!-- readOnly -->
+          <a-input placeholder="请输入用户名" v-decorator="['userName', {}]" />
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="代理人用户名">
+          <j-select-user-by-dep placeholder="请输入代理人用户名" v-decorator="['agentUserName', validatorRules.agentUserName]"
+                                :trigger-change="true"></j-select-user-by-dep>
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="代理开始时间">
+          <j-date
+            v-decorator="[ 'startTime', validatorRules.startTime]"
+            :trigger-change="true"
+            :showTime="true"
+            date-format="YYYY-MM-DD HH:mm:ss"
+            style="width:100%"
+            placeholder="请选择开始时间">
+          </j-date>
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="代理结束时间">
+          <j-date
+            v-decorator="[ 'endTime', validatorRules.endTime]"
+            :trigger-change="true"
+            :showTime="true"
+            date-format="YYYY-MM-DD HH:mm:ss"
+            style="width:100%"
+            placeholder="请选择结束时间">
+          </j-date>
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="状态">
+          <a-radio-group class="fontiframe" name="radioGroup" v-decorator="[ 'status', {}]">
+            <a-radio class="radioGroup" value="1">有效</a-radio>
+            <a-radio class="radioGroup" value="0">无效</a-radio>
+          </a-radio-group>
+        </a-form-item>
+
+      </a-form>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import pick from 'lodash.pick'
+  import {httpAction, getAction} from '@/api/manage'
+  import JDate from '@/components/jeecg/JDate.vue';
+  import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
+
+  export default {
+    name: "SysUserAgentModal",
+    components: {
+      JDate,
+      JSelectUserByDep
+    },
+    data() {
+      return {
+        title: "操作",
+        visible: false,
+        model: {},
+        labelCol: {
+          xs: {span: 24},
+          sm: {span: 5},
+        },
+        wrapperCol: {
+          xs: {span: 24},
+          sm: {span: 16},
+        },
+        username: "",
+        confirmLoading: false,
+        form: this.$form.createForm(this),
+        validatorRules: {
+          agentUserName: {rules: [{required: true, message: '请输入代理人用户名!'}]},
+          startTime: {rules: [{required: true, message: '请输入代理开始时间!'}]},
+          endTime: {rules: [{required: true, message: '请输入代理结束时间!'}]},
+        },
+        url: {
+          add: "/system/sysUserAgent/add",
+          edit: "/system/sysUserAgent/edit",
+          queryByUserName: "/system/sysUserAgent/queryByUserName",
+        },
+      }
+    },
+    created() {
+    },
+    methods: {
+      agentSettings(username) {
+        this.username = username;
+        this.init();
+
+      },
+      init() {
+        var params = {userName: this.username};//查询条件
+        getAction(this.url.queryByUserName, params).then((res) => {
+          if (res.success) {
+            console.log("获取流程节点信息", res);
+            this.edit(res.result);
+          } else {
+            this.edit({userName: this.username, status: "0"});
+          }
+        })
+      },
+      edit(record) {
+        this.form.resetFields();
+        this.model = Object.assign({}, record);
+        this.visible = true;
+        this.$nextTick(() => {
+          this.form.setFieldsValue(pick(this.model, 'userName', 'agentUserName', 'status', 'startTime', 'endTime'))
+        });
+      },
+      close() {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk() {
+        const that = this;
+        // 触发表单验证
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if (!this.model.id) {
+              httpurl += this.url.add;
+              method = 'post';
+            } else {
+              httpurl += this.url.edit;
+              method = 'put';
+            }
+            let formData = Object.assign(this.model, values);
+            httpAction(httpurl, formData, method).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                //this.init();
+              } else {
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.close();
+            })
+
+
+          }
+        })
+      },
+      handleCancel() {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
 </style>

+ 2 - 1
src/views/system/modules/UserModal.vue

@@ -23,7 +23,8 @@
       <a-form :form="form">
 
         <a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-input placeholder="请输入用户账号" v-decorator="[ 'username', validatorRules.username]" :readOnly="!!model.id"/>
+             <!-- :readOnly="!!model.id" -->
+          <a-input placeholder="请输入用户账号" v-decorator="[ 'username', validatorRules.username]"/>
         </a-form-item>
 
         <template v-if="!model.id">