Explorar o código

Merge branch 'develop_yh12' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh12

chenrui %!s(int64=2) %!d(string=hai) anos
pai
achega
6b9073e8ef

+ 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
         })
       }
     }

+ 2 - 2
src/views/allocationManagement/transfersPrint/list.vue

@@ -150,9 +150,9 @@
     <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 style="line-height: 24px;text-align:left;">
           <div>调拨单号:{{ tipData&&tipData.allocateNo }}</div>
           <div>调往对象:{{ tipData&&tipData.targetName }}</div>
         </div>

+ 7 - 2
src/views/expenseManagement/expenseReimbursement/importGuideModal.vue

@@ -18,7 +18,7 @@
             <li>1) 导入的Excel文件中必须包含名为“记账类型”、“记账名称”、“费用承担方类型”、“费用承担方”、“费用承担金额”的列,且名称必须相同</li>
             <li>2) 其他列可根据实际情况填写,如果符合规则,系统会一起导入</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -86,7 +86,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -127,6 +128,10 @@ export default {
     },
     // 下载模板
     handleExport () {
+      this.exportLoading = true
+      setTimeout(() => {
+        this.exportLoading = false
+      }, 1000)
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = 'https://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/expenseAccountDetailImport.xlsx?t=' + new Date().getTime()

+ 0 - 2
src/views/inventoryManagement/intelligentReplenishment/set.vue

@@ -72,13 +72,11 @@ import moment from 'moment'
 import VueCookies from 'vue-cookies'
 import { Upload } from '@/components'
 import { predictProductInfoExport } from '@/api/predict'
-import debounce from 'lodash/debounce'
 export default {
   name: 'IntelligentReplenishmentSet',
   mixins: [commonMixin],
   components: { Upload },
   data () {
-    this.handleExport = debounce(this.handleExport, 2200)
     return {
       spinning: false,
       filePath: 'javascript:;',

+ 1 - 1
src/views/inventoryManagement/inventoryCheck/list.vue

@@ -85,7 +85,7 @@
       okText="好的"
       :isCancel="false"
       @ok="openCommonModal=false"
-      @close="openCommonModal=false" />
+      @cancel="openCommonModal=false" />
   </a-card>
 </template>
 

+ 7 - 2
src/views/productManagement/productInfo/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 产品编码具有唯一性,系统中已存在的无法导入</li>
             <li>3) 产品品牌、产品分类、单位、包装数单位,必须是系统中已经存在的值,否则无法导入</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -88,7 +88,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -122,6 +123,10 @@ export default {
     },
     // 下载模板
     handleExport () {
+      this.exportLoading = true
+      setTimeout(() => {
+        this.exportLoading = false
+      }, 1000)
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = 'https://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/productImport.xlsx?t=' + new Date().getTime()

+ 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

@@ -114,7 +114,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>
@@ -210,7 +210,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)

+ 7 - 2
src/views/salesManagement/sendOutOrder/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 如果物流单号相同,则视为同一个发货单</li>
             <li>3) 同一个发货单可有多个不同类型的类型,包括易损件、电池、机油</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -87,7 +87,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -125,6 +126,10 @@ export default {
     },
     // 下载模板
     handleExport () {
+      this.exportLoading = true
+      setTimeout(() => {
+        this.exportLoading = false
+      }, 1000)
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = 'https://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/sendOutOrderImport.xlsx?t=' + new Date().getTime()

+ 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>

+ 7 - 2
src/views/salesReturnManagement/salesReturn/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“数量”、“价格”、“退货原因”四列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -90,7 +90,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -125,6 +126,10 @@ export default {
     },
     // 下载模板
     handleExport () {
+      this.exportLoading = true
+      setTimeout(() => {
+        this.exportLoading = false
+      }, 1000)
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx?t=' + new Date().getTime()