lilei 2 年 前
コミット
31bad81d6f

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1675143544701
+  "version": 1675146809494
 }

+ 1 - 1
src/libs/tools.js

@@ -231,7 +231,7 @@ export const toThousands = (num, decimal) => {
     return '--'
   }
   num = formatDecimal(num, decimal||decimal==0 ? decimal : 2)
-  return '¥' + num.toString().replace(/\d+/, function (n) { // 先提取整数部分
+  return (decimal!=0?'¥':'') + num.toString().replace(/\d+/, function (n) { // 先提取整数部分
     return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) {
       return $1 + ','
     })

+ 2 - 2
src/views/common/warehouse.js

@@ -80,7 +80,7 @@ const Warehouse = {
             }
           })
           this.warehouseCascadeData = res.data
-          if(this.defaultVal.length==0){
+          if(this.defaultVal&&this.defaultVal.length==0){
             this.handleChange(_this.defaultWarehouseCascade)
           }
         } else {
@@ -89,7 +89,7 @@ const Warehouse = {
       })
     },
     setDefaultVal(){
-      if(this.defaultVal.length==0){
+      if(this.defaultVal&&this.defaultVal.length==0){
         this.handleChange(this.defaultWarehouseCascade)
       }
     }

+ 6 - 5
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -12,13 +12,13 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
-          可用库存总数量(个):<strong>{{ currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0) ? currentStock.currentStockQty : '--' }}</strong>;
+          可用库存总数量:<strong>{{ currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0) ? currentStock.currentStockQty : '--' }}</strong>;
           <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-            可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>;
+            可用库存总成本:<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? toThousands(currentStock.currentStockCost) : '--' }}</strong>;
           </div>
-          冻结库存总数量(个):<strong>{{ currentStock&&(currentStock.freezeQty || currentStock.freezeQty==0) ? currentStock.freezeQty : '--' }}</strong>;
+          冻结库存总数量:<strong>{{ currentStock&&(currentStock.freezeQty || currentStock.freezeQty==0) ? currentStock.freezeQty : '--' }}</strong>;
           <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-            冻结库存总成本(¥):<strong>{{ currentStock&&(currentStock.freezeCost || currentStock.freezeCost==0) ? currentStock.freezeCost : '--' }}</strong>。
+            冻结库存总成本:<strong>{{ currentStock&&(currentStock.freezeCost || currentStock.freezeCost==0) ? toThousands(currentStock.freezeCost) : '--' }}</strong>。
           </div>
         </div>
       </a-alert>
@@ -66,6 +66,7 @@ export default {
       return '库存详情'
     },
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -80,7 +81,7 @@ export default {
         // { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(10, 0, { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 49 - 37
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -15,22 +15,27 @@
                 <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品品牌">
+                <ProductBrand id="inventoryQueryList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeType" v-model="productTypeSn"></ProductType>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="仓库仓位">
+                <Warehouse id="inventoryQueryList-warehouse" ref="warehouse" v-model="queryParam.warehouse"></Warehouse>
+              </a-form-model-item>
+            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品名称">
-                  <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品品牌">
-                  <ProductBrand id="inventoryQueryList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="4" :sm="24">
-                <a-form-model-item label="产品分类">
-                  <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeType" v-model="productTypeSn"></ProductType>
-                </a-form-model-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="滞销天数">
                   <a-input-group>
@@ -60,7 +65,7 @@
                   </a-input-group>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="4" :sm="24">
+              <a-col :md="6" :sm="24">
                 <a-form-item label="产品来源">
                   <a-select
                     allowClear
@@ -77,23 +82,25 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="10" :sm="24">
-              <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
-              <a-checkbox v-model="queryParam.enableFlag" :checked="queryParam.enableFlag" id="inventoryQueryList-enableFlag">包括禁用产品</a-checkbox>
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
-              <a-button
-                type="primary"
-                v-if="$hasPermissions('B_inventoryInventoryQueryExport')"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                id="inventoryQueryList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
+            <a-col :md="12" :sm="24">
+              <div style="margin-bottom: 10px;">
+                <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
+                <a-checkbox v-model="queryParam.enableFlag" :checked="queryParam.enableFlag" id="inventoryQueryList-enableFlag">包括禁用产品</a-checkbox>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
+                <a-button
+                  type="primary"
+                  v-if="$hasPermissions('B_inventoryInventoryQueryExport')"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  id="inventoryQueryList-export">导出</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 5px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </div>
             </a-col>
           </a-row>
         </a-form>
@@ -101,9 +108,9 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
-          可用库存总数量(个):<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
+          可用库存总数量:<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
           <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-            可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
+            可用库存总成本:<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? toThousands(currentStock.totalCurrentStockCost) : '--' }}</strong>。
           </div>
         </div>
       </a-alert>
