Browse Source

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

lilei 2 years ago
parent
commit
94529bf847

+ 25 - 0
src/config/router.config.js

@@ -3206,6 +3206,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/basicData/systemSettings',
+            redirect: '/basicData/systemSettings/index',
+            name: 'systemSettings',
+            component: BlankLayout,
+            meta: {
+              title: '系统参数',
+              icon: 'sound'
+              // permission: 'M_systemSettingsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'systemSettingsList',
+                component: () => import(/* webpackChunkName: "basicData" */ '@/views/basicData/systemSettings/index.vue'),
+                meta: {
+                  title: '系统参数',
+                  icon: 'sound',
+                  hidden: true
+                  // permission: 'M_systemSettingsList'
+                }
+              }
+            ]
           }
         ]
       },

+ 112 - 0
src/views/basicData/systemSettings/index.vue

@@ -0,0 +1,112 @@
+<template>
+  <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card>
+        <a-row :gutter="16">
+          <a-col class="gutter-row" :span="12">
+            销售下单时,是否显示产品库存为0的产品信息
+          </a-col>
+          <a-col class="gutter-row" :span="12">
+            <a-radio-group v-model="qtyValue" @change="handleQty">
+              <a-radio :value="1">
+                显示
+              </a-radio>
+              <a-radio :value="2">
+                隐藏
+              </a-radio>
+            </a-radio-group>
+          </a-col>
+        </a-row>
+      </a-card>
+      <a-card>
+        <a-row :gutter="16">
+          <a-col class="gutter-row" :span="12">
+            销售下单时,是否显示废品仓的产品信息
+          </a-col>
+          <a-col class="gutter-row" :span="12">
+            <a-radio-group v-model="wasteInfoValue" @change="handleWasteInfo">
+              <a-radio :value="1">
+                显示
+              </a-radio>
+              <a-radio :value="2">
+                隐藏
+              </a-radio>
+            </a-radio-group>
+          </a-col>
+        </a-row>
+      </a-card>
+      <a-card>
+        <a-row :gutter="16">
+          <a-col class="gutter-row" :span="12">
+            库存预警,是否包含废品库数量
+          </a-col>
+          <a-col class="gutter-row" :span="12">
+            <a-radio-group v-model="wasteNumValue" @change="handleWasteNum">
+              <a-radio :value="1">
+                包含
+              </a-radio>
+              <a-radio :value="2">
+                不包含
+              </a-radio>
+            </a-radio-group>
+          </a-col>
+        </a-row>
+      </a-card>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+export default {
+  name: 'SystemSettingsList',
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      qtyValue: 1,
+      wasteInfoValue: 1,
+      wasteNumValue: 1
+    }
+  },
+  methods: {
+    getData () {
+      this.spinning = true
+      noticeUserBizQuery().then(res => {
+        const data = res.data
+        if (res.status == 200) {
+          const no = 0
+          for (var i = 0; i < data.length; i++) {
+            data[i].no = no + i + 1
+            const key = ['tempOrderFlag', 'shelfReplenishFlag', 'shelfOrderFlag', 'shelfWarnFlag', 'allFlag']
+            const ret = []
+            key.map(item => {
+              if (data[i][item] == 1) {
+                ret.push(1)
+              }
+            })
+            data[i].allFlag = ret.length == 4 ? 1 : 0
+          }
+        }
+        this.loadData = data
+        this.spinning = false
+      })
+    },
+    handleQty () {},
+    handleWasteInfo () {},
+    handleWasteNum () {}
+  },
+  mounted () {
+    this.spinning = true
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      // this.getData()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      // this.getData()
+    }
+  }
+}
+</script>

+ 2 - 2
src/views/productManagement/productInfo/edit.vue

@@ -124,7 +124,7 @@
               @keydown.enter.native="nextFocus('specialPrice', 'cost', $event)"
               allowClear /><span>元</span>
           </a-form-model-item>
-          <a-form-model-item label="成本价" v-if="pageType=='pages'" prop="cost">
+         <!-- <a-form-model-item label="成本价" v-if="pageType=='pages'" prop="cost">
             <a-input-number
               id="productInfoEdit-cost"
               v-model="form.cost"
@@ -136,7 +136,7 @@
               ref="cost"
               @keydown.enter.native="nextFocus('cost', 'terminalPrice', $event)"
               allowClear /><span>元</span>
-          </a-form-model-item>
+          </a-form-model-item> -->
           <a-form-model-item label="终端价" prop="terminalPrice">
             <a-input-number
               id="productInfoEdit-terminalPrice"

+ 43 - 22
src/views/productManagement/productInfo/list.vue

@@ -31,7 +31,7 @@
                 </a-form-item>
               </a-col>
               <a-col :md="4" :sm="24" style="margin-top:6px;">
-                <a-checkbox @change="handleHasQty" :checked="queryParam.hasQty">
+                <a-checkbox @change="handleHasQty" :checked="queryParam.stockEmptyFlag == 0">
                   只查看有库存
                 </a-checkbox>
               </a-col>
