rev:新增质检模块
This commit is contained in:
564
mes/qd/src/views/wms/ql_manage/physicalMst/Dialog1.vue
Normal file
564
mes/qd/src/views/wms/ql_manage/physicalMst/Dialog1.vue
Normal file
@@ -0,0 +1,564 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="质检结果录入"
|
||||
append-to-body
|
||||
:visible.sync="visiable1"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
:before-close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="18" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<span>
|
||||
<el-button
|
||||
:disabled="form1.bill_status === '99'"
|
||||
type="success"
|
||||
icon="el-icon-finished"
|
||||
@click="computerResult"
|
||||
>计算结果</el-button>
|
||||
<el-button
|
||||
:disabled="form1.bill_status === '99'"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="onSubmit"
|
||||
>保存</el-button>
|
||||
<el-button icon="el-icon-close" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="form1"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
class="demo-form-inline"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="form1.material_code"
|
||||
disabled
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input
|
||||
v-model="form1.material_name"
|
||||
disabled
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批号">
|
||||
<label slot="label">批 号:</label>
|
||||
<el-input
|
||||
v-model="form1.pcsn"
|
||||
disabled
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="样品编号">
|
||||
<el-input
|
||||
v-model="form1.sample_code"
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="烧结炉号">
|
||||
<el-input
|
||||
v-model="form1.other_device_no"
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="烧结温度">
|
||||
<el-input
|
||||
v-model="form1.other_device_wd"
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<label slot="label">等 级:</label>
|
||||
<el-select
|
||||
v-model="form1.grade"
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
placeholder="等级"
|
||||
class="filter-item"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_IVT_LEVEL"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<label slot="label">重 损:</label>
|
||||
<el-input
|
||||
v-model="form1.weightlost"
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<label slot="label">结 论:</label>
|
||||
<el-select
|
||||
v-model="form1.result"
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
placeholder="结论"
|
||||
class="filter-item"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_RESULT_LHZJD"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form1.result==='07'" label="改料编码">
|
||||
<el-input
|
||||
v-model="form1.change_material_code"
|
||||
prefix-icon="el-icon-search"
|
||||
placeholder="请选择物料"
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@clear="cleanMater"
|
||||
@focus="materShow=true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form1.result==='07'" label="改料名称">
|
||||
<el-input
|
||||
v-model="form1.change_material_name"
|
||||
disabled
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="form1.result==='07'" label="改用批号">
|
||||
<el-input
|
||||
v-model="form1.change_pcsn"
|
||||
disabled
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="金相备注">
|
||||
<el-input
|
||||
v-model="form1.metallography_remark"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
style="width: 380px;"
|
||||
rows="2"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="检验备注">
|
||||
<el-input
|
||||
v-model="form1.remark"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
style="width: 380px;"
|
||||
rows="2"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="form1.tableData"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
:cell-style="cellStyle"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order_index"
|
||||
width="60"
|
||||
label="序号"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
width="100"
|
||||
prop="inspection_item_type"
|
||||
label="项点类别"
|
||||
:formatter="format_inspection_item_type"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="down_limit"
|
||||
label="合格下限(≥)"
|
||||
width="100"
|
||||
:formatter="crud.formatQlNum4"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit"
|
||||
label="合格上限(≤)"
|
||||
width="100"
|
||||
:formatter="crud.formatQlNum4"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
prop="down_limit_value"
|
||||
label="下限临界值(≤)"
|
||||
width="100"
|
||||
:formatter="crud.formatQlNum4"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit_value"
|
||||
label="上限临界值(≥)"
|
||||
width="100"
|
||||
:formatter="crud.formatQlNum4"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="is_ok"
|
||||
label="是否合格"
|
||||
width="155"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="value"
|
||||
width="155px"
|
||||
label="检测值"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="form1.tableData[scope.$index].value"
|
||||
:controls="false"
|
||||
size="mini"
|
||||
type="number"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
width="160"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="form1.tableData[scope.$index].remark"
|
||||
:disabled="form1.bill_status === '99'"
|
||||
size="mini"
|
||||
class="edit-input"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="item_remark"
|
||||
label="项点备注"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="form_remark"
|
||||
label="表单备注"
|
||||
width="160"
|
||||
/>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<MaterDtl :dialog-show.sync="materShow" :mater-opt-code="'05'" @tableChanged2="tableChanged2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudPhysicalMst from '@/api/wms/ql/physicalMst'
|
||||
|
||||
export default {
|
||||
name: 'Dialog1',
|
||||
dicts: ['QL_TEST_POINTTYPE', 'QC_RESULT_LHZJD', 'ST_IVT_LEVEL'],
|
||||
components: { MaterDtl },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
visiable1: {
|
||||
type: Boolean
|
||||
},
|
||||
inspectionId: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
materShow: false,
|
||||
materType: '05',
|
||||
form1: {
|
||||
material_id: '',
|
||||
bill_status: '',
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
pcsn: '',
|
||||
sample_code: '',
|
||||
other_device_no: '',
|
||||
other_device_wd: '',
|
||||
weightlost: '',
|
||||
grade: '',
|
||||
result: '',
|
||||
change_material_id: '',
|
||||
change_material_code: '',
|
||||
change_material_name: '',
|
||||
change_pcsn: '',
|
||||
remark: '',
|
||||
tableData: []
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'form1.tableData': {
|
||||
handler(newValue, oldValue) {
|
||||
// this.computerResult()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
const param = {
|
||||
inspection_id: this.inspectionId
|
||||
}
|
||||
crudPhysicalMst.getResult(param).then(res => {
|
||||
this.form1 = res
|
||||
if (res.grade === '') {
|
||||
this.form1.grade = '01'
|
||||
}
|
||||
})
|
||||
},
|
||||
hand() {
|
||||
|
||||
},
|
||||
cellStyle({ row, column, rowIndex, columnIndex }) {
|
||||
// https://blog.csdn.net/qq_41648113/article/details/109337781
|
||||
// https://blog.csdn.net/Akatsuki233/article/details/100311040
|
||||
// https://blog.csdn.net/qq_45414633/article/details/107795124
|
||||
|
||||
const inspection_type = row.inspection_type
|
||||
const is_limit_remark = row.is_limit_remark
|
||||
const value = parseFloat(row.value)
|
||||
const up_limit = parseFloat(row.up_limit)
|
||||
const down_limit = parseFloat(row.down_limit)
|
||||
|
||||
const down_limit_value = parseFloat(row.down_limit_value)
|
||||
const up_limit_value = parseFloat(row.up_limit_value)
|
||||
|
||||
// 理化项
|
||||
if (inspection_type === '02') {
|
||||
if (column.property === 'value') {
|
||||
if (value < down_limit) {
|
||||
row.is_ok = '0'
|
||||
return 'background: red'
|
||||
} else if ((value >= down_limit) && (value <= down_limit_value)) {
|
||||
if (is_limit_remark === '1') {
|
||||
row.form_remark = row.inspection_item_name + '超下限'
|
||||
return 'background: yellow'
|
||||
}
|
||||
row.is_ok = '1'
|
||||
} else if (value > up_limit) {
|
||||
row.is_ok = '0'
|
||||
return 'background: red'
|
||||
} else if ((value <= up_limit) && (value >= up_limit_value)) {
|
||||
if (is_limit_remark === '1') {
|
||||
row.form_remark = row.inspection_item_name + '超上限'
|
||||
return 'background: yellow'
|
||||
}
|
||||
row.is_ok = '1'
|
||||
} else {
|
||||
row.form_remark = ''
|
||||
row.is_ok = '1'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computerResult() {
|
||||
const rows = this.form1.tableData
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
if (rows[i].up_limit !== '') {
|
||||
if (rows[i].value === undefined) {
|
||||
this.crud.notify('有标准项点未输入完', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
this.form1.result = '01'
|
||||
var remark = ''
|
||||
for (var row of rows) {
|
||||
if (row.is_ok === '0') {
|
||||
this.form1.result = '02'
|
||||
} else {
|
||||
if (row.is_limit_remark === '1' && row.form_remark) {
|
||||
remark += row.form_remark.replace('\n', '') + ','
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.form1.remark = remark
|
||||
this.$set(this.form1, 'remark', remark)
|
||||
|
||||
if (this.form1.metallography_remark !== '') {
|
||||
this.form1.result = ''
|
||||
return this.crud.notify('金相异常,需人工判定', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
|
||||
if (this.form1.result === '01') return this.crud.notify('计算结果为合格', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
if (this.form1.result === '02') return this.crud.notify('计算结果为不合格', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
},
|
||||
format_inspection_item_type(row, column) {
|
||||
return this.dict.label.QL_TEST_POINTTYPE[row.inspection_item_type]
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
const msg = '是否继续!'
|
||||
|
||||
const data = this.form1.tableData
|
||||
var flag = 0
|
||||
for (var row of data) {
|
||||
if (row.up_limit !== '') {
|
||||
if (!row.value) {
|
||||
flag = flag + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果检测值有一项没填则提示是否继续 (在上限下限有值的情况下)
|
||||
if (flag > 0) {
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPhysicalMst.saveResult(this.form1).then(res => {
|
||||
this.close()
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
})
|
||||
} else {
|
||||
crudPhysicalMst.saveResult(this.form1).then(res => {
|
||||
this.close()
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
}
|
||||
},
|
||||
onSubmit2() {
|
||||
const data = this.form1.tableData
|
||||
var flag = 0
|
||||
for (var row of data) {
|
||||
if (!row.value) {
|
||||
flag = flag + 1
|
||||
}
|
||||
}
|
||||
// if (flag === data.length) {
|
||||
// this.crud.notify('请至少填写一项检测值', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
// return false
|
||||
// }
|
||||
crudPhysicalMst.saveResult(this.form1).then(res => {
|
||||
this.close()
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
type: type,
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
cleanMater() {
|
||||
this.form1.change_material_id = null
|
||||
this.form1.change_material_code = null
|
||||
this.form1.change_material_name = null
|
||||
this.form1.change_pcsn = null
|
||||
this.$forceUpdate()
|
||||
},
|
||||
tableChanged2(row) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form1.change_material_id = row.material_id
|
||||
this.form1.change_material_code = row.material_code
|
||||
this.form1.change_material_name = row.material_name
|
||||
this.form1.change_pcsn = this.form1.pcsn + '-GY'
|
||||
},
|
||||
close() {
|
||||
// this.$emit('update:visiable1', false)
|
||||
this.$parent._data.visiable1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: 1px solid #e5e6e7;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
259
mes/qd/src/views/wms/ql_manage/physicalMst/RelevancyDialog.vue
Normal file
259
mes/qd/src/views/wms/ql_manage/physicalMst/RelevancyDialog.vue
Normal file
@@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="理化报告单"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1300px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div>
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="单据号">
|
||||
<el-input
|
||||
v-model="query.inspection_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入质检单号"
|
||||
style="width: 210px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据类型">
|
||||
<el-select
|
||||
v-model="query.inspection_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INV_TYPE_LHD"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
<date-range-picker v-model="query.createTime" class="date-item" style="width: 180px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码或名称"
|
||||
style="width: 210px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="批号">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料批号"
|
||||
style="width: 210px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_id" label="理化质检单标识" />
|
||||
<el-table-column prop="inspection_code" label="质检单号" width="135" />
|
||||
<el-table-column prop="inspection_type" label="单据类型" :formatter="format_inspection_type" />
|
||||
<el-table-column prop="bill_status" label="单据状态" :formatter="formatStatus" />
|
||||
<el-table-column v-if="false" prop="biz_date" label="业务日期" />
|
||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批号" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="is_effective" label="是否有效" :formatter="format_is_active" />
|
||||
<el-table-column prop="result" label="结果" :formatter="format_result" />
|
||||
<el-table-column prop="remark" show-overflow-tooltip label="备注" />
|
||||
<el-table-column prop="input_optname" label="创建人" />
|
||||
<el-table-column prop="input_time" label="创建时间" width="135" />
|
||||
<el-table-column prop="check_optname" label="检验人" />
|
||||
<el-table-column prop="check_time" label="检验时间" width="135" />
|
||||
<el-table-column prop="confirm_optname" label="结论判定人" />
|
||||
<el-table-column prop="confirm_time" label="结论判定时间" width="135" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="sure">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPhysicalMst from '@/api/wms/ql/physicalMst'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_id: null,
|
||||
inspection_code: null,
|
||||
inspection_type: null,
|
||||
inspection_id_gu: null,
|
||||
material_id: null,
|
||||
pcsn: null
|
||||
}
|
||||
export default {
|
||||
name: 'PhysicalMst',
|
||||
dicts: ['QC_INV_TYPE_LHD', 'IS_OR_NOT', 'QC_RESULT_LHZJD'],
|
||||
components: { pagination, rrOperation, udOperation, DateRangePicker },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '理化报告单',
|
||||
url: 'api/physicalMst',
|
||||
idField: 'sample_code',
|
||||
sort: 'sample_code,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudPhysicalMst }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
materShow: false,
|
||||
visiable1: false,
|
||||
inspection_id: null,
|
||||
statusList: [],
|
||||
permission: {},
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudInspectionsheetmst.getStatus().then(res => {
|
||||
this.statusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
format_inspection_type(row, column) {
|
||||
return this.dict.label.QC_INV_TYPE_LHD[row.inspection_type]
|
||||
},
|
||||
formatStatus(row, column) {
|
||||
for (const item of this.statusList) {
|
||||
if (item.value === row.bill_status) {
|
||||
return item.label
|
||||
}
|
||||
}
|
||||
},
|
||||
format_is_active(row, column) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_effective]
|
||||
},
|
||||
format_result(row, column) {
|
||||
return this.dict.label.QC_RESULT_LHZJD[row.result]
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sure() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length !== 1) {
|
||||
return this.crud.notify('只能选择一条记录', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
if (_selectData[0].inspection_type !== '20') {
|
||||
return this.crud.notify('请选择钴粉类型', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
// 将当前表单中的数据传回父页面
|
||||
this.rows = this.$refs.table.selection
|
||||
this.$emit('RelevancyChanged', this.rows)
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$refs['form'].resetFields()
|
||||
this.$refs['table'].resetFields()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
401
mes/qd/src/views/wms/ql_manage/physicalMst/index.vue
Normal file
401
mes/qd/src/views/wms/ql_manage/physicalMst/index.vue
Normal file
@@ -0,0 +1,401 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="质检单号">
|
||||
<el-input
|
||||
v-model="query.inspection_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入质检单号"
|
||||
style="width: 210px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据类型">
|
||||
<el-select
|
||||
v-model="query.inspection_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INV_TYPE_LHD"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<label slot="label">物 料:</label>
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码或名称"
|
||||
style="width: 210px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="批号">
|
||||
<label slot="label">批 号:</label>
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料批号"
|
||||
style="width: 210px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="copyAdd(crud.selections[0])"
|
||||
>
|
||||
复制新增
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="info"
|
||||
icon="el-icon-position"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
size="mini"
|
||||
@click="resultEnter(crud.selections[0])"
|
||||
>
|
||||
结果录入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-input v-if="false" v-model="form.material_id" />
|
||||
|
||||
<el-form-item label="质检单号" prop="inspection_code">
|
||||
<el-input v-model.trim="form.inspection_code" placeholder="系统生成" disabled style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-input v-model.trim="form.material_name" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryMater" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="批号" prop="pcsn">
|
||||
<el-input v-model.trim="form.pcsn" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据类型" prop="inspection_type">
|
||||
<el-select
|
||||
v-model="form.inspection_type"
|
||||
size="mini"
|
||||
placeholder="单据类型"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INV_TYPE_LHD"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.inspection_type==='30'" label="关联单号" prop="inspection_id_gu">
|
||||
<el-input v-model.trim="form.inspection_id_gu" clearable style="width: 370px;" @focus="RelevancyShow=true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model.trim="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_id" label="理化质检单标识" />
|
||||
<el-table-column prop="inspection_code" label="质检单号" width="135" />
|
||||
<el-table-column min-width="100" show-overflow-tooltip prop="inspection_type" label="单据类型" :formatter="format_inspection_type" />
|
||||
<el-table-column prop="bill_status" label="单据状态" :formatter="formatStatus" />
|
||||
<el-table-column v-if="false" prop="biz_date" label="业务日期" />
|
||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批号" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="is_effective" label="是否有效" :formatter="format_is_active" />
|
||||
<el-table-column prop="result" label="结果" :formatter="format_result" />
|
||||
<el-table-column prop="remark" show-overflow-tooltip label="备注" />
|
||||
<el-table-column prop="input_optname" label="创建人" />
|
||||
<el-table-column prop="input_time" label="创建时间" width="135" />
|
||||
<el-table-column prop="check_optname" label="检验人" />
|
||||
<el-table-column prop="check_time" label="检验时间" width="135" />
|
||||
<el-table-column prop="confirm_optname" label="结论判定人" min-width="100" />
|
||||
<el-table-column prop="confirm_time" label="结论判定时间" width="135" />
|
||||
<el-table-column label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd1(scope.row)"
|
||||
:disabled-dle="canUd2(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
<MaterDtl :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
|
||||
<Dialog1 :visiable1.sync="visiable1" :inspection-id="inspection_id" />
|
||||
<RelevancyDialog :dialog-show.sync="RelevancyShow" @RelevancyChanged="RelevancyChanged" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPhysicalMst from '@/api/wms/ql/physicalMst'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import Dialog1 from './Dialog1'
|
||||
import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import RelevancyDialog from '@/views/wms/ql/physicalMst/RelevancyDialog'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_id: null,
|
||||
inspection_code: null,
|
||||
inspection_type: null,
|
||||
inspection_id_gu: null,
|
||||
material_id: null,
|
||||
pcsn: null
|
||||
}
|
||||
export default {
|
||||
name: 'PhysicalMst',
|
||||
dicts: ['QC_INV_TYPE_LHD', 'IS_OR_NOT', 'QC_RESULT_LHZJD'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, DateRangePicker, Dialog1, RelevancyDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '理化报告单',
|
||||
url: 'api/physicalMst',
|
||||
idField: 'inspection_id',
|
||||
sort: 'inspection_id desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudPhysicalMst }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
materShow: false,
|
||||
materType: '11',
|
||||
materialType: [],
|
||||
visiable1: false,
|
||||
inspection_id: null,
|
||||
statusList: [],
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
RelevancyShow: false,
|
||||
rules: {
|
||||
inspection_type: [
|
||||
{ required: true, message: '质检单类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
biz_date: [
|
||||
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
pcsn: [
|
||||
{ required: true, message: '批号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudInspectionsheetmst.getStatus().then(res => {
|
||||
this.statusList = res
|
||||
})
|
||||
crudInspectionsheetmst.getMaterialType().then(res => {
|
||||
this.materialType = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
canUd1(row) {
|
||||
return row.bill_status !== '10'
|
||||
},
|
||||
canUd2(row) {
|
||||
return row.bill_status === '99'
|
||||
},
|
||||
copyAdd(data) {
|
||||
crudPhysicalMst.copyAdd(data).then(res => {
|
||||
this.crud.addSuccessNotify()
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
queryMater() {
|
||||
this.materShow = true
|
||||
},
|
||||
resultEnter(data) {
|
||||
this.visiable1 = true
|
||||
this.inspection_id = data.inspection_id
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
format_inspection_type(row, column) {
|
||||
return this.dict.label.QC_INV_TYPE_LHD[row.inspection_type]
|
||||
},
|
||||
formatStatus(row, column) {
|
||||
for (const item of this.statusList) {
|
||||
if (item.value === row.bill_status) {
|
||||
return item.label
|
||||
}
|
||||
}
|
||||
},
|
||||
format_is_active(row, column) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_effective]
|
||||
},
|
||||
format_result(row, column) {
|
||||
return this.dict.label.QC_RESULT_LHZJD[row.result]
|
||||
},
|
||||
tableChanged2(row) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_name = row.material_name
|
||||
const data = {
|
||||
'materOpt_code': '01',
|
||||
'material_id': row.material_id
|
||||
}
|
||||
crudPhysicalMst.isMaterType(data).then(res => {
|
||||
const param = res.param
|
||||
if (param === '10') {
|
||||
this.form.inspection_type = '10'
|
||||
} else if (param === '20') {
|
||||
this.form.inspection_type = '20'
|
||||
} else if (param === '30') {
|
||||
this.form.inspection_type = '30'
|
||||
}
|
||||
})
|
||||
},
|
||||
RelevancyChanged(rows) {
|
||||
const row = rows[0]
|
||||
this.form.inspection_id_gu = row.inspection_id
|
||||
},
|
||||
confirm() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
const data = _selectData[0]
|
||||
crudPhysicalMst.confirm(data).then(res => {
|
||||
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
setValid() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
const data = _selectData[0]
|
||||
crudPhysicalMst.setValid(data).then(res => {
|
||||
this.crud.notify('设置成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user