Commit e039519c authored by 11528's avatar 11528

Merge remote-tracking branch 'origin/master' into master

# Conflicts:
#	src/views/ProductionProcess/workOrder.vue
parents 088795c9 249bc220
......@@ -58,6 +58,14 @@ export function updateUser(data) {
}
})
}
// 查数据字典
export function getDicts(params) {
return request({
url: '/system/dict/type/getDictByTypeStrings',
method: 'get',
params
})
}
// 删除用户
export function delUser(userId) {
......
......@@ -48,11 +48,10 @@ router.beforeEach((to, from, next) => {
})
}
})
console.log(routers.accessedRoutes, 'routers.accessedRoutes')
router.addRoutes(routers.accessedRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
} else {
alert('用户无权限')
this.$message.error('用户无权限')
store.dispatch('FedLogOut').then(() => {
next({ path: '/' })
// window.location.href = `${process.env.VUE_APP_LOGIN}?redirect=${to.fullPath}&reLocation=${process.env.VUE_APP_NQ}`
......@@ -60,7 +59,7 @@ router.beforeEach((to, from, next) => {
}
})
} else {
alert('用户无权限')
this.$message.error('用户无权限')
store.dispatch('FedLogOut').then(() => {
next({ path: '/' })
// window.location.href = `${process.env.VUE_APP_LOGIN}?redirect=${to.fullPath}&reLocation=${process.env.VUE_APP_NQ}`
......
......@@ -490,3 +490,9 @@ label {
text-align: left;
}
}
.el-upload-dragger .el-upload__text em {
color: #D20A10;
}
.el-upload-dragger:hover {
border-color: #D20A10;
}
......@@ -155,6 +155,7 @@
@click="handleDetail(scope.row)"
>详情</el-link>
<el-link
v-if="scope.row.status === '1'"
size="mini"
type="primary"
style="margin-left: 10px"
......@@ -179,7 +180,7 @@
@pagination="getOrderTable"
/>
<!-- 详细信息对话框-->
<el-dialog :close-on-click-modal="false" title="工单信息" class="workOrderDialog" :visible.sync="open" width="80%" append-to-body>
<el-dialog v-loading="Loading4" :close-on-click-modal="false" title="工单信息" class="workOrderDialog" :visible.sync="open" width="80%" append-to-body>
<el-form ref="form" :model="form" size="small" label-width="120px">
<el-row>
<el-col :span="8">
......@@ -369,18 +370,19 @@
<div>Sort</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="lineCode">
<el-table-column :show-overflow-tooltip="true" align="center" prop="lineCode1">
<template slot="header">
<div>线别号</div>
<div>Line Beach No.</div>
</template>
<template slot-scope="scope">
<span>{{ scope.row.lineCode || '-' }}</span>
<span>{{ scope.row.lineCode1 || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="startTime">
<template slot="header">
<div>实际开工时间</div>
<div>Real Start Time</div>
</template>
<template slot-scope="scope">
<span>{{ scope.row.startTime || '-' }}</span>
......@@ -398,6 +400,7 @@
<el-table-column :show-overflow-tooltip="true" align="center" prop="jobName">
<template slot="header">
<div>姓名</div>
<div>Name</div>
</template>
<template slot-scope="scope">
<span>{{ scope.row.jobName || '-' }}</span>
......@@ -478,6 +481,7 @@ export default {
Loading1: true,
Loading2: true,
Loading3: true,
Loading4: true,
// 生产工单表格数据
orderList: [
{
......@@ -571,15 +575,17 @@ export default {
/** 详情按钮方法 */
handleDetail(row) {
this.Loading4 = true
getOrder(row.businessId).then(response => {
this.open = true
if (response.data === null) {
getOrder1(row.businessId).then(response1 => {
this.form = response1.data
this.open = true
this.Loading4 = false
})
}else {
this.form = response.data
this.open = true
this.Loading4 = false
}
})
this.getBomTable(row)
......@@ -654,6 +660,8 @@ export default {
cancel() {
this.open = false
this.form = {}
this.lineList = []
this.stationList = []
this.bomList = []
this.Loading1 = true
},
......
......@@ -157,7 +157,7 @@
<template slot-scope="scope">
<el-link
size="mini"
type="success"
type="danger"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>配置</el-link>
......@@ -211,12 +211,13 @@
</el-form-item>
</el-col>
<el-col :span="5">
<el-link v-if="index1 === 0" style="margin-top: 22px" type="primary" @click="addSNRule(item, index)">
<span class="add-icon-style" align="center">+</span> 增加一行
</el-link>
<el-link v-if="index1 !== 0" style="margin-top: 22px" type="primary" @click.prevent="delSNRule(item, index1)">
<el-link v-if="item.nltMaterialEditRules.length > 1" style="margin-top: 22px" type="primary" @click.prevent="delSNRule(item, index1)">
<span class="add-icon-style" align="center">-</span> 删除
</el-link>
<el-link v-if="item.nltMaterialEditRules.length === (index1 + 1)" style="margin-top: 22px" type="primary" @click="addSNRule(item, index)">
<span class="add-icon-style" align="center">+</span> 增加一行
</el-link>
</el-col>
</el-row>
<el-row>
......@@ -248,6 +249,7 @@ import {
listMaterial,
updateMaterial
} from '@/api/material'
import moment from 'moment'
export default {
name: 'MaterialFile',
......@@ -384,6 +386,7 @@ export default {
},
// 导出按钮
handleExport() {
const newDate = moment(new Date().getTime()).format("YYYYMMDD")
const queryParam = {
materCode: this.queryParams.materCode,
materDesc: this.queryParams.materDesc
......@@ -399,7 +402,7 @@ export default {
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '物料信息' + '.xls' // 下载后文件名
downloadElement.download = '物料信息' + newDate + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
......
......@@ -4,7 +4,7 @@
<el-form ref="form" :model="form" :rules="rules" style="padding: 0 0 0 20px" class="formClass" :inline="true">
<el-form-item class="labelHeight" label="区域" style="margin-left: 20px">
<div slot="label" class="">
<div class="labelName" style="text-align: right">区域</div>
<div class="labelName" style="text-align: right">工厂</div>
<div class="labelName">Factory</div>
</div>
<div style="width: 200px">
......@@ -100,7 +100,7 @@
<template slot-scope="scope">
<el-link
size="mini"
type="primary"
type="success"
style="margin-left: 10px"
v-if="htmlType !== '2'"
@click="editPosition(scope.row)"
......@@ -109,6 +109,7 @@
size="mini"
type="primary"
style="margin-left: 10px"
v-if="scope.row.staType === '2'"
@click="handleConfigure(scope.row, scope)"
>配置物料</el-link>
<el-link
......@@ -1015,6 +1016,7 @@ export default {
type: 'warning'
}).then(() => {
this.positionList = this.positionList.filter(item => item.businessId !== row.businessId)
this.selectWordId = this.selectWordId.filter(item => item !== row.businessId)
this.$message({
type: 'success',
message: '删除成功!'
......@@ -1044,8 +1046,8 @@ export default {
}
const params = this.initData()
for (let i = 0; this.positionList.length > i; i++) {
if (i === 0) continue
if (this.positionList[i].dictValue === '2' && this.positionList[i].nltModelStationMaters < 1) {
// if (i === 0) continue
if (this.positionList[i].staType === '2' && this.positionList[i].nltModelStationMaters < 1) {
this.$message.error('扫描工站至少要选择一件物料')
return
}
......@@ -1105,16 +1107,29 @@ export default {
return
}
if (this.workType === '1') {
if (this.positionList.length === 0) {
if (this.addPositionListOne[0].staType !== '2') {
this.$message.error('第一工站必须为扫描工站')
return
}
}
this.addPositionListOne.forEach(item => {
item.nltModelStationMaters = []
item.staId = item.businessId
this.positionList.push(item)
})
this.openPosition = false
} else if (this.workType === '2') {
let list = []
list = JSON.parse(JSON.stringify(this.positionList))
this.positionList.forEach((item, index) => {
if (item.businessId === this.disposeMaterialId) {
if (index === 0) {
if (this.addPositionListOne[0].staType !== '2') {
this.$message.error('第一工站必须为扫描工站')
return
}
}
const data = {
...item,
...this.addPositionListOne[0]
......@@ -1122,10 +1137,11 @@ export default {
list[index] = data
this.positionList = list
this.tableNum++
this.openPosition = false
}
})
}
this.openPosition = false
},
// 关闭选择成品料号弹窗
cancelChoicePart() {
......@@ -1135,6 +1151,10 @@ export default {
// 确定关闭选择成品料号弹窗
submitChoicePart() {
if (this.type === '1') {
if (this.addMaterialList.length > 5) {
this.$message.error('替换物料最多选择五个')
return
}
this.configuringList.forEach(item => {
if (item.materId === this.replaceMaterialId) {
this.addMaterialList.forEach(item1 => {
......@@ -1142,7 +1162,6 @@ export default {
})
item.nltModelStationMaterAlters = this.addMaterialList
this.tableNum++
console.log(this.configuringList, 'this.configuringList')
}
})
} else if (this.type === '2') {
......
......@@ -139,7 +139,7 @@
>删除</el-link>
<el-link
size="mini"
type="danger"
type="primary"
style="margin-left: 10px"
@click="handleCopy(scope.row)"
>复制</el-link>
......
......@@ -152,7 +152,7 @@
@pagination="getStaTable"
/>
<!-- 添加或修改工站信息对话框-->
<el-dialog :close-on-click-modal="false" class="stationDialog" :title="title" :visible.sync="open" width="60%" append-to-body>
<el-dialog v-loading="Loading1" :close-on-click-modal="false" class="stationDialog" :title="title" :visible.sync="open" width="60%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-row>
<el-col :span="12">
......@@ -250,6 +250,7 @@ export default {
stationList: [],
// 加载遮罩
Loading: true,
Loading1: true,
// 表格总条数
total: 0,
// 对话框标题
......@@ -335,13 +336,14 @@ export default {
},
/** 修改按钮方法 **/
handleUpdate(row) {
console.log(row)
this.Loading1 = true
this.open = true
this.reset()
this.getDictFun()
getStation(row.businessId).then(response => {
this.Loading1 = false
this.form = response.data
this.title = '修改工站'
this.open = true
})
},
/** 删除按钮方法 **/
......
......@@ -75,6 +75,12 @@
<div>Dept Name</div>
</template>
</el-table-column>
<el-table-column align="center" :show-overflow-tooltip="true" prop="businessId" label="部门Id" width="260">
<template slot="header">
<div>部门Id</div>
<div>Dept Id</div>
</template>
</el-table-column>
<el-table-column align="center" :show-overflow-tooltip="true" prop="deptCode" label="部门编码" width="260">
<template slot="header">
<div>部门编码</div>
......
......@@ -169,7 +169,7 @@
@pagination="getDevTable"
/>
<!-- 添加或修改设备信息对话框-->
<el-dialog :close-on-click-modal="false" class="deviceDialog" :title="title" :visible.sync="open" width="60%" append-to-body>
<el-dialog v-loading="Loading1" :close-on-click-modal="false" class="deviceDialog" :title="title" :visible.sync="open" width="60%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-row>
<el-col :span="12">
......@@ -293,6 +293,7 @@ export default {
total: 0,
// 加载遮罩
Loading: true,
Loading1: true,
// 表单参数
form: {},
// 表单验证
......@@ -430,12 +431,14 @@ export default {
},
/** 修改按钮方法 **/
handleUpdate(row) {
this.Loading1 = true
this.open = true
this.reset()
this.queryStationFun()
getDevice(row.businessId).then(response => {
this.form = response.data
this.title = '修改设备'
this.open = true
this.Loading1 = false
this.getDictFun()
})
},
......
......@@ -170,7 +170,7 @@
<el-link
v-hasPermi="['sys:dictConfig:edit']"
size="mini"
type="primary"
type="success"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
......@@ -181,15 +181,15 @@
style="margin-left: 10px"
@click="handleDelete(scope.row)"
>删除</el-link>
<el-switch
v-model="scope.row.status"
v-hasPermi="['sys:dictConfig:toggle']"
disabled
class="switchDisabledStyle"
active-value="0"
inactive-value="1"
@click.native="changeStatus(scope.row)"
/>
<!-- <el-switch-->
<!-- v-model="scope.row.status"-->
<!-- v-hasPermi="['sys:dictConfig:toggle']"-->
<!-- disabled-->
<!-- class="switchDisabledStyle"-->
<!-- active-value="0"-->
<!-- inactive-value="1"-->
<!-- @click.native="changeStatus(scope.row)"-->
<!-- />-->
</template>
</el-table-column>
</el-table>
......
......@@ -195,7 +195,7 @@
<el-link
v-hasPermi="['sys:dict:edit']"
size="mini"
type="primary"
type="success"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
......
......@@ -119,7 +119,7 @@
<el-link
v-hasPermi="['sys:menu:update']"
size="mini"
type="primary"
type="success"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
......
......@@ -95,6 +95,15 @@
{{ scope.row.roleName || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="businessId" :show-overflow-tooltip="true">
<template slot="header">
<div>角色Id</div>
<div>Role Id</div>
</template>
<template slot-scope="scope">
{{ scope.row.businessId || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="roleKey" :show-overflow-tooltip="true">
<template slot="header">
<div>权限字符</div>
......@@ -145,7 +154,7 @@
<el-link
v-hasPermi="['sys:role:update']"
size="mini"
type="primary"
type="success"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
......
......@@ -238,7 +238,8 @@
<div>Start Date</div>
</template>
<template slot-scope="scope">
{{ scope.row.nltStartDate || '-' }}
<span v-if="scope.row.nltStartDate">{{ scope.row.nltStartDate.substring(0,10) }}</span>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center" width="70" prop="flag">
......@@ -278,7 +279,7 @@
<el-link
v-hasPermi="['sys:user:update']"
size="mini"
type="primary"
type="success"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
......@@ -293,7 +294,7 @@
<el-link
v-hasPermi="['sys:user:resetPwd']"
size="mini"
type="success"
type="primary"
style="margin-left: 10px"
:loading="addLoading"
@click="handleResetPwd(scope.row)"
......@@ -329,7 +330,14 @@
<div class="labelName">班组</div>
<div class="labelName">Group</div>
</div>
<el-input v-model.trim="form.nltBz" show-word-limit :maxlength="20" placeholder="请输入班组" />
<el-select v-model="form.nltBz" style="width: 100%" placeholder="请选择班组">
<el-option
v-for="dict in shiftOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
......@@ -340,7 +348,7 @@
<div class="labelName">姓名</div>
<div class="labelName">Name</div>
</div>
<el-input v-model.trim="form.name" show-word-limit :maxlength="16" placeholder="请输入姓名" />
<el-input v-model.trim="form.name" show-word-limit :maxlength="30" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -466,14 +474,14 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item class="labelHeight" label="部门:" prop="parentId">
<div slot="label" class="labelClass">
<el-form-item class="labelHeight" label="部门:" prop="deptId">
<div slot="label" class="labelClassRequired">
<div class="labelName">部门</div>
<div class="labelName">Dept</div>
</div>
<treeSelect
class="userTree"
v-model="form.deptId"
class="userTree"
:disable-branch-nodes="false"
:default-expand-level="1"
:options="deptOptions"
......@@ -524,14 +532,14 @@
<em>点击上传</em>
</div>
<div slot="tip" class="el-upload__tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
<el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
<span type="info" style="font-size: 14px; color: #6bc9f5;cursor: pointer" @click="importTemplate">下载模板</span>
</div>
<div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button class="resetBtn" @click="upload.open = false">取 消 Cancel</el-button>
<el-button :loading="importLoading" type="primary" @click="submitFileForm">确 定 Confirm</el-button>
<el-button :loading="importLoading" class="redBtn" type="danger" @click="submitFileForm">确 定 Confirm</el-button>
</div>
</el-dialog>
<el-dialog
......@@ -565,13 +573,14 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="resetBtn" @click="resetPwdDiaLog = false">取 消 Cancel</el-button>
<el-button :disabled="userRestLoading" :loading="userRestLoading" type="primary" @click="handleResetPwdSure">确 定 Confirm</el-button>
<el-button :disabled="userRestLoading" :loading="userRestLoading" type="danger" class="redBtn" @click="handleResetPwdSure">确 定 Confirm</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getDicts,
listUser,
getUser,
delUser,
......@@ -637,6 +646,7 @@ export default {
}
}
return {
shiftOptions: [], // 班次数组
confirmLoading: false,
deptTreeData: [],
pwdTypeMap: {
......@@ -701,6 +711,7 @@ export default {
deptChildren: [],
// 表单参数
form: {
deptId: '',
roleList: [],
nltStartDate: '',
nltPosition: '',
......@@ -748,7 +759,7 @@ export default {
userType: '',
allowLogin: '',
flag: '',
deptId: '',
deptId: undefined,
name: ''
},
// 表单校验
......@@ -839,14 +850,29 @@ export default {
this.getList()
this.getRoleSelect()
this.getTreeSelect()
this.getDictDetails()
// this.getConfigKey('sys.user.initPassword').then(response => {
// this.initPassword = response.msg
// })
},
methods: {
handleCheckChange(data) {
console.log('check', data)
this.form.deptId = data.id
getDictDetails() {
const params = {
dictTypes: 'shift'
}
getDicts(params).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
if (item.dictLabel === 'Day') {
item.dictLabel = '白班'
this.shiftOptions.push(item)
} else if (item.dictLabel === 'Night') {
item.dictLabel = '夜班'
this.shiftOptions.push(item)
}
})
}
})
},
changeValue() {
this.$refs.form.validateField('id')
......@@ -932,7 +958,7 @@ export default {
reset() {
this.form = {
userId: '',
deptId: '',
deptId: undefined,
phone: '',
username: '',
userType: '',
......@@ -1021,9 +1047,6 @@ export default {
this.$set(this.form, 'roleList', response.data.roleIds.split(',').map(num => { return Number(num) }))
}
console.log('详情', this.form)
// if (this.form.deptId) {
// this.form.deptId = this.form.deptId.split(',')
// }
this.title = '修改'
})
// this.getChildrenDept(userId)
......@@ -1068,7 +1091,6 @@ export default {
this.$refs['form'].validate(valid => {
if (valid) {
this.confirmLoading = true
// this.form.deptId = this.form.deptId.join(',')
if (this.form.businessId !== undefined) {
console.log('form', this.form)
updateUser(this.form).then(response => {
......@@ -1223,7 +1245,7 @@ export default {
this.importLoading = false
}
}).catch(err => {
this.$message.success(err.message)
// this.$message.success(err.message)
this.importLoading = false
})
}
......
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