lilei 2 年 前
コミット
2cec127405

+ 71 - 68
src/core/directives/dragModal.js

@@ -14,79 +14,82 @@ const dragModal = Vue.directive('drag', (el, binding, vnode, oldVnode) => {
     const isThemeModal = el.classList.contains('grid-theme')
     const dialogHeaderEl = isThemeModal ? el.querySelector('.ant-tabs-bar') : el.querySelector('.ant-modal-header')
     const dragDom = isThemeModal ? el.querySelector('.ant-modal') : el.querySelector('.ant-modal')
-    // dialogHeaderEl.style.cursor = 'move';
-    dialogHeaderEl.style.cssText += ';cursor:move;user-select:none;'
-    // dragDom.style.cssText += ';top:0px;'
-    dragDom.style.cssText += `;left:0px;top:0px;`
-    // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
-    const sty = (function () {
-      if (window.document.currentStyle) {
-        return (dom, attr) => dom.currentStyle[attr]
-      } else {
-        return (dom, attr) => getComputedStyle(dom, false)[attr]
-      }
-    })()
-
-    dialogHeaderEl.onmousedown = (e) => {
-      // 鼠标按下,计算当前元素距离可视区的距离
-      const disX = e.clientX - dialogHeaderEl.offsetLeft
-      const disY = e.clientY - dialogHeaderEl.offsetTop
-
-      const screenWidth = document.body.clientWidth // body当前宽度
-      const screenHeight = document.documentElement.clientHeight // 可见区域高度(应为body高度,可某些环境下无法获取)
-
-      const dragDomWidth = dragDom.offsetWidth // 对话框宽度
-      const dragDomheight = dragDom.offsetHeight // 对话框高度
-
-      const minDragDomLeft = dragDom.offsetLeft
-      const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth - (isThemeModal ? 10 : 0)
-
-      const minDragDomTop = dragDom.offsetTop
-      const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight - (isThemeModal ? 10 : 0)
-
-      // 获取到的值带px 正则匹配替换
-      let styL = sty(dragDom, 'left')
-      let styT = sty(dragDom, 'top')
+    if(dialogHeaderEl){
+      // dialogHeaderEl.style.cursor = 'move';
+      dialogHeaderEl.style.cssText += ';cursor:move;user-select:none;'
+      // dragDom.style.cssText += ';top:0px;'
+      dragDom.style.cssText += `;left:0px;top:0px;`
+      // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
+      const sty = (function () {
+        if (window.document.currentStyle) {
+          return (dom, attr) => dom.currentStyle[attr]
+        } else {
+          return (dom, attr) => getComputedStyle(dom, false)[attr]
+        }
+      })()
       
-      // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
-      if (styL.includes('%')) {
-        // eslint-disable-next-line no-useless-escape
-        styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
-        // eslint-disable-next-line no-useless-escape
-        styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
-      } else {
-        styL = +styL.replace(/\px/g, '')
-        styT = +styT.replace(/\px/g, '')
-      };
-
-      document.onmousemove = function (e) {
-        // 通过事件委托,计算移动的距离
-        let left = e.clientX - disX
-        let top = e.clientY - disY
-
-        // 边界处理
-        if (-(left) > minDragDomLeft) {
-          left = -(minDragDomLeft)
-        } else if (left > maxDragDomLeft) {
-          left = maxDragDomLeft
+      dialogHeaderEl.onmousedown = (e) => {
+        // 鼠标按下,计算当前元素距离可视区的距离
+        const disX = e.clientX - dialogHeaderEl.offsetLeft
+        const disY = e.clientY - dialogHeaderEl.offsetTop
+      
+        const screenWidth = document.body.clientWidth // body当前宽度
+        const screenHeight = document.documentElement.clientHeight // 可见区域高度(应为body高度,可某些环境下无法获取)
+      
+        const dragDomWidth = dragDom.offsetWidth // 对话框宽度
+        const dragDomheight = dragDom.offsetHeight // 对话框高度
+      
+        const minDragDomLeft = dragDom.offsetLeft
+        const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth - (isThemeModal ? 10 : 0)
+      
+        const minDragDomTop = dragDom.offsetTop
+        const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight - (isThemeModal ? 10 : 0)
+      
+        // 获取到的值带px 正则匹配替换
+        let styL = sty(dragDom, 'left')
+        let styT = sty(dragDom, 'top')
+        
+        // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
+        if (styL.includes('%')) {
+          // eslint-disable-next-line no-useless-escape
+          styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
+          // eslint-disable-next-line no-useless-escape
+          styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
+        } else {
+          styL = +styL.replace(/\px/g, '')
+          styT = +styT.replace(/\px/g, '')
+        };
+      
+        document.onmousemove = function (e) {
+          // 通过事件委托,计算移动的距离
+          let left = e.clientX - disX
+          let top = e.clientY - disY
+      
+          // 边界处理
+          if (-(left) > minDragDomLeft) {
+            left = -(minDragDomLeft)
+          } else if (left > maxDragDomLeft) {
+            left = maxDragDomLeft
+          }
+      
+          if (-(top) > minDragDomTop) {
+            top = -(minDragDomTop)
+          } else if (top > maxDragDomTop) {
+            top = maxDragDomTop
+          }
+          // 移动当前元素
+          dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
         }
-
-        if (-(top) > minDragDomTop) {
-          top = -(minDragDomTop)
-        } else if (top > maxDragDomTop) {
-          top = maxDragDomTop
+      
+        document.onmouseup = function (e) {
+          document.onmousemove = null
+          document.onmouseup = null
+          dragDom.releaseCapture && dragDom.releaseCapture();
         }
-        // 移动当前元素
-        dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
-      }
-
-      document.onmouseup = function (e) {
-        document.onmousemove = null
-        document.onmouseup = null
-        dragDom.releaseCapture && dragDom.releaseCapture();
+         dragDom.setCapture && dragDom.setCapture();
       }
-       dragDom.setCapture && dragDom.setCapture();
     }
+    
   })
 })
 

+ 5 - 4
src/utils/request.js

@@ -28,11 +28,12 @@ const err = (error) => {
   // 业务错误提示
   if (error.response) {
     const status = error.response.status
-    const message = error.response.data
+    const resData = error.response.data
+    console.log(resData)
     if ((status == 503 || status == 500 || status == 404)) {
       notification.destroy()
-      if(message instanceof Blob){
-        message.text().then(data => {
+      if(resData instanceof Blob){
+        resData.text().then(data => {
           const res = JSON.parse(data)
           notification.error({
             message: '提示',
@@ -42,7 +43,7 @@ const err = (error) => {
       }else{
         notification.error({
           message: '提示',
-          description: message
+          description: resData.message
         })
       }
     }

+ 1 - 1
src/views/salesManagement/pushOrderManagement/list.vue

@@ -160,7 +160,7 @@
 
       <!-- 操作提示 -->
       <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
-        <div style="text-align: center;">
+        <div style="display:flex;flex-direction: column;align-items: center;">
           <div style="margin-bottom: 15px;font-size: 14px;"><strong>{{ tipData&&tipData.printType==1?'确认允许此单进行备货打印吗?':'确认此单取消备货打印吗?' }}</strong></div>
           <div style="line-height: 24px;">
             <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>

+ 2 - 2
src/views/salesManagement/receiptPrint/list.vue

@@ -103,7 +103,7 @@
         <recordModal v-drag ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
         <!-- 操作提示 -->
         <commonModal modalTit="操作提示" okText="暂不打印" :openModal="showPrintModal" @cancel="canselModal" @ok="updatePrintStatus">
-          <div style="text-align: center;">
+          <div style="display:flex;flex-direction: column;align-items: center;">
             <div style="margin-bottom: 15px;font-size: 14px;">如需将打印状态回退至<strong>【暂不打印】</strong>,请点击下方按钮</div>
             <div style="line-height: 24px;">
               <div>收款单号:{{ tipData&&tipData.bookNo }}</div>
@@ -198,7 +198,7 @@ export default {
         { title: '户名', dataIndex: 'bankAccount', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '汇入银行', dataIndex: 'bankName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '说明', dataIndex: 'explainInfo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } , ellipsis: true},
+        { title: '说明', dataIndex: 'explainInfo', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收款打印状态', dataIndex: 'printStatusDictValue', width: '6%', align: 'center', scopedSlots: { customRender: 'printStatus' } },
         { title: '打印次数', dataIndex: 'printNum', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }

+ 5 - 5
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -143,8 +143,8 @@ export default {
       detail: null,
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
-        { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '10%', align: 'center' },
+        { title: '申请人', dataIndex: 'applyPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '财务收款事由', dataIndex: 'bookReason', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -197,10 +197,10 @@ export default {
     // 批量打印
     async handlePlPrint () {
       this.spinning = true
-      let rows = [] 
+      let rows = []
       const bookSns = []
       this.tableData.map(item => {
-        if(item.financeBookDetailList){
+        if (item.financeBookDetailList) {
           rows = rows.concat(item.financeBookDetailList)
         }
       })
@@ -211,7 +211,7 @@ export default {
       })
       const retArr = []
       const auditInfo = await getBatchLastProcessInstance({ 'businessType': 'FINANCE_BOOK', 'businessSnList': bookSns }).then(res => res.data)
-      console.log(bookSns,auditInfo)
+      console.log(bookSns, auditInfo)
       bookSns.map(item => {
         // 授信明细
         const rs = rows.filter(a => a.bookSn == item)

+ 1 - 1
src/views/salesManagement/stockPrint/list.vue

@@ -175,7 +175,7 @@
         </commonModal>
         <!-- 操作提示 -->
         <commonModal modalTit="操作提示" okText="暂不打印" :openModal="showPrintModal" @cancel="canselModal" @ok="updatePrintStatus">
-          <div style="text-align: center;">
+          <div style="display:flex;flex-direction: column;align-items: center;">
             <div style="margin-bottom: 15px;font-size: 14px;">如需将打印状态回退至<strong>【暂不打印】</strong>,请点击下方按钮</div>
             <div style="line-height: 24px;">
               <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>