소스 검색

出入库明细

lilei 3 년 전
부모
커밋
b60ca8cab9

+ 1 - 1
src/api/stockOut.js

@@ -30,7 +30,7 @@ export const stockOutBatchOut = (params) => {
 // 出入库明细
 export const stockOutDetailList = (params) => {
   return axios({
-    url: '/stockOut/detail/queryList ',
+    url: `/stockOut/detail/queryList`,
     data: params,
     method: 'post'
   })

+ 3 - 3
src/utils/request.js

@@ -23,11 +23,11 @@ const err = (error) => {
     store.commit('SET_loadingStatus', false)
     return Promise.reject(err)
   }
-
+ console.log(error.response,error.response.status)
   // 业务错误提示
   if (error.response) {
-    const status = error.response.status
-    if (status.indexOf('5')>=0) {
+    const status = error.response.status.toString()
+    if (status.indexOf('5')>=0||status.indexOf('4')>=0) {
       notification.destroy()
       notification.error({
         message: '提示',

+ 2 - 2
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -68,7 +68,7 @@
           </template>
         </s-table>
         <!-- 出入库明细 -->
-        <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+        <outInDetialModal ref="outInDetialModal" outBizType="SHOP_CALL_OUT" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
   </div>
@@ -80,7 +80,7 @@ import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn, storeCallOutDetailPrint } from '@/api/storeCallOut'
 import Print from '@/views/common/print.vue'
-import outInDetialModal from './outInDetialModal.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'StoreCallOutDetail',

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

@@ -194,7 +194,7 @@
           </a-collapse-panel>
         </a-collapse>
         <!-- 出入库明细 -->
-        <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+        <outInDetialModal ref="outInDetialModal" outBizType="SHOP_CALL_OUT" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
     <div class="affix-cont">
@@ -220,7 +220,7 @@ import ProductBrand from '../../common/productBrand.js'
 import { warehouseAllList } from '@/api/warehouse'
 import { productQuery } from '@/api/allocWarehouse'
 import Print from '@/views/common/print.vue'
-import outInDetialModal from './outInDetialModal.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'StoreCallOutEdit',

+ 0 - 145
src/views/allocationManagement/storeTransferOut/outInDetialModal.vue

@@ -1,145 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="outIndetail-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="出入库明细"
-    v-model="isShow"
-    @cancel="isShow = false"
-    :width="1024">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <div class="baseInfo" v-if="baseData">
-        <div>
-          <span>产品编码:{{ baseData.productCode }}</span>
-        </div>
-        <div>
-          <span>产品名称:{{ baseData.productName }}</span>
-        </div>
-      </div>
-      <div class="outIndetail-modal-table">
-        <!-- 列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :data="loadData"
-          :scroll="{ y: 450 }"
-          :defaultLoadData="false"
-          :showPagination="false"
-          bordered>
-        </s-table>
-      </div>
-      <div class="btn-cont">
-        <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
-      </div>
-    </a-spin>
-  </a-modal>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { STable } from '@/components'
-import { storeCallOutList } from '@/api/storeCallOut'
-export default {
-  name: 'OutinDetailModal',
-  components: { STable },
-  mixins: [commonMixin],
-  props: {
-    openModal: {
-      //  弹框显示状态
-      type: Boolean,
-      default: false
-    }
-  },
-  data () {
-    return {
-      spinning: false,
-      isShow: this.openModal, //  是否打开弹框
-      baseData: null,
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
-            this.disabled = false
-          }
-          this.spinning = false
-          return data
-        })
-      }
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'callOutTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '总成本', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次出库数量', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ]
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(7, 0, { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      return arr
-    }
-  },
-  methods: {
-    cansel () {
-      this.isShow = false
-      this.baseData = null
-    },
-    getData (row) {
-      this.baseData = row
-      this.$nextTick(() => {
-        this.$refs.table.refresh(true)
-      })
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-      }
-    }
-  }
-}
-</script>
-
-<style lang="less">
-.outIndetail-modal {
-	.ant-modal-body {
-		padding: 20px;
-    .outIndetail-modal-table{
-      padding: 20px 0 0;
-    }
-    .baseInfo{
-      line-height: 24px;
-      font-size: 14px;
-    }
-	}
-	.btn-cont {
-		text-align: center;
-		margin: 35px 0 10px;
-	}
-}
-</style>

+ 25 - 9
src/views/salesManagement/salesQuery/outInDetialModal.vue → src/views/common/outInDetialModal.vue

@@ -11,10 +11,10 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="baseInfo" v-if="baseData">
         <div>
-          <span>产品编码:{{ baseData.dealerProductEntity.code }}</span>
+          <span>产品编码:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.code : baseData.productCode }}</span>
         </div>
         <div>
