|
|
@@ -114,7 +114,7 @@
|
|
|
<el-dialog v-model="onyycpzllist" title="获取工单资料">
|
|
|
<div style=" padding: 0px; align-items: center;">
|
|
|
<el-form-item label="工单编号" prop="processName" class="mab">
|
|
|
- <el-input v-model="yycpzlformData['gdbh']" @keyup.enter="yycpzlProductValue" style="width: 23%;" />
|
|
|
+ <el-input v-model="yycpzlformData['gdbh']" ref="fanganRef" @click="yycpzlProductValue({ code: 'Tab'})" @keydown="yycpzlProductValue" style="width: 23%;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客户代号" prop="processName" class="mab">
|
|
|
<el-input v-model="yycpzlformData['khdh']" disabled style="width: 23%;" />
|
|
|
@@ -129,6 +129,9 @@
|
|
|
<el-form-item label="创建选择" class="mab" >
|
|
|
<el-checkbox disabled v-model="yycpzlformData['yjzl']">获取印件资料</el-checkbox>
|
|
|
<el-checkbox disabled v-model="yycpzlformData['gyap']">获取工艺安排</el-checkbox>
|
|
|
+ <el-form-item label="" prop="processName" class="mab" label-width="100" >
|
|
|
+ <el-input v-model="yycpzlformData['fangan']" />
|
|
|
+ </el-form-item>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer" style="text-align: right;margin-left: 25%">
|
|
|
@@ -137,6 +140,19 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog v-model="openFangan" title="请选择方案" style="width: 300px;" destroy-on-close>
|
|
|
+ <el-tree
|
|
|
+ :data="WorkOrderDetailCopesFangan"
|
|
|
+ :props="{ children: 'children', label: '方案'}" style="border: 1px solid #efefef; padding: 5px;"
|
|
|
+ node-key="方案"
|
|
|
+ highlight-current
|
|
|
+ :current-node-key="defaultSelectionFangan"
|
|
|
+ @node-click="setFangan"
|
|
|
+ >
|
|
|
+
|
|
|
+ </el-tree>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!--工序产量核算-->
|
|
|
<el-dialog v-model="gxclhslist" title="印件投料核算" style="width: 20%;position: fixed; bottom: 35%; left: 35%">
|
|
|
<div style="display: flex; flex-direction: column; height: 100%;">
|
|
|
@@ -393,6 +409,7 @@
|
|
|
<div class="JKWTree-tree" style="height: 200px">
|
|
|
<h3>工单管理</h3>
|
|
|
<el-tree :data="treeData.data" @node-click="handleNodeClick"></el-tree>
|
|
|
+<!-- <el-tree :data="treeData.data" class="treecolor" @node-click="handleNodeClick"></el-tree>-->
|
|
|
</div>
|
|
|
</layout-sider>
|
|
|
|
|
|
@@ -873,12 +890,14 @@
|
|
|
<div>
|
|
|
<el-form-item label="关键字:" class="mab" prop="keyOrder">
|
|
|
<el-space>
|
|
|
- <el-input v-model="cpdh_keyword" @keyup.enter="cpdh_ProductValue" style="width: 100%;"/>
|
|
|
+ <el-input v-model="cpdh_keyword" @keyup.enter="cpdh_ProductValue" style="width: 100%;" ref="addgdzlcpdhInput"/>
|
|
|
<el-button @click="gongdanSearchHandle(cpdh_keyword, '产品代号')">刷新</el-button>
|
|
|
</el-space>
|
|
|
</el-form-item>
|
|
|
<div style="border:1px solid #eee; width:100%; height: 400px; overflow-y: auto">
|
|
|
- <el-tree :data="cpdhDataList" :props="{children: 'children',label: 'name', value: '产品编号'}" @node-click="selectGongDanNode($event, '产品代号')" />
|
|
|
+ <el-tree :data="cpdhDataList"
|
|
|
+ :props="{children: 'children',label: 'name', value: '产品编号'}"
|
|
|
+ @node-click="selectGongDanNode($event, '产品代号')" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
@@ -1277,7 +1296,7 @@ import {
|
|
|
getProduct, getProductGy, ProductInformationEdit, workOrderListDetail, editProduct, getOrderProcessCount, StatusEdit,
|
|
|
PrintDetailDel, ProcessDetailDel,WorkOrderDetailCope,
|
|
|
getGdAnnexTable,
|
|
|
- gdAnnexAdd,
|
|
|
+ gdAnnexAdd,ProductCopeDetail,WorkOrderDetailListCope,
|
|
|
gdAnnexDel,
|
|
|
} from "@/api/yunyin/yunying";
|
|
|
import PrintPage from './components/print.vue'
|
|
|
@@ -1914,15 +1933,12 @@ const selectGongDanNode = (node, type) => {
|
|
|
}
|
|
|
|
|
|
const xzgdzlInput =ref()
|
|
|
+const addgdzlcpdhInput =ref()
|
|
|
const xzgdzlTree = ref()
|
|
|
const currentNodeKey = ref('')
|
|
|
|
|
|
//新增工单资料弹窗 键盘 input框跳转
|
|
|
const add_gdzlent = async (event,id1,id2,id3) => {
|
|
|
- if (id2 === '产品代号' && event.key==='Tab' || id2 === '产品代号' && event.key=== 'Enter') {
|
|
|
- await _ProductCodeList()
|
|
|
- cpdhModal.value = true
|
|
|
- }
|
|
|
if(event.keyCode === 40){
|
|
|
if(id3!=''){
|
|
|
document.getElementById(id3).focus()
|
|
|
@@ -1967,58 +1983,72 @@ const add_gdzlent = async (event,id1,id2,id3) => {
|
|
|
}, 200)
|
|
|
})
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
+ if (id2 === '产品代号' && event.key==='Tab' || id2 === '产品代号' && event.key=== 'Enter') {
|
|
|
+ await _ProductCodeList()
|
|
|
+ cpdhModal.value = true
|
|
|
+ //自动获取光标
|
|
|
+ await nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ addgdzlcpdhInput.value.focus()
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+let isdeFun = false
|
|
|
watch(() => khdhModal.value, async v => {
|
|
|
await nextTick(() => {
|
|
|
if (xzgdzlTree.value !== undefined) {
|
|
|
- if (v === true) {
|
|
|
- document.body.addEventListener('keydown', e => {
|
|
|
- if (e.code === 'Enter' && currentNodeKey.value !== '') {
|
|
|
- selectGongDanNode(khdhDataList.value.find(item => item['客户编号'] == currentNodeKey.value), '客户代号')
|
|
|
- return
|
|
|
- }
|
|
|
- if (e.code === 'ArrowDown') {
|
|
|
- if (currentNodeKey.value === '') {
|
|
|
- currentNodeKey.value = khdhDataList.value[0].客户编号
|
|
|
- } else {
|
|
|
- for(let i = 0; i < khdhDataList.value.length; i++) {
|
|
|
- const item = khdhDataList.value[i]
|
|
|
- if (item['客户编号'] == currentNodeKey.value) {
|
|
|
- if (khdhDataList.value[i + 1]) {
|
|
|
- currentNodeKey.value = khdhDataList.value[i + 1].客户编号
|
|
|
- break;
|
|
|
- } else {
|
|
|
- currentNodeKey.value = khdhDataList.value[0].客户编号
|
|
|
- }
|
|
|
+ const defun = (e) => {
|
|
|
+ isdeFun = true
|
|
|
+ if (e.code === 'Enter' && currentNodeKey.value !== '') {
|
|
|
+ selectGongDanNode(khdhDataList.value.find(item => item['客户编号'] == currentNodeKey.value), '客户代号')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (e.code === 'ArrowDown') {
|
|
|
+ if (currentNodeKey.value === '') {
|
|
|
+ currentNodeKey.value = khdhDataList.value[0].客户编号
|
|
|
+ } else {
|
|
|
+ console.log(khdhDataList.value)
|
|
|
+ for(let i = 0; i < khdhDataList.value.length; i++) {
|
|
|
+ const item = khdhDataList.value[i]
|
|
|
+ if (item['客户编号'] == currentNodeKey.value) {
|
|
|
+ if (khdhDataList.value[i + 1]) {
|
|
|
+ currentNodeKey.value = khdhDataList.value[i + 1].客户编号
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ currentNodeKey.value = khdhDataList.value[0].客户编号
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (e.code === 'ArrowUp') {
|
|
|
- if (currentNodeKey.value === '') {
|
|
|
- currentNodeKey.value = khdhDataList.value[khdhDataList.value.length - 1].客户编号
|
|
|
- } else {
|
|
|
- for(let i = 0; i < khdhDataList.value.length; i++) {
|
|
|
- const item = khdhDataList.value[i]
|
|
|
- if (item['客户编号'] == currentNodeKey.value) {
|
|
|
- if (khdhDataList.value[i - 1]) {
|
|
|
- currentNodeKey.value = khdhDataList.value[i - 1].客户编号
|
|
|
- break;
|
|
|
- } else {
|
|
|
- currentNodeKey.value = khdhDataList.value[khdhDataList.value.length - 1].客户编号
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (e.code === 'ArrowUp') {
|
|
|
+ if (currentNodeKey.value === '') {
|
|
|
+ currentNodeKey.value = khdhDataList.value[khdhDataList.value.length - 1].客户编号
|
|
|
+ } else {
|
|
|
+ for(let i = 0; i < khdhDataList.value.length; i++) {
|
|
|
+ const item = khdhDataList.value[i]
|
|
|
+ if (item['客户编号'] == currentNodeKey.value) {
|
|
|
+ if (khdhDataList.value[i - 1]) {
|
|
|
+ currentNodeKey.value = khdhDataList.value[i - 1].客户编号
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ currentNodeKey.value = khdhDataList.value[khdhDataList.value.length - 1].客户编号
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (v === true) {
|
|
|
+ isdeFun || document.body.addEventListener('keydown', defun)
|
|
|
+ isdeFun && document.body.removeEventListener('keydown', defun)
|
|
|
} else {
|
|
|
- document.body.removeEventListener('keydown')
|
|
|
+ document.body.removeEventListener('keydown', defun)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
})
|
|
|
|
|
|
// =========== 新增印件资料 ===========
|
|
|
@@ -2684,8 +2714,10 @@ const yycpzlformData = reactive({
|
|
|
yjzl:true,
|
|
|
gyap: true,
|
|
|
gyfa: '',
|
|
|
+ fangan: 'A',
|
|
|
});
|
|
|
const onyycpzllist = ref(false);
|
|
|
+const fanganRef = ref()
|
|
|
//引用产品资料【按钮】
|
|
|
const onyycpzlclick = () => {
|
|
|
if(_Gd_gdbh.value == null){
|
|
|
@@ -2698,55 +2730,124 @@ const onyycpzlclick = () => {
|
|
|
}
|
|
|
};
|
|
|
//引用产品资料【回车】
|
|
|
-const yycpzlProductValue = async () => {
|
|
|
- if(yycpzlformData['gdbh'] == null || yycpzlformData['gdbh'] == ''){
|
|
|
- ElMessage({type: 'warning',message: '工单那不能为空'})
|
|
|
- return false;
|
|
|
+const yycpzlProductValue = async (e) => {
|
|
|
+ if (e.code === 'Tab') {
|
|
|
+ if (yycpzlformData['gdbh'] == null || yycpzlformData['gdbh'] == '') {
|
|
|
+ ElMessage({ type: 'warning', message: '工单那不能为空' })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ await _WorkOrderDetailCopedata();
|
|
|
+ fanganKeyDown()
|
|
|
}
|
|
|
- _WorkOrderDetailCopedata();
|
|
|
};
|
|
|
+
|
|
|
+const yyzltableData = ref([]);
|
|
|
+const WorkOrderDetailCopesFangan = ref([])
|
|
|
+const defaultSelectionFangan = ref()
|
|
|
//引用产品资料->获取产品资料
|
|
|
const _WorkOrderDetailCopedata = async ()=>{
|
|
|
let search = yycpzlformData['gdbh'];
|
|
|
- console.log(search)
|
|
|
- // const ProductInformations = await ProductInformation({workOrder:search});
|
|
|
- const WorkOrderDetailCopes = await WorkOrderDetailCope({search:search});
|
|
|
- console.log(WorkOrderDetailCopes);
|
|
|
- // if(ProductInformations.msg === '未找到工单信息'){
|
|
|
- // yycpzlformData['khdh'] = '';
|
|
|
- // yycpzlformData['khmc'] = '';
|
|
|
- // yycpzlformData['cpdh'] = '';
|
|
|
- // yycpzlformData['cpmc'] = '';
|
|
|
- // ElMessage({type: 'warning',message: '未找到工单信息'})
|
|
|
- // return false;
|
|
|
- // }else{
|
|
|
- // yycpzlformData['gdbh'] = ProductInformations.data['工单编号'];
|
|
|
- // yycpzlformData['khdh'] = ProductInformations.data['客户代号'];
|
|
|
- // yycpzlformData['khmc'] = ProductInformations.data['客户名称'];
|
|
|
- // yycpzlformData['cpdh'] = ProductInformations.data['产品代号'];
|
|
|
- // yycpzlformData['cpmc'] = ProductInformations.data['产品名称'];
|
|
|
- // }
|
|
|
+ // 2403725 是带两个方案的
|
|
|
+ const WorkOrderDetailCopes = await ProductCopeDetail({workorder:search});
|
|
|
+ console.log(WorkOrderDetailCopes)
|
|
|
+ fanganRef.value.focus()
|
|
|
+ if(WorkOrderDetailCopes.msg === '未找到工单信息'){
|
|
|
+ yycpzlformData['khdh'] = '';
|
|
|
+ yycpzlformData['khmc'] = '';
|
|
|
+ yycpzlformData['cpdh'] = '';
|
|
|
+ yycpzlformData['cpmc'] = '';
|
|
|
+ ElMessage({type: 'warning',message: '未找到工单信息'})
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ yycpzlformData['gdbh'] = WorkOrderDetailCopes.data['工单编号'];
|
|
|
+ yycpzlformData['khdh'] = WorkOrderDetailCopes.data['客户编号'];
|
|
|
+ yycpzlformData['khmc'] = WorkOrderDetailCopes.data['客户名称'];
|
|
|
+ yycpzlformData['cpdh'] = WorkOrderDetailCopes.data['产品编号'];
|
|
|
+ yycpzlformData['cpmc'] = WorkOrderDetailCopes.data['产品名称'];
|
|
|
+ yycpzlformData['fangan'] = WorkOrderDetailCopes.data['方案'][0]['方案'];
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopes.data['方案'][0]['方案']
|
|
|
+ WorkOrderDetailCopesFangan.value = WorkOrderDetailCopes.data['方案']
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const setFangan = (node) => {
|
|
|
+ yycpzlformData['fangan'] = node['方案']
|
|
|
+ defaultSelectionFangan.value = node['方案']
|
|
|
+ document.removeEventListener('keydown', () => {})
|
|
|
+ openFangan.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const openFangan = ref(false)
|
|
|
+const fanganKeyDown = () => {
|
|
|
+ //2403725
|
|
|
+ if (WorkOrderDetailCopesFangan.value.length > 1) {
|
|
|
+ openFangan.value = true
|
|
|
+ document.addEventListener('keydown', (e) => {
|
|
|
+ let currentIndex
|
|
|
+ WorkOrderDetailCopesFangan.value.map( (item, index) => {
|
|
|
+ if (item['方案'] === defaultSelectionFangan.value[0]) {
|
|
|
+ currentIndex = index
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (e.code === 'ArrowDown') {
|
|
|
+ if (WorkOrderDetailCopesFangan.value[currentIndex + 1]) {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[currentIndex + 1]['方案']
|
|
|
+ } else {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[0]['方案']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.code === 'ArrowUp') {
|
|
|
+ if (WorkOrderDetailCopesFangan.value[currentIndex - 1]) {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[currentIndex - 1]['方案']
|
|
|
+ } else {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[WorkOrderDetailCopesFangan.value.length - 1]['方案']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.code === 'Enter') {
|
|
|
+ yycpzlformData['fangan'] = defaultSelectionFangan.value
|
|
|
+ document.removeEventListener('keydown', (e) => {
|
|
|
+ console.log(e)
|
|
|
+ })
|
|
|
+ openFangan.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
-//引用产品资料【执行】
|
|
|
+//引用产品资料【执行】按钮
|
|
|
const yycpzlhandleConfirm = async () => {
|
|
|
_ProductInformationEdit();
|
|
|
};
|
|
|
//引用产品资料->获取产品资料
|
|
|
const _ProductInformationEdit = async ()=>{
|
|
|
+ console.log(yycpzlformData)
|
|
|
+ if(yycpzlformData['gdbh'] === null || yycpzlformData['gdbh'] === undefined){
|
|
|
+ ElMessage({type: 'warning', message: '工单编号为空'});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(yycpzlformData['cpdh'] === null || yycpzlformData['cpdh'] === undefined){
|
|
|
+ ElMessage({type: 'warning', message: '产品代号为空'});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(yycpzlformData['fangan'] === null || yycpzlformData['fangan'] === undefined){
|
|
|
+ ElMessage({type: 'warning', message: '工艺方案为空'});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let params = {}
|
|
|
- params.oldWorkOrder = _Gd_gdbh.value;
|
|
|
- params.newWorkOrder = yycpzlformData['gdbh'];
|
|
|
+ params.workorder = yycpzlformData['gdbh'];
|
|
|
+ params.productCode = yycpzlformData['cpdh'];
|
|
|
+ params.option = yycpzlformData['fangan'];
|
|
|
+ console.log(params)
|
|
|
try {
|
|
|
- const ProductInformationEditdata = await ProductInformationEdit(params);
|
|
|
+ const ProductInformationEditdata = await WorkOrderDetailListCope(params);
|
|
|
if (ProductInformationEditdata.code === 0) {
|
|
|
ElMessage({type: 'success', message: '更新成功'})
|
|
|
+ onyycpzllist.value = false;
|
|
|
} else {
|
|
|
ElMessage({type: 'error',message: '更新失败'})
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
}
|
|
|
- onyycpzllist.value = false;
|
|
|
}
|
|
|
//引用产品资料【放弃】
|
|
|
const yycpzlhandleCancel = () => {onyycpzllist.value = false;};
|
|
|
@@ -2783,6 +2884,21 @@ DataListdata();
|
|
|
const tableData = reactive([])
|
|
|
const _Gd_khdh = ref(null)
|
|
|
const handleNodeClick = async (node) => {
|
|
|
+ // // 取消所有节点的颜色
|
|
|
+ // const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
|
|
|
+ // allNodes.forEach(node => {
|
|
|
+ // node.querySelector('.el-tree-node__label').style.color = '';
|
|
|
+ // });
|
|
|
+ // // 获取点击的节点
|
|
|
+ // const clickedNodeId = node['$treeNodeId'];
|
|
|
+ // console.log(clickedNodeId);
|
|
|
+ // const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
|
|
|
+ // if (clickedNode) {
|
|
|
+ // console.log(clickedNode);
|
|
|
+ // // 给当前点击的节点改变颜色
|
|
|
+ // clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
+ // }
|
|
|
+
|
|
|
searchInfo.value = '';
|
|
|
gytableData.value = [];
|
|
|
yjtableData.value = [];
|