Преглед на файлове

成本分配表-表头显示/多发少发弹窗

jbb преди 2 години
родител
ревизия
50ac8f3695

+ 144 - 0
src/views/cost-allocation-total/modal/pilosityFewerModal.vue

@@ -0,0 +1,144 @@
+<template>
+  <a-modal
+    title="多发少发"
+    v-model="pilosityFewerModVis"
+    :confirmLoading="confirmLoading"
+    width="86%"
+    style="top:330px;left:100px;minHeight:700px"
+    :footer="null"
+  >
+    <!-- tabel 加载 -->
+    <a-spin :spinning="confirmLoading">
+      <!-- 回显信息  -->
+      <div class="table-page-search-wrapper" style="marginTop:20px;">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
+          <a-row :gutter="24">
+            <a-col :md="6" :sm="8">
+              <a-form-item label="存货名称">
+                <a-input v-model="pilosityFewerList.goodsName"></a-input>
+              </a-form-item>
+            </a-col>
+
+            <a-col :md="6" :sm="8">
+              <a-form-item label="色号">
+                <a-input v-model="pilosityFewerList.color"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="8">
+              <a-form-item label="计划数量">
+                <a-input v-model="pilosityFewerList.planQuantity"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="8">
+              <a-form-item label="购入数量">
+                <a-input v-model="pilosityFewerList.purchaseQuantity"></a-input>
+              </a-form-item>
+            </a-col>
+
+            <a-col :md="6" :sm="8">
+              <a-form-item label="多发少发">
+                <a-input v-model="pilosityFewerList.pilosityFewer"></a-input>
+              </a-form-item>
+            </a-col>
+            <!-- <a-col :md="6" :sm="8">
+              <a-form-item label="备注">
+                <a-input v-model="pilosityFewerList.styleNumber"></a-input>
+              </a-form-item>
+            </a-col> -->
+
+            <a-col :md="24" :sm="24">
+              <a-form-item label="备注" class="noteBg">
+                <a-input type="textarea" v-model="pilosityFewerList.remarks" style="minHeight:100px;"></a-input>
+
+                <!-- 导出 打印 返回  -->
+                <a-row style="marginTop:20px;">
+                  <a-col :md="24" :sm="12">
+                    <span style="float: right;" class="table-operator">
+                      <!-- <a-button type="primary" icon="download" @click="handleExportXls('采购数量')">导出</a-button>
+                      <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button> -->
+                      <a-button type="primary" @click="backFabricLossTable" icon="rollback">返回</a-button>
+                    </span>
+                  </a-col>
+                </a-row>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  name: 'pilosityFewerListModal', // 事故单 弹框
+  components: {},
+  data() {
+    return {
+      loading: false,
+      confirmLoading: false,
+      pilosityFewerModVis: false,
+      pilosityFewerList: []
+    }
+  },
+  // 接收父组件 方法
+  props: {
+    father: {
+      type: Function,
+      default: null
+    }
+  },
+  created() {},
+  methods: {
+    //  导出
+    handleExportXls(fileName) {
+      console.log('需导出的fileName:', fileName)
+      const params = this.dyeLossRateData
+      console.log('导出参数', params)
+      // downFile('/scas/dyeLoss/excel', params).then(data => {
+      //   console.log('888')
+      //   if (!data) {
+      //     this.$message.warning('文件下载失败')
+      //     return
+      //   }
+      //   if (typeof window.navigator.msSaveBlob !== 'undefined') {
+      //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+      //   } else {
+      //     let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+      //     let link = document.createElement('a')
+      //     link.style.display = 'none'
+      //     link.href = url
+      //     link.setAttribute('download', fileName + '.xls')
+      //     document.body.appendChild(link)
+      //     link.click()
+      //     document.body.removeChild(link) // 下载完成移除元素
+      //     window.URL.revokeObjectURL(url) // 释放掉blob对象
+      //   }
+      // })
+    },
+    // 打印
+    print() {},
+    // 返回
+    backFabricLossTable() {
+      console.log('返回到面料损耗表')
+      this.pilosityFewerModVis = false
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+@import '~@assets/less/common.less';
+@import '~@assets/less/overwriter.less';
+/deep/ .ant-table-thead > tr > th {
+  text-align: center;
+  // font-weight: 700;
+}
+
+/deep/ .ant-table-tbody {
+  text-align: center;
+}
+
+// /deep/ th.replacecolor {
+//   background-color: #ccc;
+// }
+</style>

+ 34 - 13
src/views/reportForms/cost-allocation-table.vue

@@ -3,7 +3,7 @@
   <div id="costAllocationTable">
     <a-card :bordered="false">
       <!-- 主表信息 点击搜索后 回显--->
-                <a-row :gutter="24">
+      <a-row :gutter="24">
       <div class="table-page-search-wrapper">
         <!-- ref="form" :model="costAllocationTable" -->
         <a-form-model layout="inline" class="kk">
@@ -193,40 +193,56 @@
            
             
             
-            <a-col :md="6" :sm="8">
+            <!-- <a-col :md="6" :sm="8">
               <a-form-model-item label="面料不含税成本(美元)" prop="UsdfabriccostNotincludestax" >
                 {{ detailsPlanNum.fabriccostNotincludestaxUsd }}
               </a-form-model-item>
-            </a-col>
-           
+            </a-col> -->
+<!--            
             <a-col :md="6" :sm="8">
               <a-form-model-item label="辅料不含税成本(美元)" prop="UsdexcipiencostNotincludestax">
                 {{ detailsPlanNum.excipiencostNotincludestaxUsd }}
               </a-form-model-item>
-            </a-col>
+            </a-col> -->
             
-            <a-col :md="6" :sm="8">
+            <!-- <a-col :md="6" :sm="8">
               <a-form-model-item label="制单人" prop="preparedBy">
                 {{ detailsPlanNum.preparedBy }}
               </a-form-model-item>
-            </a-col>
+            </a-col> -->
 
             <a-col :md="6" :sm="8" class="noprint">
-              <h4 style="color:red;">
+              <a-form-model-item label="" prop="" >
+              <h4 style="color:red;" v-if="color1<0">
+                标记(A)
+                <span>(计算结果是负值时,该标记是红色)</span>
+              </h4>
+              <h4 style="color:black;" v-else>
                 标记(A)
                 <span>(计算结果是负值时,该标记是红色)</span>
               </h4>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8" class="noprint">
-              <h4 style="color:blue;">
+              <a-form-model-item label="" prop="" >
+              <h4 style="color:blue;" v-if="color2<0.8">
                 标记(B)
-                <span>计算结果小于O.8 时,该标记是红色)</span>
+                <span>(计算结果小于O.8 时,该标记是蓝色)</span>
               </h4>
+              <h4 style="color:black;" v-else>
+                标记(B)
+                <span>(计算结果小于O.8 时,该标记是蓝色)</span>
+              </h4>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="8">
+              <a-form-model-item label="备注" prop="UsdfabriccostNotincludestax" >
+                {{ detailsPlanNum.fabriccostNotincludestaxUsd }}
+              </a-form-model-item>
             </a-col>
-
         </a-form-model>
       </div>
-                </a-row>
+      </a-row>
     </a-card>
 
     <!--tabs 组件引入  -->
@@ -434,7 +450,9 @@ export default {
       costPayData: [],
 
       isDisabled: false, //按钮禁止
-      billstatus: '' // 单据状态
+      billstatus: '', // 单据状态
+      color1:0,
+      color2:0,
       // dateFormat: 'YYYY-MM-DD',
     }
   },
