lilei 2 rokov pred
rodič
commit
bcce8b8f3c

+ 1 - 1
src/api/allocateBill.js

@@ -188,7 +188,7 @@ export const allocateBillFailExcel = (params) => {
 //  调拨 详情  导出
 export const allocateBillDetailExcel = (params) => {
   return axios({
-    url: '/allocateBill/detail/exportExcel',
+    url: `/allocateBill/detail/exportExcel/${params.printType}`,
     data: params,
     method: 'post',
     responseType: 'blob'

+ 23 - 6
src/views/allocationManagement/transferOut/detail.vue

@@ -16,13 +16,21 @@
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra">
           <a-button
-            key="3"
+            key="4"
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOut_detail_export')"
             id="allocateBillDetail-export-btn"
             :disabled="localDataSource.length==0"
-            @click="handleExcel">导出Excel</a-button>
+            @click="handleExcel('ALLOCATE_BILL','调拨明细')">导出Excel</a-button>
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            v-if="$hasPermissions('B_transferOutType_export')"
+            id="allocateBillDetail-export-btn"
+            :disabled="localDataSource.length==0"
+            @click="handlePrint('dbflExport')">调拨分类导出</a-button>
           <a-divider type="vertical" />
           <a-button
             key="2"
@@ -85,7 +93,13 @@
       </a-card>
     </a-spin>
     <!-- 打印导出 -->
-    <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
+    <print-modal
+      :openModal="openModal"
+      :itemData="basicInfoData"
+      :nowType="nowType"
+      @export="exportFl"
+      @ok="handleOk"
+      @close="openModal=false" />
   </div>
 </template>
 
@@ -191,16 +205,19 @@ export default {
       this.$router.push({ path: `/allocationManagement/transferOut/edit/${this.basicInfoData.allocateSn}/${this.basicInfoData.dealerLevel}` })
     },
     // 导出
-    handleExcel () {
+    handleExcel (printType, filename, data) {
       const _this = this
       this.spinning = true
-      const params = { allocateSn: this.outBizSn || this.$route.params.sn }
+      const params = { allocateSn: this.outBizSn || this.$route.params.sn, printType: printType, ...data }
       params.showCostFlag = this.$hasPermissions('B_isShowCost')
       params.showAmountFlag = this.$hasPermissions('B_isShowPrice')
-      exportExcel(allocateBillDetailExcel, params, '调拨明细', function () {
+      exportExcel(allocateBillDetailExcel, params, filename, function () {
         _this.spinning = false
       })
     },
+    exportFl (data) {
+      this.handleExcel(data.printType, '调拨分类', data)
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       this.nowType = type

+ 24 - 7
src/views/allocationManagement/transferOut/edit.vue

@@ -10,13 +10,21 @@
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra">
           <a-button
-            key="3"
+            key="4"
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOut_detail_export')"
-            id="allocateBillEdit-export-btn"
+            id="allocateBillDetail-export-btn"
             :disabled="localDataSource.length==0"
-            @click="handleExcel">导出Excel</a-button>
+            @click="handleExcel('ALLOCATE_BILL','调拨明细')">导出Excel</a-button>
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            v-if="$hasPermissions('B_transferOutType_export')"
+            id="allocateBillDetail-export-btn"
+            :disabled="localDataSource.length==0"
+            @click="handlePrint('dbflExport')">调拨分类导出</a-button>
           <a-divider type="vertical" />
           <a-button
             key="2"
@@ -224,7 +232,13 @@
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
     <!-- 打印导出 -->
-    <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
+    <print-modal
+      :openModal="openModal"
+      :itemData="basicInfoData"
+      :nowType="nowType"
+      @export="exportFl"
+      @ok="handleOk"
+      @close="openModal=false" />
     <!-- 提交调拨单 -->
     <dsModal ref="dsModal" :dealerLevel="$route.params.dealerLevel" :openModal="showDsModal" @close="showDsModal=false" @ok="handleSubmit" />
     <!-- 修改基础信息 -->
@@ -589,16 +603,19 @@ export default {
       }
     },
     // 导出
-    handleExcel () {
+    handleExcel (printType, filename, data) {
       const _this = this
       this.spinning = true
-      const params = { allocateSn: this.$route.params.sn }
+      const params = { allocateSn: this.outBizSn || this.$route.params.sn, printType: printType, ...data }
       params.showCostFlag = this.$hasPermissions('B_isShowCost')
       params.showAmountFlag = this.$hasPermissions('B_isShowPrice')
-      exportExcel(allocateBillDetailExcel, params, '调拨明细', function () {
+      exportExcel(allocateBillDetailExcel, params, filename, function () {
         _this.spinning = false
       })
     },
+    exportFl (data) {
+      this.handleExcel(data.printType, '调拨分类', data)
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       this.nowType = type

+ 35 - 4
src/views/allocationManagement/transferOut/printModal.vue

@@ -21,7 +21,7 @@
         <a-form-model-item style="margin-bottom: 0;" label="调往对象">{{ itemData&&itemData.targetName || '--' }}</a-form-model-item>
         <a-form-model-item style="margin-bottom: 0;" label="发货编号">{{ itemData&&itemData.sendNo || '--' }}</a-form-model-item>
         <a-form-model-item style="margin-bottom: 0;" label="收货客户名称">{{ itemData&&itemData.receiverName || '--' }}</a-form-model-item>
-        <a-form-model-item style="margin-bottom: 0;" label="产品分类" prop="id" v-if="nowType=='dbflPrint'">
+        <a-form-model-item style="margin-bottom: 0;" label="产品分类" prop="id" v-if="nowType=='dbflPrint'||nowType=='dbflExport'">
           <a-select id="allocateBill-print-form" v-model="form.id" placeholder="请选择产品分类">
             <a-select-option v-for="item in typeList" :value="item.id" :key="item.id">
               <span v-if="item.id != 'all'">{{ item.productBrandName }} - {{ item.productTypeName3 }}</span>
@@ -39,8 +39,25 @@
       </a-form-model>
       <div class="btn-cont">
         <a-button id="allocateBill-print-close" @click="handleClose('preview')">取消</a-button>
-        <a-button id="allocateBill-print-save" type="primary" class="button-info" @click="handleSave('preview')" style="margin-left: 15px;">打印预览</a-button>
-        <a-button v-if="hidePrint" type="primary" id="allocateBill-print-back" @click="handleSave('print')" style="margin-left: 15px;">确定打印</a-button>
+        <a-button
+          v-if="nowType!='dbflExport'"
+          id="allocateBill-print-save"
+          type="primary"
+          class="button-info"
+          @click="handleSave('preview')"
+          style="margin-left: 15px;">打印预览</a-button>
+        <a-button
+          v-if="hidePrint&&nowType!='dbflExport'"
+          type="primary"
+          id="allocateBill-print-back"
+          @click="handleSave('print')"
+          style="margin-left: 15px;">确定打印</a-button>
+        <a-button
+          v-if="nowType=='dbflExport'"
+          type="primary"
+          id="allocateBill-print-back"
+          @click="handleSave('export')"
+          style="margin-left: 15px;">确定导出</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -91,6 +108,8 @@ export default {
         title = '调拨打印'
       } else if (this.nowType == 'dbflPrint') {
         title = '调拨分类打印'
+      } else if (this.nowType == 'dbflExport') {
+        title = '调拨分类导出'
       }
       return title
     },
@@ -117,7 +136,7 @@ export default {
               }
               _this.$emit('ok', obj)
             }
-          } else {
+          } else if (_this.nowType == 'dbPrint') {
             const obj = {
               allocateSn: _this.itemData.allocateSn,
               allocateNo: _this.itemData.allocateNo,
@@ -125,6 +144,18 @@ export default {
               isPreview: type == 'preview' ? 1 : 0
             }
             _this.$emit('ok', obj)
+          } else {
+            const item = _this.typeList.find(item => item.id == _this.form.id)
+            if (item) {
+              const obj = {
+                allocateSn: _this.itemData.allocateSn,
+                allocateNo: _this.itemData.allocateNo,
+                productBrandSn: item.productBrandSn,
+                productTypeSn3: item.productTypeSn3,
+                printType: 'ALLOCATE_BILL_TYPE'
+              }
+              _this.$emit('export', obj)
+            }
           }
           _this.isShow = false
         } else {

+ 50 - 22
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -7,13 +7,21 @@
         </template>
         <template slot="extra">
           <a-button
-            key="3"
+            key="4"
             type="primary"
             class="button-info"
             id="purchaseOrderDetail-export-btn"
             :disabled="localDataSource.length==0"
             v-if="$hasPermissions('B_dispatchExport')"
             @click="openExcelModal=true">导出Excel</a-button>
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            id="salesDetail-fhfl-print-btn"
+            :disabled="localDataSource.length==0"
+            v-if="$hasPermissions('B_dispatchTypeExport')"
+            @click="handleFlExport('DISPATCH_BILL_TYPE')">发货分类导出</a-button>
           <a-divider type="vertical" />
           <a-button
             key="2"
@@ -94,7 +102,13 @@
       </a-card>
     </a-spin>
     <!-- 发货分类打印 -->
-    <sendTypeModal ref="typePrint" :hasNoPrint="hasNoPrint" :openModal="openModal" @ok="handlePrintOk" @close="openModal=false" />
+    <sendTypeModal
+      ref="typePrint"
+      :hasNoPrint="hasNoPrint"
+      :nowType="nowType"
+      :openModal="openModal"
+      @ok="handlePrintOk"
+      @close="openModal=false" />
     <!-- 导出Excel -->
     <export-excel-modal :openModal="openExcelModal" :itemData="detailData" @ok="handleExcelOk" @close="openExcelModal=false" />
     <!-- 打印 -->
@@ -165,7 +179,8 @@ export default {
       localDataSource: [],
       nowPrintType: '', //  当前打印类型
       openExcelModal: false,
-      fromRouter: null
+      fromRouter: null,
+      nowType: 'print'
     }
   },
   computed: {
@@ -209,17 +224,24 @@ export default {
       })
     },
     // 导出Excel
-    handleExcelOk (priceType) {
+    handleExcelOk (priceType, data, fileName) {
       const _this = this
       const params = {
         dispatchBillSn: this.outBizSubSn || this.bizSn || this.$route.params.sn,
-        printType: priceType
+        printType: priceType,
+        ...data
       }
       this.spinning = true
-      exportExcel(dispatchDetailExcel, params, '下推产品', function () {
+      exportExcel(dispatchDetailExcel, params, fileName, function () {
         _this.spinning = false
       })
     },
+    // 发货分类导出
+    handleFlExport () {
+      this.openModal = true
+      this.nowType = 'export'
+      this.$refs.typePrint.setData(this.detailData, this.outBizSubSn || this.bizSn || this.$route.params.sn)
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       this.nowPrintType = type
@@ -231,6 +253,7 @@ export default {
         this.handlePrintOk(params, '发货', 'preview')
       } else if (type == 'DISPATCH_BILL_TYPE') { // 发货分类打印
         this.openModal = true
+        this.nowType = 'print'
         this.$refs.typePrint.setData(this.detailData, this.outBizSubSn || this.bizSn || this.$route.params.sn)
       }
     },
@@ -241,22 +264,27 @@ export default {
         type: this.nowPrintType,
         dispatchBillSn: this.outBizSubSn || this.bizSn || this.$route.params.sn
       }
-      _this.spinning = true
-      printFun(
-        dispatchDetailPrint,
-        Object.assign(params, obj || {}),
-        type,
-        taskName,
-        (res) => {
-          _this.$message.info(res.message)
-          _this.spinning = false
-        },
-        {
-          billType: 'DISPATCH',
-          billSn: obj.dispatchBillSn,
-          billNo: obj.dispatchBillNo,
-          printType: taskName + '打印'
-        }, this.hasNoPrint)
+
+      if (type != 'export') {
+        _this.spinning = true
+        printFun(
+          dispatchDetailPrint,
+          Object.assign(params, obj || {}),
+          type,
+          taskName,
+          (res) => {
+            _this.$message.info(res.message)
+            _this.spinning = false
+          },
+          {
+            billType: 'DISPATCH',
+            billSn: obj.dispatchBillSn,
+            billNo: obj.dispatchBillNo,
+            printType: taskName + '打印'
+          }, this.hasNoPrint)
+      } else {
+        this.handleExcelOk('DISPATCH_BILL_TYPE', obj, taskName)
+      }
     }
   },
   mounted () {

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

@@ -70,7 +70,7 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.$emit('ok', _this.form.priceType)
+          _this.$emit('ok', _this.form.priceType, {}, '下推产品')
           _this.isShow = false
         } else {
           console.log('error submit!!')

+ 23 - 2
src/views/salesManagement/pushOrderManagement/sendTypeModal.vue

@@ -43,8 +43,25 @@
       </a-form-model>
       <div class="btn-cont">
         <a-button id="pushOrderManagement-print-back" @click="handleCancel">取消</a-button>
-        <a-button type="primary" class="button-info" id="pushOrderManagement-print-save" @click="handleSave('preview')" style="margin-left: 15px;">打印预览</a-button>
-        <a-button type="primary" id="pushOrderManagement-print-save" v-if="!hasNoPrint" @click="handleSave('print')" style="margin-left: 10px;">确定打印</a-button>
+        <a-button
+          type="primary"
+          class="button-info"
+          id="pushOrderManagement-print-save"
+          v-if="nowType=='print'"
+          @click="handleSave('preview')"
+          style="margin-left: 15px;">打印预览</a-button>
+        <a-button
+          type="primary"
+          id="pushOrderManagement-print-save"
+          v-if="!hasNoPrint&&nowType=='print'"
+          @click="handleSave('print')"
+          style="margin-left: 10px;">确定打印</a-button>
+        <a-button
+          type="primary"
+          id="pushOrderManagement-print-save"
+          v-if="nowType=='export'"
+          @click="handleSave('export')"
+          style="margin-left: 10px;">确定导出</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -65,6 +82,10 @@ export default {
     hasNoPrint: {
       type: Boolean,
       default: false
+    },
+    nowType: {
+      type: String,
+      default: 'print'
     }
   },
   data () {