diff --git a/ruoyi-ui/src/views/pay/dayWorkHours/index.vue b/ruoyi-ui/src/views/pay/dayWorkHours/index.vue index 05ffe89..3d4ed92 100644 --- a/ruoyi-ui/src/views/pay/dayWorkHours/index.vue +++ b/ruoyi-ui/src/views/pay/dayWorkHours/index.vue @@ -151,7 +151,7 @@ - + @@ -171,7 +171,7 @@ label="员工姓名" :prop="'empInfos.' + index + '.empName'" :rules="{required: true, message: '员工姓名不能为空', trigger: 'blur'}"> - + @@ -181,7 +181,7 @@ label="部门名称" :prop="'empInfos.' + index + '.deptId'" :rules="{required: true, message: '员工姓名不能为空', trigger: 'blur'}"> - + @@ -218,21 +218,9 @@ - - - - - + + + @@ -249,7 +237,7 @@ - + @@ -271,199 +259,55 @@ 取 消 - + +
+ + + + + + 搜索 + + + + + + + + + + + + + + + + + + +
- --> + @@ -477,6 +321,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { name: "DayWorkHours", + dicts: ['pay_workshop', 'sys_user_sex', 'pay_del_status'], components: { Treeselect }, data() { return { @@ -554,7 +399,27 @@ export default { note: [ { required: true, message: "备注不能为空", trigger: "blur" } ] - } + }, + /** 选择员工*/ + emp: { + // 1 员工选择 2业务员选择 + type: null, + // 是否显示弹出层 + open: false, + // 列表遮罩层 + loading: true, + // 列表查询参数 + queryParams: { + pageNum: 1, + pageSize: 10, + name: undefined + }, + // 表格数据 + list: [], + // 总条数 + total: 0, + index: 0 + }, }; }, created() { @@ -604,7 +469,7 @@ export default { /** 查询日工工时列表 */ getList() { this.loading = true; - this.queryParams.tenantId = this.gsInfo.active_id; + // this.queryParams.tenantId = this.gsInfo.active_id; listDayWorkHours(this.queryParams).then(response => { this.dayWorkHoursList = response.rows; this.total = response.total; @@ -685,7 +550,7 @@ export default { }); }, /** 查询时选择部门 */ - changeDeptChange(dept) { + changeDept(dept) { this.form.deptName = dept.label }, getSummaries(param) { @@ -712,13 +577,6 @@ export default { }); return sums; }, - /** 查询员工 */ - getNamelist() { - getEmpNameList().then(response => { - this.queryParams.employeeList = response.data; - this.form.employeeList = response.data; - }) - }, /** 查询时选择员工 */ getEmploy(val) { this.queryParams.employeeList.forEach(employ => { @@ -743,12 +601,6 @@ export default { } }) }, - /** 查询部门 */ - getTreeselect() { - treeselect().then(response => { - this.deptOptions = response.data; - }) - }, /** 查询时选择部门 */ currDeptChange(dept) { this.form.deptName = dept.label @@ -818,8 +670,6 @@ export default { }] }; this.resetForm("form"); - this.getNamelist(); - this.getTreeselect(); }, // 新增员工 addElet() { @@ -928,29 +778,44 @@ export default { } }); }, - replaceall( restr ,oldstr, newstr ){ - while (restr.indexOf(oldstr) >= 0){ - restr = restr.replace(oldstr,newstr); - } - return restr; - }, - querySaleSearch(queryString, cb) { - let saleList = this.saleList; - let results = queryString ? saleList.filter(this.createSaleFilter(queryString)) : saleList; - // 调用 callback 返回建议列表的数据 - cb(results); + // 添加包活派工单 选择员工 + changeEmp(val,index,type){ + this.emp.open = true; + this.emp.index = index; + this.emp.type = type; + this.emp.queryParams.pageNum = 1; + this.empQuery(); + }, + /** 员工列表查询 */ + empQuery() { + this.emp.loading = true; + this.emp.queryParams.tenantId = this.gsInfo.active_id + listEmployeeInfo(this.emp.queryParams).then(response => { + this.emp.list = response.rows; + this.emp.total = response.total; + this.emp.loading = false; + }); }, - createSaleFilter(queryString) { - return (sale) => { - return (sale.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0); + /** 员工选择弹出框关闭*/ + empCancel() { + this.emp.open = false + }, + // 员工选择 选中数据 + empRowChange(val) { + console.log(this.emp.type,val); + if( this.emp.type===1 ){ + this.form.empInfos[this.emp.index].empName = val.name; + this.form.empInfos[this.emp.index].employeeId = val.id; + this.form.empInfos[this.emp.index].deptId = val.deptId; + this.form.empInfos[this.emp.index].deptName = val.deptName; } + if( this.emp.type===2 ){ + this.form.dwHoursContrasts[this.emp.index].salesman = val.name; + this.form.dwHoursContrasts[this.emp.index].deptId = val.deptId; + this.form.dwHoursContrasts[this.emp.index].deptName = val.deptName + } + this.emp.open = false; }, - handleSaleQuerySelect(item, index) { - this.form.dwHoursContrasts[index].salesman = item.name - }, - handleSaleQueryIconClick(index) { - this.form.dwHoursContrasts[index].salesman = null - } } };