فهرست منبع

Merge branch 'develop_fencang' of jianguan-web/jg-ocs-html into pre-release

李磊 2 سال پیش
والد
کامیت
6aea270a4b

+ 1 - 1
.env.preview

@@ -1,6 +1,6 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=true
-VUE_APP_API_BASE_URL=http://p.ocs.360arrow.com/ocs-admin
+VUE_APP_API_BASE_URL=https://p.ocs.360arrow.com/ocs-admin
 VUE_APP_WX_BASE_URL=//p.ocs.360arrow.com/ocs-admin/websocket/
 VUE_APP_VERSION=V1.0.1
 VUE_APP_ENVTIPS=预发布环境

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
public/js/axios.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
public/js/echarts.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 5 - 0
public/js/vue-router.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 5 - 0
public/js/vue.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 5 - 0
public/js/vuex.min.js


+ 9 - 0
src/api/productUniversalCode.js

@@ -46,3 +46,12 @@ export const productCodeQueryList = (params) => {
     method: 'post'
   })
 }
+// 导出 
+export const productUniversalExport = (params) => {
+  return axios({
+    url: '/productUniversalCode/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 65 - 16
src/libs/JGPrint.js

@@ -143,20 +143,69 @@ export const jGPrint = function (data, type, callback, printLogParams, printPage
 }
 
 // 自动排版, 遍历数组,将数组中每一个数值加起来,如果和小于某个数,则将这些数值存放到一个新数组中。
-export const groupLessThan = function(numbers, targetSum) {
-  let currentSum = 0;
-  let result = [];
-  for (let i = 0; i < numbers.length; i++) {
-    currentSum += numbers[i].h;
-    if (currentSum <= targetSum) {
-      result.push(numbers[i].t);
-    } else {
-      result.push('&-NEWPAGE-&'); // 用'&-NEWPAGE-&'作为分页符
-      currentSum = numbers[i].h; // 重新计算当前总和
-      result.push(numbers[i].t);
-    }
+export const groupLessThan = function(html) {
+  const pageMidHeight = 535 // 半页高度
+  const pageHeight = pageMidHeight*2 // 页高度
+  const arr = []
+  const result = []
+  for (let i = 0; i < html.length; i++) {
+    const h = html[i].clientHeight // 总高度
+    const pz = h<=pageMidHeight ? '0.5' : (h/pageHeight).toFixed(2) // 页数
+    arr.push({
+      h: h,
+      pz: pz,
+      t: '<div style="height:'+(pz<=0.5?pageMidHeight:'auto')+'px'+';border:1px solid #fff;">'+html[i].innerHTML+'</div>',
+      flag: 0
+    })
   }
-  return result;
+  console.log(arr)
+   // 找出所有小于半张纸的
+   const a = arr.filter(item => item.pz <= 0.5)
+   // 先找出所有超过半张纸的,小于一张纸的
+   const b = arr.filter(item => item.pz >0.5 && item.pz <= 1)
+   // 找出所有超过一张纸的
+   const c = arr.filter(item => item.pz > 1)
+   // 先给c 找匹配的另一半
+   for(let i=0;i<c.length;i++){
+    const pz = Number(c[i].pz.split('.')[1])
+    // 先从b中找
+    const hasOther = b.findIndex(item => (item.pz + pz) < 1)
+    if(hasOther>=0){
+      result.push(c[i].t + b[hasOther].t)
+      // 删除hasOther
+      b.splice(hasOther,1)
+    }else{
+      // 再从a中找
+      const hasOtherA = a.findIndex(item => (item.pz + pz) < 1)
+      if(hasOtherA>=0){
+        result.push(c[i].t + a[hasOtherA].t)
+        // 删除hasOtherA
+        b.splice(hasOther,1)
+      }else{
+        // 都没匹配到
+        result.push(c[i].t)
+      }
+    }
+   }
+
+   // 将b依次加入
+   for(let i=0;i<b.length;i++){
+    result.push(b[i].t)
+   }
+
+   // 将a中每2个放到一个容器中
+   if(a.length%2!=0){
+    a.push({t:''})
+   }
+   for(let i=0;i<a.length;i=i+2){
+    result.push(a[i].t + a[i+1].t)
+   }
+
+  //  console.log(a)
+  //  console.log(b)
+  //  console.log(c)
+  //  console.log(result)
+   return result
 }
 
 // 批量打印销售收款单html
@@ -189,9 +238,9 @@ export const jGPlPrint = function (data, type, callback, printLogParams, taskNam
   // LODOP.SET_PRINT_MODE('CATCH_PRINT_STATUS', true)
   // TaskID:任务id,Value:job代码
   LODOP.On_Return = function (TaskID, Value) {
-    console.log(TaskID, Value, printLogParams)
+    console.log(TaskID, Value!=0, printLogParams)
     // 已打印
-    if (Value) {
+    if (Number(Value)) {
       if(printLogParams){
         console.log('已打印,统计打印次数')
         printLog(printLogParams, callback)
@@ -209,7 +258,7 @@ export const jGPlPrint = function (data, type, callback, printLogParams, taskNam
   if(data.length>1){
     // 循环页
     for(var i=0;i<data.length;i++){
-      LODOP.NewPage();
+      LODOP.NewPageA();
       LODOP.ADD_PRINT_HTM(0, 0, '100%', '99%', data[i])
     }
   }else{

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

@@ -60,15 +60,15 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-                <a-form-item label="调出仓库">
-                  <warehouse
-                    v-model="queryParam.warehouseSn"
-                    isPermission
-                    id="allocateBillList-warehouseSn"
-                    placeholder="请选择调出仓库"
-                  />
-                </a-form-item>
-              </a-col>
+                  <a-form-item label="调出仓库">
+                    <warehouse
+                      v-model="queryParam.warehouseSn"
+                      isPermission
+                      id="allocateBillList-warehouseSn"
+                      placeholder="请选择调出仓库"
+                    />
+                  </a-form-item>
+                </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-item label="所在区域">
                     <subarea id="allocateBillList-subarea" ref="subarea" @change="subareaChange"></subarea>
@@ -219,7 +219,7 @@ export default {
         checkStatus: undefined,
         warehouseSn: undefined,
         printState: 'NO_PRINT',
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
@@ -258,10 +258,10 @@ export default {
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '10%' },
-        { title: '调往对象', dataIndex: 'targetName', width: '9%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '发货说明', dataIndex: 'explainInfo', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收货客户名称', dataIndex: 'receiverName', width: '9%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调往对象', dataIndex: 'targetName', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '发货编号', dataIndex: 'sendNo', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发货说明', dataIndex: 'explainInfo', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { slots: { title: 'costTitle' }, dataIndex: 'receiveTotalAmount', width: '90px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -273,8 +273,8 @@ export default {
         { title: '打印次数', dataIndex: 'printCount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-      if(this.isShowWarehouse){
-        arr.splice(4,0,{ title: '调出仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
+      if (this.isShowWarehouse) {
+        arr.splice(4, 0, { title: '调出仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       }
 
       if (this.$hasPermissions('M_transfersPrintList_salesPrice')) { //  售价权限
@@ -283,7 +283,7 @@ export default {
         arr.splice(11, 0, { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '70px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(12, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      
+
       return arr
     }
   },
@@ -306,8 +306,8 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    subareaChange(val){
-      this.queryParam.subareaArea={
+    subareaChange (val) {
+      this.queryParam.subareaArea = {
         subareaSn: val[0] ? val[0] : undefined,
         subareaAreaSn: val[1] ? val[1] : undefined
       }
@@ -327,7 +327,7 @@ export default {
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.receiverSn.resetForm()
-      if(this.advanced){
+      if (this.advanced) {
         this.$refs.subarea.clearData()
       }
       this.queryParam.printState = this.currentTab == 2 ? 'NO_PRINT' : undefined
@@ -361,10 +361,10 @@ export default {
         (res) => {
           _this.spinning = false
           _this.$store.state.app.curActionPermission = ''
-          if (res&&res.status == 200) {
+          if (res && res.status == 200) {
             _this.$refs.table.refresh()
             _this.$message.info(res.message)
-          }          
+          }
         }, {
           billType: 'ALLOCATE',
           billSn: objs.allocateSn,

+ 2 - 17
src/views/expenseManagement/expenseReimbursement/previewModal.vue

@@ -143,26 +143,11 @@ export default {
     prints(){
       const _this = this
       const html = document.getElementsByClassName('expense-detail-print')
-      const pageHeight = 535
-      const printCons = []
-      for (let i = 0; i < html.length; i++) {
-        const h = html[i].clientHeight
-        printCons.push({
-          h: h<=pageHeight?pageHeight:h,
-          t: '<div style="height:'+(h<=pageHeight?(pageHeight+'px'):'auto')+';border:1px solid #fff;">'+html[i].innerHTML+'</div>'
-        })
-      }
-      // 排序从小到大
-      printCons.sort((a, b) => {
-        return a['h'] - b['h']
-      })
-      console.log(printCons)
       // 自动排版
-      const htmlStr = groupLessThan(printCons, pageHeight*2)
+      const result = groupLessThan(html)
       this.$store.state.app.curActionPermission = 'B_eRPrint'
       // html, type, callback, printLogParams
-      // console.log(htmlStr)
-      jGPlPrint(htmlStr.join('').split('&-NEWPAGE-&'), 'print', function (res) {
+      jGPlPrint(result, 'print', function (res) {
         _this.$store.state.app.curActionPermission = ''
         _this.$emit('printOk', res)
       },null,'费用报销单')

+ 19 - 8
src/views/productManagement/productUniversal/list.vue

@@ -35,6 +35,15 @@
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productUniversalList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productUniversalList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                v-if="$hasPermissions('B_productUniversalExport')"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="productUniversalList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -94,7 +103,8 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import productUniversalEditModal from './editModal.vue'
-import { productUniversalCodeList, productUniversalCodeDel } from '@/api/productUniversalCode'
+import { exportExcel } from '@/libs/JGPrint.js'
+import { productUniversalCodeList, productUniversalCodeDel, productUniversalExport } from '@/api/productUniversalCode'
 export default {
   name: 'ProductUniversalList',
   mixins: [commonMixin],
@@ -116,11 +126,12 @@ export default {
       exportLoading: false, // 导出loading
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '24%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品状态', dataIndex: 'product.stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '通用产品编码', dataIndex: 'productCommonCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用产品名称', dataIndex: 'productCommont.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '通用产品名称', dataIndex: 'productCommont.name', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
         { title: '通用产品状态', dataIndex: 'productCommont.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
@@ -194,12 +205,12 @@ export default {
     },
     //  导出
     handleExport () {
+      const _this = this
       const params = this.queryParam
-      this.exportLoading = true
-      // customerBundleExportDelay(params).then(res => {
-      //   this.exportLoading = false
-      //   this.download(res)
-      // })
+      this.spinning = true
+      exportExcel(productUniversalExport, params, '通用产品列表', function () {
+        _this.spinning = false
+      })
     },
     download (data) {
       if (!data) { return }

+ 2 - 19
src/views/salesManagement/receiptPrint/printModel.vue

@@ -106,28 +106,11 @@ export default {
     handleCommonOk () {
       const _this = this
       const html = document.getElementsByClassName('sendGood-print-box')
-      const pageHeight = 535
-      const printCons = []
-      for (let i = 0; i < html.length; i++) {
-        const h = html[i].clientHeight
-        printCons.push({
-          h: h<=pageHeight?pageHeight:h,
-          t: '<div style="height:'+(h<=pageHeight?(pageHeight+'px'):'auto')+';border:1px solid #fff;">'+html[i].innerHTML+'</div>'
-        })
-      }
-
-      // 排序从小到大
-      printCons.sort((a, b) => {
-        return a['h'] - b['h']
-      })
-
-      // 自动排版
-      const htmlStr = groupLessThan(printCons, pageHeight*2)
-      // console.log(htmlStr.join('').split('&-NEWPAGE-&'))
+      const result = groupLessThan(html)
       this.$store.state.app.curActionPermission = 'B_SkPrint'
       // html, type, callback, printLogParams
       this.spinning = true
-      jGPlPrint(htmlStr.join('').split('&-NEWPAGE-&'), 'print', function (res) {
+      jGPlPrint(result, 'print', function (res) {
         if(res){
           _this.handleCommonCancel()
         }

+ 6 - 5
vue.config.js

@@ -27,10 +27,11 @@ const assetsCDN = {
   css: [],
   // https://unpkg.com/browse/vue@2.6.10/
   js: [
-    '//vuepkg.oss-cn-beijing.aliyuncs.com/vue.min.js',
-    '//vuepkg.oss-cn-beijing.aliyuncs.com/vue-router.min.js',
-    '//vuepkg.oss-cn-beijing.aliyuncs.com/vuex.min.js',
-    '//vuepkg.oss-cn-beijing.aliyuncs.com/axios.min.js'
+    BASE_URL + 'js/vue.min.js',
+    BASE_URL + 'js/vue-router.min.js',
+    BASE_URL + 'js/vuex.min.js',
+    BASE_URL + 'js/axios.min.js',
+    // BASE_URL + 'js/echarts.min.js'
   ]
 }
 
@@ -109,7 +110,7 @@ const vueConfig = {
       '/api': {
         // target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'http://p.ocs.360arrow.com/ocs-admin', //  预发布
+        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است