ysy 1 rok pred
rodič
commit
36922603a2

+ 9 - 0
src/api/materialReturn/index.js

@@ -24,3 +24,12 @@ export async function refundable(data) {
 }
 }
 
 
 
 
+// 保存
+
+export async function save(data) {
+  const res = await request.post('/mes/returnmaterials/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 0
src/enum/dict.js

@@ -21,6 +21,7 @@ export default {
   订单计划类型: 'plan_type',
   订单计划类型: 'plan_type',
   异常类型: 'Exception_type',
   异常类型: 'Exception_type',
   请托类型: 'entrust_type',
   请托类型: 'entrust_type',
+  退料场景: 'returnScenario',
   
   
 };
 };
 export const numberList = ['date_method'];
 export const numberList = ['date_method'];

+ 27 - 5
src/views/materialReturn/components/returnPop.vue

@@ -25,7 +25,15 @@
 
 
           <el-col :span="8">
           <el-col :span="8">
             <el-form-item label="退料场景" prop="scene" label-width="90px">
             <el-form-item label="退料场景" prop="scene" label-width="90px">
-              <el-input v-model="returnForm.scene"></el-input>
+              <el-select v-model="returnForm.scene" placeholder="请选择">
+                <el-option
+                  v-for="item in sceneList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
         </el-row>
         </el-row>
@@ -112,6 +120,8 @@
             <el-table-column label="关联工单编码" prop="workOrderCode">
             <el-table-column label="关联工单编码" prop="workOrderCode">
             </el-table-column>
             </el-table-column>
 
 
+            <el-table-column label="工序" prop="taskName"> </el-table-column>
+
             <el-table-column label="退还数量" prop="quantity">
             <el-table-column label="退还数量" prop="quantity">
               <template slot-scope="{ row, $index }">
               <template slot-scope="{ row, $index }">
                 {{ row.quantity }} {{ row.unit }}
                 {{ row.quantity }} {{ row.unit }}
@@ -145,12 +155,20 @@
 
 
 <script>
 <script>
   import { getCode } from '@/api/produce/workOrder';
   import { getCode } from '@/api/produce/workOrder';
-  import { refundable } from '@/api/materialReturn/index.js';
+  import { refundable, save } from '@/api/materialReturn/index.js';
   import pickList from './pickList.vue';
   import pickList from './pickList.vue';
 
 
   import { typeName } from '@/views/produce/components/common.js';
   import { typeName } from '@/views/produce/components/common.js';
   export default {
   export default {
     components: { pickList },
     components: { pickList },
+    props: {
+      sceneList: {
+        type: Array,
+        default() {
+          return [];
+        }
+      }
+    },
     data() {
     data() {
       return {
       return {
         visible: true,
         visible: true,
@@ -159,7 +177,8 @@
           code: '',
           code: '',
           name: '',
           name: '',
           scene: '',
           scene: '',
-          remark: ''
+          remark: '',
+          type: 1
         },
         },
 
 
         typeName,
         typeName,
@@ -223,9 +242,12 @@
 
 
         let parma = {
         let parma = {
           ...this.returnForm,
           ...this.returnForm,
-          returnList: this.returnList
+          pickOrderList: this.returnList
         };
         };
-        console.log(parma);
+
+        save(parma).then((res) => {
+          this.$emit('close', true);
+        });
       }
       }
     }
     }
   };
   };

+ 46 - 37
src/views/materialReturn/index.vue

@@ -18,23 +18,11 @@
           >
           >
         </template>
         </template>
 
 
-        <template v-slot:type="{ row }">
-          <el-tag
-            :type="
-              row.type == '0' ? 'danger' : row.type == '1' ? '' : 'success'
-            "
-            effect="dark"
-            >{{
-              row.type == '0'
-                ? '未领料'
-                : row.type == '1'
-                ? '领料中'
-                : row.type == '2'
-                ? '已出库'
-                : ''
-            }}</el-tag
-          >
-        </template>
+
+        <template v-slot:scene="{ row }">
+     {{ row.scene }}
+          </template>
+
 
 
         <template v-slot:action="{ row }">
         <template v-slot:action="{ row }">
           <el-button type="text" size="mini" @click="handDetailed(row)"
           <el-button type="text" size="mini" @click="handDetailed(row)"
@@ -44,7 +32,7 @@
       </ele-pro-table>
       </ele-pro-table>
     </el-card>
     </el-card>
 
 
-    <returnPop v-if="returnShow" @close="close"></returnPop>
+    <returnPop v-if="returnShow" @close="close" :sceneList="sceneList"></returnPop>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -54,6 +42,7 @@
   import returnSearch from './components/return-search.vue';
   import returnSearch from './components/return-search.vue';
 
 
   import returnPop from './components/returnPop.vue';
   import returnPop from './components/returnPop.vue';
+  import { getByCode } from '@/api/system/dictionary-data';
 
 
   export default {
   export default {
     components: {
     components: {
@@ -66,28 +55,21 @@
         loading: false,
         loading: false,
         selection: [],
         selection: [],
 
 
-        returnShow: false
+        returnShow: false,
+
+        sceneList: [],
       };
       };
     },
     },
     computed: {
     computed: {
       columns() {
       columns() {
         return [
         return [
 
 
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          reserveSelection: true,
-        },
-
           {
           {
             prop: 'code',
             prop: 'code',
             label: '退料单编号',
             label: '退料单编号',
             align: 'center'
             align: 'center'
           },
           },
 
 
-
           {
           {
             prop: 'name',
             prop: 'name',
             label: '退料单名称',
             label: '退料单名称',
@@ -95,6 +77,7 @@
           },
           },
 
 
           {
           {
+            slot: 'scene',
             prop: 'scene',
             prop: 'scene',
             label: '退料场景',
             label: '退料场景',
             align: 'center'
             align: 'center'
@@ -112,9 +95,8 @@
             align: 'center'
             align: 'center'
           },
           },
           {
           {
-            prop: 'type',
-            slot: 'type',
-            label: '退料类型',
+            prop: 'remark',
+            label: '退料描述',
             align: 'center'
             align: 'center'
           },
           },
 
 
@@ -130,7 +112,9 @@
         ];
         ];
       }
       }
     },
     },
-    created() {},
+    created() {
+      this.getByCodeFn();
+    },
     methods: {
     methods: {
       /* 表格数据源 */
       /* 表格数据源 */
       async datasource({ page, limit, where }) {
       async datasource({ page, limit, where }) {
@@ -149,14 +133,39 @@
       },
       },
 
 
       close(val) {
       close(val) {
-    if (val) {
-       this.reload()
-      }
-      this.returnShow = false;
+        if (val) {
+          this.reload();
+        }
+        this.returnShow = false;
+      },
+
+      handDetailed(row) {},
+
+
+      getByCodeFn() {
+      getByCode('returnScenario').then((res) => {
+        let _arr = [];
+        res.data.map((item) => {
+          const key = Object.keys(item)[0];
+          const value = item[key];
+
+          _arr.push({ name: key, value: value });
+        });
+   
+        this.sceneList = _arr;
+      });
     },
     },
 
 
+    sceneListFn(val) {
+      let _arr = this.sceneList;
+      for (const item of _arr) {
+        console.log(item.value, val);
+        if (item.value == val) {
+          return item.name;
+        }
+      }
+    },
 
 
-    handDetailed(row)  {},
 
 
       /* 刷新表格 */
       /* 刷新表格 */
       reload(where = {}) {
       reload(where = {}) {