Browse Source

燃损第1版本

fenghaifu 2 years ago
parent
commit
65ba3ecc55
2 changed files with 63 additions and 42 deletions
  1. 6 0
      src/api/reportForms/fabric-loss-table.js
  2. 57 42
      src/views/reportForms/fabric-loss-table.vue

+ 6 - 0
src/api/reportForms/fabric-loss-table.js

@@ -1 +1,7 @@
 /** 报表 -- 面料损耗表 **/
+import { getAction } from '@/api/manage'
+
+// 分页查询 染损列表
+const getFabricLossDatas = params => getAction('report/FabricLoss/getFabricLossDatas', params)
+
+export { getFabricLossDatas }

+ 57 - 42
src/views/reportForms/fabric-loss-table.vue

@@ -1,9 +1,9 @@
 <template>
   <!-- 面料损耗表 -->
-  <div id="fabricLossTable">
+  <div id="fabricLossTable" >
     <!-- 主要信息 点击搜索后 全部回显-->
-    <a-card title="主要信息">
-      <a-row :gutter="24">
+    <a-card title="主要信息" >
+      <a-row :gutter="24" >
         <div class="table-page-search-wrapper">
           <a-form-model layout="inline" ref="form" :model="fabricLoss" :rules="validatorRules">
             <a-col :md="6" :sm="8">
@@ -11,7 +11,6 @@
                 <a-input-search
                   placeholder="请输入计划单号"
                   enter-button
-                  v-model="fabricLoss.planNum"
                   @search="onSearch"
                 />
               </a-form-model-item>
@@ -19,70 +18,70 @@
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="款号" has-feedback>
-                款号68574
+                {{fabricLoss.cdefine22}}
                 <!-- <a-input v-model="fabricLoss.styleNum"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="计划员">
-                此处回显信息
+                {{fabricLoss.planner}}
                 <!-- <a-input v-model="fabricLoss.planner"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="成衣合同号">
-                此处回显信息
+                {{fabricLoss.contractNo}}
                 <!-- <a-input v-model="fabricLoss.garmentContractNo"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="排单数量">
-                此处回显信息
+                {{fabricLoss.number}}
                 <!-- <a-input v-model="fabricLoss.singleRowNum"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="业务员">
-                此处回显信息
+                {{fabricLoss.cpersonName}}
                 <!-- <a-input v-model="fabricLoss.salesman"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="实际单件成本">
-                此处回显信息
+                {{fabricLoss.actualPrice}}
                 <!-- <a-input v-model="fabricLoss.actualUnitCost"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="实际出库数量">
-                此处回显信息
+                {{fabricLoss.outboundNumber}}
                 <!-- <a-input v-model="fabricLoss.actualOutQuantity"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="制单人">
-                此处回显信息
+                {{fabricLoss.makingPeople}}
                 <!-- <a-input v-model="fabricLoss.preparedBy"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="单件成本">
-                此处回显信息
+                {{fabricLoss.price}}
                 <!-- <a-input v-model="fabricLoss.costPerUnit"></a-input> -->
               </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-model-item label="查询日期">
-                此处回显信息
+                {{fabricLoss.dateTime}}
                 <!-- <a-date-picker style="width: 100%" v-model="fabricLoss.queryDate"></a-date-picker> -->
               </a-form-model-item>
             </a-col>
@@ -105,7 +104,7 @@
           :row-key="record => record.id"
           :loading="loading"
           :columns="purchaseOrderColumns"
-          :data-source="purchaseOrderData"
+          :data-source="fabricLoss.fabricPoOrderList"
           bordered
           :pagination="false"
         >
@@ -134,7 +133,7 @@
       <!-- 委外订单国内 -->
       <div class="outsource-orders-table" style="margin:40px 0">
         <h6 class="table-title">委外订单国内</h6>
-        <a-table :columns="outsourceOrderColumns" :data-source="outsourceOrderData" bordered :pagination="false">
+        <a-table :columns="outsourceOrderColumns" :data-source="fabricLoss.fabricOMOrderList1" bordered :pagination="false">
           <!-- 材料出库数量 -->
           <span slot="materialsOutQuantity" slot-scope="text">
             <a>{{ text }}</a>
@@ -154,7 +153,7 @@
           :row-key="record => record.id"
           :loading="loading"
           :columns="outsourceOrderAbroadColumns"
-          :data-source="outsourceOrderAbroadData"
+          :data-source="fabricLoss.fabricOMOrderList2"
           bordered
           :pagination="false"
         >
@@ -346,6 +345,7 @@ import invoiceNumModal from '@views/reportForms/fabric-loss-table/invoiceNumModa
 import invoiceQuantityModal from '@views/reportForms/fabric-loss-table/invoiceQuantityModal.vue'
 import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue'
 import surplusYarnModal from '@views/reportForms/fabric-loss-table/surplusYarnModal.vue'
