Commit 43742cc4 authored by chenzj's avatar chenzj

包装标签打印页面修改

parent d3f38e87
<template>
<el-dialog title="人员选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="80%"
center
>
<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="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" 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-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="0"
inactive-value="1"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" 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"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">确 定</el-button>
<el-button @click="showFlag=false">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "UserSingleSelect",
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { Treeselect },
data() {
return {
showFlag:false,
// 遮罩层
loading: true,
// 选中数组
selectedId: null,
selectedRow:{
nickName: null
},
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
nickName: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 日期范围
dateRange: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined
},
// 列信息
columns: [
{ key: 0, label: `用户编号`, visible: true },
{ key: 1, label: `用户名称`, visible: true },
{ key: 2, label: `用户昵称`, visible: true },
{ key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true },
{ key: 6, label: `创建时间`, visible: true }
],
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
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.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row){
if(row){
this.selectedRow = row;
}
},
//行双击选中
handleRowDbClick(row){
if(row){
this.selectedRow = row;
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
}
},
// 单选选中数据
handleRowChange(row) {
if(row){
this.selectedRow = row;
}
},
// 多选框选中数据
handleSelectionChange(selection) {
this.selectedRows = selection;
this.single = selection.length != 1;
this.multiple = !selection.length;
},
AddNickName(){
for(let i=0 ; i<=this.selectedRows.length-1;i++){
console.log("this.selectedRows",this.selectedRows[i].nickName)
if(i==this.selectedRows.length-1){
this.nickName = this.nickName+this.selectedRows[i].nickName;
}else{
this.nickName = this.nickName+this.selectedRows[i].nickName+",";
}
}
},
//确定选中
confirmSelect(){
this.AddNickName();
console.log("aaaaa",this.nickName);
if(this.nickName == null){
this.$notify({
title:'提示',
type:'warning',
message: '请至少选择一条数据!'
});
return;
}
this.selectedRow.nickName = this.nickName;
this.$emit('onSelected',this.selectedRow);
this.selectedRows= [];
this.nickName="";
this.showFlag = false;
}
}
};
</script>
......@@ -234,7 +234,6 @@ export default {
},
// 单选选中数据
handleRowChange(row) {
debugger;
if(row){
this.selectedRow = row;
}
......
......@@ -143,9 +143,13 @@
v-model="produceForm.checkBy"
placeholder="请输入检验员"
clearable
/>
>
<el-button slot="append" @click="userSelectShow" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
</el-col>
<UserSingleSelect ref="userSelect" @onSelected="onUserSelected"></UserSingleSelect>
<el-col :span="8">
<el-form-item label="单位类型:" prop="materialsType">
<el-select v-model="materialsType">
......@@ -351,10 +355,11 @@ import {
packagePrintRecordInfo,
} from '@/api/mes/pro/packageLablePrint'
import templatePrint from '@/views/mes/report/index'
import UserSingleSelect from "@/components/userSelect/checkUser.vue"
import { postBatchPrintPdf } from '@/utils/ruoyi'
export default {
name: 'packageLablePrint',
components: { templatePrint },
components: { templatePrint ,UserSingleSelect},
dicts: ['mes_package_type','pro_materials_type'],
data() {
return {
......@@ -399,6 +404,14 @@ export default {
// this.getList();
},
methods: {
//人员选择返回
onUserSelected(row){
this.produceForm.checkBy = row.nickName
},
//点击人员选择按钮
userSelectShow(){
this.$refs.userSelect.showFlag = true;
},
/** 查询工单列表 */
getList() {
if (!this.queryParams.arrangeCode && !this.queryParams.workorderCode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment