中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

742 lines
24 KiB

3 months ago
<template>
<div>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 20px">基本信息</span>
</div>
<el-form ref="form" :model="formData" :rules="rules" :inline="true" class="vd-form-three" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="零件号:" prop="partCode">
2 months ago
<el-input v-model="formData.partCode" disabled placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="零件名称:" prop="partName">
2 months ago
<el-input v-model="formData.partName" disabled placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8" v-if="partType == '热表'">
2 months ago
<el-form-item label="产品型号:" prop="productType">
<el-input v-model="formData.productType" placeholder="请输入" disabled />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8" v-if="partType == '烧结'">
<el-form-item label="是否为玻璃饼:" prop="isGlassCake">
2 months ago
<el-switch v-model="formData.isGlassCake" :disabled="disabled" active-color="#13ce66" inactive-color="#ff4949" />
3 months ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="到期日期:" prop="dueDate">
<el-date-picker v-model="formData.dueDate" type="date" placeholder="请选择" format="YYYY-MM-DD" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="到期提醒(天):" prop="expirationPeriod">
2 months ago
<el-input-number :max="100000" :min="0" v-model="formData.expirationPeriod" precision="0"
controls-position="right" placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8" v-if="partType == '烧结'">
<el-form-item label="是否印字:" prop="printing">
<el-radio-group v-model="formData.printing">
<el-radio :value="3"></el-radio>
<el-radio :value="6"></el-radio>
<el-radio :value="9"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="partType == '热表'">
<el-col :span="8">
<el-form-item label="硬度:" prop="hardness">
2 months ago
<el-input v-model="formData.hardness" placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料:" prop="material">
2 months ago
<el-input v-model="formData.material" placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="面积(dm²):" prop="area">
2 months ago
<el-input-number :max="100000" :min="0" v-model="formData.area" precision="10" controls-position="right"
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="镀种:" prop="plate">
2 months ago
<el-input v-model="formData.plate" placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="镀层代号:" prop="plateCode">
2 months ago
<el-input v-model="formData.plateCode" placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="镀层厚度:" prop="plateThickness">
2 months ago
<el-input v-model="formData.plateThickness" placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label="工艺路线:" prop="craftWay" class="auto-fit">
2 months ago
<el-input v-model="formData.craftWay" type="textarea" maxlength="255" show-word-limit rows="3"
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="涂色标个数:" prop="tsbNum">
2 months ago
<el-input-number v-model="formData.tsbNum" :min="1" :max="10" controls-position="right"
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="涂色带个数:" prop="tsdNum">
2 months ago
<el-input-number v-model="formData.tsdNum" :min="1" :max="10" controls-position="right"
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="涂箭头个数:" prop="tjtNum">
2 months ago
<el-input-number v-model="formData.tjtNum" :min="1" :max="10" controls-position="right"
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label="色标色带:" prop="memo" class="auto-fit">
2 months ago
<el-input v-model="formData.memo" :rows="3" type="textarea" maxlength="900" show-word-limit
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label="关键信息:" prop="cruxMemo" class="auto-fit">
2 months ago
<el-input v-model="formData.cruxMemo" type="textarea" maxlength="2000" show-word-limit rows="3"
placeholder="请输入" />
3 months ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="工艺校验:" prop="sinTer">
<el-checkbox v-model="formData.goldMark">镀金标识</el-checkbox>
<el-checkbox v-model="formData.markingsTest" @change="setDataLocal">涂色标</el-checkbox>
2 months ago
<el-checkbox v-model="validateObj.yingGuangJian" @change="setDataLocal"
v-if="partType == '热表'">荧光检</el-checkbox>
<el-checkbox v-model="validateObj.heatTreatmentTest" @change="setDataLocal"
v-if="partType == '热表'">热处理检验</el-checkbox>
3 months ago
<el-checkbox v-model="validateObj.penmark" @change="setDataLocal" v-if="partType == '热表'">喷码</el-checkbox>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" v-if="partType == '烧结'" style="margin-top:24px">
<div slot="header" class="clearfix">
<span style="font-size: 20px">子件信息</span>
</div>
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud"
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
</avue-crud>
</el-card>
</div>
</template>
<script>
export default {
components: {
},
props: {
partType: {
type: String,
default: '',
},
partId: {
type: [Number, String],
default: null,
},
childPage: {
type: Boolean,
default: false,
},
psId: {
type: Number,
default: null,
},
rowObject: {
type: Object,
default: null,
},
},
data() {
var checkCode = (rule, value, callback) => {
this.$ajax
.post('dsPart/checkCode', {
partId: this.formData.partId,
partCode: value,
})
.then((res) => {
if (res.data) {
callback(new Error(this.$t('global.duplicateCode')));
} else {
callback();
}
});
};
const proportionNum = (rule, value, callback) => {
if (value === 0) {
callback(new Error(this.$t('输入的值必须大于0')));
} else {
callback();
}
};
return {
2 months ago
disabled: false,
3 months ago
formData: {
sinTer: false,
goldMark: false,
},
validateObj: {
yingGuangJian: false,
penmark: false,
heatTreatmentTest: false,
},
notSinTer: true,
notGlassCake: true,
tsbNum: null,
tsdNum: null,
tjtNum: null,
numOptions: [],
rules: {
2 months ago
plate: [{ required: true, message: '请输入', trigger: 'blur' }],
material: [{ required: true, message: '请输入', trigger: 'blur' }],
isGlassCake: [{ required: true, message: '请选择', trigger: 'blur' }],
printing: [{ required: true, message: '请选择', trigger: 'blur' }],
dueDate: [{ required: true, message: '请选择', trigger: 'blur' }],
3 months ago
partCode: [
{ required: true },
{ validator: checkCode, trigger: 'blur' },
],
2 months ago
partName: [{ required: true, message: '请选择', trigger: 'blur' }],
craftWay: [{ required: true, message: '请输入', trigger: 'blur' }],
3 months ago
area: [
2 months ago
{ required: true, message: '请输入', trigger: 'blur' },
3 months ago
{ validator: proportionNum, trigger: 'blur' },
],
2 months ago
expirationPeriod: [{ required: true, message: '请输入', trigger: 'blur' }],
plate: [{ required: true, message: '请输入', trigger: 'blur' }],
material: [{ required: true, message: '请输入', trigger: 'blur' }],
3 months ago
},
submitLoading: false,
data: [],
option: {
tip: false,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
dialogWidth: '60%',
border: true,
selection: false,
viewBtn: true,
menuWidth: 240,
dialogClickModal: false,
excelBtn: true,
viewBtn: false,
editBtnText: '编辑',
refreshBtn: false,
searchShowBtn: false,
gridBtn: false,
menu: false,
header: false,
index: true,
searchLabelPosition:'left',
searchLabelPosition:'left',
searchGutter:24,
searchSpan:6,
menuAlign: 'left',
gridBtn:false,
searchMenuPosition:'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
2 months ago
align: 'center',
3 months ago
column: [
{
label: '零件号',
prop: 'subCode',
search: false,
sortable: true,
overHidden: true,
},
{
label: '零件名称',
prop: 'subName',
search: false,
sortable: true,
overHidden: true,
},
{
label: '产品型号',
prop: 'productType',
search: false,
sortable: true,
overHidden: true,
},
{
label: '数量',
prop: 'quota',
search: false,
sortable: true,
overHidden: true,
},
{
label: '零件类型',
prop: 'productType',
search: false,
sortable: true,
overHidden: true,
type: "select",
cell: true,
dicData: [
{
label: '插针',
value: "1"
},
{
label: '壳体',
value: "2"
},
{
label: '石墨模',
value: "5"
},
{
label: '自制玻璃饼',
value: "3"
},
{
label: '其他',
value: "4"
}
]
}
]
}
};
},
created() {
2 months ago
},
mounted() {
this.disabled = this.dialogType == 'view' ? true : false
console.log(999999,this.dialogType)
3 months ago
},
methods: {
clear() {
this.formData = {};
this.$refs.form.resetFields();
},
loadData(partId) {
this.formData = { sinTer: false, goldMark: false };
this.notSinTer = true;
this.notGlassCake = true;
this.$refs.form.resetFields();
// if (partId) {
// this.$ajax.get('dsPart/getByKey/' + partId).then((res) => {
// if (this.$ifAjax(res)) {
// this.formData = res.data;
// if (this.rowObject != null) {
// // 由子件信息页面编辑带入信息
// this.formData.partName = this.rowObject.subName; // 零件名称=子件名称
// this.formData.productType = this.rowObject.productType; // 产品型号
// this.formData.material = this.rowObject.material; // 材料
// this.formData.area = this.rowObject.area; // 面积(dm²)
// this.formData.plate = this.rowObject.plate; // 镀种
// this.formData.plateCode = this.rowObject.plateCode; // 镀层代号
// this.formData.plateThickness = this.rowObject.plateThickness; // 镀层厚度
// if (this.rowObject.sinTerType == 3) {
// this.formData.glassCake = true;
// } else if (this.rowObject.sinTerType == 5) {
// this.formData.sinTer = true;
// } else {
// this.formData.glassCake = false;
// this.formData.sinTer = false;
// }
// }
// const craftWay = this.formData.craftWay;
// if (
// craftWay.indexOf('涂色标') !== -1 ||
// craftWay.indexOf('涂色带') !== -1
// ) {
// this.formData.markingsTest = true;
// }
// if (craftWay.indexOf('热') !== -1) {
// this.validateObj.heatTreatmentTest = true;
// }
// if (craftWay.indexOf('荧光检') !== -1) {
// this.validateObj.yingGuangJian = true;
// }
// if (craftWay.indexOf('喷码') !== -1) {
// this.validateObj.penmark = true;
// }
// this.setDataLocal();
// }
// });
// }
this.$refs.craftEdit.getData(partId, true);
},
setDataLocal() {
this.$setItem('零件信息信息验证', this.validateObj);
},
// validatorMethod(rule, value, callback) {
// const regex = /^[0-9]\d*$/;
// if (!value) {
// callback(new Error('请输入正整数'));
// } else if (!regex.test(value)) {
// callback(new Error('请输入正整数'));
// } else {
// callback();
// }
// },
submit(flag) {
this.submitLoading = true;
this.$refs.form.validate((valid) => {
if (valid) {
let isReturn = false;
if (this.formData.plateCode || this.formData.plateThickness) {
if (!this.formData.plateGoodsCode) {
isReturn = true;
}
}
if (isReturn && this.notSinTer) {
this.submitLoading = false;
return this.$message.warning('请选择镀层物料');
}
if (this.formData.craftWay.indexOf('涂色') != -1) {
if (
this.formData.tsdNum === null &&
this.formData.tsbNum === null &&
this.formData.tjtNum === null
) {
this.submitLoading = false;
return this.$message.warning('一级路线包含涂色,请填写涂色数据');
}
}
this.formData.childPage = this.childPage;
this.formData.psId = this.psId;
// this.$ajax.post('dsPart/addOrEdit', this.formData).then((res) => {
// if (this.$ifAjax(res)) {
// this.$message.success(
// this.$t('videaVueLib.publics.message.success')
// );
// this.cancel(flag, res.data);
this.$refs.craftEdit.getData(this.partId, true);
// }
// this.submitLoading = false;
// });
} else {
this.submitLoading = false;
}
});
},
cancel(flag, dsPart) {
this.$emit('cancelClose', flag, dsPart);
// if (!flag) {
// this.$refs.craftEdit.refreshLoad();
// }
},
onLoad() {
this.data = [
{
$cellEdit: true,
"area": 3.0,
"configNo": "B1",
"keyValue": 195827,
"material": "XXXX",
"memo": null,
"partCode": "21E8-040-17188-A1",
"plate": "XXXX",
"plateCode": "6",
"plateThickness": null,
"prepared": false,
"productType": "1",
"psId": 195827,
"quota": 1.0,
"sinTerType": 5,
"sinTerTypeTitle": "石墨模",
"subCode": "21E2-505-522-B1",
"subName": "设备架喷漆部件",
"subType": "R",
"subTypeTitle": "原材料",
"updateMan": {
"accountId": 622,
"card": null,
"createTime": "2025-06-26",
"curStatus": 1,
"deleted": false,
"deptName": null,
"dimissionTime": null,
"factoryId": 1,
"head": 1,
"jobName": null,
"keyValue": 601,
"ldapName": "zd001",
"mail": null,
"mobile": null,
"pfDepartment": {
"appLink": null,
"createTime": "2022-08-31",
"deleted": false,
"deptCode": "001",
"deptId": 1,
"deptName": "MES开发部",
"deptType": 1,
"deptTypeTitle": "厂",
"keyValue": 1,
"memo": null,
"orders": "00",
"parentDeptId": null,
"parentPath": null,
"ucDeptId": null,
"updateTime": "2022-08-31 16:32:46"
},
"pinyinIndex": "ZHANGDI,ZD",
"ucUserId": null,
"updateTime": "2025-06-26 15:31:23",
"userCode": "zd001",
"userId": 601,
"userName": "张迪",
"userSex": 1,
"userSources": "张迪",
"userString": "601:A:张迪",
"userType": "A"
},
"updateTime": "2025-07-11 17:46:06"
},
{
$cellEdit: true,
"area": 60.0,
"configNo": "L79",
"keyValue": 195828,
"material": null,
"memo": null,
"partCode": "21E8-040-17188-A1",
"plate": "12",
"plateCode": null,
"plateThickness": "3",
"prepared": false,
"productType": "3",
"psId": 195828,
"quota": 1.0,
"sinTerType": 2,
"sinTerTypeTitle": "壳体",
"subCode": "21E8-570-23998-L79",
"subName": "锌黄丙烯酸聚氨酯底漆",
"subType": "R",
"subTypeTitle": "原材料",
"updateMan": {
"accountId": null,
"card": null,
"createTime": "2022-08-31",
"curStatus": 1,
"deleted": false,
"deptName": null,
"dimissionTime": null,
"factoryId": 41,
"head": 0,
"jobName": "总工",
"keyValue": 1,
"ldapName": "admin",
"mail": "13699999999@136.com",
"mobile": "13699999999",
"pfDepartment": {
"appLink": null,
"createTime": "2022-08-31",
"deleted": false,
"deptCode": "001",
"deptId": 1,
"deptName": "MES开发部",
"deptType": 1,
"deptTypeTitle": "厂",
"keyValue": 1,
"memo": null,
"orders": "00",
"parentDeptId": null,
"parentPath": null,
"ucDeptId": null,
"updateTime": "2022-08-31 16:32:46"
},
"pinyinIndex": "ADMIN,ADMIN",
"ucUserId": null,
"updateTime": "2022-08-31 16:32:46",
"userCode": "00",
"userId": 1,
"userName": "admin",
"userSex": 1,
"userSources": "admin",
"userString": "1:A:admin",
"userType": "A"
},
"updateTime": "2025-09-23 13:24:24"
},
{
$cellEdit: true,
"area": 101.0,
"configNo": "A1",
"keyValue": 222030,
"material": null,
"memo": null,
"partCode": "21E8-040-17188-A1",
"plate": "12",
"plateCode": null,
"plateThickness": null,
"prepared": false,
"productType": "2",
"psId": 222030,
"quota": 1.0,
"sinTerType": 2,
"sinTerTypeTitle": "壳体",
"subCode": "21ET8-571-2901-A1",
"subName": "锌黄丙烯酸聚氨酯底漆1",
"subType": "R",
"subTypeTitle": "原材料",
"updateMan": {
"accountId": null,
"card": null,
"createTime": "2022-08-31",
"curStatus": 1,
"deleted": false,
"deptName": null,
"dimissionTime": null,
"factoryId": 41,
"head": 0,
"jobName": "总工",
"keyValue": 1,
"ldapName": "admin",
"mail": "13699999999@136.com",
"mobile": "13699999999",
"pfDepartment": {
"appLink": null,
"createTime": "2022-08-31",
"deleted": false,
"deptCode": "001",
"deptId": 1,
"deptName": "MES开发部",
"deptType": 1,
"deptTypeTitle": "厂",
"keyValue": 1,
"memo": null,
"orders": "00",
"parentDeptId": null,
"parentPath": null,
"ucDeptId": null,
"updateTime": "2022-08-31 16:32:46"
},
"pinyinIndex": "ADMIN,ADMIN",
"ucUserId": null,
"updateTime": "2022-08-31 16:32:46",
"userCode": "00",
"userId": 1,
"userName": "admin",
"userSex": 1,
"userSources": "admin",
"userString": "1:A:admin",
"userType": "A"
},
"updateTime": "2025-07-11 15:35:56"
},
{
$cellEdit: true,
"area": 8.0,
"configNo": "L16",
"keyValue": 222031,
"material": "3",
"memo": null,
"partCode": "21E8-040-17188-A1",
"plate": "12",
"plateCode": "77",
"plateThickness": null,
"prepared": true,
"productType": "4",
"psId": 222031,
"quota": 1.0,
"sinTerType": 3,
"sinTerTypeTitle": "自制玻璃饼",
"subCode": "21E8-571-4251-L16",
"subName": "锌黄丙烯酸聚氨酯底漆1",
"subType": "R",
"subTypeTitle": "原材料",
"updateMan": {
"accountId": null,
"card": null,
"createTime": "2022-08-31",
"curStatus": 1,
"deleted": false,
"deptName": null,
"dimissionTime": null,
"factoryId": 41,
"head": 0,
"jobName": "总工",
"keyValue": 1,
"ldapName": "admin",
"mail": "13699999999@136.com",
"mobile": "13699999999",
"pfDepartment": {
"appLink": null,
"createTime": "2022-08-31",
"deleted": false,
"deptCode": "001",
"deptId": 1,
"deptName": "MES开发部",
"deptType": 1,
"deptTypeTitle": "厂",
"keyValue": 1,
"memo": null,
"orders": "00",
"parentDeptId": null,
"parentPath": null,
"ucDeptId": null,
"updateTime": "2022-08-31 16:32:46"
},
"pinyinIndex": "ADMIN,ADMIN",
"ucUserId": null,
"updateTime": "2022-08-31 16:32:46",
"userCode": "00",
"userId": 1,
"userName": "admin",
"userSex": 1,
"userSources": "admin",
"userString": "1:A:admin",
"userType": "A"
},
"updateTime": "2025-07-11 15:36:02"
}
]
}
},
};
</script>
<style lang="scss" scoped>
.clearfix {
margin-bottom: 12px;
}
2 months ago
.auto-fit {
3 months ago
width: 100%;
}
</style>