Quellcode durchsuchen

Merge branch 'deploy_0804' of jianguan-web/jg-ocs-html into master

陈瑞 vor 3 Jahren
Ursprung
Commit
a8c7ee0bd9

+ 9 - 0
src/api/allocateBill.js

@@ -149,3 +149,12 @@ export const allocateBillBatchInsert = params => {
     method: 'post'
   })
 }
+//  调拨管理 导入产品  导出错误项
+export const allocateBillFailExcel = (params) => {
+  return axios({
+    url: '/allocateBill/detail/downloadFailExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 24 - 4
src/views/allocationManagement/transferOut/chooseImportModal.vue

@@ -46,20 +46,28 @@
           size="large"
           :class="loadData.length==0?'button-grey':'button-primary'"
           @click="handleSubmit"
-          style="padding: 0 60px;">确认导入</a-button>
+          style="padding: 0 40px;">确认导入</a-button>
         <a-button
           id="chooseImport-cancel"
           size="large"
           class="button-cancel"
           @click="isShow=false"
-          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
       </div>
     </div>
   </a-modal>
 </template>
 
 <script>
-import { allocateBillParseProducts } from '@/api/allocateBill'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
 export default {
   name: 'ChooseImportModal',
   props: {
@@ -129,6 +137,18 @@ export default {
         this.$emit('ok', this.loadData)
         this.isShow = false
       }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(allocateBillFailExcel, _this.unLoadData, '产品导入错误项', function () {
+        _this.spinning = false
+      })
     }
   },
   watch: {
@@ -159,7 +179,7 @@ export default {
       .btn-con{
         text-align: center;
         margin: 30px 0 20px;
-        .button-cancel{
+        .button-cancel,.button-error{
           font-size: 12px;
         }
       }

+ 107 - 0
src/views/inventoryManagement/inventoryQuery/exportExcelModal.vue

@@ -0,0 +1,107 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="export-excel-modal"
+    title="选择导出方式"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="export-excel-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="导出库存" prop="exportType">
+          <a-radio-group v-model="form.exportType">
+            <a-radio value="all">所有</a-radio>
+            <a-radio value="type">分类汇总导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="export-excel-save" @click="handleSave()">导出</a-button>
+        <a-button id="export-excel-back" @click="handleCancel" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      form: {
+        exportType: 'all'
+      },
+      rules: {
+        exportType: [{ required: true, message: '请选择导出方式', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      spinning: false
+    }
+  },
+  methods: {
+    // 确认
+    handleSave (isPrint) {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$emit('ok', _this.form.exportType)
+          _this.isShow = false
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 取消选择分类
+    handleCancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .export-excel-modal{
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 14 - 45
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -63,7 +63,7 @@
                 type="primary"
                 style="margin-left: 5px"
                 class="button-warning"
-                @click="handleExport"
+                @click="openExcelModal=true"
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="inventoryQueryList-export">导出</a-button>
@@ -116,6 +116,8 @@
     </a-spin>
     <!-- 库存详情 -->
     <inventory-query-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <!-- 导出Excel -->
+    <export-excel-modal :openModal="openExcelModal" @ok="handleExcelOk" @close="openExcelModal=false" />
   </a-card>
 </template>
 
@@ -123,11 +125,13 @@
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
+import exportExcelModal from './exportExcelModal.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { stockList, stockCount, stockExport } from '@/api/stock'
 export default {
-  components: { STable, VSelect, inventoryQueryDetailModal },
+  components: { STable, VSelect, inventoryQueryDetailModal, exportExcelModal },
   data () {
     return {
       spinning: false,
@@ -194,7 +198,8 @@ export default {
       },
       openModal: false, //  查看库存详情  弹框
       itemId: '', //  当前库存记录id
-      currentStock: null
+      currentStock: null,
+      openExcelModal: false
     }
   },
   computed: {
@@ -253,8 +258,8 @@ export default {
     goWarehouseDetail (row) {
       this.$router.push({ path: `/inventoryManagement/inventoryQuery/warehouseDetail/${row.productSn}` })
     },
-    //  导出
-    handleExport () {
+    // 导出Excel
+    handleExcelOk (exportType) {
       const _this = this
       const params = JSON.parse(JSON.stringify(this.queryParam))
       if (params.zeroQtyFlag) {
@@ -262,50 +267,14 @@ export default {
       } else {
         params.zeroQtyFlag = ''
       }
+      params.exportType = exportType
       this.exportLoading = true
-      _this.spinning = true
-      stockExport(params).then(res => {
-        this.exportLoading = false
+      this.spinning = true
+      hdExportExcel(stockExport, params, '库存查询', function () {
+        _this.exportLoading = false
         _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
-          })
-          reader.readAsText(res)
-        } else {
-          this.download(res)
-        }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存查询' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
-    //  递归函数
-    recursionFun (data) {
-      if (data) {
-        data.map((item, index) => {
-          if (item.children && item.children.length == 0) {
-            delete item.children
-          } else {
-            this.recursionFun(item.children)
-          }
-        })
-      }
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''

+ 10 - 10
src/views/power/role/roleList.vue

@@ -1,9 +1,9 @@
 <template>
-  <a-card size="small" :bordered="false">
+  <a-card size="small" :bordered="false" class="roleList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline">
-          <a-row :gutter="48">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="角色名称">
                 <a-input
@@ -112,12 +112,12 @@ export default {
       menuData: {},
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center' },
-        { title: '角色名称', dataIndex: 'name', align: 'center' },
-        { title: '角色描述', dataIndex: 'remarks', width: 200, align: 'center', scopedSlots: { customRender: 'remarks' } },
-        { title: '状态', width: 100, align: 'center', scopedSlots: { customRender: 'status' } },
-        { title: '操作', width: 150, align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center' },
+        { title: '角色名称', dataIndex: 'name', width: '25%', align: 'center' },
+        { title: '角色描述', dataIndex: 'remarks', width: '25%', align: 'center', scopedSlots: { customRender: 'remarks' } },
+        { title: '状态', width: '15%', align: 'center', scopedSlots: { customRender: 'status' } },
+        { title: '操作', width: '15%', align: 'center', scopedSlots: { customRender: 'action' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -226,7 +226,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 235
+      this.tableHeight = window.innerHeight - tableSearchH - 255
     }
   },
   mounted () {

+ 3 - 3
src/views/productManagement/productInfo/edit.vue

@@ -263,9 +263,9 @@ export default {
         unit: [
           { required: true, message: '请选择单位', trigger: 'change' }
         ],
-        packQty: [
-          { required: true, message: '请输入包装数', trigger: 'blur' }
-        ],
+        // packQty: [
+        //   { required: true, message: '请输入包装数', trigger: 'blur' }
+        // ],
         arrowFalg: [
           { required: true, message: '请选择是否为箭冠产品', trigger: 'change' }
         ]

+ 15 - 1
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -15,6 +15,18 @@
                 <a-input id="bulkWarehousingOrderList-relationNo" v-model.trim="queryParam.relationNo" allowClear placeholder="请输入关联单号"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="bulkWarehousingOrderList-state"
+                  code="SPARE_PARTS_STATE"
+                  placeholder="请选择状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkWarehousingOrderList-refresh">查询</a-button>
@@ -105,7 +117,8 @@ export default {
       // 查询参数
       queryParam: {
         productCode: '',
-        relationNo: ''
+        relationNo: '',
+        state: undefined
       },
       // 表头
       columns: [
@@ -249,6 +262,7 @@ export default {
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.relationNo = ''
+      this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },
     //  单条审核

+ 1 - 0
src/views/reportData/billingReturnReport/list.vue

@@ -77,6 +77,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_billingReturn_Report')"
                 id="billingReturnReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}

+ 1 - 0
src/views/reportData/returnSlipReport/list.vue

@@ -82,6 +82,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_returnSlip_Report')"
                 id="returnSlipReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}

+ 1 - 0
src/views/reportData/salesReturnDetailReport/list.vue

@@ -131,6 +131,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_salerReturnDetailTable_export')"
                 id="salesReturnDetailList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}

+ 3 - 2
src/views/reportData/salesReturnReport/list.vue

@@ -77,6 +77,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_salesReturn_Report')"
                 id="salesReturnReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
@@ -140,8 +141,8 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { salesReportReturnRebateList, salesReportReturnRebateCount } from '@/api/reportData'
-import { salesReturnExport } from '@/api/reportData'
+import { salesReportReturnRebateList, salesReportReturnRebateCount, salesReturnExport } from '@/api/reportData'
+
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate },
   data () {

+ 1 - 0
src/views/reportData/salesReturnsReport/list.vue

@@ -88,6 +88,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_salesReturns_report')"
                 id="salesReturnsReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}

+ 1 - 0
src/views/reportData/salesSlipReport/list.vue

@@ -82,6 +82,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_salesSlip_report')"
                 id="salesSlipReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}