Browse Source

Merge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

Lexie 1 year ago
parent
commit
486e47945e
1 changed files with 33 additions and 11 deletions
  1. 33 11
      src/view/yunyin/shengchanguanli/gongdanziliao.vue

+ 33 - 11
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -114,8 +114,10 @@
           <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']" ref="fanganRef" @click="yycpzlProductValue({ code: 'Tab'})" @keydown="yycpzlProductValue" style="width: 23%;" />
-                <el-button type="primary" @click="yycppshuaxin_click" style="margin-left: 10px">刷新</el-button>
+<!--                @click="yycpzlProductValue({ code: 'Tab'})"-->
+                <el-input v-model="yycpzlformData['gdbh']" ref="fanganRef"  @keydown="yycpzlProductValue" style="width: 23%;" />
+<!--                <el-button type="primary" @click="yycppshuaxin_click" style="margin-left: 10px">刷新</el-button>-->
+                &nbsp;&nbsp;<span style="color:red">(模糊搜索工单编号或名称)</span>
               </el-form-item>
               <el-form-item label="客户代号" prop="processName" class="mab">
                 <el-input v-model="yycpzlformData['khdh']" disabled style="width: 23%;" />
@@ -131,7 +133,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['fangan']" />
+                  <el-input v-model="yycpzlformData['fangan']" @keydown="fanganProductValue" />
                 </el-form-item>
               </el-form-item>
             </div>
@@ -2755,6 +2757,8 @@ const yycpzlformData = reactive({
 });
 const onyycpzllist = ref(false);
 const fanganRef = ref();
+const yyzltableData = ref([]);
+
 //引用产品资料【按钮】
 const onyycpzlclick = () => {
   if(_Gd_gdbh.value == null){
@@ -2762,21 +2766,32 @@ const onyycpzlclick = () => {
     ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
   }else{
     yycpzlformData['gdbh'] = _Gd_gdbh.value;
+    yyzltableData.value = [];
     _WorkOrderDetailCopedata();
     onyycpzllist.value = true;
   }
 };
-//引用产品资料【回车】
+//引用产品资料工单编号【回车】
 const yycpzlProductValue = async (e) => {
-  if (e.code === 'Tab') {
+  if (e.code === 'Enter') {
     if (yycpzlformData['gdbh'] == null || yycpzlformData['gdbh'] == '') {
-      ElMessage({ type: 'warning', message: '工单不能为空' })
+      ElMessage({ type: 'warning', message: '工单编号不能为空' })
       return false;
     }
-    await _WorkOrderDetailCopedata();
+    await _DetailCope();
+  }
+  if (e.code === 'Tab') {
+    await  _WorkOrderDetailCopedata()
     fanganKeyDown()
   }
 };
+// const fanganProductValue = async (e) => {
+//   if (e.code === 'Tab') {
+//     console.log(123)
+//     await  _WorkOrderDetailCopedata()
+//     fanganRef.value.focus()
+//   }
+// };
 
 const WorkOrderDetailCopesFangan = ref([])
 const defaultSelectionFangan = ref()
@@ -2786,13 +2801,13 @@ const _WorkOrderDetailCopedata = async ()=>{
   // 2403725 是带两个方案的
   const WorkOrderDetailCopes = await ProductCopeDetail({workorder:search});
   console.log(WorkOrderDetailCopes)
-  fanganRef.value.focus()
+  // fanganRef.value.focus()
   if(WorkOrderDetailCopes.msg === '未找到工单信息'){
     yycpzlformData['khdh'] = '';
     yycpzlformData['khmc'] = '';
     yycpzlformData['cpdh'] = '';
     yycpzlformData['cpmc'] =  '';
-    ElMessage({type: 'warning',message: '未找到工单信息'})
+    // ElMessage({type: 'warning',message: '未找到工单信息'})
     return false;
   }else{
     yycpzlformData['gdbh'] = WorkOrderDetailCopes.data['工单编号'];
@@ -2806,8 +2821,14 @@ const _WorkOrderDetailCopedata = async ()=>{
   }
 }
 
-const yyzltableData = ref([]);
-const yycppshuaxin_click = async ()=>{
+// const yycppshuaxin_click = async ()=>{
+//   let search = yycpzlformData['gdbh'];
+//   console.log(search)
+//   const WorkOrderDetailCope_table = await WorkOrderDetailCope({search:search});
+//   console.log(WorkOrderDetailCope_table)
+//   yyzltableData.value = WorkOrderDetailCope_table.data
+// }
+const _DetailCope = async (row)=>{
   let search = yycpzlformData['gdbh'];
   console.log(search)
   const WorkOrderDetailCope_table = await WorkOrderDetailCope({search:search});
@@ -2854,6 +2875,7 @@ const fanganKeyDown = () => {
       }
       if (e.code === 'Enter') {
         yycpzlformData['fangan'] = defaultSelectionFangan.value
+        console.log(12312312312312321321321321)
         document.removeEventListener('keydown', (e) => {
           console.log(e)
         })