ソースを参照

Merge branch 'develop_12' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_12

lilei 2 年 前
コミット
4dc80f29d0

+ 33 - 10
src/views/basicData/systemSettings/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <div>
+  <a-card size="small" :bordered="false" class="systemSettingsList-wrap" :style="{height:conHeight+'px'}">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-card>
+      <div ref="contentBox">
         <a-row :gutter="16">
           <a-col class="gutter-row" :span="12">
             销售下单时,是否显示产品库存为0的产品信息
@@ -17,8 +17,7 @@
             </a-radio-group>
           </a-col>
         </a-row>
-      </a-card>
-      <a-card>
+
         <a-row :gutter="16">
           <a-col class="gutter-row" :span="12">
             销售下单时,是否显示废品仓的产品信息
@@ -34,8 +33,7 @@
             </a-radio-group>
           </a-col>
         </a-row>
-      </a-card>
-      <a-card>
+
         <a-row :gutter="16">
           <a-col class="gutter-row" :span="12">
             库存预警,是否包含废品库数量
@@ -51,9 +49,9 @@
             </a-radio-group>
           </a-col>
         </a-row>
-      </a-card>
+      </div>
     </a-spin>
-  </div>
+  </a-card>
 </template>
 
 <script>
@@ -66,7 +64,8 @@ export default {
       spinning: false,
       qtyValue: 1,
       wasteInfoValue: 1,
-      wasteNumValue: 1
+      wasteNumValue: 1,
+      conHeight: '100%'
     }
   },
   methods: {
@@ -92,21 +91,45 @@ export default {
         this.spinning = false
       })
     },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      this.conHeight = window.innerHeight - 110.5
+    },
     handleQty () {},
     handleWasteInfo () {},
     handleWasteNum () {}
   },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
   mounted () {
-    this.spinning = true
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
       // this.getData()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
+      this.pageInit()
       // this.getData()
     }
   }
 }
 </script>
+<style lang="less" scoped>
+  .systemSettingsList-wrap{
+    .ant-row{
+      padding:23px 10px;
+      border-bottom: 1px solid #e0e0e0;
+    }
+  }
+
+</style>

+ 25 - 19
src/views/productManagement/productInfo/list.vue

@@ -30,10 +30,17 @@
                   <v-select code="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="4" :sm="24" style="margin-top:6px;">
-                <a-checkbox @change="handleHasQty" :checked="queryParam.stockEmptyFlag == 0">
-                  只查看有库存
-                </a-checkbox>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="查看库存">
+                  <a-select @change="handleHasQty" :value="queryParam.stockEmptyFlag" placeholder="请选择查看库存类型">
+                    <a-select-option value="0">
+                      有库存
+                    </a-select-option>
+                    <a-select-option value="1">
+                      无库存
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -63,10 +70,13 @@
             <a-menu-item key="1"> 批量启用</a-menu-item>
             <a-menu-item key="2"> 批量禁用</a-menu-item>
           </a-menu>
-          <a-button type="danger" ghost style="margin-left: 5px"> 批量操作 <a-icon type="down" /> </a-button>
+          <a-button type="danger" ghost style="margin-left: 5px">批量操作 <a-icon type="down" /> </a-button>
         </a-dropdown>
         <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
       </div>
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">注意:产品被禁用后,不能再销售。</div>
+      </a-alert>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
@@ -270,9 +280,6 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        if(this.queryParam.stockEmptyFlag && this.queryParam.stockEmptyFlag==1){
-          this.queryParam.stockEmptyFlag = undefined
-        }
         return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -331,9 +338,9 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.refresh(true)
     },
-    // 查看库存
-    handleHasQty (e) {
-      this.queryParam.stockEmptyFlag = e.target.checked ? 0:1
+    // 查看库存
+    handleHasQty (val) {
+      this.queryParam.stockEmptyFlag = val
     },
     //  新增/编辑
     handleEdit (row) {
@@ -368,7 +375,7 @@ export default {
     },
     // 启用 禁用
     changeStatus (record) {
-      if(record.currentStockQty!=0){
+      if (record.currentStockQty != 0) {
         this.$confirm({
           title: '提示',
           content: record.enabledFlag == '1' ? '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
@@ -377,10 +384,10 @@ export default {
             this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
           }
         })
-      }else{
-        if(record.enabledFlag==1){
+      } else {
+        if (record.enabledFlag == 1) {
           this.setEnable('0', [record.productSn])
-        }else{
+        } else {
           this.$confirm({
             title: '提示',
             content: '确定启用吗?',
@@ -391,7 +398,6 @@ export default {
           })
         }
       }
-      
     },
     // 启用 禁用
     setEnable (enabledFlag, snList) {
@@ -423,11 +429,11 @@ export default {
         this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
-      //判断所选产品是否都是库存为0的产品
-      let isZero =this.rowSelectionInfo.selectedRows.every(item=>{return item.currentStockQty==0})
+      // 判断所选产品是否都是库存为0的产品
+      const isZero = this.rowSelectionInfo.selectedRows.every(item => { return item.currentStockQty == 0 })
       this.$confirm({
         title: '提示',
-        content: type == '2' ? (isZero ? '产品被禁用后,不能再销售,确定批量禁用吗?':'当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?') : '确定批量启用吗?',
+        content: type == '2' ? (isZero ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?') : '确定批量启用吗?',
         centered: true,
         onOk: () => {
           this.setEnable(type == '2' ? '0' : '1', this.rowSelectionInfo.selectedRowKeys)