fix: 新增车间区域管理
This commit is contained in:
@@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="输入名称或者描述搜索"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation/>
|
||||
</div>
|
||||
<crudOperation :permission="permission"/>
|
||||
</div>
|
||||
<!-- 表单渲染 -->
|
||||
<el-row :gutter="15">
|
||||
<!--角色管理-->
|
||||
<el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="17" style="margin-bottom: 10px">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">角色列表</span>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
:data="crud.data"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="username" label="用户名"/>
|
||||
<el-table-column show-overflow-tooltip prop="person_name" label="姓名"/>
|
||||
<el-table-column prop="name" label="部门"/>
|
||||
<!--<el-table-column show-overflow-tooltip prop="dept" label="部门">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.dept.name }}</div>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 菜单授权 -->
|
||||
<el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="7">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-tooltip class="item" effect="dark" content="选择指定角色分配菜单" placement="top">
|
||||
<span class="role-span">区域选择</span>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
v-permission="['admin','roles:edit']"
|
||||
:disabled="!showButton"
|
||||
:loading="menuLoading"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="saveMenu"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="product_area" label="区域" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudUserArea from '@/views/wms/basedata/product/userArea/userArea'
|
||||
import { getDepts, getDeptSuperior } from '@/views/system/dept/dept'
|
||||
import { getChild, getMenusTree } from '@/views/system/menu/menu'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
|
||||
const defaultForm = { id: null, name: null, depts: [], description: null, dataScope: '全部', level: 3 }
|
||||
export default {
|
||||
name: 'UserStor',
|
||||
components: { Treeselect, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '角色',
|
||||
url: 'api/userArea',
|
||||
crudMethod: { ...crudUserArea },
|
||||
optShow: { add: false, reset: false, edit: false, del: false }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
level: 3,
|
||||
currentId: 0, menuLoading: false, showButton: false,
|
||||
menus: [], menuIds: [], depts: [], deptDatas: [], // 多选时使用
|
||||
tableData: [{ 'product_area': 'A1' }, { 'product_area': 'A2' }, { 'product_area': 'A3' }, { 'product_area': 'A4' }, { 'product_area': 'LK' }, { 'product_area': 'B1' }, { 'product_area': 'B2' }, { 'product_area': 'B3' }, { 'product_area': 'B4' }, { 'product_area': 'BLK' }],
|
||||
currentRow: null,
|
||||
permission: {
|
||||
add: ['admin', 'roles:add'],
|
||||
edit: ['admin', 'roles:edit'],
|
||||
del: ['admin', 'roles:del']
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
],
|
||||
permission: [
|
||||
{ required: true, message: '请输入权限', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMenuDatas(node, resolve) {
|
||||
setTimeout(() => {
|
||||
getMenusTree(node.data.id ? node.data.id : 0).then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
},
|
||||
// 新增前初始化部门信息
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
this.deptDatas = []
|
||||
},
|
||||
// 编辑前初始化自定义数据权限的部门信息
|
||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||
this.deptDatas = []
|
||||
if (form.dataScope === '自定义') {
|
||||
this.getSupDepts(form.depts)
|
||||
}
|
||||
const _this = this
|
||||
form.depts.forEach(function(dept) {
|
||||
_this.deptDatas.push(dept.id)
|
||||
})
|
||||
},
|
||||
// 提交前做的操作
|
||||
[CRUD.HOOK.afterValidateCU](crud) {
|
||||
if (crud.form.dataScope === '自定义' && this.deptDatas.length === 0) {
|
||||
this.$message({
|
||||
message: '自定义数据权限不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
} else if (crud.form.dataScope === '自定义') {
|
||||
const depts = []
|
||||
this.deptDatas.forEach(function(data) {
|
||||
const dept = { id: data }
|
||||
depts.push(dept)
|
||||
})
|
||||
crud.form.depts = depts
|
||||
} else {
|
||||
crud.form.depts = []
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 触发单选
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.showButton = true
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.currentRow = val
|
||||
crudUserArea.queryUserArea(val).then(res => {
|
||||
res.forEach(row => {
|
||||
this.tableData.forEach(selected => {
|
||||
if (selected.product_area === row.product_area) {
|
||||
this.$refs.multipleTable.toggleRowSelection(selected, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
menuChange(menu) {
|
||||
// 获取该节点的所有子节点,id 包含自身
|
||||
getChild(menu.id).then(childIds => {
|
||||
// 判断是否在 menuIds 中,如果存在则删除,否则添加
|
||||
if (this.menuIds.indexOf(menu.id) !== -1) {
|
||||
for (let i = 0; i < childIds.length; i++) {
|
||||
const index = this.menuIds.indexOf(childIds[i])
|
||||
if (index !== -1) {
|
||||
this.menuIds.splice(index, 1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < childIds.length; i++) {
|
||||
const index = this.menuIds.indexOf(childIds[i])
|
||||
if (index === -1) {
|
||||
this.menuIds.push(childIds[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.menu.setCheckedKeys(this.menuIds)
|
||||
})
|
||||
},
|
||||
// 保存菜单
|
||||
saveMenu() {
|
||||
const row = {}
|
||||
row.jo = this.currentRow
|
||||
row.rows = this.$refs.multipleTable.selection
|
||||
crudUserArea.save(row).then(res => {
|
||||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
// 改变数据
|
||||
update() {
|
||||
// 无刷新更新 表格数据
|
||||
crudRoles.get(this.currentId).then(res => {
|
||||
for (let i = 0; i < this.crud.data.length; i++) {
|
||||
if (res.id === this.crud.data[i].id) {
|
||||
this.crud.data[i] = res
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取部门数据
|
||||
getDepts() {
|
||||
getDepts({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
getSupDepts(depts) {
|
||||
const ids = []
|
||||
depts.forEach(dept => {
|
||||
ids.push(dept.id)
|
||||
})
|
||||
getDeptSuperior(ids).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
})
|
||||
},
|
||||
buildDepts(depts) {
|
||||
depts.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildDepts(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 200)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 如果数据权限为自定义则获取部门数据
|
||||
changeScope() {
|
||||
if (this.form.dataScope === '自定义') {
|
||||
this.getDepts()
|
||||
}
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.level >= this.level
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.role-span {
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
font-size: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
::v-deep .vue-treeselect__multi-value {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
::v-deep .vue-treeselect__multi-value-item {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function queryStor(data) {
|
||||
return request({
|
||||
url: '/api/userArea/queryStor',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryUserArea(data) {
|
||||
return request({
|
||||
url: '/api/userArea/queryUserArea',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/userArea/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getuserArea(data) {
|
||||
return request({
|
||||
url: '/api/userArea/getuserArea',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getSect(data) {
|
||||
return request({
|
||||
url: '/api/userArea/getSect',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { queryUserArea, queryStor, save, getuserArea, getSect }
|
||||
@@ -8,15 +8,16 @@
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
|
||||
<el-form-item :label="$t('RawFoil.search.product_area')">
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
size="mini"
|
||||
:placeholder="$t('common.Please_select')"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
@@ -28,33 +29,33 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('RawFoil.dialog.resource_name')">
|
||||
<el-form-item label="机台编码">
|
||||
<el-input
|
||||
v-model="query.resource_name"
|
||||
clearable
|
||||
size="mini"
|
||||
:placeholder="$t('RawFoil.dialog.resource_name')"
|
||||
placeholder="机台编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('RawFoil.dialog.container_name')">
|
||||
<!-- <label slot="label">母 卷 号:</label>-->
|
||||
<el-form-item label="母卷号">
|
||||
<label slot="label">母 卷 号:</label>
|
||||
<el-input
|
||||
v-model="query.container_name"
|
||||
clearable
|
||||
size="mini"
|
||||
:placeholder="$t('RawFoil.dialog.container_name')"
|
||||
placeholder="母卷号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('RawFoil.search.status')">
|
||||
<el-form-item label="工单状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
size="mini"
|
||||
:placeholder="$t('RawFoil.search.status')"
|
||||
placeholder="工单状态"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
@@ -66,13 +67,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('RawFoil.search.createTime')">
|
||||
<el-form-item label="工单日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
:start-placeholder="$t('common.startDate')"
|
||||
:end-placeholder="$t('common.endDate')"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
@@ -92,7 +93,7 @@
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="compelEnd"
|
||||
>
|
||||
{{ $t('RawFoil.search.button_end') }}
|
||||
强制结束
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
@@ -103,7 +104,7 @@
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="weigh"
|
||||
>
|
||||
{{ $t('RawFoil.search.button_weight') }}
|
||||
称重
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
@@ -112,17 +113,17 @@
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
:width="computedLabelWidth"
|
||||
width="800px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" :label-width="computedFormLabelWidth">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.container_name')" prop="container_name">
|
||||
<el-form-item label="母卷号" prop="container_name">
|
||||
<el-input v-model="form.container_name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.resource_name')" prop="resource_name">
|
||||
<el-form-item label="机台编码" prop="resource_name">
|
||||
<el-input v-model="form.resource_name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -130,12 +131,12 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.mfg_order_name')" prop="mfg_order_name">
|
||||
<el-form-item label="生产工单" prop="mfg_order_name">
|
||||
<el-input v-model="form.mfg_order_name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.product_name')" prop="product_name">
|
||||
<el-form-item label="产品编码" prop="product_name">
|
||||
<el-input v-model="form.product_name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -143,12 +144,12 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.description')" prop="description">
|
||||
<el-form-item label="产品名称" prop="description">
|
||||
<el-input v-model="form.description" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.theory_height')" prop="theory_height">
|
||||
<el-form-item label="理论长度" prop="theory_height">
|
||||
<el-input v-model="form.theory_height" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -156,17 +157,17 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.eqp_velocity')" prop="eqp_velocity">
|
||||
<el-form-item label="设备生产速度" prop="eqp_velocity">
|
||||
<el-input v-model="form.eqp_velocity" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.up_coiler_date')" prop="up_coiler_date">
|
||||
<el-form-item label="上卷开始时间" prop="up_coiler_date">
|
||||
<!-- <el-date-picker v-model="form.up_coiler_date" type="date" placeholder="选择日期" style="width: 250px" value-format="yyyy-MM-dd" />-->
|
||||
<el-date-picker
|
||||
v-model="form.up_coiler_date"
|
||||
type="datetime"
|
||||
:placeholder="$t('common.Tip18')"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 250px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
default-time="12:00:00"
|
||||
@@ -177,12 +178,12 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.productin_qty')">
|
||||
<el-form-item label="重量">
|
||||
<el-input v-model="form.productin_qty" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.agvno')">
|
||||
<el-form-item label="车号">
|
||||
<el-input v-model="form.agvno" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -190,22 +191,22 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.remark')">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('RawFoil.dialog.is_reload_send')">
|
||||
<el-radio v-model="form.is_reload_send" label="0">{{ $t('common.No') }}</el-radio>
|
||||
<el-radio v-model="form.is_reload_send" label="1">{{ $t('common.Yes') }}</el-radio>
|
||||
<el-form-item label="是否重新更新">
|
||||
<el-radio v-model="form.is_reload_send" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_reload_send" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">{{ $t('common.Cancel') }}</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('common.Confirm') }}</el-button>
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -219,86 +220,22 @@
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="workorder_id" label="工单标识" />
|
||||
<el-table-column
|
||||
prop="mfg_order_name"
|
||||
:label="$t('RawFoil.table.mfg_order_name')"
|
||||
:min-width="flexWidth('mfg_order_name', crud.data, $t('RawFoil.table.mfg_order_name'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
:label="$t('RawFoil.table.status')"
|
||||
:min-width="flexWidth('status', crud.data, $t('RawFoil.table.status'), 5)"
|
||||
:formatter="formatStatusName"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="container_name"
|
||||
:label="$t('RawFoil.table.container_name')"
|
||||
:min-width="flexWidth('container_name',crud.data,$t('RawFoil.table.container_name'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="point_code2"
|
||||
:label="$t('RawFoil.table.point_code2')"
|
||||
:min-width="flexWidth('point_code2',crud.data,$t('RawFoil.table.point_code2'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="resource_name"
|
||||
:label="$t('RawFoil.table.resource_name')"
|
||||
:min-width="flexWidth('resource_name',crud.data,$t('RawFoil.table.resource_name'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="product_name"
|
||||
:label="$t('RawFoil.table.product_name')"
|
||||
:min-width="flexWidth('product_name',crud.data,$t('RawFoil.table.product_name'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="theory_height"
|
||||
:label="$t('RawFoil.table.theory_height')"
|
||||
:min-width="flexWidth('theory_height',crud.data,$t('RawFoil.table.theory_height'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realstart_time"
|
||||
:label="$t('RawFoil.table.realstart_time')"
|
||||
:min-width="flexWidth('realstart_time',crud.data,$t('RawFoil.table.realstart_time'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realend_time"
|
||||
:label="$t('RawFoil.table.realend_time')"
|
||||
:min-width="flexWidth('realend_time',crud.data,$t('RawFoil.table.realend_time'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="productin_qty"
|
||||
:label="$t('RawFoil.table.productin_qty')"
|
||||
:min-width="flexWidth('productin_qty',crud.data,$t('RawFoil.table.productin_qty'))"
|
||||
:formatter="crud.formatNum3"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="agvno"
|
||||
:label="$t('RawFoil.table.agvno')"
|
||||
:min-width="flexWidth('agvno',crud.data,$t('RawFoil.table.agvno'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="product_area"
|
||||
:label="$t('RawFoil.table.product_area')"
|
||||
:min-width="flexWidth('product_area',crud.data,$t('RawFoil.table.product_area'))"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="is_baking"
|
||||
:label="$t('RawFoil.table.is_baking')"
|
||||
:min-width="flexWidth('is_baking',crud.data,$t('RawFoil.table.is_baking'))"
|
||||
:formatter="formatBakeIsOrNot"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="is_instor"
|
||||
:label="$t('RawFoil.table.is_instor')"
|
||||
:min-width="flexWidth('is_instor',crud.data,$t('RawFoil.table.is_instor'))"
|
||||
:formatter="formatStorIsOrNot"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="update_time"
|
||||
:label="$t('RawFoil.table.update_time')"
|
||||
:min-width="flexWidth('update_time',crud.data,$t('RawFoil.table.update_time'))"
|
||||
/>
|
||||
<el-table-column v-permission="[]" :label="$t('common.Operate')" width="160px" align="center" fixed="right">
|
||||
<el-table-column prop="mfg_order_name" label="工单号" :min-width="flexWidth('mfg_order_name',crud.data,'工单号')" />
|
||||
<el-table-column prop="status" label="工单状态" :min-width="flexWidth('status',crud.data,'工单状态')" :formatter="formatStatusName" />
|
||||
<el-table-column prop="container_name" label="母卷号" :min-width="flexWidth('container_name',crud.data,'母卷号')" />
|
||||
<el-table-column prop="point_code2" label="点位编码" :min-width="flexWidth('point_code2',crud.data,'点位编码')" />
|
||||
<el-table-column prop="resource_name" label="机台编码" :min-width="flexWidth('resource_name',crud.data,'机台编码')" />
|
||||
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品编码')" />
|
||||
<el-table-column prop="theory_height" label="理论长度" :min-width="flexWidth('theory_height',crud.data,'理论长度')" />
|
||||
<el-table-column prop="realstart_time" label="开始时间" :min-width="flexWidth('realstart_time',crud.data,'开始时间')" />
|
||||
<el-table-column prop="realend_time" label="结束时间" :min-width="flexWidth('realend_time',crud.data,'结束时间')" />
|
||||
<el-table-column prop="productin_qty" label="重量" :min-width="flexWidth('productin_qty',crud.data,'重量')" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="agvno" label="车号" :min-width="flexWidth('agvno',crud.data,'车号')" />
|
||||
<el-table-column prop="product_area" label="生产区域" :min-width="flexWidth('product_area',crud.data,'生产区域')" />
|
||||
<el-table-column prop="is_baking" label="请求烘烤" :min-width="flexWidth('is_baking',crud.data,'请求烘烤')" :formatter="formatBakeIsOrNot" />
|
||||
<el-table-column prop="is_instor" label="请求入半成品库" :min-width="flexWidth('is_instor',crud.data,'请求入半成品库')" :formatter="formatStorIsOrNot" />
|
||||
<el-table-column prop="update_time" label="更新时间" :min-width="flexWidth('update_time',crud.data,'更新时间')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
@@ -324,7 +261,6 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
const defaultForm = {
|
||||
workorder_id: null,
|
||||
@@ -359,7 +295,7 @@ export default {
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: i18n.t('RawFoil.title'),
|
||||
title: '生箔工序工单',
|
||||
url: 'api/rawfoilworkorder',
|
||||
idField: 'workorder_id',
|
||||
sort: 'workorder_id,desc',
|
||||
@@ -379,52 +315,30 @@ export default {
|
||||
openParam: null,
|
||||
permission: {},
|
||||
rules: {
|
||||
container_name: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m2'), trigger: 'blur' }
|
||||
],
|
||||
resource_name: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m3'), trigger: 'blur' }
|
||||
{ required: true, message: '机台编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
mfg_order_name: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m4'), trigger: 'blur' }
|
||||
{ required: true, message: '生产工单不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_name: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m5'), trigger: 'blur' }
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m6'), trigger: 'blur' }
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
theory_height: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m7'), trigger: 'blur' }
|
||||
{ required: true, message: '理论长度不能为空', trigger: 'blur' }
|
||||
],
|
||||
eqp_velocity: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m8'), trigger: 'blur' }
|
||||
{ required: true, message: '设备生产速度不能为空', trigger: 'blur' }
|
||||
],
|
||||
p_coiler_date: [
|
||||
{ required: true, message: i18n.t('RawFoil.msg.m9'), trigger: 'blur' }
|
||||
{ required: true, message: '上卷开始时间不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
computedLabelWidth() {
|
||||
const item = localStorage.getItem('lang')
|
||||
if (item === 'in') {
|
||||
return `900px`
|
||||
}
|
||||
return `800px`
|
||||
},
|
||||
computedFormLabelWidth() {
|
||||
const item = localStorage.getItem('lang')
|
||||
if (item === 'zh') {
|
||||
return `110px`
|
||||
}
|
||||
if (item === 'in') {
|
||||
return `170px`
|
||||
}
|
||||
return `130px`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
@@ -446,11 +360,11 @@ export default {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
if (data.status === '09') {
|
||||
return this.crud.notify(i18n.t('RawFoil.msg.m1'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return this.crud.notify('不能对完成状态的工单强制结束', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudRawfoilworkorder.compelEnd(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify(i18n.t('common.Operation_success'), CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
weigh() {
|
||||
|
||||
Reference in New Issue
Block a user