فهرست منبع

稽核任务和稽核详情功能完善

yangll 4 سال پیش
والد
کامیت
90b6f369ee

+ 20 - 7
src/views/smscheck/TaskMain.vue

@@ -1,14 +1,18 @@
 <template>
   <!-- 列表页 -->
-  <TaskList v-if="showType === 'list'"
-                    @goAdd="showAdd"
-                    @goImport="showImport"/>
+  <task-list v-if="showType === 'list'"
+             @goAdd="showAdd"
+             @goImport="showImport"
+             @goCheckList="showCheckList"/>
   <!-- 添加页 -->
-  <TaskAdd v-else-if="showType === 'add'"
+  <task-add v-else-if="showType === 'add'"
             @goList="showList"/>
   <!-- 导入页 -->
-  <TaskImport v-else-if="showType === 'import'"
-            @goList="showList"/>
+  <task-import v-else-if="showType === 'import'"
+            @goList="showList" :task="task"/>
+  <!-- 导入页 -->
+  <task-check-list v-else-if="showType === 'checkList'"
+              @goList="showList" :task="task"/>
 </template>
 
 <script>
@@ -16,6 +20,7 @@
   import TaskList from './modules/TaskList'
   import TaskAdd from './modules/TaskAdd'
   import TaskImport from './modules/TaskImport'
+  import TaskCheckList from './modules/TaskCheckList'
 
   export default {
     name: 'TaskMain',
@@ -23,11 +28,13 @@
       TaskList,
       TaskAdd,
       TaskImport,
+      TaskCheckList,
     },
     data () {
       return {
         description: '稽核任务管理主页面',
         showType: 'list',
+        task:{}
       }
     },
     methods: {
@@ -40,8 +47,14 @@
         this.showType = 'add'
       },
       // 显示导入页面
-      showImport(param) {
+      showImport(task) {
         this.showType = 'import'
+        this.task = task;
+      },
+      // 显示导入页面
+      showCheckList(task) {
+        this.showType = 'checkList'
+        this.task = task;
       },
     }
   }

+ 2 - 7
src/views/smscheck/modules/TaskAdd.vue

@@ -11,7 +11,7 @@
     cancelText="关闭">
 
     <a-spin :spinning="confirmLoading">
-      <j-form-container :disabled="formDisabled">
+      <j-form-container :disabled="disableSubmit">
         <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
           <a-row>
             <a-col :span="24">
@@ -104,13 +104,8 @@ export default {
       }
     }
   },
