浏览代码

前端入库收购合同

gjy 2 年之前
父节点
当前提交
332395b520

+ 2 - 2
src/views/contractManagement/acquisitionContractAdd.vue

@@ -590,7 +590,7 @@ import { isUndefined } from 'xe-utils/methods'
       },
       returnsales() {
         this.deptBudgetList =  {
-          deliverType: '1',
+          deliverType: '2',
           sourceGoods:'',
           placeDelivery:'',
           addressUrl: '',
@@ -1278,7 +1278,7 @@ import { isUndefined } from 'xe-utils/methods'
                 localStorage.setItem('deptBudgetList_data4', JSON.stringify(this.restaurants4));
                 this.$message.success('添加成功')
                 this.deptBudgetList = {
-                  deliverType: '1',
+                  deliverType: '2',
                   sourceGoods:'',
                   placeDelivery:'',
                   addressUrl: '',

+ 20 - 4
src/views/houseSelfCollect/inspectionManagementNew.vue

@@ -91,7 +91,11 @@
                 </ws-form-item>
                 <ws-form-item label="货名" span="1"
                   prop="inOutTaskNo">
-                  <el-select :disabled='disablednotarize || goodsdisabled' v-model="deptBudgetList.goodsName" clearable
+                  <!-- <el-select :disabled='disablednotarize || goodsdisabled' v-model="deptBudgetList.goodsName" clearable
+                    filterable placeholder="请选择" class="typeselect" @change="goodsNameChange">
+                    <el-option v-for="item in goodnameList" :key="'huoming' + item.id" :label="item.goodsName" :value="item.goodsName" />
+                  </el-select> -->
+                  <el-select disabled v-model="deptBudgetList.goodsName" clearable
                     filterable placeholder="请选择" class="typeselect" @change="goodsNameChange">
                     <el-option v-for="item in goodnameList" :key="'huoming' + item.id" :label="item.goodsName" :value="item.goodsName" />
                   </el-select>
@@ -560,6 +564,7 @@ export default {
       goodsdisabled: false,
       customerName: '',
       customerPhone: '',
+      contractFlag:7,
       deptBudgetList: {
         type: '干粮',
         freight: 0,
@@ -2609,6 +2614,8 @@ export default {
       }
       this.deptBudgetList.warehouseNo = this.warehouseNo
       console.log(this.deptBudgetList, '入库对象')
+      this.deptBudgetList.agent =
+                localStorage.getItem('ws-pf_staffName')
       // return
       this.$confirm(`确定提交入库信息`, {
         cancelButtonText: '取消',
@@ -2632,14 +2639,18 @@ export default {
               if(this.deptBudgetList.id){
                   var zjid=JSON.parse(JSON.stringify(this.deptBudgetList.id))
                   var kid=JSON.parse(JSON.stringify(this.deptBudgetList.warehouseInOutId))
+                  // delete this.deptBudgetList.status
+                  this.$delete(this.deptBudgetList,'status')
+                  // var status=JSON.parse(JSON.stringify(this.deptBudgetList.warehouseInOutId))
                 }
+                // console.log(delete this.deptBudgetList.status)
               if (this.statusTypetext == '初检') {
-                this.deptBudgetList.agent =
-                localStorage.getItem('ws-pf_staffName')
+                
                 
                 if(this.deptBudgetList.id){
                   this.deptBudgetList.id=kid
                 }
+                
                 addstorageputList(this.deptBudgetList)
                   .toPromise()
                   .then((response) => {
@@ -3064,9 +3075,11 @@ export default {
               
             }
             if(this.serviceManagementType==3){
+              this.contractFlag=10
               this.taskflag=3
             }else{
               this.taskflag=2
+              this.contractFlag=7
             }
           getReceiptTaskNo({
             flag: this.taskflag,
@@ -3091,9 +3104,11 @@ export default {
         //   //解决冲突别解决没了(注意)
         this.taskflag=3
         this.outType = '他运'
+        this.contractFlag=10
       } else {
         this.taskflag=2
         this.outType = ''
+        this.contractFlag=7
       }
       console.log(this.taskflag,22222222)
       getReceiptTaskNo({
@@ -3155,6 +3170,7 @@ export default {
           console.log(this.outContractNo[i])
           this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
           this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+          this.goodsNameChange(this.deptBudgetList.goodsName)
           this.deptBudgetList.grade = this.outContractNo[i].grade
           if (this.outContractNo[i].inOutType == '采购入库') {
             this.customerName = this.outContractNo[i].buyer
@@ -3373,7 +3389,7 @@ export default {
       //合同编号
       xialaNo({
         compId: localStorage.getItem('ws-pf_compId'),
-        flag: 7,
+        flag: this.contractFlag,
       })
         .toPromise()
         .then((response) => {

+ 6 - 3
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -1449,13 +1449,15 @@
             type: 'warning',
           })
           .then(() => {
+            this.deptBudgetList.secretaryWeigher =
+                localStorage.getItem('ws-pf_staffName')
             var that = this
             var warehousing = {}
             //贸易入库保存需要再走入库接口
             if (this.inWarehouseType == 1) {
               warehousing = JSON.parse(JSON.stringify(this.weighingList))
               // warehousing = this.weighingList
-              warehousing.secretaryWeigher = localStorage.getItem('ws-pf_staffName')
+              warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
               warehousing.compId = localStorage.getItem('ws-pf_compId')
               warehousing.inOutFlag = 2
               let _data = JSON.parse(
@@ -1474,8 +1476,7 @@
             }
             // 毛重
             if (this.tpyeNo == 1) {
-              this.deptBudgetList.secretaryWeigher =
-                localStorage.getItem('ws-pf_staffName')
+              
               // console.log(this.weighingList)
               if (this.weighingList.customerNumberCard) {
                 //毛检保存前进行校验
@@ -1527,6 +1528,7 @@
                             warehousing.deductionWeight /= 1000
                             warehousing.statusFlag = 1
                             warehousing.inOutFlag = 2
+                            warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
                             warehousing.id = warehousing.warehouseInOutId
                             warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
                             warehousing.weighingManagement = this.weighingList
@@ -1607,6 +1609,7 @@
                   warehousing.inOutFlag = 2
                   delete warehousing.status
                   warehousing.id = warehousing.warehouseInOutId
+                  warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
                   warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
                   warehousing.weighingManagement = this.weighingList
 

+ 208 - 23
src/views/warehousenew/warehousingOrder.vue

@@ -34,6 +34,8 @@
         </ws-button>
         </el-col>
         <el-col style='text-align:right;' :span="12">
+          <ws-button v-hasPermission="
+            `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="fieldrations()" >折干</ws-button>
            <ws-button v-hasPermission="
             `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="distribution()" >预付款分配</ws-button>
         <ws-button v-hasPermission="
@@ -44,16 +46,14 @@
         </el-button> -->
         </el-col>
     </el-row>
-    <div v-for="item in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
+    <div v-for="(item,index) in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
       <div style='width:100%;justify-content:space-between;align-items:center;margin-bottom:10px;' class="flex">
         <div>{{item.issuingTime}}</div>
         <div>{{item.warehouseName}}入库单<span v-if='item.warehouseType==2'>(临)</span></div>
         <div>
           <!-- <ws-button  type="primary" @click="distribution(item)" >预付款分配</ws-button>
         <ws-button type="primary" @click="marginAllocation(item)">保证金分配</ws-button> -->
-            <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="
-            `warehouseManagement.warehousingOrder.appl`
-          ">请款
+            <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="`warehouseManagement.warehousingOrder.appl`">请款
         </ws-button>
          <ws-button v-if='!item.payshow' type="primary" @click="cancel(item)" v-hasPermission="
             `warehouseManagement.warehousingOrder.appl`
@@ -73,7 +73,7 @@
         </ws-button>
         </div>
       </div>
-      <el-table class="wenzi" :data="item.warehousingOrderList" style="width: 100%"  @selection-change="handleSelectionChange($event,item)" >
+      <el-table class="wenzi" :ref="'multipleTable'+index" :data="item.warehousingOrderList" style="width: 100%"  @selection-change="handleSelectionChange($event,item,index)" >
           <el-table-column
           :selectable='selectInit'
       type="selection"
@@ -266,7 +266,7 @@
           <el-button type="primary" @click="distributionsubmit">提交</el-button>
         </span>
       </el-dialog>
-                  <el-dialog
+        <el-dialog
         title="保证金分配"
         :visible.sync="marginshow"
         width="50%"
@@ -318,6 +318,39 @@
           <el-button type="primary" @click="marginsubmit">提交</el-button>
         </span>
       </el-dialog>
+      <el-dialog
+        title="折干"
+        :visible.sync="fieldrationsshow"
+        width="50%"
+        :before-close="handleClose4">
+        <div>
+           <!--插槽会替换title显示的内容 -->
+         <div slot="title" class="header-title">
+            <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
+        </div>
+          <el-form ref="form" :model="form" label-width="120px">
+            <el-form-item label="合同编号">
+              <el-input disabled v-model="form.accumulatedPrepayment"></el-input>
+            </el-form-item>
+            <el-form-item label="折干前重量(吨)">
+              <el-input v-model="fieldrationsList.beforeWeight"></el-input>
+            </el-form-item>
+             <el-form-item label="折干前成本(元/吨)">
+              <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.beforeCost"></el-input>
+            </el-form-item>
+            <el-form-item label="折干后重量(吨)">
+              <el-input @input="afterWeightchange" v-model="fieldrationsList.afterWeight"></el-input>
+            </el-form-item>
+             <el-form-item label="折干后成本(元/吨)">
+              <el-input disabled  placeholder="自动计算,不可编辑" v-model="fieldrationsList.afterCost"></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose4">取消</el-button>
+          <el-button type="primary" @click="fieldrationssubmit">提交</el-button>
+        </span>
+      </el-dialog>
       <!-- <el-dialog
       title="提示"
       :visible.sync="dialogVisible"
@@ -431,7 +464,12 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         },
         // 表格显示数据
         tableDate: [],
-
+        fieldrationsList:{
+          beforeWeight:'',
+          beforeCost:'',
+          afterWeight:'',
+          afterCost:'',
+        },
         // 是否显示
         showType: true,
         dialogVisible:false,
@@ -495,6 +533,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         searchKeyWord: '',
         inOutType:'',
         contractType: 2,
+        fieldrationsshow:false,
         // 提交类型
         submitType: true,
         multipleSelection:[],
@@ -573,13 +612,35 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       selectinOutType(){
         this.getList()
       },
-       handleSelectionChange(val,item) {
+       handleSelectionChange(val,item,index) {
          console.log(val,item)
+         for(let i = 0;i < this.gainList.length; i++){
+          if(this.gainList[i].warehouseName==item.warehouseName){
+            for (let q = 0; q < this.gainList[i].warehousingOrderList.length; q++) {
+              if(!item.payshow){
+                this.gainList[i].warehousingOrderList[q].select=false
+              }
+            }
+          }
+         }
          for (let i = 0; i < val.length; i++) {
            if(!item.payshow){
+            if(val[i].amountNotPayable<=0){
+              this.$message({
+                message: '请选择未付大于零的条目!',
+                type: 'warning'
+              });
+              var that =this
+              setTimeout(()=>{
+              console.log(that.$refs[`multipleTable${index}`][0])
+              that.$refs[`multipleTable${index}`][0].toggleRowSelection(val[i],false);
+            },1000)
+            }else{
               val[i].select=true
+            }
            }
           }
+          console.log(val)
           this.multipleSelection1[item.id]=val
         //  this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
         //  console.log(this.multipleSelection)
@@ -619,6 +680,32 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         console.log(item)
         if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
           if(Object.keys(this.multipleSelection1).length!=0&&this.multipleSelection1[item.id].length>0){
+            for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
+              if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
+                
+                if(this.multipleSelection1[item.id][i].inType=='移库入库'||this.multipleSelection1[item.id][i].inType=='退库入库'){
+                  this.$message({
+                    message: '请选择收购入库或采购入库的条目!',
+                    type: 'warning'
+                  });
+                  return 
+                }
+                if(this.multipleSelection1[item.id][i].amountNotPayable<=0){
+                  this.$message({
+                    message: '请选择未付大于零的条目!',
+                    type: 'warning'
+                  });
+                  return 
+                }
+                if(this.multipleSelection1[item.id][i].amountNotPayable>0&&this.multipleSelection1[item.id][i].approveStatus){
+                  this.$message({
+                    message: '请选择未请款的条目!',
+                    type: 'warning'
+                  });
+                  return 
+                }
+              }
+            }
             item.payshow=false
             for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
               if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
@@ -706,6 +793,53 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         }
         
       },
+      fieldrations(){
+        let _this= this
+        console.log(this.multipleSelection1)
+        var arr=[]
+        var currectData=[]
+        for (const key in this.multipleSelection1) {
+          var array=this.multipleSelection1[key]
+          for (let i = 0; i < array.length; i++) {
+            arr.push(array[i])
+          }
+          if(array.length>0){
+            currectData=array
+          }
+        }
+        if(arr.length>1){
+          this.$message({
+              message: '一次只可折干一条数据',
+              type: 'warning'
+            });
+            return
+        }
+        
+        if(currectData.length==0){
+          this.$message({
+              message: '请选择一条数据!',
+              type: 'warning'
+            });
+            return
+        }
+        // console.log(currectData)
+        var arr1=currectData
+        for (let i = 0; i < arr1.length; i++) {
+          if(arr1[i].goodsName.indexOf('潮粮')){
+            this.$message({
+              message: '只有潮粮可以折干!',
+              type: 'warning'
+            });
+            return
+          }
+          // _this.dialogTitle=arr1[i].contractNo
+        }
+        // this.currectdata=item
+        this.currectdata=arr1
+        this.fieldrationsList.beforeWeight=this.currectdata[0].surplusWeight
+        this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
+        this.fieldrationsshow=true
+      },
       distribution(){
         let _this= this
         console.log(this.multipleSelection1)
@@ -745,7 +879,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
             return
           }
-          if(!arr1[i].contractNo){
+          if(arr1[i].inType!='采购入库'){
             this.$message({
               message: '请选择货源是采购合同的条目',
               type: 'warning'
@@ -790,7 +924,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
     },
       cancel(item){
         item.payshow=true
-        console.log(this.multipleSelection1[item.id])
+
         for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
             if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
               this.multipleSelection1[item.id][i].select=false
@@ -807,19 +941,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       },
       selectInit(row,index){
         if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
-          if(row.inType=='移库入库'||row.inType=='退库入库'){
-            return false
-          }else{
-            if(row.amountNotPayable>0){
-              if(!row.approveStatus){
-                return true
-              }else{
-                return false
-              }
-            }else{
-              return false
-            }
-          }
+          return true
           
         }else if(localStorage.getItem('ws-pf_staffName')=='杜大光'){
           return true
@@ -936,6 +1058,66 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
           })
       },
+      afterWeightchange(e){
+        this.fieldrationsList.afterCost=(Number(this.fieldrationsList.beforeWeight)*Number(this.fieldrationsList.beforeCost))/Number(e)
+      },
+      fieldrationssubmit(){
+        var arr2=this.currectdata
+          if(!this.fieldrationsList.beforeWeight){
+            this.$message({
+              message: '折干前重量不能为空',
+              type: 'warning'
+            });
+            return
+          }
+          if(this.fieldrationsList.beforeWeight<=0){
+            this.$message({
+              message: '折干前重量输入错误',
+              type: 'warning'
+            });
+            return
+          }
+          if(!this.fieldrationsList.afterWeight){
+            this.$message({
+              message: '折干前重量不能为空',
+              type: 'warning'
+            });
+            return
+          }
+          if(this.fieldrationsList.afterWeight<=0){
+            this.$message({
+              message: '折干后重量输入错误',
+              type: 'warning'
+            });
+            return
+          }
+          this.$confirm('确定提交分配金额?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            paymoney({flag:3,money:this.form.distributionIng,warehousingOrderList:arr2,contractId:this.form.contractId}).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '分配成功',
+              type: 'success'
+            });
+            this.form.distributionIng=''
+            this.marginshow=false
+            this.getList()
+          }).catch(() => {
+           this.$message({
+              message: '分配失败',
+              type: 'warning'
+            });
+          })
+          }).catch(() => {
+            // this.$message({
+            //   type: 'info',
+            //   message: '已取消删除'
+            // });          
+          });
+      },
       marginsubmit(item){
         var arr2=this.currectdata
           if(this.form.distributionIng>this.form.distributionCan){
@@ -1363,6 +1545,9 @@ multiFilter(array, filters) {
         this.form.distributionIng=''
         this.marginshow = false
       },
+      handleClose4() {
+        this.fieldrationsshow = false
+      },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)
         this.pageSize = val