Commit 6b1a1117 authored by tanjunxin's avatar tanjunxin

fix: 1.生产工单size计算优化; 2.角色管理表格增加角色字段显示; 3.刀模版台账弹窗细节优化

parent e717dffe
...@@ -5,8 +5,8 @@ VUE_APP_TITLE = 宝绅-生产执行系统 ...@@ -5,8 +5,8 @@ VUE_APP_TITLE = 宝绅-生产执行系统
ENV = 'development' ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.3.181:8100' VUE_APP_BASE_API = 'http://192.168.3.181:8100'
VUE_APP_BASE_API = 'http://192.168.3.181:8101' # VUE_APP_BASE_API = 'http://192.168.3.181:8101'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
...@@ -159,6 +159,14 @@ ...@@ -159,6 +159,14 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="是否配送刀模版" align="center" prop="toolDelivery">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no_number"
:value="scope.row.toolDelivery"
/>
</template>
</el-table-column> -->
<el-table-column label="固化时间" align="center" prop="solidifyTime" /> <el-table-column label="固化时间" align="center" prop="solidifyTime" />
<el-table-column <el-table-column
label="加工处理最小厚度" label="加工处理最小厚度"
...@@ -489,12 +497,16 @@ ...@@ -489,12 +497,16 @@
:rules="rules" :rules="rules"
label-width="120px" label-width="120px"
> >
<el-form-item label="配送刀模版"> <!-- <el-form-item label="是否配送刀模版">
<el-radio-group v-model="form.toolDelivery"> <el-radio-group v-model="form.toolDelivery" @input="handleToolDeliveryChange">
<el-radio :label="1"></el-radio> <el-radio
<el-radio :label="0"></el-radio> v-for="dict in dict.type.sys_yes_no_number"
:key="dict.value"
:label="Number(dict.value)"
>{{ dict.label }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
...@@ -600,7 +612,7 @@ import { genCode } from "@/api/system/autocode/rule"; ...@@ -600,7 +612,7 @@ import { genCode } from "@/api/system/autocode/rule";
export default { export default {
name: "Workunit", name: "Workunit",
components: { WorkstationSelect }, components: { WorkstationSelect },
dicts: ["sys_yes_no"], dicts: ["sys_yes_no", "sys_yes_no_number"],
data() { data() {
return { return {
optType: undefined, optType: undefined,
...@@ -836,6 +848,11 @@ export default { ...@@ -836,6 +848,11 @@ export default {
this.form.workunitCode = null; this.form.workunitCode = null;
} }
}, },
handleToolDeliveryChange(val) {
updateWorkunit(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
});
}
}, },
}; };
</script> </script>
...@@ -321,7 +321,6 @@ ...@@ -321,7 +321,6 @@
</el-col> --> </el-col> -->
</el-row> </el-row>
</el-form> </el-form>
<el-tabs type="border-card" @tab-click="tabClick"> <el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane label="BOM"> <el-tab-pane label="BOM">
<ProogingBom ref="ProogingBomRef" /> <ProogingBom ref="ProogingBomRef" />
...@@ -554,10 +553,10 @@ export default { ...@@ -554,10 +553,10 @@ export default {
console.log('this.currentData', this.currentData) console.log('this.currentData', this.currentData)
this.currentData.saleDirectiveList = this.$refs["WorkOrderSaleRef"].tableData this.currentData.saleDirectiveList = this.$refs["WorkOrderSaleRef"].tableData
this.form.quantity = quantity this.form.quantity = quantity
this.handleChangeQuantity()
} }
}, },
handleChangeQuantity() { handleChangeQuantity() {
// console.log(quantity);
// 计算补单的时候 数量变更修改 // 计算补单的时候 数量变更修改
if (this.mode === 'make') { if (this.mode === 'make') {
// this.form.quantity // this.form.quantity
......
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
label-width="120px" label-width="120px"
> >
<el-row> <el-row>
<el-col :span="12"> <!-- <el-col :span="12">
<el-form-item label="刀模版具类型" prop="toolTypeId"> <el-form-item label="刀模版具类型" prop="toolTypeId">
<el-select <el-select
style="width: 100%" style="width: 100%"
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物料编码" prop="sapItemCode"> <el-form-item label="物料编码" prop="sapItemCode">
<el-input v-model="form.sapItemCode" placeholder="请选择物料编码"> <el-input v-model="form.sapItemCode" placeholder="请选择物料编码">
......
...@@ -152,13 +152,22 @@ ...@@ -152,13 +152,22 @@
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
<workunitSelect :userId="form.userId" :id="id" ref="workunitSelectRef" @reflash="workerFlash" /> <workunitSelect :userId="form.userId" ref="workunitSelectRef" @reflash="workerFlash" />
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <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="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="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="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="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="角色" align="center" key="roleListStr" prop="roleListStr" v-if="columns[7].visible" width="120" />
<!-- <el-table-column label="刀模版管理员" align="center" key="toolIdentity" prop="toolIdentity" v-if="columns[7].visible" width="120">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no_number"
:value="scope.row.toolIdentity"
/>
</template>
</el-table-column> -->
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible"> <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
...@@ -298,14 +307,18 @@ ...@@ -298,14 +307,18 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <!-- <el-col :span="12">
<el-form-item label="刀模版管理员" label-width="120px"> <el-form-item label="刀模版管理员" label-width="120px">
<el-radio-group v-model="form.toolIdentity"> <el-radio-group v-model="form.toolIdentity">
<el-radio :label="1"></el-radio> <el-radio
<el-radio :label="0"></el-radio> v-for="dict in dict.type.sys_yes_no_number"
:key="dict.value"
:label="Number(dict.value)"
>{{ dict.label }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
...@@ -390,17 +403,26 @@ ...@@ -390,17 +403,26 @@
</template> </template>
<script> <script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, getBpmUser} from "@/api/system/user"; import {
listUser,
getUser,
delUser,
addUser,
updateUser,
resetUserPwd,
changeUserStatus,
getBpmUser,
} from "@/api/system/user";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Workstationworker from "./profile/worker"; import Workstationworker from "./profile/worker";
import workunitSelect from "./profile/workunitSelect.vue" import workunitSelect from "./profile/workunitSelect.vue";
export default { export default {
name: "User", name: "User",
dicts: ['sys_normal_disable', 'sys_user_sex'], dicts: ["sys_normal_disable", "sys_user_sex", "sys_yes_no_number"],
components: { Treeselect, Workstationworker,workunitSelect }, components: { Treeselect, Workstationworker, workunitSelect },
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -437,11 +459,11 @@ export default { ...@@ -437,11 +459,11 @@ export default {
roleOptions: [], roleOptions: [],
// 表单参数 // 表单参数
form: { form: {
userId: null userId: null,
}, },
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label" label: "label",
}, },
// 用户导入参数 // 用户导入参数
upload: { upload: {
...@@ -456,7 +478,7 @@ export default { ...@@ -456,7 +478,7 @@ export default {
// 设置上传的请求头部 // 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData" url: process.env.VUE_APP_BASE_API + "/system/user/importData",
}, },
// 查询参数 // 查询参数
queryParams: { queryParams: {
...@@ -465,7 +487,7 @@ export default { ...@@ -465,7 +487,7 @@ export default {
userName: undefined, userName: undefined,
phonenumber: undefined, phonenumber: undefined,
status: undefined, status: undefined,
deptId: undefined deptId: undefined,
}, },
// 列信息 // 列信息
columns: [ columns: [
...@@ -475,48 +497,60 @@ export default { ...@@ -475,48 +497,60 @@ export default {
{ key: 3, label: `部门`, visible: true }, { key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true }, { key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true }, { key: 5, label: `状态`, visible: true },
{ key: 6, label: `创建时间`, visible: true } { key: 6, label: `创建时间`, visible: true },
{ key: 7, label: `角色`, visible: true },
// { key: 7, label: `刀模版管理员`, visible: true },
], ],
// 表单校验 // 表单校验
rules: { rules: {
userName: [ userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }, { required: true, message: "用户名称不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } {
min: 2,
max: 20,
message: "用户名称长度必须介于 2 和 20 之间",
trigger: "blur",
},
], ],
nickName: [ nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" } { required: true, message: "用户昵称不能为空", trigger: "blur" },
], ],
password: [ password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" }, { required: true, message: "用户密码不能为空", trigger: "blur" },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' } {
min: 5,
max: 20,
message: "用户密码长度必须介于 5 和 20 之间",
trigger: "blur",
},
], ],
email: [ email: [
{ {
type: "email", type: "email",
message: "请输入正确的邮箱地址", message: "请输入正确的邮箱地址",
trigger: ["blur", "change"] trigger: ["blur", "change"],
} },
], ],
phonenumber: [ phonenumber: [
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码", message: "请输入正确的手机号码",
trigger: "blur" trigger: "blur",
} },
] ],
} },
}; };
}, },
watch: { watch: {
// 根据名称筛选部门树 // 根据名称筛选部门树
deptName(val) { deptName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} },
}, },
created() { created() {
this.getList(); this.getList();
this.getTreeselect(); this.getTreeselect();
this.getConfigKey("sys.user.initPassword").then(response => { this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg; this.initPassword = response.msg;
}); });
}, },
...@@ -527,31 +561,32 @@ export default { ...@@ -527,31 +561,32 @@ export default {
/** 查询用户列表 */ /** 查询用户列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => { listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows; this.userList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
} }
); );
}, },
workerFlash(){ workerFlash() {
this.$refs.postList.getList(); this.$refs.postList.getList();
}, },
/** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */
getTreeselect() { getTreeselect() {
treeselect().then(response => { treeselect().then((response) => {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
onworkunitSelectRefs(){ onworkunitSelectRefs() {
this.$refs['workunitSelectRef'].showFlag = true this.$refs["workunitSelectRef"].showFlag = true;
}, },
/** 同步bpm人员管理 */ /** 同步bpm人员管理 */
handleSynchronism() { handleSynchronism() {
this.syncLoading = true; this.syncLoading = true;
this.reset(); this.reset();
getBpmUser().then(res => { getBpmUser().then((res) => {
if(res.code === 200) { if (res.code === 200) {
this.$modal.msgSuccess("同步成功"); this.$modal.msgSuccess("同步成功");
this.getList(); this.getList();
} }
...@@ -571,11 +606,15 @@ export default { ...@@ -571,11 +606,15 @@ export default {
// 用户状态修改 // 用户状态修改
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用"; let text = row.status === "0" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() { this.$modal
.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
.then(function () {
return changeUserStatus(row.userId, row.status); return changeUserStatus(row.userId, row.status);
}).then(() => { })
.then(() => {
this.$modal.msgSuccess(text + "成功"); this.$modal.msgSuccess(text + "成功");
}).catch(function() { })
.catch(function () {
row.status = row.status === "0" ? "1" : "0"; row.status = row.status === "0" ? "1" : "0";
}); });
}, },
...@@ -599,7 +638,7 @@ export default { ...@@ -599,7 +638,7 @@ export default {
toolIdentity: 0, toolIdentity: 0,
remark: undefined, remark: undefined,
postIds: [], postIds: [],
roleIds: [] roleIds: [],
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -616,7 +655,7 @@ export default { ...@@ -616,7 +655,7 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.userId); this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
...@@ -637,7 +676,7 @@ export default { ...@@ -637,7 +676,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
getUser().then(response => { getUser().then((response) => {
this.postOptions = response.posts; this.postOptions = response.posts;
this.roleOptions = response.roles; this.roleOptions = response.roles;
this.open = true; this.open = true;
...@@ -650,7 +689,7 @@ export default { ...@@ -650,7 +689,7 @@ export default {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
const userId = row.userId || this.ids; const userId = row.userId || this.ids;
getUser(userId).then(response => { getUser(userId).then((response) => {
this.form = response.data; this.form = response.data;
this.postOptions = response.posts; this.postOptions = response.posts;
this.roleOptions = response.roles; this.roleOptions = response.roles;
...@@ -668,30 +707,32 @@ export default { ...@@ -668,30 +707,32 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
closeOnClickModal: false, closeOnClickModal: false,
inputPattern: /^.{5,20}$/, inputPattern: /^.{5,20}$/,
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间" inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
}).then(({ value }) => { })
resetUserPwd(row.userId, value).then(response => { .then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
this.$modal.msgSuccess("修改成功,新密码是:" + value); this.$modal.msgSuccess("修改成功,新密码是:" + value);
}); });
}).catch(() => {}); })
.catch(() => {});
}, },
/** 分配角色操作 */ /** 分配角色操作 */
handleAuthRole: function(row) { handleAuthRole: function (row) {
const userId = row.userId; const userId = row.userId;
this.$router.push("/system/user-auth/role/" + userId); this.$router.push("/system/user-auth/role/" + userId);
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.userId != undefined) { if (this.form.userId != undefined) {
updateUser(this.form).then(response => { updateUser(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addUser(this.form).then(response => { addUser(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -703,18 +744,26 @@ export default { ...@@ -703,18 +744,26 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const userIds = row.userId || this.ids; const userIds = row.userId || this.ids;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() { this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return delUser(userIds); return delUser(userIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/user/export', { this.download(
...this.queryParams "system/user/export",
}, `user_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`user_${new Date().getTime()}.xlsx`
);
}, },
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {
...@@ -723,8 +772,11 @@ export default { ...@@ -723,8 +772,11 @@ export default {
}, },
/** 下载模板操作 */ /** 下载模板操作 */
importTemplate() { importTemplate() {
this.download('system/user/importTemplate', { this.download(
}, `user_template_${new Date().getTime()}.xlsx`) "system/user/importTemplate",
{},
`user_template_${new Date().getTime()}.xlsx`
);
}, },
// 文件上传中处理 // 文件上传中处理
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
...@@ -735,13 +787,19 @@ export default { ...@@ -735,13 +787,19 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList(); this.getList();
}, },
// 提交上传文件 // 提交上传文件
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
} },
} },
}; };
</script> </script>
...@@ -37,8 +37,8 @@ module.exports = { ...@@ -37,8 +37,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8080`, // target: `http://localhost:8080`,
// target: `http://192.168.3.181:8100`, target: `http://192.168.3.181:8100`,
target: `http://192.168.3.181:8101`, // target: `http://192.168.3.181:8101`,
// target: `http://192.168.4.122:8080`, // target: `http://192.168.4.122:8080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
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