Browse Source

盘点详情 数据更改

chenrui 3 năm trước cách đây
mục cha
commit
0a40a0e55f
1 tập tin đã thay đổi với 62 bổ sung43 xóa
  1. 62 43
      src/views/inventoryManagement/inventoryChecking/detailModal.vue

+ 62 - 43
src/views/inventoryManagement/inventoryChecking/detailModal.vue

@@ -55,11 +55,19 @@
           <div slot="message">
             <div style="display: flex;justify-content: space-between;align-items: center;">
               <div>
-                总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
-                总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
-                总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
-                盘盈数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong> ,
-                盘亏数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>
+                <div>
+                  总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
+                  总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
+                  总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                </div>
+                <div>
+                  盘盈总数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong>,
+                  <span v-if="basicInfoData&&basicInfoData.state=='FINISH'">盘盈总成本: <strong>{{ productTotal&&(productTotal.checkProfitCost || productTotal.checkProfitCost==0) ? productTotal.checkProfitCost : '--' }}</strong>,</span>
+                  盘亏总数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>,
+                  <span v-if="basicInfoData&&basicInfoData.state=='FINISH'">盘亏总成本: <strong>{{ productTotal&&(productTotal.checkLossCost || productTotal.checkLossCost==0) ? productTotal.checkLossCost : '--' }}</strong>,</span>
+                  盈亏总数量: <strong>{{ productTotal&&(productTotal.totalCheckProfitLossQty || productTotal.totalCheckProfitLossQty==0) ? productTotal.totalCheckProfitLossQty : '--' }}</strong>,
+                  <span v-if="basicInfoData&&basicInfoData.state=='FINISH'">盈亏总成本: <strong>{{ productTotal&&(productTotal.totalCheckProfitLossCost || productTotal.totalCheckProfitLossCost==0) ? productTotal.totalCheckProfitLossCost : '--' }}</strong>,</span>
+                </div>
               </div>
               <div>
                 <span style="color: red;display: inline-block;margin-right: 8px;">红色代表盘盈</span>
@@ -70,42 +78,45 @@
         </a-alert>
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-            <a-row :gutter="15">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品编码" prop="productCode">
-                  <a-input id="inventoryCheckMakeInventoryList-productCode" v-model="queryParam.productCode" placeholder="请输入" allowClear />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品名称" prop="productName">
-                  <a-input id="inventoryCheckMakeInventoryList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品分类">
-                  <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
-                </a-form-item>
-              </a-col>
-              <template v-if="advanced && (basicInfoData&&basicInfoData.warehouseFlag=='1')">
-                <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
-                  <a-form-item label="仓库">
-                    <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                      <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                    </a-select>
+          <div style="display: flex;justify-content: space-between;">
+            <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-row :gutter="15">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品编码" prop="productCode">
+                    <a-input id="inventoryCheckMakeInventoryList-productCode" v-model="queryParam.productCode" placeholder="请输入" allowClear />
                   </a-form-item>
                 </a-col>
-              </template>
-              <a-col :md="5" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 5px" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
-                  {{ advanced ? '收起' : '展开' }}
-                  <a-icon :type="advanced ? 'up' : 'down'"/>
-                </a>
-              </a-col>
-            </a-row>
-          </a-form>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品名称" prop="productName">
+                    <a-input id="inventoryCheckMakeInventoryList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品分类">
+                    <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
+                  </a-form-item>
+                </a-col>
+                <template v-if="advanced && (basicInfoData&&basicInfoData.warehouseFlag=='1')">
+                  <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    <a-form-item label="仓库">
+                      <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                        <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                </template>
+                <a-col :md="5" :sm="24" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 5px" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </a-col>
+              </a-row>
+            </a-form>
+            <div style="flex-shrink: 0;margin-left: 5px;"><a-checkbox v-model="isPrice"><span style="display: inline-block;margin-top: 1px;">仅显示盈亏</span></a-checkbox></div>
+          </div>
         </div>
         <!-- 列表 -->
         <s-table
@@ -174,8 +185,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return checkWarehouseDetailList(Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })).then(res => {
-          this.getDetailCount()
+        const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })
+        if (this.isPrice) {
+          params.profitLossFlag = 1
+        }
+        return checkWarehouseDetailList(params).then(res => {
+          this.getDetailCount(params)
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -191,6 +206,7 @@ export default {
       productType: [],
       warehouseList: [], //  仓库  下拉数据
       localDataSource: [],
+      isPrice: false, //  仅显示盈亏
       openPrintModal: false,
       nowType: null,
       printerType: 'NEEDLE' //  打印机类型
@@ -227,8 +243,8 @@ export default {
       })
     },
     // 合计
-    getDetailCount () {
-      checkWarehouseDetailCount(Object.assign(this.queryParam, { checkWarehouseSn: this.itemSn })).then(res => {
+    getDetailCount (params) {
+      checkWarehouseDetailCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
           if (res.data && res.data.checkLossQty) {
@@ -360,6 +376,9 @@ export default {
         this.getDetail()
         this.getWarehouseList()
       }
+    },
+    isPrice (newValue, oldValue) {
+      this.$refs.table.refresh(true)
     }
   }
 }