@@ -165,7 +165,7 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         enabledFlag: undefined, //  状态
-        hasQty: false
+        stockEmptyFlag: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
@@ -218,15 +218,15 @@ export default {
             return text || text == 0 ? _this.toThousands(text, 2) : '--'
           }
         },
-        {
-          title: '成本价',
-          dataIndex: 'specialPrice',
-          width: '7%',
-          align: 'right',
-          customRender: function (text) {
-            return text || text == 0 ? _this.toThousands(text, 2) : '--'
-          }
-        },
+        // {
+        //   title: '成本价',
+        //   dataIndex: 'specialPrice',
+        //   width: '7%',
+        //   align: 'right',
+        //   customRender: function (text) {
+        //     return text || text == 0 ? _this.toThousands(text, 2) : '--'
+        //   }
+        // },
         {
           title: '终端价',
           dataIndex: 'terminalPrice',
@@ -256,7 +256,7 @@ export default {
         },
         {
           title: '可用库存',
-          dataIndex: 'createDate',
+          dataIndex: 'currentStockQty',
           width: '7%',
           align: 'center',
           customRender: function (text) {
@@ -270,6 +270,9 @@ 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) {
@@ -322,7 +325,7 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.enabledFlag = undefined
-      this.queryParam.hasQty = false
+      this.queryParam.stockEmptyFlag = undefined
       this.productType = []
       this.$refs.table.clearSelected()
       this.rowSelectionInfo = null
@@ -330,7 +333,7 @@ export default {
     },
     // 只查看有库存
     handleHasQty (e) {
-      this.queryParam.hasQty = e.target.checked
+      this.queryParam.stockEmptyFlag = e.target.checked ? 0:1
     },
     //  新增/编辑
     handleEdit (row) {
@@ -365,14 +368,30 @@ export default {
     },
     // 启用 禁用
     changeStatus (record) {
-      this.$confirm({
-        title: '提示',
-        content: record.enabledFlag == '1' ? '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
-        centered: true,
-        onOk: () => {
-          this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
+      if(record.currentStockQty!=0){
+        this.$confirm({
+          title: '提示',
+          content: record.enabledFlag == '1' ? '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
+          centered: true,
+          onOk: () => {
+            this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
+          }
+        })
+      }else{
+        if(record.enabledFlag==1){
+          this.setEnable('0', [record.productSn])
+        }else{
+          this.$confirm({
+            title: '提示',
+            content: '确定启用吗?',
+            centered: true,
+            onOk: () => {
+              this.setEnable('1', [record.productSn])
+            }
+          })
         }
-      })
+      }
+      
     },
     // 启用 禁用
     setEnable (enabledFlag, snList) {
@@ -404,9 +423,11 @@ export default {
         this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
+      //判断所选产品是否都是库存为0的产品
+      let isZero =this.rowSelectionInfo.selectedRows.every(item=>{return item.currentStockQty==0})
       this.$confirm({
         title: '提示',
-        content: type == '2' ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '确定批量启用吗?',
+        content: type == '2' ? (isZero ? '产品被禁用后,不能再销售,确定批量禁用吗?':'当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?') : '确定批量启用吗?',
         centered: true,
         onOk: () => {
           this.setEnable(type == '2' ? '0' : '1', this.rowSelectionInfo.selectedRowKeys)

+ 5 - 2
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -18,7 +18,7 @@
       </a-page-header>
       <!-- 基础信息 -->
       <a-card size="small" :bordered="false" v-if="isShowBisiceInfo" class="purchaseOrderEdit-cont">
-        <a-row :gutter="16" type="flex" align="middle" justify="center"s>
+        <a-row :gutter="16" type="flex" sjustify="center">
           <a-col class="gutter-row" :span="12">
             供应商:{{ detail&&detail.purchaseTargetName || '--' }}
           </a-col>
@@ -30,7 +30,7 @@
           </a-col>
           <a-col class="gutter-row" :span="12">
             <span>收货地址:</span>
-            <div style="display: inline-block;vertical-align: middle;" v-if="detail&&(detail.shippingAddressProvinceName || detail.shippingAddressCityName || detail.shippingAddressCountyName || detail.shippingAddress)">
+            <div style="display: inline-block;width:90%;vertical-align: top;" v-if="detail&&(detail.shippingAddressProvinceName || detail.shippingAddressCityName || detail.shippingAddressCountyName || detail.shippingAddress)">
               {{ detail&&detail.shippingAddressProvinceName || '' }}
               {{ detail&&detail.shippingAddressCityName || '' }}
               {{ detail&&detail.shippingAddressCountyName || '' }}
@@ -678,5 +678,8 @@ export default {
         margin-left: 15px;
       }
     }
+    .gutter-row:nth-child(1),.gutter-row:nth-child(2){
+      margin-bottom:10px;
+    }
   }
 </style>