|
|
@@ -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%;" />
|
|
|
@@ -130,7 +130,7 @@
|
|
|
<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['fa']"/>
|
|
|
+ <el-input v-model="yycpzlformData['fangan']" />
|
|
|
</el-form-item>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -168,6 +168,19 @@
|
|
|
<!-- </el-table>-->
|
|
|
</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%;">
|
|
|
@@ -1308,7 +1321,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'
|
|
|
@@ -1999,53 +2012,57 @@ const add_gdzlent = async (event,id1,id2,id3) => {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+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)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -2715,9 +2732,10 @@ const yycpzlformData = reactive({
|
|
|
yjzl:true,
|
|
|
gyap: true,
|
|
|
gyfa: '',
|
|
|
- fa: 'A',
|
|
|
+ fangan: 'A',
|
|
|
});
|
|
|
const onyycpzllist = ref(false);
|
|
|
+const fanganRef = ref()
|
|
|
//引用产品资料【按钮】
|
|
|
const onyycpzlclick = () => {
|
|
|
if(_Gd_gdbh.value == null){
|
|
|
@@ -2730,26 +2748,26 @@ 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([]);
|
|
|
-//引用产品资料->获取产品资料 2403114
|
|
|
+const WorkOrderDetailCopesFangan = ref([])
|
|
|
+const defaultSelectionFangan = ref()
|
|
|
+//引用产品资料->获取产品资料
|
|
|
const _WorkOrderDetailCopedata = async ()=>{
|
|
|
let search = yycpzlformData['gdbh'];
|
|
|
- const WorkOrderDetailCopes = await ProductInformation({workOrder:search});
|
|
|
- // const WorkOrderDetailCopes = await WorkOrderDetailCope({search:search});
|
|
|
- console.log(WorkOrderDetailCopes);
|
|
|
- // yyzltableData.value = WorkOrderDetailCopes.data
|
|
|
- // yycpzlformData['gdbh'] = WorkOrderDetailCopes.data[0]['工单编号'];
|
|
|
- // yycpzlformData['khdh'] = WorkOrderDetailCopes.data[0]['客户编号'];
|
|
|
- // yycpzlformData['khmc'] = WorkOrderDetailCopes.data[0]['客户名称'];
|
|
|
- // yycpzlformData['cpdh'] = WorkOrderDetailCopes.data[0]['产品编号'];
|
|
|
- // yycpzlformData['cpmc'] = WorkOrderDetailCopes.data[0]['产品名称'];
|
|
|
+ // 2403725 是带两个方案的
|
|
|
+ const WorkOrderDetailCopes = await ProductCopeDetail({workorder:search});
|
|
|
+ fanganRef.value.focus()
|
|
|
if(WorkOrderDetailCopes.msg === '未找到工单信息'){
|
|
|
yycpzlformData['khdh'] = '';
|
|
|
yycpzlformData['khmc'] = '';
|
|
|
@@ -2758,33 +2776,88 @@ const _WorkOrderDetailCopedata = async ()=>{
|
|
|
ElMessage({type: 'warning',message: '未找到工单信息'})
|
|
|
return false;
|
|
|
}else{
|
|
|
+ console.log( WorkOrderDetailCopes.data)
|
|
|
+ console.log( WorkOrderDetailCopes.data['产品代号'])
|
|
|
yycpzlformData['gdbh'] = WorkOrderDetailCopes.data['工单编号'];
|
|
|
- yycpzlformData['khdh'] = WorkOrderDetailCopes.data['客户代号'];
|
|
|
+ yycpzlformData['khdh'] = WorkOrderDetailCopes.data['客户编号'];
|
|
|
yycpzlformData['khmc'] = WorkOrderDetailCopes.data['客户名称'];
|
|
|
- yycpzlformData['cpdh'] = 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 yyzltableRowClick = async (row) => {
|
|
|
-// yycpzlformData['gdbh'] = row['工单编号'];
|
|
|
-// yycpzlformData['khdh'] = row['客户编号'];
|
|
|
-// yycpzlformData['khmc'] = row['客户名称'];
|
|
|
-// yycpzlformData['cpdh'] = row['产品编号'];
|
|
|
-// yycpzlformData['cpmc'] = row['产品名称'];
|
|
|
-// };
|
|
|
-//引用产品资料【执行】
|
|
|
+
|
|
|
+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;
|