wansfa 1 年之前
父節點
當前提交
d94416ac8a

+ 8 - 0
src/api/company/company.js

@@ -83,3 +83,11 @@ export function deduct(data) {
  
  
 
+// 查询企业列表
+export function crmDayCountlist(query) {
+  return request({
+    url: '/company/company/crmDayCountlist',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
src/api/crm/customer.js

@@ -93,6 +93,15 @@ export function assignCustomer(data) {
   })
 }
 
+
+export function assignCrmToCompany(data) {
+  return request({
+    url: '/crm/customer/assignCrmToCompany',
+    method: 'post',
+    data: data
+  })
+}
+
 export function listCustomer(query) {
   return request({
     url: '/crm/customer/list',

+ 53 - 0
src/api/oms/store.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询网店列表
+export function listStore(query) {
+  return request({
+    url: '/oms/store/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询网店详细
+export function getStore(storeId) {
+  return request({
+    url: '/oms/store/' + storeId,
+    method: 'get'
+  })
+}
+
+// 新增网店
+export function addStore(data) {
+  return request({
+    url: '/oms/store',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改网店
+export function updateStore(data) {
+  return request({
+    url: '/oms/store',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除网店
+export function delStore(storeId) {
+  return request({
+    url: '/oms/store/' + storeId,
+    method: 'delete'
+  })
+}
+
+// 导出网店
+export function exportStore(query) {
+  return request({
+    url: '/oms/store/export',
+    method: 'get',
+    params: query
+  })
+}

+ 209 - 0
src/views/company/components/companySelect.vue

@@ -0,0 +1,209 @@
+<template>
+  <div  >
+    <el-row :gutter="20">
+      <!--部门数据-->
+      <!-- <el-col :span="4" :xs="24">
+        <div class="head-container">
+          <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
+        </div>
+        <div class="head-container">
+          <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="true" :filter-node-method="filterNode" ref="tree"  @node-click="handleNodeClick" />
+        </div>
+      </el-col> -->
+
+      <!--用户数据-->
+      <el-col :span="24" :xs="24">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+          <el-form-item label="公司姓名" prop="companyName">
+            <el-input v-model="queryParams.companyName" placeholder="请输入公司姓名" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
+          </el-form-item>
+          <el-form-item label="公司电话" prop="phonenumber">
+            <el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
+          </el-form-item>
+          <!-- <el-form-item label="创建时间">
+            <el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+          </el-form-item> -->
+          <el-form-item>
+            <el-button  icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-button icon="el-icon-add" size="mini" @click="addCompany">添加公司</el-button>
+          </el-form-item>
+        </el-form>
+        <div  class="tags">
+          <el-tag closable @close="delCompany(index)" style="margin-bottom:5px;" v-for="(item,index) in companys"  >{{item.companyName}}</el-tag>
+        </div>
+        <el-table  ref="multipleTable"  v-loading="loading" :data="companyList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="50" align="center" />
+          <el-table-column label="ID" width="50px" align="center" prop="companyId" :show-overflow-tooltip="true" />
+          <el-table-column label="公司名称" width="220"  align="center" prop="companyName" :show-overflow-tooltip="true" />
+          <el-table-column label="公司联系人" align="center" prop="linkName" :show-overflow-tooltip="true" />
+          <el-table-column label="公司电话" align="center" prop="companyMobile" width="120" />
+          <el-table-column label="今日分配客户数" align="center" prop="nowDayCustomerCount"   />
+          <el-table-column label="创建时间"  sortable align="center" prop="createTime" width="160">
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+        
+        <div class="btns">
+          <el-button type="primary" @click="submit"  >确 定</el-button>
+        </div>
+        </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { crmDayCountlist } from "@/api/company/company";
+import { treeselect } from "@/api/company/companyDept";
+export default {
+  name: "Compnay",
+  
+  data() {
+    return {
+      selectCompany:[],
+      companys:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 公司表格数据
+      companyList: [],
+      // 部门树选项
+      deptOptions: undefined,
+      // 部门名称
+      deptName: undefined,
+      // 日期范围
+      dateRange: [],
+      // 状态数据字典
+      statusOptions: [],
+      // 性别状态字典
+      sexOptions: [],
+      // 岗位选项
+      postOptions: [],
+      // 角色选项
+      roleOptions: [],
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      hasClickClose:false,
+      // 用户导入参数
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyName: undefined,
+        phonenumber: undefined,
+        status: undefined,
+        deptId: undefined,
+      },
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    submit(){
+      this.addCompany();
+      this.$emit('selectCompany',this.companys);
+    },
+    itemChcek(){
+        let that=this;
+        setTimeout(() => {
+              var companyIds=[];
+              for (let index = 0; index < this.companys.length; index++) {
+                 const compnay = this.companys[index];
+                 companyIds.push(compnay.companyId);
+              }
+              that.companyList.forEach(row => {
+                  if(companyIds.indexOf(row.companyId)!=-1){
+                      that.$refs.multipleTable.toggleRowSelection(row, true);
+                  }
+              });
+
+        }, 0);
+    },
+    /** 查询用户列表 */
+    getList() {
+      this.loading = true;
+      let that=this;
+      crmDayCountlist(this.queryParams).then((response) => {
+            this.companyList = response.rows;
+            this.total = response.total;
+            this.loading = false;
+            that.itemChcek();
+        }
+      );
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id;
+      this.getList();
+    },
+     
+     
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.page = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.selectCompany=selection;
+      this.ids = selection.map((item) => item.companyId);
+    },
+    addCompany(){
+      var that=this;
+      this.selectCompany.forEach(element => {
+        var flag= that.companys.some(item => item.companyId === element.companyId)
+        if(!flag){
+           this.companys.push(element);
+        }
+      });
+    },
+    delCompany(index){
+      this.companys.splice(index,1)
+    }
+  },
+};
+</script>
+<style >
+ 
+.btns{
+  padding-top: 15px;
+  display: flex;
+  align-content: center;
+  justify-content: flex-end;
+}
+</style>

+ 221 - 0
src/views/crm/components/assignCompany.vue

@@ -0,0 +1,221 @@
+<template>
+    <div>
+       <el-form ref="assignForm" :model="assignForm" :rules="assignRules" label-width="120px">
+        <el-form-item label="未分配客户" >
+           <!-- <el-tag v-for="customer in assignForm.customers">{{customer.customerName}}</el-tag> -->
+           <!-- {{assignForm.customers.length}} -->
+           {{  noAssignCount }}个
+        </el-form-item>
+
+         <el-form-item label="已分配客户" >
+           {{ assignCount  }}个
+        </el-form-item>
+
+        <el-form-item label="分配公司" prop="companyId">
+                <el-row :gutter="10" class="mb8">
+                    <el-col :span="1.5">
+                        <el-button @click="handleCompanySelect">添加公司</el-button>
+                    </el-col>
+                </el-row>
+                <el-table border  :data="companys" >
+                    <el-table-column label="ID" align="center" prop="companyId" />
+                    <el-table-column width="200px" label="公司名称" align="center" prop="companyName" />
+                    <el-table-column label="公司联系人" align="center" prop="linkName" />
+                    <el-table-column label="公司电话" align="center" prop="companyMobile" />
+                    <!-- <el-table-column label="公司地址" align="center" prop="companyAddress" width="120" /> -->
+                    <el-table-column label="今日分配数" align="center" prop="nowDayCustomerCount"   />
+                    <el-table-column label="分配数量" align="center"  prop="count" width="200px" >
+                        <template slot-scope="scope">
+                        <div>
+                            <el-input-number ref="stepTxtNum" :min="0" v-model="scope.row.count"  @change="changeVal(scope.row)"   size="mini"></el-input-number>
+                        </div>
+                    </template>
+                    </el-table-column>
+                    <el-table-column label="操作"   align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
+                    <template slot-scope="scope">
+                        <el-button
+                        size="mini"
+                        type="text"
+                        @click="handleRemoveCompany(scope.row.$index)"
+                        >删除</el-button>
+                    </template>
+                    </el-table-column>
+                </el-table>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="footer">
+        <el-button type="primary" @click="submitAssignForm">确 定</el-button>
+        <el-button @click="assign.open=false">取 消</el-button>
+      </div>
+
+     <el-dialog :title="companySelect.title" :visible.sync="companySelect.open" width="1000px" append-to-body>
+        <company-select ref="companySelects" @selectCompany="selectCompany"  ></company-select>
+     </el-dialog>
+
+
+    </div>
+</template>>
+
+
+<script>
+
+    import { assignCrmToCompany } from "@/api/crm/customer";
+    import companySelect from '../../company/components/companySelect.vue';
+    export default {
+        components: {companySelect },
+        name: "visit",
+        data() {
+            return {
+                type:null,
+                noAssignCount:0,
+                assignCount:0,
+                customerIds:[],
+                companySelect:{
+                    title:"选择公司",
+                    open:false,
+                },
+                assignForm: {
+                },
+                // 表单校验
+                assignRules: {
+                    
+                },
+                companys:[],
+                 
+            };
+        },
+        created() {
+          
+        },
+        methods: {
+            init(customerIds){
+                this.customerIds =  customerIds;
+                this.assignCount=0;
+                this.noAssignCount=this.customerIds.length;
+                this.companys=[];
+            },
+            changeVal(row) {
+                this.$forceUpdate();//解决点击计数器失效问题
+                this.computeCount();
+                if(this.assignCount>this.customerIds.length){
+                    this.$nextTick(() => {
+                         row.count=0;
+                         this.computeCount();
+                    });
+                   
+                }
+            },
+            handleRemoveCompany(index){
+                this.companys.splice(index,1);
+                this.computeCount();
+                this.$refs.companySelects.delCompany(index);
+            },
+            selectCompany(data){
+                var companys=[];
+                var number=parseInt(this.customerIds.length/data.length);
+                data.forEach(element => {
+                    var company={
+                        companyId:element.companyId,
+                        companyName:element.companyName,
+                        linkName:element.linkName,
+                        nowDayCustomerCount:element.nowDayCustomerCount,
+                        companyMobile:element.companyMobile,
+                        count:number,
+                    }
+                    companys.push(company)
+                });
+                this.companys=companys;
+                this.companySelect.open=false;
+                this.computeCount()
+            },
+            computeCount(){
+                this.assignCount=0;
+                var that=this;
+                this.companys.forEach(element => {
+                    that.assignCount+=element.count;
+                });
+                this.noAssignCount=this.customerIds.length-this.assignCount
+            },
+            handleCompanySelect(){
+                var that=this;
+                this.companySelect.open=true;
+                setTimeout(() => {
+                    that.$refs.companySelects.getList();
+                }, 500);
+            },
+            init(customerIds,type){
+                this.type=type,
+                this.customerIds =  customerIds;
+                this.assignCount=0;
+                this.noAssignCount=this.customerIds.length;
+                this.companys=[];
+            },
+            /** 提交按钮 */
+            submitAssignForm() {
+                var that=this;
+                this.$refs["assignForm"].validate(valid => {
+                    if (valid) {
+                        var companys=[];
+                        var customerIds=[];
+                        var idIndex=0;
+                        var totalAssignCount=0;
+                        console.log("qxj companys",JSON.stringify(this.companys));
+                        this.companys.forEach(element => {
+                            if(element.count>0){
+                                var ids=that.customerIds.slice(idIndex,idIndex+element.count)
+                                console.log("qxj customerIds:"+that.customerIds+" count:"+element.count);
+                                console.log("qxj ids:"+ids);
+                                customerIds=customerIds.concat(ids);
+                                idIndex=idIndex+element.count;
+                                var data={companyId:element.companyId,count:element.count};
+                                companys.push(data);
+                                totalAssignCount+=element.count;
+                            }
+                        });
+                        if(companys.length==0){
+                            this.msgError("请选择公司");
+                            return;
+                        }
+                        if(totalAssignCount>(this.assignCount+this.noAssignCount)){
+                            this.msgError("分配数量有误");
+                            return;
+                        }
+                        this.myloading = this.$loading({
+                            lock: true,
+                            text: '处理中...',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(0, 0, 0, 0.7)'
+                        });
+                        var data={customerIds:customerIds,companys:companys }
+                        console.log("qxj data:",JSON.stringify(data));
+                        assignCrmToCompany(data).then(response => {
+                            this.myloading.close()
+                            if (response.code === 200) {
+                                this.msgSuccess("操作成功");
+                                this.$emit('close');
+                            }
+                        });
+                    }
+                });
+            },
+            closeAction(){
+                //this.$refs.companySelects.companys=[];
+            }
+        }
+    };
+</script>
+
+<style lang="scss" scoped>
+.contents{
+    height: 100%;
+    background-color: #fff;
+    padding: 20px;
+        
+}
+.footer{
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    margin-bottom: 10px;
+}
+</style>

+ 13 - 10
src/views/crm/customer/index.vue

@@ -166,6 +166,8 @@
             <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
       </el-table-column>
+
+      <el-table-column label="认领人" align="center" prop="companyUserNickName" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="最后一次跟进时间" align="center" prop="receiveTime" width="180">
       </el-table-column>
@@ -246,14 +248,14 @@
           </el-select>
         </el-form-item>
         <el-form-item label="客户类型" prop="customerType">
-        <el-select v-model="form.customerType" placeholder="请选择客户类型" clearable size="small">
-           <el-option
-                v-for="item in typeOptions"
-                :key="item.dictValue"
-                :label="item.dictLabel"
-                :value="item.dictValue"
-              />
-        </el-select>
+          <el-select v-model="form.customerType" placeholder="请选择客户类型" clearable size="small">
+            <el-option
+                  v-for="item in typeOptions"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                />
+          </el-select>
       </el-form-item>
         <el-form-item label="客户状态">
           <el-radio-group v-model="form.status">
@@ -678,8 +680,9 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有客户数据项?', "警告", {
+      //const queryParams = this.queryParams;
+      const queryParams=this.addDateRange(this.queryParams, this.dateRange)
+      this.$confirm('是否确认导出客户数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"

+ 48 - 39
src/views/crm/customer/line.vue

@@ -130,7 +130,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="ID" align="center" prop="customerId" />
       <el-table-column label="所属公司" align="center" prop="companyName" />
-      <el-table-column label="客户编号" align="center" prop="customerCode" />
+      <el-table-column width="120"  label="客户编号" align="center" prop="customerCode" />
       <el-table-column label="客户名称" align="center" prop="customerName" />
       <el-table-column label="手机" align="center" prop="mobile" />
       <el-table-column  label="性别" align="center" prop="sex">
@@ -140,7 +140,7 @@
       </el-table-column>
       <el-table-column label="微信号" align="center" prop="weixin" />
       <el-table-column label="所在地" align="center" prop="address" />
-      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column width="105" label="创建时间" align="center" prop="createTime" />
       <el-table-column  label="客户来源" align="center" prop="source">
         <template slot-scope="scope">
             <el-tag prop="status" v-for="(item, index) in sourceOptions"    v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
@@ -300,30 +300,17 @@
        <div class="import-msg" v-html="importMsg">
        </div>
     </el-dialog>
-    <el-dialog :title="assign.title" :visible.sync="assign.open" width="600px" append-to-body>
-      <el-form ref="assignForm" :model="assignForm" :rules="assignRules" label-width="120px">
-        <el-form-item label="待分配客户" >
-           <el-tag v-for="customer in assignForm.customers">{{customer.customerName}}</el-tag>
-        </el-form-item>
-        <el-form-item label="分配公司" prop="companyId">
-          <el-select filterable v-model="assignForm.companyId" placeholder="请选择公司" clearable size="small">
-                <el-option
-                  v-for="item in companys"
-                  :key="item.companyId"
-                  :label="item.companyName"
-                  :value="item.companyId"
-                />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitAssignForm">确 定</el-button>
-        <el-button @click="assign.open=false">取 消</el-button>
-      </div>
+
+    <el-dialog :title="assign.title" :visible.sync="assign.open" @close="closeAssignPop" width="900px" append-to-body>
+       <assign-company  ref="assignCompany" @close="closeAssign"   />
     </el-dialog>
+
     <el-dialog :title="assignList.title" :visible.sync="assignList.open" width="1000px" append-to-body>
       <customer-assign-list  ref="assignList" @close="closeAssignList"></customer-assign-list>
     </el-dialog>
+
+
+
   </div>
 </template>
 
@@ -331,11 +318,13 @@
 import { assignCustomer,importLineTemplate,listLineCustomer, getLineCustomer, delLineCustomer, addLineCustomer, updateLineCustomer, exportLineCustomer } from "@/api/crm/customer";
 import {getCitys} from "@/api/store/city";
 import { getToken } from "@/utils/auth";
-import { getCompanyList } from "@/api/company/company";
+
 import customerAssignList from '../components/customerAssignList.vue';
+import assignCompany from '../components/assignCompany.vue';
+
 export default {
   name: "Customer",
-  components: { customerAssignList },
+  components: { customerAssignList,assignCompany },
   data() {
     return {
       assignList:{
@@ -348,10 +337,16 @@ export default {
       activeName:"0",
       tagsOptions:[],
       companys:[],
+      noAssignCount:0,
+      assignCount:0,
       assign:{
         title:"分配客户",
         open:false,
       },
+      companySelect:{
+        title:"选择公司",
+        open:false,
+      },
       assignForm: {
         companyId:null,
       },
@@ -457,9 +452,7 @@ export default {
     this.getDicts("crm_customer_tag").then((response) => {
       this.tagsOptions = response.data;
     });
-    getCompanyList().then(response => {
-      this.companys = response.data;
-    });
+
     this.getCitys();
     this.getList();
   },
@@ -471,6 +464,13 @@ export default {
         that.$refs.assignList.getData();
       }, 200);
     },
+    closeAssign(){
+      this.assign.open=false;
+      this.getList();
+    },
+    closeAssignPop(){
+       this.$refs.assignCompany.closeAction();
+    },
     closeAssignList(){
       this.assignList.open=false;
       this.getList();
@@ -588,17 +588,24 @@ export default {
       var that=this
       this.assign.open = true;
       this.assign.title = "分配线索客户";
-      //获取所有CUSTOMER列表
-      var cutsomers=[];
-      this.customerList.forEach(function(value,index,array){
-        that.ids.forEach(function(id,index,array){
-          if(id==value.customerId){
-            var data={customerId:value.customerId,customerName:value.customerName}
-            cutsomers.push(data)
-          }
-        })
-      });
-      this.assignForm.customers=cutsomers;
+
+       setTimeout(() => {
+          that.$refs.assignCompany.init(this.ids);
+      }, 200);
+
+
+      // //获取所有CUSTOMER列表
+      // var cutsomers=[];
+      // this.customerList.forEach(function(value,index,array){
+      //   that.ids.forEach(function(id,index,array){
+      //     if(id==value.customerId){
+      //       var data={customerId:value.customerId,customerName:value.customerName}
+      //       cutsomers.push(data)
+      //     }
+      //   })
+      // });
+      // this.assignForm.customers=cutsomers;
+      // this.assignCount=this.assignForm.customers.length;
     },
     submitAssignForm() {
       if(this.assignForm.customers.length==0){
@@ -730,7 +737,9 @@ export default {
      // 提交上传文件
      submitFileForm() {
       this.$refs.upload.submit();
-    },
+    }
+
+
   }
 };
 </script>

+ 469 - 0
src/views/oms/store/list.vue

@@ -0,0 +1,469 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+     
+     <el-form-item label="客户状态" prop="storeType">
+        <el-select v-model="queryParams.storeType" placeholder="请选择网店类型" clearable size="small">
+           <el-option
+                v-for="item in storeTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="店铺名称" prop="storeName">
+        <el-input
+          v-model="queryParams.storeName"
+          placeholder="请输入店铺名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="店铺编码" prop="storeCode">
+        <el-input
+          v-model="queryParams.storeCode"
+          placeholder="请输入店铺编码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"/>
+      </el-form-item>
+
+     <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+           <el-option
+                v-for="item in statusOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"/>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="到期时间" prop="limitTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.limitTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择到期时间">
+        </el-date-picker>
+      </el-form-item>
+
+     <el-form-item label="渠道类型" prop="channelType">
+        <el-select v-model="queryParams.channelType" placeholder="请选择状态" clearable size="small">
+           <el-option
+                v-for="item in channelTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"/>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="所属省市区" prop="cityIds">
+        <el-input
+          v-model="queryParams.cityIds"
+          placeholder="请输入所属省市区"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="详情地址" prop="address">
+        <el-input
+          v-model="queryParams.address"
+          placeholder="请输入详情地址"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="联系人" prop="linkUsername">
+        <el-input
+          v-model="queryParams.linkUsername"
+          placeholder="请输入联系人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="联系电话" prop="linkPhone">
+        <el-input
+          v-model="queryParams.linkPhone"
+          placeholder="请输入联系电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:store:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:store:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:store:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:store:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="storeId" />
+      <el-table-column  label="网店类型" align="center" prop="storeType">
+        <template slot-scope="scope">
+            <el-tag prop="storeType" v-for="(item, index) in storeTypeOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="店铺名称" align="center" prop="storeName" />
+      <el-table-column label="店铺编码" align="center" prop="storeCode" />
+
+      <el-table-column  label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+            <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="到期时间" align="center" prop="limitTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.limitTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+
+      <el-table-column  label="渠道类型" align="center" prop="channelType">
+        <template slot-scope="scope">
+            <el-tag prop="channelType" v-for="(item, index) in channelTypeOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="所属省市区" align="center" prop="cityIds" />
+      <el-table-column label="详情地址" align="center" prop="address" />
+      <el-table-column label="联系人" align="center" prop="linkUsername" />
+      <el-table-column label="联系电话" align="center" prop="linkPhone" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:store:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:store:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改网店对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+       <el-form-item label="客户类型" prop="storeType">
+          <el-select v-model="form.storeType" placeholder="请选择网店类型" clearable size="small">
+            <el-option
+                  v-for="item in storeTypeOptions"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                />
+          </el-select>
+      </el-form-item>
+
+        <el-form-item label="店铺名称" prop="storeName">
+          <el-input v-model="form.storeName" placeholder="请输入店铺名称" />
+        </el-form-item>
+        <el-form-item label="店铺编码" prop="storeCode">
+          <el-input v-model="form.storeCode" placeholder="请输入店铺编码" />
+        </el-form-item>
+        
+       <el-form-item label="状态" prop="status">
+          <el-select v-model="form.status" placeholder="请选择状态" clearable size="small">
+            <el-option
+                  v-for="item in statusOptions"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="到期时间" prop="limitTime">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.limitTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择到期时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+        <el-form-item label="渠道类型" prop="channelType">
+          <el-select v-model="form.channelType" placeholder="请选择状态" clearable size="small">
+            <el-option
+                  v-for="item in channelTypeOptions"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="所属省市区" prop="cityIds">
+          <el-input v-model="form.cityIds" placeholder="请输入所属省市区" />
+        </el-form-item>
+        <el-form-item label="详情地址" prop="address">
+          <el-input v-model="form.address" placeholder="请输入详情地址" />
+        </el-form-item>
+        <el-form-item label="联系人" prop="linkUsername">
+          <el-input v-model="form.linkUsername" placeholder="请输入联系人" />
+        </el-form-item>
+        <el-form-item label="联系电话" prop="linkPhone">
+          <el-input v-model="form.linkPhone" placeholder="请输入联系电话" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listStore, getStore, delStore, addStore, updateStore, exportStore } from "@/api/oms/store";
+
+export default {
+  name: "Store",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 网店表格数据
+      storeList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      storeTypeOptions:[],
+      channelTypeOptions:[],
+      statusOptions:[],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        storeType: null,
+        storeName: null,
+        storeCode: null,
+        status: null,
+        limitTime: null,
+        channelType: null,
+        cityIds: null,
+        address: null,
+        linkUsername: null,
+        linkPhone: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+
+    this.getDicts("oms_store_type").then((response) => {
+        this.storeTypeOptions = response.data;
+    });
+    this.getDicts("oms_channel_type").then((response) => {
+        this.channelTypeOptions = response.data;
+    });
+    this.getDicts("oms_store_status").then((response) => {
+        this.statusOptions = response.data;
+    });
+
+    this.getList();
+  },
+  methods: {
+    /** 查询网店列表 */
+    getList() {
+      this.loading = true;
+      listStore(this.queryParams).then(response => {
+        this.storeList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        storeId: null,
+        storeType: null,
+        storeName: null,
+        storeCode: null,
+        status: 0,
+        createTime: null,
+        updateTime: null,
+        limitTime: null,
+        remark: null,
+        channelType: null,
+        cityIds: null,
+        address: null,
+        linkUsername: null,
+        linkPhone: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.storeId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加网店";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const storeId = row.storeId || this.ids
+      getStore(storeId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改网店";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.storeId != null) {
+            updateStore(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addStore(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const storeIds = row.storeId || this.ids;
+      this.$confirm('是否确认删除网店编号为"' + storeIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delStore(storeIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有网店数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportStore(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 3 - 3
src/views/store/storePayment/index.vue

@@ -65,7 +65,7 @@
       <el-form-item label="员工姓名" prop="companyUserNickName">
         <el-input
           v-model="queryParams.companyUserNickName"
-          placeholder="请输入会员手机号"
+          placeholder="请输入员工姓名"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
@@ -83,7 +83,7 @@
 
       <el-form-item label="支付时间" prop="payTime">
         <el-date-picker
-          style="width:205.4px"
+          style="width:215.4px"
           clearable size="small"
           v-model="dateRange"
           type="daterange"
@@ -95,7 +95,7 @@
      
        <el-form-item label="退款时间" prop="refundTime">
         <el-date-picker 
-          style="width: 205.4px"
+          style="width: 215.4px"
           clearable size="small" 
           v-model="refundDateRange"
           type="daterange"