@@ -570,6 +588,9 @@ export default {
       this.detailsPlanNum.fabriccostNotincludestax=( this.detailsPlanNum.fabriccostNotincludestax==''|| !this.detailsPlanNum.fabriccostNotincludestax)?'':Number( this.detailsPlanNum.fabriccostNotincludestax).toFixed(2)//面料不含税成本   
       this.detailsPlanNum.excipiencostNotincludestax=( this.detailsPlanNum.excipiencostNotincludestax==''|| !this.detailsPlanNum.excipiencostNotincludestax)?'':Number( this.detailsPlanNum.excipiencostNotincludestax).toFixed(2)//辅料料不含税成本   
       this.detailsPlanNum.salesrrdersOriginaltotal=( this.detailsPlanNum.salesrrdersOriginaltotal==''|| !this.detailsPlanNum.salesrrdersOriginaltotal)?'':Number( this.detailsPlanNum.salesrrdersOriginaltotal).toFixed(2)//销售订单原币金额   
+      this.color1 = Number(this.detailsPlanNum.rmbExportamount)-Number(this.detailsPlanNum.fabriccostNotincludestax)-Number(this.detailsPlanNum.excipiencostNotincludestax)-Number(this.detailsPlanNum.rmbProcesscost)-Number(this.detailsPlanNum.rmbExpense)
+      this.color2 = this.color1/Number(this.detailsPlanNum.usdTotalexportprice)
+      this.color2 = this.color2>0?this.color2:-this.color2
     },
 
     //计算短出货值

