wansfa 2 years ago
parent
commit
5a43c179ff

+ 1 - 2
public/wx.html

@@ -1,4 +1,3 @@
-
 <!DOCTYPE html>
 <html lang="en">
 <head>
@@ -109,7 +108,7 @@
             //dataType: "jsonp",
             //jsonp: "callback",//传递给请求处理程序或页面的,标识jsonp回调函数名(一般为:callback)
             //jsonpCallback: "GetData",//callback的function名称
-            url: "http://127.0.0.1:7015/app/user/getAppletScheme",
+            url: "http://139.186.77.83:7015/app/user/getAppletScheme",
             data: {
               "cardId":cid,
               // "domain": "eturl.cn",

+ 1 - 1
src/api/company/companyMoneyLogs.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询企业账户记录列表
 export function listCompanyMoneyLogs(query) {
   return request({
-    url: '/company/companyMoneyLogs/list',
+    url: '/company/companyMoneyLogs/list',  
     method: 'get',
     params: query
   })

+ 1 - 1
src/utils/auth.js

@@ -1,6 +1,6 @@
 import Cookies from 'js-cookie'
 
-const TokenKey = 'Admin-Token'
+const TokenKey = 'Web-Token'
 
 export function getToken() {
   return Cookies.get(TokenKey)

+ 27 - 10
src/views/company/components/userSelect.vue

@@ -36,7 +36,7 @@
         <div  class="tags">
           <el-tag closable @close="delUser(index)" style="margin-bottom:5px;" v-for="(item,index) in users"  >{{item.nickName}}</el-tag>
         </div>
-        <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
+        <el-table  ref="multipleTable"  v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="50" align="center" />
           <el-table-column label="ID" align="center" prop="userId" :show-overflow-tooltip="true" />
           <el-table-column label="员工编号" align="center" prop="userName" :show-overflow-tooltip="true" />
@@ -89,7 +89,7 @@ export default {
       // 总条数
       total: 0,
       // 用户表格数据
-      userList: null,
+      userList: [],
       // 部门树选项
       deptOptions: undefined,
       // 部门名称
@@ -108,6 +108,7 @@ export default {
         children: "children",
         label: "label",
       },
+      hasClickClose:false,
       // 用户导入参数
       // 查询参数
       queryParams: {
@@ -127,23 +128,39 @@ export default {
     },
   },
   created() {
-    this.getList()
+    this.getList();
     this.getTreeselect();
-    
   },
-
   methods: {
     submit(){
+      this.addUser();
       this.$emit('selectUser',this.users);
     },
+    itemChcek(){
+        let that=this;
+        setTimeout(() => {
+              var userIds=[];
+              for (let index = 0; index < this.users.length; index++) {
+                 const user = this.users[index];
+                 userIds.push(user.userId);
+              }
+              that.userList.forEach(row => {
+                  if(userIds.indexOf(row.userId)!=-1){
+                      that.$refs.multipleTable.toggleRowSelection(row, true);
+                  }
+              });
+
+        }, 0);
+    },
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      getSelectUserList(this.addDateRange(this.queryParams, this.dateRange)).then(
-        (response) => {
-          this.userList = response.rows;
-          this.total = response.total;
-          this.loading = false;
+      let that=this;
+      getSelectUserList(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
+            this.userList = response.rows;
+            this.total = response.total;
+            this.loading = false;
+            that.itemChcek();
         }
       );
     },

+ 50 - 40
src/views/crm/components/assignUser.vue

@@ -9,35 +9,35 @@
             </el-form-item>
 
             <el-form-item label="分配员工" prop="users">
-            <el-row :gutter="10" class="mb8">
-                <el-col :span="1.5">
-                    <el-button @click="handleUserSelect">添加员工</el-button>
-                </el-col>
-            </el-row>
-            <el-table border  :data="users" >
-                <el-table-column label="ID" align="center" prop="userId" />
-                <el-table-column label="员工帐号" align="center" prop="userName" />
-                <el-table-column label="员工姓名" align="center" prop="nickName" />
-                <el-table-column label="所属部门" align="center" prop="deptName" />
-                <el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
-                <el-table-column label="今日分配数" align="center" prop="nowDayCustomerCount"   />
-                <el-table-column label="分配数量" align="center"  prop="count" width="200px" >
+                <el-row :gutter="10" class="mb8">
+                    <el-col :span="1.5">
+                        <el-button @click="handleUserSelect">添加员工</el-button>
+                    </el-col>
+                </el-row>
+                <el-table border  :data="users" >
+                    <el-table-column label="ID" align="center" prop="userId" />
+                    <el-table-column label="员工帐号" align="center" prop="userName" />
+                    <el-table-column label="员工姓名" align="center" prop="nickName" />
+                    <el-table-column label="所属部门" align="center" prop="deptName" />
+                    <el-table-column label="手机号码" align="center" prop="phonenumber" 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">
-                    <div>
-                        <el-input-number :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="handleRemoveUser(scope.row.$index)"
-                    >删除</el-button>
-                </template>
-                </el-table-column>
-            </el-table>
+                        <el-button
+                        size="mini"
+                        type="text"
+                        @click="handleRemoveUser(scope.row.$index)"
+                        >删除</el-button>
+                    </template>
+                    </el-table-column>
+                </el-table>
             </el-form-item>
         </el-form>
         <div   class="footer">
@@ -77,21 +77,23 @@
         },
         created() {
           
-            
         },
         methods: {
             changeVal(row) {
-
                 this.$forceUpdate();//解决点击计数器失效问题
-                this.computeCount()
+                this.computeCount();
                 if(this.assignCount>this.customerIds.length){
-                    row.count=0;
-                    this.computeCount()
+                    this.$nextTick(() => {
+                         row.count=0;
+                         this.computeCount();
+                    });
+                   
                 }
             },
             handleRemoveUser(index){
                 this.users.splice(index,1);
-                this.computeCount()
+                this.computeCount();
+                this.$refs.userSelects.delUser(index);
             },
             selectUser(data){
                 var users=[];
@@ -109,7 +111,6 @@
                     users.push(user)
                 });
                 this.users=users;
-                console.log("qxj selectUser",JSON.stringify(users));
                 this.userSelect.open=false;
                 this.computeCount()
             },
@@ -125,13 +126,13 @@
                 var that=this;
                 this.userSelect.open=true;
                 setTimeout(() => {
-                    console.log()
                     that.$refs.userSelects.getList();
                 }, 500);
             },
             init(customerIds,type){
                 this.type=type,
                 this.customerIds =  customerIds;
+                this.assignCount=0;
                 this.noAssignCount=this.customerIds.length;
                 this.users=[];
             },
@@ -143,21 +144,28 @@
                         var users=[];
                         var customerIds=[];
                         var idIndex=0;
+                        var totalAssignCount=0;
+                        console.log("qxj users",JSON.stringify(this.users));
                         this.users.forEach(element => {
                             if(element.count>0){
                                 var ids=that.customerIds.slice(idIndex,idIndex+element.count)
-                                console.log(that.customerIds)
-                                console.log(ids)
+                                console.log("qxj customerIds:"+that.customerIds+" count:"+element.count);
+                                console.log("qxj ids:"+ids);
                                 customerIds=customerIds.concat(ids);
                                 idIndex=idIndex+element.count;
                                 var data={companyUserId:element.userId,count:element.count};
-                                users.push(data)
+                                users.push(data);
+                                totalAssignCount+=element.count;
                             }
                         });
                         if(users.length==0){
                             this.msgError("请选择员工");
                             return;
                         }
+                        if(totalAssignCount>(this.assignCount+this.noAssignCount)){
+                            this.msgError("分配数量有误");
+                            return;
+                        }
                         this.myloading = this.$loading({
                             lock: true,
                             text: '处理中...',
@@ -176,7 +184,9 @@
                     }
                 });
             },
