parent
7b865565ef
commit
9df0783351
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="mytable">
|
||||
<el-button size="small" type="primary" @click="getList" >查询</el-button>
|
||||
<el-button size="small" type="success" @click="add" >新增</el-button>
|
||||
<el-button size="small" type="danger" @click="remove" >删除</el-button>
|
||||
<el-button size="small" type="success" @click="saveGxcd" >保存</el-button>
|
||||
<vxe-grid
|
||||
id="gxId"
|
||||
ref="xGridGx"
|
||||
border
|
||||
resizable
|
||||
keep-source
|
||||
:align="'center'"
|
||||
:height="height"
|
||||
:auto-resize="true"
|
||||
:columns="gxCDtableColumn"
|
||||
highlight-current-row
|
||||
:data="gxCDList"
|
||||
:custom-config="{storage: true }"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'row',
|
||||
showStatus: true,
|
||||
}"
|
||||
:scroll-x="{enabled: true}"
|
||||
:scroll-y="{enabled: true}"
|
||||
highlight-hover-row
|
||||
show-overflow
|
||||
show-header-overflow
|
||||
>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCdAll,saveGxcd,removeGxcd} from '@/api/jhzx/pc'
|
||||
export default {
|
||||
name:'GxCD',
|
||||
props:{
|
||||
height:{
|
||||
type:Number,
|
||||
default:700,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
gxCDList:[],
|
||||
gxCDtableColumn:[
|
||||
{ type: 'checkbox', width: 50 },
|
||||
{type: 'seq', width: 60, title: '序号'},
|
||||
{ field: 'gx', title: '工序', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: 'cd', title: '间隔周期', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
getList(){
|
||||
getCdAll().then((res) => {
|
||||
this.gxCDList = res.data
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.$refs.xGridGx.insertAt({},-1)
|
||||
},
|
||||
remove(){
|
||||
this.$refs.xGridGx.removeCheckboxRow()
|
||||
},
|
||||
async saveGxcd(){
|
||||
const {insertRecords, removeRecords, updateRecords} = this.$refs.xGridGx.getRecordset()
|
||||
if (insertRecords.length !== 0 ) {
|
||||
await saveGxcd(insertRecords).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
if (updateRecords.length !== 0) {
|
||||
await saveGxcd(updateRecords).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
if (removeRecords.length !== 0) {
|
||||
await removeGxcd(removeRecords).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<div class="mytable">
|
||||
<el-button size="small" type="primary" @click="getList" >查询</el-button>
|
||||
<el-button size="small" type="success" @click="add" >新增</el-button>
|
||||
<el-button size="small" type="danger" @click="remove" >删除</el-button>
|
||||
<el-button size="small" type="success" @click="saveSbcn" >保存</el-button>
|
||||
<vxe-grid
|
||||
id="sbcnId"
|
||||
ref="xGridSbcn"
|
||||
border
|
||||
resizable
|
||||
keep-source
|
||||
:align="'center'"
|
||||
:height="height"
|
||||
:auto-resize="true"
|
||||
:columns="sbcnColumn"
|
||||
highlight-current-row
|
||||
:data="sbcnList"
|
||||
:custom-config="{storage: true }"
|
||||
:scroll-x="{enabled: true}"
|
||||
:scroll-y="{enabled: true}"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'row',
|
||||
showStatus: true,
|
||||
}"
|
||||
highlight-hover-row
|
||||
show-overflow
|
||||
show-header-overflow
|
||||
>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSbcnAll, saveSbcn, removeSbcn} from '@/api/jhzx/pc'
|
||||
export default {
|
||||
name:'Sbcn',
|
||||
props:{
|
||||
height:{
|
||||
type:Number,
|
||||
default:700,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
sbcnList:[],
|
||||
sbcnColumn:[
|
||||
{ type: 'checkbox', width: 50 },
|
||||
{type: 'seq', width: 60, title: '序号', },
|
||||
{ field: '_工序', title: '工序', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: 'code', title: '编码', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '设备名称', title: '设备名称', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '单台效率', title: '单台效率', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '单台产能', title: '单台产能', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '白班设备产能', title: '白班设备产能', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '二班设备产能', title: '二班设备产能', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '双班合计产能', title: '双班合计产能', width: 150,
|
||||
editRender: { name: "input" },
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
{ field: '禁用', title: '禁用', width: 150,
|
||||
editRender: { name: '$select', options:[{ label: '是', value:true}, { label: '否', value:false}], props: {clearable: true}},
|
||||
formatter:this.formatterJy,
|
||||
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
|
||||
filterRender: { name: 'FilterCombination', },
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
getList(){
|
||||
getSbcnAll().then((res) => {
|
||||
this.sbcnList = res.data
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.$refs.xGridSbcn.insertAt({},-1)
|
||||
},
|
||||
remove(){
|
||||
this.$refs.xGridSbcn.removeCheckboxRow()
|
||||
},
|
||||
async saveSbcn(){
|
||||
const {insertRecords, removeRecords, updateRecords} = this.$refs.xGridSbcn.getRecordset()
|
||||
if (insertRecords.length !== 0 ) {
|
||||
await saveSbcn(insertRecords).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
if (updateRecords.length !== 0) {
|
||||
await saveSbcn(updateRecords).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
if (removeRecords.length !== 0) {
|
||||
await removeSbcn(removeRecords).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
},
|
||||
//转码
|
||||
formatterJy({cellValue}){
|
||||
if(cellValue){
|
||||
return '是'
|
||||
}
|
||||
if(!cellValue){
|
||||
return '否'
|
||||
}
|
||||
return cellValue
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in new issue