init
This commit is contained in:
190
src/views/QualityManager/base/knowledge-add.vue
Normal file
190
src/views/QualityManager/base/knowledge-add.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-07-13 08:38:24
|
||||
* @LastEditTime: 2021-07-13 20:09:11
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: \mt-bus-fe\src\views\QualityManager\base\knowledge-add.vue
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
@close="onClose"
|
||||
>
|
||||
<el-row :gutter="15" style="padding: 0 20px;">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
size="medium"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-form-item :label="$t('module.basicData.knowledge.title')" prop="title">
|
||||
<el-input v-model="dataForm.title" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.knowledge.title')])" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.knowledge.content')">
|
||||
<Tinymce ref="editor" v-model="dataForm.content" :height="300" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.knowledge.annex')">
|
||||
<el-upload
|
||||
ref="annex"
|
||||
:data="dataObj"
|
||||
name="files"
|
||||
:file-list="fileList"
|
||||
:action="uploadPath"
|
||||
:before-upload="annexBeforeUpload"
|
||||
:on-success="handleSuccess"
|
||||
:on-preview="handlePreview"
|
||||
class="btn"
|
||||
>
|
||||
<el-button size="small" type="primary" icon="el-icon-upload">{{ 'btn.upload' | i18nFilter }}</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Tinymce from '@/components/Tinymce'
|
||||
import { uploadPath } from '@/api/basic'
|
||||
import { getUrl } from '@/api/file'
|
||||
import { getDataById, addKnowledge, updateData } from '@/api/quality-manage/knowledge'
|
||||
export default {
|
||||
components: { Tinymce },
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
// rules: [],
|
||||
dataForm: {
|
||||
title: null,
|
||||
content: null,
|
||||
annexUrl: null
|
||||
},
|
||||
dataObj: { typeCode: 'file' },
|
||||
uploadPath,
|
||||
fileList: [],
|
||||
rules: {
|
||||
title: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.knowledge.title')]),
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
onClose() {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.$refs['editor'].setContent('')
|
||||
this.fileList = []
|
||||
},
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.dataForm.id) {
|
||||
updateData(this.dataForm).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
addKnowledge(this.dataForm).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || ''
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
getDataById({ id: this.dataForm.id }).then(res => {
|
||||
this.dataForm = res.data
|
||||
console.log(this.dataForm)
|
||||
this.$refs['editor'].setContent(this.dataForm.content)
|
||||
if (this.dataForm.annexUrl) {
|
||||
const arr = this.dataForm.annexUrl.split(';').map(v => {
|
||||
const obj = {}
|
||||
const a = v.split(':')
|
||||
obj.name = a[0]
|
||||
obj.id = a[1]
|
||||
return obj
|
||||
})
|
||||
this.fileList = arr
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
annexBeforeUpload(file) {
|
||||
const isRightSize = file.size / 1024 / 1024 < 2
|
||||
if (!isRightSize) {
|
||||
this.$message.error('文件大小超过 2MB')
|
||||
}
|
||||
return isRightSize
|
||||
},
|
||||
handleSuccess(res, file) {
|
||||
this.fileList.push({ name: file.name, id: res.data[0].id })
|
||||
const arr = this.fileList.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
let str = ''
|
||||
arr.forEach((v) => {
|
||||
str += v.name + ':' + v.id + ';'
|
||||
})
|
||||
this.formData.annexUrl = str.slice(0, -1)
|
||||
},
|
||||
handlePreview(file) {
|
||||
getUrl({
|
||||
attachmentId: file.id,
|
||||
type: 1
|
||||
}).then(response => {
|
||||
let fileName = ''
|
||||
const contentDisposition = response.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9)
|
||||
}
|
||||
const blob = new Blob([response.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
179
src/views/QualityManager/base/knowledge.vue
Normal file
179
src/views/QualityManager/base/knowledge.vue
Normal file
@@ -0,0 +1,179 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-04-06 19:33:11
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-14 15:35:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:inline="true"
|
||||
size="medium"
|
||||
label-width="150px"
|
||||
>
|
||||
<el-form-item :label="$t('module.basicData.knowledge.time')" prop="time">
|
||||
<el-date-picker
|
||||
v-model="formData.timeSlot"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
:start-placeholder="$t('module.basicData.knowledge.startTime')"
|
||||
:end-placeholder="$t('module.basicData.knowledge.endTime')"
|
||||
:range-separator="$t('module.basicData.ScrapInfo.To')"
|
||||
clearable
|
||||
/>
|
||||
<!-- value-format="yyyy-MM-dd" -->
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.knowledge.title')" prop="title">
|
||||
<el-input v-model="formData.title" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.knowledge.title')])" clear />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList()"> {{ 'btn.search' | i18nFilter }} </el-button>
|
||||
<el-button type="primary" @click="addNew()"> {{ 'btn.add' | i18nFilter }} </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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="formData.current"
|
||||
:limit.sync="formData.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
<knowledge-add v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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
|
||||
// },
|
||||
{
|
||||
prop: 'title',
|
||||
label: i18n.t('module.basicData.knowledge.title'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: i18n.t('module.basicData.knowledge.content'),
|
||||
align: 'center',
|
||||
filter: getSimpleText
|
||||
}
|
||||
]
|
||||
// import { timeFormatter } from '@/filters'
|
||||
import i18n from '@/lang'
|
||||
import { getSimpleText } from '@/filters'
|
||||
import { getKnowList, delData } from '@/api/quality-manage/knowledge'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import knowledgeAdd from './knowledge-add.vue'
|
||||
export default {
|
||||
components: { Pagination, BaseTable, MethodBtn, knowledgeAdd },
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
endTime: null,
|
||||
startTIme: null,
|
||||
size: 10,
|
||||
current: 1,
|
||||
title: null,
|
||||
timeSlot: null
|
||||
},
|
||||
addOrUpdateVisible: false,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
if (this.formData.timeSlot) {
|
||||
this.formData.startTIme = this.formData.timeSlot[0]
|
||||
this.formData.endTime = this.formData.timeSlot[1]
|
||||
} else {
|
||||
this.formData.startTime = ''
|
||||
this.formData.endTime = ''
|
||||
}
|
||||
getKnowList(this.formData).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
|
||||
})
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(i18n.t('deleteMsgBox.content'), i18n.t('deleteMsgBox.hint'), {
|
||||
confirmButtonText: i18n.t('btn.confirm'),
|
||||
cancelButtonText: i18n.t('btn.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
delData({ id: raw.data.id }).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,208 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:53:42
|
||||
* @enName:
|
||||
-->
|
||||
<template>
|
||||
<div style="margin:20px">
|
||||
<div slot="title" style=" background-color:#02BCFF;font-size:1.5em;color:white;padding:5px 20px;margin:20px">{{ isdetail? 'btn.detail' : 'btn.edit' | i18nFilter }}</div>
|
||||
<div style="margin:0 15px">
|
||||
<el-form :inline="true" label-width="100px">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.EquipmentName')">
|
||||
<el-input v-model="equipmentDetectParamData.equipmentName" style="width:300px" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.EquipmentCode')">
|
||||
<el-input v-model="equipmentDetectParamData.equipmentCode" style="width:300px" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.DetectionArea')">
|
||||
<el-input v-model="equipmentDetectParamData.equipmentArea" style="width:300px" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.EquipmentFunction')">
|
||||
<el-input v-model="equipmentDetectParamData.equipmentDesc" style="width:300px" readonly />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin:20px">
|
||||
<el-button type="success" @click="goback()">{{ 'btn.back' | i18nFilter }}</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">{{ 'btn.edit' | i18nFilter }}</el-button>
|
||||
<span v-if="!isdetail">
|
||||
<el-button v-if="listQuery.equipmentId" type="primary" @click="addNew()">{{ 'btn.addattr' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<div style="height:380px;overflow:auto">
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
>
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
</div>
|
||||
</div>
|
||||
<detecParam-attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :equipment-id="listQuery.equipmentId" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import i18n from '@/lang'
|
||||
import { detecParamDetail, detecParamDelete } from '@/api/quality-manage/detecParam'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import detecParamAttrAdd from './detecParamAttr-add'
|
||||
import basicData from '@/filters/basicData'
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: 'btn.edit'
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: 'btn.delete'
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: i18n.t('module.basicData.equipmentDetectInfo.TestParameterName'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: i18n.t('module.quality.offlineDetec.DetecParamCode'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'refValue',
|
||||
label: i18n.t('module.basicData.equipmentDetectInfo.ReferenceValue'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: i18n.t('module.quality.offlineDetec.maxValue'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: i18n.t('module.quality.offlineDetec.minValue'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'avgValue',
|
||||
label: i18n.t('module.quality.offlineDetec.avgValue'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: i18n.t('module.quality.offlineDetec.unit'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'uploadSpc',
|
||||
label: i18n.t('module.quality.offlineDetec.uploadSpc'),
|
||||
filter: basicData('onDuty'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: i18n.t('module.basicData.visual.Remarks'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
components: { BaseTable, MethodBtn, detecParamAttrAdd },
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
categoryArr: [],
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
tableProps,
|
||||
list: [],
|
||||
equipmentDetectParamData: {},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 500,
|
||||
equipmentId: ''
|
||||
},
|
||||
isdetail: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.equipmentDetectParamData = this.$route.query.data
|
||||
this.listQuery.equipmentId = this.equipmentDetectParamData.equipmentId
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.isdetail = false
|
||||
this.isdetail = Boolean(this.$route.query.isdetail)
|
||||
this.list.splice(0, this.list.length)
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
detecParamDetail(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.name}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
detecParamDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false
|
||||
},
|
||||
goback() {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,172 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:54:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:visible.sync="visible"
|
||||
><el-row :gutter="10">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="rules"
|
||||
size="medium"
|
||||
label-width="200px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.basicData.equipmentDetectInfo.TestParameterName')" prop="name">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('module.basicData.equipmentDetectInfo.TestParameterName')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.EquipmentCode')" prop="code">
|
||||
<el-input v-model="dataForm.code" :placeholder="$t('module.quality.offlineDetec.EquipmentCode')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.basicData.equipmentDetectInfo.ReferenceValue')" prop="refValue">
|
||||
<el-input-number v-model="dataForm.refValue" :step="1" :placeholder="$t('module.basicData.equipmentDetectInfo.ReferenceValue')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.maxValue')" prop="maxValue">
|
||||
<el-input-number v-model="dataForm.maxValue" :step="1" :placeholder="$t('module.quality.offlineDetec.maxValue')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.minValue')" prop="minValue">
|
||||
<el-input-number v-model="dataForm.minValue" :step="1" :placeholder="$t('module.quality.offlineDetec.minValue')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.avgValue')" prop="avgValue">
|
||||
<el-input-number v-model="dataForm.avgValue" :step="1" :placeholder="$t('module.quality.offlineDetec.avgValue')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.unit')" prop="unit">
|
||||
<el-input v-model="dataForm.unit" :placeholder="$t('module.quality.offlineDetec.unit')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.uploadSpc')" prop="uploadSpc">
|
||||
<el-switch v-model="dataForm.uploadSpc" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.basicData.visual.Remarks')" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('module.basicData.visual.Remarks')" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="drawer-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { detecParamAdd, detecParamUpdate, ParamDetail, detecParamCode } from '@/api/quality-manage/detecParam'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
equipmentId: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
name: undefined,
|
||||
code: '',
|
||||
refValue: undefined,
|
||||
maxValue: undefined,
|
||||
minValue: undefined,
|
||||
avgValue: '',
|
||||
unit: '',
|
||||
uploadSpc: '0',
|
||||
remark: undefined
|
||||
},
|
||||
rules: {
|
||||
name: [],
|
||||
refValue: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || ''
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
ParamDetail(this.dataForm.id).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
} else {
|
||||
detecParamCode().then(res => {
|
||||
this.dataForm.code = res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
const data = this.dataForm
|
||||
data.equipmentId = this.equipmentId
|
||||
if (this.dataForm.id) {
|
||||
detecParamUpdate(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
detecParamAdd(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,214 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:55:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-row :gutter="15">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="rules"
|
||||
size="medium"
|
||||
label-width="200px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.SubstrateId')" prop="substrateId">
|
||||
<el-input v-model="dataForm.substrateId" :placeholder="$i18nForm(['placeholder.input', $t('module.quality.offlineDetec.SubstrateId')])" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.DetecTime')" prop="testTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.testTime"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.DetecParam')" prop="testParamId">
|
||||
<el-select
|
||||
v-model="dataForm.testParamId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.quality.offlineDetec.DetecParam')])"
|
||||
filterable
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in testParamArr"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.DetecValue')" prop="testParamValue">
|
||||
<el-input v-model="dataForm.testParamValue" :placeholder="$i18nForm(['placeholder.input', $t('module.quality.offlineDetec.DetecValue')])" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.DetecStaff')" prop="staffId">
|
||||
<el-select
|
||||
v-model="dataForm.staffId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.quality.offlineDetec.DetecStaff')])"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
@change="$forceUpdate()"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item) in staffArr"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item :label="$t('module.basicData.visual.Remarks')" prop="remarks">
|
||||
<el-input v-model="dataForm.remarks" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Remarks')])" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="" prop="">
|
||||
<el-button type="primary" size="medium" @click="dataFormSubmit()"> {{ 'btn.save' | i18nFilter }} </el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { detecRegistrationAdd, detecRegistrationUpdate, detecRegistrationDetail } from '@/api/quality-manage/detecRegistration'
|
||||
import { staffList } from '@/api/basicData/GroupModule/staff'
|
||||
import { detecRegistrationList } from '@/api/quality-manage/detecRegistration'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
equipmentId: {
|
||||
type: String,
|
||||
default: () => {
|
||||
}
|
||||
},
|
||||
testParamArr: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
staffArr: [],
|
||||
substrateArr: [],
|
||||
dataForm: {
|
||||
id: '',
|
||||
substrateId: undefined,
|
||||
testTime: '',
|
||||
staffId: [],
|
||||
testParamValue: '',
|
||||
testParamId: '',
|
||||
remarks: undefined
|
||||
},
|
||||
rules: {
|
||||
substrateId: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.quality.offlineDetec.SubstrateId')]),
|
||||
trigger: 'blur'
|
||||
}],
|
||||
testParamId: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.quality.offlineDetec.DetecParam')]),
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
const params = {
|
||||
current: 1,
|
||||
size: 999
|
||||
}
|
||||
staffList(params).then(response => {
|
||||
this.staffArr = response.data.records
|
||||
})
|
||||
params.equipmentId = this.equipmentId
|
||||
detecRegistrationList(params).then(response => {
|
||||
if (response.data.records) {
|
||||
this.substrateArr = response.data.records
|
||||
} else {
|
||||
this.substrateArr.splice(0, this.substrateArr.length)
|
||||
}
|
||||
})
|
||||
this.dataForm.id = id || ''
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.substrateArr.length > 0) {
|
||||
this.dataForm.substrateId = this.substrateArr[0].substrateId
|
||||
}
|
||||
if (this.dataForm.id) {
|
||||
detecRegistrationDetail(this.dataForm.id).then(res => {
|
||||
this.dataForm = res.data
|
||||
const data = JSON.parse(JSON.stringify(res.data))
|
||||
this.dataForm.staffId = data.testingStaffs.toString().split(',')
|
||||
})
|
||||
} else {
|
||||
this.dataForm.testTime = new Date()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
const data = this.dataForm
|
||||
data.equipmentId = this.equipmentId
|
||||
data.testingStaffs = data.staffId.toString()
|
||||
if (this.dataForm.id) {
|
||||
detecRegistrationUpdate(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
detecRegistrationAdd(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,227 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-04-14 15:49:33
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:57:25
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="listQuery"
|
||||
:inline="true"
|
||||
size="medium"
|
||||
label-width="200px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.EquipmentName')+':'">
|
||||
<span style="margin: 0 5px;color:#1890FF">{{ equipmentData.name }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.SubstrateId')" prop="substrateId">
|
||||
<el-input v-model="listQuery.substrateId" :placeholder="['placeholder.input', $t('module.quality.offlineDetec.SubstrateId')] | i18nFilterForm" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.equipmentDetectInfo.TestParameterName')" prop="offlineParamId">
|
||||
<el-select v-model="listQuery.offlineParamId" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.equipmentDetectInfo.TestParameterName')])" clearable>
|
||||
<el-option
|
||||
v-for="item in offlineParamArr"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.offlineDetec.DetecTime')" label-width="100px" prop="time">
|
||||
<el-date-picker
|
||||
v-model="listQuery.timeSlot"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
:start-placeholder="$t('module.orderManage.order.StartTime')"
|
||||
:end-placeholder="$t('module.orderManage.order.StartTime')"
|
||||
:range-separator="$t('module.orderManage.order.To')"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList()">{{ 'btn.search' | i18nFilter }}</el-button>
|
||||
<el-button v-if="equipmentData.equipmentId" type="primary" @click="addNew()">{{ 'btn.add' | i18nFilter }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<base-table
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
: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()"
|
||||
/>
|
||||
<detecRegistrationList-add v-if="addOrUpdateVisible" ref="addOrUpdate" :test-param-arr="offlineParamArr" :equipment-id="equipmentData.equipmentId" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/lang'
|
||||
import { detecRegistrationList, detecRegistrationDelete } from '@/api/quality-manage/detecRegistration'
|
||||
import detecRegistrationListAdd from './detecRegistrationList-add'
|
||||
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'
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: 'btn.edit'
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: 'btn.delete'
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: i18n.t('module.quality.offlineDetec.EquipmentName'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'substrateId',
|
||||
label: i18n.t('module.quality.offlineDetec.SubstrateId'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'testTime',
|
||||
label: i18n.t('module.quality.offlineDetec.DetecTime'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'testParamName',
|
||||
label: i18n.t('module.quality.offlineDetec.DetecParam'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'testParamValue',
|
||||
label: i18n.t('module.quality.offlineDetec.DetecValue'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'remarks',
|
||||
label: i18n.t('module.basicData.visual.Remarks'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: '',
|
||||
components: { Pagination, BaseTable, MethodBtn, detecRegistrationListAdd },
|
||||
filters: {
|
||||
statusFilter(status) {
|
||||
const statusMap = {
|
||||
published: 'success',
|
||||
draft: 'info',
|
||||
deleted: 'danger'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
equipmentData: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
},
|
||||
offlineParamArr: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: false,
|
||||
listQuery: {
|
||||
equipmentId: '',
|
||||
substrateId: '',
|
||||
current: 1,
|
||||
size: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.equipmentName}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
detecRegistrationDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
this.listQuery.equipmentId = this.equipmentData.equipmentId
|
||||
this.listLoading = true
|
||||
if (this.listQuery.substrateId === '') {
|
||||
delete this.listQuery.substrateId
|
||||
}
|
||||
detecRegistrationList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
console.log(this.list)
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
console.log(id)
|
||||
if (this.equipmentData.equipmentId) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
} else {
|
||||
this.$message.error(this.$t('module.quality.offlineDetec.getEquipmetId'))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-04-06 19:33:11
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-05-25 17:39:32
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-tree accordion :load="loadNode" :lazy="true" :highlight-current="true" :data="dataList" :props="defaultProps" @node-click="handleNodeClick" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { equipmentDetectAreaAttrList } from '@/api/basicData/Equipment/equipmentDetectAreaAttr'
|
||||
export default {
|
||||
props: {
|
||||
menuList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
[]
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'detectArea',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
dataList: [],
|
||||
children: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.dataList.splice(0, this.dataList.length)
|
||||
this.dataList = JSON.parse(JSON.stringify(this.menuList))
|
||||
},
|
||||
async loadNode(node, resolve) {
|
||||
if (node.level === 0) {
|
||||
resolve(this.dataList)
|
||||
} else if (node.level === 1) {
|
||||
const listQuery = {
|
||||
current: 1,
|
||||
size: 990,
|
||||
detectDistributionAreaId: node.data.id
|
||||
}
|
||||
const response = await equipmentDetectAreaAttrList(listQuery)
|
||||
if (response.data.records) {
|
||||
this.children = response.data.records
|
||||
console.log(this.children)
|
||||
} else {
|
||||
this.children.splice(0, this.children.length)
|
||||
}
|
||||
this.children.forEach(item => {
|
||||
item.detectArea = item.name
|
||||
item.leaf = true
|
||||
})
|
||||
resolve(this.children)
|
||||
}
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
if (data.equipmentId) {
|
||||
this.$emit('getequipmentId', data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tree >>> .el-tree-node__label {
|
||||
font-size: 20px;
|
||||
}
|
||||
.el-tree >>> .el-tree-node__expand-icon {
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
210
src/views/QualityManager/offlineDetec/detecParam.vue
Normal file
210
src/views/QualityManager/offlineDetec/detecParam.vue
Normal file
@@ -0,0 +1,210 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 15:41:11
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:58:55
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" @keyup.enter.native="getDataList()">
|
||||
<el-form-item :label="$t('module.basicData.equipmentDetectInfo.DetectionArea')">
|
||||
<el-select v-model="listQuery.detecAreaId" :placeholder="$t('module.basicData.equipmentDetectInfo.DetectionArea')" clearable>
|
||||
<el-option
|
||||
v-for="item in detectAreaArr"
|
||||
:key="item.id"
|
||||
:label="item.detectArea"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.equipment.EquipmentName')">
|
||||
<el-select v-model="listQuery.equipmentId" :placeholder="$t('module.basicData.equipment.EquipmentName')" clearable>
|
||||
<el-option
|
||||
v-for="item in equipmentArr"
|
||||
:key="item.equipmentId"
|
||||
:label="item.equipmentName"
|
||||
:value="item.equipmentId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getList()">{{ 'btn.search' | i18nFilter }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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 { detecParamList } from '@/api/quality-manage/detecParam'
|
||||
import { equipmentDetectAreaList } from '@/api/basicData/Equipment/equipmentDetectArea'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
/**
|
||||
* 表格表头配置项 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: 'detail',
|
||||
btnName: 'btn.detail'
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: i18n.t('module.quality.offlineDetec.EquipmentName'),
|
||||
align: 'center',
|
||||
width: '200px'
|
||||
},
|
||||
{
|
||||
prop: 'equipmentCode',
|
||||
label: i18n.t('module.quality.offlineDetec.EquipmentCode'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'equipmentArea',
|
||||
label: i18n.t('module.quality.offlineDetec.DetectionArea'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'equipmentDesc',
|
||||
label: i18n.t('module.quality.offlineDetec.EquipmentFunction'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'Material',
|
||||
components: { Pagination, BaseTable, MethodBtn },
|
||||
filters: {
|
||||
statusFilter(status) {
|
||||
const statusMap = {
|
||||
published: 'success',
|
||||
draft: 'info',
|
||||
deleted: 'danger'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
trueWidth: 240,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
equipmentId: '',
|
||||
detecAreaId: ''
|
||||
},
|
||||
equipmentArr: [],
|
||||
detectAreaArr: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'edit') {
|
||||
this.addNew(raw.data)
|
||||
} else {
|
||||
this.addNew(raw.data, true)
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
const params = {
|
||||
current: 1,
|
||||
size: 550
|
||||
}
|
||||
equipmentDetectAreaList(params).then(response => {
|
||||
if (response.data.records) {
|
||||
this.detectAreaArr = response.data.records
|
||||
} else {
|
||||
this.detectAreaArr.splice(0, this.equipmentArr.length)
|
||||
}
|
||||
})
|
||||
detecParamList(params).then(response => {
|
||||
if (response.data.records) {
|
||||
this.equipmentArr = response.data.records
|
||||
} else {
|
||||
this.equipmentArr.splice(0, this.equipmentArr.length)
|
||||
}
|
||||
})
|
||||
this.listLoading = true
|
||||
detecParamList(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
|
||||
})
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(data, isdetail) {
|
||||
this.$router.push({
|
||||
name: 'detecParamAdd',
|
||||
query: {
|
||||
data: data,
|
||||
isdetail: isdetail
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
108
src/views/QualityManager/offlineDetec/detecRegistration.vue
Normal file
108
src/views/QualityManager/offlineDetec/detecRegistration.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-04-06 19:33:11
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-06-29 16:47:13
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-container style="margin:30px">
|
||||
<el-aside style="width:250px">
|
||||
<el-tree :data="menuList" :props="defaultProps" @node-click="getOrganization" />
|
||||
</el-aside>
|
||||
<el-main style="border:2px solid #E4E4E4;border-radius:10px;margin-left:10px">
|
||||
<detecRegistration-list :equipment-data="equipmentData" :offline-param-arr="offlineParamArr" />
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import detecRegistrationList from './components/detecRegistrationList'
|
||||
import { equipmentDetectTreeList } from '@/api/basicData/Equipment/equipmentDetectArea'
|
||||
import { equipmentDetectParamList } from '@/api/basicData/Equipment/equipmentDetectParam'
|
||||
// import { getDetecRegistrationList } from '@/api/quality-manage/detecRegistration'
|
||||
export default {
|
||||
components: { detecRegistrationList },
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
addOrUpdateVisible: false,
|
||||
equipmentData: {
|
||||
equipmentId: '',
|
||||
name: ''
|
||||
},
|
||||
offlineParamArr: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
this.getOrganization({ detectEquipmentAreaId: '' })
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
const TreeListQuery = {
|
||||
current: 1,
|
||||
size: 500
|
||||
}
|
||||
this.menuList.splice(0, this.menuList.length)
|
||||
this.menuList = [
|
||||
{
|
||||
'name': '全部',
|
||||
'children': []
|
||||
}
|
||||
]
|
||||
const res = await equipmentDetectTreeList(TreeListQuery)
|
||||
if (res.code === 0) {
|
||||
this.menuList[0].children = res.data
|
||||
if (this.menuList[0].children) {
|
||||
this.menuList[0].children.forEach(item => {
|
||||
item.name = item.detectArea
|
||||
if (item.detectSystemVoList) {
|
||||
item.children = item.detectSystemVoList
|
||||
item.detectSystemVoList.forEach(item1 => {
|
||||
if (item1.equipmentVoList) { item1.children = item1.equipmentVoList }
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
getOrganization(data) {
|
||||
if (data.detectEquipmentAreaId) {
|
||||
this.equipmentData.equipmentId = data.id
|
||||
this.equipmentData.name = data.name
|
||||
} else {
|
||||
this.equipmentData.equipmentId = ''
|
||||
this.equipmentData.name = ''
|
||||
}
|
||||
const paramy = {
|
||||
detectEquipmentAreaId: data.detectEquipmentAreaId,
|
||||
name: '',
|
||||
current: 1,
|
||||
size: 999
|
||||
}
|
||||
equipmentDetectParamList(paramy).then(response => {
|
||||
if (response.data.records) {
|
||||
this.offlineParamArr = response.data.records
|
||||
} else {
|
||||
this.offlineParamArr.splice(0, this.offlineParamArr.length)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-container >>> .el-aside{
|
||||
border:2px solid #E4E4E4;
|
||||
border-radius:10px;
|
||||
background-color: white;
|
||||
min-height:550px;
|
||||
width:25%;
|
||||
padding-top:20px
|
||||
}
|
||||
</style>
|
||||
190
src/views/QualityManager/plan/AddForm.vue
Normal file
190
src/views/QualityManager/plan/AddForm.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<!--
|
||||
* @Date: 2021-02-01 16:12:13
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:42:34
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\AddForm.vue
|
||||
* @Description: 添加检测计划
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-bind="$attrs" :title="$t('module.quality.plan.addDialogTitle')" v-on="$listeners" @open="onOpen" @close="onClose">
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="180px">
|
||||
<el-form-item :label="$t('module.quality.plan.testPlaneName')" prop="testPlaneName">
|
||||
<el-input v-model="formData.testPlaneName" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.testPlaneCode')" prop="testPlaneCode">
|
||||
<el-input v-model="formData.testPlaneCode" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.areaCode')" prop="areaCode">
|
||||
<el-select
|
||||
v-model="formData.areaCode"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.deviceType"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.quality.plan.areaName')" prop="areaNameId">
|
||||
<el-select
|
||||
v-model="formData.areaNameId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in areaList"
|
||||
:key="index"
|
||||
:label="item.detectArea"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.distributionAreaName')" prop="areaNameId" label-width="185px">
|
||||
<el-select
|
||||
v-model="formData.areaNameId"
|
||||
disabled
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in areaList"
|
||||
:key="index"
|
||||
:label="item.distributionArea"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.detectionRateDicId')" prop="detectionRateDicId">
|
||||
<el-select
|
||||
v-model="formData.detectionRateDicId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.detectionPeriodList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.testPlaneContent')" prop="testPlaneContent">
|
||||
<el-input v-model="formData.testPlaneContent" clearable :style="{width: '100%'}" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.quality.plan.remark')" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="close">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="handelConfirm">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getDictDeviceType, detectionPeriod } from '@/api/dict'
|
||||
import { addPlanInfo } from '@/api/quality-manage/plan'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
areaList: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
testPlaneName: undefined,
|
||||
testPlaneCode: undefined,
|
||||
areaCode: undefined,
|
||||
areaNameId: undefined,
|
||||
// detectionRateDicId: undefined,
|
||||
// testPlaneContent: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
rules: {
|
||||
testPlaneName: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.plan.notEmpty'),
|
||||
trigger: 'change'
|
||||
}],
|
||||
// testPlaneContent: [{
|
||||
// required: true,
|
||||
// message: i18n.t('module.quality.plan.notEmpty'),
|
||||
// trigger: 'blur'
|
||||
// }],
|
||||
areaNameId: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.plan.notEmpty'),
|
||||
trigger: 'blur'
|
||||
}]
|
||||
// detectionRateDicId: [{
|
||||
// required: true,
|
||||
// message: i18n.t('module.quality.plan.notEmpty'),
|
||||
// trigger: 'blur'
|
||||
// }]
|
||||
},
|
||||
dict: {
|
||||
deviceType: [],
|
||||
detectionPeriodList: [],
|
||||
areaNameList: [{
|
||||
id: 'PID00A',
|
||||
name: 'PID00A'
|
||||
}, {
|
||||
id: 'PID00C',
|
||||
name: 'PID00C'
|
||||
}, {
|
||||
id: 'PID22-24',
|
||||
name: 'PID22-24'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
onOpen() {},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(async valid => {
|
||||
if (!valid) return
|
||||
const result = await addPlanInfo(this.formData)
|
||||
if (result.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功!'
|
||||
})
|
||||
this.$emit('done')
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
const result = await getDictDeviceType()
|
||||
this.dict.deviceType = result
|
||||
const result2 = await detectionPeriod()
|
||||
this.dict.detectionPeriodList = result2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
204
src/views/QualityManager/plan/EditForm.vue
Normal file
204
src/views/QualityManager/plan/EditForm.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<!--
|
||||
* @Date: 2021-02-01 16:12:13
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:43:04
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\EditForm.vue
|
||||
* @Description: 编辑设备类型配方
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-bind="$attrs" :title="$t('module.quality.plan.addDialogTitle')" v-on="$listeners" @open="onOpen" @close="onClose">
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="180px">
|
||||
<el-form-item :label="$t('module.quality.plan.testPlaneName')" prop="testPlaneName">
|
||||
<el-input v-model="formData.testPlaneName" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.testPlaneCode')" prop="testPlaneCode">
|
||||
<el-input v-model="formData.testPlaneCode" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.areaCode')" prop="areaCode">
|
||||
<el-select
|
||||
v-model="formData.areaCode"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.deviceType"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.quality.plan.areaName')" prop="areaNameId">
|
||||
<el-select
|
||||
v-model="formData.areaNameId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in areaList"
|
||||
:key="index"
|
||||
:label="item.detectArea"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.distributionAreaName')" prop="areaNameId" label-width="188px">
|
||||
<el-select
|
||||
v-model="formData.areaNameId"
|
||||
disabled
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in areaList"
|
||||
:key="index"
|
||||
:label="item.distributionArea"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.detectionRateDicId')" prop="detectionRateDicId">
|
||||
<el-select
|
||||
v-model="formData.detectionRateDicId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.detectionPeriodList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.testPlaneContent')" prop="testPlaneContent">
|
||||
<el-input v-model="formData.testPlaneContent" clearable :style="{width: '100%'}" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.quality.plan.remark')" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="close">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="handelConfirm">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getDictDeviceType, detectionPeriod } from '@/api/dict'
|
||||
import { editPlanInfo, getPlanInfo } from '@/api/quality-manage/plan'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
targetInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
areaList: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
testPlaneName: undefined,
|
||||
testPlaneCode: undefined,
|
||||
areaCode: undefined,
|
||||
areaNameId: undefined,
|
||||
// detectionRateDicId: undefined,
|
||||
// testPlaneContent: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
rules: {
|
||||
testPlaneName: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.plan.notEmpty'),
|
||||
trigger: 'change'
|
||||
}],
|
||||
// testPlaneContent: [{
|
||||
// required: true,
|
||||
// message: i18n.t('module.quality.plan.notEmpty'),
|
||||
// trigger: 'blur'
|
||||
// }],
|
||||
areaNameId: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.plan.notEmpty'),
|
||||
trigger: 'blur'
|
||||
}]
|
||||
// detectionRateDicId: [{
|
||||
// required: true,
|
||||
// message: i18n.t('module.quality.plan.notEmpty'),
|
||||
// trigger: 'blur'
|
||||
// }]
|
||||
},
|
||||
dict: {
|
||||
deviceType: [],
|
||||
detectionPeriodList: [],
|
||||
areaNameList: [{
|
||||
id: 'PID00A',
|
||||
name: 'PID00A'
|
||||
}, {
|
||||
id: 'PID00C',
|
||||
name: 'PID00C'
|
||||
}, {
|
||||
id: 'PID22-24',
|
||||
name: 'PID22-24'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.getInfo()
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(async valid => {
|
||||
if (!valid) return
|
||||
const result = await editPlanInfo(this.formData)
|
||||
if (result.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '修改成功!'
|
||||
})
|
||||
this.$emit('done')
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
const result = await getPlanInfo({
|
||||
id: this.targetInfo?.id
|
||||
})
|
||||
if (result.code === 0) {
|
||||
this.formData = result.data
|
||||
}
|
||||
},
|
||||
async getDict() {
|
||||
const result = await getDictDeviceType()
|
||||
this.dict.deviceType = result
|
||||
const result2 = await detectionPeriod()
|
||||
this.dict.detectionPeriodList = result2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
243
src/views/QualityManager/plan/index.vue
Normal file
243
src/views/QualityManager/plan/index.vue
Normal file
@@ -0,0 +1,243 @@
|
||||
<!--
|
||||
* @Date: 2020-12-15 15:36:52
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:40:43
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\index.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="usermanager-container">
|
||||
<div class="method-btn-area">
|
||||
{{ $t('module.quality.plan.areaName') + ':' }}
|
||||
<el-select v-model="listQuery.areaId" clearable>
|
||||
<el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.detectArea" />
|
||||
</el-select>
|
||||
{{ $t('module.quality.plan.testPlaneName') + ':' }}
|
||||
<el-input v-model="listQuery.inspectionPlanName" clearable :placeholder="$t('module.quality.plan.searchPlaceholder')" style="width: 200px;" />
|
||||
<!-- <el-select v-model="listQuery.equipmentType" :placeholder="$t('module.equipmentManager.recipe.devicetypeselect')" clearable style="width: 200px;">
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.deviceType"
|
||||
:key="'device-' + index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select> -->
|
||||
<el-button @click="getList">{{ 'btn.search' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="showDialog = true">{{ 'btn.add' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
<base-table :table-config="tableProps" :table-data="list" :is-loading="listLoading" :page="listQuery.current" :limit="listQuery.size">
|
||||
<method-btn slot="handleBtn" :method-list="tableBtn" @clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" @pagination="getList" />
|
||||
<add-form :visible.sync="showDialog" :area-list="areaList" @done="getList" />
|
||||
<edit-form :visible.sync="showEditDialog" :area-list="areaList" :target-info="{id: curEditId}" @done="getList" />
|
||||
<send-form :visible.sync="showSendDialog" :target-info="{id: curEditId, distributionAreaName}" @done="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dataDict from '@/filters/DataDict'
|
||||
import { timeFormatter } from '@/filters'
|
||||
// edit here
|
||||
const tableBtn = [{
|
||||
type: 'func',
|
||||
btnName: 'btn.sendPlan'
|
||||
}, {
|
||||
type: 'edit',
|
||||
btnName: 'btn.edit'
|
||||
}, {
|
||||
type: 'delete',
|
||||
btnName: 'btn.delete'
|
||||
}, {
|
||||
type: 'detail',
|
||||
btnName: 'btn.detail'
|
||||
}]
|
||||
const tableProps = [{
|
||||
prop: 'testPlaneCode',
|
||||
label: i18n.t('module.quality.plan.testPlaneCode'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'testPlaneName',
|
||||
label: i18n.t('module.quality.plan.testPlaneName'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'detecAreaName',
|
||||
label: i18n.t('module.quality.plan.areaName'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'distributionAreaName',
|
||||
label: i18n.t('module.quality.plan.distributionAreaName'),
|
||||
align: 'center',
|
||||
width: '200px'
|
||||
}, {
|
||||
prop: 'isIssued',
|
||||
label: i18n.t('module.quality.plan.isIssued'),
|
||||
align: 'center',
|
||||
filter: dataDict('yesOrNo')
|
||||
}, {
|
||||
prop: 'issuedTime',
|
||||
label: i18n.t('module.quality.plan.issuedTime'),
|
||||
align: 'center',
|
||||
filter: timeFormatter
|
||||
}, {
|
||||
prop: 'remark',
|
||||
label: i18n.t('module.quality.plan.remark'),
|
||||
align: 'center'
|
||||
}]
|
||||
// {
|
||||
// prop: 'testPlaneContent',
|
||||
// label: i18n.t('module.quality.plan.testPlaneContent'),
|
||||
// align: 'center'
|
||||
// },
|
||||
// {
|
||||
// // dictionaryDetectionRate
|
||||
// prop: 'detectionRateDicId',
|
||||
// label: i18n.t('module.quality.plan.detectionRateDicId'),
|
||||
// align: 'center',
|
||||
// subcomponent: DictFilter,
|
||||
// filter: detectionPeriod
|
||||
// },
|
||||
import AddForm from './AddForm'
|
||||
import EditForm from './EditForm'
|
||||
import sendForm from './sendForm'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import { objFilter } from '@/utils'
|
||||
import { getDictDeviceType } from '@/api/dict'
|
||||
// , detectionPeriod
|
||||
// import DictFilter from '@/components/BaseTable/subcomponents/DataDictFilter'
|
||||
import { getPlanList, delPlanInfo, getArea } from '@/api/quality-manage/plan'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
name: 'QualityPlanManager',
|
||||
components: { Pagination, BaseTable, MethodBtn, AddForm, EditForm, sendForm },
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
showDialog: false,
|
||||
showSendDialog: false,
|
||||
curEditId: null,
|
||||
showEditDialog: false,
|
||||
areaList: [],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
equipmentType: null,
|
||||
inspectionPlanName: '',
|
||||
areaId: null
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
dictData: {
|
||||
deviceType: []
|
||||
},
|
||||
distributionAreaName: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getDict()
|
||||
this.getAreaList()
|
||||
this.getList()
|
||||
// this.listLoading = false
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
handleNodeClick() {},
|
||||
handleClick(raw) {
|
||||
console.log(raw)
|
||||
switch (raw.type) {
|
||||
case 'delete':
|
||||
this.$confirm(i18n.t('deleteMsgBox.content'), i18n.t('deleteMsgBox.hint'), {
|
||||
confirmButtonText: i18n.t('btn.confirm'),
|
||||
cancelButtonText: i18n.t('btn.cancel'),
|
||||
type: 'warning'
|
||||
}).then(async() => {
|
||||
// 走接口
|
||||
const result = await delPlanInfo({
|
||||
id: raw.data.id
|
||||
})
|
||||
if (result.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: i18n.t('deleteMsgBox.doneMsg')
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
this.showEditDialog = true
|
||||
this.curEditId = raw.data.id
|
||||
break
|
||||
case 'detail':
|
||||
this.$router.push({
|
||||
name: 'PlanParamManage',
|
||||
query: {
|
||||
id: raw.data.id,
|
||||
areaNameId: raw.data.areaNameId
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'func':
|
||||
this.distributionAreaName = raw.data.distributionAreaName
|
||||
this.showSendDialog = true
|
||||
this.curEditId = raw.data.id
|
||||
break
|
||||
}
|
||||
},
|
||||
async getList() {
|
||||
this.listLoading = true
|
||||
// edit here
|
||||
const res = await getPlanList(objFilter(this.listQuery))
|
||||
if (res.code === 0) {
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
this.listLoading = false
|
||||
}
|
||||
},
|
||||
async getDict() {
|
||||
const result = await getDictDeviceType()
|
||||
this.dict.deviceType = result
|
||||
},
|
||||
async getAreaList() {
|
||||
const result = await getArea({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
this.areaList = result.data.records
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.usermanager-container {
|
||||
padding: 20px;
|
||||
.method-btn-area {
|
||||
padding: 15px 30px;
|
||||
margin: 10px 0 20px 0;
|
||||
border: 1px solid #dfe6ec;
|
||||
}
|
||||
.tree-select-container {
|
||||
border: 1px solid #dfe6ec;
|
||||
min-height: 400px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
147
src/views/QualityManager/plan/issuedplan.vue
Normal file
147
src/views/QualityManager/plan/issuedplan.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<!--
|
||||
* @Date: 2020-12-15 15:36:52
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2021-03-25 20:39:57
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\issuedplan.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="usermanager-container">
|
||||
<div class="method-btn-area">
|
||||
<el-input v-model="listQuery.inspectionPlanName" clearable :placeholder="$t('module.quality.plan.searchPlaceholder')" style="width: 200px;" />
|
||||
<el-input v-model="listQuery.area" clearable :placeholder="$t('module.quality.plan.searchPlaceholderArea')" style="width: 200px;" />
|
||||
<el-date-picker
|
||||
v-model="listQuery.startTime"
|
||||
type="datetime"
|
||||
:placeholder="$t('module.quality.plan.placeholderStartTime')"
|
||||
clearable
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="listQuery.endTime"
|
||||
type="datetime"
|
||||
:placeholder="$t('module.quality.plan.placeholderEndTime')"
|
||||
clearable
|
||||
/>
|
||||
<el-button @click="getList">{{ 'btn.search' | i18nFilter }}</el-button>
|
||||
<!-- <el-button type="primary" @click="showDialog = true">{{ 'btn.add' | i18nFilter }}</el-button> -->
|
||||
</div>
|
||||
<base-table :table-config="tableProps" :table-data="list" :is-loading="listLoading" :page="listQuery.current" :limit="listQuery.size">
|
||||
<!-- <method-btn slot="handleBtn" :method-list="tableBtn" @clickBtn="handleClick" /> -->
|
||||
</base-table>
|
||||
<pagination :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" @pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dataDict from '@/filters/DataDict'
|
||||
import { timeFormatter } from '@/filters'
|
||||
// edit here
|
||||
const tableProps = [{
|
||||
prop: 'testPlaneName',
|
||||
label: i18n.t('module.quality.plan.testPlaneName'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'areaName',
|
||||
label: i18n.t('module.quality.plan.areaName'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'isSucceed',
|
||||
label: i18n.t('module.quality.plan.isIssued'),
|
||||
align: 'center',
|
||||
filter: dataDict('yesOrNo')
|
||||
}, {
|
||||
prop: 'issueTime',
|
||||
label: i18n.t('module.quality.plan.issuedTime'),
|
||||
align: 'center',
|
||||
filter: timeFormatter
|
||||
}, {
|
||||
prop: 'remark',
|
||||
label: i18n.t('module.quality.plan.remark'),
|
||||
align: 'center'
|
||||
}]
|
||||
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import { objFilter } from '@/utils'
|
||||
import { getDictDeviceType } from '@/api/dict'
|
||||
// edit here
|
||||
import { sentPlanList } from '@/api/quality-manage/plan'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
name: 'QualityPlanManager',
|
||||
components: { Pagination, BaseTable },
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
showDialog: false,
|
||||
curEditId: null,
|
||||
showEditDialog: false,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
area: null,
|
||||
inspectionPlanName: '',
|
||||
endTime: null,
|
||||
startTime: null
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
dictData: {
|
||||
deviceType: []
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getDict()
|
||||
this.getList()
|
||||
// this.listLoading = false
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
async getList() {
|
||||
this.listLoading = true
|
||||
// edit here
|
||||
const res = await sentPlanList(objFilter(this.listQuery))
|
||||
if (res.code === 0) {
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
this.listLoading = false
|
||||
}
|
||||
},
|
||||
async getDict() {
|
||||
const result = await getDictDeviceType()
|
||||
this.dict.deviceType = result
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.usermanager-container {
|
||||
padding: 20px;
|
||||
.method-btn-area {
|
||||
padding: 15px 30px;
|
||||
margin: 10px 0 20px 0;
|
||||
border: 1px solid #dfe6ec;
|
||||
}
|
||||
.tree-select-container {
|
||||
border: 1px solid #dfe6ec;
|
||||
min-height: 400px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
117
src/views/QualityManager/plan/sendForm.vue
Normal file
117
src/views/QualityManager/plan/sendForm.vue
Normal file
@@ -0,0 +1,117 @@
|
||||
<!--
|
||||
* @Date: 2021-02-01 16:12:13
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:44:09
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\sendForm.vue
|
||||
* @Description: 添加检测计划
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-bind="$attrs" :title="$t('module.quality.plan.sendDialogTitle')" v-on="$listeners" @open="onOpen" @close="onClose">
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="150px">
|
||||
<el-form-item :label="$t('module.quality.plan.operatorId')" prop="operatorId">
|
||||
<el-select
|
||||
v-model="formData.operatorId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.worker"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.distributionAreaName')" prop="distributionAreaName" label-width="175px">
|
||||
{{ targetInfo.distributionAreaName }}
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.remark')" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="close">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="handelConfirm">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getDictWorker } from '@/api/dict'
|
||||
import { editPlanInfo, sendPlan } from '@/api/quality-manage/plan'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
targetInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
operatorId: undefined,
|
||||
qualityInspectionPlanId: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
rules: {
|
||||
operatorId: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.plan.notEmpty'),
|
||||
trigger: 'change'
|
||||
}]
|
||||
},
|
||||
dict: {
|
||||
deviceType: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.formData.qualityInspectionPlanId = this.targetInfo?.id
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(async valid => {
|
||||
if (!valid) return
|
||||
const result = await editPlanInfo({
|
||||
id: this.formData.qualityInspectionPlanId,
|
||||
issuedTime: new Date()
|
||||
})
|
||||
if (result.code === 0) {
|
||||
const res = await sendPlan(this.formData)
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功!'
|
||||
})
|
||||
this.$emit('done')
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
const result = await getDictWorker()
|
||||
this.dict.worker = result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
106
src/views/QualityManager/plan/subpage/AddForm.vue
Normal file
106
src/views/QualityManager/plan/subpage/AddForm.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<!--
|
||||
* @Date: 2021-01-09 16:25:11
|
||||
* @LastEditors: guo
|
||||
* @LastEditTime: 2021-03-13 17:12:07
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\subpage\AddForm.vue
|
||||
* @Description: 设备配方添加参数
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-bind="$attrs" :title="$t('module.quality.planDetail.addDialogTitle')" v-on="$listeners" @open="onOpen" @close="onClose">
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="150px">
|
||||
<el-form-item :label="$t('module.quality.planDetail.name')" prop="name">
|
||||
<el-input v-model="formData.name" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.planDetail.references')" prop="references">
|
||||
<el-input v-model="formData.references" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.planDetail.remark')" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="close">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="handelConfirm">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { addPlanParamInfo } from '@/api/quality-manage/plan'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
targetInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
name: undefined,
|
||||
inspectionPlanId: null,
|
||||
references: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
rules: {
|
||||
name: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.planDetail.notEmpty'),
|
||||
trigger: 'change'
|
||||
}],
|
||||
references: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.planDetail.notEmpty'),
|
||||
trigger: 'blur'
|
||||
}],
|
||||
remark: []
|
||||
},
|
||||
dict: {
|
||||
param: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.formData.inspectionPlanId = this.targetInfo?.id
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(async valid => {
|
||||
if (!valid) return
|
||||
const result = await addPlanParamInfo(this.formData)
|
||||
if (result.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功!'
|
||||
})
|
||||
this.$emit('done')
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
// const result = await getDictMaterial()
|
||||
// if (result.code === 0) {
|
||||
// this.dict.material = result.data
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
109
src/views/QualityManager/plan/subpage/EditForm.vue
Normal file
109
src/views/QualityManager/plan/subpage/EditForm.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<!--
|
||||
* @Date: 2021-01-09 16:25:11
|
||||
* @LastEditors: guo
|
||||
* @LastEditTime: 2021-03-13 17:15:16
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\subpage\EditForm.vue
|
||||
* @Description: 设备配方添加参数
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-bind="$attrs" :title="$t('module.quality.planDetail.addDialogTitle')" v-on="$listeners" @open="onOpen" @close="onClose">
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="150px">
|
||||
<el-form-item :label="$t('module.quality.planDetail.name')" prop="name">
|
||||
<el-input v-model="formData.name" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.planDetail.references')" prop="references">
|
||||
<el-input v-model="formData.references" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.planDetail.remark')" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="close">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="handelConfirm">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { editPlanParamInfo, getPlanParamInfo } from '@/api/quality-manage/plan'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
targetInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
name: undefined,
|
||||
inspectionPlanId: null,
|
||||
references: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
rules: {
|
||||
name: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.planDetail.notEmpty'),
|
||||
trigger: 'change'
|
||||
}],
|
||||
references: [{
|
||||
required: true,
|
||||
message: i18n.t('module.quality.planDetail.notEmpty'),
|
||||
trigger: 'blur'
|
||||
}],
|
||||
remark: []
|
||||
},
|
||||
dict: {
|
||||
param: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.formData.inspectionPlanId = this.targetInfo?.id
|
||||
this.getInfo()
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(async valid => {
|
||||
if (!valid) return
|
||||
const result = await editPlanParamInfo(this.formData)
|
||||
if (result.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功!'
|
||||
})
|
||||
this.$emit('done')
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
const result = await getPlanParamInfo({
|
||||
id: this.targetInfo?.id
|
||||
})
|
||||
if (result.code === 0) {
|
||||
this.formData = result.data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
281
src/views/QualityManager/plan/subpage/detail.vue
Normal file
281
src/views/QualityManager/plan/subpage/detail.vue
Normal file
@@ -0,0 +1,281 @@
|
||||
<!--
|
||||
* @Date: 2020-12-15 15:36:52
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 14:04:37
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\plan\subpage\detail.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="bom-form-container">
|
||||
<el-form ref="elForm" :model="formData" size="medium" label-width="200px">
|
||||
<el-form-item :label="$t('module.quality.plan.testPlaneName')" prop="testPlaneName">
|
||||
<el-input v-model="formData.testPlaneName" clearable :style="{width: '100%'}" :disabled="pagetype" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.testPlaneCode')" prop="testPlaneCode">
|
||||
<el-input v-model="formData.testPlaneCode" clearable :style="{width: '100%'}" :disabled="pagetype" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.areaName')" prop="areaNameId">
|
||||
<el-select
|
||||
v-model="formData.areaNameId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:disabled="pagetype"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in areaList"
|
||||
:key="index"
|
||||
:label="item.detectArea"
|
||||
:value="item.id"
|
||||
:disabled="pagetype"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.plan.distributionAreaName')" prop="areaNameId">
|
||||
<el-select
|
||||
v-model="formData.areaNameId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:disabled="pagetype"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in areaList"
|
||||
:key="index"
|
||||
:label="item.distributionArea"
|
||||
:value="item.id"
|
||||
:disabled="pagetype"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.detectionRateDicId')" prop="detectionRateDicId">
|
||||
<el-select
|
||||
v-model="formData.detectionRateDicId"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:disabled="pagetype"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.deviceType"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('module.quality.plan.testPlaneContent')" prop="testPlaneContent">
|
||||
<el-input v-model="formData.testPlaneContent" clearable :style="{width: '100%'}" :disabled="pagetype" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.quality.plan.remark')" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable :style="{width: '100%'}" :disabled="pagetype" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="sub-table-container">
|
||||
<el-divider>{{ $t('module.quality.planDetail.title') }}</el-divider>
|
||||
<!-- <div class="method-btn-area">
|
||||
<el-button type="primary" style="float: right;margin: 0 20px;" @click="showDialog = true">{{ 'btn.add' | i18nFilter }}</el-button>
|
||||
</div> -->
|
||||
<base-table :table-config="tableProps" :table-data="list" :is-loading="listLoading" :page="listQuery.current" :limit="listQuery.size">
|
||||
<method-btn slot="handleBtn" @clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
<pagination :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" @pagination="getList" />
|
||||
<!-- <add-form :visible.sync="showDialog" :target-info="{id: listQuery.detectDistributionAreaId}" @done="getList" />
|
||||
<edit-form :visible.sync="showEditDialog" :target-info="{id: curEditId, fatherId: listQuery.detectDistributionAreaId}" @done="getList" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import CheckDetail from '@/components/BaseTable/subcomponents/CheckDetail'
|
||||
// edit here
|
||||
import dataDict from '@/filters/DataDict'
|
||||
// import { timeFormatter } from '@/filters'
|
||||
// const tableBtn = [{
|
||||
// type: 'edit',
|
||||
// btnName: 'btn.edit'
|
||||
// }, {
|
||||
// type: 'delete',
|
||||
// btnName: 'btn.delete'
|
||||
// }]
|
||||
const tableProps = [{
|
||||
prop: 'equipmentName',
|
||||
label: i18n.t('module.quality.planDetail.equipmentName'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'name',
|
||||
label: i18n.t('module.quality.planDetail.name'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'value',
|
||||
label: i18n.t('module.quality.planDetail.references'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'distribution',
|
||||
label: i18n.t('module.quality.plan.isIssued'),
|
||||
align: 'center',
|
||||
filter: dataDict('yesOrNo')
|
||||
}, {
|
||||
prop: 'testFrequency',
|
||||
label: i18n.t('module.quality.planDetail.testFrequency'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'testSystem',
|
||||
label: i18n.t('module.quality.planDetail.testSystem'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'description',
|
||||
label: i18n.t('module.quality.planDetail.description'),
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'remark',
|
||||
label: i18n.t('module.quality.planDetail.remark'),
|
||||
align: 'center'
|
||||
}]
|
||||
// import AddForm from './AddForm'
|
||||
// import EditForm from './EditForm'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
// edit here
|
||||
// import { objFilter } from '@/utils'
|
||||
import { getPlanInfo, getPlanParamList, delPlanParamInfo, getArea } from '@/api/quality-manage/plan'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import i18n from '@/lang'
|
||||
export default {
|
||||
name: 'BOMForm',
|
||||
components: { Pagination, BaseTable, MethodBtn },
|
||||
// , AddForm, EditForm
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
showDialog: false,
|
||||
curEditId: null,
|
||||
showEditDialog: false,
|
||||
listQuery: {
|
||||
enabled: 1,
|
||||
detectDistributionAreaId: null,
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
formData: {
|
||||
testPlaneName: undefined,
|
||||
testPlaneCode: undefined,
|
||||
areaCode: undefined,
|
||||
areaName: undefined,
|
||||
detectionRateDicId: undefined,
|
||||
testPlaneContent: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
dict: {
|
||||
deviceType: []
|
||||
},
|
||||
areaList: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pagetype() {
|
||||
return true
|
||||
// return false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.$route.query)
|
||||
this.listQuery.detectDistributionAreaId = this.$route.query.areaNameId
|
||||
this.getAreaList()
|
||||
this.getDetail()
|
||||
this.getList()
|
||||
// this.listLoading = false
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
console.log(raw)
|
||||
switch (raw.type) {
|
||||
case 'delete':
|
||||
this.$confirm(i18n.t('deleteMsgBox.content'), i18n.t('deleteMsgBox.hint'), {
|
||||
confirmButtonText: i18n.t('btn.confirm'),
|
||||
cancelButtonText: i18n.t('btn.cancel'),
|
||||
type: 'warning'
|
||||
}).then(async() => {
|
||||
// 走接口
|
||||
const result = await delPlanParamInfo({
|
||||
id: raw.data.id
|
||||
})
|
||||
if (result.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: i18n.t('deleteMsgBox.doneMsg')
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
this.showEditDialog = true
|
||||
this.curEditId = raw.data.id
|
||||
break
|
||||
}
|
||||
},
|
||||
async getList() {
|
||||
this.listLoading = true
|
||||
// edit here
|
||||
const res = await getPlanParamList(this.listQuery)
|
||||
if (res.code === 0) {
|
||||
this.list = res.data ? res.data : []
|
||||
this.listLoading = false
|
||||
}
|
||||
},
|
||||
async getDetail() {
|
||||
const result = await getPlanInfo({
|
||||
id: this.$route.query.id
|
||||
})
|
||||
if (result.code === 0) {
|
||||
this.formData = result.data
|
||||
// console.log(result)
|
||||
}
|
||||
},
|
||||
async getAreaList() {
|
||||
const result = await getArea({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
this.areaList = result.data.records
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['elForm'].validate(valid => {
|
||||
if (!valid) return
|
||||
// TODO 提交表单
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
saveForm() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/styles/mixin.scss";
|
||||
.bom-form-container {
|
||||
padding: 20px;
|
||||
.method-btn-area {
|
||||
padding: 15px 30px;
|
||||
margin: 10px 0 20px 0;
|
||||
border: 1px solid #dfe6ec;
|
||||
@include clearfix;
|
||||
}
|
||||
.sub-table-container {
|
||||
margin-top: 80px;
|
||||
}
|
||||
}
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
303
src/views/QualityManager/scrap/ScrapInfo-add.vue
Normal file
303
src/views/QualityManager/scrap/ScrapInfo-add.vue
Normal file
@@ -0,0 +1,303 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-20 11:03:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
@close="onClose"
|
||||
>
|
||||
<el-row :gutter="15" style="padding: 0 20px;">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="rules"
|
||||
size="medium"
|
||||
label-width="150px"
|
||||
label-position="right"
|
||||
>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.updateTime')" prop="registerTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.registerTime"
|
||||
format="yyyy-MM-dd"
|
||||
:style="{width: '100%'}"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.updateTime')])"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.RegisterPerson')" prop="registerPerson">
|
||||
<!-- <el-input v-model="dataForm.registerPerson" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.RegisterPerson')])" clearable :style="{width: '100%'}" /> -->
|
||||
<el-select
|
||||
v-model="dataForm.registerPerson"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.RegisterPerson')])"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.worker"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.entryType')" prop="entryType">
|
||||
<!-- <el-input v-model="dataForm.registerPerson" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.RegisterPerson')])" clearable :style="{width: '100%'}" /> -->
|
||||
<el-select
|
||||
v-model="dataForm.entryType"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.entryType')])"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in entryType"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.workOrderId')" prop="workOrderId">
|
||||
<el-select
|
||||
v-model="dataForm.workOrderId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.workOrderId')])"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.orderList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.source')" prop="source">
|
||||
<el-input v-model="dataForm.source" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.source')])" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.PlateId')" prop="substrateId">
|
||||
<el-input v-model="dataForm.substrateId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.PlateId')])" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.name')" prop="equipmentId">
|
||||
<el-select v-model="dataForm.equipmentId" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.name')])" clearable :style="{width: '100%'}" @change="getScrapGrade">
|
||||
<el-option
|
||||
v-for="(item, index) in device"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id "
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="tag" :label="$t('module.basicData.ScrapInfo.wasteGrade')" prop="ewasteGrade">
|
||||
<el-input v-model="wasteGrade" clear readonly :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.wasteGrade')])" :disabled="true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.cause')" prop="scrapReasonId">
|
||||
<!-- <el-input v-model="dataForm.registerPerson" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.RegisterPerson')])" clearable :style="{width: '100%'}" /> -->
|
||||
<el-select
|
||||
v-model="dataForm.scrapReasonId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.cause')])"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.scrapReason"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.remark')" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.remark')])" clearable :style="{width: '100%'}" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/lang'
|
||||
import { getScrapInfo, editScrapInfo, addScrapInfo, getScrap } from '@/api/quality-manage/scrap'
|
||||
import { scrapReasonList } from '@/api/dict'
|
||||
import { getDictWorker } from '@/api/dict'
|
||||
import { getEqList } from '@/api/equipment/maintain'
|
||||
import { workOrderList } from '@/api/orderManage/workOrder/workOrder'
|
||||
|
||||
const wasteGradeArr = [{
|
||||
value: '加工可用',
|
||||
label: i18n.t('module.basicData.ScrapInfo.completeWaste')
|
||||
},
|
||||
{
|
||||
value: '完全废品',
|
||||
label: i18n.t('module.basicData.ScrapInfo.CanBeUsedAfterProcessing')
|
||||
}]
|
||||
|
||||
const entryType = [{
|
||||
value: '2',
|
||||
label: i18n.t('module.basicData.ScrapInfo.manual')
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: i18n.t('module.basicData.ScrapInfo.automatic')
|
||||
}]
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
source: undefined,
|
||||
registerTime: undefined,
|
||||
registerPerson: undefined,
|
||||
scrapGrade: undefined,
|
||||
description: undefined,
|
||||
substrateId: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
wasteGradeArr,
|
||||
entryType,
|
||||
rules: {
|
||||
name: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.ScrapInfo.WasteName')]),
|
||||
trigger: 'blur'
|
||||
}],
|
||||
code: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.ScrapInfo.WasteCode')]),
|
||||
trigger: 'blur'
|
||||
}],
|
||||
equipmentId: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.ScrapInfo.equipmentId')]),
|
||||
trigger: 'change'
|
||||
}],
|
||||
substrateId: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.ScrapInfo.PlateId')]),
|
||||
trigger: 'blur'
|
||||
}],
|
||||
registerPerson: [{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.ScrapInfo.registerPerson')]),
|
||||
trigger: 'change'
|
||||
}]
|
||||
},
|
||||
dict: {
|
||||
worker: [],
|
||||
scrapReason: [],
|
||||
orderList: []
|
||||
},
|
||||
device: [],
|
||||
wasteGrade: '',
|
||||
tag: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
getScrapGrade(val) {
|
||||
getScrap(val).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.data) {
|
||||
this.tag = true
|
||||
this.wasteGrade = res.data.dataName
|
||||
} else {
|
||||
this.tag = false
|
||||
this.wasteGrade = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || ''
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
getScrapInfo({ id: this.dataForm.id }).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.dataForm.id) {
|
||||
console.log(this.device)
|
||||
editScrapInfo(this.dataForm).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
addScrapInfo(this.dataForm).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
const result3 = await workOrderList({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
console.log(result3)
|
||||
this.dict.orderList = result3.data.records
|
||||
const result1 = await getEqList({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
if (result1.code === 0) {
|
||||
this.device = result1.data.records
|
||||
}
|
||||
const result = await getDictWorker()
|
||||
this.dict.worker = result
|
||||
const result2 = await scrapReasonList()
|
||||
this.dict.scrapReason = result2
|
||||
// this.dict.orderList = result3.data.records
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
60
src/views/QualityManager/scrap/ScrapInfoCause.vue
Normal file
60
src/views/QualityManager/scrap/ScrapInfoCause.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<!--
|
||||
* @Date: 2021-01-07 20:09:37
|
||||
* @LastEditors: guo
|
||||
* @LastEditTime: 2021-03-18 15:19:21
|
||||
* @FilePath: \basic-admin\src\views\QualityManager\scrap\ScrapInfoCause.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
<el-button type="text" size="small" @click="emitClick">{{ $t('module.basicData.ScrapInfo.cause') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getscrapReason } from '@/api/quality-manage/scrap'
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async emitClick() {
|
||||
const h = this.$createElement
|
||||
await this.getReason()
|
||||
await this.$msgbox({
|
||||
title: this.$t('module.basicData.ScrapInfo.cause'),
|
||||
message: h('div', null, [
|
||||
h('span', null, `${this.$t('module.basicData.ScrapInfo.scrapType')}:${this.formData.scrapType}`),
|
||||
h('br'),
|
||||
h('div', null, `${this.$t('module.basicData.ScrapInfo.cause')}:${this.formData.scrap}`)
|
||||
]),
|
||||
showCancelButton: false,
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText')
|
||||
})
|
||||
},
|
||||
async getReason() {
|
||||
if (this.injectData.scrapReasonId) {
|
||||
const result = await getscrapReason({
|
||||
id: this.injectData.scrapReasonId
|
||||
})
|
||||
if (result.code === 0) {
|
||||
this.formData = result.data
|
||||
}
|
||||
} else {
|
||||
this.formData = {
|
||||
scrapType: '暂无',
|
||||
scrap: '暂无'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
119
src/views/QualityManager/scrap/components/barChart.vue
Normal file
119
src/views/QualityManager/scrap/components/barChart.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-03-03 16:39:34
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-23 10:26:44
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :id="id" :style="barStyle" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return 'barChart'
|
||||
}
|
||||
},
|
||||
barStyle: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
series: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
color: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return ['#5470C6']
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
series: {
|
||||
handler() {
|
||||
this.init()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
addEventListener('resize', () => {
|
||||
this.chart.resize()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
|
||||
this.chart.setOption({
|
||||
color: this.color,
|
||||
title: this.title,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
legend: this.legend,
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: this.xAxis,
|
||||
yAxis: this.yAxis,
|
||||
series: this.series
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
36
src/views/QualityManager/scrap/filters/index.js
Normal file
36
src/views/QualityManager/scrap/filters/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* @Date: 2020-12-29 16:49:28
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2021-04-13 13:49:51
|
||||
* @FilePath: \basic-admin\src\filters\DataDict\index.js
|
||||
* @Description: 部分常量的数据字典定义
|
||||
*/
|
||||
|
||||
import { scrapReasonList } from '@/api/dict'
|
||||
import { getEqList } from '@/api/equipment/maintain'
|
||||
|
||||
const table = {
|
||||
device: {},
|
||||
scrap: {}
|
||||
}
|
||||
|
||||
getEqList({
|
||||
current: 1,
|
||||
size: 999
|
||||
}).then(res => {
|
||||
res.data.records.map(item => {
|
||||
table.device[item.id] = item.name
|
||||
})
|
||||
})
|
||||
|
||||
scrapReasonList().then(res => {
|
||||
res.map(item => {
|
||||
table.scrap[item.id] = item.name
|
||||
})
|
||||
})
|
||||
|
||||
export default function(dictTable) {
|
||||
return function(val) {
|
||||
return table?.[dictTable]?.[val]
|
||||
}
|
||||
}
|
||||
267
src/views/QualityManager/scrap/index.vue
Normal file
267
src/views/QualityManager/scrap/index.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 15:41:11
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 13:39:35
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:inline="true"
|
||||
size="medium"
|
||||
label-width="130px"
|
||||
>
|
||||
<el-form-item v-if="false" :label="$t('module.basicData.ScrapInfo.PlateId')" prop="basalId">
|
||||
<el-input v-model="formData.basalId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.PlateId')])" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.TimePeriod')" prop="time">
|
||||
<el-date-picker
|
||||
v-model="formData.timeSlot"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
:start-placeholder="$t('module.basicData.ScrapInfo.StartTime')"
|
||||
:end-placeholder="$t('module.basicData.ScrapInfo.EndTime')"
|
||||
:range-separator="$t('module.basicData.ScrapInfo.To')"
|
||||
clearable
|
||||
/>
|
||||
<!-- value-format="yyyy-MM-dd" -->
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.ScrapInfo.name')" prop="equipmentId">
|
||||
<el-select v-model="formData.equipmentId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.ScrapInfo.name')])" clearable :style="{width: '100%'}" filterable>
|
||||
<el-option
|
||||
v-for="(item, index) in device"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList()"> {{ 'btn.search' | i18nFilter }} </el-button>
|
||||
<el-button type="primary" @click="addNew()"> {{ 'btn.add' | i18nFilter }} </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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="formData.current"
|
||||
:limit.sync="formData.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
<ScrapInfo-add v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getScrapList, delScrapInfo } from '@/api/quality-manage/scrap'
|
||||
import { scrapReasonList } from '@/api/dict'
|
||||
import ScrapInfoAdd from './ScrapInfo-add.vue'
|
||||
// import ScrapInfoCause from './ScrapInfoCause.vue'
|
||||
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 i18n from '@/lang'
|
||||
import { getEqList } from '@/api/equipment/maintain'
|
||||
// import DictFilter from '@/components/BaseTable/subcomponents/DataDictFilter'
|
||||
/**
|
||||
* 表格表头配置项 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
|
||||
// },
|
||||
{
|
||||
prop: 'source',
|
||||
label: i18n.t('module.basicData.ScrapInfo.source'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'scrapGradeDic',
|
||||
label: i18n.t('module.basicData.ScrapInfo.wasteGrade'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: i18n.t('module.basicData.ScrapInfo.name'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'substrateId',
|
||||
label: i18n.t('module.basicData.ScrapInfo.PlateId'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'registerPersonName',
|
||||
label: i18n.t('module.basicData.ScrapInfo.RegisterPerson'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'updateTime',
|
||||
label: i18n.t('module.basicData.ScrapInfo.updateTime'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'scrapReason',
|
||||
label: i18n.t('module.basicData.ScrapInfo.cause'),
|
||||
align: 'center'
|
||||
}
|
||||
// {
|
||||
// prop: 'scrapReasonId',
|
||||
// label: i18n.t('module.basicData.ScrapInfo.cause'),
|
||||
// subcomponent: ScrapInfoCause,
|
||||
// align: 'center'
|
||||
// // filter: scrapReasonList
|
||||
// }
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'ScrapInfo',
|
||||
components: { Pagination, BaseTable, MethodBtn, ScrapInfoAdd },
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
formData: {
|
||||
timeSlot: null,
|
||||
basalId: '',
|
||||
current: 1,
|
||||
size: 10,
|
||||
id: ''
|
||||
},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
dict: {
|
||||
scrap: []
|
||||
},
|
||||
device: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(i18n.t('deleteMsgBox.content'), i18n.t('deleteMsgBox.hint'), {
|
||||
confirmButtonText: i18n.t('btn.confirm'),
|
||||
cancelButtonText: i18n.t('btn.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delScrapInfo({ id: raw.data.id }).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
if (this.formData.timeSlot) {
|
||||
this.formData.startTime = this.formData.timeSlot[0]
|
||||
this.formData.endTime = this.formData.timeSlot[1]
|
||||
} else {
|
||||
this.formData.startTime = ''
|
||||
this.formData.endTime = ''
|
||||
}
|
||||
getScrapList(this.formData).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
console.log(this.list)
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
const result1 = await getEqList({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
if (result1.code === 0) {
|
||||
this.device = result1.data.records
|
||||
}
|
||||
const result = await scrapReasonList()
|
||||
this.dict.scrap = result
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
225
src/views/QualityManager/scrap/scrapCategoryStatistics.vue
Normal file
225
src/views/QualityManager/scrap/scrapCategoryStatistics.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 15:41:11
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-20 10:54:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:inline="true"
|
||||
size="medium"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item v-if="false" :label="$t('module.quality.ScrapInfo.PlateId')" prop="basalId">
|
||||
<el-input v-model="formData.basalId" :placeholder="$i18nForm(['placeholder.input', $t('module.quality.ScrapInfo.PlateId')])" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.quality.ScrapInfo.name')" prop="equipmentId">
|
||||
<el-select v-model="formData.equipmentId" :placeholder="$i18nForm(['placeholder.input', $t('module.quality.ScrapInfo.name')])" clearable :style="{width: '100%'}" filterable>
|
||||
<el-option
|
||||
v-for="(item, index) in dict.device"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList()"> {{ 'btn.search' | i18nFilter }} </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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>
|
||||
</el-col>
|
||||
<el-col :span="0">
|
||||
<echarts-bar
|
||||
v-if="false"
|
||||
ref="BarRef"
|
||||
:color="color"
|
||||
:bar-style="barStyle"
|
||||
:title="barTitle"
|
||||
:x-axis="xAxis"
|
||||
:y-axis="yAxis"
|
||||
:series="series"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="formData.current"
|
||||
:limit.sync="formData.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getList } from '@/api/quality-manage/scrapCategoryStatistics'
|
||||
import { scrapReasonList } from '@/api/dict'
|
||||
// import ScrapInfoCause from './ScrapInfoCause.vue'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import i18n from '@/lang'
|
||||
import dataDict from './filters'
|
||||
import { getEqList } from '@/api/equipment/maintain'
|
||||
import echartsBar from './components/barChart.vue'
|
||||
// import DictFilter from '@/components/BaseTable/subcomponents/DataDictFilter'
|
||||
/**
|
||||
* 表格表头配置项 TypeScript接口注释
|
||||
* tableConfig<ConfigItem> = []
|
||||
*
|
||||
* Interface ConfigItem = {
|
||||
* prop: string,
|
||||
* label: string,
|
||||
* width: string,
|
||||
* align: string,
|
||||
* subcomponent: function,
|
||||
* filter: function
|
||||
* }
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
const tableBtn = []
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentId',
|
||||
label: i18n.t('module.quality.ScrapInfo.name'),
|
||||
align: 'center',
|
||||
filter: dataDict('device')
|
||||
},
|
||||
{
|
||||
prop: 'reasonId',
|
||||
label: i18n.t('module.quality.ScrapInfo.cause'),
|
||||
align: 'center',
|
||||
filter: dataDict('scrap')
|
||||
},
|
||||
{
|
||||
prop: 'count',
|
||||
label: i18n.t('module.quality.ScrapInfo.count'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
const barTitle = {
|
||||
text: i18n.t('module.quality.ScrapInfo.title'),
|
||||
subtext: i18n.t('module.quality.ScrapInfo.subTitle')
|
||||
}
|
||||
const color = [
|
||||
'#5470C6', '#91CC75'
|
||||
]
|
||||
const barStyle = {
|
||||
height: '400px',
|
||||
width: '100%',
|
||||
margin: '20px'
|
||||
}
|
||||
const series = [{
|
||||
name: i18n.t('module.quality.ScrapInfo.subTitle'),
|
||||
data: [],
|
||||
type: 'bar'
|
||||
}]
|
||||
|
||||
export default {
|
||||
name: 'ScrapInfo',
|
||||
components: { Pagination, BaseTable, MethodBtn, echartsBar },
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
formData: {
|
||||
equipmentId: '',
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
dict: {
|
||||
scrap: [],
|
||||
device: []
|
||||
},
|
||||
color,
|
||||
barTitle,
|
||||
barStyle,
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: []
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
getList(this.formData).then(response => {
|
||||
this.series[0].data = []
|
||||
this.xAxis.data = []
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
response.data.records.map(item => {
|
||||
this.series[0].data.push(Number(item.count))
|
||||
this.xAxis.data.push(dataDict('device')(item.equipmentId) + '(' + dataDict('scrap')(item.reasonId) + ')')
|
||||
})
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
const result1 = await getEqList({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
if (result1.code === 0) {
|
||||
this.dict.device = result1.data.records
|
||||
}
|
||||
const result = await scrapReasonList()
|
||||
this.dict.scrap = result
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user