Sfoglia il codice sorgente

森语-成本分配汇总-详情

jbb 2 anni fa
parent
commit
d1fb52b728

+ 508 - 75
src/views/cost-allocation-total/costDetailDrawer.vue

@@ -59,14 +59,15 @@
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="人民币费用支出" prop="rmbExpense">
-                  <a href="javascript:void(0)" @click="mainTableExpenseCNY()">{{ detailsPlanNum.rmbExpense }}</a>
+                  {{ detailsPlanNum.rmbExpense }}
+                  <!-- <a href="javascript:void(0)" @click="mainTableExpenseCNY()">{{ detailsPlanNum.rmbExpense }}</a> -->
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="8">
+              <!-- <a-col :md="6" :sm="8">
                 <a-form-model-item label="税率%" prop="taxrate">
                   {{ detailsPlanNum.taxrate }}
                 </a-form-model-item>
-              </a-col>
+              </a-col> -->
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="实际出货数量" prop="actualShipquantity">
                   {{ detailsPlanNum.actualShipquantity }}
@@ -79,7 +80,8 @@
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="美元费用支出" prop="usdExpense">
-                  <a href="javascript:void(0)" @click="mainTableExpenseUSD()">{{ detailsPlanNum.usdExpense }}</a>
+                  {{  detailsPlanNum.usdExpense  }}
+                  <!-- <a href="javascript:void(0)" @click="mainTableExpenseUSD()">{{ detailsPlanNum.usdExpense }}</a> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
@@ -97,11 +99,11 @@
                   {{ detailsPlanNum.shortvalue }}
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="8">
+              <!-- <a-col :md="6" :sm="8">
                 <a-form-model-item label="短出面料成本" prop="fabricshortcost">
                   {{ detailsPlanNum.fabricshortcost }}
                 </a-form-model-item>
-              </a-col>
+              </a-col> -->
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="事故单美金金额" prop="accidentUsdamount">
                   {{ detailsPlanNum.accidentUsdamount }}
@@ -163,7 +165,119 @@
       <a-card :bordered="true" style="margin:10px 0">
         <!--tabs 组件引入  style="marginTop:60px;" -->
         <div>
