<template>
|
<a-modal
|
:width="1250"
|
:visible="visible"
|
:maskClosable="false"
|
@ok="handleOk"
|
cancelText="关闭"
|
@cancel="handleCancel"
|
:confirmLoading="confirmLoading"
|
title="附录6"
|
>
|
<!-- :title="title" -->
|
<a-spin :spinning="confirmLoading">
|
<a-form :form="form">
|
<span
|
class="ant-descriptions-title"
|
style="font-size: large;font-size: 15px;float: right;"
|
>{{this.model.receiptsNum2}}</span>
|
<a-divider
|
orientation="center"
|
style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
|
> {{this.model.receiptsName2}} </a-divider>
|
<!-- 生产设备精度检验单 -->
|
<a-row :gutter="24">
|
<a-col :span="8">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="设备名称"
|
>
|
<span v-if="this.model != null">{{ this.model.equipmentName }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="8">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="设备型号"
|
>
|
<span v-if="this.model != null">{{ this.model.equipmentModel }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="8">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="统一编码"
|
>
|
<span v-if="this.model != null">{{ this.model.equipmentNum }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="8">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="使用单位"
|
>
|
<span v-if="this.model != null">{{ this.model.useUnitName }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="8">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="保养单位"
|
>
|
<span v-if="this.model != null">{{ this.model.actualEndTime }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</a-spin>
|
<a-table
|
ref="table"
|
bordered
|
size="middle"
|
rowKey='id'
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="false"
|
>
|
<template
|
v-for="col in columns"
|
:slot="col.dataIndex"
|
slot-scope='text, record, index'
|
>
|
<div :key="col.dataIndex">
|
|
<a-input
|
:value="text"
|
v-if="col.dataIndex == 'actualMeasure'"
|
auto-size
|
placeholder="请输入实测值"
|
@change="(e)=>handleChange(e, record.key, col, index)"
|
/>
|
</div>
|
</template>
|
</a-table>
|
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="精度检验者"
|
>
|
<span v-if="this.model != null">{{ this.model.precisionInspectionUserName}}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="维修室主任"
|
>
|
<span v-if="this.model != null">{{ this.model.repairDirectorUserName }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</div>
|
<div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
|
<span
|
class="ant-descriptions-title"
|
style="font-size: large;font-style: normal;font-size: 15px;"
|
>精度状态</span>
|
</div>
|
<div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="各项精度达到允差要求"
|
>
|
<a-switch
|
checked-children="是"
|
un-checked-children="否"
|
:checked="model.eachTolerance == '1'"
|
@change="handle2Switch(model.eachTolerance)"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="部分精度未达到允差要求"
|
>
|
<a-switch
|
checked-children="是"
|
un-checked-children="否"
|
:checked="model.partTolerance == '1'"
|
@change="handle3Switch(model.partTolerance)"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col
|
:style="{float: 'right'}"
|
:span="12"
|
>
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="设备检验员"
|
>
|
<span v-if="this.model != null">{{ this.model.equipmentInspectorUserName }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</div>
|
<div :style="{height: '175px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
|
<span
|
class="ant-descriptions-title"
|
style="font-size: large;font-style: normal;font-size: 15px;"
|
>零件状态</span>
|
</div>
|
<div :style="{height: '175px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 12 }"
|
label="检测调试后试加工零件号:"
|
>
|
<a-input v-model="model.sparePart" />
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="零件加工:"
|
>
|
<a-switch
|
checked-children="合格"
|
un-checked-children="不合格"
|
:checked="model.processPass == '1'"
|
@change="handle4Switch(model.processPass)"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="能否满足加工工艺要求"
|
>
|
<a-switch
|
checked-children="能"
|
un-checked-children="不能"
|
@change="handle5Switch(model.meetProcessRequire)"
|
:checked="model.meetProcessRequire == '1'"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col
|
:style="{float: 'right'}"
|
:span="12"
|
>
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="使用单位技术主管"
|
>
|
<span v-if="this.model != null">{{ this.model.useUnitDirectorUserName }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</div>
|
<div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
|
<span
|
class="ant-descriptions-title"
|
style="font-size: large;font-style: normal;font-size: 15px;"
|
>结论</span>
|
</div>
|
<div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
|
<a-row :gutter="24">
|
<a-col :span="24">
|
<a-form-item
|
:labelCol="{ span: 4 }"
|
:wrapperCol="{ span: 20 }"
|
label="设备判定"
|
>
|
<a-radio-group
|
v-model="model.judgmentResult"
|
@change="onChangeJudgmentResult"
|
>
|
<a-radio value="qualified"> 合格 </a-radio>
|
<a-radio value="limitedUse"> 限用 </a-radio>
|
<a-radio value="disabled"> 禁用 </a-radio>
|
</a-radio-group>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col
|
:style="{float: 'right'}"
|
:span="12"
|
>
|
<a-form-item
|
:labelCol="{ span: 8 }"
|
:wrapperCol="{ span: 4 }"
|
label="设备检验员签字"
|
>
|
<span v-if="this.model != null">{{ this.model.equipmentInspectorSignUserName }}</span>
|
<span v-else>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</div>
|
<div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
|
<span
|
class="ant-descriptions-title"
|
style="font-size: large;font-style: normal;font-size: 15px;"
|
>备注</span>
|
</div>
|
<div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
|
<a-textarea
|
allowClear
|
:placeholder="'请输入备注信息'"
|
v-model="model.remark "
|
rows="4"
|
/>
|
<!-- :disabled="true" -->
|
</div>
|
<template slot="footer">
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleCancel()"
|
>
|
关闭
|
</a-button>
|
|
<a-button
|
@click="handleOk()"
|
type="primary"
|
:loading="confirmLoading"
|
:disabled="this.model.precisionInspectionStatus == '5'"
|
>确定</a-button>
|
|
</template>
|
</a-modal>
|
|
</template>
|
|
<script>
|
import { getAction, postAction, requestPut } from '@/api/manage'
|
import pick from 'lodash.pick'
|
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
import Tooltip from 'ant-design-vue/es/tooltip'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import { getFileAccessHttpUrl } from '@/api/manage';
|
|
export default {
|
name: "EquipmentPrecisionCheckOrderModal",
|
mixins: [JeecgListMixin],
|
components: {
|
JMultiSelectTag,
|
Tooltip,
|
},
|
data() {
|
return {
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
},
|
width: 50,
|
},
|
{
|
title: '检验项目',
|
align: 'center',
|
dataIndex: 'precisionParametersName',
|
width: 600,
|
},
|
{
|
title: '允差',
|
align: 'center',
|
dataIndex: 'tolerance'
|
},
|
{
|
title: '实测',
|
align: 'center',
|
dataIndex: 'actualMeasure',
|
width: 150,
|
scopedSlots: { customRender: 'actualMeasure' }
|
},
|
|
|
],
|
title: "操作",
|
visible: false,
|
disableSubmit: false,
|
codeDisable: true,
|
dataSource: [],
|
model: {},
|
departs: [],
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 18 },
|
},
|
confirmLoading: false,
|
form: this.$form.createForm(this),
|
validatorRules: {
|
num: {
|
rules: [
|
{ required: true, message: '请输入保养工单编码!' },
|
]
|
},
|
},
|
url: {
|
add: "/eam/precisionInspection/precisionInspection",
|
getPrecisionInspection: "/eam/precisionInspection/getPrecisionInspectionList",
|
list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId",
|
getSysFileName: "/eam/sysFileName/getSysFileName",
|
},
|
|
}
|
},
|
|
methods: {
|
|
edit(record) {
|
let that = this;
|
if (record.receipts2 == "" || record.receipts2 == null) {
|
this.getSysFileName()
|
}
|
this.form.resetFields();
|
// record.eachTolerance = '0'
|
// record.partTolerance = '0'
|
// record.processPass = '0'
|
// record.meetProcessRequire = '0'
|
// record.judgmentResult = ""
|
this.model = Object.assign({}, record);
|
this.getPrecisionInspection()
|
// this.getEquipmentPrecision()
|
this.visible = true;
|
that.$nextTick(() => {
|
// that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark'));
|
});
|
|
},
|
|
|
close() {
|
this.$emit('close');
|
this.visible = false;
|
},
|
|
handleCancel() {
|
this.close();
|
},
|
|
handleOk() {
|
// if (this.model.precisionInspectionStatus === '2') {
|
// if ((this.model.eachTolerance === "0" || this.model.eachTolerance === 0) && (this.model.partTolerance === "0" || this.model.partTolerance === 0)) {
|
// this.$message.warning("请对精度状态结果勾选!");
|
// return
|
// }
|
// }
|
// if (this.model.precisionInspectionStatus === '3') {
|
// if ((this.model.processPass === "0" || this.model.processPass === 0) && (this.model.meetProcessRequire === "0" || this.model.meetProcessRequire === 0)) {
|
// this.$message.warning("请对零件状态结果勾选!");
|
// return
|
// }
|
// }
|
const that = this;
|
that.form.validateFields((err, values) => {
|
if (!err) {
|
this.$confirm({
|
title: '生产设备精度检验单',
|
content: '提示:请谨慎操作!',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
let formData = Object.assign(that.model, values);
|
formData.precisionInspectionDetailList = that.dataSource
|
that.confirmLoading = true;
|
postAction(that.url.add, formData).then((res) => {
|
if (res.success) {
|
that.$message.success(res.message);
|
that.$emit('ok', new Date());
|
} else {
|
that.$message.warning(res.message);
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
that.close();
|
})
|
},
|
})
|
}
|
})
|
},
|
|
handleDelete(text, record, index) {
|
this.dataSource.splice(index, 1);
|
},
|
|
getPrecisionInspection() {
|
getAction(this.url.getPrecisionInspection, { maintenanceOrderId: this.model.id }).then((res) => {
|
if (res.success) {
|
this.dataSource = res.result[0].precisionInspectionDetails
|
this.model = Object.assign(this.model, res.result[0]);
|
}
|
})
|
},
|
|
handle2Switch(eachTolerance) {
|
if ('0' == eachTolerance) {
|
this.model.eachTolerance = '1'
|
} else {
|
this.model.eachTolerance = '0'
|
}
|
this.model = Object.assign({}, this.model);
|
},
|
|
handle3Switch(partTolerance) {
|
if ('0' == partTolerance) {
|
this.model.partTolerance = '1'
|
} else {
|
this.model.partTolerance = '0'
|
}
|
this.model = Object.assign({}, this.model);
|
},
|
|
handle4Switch(processPass) {
|
if ('0' == processPass) {
|
this.model.processPass = '1'
|
} else {
|
this.model.processPass = '0'
|
}
|
this.model = Object.assign({}, this.model);
|
},
|
|
handle5Switch(meetProcessRequire) {
|
if ('0' == meetProcessRequire) {
|
this.model.meetProcessRequire = '1'
|
} else {
|
this.model.meetProcessRequire = '0'
|
}
|
this.model = Object.assign({}, this.model);
|
},
|
|
onChangeJudgmentResult(e) {
|
this.model.judgmentResult = e.target.value
|
this.model = Object.assign({}, this.model);
|
},
|
|
handleChange(value, key, column, index) {
|
let that = this;
|
const temp = [...that.dataSource];
|
const target = temp.filter(item => key === item.key)[index];
|
if (target) {
|
if ('actualMeasure' == column.dataIndex) {
|
target['actualMeasure'] = value.target.value;
|
}
|
//显示带过来的数据
|
that.dataSource = temp;
|
}
|
},
|
|
getSysFileName() {
|
getAction(this.url.getSysFileName, { name: '16' }).then((res) => {
|
if (res.success) {
|
this.model = Object.assign(this.model, res.result[0]);
|
}
|
})
|
},
|
|
},
|
}
|
</script>
|
|
<style lang="less" scoped>
|
/deep/ .frozenRowClass {
|
color: #c9c9c9;
|
}
|
.fontweight {
|
font-weight: bold;
|
}
|
.ant-btn {
|
padding: 0 10px;
|
margin-left: 3px;
|
}
|
|
.ant-form-item-control {
|
line-height: 0px;
|
}
|
|
/** 主表单行间距 */
|
.ant-form .ant-form-item {
|
margin-bottom: 10px;
|
}
|
|
/** Tab页面行间距 */
|
.ant-tabs-content .ant-form-item {
|
margin-bottom: 0px;
|
}
|
.hightColor {
|
height: 10%;
|
font-weight: bold;
|
font-size: 20px;
|
color: #1b1e1e;
|
}
|
.frozenRowClass {
|
color: #c9c9c9;
|
}
|
.fontweight {
|
font-weight: bold;
|
}
|
.hight {
|
color: #f5222d;
|
}
|
/deep/ .red {
|
color: red;
|
}
|
|
.line {
|
width: 1px;
|
height: 300px;
|
background-color: #000;
|
border: none;
|
float: left;
|
}
|
</style>
|