-             
+            closeAction(){
+                this.$refs.userSelects.users=[];
+            }
         }
     };
 </script>

+ 4 - 4
src/views/crm/customer/line.vue

@@ -211,7 +211,7 @@
         @pagination="getList"/>
 
     
-    <el-dialog :title="assign.title" :visible.sync="assign.open" width="800px" append-to-body>
+    <el-dialog :title="assign.title" :visible.sync="assign.open" width="800px" @close="closeAssignPop" append-to-body>
       <assign-user  ref="assignUser" @close="closeAssign"   />
     </el-dialog>
     <el-drawer
@@ -492,6 +492,9 @@ export default {
       this.assign.open=false;
       this.getList();
     },
+    closeAssignPop(){
+         this.$refs.assignUser.closeAction();
+    },
     /** 查询客户列表 */
     getList() {
       this.loading = true;
@@ -566,9 +569,6 @@ export default {
       this.multiple = !selection.length
       console.log(this.ids)
     },
-    
-  
-    
     /** 删除按钮操作 */
     handleDelete(row) {
       const customerIds = row.customerId || this.ids;

+ 1 - 4
src/views/crm/customer/my.vue

@@ -234,10 +234,7 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-    <el-drawer
-      size="75%"
-      :title="show.title" :visible.sync="show.open"
-      >
+    <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
         <customer-details  ref="customerDetails" />
     </el-drawer>
     <el-dialog :title="addSms.title" :visible.sync="addSms.open" width="1000px" append-to-body>

+ 37 - 1
src/views/store/storePayment/index.vue

@@ -23,6 +23,18 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
+
+
+      <el-form-item label="员工姓名" prop="companyUserNickName">
+          <el-input
+            v-model="queryParams.companyUserNickName"
+            placeholder="请输入员工姓名"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+          />
+      </el-form-item>
+
           <el-form-item label="提交时间" prop="createTime">
             <el-date-picker clearable size="small" style="width: 205.4px"
               v-model="queryParams.createTime"
@@ -31,9 +43,10 @@
               placeholder="选择提交时间">
             </el-date-picker>
           </el-form-item>
+
           <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"
@@ -42,6 +55,20 @@
               end-placeholder="结束日期">
             </el-date-picker>
           </el-form-item>
+
+          <el-form-item label="退款时间" prop="refundTime">
+              <el-date-picker 
+                style="width: 215.4px"
+                clearable size="small" 
+                v-model="refundDateRange"
+                type="daterange"
+                value-format="yyyy-MM-dd"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期">
+              </el-date-picker>
+            </el-form-item>
+
+
           <el-form-item label="状态" prop="status">
             <el-select   v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
             <el-option
@@ -175,6 +202,7 @@ export default {
       // 显示搜索条件
       showSearch: true,
       dateRange:[],
+      refundDateRange:[],
       // 总条数
       total: 0,
       // 支付明细表格数据
@@ -238,6 +266,14 @@ export default {
     /** 查询支付明细列表 */
     getList() {
       this.loading = true;
+      if(this.refundDateRange!=null&&this.refundDateRange.length==2){
+        this.queryParams.refundBeginTime=this.refundDateRange[0];
+        this.queryParams.refundEndTime=this.refundDateRange[1];
+      }
+      else{
+        this.queryParams.refundBeginTime=null;
+        this.queryParams.refundEndTime=null;
+      }
       listStorePayment(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
         this.storePaymentList = response.rows;
         this.total = response.total;