Ver código fonte

出库详情,跳转页面改为打开弹框

chenrui 3 anos atrás
pai
commit
a06c6d87e3

+ 15 - 6
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="chainTransferOutDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutDetail-cont" >
+      <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
         <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
+        <template slot="subTitle" v-if="!outBizSn">
           <a id="chainTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a-button
             v-if="isEdit&&$hasPermissions('B_allocLinkageOutEdit')"
@@ -75,6 +75,12 @@ import { getOperationalPrecision } from '@/libs/tools.js'
 import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailCount, allocLinkageOutDetailPrint } from '@/api/allocLinkageOut'
 export default {
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       spinning: false,
@@ -92,7 +98,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const params = Object.assign(parameter, { allocationLinkageOutSn: this.$route.params.sn })
+        const params = Object.assign(parameter, { allocationLinkageOutSn: this.outBizSn || this.$route.params.sn })
         return allocLinkageOutDetailList(params).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -125,7 +131,7 @@ export default {
     },
     // 基本信息
     getDetail () {
-      allocLinkageOutDetailSn({ sn: this.$route.params.sn }).then(res => {
+      allocLinkageOutDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
         } else {
@@ -151,7 +157,7 @@ export default {
     handlePrint (type) {
       const _this = this
       _this.spinning = true
-      allocLinkageOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+      allocLinkageOutDetailPrint({ sn: this.outBizSn || this.$route.params.sn, type: this.printerType }).then(res => {
         _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
@@ -182,9 +188,12 @@ export default {
       }
     }
   },
+  mounted () {
+    this.getDetail()
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getDetail()
+      // vm.getDetail()
     })
   }
 }

+ 18 - 8
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="storeTransferOutDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutDetail-back" >
+      <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutDetail-back" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
         <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
+        <template slot="subTitle" v-if="!outBizSn">
           <a id="storeTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a-button
             v-if="isEdit&&$hasPermissions('B_storeCallOutEdit')"
@@ -71,6 +71,12 @@ import { getOperationalPrecision } from '@/libs/tools.js'
 import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn, storeCallOutDetailPrint } from '@/api/storeCallOut'
 export default {
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       spinning: false,
@@ -87,7 +93,7 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return storeCallOutDetailList(Object.assign(parameter, { storeCallOutSn: this.$route.params.sn })).then(res => {
+        return storeCallOutDetailList(Object.assign(parameter, { storeCallOutSn: this.outBizSn || this.$route.params.sn })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -120,7 +126,7 @@ export default {
     handlePrint (type) {
       const _this = this
       _this.spinning = true
-      storeCallOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType, costFlag: this.printCostChecked ? '1' : '0' }).then(res => {
+      storeCallOutDetailPrint({ sn: this.outBizSn || this.$route.params.sn, type: this.printerType, costFlag: this.printCostChecked ? '1' : '0' }).then(res => {
         _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
@@ -152,7 +158,7 @@ export default {
     },
     // 基本信息
     getDetail () {
-      storeCallOutDetailSn({ sn: this.$route.params.sn }).then(res => {
+      storeCallOutDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
         } else {
@@ -162,7 +168,7 @@ export default {
     },
     // 合计
     getDetailCount () {
-      storeCallOutDetailCount({ storeCallOutSn: this.$route.params.sn }).then(res => {
+      storeCallOutDetailCount({ storeCallOutSn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -175,10 +181,14 @@ export default {
       this.$router.push({ path: `/allocationManagement/storeTransferOut/edit/${this.basicInfoData.id}/${this.basicInfoData.storeCallOutSn}` })
     }
   },
+  mounted () {
+    this.getDetail()
+    this.getDetailCount()
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getDetail()
-      vm.getDetailCount()
+      // vm.getDetail()
+      // vm.getDetailCount()
     })
   }
 }

+ 14 - 6
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="warehouseAllocationDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationDetail-back" >
+    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationDetail-back" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
       <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
+      <template slot="subTitle" v-if="!outBizSn">
         <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <a-button
           v-if="warehouse&&warehouse.stateDictValue!='已完结'&&$hasPermissions('B_warehouseAllocationEdit')"
@@ -79,13 +79,18 @@ import { STable, VSelect } from '@/components'
 import { allocWarehouseDetailSn, allocWarehouseDetailCount, allocWarehouseDetailList } from '@/api/allocWarehouse.js'
 export default {
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       exportLoading: false, // 导出loading
       queryParam: {
-        allocationWarehouseSn: this.$route.params.sn
+        allocationWarehouseSn: this.outBizSn || this.$route.params.sn
       },
-      id: this.$route.params.id, // 单据id
       warehouse: null, // 基础信息
       productTotal: null,
       // 表头
@@ -128,7 +133,7 @@ export default {
     },
     // 查询基础信息
     getHouse () {
-      allocWarehouseDetailSn({ sn: this.$route.params.sn }).then(res => {
+      allocWarehouseDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.warehouse = res.data
           this.queryParam.outWarehouseSn = res.data.outWarehouseSn
@@ -169,9 +174,12 @@ export default {
       link.click()
     }
   },
+  mounted () {
+    this.getHouse()
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getHouse()
+      // vm.getHouse()
     })
   }
 }

+ 14 - 5
src/views/purchasingManagement/purchaseReturn/detail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="purchaseReturnDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnDetail-cont" >
+    <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
       <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
+      <template slot="subTitle" v-if="!outBizSn">
         <a id="purchaseReturnDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <a-button
           v-if="isEdit"
@@ -61,6 +61,12 @@ import { getOperationalPrecision } from '@/libs/tools.js'
 import { purchaseReturnDetailSn, purchaseReturnDetailList } from '@/api/purchaseReturn'
 export default {
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       // 表头
@@ -80,7 +86,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.$route.params.sn })).then(res => {
+        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.outBizSn || this.$route.params.sn })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -107,7 +113,7 @@ export default {
     },
     // 基本信息
     getDetail () {
-      purchaseReturnDetailSn({ sn: this.$route.params.sn }).then(res => {
+      purchaseReturnDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
         } else {
@@ -120,9 +126,12 @@ export default {
       this.$router.push({ path: `/purchasingManagement/purchaseReturn/edit/${this.basicInfoData.id}/${this.basicInfoData.purchaseReturnSn}/${this.basicInfoData.returnTargetName}` })
     }
   },
+  mounted () {
+    this.getDetail()
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getDetail()
+      // vm.getDetail()
     })
   }
 }

+ 56 - 10
src/views/salesManagement/outboundOrder/list.vue

@@ -98,15 +98,41 @@
         </template>
       </s-table>
     </a-spin>
+    <!-- 详情 -->
+    <a-modal
+      centered
+      class="outboundOrderDetail-modal"
+      :footer="null"
+      :maskClosable="false"
+      title="详情"
+      v-model="openModal"
+      v-if="openModal"
+      @cancle="cancleModal"
+      width="80%">
+      <div style="max-height: 700px;overflow-y: scroll;">
+        <pushOrderDetailModal v-if="outBizType=='PURCHASE_RETURN'" :outBizSn="orderSn" />
+        <salesDetailModal v-if="outBizType=='SALES'" :outBizSn="orderSn" />
+        <urgentDetailModal v-if="outBizType=='DISPATCH_DEDUCT'" :outBizSn="orderSn" />
+        <storeTransferOutDetailModal v-if="outBizType=='SHOP_CALL_OUT'" :outBizSn="orderSn" />
+        <chainTransferOutDetailModal v-if="outBizType=='LINKAGE_CALL_OUT'" :outBizSn="orderSn" />
+        <warehouseAllocationDetailModal v-if="outBizType=='WAREHOUSE_CALL_OUT'" :outBizSn="orderSn" />
+      </div>
+    </a-modal>
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import pushOrderDetailModal from '@/views/purchasingManagement/purchaseReturn/detail.vue'
+import salesDetailModal from '@/views/salesManagement/salesQuery/detail.vue'
+import urgentDetailModal from '@/views/salesManagement/urgentItemsOffset/detail.vue'
+import storeTransferOutDetailModal from '@/views/allocationManagement/storeTransferOut/detail.vue'
+import chainTransferOutDetailModal from '@/views/allocationManagement/chainTransferOut/detail.vue'
+import warehouseAllocationDetailModal from '@/views/allocationManagement/warehouseAllocation/detail.vue'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal },
   data () {
     return {
       spinning: false,
@@ -151,7 +177,10 @@ export default {
           this.disabled = false
           return data
         })
-      }
+      },
+      openModal: false,
+      orderSn: undefined,
+      outBizType: null //  当前单子类型   SALES销售出库        ALLOCATE调拨出库
     }
   },
   computed: {
@@ -213,29 +242,46 @@ export default {
     },
     //  详情
     handleDetail (row) {
+      this.outBizType = row.outBizType
       //  根据出库类型跳转对应页面
       if (row.outBizType == 'PURCHASE_RETURN') { // 采购退货
-        this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else if (row.outBizType == 'SPARE_PARTS_RETURN') { // 散件退货
         this.$message.warning('该出库类型对应页面未开发')
-        // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'SALES') { // 销售
-        this.$router.push({ path: `/salesManagement/salesQuery/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/salesManagement/salesQuery/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else if (row.outBizType == 'DISPATCH_DEDUCT') { // 急件冲减
-        this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else if (row.outBizType == 'SHOP_CALL_OUT') { // 店内调出
-        this.$router.push({ path: `/allocationManagement/storeTransferOut/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/allocationManagement/storeTransferOut/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else if (row.outBizType == 'CHECK_ORDER_OUT') { // 库存盘点盘亏
         this.$message.warning('该出库类型对应页面未开发')
-        // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'LINKAGE_CALL_OUT') { // 连锁调出
-        this.$router.push({ path: `/allocationManagement/chainTransferOut/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/allocationManagement/chainTransferOut/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else if (row.outBizType == 'WAREHOUSE_CALL_OUT') { // 仓库调出
-        this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else {
         this.$message.warning('出库类型未知')
       }
     },
+    // 关闭弹框
+    cancleModal () {
+      this.outBizType = null
+      this.orderSn = undefined
+      this.openModal = false
+    },
     // 单个出库
     handleOutbound (row) {
       const _this = this

+ 11 - 5
src/views/salesManagement/salesQuery/detail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="salesDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
-        <template slot="subTitle">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }">
+        <template slot="subTitle" v-if="!outBizSn">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
           <a-button
             v-if="(detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE')&&$hasPermissions('B_salesEdit')"
@@ -100,6 +100,12 @@ import { salesDetailList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       spinning: false,
@@ -135,7 +141,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return salesDetailList(Object.assign(parameter, { salesBillSn: this.$route.params.sn })).then(res => {
+        return salesDetailList(Object.assign(parameter, { salesBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -175,7 +181,7 @@ export default {
     },
     //  详情
     getDetail () {
-      salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
+      salesDetailBySn({ salesBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
         } else {
@@ -187,7 +193,7 @@ export default {
     handlePrint (type) {
       const _this = this
       _this.spinning = true
-      salesDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+      salesDetailPrint({ sn: this.outBizSn || this.$route.params.sn, type: this.printerType }).then(res => {
         _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()

+ 11 - 5
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -2,9 +2,9 @@
   <div class="urgentItemsOffsetDetail-page-wrapper">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 操作 -->
-      <a-page-header :ghost="false" :backIcon="false" class="urgentItemsOffsetDetail-operation-wrapper" >
+      <a-page-header :ghost="false" :backIcon="false" class="urgentItemsOffsetDetail-operation-wrapper" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
         <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
+        <template slot="subTitle" v-if="!outBizSn">
           <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
@@ -72,6 +72,12 @@ import { STable, VSelect } from '@/components'
 import { urgentWriteDown, urgentDetailSn, urgentDetailList } from '@/api/urgent'
 export default {
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       spinning: false,
@@ -100,7 +106,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return urgentDetailList(Object.assign(parameter, { urgentBillSn: this.$route.params.sn })).then(res => {
+        return urgentDetailList(Object.assign(parameter, { urgentBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -127,7 +133,7 @@ export default {
     },
     //  详情
     getDetail () {
-      urgentDetailSn({ sn: this.$route.params.sn }).then(res => {
+      urgentDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
         } else {
@@ -144,7 +150,7 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          urgentWriteDown({ urgentBillSn: _this.$route.params.sn }).then(res => {
+          urgentWriteDown({ urgentBillSn: _this.outBizSn || _this.$route.params.sn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.getDetail()