Browse Source

bug修复

chenrui 4 years ago
parent
commit
3da83d5633

+ 9 - 1
src/api/allocLinkagePut.js

@@ -18,13 +18,21 @@ export const allocLinkagePutAudit = (params) => {
     method: 'get'
   })
 }
-//  连锁调拨调  入库
+//  连锁调拨调  入库
 export const allocLinkagePutSubmit = (params) => {
   return axios({
     url: `/allocLinkagePut/submit/${params.sn}`,
     method: 'get'
   })
 }
+//  连锁调拨调入 详情 合计
+export const allocLinkagePutDetailCount = (params) => {
+  return axios({
+    url: '/allocLinkagePut/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
 //  连锁调拨调出 详情  根据sn查
 export const allocLinkagePutDetailSn = (params) => {
   return axios({

+ 1 - 1
src/api/allocWarehouse.js

@@ -27,7 +27,7 @@ export const allocWarehouseDel = params => {
   })
 }
 // 仓库调拨 详情  合计
-export const allocWarehouseDetailTotal = params => {
+export const allocWarehouseDetailCount = params => {
   return axios({
     url: '/allocWarehouse/detail/queryCount',
     data: params,

+ 15 - 3
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -27,7 +27,7 @@
     <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
       <!-- 总计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">总款数 <strong>{{ (basicInfoData&&basicInfoData.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (basicInfoData&&basicInfoData.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (basicInfoData&&basicInfoData.productTotalCost) || 0 }}</strong></div>
+        <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -47,7 +47,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { allocLinkagePutDetailList, allocLinkagePutDetailSn } from '@/api/allocLinkagePut'
+import { allocLinkagePutDetailList, allocLinkagePutDetailSn, allocLinkagePutDetailCount } from '@/api/allocLinkagePut'
 export default {
   components: { STable, VSelect },
   data () {
@@ -76,10 +76,12 @@ export default {
             // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
             data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
           }
+          this.getDetailCount(params)
           return data
         })
       },
-      basicInfoData: null //  基本信息
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
     }
   },
   methods: {
@@ -97,6 +99,16 @@ export default {
         }
       })
     },
+    // 合计
+    getDetailCount (params) {
+      allocLinkagePutDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
     //  编辑
     handleEdit () {
       this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${this.basicInfoData.id}/${this.basicInfoData.allocationLinkagePutSn}` })

+ 6 - 4
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -105,7 +105,7 @@
 import { STable, VSelect } from '@/components'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseCascadeList } from '@/api/warehouse'
-import { allocLinkagePutDetailSn } from '@/api/allocLinkagePut'
+import { allocLinkagePutDetailSn, allocLinkagePutDetailList, allocLinkagePutDetailCount } from '@/api/allocLinkagePut'
 export default {
   components: { STable, VSelect },
   data () {
@@ -173,10 +173,11 @@ export default {
       this.disabled = true
       this.pageNo = pageNo || this.pageNo
       // 箭冠品牌 sysFlag传1,非箭冠品牌传0。与新增时所选调出产品类型有关
-      this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
+      // this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
-      productQuery(params).then(res => {
+      allocLinkagePutDetailList(params).then(res => {
         if (res.status == 200) {
+          this.getDetailCount(params)
           const data = res.data
           this.paginationProps.total = Number(res.data.count) || 0
           this.paginationProps.current = data.pageNo
@@ -195,7 +196,7 @@ export default {
     },
     // 合计
     getDetailCount (params) {
-      allocLinkageOutDetailCount(params).then(res => {
+      allocLinkagePutDetailCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -232,6 +233,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getDetail()
+      vm.getProductList(1)
       vm.getWarehouseCascade()
     })
   }

+ 17 - 9
src/views/allocationManagement/chainTransferIn/list.vue

@@ -20,12 +20,12 @@
               <a-select
                 placeholder="请选择调出对象"
                 allowClear
-                id="chainTransferInList-putTenantSn"
-                v-model="queryParam.putTenantSn"
+                id="chainTransferInList-outTenantSn"
+                v-model="queryParam.outTenantSn"
                 :showSearch="true"
                 option-filter-prop="children"
                 :filter-option="filterOption">
-                <a-select-option v-for="item in putTenantSnData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                <a-select-option v-for="item in outTenantSnData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -104,6 +104,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { allocLinkagePutList, allocLinkagePutAudit, allocLinkagePutSubmit } from '@/api/allocLinkagePut'
 import { getTenantList } from '@/api/allocLinkageOut'
@@ -114,7 +115,7 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       time: undefined, //  入库时间
       queryParam: { //  查询条件
-        outTenantName: undefined, //  调出对象
+        outTenantSn: undefined, //  调出对象
         allocationType: undefined, //  调拨产品类型
         state: undefined, //  业务状态
         settleState: undefined
@@ -139,7 +140,14 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        this.queryParam = {}
+        // 入库时间
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
         return allocLinkagePutList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -150,7 +158,7 @@ export default {
           return data
         })
       },
-      putTenantSnData: []
+      outTenantSnData: []
     }
   },
   methods: {
@@ -160,7 +168,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.outTenantName = undefined
+      this.queryParam.outTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
@@ -217,9 +225,9 @@ export default {
     getPutTenantList () {
       getTenantList({}).then(res => {
         if (res.status == 200) {
-          this.putTenantSnData = res.data
+          this.outTenantSnData = res.data
         } else {
-          this.putTenantSnData = []
+          this.outTenantSnData = []
         }
       })
     },

+ 3 - 7
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -73,11 +73,7 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
-import {
-  allocWarehouseDetailSn,
-  allocWarehouseDetailTotal,
-  allocWarehouseDetailQuery
-} from '@/api/allocWarehouse.js'
+import { allocWarehouseDetailSn, allocWarehouseDetailCount, allocWarehouseDetailList } from '@/api/allocWarehouse.js'
 export default {
   components: { STable, VSelect },
   data () {
@@ -107,7 +103,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return allocWarehouseDetailQuery(Object.assign(parameter, this.queryParam)).then(res => {
+        return allocWarehouseDetailList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -142,7 +138,7 @@ export default {
     },
     // 已选产品总计查询
     getProduceTotal () {
-      allocWarehouseDetailTotal(this.queryParam).then(res => {
+      allocWarehouseDetailCount(this.queryParam).then(res => {
         if (res.status == 200) {
           this.productTotalCost = res.data.productTotalCost || 0
           this.productTotalQty = res.data.productTotalQty || 0

+ 2 - 2
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -226,7 +226,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { allocWarehouseDetailList, allocWarehouseDetail, productQuery, allocWarehouseDetailTotal, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
+import { allocWarehouseDetailList, allocWarehouseDetail, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseLocAllList } from '@/api/warehouse'
@@ -430,7 +430,7 @@ export default {
     },
     // 合计
     getDetailCount (params) {
-      allocWarehouseDetailTotal(params).then(res => {
+      allocWarehouseDetailCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {

+ 2 - 2
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -109,7 +109,7 @@
 </template>
 
 <script>
-import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDelete } from '@/api/allocWarehouse'
+import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDel } from '@/api/allocWarehouse'
 import { warehouseAllList } from '@/api/warehouse.js'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
@@ -200,7 +200,7 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
-          allocWarehouseDelete({ id: row.id }).then(res => {
+          allocWarehouseDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()