修改菜单,增加质量管理
This commit is contained in:
178
src/views/QualityManager/QCPplan.vue
Normal file
178
src/views/QualityManager/QCPplan.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 15:41:11
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2022-03-03 14:28:58
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<head-form
|
||||
:placeholder-name="placeholderName"
|
||||
:key-name="keyName"
|
||||
:show-add="showAdd"
|
||||
@getDataList="getList"
|
||||
@add="addNew"
|
||||
/>
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
:is-loading="listLoading"
|
||||
>
|
||||
<method-btn
|
||||
slot="handleBtn"
|
||||
:width="trueWidth"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="listQuery.current"
|
||||
:limit.sync="listQuery.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/lang'
|
||||
import { StateConfigList, StateConfigDelete } from '@/api/basicData/StateConfig'
|
||||
import HeadForm from '@/components/basicData/HeadForm'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import { timeFormatter } from '@/filters'
|
||||
import basicData from '@/filters/basicData'
|
||||
/**
|
||||
* 表格表头配置项 TypeScript接口注释
|
||||
* tableConfig<ConfigItem> = []
|
||||
*
|
||||
* Interface ConfigItem = {
|
||||
* prop: string,
|
||||
* label: string,
|
||||
* width: string,
|
||||
* align: string,
|
||||
* subcomponent: function,
|
||||
* filter: function
|
||||
* }
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: 'btn.edit'
|
||||
}
|
||||
// {
|
||||
// type: 'delete',
|
||||
// btnName: 'btn.delete'
|
||||
// }
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: i18n.t('module.basicData.factory.createTime'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: i18n.t('module.basicData.StateConfig.status'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'twinkle',
|
||||
label: i18n.t('module.basicData.StateConfig.Twinkle'),
|
||||
filter: basicData('onDuty'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'colour',
|
||||
label: i18n.t('module.basicData.StateConfig.DisplayColor'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: i18n.t('module.basicData.visual.Remarks'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'QCPplan',
|
||||
components: { Pagination, BaseTable, MethodBtn, HeadForm },
|
||||
data() {
|
||||
return {
|
||||
keyName: i18n.t('module.basicData.visual.keyword'),
|
||||
placeholderName: this.$t('module.basicData.StateConfig.status'),
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
trueWidth: 150,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
showAdd: false,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
console.log(raw)
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.status}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
StateConfigDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
getList(key) {
|
||||
this.listLoading = true
|
||||
this.listQuery.status = key
|
||||
StateConfigList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -13,11 +13,11 @@
|
||||
{{ i.equipmentId ? equipmentObj[i.equipmentId] : $t('module.art.eqName') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" class="process-table-main-item-item">
|
||||
<!-- <el-col :span="4" class="process-table-main-item-item">
|
||||
<el-button v-if="!processPortObj[item.workSequenceId]" disabled>
|
||||
{{ i.equipmentRecipeId ? equipmentRecipeObj[i.equipmentRecipeId] : $t('module.art.recipeName') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="4" class="process-table-main-item-item">
|
||||
<el-button v-if="!processPortObj[item.workSequenceId]" disabled>
|
||||
{{ i.nodeType ? nodeTypesObj[i.nodeType] : $t('module.art.artType') }}
|
||||
@@ -36,7 +36,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
listAllEquipmentRecipe,
|
||||
// listAllEquipmentRecipe,
|
||||
listProcessFlowNode,
|
||||
listProcess
|
||||
} from '@/api/art-manage/art.js'
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
processObj: {},
|
||||
processPortObj: {},
|
||||
equipmentRecipeList: [],
|
||||
equipmentRecipeObj: [],
|
||||
// equipmentRecipeObj: [],
|
||||
equipmentList: [],
|
||||
equipmentObj: {},
|
||||
showAddList: [],
|
||||
@@ -102,12 +102,12 @@ export default {
|
||||
console.log(this.processList)
|
||||
console.log(this.processObj)
|
||||
// 获取配方列表
|
||||
const allRecipeRes = await listAllEquipmentRecipe()
|
||||
this.equipmentRecipeList = allRecipeRes.data
|
||||
allRecipeRes.data.map(item => {
|
||||
this.equipmentRecipeObj[item.id] = item.name
|
||||
})
|
||||
console.log(this.equipmentRecipeList)
|
||||
// const allRecipeRes = await listAllEquipmentRecipe()
|
||||
// this.equipmentRecipeList = allRecipeRes.data
|
||||
// allRecipeRes.data.map(item => {
|
||||
// this.equipmentRecipeObj[item.id] = item.name
|
||||
// })
|
||||
// console.log(this.equipmentRecipeList)
|
||||
// 获取设备列表
|
||||
const allEquipmentRes = await listEquipment()
|
||||
this.equipmentList = allEquipmentRes.data
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
{{ i.equipmentId ? equipmentObj[i.equipmentId] : $t('module.art.eqName') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" class="process-table-main-item-item">
|
||||
<!-- <el-col :span="4" class="process-table-main-item-item">
|
||||
<el-button v-if="!processPortObj[item.workSequenceId]" icon="el-icon-edit" @click="choiceRecipe(index, idx, i.equipmentRecipeId)">
|
||||
{{ i.equipmentRecipeId ? equipmentRecipeObj[i.equipmentRecipeId] : $t('module.art.recipeName') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="4" class="process-table-main-item-item">
|
||||
<el-button v-if="!processPortObj[item.workSequenceId]" icon="el-icon-edit" @click="choiceArtType(index, idx, i.nodeType)">
|
||||
{{ i.nodeType ? nodeTypesObj[i.nodeType] : $t('module.art.artType') }}
|
||||
@@ -55,7 +55,7 @@ import processTableSelect from './process-table-select.vue'
|
||||
import processTableAdd from './process-table-add.vue'
|
||||
import vuedraggable from 'vuedraggable'
|
||||
import {
|
||||
listAllEquipmentRecipe,
|
||||
// listAllEquipmentRecipe,
|
||||
addProcessFlows,
|
||||
listProcessFlowNode,
|
||||
listProcess
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
processObj: {},
|
||||
processPortObj: {},
|
||||
equipmentRecipeList: [],
|
||||
equipmentRecipeObj: [],
|
||||
// equipmentRecipeObj: [],
|
||||
equipmentList: [],
|
||||
equipmentObj: {},
|
||||
showAddList: [],
|
||||
@@ -131,12 +131,12 @@ export default {
|
||||
console.log(this.processList)
|
||||
console.log(this.processObj)
|
||||
// 获取配方列表
|
||||
const allRecipeRes = await listAllEquipmentRecipe()
|
||||
this.equipmentRecipeList = allRecipeRes.data
|
||||
allRecipeRes.data.map(item => {
|
||||
this.equipmentRecipeObj[item.id] = item.name
|
||||
})
|
||||
console.log(this.equipmentRecipeList)
|
||||
// const allRecipeRes = await listAllEquipmentRecipe()
|
||||
// this.equipmentRecipeList = allRecipeRes.data
|
||||
// allRecipeRes.data.map(item => {
|
||||
// this.equipmentRecipeObj[item.id] = item.name
|
||||
// })
|
||||
// console.log(this.equipmentRecipeList)
|
||||
// 获取设备列表
|
||||
const allEquipmentRes = await listEquipment()
|
||||
this.equipmentList = allEquipmentRes.data
|
||||
@@ -197,8 +197,8 @@ export default {
|
||||
nodeType: '',
|
||||
processFlowId: this.processFlowId,
|
||||
workSequenceId: this.dataList[index].workSequenceId,
|
||||
description: this.dataList[index].processFlowEquipmentParams[0]?.description ? this.dataList[index].processFlowEquipmentParams[0].description : '',
|
||||
remark: this.dataList[index].processFlowEquipmentParams[0]?.remark ? this.dataList[index].processFlowEquipmentParams[0].remark : ''
|
||||
description: this.dataList[index].processFlowEquipmentParams[0].description ? this.dataList[index].processFlowEquipmentParams[0].description : '',
|
||||
remark: this.dataList[index].processFlowEquipmentParams[0].remark ? this.dataList[index].processFlowEquipmentParams[0].remark : ''
|
||||
})
|
||||
e.stopPropagation()
|
||||
},
|
||||
@@ -232,16 +232,16 @@ export default {
|
||||
this.$refs.processtableselect.init('equipmentId', first, sec, id, this.processObj[processId].equipments)
|
||||
},
|
||||
// 选择配方
|
||||
choiceRecipe(first, sec, id) {
|
||||
if (this.dataList[first].processFlowEquipmentParams[sec]?.equipmentId) {
|
||||
this.$refs.processtableselect.init('equipmentRecipeId', first, sec, id, this.equipmentRecipeList.filter(f => f.equipmentId === this.dataList[first].processFlowEquipmentParams[sec].equipmentId))
|
||||
} else {
|
||||
this.$message.error(this.$t('module.art.choiceEqError'))
|
||||
}
|
||||
},
|
||||
// choiceRecipe(first, sec, id) {
|
||||
// if (this.dataList[first].processFlowEquipmentParams[sec]?.equipmentId) {
|
||||
// this.$refs.processtableselect.init('equipmentRecipeId', first, sec, id, this.equipmentRecipeList.filter(f => f.equipmentId === this.dataList[first].processFlowEquipmentParams[sec].equipmentId))
|
||||
// } else {
|
||||
// this.$message.error(this.$t('module.art.choiceEqError'))
|
||||
// }
|
||||
// },
|
||||
// 选择工艺类型
|
||||
choiceArtType(first, sec, id) {
|
||||
if (this.dataList[first].processFlowEquipmentParams[sec]?.equipmentId) {
|
||||
if (this.dataList[first].processFlowEquipmentParams[sec].equipmentId) {
|
||||
this.$refs.processtableselect.init('nodeType', first, sec, id, this.nodeTypes)
|
||||
} else {
|
||||
this.$message.error(this.$t('module.art.choiceEqError'))
|
||||
@@ -307,13 +307,14 @@ export default {
|
||||
hasNull = true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
item.processFlowEquipmentParams.map(i => {
|
||||
if (!i.equipmentId || !i.equipmentRecipeId) {
|
||||
hasNull = true
|
||||
}
|
||||
})
|
||||
}
|
||||
// else {
|
||||
// item.processFlowEquipmentParams.map(i => {
|
||||
// if (!i.equipmentId || !i.equipmentRecipeId) {
|
||||
// hasNull = true
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
})
|
||||
// console.log(JSON.stringify(vm.dataList))
|
||||
// if (vm.dataList.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user