lilei 2 年 前
コミット
f2e832e85e

+ 28 - 1
src/views/financialManagement/financialCollection/dispatchModal.vue

@@ -42,15 +42,29 @@
         <a-button @click="handleCommonCancel">关闭</a-button>
       </div>
     </a-spin>
+    <!-- 查看销售单或备货单详情 -->
+    <commonModal
+      :modalTit="detailType?'备货单详情':'销售单详情'"
+      bodyPadding="10px"
+      width="70%"
+      :showFooter="false"
+      :openModal="showDetailModal"
+      @cancel="cancelDetail">
+      <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+      <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :outBizSubSn="bizSn"></dispatchDetail>
+    </commonModal>
   </a-modal>
 </template>
 
 <script>
 import { STable } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import { queryDispatchBillListBySn } from '@/api/financeBook.js'
 export default {
   name: 'DispatchModal',
-  components: { STable },
+  components: { STable, commonModal, salesDetail, dispatchDetail },
   props: {
     openModal: {
       type: Boolean,
@@ -64,6 +78,9 @@ export default {
   data () {
     return {
       spinning: false,
+      showDetailModal: false,
+      detailType: 2,
+      bizSn: null,
       isShow: this.openModal,
       detailData: null,
       columns: [
@@ -108,6 +125,16 @@ export default {
     },
     setDetail (data) {
       this.detailData = data
+    },
+    handleDetail (row, type) {
+      this.detailType = type
+      this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
+      this.showDetailModal = true
+    },
+    cancelDetail () {
+      this.showDetailModal = false
+      this.detailType = 2
+      this.bizSn = null
     }
   },
   watch: {

+ 13 - 8
src/views/salesManagement/salesQuery/detail.vue

@@ -2,7 +2,7 @@
   <div class="salesDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
-        <template slot="subTitle">
+        <template slot="subTitle" v-if="!bizSn">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
         </template>
         <template slot="extra">
@@ -196,13 +196,18 @@ import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import dsModal from '@/views/salesManagement/waitDispatch/dsModal.vue'
-import { findBySalesBillSn } from '@/api/dispatch'
 import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit, salesWriteAuditPush } from '@/api/sales'
 import { salesDetailAllList, salesDetailAllStockList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   mixins: [commonMixin],
   components: { STable, VSelect, printModal, auditModal, dsModal },
+  props: {
+    bizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       spinning: false,
@@ -211,7 +216,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn })
+        const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn || this.bizSn })
         let url = salesDetailAllList
         if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
           url = salesDetailAllStockList
@@ -331,7 +336,7 @@ export default {
     },
     //  详情
     getDetail () {
-      salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
+      salesDetailBySn({ salesBillSn: this.$route.params.sn || this.bizSn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data || null
           this.$refs.table.refresh(true)
@@ -353,7 +358,7 @@ export default {
     // 一键审核
     handleOnceAudit (data) {
       const params = {
-        salesBillSn: this.$route.params.sn,
+        salesBillSn: this.$route.params.sn || this.bizSn,
         billStatus: 'AUDIT_PASS',
         dispatchBill: data
       }
@@ -371,7 +376,7 @@ export default {
     auditOrder (billStatus) {
       this.spinningAudit = true
       salesWriteAudit({
-        salesBillSn: this.$route.params.sn,
+        salesBillSn: this.$route.params.sn || this.bizSn,
         billStatus: billStatus
       }).then(res => {
         if (res.status == 200) {
@@ -379,7 +384,7 @@ export default {
           this.$message.success(res.message)
           this.spinningAudit = false
           if (billStatus == 'AUDIT_PASS' && !this.auditText) {
-            this.$router.push({ name: 'waitDispatch', params: { salesBillSn: this.$route.params.sn, dispatchBillSn: res.data.dispatchBillSn } })
+            this.$router.push({ name: 'waitDispatch', params: { salesBillSn: this.$route.params.sn || this.bizSn, dispatchBillSn: res.data.dispatchBillSn } })
           } else {
             //  关闭详情跳列表
             this.handleBack()
@@ -396,7 +401,7 @@ export default {
       // 销售分类导出
       if (type == 'typeExport') {
         const params = {
-          salesBillSn: this.$route.params.sn,
+          salesBillSn: this.$route.params.sn || this.bizSn,
           showCostFlag: this.$hasPermissions('B_isShowCost')
         }
         _this.spinning = true