Browse Source

修改bug

chenrui 2 years ago
parent
commit
cdf5f342bb

+ 3 - 4
src/views/purchasingManagement/purchaseOutOfStock/detailModal.vue

@@ -22,8 +22,8 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px" v-if="objItem">
         <div class="ftext" slot="message">
-          缺货总款数:<strong>{{ objItem.totalCategory || objItem.totalCategory==0 ? objItem.totalCategory : '--' }}</strong>;
-          缺货总数量:<strong>{{ objItem.totalQty || objItem.totalQty==0 ? objItem.totalQty : '--' }}</strong>;
+          缺货总款数:<strong>{{ objItem.totalCategory || objItem.totalCategory==0 ? objItem.totalCategory : '--' }}</strong>;
+          缺货总数量:<strong>{{ objItem.totalQty || objItem.totalQty==0 ? objItem.totalQty : '--' }}</strong>;
           <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
             缺货总售价:<strong>{{ objItem.totalAmount || objItem.totalAmount==0 ? toThousands(objItem.totalAmount) : '--' }}</strong>。
           </div>
@@ -114,7 +114,7 @@ export default {
   methods: {
     // 获取表格数据
     pageInit () {
-      this.$refs.table.refresh(true)
+      this.$refs.table.refresh()
     }
   },
   watch: {
@@ -126,7 +126,6 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.currentStock = null
         this.$refs.table.clearTable()
       }
     }

+ 37 - 6
src/views/purchasingManagement/purchaseOutOfStock/list.vue

@@ -11,10 +11,15 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
+              <a-form-item label="供应商名称">
                 <a-input id="outOfStockList-purchaseTargetName" v-model.trim="queryParam.purchaseTargetName" placeholder="请输入客户名称" allowClear />
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="采购单号">
+                <a-input id="outOfStockList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" placeholder="请输入采购单号" allowClear />
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOutOfStock-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseOutOfStock-reset">重置</a-button>
@@ -24,11 +29,22 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                class="button-warning"
                 id="inventoryWarningList-export-btn">导出</a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px" v-if="countData">
+        <div class="ftext" slot="message">
+          缺货总款数:<strong>{{ countData.totalCount || countData.totalCount==0 ? countData.totalCount : '--' }}</strong>;
+          缺货总数量:<strong>{{ countData.totalQty || countData.totalQty==0 ? countData.totalQty : '--' }}</strong>;
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            缺货总金额:<strong>{{ countData.totalAmount || countData.totalAmount==0 ? toThousands(countData.totalAmount) : '--' }}</strong>。
+          </div>
+        </div>
+      </a-alert>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
@@ -61,7 +77,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { outOfStockList, outOfStockExportDetail } from '@/api/oos'
+import { outOfStockList, outOfStockExportDetail, outOfStockQueryCount } from '@/api/oos'
 import custList from '@/views/common/custList.vue'
 import detailModal from './detailModal.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
@@ -75,19 +91,22 @@ export default {
       queryParam: { //  查询条件
         beginDate: undefined,
         endDate: undefined,
-        purchaseTargetName: ''
+        purchaseTargetName: '',
+        purchaseBillNo: ''
       },
       detailObj: undefined, // 详情统计内容
       openModal: false,
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
       time: [],
+      countData: null,
       exportLoading: false, // 导出loading
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return outOfStockList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return outOfStockList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -95,6 +114,7 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
+            this.getCount(params)
             this.disabled = false
           }
           this.spinning = false
@@ -120,6 +140,16 @@ export default {
     }
   },
   methods: {
+    // 统计
+    getCount (params) {
+      outOfStockQueryCount(params).then(res => {
+        if (res.status == 200) {
+          this.countData = res.data
+        } else {
+          this.countData = null
+        }
+      })
+    },
     // 导出
     handleExport () {
       const _this = this
@@ -144,7 +174,8 @@ export default {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = undefined
       this.queryParam.endDate = undefined
-      this.queryParam.purchaseTargetName = undefined
+      this.queryParam.purchaseTargetName = ''
+      this.queryParam.purchaseBillNo = ''
       this.$refs.table.refresh(true)
     },
     //  详情
@@ -153,7 +184,7 @@ export default {
       this.detailObj = row
       const _this = this
       _this.$nextTick(() => {
-        _this.$ref.outOfStockDetail.pageInit()
+        _this.$refs.outOfStockDetail.pageInit()
       })
     },
     pageInit () {