浏览代码

修改bug

chenrui 11 月之前
父节点
当前提交
d97babdb58

+ 30 - 5
src/views/purchasingManagement/purchaseReceipt/list.vue

@@ -136,7 +136,7 @@
               @click="handleDel(record)"
               @click="handleDel(record)"
               class="button-error"
               class="button-error"
               id="purchaseReceiptList-del-btn">取消</a-button>
               id="purchaseReceiptList-del-btn">取消</a-button>
-            <a-tooltip placement="left" v-if="$hasPermissions('B_purchaseReceiptTransportNo') && (record.state === 'WAIT_PUT'&&record.thirdpartyBizState==='FINISH')||(record.state === 'FINISH'&&record.thirdpartyBizState==='FINISH')">
+            <!-- <a-tooltip placement="left" >
               <template slot="title">
               <template slot="title">
                 <span>物流单号:{{ record.transportNo||'--' }}</span>
                 <span>物流单号:{{ record.transportNo||'--' }}</span>
               </template>
               </template>
@@ -147,25 +147,37 @@
                 id="purchaseReceiptList-logistics-btn">
                 id="purchaseReceiptList-logistics-btn">
                 物流
                 物流
               </a-button>
               </a-button>
-            </a-tooltip>
+            </a-tooltip> -->
+            <a-button
+              v-if="$hasPermissions('B_purchaseReceiptTransportNo') && (record.state === 'WAIT_PUT'&&record.thirdpartyBizState==='FINISH')||(record.state === 'FINISH'&&record.thirdpartyBizState==='FINISH')"
+              size="small"
+              type="link"
+              class="button-warning"
+              :id="'purchaseReceiptList-logistics-btn'+record.id"
+              @click="handleFlow(record)"
+            >
+              物流
+            </a-button>
             <a-button
             <a-button
               size="small"
               size="small"
               type="link"
               type="link"
               class="button-warning"
               class="button-warning"
               @click="addVoucher(record)"
               @click="addVoucher(record)"
               v-if="$hasPermissions('B_purchaseReceiptAddVoucher') && isShowUploadBtn(record)"
               v-if="$hasPermissions('B_purchaseReceiptAddVoucher') && isShowUploadBtn(record)"
-              id="purchaseReceiptList-addVoucher-btn">上传凭证</a-button>
+              :id="'purchaseReceiptList-addVoucher-btn'+record.id">上传凭证</a-button>
             <a-button
             <a-button
               size="small"
               size="small"
               type="link"
               type="link"
               class="button-warning"
               class="button-warning"
               @click="seeVoucher(record)"
               @click="seeVoucher(record)"
               v-if="$hasPermissions('B_purchaseReceiptSeeVoucher') && isShowCheckBtn(record)"
               v-if="$hasPermissions('B_purchaseReceiptSeeVoucher') && isShowCheckBtn(record)"
-              id="purchaseReceiptList-seeVoucher-btn">查看凭证</a-button>
+              :id="'purchaseReceiptList-seeVoucher-btn'+record.id">查看凭证</a-button>
             <span v-if="(!$hasPermissions('B_purchaseReceiptSeeVoucher')&&!$hasPermissions('B_purchaseReceiptAddVoucher')&&!$hasPermissions('B_purchaseReceiptTransportNo')&&!$hasPermissions('B_purchaseReceiptDel')&&!$hasPermissions('M_purchaseReceiptEdit')&&!$hasPermissions('B_purchaseReceiptAudit'))||isShowNoBtn(record)">--</span>
             <span v-if="(!$hasPermissions('B_purchaseReceiptSeeVoucher')&&!$hasPermissions('B_purchaseReceiptAddVoucher')&&!$hasPermissions('B_purchaseReceiptTransportNo')&&!$hasPermissions('B_purchaseReceiptDel')&&!$hasPermissions('M_purchaseReceiptEdit')&&!$hasPermissions('B_purchaseReceiptAudit'))||isShowNoBtn(record)">--</span>
           </template>
           </template>
         </s-table>
         </s-table>
       </a-spin>
       </a-spin>
+      <!-- 查看物流单号 -->
+      <viewLogistics v-drag :openModal="openFlowModal" :itemNo="noInfo" @close="closeFlowModal"></viewLogistics>
       <!-- 详情弹窗 -->
       <!-- 详情弹窗 -->
       <detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
       <detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
       <!-- 审核弹窗 -->
       <!-- 审核弹窗 -->
