Просмотр исходного кода

行短稽核任务功能完善

yangll 4 лет назад
Родитель
Сommit
0ebf2e97b1

+ 5 - 1
src/mixins/JeecgListMixin.js

@@ -49,12 +49,16 @@ export const JeecgListMixin = {
       superQueryParams: '',
       /** 高级查询拼接方式 */
       superQueryMatchType: 'and',
+      /* 自动查询 默认开启 */
+      autoSearch: true
     }
   },
   created() {
       if(!this.disableMixinCreated){
         console.log(' -- mixin created -- ')
-        this.loadData();
+        if (this.autoSearch) {
+          this.loadData();
+        }
         //初始化字典配置 在自己页面定义
         this.initDictConfig();
       }

+ 1 - 23
src/views/smscheck/SmsCheckTaskList.vue

@@ -1,6 +1,6 @@
 <template>
 
-  <a-card :bordered="false" style="margin-top: 24px">
+  <a-card :bordered="false">
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -212,7 +212,6 @@
           deleteBatch: "/smsCheck/task/deleteBatch",
           exportXlsUrl: "/smsCheck/task/exportXls",
           importExcelUrl: "smsCheck/task/importExcel",
-
         },
         dictOptions:{},
         superFieldList:[],
@@ -247,25 +246,4 @@
 <style lang="less" scoped>
   @import '~@assets/less/common.less';
 
-  .app-link-block {
-    padding: 12px;
-    text-align: center;
-    display: block;
-    color: inherit;
-
-    a {
-      color: var(--primary-color);
-      text-decoration: none;
-      background-color: transparent;
-      outline: none;
-      cursor: pointer;
-      transition: color 0.3s;
-      -webkit-text-decoration-skip: objects;
-    }
-  }
-  .app-link-block .app-link-icon {
-    color: #69c0ff;
-    font-size: 30px;
-    margin: 6px 0 10px 0;
-  }
 </style>

+ 1 - 1
src/views/smscheck/TaskMain.vue

@@ -40,7 +40,7 @@
         this.showType = 'add'
       },
       // 显示导入页面
-      showImport() {
+      showImport(param) {
         this.showType = 'import'
       },
     }

+ 146 - 13
src/views/smscheck/modules/TaskAdd.vue

@@ -1,30 +1,163 @@
 <template>
 
-  <div>
-    <div>
-      <h1>添加页</h1>
-    </div>
-    <div>
-      <a-button type="primary" @click="showList">返回</a-button>
-    </div>
-  </div>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+
+    <a-spin :spinning="confirmLoading">
+      <j-form-container :disabled="formDisabled">
+        <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+          <a-row>
+            <a-col :span="24">
+              <a-form-model-item label="任务名称" prop="taskName" v-bind="labelCol1">
+                <a-input v-model="model.taskName" placeholder="请输入任务名称"  ></a-input>
+              </a-form-model-item>
+            </a-col>
+
+            <a-col :span="12">
+              <a-form-model-item label="开始时间" prop="taskStartTime" v-bind="labelCol2">
+                <j-date placeholder="请选择任务开始时间"  v-model="model.taskStartTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="结束时间" prop="taskEndTime" v-bind="labelCol2">
+                <j-date placeholder="请选择任务结束时间"  v-model="model.taskEndTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item label="描述" prop="description" v-bind="labelCol1">
+                <a-textarea v-model="model.description" rows="4" placeholder="请输入描述" />
+              </a-form-model-item>
+            </a-col>
+
+          </a-row>
+        </a-form-model>
+      </j-form-container>
+    </a-spin>
+
+  </j-modal>
 
 </template>
 
 <script>
 
+import { httpAction } from '@api/manage'
+
 export default {
   name: 'TaskAdd',
-
   data () {
     return {
-      description: '添加页面'
+      description: '添加页面',
+      title: '',
+      width: 960,
+      visible: false,
+      disableSubmit: false,
+      model:{
+      },
+      // 1列
+      labelCol1 : {
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 2 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 21 },
+        }
+      },
+      // 2列
+      labelCol2 : {
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 4 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 18 },
+        }
+      },
+      confirmLoading: false,
+      validatorRules: {
+        taskName: [
+          { required: true, message: '请输入任务名称!'},
+        ],
+        taskStartTime: [
+          { required: true, message: '请输入任务开始时间!'},
+        ],
+        taskEndTime: [
+          { required: true, message: '请输入任务结束时间!'},
+        ],
+        fileUrl: [
+          { required: true, message: '请输入文件路径!'},
+        ],
+      },
+      url: {
+        add: "/smsCheck/task/add",
+        edit: "/smsCheck/task/edit",
+        queryById: "/smsCheck/task/queryById"
+      }
     }
   },