@@ -160,12 +167,13 @@ import { commonMixin } from '@/utils/mixin'
 import { stockList, stockCount, stockExport } from '@/api/stock'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
+import Warehouse from '@/views/common/warehouse.js'
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'InventoryQueryList',
-  components: { STable, VSelect, inventoryQueryDetailModal, ProductType, ProductBrand },
+  components: { STable, VSelect, inventoryQueryDetailModal, ProductType, ProductBrand, Warehouse },
   mixins: [commonMixin],
   data () {
     return {
@@ -180,6 +188,7 @@ export default {
         productTypeSn1: '', //  产品分类1
         productTypeSn2: '', //  产品分类2
         productTypeSn3: '', //  产品分类3
+        warehouse: undefined,
         zeroQtyFlag: false, //  库存情况
         enableFlag: true, // 显示禁用产品
         minUnsalableDays: undefined, // 滞销天数最小值
@@ -253,6 +262,7 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -266,7 +276,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(7, 0, { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -331,6 +341,8 @@ export default {
       this.queryParam.brandName = undefined
       this.queryParam.productTypeName = undefined
       this.queryParam.zeroQtyFlag = false
+      this.queryParam.warehouse = undefined
+      this.$refs.warehouse.setDefaultVal()
       this.productTypeSn = []
       this.queryParam.minUnsalableDays = undefined // 滞销天数最小值
       this.queryParam.maxUnsalableDays = undefined // 滞销天数最大值

+ 7 - 6
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -83,13 +83,13 @@
         <!-- 合计 -->
         <a-alert type="info" style="margin-bottom:10px">
           <div class="ftext" slot="message">
-            当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.currentStockQty || productTotal.currentStockQty==0)) ? productTotal.currentStockQty : '--' }}</strong>;
+            当前库存总数量:<strong>{{ (productTotal&&(productTotal.currentStockQty || productTotal.currentStockQty==0)) ? productTotal.currentStockQty : '--' }}</strong>;
             <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-              当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>;
+              当前库存总成本:<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? toThousands(productTotal.currentStockCost) : '--' }}</strong>;
             </div>
-            冻结库存总数量(个):<strong>{{ productTotal&&(productTotal.freezeQty || productTotal.freezeQty==0) ? productTotal.freezeQty : '--' }}</strong>;
+            冻结库存总数量:<strong>{{ productTotal&&(productTotal.freezeQty || productTotal.freezeQty==0) ? productTotal.freezeQty : '--' }}</strong>;
             <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-              冻结库存总成本(¥):<strong>{{ productTotal&&(productTotal.freezeCost || productTotal.freezeCost==0) ? productTotal.freezeCost : '--' }}</strong>。
+              冻结库存总成本:<strong>{{ productTotal&&(productTotal.freezeCost || productTotal.freezeCost==0) ? toThousands(productTotal.freezeCost) : '--' }}</strong>。
             </div>
           </div>
         </a-alert>
@@ -176,6 +176,7 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'product.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -190,11 +191,11 @@ export default {
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '数量', scopedSlots: { customRender: 'qty' }, width: '5%', align: 'center' },
         // { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '出入库状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(12, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(12, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }