代码更新
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/dcBaseDevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/dcBaseDevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/dcBaseDevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getItemByDeviceTypeId(data) {
|
||||
return request({
|
||||
url: 'api/dcBaseDevice/getItemByDeviceTypeId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/dcBaseDevice/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getItemByDeviceTypeId, changeActive }
|
||||
@@ -1,42 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/devicetype',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/devicetype/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/devicetype',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getWorksection() {
|
||||
return request({
|
||||
url: 'api/devicetype/getWorksection',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/devicetype/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getWorksection, changeActive }
|
||||
@@ -1,59 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/item',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/item/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/item',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceTypeBySection(data) {
|
||||
return request({
|
||||
url: 'api/item/getDeviceTypeBySection',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDtlByDevicetypeId(data) {
|
||||
return request({
|
||||
url: 'api/item/getDtlByDevicetypeId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveItem(data) {
|
||||
return request({
|
||||
url: 'api/item/saveItem',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/item/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDeviceTypeBySection, getDtlByDevicetypeId, saveItem, changeActive }
|
||||
@@ -1,35 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/worksection',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/worksection/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/worksection',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/worksection/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive }
|
||||
@@ -1,27 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/acsDeviceErpmapping',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/acsDeviceErpmapping/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/acsDeviceErpmapping',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -1,82 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/produceline',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/produceline/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/produceline',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/produceline/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getWorkprocedure(data) {
|
||||
return request({
|
||||
url: '/api/produceline/queryWorkProcedureListByLineId',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryWorkProcedureDeviceListByLineId(data) {
|
||||
return request({
|
||||
url: '/api/produceline/queryWorkProcedureDeviceListByLineId',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveWorkProcedureDevice1(data) {
|
||||
return request({
|
||||
url: '/api/produceline/saveWorkProcedureDevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveWorkProcedure(data) {
|
||||
return request({
|
||||
url: '/api/produceline/saveWorkProcedure',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getWorkprocedureByLineId(data) {
|
||||
return request({
|
||||
url: '/api/produceline/getWorkprocedureByLineId',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getWorkprocedureDeviceTypeList(data) {
|
||||
return request({
|
||||
url: '/api/produceline/getWorkprocedureDeviceTypeList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive }
|
||||
@@ -46,12 +46,6 @@ export function getDevice1() {
|
||||
})
|
||||
}
|
||||
|
||||
export function getProduceline() {
|
||||
return request({
|
||||
url: 'api/producetask/getProduceline',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getCust() {
|
||||
return request({
|
||||
@@ -114,4 +108,4 @@ export function synchro(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMaterial, getDevice, getProduceline, getCust, getWorkprocedure, excelImport, getDevice1, copyAdd, sortUpdate, mandFinish, issued, synchro }
|
||||
export default { add, edit, del, getMaterial, getDevice, getCust, getWorkprocedure, excelImport, getDevice1, copyAdd, sortUpdate, mandFinish, issued, synchro }
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入设备编码或名称"
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<label class="el-form-item-label">工段类型</label>
|
||||
<el-select v-model="search_section_id" size="small" placeholder="所属工段" class="filter-item" style="width: 220px" @change="getDeviceTypeBySection1(search_section_id)">
|
||||
<el-option
|
||||
v-for="item in worksectionList"
|
||||
:key="item.worksection_id"
|
||||
:label="item.worksection_name"
|
||||
:value="item.worksection_id"
|
||||
/>
|
||||
</el-select>
|
||||
<label class="el-form-item-label">设备类型</label>
|
||||
|
||||
<el-select v-model="query.devicetype_id" size="small" placeholder="设备类型" class="filter-item" style="width: 220px" @change="changeDeviceType">
|
||||
<el-option
|
||||
v-for="item in devicetypeList1"
|
||||
:key="item.devicetype_id"
|
||||
:label="item.devicetype_name"
|
||||
:value="item.devicetype_id"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="540px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 270px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="device_name">
|
||||
<el-input v-model="form.device_name" style="width: 270px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工段" prop="section_id">
|
||||
<el-select v-model="form.section_id" filterable clearable size="small" placeholder="所属工段" class="filter-item" style="width: 270px" @change="getDeviceTypeBySection(form.section_id)">
|
||||
<el-option
|
||||
v-for="item in worksectionList"
|
||||
:key="item.worksection_id"
|
||||
:label="item.worksection_name"
|
||||
:value="item.worksection_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="devicetype_id">
|
||||
<el-select v-model="form.devicetype_id" filterable clearable size="small" placeholder="设备类型" class="filter-item" style="width: 270px">
|
||||
<el-option
|
||||
v-for="item in devicetypeList"
|
||||
:key="item.devicetype_id"
|
||||
:label="item.devicetype_name"
|
||||
:value="item.devicetype_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<label slot="label">备 注</label>
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 270px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<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>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
<el-table-column prop="devicetype_name" label="设备类型" />
|
||||
<el-table-column prop="worksection_name" label="所属工段" />
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDcBaseDevice from '@/api/wms/dc/dcBaseDevice'
|
||||
import CRUD, { presenter, header, form, crud } 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 crudItem from '@/api/wms/dc/item'
|
||||
import crudDevicetype from '@/api/wms/dc/devicetype'
|
||||
|
||||
const defaultForm = { device_id: null, device_code: null, device_name: null, is_used: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, devicetype_id: null, section_id: null }
|
||||
export default {
|
||||
name: 'DcBaseDevice',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '采集设备', url: 'api/dcBaseDevice', idField: 'device_id', sort: 'device_id,desc', optShow: { add: true, edit: false, del: false, download: false, reset: false }, crudMethod: { ...crudDcBaseDevice }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
devicetypeList: [],
|
||||
devicetypeList1: [],
|
||||
worksectionList: [],
|
||||
search_section_id: '',
|
||||
tableLabel: [],
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_name: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
devicetype_id: [
|
||||
{ required: true, message: '数据采集设备类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
section_id: [
|
||||
{ required: true, message: '所属工段不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorksection()
|
||||
},
|
||||
methods: {
|
||||
changeDeviceType() {
|
||||
this.$forceUpdate()
|
||||
this.getHeader()
|
||||
this.crud.toQuery()
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
crudItem.getDeviceTypeBySection({ section_id: this.form.section_id }).then(res => {
|
||||
this.devicetypeList = res
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader()
|
||||
return true
|
||||
},
|
||||
getHeader() {
|
||||
crudDcBaseDevice.getItemByDeviceTypeId({ devicetype_id: this.query.devicetype_id }).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
getDeviceTypeBySection(section_id) {
|
||||
this.form.devicetype_id = ''
|
||||
crudItem.getDeviceTypeBySection({ section_id: section_id }).then(res => {
|
||||
this.devicetypeList = res
|
||||
})
|
||||
},
|
||||
getDeviceTypeBySection1(section_id) {
|
||||
this.query.devicetype_id = ''
|
||||
crudItem.getDeviceTypeBySection({ section_id: section_id }).then(res => {
|
||||
this.devicetypeList1 = res
|
||||
if (this.devicetypeList1.length !== 0) {
|
||||
this.query.devicetype_id = this.devicetypeList1[0].devicetype_id
|
||||
this.getHeader()
|
||||
this.crud.toQuery()
|
||||
} else {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
})
|
||||
},
|
||||
getWorksection() {
|
||||
crudDevicetype.getWorksection().then(res => {
|
||||
this.worksectionList = res
|
||||
this.search_section_id = this.worksectionList[0].worksection_id
|
||||
this.getDeviceTypeBySection1(this.search_section_id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,148 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.search" clearable placeholder="设备类型编码或名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-form-item label="设备类型编码" prop="devicetype_code">
|
||||
<el-input v-model="form.devicetype_code" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型名称 " prop="devicetype_name">
|
||||
<el-input v-model="form.devicetype_name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工段" prop="section_id">
|
||||
<el-select v-model="form.section_id" filterable clearable size="small" placeholder="所属工段" class="filter-item" style="width: 250px">
|
||||
<el-option
|
||||
v-for="item in worksectionList"
|
||||
:key="item.worksection_id"
|
||||
:label="item.worksection_name"
|
||||
:value="item.worksection_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<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>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="devicetype_code" label="设备类型编码" />
|
||||
<el-table-column prop="devicetype_name" label="设备类型名称 " />
|
||||
<el-table-column prop="worksection_name" label="所属工段" />
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDevicetype from '@/api/wms/dc/devicetype'
|
||||
import CRUD, { presenter, header, form, crud } 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'
|
||||
|
||||
const defaultForm = { devicetype_id: null, devicetype_code: null, devicetype_name: null, section_id: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_used: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Devicetype',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '设备类型', url: 'api/devicetype', idField: 'devicetype_id', sort: 'section_id,desc', optShow: { add: true, edit: true, del: true, download: false, reset: true }, crudMethod: { ...crudDevicetype }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
worksectionList: [],
|
||||
rules: {
|
||||
devicetype_code: [
|
||||
{ required: true, message: '设备类型编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
devicetype_name: [
|
||||
{ required: true, message: '设备类型名称 不能为空', trigger: 'blur' }
|
||||
],
|
||||
section_id: [
|
||||
{ required: true, message: '工段标识不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorksection()
|
||||
},
|
||||
methods: {
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudDevicetype.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getWorksection() {
|
||||
crudDevicetype.getWorksection().then(res => {
|
||||
this.worksectionList = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,304 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="项点维护"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="18" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="6" style="margin-bottom: 20px">
|
||||
<span style="float: right">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="saveButton('form')">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="closeButton">关闭</el-button>
|
||||
</el-form>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="工段类型" prop="worksection_id">
|
||||
<el-select v-model="form.worksection_id" filterable clearable size="small" placeholder="所属工段" class="filter-item" style="width: 250px" @change="getDeviceTypeBySection(form.worksection_id)">
|
||||
<el-option
|
||||
v-for="item in worksectionList"
|
||||
:key="item.worksection_id"
|
||||
:label="item.worksection_name"
|
||||
:value="item.worksection_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="devicetype_id">
|
||||
<el-select v-model="form.devicetype_id" filterable clearable size="small" placeholder="设备类型" class="filter-item" style="width: 250px" @change="getDtl">
|
||||
<el-option
|
||||
v-for="item in devicetypeList"
|
||||
:key="item.devicetype_id"
|
||||
:label="item.devicetype_name"
|
||||
:value="item.devicetype_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="crud-opts2" style="margin-top: 30px">
|
||||
<span class="role-span">新增项点</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-circle-plus"
|
||||
size="mini"
|
||||
@click="addItem"
|
||||
>
|
||||
新增项点
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
border
|
||||
:row-class-name="rowClassName"
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
>
|
||||
<el-table-column label="序号" align="center" prop="xh" width="60" />
|
||||
<el-table-column label="项点编码" width="230" prop="item_code">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_show === '1'">{{ scope.row.item_code }}</span>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="scope.row.item_code"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项点名称" width="230" prop="item_name">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_show === '1'">{{ scope.row.item_name }}</span>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="scope.row.item_name"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="acs项点编码" width="230" prop="acs_item_code">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_show === '1'">{{ scope.row.acs_item_code }}</span>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="scope.row.acs_item_code"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="默认值" width="230" prop="default_value">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_show === '1'">{{ scope.row.default_value }}</span>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="scope.row.default_value"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="明细序号" width="120" prop="seq_no">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_show === '1'">{{ scope.row.seq_no }}</span>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="scope.row.seq_no"
|
||||
style="width: 100px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" width="230" prop="remark">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.is_show === '1'">{{ scope.row.remark }}</span>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="scope.row.remark"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-if="scope.row.is_show === '1'" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="editData(scope.row,scope.$index)" />
|
||||
<el-button v-else type="success" class="filter-item" size="mini" icon="el-icon-check" @click="finishData(scope.row,scope.$index)" />
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, tableData)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudItem from '@/api/wms/dc/item'
|
||||
import crudDevicetype from '@/api/wms/dc/devicetype'
|
||||
|
||||
const defaultForm = {
|
||||
worksection_id: '',
|
||||
devicetype_id: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: {},
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
worksectionList: [],
|
||||
devicetypeList: [],
|
||||
titleName: '',
|
||||
rules: {
|
||||
devicetype_id: [
|
||||
{ required: true, message: '设备类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
worksection_id: [
|
||||
{ required: true, message: '工段类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveButton(form) {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少添加一条项点明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].is_show === '0') {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (this.form.tableData[i].xh) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
crudItem.saveItem(this.form).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.closeButton()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
closeButton() {
|
||||
this.dialogVisible = false
|
||||
this.form.worksection_id = ''
|
||||
this.form.devicetype_id = ''
|
||||
this.devicetypeList = []
|
||||
this.form.tableData = []
|
||||
},
|
||||
setForm(form) {
|
||||
this.dialogVisible = true
|
||||
this.form = form
|
||||
},
|
||||
getDeviceTypeBySection(worksection_id) {
|
||||
this.form.devicetype_id = ''
|
||||
crudItem.getDeviceTypeBySection({ section_id: worksection_id }).then(res => {
|
||||
this.devicetypeList = res
|
||||
})
|
||||
},
|
||||
editData(row, index) {
|
||||
row.is_show = '0'
|
||||
},
|
||||
finishData(row, index) {
|
||||
if (row.item_code === '') {
|
||||
this.crud.notify('项点编码不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
} else if (row.item_name === '') {
|
||||
this.crud.notify('项点名称不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
} else if (row.seq_no === '') {
|
||||
this.crud.notify('明细序号', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
} else {
|
||||
row.is_show = '1'
|
||||
}
|
||||
},
|
||||
rowClassName({ row, rowIndex }) {
|
||||
row.xh = rowIndex + 1
|
||||
},
|
||||
addItem() {
|
||||
if (this.form.devicetype_id === '') {
|
||||
this.crud.notify('请先选择工段和设备类型', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (this.form.tableData === undefined) {
|
||||
this.form.tableData = []
|
||||
}
|
||||
const obj = {}
|
||||
obj.item_code = ''
|
||||
obj.item_name = ''
|
||||
obj.default_value = ''
|
||||
obj.seq_no = ''
|
||||
obj.is_show = '0'
|
||||
this.form.tableData.unshift(obj)
|
||||
},
|
||||
open() {
|
||||
this.getWorksection()
|
||||
},
|
||||
close() {
|
||||
this.$emit('tableChanged')
|
||||
},
|
||||
getDtl() {
|
||||
crudItem.getDtlByDevicetypeId({ devicetype_id: this.form.devicetype_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
async queryDtl() {
|
||||
this.dtlShow = true
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
this.form.tableData.splice(index, 1)
|
||||
},
|
||||
getWorksection() {
|
||||
crudDevicetype.getWorksection().then(res => {
|
||||
this.worksectionList = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,181 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入项点编码或名称"
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<label class="el-form-item-label">所属工段</label>
|
||||
<el-select v-model="query.section_id" filterable clearable size="small" placeholder="所属工段" class="filter-item" style="width: 220px" @change="getDeviceTypeBySection(query.section_id)">
|
||||
<el-option
|
||||
v-for="item in worksectionList"
|
||||
:key="item.worksection_id"
|
||||
:label="item.worksection_name"
|
||||
:value="item.worksection_id"
|
||||
/>
|
||||
</el-select>
|
||||
<label class="el-form-item-label">设备类型</label>
|
||||
<el-select v-model="query.devicetype_id" size="small" placeholder="设备类型" class="filter-item" style="width: 220px" @change="reference">
|
||||
<el-option
|
||||
v-for="item in devicetypeList"
|
||||
:key="item.devicetype_id"
|
||||
:label="item.devicetype_name"
|
||||
:value="item.devicetype_id"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-s-grid"
|
||||
size="mini"
|
||||
@click="openWh"
|
||||
>
|
||||
项点维护
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="item_code" label="项点编码" />
|
||||
<el-table-column prop="item_name" label="项点名称 " width="150" />
|
||||
<el-table-column prop="acs_item_code" label="acs项点编码 " width="150" />
|
||||
<el-table-column prop="worksection_name" label="所属工段" width="100" />
|
||||
<el-table-column prop="devicetype_name" label="设备类型" width="100" />
|
||||
<el-table-column prop="default_value" label="默认值" />
|
||||
<el-table-column prop="seq_no" label="明细序号" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog ref="child" :dialog-show.sync="addShow" @tableChanged="tableChanged" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudItem from '@/api/wms/dc/item'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/dc/item/AddDialog'
|
||||
import crudDevicetype from '@/api/wms/dc/devicetype'
|
||||
|
||||
const defaultForm = { iteml_id: null, item_code: null, item_name: null, default_value: null, seq_no: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_used: null, is_delete: null, devicetype_id: null, acs_item_code: null }
|
||||
export default {
|
||||
name: 'Item',
|
||||
components: { pagination, crudOperation, rrOperation, AddDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
query: {
|
||||
section_id: ''
|
||||
},
|
||||
cruds() {
|
||||
return CRUD({ title: '采集项管理', url: 'api/item', idField: 'iteml_id', sort: 'iteml_id,desc',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudItem }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
addShow: false,
|
||||
worksectionList: [],
|
||||
devicetypeList: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorksection()
|
||||
console.log(this.worksectionList)
|
||||
},
|
||||
methods: {
|
||||
reference() {
|
||||
this.$forceUpdate()
|
||||
this.crud.toQuery()
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudItem.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
openWh() {
|
||||
this.$refs.child.setForm(this.form)
|
||||
},
|
||||
getDeviceTypeBySection(section_id) {
|
||||
this.query.devicetype_id = ''
|
||||
crudItem.getDeviceTypeBySection({ section_id: section_id }).then(res => {
|
||||
this.devicetypeList = res
|
||||
this.query.devicetype_id = this.devicetypeList[0].devicetype_id
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
getWorksection() {
|
||||
crudDevicetype.getWorksection().then(res => {
|
||||
this.worksectionList = res
|
||||
})
|
||||
},
|
||||
tableChanged() {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,128 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.search" clearable placeholder="工段编码或名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="工段编码" prop="worksection_code">
|
||||
<el-input v-model="form.worksection_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工段名称 " prop="worksection_name">
|
||||
<el-input v-model="form.worksection_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<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>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :cell-style="{'text-align':'center'}" :header-cell-style="{'text-align':'center'}" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="worksection_code" label="工段编码" />
|
||||
<el-table-column prop="worksection_name" label="工段名称 " />
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudWorksection from '@/api/wms/dc/worksection'
|
||||
import CRUD, { presenter, header, form, crud } 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'
|
||||
|
||||
const defaultForm = { worksection_id: null, worksection_code: null, worksection_name: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_used: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Worksection',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '工段基本信息', url: 'api/worksection', idField: 'worksection_id', sort: 'worksection_id,desc', optShow: { add: true, edit: true, del: true, download: false, reset: true }, crudMethod: { ...crudWorksection }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
worksection_code: [
|
||||
{ required: true, message: '工段编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
worksection_name: [
|
||||
{ required: true, message: '工段名称 不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'worksection_code', display_name: '工段编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudWorksection.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,154 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.workprocedure_id === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-row style="margin-bottom: 10px">
|
||||
<el-col :span="22">
|
||||
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="primary" @click="saveWorkProcedureDevice()">保存</el-button>
|
||||
<!-- <el-button @click="closeSave()">取消</el-button>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
border
|
||||
:cell-style="{'text-align': 'center'}"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column
|
||||
prop="device_code"
|
||||
label="设备编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="device_name"
|
||||
label="设备名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="device_type"
|
||||
label="设备类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.pdm_device_type[scope.row.device_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- <WorkProcedureDeviceConfigDialog ref="workProcedureDeviceConfigDialog" />-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
// import WorkProcedureDeviceConfigDialog from './WorkProcedureDeviceConfigDialog'
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import crudProduceline, {
|
||||
queryWorkProcedureDeviceListByLineId,
|
||||
saveWorkProcedureDevice1 } from '@/api/wms/pdm/produceline'
|
||||
|
||||
export default {
|
||||
name: 'DeviceDialog',
|
||||
dicts: ['pdm_device_type'],
|
||||
components: { },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '设备详情',
|
||||
url: 'api/produceline/queryWorkProcedureDeviceListByLineId',
|
||||
sort: ['update_time,asc'],
|
||||
query: { workprocedure_id: '' },
|
||||
crudMethod: { ...crudProduceline },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
device_id: {},
|
||||
seq_no: '',
|
||||
workprocedure_id: '',
|
||||
produceline_id: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
if (row.checked === '1') {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeDelete](row) {
|
||||
return true
|
||||
},
|
||||
/* closeSave() {
|
||||
this.$refs.workProcedureDeviceConfigDialog.dialogShow = false
|
||||
},*/
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.device_id = val.map(item => item.device_id)
|
||||
console.log(this.device_id)
|
||||
},
|
||||
async saveWorkProcedureDevice() {
|
||||
const saveData = { // eslint-disable-line no-unused-vars
|
||||
produceline_id: this.produceline_id,
|
||||
workprocedure_id: this.workprocedure_id,
|
||||
device_id: this.device_id,
|
||||
seq_no: this.seq_no
|
||||
}
|
||||
await saveWorkProcedureDevice1(saveData).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
|
||||
const queryData = { // eslint-disable-line no-unused-vars
|
||||
produceline_id: this.openParam.produceline_id,
|
||||
workprocedure_id: this.workprocedure_id
|
||||
}
|
||||
await queryWorkProcedureDeviceListByLineId(queryData).then(res => {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
if (row.checked === '1') {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="产线工序配置"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row style="margin-bottom: 10px;margin-top: 0px">
|
||||
<el-col :span="20">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item :inline="true" label="产线编码:">
|
||||
<el-input v-model="formInline.produceline_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :inline="true" label="产线名称:">
|
||||
<el-input v-model="formInline.produceline_name" disabled />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="4" />
|
||||
</el-row>
|
||||
<span>工序列表:</span>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%"
|
||||
border
|
||||
:cell-style="{'text-align': 'center'}"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column
|
||||
prop="workprocedure_code"
|
||||
label="工序编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="seq_no"
|
||||
label="工序顺序"
|
||||
/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveWorkProcedure()">保存</el-button>
|
||||
<el-button @click="closeSave()">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudProduceline, {
|
||||
saveWorkProcedure
|
||||
} from '@/api/wms/pdm/produceline'
|
||||
|
||||
export default {
|
||||
name: 'WorkProcedureConfigDialog',
|
||||
dicts: ['ST_IVT_LEVEL'],
|
||||
components: { pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '工序列表', url: 'api/produceline/queryWorkProcedureListByLineId', crudMethod: { ...crudProduceline }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formInline: {
|
||||
produceline_code: '',
|
||||
produceline_name: ''
|
||||
},
|
||||
tableData: [],
|
||||
produceline_id: '',
|
||||
workprocedure_id: '',
|
||||
seq_no: '',
|
||||
workprocedure_ids: [],
|
||||
dialogVisible: this.dialogShow
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
if (row.checked === '1') {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
open() {
|
||||
this.formInline.produceline_code = this.openParam.produceline_code
|
||||
this.formInline.produceline_name = this.openParam.produceline_name
|
||||
this.query.produceline_id = this.openParam.produceline_id
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.workprocedure_ids = val.map(item => item.workprocedure_id + ',' + item.seq_no)
|
||||
},
|
||||
saveWorkProcedure() {
|
||||
const saveData = { // eslint-disable-line no-unused-vars
|
||||
produceline_id: this.openParam.produceline_id,
|
||||
workprocedure_ids: this.workprocedure_ids
|
||||
}
|
||||
saveWorkProcedure(saveData).then(res => {
|
||||
this.open()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.dialogShow = false
|
||||
})
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
closeSave() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.el-table_body tr.current-row>td {
|
||||
background-color: #e9e500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,214 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="产线设备配置"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row style="margin-bottom: 10px;margin-top: 0px">
|
||||
<el-col :span="20">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item :inline="true" label="产线编码:">
|
||||
<el-input v-model="formInline.produceline_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :inline="true" label="产线名称:">
|
||||
<el-input v-model="formInline.produceline_name" disabled />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="4" />
|
||||
</el-row>
|
||||
|
||||
<!-- 仓位列表-->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="10" :lg="11" :xl="11" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<span>工序列表:</span>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
:row-class-name="tableRowClassName"
|
||||
:row-style="selectedstyle"
|
||||
style="width: 100%"
|
||||
highlight-current-row
|
||||
border
|
||||
:cell-style="{'text-align': 'center'}"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column
|
||||
prop="workprocedure_code"
|
||||
label="工序编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="seq_no"
|
||||
label="工序顺序"
|
||||
/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 设备详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="14" :lg="13" :xl="13">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>设备详情</span>
|
||||
</div>
|
||||
<DeviceDialog ref="deviceDialog" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { presenter, header } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DeviceDialog from './DeviceDialog'
|
||||
import crudProduceline from '@/api/wms/pdm/produceline.js'
|
||||
export default {
|
||||
name: 'WorkProcedureDeviceConfigDialog',
|
||||
dicts: ['ST_IVT_LEVEL'],
|
||||
components: { pagination, DeviceDialog },
|
||||
mixins: [presenter(), header()],
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '工序列表',
|
||||
url: 'api/produceline/getWorkprocedureByLineId',
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: { ...crudProduceline },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formInline: {
|
||||
produceline_code: '',
|
||||
produceline_name: ''
|
||||
},
|
||||
deviceDialogVisible: true,
|
||||
tableData: [],
|
||||
deviceTableData: [],
|
||||
produceline_id: '',
|
||||
workprocedure_id: '',
|
||||
seq_no: '',
|
||||
device_id: [],
|
||||
workList: [],
|
||||
dialogVisible: this.dialogShow,
|
||||
getIndex: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.form = this.openParam.form
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.deviceDialog) {
|
||||
this.$refs.deviceDialog.query.workprocedure_id = ''
|
||||
}
|
||||
return true
|
||||
},
|
||||
selectedstyle({ row, rowIndex }) {
|
||||
if ((this.getIndex) === rowIndex) {
|
||||
return {
|
||||
'background-color': 'red'
|
||||
}
|
||||
}
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
rowClick(row) {
|
||||
this.getIndex = row.index
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
open() {
|
||||
this.formInline.produceline_code = this.openParam.produceline_code
|
||||
this.formInline.produceline_name = this.openParam.produceline_name
|
||||
this.query.produceline_id = this.openParam.produceline_id
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.deviceDialog.seq_no = val.seq_no
|
||||
this.$refs.deviceDialog.workprocedure_id = val.workprocedure_id
|
||||
this.$refs.deviceDialog.produceline_id = this.openParam.produceline_id
|
||||
this.$refs.deviceDialog.query.workprocedure_id = val.workprocedure_id
|
||||
this.$refs.deviceDialog.query.produceline_id = this.openParam.produceline_id
|
||||
this.$refs.deviceDialog.crud.toQuery()
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.device_id = val.map(item => item.device_id)
|
||||
console.log(this.device_id)
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
closeSave() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.el-table_body tr.current-row > td {
|
||||
background-color: #e9e500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,274 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="产线工序参数"
|
||||
:visible.sync="dialogShow"
|
||||
destroy-on-close
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:loading="crud.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 产线详情-->
|
||||
<el-row style="margin-bottom: 10px;margin-top: 10px;border: 1px solid red;">
|
||||
<el-col :span="24">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item :inline="true" label="产线编码:">
|
||||
<el-input v-model="formInline.produceline_code" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :inline="true" label="产线名称:">
|
||||
<el-input v-model="formInline.produceline_name" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :inline="true" label="工序名称:">
|
||||
<el-select
|
||||
v-model="formInline.workprocedure_id"
|
||||
size="mini"
|
||||
placeholder="工序名称"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
@change="changeWorkProcedure"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workProcedureList"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :inline="true" label="设备类型:">
|
||||
<el-select
|
||||
v-model="formInline.device_type"
|
||||
size="mini"
|
||||
placeholder="设备类型"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workProcedureDeviceTypeList"
|
||||
:label="item.device_type_name"
|
||||
:value="item.device_type"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :inline="true" label="工序业务:">
|
||||
<el-select
|
||||
v-model="formInline.workprocedure_buss"
|
||||
size="mini"
|
||||
multiple
|
||||
placeholder="工序业务"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
@change="changeWorkProcedureBuss"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.work_procedure_buss_list"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane v-for="title in bussTabs" :key="title.label" :label="title.label" :name="title.name">
|
||||
<!-- 组件-->
|
||||
<component :is="title.component" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import {
|
||||
getWorkprocedureByLineId,
|
||||
getWorkprocedureDeviceTypeList,
|
||||
saveWorkProcedure
|
||||
} from '@/api/wms/pdm/produceline.js'
|
||||
import CallMaterialRequest from './buss/CallMaterialRequest'
|
||||
import FullMaterialRequest from './buss/FullMaterialRequest'
|
||||
import SendVehicle from './buss/SendVehicle'
|
||||
import CallVehicle from './buss/CallVehicle'
|
||||
|
||||
export default {
|
||||
name: 'WorkProcedureParamDialog',
|
||||
dicts: ['work_procedure_buss_list'],
|
||||
components: { CallMaterialRequest, FullMaterialRequest, SendVehicle, CallVehicle },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
bussTabs: [],
|
||||
formInline: {
|
||||
device_type: '',
|
||||
produceline_code: '',
|
||||
produceline_name: '',
|
||||
workprocedure_id: '',
|
||||
workprocedure_buss: ''
|
||||
},
|
||||
workProcedureDeviceTypeList: [],
|
||||
workProcedureList: [],
|
||||
produceline_id: '',
|
||||
workprocedure_id: '',
|
||||
seq_no: '',
|
||||
workprocedure_ids: [],
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.form = this.openParam.form
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeWorkProcedure(workprocedure_id) {
|
||||
const param = {
|
||||
produceline_id: this.openParam.produceline_id,
|
||||
workprocedure_id
|
||||
}
|
||||
getWorkprocedureDeviceTypeList(param).then(res => {
|
||||
this.workProcedureDeviceTypeList = res
|
||||
})
|
||||
},
|
||||
changeWorkProcedureBuss(workBussList) {
|
||||
debugger
|
||||
this.bussTabs = []
|
||||
const that = this
|
||||
workBussList.forEach((item, index, arr) => {
|
||||
const workBussObj = that.dict.work_procedure_buss_list.find(i => i.value === item)
|
||||
var component = 'CallMaterialRequest'
|
||||
if (item === '01') {
|
||||
component = 'CallVehicle'
|
||||
}
|
||||
if (item === '02') {
|
||||
component = 'SendVehicle'
|
||||
}
|
||||
if (item === '03') {
|
||||
component = 'FullMaterialRequest'
|
||||
}
|
||||
if (item === '04') {
|
||||
component = 'CallMaterialRequest'
|
||||
}
|
||||
const tabObj = {
|
||||
label: workBussObj.label,
|
||||
name: workBussObj.value,
|
||||
component
|
||||
}
|
||||
this.bussTabs.push(tabObj)
|
||||
})
|
||||
debugger
|
||||
},
|
||||
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event)
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$refs['tableData'].resetFields()
|
||||
},
|
||||
open() {
|
||||
const queryData = { // eslint-disable-line no-unused-vars
|
||||
produceline_id: this.openParam.produceline_id
|
||||
}
|
||||
this.formInline.produceline_id = this.openParam.produceline_id
|
||||
this.formInline.produceline_code = this.openParam.produceline_code
|
||||
this.formInline.produceline_name = this.openParam.produceline_name
|
||||
getWorkprocedureByLineId(queryData).then(res => {
|
||||
this.workProcedureList = res
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.workprocedure_ids = val.map(item => item.workprocedure_id + ',' + item.seq_no)
|
||||
console.log(this.workprocedure_ids)
|
||||
},
|
||||
saveWorkProcedure() {
|
||||
const saveData = { // eslint-disable-line no-unused-vars
|
||||
produceline_id: this.openParam.produceline_id,
|
||||
workprocedure_ids: this.workprocedure_ids
|
||||
}
|
||||
saveWorkProcedure(saveData).then(res => {
|
||||
this.open()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.dialogShow = false
|
||||
})
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
closeSave() {
|
||||
this.dialogShow = false
|
||||
this.deviceDialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.el-table_body tr.current-row > td {
|
||||
background-color: #e9e500;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>-->
|
||||
@@ -1,107 +0,0 @@
|
||||
<template>
|
||||
<!--称重站点-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">叫料请求:</span>
|
||||
</div>
|
||||
<el-form :inline="true" :model="formData" class="demo-form-inline">
|
||||
<el-form-item label="审批人">
|
||||
<el-input v-model="formData.user" placeholder="审批人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动区域">
|
||||
<el-select v-model="formData.region" placeholder="活动区域">
|
||||
<el-option label="区域一" value="shanghai"></el-option>
|
||||
<el-option label="区域二" value="beijing"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span"/>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crud from '@/mixins/crud'
|
||||
|
||||
export default {
|
||||
name: 'CallMaterialRequest',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
parentForm: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
user: '',
|
||||
region: ''
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
/*// 从父表单获取设备编码
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})*/
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
/*this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = false
|
||||
updateConfig(parentForm, this.form).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})*/
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<!--称重站点-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">叫空载具:</span>
|
||||
</div>
|
||||
<!-- <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-tooltip class="item" effect="dark" content="设备为输送机或者NDC系统时需为数字" placement="bottom-end">
|
||||
<el-form-item label="电气调度号" label-width="150px">
|
||||
<el-input v-model="form.address" />
|
||||
</el-form-item>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>-->
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crud from '@/mixins/crud'
|
||||
|
||||
export default {
|
||||
name: 'CallVehicle',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
parentForm: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
/*// 从父表单获取设备编码
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})*/
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
/*this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = false
|
||||
updateConfig(parentForm, this.form).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})*/
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,236 +0,0 @@
|
||||
<template>
|
||||
<!--满料请求-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">计量单位:</span>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
数量单位:
|
||||
<el-select
|
||||
v-model="opc_id"
|
||||
placeholder="无"
|
||||
clearable
|
||||
@change="changeOpc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dataOpcservers"
|
||||
:key="item.opc_id"
|
||||
:label="item.opc_name"
|
||||
:value="item.opc_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
重量单位:
|
||||
<el-select
|
||||
v-model="plc_id"
|
||||
placeholder="无"
|
||||
clearable
|
||||
@change="changePlc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dataOpcPlcs"
|
||||
:key="item.plc_id"
|
||||
:label="item.plc_name"
|
||||
:value="item.plc_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">入库区域:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="电气调度号" label-width="150px">
|
||||
<el-switch v-model="form.OPCServer" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">PLC读取字段:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-table
|
||||
v-loading="false"
|
||||
:data="data1"
|
||||
:max-height="550"
|
||||
size="small"
|
||||
style="width: 100%;margin-bottom: 15px"
|
||||
>
|
||||
|
||||
<el-table-column prop="name" label="用途" />
|
||||
<el-table-column prop="code" label="别名要求" />
|
||||
<el-table-column prop="db" label="DB块">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="data1[scope.$index].db"
|
||||
size="mini"
|
||||
class="edit-input"
|
||||
@input="finishReadEdit(data1[scope.$index])"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">PLC写入字段:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-table
|
||||
v-loading="false"
|
||||
:data="data2"
|
||||
:max-height="550"
|
||||
size="small"
|
||||
style="width: 100%;margin-bottom: 15px"
|
||||
>
|
||||
|
||||
<el-table-column prop="name" label="用途" />
|
||||
<el-table-column prop="code" label="别名要求" />
|
||||
<el-table-column prop="db" label="DB块">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="data2[scope.$index].db"
|
||||
size="mini"
|
||||
class="edit-input"
|
||||
@input="finishWriteEdit(data2[scope.$index])"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
:loading="false"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import crud from '@/mixins/crud'
|
||||
|
||||
export default {
|
||||
name: 'FullMaterialRequest',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
parentForm: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
device_code: '',
|
||||
device_id: '',
|
||||
plc_id: '',
|
||||
plc_code: '',
|
||||
opc_id: '',
|
||||
opc_code: '',
|
||||
configLoading: false,
|
||||
dataOpcservers: [],
|
||||
dataOpcPlcs: [],
|
||||
data1: [],
|
||||
data2: [],
|
||||
form: {
|
||||
inspect_in_stocck: true,
|
||||
ignore_pickup_check: true,
|
||||
ignore_release_check: true,
|
||||
apply_task: true,
|
||||
manual_create_task: true,
|
||||
is_pickup: true,
|
||||
is_release: true
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
/*// 从父表单获取设备编码
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})*/
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
/*this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = false
|
||||
updateConfig(parentForm, this.form).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})*/
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<!--称重站点-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">送空载具:</span>
|
||||
</div>
|
||||
<!-- <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-tooltip class="item" effect="dark" content="设备为输送机或者NDC系统时需为数字" placement="bottom-end">
|
||||
<el-form-item label="电气调度号" label-width="150px">
|
||||
<el-input v-model="form.address" />
|
||||
</el-form-item>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>-->
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crud from '@/mixins/crud'
|
||||
|
||||
export default {
|
||||
name: 'SendVehicle',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
parentForm: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
/*// 从父表单获取设备编码
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})*/
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
/*this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = false
|
||||
updateConfig(parentForm, this.form).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})*/
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,221 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="产线编码" prop="produceline_code">
|
||||
<el-input v-model="form.produceline_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产线名称" prop="produceline_name">
|
||||
<el-input v-model="form.produceline_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<label slot="label">备 注</label>
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<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>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="produceline_code" label="产线编码" />
|
||||
<el-table-column prop="produceline_name" label="产线名称" />
|
||||
<el-table-column prop="remark" label="备注" width="100" />
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建者" />
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="120" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="workProcedureSet(scope.row)">工序配置</el-button>
|
||||
<el-button type="text" size="small" @click="workProcedureDeviceSet(scope.row)">设备配置</el-button>
|
||||
<el-button type="text" size="small" @click="workProcedureParamSet(scope.row)">工序参数</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<WorkProcedureConfigDialog :dialog-show.sync="workProcedureConfigDialog" :open-param="openParam" />
|
||||
<WorkProcedureDeviceConfigDialog :dialog-show.sync="workProcedureDeviceConfigDialog" :open-param="openParam" />
|
||||
<WorkProcedureParamDialog :dialog-show.sync="workProcedureParamDialog" :open-param="openParam" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProduceLine, { changeActive } from '@/api/wms/pdm/produceline.js'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import WorkProcedureConfigDialog from './WorkProcedureConfigDialog'
|
||||
import WorkProcedureDeviceConfigDialog from './WorkProcedureDeviceConfigDialog'
|
||||
import WorkProcedureParamDialog from './WorkProcedureParamDialog'
|
||||
|
||||
const defaultForm = {
|
||||
produceline_id: null,
|
||||
produceline_code: null,
|
||||
produceline_name: null,
|
||||
is_used: null,
|
||||
create_id: null,
|
||||
remark: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'Produceline',
|
||||
components: {
|
||||
pagination,
|
||||
crudOperation,
|
||||
WorkProcedureConfigDialog,
|
||||
WorkProcedureDeviceConfigDialog,
|
||||
WorkProcedureParamDialog
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '产线',
|
||||
url: 'api/produceline',
|
||||
idField: 'produceline_id',
|
||||
sort: 'produceline_id,desc',
|
||||
crudMethod: { ...crudProduceLine },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
workProcedureConfigDialog: false,
|
||||
workProcedureDeviceConfigDialog: false,
|
||||
workProcedureParamDialog: false,
|
||||
openParam: {},
|
||||
permission: {},
|
||||
rules: {
|
||||
produceline_id: [
|
||||
{ required: true, message: '产线标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
produceline_code: [
|
||||
{ required: true, message: '产线编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
produceline_name: [
|
||||
{ required: true, message: '产线名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_id: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_name: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '是否删除不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
workProcedureSet(row) {
|
||||
this.openParam = row
|
||||
this.workProcedureConfigDialog = true
|
||||
},
|
||||
workProcedureDeviceSet(row) {
|
||||
this.openParam = row
|
||||
this.workProcedureDeviceConfigDialog = true
|
||||
},
|
||||
workProcedureParamSet(row) {
|
||||
this.openParam = row
|
||||
this.workProcedureParamDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -50,7 +50,7 @@ export default {
|
||||
dialogVisible: false,
|
||||
deviceList: [],
|
||||
workprocedure_id: '',
|
||||
form: { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null },
|
||||
form: { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, device_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null },
|
||||
rules: {
|
||||
device_id: [
|
||||
{ required: true, message: '设备标识不能为空', trigger: 'blur' }
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="device_name" label="设备名称" width="120" />
|
||||
<el-table-column prop="produceline_name" label="产线名称" />
|
||||
<el-table-column prop="cust_name" label="客户名称" />
|
||||
<el-table-column prop="seq_no" label="生产顺序" />
|
||||
<el-table-column prop="plan_qty" label="计划生产数量" width="120" />
|
||||
|
||||
@@ -44,16 +44,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属产线">
|
||||
<el-select v-model="query.produceline_id" style="width: 185px;" filterable clearable class="filter-item" placeholder="请选择产线" @change="crud.toQuery">
|
||||
<el-option
|
||||
v-for="item in producelineList"
|
||||
:key="item.produceline_id"
|
||||
:label="item.produceline_name"
|
||||
:value="item.produceline_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属客户">
|
||||
<el-select v-model="query.cust_id" filterable clearable class="filter-item" style="width: 185px" placeholder="请选择客户" @change="crud.toQuery">
|
||||
<el-option
|
||||
@@ -162,16 +152,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="产线名称" prop="produceline_id">
|
||||
<el-select v-model="form.produceline_id" filterable clearable class="filter-item" style="width: 200px" placeholder="请选择产线">
|
||||
<el-option
|
||||
v-for="item in producelineList"
|
||||
:key="item.produceline_id"
|
||||
:label="item.produceline_name"
|
||||
:value="item.produceline_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="客户名称">
|
||||
<el-select v-model="form.cust_id" filterable clearable class="filter-item" style="width: 200px" placeholder="请选择客户">
|
||||
<el-option
|
||||
@@ -269,7 +249,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="device_name" label="设备名称" width="120" />
|
||||
<el-table-column v-if="false" prop="produceline_name" label="产线名称" />
|
||||
<el-table-column v-if="false" prop="cust_name" label="客户名称" />
|
||||
<el-table-column prop="plan_qty" label="计划生产数量" width="120" />
|
||||
<el-table-column prop="real_qty" label="实际生产数量" width="120" />
|
||||
@@ -348,7 +327,6 @@ const defaultForm = {
|
||||
producetask_status: null,
|
||||
material_id: null,
|
||||
device_id: null,
|
||||
produceline_id: null,
|
||||
cust_id: null,
|
||||
seq_no: null,
|
||||
plan_qty: null,
|
||||
@@ -415,9 +393,6 @@ export default {
|
||||
device_id: [
|
||||
{ required: true, message: '设备标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
produceline_id: [
|
||||
{ required: true, message: '产线标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
seq_no: [
|
||||
{ required: true, message: '生产顺序不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -437,7 +412,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getProduceline()
|
||||
this.getCust()
|
||||
this.getMaterial()
|
||||
this.getWorkprocedure()
|
||||
@@ -575,11 +549,6 @@ export default {
|
||||
this.workprocedureList = res
|
||||
})
|
||||
},
|
||||
getProduceline() {
|
||||
crudProducetask.getProduceline().then(res => {
|
||||
this.producelineList = res
|
||||
})
|
||||
},
|
||||
tableChanged3() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user