-          <span>产品名称:{{ baseData.dealerProductEntity.name }}</span>
+          <span>产品名称:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.name : baseData.productName }}</span>
         </div>
       </div>
       <div class="outIndetail-modal-table">
@@ -52,6 +52,10 @@ export default {
       //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    outBizType: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -64,13 +68,25 @@ export default {
         this.disabled = true
         this.spinning = true
         // outBizType = SHOP_CALL_OUT(店内调出)   /  SALES (销售)
-        return stockOutDetailList(Object.assign(parameter, { outBizSn: this.outBizSn, outBizNo: this.outBizNo, outBizType: this.outBizType })).then(res => {
+        const params = this.baseData
+        console.log(params)
+        const queryParams = { outBizType: this.outBizType, productSn: params.productSn }
+        if (this.outBizType == 'SALES') {
+          queryParams.outBizSn = params.salesBillSn
+          queryParams.outBizNo = params.salesBillNo
+        }
+        if (this.outBizType == 'SHOP_CALL_OUT') {
+          queryParams.outBizSn = params.storeCallOutSn
+          queryParams.outBizNo = params.storeCallOutNo
+        }
+        return stockOutDetailList(queryParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              data.list[i].totalCost = data.list[i].putCost * data.list[i].outQty
             }
             this.disabled = false
           }
@@ -85,16 +101,16 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'callOutTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'outBizType', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次出库数量', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次出库数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(7, 0, { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }

+ 2 - 2
src/views/salesManagement/salesQuery/detail.vue

@@ -94,7 +94,7 @@
           </template>
         </s-table>
         <!-- 出入库明细 -->
-        <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+        <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
   </div>
@@ -106,7 +106,7 @@ import { getOperationalPrecision } from '@/libs/tools.js'
 import { STable, VSelect } from '@/components'
 import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
 import { salesDetailList } from '@/api/salesDetail'
-import outInDetialModal from './outInDetialModal.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {

+ 2 - 3
src/views/salesManagement/salesQuery/edit.vue

@@ -188,10 +188,9 @@
     <!-- 收付款弹框 -->
     <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
     <!-- 出入库明细 -->
-    <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+    <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
   </div>
 </template>
-
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { mapActions } from 'vuex'
@@ -203,7 +202,7 @@ import settleModal from '@/views/financialManagement/settleModal/settleModal.vue
 import { stockByProductSn } from '@/api/stock'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
-import outInDetialModal from './outInDetialModal.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {

+ 3 - 2
src/views/salesManagement/salesQuery/queryPart.vue

@@ -94,7 +94,7 @@
       class="sTable"
       ref="table"
       size="small"
-      :rowKey="(record) => record.productSn+record.currentQty+record.warehouseSn+record.warehouseLocationSn"
+      :rowKey="(record) => record.productSn+'-'+record.no"
       :columns="columns"
       :data="loadData"
       :customRow="handleClickRow"
@@ -316,7 +316,7 @@ export default {
             data.list[i].salesNums = 1
             data.list[i].currentQty = data.list[i].currentQty || 0
             data.list[i].price = data.list[i].lastSalePrice ? data.list[i].lastSalePrice : data.list[i].salePrice
-            data.list[i].productOrigCode = data.list[i].productOrigCode.trim()
+            data.list[i].productOrigCode = data.list[i].productOrigCode ? data.list[i].productOrigCode.trim() : ''
           }
           if (!params.vinCode) {
             _this.vinInfoData = null
@@ -329,6 +329,7 @@ export default {
           }
         }
         _this.disabled = false
+        console.log(data)
         return data
       })
     },