瀏覽代碼

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

lilei 2 年之前
父節點
當前提交
5fbaa81f94

+ 10 - 0
src/api/sparePartsReturn.js

@@ -106,3 +106,13 @@ export const sparePartsReturnDetailSave = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+
+// 导出明细
+export const sparePartsReturnExportDetail = (params) => {
+  return axios({
+    url: `/report/sparePartsReturn/exportDetail`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 12 - 12
src/views/purchasingManagement/purchaseReturn/detailModal.vue

@@ -11,11 +11,11 @@
     <div>
     <div>
       <a-descriptions size="small" :column="3" style="margin-bottom: 10px;">
       <a-descriptions size="small" :column="3" style="margin-bottom: 10px;">
         <a-descriptions-item label="采购退货单号">{{ detailsData&&detailsData.sparePartsReturnNo || '--' }}</a-descriptions-item>
         <a-descriptions-item label="采购退货单号">{{ detailsData&&detailsData.sparePartsReturnNo || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="供应商名称">{{ detailsData&&detailsData.supplierName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="退货原因">{{ detailsData&&detailsData.returnReason || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="创建时间">{{ detailsData&&detailsData.returnReason || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="出库时间">{{ detailsData&&detailsData.returnReason || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="业务状态">{{ detailsData&&detailsData.returnReason || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="供应商名称">{{ detailsData&&detailsData.supplier&&detailsData.supplier.supplierName || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="退货原因">{{ detailsData&&detailsData.returnReasonDictValue || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="创建时间">{{ detailsData&&detailsData.createDate || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="出库时间">{{ detailsData&&detailsData.updateDate || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="业务状态">{{ detailsData&&detailsData.stateDictValue || '--' }}</a-descriptions-item>
         <a-descriptions-item label="补充说明" :span="3">{{ detailsData&&detailsData.explainInfo || '--' }}</a-descriptions-item>
         <a-descriptions-item label="补充说明" :span="3">{{ detailsData&&detailsData.explainInfo || '--' }}</a-descriptions-item>
         <a-descriptions-item label="附件" :span="3">
         <a-descriptions-item label="附件" :span="3">
           <span v-if="detailsData&&detailsData.attachmentList&&detailsData.attachmentList.length>0">
           <span v-if="detailsData&&detailsData.attachmentList&&detailsData.attachmentList.length>0">
@@ -35,12 +35,12 @@
       </a-alert>
       </a-alert>
       <s-table
       <s-table
         class="sTable"
         class="sTable"
-        ref="table"
+        ref="tableDetail"
         size="small"
         size="small"
-        :rowKey="(record) => record.stockPutSn"
+        :rowKey="(record) => record.id"
         :columns="columns"
         :columns="columns"
         :data="loadData"
         :data="loadData"
-        :defaultLoadData="false"
+        :defaultLoadData="true"
         bordered>
         bordered>
       </s-table>
       </s-table>
       <div class="btn-cont"><a-button id="confirmationDetail-modal-back" @click="isShow = false">返回列表</a-button></div>
       <div class="btn-cont"><a-button id="confirmationDetail-modal-back" @click="isShow = false">返回列表</a-button></div>
@@ -97,7 +97,7 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'product.unit', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'product.unit', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '批次号', dataIndex: 'sparePartsBatchNo', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库数量', dataIndex: 'putQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库数量', dataIndex: 'putQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货单价', dataIndex: 'cost', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货单价', dataIndex: 'cost', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '申请退货数量', dataIndex: 'qty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '申请退货数量', dataIndex: 'qty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -117,7 +117,7 @@ export default {
     },
     },
     // 获取金额统计
     // 获取金额统计
     getStatisticsData () {
     getStatisticsData () {
-      queryPageCount({ sn: this.itemSn }).then(res => {
+      queryPageCount({ sparePartsReturnSn: this.itemSn }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           res.data.totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? toFixedDecimal(res.data.totalCost, 2) : '--'
           res.data.totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? toFixedDecimal(res.data.totalCost, 2) : '--'
           this.statisticsObj = res.data
           this.statisticsObj = res.data
@@ -136,7 +136,7 @@ export default {
     isShow (newValue, oldValue) {
     isShow (newValue, oldValue) {
       if (!newValue) {
       if (!newValue) {
         this.$emit('close')
         this.$emit('close')
-        this.$refs.table.clearTable()
+        this.$refs.tableDetail.clearTable()
       } else {
       } else {
         this.getStatisticsData()
         this.getStatisticsData()
         this.getBasicsInfo()
         this.getBasicsInfo()
@@ -146,7 +146,7 @@ export default {
       if (this.isShow && newValue) {
       if (this.isShow && newValue) {
         const _this = this
         const _this = this
         setTimeout(() => {
         setTimeout(() => {
-          _this.$refs.table.refresh(true)
+          _this.$refs.tableDetail.refresh(true)
         }, 200)
         }, 200)
       }
       }
     }
     }

+ 14 - 12
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -136,7 +136,7 @@
     <!-- 导出提示框 -->
     <!-- 导出提示框 -->
     <reportModal :visible="showExport" @close="showExport=false"></reportModal>
     <reportModal :visible="showExport" @close="showExport=false"></reportModal>
     <!-- 审核进度弹窗 -->
     <!-- 审核进度弹窗 -->
-    <reviewProgressModal v-drag :itemSn="itemSn" :openModal="openReviewModal" @close="openReviewModal=false"></reviewProgressModal>
+    <reviewProgressModal v-drag :itemSn="itemSn" :auditTime="auditTime" :openModal="openReviewModal" @close="openReviewModal=false"></reviewProgressModal>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
@@ -152,7 +152,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { toFixedDecimal } from '@/libs/tools.js'
 import { toFixedDecimal } from '@/libs/tools.js'
 import supplier from '@/views/common/supplier.js'
 import supplier from '@/views/common/supplier.js'
-import { sparePartsReturnList, sparePartsReturnDelete, sparePartsDetailExport, againSubmit } from '@/api/sparePartsReturn'
+import { sparePartsReturnList, sparePartsReturnDelete, sparePartsReturnExportDetail, againSubmit } from '@/api/sparePartsReturn'
 export default {
 export default {
   name: 'PurchaseReturnList',
   name: 'PurchaseReturnList',
   mixins: [commonMixin],
   mixins: [commonMixin],
@@ -182,7 +182,7 @@ export default {
         { title: '采购退货单号', scopedSlots: { customRender: 'sparePartsReturnNo' }, width: '15%', align: 'center' },
         { title: '采购退货单号', scopedSlots: { customRender: 'sparePartsReturnNo' }, width: '15%', align: 'center' },
         { title: '供应商名称', dataIndex: 'supplier.supplierName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '供应商名称', dataIndex: 'supplier.supplierName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '申请退货数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货金额', dataIndex: 'totalCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '退货金额', dataIndex: 'totalCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } },
         { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -206,7 +206,8 @@ export default {
           return data
           return data
         })
         })
       },
       },
-      itemSn: null // 采购退货SN
+      itemSn: null, // 采购退货SN
+      auditTime: null// 审核时间
     }
     }
   },
   },
   methods: {
   methods: {
@@ -218,14 +219,14 @@ export default {
     //  导出
     //  导出
     handleExport () {
     handleExport () {
       const _this = this
       const _this = this
-      _this.showExport = true
-      // _this.exportLoading = true
-      // _this.spinning = true
-      // hdExportExcel(sparePartsDetailExport, _this.queryParam, '散件入库明细', function () {
-      //   _this.exportLoading = false
-      //   _this.spinning = false
-      //   _this.showExport = true
-      // })
+      _this.exportLoading = true
+      _this.spinning = true
+      _this.queryParam.showCostFlag = this.$hasPermissions('B_isShowCost') ? 1 : 0
+      hdExportExcel(sparePartsReturnExportDetail, _this.queryParam, '采购退货', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.showExport = true
+      })
     },
     },
     //  新增
     //  新增
     handleAdd () {
     handleAdd () {
@@ -242,6 +243,7 @@ export default {
     // 审核进度
     // 审核进度
     handleSH (row) {
     handleSH (row) {
       this.itemSn = row.sparePartsReturnSn
       this.itemSn = row.sparePartsReturnSn
+      this.auditTime = row.submitDate
       this.openReviewModal = true
       this.openReviewModal = true
     },
     },
     // 再次提交
     // 再次提交

+ 18 - 4
src/views/purchasingManagement/purchaseReturn/purchaseReturnDeatil.vue

@@ -37,7 +37,7 @@
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
         <!-- <div>已入库产品信息</div>
         <!-- <div>已入库产品信息</div>
         <a-divider /> -->
         <a-divider /> -->
-        <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct" @bachAdd="saveMoreProduct"></queryPart>
+        <queryPart ref="partQuery" :newLoading="isInster" :addMoreLoading="addMoreLoading" @add="saveProduct" @bachAdd="saveMoreProduct"></queryPart>
       </a-card>
       </a-card>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
         <a-alert style="margin-bottom: 10px;" type="info">
         <a-alert style="margin-bottom: 10px;" type="info">
@@ -247,7 +247,8 @@ export default {
       },
       },
       openModal: false, // 修改信息弹窗
       openModal: false, // 修改信息弹窗
       statisticsObj: null, // 统计明细
       statisticsObj: null, // 统计明细
-      detailsData: null// 基础信息数据
+      detailsData: null, // 基础信息数据
+      addMoreLoading: false// 批量添加动画
     }
     }
   },
   },
   methods: {
   methods: {
@@ -277,18 +278,23 @@ export default {
             _this.$message.info(res.message)
             _this.$message.info(res.message)
             _this.delLoading = false
             _this.delLoading = false
             _this.spinning = false
             _this.spinning = false
+          }).catch(err => {
+            _this.delLoading = false
           })
           })
         }
         }
       })
       })
     },
     },
     resetTable (flag) {
     resetTable (flag) {
       this.$refs.table.refresh(flag)
       this.$refs.table.refresh(flag)
+      this.$refs.partQuery.refreshTable()
     },
     },
     //  重置
     //  重置
     resetSearchForm (flag) {
     resetSearchForm (flag) {
       this.productForm.productName = ''
       this.productForm.productName = ''
       this.productForm.productCode = ''
       this.productForm.productCode = ''
+      this.productForm.sparePartsNo = ''
       this.$refs.table.refresh(!!flag)
       this.$refs.table.refresh(!!flag)
+      this.$refs.partQuery.refreshTable()
     },
     },
     // 已选产品  blur
     // 已选产品  blur
     onCellBlur (val, record) {
     onCellBlur (val, record) {
@@ -336,10 +342,14 @@ export default {
         sparePartsNo: row.sparePartsNo,
         sparePartsNo: row.sparePartsNo,
         sparePartsSn: row.sparePartsSn
         sparePartsSn: row.sparePartsSn
       }
       }
-      this.spinning = true
       this.saveEdit(paramsData)
       this.saveEdit(paramsData)
     },
     },
     saveMoreProduct (data) {
     saveMoreProduct (data) {
+      if (this.addMoreLoading) {
+        // 防止多次添加产品
+        return
+      }
+      this.addMoreLoading = true
       var ajax_data = []
       var ajax_data = []
       data.forEach(item => {
       data.forEach(item => {
         const obj = {
         const obj = {
@@ -364,12 +374,16 @@ export default {
       this.saveEdit(ajax_data)
       this.saveEdit(ajax_data)
     },
     },
     saveEdit (params) {
     saveEdit (params) {
+      this.spinning = true
       sparePartsReturnDetailSave(params).then(res => {
       sparePartsReturnDetailSave(params).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           this.resetSearchForm(true)
           this.resetSearchForm(true)
         }
         }
         this.isInster = false
         this.isInster = false
         this.spinning = false
         this.spinning = false
+        this.addMoreLoading = false
+      }).catch(err => {
+        this.isInster = false
       })
       })
     },
     },
     beforeSubmit () {
     beforeSubmit () {
@@ -401,7 +415,7 @@ export default {
     },
     },
     // 获取页面统计数据
     // 获取页面统计数据
     getStatisticsData () {
     getStatisticsData () {
-      queryPageCount({ sn: this.sparePartsReturnSn }).then(res => {
+      queryPageCount({ sparePartsReturnSn: this.sparePartsReturnSn }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           res.data.totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? toFixedDecimal(res.data.totalCost, 2) : '--'
           res.data.totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? toFixedDecimal(res.data.totalCost, 2) : '--'
           this.statisticsObj = res.data
           this.statisticsObj = res.data

+ 14 - 7
src/views/purchasingManagement/purchaseReturn/queryPart.vue

@@ -30,7 +30,7 @@
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-reset">重置</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-reset">重置</a-button>
             </a-col>
             </a-col>
             <a-col :md="12" :sm="24" style="margin-bottom: 10px;display: flex;align-items: center;">
             <a-col :md="12" :sm="24" style="margin-bottom: 10px;display: flex;align-items: center;">
-              <a-button type="primary" style="margin-right: 5px" @click="handleBatchAdd" :disabled="disabledFlag">批量添加</a-button>
+              <a-button type="primary" style="margin-right: 5px" @click="handleBatchAdd" :loading="addMoreLoading">批量添加</a-button>
               <a-checkbox @change="onChange">
               <a-checkbox @change="onChange">
                 显示最大可退数量为0的产品
                 显示最大可退数量为0的产品
               </a-checkbox>
               </a-checkbox>
@@ -72,7 +72,7 @@
           size="small"
           size="small"
           type="link"
           type="link"
           class="button-info"
           class="button-info"
-          :disabled="newLoading"
+          :loading="newLoading"
           v-if="record.currentStockQty != 0"
           v-if="record.currentStockQty != 0"
           @click="handleAdd(record)"
           @click="handleAdd(record)"
         >添加</a-button>
         >添加</a-button>
@@ -99,6 +99,10 @@ export default {
     showReceiveQty: {
     showReceiveQty: {
       type: Boolean,
       type: Boolean,
       default: false
       default: false
+    },
+    addMoreLoading: {
+      type: Boolean,
+      default: false
     }
     }
   },
   },
   data () {
   data () {
@@ -156,10 +160,14 @@ export default {
     resetSearchForm () {
     resetSearchForm () {
       this.queryParam.productName = ''
       this.queryParam.productName = ''
       this.queryParam.productCode = ''
       this.queryParam.productCode = ''
+      this.queryParam.sparePartsNo = ''
       this.warehousingDate = []
       this.warehousingDate = []
       this.$refs.rangeDate.resetDate(this.warehousingDate)
       this.$refs.rangeDate.resetDate(this.warehousingDate)
       this.$refs.chooseTable.refresh(true)
       this.$refs.chooseTable.refresh(true)
     },
     },
+    refreshTable () {
+      this.$refs.chooseTable.refresh(true)
+    },
     onChange (e) {
     onChange (e) {
       this.queryParam.isZero = e.target.checked ? 1 : 0
       this.queryParam.isZero = e.target.checked ? 1 : 0
       this.refreshData()
       this.refreshData()
@@ -179,14 +187,13 @@ export default {
     },
     },
     rowSelectionFun (obj) {
     rowSelectionFun (obj) {
       this.selectArr = obj.selectedRows
       this.selectArr = obj.selectedRows
-      if (obj && obj.selectedRows.length > 0) {
-        this.disabledFlag = false
-      } else {
-        this.disabledFlag = true
-      }
     },
     },
     // 批量添加
     // 批量添加
     handleBatchAdd () {
     handleBatchAdd () {
+      if (!this.selectArr) {
+        this.$message.warning('请先选择要添加的产品!')
+        return
+      }
       this.$emit('bachAdd', this.selectArr)
       this.$emit('bachAdd', this.selectArr)
     }
     }
   }
   }

+ 6 - 2
src/views/purchasingManagement/purchaseReturn/reviewProgressModal.vue

@@ -8,13 +8,13 @@
     @cancel="isShow=false"
     @cancel="isShow=false"
     width="50%">
     width="50%">
     <p>说明:以下信息来自钉钉</p>
     <p>说明:以下信息来自钉钉</p>
-    <p style="font-weight:bold;">提审时间:2023-01-06 17:56:56</p>
+    <p style="font-weight:bold;">提审时间:{{ auditTime }}</p>
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <s-table
       <s-table
         class="sTable fixPagination"
         class="sTable fixPagination"
         ref="table"
         ref="table"
         size="small"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record,index) => {return index}"
         :columns="columns"
         :columns="columns"
         :data="loadData"
         :data="loadData"
         :scroll="{ y: 500 }"
         :scroll="{ y: 500 }"
@@ -40,6 +40,10 @@ export default {
     itemSn: {
     itemSn: {
       type: [Number, String],
       type: [Number, String],
       default: ''
       default: ''
+    },
+    auditTime: {
+      type: String,
+      default: ''
     }
     }
   },
   },
   data () {
   data () {

+ 2 - 0
src/views/salesManagement/salesQuery/edit.vue

@@ -487,6 +487,8 @@ export default {
           this.spinning = false
           this.spinning = false
         }
         }
         this.isInster = false
         this.isInster = false
+      }).catch(err => {
+        this.isInster = false
       })
       })
     },
     },
     //  销售单详情
     //  销售单详情