工艺管理问题修改

dev-scheduling
zhangdi 2 months ago
parent 815f212a04
commit ab1e38f191
  1. 72
      src/views/processManagement/components/processMainte/dsPartBasicInfo.vue
  2. 98
      src/views/processManagement/components/processMainte/processPlanning.vue

@ -678,73 +678,12 @@ export default {
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.hotDispose = true;
// }
// if (craftWay.indexOf('') !== -1) {
// this.validateObj.fluorescenceCheck = true;
// }
// if (craftWay.indexOf('') !== -1) {
// this.validateObj.inkjetPrinting = 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;
console.log(98989, this.formData);
this.$refs.testForm.validate(valid => {
if (valid) {
let isReturn = false;
@ -789,16 +728,7 @@ export default {
this.$message.success('操作成功');
this.cancel(flag, res.data);
});
// 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;
}

@ -25,9 +25,26 @@
:data="data"
:props="defaultProps"
@node-click="handleNodeClick"
@node-contextmenu="handleNodeRightClick"
:default-expand-all="true"
:expand-on-click-node="false"
/>
<div
v-show="contextMenuVisible"
class="custom-context-menu"
:style="{ top: contextMenuTop + 'px', left: contextMenuLeft + 'px' }"
>
<div class="context-menu">
<el-button
link
type="danger"
@click="handleDeleteNode"
v-if="contextTreeNode && contextTreeNode.level === 2"
>
删除
</el-button>
</div>
</div>
</div>
<div class="process-right">
<el-form
@ -620,12 +637,19 @@ export default {
moldCode: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }],
},
treeNodes: {}, //
parentData: {}, //
partInfoData: {}, //
tempId: 0,
projectOptions: [], //
standardList: [], //
filteredList: [],
dictionaryData: [],
//
contextMenuVisible: false,
contextMenuTop: 0,
contextMenuLeft: 0,
contextNodeData: null,
contextTreeNode: null,
};
},
@ -639,6 +663,12 @@ export default {
this.getProject();
this.getStandardList();
this.getDictionary();
document.addEventListener('click', this.closeContextMenu);
document.addEventListener('contextmenu', this.closeContextMenu); //
},
beforeUnmount() {
document.removeEventListener('click', this.closeContextMenu);
document.removeEventListener('contextmenu', this.closeContextMenu);
},
methods: {
//
@ -844,6 +874,15 @@ export default {
return false;
}
this.treeNodes = nodes;
const parentNode = node.parent;
if (parentNode && parentNode.data && !parentNode.isRoot) {
this.parentData = parentNode.data; //
console.log('父节点数据:', this.parentData);
} else {
console.log('当前节点无父节点(可能是根节点)');
}
this.treeLeave = node.level;
//
@ -877,6 +916,36 @@ export default {
this.form4.tableData4 = moldToolList;
}
},
//
handleNodeRightClick(event, nodeData, node, component) {
event.preventDefault();
if (node.level !== 2) {
this.$message.warning('仅工艺节点支持右键操作');
this.contextMenuVisible = false
return;
}
//
this.contextNodeData = nodeData;
this.contextTreeNode = node;
//
const x = event.clientX;
const y = event.clientY;
//
this.contextMenuLeft = Math.min(x, window.innerWidth - 130); // 130
this.contextMenuTop = Math.min(y, window.innerHeight - 60); // 60
this.contextMenuVisible = true;
},
closeContextMenu() {
this.contextMenuVisible = false;
this.contextNodeData = null;
this.contextTreeNode = null;
},
// tab
handleClick(value) {
console.log(999999, value);
@ -1261,6 +1330,18 @@ export default {
this.$refs.tableForm2.validate((isValid, invalidFields) => {
if (isValid) {
this.craftLoading = true;
//
if (
this.parentData.rawData.remarks &&
this.parentData.rawData?.remarks.indexOf('HTBY') > -1
) {
this.form2.tableData2.forEach(item => {
if (item.projectName.indexOf('耐蚀性检测') < 0) {
this.$message.error('检测项目必须包含耐蚀性检测!');
return false;
}
});
}
let query_ = {
processEntity: this.treeNodes.rawData.processInfo, //
processProjectEntityList: this.form2.tableData2, //
@ -1360,4 +1441,21 @@ export default {
.tableHeight {
height: calc(100vh - 50px - 80px - 40px - 94px - 50px - 50px);
}
.custom-context-menu {
position: fixed;
z-index: 2000;
background: #fff;
border: 1px solid #ebeef5;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
padding: 4px 0;
}
.context-menu .el-button {
display: block;
width: 100%;
text-align: left;
padding: 6px 12px;
margin: 0;
}
</style>

Loading…
Cancel
Save