chenrui 1 rok pred
rodič
commit
19116b4799

+ 1 - 2
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -53,8 +53,7 @@
             class="sTable"
             ref="table"
             size="small"
-            :rowKey="(record) => record.productSn"
-            rowKeyName="productSn"
+            :rowKey="(record) => record.id"
             :row-selection="{ columnWidth: 40 }"
             @rowSelection="rowSelectionFun"
             :data="loadData"

+ 2 - 3
src/views/purchasingManagement/purchaseOrderNew/list.vue

@@ -133,11 +133,10 @@
           </template>
         </s-table>
       </a-spin>
-  </a-card>
       <!-- 选择基本信息弹框 -->
       <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
-  </div>
- 
+  </a-card>
+  </div> 
 </template>
 
 <script>

+ 33 - 12
src/views/purchasingManagement/purchaseOrderNew/outStockListModal.vue

@@ -1,13 +1,15 @@
 <template>
-  <a-modal
-    centered
-    class="outStock-modal"
-    :footer="null"
-    :maskClosable="false"
+  <a-drawer
+    :zIndex="zIndex"
     title="导入缺货"
-    v-model="isShow"
-    @cancel="isShow=false"
-    :width="860">
+    placement="right"
+    :visible="isShow"
+    :width="width"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="isShow=false"
+    wrapClassName="outStock-modal"
+  >
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con">
         <div>
@@ -43,12 +45,13 @@
             @rowSelection="rowSelectionFun"
             :data="loadData"
             :columns="columns"
-            :scroll="{ y: 450 }"
+            :style="{ height: tableHeight+84.5+'px' }"
+            :scroll="{ y:tableHeight, x: 1000 }"
             bordered>
           </s-table>
         </div>
         <!-- 按钮 -->
-        <div class="btn-con">
+        <div class="btn-con" ref="btnBox">
           <a-button
             id="outStock-cancel"
             size="large"
@@ -64,8 +67,8 @@
             style="padding: 0 30px;">确定</a-button>
         </div>
       </div>
-      </div></a-spin>
-  </a-modal>
+    </a-spin>
+  </a-drawer>
 </template>
 
 <script>
@@ -102,6 +105,9 @@ export default {
     const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
+      zIndex: 90,
+      width: '70%',
+      tableHeight: 0,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
@@ -174,9 +180,19 @@ export default {
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.purchaseBillNo = ''
       this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      this.$nextTick(() => {
+        const searchBoxH = this.$refs.tableSearch.offsetHeight
+        const tabBoxH = this.$refs.btnBox.offsetHeight
+        this.tableHeight = window.innerHeight - searchBoxH - tabBoxH - 300
+      })
     }
   },
   watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    },
     //  父页面传过来的弹框状态
     openModal (newValue, oldValue) {
       this.isShow = newValue
@@ -186,6 +202,11 @@ export default {
       if (!newValue) {
         this.$refs.table.clearSelected() // 清空表格选中项
         this.$emit('close')
+      } else {
+        setTimeout(() => {
+          this.setTableH()
+        }, 200)
+        this.resetSearchForm()
       }
     }
   }

+ 1 - 2
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -62,8 +62,7 @@
             class="sTable"
             ref="table"
             size="small"
-            :rowKey="(record) => record.productSn"
-            rowKeyName="productSn"
+            :rowKey="(record) => record.id"
             :row-selection="{ columnWidth: 40 }"
             :scroll="{ y:tableHeight, x: 1000 }"
             @rowSelection="rowSelectionFun"