Commit f0dae9d6 authored by wdy's avatar wdy

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

parents bc0000b1 b475eaf3
...@@ -39,33 +39,11 @@ export function updataInfo(data) { ...@@ -39,33 +39,11 @@ export function updataInfo(data) {
}) })
} }
// 角色状态修改 // 逻辑删除基础信息接口
export function changeRoleStatus(businessId, flag) { export function deleteLogical(id) {
const data = {
businessId,
flag
}
return request({ return request({
url: '/system/role/changeStatus', url: '/wbbaseinfo/deleteLogical/' + id,
method: 'put',
params: data
})
}
// 删除角色
export function delRole(roleId) {
return request({
url: '/system/role/deleteLogical/' + roleId,
method: 'delete' method: 'delete'
}) })
} }
// 导出角色
export function exportRole(query) {
return request({
url: '/system/role/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
...@@ -20,3 +20,28 @@ export function abandon(data) { ...@@ -20,3 +20,28 @@ export function abandon(data) {
} }
}) })
} }
export function checkType(data){
return request({
url: '/wbwarehouseinventorytemp/checkType/' + data,
method:'get'
})
}
export function addList(data){
return request({
url: '/wbwarehouseinventorytemp/addList',
method:'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function deleteByType(data){
return request({
url: '/wbwarehouseinventorytemp/deleteByType/' + data,
method:'delete'
})
}
\ No newline at end of file
...@@ -8,4 +8,30 @@ export function listdevice(query) { ...@@ -8,4 +8,30 @@ export function listdevice(query) {
params: query params: query
}) })
} }
export function updatadevice(data) {
return request({
url: '/wbwarehouse/update',
method: 'put',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function getDetailById(id) {
return request({
url: '/wbwarehouse/detail/' + id,
method: 'get'
})
}
export function add(data) {
return request({
url: '/wbwarehouse/add',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
import request from '@/utils/request' import request from '@/utils/request'
// TODO: 用来进行工序库的出入库记录的 分页+时间+普通字段的查询
export function listLog(queryParams) { export function listLog(queryParams) {
console.log('this is date:', queryParams.dateRange)
return request({ return request({
url: '/wbwarehouselog/queryWbWarehouseLogByPagination', url: '/wbwarehouselog/queryWbWarehouseLogByPagination',
method: 'get', method: 'get',
params: queryParams params: queryParams
}) })
} }
export function findSingleLogDetail(singleLogIdAndFqYs) {
return request({
url: '/wbwarehouselog/detail',
method: 'post',
data: singleLogIdAndFqYs,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
...@@ -81,7 +81,7 @@ export function BaseTableArguments(selection, loading, processList, queryParams, ...@@ -81,7 +81,7 @@ export function BaseTableArguments(selection, loading, processList, queryParams,
} }
// TODO: 组件表单所需的所有参数 // TODO: 组件表单所需的所有参数
export function BaseTableArgumentsTest(nIndex, selection, loading, processList, queryParams, columnData) { export function BaseTableArgumentsTest(nIndex, selection, loading, List, queryParams, columnData) {
// TODO: 选择框是否需要存在 (selection判断表单选择框是否需要存在) // TODO: 选择框是否需要存在 (selection判断表单选择框是否需要存在)
if (typeof selection !== 'boolean') { if (typeof selection !== 'boolean') {
console.warn('selection下拉框参数的type类型错误!请检查后重新赋值') console.warn('selection下拉框参数的type类型错误!请检查后重新赋值')
...@@ -108,5 +108,5 @@ export function BaseTableArgumentsTest(nIndex, selection, loading, processList, ...@@ -108,5 +108,5 @@ export function BaseTableArgumentsTest(nIndex, selection, loading, processList,
this.queryParams = queryParamsType this.queryParams = queryParamsType
} }
this.columnData = columnData this.columnData = columnData
this.processList = processList this.List = List
} }
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
v-loading="allTableArguments.loading" v-loading="allTableArguments.loading"
class="processList" class="processList"
border border
:data="allTableArguments.processList" :data="allTableArguments.List"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="index" label="序号" width="50" :index="nIndex" /> <el-table-column type="index" label="序号" width="50"/>
<!-- TODO: 选择框是否开启,selectable控制是否单行禁用 --> <!-- TODO: 选择框是否开启,selectable控制是否单行禁用 -->
<el-table-column v-if="allTableArguments.columObj.selection" type="selection" :selectable="allTableArguments.columObj.selectable" width="50px" /> <el-table-column v-if="allTableArguments.columObj.selection" type="selection" :selectable="allTableArguments.columObj.selectable" width="50px" />
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
:index="columIndex" :index="columIndex"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<!-- 默认展示 --> <!-- 默认展示 -->
<span v-if="column.text && column.editRow !== $index">{{ row[column.prop] || '-' }}</span> <span v-if="column.text && column.editRow !== $index">{{ row[column.prop] || '-' }}</span>
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
selection: Boolean, selection: Boolean,
loading: Boolean, loading: Boolean,
queryParams: Object, queryParams: Object,
processList: Array, List: Array,
columnData: Array columnData: Array
} }
} }
......
...@@ -117,18 +117,24 @@ export default { ...@@ -117,18 +117,24 @@ export default {
}, },
// 提价时要调的接口 // 提价时要调的接口
submitForm() { submitForm() {
this.$refs.form.validate((valid) => { this.$confirm('是否确认提交?', '提示', {
if (valid) { confirmButtonText: '确定',
addApplication(this.form).then(res => { cancelButtonText: '取消',
console.log('res', res) type: 'warning'
if (res.code === 200) { }).then(res => {
this.$message.success('操作成功') this.$refs.form.validate((valid) => {
this.resetFrom() if (valid) {
} else if (res.code === null) { addApplication(this.form).then(res => {
this.$message.success(res.message) console.log('res', res)
} if (res.code === 200) {
}) this.$message.success('操作成功')
} this.resetFrom()
} else if (res.code === null) {
this.$message.success(res.message)
}
})
}
})
}) })
}, },
// 调数据字典查询 // 调数据字典查询
......
...@@ -92,9 +92,9 @@ ...@@ -92,9 +92,9 @@
{{ scope.row.createName || '-' }} {{ scope.row.createName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime" width="200px"> <el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="updateDate" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.updateDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
</template> </template>
<script> <script>
import { add, listBasicInfo, updataInfo, getDetailById } from '@/api/equipment/basicInfo' import { add, listBasicInfo, updataInfo, getDetailById, deleteLogical } from '@/api/equipment/basicInfo'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
export default { export default {
name: 'Role', name: 'Role',
...@@ -264,15 +264,11 @@ export default { ...@@ -264,15 +264,11 @@ export default {
pgx: [ pgx: [
{ required: true, message: '请输入pgx', trigger: 'blur' } { required: true, message: '请输入pgx', trigger: 'blur' }
], ],
prank: [ prank: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
{ required: true, message: '请输入prank', trigger: 'blur' }
],
pissb: [ pissb: [
{ required: true, message: '请输入pissb', trigger: 'blur' } { required: true, message: '请输入pissb', trigger: 'blur' }
], ],
psm: [ psm: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
{ required: true, message: '请输入psm', trigger: 'blur' }
],
psy: [ psy: [
{ required: true, message: '请输入psy', trigger: 'blur' } { required: true, message: '请输入psy', trigger: 'blur' }
] ]
...@@ -306,7 +302,7 @@ export default { ...@@ -306,7 +302,7 @@ export default {
getList() { getList() {
this.loading = true this.loading = true
listBasicInfo(this.queryParams).then(res => { listBasicInfo(this.queryParams).then(res => {
res.rows.createDate = parseTime(res.rows.createDate,'{y}-{m}-{d}') res.rows.createDate = parseTime(res.rows.createDate, '{y}-{m}-{d}')
this.total = res.total this.total = res.total
this.basicInfoList = res.rows this.basicInfoList = res.rows
this.loading = false this.loading = false
...@@ -475,25 +471,24 @@ export default { ...@@ -475,25 +471,24 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const roleIds = row.businessId || this.ids const id = row.businessId
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', { this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(function() { }).then(res => {
return delRole(roleIds) deleteLogical(id).then(res => {
}).then(() => { if (res.code === 200) {
this.getList() this.$message.success('操作成功')
this.$message({ this.getList()
message: '删除成功', }
type: 'success'
}) })
}).catch(function() {
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-container { .app-container {
font-size: 18px; font-size: 18px;
......
...@@ -35,21 +35,21 @@ ...@@ -35,21 +35,21 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="padding:5px 10px"> <div style="padding:5px 10px">
<div class="mb12 font-small-bold">设备管理列表</div> <div class="mb12 font-small-bold">库存管理列表</div>
<el-table v-loading="loading" border :data="equipmentList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="80" /> <el-table-column type="index" label="序号" width="80" />
<el-table-column label="pn" prop="businessId" width="120"> <el-table-column label="pn" prop="businessId">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.pn || '-' }} {{ scope.row.pn || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="lot" prop="lot" width="120"> <el-table-column label="lot" prop="lot">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lot || '-' }} {{ scope.row.lot || '-' }}
</template> </template>
...@@ -74,14 +74,17 @@ ...@@ -74,14 +74,17 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="110px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)"> <el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)">
详情 详情
</el-button> </el-button>
<el-button :type="typeParent" :size="size" @click="handleUpdate(scope.row)"> <el-button
修改 size="mini"
</el-button> type="text"
style="color: #49cec9"
@click="handleUpdate(scope.row)"
>修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -96,40 +99,27 @@ ...@@ -96,40 +99,27 @@
<!-- 添加或修改设备配置对话框 --> <!-- 添加或修改设备配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="名称" prop="roleName"> <el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.roleName" show-word-limit :maxlength="30" placeholder="请输入设备名称" /> <el-input v-model.trim="form.pn" :maxlength="30" placeholder="请输入pn" />
</el-form-item>
<el-form-item label="lot" prop="lot">
<el-input v-model.trim="form.lot" :maxlength="30" placeholder="请输入lot" />
</el-form-item>
<el-form-item label="plocation" prop="plocation">
<el-input v-model.trim="form.plocation" :maxlength="30" placeholder="请输入plocation" />
</el-form-item> </el-form-item>
<el-form-item label="设备来源" prop="roleKey"> <el-form-item label="厚度" prop="phd">
<el-input v-model.trim="form.roleKey" show-word-limit :maxlength="30" placeholder="请输入设备来源" /> <el-input v-model.trim="form.phd" :maxlength="30" placeholder="请输入厚度" />
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="roleSort"> <el-form-item label="psm" prop="psm">
<el-input-number v-model="form.roleSort" style="width: 100%" controls-position="right" :min="0" /> <el-input v-model.trim="form.psm" :maxlength="30" placeholder="请输入psm" />
</el-form-item> </el-form-item>
<el-form-item label="设备批次"> <el-form-item label="pzl" prop="pzl">
<!-- <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>--> <el-input v-model.trim="form.pzl" :maxlength="30" placeholder="请输入pzl" />
<!-- <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>-->
<!-- <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>-->
<el-tree
ref="menu"
class="tree-border"
:data="menuOptions"
show-checkbox
node-key="id"
check-strictly
empty-text="加载中,请稍后"
:props="defaultProps"
@check-change="handleMenuCheckChange"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="parnk" prop="prank">
<el-input <el-input v-model.trim="form.prank" :maxlength="30" placeholder="请输入prank" />
v-model.trim="form.remark"
maxlength="200"
show-word-limit
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -179,37 +169,25 @@ ...@@ -179,37 +169,25 @@
<el-form-item label="parnk:" prop="prank"> <el-form-item label="parnk:" prop="prank">
<el-input v-model.trim="singleDetails.prank" :readonly="true" /> <el-input v-model.trim="singleDetails.prank" :readonly="true" />
</el-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="createName">
<el-input v-model.trim="singleDetails.createName" :readonly="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="true" />
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="createName">
<el-input v-model.trim="singleDetails.createName" :readonly="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="true" />
</el-form-item>
</el-col>
</el-row>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { listdevice, updatadevice, getDetailById, add } from '@/api/magnagement'
addRole,
changeRoleStatus,
dataScope,
delRole,
exportRole,
getRole,
updateRole
} from '@/api/system/role'
import { listdevice } from '@/api/magnagement'
import { roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect } from '@/api/system/menu'
import { roleDeptTreeselect, treeselect as deptTreeselect } from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template'
export default { export default {
name: 'Role', name: 'Role',
data() { data() {
...@@ -316,13 +294,20 @@ export default { ...@@ -316,13 +294,20 @@ export default {
rows: 10, rows: 10,
pn: undefined, pn: undefined,
lot: undefined, lot: undefined,
snapLocation: undefined plocation: undefined,
ptype: 1,
pstatus: 0,
delFlag: 0
}, },
// 表单参数 // 表单参数
form: { form: {
pn: '', pn: '',
lot: '', lot: '',
plocation: '' plocation: '',
phd: '',
psm: '',
pzl: '',
prank: ''
}, },
defaultProps: { defaultProps: {
children: 'children', children: 'children',
...@@ -330,15 +315,13 @@ export default { ...@@ -330,15 +315,13 @@ export default {
}, },
// 表单校验 // 表单校验
rules: { rules: {
roleName: [ pn: [{ required: true, message: '请输入pn', trigger: 'blur' }],
{ required: true, message: '请输入角色名称', trigger: 'blur' } lot: [{ required: true, message: '请输入lot', trigger: 'blur' }],
], plocation: [{ required: true, message: '请输入plocation', trigger: 'blur' }],
roleKey: [ phd: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
{ required: true, message: '请输入权限字符', trigger: 'blur' } psm: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
], pzl: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
roleSort: [ prank: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }]
{ required: true, message: '请输入角色排序', trigger: 'blur' }
]
}, },
deptOptions: [], deptOptions: [],
formData: {} formData: {}
...@@ -361,9 +344,6 @@ export default { ...@@ -361,9 +344,6 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// });
}, },
methods: { methods: {
// TODO: 获取所选行详情信息操作 // TODO: 获取所选行详情信息操作
...@@ -395,100 +375,6 @@ export default { ...@@ -395,100 +375,6 @@ export default {
} }
) )
}, },
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data
})
},
/** 查询菜单列表 */
getMenuList(roleId) {
roleMenuTreeselectMC(roleId).then(response => {
this.menuList = this.handleTree(response.data.menus, 'businessId')
this.loading = false
})
},
/** 查询部门树结构 */
getDeptTreeselect() {
deptTreeselect().then(response => {
this.deptOptions = response.data
})
},
// 树状图节点点击选中事件
handleMenuCheckChange(data, check, subCheck) { // data为选中节点信息,check选中状态
if (data.children !== undefined && data.children !== null) { // 是否包含子节点
this.checkNode(data.children, check) // 调用checkNode方法
}
// // 获取所有被选中的节点信息
// const nodes = this.$refs.menu.getCheckedNodes(false, false)
// // 将获取到的信息赋值(根据自己的需求)
// this.custGroupDesc = nodes.map(item => item.CN_NAME)
// this.searchForm.custGroup = nodes.map(item => item.code)
},
// 选中所有下级节点
checkNode(data, check) {
// 遍历所有下级节点信息
data.forEach(item => {
// 通过节点信息设置选中状态
this.$refs.menu.setChecked(item, check, false)
// 是否包含下级节点,包含下级节点则选中所有下级节点
if (item.children !== undefined) {
this.checkNode(item.children, check)
}
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
const checkedKeys = this.$refs.menu.getHalfCheckedKeys()
// 半选中的菜单节点
const halfCheckedKeys = this.$refs.menu.getCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
const checkedKeys = this.$refs.dept.getHalfCheckedKeys()
// // 半选中的部门节点
const halfCheckedKeys = this.$refs.dept.getCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return this.$refs.dept.getCheckedKeys()
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.data.menus
return response
})
},
/** 根据角色ID和菜单ID查询部门树结构 */
getRoleDeptTreeselect(roleId, menuId) {
return roleDeptTreeselect(roleId, menuId).then(response => {
this.form.deptCheckStrictly = response.data.deptCheckStrictly
this.deptOptions = response.data.depts
this.form.dataScope = this.dataScopeOptions[response.data.dataScope - 1].value
return response
})
},
// 角色状态修改
handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return changeRoleStatus(row.businessId, row.flag)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
})
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
...@@ -529,48 +415,6 @@ export default { ...@@ -529,48 +415,6 @@ export default {
this.queryParams.page = 1 this.queryParams.page = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */
resetQuery() {
// this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
// // 树权限(父子联动)
// handleCheckedTreeConnect(value, type) {
// if (type === 'menu') {
// this.form.menuCheckStrictly = !!value
// } else if (type === 'dept') {
// this.form.deptCheckStrictly = !!value
// }
// },
// 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type === 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions : [])
} else if (type === 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions : [])
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type === 'menu') {
const treeList = this.menuOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
}
} else if (type === 'dept') {
const treeList = this.deptOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value
}
}
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset()
...@@ -580,120 +424,54 @@ export default { ...@@ -580,120 +424,54 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.title = '编辑基础信息表单'
const roleId = row.businessId || this.ids const id = row.businessId
const roleMenu = this.getRoleMenuTreeselect(roleId) getDetailById(id).then(res => {
getRole(roleId).then(response => { this.form = res.data
this.form = response.data
this.open = true this.open = true
this.getMenuTreeselect(roleId)
this.$nextTick(() => {
roleMenu.then(res => {
this.$refs.menu.setCheckedKeys(res.data.checkedKeys)
})
})
this.title = '修改角色'
})
},
/** 分配数据权限操作 选择菜单 */
handleMenu(row) {
this.reset()
const roleId = row.businessId || this.ids
this.getMenuList(roleId) // 查询菜单列表树形显示
getRole(roleId).then(response => {
this.form = response.data
this.openDataScope = true
this.title = '分配数据权限'
}) })
}, },
/** 分配数据权限操作 */
handleDataScope(row) {
this.deptOptions = []
this.form.dataScope = undefined
const roleId = this.form.businessId
this.form.menuId = row.businessId
this.form.menuName = row.menuName
const roleDeptTreeselect = this.getRoleDeptTreeselect(roleId, this.form.menuId)
this.$nextTick(() => {
roleDeptTreeselect.then(res => {
this.$refs.dept.setCheckedKeys(res.data.checkedKeys)
})
})
this.title = '分配数据权限'
},
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.form.menuCheckStrictly = false // 校验通过,提交表单或进行其他操作
console.log('form', this.form)
if (this.form.businessId !== undefined) { if (this.form.businessId !== undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys() console.log('更新')
updateRole(this.form).then(response => { updatadevice(this.form).then(res => {
this.msgSuccess('修改成功') console.log('res', res)
this.open = false if (res.code === 200) {
this.getList() this.open = false
this.$message.success('操作成功')
this.getList()
this.reFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
}) })
} else { } else {
this.form.menuIds = this.getMenuAllCheckedKeys() add(this.form).then(res => {
addRole(this.form).then(response => { if (res.code === 200) {
this.msgSuccess('新增成功') this.open = false
this.open = false this.$message.success('操作成功')
this.getList() this.getList()
this.reFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
}) })
} }
} else {
// 校验失败,显示错误信息或进行其他操作
} }
}) })
}, },
/** 提交按钮(数据权限) */
submitDataScope: function() {
if (this.form.businessId !== undefined && this.form.menuId !== undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys()
dataScope(this.form).then(response => {
this.msgSuccess('修改成功')
this.openDataScope = false
this.getList()
})
}
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const roleIds = row.businessId || this.ids
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delRole(roleIds)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportRole(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '角色信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
// this.download(response.msg);
})
})
} }
} }
} }
......
...@@ -38,19 +38,13 @@ ...@@ -38,19 +38,13 @@
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
<el-button style="padding: 8px 7px;" :type="typePrimary" :size="smallSize" :icon="addIcon" @click="handleAdd">开始盘点 {{ check }} </el-button> <el-button style="padding: 8px 7px;" :type="typePrimary" :size="smallSize" :icon="addIcon" @click="checkType">开始盘点 {{ check }} </el-button>
</el-form-item> </el-form-item>
<!-- 这俩都没写接口以及方法 -->
<el-form-item> <el-form-item>
<el-button <el-button style="padding: 8px 7px;" type="danger" :size="smallSize" @click="deleteByType" icon="el-icon-minus">结束盘点 {{ check }}</el-button>
style="padding: 8px 7px;"
type="danger"
:size="smallSize"
icon="el-icon-minus"
>结束盘点
{{ check }}
</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
...@@ -229,7 +223,7 @@ import { ...@@ -229,7 +223,7 @@ import {
getRole, getRole,
updateRole updateRole
} from '@/api/system/role' } from '@/api/system/role'
import { listCheck} from '@/api/equipment/check' import { checkType, listCheck,addList,deleteByType} from '@/api/equipment/check'
import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu' import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu'
import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept' import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template' // import { getRolesByInsId } from '../../../api/businessManage/template'
...@@ -237,6 +231,13 @@ export default { ...@@ -237,6 +231,13 @@ export default {
name: 'Role', name: 'Role',
data() { data() {
return { return {
// 需要盘点的list
checkFrom: {
Ptype: '',
checkList: [],
},
// 选中的列表
selectList:[],
// TODO: 表单里的单项详情参数 // TODO: 表单里的单项详情参数
singleDetails: { singleDetails: {
equipmentName: '', equipmentName: '',
...@@ -400,6 +401,37 @@ export default { ...@@ -400,6 +401,37 @@ export default {
this.title = '详情信息' this.title = '详情信息'
this.openDetails = !this.openDetails this.openDetails = !this.openDetails
}, },
deleteByType(){
deleteByType(1).then(flag => {
if(flag.data > 0 && flag.code === 200){
this.$message.success("结束盘点成功")
}else{
this.$message.error("结束盘点失败")
}
})
},
checkType(){
checkType(1).then(total => {
if(total.data !== 0){
this.$message.error("请先结束盘点")
}else{
let data = []
if(this.selectList.length === 0){
data = this.equipmentList
}else{
data = this.selectList
}
addList(data).then(flag => {
if(flag.data.influence > 0){
this.$message.success("盘点成功")
}else{
this.$message.error("盘点失败")
}
})
}
})
},
handelTab(i, e) { handelTab(i, e) {
const that = this const that = this
if (!that.$refs['input' + i]) { if (!that.$refs['input' + i]) {
...@@ -565,6 +597,7 @@ export default { ...@@ -565,6 +597,7 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId) this.ids = selection.map(item => item.roleId)
this.selectList = selection
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
......
...@@ -38,24 +38,11 @@ ...@@ -38,24 +38,11 @@
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
<el-button <el-button style="padding: 8px 7px;" :type="typePrimary" :size="smallSize" :icon="addIcon" @click="checkType">开始盘点 {{ check }} </el-button>
style="padding: 8px 7px;"
:type="typePrimary"
:size="smallSize"
:icon="addIcon"
>开始盘点
{{ check }}
</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button style="padding: 8px 7px;" type="danger" :size="smallSize" @click="deleteByType" icon="el-icon-minus">结束盘点 {{ check }}</el-button>
style="padding: 8px 7px;"
type="danger"
:size="smallSize"
icon="el-icon-minus"
>结束盘点
{{ check }}
</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -236,7 +223,8 @@ import { ...@@ -236,7 +223,8 @@ import {
listRole, listRole,
updateRole updateRole
} from '@/api/system/role' } from '@/api/system/role'
import {listCheck} from '@/api/equipment/check' import {listCheck } from '@/api/equipment/checkProcess'
import { checkType, addList,deleteByType} from '@/api/equipment/check'
import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu' import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu'
import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept' import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template' // import { getRolesByInsId } from '../../../api/businessManage/template'
...@@ -258,6 +246,7 @@ export default { ...@@ -258,6 +246,7 @@ export default {
openDetails: false, openDetails: false,
// // TODO: 模拟测试数据 // // TODO: 模拟测试数据
equipmentList: [], equipmentList: [],
selectList: [],
// check: '开始盘点', // check: '开始盘点',
typeParent: 'text', typeParent: 'text',
typePrimary: 'primary', typePrimary: 'primary',
...@@ -403,6 +392,36 @@ export default { ...@@ -403,6 +392,36 @@ export default {
this.title = '详情信息' this.title = '详情信息'
this.openDetails = !this.openDetails this.openDetails = !this.openDetails
}, },
deleteByType(){
deleteByType(2).then(flag => {
if(flag.data > 0){
this.$message.success("结束盘点成功")
}else{
this.$message.error("结束盘点失败")
}
})
},
checkType(){
checkType(2).then(total => {
if(total.data !== 0){
this.$message.error("请先结束盘点")
}else{
let data = []
if(this.selectList.length === 0){
data = this.equipmentList
}else{
data = this.selectList
}
addList(data).then(flag => {
if(flag.data.influence > 0){
this.$message.success("盘点成功")
}else{
this.$message.error("盘点失败")
}
})
}
})
},
handelTab(i, e) { handelTab(i, e) {
const that = this const that = this
if (!that.$refs['input' + i]) { if (!that.$refs['input' + i]) {
......
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
{{ scope.row.createName || '-' }} {{ scope.row.createName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime" width="200px"> <el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="updateDate" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.updateDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rule" label-width="80px">
<!-- TODO: 基础设备管理--> <div class="info"><span class="title">设备入库</span></div>
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true"> <el-row :gutter="40">
<el-form-item label="设备名称" prop="roleName"> <el-col :span="12" style="padding-left: 10%;">
<el-input <el-form-item label="pn:" style="flex-basis: 50%;" prop="pn">
v-model="queryParams.deviceName" <el-input v-model="form.pn" placeholder="请输入pn" :style="{ width: '400px', height: '30px' }" :maxlength="50" />
placeholder="请输入设备名称" </el-form-item>
clearable </el-col>
:maxlength="30" <el-col :span="12">
size="small" <el-form-item label="lot:" style="flex-basis: 50%;" prop="lot">
style="width: 150px" <el-input v-model="form.lot" placeholder="请输入lot" :style="{ width: '400px', height: '30px' }" :maxlength="10" />
@keyup.enter.native="handleQuery" </el-form-item>
/> </el-col>
</el-form-item> </el-row>
<el-form-item label="设备编码" prop="roleKey"> <el-row :gutter="40">
<el-input <el-col :span="12" style="padding-left: 10%;">
v-model="queryParams.deviceId" <el-form-item label="位置:" style="flex-basis: 50%;" prop="plocation">
placeholder="请输入设备编码" <el-input v-model="form.plocation" placeholder="请输入位置" :style="{ width: '400px', height: '30px' }" :maxlength="50" />
clearable </el-form-item>
size="small" </el-col>
style="width: 150px" <el-col :span="12">
@keyup.enter.native="handleQuery" <el-form-item label="厚度:" style="flex-basis: 50%;" prop="phd">
/> <el-input v-model="form.phd" placeholder="请输入厚度" :style="{ width: '400px', height: '30px' }" :maxlength="10" />
</el-form-item> </el-form-item>
</el-col>
<el-form-item> </el-row>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-row :gutter="40">
</el-form-item> <el-col :span="12" style="padding-left: 10%;">
<el-form-item label="psm:" style="flex-basis: 50%;" prop="psm">
</el-form> <el-input v-model="form.psm" placeholder="请输入psm" :style="{ width: '400px', height: '30px' }" :maxlength="50" />
</el-form-item>
<div class="placeholder" /> </el-col>
<el-col :span="12">
<!-- TODO: 中间的分隔符号 --> <el-form-item label="pzl:" style="flex-basis: 50%;" prop="pzl">
<div style="padding:5px 10px"> <el-input v-model="form.pzl" placeholder="请输入pzl" :style="{ width: '400px', height: '30px' }" :maxlength="10" />
</el-form-item>
<!-- TODO: 以下为基础设备管理列表 --> </el-col>
<div class="mb12 font-small-bold">设备领用列表</div> </el-row>
<el-table v-loading="loading" border :data="roleList" @selection-change="handleSelectionChange"> <el-row>
<el-table-column type="index" label="序号" width="50" /> <el-col :span="12" style="padding-left: 8.6%;">
<el-table-column label="设备名称" prop="deviceName" :show-overflow-tooltip="true"> <el-form-item label="prank:" style="flex-basis: 50%;" prop="prank">
<template slot-scope="scope"> <el-input v-model="form.prank" placeholder="请输入prank" :style="{ width: '400px', height: '30px' }" :maxlength="10" />
{{ scope.row.deviceName || '-' }} </el-form-item>
</template> </el-col>
</el-table-column> </el-row>
<el-table-column label="设备编码" prop="deviceId"> <div class="button" >
<template slot-scope="scope"> <el-button type="primary" @click="submitForm">提交</el-button>
{{ scope.row.deviceId || '-' }}
</template>
</el-table-column>
<el-table-column label="LOT" prop="LOT">
<template slot-scope="scope">
{{ scope.row.deviceId || '-' }}
</template>
</el-table-column>
<el-table-column label="位置" prop="location">
<template slot-scope="scope">
{{ scope.row.location || '-' }}
</template>
</el-table-column>
<el-table-column label="厚度" prop="ply">
<template slot-scope="scope">
{{ scope.row.ply || '-' }}
</template>
</el-table-column>
<el-table-column label="操作员" prop="createBy">
<template slot-scope="scope">
{{ scope.row.createBy || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" :show-overflow-tooltip="true" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="140px">
<template slot-scope="scope">
<el-button v-if="scope.row.state !== ' '" align="center" :type="typeParent" :size="size" @click="handleUpdate(scope.row)">
{{ updataName }}
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-pagination
background
layout="prev, pager, next"
:total="1000"
/>
<!-- TODO: 添加或修改设备配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model.trim="form.deviceName" show-word-limit :maxlength="30" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备编码" prop="deviceId">
<el-input v-model.trim="form.deviceId" show-word-limit :maxlength="30" placeholder="请输入设备编码" />
</el-form-item>
<el-form-item label="LOT" prop="LOT">
<el-input v-model.trim="form.LOT" show-word-limit :maxlength="30" placeholder="请输入LOT" />
</el-form-item>
<el-form-item label="位置" prop="location">
<el-input v-model.trim="form.location" show-word-limit :maxlength="30" placeholder="请输入设备编码" />
</el-form-item>
<el-form-item label="厚度" prop="ply">
<el-input v-model.trim="form.ply" show-word-limit :maxlength="30" placeholder="请输入设备编码" />
</el-form-item>
<el-form-item label="操作员" prop="createBy">
<el-input v-model.trim="form.createBy" :maxlength="30" show-word-limit placeholder="请输入创建人" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
</div> </div>
</el-dialog> </el-form>
<!-- TODO: 单项详情信息表单配置 -->
<el-dialog class="aboutSingleDetails" :title="title" :visible.sync="openDetails" width="700px" append-to-body>
<el-form ref="formDetails" :model="singleDetails" size="small" label-width="90px">
<el-form-item label="名称:" prop="deviceName">
<el-input v-model.trim="singleDetails.deviceName" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="设备编码:" prop="deviceId">
<el-input v-model.trim="singleDetails.deviceId" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="LOT: " prop="LOT">
<el-input v-model.trim="singleDetails.LOT" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="位置:" prop="location">
<el-input v-model.trim="singleDetails.location" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="位置:" prop="ply">
<el-input v-model.trim="singleDetails.ply" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="创建时间:" prop="createTime">
<el-input v-model.trim="singleDetails.createTime" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="创建人:" prop="createBy">
<el-input v-model.trim="singleDetails.createBy" :readonly="isReadOnly" />
</el-form-item>
<el-form-item label="状态" prop="state">
<el-input v-model.trim="singleDetails.state" :readonly="isReadOnly" />
</el-form-item>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { add, updatadevice } from '@/api/magnagement'
export default { export default {
name: 'Role', name: 'Role',
data() { data() {
return { return {
typeParent: 'text',
typePrimary: 'primary',
typeSuccess: 'success',
nameParent: '删除',
resetName: '重置',
addName: '新增',
application: '申请领用',
updataName: '修改',
size: 'mini',
smallSize: 'small',
delicon: 'el-icon-delete',
addIcon: 'el-icon-plus',
exportIcon: 'el-icon-download',
resetIcon: '',
// TODO: 控制只读
isReadOnly: true,
// 遮罩层
loading: true,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 角色表格数据
roleList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 是否显示弹出层(数据详情)
openDetails: false,
// 日期范围
// dateRange: [],
// 菜单表格数据
menuList: [],
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceName: undefined,
deviceId: undefined,
LOT: undefined,
location: undefined,
ply: undefined,
state: undefined,
flag: undefined
},
defaultProps: {},
// TODO: 表单参数
form: { form: {
deviceName: '', pn: '',
deviceId: '', lot: '',
LOT: '', plocation: '',
location: '', phd: '',
ply: '', psm: '',
state: '', pzl: '',
flag: '1', prank: '',
remark: '', flag: 1,
createTime: new Date(), ptype: 1,
updataTime: new Date(), pstatus: 0
createBy: ''
},
// TODO: 表单初始参数
formReset: {
deviceName: '',
deviceId: '',
LOT: '',
location: '',
ply: '',
state: '',
flag: '1',
createTime: new Date(),
updataTime: new Date(),
createBy: ''
},
// TODO: 表单里的单项详情参数
singleDetails: {
deviceName: '',
deviceId: '',
LOT: '',
location: '',
ply: '',
state: '',
flag: '1',
createTime: new Date(),
updataTime: new Date(),
createBy: ''
}, },
// TODO: 模拟测试数据 rule: {
simulateDeviceList: [{ pn: [{ required: true, message: '请输入pn', trigger: 'blur' }],
deviceName: '设备1', deviceId: '0001', flag: 1, LOT: '0001', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '驳回' lot: [{ required: true, message: '请输入lot', trigger: 'blur' }],
}, { plocation: [{ required: true, message: '请输入位置', trigger: 'blur' }],
deviceName: '设备2', deviceId: '0002', flag: 2, LOT: '0002', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '驳回' phd: [{ pattern: /^\d+$/, message: '仅能输入数字', trigger: 'change' }],
}, { psm: [{ pattern: /^\d+$/, message: '仅能输入数字', trigger: 'change' }],
deviceName: '设备3', deviceId: '0003', flag: 2, LOT: '0003', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '驳回' pzl: [{ pattern: /^\d+$/, message: '仅能输入数字', trigger: 'change' }],
}, { prank: [{ pattern: /^\d+$/, message: '仅能输入数字', trigger: 'change' }]
deviceName: '设备4', deviceId: '0004', flag: 2, LOT: '0004', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '驳回'
}, {
deviceName: '设备5', deviceId: '0005', flag: 2, LOT: '0005', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '待审核'
}, {
deviceName: '设备6', deviceId: '0006', flag: 2, LOT: '0006', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '待审核'
}, {
deviceName: '设备7', deviceId: '0007', flag: 2, LOT: '0007', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '待审核'
}, {
deviceName: '设备8', deviceId: '0008', flag: 2, LOT: '0008', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '待审核'
}, {
deviceName: '设备9', deviceId: '0009', flag: 2, LOT: '0009', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '通过'
}, {
deviceName: '设备10', deviceId: '00010', flag: 2, LOT: '0010', location: 'XXX', ply: 'YYY', createTime: new Date(), updataTime: new Date(), createBy: 'admin', state: '通过'
} }
],
// 表单校验
rules: {
deviceName: [
{ required: true, message: '请输入设备名称', trigger: 'blur' }
],
deviceId: [
{ required: true, message: '请输入设备编码', trigger: 'blur' }
],
LOT: [
{ required: true, message: '请输入LOT', trigger: 'blur' }
],
createBy: [
{ required: true, message: '请输入申请人', trigger: 'blur' }
]
},
deptOptions: []
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next()
},
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { this.init()
const { searchParams } = this.$store.getters; const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.queryParams = { ...param }
}
this.getList()
}, },
methods: { methods: {
/** 查询角色列表 */ // 重置
getList() { resetFrom() {
this.loading = true
this.roleList = this.simulateDeviceList
console.log(this.roleList)
this.loading = false
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
// TODO: 将模拟数据的空对象赋值给表单对象,达成清空填写表单的效果
this.form = { this.form = {
deviceName: '', pn: '',
deviceId: '', lot: '',
location: '', plocation: '',
ply: '', phd: '',
state: '', psm: '',
flag: '1', pzl: '',
createTime: new Date(), prank: ''
updataTime: new Date(),
createBy: ''
}
},
/** TODO: 查询按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** TODO: 重置按钮操作 */
resetQuery() {},
// 多选框选中数据
handleSelectionChange(selection) {},
/** TODO: 新增按钮操作 */
handleAdd() {
// TODO: 初始化新增对话框的状态
this.reset()
this.title = '申请领用设备'
this.open = !this.open
},
// TODO: 获取所选行详情信息操作
handleDetail(row) {
this.singleDetails = this.formReset
this.singleDetails = row
this.title = '详情信息'
this.openDetails = !this.openDetails
},
/** TODO: 修改按钮操作 */
handleUpdate(row) {
this.reset()
this.title = '修改申请'
const upddeviceName = row.deviceName
for (const pd of this.simulateDeviceList) {
if (pd.deviceName === upddeviceName) {
this.form = pd
}
} }
this.open = true this.$refs.form.clearValidate()
},
/** TODO: 修改或增加list列表里的数据 */
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
// TODO: 模拟测试数据的修改,可删除
for (const p of this.simulateDeviceList) {
if (p.deviceName === this.form.deviceName) {
this.simulateDeviceList = this.simulateDeviceList.map(obj =>
obj.deviceName === this.form.deviceName ? this.form : obj
)
this.msgSuccess('申请成功')
this.getList()
this.reset()
this.open = !this.open
return
} else {
if (this.form !== undefined && this.form !== null) {
this.simulateDeviceList.push(this.form)
this.msgSuccess('申请成功')
this.getList()
this.reset()
this.open = !this.open
return
}
}
}
}
})
}, },
// 初始化要调的接口
/** TODO: 关于模拟数据的 删除list数组所调用的删除方法,封装的函数如下 */ init() {
delDevice(delDeviceName) { this.getDict()
let tip = false
for (const pd0 of this.simulateDeviceList) {
console.log('This is pd0:', pd0)
if (pd0.deviceName === delDeviceName) {
this.simulateDeviceList = this.simulateDeviceList.filter(item => item.deviceName !== delDeviceName)
tip = true
break
}
}
return tip
}, },
/** TODO:删除按钮操作 */ // 提交时要调的接口
handleDelete(row) { submitForm() {
this.$confirm('是否确认操作', '提示', { this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
return this.delDevice(row.deviceName) this.$refs.form.validate((valid) => {
}).then(() => { if (valid) {
this.getList() console.log('form', this.form)
this.$message({ // 校验通过,提交表单或进行其他操作
message: '删除成功', if (this.form.businessId !== undefined) {
type: 'success' updatadevice(this.form).then(res => {
}) if (res.code === 200) {
}).catch(() => { this.open = false
this.$message({ this.$message.success('操作成功')
type: 'info', this.resetFrom()
message: '已取消删除' } else if (res.code === null) {
this.$message.error(res.message)
}
})
} else {
add(this.form).then(res => {
if (res.code === 200) {
this.open = false
this.$message.success('操作成功')
this.resetFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
})
}
} else {
// 校验失败,显示错误信息或进行其他操作
}
}) })
}) })
},
// 调数据字典查询
getDict() {
} }
} }
} }
</script> </script>
...@@ -451,38 +152,20 @@ export default { ...@@ -451,38 +152,20 @@ export default {
font-size: 18px; font-size: 18px;
padding: 0; padding: 0;
.placeholder { .info{
height: 1.3vh; height: 100px;
background-color: #F4F4F4; display: flex;
margin-bottom: 10px align-items: center;
} justify-content: center;
.title{
.table-drop { color: #333;
vertical-align: 2px; font-weight: 700;
line-height: 20px;
margin-left: 15px
}
.el-switch {
margin-left: 15px;
}
}
.el-divider--vertical{
height: 12em;
width: 4px;
}
.aboutSingleDetails{
.el-form-item{
.el-input >>> .el-input__inner {
-webkit-appearance: none;
background-color: #FFF;
background-image: none;
border-radius: 4px;
border: 0;
width: 100%;
} }
} }
.button{
margin-top: 7%;
margin-left: 11%;
}
} }
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
<div class="mb12 font-small-bold">设备管理列表</div> <div class="mb12 font-small-bold">设备管理列表</div>
<el-table v-loading="loading" border :data="equipmentList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="80" /> <el-table-column type="index" label="序号" width="80" />
<el-table-column label="pn" prop="businessId" width="120"> <el-table-column label="pn" prop="businessId">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.pn || '-' }} {{ scope.row.pn || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="lot" prop="lot" width="120"> <el-table-column label="lot" prop="lot">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lot || '-' }} {{ scope.row.lot || '-' }}
</template> </template>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="80px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)"> <el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)">
详情 详情
...@@ -167,19 +167,19 @@ ...@@ -167,19 +167,19 @@
<el-form-item label="parnk:" prop="prank"> <el-form-item label="parnk:" prop="prank">
<el-input v-model.trim="singleDetails.prank" :readonly="true" /> <el-input v-model.trim="singleDetails.prank" :readonly="true" />
</el-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="createName">
<el-input v-model.trim="singleDetails.createName" :readonly="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="true" />
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="createName">
<el-input v-model.trim="singleDetails.createName" :readonly="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="true" />
</el-form-item>
</el-col>
</el-row>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -305,8 +305,9 @@ export default { ...@@ -305,8 +305,9 @@ export default {
pn: undefined, pn: undefined,
lot: undefined, lot: undefined,
plocation: undefined, plocation: undefined,
pstatus: 1, pstatus: 0,
ptype: 1 ptype: 1,
delFlag: 0
}, },
// 表单参数 // 表单参数
form: { form: {
......
...@@ -35,21 +35,21 @@ ...@@ -35,21 +35,21 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="padding:5px 10px"> <div style="padding:5px 10px">
<div class="mb12 font-small-bold">设备管理列表</div> <div class="mb12 font-small-bold">工序库列表</div>
<el-table v-loading="loading" border :data="equipmentList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="80" /> <el-table-column type="index" label="序号" width="80" />
<el-table-column label="pn" prop="businessId" width="120"> <el-table-column label="pn" prop="businessId">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.pn || '-' }} {{ scope.row.pn || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="lot" prop="lot" width="120"> <el-table-column label="lot" prop="lot">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lot || '-' }} {{ scope.row.lot || '-' }}
</template> </template>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="80px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)"> <el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)">
详情 详情
...@@ -176,19 +176,19 @@ ...@@ -176,19 +176,19 @@
<el-form-item label="parnk:" prop="prank"> <el-form-item label="parnk:" prop="prank">
<el-input v-model.trim="singleDetails.prank" :readonly="true" /> <el-input v-model.trim="singleDetails.prank" :readonly="true" />
</el-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="createName">
<el-input v-model.trim="singleDetails.createName" :readonly="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="true" />
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="createName">
<el-input v-model.trim="singleDetails.createName" :readonly="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="true" />
</el-form-item>
</el-col>
</el-row>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -314,8 +314,9 @@ export default { ...@@ -314,8 +314,9 @@ export default {
pn: undefined, pn: undefined,
lot: undefined, lot: undefined,
plocation: undefined, plocation: undefined,
pstatus: 1, pstatus: 0,
ptype: 2 ptype: 2,
delFlag: 0
}, },
// 表单参数 // 表单参数
form: { form: {
......
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
{{ scope.row.createName || '-' }} {{ scope.row.createName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime" width="200px"> <el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="updateDate" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.updateDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
......
...@@ -128,7 +128,15 @@ ...@@ -128,7 +128,15 @@
/> />
<!-- TODO: 单项详情信息表单配置 --> <!-- TODO: 单项详情信息表单配置 -->
<el-dialog class="aboutSingleDetails" :title="title" :visible.sync="openDetails" :close-on-click-modal="false" width="800px" append-to-body> <el-dialog
class="aboutSingleDetails"
:title="title"
:visible.sync="openDetails"
:close-on-click-modal="false"
width="800px"
append-to-body
@closed="handleClose"
>
<el-form ref="formDetails" :model="singleDetails" size="small" label-width="90px"> <el-form ref="formDetails" :model="singleDetails" size="small" label-width="90px">
<el-row :gutter="10" justify="start" align="middle"> <el-row :gutter="10" justify="start" align="middle">
...@@ -142,9 +150,6 @@ ...@@ -142,9 +150,6 @@
<el-form-item label="plocation:" prop="plocation"> <el-form-item label="plocation:" prop="plocation">
<el-input v-model.trim="singleDetails.plocation" :readonly="isReadOnly" /> <el-input v-model.trim="singleDetails.plocation" :readonly="isReadOnly" />
</el-form-item> </el-form-item>
<el-form-item label="操作员:" prop="user">
<el-input v-model.trim="singleDetails.user" :readonly="isReadOnly" />
</el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -154,36 +159,60 @@ ...@@ -154,36 +159,60 @@
<el-form-item label="库状态:" prop="poperate"> <el-form-item label="库状态:" prop="poperate">
{{ selectedPoperate(singleDetails.poperate) }} {{ selectedPoperate(singleDetails.poperate) }}
</el-form-item> </el-form-item>
<el-form-item label="fqYs:" prop="fqYs">
{{ singleDetails.fqYs }}
</el-form-item>
<el-form-item label="操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="isReadOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row v-if=" singleDetails.poperate==='4' ">
<el-col :span="12">
<el-form-item label="创建人:" prop="createBy">
<el-input v-model.trim="singleDetails.createBy" :readonly="isReadOnly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="isReadOnly" />
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> <!-- TODO: 这里是 库状态为废弃时才会触发显示的模块 -->
<transition name="fade-transform" mode="out-in">
<el-row v-if=" activateAbandonedState " style="height: 160px">
<el-col :span="12">
<el-form-item label="fq_ys:" prop="fq_ys">
{{ singleDetails.fq_ys }}
</el-form-item>
<el-form-item label="fq_bz:" prop="fq_bz">
{{ singleDetails.fq_bz }}
</el-form-item>
<el-form-item label="fq_dbxi:" prop="fq_dbxi">
{{ singleDetails.fq_dbxi }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="fq_dd:" prop="fq_dd">
{{ singleDetails.fq_dd }}
</el-form-item>
<el-form-item label="fq_mcode:" :label-width="10" prop="fq_mcode">
{{ singleDetails.fq_mcode }}
</el-form-item>
<el-form-item label="fq_yy:" prop="fq_yy">
{{ singleDetails.fq_yy }}
</el-form-item>
</el-col>
</el-row>
<transition />
<el-row>
<el-col :span="12">
<el-form-item label="操作员:" prop="userName">
<el-input v-model.trim="singleDetails.userName" :readonly="isReadOnly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="操作时间:" prop="createDate">
<el-input v-model.trim="singleDetails.createDate" :readonly="isReadOnly" />
</el-form-item>
</el-col>
</el-row>
</transition></el-form>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listLog } from '@/api/processLibrary/InventoryRecord' import { listLog, findSingleLogDetail } from '@/api/processMangement/InventoryRecord'
import BaseTable from '@/components/Table/BaseTable/index.vue' import BaseTable from '@/components/Table/BaseTable/index.vue'
export default { export default {
...@@ -225,10 +254,10 @@ export default { ...@@ -225,10 +254,10 @@ export default {
label: '出库' label: '出库'
}, },
{ {
value: '1', value: '3',
label: '修正' label: '修正'
}, { }, {
value: '2', value: '4',
label: '废弃' label: '废弃'
} }
], ],
...@@ -273,8 +302,8 @@ export default { ...@@ -273,8 +302,8 @@ export default {
return true return true
} }
}, },
// column列,columType(列类型,可选text(默认为普通文字模式),input(input可编辑框),switch(switch开关),image(图片),operation(操作按钮)) // TODO: column列,columType(列类型,可选text(默认为普通文字模式),input(input可编辑框),switch(switch开关),image(图片),operation(操作按钮))
// prop(参数),label(列名),width(宽度),align(对齐方式),sortable(是否支持排序) // TODO: :prop(参数),label(列名),width(宽度),align(对齐方式),sortable(是否支持排序)
columnData: [ columnData: [
{ {
text: true, text: true,
...@@ -312,7 +341,7 @@ export default { ...@@ -312,7 +341,7 @@ export default {
}, },
{ {
text: true, text: true,
prop: 'user', prop: 'userName',
label: '操作员', label: '操作员',
sortable: false, sortable: false,
width: '150px' width: '150px'
...@@ -346,20 +375,10 @@ export default { ...@@ -346,20 +375,10 @@ export default {
openDetails: false, openDetails: false,
isReadOnly: true, isReadOnly: true,
// TODO: 表单里的单项详情参数 // TODO: 表单里的单项详情参数
singleDetails: { singleDetails: {},
pn: '', // TODO: 获取表单单项详情的参数
lot: '', singleLogIdAndFqYs: {},
ptype: '', activateAbandonedState: false
poperate: '',
plocation: '',
remarks: '',
fqYs: '',
user: '',
createBy: '',
updateBy: '',
createDate: '',
updateDate: ''
}
} }
}, },
computed: { computed: {
...@@ -378,7 +397,7 @@ export default { ...@@ -378,7 +397,7 @@ export default {
return { return {
listName: '出入库记录列表', listName: '出入库记录列表',
loading: this.loading, loading: this.loading,
processList: this.inventoryRecordList, List: this.inventoryRecordList,
queryParams: this.queryParams, queryParams: this.queryParams,
columObj: this.columObj columObj: this.columObj
} }
...@@ -437,14 +456,7 @@ export default { ...@@ -437,14 +456,7 @@ export default {
return '' return ''
} }
}, },
handleClose() {
this.clearVisible = false
this.exportVisible = false
},
// 登录状态字典翻译
// statusFormat(row, column) {
// return this.selectDictLabel(this.statusOptions, row.status)
// },
/** TODO: 查询按钮操作 */ /** TODO: 查询按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.page = 1 this.queryParams.page = 1
...@@ -456,10 +468,40 @@ export default { ...@@ -456,10 +468,40 @@ export default {
this.handleQuery() this.handleQuery()
}, },
/* TODO: 控制单项表单关闭的详情 */
handleClose() {
this.activateAbandonedState = false
this.singleLogIdAndFqYs = {}
},
/* TODO: 获取详情信息*/
handleDetail: function(row) { handleDetail: function(row) {
console.log('success!') /* TODO: 如果库状态为‘废弃’,即为‘4’时,则可以进入 */
if (row.poperate !== '4') {
this.singleDetails = { ...row }
} else {
/* TODO: 设置单项详情的查询的条件 */
this.singleLogIdAndFqYs['businessId'] = row.businessId
this.singleLogIdAndFqYs['fqYs'] = row.fqYs
/* TODO: 进行查询,如果返回的code为200,则表示返回的值成功 */
findSingleLogDetail(this.singleLogIdAndFqYs).then(
response => {
if (response.code === 200) {
this.singleDetails = Object.assign({}, response.data, { ...row })
/* TODO: 如果库状态==='4' 并且返回的状态码为200的时候,才会将可变的详情字段设置为true,去激活并打开 */
this.activateAbandonedState = true
} else {
/* TODO: 如果状态码不对则不会激活可变字段,并且抛出错误信息response.message */
this.$message({
showClose: true,
message: response.message,
type: 'warning'
})
this.singleDetails = { ...row }
}
}
)
}
this.title = '记录详情' this.title = '记录详情'
this.singleDetails = { ...row }
this.openDetails = true this.openDetails = true
} }
} }
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<script> <script>
import { queryList, add, getDetailById, updataInfo, deleteLogical } from '@/api/sample/basicInformation' import { queryList, add, getDetailById, updataInfo, deleteLogical } from '@/api/sample/basicInformation'
import {parseTime} from "@/utils"; import { parseTime } from "@/utils";
export default { export default {
name: 'Index', name: 'Index',
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
size="small" size="small"
/> />
</el-form-item> </el-form-item>
<el-form-item label="部门状态"> <!-- <el-form-item label="部门状态">-->
<el-select v-model="queryParams.flag" placeholder="请选择部门状态" clearable size="small"> <!-- <el-select v-model="queryParams.flag" placeholder="请选择部门状态" clearable size="small">-->
<el-option <!-- <el-option-->
v-for="dict in statusOptions" <!-- v-for="dict in statusOptions"-->
:key="dict.dictValue" <!-- :key="dict.dictValue"-->
:label="dict.dictLabel" <!-- :label="dict.dictLabel"-->
:value="dict.dictValue" <!-- :value="dict.dictValue"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button <el-button
style="padding: 8px 7px;" style="padding: 8px 7px;"
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['system:dept:edit']"--> <!-- v-hasPermi="['system:dept:edit']"-->
...@@ -222,7 +222,7 @@ export default { ...@@ -222,7 +222,7 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 状态数据字典 // 状态数据字典
statusOptions: [], // statusOptions: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
deptName: undefined, deptName: undefined,
...@@ -275,9 +275,9 @@ export default { ...@@ -275,9 +275,9 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
this.getDicts('sys_normal_disable'.toUpperCase()).then(response => { // this.getDicts('sys_normal_disable'.toUpperCase()).then(response => {
this.statusOptions = response.data // this.statusOptions = response.data
}) // })
}, },
methods: { methods: {
/** 查询部门列表 */ /** 查询部门列表 */
...@@ -317,9 +317,9 @@ export default { ...@@ -317,9 +317,9 @@ export default {
} }
}, },
// 字典状态字典翻译 // 字典状态字典翻译
statusFormat(row, column) { // statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.flag) // return this.selectDictLabel(this.statusOptions, row.flag)
}, // },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
......
...@@ -23,22 +23,22 @@ ...@@ -23,22 +23,22 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="flag"> <!-- <el-form-item label="状态" prop="flag">-->
<el-select <!-- <el-select-->
v-model="queryParams.flag" <!-- v-model="queryParams.flag"-->
placeholder="字典状态" <!-- placeholder="字典状态"-->
clearable <!-- clearable-->
size="small" <!-- size="small"-->
style="width: 200px" <!-- style="width: 200px"-->
> <!-- >-->
<el-option <!-- <el-option-->
v-for="dict in statusOptions" <!-- v-for="dict in statusOptions"-->
:key="dict.dictValue" <!-- :key="dict.dictValue"-->
:label="dict.dictLabel" <!-- :label="dict.dictLabel"-->
:value="dict.dictValue" <!-- :value="dict.dictValue"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
...@@ -52,12 +52,25 @@ ...@@ -52,12 +52,25 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> type="primary"
style="padding: 8px 7px;"
icon="el-icon-search"
size="small"
@click="handleQuery"
>搜索</el-button>
<el-button
style="padding: 8px 7px;"
icon="el-icon-refresh"
size="small"
@click="resetQuery"
>重置
</el-button>
</el-form-item> </el-form-item>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
size="small" size="small"
...@@ -66,9 +79,10 @@ ...@@ -66,9 +79,10 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="success" type="success"
icon="el-icon-edit" icon="el-icon-edit"
size="mini" size="small"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
>修改 >修改
...@@ -76,9 +90,10 @@ ...@@ -76,9 +90,10 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="small"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
>删除 >删除
...@@ -86,6 +101,7 @@ ...@@ -86,6 +101,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="success" type="success"
icon="el-icon-download" icon="el-icon-download"
size="small" size="small"
...@@ -161,8 +177,8 @@ ...@@ -161,8 +177,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
...@@ -174,14 +190,21 @@ ...@@ -174,14 +190,21 @@
<el-form-item label="字典类型" prop="dictType"> <el-form-item label="字典类型" prop="dictType">
<el-input v-model.trim="form.dictType" :maxlength="30" placeholder="请输入字典类型" /> <el-input v-model.trim="form.dictType" :maxlength="30" placeholder="请输入字典类型" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="flag"> <el-form-item label="状态" prop="flag">
<!-- <el-form-item label="状态" prop="flag">-->
<!-- <el-radio-group v-model="form.flag">-->
<!-- <el-radio-->
<!-- v-for="dict in statusOptions"-->
<!-- :key="dict.dictValue"-->
<!-- :label="dict.dictValue"-->
<!-- >{{ dict.dictLabel }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-radio-group v-model="form.flag"> <el-radio-group v-model="form.flag">
<el-radio <el-radio label="1">启用</el-radio>
v-for="dict in statusOptions" <el-radio label="0">停用</el-radio>
:key="dict.dictValue"
:label="dict.dictValue"
>{{ dict.dictLabel }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="父字典名称"> <el-form-item label="父字典名称">
...@@ -313,14 +336,14 @@ export default { ...@@ -313,14 +336,14 @@ export default {
title: '', title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 状态数据字典 // // 状态数据字典
statusOptions: [], // statusOptions: [],
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, page: 1,
pageSize: 10, rows: 10,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
flag: undefined flag: undefined
...@@ -364,9 +387,9 @@ export default { ...@@ -364,9 +387,9 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => { // this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data // this.statusOptions = response.data
}) // })
optionselect().then(response => { optionselect().then(response => {
this.options = response.data this.options = response.data
}) })
...@@ -419,9 +442,9 @@ export default { ...@@ -419,9 +442,9 @@ export default {
}) })
}, },
// 字典状态字典翻译 // 字典状态字典翻译
statusFormat(row, column) { // statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.flag) // return this.selectDictLabel(this.statusOptions, row.flag)
}, // },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
...@@ -442,7 +465,7 @@ export default { ...@@ -442,7 +465,7 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.page = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
......
...@@ -22,24 +22,15 @@ ...@@ -22,24 +22,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="角色状态" prop="flag">
<el-select
v-model="queryParams.flag"
placeholder="请选择角色状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button
style="padding: 8px 7px;"
type="primary"
icon="el-icon-search"
size="small"
@click="handleQuery">
查询
</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
...@@ -128,8 +119,8 @@ ...@@ -128,8 +119,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
...@@ -510,7 +501,7 @@ export default { ...@@ -510,7 +501,7 @@ export default {
}, },
/** 查询按钮操作 */ /** 查询按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.page = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
......
...@@ -22,22 +22,6 @@ ...@@ -22,22 +22,6 @@
style="width: 150px" style="width: 150px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="flag">
<el-select
v-model="queryParams.flag"
placeholder="请选择用户状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
......
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