gjy преди 2 години
родител
ревизия
9b3c697d78
променени са 2 файла, в които са добавени 69 реда и са изтрити 21 реда
  1. 0 3
      src/views/statisticalReport/autoSettlementList.vue
  2. 69 18
      src/views/warehousenew/warehousingOrder.vue

+ 0 - 3
src/views/statisticalReport/autoSettlementList.vue

@@ -101,7 +101,6 @@
               !scope.row.actualLosschange && scope.row.actualLoss
             ">{{ scope.row.actualLoss }}</span>
             <input v-if="scope.row.actualLosschange" style="width: 60px" v-model="actualLoss" type="text" />
-            <!--改结算重量-->
             <i @click="changeactualLoss(scope.row)" v-if="
               (scope.row.actualLosschange &&
                 scope.row.status == '待请款') ||
@@ -110,10 +109,8 @@
             " class="iconfont icon-dui"></i>
             <img v-if="
               (!scope.row.actualLosschange &&
-                scope.row.actualLoss &&
                 scope.row.status == '待请款') ||
               (!scope.row.actualLosschange &&
-                scope.row.actualLoss &&
                 scope.row.status == '已驳回')
             " width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
               src="../../../public/img/edit.png" @click="editactualLoss(scope.row)" alt="" />

+ 69 - 18
src/views/warehousenew/warehousingOrder.vue

@@ -111,6 +111,16 @@
         </el-table-column> -->
         <el-table-column prop="goodsName" label="货名" width="50">
         </el-table-column>
+        <!-- <el-table-column prop="inWarehouseWeight1"  width="110" class="table_td" label="加权水分">
+          <template scope="scope">
+            <span v-if='scope.row.edit==false'>{{scope.row.weightedMoisture}}</span>
+            <el-input style='width:80%;' v-if='scope.row.edit' v-model='scope.row.weightedMoisture'></el-input>
+            <i @click="changeMoisture(scope.row)" v-if="
+                scope.row.edit" class="iconfont icon-dui"></i>
+            <img v-if="!scope.row.edit" width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
+              src="../../../public/img/edit.png" @click="editMoisture(scope.row)" alt="" />
+          </template>
+        </el-table-column> -->
         <el-table-column prop="inWarehouseWeight1"  width="110" class="table_td" label="入库重量">
           <template scope="scope">
             <span v-if='scope.row.weightedit==false&&scope.row.warehouseType==2||scope.row.warehouseType==1'>{{scope.row.inWarehouseWeight1}}</span>
@@ -349,7 +359,7 @@
             <el-form-item label="折干前重量(吨)">
               <el-input v-model="fieldrationsList.beforeWeight"></el-input>
             </el-form-item>
-             <el-form-item label="折干前成本(元/吨)">
+             <!-- <el-form-item label="折干前成本(元/吨)">
               <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.beforeCost"></el-input>
             </el-form-item>
             <el-form-item label="折干前仓位">
@@ -361,13 +371,13 @@
                   :value="item.binNumber">
                 </el-option>
               </el-select>
-            </el-form-item>
+            </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-form-item label="折干后成本(元/吨)">
               <el-input disabled  placeholder="自动计算,不可编辑" v-model="fieldrationsList.afterCost"></el-input>
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item label="折干后仓位">
               <el-select @focus="warehousefocus1" @change="warehousechange1" v-model="fieldrationsList.afterBinNo" filterable placeholder="请选择">
                 <el-option
@@ -859,6 +869,9 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       editWeight(row){
         row.weightedit=true
       },
+      editMoisture(row){
+        row.edit=true
+      },
       changeWeight(row){
         if(row.inWarehouseWeight1<row.outWarehouseWeight){
           this.$message({
@@ -880,6 +893,27 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
               })
           })
       },
+      changeMoisture(row){
+        if(row.weightedMoisture<14||row.weightedMoisture>80){
+          this.$message({
+            message: '加权水分输入错误',
+            type: 'warning'
+          });
+          return 
+        }
+        this.$confirm('确定提交入库重量?', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            editwarehousingorder({id:row.id,weightedMoisture:row.weightedMoisture}).toPromise()
+              .then((response) => {
+                // row.weightedit=false
+                this.getList()
+              })
+          })
+      },
       payout(item){
         console.log(item)
         if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
@@ -1003,27 +1037,37 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         let _this= this
         console.log(this.multipleSelection1)
         var arr=[]
+        var arr3=[]
         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(arr3.length==0){
+              arr3.push(array[i])
+            }else{
+              var arr2=arr3.filter((item)=>{return item.warehouseName==array[i].warehouseName})
+              if(arr2.length==0){
+                arr3.push(array[i])
+              }
+            }
           }
           if(array.length>0){
             currectData=array
           }
         }
-        if(arr.length>1){
+        if(currectData.length==0){
           this.$message({
-              message: '一次只可折干一条数据',
+              message: '请选择一条数据!',
               type: 'warning'
             });
             return
         }
+        // console.log(arr1)
         
-        if(currectData.length==0){
+        if(arr3.length>1){
           this.$message({
-              message: '请选择一条数据!',
+              message: '请选择一个仓库的数据进行折干!',
               type: 'warning'
             });
             return
@@ -1038,14 +1082,20 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
             return
           }
+
           // _this.dialogTitle=arr1[i].contractNo
         }
+        var weight=0
+        for (let i = 0; i < this.currectdata.length; i++) {
+          weight+=this.currectdata[i].surplusWeight
+          
+        }
         // this.currectdata=item
         this.currectdata=arr1
-        this.fieldrationsList.id=this.currectdata[0].id
+        this.fieldrationsList.warehousingOrderList=this.currectdata
         this.fieldrationsList.baseId=this.currectdata[0].baseId
-        this.fieldrationsList.beforeWeight=this.currectdata[0].surplusWeight
-        this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
+        this.fieldrationsList.beforeWeight=weight
+        // this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
         this.fieldrationsshow=true
       },
       distribution(){
@@ -1295,13 +1345,13 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
             return
           }
-          if(!this.fieldrationsList.beforeBinNo){
-            this.$message({
-              message: '折干前仓位不能为空',
-              type: 'warning'
-            });
-            return
-          }
+          // if(!this.fieldrationsList.beforeBinNo){
+          //   this.$message({
+          //     message: '折干前仓位不能为空',
+          //     type: 'warning'
+          //   });
+          //   return
+          // }
           if(!this.fieldrationsList.afterWeight){
             this.$message({
               message: '折干后重量不能为空',
@@ -1633,6 +1683,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
                 console.log(response.records[i].warehouseType)
                 data[q].select=false
                 data[q].weightedit=false
+                data[q].edit=false
                 data[q].warehouseType=response.records[i].warehouseType
               }