Ver código fonte

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

chenrui 3 anos atrás
pai
commit
95cd41fecb

+ 0 - 10
src/config/router.config.js

@@ -175,16 +175,6 @@ export const asyncRouterMap = [
                   hidden: true,
                   permission: 'M_outboundOrderList'
                 }
-              },
-              {
-                path: 'detail/:sn',
-                name: 'outboundOrderDetail',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/outboundOrder/detail.vue'),
-                meta: {
-                  title: '出库明细',
-                  icon: 'export',
-                  hidden: true
-                }
               }
             ]
           },

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

@@ -1,9 +1,9 @@
 <template>
   <div class="allocateBillDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="allocateBillDetail-back" >
+      <a-page-header :ghost="false" :backIcon="false" class="allocateBillDetail-back" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
         <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
+        <template slot="subTitle" v-if="!outBizSn">
           <a id="allocateBillDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a-button
             v-if="isEdit"
@@ -65,6 +65,12 @@ import { getOperationalPrecision } from '@/libs/tools.js'
 import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount, allocateBillDetailPrint } from '@/api/allocateBill'
 export default {
   components: { STable, VSelect },
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       spinning: false,
@@ -83,7 +89,7 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.$route.params.sn })).then(res => {
+        return allocateBillDetailList(Object.assign(parameter, { allocateSn: 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++) {
@@ -113,7 +119,7 @@ export default {
     },
     // 基本信息
     getDetail () {
-      allocateBillDetail({ sn: this.$route.params.sn }).then(res => {
+      allocateBillDetail({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
         } else {
@@ -123,7 +129,7 @@ export default {
     },
     // 合计
     getDetailCount () {
-      allocateBillDetailCount({ allocateSn: this.$route.params.sn }).then(res => {
+      allocateBillDetailCount({ allocateSn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -139,7 +145,7 @@ export default {
     handlePrint (type) {
       const _this = this
       _this.spinning = true
-      allocateBillDetailPrint({ sn: this.$route.params.sn, isPreview: type == 'preview' ? 1 : 0 }).then(res => {
+      allocateBillDetailPrint({ sn: this.outBizSn || this.$route.params.sn, isPreview: type == 'preview' ? 1 : 0 }).then(res => {
         _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
@@ -170,10 +176,14 @@ export default {
       }
     }
   },
+  mounted () {
+    this.getDetail()
+    this.getDetailCount()
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getDetail()
-      vm.getDetailCount()
+      // vm.getDetail()
+      // vm.getDetailCount()
     })
   }
 }

+ 0 - 140
src/views/salesManagement/outboundOrder/detail.vue

@@ -1,140 +0,0 @@
-<template>
-  <div class="outboundOrderDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="outboundOrderDetail-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="outboundOrderDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <!-- <template slot="extra">
-        <a-button key="2" id="outboundOrderDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="outboundOrderDetail-print-btn">快速打印</a-button>
-      </template> -->
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions size="small" :column="2">
-            <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货地址">
-              <span v-if="detailData&&detailData.salesBillExtEntity && (detailData.salesBillExtEntity.shippingAddrProvinceName || detailData.salesBillExtEntity.shippingAddrCityName || detailData.salesBillExtEntity.shippingAddrCountyName || detailData.salesBillExtEntity.shippingAddr)">
-                {{ (detailData && detailData.salesBillExtEntity && detailData.salesBillExtEntity.shippingAddrProvinceName) ? detailData.salesBillExtEntity.shippingAddrProvinceName : '' }}
-                {{ (detailData && detailData.salesBillExtEntity && detailData.salesBillExtEntity.shippingAddrCityName) ? detailData.salesBillExtEntity.shippingAddrCityName : '--' }}
-                {{ (detailData && detailData.salesBillExtEntity && detailData.salesBillExtEntity.shippingAddrCountyName) ? detailData.salesBillExtEntity.shippingAddrCountyName : '--' }}
-                {{ (detailData && detailData.salesBillExtEntity && detailData.salesBillExtEntity.shippingAddr) ? detailData.salesBillExtEntity.shippingAddr : '--' }}
-              </span>
-              <span v-else>--</span>
-            </a-descriptions-item>
-            <a-descriptions-item label="收款方式">{{ (detailData && detailData.salesBillExtEntity&&detailData.salesBillExtEntity.settleStyleSnDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货人">{{ (detailData && detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货电话">{{ (detailData && detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (detailData && detailData.salesBillExtEntity&&detailData.salesBillExtEntity.remarks) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务状态">{{ (detailData && detailData.billStatusDictValue) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom: 10px;">
-        <div slot="message">
-          本次下推数量:<strong>{{ totalOutQty }}</strong>
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        bordered>
-        <!-- 状态 -->
-        <template slot="state" slot-scope="text, record">
-          <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '已出库': '未出库' }}</a-tag>
-        </template>
-      </s-table>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { STable } from '@/components'
-import { stockOutDetail, stockOutDetailList, stockOutDetailCount } from '@/api/stockOut'
-export default {
-  components: { STable },
-  data () {
-    return {
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本次出库数', dataIndex: 'outQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        return stockOutDetailList(Object.assign(parameter, this.queryParam, { sn: 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++) {
-            data.list[i].no = no + i + 1
-          }
-          this.disabled = false
-          this.getDetailCount()
-          return data
-        })
-      },
-      detailData: null, //  详情数据
-      totalOutQty: 0 //  下推数量
-    }
-  },
-  methods: {
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/outboundOrder/list', query: { closeLastOldTab: true } })
-    },
-    //  获取详情
-    getDetail () {
-      stockOutDetail({ sn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.detailData = res.data
-        } else {
-          this.detailData = null
-        }
-      })
-    },
-    // 合计
-    getDetailCount () {
-      stockOutDetailCount({ sn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.totalOutQty = res.data && res.data.totalOutQty || 0
-        } else {
-          this.totalOutQty = 0
-        }
-      })
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getDetail()
-    })
-  }
-}
-</script>
-
-<style lang="less">
-  .outboundOrderDetail-wrap{
-    .outboundOrderDetail-back{
-      margin-bottom: 10px;
-    }
-    .outboundOrderDetail-cont{
-      margin-bottom: 10px;
-    }
-  }
-</style>

+ 34 - 4
src/views/salesManagement/outboundOrder/list.vue

@@ -95,15 +95,31 @@
         </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="960">
+    <pushOrderDetailModal v-if="outBizType=='SALES'" :outBizSubSn="orderSn" />
+    <allocationDetailModal v-if="outBizType=='ALLOCATE'" :outBizSn="orderSn" />
+	</a-modal>
   </a-card>
 </template>
 
 <script>
 import rangeDate from '@/views/common/rangeDate.vue'
+import pushOrderDetailModal from '@/views/salesManagement/pushOrderManagement/detail.vue'
+import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
 import { STable, VSelect } from '@/components'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, allocationDetailModal },
   data () {
     return {
       spinning: false,
@@ -146,7 +162,10 @@ export default {
           this.disabled = false
           return data
         })
-      }
+      },
+      openModal: false,
+      orderSn: undefined,
+      outBizType: null  //  当前单子类型   SALES销售出库        ALLOCATE调拨出库
     }
   },
   computed: {
@@ -206,15 +225,26 @@ export default {
     },
     //  详情
     handleDetail (row) {
+      this.outBizType = row.outBizType
       //  根据出库类型跳转对应页面
       if (row.outBizType == 'SALES' && this.$hasPermissions('B_dispatchDetail')) { //  销售出库
-        this.$router.push({ path: `/salesManagement/pushOrderManagement/detail/${row.outBizSubSn}/stockOut` })
+        // this.$router.push({ path: `/salesManagement/pushOrderManagement/detail/${row.outBizSubSn}/stockOut` })
+        this.orderSn = row.outBizSubSn
+        this.openModal = true
       } else if (row.outBizType == 'ALLOCATE' && this.$hasPermissions('M_transferOut_detail')) { //  调拨出库
-        this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.outBizSn}` })
+        // this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.outBizSn}` })
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else if (row.outBizType == 'CHECK_ORDER_OUT') { //  库存盘点盘亏
 
       }
     },
+    // 关闭弹框
+    cancleModal(){
+      this.outBizType = null
+      this.orderSn = undefined
+      this.openModal = false
+    },
     // 出库/批量出库
     handleOutbound (row) {
       const _this = this

+ 5 - 1
src/views/salesManagement/pushOrderManagement/chooseTypeModal.vue

@@ -38,6 +38,10 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    outBizSubSn: {
+      type: [Number, String],
+      default: ''
     }
   },
   data () {
@@ -79,7 +83,7 @@ export default {
     // 获取该销售单产品二级分类
     getTypeData () {
       this.typeList = [{ productTypeSn2: 'all', productTypeName2: '全部' }]
-      dispatchDetailType({ dispatchBillSn: this.$route.params.sn }).then(res => {
+      dispatchDetailType({ dispatchBillSn: this.outBizSubSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           if (res.data && res.data.length > 0) {
             this.typeList = [...this.typeList, ...res.data]

+ 16 - 10
src/views/salesManagement/pushOrderManagement/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: !outBizSubSn ? '16px 24px' : '0px 24px' }">
+        <template slot="subTitle" v-if="!outBizSubSn">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
         </template>
         <template slot="extra" v-if="$hasPermissions('B_dispatchPrint')">
@@ -42,14 +42,14 @@
           <a-collapse-panel key="1" header="基础信息">
             <a-descriptions size="small" :column="3">
               <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货地址" v-if="detailData&&detailData.salesBillExtEntity">
+              <a-descriptions-item label="收货人" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货地址" :span="3" v-if="detailData&&detailData.salesBillExtEntity">
                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
               </a-descriptions-item>
-              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货人" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收货电话" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
               <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
@@ -73,7 +73,7 @@
           ref="table"
           size="small"
           :rowKey="(record) => record.id"
-          :columns="$route.params.type=='stockOut' ? outColumns : columns"
+          :columns="($route.params.type=='stockOut' || outBizSubSn) ? outColumns : columns"
           :data="loadData"
           :scroll="{ x: 1070, y: 500 }"
           bordered>
@@ -88,7 +88,7 @@
       </a-card>
     </a-spin>
     <!-- 分类打印 -->
-    <choose-type-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+    <choose-type-modal :openModal="openModal" :outBizSubSn="outBizSubSn" @ok="handleOk" @close="openModal=false" />
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -101,6 +101,12 @@ import { dispatchDetaillList, dispatchFindBySn, dispatchDetailPrint } from '@/ap
 export default {
   name: 'SalesDetail',
   components: { STable, VSelect, chooseTypeModal },
+  props: {
+    outBizSubSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       disabled: false,
@@ -126,7 +132,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return dispatchDetaillList(Object.assign(parameter, { dispatchBillSn: this.$route.params.sn })).then(res => {
+        return dispatchDetaillList(Object.assign(parameter, { dispatchBillSn: this.outBizSubSn || 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++) {
@@ -158,7 +164,7 @@ export default {
     },
     //  详情
     getDetail () {
-      dispatchFindBySn({ dispatchBillSn: this.$route.params.sn }).then(res => {
+      dispatchFindBySn({ dispatchBillSn: this.outBizSubSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
         } else {
@@ -183,7 +189,7 @@ export default {
       const _this = this
       const params = {
         type: this.nowPrintType,
-        dispatchBillSn: this.$route.params.sn
+        dispatchBillSn: this.outBizSubSn || this.$route.params.sn
       }
       _this.spinning = true
       dispatchDetailPrint(Object.assign(params, productType || {})).then(res => {