Jelajahi Sumber

禅道bug修复

jingshuyong 11 bulan lalu
induk
melakukan
e1eee659ca

+ 145 - 110
src/views/productionPlan/components/detail/plan.vue

@@ -5,21 +5,28 @@
       <el-descriptions-item label="计划单号">{{
         productionPlan.code
       }}</el-descriptions-item>
-      <el-descriptions-item :label="'计划数量'">{{ productionPlan.productNum }} {{ clientEnvironmentId == '4' ? '(方)' :
-        productionPlan.measuringUnit }}</el-descriptions-item>
-
+      <!-- <el-descriptions-item :label="'计划数量'">{{ productionPlan.productNum }} {{ clientEnvironmentId == '4' ? '(方)' :
+        productionPlan.measuringUnit }}</el-descriptions-item> -->
+      <el-descriptions-item
+        :label="`计划数量${
+          clientEnvironmentId == '4'
+            ? '(方)'
+            : '(' + productionPlan.measuringUnit + ')'
+        }`"
+        >{{ productionPlan.productNum }}</el-descriptions-item
+      >
       <el-descriptions-item label="计划创建人">{{
         productionPlan.createUserName
       }}</el-descriptions-item>
       <el-descriptions-item label="计划类型">{{
         ['', '内销计划', '外销计划', '预制计划'][productionPlan.planType]
       }}</el-descriptions-item>
-      <el-descriptions-item label="计划重量">{{
-        productionPlan.productNum &&
-        productionPlan.productNum * productionPlan.productUnitWeight
-      }}
+      <el-descriptions-item label="计划重量"
+        >{{
+          productionPlan.productNum &&
+          productionPlan.productNum * productionPlan.productUnitWeight
+        }}
         {{ productionPlan.weightUnit }}
-
       </el-descriptions-item>
 
       <el-descriptions-item label="计划创建时间">{{
@@ -28,20 +35,33 @@
       <el-descriptions-item label="计划完成日期">{{
         productionPlan.planDeliveryTime
       }}</el-descriptions-item>
-      <el-descriptions-item :label="'要求生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')">{{
+      <!-- <el-descriptions-item :label="'要求生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')">{{
         productionPlan.requiredFormingNum }} {{ clientEnvironmentId == '4' ? '(方)' : productionPlan.measuringUnit
-        }}</el-descriptions-item>
-
-      <el-descriptions-item :label="'实际交货数量' + (clientEnvironmentId == '4' ? '(方)' : '')">
+        }}</el-descriptions-item> -->
+      <el-descriptions-item
+        :label="`要求生产数量${
+          clientEnvironmentId == '4'
+            ? '(方)'
+            : '(' + productionPlan.measuringUnit + ')'
+        }`"
+        >{{ productionPlan.requiredFormingNum }}
+      </el-descriptions-item>
+      <el-descriptions-item
+        :label="'实际交货数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
+      >
         {{ productionPlan.deliveryNum }}
       </el-descriptions-item>
       <el-descriptions-item label="实际完成时间">
         {{ productionPlan.completeTime }}
       </el-descriptions-item>
-      <el-descriptions-item label="要求生产重量">{{
-        productionPlan.requiredFormingWeight
-      }} {{ productionPlan.weightUnit }}</el-descriptions-item>
-
+      <!-- <el-descriptions-item label="要求生产重量"
+        >{{ productionPlan.requiredFormingWeight }}
+        {{ productionPlan.weightUnit }}</el-descriptions-item
+      > -->
+      <el-descriptions-item
+        :label="`要求生产重量(${productionPlan.weightUnit})`"
+        >{{ productionPlan.requiredFormingWeight }}</el-descriptions-item
+      >
       <el-descriptions-item label="使用改型">{{
         productionPlan.modification ? '是' : '否'
       }}</el-descriptions-item>
@@ -57,7 +77,7 @@
           productRequirementInfo.productCode
         }}</el-descriptions-item>
         <el-descriptions-item label="牌号">{{
-          productRequirementInfo.bandNo
+          productionPlan.batchNo
         }}</el-descriptions-item>
 
         <el-descriptions-item label="重量单位">{{
@@ -82,130 +102,145 @@
         <el-descriptions-item label="印字要求" :span="2">{{
           productRequirementInfo.printingRequirements
         }}</el-descriptions-item>
-
       </el-descriptions>
     </div>
 
-    <div v-if="infoData.salesOrderList.length">
+    <div v-if="infoData.salesOrderList && infoData.salesOrderList.length">
       <HeaderTitle title="销售订单信息" class="mt-20"> </HeaderTitle>
-      <ele-pro-table ref="table" :columns="columns" :datasource="infoData.salesOrderList">
-
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="infoData.salesOrderList"
+      >
         <template v-slot:contractNum="{ row }">
-          {{ row.contractNum }} {{ row.measuringUnit }}
+          <!-- {{ row.contractNum }} {{ row.measuringUnit }} -->
+          {{ row.contractNum }}
         </template>
 
-
-
         <template v-slot:productSumWeight="{ row }">
           {{ row.productSumWeight }} {{ row.weightUnit }}
         </template>
 
-
         <template v-slot:number="{ row }">
           <div class="progress-box">
             <div class="gress">
-              <el-progress :percentage="+(((row.deliveryNum || 0) / row.contractNum) * 100).toFixed(2)
-                " color="red" :show-text="false" text-color="#000" :stroke-width="16"></el-progress>
+              <el-progress
+                :percentage="
+                  +(((row.deliveryNum || 0) / row.contractNum) * 100).toFixed(2)
+                "
+                color="red"
+                :show-text="false"
+                text-color="#000"
+                :stroke-width="16"
+              ></el-progress>
             </div>
             <div :span="6">{{
               `${row.deliveryNum || 0}/ ${row.contractNum}`
-              }}</div>
+            }}</div>
           </div>
         </template>
+        <template v-slot:headerContractNum="{ column }">
+          <div class="header_required"
+            ><span class="is-required">{{ column.label + `(${productionPlan.measuringUnit})` }}</span></div
+          >
+        </template>
       </ele-pro-table>
     </div>
   </div>
 </template>
 
 <script>
-export default {
-  props: {
-    infoData: {
-      type: Object,
-      default: () => ({})
-    }
-  },
-  computed: {
-    clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
+  export default {
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      }
     },
-    productionPlan() {
-      return this.infoData.productionPlan || {};
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      },
+      productionPlan() {
+        console.log(this.infoData, '2222222');
+        return this.infoData.productionPlan || {};
+      },
+      productRequirementInfo() {
+        return this.infoData.productRequirementInfo || {};
+      }
     },
-    productRequirementInfo() {
-      return this.infoData.productRequirementInfo || {};
+    data() {
+      return {
+        labelName: '订单数量',
+        columns: [
+          {
+            prop: 'code',
+            label: '销售订单',
+            minWidth: 110
+          },
+          {
+            prop: 'lineNumber',
+            label: '行号'
+          },
+          {
+            prop: 'contractNum',
+            slot: 'contractNum',
+             headerSlot: 'headerContractNum',
+            label: `订单数量`
+          },
+          {
+            prop: 'productSumWeight',
+            slot: 'productSumWeight',
+            label: '订单重量'
+          },
+          {
+            prop: 'orderLibraryType',
+            label: '按单按库',
+            formatter: (row) => ['', '按单', '按库'][row.orderLibraryType]
+          },
+          {
+            prop: 'deliveryRequirements',
+            label: '交付要求',
+            formatter: (row) =>
+              ['', '普通', '紧急', '重要'][row.deliveryRequirements]
+          },
+          {
+            prop: 'orderType',
+            label: '订单类型',
+            formatter: (row) =>
+              ['', '内销订单', '外销订单', '预制订单'][row.orderType]
+          },
+          {
+            prop: 'releaseTime',
+            label: '下达时间'
+          },
+          {
+            prop: 'deliveryTime',
+            label: '交付日期'
+          },
+
+          {
+            prop: 'customerName',
+            label: '客户名称'
+          }
+        ]
+      };
     }
-  },
-  data() {
-    return {
-      columns: [
-        {
-          prop: 'code',
-          label: '销售订单',
-          minWidth: 110
-        },
-        {
-          prop: 'lineNumber',
-          label: '行号'
-        },
-        {
-          prop: 'contractNum',
-          slot: 'contractNum',
-          label: '订单数量'
-        },
-        {
-          prop: 'productSumWeight',
-          slot: 'productSumWeight',
-          label: '订单重量'
-        },
-        {
-          prop: 'orderLibraryType',
-          label: '按单按库',
-          formatter: (row) => ['', '按单', '按库'][row.orderLibraryType]
-        },
-        {
-          prop: 'deliveryRequirements',
-          label: '交付要求',
-          formatter: (row) =>
-            ['', '普通', '紧急', '重要'][row.deliveryRequirements]
-        },
-        {
-          prop: 'orderType',
-          label: '订单类型',
-          formatter: (row) =>
-            ['', '内销订单', '外销订单', '预制订单'][row.orderType]
-        },
-        {
-          prop: 'releaseTime',
-          label: '下达时间'
-        },
-        {
-          prop: 'deliveryTime',
-          label: '交付日期'
-        },
-
-        {
-          prop: 'customerName',
-          label: '客户名称'
-        }
-      ]
-    };
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.mt-20 {
-  margin-top: 20px;
-}
+  .mt-20 {
+    margin-top: 20px;
+  }
 
-.progress-box {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
+  .progress-box {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
-  .gress {
-    flex: 1;
-    margin-right: 10px;
+    .gress {
+      flex: 1;
+      margin-right: 10px;
+    }
   }
-}
 </style>

+ 6 - 0
src/views/productionPlan/components/disassemblePlanPop.vue

@@ -176,6 +176,7 @@
   import { getBom, batchSave } from '@/api/productionPlan/index.js';
   import { routeList } from '@/api/saleOrder';
   import EquipmentDialog from './EquipmentDialog.vue';
+  import { start } from 'nprogress';
 
   export default {
     components: {
@@ -375,6 +376,7 @@
     },
     methods: {
       open(row) {
+        console.log(row, 'row 1234');
         this.unit = row.measuringUnit;
         this.formData = deepClone(row);
         this.getBomList();
@@ -449,6 +451,8 @@
           produceRoutingName: row.name || '',
           requiredFormingNum: _num,
           productUnitWeight: m.productUnitWeight,
+          // startTime: this.formData.startTime || '',
+          // endTime: this.formData.endTime || '',
           unit: this.unit,
           resourceType: 0
         };
@@ -580,6 +584,8 @@
             requiredFormingNum: '',
             productUnitWeight: m.productUnitWeight,
             unit: this.unit,
+            // startTime: this.formData.startTime || '',
+            // endTime: this.formData.endTime || '',
             resourceType: 1
           };
         });

+ 23 - 13
src/views/saleOrder/components/order-detail.vue

@@ -20,13 +20,14 @@
         </el-descriptions-item>
         <el-descriptions-item>
           <template slot="label"> 数量</template>
-          {{ form.salesOrderBasicInfo.contractNum }}  {{  form.salesOrderBasicInfo.measuringUnit }}
+          {{ form.salesOrderBasicInfo.contractNum }}
+          {{ form.salesOrderBasicInfo.measuringUnit }}
         </el-descriptions-item>
-       <el-descriptions-item>
+        <el-descriptions-item>
           <template slot="label"> 模数 </template>
           {{ form.salesOrderBasicInfo.moCount }}
         </el-descriptions-item>
-       <el-descriptions-item>
+        <el-descriptions-item>
           <template slot="label"> 块数 </template>
           {{ form.salesOrderBasicInfo.blockCount }}
         </el-descriptions-item>
@@ -44,13 +45,14 @@
         </el-descriptions-item>
         <el-descriptions-item>
           <template slot="label"> 订单重量 </template>
-          {{ form.salesOrderBasicInfo.productSumWeight }}   {{  form.salesOrderBasicInfo.weightUnit }}
+          {{ form.salesOrderBasicInfo.productSumWeight }}
+          {{ form.salesOrderBasicInfo.weightUnit }}
         </el-descriptions-item>
-<!--        <el-descriptions-item>
+        <!--        <el-descriptions-item>
           <template slot="label"> 已交货重量 </template>
           {{ form.salesOrderBasicInfo.deliveredWeight }}
         </el-descriptions-item> -->
-<!--        <el-descriptions-item>
+        <!--        <el-descriptions-item>
           <template slot="label"> 欠交货重量 </template>
           {{ form.salesOrderBasicInfo.backOrderWeight }}
         </el-descriptions-item> -->
@@ -122,7 +124,7 @@
         </el-descriptions-item>
         <el-descriptions-item>
           <template slot="label"> 单重 </template>
-          {{ form.productSpecRequirement.productUnitWeight }}
+          {{ weightUnit(form.productSpecRequirement) }}
         </el-descriptions-item>
         <el-descriptions-item>
           <template slot="label"> 重量单位 </template>
@@ -292,7 +294,7 @@
   import { getSalesDetail } from '@/api/saleOrder';
   export default {
     mixins: [dictMixins],
-    data () {
+    data() {
       return {
         visible: false,
         form: {
@@ -303,8 +305,16 @@
         }
       };
     },
-    computed: {},
-    created () {
+    computed: {
+      weightUnit() {
+        return (row) => {
+          if (row.productUnitWeight) {
+            return `${row.productUnitWeight} ( ${row.unitWeight} )`;
+          }
+        };
+      }
+    },
+    created() {
       this.requestDict('按单按库');
       this.requestDict('交付要求');
       this.requestDict('订单类型');
@@ -313,11 +323,11 @@
       this.requestDict('交货状态');
     },
     methods: {
-      open (row) {
+      open(row) {
         this.getDetail(row.id);
         this.visible = true;
       },
-      getDetail (id) {
+      getDetail(id) {
         getSalesDetail(id).then((res) => {
           if (typeof res.salesOrderBasicInfo != 'string') {
             this.form.salesOrderBasicInfo = res.salesOrderBasicInfo;
@@ -333,7 +343,7 @@
           }
         });
       },
-      cancel () {
+      cancel() {
         this.visible = false;
       }
     }

+ 2 - 2
src/views/saleOrder/index.vue

@@ -31,11 +31,11 @@
         @columns-change="handleColumnChange"
         :cache-key="cacheKeyUrl"
       >
-        <!-- <template v-slot:code="{ row }">
+        <template v-slot:code="{ row }">
           <el-link :underline="false" type="primary" @click="openDetails(row)">
             {{ row.code }}
           </el-link>
-        </template> -->
+        </template>
 
         <template v-slot:priority="{ row }">
           <div style="display: flex">