Kaynağa Gözat

增加导出明细按钮

lichao 3 yıl önce
ebeveyn
işleme
9f9bc3aeb0

+ 18 - 1
src/views/purchaseIssue/index.vue

@@ -272,6 +272,7 @@ import {
   warehouse,
   listDelete,
   tableDeleteQuery,
+  exportDetail,
   confirmDeletion, pleaseCheck, revoke, queryUserVal, getName, revokeBill, copyNew, printingTiem
 } from '@/api/purchaseIssue/index'
 import Cookies from 'js-cookie'
@@ -648,7 +649,7 @@ export default {
           type: 'warning',
           size: 'mini',
           icon: 'el-icon-download',
-          name: '导出',
+          name: '导出明细',
           disabled: false
         },
         // {
@@ -1736,6 +1737,22 @@ export default {
         case '撤销出库':
           this.revocationOfApproval(2)
           break
+        case '导出明细':
+          if (!this.$refs.avatar.form.fId) {
+            this.$message.error('数据未保存,请先保存')
+          } else {
+            let id = this.$refs.avatar.form.fId
+            this.$confirm("是否确认导出销售出库明细?", "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            }).then(function () {
+              return exportDetail({fPid: id})
+            }).then((response) => {
+              this.download(response.msg);
+            });
+          }
+          break
         case '打印':
           // console.log(this.listData.fFeeid,this.contentList)
           this.formList.createBy = Cookies.get('userName')

+ 0 - 70
src/views/warehouse/allocation/index.vue

@@ -1321,14 +1321,12 @@ export default {
           if (this.contentList.length === 0) {
             this.$message.error("请维护明细")
           } else {
-            if (!this.$refs.avatar.form.fId) {
               let formData = new window.FormData()
               formData.append('tWarehousebills', JSON.stringify(Object.assign({},this.$refs.avatar.form, this.formOut, this.formIn)))
               formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
               formData.append('fBilltype', 'DB')
               submit(formData).then(res => {
                 if (res.code == 200) {
-                  console.log(res)
                   if(res){
                     this.$refs.avatar.form = res.data.warehouseBills
                   }
@@ -1398,74 +1396,6 @@ export default {
                   })
                 }
               })
-            } else {
-              let pass = false;
-              this.contentList.forEach(item => {
-                if (item.fGrossweightblc === 0) {
-                  pass = true
-                }
-              })
-              if (pass) {
-                this.$message.error('当前库存数量为0,请修改调拨信息')
-                return
-              }
-              for(let item in this.contentList) {
-                let num = Number(item) + 1
-                if (!this.contentList[item].fUnitprice) {
-                  this.$message.error("请维护第" + num + "行单价")
-                  return false
-                }
-                if(!this.contentList[item].fQty){
-                  this.$message.error("请维护第" + num + "数量")
-                  return false
-                }
-                if (!this.contentList[item].fFeeunitid) {
-                  this.$message.error("请维护第" + num + "行计量单位")
-                  return false
-                }
-                if (!this.contentList[item].fAmount) {
-                  this.$message.error("请维护第" + num + "行金额")
-                  return false
-                }
-              }
-              // fTypeid 1确认 2撤销
-              let data = {
-                fId: this.$refs.avatar.form.fId,
-                fTypeid: 1
-              }
-              isAllocation(data).then(res => {
-                this.contentButton.forEach(item => {
-                  if (item.name === '撤销调拨') {
-                    item.disabled = false
-                  }
-                  if (item.name === '调拨确认' || item.name === '修改' || item.name === '录入明细' || item.name === '保存') {
-                    item.disabled = true
-                  }
-                })
-                selectMessage(this.$refs.avatar.form.fId).then(res => {
-                  this.contentList = res.data.tWarehousebillsfees
-                  this.$refs.avatar.form = res.data.warehouseBills
-                  let data = {
-                    tableName: this.purchaseList.tableName,
-                    userId: Cookies.get('userName')
-                  }
-                  let list = {
-                    warehouseBills:res.data.warehouseBills,
-                    tWarehousebillsfees:res.data.tWarehousebillsfees
-                  }
-                  this.contentOption.forEach(item => {
-                    item.disabled = true
-                  })
-                  this.formDisabled = true
-                  this.getRow(data, list)
-                })
-                this.$message({
-                  message: '调拨成功',
-                  type: 'success',
-                  showClose:true
-                });
-              })
-            }
           }
           break
         case '撤销调拨':