ysy пре 1 година
родитељ
комит
5999549a66

+ 82 - 11
src/views/produce/components/picking/details.vue

@@ -1,7 +1,23 @@
 <template>
-  <div>
-    <div> 领料详情 </div>
-  </div>
+  <ele-pro-table
+    ref="table"
+    :columns="columns"
+    max-height="68vh"
+    :datasource="dataList"
+    cache-key="pickingDetails"
+    highlight-current-row
+    @row-click="rowClick"
+    :need-page="false"
+    @refresh="refresh"
+  >
+    <template v-slot:toolbar>
+      <div class="c_title">领料详情 </div>
+    </template>
+
+    <template v-slot:action="{ row }">
+      <el-button type="text" size="mini">详情</el-button>
+    </template>
+  </ele-pro-table>
 </template>
 
 <script>
@@ -13,17 +29,72 @@
         dataList: []
       };
     },
+
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '领料时间',
+            align: 'center'
+          },
+          {
+            prop: 'pickCode',
+            label: '领料单编号',
+            align: 'center'
+          },
+
+          {
+            prop: 'pickName',
+            label: '领料单名称',
+            align: 'center'
+          },
+
+          {
+            prop: 'executorName',
+            label: '领料人',
+            align: 'center'
+          },
+
+          {
+            prop: '',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action'
+          }
+        ];
+      }
+    },
+
     methods: {
       getList(workListIds) {
-        pickDetails(workListIds).then(res => {
-          console.log(99,res);
-          this.dataList = res.data || [];
-
-        })
+        this.workListIds = workListIds || [];
+        pickDetails(workListIds).then((res) => {
+          this.dataList = res || [];
+          this.$forceUpdate();
+        });
       },
-    },
-    created() {
 
-    }
+      rowClick(row) {},
+
+      refresh() {
+        this.getList(this.workListIds);
+      }
+    },
+    created() {}
   };
 </script>
+
+<style lang="scss" scoped></style>

+ 22 - 68
src/views/produce/components/picking/index.vue

@@ -8,6 +8,21 @@
     append-to-body
     width="80%"
   >
+  <el-form>
+    <el-row :gutter="24">
+      <el-col :span="6">
+        <el-form-item label="领料单编号" prop="pickCode" label-width="90px">
+          <el-input v-model="pickCode" disabled=""></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="6">
+        <el-form-item label="领料单名称" prop="pickName" label-width="90px">
+          <el-input v-model="pickName"></el-input>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
     <div v-for="(item, idx) in workList" :key="idx">
       <el-form
         :ref="`formRef${idx}`"
@@ -16,21 +31,7 @@
         size="mini"
         label-position="left"
       >
-        <el-row :gutter="24">
-          <el-col :span="6">
-            <el-form-item label="领料单编号" prop="pickCode" label-width="90px">
-              <el-input v-model="item.pickCode" disabled=""></el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="6">
-            <el-form-item label="领料单名称" prop="pickName" label-width="90px">
-              <el-input v-model="item.pickName"></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <div class="table_box">
+        <div class="tableZ_box">
           <div class="row">
             <div class="col">
               <div class="name">生产工单号</div>
@@ -213,6 +214,9 @@
         workList: [],
         rules: {},
 
+        pickCode: null,
+        pickName: null,
+
         typeName,
 
         tableRules: {}
@@ -243,11 +247,8 @@
         });
       },
 
-      getOrderCode() {
-        this.workList.forEach(async (e) => {
-          const data = await getCode('pick_order_code');
-          this.$set(e, 'pickCode', data);
-        });
+      async getOrderCode() {
+        this.pickCode = await getCode('pick_order_code');
       },
 
       removeItem(idx, index) {
@@ -338,7 +339,7 @@
 
         batchSave(_arr).then((res) => {
           this.$message.success('领料成功');
-          this.handleClose();
+          this.$emit('close', false);
         });
       }
     },
@@ -350,53 +351,6 @@
 </script>
 
 <style lang="scss" scoped>
-  .table_box {
-    border: 1px solid #69c0ff;
-    margin: 6px 0;
-
-    &:last-child {
-      border-bottom: none;
-    }
-
-    .row {
-      width: 100%;
-      display: flex;
-    }
-
-    .col {
-      width: calc(100% / 5);
-      display: flex;
-      align-items: center;
-      min-width: 200px;
-      min-height: 32px;
-      border-bottom: 1px solid #69c0ff;
-      border-right: 1px solid #69c0ff;
-
-      &:last-child {
-        border-right: none;
-      }
-
-      .name {
-        display: flex;
-        align-items: center;
-        padding: 4px;
-        width: 80px;
-        height: 100%;
-        background-color: #bae7ff;
-        color: #000;
-      }
-
-      .content {
-        padding: 4px 6px;
-        color: #000;
-      }
-    }
-
-    .pd6 {
-      padding: 0 6px;
-    }
-  }
-
   .table_content {
     margin-bottom: 10px;
   }

+ 2 - 2
src/views/produce/components/produceOrder.vue

@@ -115,10 +115,10 @@
     created() {},
     methods: {
       /* 表格数据源 */
-      datasource({ page, limit, where }) {
+      datasource({ page, where }) {
         return workorderPage({
           pageNum: page,
-          size: limit,
+          size: 200,
           taskId:  this.taskObj&& this.taskObj.id,
           ...where
         });

+ 57 - 2
src/views/produce/index.vue

@@ -84,12 +84,20 @@
             return false;
           }
 
-          // this.$refs.pickListRef.getList(this.workListIds);
+          this.$nextTick(() => {
+            this.$refs.pickListRef.getList(this.workListIds);
+          });
+
           this.pickingShow = true;
         }
       },
 
-      pickingClose() {
+      pickingClose(val) {
+        if (val) {
+          this.$nextTick(() => {
+            this.$refs.pickListRef.getList(this.workListIds);
+          });
+        }
         this.pickingShow = false;
       }
     },
@@ -134,6 +142,53 @@
     font-size: 18px;
     font-weight: bold;
   }
+
+  .tableZ_box {
+    border: 1px solid #e3e5e5;
+    margin: 6px 0;
+
+    &:last-child {
+      border-bottom: none;
+    }
+
+    .row {
+      width: 100%;
+      display: flex;
+    }
+
+    .col {
+      width: calc(100% / 5);
+      display: flex;
+      align-items: center;
+      min-width: 200px;
+      min-height: 32px;
+      border-bottom: 1px solid #e3e5e5;
+      border-right: 1px solid #e3e5e5;
+
+      &:last-child {
+        border-right: none;
+      }
+
+      .name {
+        display: flex;
+        align-items: center;
+        padding: 4px;
+        width: 80px;
+        height: 100%;
+        background-color: #d0e4d5;
+        color: #000;
+      }
+
+      .content {
+        padding: 4px 6px;
+        color: #000;
+      }
+    }
+
+    .pd6 {
+      padding: 0 6px;
+    }
+  }
 </style>
 <style lang="scss" scoped>
   .index_box {