@@ -191,12 +203,13 @@ import reviewModal from './reviewModal.vue'
 import detailModal from './detailModal.vue'
 import detailModal from './detailModal.vue'
 import uploadVoucherModal from './uploadVoucherModal.vue'
 import uploadVoucherModal from './uploadVoucherModal.vue'
 import seeVoucherModal from './seeVoucherModal.vue'
 import seeVoucherModal from './seeVoucherModal.vue'
+import viewLogistics from './viewLogisticsModal.vue'
 // 接口
 // 接口
 import { purchaseList, purchasePageCount, purchaseCancel, purchaseAudit } from '@/api/purchase'
 import { purchaseList, purchasePageCount, purchaseCancel, purchaseAudit } from '@/api/purchase'
 export default {
 export default {
   name: 'PurchaseReceiptList',
   name: 'PurchaseReceiptList',
   mixins: [commonMixin],
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, custList, rangeDate, reviewModal, detailModal, uploadVoucherModal, seeVoucherModal },
+  components: { STable, supplier, VSelect, custList, rangeDate, reviewModal, detailModal, uploadVoucherModal, seeVoucherModal, viewLogistics },
   data () {
   data () {
     return {
     return {
       spinning: false,
       spinning: false,
@@ -223,6 +236,8 @@ export default {
       itemSn: null, // 采购入库sn
       itemSn: null, // 采购入库sn
       itemSeeData: null, // 查看凭证数据
       itemSeeData: null, // 查看凭证数据
       totalData: null, // 统计数据
       totalData: null, // 统计数据
+      openFlowModal: false, // 物流弹窗
+      noInfo: '', // 物流单号
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
@@ -431,6 +446,16 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
+    // 打开物流弹窗
+    handleFlow (row) {
+      this.noInfo = row.transportNo
+      this.openFlowModal = true
+    },
+    // 关闭物流弹窗
+    closeFlowModal () {
+      this.noInfo = ''
+      this.openFlowModal = false
+    },
     // 初始化数据
     // 初始化数据
     pageInit () {
     pageInit () {
       const _this = this
       const _this = this

+ 1 - 1
src/views/purchasingManagement/purchaseReceipt/seeVoucherModal.vue

@@ -11,7 +11,7 @@
     <div class="seeVoucher-con">
     <div class="seeVoucher-con">
       <div v-if="itemData&&itemData.length>0" class="seeVoucher-main">
       <div v-if="itemData&&itemData.length>0" class="seeVoucher-main">
         <div v-for="item in itemData" :key="item.id" style="margin-bottom: 10px;">
         <div v-for="item in itemData" :key="item.id" style="margin-bottom: 10px;">
-          <a class="link-bule" v-if="item.extName!='jpg'&&item.extName!='jpeg'&&item.extName!='png'" :href="item.filePath">
+          <a class="link-bule" v-if="item.extName!='jpg'&&item.extName!='jpeg'&&item.extName!='png'" :href="item.filePath.replace('http:', 'https:')">
             <a-icon type="download" style="padding-right: 5px;" />{{ item.fileName }}
             <a-icon type="download" style="padding-right: 5px;" />{{ item.fileName }}
           </a>
           </a>
           <img v-else :src="item.filePath" alt="图片走丢了" width="100%"/>
           <img v-else :src="item.filePath" alt="图片走丢了" width="100%"/>

+ 94 - 0
src/views/purchasingManagement/purchaseReceipt/viewLogisticsModal.vue

@@ -0,0 +1,94 @@
+<template>
+  <a-modal
+    centered
+    class="viewLogistics-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="物流单号"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="360">
+    <div class="viewLogistics-con">
+      <div class="viewLogistics-main">
+        物流单号:{{ itemNo||'--' }}
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          v-if="itemNo"
+          id="viewLogistics-cancel"
+          class="button-cancel"
+          @click="handleCopy">复制</a-button>
+        <a-button
+          v-else
+          id="viewLogistics-cancel"
+          class="button-cancel"
+          @click="isShow=false">关闭</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { Upload } from '@/components'
+export default {
+  name: 'ViewLogisticsModal',
+  components: { Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemNo: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal //  是否打开弹框
+    }
+  },
+  methods: {
+    async handleCopy () {
+      const _this = this
+      try {
+        await navigator.clipboard.writeText(_this.itemNo)
+        _this.$message.success('内容已复制到剪贴板')
+      } catch (err) {
+        _this.$message.error('复制到剪贴板失败', err)
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .viewLogistics-modal{
+    .viewLogistics-con{
+      .viewLogistics-main{
+        padding:10px 20px 20px;
+      }
+     .btn-con{
+       margin: 10px 0 20px;
+       text-align: center;
+       .button-cancel{
+         font-size: 12px;
+       }
+     }
+
+    }
+  }
+</style>