lilei 2 роки тому
батько
коміт
2c5d8f191b

+ 23 - 2
src/views/financialManagement/financialCollection/selectGlAllocatModal.vue

@@ -74,16 +74,28 @@
         </s-table>
       </div>
     </a-spin>
+    <!-- 查看详情 -->
+    <commonModal
+      modalTit="调拨单详情"
+      bodyPadding="10px"
+      width="70%"
+      :showFooter="false"
+      :openModal="showDetailModal"
+      @cancel="cancelDetail">
+      <allocationDetailModal v-if="showDetailModal" :outBizSn="bizSn" />
+    </commonModal>
   </a-modal>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import { allocateBillList } from '@/api/allocateBill'
+import commonModal from '@/views/common/commonModal.vue'
+import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {
   name: 'SelectGlAllocatModal',
-  components: { STable, VSelect, dealerSubareaScopeList },
+  components: { STable, VSelect, dealerSubareaScopeList, commonModal, allocationDetailModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -113,7 +125,8 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       spinning: false,
-      handlePlData: [],
+      showDetailModal: false,
+      bizSn: null,
       queryParam: {
         buyerSn: undefined, //  客户名称
         receiverSn: undefined, // 收货客户
@@ -171,6 +184,14 @@ export default {
     shcustChange (val) {
       this.queryParam.receiverSn = val.key
     },
+    handleDetail (row, type) {
+      this.bizSn = row.allocateSn
+      this.showDetailModal = true
+    },
+    cancelDetail () {
+      this.showDetailModal = false
+      this.bizSn = null
+    },
     // 删除
     handleDel (row) {
       const oi = this.orginData.findIndex(item => row.bizSn == item.allocateSn)

+ 37 - 5
src/views/financialManagement/financialCollection/selectGlSalesModal.vue

@@ -84,6 +84,18 @@
           </template>
         </s-table>
       </div>
+
+      <!-- 查看销售单或备货单详情 -->
+      <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" :bizSn="bizSn"></dispatchDetail>
+      </commonModal>
     </a-spin>
   </a-modal>
 </template>
@@ -91,10 +103,13 @@
 <script>
 import { STable, VSelect } from '@/components'
 import { dispatchlList } from '@/api/dispatch'
+import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {
   name: 'SelectGlSalesModal',
-  components: { STable, VSelect, dealerSubareaScopeList },
+  components: { STable, VSelect, dealerSubareaScopeList, commonModal, salesDetail, dispatchDetail },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -124,7 +139,9 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       spinning: false,
-      handlePlData: [],
+      showDetailModal: false,
+      detailType: 2,
+      bizSn: null,
       queryParam: {
         buyerSn: undefined, //  客户名称
         receiverSn: undefined, // 收货客户
@@ -185,6 +202,17 @@ export default {
     shcustChange (val) {
       this.queryParam.receiverSn = val.key
     },
+    handleDetail (row, type) {
+      this.detailType = type
+      this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
+      this.showDetailModal = true
+      console.log(this.bizSn)
+    },
+    cancelDetail () {
+      this.showDetailModal = false
+      this.detailType = 2
+      this.bizSn = null
+    },
     // 删除
     handleDel (row) {
       const oi = this.orginData.findIndex(item => row.bizSn == item.dispatchBillSn)
@@ -219,7 +247,9 @@ export default {
         this.$refs.shbuyerName.resetForm()
       })
       if (this.$refs.table && !flag) {
-        this.$refs.table.refresh(true)
+        this.$nextTick(() => {
+          this.$refs.table.refresh(true)
+        })
       }
     }
   },
@@ -236,8 +266,8 @@ export default {
       if (!newValue) {
         this.handleCommonCancel()
       } else {
+        this.resetSearchForm(1)
         if (this.dealerSn) {
-          this.resetSearchForm(1)
           // 回显客户
           this.queryParam.buyerSn = this.dealerSn
           this.$nextTick(() => {
@@ -245,7 +275,9 @@ export default {
             this.$refs.table.refresh(true)
           })
         } else {
-          this.resetSearchForm()
+          this.$nextTick(() => {
+            this.$refs.table.refresh(true)
+          })
         }
       }
     }

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

@@ -222,7 +222,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn || this.bizSn })
+        const params = Object.assign(parameter, { salesBillSn: this.bizSn || this.$route.params.sn })
         let url = salesDetailAllList
         if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
           url = salesDetailAllStockList
@@ -345,7 +345,7 @@ export default {
     },
     //  详情
     getDetail () {
-      salesDetailBySn({ salesBillSn: this.$route.params.sn || this.bizSn }).then(res => {
+      salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data || null
           this.$refs.table.refresh(true)
@@ -367,7 +367,7 @@ export default {
     // 一键审核
     handleOnceAudit (data) {
       const params = {
-        salesBillSn: this.$route.params.sn || this.bizSn,
+        salesBillSn: this.bizSn || this.$route.params.sn,
         billStatus: 'AUDIT_PASS',
         dispatchBill: data
       }
@@ -387,7 +387,7 @@ export default {
     auditOrder (billStatus) {
       this.spinningAudit = true
       salesWriteAudit({
-        salesBillSn: this.$route.params.sn || this.bizSn,
+        salesBillSn: this.bizSn || this.$route.params.sn,
         billStatus: billStatus
       }).then(res => {
         if (res.status == 200) {
@@ -395,7 +395,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 || this.bizSn, dispatchBillSn: res.data.dispatchBillSn } })
+            this.$router.push({ name: 'waitDispatch', params: { salesBillSn: this.bizSn || this.$route.params.sn, dispatchBillSn: res.data.dispatchBillSn } })
           } else {
             //  关闭详情跳列表
             this.handleBack()
@@ -412,7 +412,7 @@ export default {
       // 销售分类导出
       if (type == 'typeExport') {
         const params = {
-          salesBillSn: this.$route.params.sn || this.bizSn,
+          salesBillSn: this.bizSn || this.$route.params.sn,
           showCostFlag: this.$hasPermissions('B_isShowCost')
         }
         _this.spinning = true