瀏覽代碼

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

# Conflicts:
#	src/views/allocationManagement/transferReturn/print.vue
调拨退货打印
lilei 3 年之前
父節點
當前提交
e6f887fe15

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "1.2.4",
+    "version": "2.1.6",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 1 - 1
src/api/allocateReturn.js

@@ -42,7 +42,7 @@ export const allocateReturnExcel = params => {
 // 打印
 export const allocateReturnPrint = params => {
   return axios({
-    url: `/allocateReturn/print/${params.allocateReturnSn}`,
+    url: `/allocateReturn/print/${params.allocateReturnSn}/${params.printType}`,
     method: 'get',
     responseType: 'blob'
   })

+ 1 - 1
src/views/allocationManagement/transferReturn/detail.vue

@@ -15,7 +15,7 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="pageType=='pages'">
-          <print :params="{allocateReturnSn: $route.params.sn || outBizSn}" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
+          <print :params="{allocateReturnSn: $route.params.sn || outBizSn}" :basicInfoData="basicInfoData" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="allocateBillDetail-cont">

+ 1 - 1
src/views/allocationManagement/transferReturn/edit.vue

@@ -9,7 +9,7 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra">
-          <print :params="{allocateReturnSn: $route.params.sn}" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
+          <print :params="{allocateReturnSn: $route.params.sn || outBizSn}" :basicInfoData="basicInfoData" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" v-if="basicInfoData" class="allocateBillEdit-cont">

+ 24 - 2
src/views/allocationManagement/transferReturn/print.vue

@@ -24,6 +24,8 @@
       id="editGrap-export-btn"
       :disabled="disabled"
       @click="handleExcel">导出Excel</a-button>
+    <!-- 打印导出 -->
+    <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -31,8 +33,10 @@
 
 <script>
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import printModal from './printModal.vue'
 import { allocateReturnExcel, allocateReturnPrint } from '@/api/allocateReturn'
 export default {
+  components: { printModal },
   props: {
     params: {
       type: Object,
@@ -40,19 +44,37 @@ export default {
         return {}
       }
     },
+    basicInfoData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    },
     disabled: {
       type: Boolean,
       default: false
     }
   },
+  data () {
+    return {
+      openModal: false,
+      nowType: null
+    }
+  },
   methods: {
+    // 打印预览/快捷打印
     handlePrint (type) {
+      this.nowType = type
+      this.openModal = true
+    },
+    handleOk (obj) {
       const _this = this
       const params = {
-        allocateReturnSn: this.params.allocateReturnSn || ''
+        allocateReturnSn: obj.allocateReturnSn || '',
+        printType: obj.printType
       }
       _this.$emit('loading')
-      printFun(allocateReturnPrint, params, type, '调拨退货单', () => { _this.$emit('unloading') })
+      printFun(allocateReturnPrint, params, obj.isPreview, '调拨退货单', () => { _this.$emit('unloading') })
     },
     // 导出
     handleExcel () {

+ 123 - 0
src/views/allocationManagement/transferReturn/printModal.vue

@@ -0,0 +1,123 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="allocateBill-print-type-modal"
+    title="调拨退货打印"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="allocateBill-print-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="调拨退货单号">{{ itemData&&itemData.allocateReturnNo || '--' }}</a-form-model-item>
+        <a-form-model-item label="调拨退货对象">{{ itemData&&itemData.targetName || '--' }}</a-form-model-item>
+        <a-form-model-item label="产品价格" prop="priceType">
+          <a-radio-group v-model="form.priceType">
+            <a-radio value="thj">退货价</a-radio>
+            <a-radio value="cbj">成本价</a-radio>
+            <a-radio value="bdy">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="allocateBill-print-save" @click="handleSave(0)">取消</a-button>
+        <a-button type="primary" id="allocateBill-print-back" @click="handleSave(1)" 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
+      }
+    },
+    nowType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      form: {
+        id: 'all',
+        priceType: undefined
+      },
+      rules: {
+        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      spinning: false
+    }
+  },
+  methods: {
+    // 确认
+    handleSave (type) {
+      const _this = this
+      if (type == 0) {
+        _this.$emit('close')
+        return
+      }
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          // 确定
+          if (type == 1) {
+            const obj = {
+              allocateReturnSn: _this.itemData.allocateReturnSn,
+              printType: _this.form.priceType,
+              isPreview: this.nowType
+            }
+            _this.$emit('ok', obj)
+          }
+          _this.isShow = false
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .allocateBill-print-type-modal{
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 2 - 2
vue.config.js

@@ -107,9 +107,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.102/ocs-admin',
+        target: 'http://192.168.16.151/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
-        target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
+        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,
         changeOrigin: true,
         pathRewrite: {