فهرست منبع

合并宝悦代码

2213980799@qq.com 1 سال پیش
والد
کامیت
c592e2faa9

+ 99 - 92
src/views/productionPlan/components/detail/plan.vue

@@ -5,9 +5,10 @@
       <el-descriptions-item label="计划单号">{{
         productionPlan.code
       }}</el-descriptions-item>
-      <el-descriptions-item label="计划生产数量(方)">{{
-        productionPlan.productNum
-      }}</el-descriptions-item>
+      <el-descriptions-item
+        :label="'计划生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
+        >{{ productionPlan.productNum }}</el-descriptions-item
+      >
       <!-- <el-descriptions-item label="已交货数量">已交货数量</el-descriptions-item>
       <el-descriptions-item label="未交货数量">未交货数量</el-descriptions-item> -->
       <el-descriptions-item label="计划创建人">{{
@@ -28,16 +29,19 @@
       <el-descriptions-item label="计划完成日期">{{
         productionPlan.planDeliveryTime
       }}</el-descriptions-item>
-      <el-descriptions-item label="要求生产数量(方)">{{
-        productionPlan.requiredFormingNum
-      }}</el-descriptions-item>
+      <el-descriptions-item
+        :label="'要求生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
+        >{{ productionPlan.requiredFormingNum }}</el-descriptions-item
+      >
       <!-- <el-descriptions-item label="已生产数量">已生产数量</el-descriptions-item>
       <el-descriptions-item label="未生产数量">未生产数量</el-descriptions-item> -->
-      <el-descriptions-item label="实际交货数量(方)">
-         {{ productionPlan.deliveryNum}}
+      <el-descriptions-item
+        :label="'实际交货数量' + (clientEnvironmentId == '4' ? '(方)' : '')"
+      >
+        {{ productionPlan.deliveryNum }}
       </el-descriptions-item>
       <el-descriptions-item label="实际完成时间">
-        {{ productionPlan.completeTime}}
+        {{ productionPlan.completeTime }}
       </el-descriptions-item>
       <el-descriptions-item label="要求生产重量">{{
         productionPlan.requiredFormingWeight
@@ -124,94 +128,97 @@
 </template>
 
 <script>
-  export default {
-    props: {
-      infoData: {
-        type: Object,
-        default: () => ({})
-      }
+export default {
+  props: {
+    infoData: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     },
-    computed: {
-      productionPlan () {
-        return this.infoData.productionPlan || {};
-      },
-      productRequirementInfo () {
-        return this.infoData.productRequirementInfo || {};
-      }
+    productionPlan() {
+      return this.infoData.productionPlan || {};
     },
-    data () {
-      return {
-        columns: [
-          {
-            prop: 'code',
-            label: '销售订单',
-            minWidth: 110
-          },
-          {
-            prop: 'lineNumber',
-            label: '行号'
-          },
-          {
-            prop: 'contractNum',
-            label: '合同数量(方)'
-          },
-          {
-            prop: '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: '交付日期'
-          },
-          // {
-          //   action: 'number',
-          //   slot: 'number',
-          //   prop: 'number',
-          //   label: '已交付数量',
-          //   width: 280
-          // },
-          {
-            prop: 'customerName',
-            label: '客户名称'
-          }
-        ]
-      };
+    productRequirementInfo() {
+      return this.infoData.productRequirementInfo || {};
     }
-  };
+  },
+  data() {
+    return {
+      columns: [
+        {
+          prop: 'code',
+          label: '销售订单',
+          minWidth: 110
+        },
+        {
+          prop: 'lineNumber',
+          label: '行号'
+        },
+        {
+          prop: 'contractNum',
+          label: '合同数量'
+        },
+        {
+          prop: '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: '交付日期'
+        },
+        // {
+        //   action: 'number',
+        //   slot: 'number',
+        //   prop: 'number',
+        //   label: '已交付数量',
+        //   width: 280
+        // },
+        {
+          prop: 'customerName',
+          label: '客户名称'
+        }
+      ]
+    };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .mt-20 {
-    margin-top: 20px;
-  }
-  .progress-box {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
+.mt-20 {
+  margin-top: 20px;
+}
+.progress-box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
 
-    .gress {
-      flex: 1;
-      margin-right: 10px;
-    }
+  .gress {
+    flex: 1;
+    margin-right: 10px;
   }
+}
 </style>

+ 35 - 26
src/views/productionPlan/detail.vue

@@ -14,7 +14,11 @@
             :planId="infoData.productionPlan && infoData.productionPlan.id"
           />
         </el-tab-pane>
-        <el-tab-pane label="生产详情表" name="productionDetail">
+        <el-tab-pane
+          label="生产详情表"
+          name="productionDetail"
+          v-if="clientEnvironmentId == 4"
+        >
           <productionDetail
             :planId="infoData.productionPlan && infoData.productionPlan.id"
           />
@@ -29,34 +33,39 @@
 </template>
 
 <script>
-  import plan from './components/detail/plan.vue';
-  import material from './components/detail/material.vue';
-  import productionDetail from './components/detail/productionDetail.vue';
-  // import prod from './components/detail/prod.vue';
-  import { getProductPlanDetail } from '@/api/productionPlan/index';
-  export default {
-    components: { plan, material,productionDetail },
-    data() {
-      return {
-        activeName: 'plan',
-        infoData: {}
-      };
-    },
-    created() {
-      this.getDetail();
-    },
-    methods: {
-      async getDetail() {
-        const data = await getProductPlanDetail(this.$route.params.id);
+import plan from './components/detail/plan.vue';
+import material from './components/detail/material.vue';
+import productionDetail from './components/detail/productionDetail.vue';
+// import prod from './components/detail/prod.vue';
+import { getProductPlanDetail } from '@/api/productionPlan/index';
+export default {
+  components: { plan, material, productionDetail },
+  data() {
+    return {
+      activeName: 'plan',
+      infoData: {}
+    };
+  },
+  created() {
+    this.getDetail();
+  },
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    }
+  },
+  methods: {
+    async getDetail() {
+      const data = await getProductPlanDetail(this.$route.params.id);
 
-        this.infoData = data;
-      }
+      this.infoData = data;
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .pane-box {
-    padding: 20px 0;
-  }
+.pane-box {
+  padding: 20px 0;
+}
 </style>

+ 352 - 353
src/views/productionPlan/index.vue

@@ -45,7 +45,7 @@
             trigger="hover"
             content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
           >
-            <div class="sort-wrap"  slot="reference">
+            <div class="sort-wrap" slot="reference">
               <i class="el-icon-caret-top" @click="sortTop(row)"></i>
               <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
             </div>
@@ -108,193 +108,194 @@
 </template>
 
 <script>
-  import { getList, del, updatePriority } from '@/api/productionPlan/index.js';
-  import productionPlanSearch from './components/productionPlan-search.vue';
-  import { release } from '@/api/productionPlan/order.js';
-  import { multiply } from '@/utils/math';
-  import { getCode } from '@/api/codeManagement';
-  import { debounce } from 'lodash';
-  export default {
-    components: {
-      productionPlanSearch
-    },
-    data() {
-      return {
-        activeName: 'first',
+import { getList, del, updatePriority } from '@/api/productionPlan/index.js';
+import productionPlanSearch from './components/productionPlan-search.vue';
+import { release } from '@/api/productionPlan/order.js';
+import { multiply } from '@/utils/math';
+import { getCode } from '@/api/codeManagement';
+import { debounce } from 'lodash';
+export default {
+  components: {
+    productionPlanSearch
+  },
+  data() {
+    return {
+      activeName: 'first',
 
-        // 加载状态
-        loading: false,
-        pageType: 'add',
-        dialogTitle: '',
-        isBindPlan: false,
-        statusOpt: {
-          first: [
-            { label: '所有状态', value: '3,2' },
-            { label: '待发布', value: '2' },
-            { label: '发布失败', value: '3' }
-          ],
-          second: [
-            { label: '所有状态', value: '7,4,5,6' },
-            { label: '待生产', value: '4' },
-            { label: '生产中', value: '5' },
-            { label: '已完成', value: '6' },
-            { label: '已延期', value: '7' }
-          ]
-        },
-        planType: [
-          { label: '所有计划类型', value: null },
-          { label: '内销计划', value: '1' },
-          { label: '外销计划', value: '2' },
-          { label: '预制计划', value: '3' }
+      // 加载状态
+      loading: false,
+      pageType: 'add',
+      dialogTitle: '',
+      isBindPlan: false,
+      statusOpt: {
+        first: [
+          { label: '所有状态', value: '3,2' },
+          { label: '待发布', value: '2' },
+          { label: '发布失败', value: '3' }
+        ],
+        second: [
+          { label: '所有状态', value: '7,4,5,6' },
+          { label: '待生产', value: '4' },
+          { label: '生产中', value: '5' },
+          { label: '已完成', value: '6' },
+          { label: '已延期', value: '7' }
         ]
-      };
+      },
+      planType: [
+        { label: '所有计划类型', value: null },
+        { label: '内销计划', value: '1' },
+        { label: '外销计划', value: '2' },
+        { label: '预制计划', value: '3' }
+      ]
+    };
+  },
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     },
-    computed: {
-      // 表格列配置
-      columns() {
-        const opt = {
-          first: [
-            // {
-            //   prop: 'deliveryTime',
-            //   label: '预测交货日期',
-            //   align: 'center',
-            //   showOverflowTooltip: true,
-            //   minWidth: 110
-            // }
-          ],
-          second: [
-            // {
-            //   prop: 'formingTime',
-            //   label: '实际生产日期',
-            //   align: 'center',
-            //   showOverflowTooltip: true,
-            //   minWidth: 110
-            // },
-            {
-              prop: 'releaseTime',
-              label: '工单发布日期',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 110
-            },
-            {
-              prop: 'planFormingTime',
-              label: '预测生产日期',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 110
-            },
-            {
-              prop: 'deliveryTime',
-              label: '预测交货日期',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 110
-            },
-            {
-              prop: 'formingTime',
-              label: '实际交货日期',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 110
-            }
-          ]
-        };
-
-        return [
+    // 表格列配置
+    columns() {
+      const opt = {
+        first: [
+          // {
+          //   prop: 'deliveryTime',
+          //   label: '预测交货日期',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // }
+        ],
+        second: [
+          // {
+          //   prop: 'formingTime',
+          //   label: '实际生产日期',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
           {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
+            prop: 'releaseTime',
+            label: '工单发布日期',
             align: 'center',
             showOverflowTooltip: true,
-            fixed: 'left'
+            minWidth: 110
           },
           {
-            slot: 'code',
-            prop: 'code',
-            action: 'code',
-            label: '计划编号',
+            prop: 'planFormingTime',
+            label: '预测生产日期',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 180
+            minWidth: 110
           },
           {
-            prop: 'productCode',
-            label: '产品编码',
+            prop: 'deliveryTime',
+            label: '预测交货日期',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 140
+            minWidth: 110
           },
           {
-            prop: 'productName',
-            label: '产品名称',
+            prop: 'formingTime',
+            label: '实际交货日期',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 140
-          },
+            minWidth: 110
+          }
+        ]
+      };
 
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          slot: 'code',
+          prop: 'code',
+          action: 'code',
+          label: '计划编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
 
-          {
-            prop: 'brandNo',
-            label: '牌号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'batchNo',
-            label: '批号',
-            align: 'center',
-            minWidth: 100,
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'model',
-            label: '型号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-   
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center',
+          minWidth: 100,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'priority',
-            label: '优先级',
-            align: 'center',
-            minWidth: 120,
-            slot: 'priority',
-            sortable: 'custom'
-          },
+        {
+          prop: 'priority',
+          label: '优先级',
+          align: 'center',
+          minWidth: 120,
+          slot: 'priority',
+          sortable: 'custom'
+        },
 
-          {
-            prop: 'productNum',
-            label: '计划数量(方)',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'productWeight',
-            label: '计划重量',
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'productWeight'
-          },
-          {
-            prop: 'requiredFormingNum',
-            label: '要求生产数量(方)',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'productNum',
+          label: '计划数量'+(this.clientEnvironmentId=='4'?'(方)':''),
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'productWeight',
+          label: '计划重量',
+          align: 'center',
+          showOverflowTooltip: true,
+          slot: 'productWeight'
+        },
+        {
+          prop: 'requiredFormingNum',
+          label: '要求生产数量'+(this.clientEnvironmentId=='4'?'(方)':''),
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'newSumOrderWeight',
-            label: '要求生产重量',
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'newSumOrderWeight'
-          },
+        {
+          prop: 'newSumOrderWeight',
+          label: '要求生产重量',
+          align: 'center',
+          showOverflowTooltip: true,
+          slot: 'newSumOrderWeight'
+        },
 
-          {
+        {
           prop: 'moCount',
           label: '模数',
           align: 'center'
@@ -312,208 +313,206 @@
           showOverflowTooltip: true,
           minWidth: 110
         },
-          {
-            prop: 'reqMoldTime',
-            label: '要求生产日期',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
+        {
+          prop: 'reqMoldTime',
+          label: '要求生产日期',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
 
-          ...opt[this.activeName],
+        ...opt[this.activeName],
 
-          {
-            prop: 'orderType',
-            label: '计划类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              const obj = this.planType.find((i) => i.value == row.planType);
-              return obj && obj.label;
-            }
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            columnKey: 'status',
-            slot: 'status',
-            label: '状态',
-            align: 'center',
-            formatter: (row) => {
-              const obj = this.statusOpt[this.activeName].find(
-                (i) => i.value == row.status
-              );
-              return obj && obj.label;
-            }
-          },
-          // ...(this.activeName === 'second'
-          //   ? [
-          //       {
-          //         prop: 'releaseTime',
-          //         label: '发布时间',
-          //         align: 'center',
-          //         showOverflowTooltip: true,
-          //         minWidth: 110
-          //       }
-          //     ]
-          //   : []),
-          ...(this.activeName === 'first'
-            ? [
-                {
-                  columnKey: 'action',
-                  label: '操作',
-                  width: 250,
-                  align: 'center',
-                  resizable: false,
-                  fixed: 'right',
-                  slot: 'action',
-                  showOverflowTooltip: true
-                }
-              ]
-            : [])
-        ];
-      }
-    },
-    methods: {
-      statusFormatter(status) {
-        const obj = this.statusOpt[this.activeName].find(
-          (i) => i.value == status
-        );
-
-        return obj && obj.label;
-      },
-      /* 表格数据源 */
-      datasource({ page, limit, where }) {
-        return getList({
-          pageNum: page,
-          size: limit,
-          ...where,
-          ...this.sort
-        });
-      },
-      // 发布工单
-      handleOrderPublish(type, row) {
-        this.$confirm('发布工单后不可撤回,确定发布吗?', '发布确认')
-          .then(async () => {
-            const loading = this.$loading({
-              lock: true,
-              fullscreen: true,
-              text: '工单发布中...'
-            });
-            try {
-              let code = row.workOrderCode;
-              if (!code) {
-                code = await getCode('product_order_code');
-              }
-              // 反显对象会报错 status
-              const data = await release([row.id]);
-              if (data || data === 0) {
-                this.$message.success('发布成功!');
-              } else {
-                this.$message.error('发布失败,请重新发布!');
+        {
+          prop: 'orderType',
+          label: '计划类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            const obj = this.planType.find((i) => i.value == row.planType);
+            return obj && obj.label;
+          }
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'status',
+          slot: 'status',
+          label: '状态',
+          align: 'center',
+          formatter: (row) => {
+            const obj = this.statusOpt[this.activeName].find(
+              (i) => i.value == row.status
+            );
+            return obj && obj.label;
+          }
+        },
+        // ...(this.activeName === 'second'
+        //   ? [
+        //       {
+        //         prop: 'releaseTime',
+        //         label: '发布时间',
+        //         align: 'center',
+        //         showOverflowTooltip: true,
+        //         minWidth: 110
+        //       }
+        //     ]
+        //   : []),
+        ...(this.activeName === 'first'
+          ? [
+              {
+                columnKey: 'action',
+                label: '操作',
+                width: 250,
+                align: 'center',
+                resizable: false,
+                fixed: 'right',
+                slot: 'action',
+                showOverflowTooltip: true
               }
-              this.reload();
-            } catch (error) {
-              console.error(error);
-            }
-            loading.close();
-          })
-          .catch((err) => {
-            console.error(err);
-          });
+            ]
+          : [])
+      ];
+    }
+  },
+  methods: {
+    statusFormatter(status) {
+      const obj = this.statusOpt[this.activeName].find(
+        (i) => i.value == status
+      );
 
-        // this.$router.push({
-        //   path: '/productionPlan/workOrderPublish',
-        //   query: {
-        //     type,
-        //     id: row.id
-        //   }
-        // });
-      },
-      // 修改计划
-      planEdit({ id }) {
-        this.$router.push({
-          path: '/saleOrder/salesToProduction',
-          query: {
-            type: 'edit',
-            id
+      return obj && obj.label;
+    },
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return getList({
+        pageNum: page,
+        size: limit,
+        ...where,
+        ...this.sort
+      });
+    },
+    // 发布工单
+    handleOrderPublish(type, row) {
+      this.$confirm('发布工单后不可撤回,确定发布吗?', '发布确认')
+        .then(async () => {
+          const loading = this.$loading({
+            lock: true,
+            fullscreen: true,
+            text: '工单发布中...'
+          });
+          try {
+            let code = row.workOrderCode;
+            if (!code) {
+              code = await getCode('product_order_code');
+            }
+            // 反显对象会报错 status
+            const data = await release([row.id]);
+            if (data || data === 0) {
+              this.$message.success('发布成功!');
+            } else {
+              this.$message.error('发布失败,请重新发布!');
+            }
+            this.reload();
+          } catch (error) {
+            console.error(error);
           }
+          loading.close();
+        })
+        .catch((err) => {
+          console.error(err);
         });
-      },
-      handleTabChange() {
-        this.$refs.searchRef.reset();
-      },
 
-      /* 刷新表格 */
-      reload(where) {
-        this.$nextTick(() => {
-          this.$refs.table.reload({ page: 1, where });
-        });
-      },
+      // this.$router.push({
+      //   path: '/productionPlan/workOrderPublish',
+      //   query: {
+      //     type,
+      //     id: row.id
+      //   }
+      // });
+    },
+    // 修改计划
+    planEdit({ id }) {
+      this.$router.push({
+        path: '/saleOrder/salesToProduction',
+        query: {
+          type: 'edit',
+          id
+        }
+      });
+    },
+    handleTabChange() {
+      this.$refs.searchRef.reset();
+    },
 
-      goDetail({ id }) {
-        this.$router.push({
-          path: '/productionPlan/detail/' + id
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() => {
+        this.$refs.table.reload({ page: 1, where });
+      });
+    },
+
+    goDetail({ id }) {
+      this.$router.push({
+        path: '/productionPlan/detail/' + id
+      });
+    },
+    handleDelete({ id }) {
+      this.$confirm('确定删除当前数据?', '提示')
+        .then(async () => {
+          await del(id);
+          this.$message.success('删除成功!');
+          this.reload();
+        })
+        .catch((err) => {
+          console.error(err);
         });
-      },
-      handleDelete({ id }) {
-        this.$confirm('确定删除当前数据?', '提示')
-          .then(async () => {
-            await del(id);
-            this.$message.success('删除成功!');
-            this.reload();
-          })
-          .catch((err) => {
-            console.error(err);
-          });
-      },
+    },
 
-      
-      onSortChange(e) {
-        let sort = {
-          orderBy: e.order,
-          sortName:  e.prop,
-        }
-        this.sort = sort
-        this.reload()
-       
-      },
+    onSortChange(e) {
+      let sort = {
+        orderBy: e.order,
+        sortName: e.prop
+      };
+      this.sort = sort;
+      this.reload();
+    },
 
-      sortTop(row) {
-        row.priority = Number(row.priority) + 1;
-        this.priorityChange(row);
-      },
-      sortBottom(row) {
-        if (row.priority <= 1) {
-          return;
-        }
-        row.priority = Number(row.priority) - 1;
-        this.priorityChange(row);
-      },
+    sortTop(row) {
+      row.priority = Number(row.priority) + 1;
+      this.priorityChange(row);
+    },
+    sortBottom(row) {
+      if (row.priority <= 1) {
+        return;
+      }
+      row.priority = Number(row.priority) - 1;
+      this.priorityChange(row);
+    },
 
-      priorityChange(row) {
-        if (row.priority > 10) {
-          row.priority = 10; // 如果大于 10,则设置为 10
-        } else if (row.priority < 0) {
-          row.priority = 0; // 如果小于 0,则设置为 0
-        }
+    priorityChange(row) {
+      if (row.priority > 10) {
+        row.priority = 10; // 如果大于 10,则设置为 10
+      } else if (row.priority < 0) {
+        row.priority = 0; // 如果小于 0,则设置为 0
+      }
 
-        this.priorityFn(row);
-      },
-      priorityFn: debounce(function (row) {
-        let params = {
-          id: row.id,
-          priority: row.priority
-        };
-        updatePriority(params).then((res) => {});
-      }, 800)
-    }
-  };
+      this.priorityFn(row);
+    },
+    priorityFn: debounce(function (row) {
+      let params = {
+        id: row.id,
+        priority: row.priority
+      };
+      updatePriority(params).then((res) => {});
+    }, 800)
+  }
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 1 - 1
src/views/saleOrder/components/create-order.vue

@@ -87,7 +87,7 @@
         <el-table-column label="重量单位" align="center" prop="weightUnit">
           
         </el-table-column>
-        <el-table-column label="交付数量(方)" align="center" prop="contractNum">
+        <el-table-column label="交付数量" align="center" prop="contractNum">
           <template slot-scope="scope">
             <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.contractNum'" :rules="{
               required: true,

+ 301 - 299
src/views/saleOrder/index.vue

@@ -21,7 +21,7 @@
         :selection.sync="selection"
         cache-key="systemRoleTable1"
         row-key="id"
-        @sort-change="onSortChange"  
+        @sort-change="onSortChange"
       >
         <template v-slot:code="{ row }">
           <el-link :underline="false" @click="openDetails(row)">
@@ -30,13 +30,12 @@
         </template>
 
         <template v-slot:priority="{ row }">
-       
           <el-input
             v-model="row.priority"
             type="number"
             size="mini"
-              :min="0"
-         :max="10"
+            :min="0"
+            :max="10"
             @change="priorityChange(row)"
           ></el-input>
           <el-popover
@@ -45,7 +44,7 @@
             trigger="hover"
             content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
           >
-            <div class="sort-wrap"  slot="reference">
+            <div class="sort-wrap" slot="reference">
               <i class="el-icon-caret-top" @click="sortTop(row)"></i>
               <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
             </div>
@@ -89,323 +88,326 @@
 </template>
 
 <script>
-  import OrderSearch from './components/order-search.vue';
-  import OrderDetail from './components/order-detail.vue';
-  import CreateOrder from './components/create-order.vue';
-  import { getPageList, deleteOrder, updatePriority } from '@/api/saleOrder';
-  import dictMixins from '@/mixins/dictMixins';
-  import { debounce } from 'lodash';
-  export default {
-    name: 'saleOrder',
-    mixins: [dictMixins],
-    components: {
-      OrderSearch,
-      OrderDetail,
-      CreateOrder
-    },
-    data() {
-      return {
-        // 加载状态
-        loading: false,
-        activeName: 'first',
-        selection: []
-      };
+import OrderSearch from './components/order-search.vue';
+import OrderDetail from './components/order-detail.vue';
+import CreateOrder from './components/create-order.vue';
+import { getPageList, deleteOrder, updatePriority } from '@/api/saleOrder';
+import dictMixins from '@/mixins/dictMixins';
+import { debounce } from 'lodash';
+export default {
+  name: 'saleOrder',
+  mixins: [dictMixins],
+  components: {
+    OrderSearch,
+    OrderDetail,
+    CreateOrder
+  },
+  data() {
+    return {
+      // 加载状态
+      loading: false,
+      activeName: 'first',
+      selection: []
+    };
+  },
+
+  computed: {
+    // 表格列配置
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     },
-    computed: {
-      // 表格列配置
-      columns() {
-        const privateColumn = [];
-        if (this.activeName == 'first') {
-          privateColumn.push({
-            columnKey: 'action',
-            label: '操作',
-            width: 150,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true,
-            fixed: 'right'
-          });
-        }
-        return [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'code',
-            label: '销售订单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 150,
-            slot: 'code'
-          },
-          {
-            prop: 'lineNumber',
-            label: '行号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'productCode',
-            label: '产品编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140,
-            sortable: true
-          },
+    columns() {
+      const privateColumn = [];
+      if (this.activeName == 'first') {
+        privateColumn.push({
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        });
+      }
+      return [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center'
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '销售订单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150,
+          slot: 'code'
+        },
+        {
+          prop: 'lineNumber',
+          label: '行号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140,
+          sortable: true
+        },
 
-          {
-            prop: 'productName',
-            label: '产品名称',
-            align: 'center',
-            minWidth: 120
-          },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          minWidth: 120
+        },
 
-          {
-            prop: 'produceRoutingName',
-            label: '工艺路线',
-            align: 'center',
-            minWidth: 120
-          },
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center',
+          minWidth: 120
+        },
 
-          {
-            prop: 'brandNo',
-            label: '牌号',
-            align: 'center'
-          },
-          {
-            prop: 'model',
-            label: '型号',
-            align: 'center',
-            minWidth: 120,
-            sortable: true
-          },
-          {
-            prop: 'priority',
-            label: '优先级',
-            align: 'center',
-            minWidth: 120,
-            slot: 'priority',
-            sortable: 'custom'
-          },
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center'
+        },
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center',
+          minWidth: 120,
+          sortable: true
+        },
+        {
+          prop: 'priority',
+          label: '优先级',
+          align: 'center',
+          minWidth: 120,
+          slot: 'priority',
+          sortable: 'custom'
+        },
 
-          {
-            prop: 'productSumWeight',
-            label: '合同重量',
-            align: 'center',
-            slot: 'productSumWeight'
-          },
-          {
-            prop: 'contractNum',
-            label: '合同数量(方)',
-            align: 'center'
-          },
-          {
-            prop: 'lackNum',
-            label: '欠交数量(方)',
-            align: 'center'
-          },
-          {
+        {
+          prop: 'productSumWeight',
+          label: '合同重量',
+          align: 'center',
+          slot: 'productSumWeight'
+        },
+        {
+          prop: 'contractNum',
+          label: '合同数量'+(this.clientEnvironmentId=='4'?'(方)':''),
+          align: 'center'
+        },
+        {
+          prop: 'lackNum',
+          label: '欠交数量'+(this.clientEnvironmentId=='4'?'(方)':""),
+          align: 'center',
+        },
+        {
           prop: 'moCount',
           label: '模数',
-          align: 'center'
+          align: 'center',
+          show:this.clientEnvironmentId=='4'
         },
         {
           prop: 'blockCount',
           label: '块数',
-          align: 'center'
+          align: 'center',
+          show:this.clientEnvironmentId=='4'
+        },
+        {
+          prop: 'orderLibraryType',
+          label: '按单按库',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return this.getDictValue('按单按库', _row.orderLibraryType);
+          }
+        },
+        {
+          prop: 'deliveryRequirements',
+          label: '交付要求',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return this.getDictValue('交付要求', _row.deliveryRequirements);
+          }
+        },
+        {
+          prop: 'orderType',
+          label: '订单类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return this.getDictValue('订单类型', _row.orderType);
+          }
+        },
+        {
+          prop: 'orderSource',
+          label: '订单来源',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return this.getDictValue('订单来源', _row.orderSource);
+          }
+        },
+        {
+          prop: 'status',
+          label: '生产状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return this.getDictValue('生产状态', _row.status);
+          }
+        },
+        {
+          prop: 'releaseTime',
+          label: '下达时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'deliveryTime',
+          label: '交付日期',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'customerName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true
         },
-          {
-            prop: 'orderLibraryType',
-            label: '按单按库',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('按单按库', _row.orderLibraryType);
-            }
-          },
-          {
-            prop: 'deliveryRequirements',
-            label: '交付要求',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('交付要求', _row.deliveryRequirements);
-            }
-          },
-          {
-            prop: 'orderType',
-            label: '订单类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('订单类型', _row.orderType);
-            }
-          },
-          {
-            prop: 'orderSource',
-            label: '订单来源',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('订单来源', _row.orderSource);
-            }
-          },
-          {
-            prop: 'status',
-            label: '生产状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('生产状态', _row.status);
-            }
-          },
-          {
-            prop: 'releaseTime',
-            label: '下达时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'deliveryTime',
-            label: '交付日期',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'customerName',
-            label: '客户名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
 
-          {
-            prop: 'serialNo',
-            label: '客户代号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'serialNo',
+          label: '客户代号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'simpleName',
-            label: '客户简称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'simpleName',
+          label: '客户简称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'salesman',
-            label: '业务员',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          ...privateColumn
-        ];
-      }
-    },
-    created() {
-      this.requestDict('按单按库');
-      this.requestDict('交付要求');
-      this.requestDict('订单类型');
-      this.requestDict('订单来源');
-      this.requestDict('生产状态');
-    },
-    methods: {
-      /* 表格数据源 */
-      async datasource({ page, limit, where, order }) {
-        if (this.activeName == 'first') {
-          where.status = [1];
+        {
+          prop: 'salesman',
+          label: '业务员',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        ...privateColumn
+      ];
+    }
+  },
+  created() {
+    this.requestDict('按单按库');
+    this.requestDict('交付要求');
+    this.requestDict('订单类型');
+    this.requestDict('订单来源');
+    this.requestDict('生产状态');
+  },
+  methods: {
+    /* 表格数据源 */
+    async datasource({ page, limit, where, order }) {
+      if (this.activeName == 'first') {
+        where.status = [1];
+      } else {
+        if (where.proStu) {
+          where.status = [where.proStu];
         } else {
-          if (where.proStu) {
-            where.status = [where.proStu];
-          } else {
-            where.status = [2, 3, 4, 5, 6, 7];
-          }
+          where.status = [2, 3, 4, 5, 6, 7];
         }
-        const params = {
-          size: limit,
-          pageNum: page,
-          ...where,
-          ...this.sort
-        };
-        const data = await getPageList(params);
-        return data;
-      },
+      }
+      const params = {
+        size: limit,
+        pageNum: page,
+        ...where,
+        ...this.sort
+      };
+      const data = await getPageList(params);
+      return data;
+    },
 
-      /* 刷新表格 */
-      reload(where) {
-        this.$nextTick(() =>
-          this.$refs.table.reload({ page: 1, limit: 10, where })
-        );
-      },
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() =>
+        this.$refs.table.reload({ page: 1, limit: 10, where })
+      );
+    },
 
-      openDetails(row) {
-        this.$refs.detailDialog.open(row);
-      },
-      toUpdate(row) {
-        this.$refs.createDialog.open(row);
-      },
-      remove(row) {
-        deleteOrder([row.id]).then((res) => {
-          this.$message.success(res);
-          this.reload();
-        });
-      },
+    openDetails(row) {
+      this.$refs.detailDialog.open(row);
+    },
+    toUpdate(row) {
+      this.$refs.createDialog.open(row);
+    },
+    remove(row) {
+      deleteOrder([row.id]).then((res) => {
+        this.$message.success(res);
+        this.reload();
+      });
+    },
 
-      onSortChange(e) {
-        let sort = {
-          orderBy: e.order,
-          sortName:  e.prop,
-        }
-        this.sort = sort
-        this.reload()
-      },
-       
+    onSortChange(e) {
+      let sort = {
+        orderBy: e.order,
+        sortName: e.prop
+      };
+      this.sort = sort;
+      this.reload();
+    },
 
-      sortTop(row) {
-        row.priority = Number(row.priority) + 1;
-        this.priorityChange(row);
-      },
-      sortBottom(row) {
-        if (row.priority <= 1) {
-          return;
-        }
-        row.priority = Number(row.priority) - 1;
-        this.priorityChange(row);
-      },
+    sortTop(row) {
+      row.priority = Number(row.priority) + 1;
+      this.priorityChange(row);
+    },
+    sortBottom(row) {
+      if (row.priority <= 1) {
+        return;
+      }
+      row.priority = Number(row.priority) - 1;
+      this.priorityChange(row);
+    },
 
-      priorityChange(row) {
-        if (row.priority > 10) {
-          row.priority = 10; // 如果大于 10,则设置为 10
-        } else if (row.priority < 0) {
-          row.priority = 0; // 如果小于 0,则设置为 0
-        }
+    priorityChange(row) {
+      if (row.priority > 10) {
+        row.priority = 10; // 如果大于 10,则设置为 10
+      } else if (row.priority < 0) {
+        row.priority = 0; // 如果小于 0,则设置为 0
+      }
 
-        this.priorityFn(row);
-      },
-      priorityFn: debounce(function (row) {
-        let params = { 
-          id: row.id,
-          priority: row.priority
-        }
-        updatePriority(params).then((res) => {
-         
-        })
-      }, 800)
-    }
-  };
+      this.priorityFn(row);
+    },
+    priorityFn: debounce(function (row) {
+      let params = {
+        id: row.id,
+        priority: row.priority
+      };
+      updatePriority(params).then((res) => {});
+    }, 800)
+  }
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 147 - 119
src/views/saleOrder/salesToProduction.vue

@@ -134,7 +134,9 @@
           <el-table-column label="行号" align="center" prop="lineNumber">
           </el-table-column>
           <el-table-column
-            label="合同数量(方)"
+            :label="
+              '合同数量' + (clientEnvironmentId == '4' ? '(方)' : '')
+            "
             align="center"
             prop="contractNum"
           >
@@ -150,10 +152,18 @@
           </el-table-column>
           <el-table-column label="规格" align="center" prop="specification">
           </el-table-column>
-          <el-table-column label="欠交数量(方)" align="center" prop="lackNum">
+          <el-table-column
+            :label="
+              '欠交数量' + (clientEnvironmentId == '4' ? '(方)' : '')
+            "
+            align="center"
+            prop="lackNum"
+          >
           </el-table-column>
           <el-table-column
-            label="计划生产数量(方)"
+            :label="
+              '计划生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')
+            "
             align="center"
             prop="planProductNum"
             width="140"
@@ -183,7 +193,9 @@
             </template>
           </el-table-column>
           <el-table-column
-            label="要求生产数量(方)"
+            :label="
+              '要求生产数量' + (clientEnvironmentId == '4' ? '(方)' : '')
+            "
             align="center"
             prop="requiredFormingNum"
             width="120"
@@ -210,7 +222,12 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="模数" align="center" width="100">
+          <el-table-column
+            label="模数"
+            align="center"
+            width="100"
+            v-if="clientEnvironmentId == '4'"
+          >
             <template slot-scope="scope">
               <div>
                 <el-input
@@ -228,7 +245,11 @@
             </template>
           </el-table-column>
 
-          <el-table-column align="center" width="100">
+          <el-table-column
+            align="center"
+            width="100"
+            v-if="clientEnvironmentId == '4'"
+          >
             <template slot="header">
               <span style="color: red">*</span>
               <span>块数</span>
@@ -253,7 +274,12 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column label="权重等级" align="center" width="120">
+          <el-table-column
+            label="权重等级"
+            align="center"
+            width="120"
+            v-if="clientEnvironmentId == '4'"
+          >
             <template slot-scope="scope">
               <div>
                 <el-select v-model="scope.row.weight" style="width: 100%">
@@ -267,7 +293,12 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column align="center" width="120" label="是否开槽">
+          <el-table-column
+            align="center"
+            width="120"
+            label="是否开槽"
+            v-if="clientEnvironmentId == '4'"
+          >
             <template slot-scope="scope">
               <div>
                 <el-select
@@ -285,7 +316,12 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column align="center" width="120" label="开槽类型">
+          <el-table-column
+            align="center"
+            width="120"
+            label="开槽类型"
+            v-if="clientEnvironmentId == '4'"
+          >
             <template slot-scope="scope">
               <DictSelection
                 dictName="开槽类型"
@@ -293,21 +329,6 @@
                 v-if="scope.row.isSlotting == 1"
               >
               </DictSelection>
-              <!-- <div>
-                <el-select
-                  v-if="scope.row.isSlotting == 1"
-                  style="width: 100%"
-                  v-model="scope.row.slottingType"
-                  placeholder="请选择"
-                >
-                  <el-option
-                    v-for="item of isSlotting"
-                    :key="item.code"
-                    :label="item.name"
-                    :value="item.code"
-                  />
-                </el-select>
-              </div> -->
             </template>
           </el-table-column>
           <el-table-column
@@ -523,6 +544,9 @@ export default {
     };
   },
   computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    },
     // 是否开启响应式布局
     styleResponsive() {
       return this.$store.state.theme.styleResponsive;
@@ -572,7 +596,9 @@ export default {
         this.form.produceRoutingId =
           res.produceRoutingId || this.$route.query.produceRoutingId;
         this.form.salesOrders.map((item, index) => {
-          this.tableHandleKeyUp(item, '', item.lackNum, 'sum');
+          if (this.clientEnvironmentId == '4') {
+            this.tableHandleKeyUp(item, '', item.lackNum, 'sum');
+          }
           item.slottingType = item.slottingType && item.slottingType + '';
           item.priority = index + 1;
           item.planProductNum = item.lackNum;
@@ -598,13 +624,13 @@ export default {
         this.$set(
           item,
           'requiredFormingNum',
-          (item.planProductNum * (this.form.marginCoefficient || 1))
+          item.planProductNum * (this.form.marginCoefficient || 1)
         );
       });
     },
 
     toInt(planProductNum) {
-      return (planProductNum * (this.form.marginCoefficient || 1))
+      return planProductNum * (this.form.marginCoefficient || 1);
     },
 
     cancel() {
@@ -707,102 +733,104 @@ export default {
       this.$set(this.form, 'produceRoutingId', data.id);
       this.$set(this.form, 'produceVersionName', data.produceVersionName);
     },
- // 表格:模数、数量(方)、块数输入框 输入事件
- tableHandleKeyUp(row, index, e, name) {
-      if (!row.specification) {
-        return;
-      }
-      // console.log(row);
-      let modelArr = row.specification.split('*');
-      let modelLong = modelArr[0]; // model规格长度
-      let modeWide = modelArr[1]; // model规格宽度
-      let modeHight = modelArr[2].substr(0, modelArr[2].indexOf('cm')); // model规格高度
-      modeHight = Number(modeHight);
-      if (name === 'moCount') {
-        // 模数
-        row.moCount = e;
-        // 计算块数的公式:
-        // (一模6米长度 / model规格长度) * (一模1.2米宽度 / model规格宽度) = 每一模的块数
-        // 每一模的块数*模数moCount = 总块数
-        if (row.productName.includes('板材')) {
-          row.blockCount =
-            Math.floor(600 / modelLong) *
-            Math.floor(120 / modeHight) *
-            Math.floor(60 / modeWide) *
-            row.moCount;
-        } else if (row.productName.includes('砌块')) {
-          let modelLongFixed = (600 / modelLong).toFixed(2);
-          modelLongFixed = modelLongFixed.substring(
-            0,
-            modelLongFixed.length - 1
-          );
-          let modeWideFixed = (120 / modeWide).toFixed(2);
-          modeWideFixed = modeWideFixed.substring(0, modeWideFixed.length - 1);
-          let modeHightFixed = (60 / modeHight).toFixed(2);
-          modeHightFixed = modeHightFixed.substring(
-            0,
-            modeHightFixed.length - 1
-          );
-          row.blockCount =
-            Math.floor(modelLongFixed * modeWideFixed * modeHightFixed) *
-            row.moCount;
-        }
+    // 表格:模数、数量(方)、块数输入框 输入事件
+    tableHandleKeyUp(row, index, e, name) {
+      if (row.specification && this.clientEnvironmentId == '4') {
+        let modelArr = row.specification.split('*');
+        let modelLong = modelArr[0]; // model规格长度
+        let modeWide = modelArr[1]; // model规格宽度
+        let modeHight = modelArr[2].substr(0, modelArr[2].indexOf('cm')); // model规格高度
+        modeHight = Number(modeHight);
+        if (name === 'moCount') {
+          // 模数
+          row.moCount = e;
+          // 计算块数的公式:
+          // (一模6米长度 / model规格长度) * (一1.2米宽度 / model规格宽度) = 每一模的块
+          // 每一模的块数*模数moCount = 总块数
+          if (row.productName.includes('板材')) {
+            row.blockCount =
+              Math.floor(600 / modelLong) *
+              Math.floor(120 / modeHight) *
+              Math.floor(60 / modeWide) *
+              row.moCount;
+          } else if (row.productName.includes('砌块')) {
+            let modelLongFixed = (600 / modelLong).toFixed(2);
+            modelLongFixed = modelLongFixed.substring(
+              0,
+              modelLongFixed.length - 1
+            );
+            let modeWideFixed = (120 / modeWide).toFixed(2);
+            modeWideFixed = modeWideFixed.substring(
+              0,
+              modeWideFixed.length - 1
+            );
+            let modeHightFixed = (60 / modeHight).toFixed(2);
+            modeHightFixed = modeHightFixed.substring(
+              0,
+              modeHightFixed.length - 1
+            );
+            row.blockCount =
+              Math.floor(modelLongFixed * modeWideFixed * modeHightFixed) *
+              row.moCount;
+          }
 
-        row.planProductNum =
-          ((modelLong * modeWide * modeHight) / 1000000).toFixed(5) *
-          row.blockCount;
-      } else if (name === 'sum') {
-        //方数
-        row.planProductNum = e;
+          row.planProductNum =
+            ((modelLong * modeWide * modeHight) / 1000000).toFixed(5) *
+            row.blockCount;
+        } else if (name === 'sum') {
+          //方数
+          row.planProductNum = e;
 
-        row.blockCount = Math.floor(
-          e / ((modelLong * modeWide * modeHight) / 1000000)
-        );
-        // console.log(e,'row.blockCount')
-        // console.log(modelLong,'row.blockCount')
-        // console.log(modeWide,'row.blockCount')
-        // console.log(modeHight,'row.blockCount')
-
-        if (row.productName.includes('板材')) {
-          row.moCount = Math.ceil(
-            row.blockCount /
-              (Math.floor(600 / modelLong) *
-                Math.floor(120 / modeHight) *
-                Math.floor(60 / modeWide))
-          );
-        } else if (row.productName.includes('砌块')) {
-          row.moCount = Math.ceil(
-            row.blockCount /
-              Math.floor(
-                (600 / modelLong) * (120 / modeHight) * (60 / modeWide)
-              )
-          );
-        }
-      } else if (name === 'blockCount') {
-        //块数
-        row.blockCount = e;
-
-        if (row.productName.includes('板材')) {
-          row.moCount = Math.ceil(
-            row.blockCount /
-              (Math.floor(600 / modelLong) *
-                Math.floor(120 / modeHight) *
-                Math.floor(60 / modeWide))
+          row.blockCount = Math.floor(
+            e / ((modelLong * modeWide * modeHight) / 1000000)
           );
-        } else if (row.productName.includes('砌块')) {
-          row.moCount = Math.ceil(
-            row.blockCount /
-              Math.floor(
-                (600 / modelLong) * (120 / modeHight) * (60 / modeWide)
-              )
-          );
-        }
+          // console.log(e,'row.blockCount')
+          // console.log(modelLong,'row.blockCount')
+          // console.log(modeWide,'row.blockCount')
+          // console.log(modeHight,'row.blockCount')
+
+          if (row.productName.includes('板材')) {
+            row.moCount = Math.ceil(
+              row.blockCount /
+                (Math.floor(600 / modelLong) *
+                  Math.floor(120 / modeHight) *
+                  Math.floor(60 / modeWide))
+            );
+          } else if (row.productName.includes('砌块')) {
+            row.moCount = Math.ceil(
+              row.blockCount /
+                Math.floor(
+                  (600 / modelLong) * (120 / modeHight) * (60 / modeWide)
+                )
+            );
+          }
+        } else if (name === 'blockCount') {
+          //块数
+          row.blockCount = e;
+
+          if (row.productName.includes('板材')) {
+            row.moCount = Math.ceil(
+              row.blockCount /
+                (Math.floor(600 / modelLong) *
+                  Math.floor(120 / modeHight) *
+                  Math.floor(60 / modeWide))
+            );
+          } else if (row.productName.includes('砌块')) {
+            row.moCount = Math.ceil(
+              row.blockCount /
+                Math.floor(
+                  (600 / modelLong) * (120 / modeHight) * (60 / modeWide)
+                )
+            );
+          }
 
-        row.planProductNum = (
-          (Number(e) * modelLong * modeWide * modeHight) /
-          1000000
-        ).toFixed(5);
+          row.planProductNum = (
+            (Number(e) * modelLong * modeWide * modeHight) /
+            1000000
+          ).toFixed(5);
+        }
       }
+
       row.requiredFormingNum = this.toInt(row.planProductNum);
     },
     confirmChoose(list) {
@@ -893,7 +921,7 @@ export default {
                 data.workOrder.productionPlanId = params.id;
               }
 
-              await releaseSave(data)(data)
+              await releaseSave(data)
                 .then((res) => {
                   if (res === 1) {
                     this.$message.success('工单已发布!');

+ 4 - 1
src/views/workOrder/index.vue

@@ -116,6 +116,9 @@
       };
     },
     computed: {
+      clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    },
       // 表格列配置
       columns() {
         return [
@@ -185,7 +188,7 @@
 
           {
             prop: 'formingNum',
-            label: '要求生产数量',
+            label: '要求生产数量'+this.clientEnvironmentId==4?'(方)':'',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110

+ 1 - 1
vue.config.js

@@ -32,7 +32,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        target: 'http://192.168.1.107:20881',
+        target: 'http://192.168.1.107:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''