+  computed: {
+    formDisabled(){
+      return this.disabled
+    },
+  },
+  created () {
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
   methods: {
-    // 显示列表页面
-    showList() {
-      this.$emit('goList', true);
+    handleOk () {
+      this.submitForm();
+    },
+    handleCancel () {
+      this.visible = false;
+    },
+    add () {
+      this.edit(this.modelDefault);
+    },
+    edit (record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm () {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate(valid => {
+        // 验证通过
+        if (valid) {
+          that.confirmLoading = true;
+          let httpUrl = '';
+          let method = '';
+          if (!this.model.id) {
+            httpUrl += this.url.add;
+            method = 'post';
+          } else {
+            httpUrl += this.url.edit;
+            method = 'put';
+          }
+          // 发送请求
+          httpAction(httpUrl, this.model, method)
+            .then((res) => {
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+                that.visible = false;
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+        }
+      })
     },
   }
 }

+ 192 - 8
src/views/smscheck/modules/TaskImport.vue

@@ -1,24 +1,143 @@
 <template>
 
   <div>
-    <div>
-      <h1>导入页</h1>
-    </div>
-    <div>
-      <a-button type="primary" @click="showList">返回</a-button>
-    </div>
+    <a-card :bordered="false">
+      <h1>
+        <span style="font-size: 14px;">稽核档案 / 客户导入</span>
+      </h1>
+      <div>
+        <a-button type="primary" @click="showList">返回</a-button>
+      </div>
+    </a-card>
+
+    <a-card :bordered="true" style="margin-top: 12px;">
+      <!-- 操作按钮区域 start -->
+      <div class="table-operator">
+        <a-upload name="file"
+                  :showUploadList="false"
+                  :multiple="false"
+                  :headers="tokenHeader"
+                  :action="url.importExcel"
+                  @change="uploadChange">
+          <a-button type="primary" icon="upload">客户资料导入</a-button>
+        </a-upload>
+        <a-button type="primary" icon="import"
+                  @click="importInfo">确定导入</a-button>
+      </div>
+      <!-- 操作按钮区域 end -->
+
+      <!-- table区域 begin -->
+      <div>
+        <a-table
+          ref="table"
+          size="middle"
+          :scroll="{x:true}"
+          bordered
+
+          :columns="columns"
+          :dataSource="dataSource"
+          :pagination="false"
+          :loading="loading"
+          class="j-table-force-nowrap"
+          @change="handleTableChange">
+
+        </a-table>
+      </div>
+      <!-- table区域 end -->
+
+    </a-card>
+
   </div>
 
 </template>
 
 <script>
 
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { httpAction } from '@api/manage'
+
   export default {
     name: 'TaskImport',
-
+    mixins:[JeecgListMixin],
     data () {
       return {
-        description: '导入页面'
+        description: '导入页面',
+        autoSearch: false,
+        dataSource: [],
+        errorCount: 0,
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'客户编号',
+            align:"center",
+            dataIndex: 'customerNo'
+          },
+          {
+            title:'客户名称',
+            align:"center",
+            dataIndex: 'customerName'
+          },
+          {
+            title:'服务号码',
+            align:"center",
+            dataIndex: 'smsNumber'
+          },
+          {
+            title:'用户编号',
+            align:"center",
+            dataIndex: 'userNo'
+          },
+          {
+            title:'入网时间',
+            align:"center",
+            dataIndex: 'networkAccessTime'
+          },
+          {
+            title:'用户状态',
+            align:"center",
+            dataIndex: 'userState'
+          },
+          {
+            title:'用户发展员工',
+            align:"center",
+            dataIndex: 'staffInfo'
+          },
+          {
+            title:'员工姓名',
+            align:"center",
+            dataIndex: 'staffName'
+          },
+          {
+            title:'员工编号',
+            align:"center",
+            dataIndex: 'staffNo'
+          },
+          {
+            title:'用户发展二级部门',
+            align:"center",
+            dataIndex: 'staffDeptLevel2'
+          },
+          {
+            title:'用户发展三级部门',
+            align:"center",
+            dataIndex: 'staffDeptLevel3'
+          },
+
+        ],
+        url: {
+          importExcel: window._CONFIG['domainURL'] + "/smsCheck/task/importCustomerExcel",
+          importData: "/smsCheck/task/importCustomerData",
+        },
       }
     },
     methods: {
@@ -26,6 +145,71 @@
       showList() {
         this.$emit('goList', true);
       },
+      /**
+       * 上传事件回调
+       *
+       * @param result 回调值
+       */
+      uploadChange(result) {
+        let file = result.file;
+        let event = result.event;
+        if (event === undefined && file.status === 'uploading') {
+          this.$message.info('开始上传');
+        }
+        if (event && file.status === 'uploading') {
+          this.$message.info('上传中,请稍等……');
+        }
+        if (file.response) {
+          let success = file.response.success;
+          let message = file.response.message;
+          if (!success) {
+            this.$message.error(message);
+          }
+          if (file.status === 'done') {
+            this.dataSource = file.response.result.data;
+            this.errorCount = file.response.result.errorCount;
+            if (this.errorCount > 0) {
+              this.$message.error('导入含有错误项,请检查内容')
+            } else {
+              this.$message.info('上传完成');
+            }
+          }
+        }
+
+      },
+      /**
+       * 导入信息
+       */
+      importInfo() {
+        if (this.dataSource.length === 0) {
+          this.$message.error('暂无导入数据,请上传导入文件!');
+          return;
+        }
+        if (this.errorCount !== 0) {
+          this.$message.error('包含非法数据,无法导入!');
+          return;
+        }
+
+        this.$message.info('开始导入,请稍等……');
+        let httpUrl = this.url.importData;
+        let params = this.dataSource;
+        let method = 'POST';
+        let that = this;
+        // 发送请求
+        httpAction(httpUrl, params, method)
+          .then((res) => {
+            if(res.success){
+              that.$message.success(res.message);
+              that.$emit('ok');
+              that.visible = false;
+            }else{
+              that.$message.warning(res.message);
+            }
+          }).finally(() => {
+          that.confirmLoading = false;
+        })
+
+      }
     }
   }
 </script>

+ 230 - 8
src/views/smscheck/modules/TaskList.vue

@@ -1,27 +1,229 @@
 <template>
 
-  <div>
-    <div>
-      <h1>列表页</h1>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="任务名称">
+              <j-input placeholder="请输入任务名称" v-model="queryParam.taskName"></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="任务状态">
+              <j-dict-select-tag placeholder="请选择任务状态" v-model="queryParam.taskState" dictCode="sms_check_task_state"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="10" :lg="11" :md="12" :sm="24">
+              <a-form-item label="开始时间">
+                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.taskStartTime_begin"></j-date>
+                <span class="query-group-split-cust"></span>
+                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.taskStartTime_end"></j-date>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="10" :lg="11" :md="12" :sm="24">
+              <a-form-item label="结束时间">
+                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.taskEndTime_begin"></j-date>
+                <span class="query-group-split-cust"></span>
+                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.taskEndTime_end"></j-date>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button @click="showImport" type="primary" icon="import">客户资料导入</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('稽核任务')">导出</a-button>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
     </div>
+
+    <!-- table区域-begin -->
     <div>
-      <a-button type="primary" @click="showAdd">添加</a-button>
-      <a-button type="primary" @click="showImport">导入</a-button>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
     </div>
-  </div>
+    <!-- 任务添加 -->
+    <task-add ref="modalForm" @ok="modalFormOk"></task-add>
+  </a-card>
+
 
 </template>
 
 <script>
 
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import SmsCheckTaskModal from './SmsCheckTaskModal'
+  import TaskAdd from './TaskAdd'
+
   export default {
     name: 'TaskList',
-
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      SmsCheckTaskModal,
+      TaskAdd
+    },
     data () {
       return {
-        description: '列表页面'
+        description: '稽核任务管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'任务名称',
+            align:"center",
+            dataIndex: 'taskName'
+          },
+          {
+            title:'任务状态',
+            align:"center",
+            dataIndex: 'taskState_dictText'
+          },
+          {
+            title:'任务开始时间',
+            align:"center",
+            dataIndex: 'taskStartTime'
+          },
+          {
+            title:'任务结束时间',
+            align:"center",
+            dataIndex: 'taskEndTime'
+          },
+          {
+            title:'描述',
+            align:"center",
+            dataIndex: 'description'
+          },
+          {
+            title:'客户总数',
+            align:"center",
+            dataIndex: 'customerCount'
+          },
+          {
+            title:'待稽核数',
+            align:"center",
+            dataIndex: 'checkCount'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/smsCheck/task/list",
+          delete: "/smsCheck/task/delete",
+          deleteBatch: "/smsCheck/task/deleteBatch",
+          exportXlsUrl: "/smsCheck/task/exportXls",
+          importExcelUrl: "smsCheck/task/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
       }
     },
+    created() {
+      this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
     methods: {
       // 显示添加页面
       showAdd() {
@@ -31,6 +233,26 @@
       showImport() {
         this.$emit('goImport', true);
       },
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'taskName',text:'任务名称',dictCode:''})
+        fieldList.push({type:'string',value:'taskState',text:'任务状态',dictCode:'sms_check_task_state'})
+        fieldList.push({type:'datetime',value:'taskStartTime',text:'任务开始时间'})
+        fieldList.push({type:'datetime',value:'taskEndTime',text:'任务结束时间'})
+        this.superFieldList = fieldList
+      },
+      // handleAdd: function () {
+      //   this.$refs.modalForm.add();
+      //   this.$refs.modalForm.title = "新增";
+      //   this.$refs.modalForm.disableSubmit = false;
+      // },
+      // handleEdit: function (record) {
+      //   this.$refs.modalForm.edit(record);
+      //   this.$refs.modalForm.title = "编辑";
+      //   this.$refs.modalForm.disableSubmit = false;
+      // },
     }
   }
 </script>