فهرست منبع

采购退货申请单打印、导出、导入

lilei 2 سال پیش
والد
کامیت
aefff9b198

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1660119761565
+  "version": 1660187017431
 }

+ 49 - 0
src/api/purchaseReturnApply.js

@@ -105,4 +105,53 @@ export const purchaseReturnAgainCreate = (params) => {
    url: `/purchaseReturnApply/againCreate/${params.sn}`,
    method: 'get'
  })
+}
+
+// 导出删除项
+export const exportDeleteExcel = (params) => {
+  return axios({
+    url: `/purchaseReturnApply/detail/downloadDeleteFailExcel/${params.sn}`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 导出错误项
+export const exportErrorExcel = (params) => {
+  return axios({
+    url: `/purchaseReturnApply/detail/downloadFailExcel`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 解析产品的导入模板
+export const purchaseReturnApplyReadExcel = (params) => {
+  return axios({
+    url: `/purchaseReturnApply/detail/readExcel`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 导出明细
+export const purchaseReturnApplyExport = (params) => {
+ return axios({
+   url: `/purchaseReturnApply/excel/${params.sn}`,
+   method: 'get',
+   responseType: 'blob'
+ })
+}
+// 详情  打印
+export const purchaseReturnApplyPrint = params => {
+  const data = {
+    url: `/purchaseReturnApply/print/${params.sn}/${params.type}`,
+    method: 'get'
+  }
+  // 喷墨打印
+  if (params.type == 'INK') {
+    data.responseType = 'blob'
+  }
+  return axios(data)
 }

+ 1 - 1
src/views/Home.vue

@@ -789,7 +789,7 @@ export default {
   methods: {
     ...mapActions(['getLookUpData']),
     hasNewProduct () {
-      this.getLookUpData('RETURN_APPLY_BILL_STATUS')
+      this.getLookUpData('RETURN_REASON')
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
         if (res.status == 200) {
           if (res.data.count > 0) {

+ 192 - 0
src/views/purchasingManagement/purchaseReturnApplyForm/chooseImportModal.vue

@@ -0,0 +1,192 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="80%">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          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 { hdExportExcel } from '@/libs/exportExcel'
+import { exportErrorExcel, purchaseReturnApplyReadExcel } from '@/api/purchaseReturnApply'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'product.unit', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'exprotQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'product.unit', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'exprotQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '错误说明', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      purchaseReturnApplyReadExcel(this.paramsData).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.successList && res.data.successList.length > 0) {
+            res.data.successList.map((item, index) => {
+              item.no = index + 1
+              item.purchaseReturnApplyNo = this.paramsData.purchaseReturnApplyNo
+              item.purchaseReturnApplySn = this.paramsData.purchaseReturnApplySn
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+              item.purchaseReturnApplyNo = this.paramsData.purchaseReturnApplyNo
+              item.purchaseReturnApplySn = this.paramsData.purchaseReturnApplySn
+            })
+          }
+          _this.loadData = res.data.successList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入的产品!')
+      } else {
+        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(exportErrorExcel, _this.unLoadData, '采购退货申请单导出错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 30 - 21
src/views/purchasingManagement/purchaseReturnApplyForm/detail.vue

@@ -7,7 +7,7 @@
           <a id="purchaseReturnDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
+        <template slot="extra">
           <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
         </template>
       </a-page-header>
@@ -41,6 +41,10 @@
                 退货金额:<strong>{{ (basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount==0)) ? basicInfoData.totalAmount : '--' }}</strong>;
               </div>
             </a-alert>
+            <div v-if="basicInfoData" style="margin-bottom:10px;display:flex;align-items:center;">
+              <div>总公司删除产品明细:共 {{ basicInfoData.removeQty }} 款产品,{{ basicInfoData.removeCode.replace(',','、') }}。</div>
+              <a-button @click="exportDelProduct" type="link">导出删除产品明细</a-button>
+            </div>
             <!-- 列表 -->
             <s-table
               class="sTable"
@@ -64,8 +68,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
-import { getOperationalPrecision } from '@/libs/tools.js'
-import { purchaseReturnDetail, purchaseReturnDetailList, purchaseReturnDetailPrint, purchaseReturnDetailExport } from '@/api/purchaseReturnApply'
+import { purchaseReturnDetail, purchaseReturnDetailList, purchaseReturnApplyPrint, purchaseReturnApplyExport, exportDeleteExcel } from '@/api/purchaseReturnApply'
 export default {
   name: 'PurchaseReturnDetail',
   components: { STable, VSelect, Print },
@@ -83,15 +86,13 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.outBizSn || this.$route.params.sn })).then(res => {
+        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnApplySn: this.outBizSn || this.$route.params.sn })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-              // 采购金额  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-              data.list[i].purchaseReturnAmount = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
             }
             this.disabled = false
             this.dataSource = data.list
@@ -106,20 +107,20 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'product.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总公司实收数量', dataIndex: 'receiveQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'goodQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remarks', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '单位', dataIndex: 'product.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总公司变更详情', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(4, 0, { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '退货单价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }
@@ -127,20 +128,28 @@ export default {
   methods: {
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/purchasingManagement/purchaseReturn/list' })
+      this.$router.push({ name: 'purchaseReturnApplyFormList' })
     },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
       _this.spinning = true
-      let url = purchaseReturnDetailPrint
+      let url = purchaseReturnApplyPrint
       const params = { sn: this.$route.params.sn || this.outBizSn }
-      params.showFlag = this.$hasPermissions('M_ShowAllCost') ? 1 : 0
       if (type == 'export') { //  导出
-        url = purchaseReturnDetailExport
+        url = purchaseReturnApplyExport
       }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '采购退货单', function () {
+      hdPrint(printerType, type, url, params, '采购退货申请单', function () {
+        _this.spinning = false
+      })
+    },
+    // 导出删除的产品
+    exportDelProduct () {
+      const _this = this
+      _this.spinning = true
+      const params = { sn: this.$route.params.sn || this.outBizSn }
+      hdPrint('', 'export', exportDeleteExcel, params, '采购退货申请单删除产品明细', function () {
         _this.spinning = false
       })
     },

+ 32 - 8
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销中心</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
+        <template slot="extra">
           <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
         </template>
       </a-page-header>
@@ -138,6 +138,7 @@
                 <a-button
                   type="default"
                   id="purchaseReturnEdit-import-btn"
+                  @click="openGuideModal = true"
                   style="margin-right: 10px;">产品导入</a-button>
                 <a-button
                   type="primary"
@@ -209,6 +210,9 @@
         @click="handleSubmit"
         style="padding: 0 60px;">提交</a-button>
     </a-card>
+
+    <!-- 导入明细 -->
+    <importGuideModal :openModal="openGuideModal" :params="{purchaseReturnApplySn: $route.params.sn, purchaseReturnApplyNo:detailData?detailData.purchaseReturnApplyNo:''}" @close="openGuideModal=false" @ok="hanldeImprotOk" />
   </div>
 </template>
 
@@ -218,6 +222,7 @@ import { STable, VSelect } from '@/components'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 import ProductType from '../../common/productType.js'
+import importGuideModal from './importGuideModal.vue'
 import { productList } from '@/api/product'
 import {
   purchaseReturnDetailList,
@@ -228,11 +233,11 @@ import {
   purchaseReturnModifyQty,
   modifyReturnReason,
   purchaseReturnSubmit,
-  purchaseReturnDetailPrint,
-  purchaseReturnDetailExport } from '@/api/purchaseReturnApply'
+  purchaseReturnApplyPrint,
+  purchaseReturnApplyExport } from '@/api/purchaseReturnApply'
 export default {
   name: 'PurchaseReturnEdit',
-  components: { STable, VSelect, Print, ProductType },
+  components: { STable, VSelect, Print, ProductType, importGuideModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -249,6 +254,7 @@ export default {
       returnReasonList: [], // 退货原因列表
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
+      openGuideModal: false, // 导入产品弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -322,17 +328,27 @@ export default {
     handlePrint (type, printerType) {
       const _this = this
       _this.spinning = true
-      let url = purchaseReturnDetailPrint
+      let url = purchaseReturnApplyPrint
       const params = { sn: this.$route.params.sn }
-      params.showFlag = this.$hasPermissions('M_ShowAllCost') ? 1 : 0
       if (type == 'export') { //  导出
-        url = purchaseReturnDetailExport
+        url = purchaseReturnApplyExport
       }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '采购退货单', function () {
+      hdPrint(printerType, type, url, params, '采购退货申请单', function () {
         _this.spinning = false
       })
     },
+    // 确认导入明细
+    hanldeImprotOk (obj) {
+      this.spinning = true
+      salesDetailInsertImport(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.getOrderDetail(false)
+        }
+        this.spinning = false
+      })
+    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
@@ -400,6 +416,10 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
+      if (this.dataSource.length == 0) {
+        this.$message.info('没有可删除的产品')
+        return
+      }
       const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
@@ -426,6 +446,10 @@ export default {
     //  提交
     handleSubmit () {
       const _this = this
+      if (this.dataSource.length == 0) {
+        this.$message.info('请添加产品')
+        return
+      }
       _this.spinning = true
       purchaseReturnSubmit({ sn: _this.$route.params.sn }).then(res => {
         if (res.status == 200) {

+ 202 - 0
src/views/purchasingManagement/purchaseReturnApplyForm/importGuideModal.vue

@@ -0,0 +1,202 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“退货原因”的列,且名称必须相同,其它列可自定义,不影响数据导入</li>
+            <li>2) 如果导入的产品已经存在,则不会导入该行</li>
+          </ul>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="选择导入文件"
+              @remove="resetSearchForm"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 清空数据
+    resetSearchForm () {
+      this.$refs.importUpload.setFileList() //  清空导入文件
+      this.paramsData = null //  清空上传数据
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData && this.paramsData.path) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      console.log(file)
+      if (file) {
+        this.paramsData = {
+          purchaseReturnApplySn: this.params.purchaseReturnApplySn || '',
+          purchaseReturnApplyNo: this.params.purchaseReturnApplyNo || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+    // 下载模板
+    handleExport () {
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/SalesDetailImport.xlsx'
+      link.setAttribute('download', '采购退货申请单产品明细模板' + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+      document.body.removeChild(link)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 2 - 2
src/views/purchasingManagement/purchaseReturnApplyForm/list.vue

@@ -74,7 +74,7 @@
         bordered>
         <!-- 采退单号 -->
         <template slot="purchaseReturnApplyNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_purchaseReturnDetail')" @click="handleDetail(record)">{{ record.purchaseReturnApplyNo }}</span>
+          <span class="table-td-link" v-if="!$hasPermissions('B_purchaseReturnDetail')" @click="handleDetail(record)">{{ record.purchaseReturnApplyNo }}</span>
           <span v-else>{{ record.purchaseReturnApplyNo }}</span>
           <a-badge count="改" :offset="[10,0]" v-if="record.state=='HQ_CHANGE'"></a-badge>
         </template>
@@ -245,7 +245,7 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.purchaseReturnApplySn}` })
+      this.$router.push({ name: 'purchaseReturnApplyFormDetail', params: { sn: row.purchaseReturnApplySn } })
     },
     //  新增/编辑
     handleEdit (row) {

+ 1 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -196,7 +196,7 @@
     <!-- <div class="affix-cont"></div> -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
-    <!-- 导入费用明细 -->
+    <!-- 导入明细 -->
     <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn, salesBillNo:detailData?detailData.salesBillNo:''}" @close="openGuideModal=false" @ok="hanldeImprotOk" />
     <!-- 收付款弹框 -->
     <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>