Quellcode durchsuchen

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt

liujt vor 7 Monaten
Ursprung
Commit
d6ca878a1a

+ 236 - 208
src/BIZComponents/inventoryTableDetails.vue

@@ -154,6 +154,10 @@
       isProductionRequirements: {
         type: Boolean,
         default: false
+      },
+      quoteType: {
+        type: Number,
+        default: 1
       }
     },
     data() {
@@ -168,28 +172,23 @@
     },
     computed: {
       columns() {
-        let orderColumn = {
-          width: 1,
-          show: false
-        };
-        if (this.isOrderNo) {
-          orderColumn = {
-            minWidth: 200,
-            prop: 'orderNo',
-            label: '订单编码',
-            showOverflowTooltip: true,
-            align: 'center'
-          };
-        }
-        return [
+        // 基础列(新增字段之前的列)
+        const baseColumns = [
           {
             width: 45,
             type: 'index',
             columnKey: 'index',
             align: 'center'
           },
-          orderColumn,
 
+          {
+            minWidth: 200,
+            prop: 'orderNo',
+            label: '订单编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            isNone: !this.isOrderNo
+          },
           {
             width: 280,
             prop: 'productName',
@@ -218,74 +217,139 @@
             label: '规格',
             slot: 'specification',
             align: 'center'
-          },
-          this.contractBookType == 1
-            ? {
-                width: 200,
-                prop: 'customerMark',
-                label: '客户代号',
-                slot: 'customerMark',
-                headerSlot: 'headerCustomerMark',
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
-          this.contractBookType == 2
-            ? {
-                width: 200,
-                prop: 'customerMark',
-                label: '供应商代号',
-                slot: 'customerMark',
-                headerSlot: 'headerSupplierMark',
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
-          this.isCustomerMark
-            ? {
-                minWidth: 120,
-                prop: 'entrustedEnterpriseId',
-                label: '受托企业',
-                slot: 'entrustedEnterpriseId',
-                show: this.isCustomerMark,
-                align: 'center',
-                showOverflowTooltip: true,
-                formatter: (row, column) => {
-                  return (
-                    (this.supplierObj &&
-                      this.supplierObj[row.productId]?.find(
-                        (item) => item.id === row.entrustedEnterpriseId
-                      )?.name) ||
-                    ''
-                  );
+          }
+        ];
+        // 条件显示的新增字段列(仅当quoteType为2时显示)
+        const additionalColumns =
+          this.quoteType === 2
+            ? [
+                // 新增字段:厚度
+                {
+                  width: 150,
+                  prop: 'thickNess',
+                  label: '厚度',
+                  slot: 'thickNess',
+                  align: 'center'
+                },
+                // 新增字段:平方数
+                {
+                  width: 150,
+                  prop: 'squareNumber',
+                  label: '平方数',
+                  slot: 'squareNumber',
+                  align: 'center'
+                },
+                // 新增字段:加工费(未税)
+                {
+                  width: 150,
+                  prop: 'processingFeeBeforeTax',
+                  label: '加工费(未税)',
+                  slot: 'processingFeeBeforeTax',
+                  align: 'center'
+                },
+                // 新增字段:包装费(未税)
+                {
+                  width: 150,
+                  prop: 'packagingFeeNotTaxed',
+                  label: '包装费(未税)',
+                  slot: 'packagingFeeNotTaxed',
+                  align: 'center'
+                },
+                // 新增字段:运输费(未税)
+                {
+                  width: 150,
+                  prop: 'transportationFeeWithoutTax',
+                  label: '运输费(未税)',
+                  slot: 'transportationFeeWithoutTax',
+                  align: 'center'
+                },
+                // 新增字段:未税小计
+                {
+                  width: 150,
+                  prop: 'untaxedSubtotal',
+                  label: '未税小计',
+                  slot: 'additionalTaxRate_untaxed',
+                  align: 'center'
+                },
+                // 新增字段:税率(%)
+                {
+                  width: 150,
+                  prop: 'additionalTaxRate',
+                  label: '税率(%)',
+                  slot: 'additionalTaxRate',
+                  align: 'center'
+                },
+                // 新增字段:含税小计
+                {
+                  width: 150,
+                  prop: 'includingTaxPrice',
+                  label: '含税小计',
+                  slot: 'includingTaxPrice',
+                  align: 'center'
                 }
-              }
-            : {
-                width: 1
-              },
+              ]
+            : [];
+        const remainingColumns = [
           {
-            width: 150,
+            width: 200,
+            prop: 'customerMark',
+            label: this.contractBookType == 1 ? '客户代号' : '供应商代号',
+            slot: 'customerMark',
+            headerSlot: 'headerCustomerMark',
+            isNone: this.quoteType === 2,
+            align: 'center'
+          },
+          {
+            minWidth: 240,
+            prop: 'taskName',
+            label: '工序',
+            slot: 'taskName',
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'productionCodes',
+            label: '生产编号',
+            isNone: this.quoteType === 2,
+            align: 'center'
+          },
+          {
+            minWidth: 280,
+            prop: 'productionRequirements',
+            label: '生产要求',
+            align: 'center',
+            isNone: !this.isProductionRequirements
+          },
+          {
+            minWidth: 120,
+            prop: 'entrustedEnterpriseId',
+            label: '受托企业',
+            slot: 'entrustedEnterpriseId',
+            isNone: !this.isCustomerMark,
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return (
+                this.supplierObj[row.productId]?.find(
+                  (item) => item.id === row.entrustedEnterpriseId
+                )?.name || ''
+              );
+            }
+          },
+          {
+            width: 180,
             prop: 'saleCount',
             label: '数量',
             slot: 'saleCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          // {
-          //   width: 150,
-          //   prop: 'saleUnit',
-          //   label: '单位',
-          //   slot: 'saleUnit',
-          //   headerSlot: 'headerTotalCount',
-          //   align: 'center'
-          // },
           {
             width: 120,
             prop: 'packingSpecification',
             align: 'center',
             label: '包装规格',
+            isNone: this.quoteType === 2,
             showOverflowTooltip: true
           },
           {
@@ -293,68 +357,32 @@
             prop: 'totalCount',
             label: '计量数量',
             slot: 'totalCount',
+            isNone: this.quoteType === 2,
+            headerSlot: 'headerTotalCount',
             formatter: (row, column) => {
               if (row.totalCount) {
                 return row.totalCount + ' ' + row.measuringUnit;
               }
             },
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          // {
-          //   width: 120,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   align: 'center'
-          // },
-          this.pageName == 'send'
-            ? {
-                minWidth: 110,
-                prop: 'sendTotalCount',
-                label: '已发货数量',
-                slot: 'sendTotalCount',
-                formatter: (row, column) => {
-                  if (row.sendTotalCount) {
-                    return row.sendTotalCount + ' ' + row.measuringUnit;
-                  }
-                },
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
-          this.pageName == 'send'
-            ? {
-                minWidth: 110,
-                prop: 'notSendTotalCount',
-                label: '未发货数量',
-                slot: 'notSendTotalCount',
-                formatter: (row, column) => {
-                  if (row.notSendTotalCount) {
-                    return row.notSendTotalCount + ' ' + row.measuringUnit;
-                  }
-                },
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
+
           {
-            width: 120,
+            width: 140,
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
+            isNone: this.quoteType === 2,
+            headerSlot: 'headerSingleWeight',
             formatter: (row, column) => {
               if (row.singleWeight) {
                 return row.singleWeight + ' ' + row.weightUnit;
               }
             },
-            headerSlot: 'headerSingleWeight',
             align: 'center'
           },
           {
-            width: 120,
+            width: 140,
             prop: 'totalWeight',
             label: '总重',
             slot: 'totalWeight',
@@ -365,31 +393,12 @@
             },
             align: 'center'
           },
-          // {
-          //   width: 120,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+
           {
             width: 160,
             prop: 'goodsPriceType',
             label: '价格类型',
+            isNone: this.quoteType === 2,
             formatter: (row, column) => {
               return this.getDictValue('商品价格类型', row.goodsPriceType);
             },
@@ -400,40 +409,41 @@
             prop: 'singlePrice',
             label: '单价',
             slot: 'singlePrice',
+            isNone: this.quoteType === 2,
             headerSlot: 'headerSinglePrice',
             align: 'center'
           },
+
           {
             width: 160,
             prop: 'taxRate',
             label: '税率',
+            isNone: this.quoteType === 2,
             formatter: (_row, _column, cellValue) => {
               return _row.taxRate ? _row.taxRate + '%' : '';
             },
             align: 'center'
           },
           {
-            width: 160,
+            width: 150,
             prop: 'notaxSinglePrice',
             label: '不含税单价',
+            isNone: this.quoteType === 2,
+            slot: 'notaxSinglePrice',
             align: 'center'
           },
-          this.isDiscount
-            ? {
-                width: 160,
-                prop: 'discountSinglePrice',
-                label: '折让单价',
-                align: 'center',
-
-                formatter: (_row, _column, cellValue) => {
-                  return _row.discountSinglePrice
-                    ? Number(_row.discountSinglePrice).toFixed(2)
-                    : '';
-                }
-              }
-            : {
-                width: 1
-              },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折让单价',
+            align: 'center',
+            isNone: !this.isDiscount,
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountSinglePrice
+                ? Number(_row.discountSinglePrice).toFixed(2)
+                : '';
+            }
+          },
           {
             width: 120,
             prop: 'totalPrice',
@@ -441,25 +451,23 @@
             slot: 'totalPrice',
             align: 'center'
           },
-          this.isDiscount
-            ? {
-                width: 160,
-                prop: 'discountTotalPrice',
-                label: '折让合计',
-                align: 'center',
-                formatter: (_row, _column, cellValue) => {
-                  return _row.discountTotalPrice
-                    ? Number(_row.discountTotalPrice).toFixed(2)
-                    : '';
-                }
-              }
-            : {
-                width: 1
-              },
+          {
+            width: 160,
+            prop: 'discountTotalPrice',
+            label: '折让合计',
+            align: 'center',
+            isNone: !this.isDiscount,
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountTotalPrice
+                ? Number(_row.discountTotalPrice).toFixed(2)
+                : '';
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',
             label: '物品级别',
+            isNone: this.quoteType === 2,
             formatter: (_row, _column, cellValue) => {
               return levelList.find((item) => item.value == _row.goodsLevel)
                 ?.label;
@@ -471,6 +479,7 @@
             prop: 'batchNo',
             label: '批次号',
             slot: 'batchNo',
+            isNone: this.quoteType === 2,
             align: 'center'
           },
           {
@@ -478,6 +487,7 @@
             prop: 'productBrand',
             label: '牌号',
             slot: 'productBrand',
+            isNone: this.quoteType === 2,
             align: 'center'
           },
           {
@@ -485,34 +495,41 @@
             prop: 'modelType',
             label: '型号',
             slot: 'modelType',
+            isNone: this.quoteType === 2,
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'imgCode',
-            align: 'center',
-            label: '图号/件号',
-            showOverflowTooltip: true
-          },
           {
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
+            slot: 'modelKey',
+            isNone: this.quoteType === 2,
             showOverflowTooltip: true,
             align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
+            slot: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
+            isNone: this.quoteType === 2,
             align: 'center'
           },
+          {
+            width: 120,
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            isNone: this.quoteType === 2,
+            showOverflowTooltip: true
+          },
           {
             prop: 'provenance',
             label: '产地',
             slot: 'provenance',
             align: 'center',
+            isNone: this.quoteType === 2,
             minWidth: 200,
             showOverflowTooltip: true,
             formatter: (row, column) => {
@@ -528,6 +545,7 @@
             prop: 'produceType',
             align: 'center',
             label: '属性类型',
+            isNone: this.quoteType === 2,
             showOverflowTooltip: true,
             formatter: (row, column) => {
               if (row.produceType) {
@@ -539,56 +557,25 @@
               }
             }
           },
-          {
-            minWidth: 160,
-            prop: 'productionCodes',
-            label: '生产编号',
-            align: 'center'
-          },
-          this.isProductionRequirements
-            ? {
-                minWidth: 280,
-                prop: 'productionRequirements',
-                label: '生产要求',
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
-          {
-            minWidth: 240,
-            prop: 'taskName',
-            label: '工序',
-            slot: 'taskName',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 160,
             prop: 'arrivalWay',
             label: '到货方式',
             align: 'center',
+            isNone: !this.isArrivalWay || this.quoteType === 2,
             formatter: (_row, _column, cellValue) => {
               return _row.arrivalWay == 1
                 ? '一次性到货'
                 : _row.arrivalWay == 2
                 ? '分批到货'
                 : '';
-            },
-            show: this.isArrivalWay
+            }
           },
           {
             width: 160,
             prop: 'customerExpectDeliveryDeadline',
             label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
             slot: 'customerExpectDeliveryDeadline',
-
             align: 'center'
           },
           {
@@ -596,16 +583,17 @@
             prop: 'produceDeliveryDeadline',
             label: '生产交付交期',
             slot: 'produceDeliveryDeadline',
+            isNone: this.contractBookType != 1,
             headerSlot: 'headerProduceDeliveryDeadline',
-            show: this.contractBookType == 1,
             align: 'center'
           },
+
           {
             width: 200,
             prop: 'guaranteePeriod',
             label: '有效期',
+            isNone: this.quoteType === 2,
             slot: 'guaranteePeriod',
-
             align: 'center',
             formatter: (_row, _column, cellValue) => {
               return (
@@ -617,20 +605,43 @@
             width: 200,
             prop: 'guaranteePeriodDeadline',
             label: '有效期截止日期',
+            isNone: this.quoteType === 2,
             slot: 'guaranteePeriodDeadline',
             align: 'center'
           },
+
           {
             width: 220,
             prop: 'customerReqFiles',
             label: '客户需求',
             slot: 'customerReqFiles',
+            isNone: this.quoteType === 2,
             align: 'center'
           },
+          // {
+          //   width: 100,
+          //   prop: 'density',
+          //   label: '密度',
+          //   align: 'center'
+          // },
+          {
+            width: 150,
+            prop: 'productType',
+            label: '生产加工方式',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _row.productType == 2
+                ? '加工'
+                : _row.productType == 3
+                ? '装配'
+                : '';
+            }
+          },
           {
             width: 130,
             prop: 'technicalAnswerName',
             label: '技术答疑人',
+            isNone: this.quoteType === 2,
             slot: 'technicalAnswerName',
             align: 'center'
           },
@@ -638,6 +649,7 @@
             width: 220,
             prop: 'technicalParams',
             label: '技术参数',
+            isNone: this.quoteType === 2,
             slot: 'technicalParams',
             align: 'center'
           },
@@ -648,10 +660,18 @@
             slot: 'technicalDrawings',
             align: 'center'
           },
+          {
+            width: 120,
+            prop: 'drawingVersion',
+            isNone: this.quoteType === 2,
+            label: '图纸版本',
+            align: 'center'
+          },
           {
             width: 240,
             prop: 'technologyRouteName',
             label: '工艺路线',
+            isNone: this.quoteType === 2,
             slot: 'technologyRouteName',
             align: 'center'
           },
@@ -659,6 +679,7 @@
             width: 240,
             prop: 'industryArtFiles',
             label: '工艺附件',
+            isNone: this.quoteType === 2,
             slot: 'industryArtFiles',
             align: 'center'
           },
@@ -667,6 +688,7 @@
             prop: 'otherFiles',
             label: '其他附件',
             slot: 'otherFiles',
+            isNone: this.quoteType === 2,
             align: 'center'
           },
           {
@@ -677,6 +699,12 @@
             align: 'center'
           }
         ];
+        // 合并所有列
+        return [
+          ...baseColumns,
+          ...additionalColumns,
+          ...remainingColumns
+        ].filter((item) => !item.isNone);
       }
     },
 

+ 6 - 7
src/api/bpm/components/entrust/index.js

@@ -1,25 +1,24 @@
 import request from '@/utils/request';
 
-
-
 //新建/修改
 export async function save(data) {
-  const res = await request.post('/mes/please_entrust_management/' + (data.id ? 'update' : 'add'), data);
+  const res = await request.post(
+    '/mes/please_entrust_management/' + (data.id ? 'update' : 'add'),
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
-
 /**
  * 详情
  */
- export async function details(id) {
-  const res = await request.get(`mes/please_entrust_management/details/${id}`);
+export async function details(id) {
+  const res = await request.get(`/mes/please_entrust_management/getById/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
-

+ 503 - 179
src/views/bpm/handleTask/components/entrust/create.vue

@@ -38,17 +38,17 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
+        <!-- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
           <el-form-item label="编码:" prop="code">
             <el-input v-model="form.code" disabled />
           </el-form-item>
-        </el-col>
+        </el-col> -->
         <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
           <el-form-item label="名称:" prop="name">
             <el-input v-model="form.name" :disabled="type == 'detail'" />
           </el-form-item>
         </el-col>
-        <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
+        <!-- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
           <el-form-item label="生产工单:" prop="workOrderCode">
             <el-input
               v-model="form.workOrderCode"
@@ -60,8 +60,8 @@
             >
             </el-input>
           </el-form-item>
-        </el-col>
-        <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
+        </el-col> -->
+        <!-- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
           <el-form-item label="工序:" prop="procedureList">
             <el-select
               style="width: 100%"
@@ -80,7 +80,7 @@
               </el-option>
             </el-select>
           </el-form-item>
-        </el-col>
+        </el-col> -->
         <el-col :span="8">
           <el-form-item label="请托部门:" prop="pleaseEntrustDeptId">
             <el-input v-model="form.pleaseEntrustDeptName" clearable disabled>
@@ -132,7 +132,7 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="8">
+        <!-- <el-col :span="8">
           <el-form-item label="完成时间:" prop="finishTime">
             <el-date-picker
               v-model="form.finishTime"
@@ -142,9 +142,9 @@
               :disabled="type == 'detail'"
             ></el-date-picker>
           </el-form-item>
-        </el-col>
-     
-        <el-col v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }">
+        </el-col> -->
+
+        <!-- <el-col v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }">
           <el-form-item label="需求描述:">
             <el-input
               v-model="form.describes"
@@ -153,14 +153,63 @@
               :disabled="type == 'detail'"
             />
           </el-form-item>
-        </el-col>
+        </el-col> -->
         <!-- <el-col :span="8">
           s
         </el-col> -->
       </el-row>
       <headerTitle title="产品信息" style="margin-top: 15px"></headerTitle>
 
-      <el-table :data="form.pleaseEntrustObjList" border height="40vh">
+      <ele-pro-table
+        ref="entrustCreateTable"
+        :columns="columns"
+        :datasource="orderList"
+        :selection.sync="selection"
+        :current.sync="current"
+        highlight-current-row
+        row-key="id"
+        height="40vh"
+      >
+        <template v-slot:totalCount="{ row }">
+          <el-input v-model="row.totalCount"> </el-input>
+        </template>
+
+        <template v-slot:describes="{ row }">
+          <el-input v-model="row.describes"> </el-input>
+        </template>
+
+        <template v-slot:taskId="{ row, $index }">
+          <el-select
+            clearable
+            filterable
+            style="width: 100%"
+            v-model="row.taskId"
+            placeholder="请选择"
+            @change="taskListChange(row, $index)"
+          >
+            <el-option
+              v-for="item in row.taskList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            >
+            </el-option>
+          </el-select>
+        </template>
+
+        <template v-slot:planDeliveryTime="{ row }">
+          <el-date-picker
+            v-model="row.planDeliveryTime"
+            type="datetime"
+            placeholder="选择日期时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+          >
+          </el-date-picker>
+        </template>
+      </ele-pro-table>
+
+      <!-- <el-table :data="orderList" border height="40vh">
         <el-table-column label="序号" align="center" width="60">
           <template slot-scope="scope">
             <span>{{ scope.$index + 1 }}</span>
@@ -175,8 +224,6 @@
         </el-table-column>
         <el-table-column label="批号" align="center" prop="batchNo">
         </el-table-column>
-        <!-- <el-table-column label="型号" align="center" prop="model">
-        </el-table-column> -->
         <el-table-column label="规格" align="center" prop="specification">
         </el-table-column>
         <el-table-column label="数量" align="center" prop="productNumber">
@@ -231,7 +278,7 @@
             </el-form-item>
           </template>
         </el-table-column>
-      </el-table>
+      </el-table> -->
     </el-form>
 
     <produceOrder ref="produceOrderRef" @choose="choose" />
@@ -239,186 +286,463 @@
 </template>
 
 <script>
-import produceOrder from './produceOrder';
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
-import { getProduceTaskList } from '@/api/mes';
-import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-import { details } from '@/api/bpm/components/entrust';
+  import produceOrder from './produceOrder';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { getProduceTaskList } from '@/api/mes';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { details } from '@/api/bpm/components/entrust';
 
-const defaultForm = function () {
-  return {
-    createTime: '', //创建时间
-    code: '', //编码
-    name: '', //名称
-    workOrderCode: '', //工单编码
-    pleaseEntrustUserId: '', //请托人id
-    pleaseEntrustUserName: '', //请托人名称
-    pleaseEntrustDeptId: '', //请托人部门id
-    pleaseEntrustDeptName: '', //请托人部门名称
-    beEntrustedDeptId: '', //受托人部门id.
-    beEntrustedDeptName: '', //受托人部门名称
-    produceRoutingId: null,
-    produceRoutingName: '',
-    procedureList: [],
-    pleaseEntrustObjList: [], //具体请托对象
-    type: '', //类型
-    status: '',
-    describes: '', //描述
-    finishTime: '', //完成时间
-    processInstanceId: '', //流程实例id
-    factoriesName: '',
-    factoriesId: '',
-    priority: '',
-    beEntrustedFactoriesId: '', //受托工厂id
-    beEntrustedFactoriesName: '' //受托工厂名称
-  };
-};
-export default {
-  components: { produceOrder, deptSelect },
-  data() {
+  const defaultForm = function () {
     return {
-      loading: false,
-      form: { ...defaultForm() },
-      options: [
-        {
-          name: '一般',
-          value: 1
-        },
-        {
-          name: '紧急',
-          value: 2
-        }
-      ],
-      // 表单验证规则
-      rules: {
-        type: [{ required: true, message: '请选择', trigger: 'change' }],
-        name: [{ required: true, message: '请输入', trigger: 'change' }],
-
-        workOrderCode: [
-          { required: true, message: '请选择', trigger: 'change' }
+      createTime: '', //创建时间
+      code: '', //编码
+      name: '', //名称
+      workOrderCode: '', //工单编码
+      pleaseEntrustUserId: '', //请托人id
+      pleaseEntrustUserName: '', //请托人名称
+      pleaseEntrustDeptId: '', //请托人部门id
+      pleaseEntrustDeptName: '', //请托人部门名称
+      beEntrustedDeptId: '', //受托人部门id.
+      beEntrustedDeptName: '', //受托人部门名称
+      produceRoutingId: null,
+      produceRoutingName: '',
+      procedureList: [],
+      pleaseEntrustObjList: [], //具体请托对象
+      type: '', //类型
+      status: '',
+      describes: '', //描述
+      finishTime: '', //完成时间
+      processInstanceId: '', //流程实例id
+      factoriesName: '',
+      factoriesId: '',
+      priority: '',
+      beEntrustedFactoriesId: '', //受托工厂id
+      beEntrustedFactoriesName: '' //受托工厂名称
+    };
+  };
+  export default {
+    components: { produceOrder, deptSelect },
+    data() {
+      return {
+        loading: false,
+        form: { ...defaultForm() },
+        planType: [
+          { label: '所有计划类型', value: null },
+          { label: '内销计划', value: '1' },
+          { label: '外销计划', value: '2' },
+          { label: '预制计划', value: '3' }
         ],
-        beEntrustedDeptId: [
-          { required: true, message: '请选择', trigger: 'change' }
+        options: [
+          {
+            name: '一般',
+            value: 1
+          },
+          {
+            name: '紧急',
+            value: 2
+          }
         ],
-        finishTime: [{ required: true, message: '请选择', trigger: 'change' }]
-      },
-      type: '',
-      produceTaskList: [],
-      factoryList: []
-    };
-  },
-  props: {
-    businessId: {
-      default: ''
-    },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  created() {
-    this.getFactoryList();
-    this.init();
-  },
-  methods: {
-    async init() {
-      const data = await details(this.businessId);
-      this.type = this.taskDefinitionKey == 'starter' ? 'edit' : 'detail';
-      this.form = data;
-      this.getProduceTaskList();
-      this.form.procedureList = this.form.procedureList.map(
-        (item) => item.produceTaskId
-      );
-      this.form.type = this.form.type + '';
-    },
+        tabOptions: [
+          { key: 'main', name: '异常详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        // 表单验证规则
+        rules: {
+          type: [{ required: true, message: '请选择', trigger: 'change' }],
+          name: [{ required: true, message: '请输入', trigger: 'change' }],
 
-    addProduct() {
-      this.$refs.produceOrderRef.open();
+          workOrderCode: [
+            { required: true, message: '请选择', trigger: 'change' }
+          ],
+          beEntrustedDeptId: [
+            { required: true, message: '请选择', trigger: 'change' }
+          ],
+          finishTime: [{ required: true, message: '请选择', trigger: 'change' }]
+        },
+        type: '',
+        produceTaskList: [],
+        factoryList: [],
+        orderList: [],
+        selection: [],
+        current: null,
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'categoryName',
+            label: '产品名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'apsWorkOrderCode',
+          //   label: '生产订单号',
+          //   slot: 'apsWorkOrderCode',
+          //   align: 'center',
+          //   minWidth: 110,
+          //   showOverflowTooltip: true
+          // },
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'describes',
+            slot: 'describes',
+            label: '需求描述',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'totalCount',
+            slot: 'totalCount',
+            label: '请托数量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'planType',
+            label: '计划类型',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.planType);
+              return obj && obj.label;
+            }
+          },
+          {
+            prop: 'code',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            width: 130,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'bomType',
+            label: 'BOM分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (row.bomType == 1) {
+                return '产品(PBOM)';
+              }
+              if (row.bomType == 2) {
+                return '加工(MBOM)';
+              }
+              if (row.bomType == 3) {
+                return '装配(ABOM)';
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'bomCategoryVersions',
+            label: 'BOM版本',
+            align: 'center',
+            width: 130,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (row.bomCategoryName) {
+                return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'taskId',
+            slot: 'taskId',
+            label: '工序',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'planDeliveryTime',
+            slot: 'planDeliveryTime',
+            label: '完成日期',
+            align: 'center',
+            minWidth: 260
+          },
+          {
+            prop: 'planStartTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            sortable: true
+          },
+          {
+            prop: 'planCompleteTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            sortable: true
+          },
+          {
+            prop: 'startTime',
+            label: '工单开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            sortable: true
+          },
+          {
+            prop: 'completeTime',
+            label: '工单结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            sortable: true
+          }
+          // {
+          //   prop: 'priority',
+          //   label: '优先级',
+          //   align: 'center',
+          //   minWidth: 120
+          // }
+        ]
+      };
     },
-
-    beEntrustedDeptIdChange(val, row) {
-      this.form.beEntrustedDeptName = row.name;
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
     },
-    factoryListChange(row) {
-      this.form.beEntrustedFactoriesName = row.name;
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
     },
-    async getFactoryList() {
-      const { list } = await warehouseDefinition.getFactoryarea({
-        pageNum: 1,
-        size: 999,
-        type: 1
-      });
-      this.factoryList = list || [];
+    created() {
+      this.getFactoryList();
+      this.init();
     },
+    methods: {
+      async init() {
+        const data = await details(this.businessId);
+        this.type = this.taskDefinitionKey == 'starter' ? 'edit' : 'detail';
+        // this.form = data;
+        const {
+          applyDeptName,
+          applyDeptId,
+          createUserName,
+          createUserId,
+          applyFactoriesId,
+          applyFactoriesName,
+          beEntrustedDeptId,
+          beEntrustedDeptName,
+          beEntrustedFactoriesName,
+          beEntrustedFactoriesId,
+          name,
+          type,
+          priority,
+          id: dataId
+        } = data;
 
-    choose(data) {
-      this.form.workOrderCode = data.code;
-      this.form.produceRoutingId = data.produceRoutingId;
-      this.form.produceRoutingName = data.produceRoutingName;
-      this.form.pleaseEntrustObjList = [data];
-      this.form.procedureList = [];
-      this.getProduceTaskList();
-    },
-    async getProduceTaskList() {
-      const res = await getProduceTaskList({
-        isDetail: true,
-        pageNum: 1,
-        routingId: this.form.produceRoutingId,
-        size: -1
-      });
-      this.produceTaskList = res.list;
-    },
-    async getTableValue() {
-      let data = JSON.parse(JSON.stringify(this.form));
-      data.procedureList = data.procedureList.map((item) => {
-        return {
-          produceTaskId: item,
-          produceTaskName: this.produceTaskList.find((val) => val.id == item)
-            .name
+        Object.assign(this.form, {
+          pleaseEntrustDeptName: applyDeptName,
+          pleaseEntrustDeptId: applyDeptId,
+          pleaseEntrustUserName: createUserName,
+          pleaseEntrustUserId: createUserId,
+          factoriesId: applyFactoriesId,
+          factoriesName: applyFactoriesName,
+          beEntrustedDeptId,
+          beEntrustedDeptName,
+          beEntrustedFactoriesName,
+          beEntrustedFactoriesId,
+          name,
+          type,
+          priority,
+          id: dataId
+        });
+
+        const newData = {
+          ...this.deepCopy(data),
+          taskList: []
         };
-      });
-      if (await this.getValidate()) {
-        return data;
-      }
-      return false;
-    },
 
-    getValidate() {
-      return new Promise((resolve, reject) => {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            resolve(false);
-          } else {
-            resolve(true);
-          }
+        this.orderList.push(newData);
+        this.getOrderTaskList();
+        // this.form.procedureList = this.form.procedureList.map(
+        //   (item) => item.produceTaskId
+        // );
+        this.form.type = this.form.type + '';
+      },
+
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
+
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
+
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      },
+
+      addProduct() {
+        this.$refs.produceOrderRef.open();
+      },
+
+      beEntrustedDeptIdChange(val, row) {
+        this.form.beEntrustedDeptName = row.name;
+      },
+      factoryListChange(row) {
+        this.form.beEntrustedFactoriesName = row.name;
+      },
+      async getFactoryList() {
+        const { list } = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 999,
+          type: 1
+        });
+        this.factoryList = list || [];
+      },
+
+      choose(data) {
+        this.form.workOrderCode = data.code;
+        this.form.produceRoutingId = data.produceRoutingId;
+        this.form.produceRoutingName = data.produceRoutingName;
+        this.form.pleaseEntrustObjList = [data];
+        this.form.procedureList = [];
+        this.getProduceTaskList();
+      },
+      async getOrderTaskList() {
+        for (const item of this.orderList) {
+          const res = await getProduceTaskList({
+            isDetail: true,
+            pageNum: 1,
+            routingId: item.produceRoutingId,
+            size: -1
+          });
+
+          item.taskList = res.list;
+        }
+      },
+      async getTableValue() {
+        let data = JSON.parse(JSON.stringify(this.form));
+        data.procedureList = data.procedureList.map((item) => {
+          return {
+            produceTaskId: item,
+            produceTaskName: this.produceTaskList.find((val) => val.id == item)
+              .name
+          };
+        });
+        if (await this.getValidate()) {
+          return data;
+        }
+        return false;
+      },
+
+      getValidate() {
+        return new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              resolve(false);
+            } else {
+              resolve(true);
+            }
+          });
         });
-      });
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.basic-details-title {
-  margin: 10px 0;
-}
+  .basic-details-title {
+    margin: 10px 0;
+  }
 
-.add-product {
-  width: 100%;
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  font-size: 30px;
-  color: #1890ff;
-  margin: 10px 0;
-  cursor: pointer;
-}
+  .add-product {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    font-size: 30px;
+    color: #1890ff;
+    margin: 10px 0;
+    cursor: pointer;
+  }
 
-.create-form .el-form-item {
-  margin-bottom: 15px !important;
-}
+  .create-form .el-form-item {
+    margin-bottom: 15px !important;
+  }
 </style>

+ 235 - 217
src/views/bpm/handleTask/components/entrust/produceOrder.vue

@@ -14,7 +14,7 @@
           <ele-pro-table
             ref="equiTable"
             :columns="columns"
-            :datasource="datasource"
+            :datasource="orderList"
             :selection.sync="selection"
             :current.sync="current"
             highlight-current-row
@@ -34,235 +34,253 @@
 </template>
 
 <script>
-import { produceOrder } from '@/api/bpm/components/exceptionManagement';
+  import { produceOrder } from '@/api/bpm/components/exceptionManagement';
 
-export default {
-  components: {},
-  props: {
-    selectList: Array,
-    type: {
-      default: 2 //1多选 2单选
-    }
-  },
-  data() {
-    return {
-      planType: [
-        { label: '所有计划类型', value: null },
-        { label: '内销计划', value: '1' },
-        { label: '外销计划', value: '2' },
-        { label: '预制计划', value: '3' }
-      ],
-      equipmentdialog: false,
-      current: null,
-      columns: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          reserveSelection: true,
-          show: this.type == 1
-        },
-        {
-          label: '生产工单号',
-          align: 'center',
-          prop: 'code',
+  export default {
+    components: {},
+    props: {
+      selectList: Array,
+      type: {
+        default: 2 //1多选 2单选
+      }
+    },
+    data() {
+      return {
+        planType: [
+          { label: '所有计划类型', value: null },
+          { label: '内销计划', value: '1' },
+          { label: '外销计划', value: '2' },
+          { label: '预制计划', value: '3' }
+        ],
+        equipmentdialog: false,
+        current: null,
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true,
+            show: this.type == 1
+          },
+          {
+            label: '生产工单号',
+            align: 'center',
+            prop: 'code',
+
+            minWidth: 110
+          },
+
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'planType',
+            label: '计划类型',
+            align: 'center',
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.planType);
+              return obj && obj.label;
+            }
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center'
+          },
+          {
+            prop: 'productCode',
+            label: '产品编号',
+            align: 'center'
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center'
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center'
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center'
+          },
+          {
+            prop: 'batchNo',
+            label: '批号',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'priority',
+            label: '优先级',
+            align: 'center',
+            minWidth: 120,
+            sortable: 'custom'
+          },
 
-          minWidth: 110
-        },
+          {
+            prop: 'formingNum',
+            label: '要求生产数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formingWeight',
+            label: '要求生产重量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formedNum',
+            label: '已生产数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formedWeight',
+            label: '已生产重量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planStartTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planCompleteTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'startTime',
+            label: '实际开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
 
-        {
-          prop: 'productionPlanCode',
-          label: '计划编号',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'planType',
-          label: '计划类型',
-          align: 'center',
-          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
+          },
+
+          {
+            prop: 'teamName',
+            label: '班组',
+            align: 'center',
+            showOverflowTooltip: true
           }
-        },
-        {
-          prop: 'produceRoutingName',
-          label: '工艺路线',
-          align: 'center'
-        },
-        {
-          prop: 'productCode',
-          label: '产品编号',
-          align: 'center'
-        },
-        {
-          prop: 'productName',
-          label: '产品名称',
-          align: 'center'
-        },
-        {
-          prop: 'brandNo',
-          label: '牌号',
-          align: 'center'
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center'
-        },
-        {
-          prop: 'model',
-          label: '型号',
-          align: 'center'
-        },
-        {
-          prop: 'batchNo',
-          label: '批号',
-          align: 'center',
-          minWidth: 100,
-          showOverflowTooltip: true
-        },
+        ],
+        categoryLevelId: null,
+        code: null,
+        selection: [],
+        ids: [],
+        orderList: []
+      };
+    },
 
-        {
-          prop: 'priority',
-          label: '优先级',
-          align: 'center',
-          minWidth: 120,
-          sortable: 'custom'
-        },
+    watch: {},
+    methods: {
+      datasource({ page, where, limit }) {
+        return produceOrder({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      open(ids) {
+        this.equipmentdialog = true;
+      },
 
-        {
-          prop: 'formingNum',
-          label: '要求生产数量',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'formingWeight',
-          label: '要求生产重量',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'formedNum',
-          label: '已生产数量',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'formedWeight',
-          label: '已生产重量',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planStartTime',
-          label: '计划开始时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planCompleteTime',
-          label: '计划结束时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'startTime',
-          label: '实际开始时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
 
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
 
-        {
-          prop: 'teamName',
-          label: '班组',
-          align: 'center',
-          showOverflowTooltip: true
-        }
-      ],
-      categoryLevelId: null,
-      code: null,
-      selection: [],
-      ids: []
-    };
-  },
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      },
 
-  watch: {},
-  methods: {
-    datasource({ page, where, limit }) {
-      return produceOrder({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
-    },
-    open(ids) {
-      this.equipmentdialog = true;
-    },
-    onDone() {
-      this.$nextTick(() => {
-        this.$refs.equiTable.setSelectedRowKeys(this.ids);
-      });
-    },
-    handleClose() {
-      this.equipmentdialog = false;
-      this.$refs.equiTable.clearSelection();
-    },
-    // 选择
-    selected() {
-      let data =
-        this.type == 1
-          ? JSON.parse(JSON.stringify(this.selection))
-          : JSON.parse(JSON.stringify(this.current));
-      data['productNumber'] = data.formingNum;
+      onDone() {
+        this.$nextTick(() => {
+          this.$refs.equiTable.setSelectedRowKeys(this.ids);
+        });
+      },
+      handleClose() {
+        this.equipmentdialog = false;
+        this.$refs.equiTable.clearSelection();
+      },
+      // 选择
+      selected() {
+        let data =
+          this.type == 1
+            ? JSON.parse(JSON.stringify(this.selection))
+            : JSON.parse(JSON.stringify(this.current));
+        data['productNumber'] = data.formingNum;
 
-      this.$emit('choose', data);
-      this.handleClose();
+        this.$emit('choose', data);
+        this.handleClose();
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.tree_col {
-  border: 1px solid #eee;
-  padding: 10px 0;
-  box-sizing: border-box;
-  max-height: 530px;
-  overflow: auto;
-}
-.table_col {
-  padding-left: 10px;
-  ::v-deep .el-table th.el-table__cell {
-    background: #f2f2f2;
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    max-height: 530px;
+    overflow: auto;
+  }
+  .table_col {
+    padding-left: 10px;
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+  .topsearch {
+    margin-bottom: 15px;
   }
-}
-.pagination {
-  text-align: right;
-  padding: 10px 0;
-}
-.btns {
-  text-align: center;
-  padding: 10px 0;
-}
-.topsearch {
-  margin-bottom: 15px;
-}
 </style>

+ 80 - 81
src/views/bpm/handleTask/components/entrust/submit.vue

@@ -11,7 +11,6 @@
 
       <el-form-item
         label="审批建议"
-
         style="margin-bottom: 20px"
         :rules="{
           required: true,
@@ -34,13 +33,13 @@
         @click="handleAudit(1)"
         >通过
       </el-button>
-      <el-button
+      <!-- <el-button
         icon="el-icon-edit-outline"
         type="warning"
         size="mini"
         @click="edit"
         >修改完成时间
-      </el-button>
+      </el-button> -->
 
       <el-button
         icon="el-icon-circle-close"
@@ -88,7 +87,6 @@
         </el-form-item>
         <el-form-item
           label="审批建议"
-
           style="margin-bottom: 20px"
           :rules="{
             required: true,
@@ -112,95 +110,96 @@
 </template>
 
 <script>
-import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
-import dictMixins from '@/mixins/dictMixins';
-import { save } from '@/api/bpm/components/entrust';
+  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
+  import dictMixins from '@/mixins/dictMixins';
+  import { save } from '@/api/bpm/components/entrust';
 
-// import {
-//   assign,
-//   cancel
-// } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
+  // import {
+  //   assign,
+  //   cancel
+  // } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
 
-// 流程实例的详情页,可用于审批
-export default {
-  mixins: [dictMixins],
+  // 流程实例的详情页,可用于审批
+  export default {
+    mixins: [dictMixins],
 
-  name: '',
-  components: {
-    //   Parser
-  },
-  props: {
-    businessId: {
-      default: ''
-    },
-    taskId: {
-      default: ''
-    },
-    id: {
-      default: ''
+    name: '',
+    components: {
+      //   Parser
     },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      visible: false,
-      form: {
-        reason: ''
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
       },
-      formData: {
-        finishTime: ''
+      taskDefinitionKey: {
+        default: ''
       }
-    };
-  },
-  created() {},
-  methods: {
-    async edit() {
-      this.visible = true;
-      this.formData = await this.getTableValue();
     },
-    async handleAudit(status) {
-      //申请人申请
-      if (this.taskDefinitionKey === 'starter') {
-        const data = await this.getTableValue();
-        // return
-        if (data) {
-          await save(data);
+    data() {
+      return {
+        visible: false,
+        form: {
+          reason: ''
+        },
+        formData: {
+          finishTime: ''
         }
-      }
-      await this._approveTaskWithVariables(status);
-    },
-    async save() {
-      await save(this.formData);
-    },
-    async _approveTaskWithVariables(status) {
-      let variables = {
-        pass: !!status
       };
-      let API = !!status ? approveTaskWithVariables : rejectTask;
-      API({
-        id: this.taskId,
-        reason: this.form.reason,
-        variables
-      }).then((res) => {
-        if (res.data.code != '-1') {
-          this.$emit('handleAudit', {
-            status,
-            title: status === 0 ? '驳回' : ''
-          });
-        }
-      });
     },
-    getTableValue() {
-      return new Promise((resolve, reject) => {
-        this.$emit('getTableValue', async (data) => {
-          resolve(await data);
+    created() {},
+    methods: {
+      async edit() {
+        this.visible = true;
+        this.formData = await this.getTableValue();
+      },
+      async handleAudit(status) {
+        //申请人申请
+        if (this.taskDefinitionKey === 'starter') {
+          const data = await this.getTableValue();
+          // return
+          if (data) {
+            await save(data);
+          }
+        }
+        await this._approveTaskWithVariables(status);
+      },
+      async save() {
+        await save(this.formData);
+      },
+      async _approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
         });
-      });
+      },
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+      cancel() {}
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss"></style>

+ 5 - 0
src/views/bpm/handleTask/components/producePlan/detailDialog.vue

@@ -20,6 +20,11 @@
             <el-input :value="planType" disabled></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品名称">
+            <el-input :value="details.productName" disabled></el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="产品编码">
             <el-input :value="details.productCode" disabled></el-input>

+ 2 - 2
vue.config.js

@@ -40,8 +40,8 @@ module.exports = {
         // target: 'http://192.168.1.105:18086',
 
         // target: 'http://192.168.1.251:18186',
-        target: 'http://192.168.1.251:18086',
-        // target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.251:18086',
+        target: 'http://192.168.1.125:18086',
 
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金