+ 28 - 6
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -32,6 +32,10 @@
             <span slot="fabRemaQuaSlot" slot-scope="text">
               <a>{{ Number(text).toFixed(4) }}</a>
             </span>
+            <!-- 余下数量-->
+            <span slot="pilosityFewerSlot" slot-scope="text">
+              <a>{{ Number(text).toFixed(4) }}</a>
+            </span>
             <!-- 备注 -->
             <span slot="remarks" slot-scope="text,record">
               <a-input placeholder="请输入" v-model="record.remarks" v-show='showSelect==0'/>
@@ -180,6 +184,7 @@
       <ingInQua-modal ref="ingInQuaModal" :father="cc"></ingInQua-modal>
       <!-- 余下数量 -->
       <ingRemQua-modal ref="ingRemQuaModal" :father="bb"></ingRemQua-modal>
+      <pilosity-fewer-list-modal ref="pilosityFewerListModal"></pilosity-fewer-list-modal>
     </div>
   </div>
 </template>
@@ -193,6 +198,7 @@ import fabInQuaModal from '@views/cost-allocation-total/modal/fabInQuaModal.vue'
 import fabRemQuaModal from '@views/cost-allocation-total/modal/fabRemQuaModal.vue'
 import ingInQuaModal from '@views/cost-allocation-total/modal/ingInQuaModal.vue'
 import ingRemQuaModal from '@views/cost-allocation-total/modal/ingRemQuaModal.vue'
+import pilosityFewerListModal from '@views/cost-allocation-total/modal/pilosityFewerModal.vue'
 
 export default {
   name: 'UnitTabs', //  Tabs 详情
@@ -203,7 +209,8 @@ export default {
     fabInQuaModal, // 面料 转入数量
     fabRemQuaModal, //  余下数量
     ingInQuaModal, // 辅料 转入数量
-    ingRemQuaModal // 余下数量
+    ingRemQuaModal ,// 余下数量
+    pilosityFewerListModal,//多发少发
   },
   data() {
     // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
@@ -321,11 +328,13 @@ export default {
           dataIndex: 'pilosityFewer',
           width: '9%',
           className: 'replacecolor',
-          customRender: (text, record, index) => {
-            if(text!==''&&text){
-              return Number(text).toFixed(4)
-            }
-          },
+          customCell: this.pilosityFewerCell,
+          scopedSlots: { customRender: 'pilosityFewerSlot' }
+          // customRender: (text, record, index) => {
+          //   if(text!==''&&text){
+          //     return Number(text).toFixed(4)
+          //   }
+          // },
         },
         {
           title: '备注',
@@ -681,6 +690,19 @@ export default {
       }
     },
 
+    //面料-多发少发
+    pilosityFewerCell(){
+      return {
+        on: {
+          click: event => {
+            console.log('面料 - 多发少发')
+            this.$refs.pilosityFewerListModal.pilosityFewerModVis = true
+            this.$refs.pilosityFewerListModal.pilosityFewerList = record.pilosutyFewerList
+          }
+        }
+      }
+    },
+
     // 辅料-转入数量 弹框
     ingInQuaCustomCell(record) {console.log('辅料 - 转入数量')
       return {