-  computed: {
-    formDisabled(){
-      return this.disabled
-    },
-  },
   created () {
-    //备份model原始值
+    // 备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
   },
   methods: {

+ 238 - 0
src/views/smscheck/modules/TaskCheckList.vue

@@ -0,0 +1,238 @@
+<template>
+
+  <div>
+    <a-page-header
+      style="background-color: #FFFFFF;"
+      title="稽核详情"
+      sub-title=""
+      @back="showList"
+    >
+      <a-descriptions :title="task.name" size="small" :column="3">
+        <a-descriptions-item label="状态"><a-tag color="blue">{{task.stateText}}</a-tag></a-descriptions-item>
+        <a-descriptions-item label="开始时间">{{task.startTime}}</a-descriptions-item>
+        <a-descriptions-item label="结束时间">{{task.endTime}}</a-descriptions-item>
+        <a-descriptions-item label="描述">{{task.description}}</a-descriptions-item>
+      </a-descriptions>
+<!--      <a-divider style="margin: 6px;"/>-->
+    </a-page-header>
+
+    <a-card :bordered="false" style="margin-top: -22px;">
+      <a-tabs default-active-key="1" @change="">
+        <a-tab-pane key="1" :tab="tab1"></a-tab-pane>
+        <a-tab-pane key="2" :tab="tab2"></a-tab-pane>
+        <a-tab-pane key="3" :tab="tab3"></a-tab-pane>
+      </a-tabs>
+      <!-- 查询区域 -->
+      <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.customerNo"></j-input>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="客户名称">
+                <j-input placeholder="请输入客户名称" v-model="queryParam.customerName"></j-input>
+              </a-form-item>
+            </a-col>
+            <template v-if="toggleSearchStatus">
+
+            </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 -->
+
+      <!-- table区域-begin -->
+      <div>
+        <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 @click="handleDetail(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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+        </a-table>
+
+      </div>
+      <!-- table区域 end -->
+    </a-card>
+
+
+
+  </div>
+
+</template>
+
+<script>
+
+import { httpAction } from '@api/manage'
+import '@/assets/less/TableExpand.less'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+export default {
+  name: 'TaskCheckList',
+  mixins:[JeecgListMixin],
+  props: {
+    task: {
+      type: Object,
+      require: true
+    }
+  },
+  data () {
+    return {
+      description: '稽核详情页面',
+      tab1: '全部(' + this.task.customerCount + ')',
+      tab2: '待稽核(' + this.task.customerCount + ')',
+      tab3: '已稽核(' + this.task.checkCount + ')',
+      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: 'staffName'
+        },
+        {
+          title:'员工工号',
+          align:"center",
+          dataIndex: 'staffNo'
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align:"center",
+          fixed:"right",
+          width:147,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: "/smsCheck/customerInfo/list",
+        delete: "/smsCheck/task/delete",
+        edit: "/smsCheck/task/edit",
+        deleteBatch: "/smsCheck/task/deleteBatch",
+        exportXlsUrl: "/smsCheck/task/exportXls",
+        importExcelUrl: "smsCheck/task/importExcel",
+
+      },
+    }
+  },
+  methods: {
+    // 显示列表页面
+    showList() {
+      this.$emit('goList', true);
+    },
+    handleCancel () {
+      this.visible = false;
+    },
+    detail (record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 60 - 0
src/views/smscheck/modules/TaskDetail.vue

@@ -0,0 +1,60 @@
+<template>
+
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    :okButtonProps="{ class:{'jee-hidden': true} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+
+    <a-spin :spinning="confirmLoading">
+
+      <a-descriptions :title="model.taskName">
+        <a-descriptions-item label="任务状态"><a-tag color="blue">{{model.taskState_dictText}}</a-tag></a-descriptions-item>
+        <a-descriptions-item label="开始时间">{{model.taskStartTime}}</a-descriptions-item>
+        <a-descriptions-item label="结束时间">{{model.taskEndTime}}</a-descriptions-item>
+        <a-descriptions-item label="描述">{{model.description}}</a-descriptions-item>
+      </a-descriptions>
+      <a-descriptions>
+        <a-descriptions-item label="客户总数">{{model.customerCount}}</a-descriptions-item>
+        <a-descriptions-item label="待稽核数">{{model.checkCount}}</a-descriptions-item>
+      </a-descriptions>
+    </a-spin>
+
+  </j-modal>
+
+</template>
+
+<script>
+
+export default {
+  name: 'TaskDetail',
+  data () {
+    return {
+      description: '详情页面',
+      title: '详情页面',
+      width: 960,
+      visible: false,
+      disableSubmit: false,
+      model:{
+      },
+      confirmLoading: false,
+    }
+  },
+  methods: {
+    handleCancel () {
+      this.visible = false;
+    },
+    detail (record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 40 - 24
src/views/smscheck/modules/TaskImport.vue

@@ -1,16 +1,23 @@
 <template>
 
   <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;">
+    <a-page-header
+      style="background-color: #FFFFFF;"
+      title="客户资料导入"
+      sub-title="1、先选择客户资料,进行导入前预览。2、信息无误后再确认导入"
+      @back="showList"
+    >
+      <a-descriptions :title="task.name" size="small" :column="3">
+        <a-descriptions-item label="状态"><a-tag color="blue">{{task.stateText}}</a-tag></a-descriptions-item>
+        <a-descriptions-item label="开始时间">{{task.startTime}}</a-descriptions-item>
+        <a-descriptions-item label="结束时间">{{task.endTime}}</a-descriptions-item>
+        <a-descriptions-item label="描述">{{task.description}}</a-descriptions-item>
+      </a-descriptions>
+      <a-divider style="margin: 6px;"/>
+    </a-page-header>
+
+    <a-card :bordered="false" style="margin-top: -22px;">
       <!-- 操作按钮区域 start -->
       <div class="table-operator">
         <a-upload name="file"
@@ -19,7 +26,7 @@
                   :headers="tokenHeader"
                   :action="url.importExcel"
                   @change="uploadChange">
-          <a-button type="primary" icon="upload">客户资料导入</a-button>
+          <a-button type="primary" icon="upload">客户资料选择</a-button>
         </a-upload>
         <a-button type="primary" icon="import"
                   @click="importInfo">确定导入</a-button>
@@ -31,9 +38,8 @@
         <a-table
           ref="table"
           size="middle"
-          :scroll="{x:true}"
           bordered
-
+          :scroll="{x:true}"
           :columns="columns"
           :dataSource="dataSource"
           :pagination="false"
@@ -59,6 +65,12 @@
   export default {
     name: 'TaskImport',
     mixins:[JeecgListMixin],
+    props: {
+      task: {
+        type: Object,
+        require: true
+      }
+    },
     data () {
       return {
         description: '导入页面',
@@ -107,11 +119,6 @@
             align:"center",
             dataIndex: 'userState'
           },
-          {
-            title:'用户发展员工',
-            align:"center",
-            dataIndex: 'staffInfo'
-          },
           {
             title:'员工姓名',
             align:"center",
@@ -123,20 +130,29 @@
             dataIndex: 'staffNo'
           },
           {
-            title:'用户发展二级部门',
+            title:'员工二级部门',
             align:"center",
-            dataIndex: 'staffDeptLevel2'
+            dataIndex: 'staffDeptLevel2Name'
           },
           {
-            title:'用户发展三级部门',
+            title:'员工二级部门编号',
             align:"center",
-            dataIndex: 'staffDeptLevel3'
+            dataIndex: 'staffDeptLevel2No'
+          },
+          {
+            title:'员工三级部门',
+            align:"center",
+            dataIndex: 'staffDeptLevel3Name'
+          },
+          {
+            title:'员工三级部门编号',
+            align:"center",
+            dataIndex: 'staffDeptLevel3No'
           },
-
         ],
         url: {
           importExcel: window._CONFIG['domainURL'] + "/smsCheck/task/importCustomerExcel",
-          importData: "/smsCheck/task/importCustomerData",
+          importData: "/smsCheck/task/taskId/importCustomerData",
         },
       }
     },
@@ -191,7 +207,7 @@
         }
 
         this.$message.info('开始导入,请稍等……');
-        let httpUrl = this.url.importData;
+        let httpUrl = this.url.importData.replaceAll("taskId", this.task.id);
         let params = this.dataSource;
         let method = 'POST';
         let that = this;

+ 108 - 12
src/views/smscheck/modules/TaskList.vue

@@ -61,7 +61,7 @@
       </a-dropdown>
     </div>
 
-    <!-- table区域-begin -->
+    <!-- table区域 begin -->
     <div>
       <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>项
@@ -105,12 +105,24 @@
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
+          <a-divider type="vertical" />
+          <a @click="handleDetail(record)">详情</a>
+          <a-divider type="vertical" />
+          <a @click="showCheckList(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 v-if="record.taskState == 0">
+                <a-popconfirm title="确定开始稽核吗?" @confirm="() => checkStart(record)">
+                  <a>开始稽核</a>
+                </a-popconfirm>
+              </a-menu-item>
+              <a-menu-item v-if="record.taskState == 1">
+                <a-popconfirm title="确定结束稽核吗?" @confirm="() => checkEnd(record)">
+                  <a>结束稽核</a>
+                </a-popconfirm>
               </a-menu-item>
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -123,8 +135,11 @@
 
       </a-table>
     </div>
+    <!-- table区域 end -->
+
     <!-- 任务添加 -->
     <task-add ref="modalForm" @ok="modalFormOk"></task-add>
+    <task-detail ref="modalDetail" @ok="modalFormOk"></task-detail>
   </a-card>
 
 
@@ -132,23 +147,23 @@
 
 <script>
 
+  import { httpAction } from '@api/manage'
   import '@/assets/less/TableExpand.less'
-  import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import SmsCheckTaskModal from './SmsCheckTaskModal'
   import TaskAdd from './TaskAdd'
+  import TaskDetail from './TaskDetail'
 
   export default {
     name: 'TaskList',
-    mixins:[JeecgListMixin, mixinDevice],
+    mixins:[JeecgListMixin],
     components: {
-      SmsCheckTaskModal,
-      TaskAdd
+      TaskAdd,
+      TaskDetail,
     },
     data () {
       return {
         description: '稽核任务管理页面',
-        // 表头
+        disableSubmit: false,
         columns: [
           {
             title: '#',
@@ -207,13 +222,15 @@
         url: {
           list: "/smsCheck/task/list",
           delete: "/smsCheck/task/delete",
+          edit: "/smsCheck/task/edit",
           deleteBatch: "/smsCheck/task/deleteBatch",
           exportXlsUrl: "/smsCheck/task/exportXls",
           importExcelUrl: "smsCheck/task/importExcel",
 
         },
-        dictOptions:{},
-        superFieldList:[],
+        dictOptions: {},
+        superFieldList: [],
+        currentTaskState: 0,
       }
     },
     created() {
@@ -231,7 +248,39 @@
       },
       // 显示导入页面
       showImport() {
-        this.$emit('goImport', true);
+        // 选择一条
+        if (this.selectedRowKeys.length !== 1) {
+          this.$message.warning('请选择一条记录!');
+          return;
+        }
+        let row = this.selectionRows[0]
+        let task = {
+          id: row.id,
+          name: row.taskName,
+          startTime: row.taskStartTime,
+          endTime: row.taskEndTime,
+          state: row.taskState,
+          stateText: row.taskState_dictText,
+          description: row.description,
+          customerCount: row.customerCount,
+          checkCount: row.checkCount,
+        }
+        this.$emit('goImport', task);
+      },
+      // 显示导入页面
+      showCheckList(record) {
+        let task = {
+          id: record.id,
+          name: record.taskName,
+          startTime: record.taskStartTime,
+          endTime: record.taskEndTime,
+          state: record.taskState,
+          stateText: record.taskState_dictText,
+          description: record.description,
+          customerCount: record.customerCount,
+          checkCount: record.checkCount,
+        }
+        this.$emit('goCheckList', task);
       },
       initDictConfig(){
       },
@@ -253,6 +302,53 @@
       //   this.$refs.modalForm.title = "编辑";
       //   this.$refs.modalForm.disableSubmit = false;
       // },
+      // handleDetail:function(record){
+      //   this.$refs.modalForm.edit(record);
+      //   this.$refs.modalForm.title="详情";
+      //   this.$refs.modalForm.disableSubmit = true;
+      // },
+      handleDetail(record){
+        this.$refs.modalDetail.detail(record);
+        this.$refs.modalDetail.title="详情";
+      },
+      checkStart(record){
+        record.taskState = 1;
+        let that = this;
+        let httpUrl = this.url.edit;
+        let param = record;
+        let method = 'put';
+
+        // 发送请求
+        httpAction(httpUrl, param, method)
+          .then((res) => {
+            if(res.success){
+              that.$message.success("稽核任务已开始!");
+            }else{
+              that.$message.warning(res.message);
+            }
+          }).finally(() => {
+            that.loadData();
+        })
+      },
+      checkEnd(record){
+        record.taskState = 2;
+        let that = this;
+        let httpUrl = this.url.edit;
+        let param = record;
+        let method = 'put';
+
+        // 发送请求
+        httpAction(httpUrl, param, method)
+          .then((res) => {
+            if(res.success){
+              that.$message.success("稽核任务已结束!");
+            }else{
+              that.$message.warning(res.message);
+            }
+          }).finally(() => {
+            that.loadData();
+        })
+      },
     }
   }
 </script>