Browse Source

面损表-批量修改单价

jbb 2 years ago
parent
commit
24a263cbfe

+ 30 - 2
src/views/reportForms/fabric-loss-table.vue

@@ -403,7 +403,7 @@
         <iquantityMoreLess-modal ref="iquantityMoreLessModal"></iquantityMoreLess-modal>
 
         <!-- 委外订单国内弹框 -->
-        <materialsOutQuantity-modal ref="materialsOutQuantityModal" :father="cc"></materialsOutQuantity-modal>
+        <materialsOutQuantity-modal ref="materialsOutQuantityModal" :father="cc" @Bulk-price="bulkPrice"></materialsOutQuantity-modal>
 
         <!-- 采购入库数量弹框 -->
         <purchaseInQuantity-modal ref="purchaseInQuantityModal" :father="dd"></purchaseInQuantity-modal>
@@ -975,7 +975,6 @@ export default {
       data.map(item=>{
         if(item.List.length == 0){
            var bb =document.querySelector(item.class)
-           debugger
            console.log(document)
             // bb.className = 'noprint'
         }
@@ -1265,6 +1264,35 @@ export default {
       this.$refs.attachmentDisplay.AttachmentModVis = true
       this.$refs.attachmentDisplay.attachmentData =  attachList;
     },
+    //供应商,颜色,批号
+    bulkPrice(supplier,colour,lotNumber,editPricre){
+      colour=colour? colour : "";
+      lotNumber=lotNumber? lotNumber : "";
+      this.fabricLoss.fabricOMOrderList1.map(item=>{
+        item.fabricMoOrderCKList.map(event=>{
+          if(event.cinvCodeOut == supplier && event.ccolorOut==colour && (event.cvenAbbName == ''|| !event.cvenAbbName)){
+              var length =(lotNumber)? lotNumber.length:0
+              lotNumber = lotNumber?lotNumber:''
+              if(event.cbatchOut.substring(0,length)==lotNumber){
+                event.iprice = editPricre
+              }
+
+          }
+        })
+      })
+      this.fabricLoss.fabricOMOrderList2.map(item=>{
+        item.fabricMoOrderCKList.map(event=>{
+          if(event.cinvCodeOut == supplier && event.ccolorOut==colour && (event.cvenAbbName == ''|| !event.cvenAbbName)){
+              var length =(lotNumber)? lotNumber.length:0
+              lotNumber = lotNumber?lotNumber:''
+              if(event.cbatchOut.substring(0,length)==lotNumber){
+                event.iprice = editPricre
+              }
+
+          }
+        })
+      })
+    },
 
     // father
     aa() {},

+ 79 - 15
src/views/reportForms/fabric-loss-table/materialsOutQuantityModal.vue

@@ -12,31 +12,42 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-            <a-col :md="6" :sm="8">
+            <a-col :md="4" :sm="8">
               <a-form-item label="批号">
                 <a-input placeholder="请输入批号" v-model="queryParam.cbatchOut"></a-input>
               </a-form-item>
             </a-col>
 
-            <a-col :md="6" :sm="8">
+            <a-col :md="4" :sm="8">
               <a-form-item label="供应商">
                 <a-input placeholder="请输入供应商" v-model="queryParam.cvenAbbName"></a-input>
               </a-form-item>
             </a-col>
 
-            <a-col :md="6" :sm="8">
+            <a-col :md="4" :sm="8">
               <a-form-item label="物料编码">
                 <a-input placeholder="请输入物料编码" v-model="queryParam.cinvCodeOut"></a-input>
               </a-form-item>
             </a-col>
+            <a-col :md="4" :sm="8">
+              <a-form-item label="颜色">
+                <a-input placeholder="请输入颜色" v-model="queryParam.colour"></a-input>
+              </a-form-item>
+            </a-col>
             <template v-if="toggleSearchStatus">
-              <a-col :md="6" :sm="8">
+              <a-col :md="4" :sm="8">
                 <a-form-item label="物料名称">
                   <a-input placeholder="请输入物料名称" v-model="queryParam.cinvNameOut"></a-input>
                 </a-form-item>
+              </a-col>
+                <a-col :md="4" :sm="8">
+                <a-form-item label="订单号">
+                  <a-input placeholder="请输入订单号" v-model="queryParam.cplanCode"></a-input>
+                </a-form-item>
+             
               </a-col>
             </template>
-            <a-col :md="6" :sm="8">
+            <a-col :md="8" :sm="8">
               <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                 <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                 <a-button type="primary" icon="download" @click="exportExcel" style="margin-left: 8px">导出</a-button>
@@ -52,9 +63,27 @@
                   
                 </JsonExcel>
                 <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+                <a @click="handleToggleSearch" style="margin-left: 8px">
+                  {{ toggleSearchStatus ? '收起' : '展开' }}
+                  <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                </a>
               </span>
             </a-col>
           </a-row>
+          <a-row :gutter="24">
+            <a-col :md="4" :sm="8">
+              <a-form-item label="">
+                 <a-input placeholder="请输入" v-model="editPricre"></a-input>
+              </a-form-item>
+             
+            </a-col>
+            <a-col :md="4" :sm="8">
+              <a-form-item label="">
+                <a-button type="primary" @click="allEditPrice">批量修改</a-button>
+              </a-form-item>
+             
+            </a-col>
+          </a-row>
         </a-form>
       </div>
 
@@ -100,7 +129,8 @@ export default {
   data() {
     return {
       exportTitle:"材料出库数量",
-      
+      editPricre:'',
+      allowModification:'no',
       // 表头
       materialsOutQuantityColumns: [
         {
@@ -197,10 +227,11 @@ export default {
 
       // 查询条件
       queryParam: {
-        batchNum: '', // 批号
-        supplier: '', // 供应商
-        materialCode: '', // 物料编码
-        materialName: '' // 物料名称
+        cbatchOut: '', // 批号
+        cvenAbbName: '', // 供应商
+        cinvCodeOut: '', // 物料编码
+        colour:'',
+        cinvNameOut: '' // 物料名称
       }
     }
   },
@@ -273,23 +304,55 @@ export default {
       // this.materialsOutQuantityModVis = false
       this.close()
     },
+    allEditPrice(){
+       if(this.queryParam.cinvCodeOut=='' || !this.queryParam.cinvCodeOut){
+        this.$message.error('物料编码不允许为空!' );
+      }else if(this.queryParam.cvenAbbName !=='' && this.queryParam.cvenAbbName){
+        this.$message.error('供应商必须为空!');
+      } else if(this.editPricre ==''){
+        this.$message.error('请输入修改的价格!');
+      }else{           
+        this.allDataList.map(item=>{
+          if(item.cinvCodeOut == this.queryParam.cinvCodeOut && item.ccolorOut==this.queryParam.colour && (item.cvenAbbName == ''|| !item.cvenAbbName)){
+              var length =(this.queryParam.cbatchOut)? this.queryParam.cbatchOut.length:0
+              this.queryParam.cbatchOut = this.queryParam.cbatchOut?this.queryParam.cbatchOut:''
+              if(item.cbatchOut.substring(0,length)==this.queryParam.cbatchOut){
+                item.iprice = this.editPricre
+              }
+
+          }
+        })
+        this.$emit('Bulk-price',this.queryParam.cinvCodeOut,this.queryParam.colour,this.queryParam.cbatchOut,this.editPricre)
+      }
+    },
     // 弹框查询按钮
     searchQuery() {
       this.materialsOutQuantityData = this.allDataList.filter(e=>
-        (this.queryParam.cbatchOut == null || e.cbatchOut.toLowerCase().indexOf(this.queryParam.cbatchOut.toLowerCase())>-1) && 
-        (this.queryParam.cvenAbbName == null || e.cvenAbbName.toLowerCase().indexOf(this.queryParam.cvenAbbName.toLowerCase())>-1) &&
-        (this.queryParam.cinvCodeOut == null || e.cinvCodeOut.toLowerCase().indexOf(this.queryParam.cinvCodeOut.toLowerCase())>-1) &&
-        (this.queryParam.cinvNameOut == null || e.cvenAbbName.toLowerCase().indexOf(this.queryParam.cinvNameOut.toLowerCase())>-1)
+        (!this.queryParam.cbatchOut  || e.cbatchOut.toLowerCase().indexOf(this.queryParam.cbatchOut.toLowerCase())>-1) && 
+        (!this.queryParam.cvenAbbName  || e.cvenAbbName.toLowerCase().indexOf(this.queryParam.cvenAbbName.toLowerCase())>-1) &&
+        (!this.queryParam.cinvCodeOut || e.cinvCodeOut.toLowerCase().indexOf(this.queryParam.cinvCodeOut.toLowerCase())>-1) &&
+        (!this.queryParam.cinvNameOut  || e.cvenAbbName.toLowerCase().indexOf(this.queryParam.cinvNameOut.toLowerCase())>-1)&&
+        (!this.queryParam.colour || e.ccolorOut.indexOf(this.queryParam.colour)>-1)&&
+        (!this.queryParam.cplanCode || e.cplanCode.indexOf(this.queryParam.cplanCode)>-1)
       );
+      this.allowModification = 'yes'
     },
     // 重置
     searchReset() {
-      this.queryParam = {}
+      this.queryParam={
+        cbatchOut: '', // 批号
+        cvenAbbName: '', // 供应商
+        cinvCodeOut: '', // 物料编码
+        colour:'',
+        cinvNameOut: '' // 物料名称
+      }
+      this.materialsOutQuantityData = this.allDataList
       // this.getShipmentList()
     },
     close() {
       this.$emit('close')
       this.materialsOutQuantityModVis = false
+      this.allowModification = 'no'
     },
     showTotal(data) {
       return (
@@ -339,6 +402,7 @@ export default {
  /deep/ .ant-table-footer .ant-table-body {
     overflow: hidden !important;
   }
+
 // /deep/ th.replacecolor {
 //   background-color: #ccc;
 // }