-          <tabs ref="unitTabs" />
+          <a-tabs @change="tabsCallback" :default-active-key="activeKey">
+             <a-tab-pane v-for="(item, index) in tabNameList" :key="index" :tab="item">
+              <div>
+                <h6 class="table-title">面料</h6>
+                <a-table
+                 rowKey="(item)=>item.id"
+                 :loading="loading"
+                 :columns="fabColumns"
+                 :data-source="fabData"
+                 bordered
+                 :pagination="false"
+                 :scroll="{ x: 1500,y:300 }"
+                >
+               </a-table>
+              </div>
+
+              <!-- tabs 辅料   -->
+             <div style="margin:30px 0">
+               <h6 class="table-title">辅料</h6>
+               <a-table
+                 rowKey="(item)=>item.id"
+                :loading="loading"
+                :columns="ingColumns"
+                :data-source="ingData"
+                 bordered
+                :pagination="false"
+                :scroll="{ x: 1000,y:300 }"
+               >
+               </a-table>
+            </div>
+             <!-- tabs 发运明细   :scroll="{ x: 1500 }"-->
+             <div>
+               <h6 class="table-title">发运明细</h6>
+               <a-table
+               rowKey="(item)=>item.id"
+              :loading="loading"
+              :columns="shipColumns"
+               :data-source="shipData"
+              bordered
+             :pagination="false"
+              :scroll="{ x: 1500,y:300 }"
+               >
+              </a-table>
+        </div>
+
+         <!-- tabs 合计 信息 -->
+         <div style="marginTop:30px;">
+          <h6 class="table-title">合计信息</h6>
+          <div style="border: 1px solid #e8e8e8;padding: 20px 20px 0 20px;">
+            <a-row :gutter="24">
+              <div class="table-page-search-wrapper">
+                <a-form layout="inline" class="kk">
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="出货数量合计" >
+                      <span >{{sumInfo.shipQua}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="辅料金额合计">
+                      <span >{{sumInfo.ingAmount}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="辅料不含税金额合计" >
+                      <span >{{sumInfo.ingExcludAmount}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="出运美元外销总价" >
+                      <span>{{sumInfo.exportPriceUSD}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="出运加工费">
+                      <span >{{sumInfo.shipProcesFees}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="面料不含税金额合计">
+                      <span>{{sumInfo.fabricExcludTax}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="出运人民币外销金额">
+                      <span >{{sumInfo.exportedAmountRMB}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="合计金额">
+                      <span >{{sumInfo.amountTotal}}</span>
+                    </a-form-item>
+                  </a-col>
+
+                  <a-col :md="6" :sm="8">
+                    <a-form-item label="面料金额合计" >
+                      <span>{{sumInfo.fabricAmount}}</span>
+                    </a-form-item>
+                  </a-col>
+                </a-form>
+              </div>
+            </a-row>
+          </div>
+        </div>
+              </a-tab-pane>
+          </a-tabs>
+          <!-- <tabs ref="unitTabs" /> -->
         </div>
       </a-card>
 
@@ -178,12 +292,8 @@
             :data-source="accidentListData"
             bordered
             :pagination="false"
-            :scroll="{ y: 300 }"
+            :scroll="{ x: 1500,y:300 }"
           >
-            <!-- 事故单 -->
-            <span slot="accidentNum" slot-scope="text">
-              <a>{{ text }}</a>
-            </span>
           </a-table>
         </div>
 
@@ -195,6 +305,7 @@
             :loading="loading"
             :columns="costPayColumns"
             :data-source="costPayData"
+            :scroll="{ x: 1500,y:300 }"
             bordered
             :pagination="false"
           >
@@ -210,16 +321,6 @@
         </div>
       </a-card>
     </a-drawer>
-
-    <!-- 所有弹框 -->
-    <div>
-      <!-- 主表 人民币费用支出  弹框 -->
-      <mainTableExpenseCNY-modal ref="mainTableExpenseCNYModal" :father="aa"></mainTableExpenseCNY-modal>
-      <!-- 主表 美元费用支出  弹框 -->
-      <mainTableExpenseUSD-modal ref="mainTableExpenseUSDModal" :father="bb"></mainTableExpenseUSD-modal>
-      <!-- 事故单 -->
-      <accidentList-modal ref="accidentListModal" :father="cc"></accidentList-modal>
-    </div>
   </div>
 </template>
 
@@ -227,19 +328,12 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
-
-import tabs from '@views/cost-allocation-total/tabs.vue' // tabs组件
-
-import mainTableExpenseCNYModal from '@views/cost-allocation-total/modal/mainTableExpenseCNYModal.vue'
-import mainTableExpenseUSDModal from '@views/cost-allocation-total/modal/mainTableExpenseUSDModal.vue'
-import accidentListModal from '@views/cost-allocation-total/modal/accidentListModal.vue' // 事故单
-
 import { costByPlanNum } from '@api/document/cost-allocation-total.js'
 
 export default {
   name: 'CostDetailDrawer', // 详情抽屉
   mixins: [JeecgListMixin],
-  components: { JEllipsis, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal },
+  components: { JEllipsis, moment },
 
   data() {
     return {
@@ -254,55 +348,353 @@ export default {
           width: 120,
           dataIndex: 'accidentNum',
           className: 'replacecolor',
-          customCell: this.accidentListCustomCell,
-          scopedSlots: { customRender: 'accidentNum' }
         },
-        { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
-        { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
+        { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker',ellipsis: true, className: 'replacecolor' },
+        { title: '金额', dataIndex: 'amount', width: 120,ellipsis: true, className: 'replacecolor' }
       ],
       accidentListData: [],
 
       // 费用支出 表头
       costPayColumns: [
-        { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
-        { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo', className: 'replacecolor' },
-        { title: '费用项目', dataIndex: 'expenseItem', width: 120, className: 'replacecolor' },
-        { title: ' 支出本币金额', dataIndex: 'disbursedLocalmoney', width: 120, className: 'replacecolor' },
-        { title: '支出原币金额', dataIndex: 'disbursedOriginalmoney', width: 120, className: 'replacecolor' },
-        { title: '发票号', dataIndex: 'invoicenum', width: 120, className: 'replacecolor' },
-        { title: '制单人', dataIndex: 'preparedBy', width: 120, className: 'replacecolor' }
+        { title: '账套号', width: 120, dataIndex: 'setNo',ellipsis: true, className: 'replacecolor' },
+        { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo',ellipsis: true, className: 'replacecolor' },
+        { title: '费用项目', dataIndex: 'expenseItem', width: 120,ellipsis: true, className: 'replacecolor' },
+        { title: ' 支出本币金额', dataIndex: 'disbursedLocalmoney', width: 120,ellipsis: true, className: 'replacecolor' },
+        { title: '支出原币金额', dataIndex: 'disbursedOriginalmoney', width: 120,ellipsis: true, className: 'replacecolor' },
+        { title: '发票号', dataIndex: 'invoicenum', width: 120,ellipsis: true, className: 'replacecolor' },
+        { title: '制单人', dataIndex: 'preparedBy', width: 120,ellipsis: true, className: 'replacecolor' }
+      ],
+      // 面料
+      fabColumns: [
+        {
+          title: '序号',
+          width: 90,
+          dataIndex: 'index',
+          key: 'index',
+          customRender: (text, record, index) => `${index + 1}`,
+          className: 'replacecolor'
+        },
+        { title: '货物名称', width: 160, dataIndex: 'goodsName',ellipsis: true, className: 'replacecolor' },
+        {
+          title: '转入数量',
+          dataIndex: 'fabrictransferQuantity',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor',
+        },
+        {
+          title: '转入成本',
+          dataIndex: 'transferCost',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor',
+          // slots:{title:'transferCostTitle'} ,
+        },
+
+        { title: '单耗/件', dataIndex: 'unitConsumption', width: 120,ellipsis: true, className: 'replacecolor' },
+        { title: '使用数量', dataIndex: 'usageQuantity', width: 120,ellipsis: true, className: 'replacecolor' },
+        { title: '计划数量', dataIndex: 'planQuantity', width: 120,ellipsis: true, className: 'replacecolor' },
+        {
+          title: '购入数量',
+          dataIndex: 'purchaseQuantity',
+          ellipsis: true,
+          width: 120,
+          className: 'replacecolor'
+        },
+        {
+          title: '余下数量',
+          dataIndex: 'fabricremainingQuantity',
+          ellipsis: true,
+          width: 100,
+          className: 'replacecolor',
+        },
+        {
+          title: '损耗',
+          dataIndex: 'loss',
+          ellipsis: true,
+          width: 120,
+          className: 'replacecolor'
+        },
+        {
+          title: '余下数量的成本',
+          dataIndex: 'remainingQuantitycost',
+          ellipsis: true,
+          width: 120,
+          className: 'replacecolor',
+
+        }
+      ],
+       // 辅料
+       ingColumns: [
+        {
+          title: '序号',
+          width: 90,
+          dataIndex: 'index',
+          key: 'index',
+          fixed: 'left',
+          customRender: (text, record, index) => `${index + 1}`,
+          className: 'replacecolor'
+        },
+        { title: '货物名称', width: 200, dataIndex: 'goodsName', fixed: 'left',ellipsis: true, className: 'replacecolor' },
+        {
+          title: '转入数量',
+          dataIndex: 'ingredientsTransferQuantity',
+          width: 150,
+          ellipsis: true,
+          className: 'replacecolor',
+        },
+        {
+          title: '转入成本',
+          dataIndex: 'transferCost',
+          width: 130,
+          ellipsis: true,
+          className: 'replacecolor',
+          // slots:{title:'transferCostTitle'} ,
+        },
+
+        { title: '使用数量', dataIndex: 'usageQuantity',ellipsis: true, width: 120, className: 'replacecolor' },
+        {
+          title: '购入数量',
+          dataIndex: 'purchaseQuantity',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '余下数量',
+          dataIndex: 'ingredientsRemainingQuantity',
+          width: 140,
+          ellipsis: true,
+          className: 'replacecolor',
+        },
+        {
+          title: '损耗',
+          dataIndex: 'loss',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '人民币金额',
+          dataIndex: 'rmbAmount',
+          width: 160,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '美元金额',
+          dataIndex: 'usdAmount',
+          width: 160,
+          ellipsis: true,
+          className: 'replacecolor',
+          customRender: (text, record, index) => {
+            if (record.rmbAmount == record.usdAmount)
+              return "";
+            else
+              return record.usdAmount;
+           } 
+        },
+        {
+          title: '不含税金额',
+          dataIndex: 'priceExcludingtax',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '用量',
+          dataIndex: 'dosage',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor'
+        }
+      ],
+      // 发运明细
+      shipColumns: [
+        {
+          title: '序号',
+          width: 80,
+          dataIndex: 'index',
+          key: 'index',
+          fixed: 'left',
+          ellipsis: true,
+          customRender: (text, record, index) => `${index + 1}`,
+          className: 'replacecolor'
+        },
+        { title: '发票号码', width: 150, dataIndex: 'invoiceNum', fixed: 'left',ellipsis: true, className: 'replacecolor' },
+        {
+          title: '出运日期',
+          dataIndex: 'outdata',
+          width: 120,
+          fixed: 'left',
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '小po',
+          width: 90,
+          dataIndex: 'smallPo',
+          fixed: 'left',
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '汇率',
+          dataIndex: 'exchangeRate',
+          width: 90,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+
+        { title: '订单号', dataIndex: 'orderNum', width: 180,ellipsis: true, className: 'replacecolor' },
+        {
+          title: '产品款号',
+          dataIndex: 'poStyleNum',
+          width: 220,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '出货数量',
+          dataIndex: 'shipQuantity',
+          width: 100,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '外销单价',
+          dataIndex: 'exportUnitPrice',
+          width: 100,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '外销总价',
+          dataIndex: 'exportPrice',
+          width: 100,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '人民币金额',
+          dataIndex: 'rmbAmount',
+          width: 120,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '加工单价(人民币)',
+          dataIndex: 'procesUnitPricermb',
+          width: 150,
+          ellipsis: true,
+          className: 'replacecolor'
+        },
+        {
+          title: '加工单价(美元)',
+          dataIndex: 'procesUnitPriceusd',
+          width: 150,
+          ellipsis: true,
+          className: 'replacecolor',
+          customRender: (text, record, index) => {
+            if (record.procesUnitPricermb == record.procesUnitPriceusd)
+              return "";
+            else
+              return record.procesUnitPriceusd;
+           } 
+        },
+        {
+          title: '加工费',
+          dataIndex: 'processCost',
+          width: 100,
+          ellipsis: true,
+          className: 'replacecolor'
+        }
       ],
+      shipData: [],
+      ingData: [],     
+      fabData: [],
+      sumInfo: {} ,//合计对象
       costPayData: [],
+      tabNameList:[],
+      tabsAllData: [],
       visible: false,
+      activeKey: '0',
       record: {} //点击的计划单号
     }
   },
   created() {
-    this.getALLDetail()
+    // this.getALLDetail()
   },
   methods: {
     // 详情所有数据
-    getALLDetail() {
+    getALLDetail(planNum) {
       this.$nextTick(() => {
         // console.log('详情拿到planNum', this.record.planNum)
-        costByPlanNum({ plannum: this.record.planNum, type: 'query' }).then(res => {
+        costByPlanNum({ plannum:planNum, type: 'query' }).then(res => {
           if (res.success) {
             this.detailsPlanNum = res.result //所有详情
             this.accidentListData = res.result.syCostAllocationAccidentList //事故单
+            this.accidentCalculation(this.accidentListData)
+            var accidentNum = 0
+            this.accidentListData.map(item =>{
+              item.id = accidentNum + 1
+              accidentNum += 1
+            })
             this.costPayData = res.result.syCostAllocationCostpayList //支出费用
-
-            // tabs 名称集合
-            this.$refs.unitTabs.tabNameList = res.result.processUnit.split(',')
-
-            //所有tabs数据
-            this.$refs.unitTabs.tabsAllData = res.result.processUnitList
-
-            // 页面打开加载的数据
-            var oneData = this.$refs.unitTabs.tabsAllData[0]
-            this.$refs.unitTabs.fabData = oneData.syCostAllocationFabricList
-            this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList
-            this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetailList
-
+            var num = 0
+            this.costPayData.map(item =>{
+              item.id = num + 1
+              num += 1
+            })
+            this.tabNameList = res.result.processUnit.split(',')
+            this.tabsAllData = res.result.processUnitList
+            var oneData = this.tabsAllData[0]
+            this.fabData = oneData.syCostAllocationFabricList
+            this.fabData.map(item=>{
+              if(item.remainingQuantitycost!=='' && item.remainingQuantitycost){
+                item.remainingQuantitycost = item.remainingQuantitycost.toFixed(2)
+              }
+            })
+            this.ingData = oneData.syCostAllocationIngredientList
+            this.shipData = oneData.syCostAllocationShipdetail
+            this.calculation(oneData.syCostAllocationShipdetail)
+              //合计中面料相关金额
+              var s=0
+            oneData.syCostAllocationFabricList.map(item=>{
+              s+=Number(item.transferCost)
+            })
+             this.sumInfo.fabricAmount =(this.detailsPlanNum.fabriccostIncludestax!==''&&this.detailsPlanNum.fabriccostIncludestax)?(this.detailsPlanNum.fabriccostIncludestax).toFixed(3):''//合计中的面料总额
+             this.sumInfo.fabricExcludTax = (s/1.13).toFixed(3)//合计中的不含税面料总额
+             
+              //合计中辅料相关金额
+            var s = 0,
+            v =0
+            oneData.syCostAllocationIngredientList.map(item=>{
+              s+=Number(item.priceExcludingtax),
+              v+=Number(item.rmbAmount)
+            })
+            this.sumInfo.ingExcludAmount = s.toFixed(3),//辅料不含税金额合计
+          
+            this.sumInfo.ingAmount =v.toFixed(3)//辅料金额合计
+            debugger
+            //合计中出运明细相关金额
+            var s =0,
+            v = 0,
+            d = 0,
+            b = 0,
+            f=0
+            oneData.syCostAllocationShipdetail.map(item=>{
+              s+=Number(item.exportPrice)
+              v+=Number(item.shipQuantity)
+              d+=Number(item.processCost)
+              b+=Number(item.exportPrice)
+            })
+            this.sumInfo.exportPriceUSD = s.toFixed(3)//出运美元外销总价
+            this.sumInfo.shipQua =v.toFixed(3)//出货数量合计
+            this.sumInfo.shipProcesFees =d.toFixed(3)//出运加工费
+            this.sumInfo.exportedAmountRMB =b.toFixed(3)//出运人民币外销金额 f
+            f=Number(this.sumInfo.ingAmount)+Number(this.sumInfo.shipProcesFees)
+            this.sumInfo.amountTotal =f.toFixed(3)//合计金额
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -313,27 +705,68 @@ export default {
       })
     },
 
-    //  主表:人民币费用支出  弹框
-    mainTableExpenseCNY() {
-      console.log('点击:主表人民币费用支出')
-      this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYModVis = true
+    //计算短出货值
+    calculation(val){
+      var  average = 0
+       val.map(item=>{
+         average += Number(item.exportUnitPrice)
+       })
+       this.detailsPlanNum.shortvalue = (this.detailsPlanNum.shortseveral*average).toFixed(3)
+       var shipQuantityAll =0,
+        exportUnitPriceALll = 0,
+        exportPriceAll =0,
+        rmbAmountAll = 0,
+        procesUnitPricermbAll = 0,
+        procesUnitPriceusdAll = 0,
+        processCostAll = 0
+        val.map(item=>{
+          shipQuantityAll+=Number(item.shipQuantity)
+          exportUnitPriceALll+=Number(item.exportUnitPrice)
+          exportPriceAll+=Number(item.exportPrice)
+          rmbAmountAll+=Number(item.rmbAmount)
+          procesUnitPricermbAll+=Number(item.procesUnitPricermb)
+          procesUnitPriceusdAll+=Number(item.procesUnitPriceusd)
+          processCostAll+=Number(item.processCost)
+        })
+        var allObj ={
+          outdata:'合计',
+          shipQuantity:shipQuantityAll.toFixed(3),
+          exportUnitPrice:exportUnitPriceALll.toFixed(3),
+          exportPrice:exportPriceAll.toFixed(3),
+          rmbAmount:rmbAmountAll.toFixed(3),
+          procesUnitPricermb:procesUnitPricermbAll.toFixed(3),
+          procesUnitPriceusd:procesUnitPriceusdAll.toFixed(3),
+          processCost:processCostAll.toFixed(3)
+        }
+        this.shipData.push(allObj)
     },
-    // 主表:美元费用支出  弹框
-    mainTableExpenseUSD() {
-      console.log('点击:主表美元费用支出')
-      this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDModVis = true
+
+     //计算事故单美元金额和事故单人民币金额
+     accidentCalculation(val){
+      var usaMoney = 0,
+          rmbMoney = 0
+      val.map(item=>{
+        usaMoney += item.amount,
+        rmbMoney+=item.rmbAmount
+      })
+      this.detailsPlanNum.accidentUsdamount = usaMoney
+      this.detailsPlanNum.accidentcnyAmount = usaMoney
     },
 
-    // 事故单 单号 弹框
-    accidentListCustomCell(record) {
-      return {
-        on: {
-          click: event => {
-            console.log('this:', this)
-            // 调用【面料损耗表】中的【事故单】弹框
-            this.$refs.accidentListModal.accidentListModVis = true
-          }
-        }
+    tabsCallback(key) {
+      this.activeKey = key
+      // console.log('点击的是', this.activeKey)
+      if (key == 0) {
+        var oneData = this.tabsAllData[0]
+        this.fabData = oneData.syCostAllocationFabricList
+        this.ingData = oneData.syCostAllocationIngredientList
+        this.shipData = oneData.syCostAllocationShipdetailList
+      }
+      if (key == 1) {
+        var twoData = this.tabsAllData[1]
+        this.fabData = twoData.syCostAllocationFabricList
+        this.ingData = twoData.syCostAllocationIngredientList
+        this.shipData = twoData.syCostAllocationShipdetailList
       }
     },
 

+ 3 - 27
src/views/cost-allocation-total/list.vue

@@ -99,32 +99,8 @@
         :scroll="{ x: 1000 }"
         @change="handleTableChange"
       >
-        <!-- 单据状态 -->
-        <span slot="billstatus" slot-scope="text, record">
-          <a-tag color="orange" v-if="record.billstatus == '0'">未保存</a-tag>
-          <a-tag color="green" v-if="record.billstatus == '1'">仅保存</a-tag>
-          <a-tag color="blue" v-if="record.billstatus == '2'">已审批</a-tag>
-        </span>
-
         <!-- 操作 -->
-
-        <span slot="operationSlot" slot-scope="text, record" v-if="record.billstatus == '1'">
-          <a href="javascript:void(0);" @click="detail(record)">详情</a>
-          <a-divider type="vertical" />
-          <a-popconfirm title="确定审核吗?" ok-text="是" cancel-text="否" @confirm="check(record)">
-            <a href="javascript:void(0);" style="color:green">审核</a>
-          </a-popconfirm>
-        </span>
-
-        <span slot="operationSlot" slot-scope="text, record" v-else-if="record.billstatus == '2'">
-          <a href="javascript:void(0);" @click="detail(record)">详情</a>
-          <a-divider type="vertical" />
-          <a-popconfirm title="确定取消审核吗?" ok-text="是" cancel-text="否" @confirm="cancelCheck(record)">
-            <a href="javascript:void(0);" style="color:red">取消审核</a>
-          </a-popconfirm>
-        </span>
-
-        <span slot="operationSlot" slot-scope="text, record" v-else-if="record.billstatus == '0'">
+        <span slot="option" slot-scope="text, record" >
           <a href="javascript:void(0);" @click="detail(record)">详情</a>
         </span>
       </a-table>
@@ -194,6 +170,7 @@ export default {
         { title: '实际出货数量', width: 120, dataIndex: 'actualShipquantity', ellipsis: true, className: 'replacecolor' },
         { title: '短出数', width: 120, dataIndex: 'shortseveral', ellipsis: true, className: 'replacecolor' },
         { title: '制单人', width: 120, dataIndex: 'preparedBy', ellipsis: true, className: 'replacecolor' },
+        { title: '操作', width: 120, dataIndex: 'option', ellipsis: true, className: 'replacecolor', scopedSlots: { customRender: 'option' } },
       ],
       costAllocationData: [],
       outdata:'',
@@ -236,9 +213,8 @@ export default {
     //  详情
     detail(record) {
       this.$refs.costDetailDrawer.visible = true
-      this.$refs.costDetailDrawer.record = record //接口参数
       // console.log('参数record', this.$refs.costDetailDrawer.record.planNum)
-      this.$refs.costDetailDrawer.getALLDetail()
+      this.$refs.costDetailDrawer.getALLDetail(record.planNum)
     },
     //  审核
     check(record) {