+import { getFabricLossDatas } from '@api/reportForms/fabric-loss-table'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
@@ -367,37 +367,37 @@ export default {
   },
   data() {
     return {
-      fabricLoss: {}, // 主表信息
+      fabricLoss: {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[]}, // 主表信息
       loading: false, // 表格加载
       validatorRules: {
         planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
       },
       // 采购订单 表头
       purchaseOrderColumns: [
-        { title: '货物名称', width: 120, dataIndex: 'goodsName', className: 'replacecolor' },
-        { title: '批号', width: 120, dataIndex: 'batchNum', className: 'replacecolor' },
-        { title: '计划数量', dataIndex: 'planQuantity', width: 120, className: 'replacecolor' },
+        { title: '货物名称', width: 150, dataIndex: 'cinvName', className: 'replacecolor' },
+        { title: '批号', width: 80, dataIndex: 'cbatch', className: 'replacecolor' },
+        { title: '计划数量', dataIndex: 'iquantity', width: 80, className: 'replacecolor' },
         {
           title: '采购数量',
-          dataIndex: 'purchaseQuantity',
-          width: 120,
+          dataIndex: 'iquantityIn',
+          width: 80,
           className: 'replacecolor',
           customCell: this.purchaseQuantityCustomCell,
           scopedSlots: { customRender: 'purchaseQuantity' }
         },
 
-        { title: '采购供应商', dataIndex: 'purchaseSupplier', width: 120, className: 'replacecolor' },
-        { title: '分配数量', dataIndex: 'allotQuantity', width: 120, className: 'replacecolor' },
-        { title: '委外供应商', dataIndex: 'outsourceSupplier', width: 120, className: 'replacecolor' },
+        { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
+        { title: '分配数量', dataIndex: 'allotQuantity', width: 80, className: 'replacecolor' },
+        { title: '委外供应商', dataIndex: 'outsourceSupplier', width: 100, className: 'replacecolor' },
         {
           title: '余纱',
           dataIndex: 'surplusYarn',
-          width: 120,
+          width: 80,
           className: 'replacecolor',
           customCell: this.surplusYarnCustomCell,
           scopedSlots: { customRender: 'surplusYarn' }
         },
-        { title: '采购损耗', dataIndex: 'purchaseLoss', width: 100, className: 'replacecolor' }
+        { title: '采购损耗', dataIndex: 'purchaseLoss', width: 80, className: 'replacecolor' }
       ],
       purchaseOrderData: [
         {
@@ -428,17 +428,17 @@ export default {
 
       // 委外订单国内 表头
       outsourceOrderColumns: [
-        { title: '制造工艺', width: 120, dataIndex: 'makeWorkmanship', className: 'replacecolor' },
-        { title: '工厂', width: 120, dataIndex: 'factory', className: 'replacecolor' },
+        { title: '制造工艺', width: 100, dataIndex: 'cvcname', className: 'replacecolor' },
+        { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
         {
           title: '材料出库数量',
-          dataIndex: 'materialsOutQuantityData',
-          width: 120,
+          dataIndex: 'ioutQuantity',
+          width: 80,
           className: 'replacecolor',
           customCell: this.materialsOutQuantityCustomCell,
           scopedSlots: { customRender: 'materialsOutQuantity' }
         },
-        { title: '采购数量', dataIndex: 'purchaseAmount', width: 120, className: 'replacecolor' },
+        { title: '委外订单数量', dataIndex: 'iquantity', width: 100, className: 'replacecolor' },
 
         {
           title: '单位',
@@ -461,15 +461,15 @@ export default {
         {
           title: '采购入库数量',
           dataIndex: 'purchaseInQuantity',
-          width: 120,
+          width: 80,
           className: 'replacecolor',
           customCell: this.purchaseInQuantityCustomCell,
           scopedSlots: { customRender: 'purchaseInQuantity' }
         },
-        { title: '物料编码', dataIndex: 'materialCode', width: 120, className: 'replacecolor' },
-        { title: '货物名称', dataIndex: 'goodsName', width: 100, className: 'replacecolor' },
-        { title: '颜色', dataIndex: 'color', width: 120, className: 'replacecolor' },
-        { title: '计划数量', dataIndex: 'planQuantity', width: 120, className: 'replacecolor' },
+        { title: '物料编码', dataIndex: 'cinvCode', width: 100, className: 'replacecolor' },
+        { title: '货物名称', dataIndex: 'cinvName', width: 150, className: 'replacecolor' },
+        { title: '颜色', dataIndex: 'color', width: 80, className: 'replacecolor' },
+        { title: '计划数量', dataIndex: 'planQuantity', width: 80, className: 'replacecolor' },
         { title: '损耗', dataIndex: 'loss', wiclassName: 'replacecolor' },
         { title: '多发少发', dataIndex: 'moreOrLess', width: 100, className: 'replacecolor' }
       ],
@@ -723,8 +723,23 @@ export default {
   methods: {
     // 【计划单号】 搜索
     onSearch(value) {
-      console.log('【计划单号】 ', value)
-      // 根据计划单号查询该页面所有信息且回显
+      if (value == "" || value == null){
+        this.$message.error('请输入计划号!');
+      }else{
+        this.loading = true;
+        this.$nextTick(() => {
+          getFabricLossDatas({csocode:value}).then(res => {
+            this.loading = false;
+            if (res.success) {
+              this.fabricLoss = res.result;
+              // console.log('染损列表', this.dyeLossRateData)
+            }else{
+              this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[]};
+              this.$message.error(res.message);
+            }
+          })
+        })
+      }
     },
     // 【采购数量】单元格 弹框
     purchaseQuantityCustomCell(record) {
@@ -733,12 +748,12 @@ export default {
           click: event => {
             console.log('点击了单元格')
 
-            if (this.purchaseOrderColumns.goodsName == '来源余纱') {
+            if (this.purchaseOrderColumns.cinvName == '来源余纱') {
               console.log('来源余纱this:', this)
               console.log('来源余纱event:', event)
               this.$refs.fromsurplusYarnModal.fromsurplusYarnModVis = true
             }
-            if (this.purchaseOrderColumns.goodsName == '其他入库的纱') {
+            if (this.purchaseOrderColumns.cinvName == '其他入库的纱') {
               console.log('其他入库的纱this:', this)
               console.log('其他入库的纱event:', event)
               this.$refs.otherYarnsInModal.otherYarnsInModVis = true