695593266@qq.com 10 месяцев назад
Родитель
Сommit
5703623999

+ 17 - 0
src/views/produce/components/feeding/index.vue

@@ -482,6 +482,23 @@
               };
             });
             console.log(arr, 'arr');
+            arr.forEach((it) => {
+              if (it.semiProductList.length != 0) {
+                it.semiProductList.forEach((item) => {
+                  if (item.extInfo && item.extInfo.taskId == -1) {
+                    item.extInfo.taskId = item.extInfo.taskId + '';
+                  }
+                });
+              }
+
+              // if (it.pickOutInList.length != 0) {
+              //   it.pickOutInList.forEach((item) => {
+              //     if (item.extInfo && item.extInfo.taskId == -1) {
+              //       item.extInfo.taskId = item.extInfo.taskId + '';
+              //     }
+              //   });
+              // }
+            });
             this.List = deepClone(arr);
           })
           .finally(() => {

+ 52 - 11
src/views/produce/components/jobBooking/components/batchPackagingGrouping.vue

@@ -94,7 +94,7 @@
                       v-if="i == 0"
                       @input="changeinput"
                       disabled
-                      style="width: 200px"
+                      style="width: 160px"
                     ></el-input>
                     <el-input
                       class="uni-el-input"
@@ -102,7 +102,7 @@
                       type="number"
                       v-else
                       disabled
-                      style="width: 200px"
+                      style="width: 160px"
                     ></el-input>
                     <div class="unit">{{ item.packageUnit }}</div>
                   </div>
@@ -116,12 +116,23 @@
                         class="uni-el-input"
                         v-model="item.packageCell"
                         disabled
-                        style="width: 200px"
+                        style="width: 160px"
                       ></el-input>
                       <div class="unit">{{ item.packageUnit }}</div
                       >/<div class="unit">{{ item.conversionUnit }}</div>
                     </div>
                   </div>
+
+                  <div class="rx ww55" v-if="isReelSpecification">
+                    <div class="lable lable200 rx-cc">盘具规格:</div>
+                    <div class="content content_num">
+                      <el-input
+                        class="uni-el-input"
+                        v-model="reelSpecification"
+                        style="width: 160px"
+                      ></el-input>
+                    </div>
+                  </div>
                 </div>
               </div>
 
@@ -279,7 +290,7 @@
                 v-model="item.formedNumLast"
                 type="number"
                 disabled
-                style="width: 200px"
+                style="width: 160px"
               ></el-input>
               <div class="unit">{{ item.conversionUnit }}</div>
             </div>
@@ -291,7 +302,7 @@
                 <el-input
                   class="uni-el-input"
                   v-model="item.packageCell"
-                  style="width: 200px"
+                  style="width: 160px"
                   @input="changeInputPack(item, i)"
                   :disabled="!item.conversionUnit"
                 ></el-input>
@@ -299,6 +310,20 @@
                 >/<div class="unit">{{ item.conversionUnit }}</div>
               </div>
             </div>
+
+            <div
+              class="rx ww55"
+              v-if="isReelSpecification && item.titel == '最小包装'"
+            >
+              <div class="lable lable200 rx-cc">盘具规格</div>
+              <div class="content content_num">
+                <el-input
+                  class="uni-el-input"
+                  v-model="reelSpecification"
+                  style="width: 160px"
+                ></el-input>
+              </div>
+            </div>
           </div>
         </div>
 
@@ -351,6 +376,7 @@
     packingReport,
     getPackingList
   } from '@/api/produce/workOrder';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
 
   // import {
   // 	getByCode
@@ -455,7 +481,9 @@
         packageTwoCell: '',
         packageTwoUnit: '',
         conversionTwoUnit: '',
-        packageDispositionData: ''
+        packageDispositionData: '',
+        isReelSpecification: false,
+        reelSpecification: ''
       };
     },
     watch: {
@@ -744,7 +772,8 @@
       // this.packageDispositionFn();
       // this.getPackingDetails()
       // this.getPackingDetailsTwo()
-      console.log(this.objData, 'objData');
+      // console.log(this.objData, 'objData');
+      this.getReelSpecification();
     },
 
     methods: {
@@ -759,6 +788,14 @@
         }, 500); // 500毫秒后触发
       },
 
+      async getReelSpecification() {
+        await parameterGetByCode({
+          code: 'dishware_specifications'
+        }).then((res) => {
+          this.isReelSpecification = res.value == '1' ? true : false;
+        });
+      },
+
       changeUserType(e) {
         let list = this.localdataList.find((item) => item.value === e);
         // this.text = e.text;
@@ -1502,7 +1539,8 @@
               outsidePackageUnit: this.DispositionList[2].packageUnit, // 最小包装单位
               outsideConversionUnit: this.DispositionList[2].conversionUnit, // 最小包装单位
               outsideFormedNumLast: this.DispositionList[2].formedNumLast,
-              isNewUnpack: this.isNewUnpack
+              isNewUnpack: this.isNewUnpack,
+              reelSpecification: this.reelSpecification
             };
           } else {
             packInfo = {
@@ -1525,7 +1563,8 @@
                 minimumPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
                 minimumConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
                 minimumFormedNumLast: this.DispositionList[0].formedNumLast, // 总包装数量
-                isNewUnpack: this.isNewUnpack
+                isNewUnpack: this.isNewUnpack,
+                reelSpecification: this.reelSpecification
               };
             } else {
               packInfo = {
@@ -1546,7 +1585,8 @@
                 withinPackageUnit: this.DispositionList[1].packageUnit, // 最小包装单位
                 withinConversionUnit: this.DispositionList[1].conversionUnit, // 最小包装单位
                 withinFormedNumLast: this.DispositionList[1].formedNumLast, // 总包装数量
-                isNewUnpack: this.isNewUnpack
+                isNewUnpack: this.isNewUnpack,
+                reelSpecification: this.reelSpecification
               };
             } else {
               packInfo = {
@@ -1566,7 +1606,8 @@
                 outsidePackageUnit: this.DispositionList[2].packageUnit, // 最小包装单位
                 outsideConversionUnit: this.DispositionList[2].conversionUnit, // 最小包装单位
                 outsideFormedNumLast: this.DispositionList[2].formedNumLast,
-                isNewUnpack: this.isNewUnpack
+                isNewUnpack: this.isNewUnpack,
+                reelSpecification: this.reelSpecification
               }; // 总包装数量
             } else {
               packInfo = {

+ 18 - 1
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -344,7 +344,8 @@
           v-if="
             ![2, 3, 6].includes(Number(item.currentTaskDiagram.type)) &&
             !row.extInfo.isLoss &&
-            item.currentTaskDiagram.isFirstTask != 1
+            item.currentTaskDiagram.isFirstTask != 1 &&
+            item.currentTaskDiagram.taskId != '-1'
           "
           >损耗</el-link
         >
@@ -1018,6 +1019,22 @@
             align: 'center',
             slot: 'index'
           },
+
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             width: 150,
             prop: 'modelType',

+ 15 - 0
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -854,6 +854,21 @@
             slot: 'feedQuantity',
             align: 'center'
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             width: 110,
             prop: 'position',

+ 1 - 1
src/views/produce/components/jobBooking/index.vue

@@ -943,7 +943,7 @@
                   taskId: this.taskObj.id,
                   notFormedNum: null,
                   notFormedWeight: null,
-                  lossNum: null,
+                  lossQuantity: null,
                   lossWeight: null
                 };
 

+ 18 - 0
src/views/produce/components/new_produceOrder.vue

@@ -286,6 +286,22 @@
             minWidth: 110
           },
 
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
           {
             prop: 'planStartTime',
             label: '计划开始时间',
@@ -343,6 +359,7 @@
     watch: {
       taskObj: {
         handler(val) {
+          console.log('123');
           this.reload();
         },
         // immediate: true,
@@ -350,6 +367,7 @@
       },
       current: {
         handler(val) {
+          console.log('456');
           this.reload();
         },
         // immediate: true,

+ 297 - 5
src/views/produce/components/outsourcing/details.vue

@@ -2,6 +2,12 @@
   <div>
     <!-- <el-card shadow="never" v-loading="loading"> -->
     <!-- <search @search="reload" ref="searchRef"> </search> -->
+    <!-- <div>
+      <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
+        <el-tab-pane label="委外" name="1"></el-tab-pane>
+        <el-tab-pane label="请托" name="2"></el-tab-pane>
+      </el-tabs>
+    </div> -->
 
     <!-- 数据表格 -->
     <ele-pro-table
@@ -9,8 +15,9 @@
       :columns="columns"
       :datasource="dataList"
       cache-key="workOrderTable"
-      max-height="68vh"
+      max-height="61vh"
       :need-page="false"
+      v-if="activeName == '1'"
     >
       <template v-slot:toolbar>
         <div class="rx-sc">
@@ -136,6 +143,87 @@
       </template>
     </ele-pro-table>
     <!-- </el-card> -->
+
+    <ele-pro-table
+      ref="table"
+      :columns="colunms1"
+      :datasource="pleaseData"
+      cache-key="workOrderTable"
+      max-height="61vh"
+      :need-page="false"
+      v-if="activeName == '2'"
+    >
+      <template v-slot:toolbar>
+        <div class="rx-sc">
+          <div class="c_title">请托记录 </div>
+          <el-button
+            type="primary"
+            size="mini"
+            style="margin: 0 5px"
+            @click="handleAdd"
+            >新增</el-button
+          >
+        </div>
+      </template>
+
+      <template v-slot:type="{ row }">
+        <span> {{ getPleaseType(row) }}</span>
+      </template>
+
+      <template v-slot:code="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="openPleaseDetail('detail', row)"
+        >
+          {{ row.code }}
+        </el-link>
+      </template>
+
+      <template v-slot:action="{ row }">
+        <!-- <el-link
+          type="primary"
+          v-if="row.status == 0"
+          :underline="false"
+          icon="el-icon-truck"
+          @click="open('edit', row)"
+        >
+          编辑
+        </el-link> -->
+        <el-link
+          type="primary"
+          v-if="row.status == 2"
+          :underline="false"
+          icon="el-icon-truck"
+          @click="openWarehouseEntry(row.id)"
+        >
+          申请入库
+        </el-link>
+        <el-popconfirm
+          class="ele-action"
+          v-if="row.status == 0"
+          title="确定要删除吗?"
+          @confirm="remove([row.id])"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-circle-plus-outline"
+          @click="submit(row)"
+          v-if="row.status == 0"
+        >
+          提交
+        </el-link>
+      </template>
+    </ele-pro-table>
+
     <flow ref="flowRef"></flow>
 
     <release ref="releaseRef" @refresh="releaseRefresh"></release>
@@ -153,6 +241,8 @@
   import Detail from '../../../outsourcing/components/details.vue';
   import timeDialog from '../../../outsourcing/components/timeDialog.vue';
   import { getFile } from '@/api/system/file';
+  import { getList as getPleaseListData } from '@/api/entrust/index';
+  import { getByCode } from '@/api/system/dictionary-data';
   export default {
     components: {
       search,
@@ -161,12 +251,23 @@
       Detail,
       timeDialog
     },
+
+    props: {
+      chooseType: {
+        type: String,
+        default: '1'
+      }
+    },
+
     data() {
       return {
         loading: false,
         code: '',
         dataList: [],
-        workOrderCode: ''
+        workOrderCode: '',
+        activeName: this.chooseType,
+        pleaseData: [],
+        pleaseTypeList: []
       };
     },
     filters: {
@@ -355,12 +456,163 @@
         ];
       },
 
+      colunms1() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'type',
+            label: '类型',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'type'
+          },
+          {
+            prop: 'priority',
+            label: '紧急程度',
+            width: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '一般' : cellValue == 2 ? '紧急' : '';
+            }
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            width: 160,
+            showOverflowTooltip: true,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            width: 130,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'workOrderCode',
+            label: '工单编码',
+            width: 160,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'procedureList',
+            width: 130,
+            showOverflowTooltip: true,
+
+            label: '工序',
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              return cellValue.map((item) => item.produceTaskName).toString();
+            }
+          },
+
+          // {
+          //   prop: 'a',
+          //   label: '关联名称',
+          //   align: 'center'
+          // },
+          {
+            prop: 'factoriesName',
+            label: '所属工厂',
+            align: 'center',
+            width: 130,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'pleaseEntrustDeptName',
+            label: '请托部门',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'pleaseEntrustUserName',
+            label: '请托人',
+            align: 'center',
+            width: 80,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'beEntrustedFactoriesName',
+            label: '受托工厂',
+            align: 'center',
+            width: 130,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'beEntrustedDeptName',
+            label: '受托部门',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'finishTime',
+            label: '完成时间',
+            align: 'center',
+            width: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'describes',
+            label: '需求描述',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            slot: 'status',
+            width: 80,
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              return cellValue == 0
+                ? '草稿'
+                : cellValue == 1
+                ? '审核中'
+                : cellValue == 2
+                ? '审核通过'
+                : '';
+            }
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 180,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+
       clientEnvironmentId() {
         return this.$store.state.user.info.clientEnvironmentId;
       }
     },
     created() {},
 
+    mounted() {
+      this.getPleaseTypeList();
+    },
+
     methods: {
       statusFormatter(status) {
         const obj = this.statusOpt.find((i) => i.value == status);
@@ -375,9 +627,26 @@
       //   });
       // },
 
-      getDataList(code) {
+      async getPleaseTypeList() {
+        let res = await getByCode('entrust_type');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.pleaseTypeList = list;
+        }
+      },
+
+      getPleaseType(item) {
+        const data = this.pleaseTypeList.filter((it) => it.value == item.type);
+
+        return data.length != 0 ? data[0].label : '';
+      },
+
+      async getDataList(code) {
         this.workOrderCode = code;
-        getList({
+        await getList({
           pageNum: 1,
           size: -1,
           workOrderCode: this.workOrderCode
@@ -388,6 +657,17 @@
         });
       },
 
+      async getPleaseData(code) {
+        await getPleaseListData({
+          pageNum: 1,
+          size: -1,
+          code
+        }).then((res) => {
+          this.pleaseData = res.list || [];
+          // this.$forceUpdate();
+        });
+      },
+
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
       },
@@ -411,6 +691,18 @@
         this.$refs.releaseRef.open(row);
       },
 
+      handleClick(tab) {
+        this.activeName = tab._props.name;
+
+        if (this.activeName == '1') {
+          this.getDataList(this.workOrderCode);
+        } else if (this.activeName == '2') {
+          this.getPleaseData(this.workOrderCode);
+        }
+      },
+
+      openPleaseDetail() {},
+
       /* 刷新表格 */
       reload() {
         this.$nextTick(() => {
@@ -426,7 +718,7 @@
 
       handleAdd() {
         // this.$refs.releaseRef.open();
-        this.$emit('outsourcingAdd', 'pick');
+        this.$emit('outsourcingAdd', 'pick', this.activeName);
       },
 
       releaseRefresh() {

+ 49 - 39
src/views/produce/components/outsourcing/index.vue

@@ -5,7 +5,9 @@
         <el-tab-pane label="委外记录" name="1"></el-tab-pane>
         <el-tab-pane label="请托记录" name="2"></el-tab-pane>
       </el-tabs> -->
-      <div class="c_title">委外记录</div>
+      <div class="c_title">{{
+        activeName == '1' ? '委外记录' : '请托记录'
+      }}</div>
     </div>
     <div style="overflow: auto" v-if="activeName == '1'">
       <el-form
@@ -195,20 +197,23 @@
             v-model="attributeData.type"
             style="width: 260px"
           ></DictSelection>
+        </el-form-item>
 
-          <!-- <el-select
-            v-model="attributeData.type"
-            placeholder="请选择"
+        <el-form-item label="紧急程度:" prop="priority">
+          <el-select
             style="width: 260px"
+            v-model="attributeData.priority"
+            placeholder="请选择"
+            clearable
           >
             <el-option
-              v-for="item in pleaseList"
-              :key="item.id"
+              v-for="item in options"
+              :key="item.value"
               :label="item.name"
-              :value="item.id"
+              :value="item.value"
             >
             </el-option>
-          </el-select> -->
+          </el-select>
         </el-form-item>
         <el-form-item label="请托数量:" prop="formedNumLast">
           <el-input
@@ -343,6 +348,7 @@
 
       <div class="btn-box">
         <el-button type="primary" @click="confirm">确认</el-button>
+        <el-button type="primary" @click="cancel">取消</el-button>
       </div>
     </div>
   </div>
@@ -372,7 +378,8 @@
           taskIdes: [],
           factoriesId: '',
           factoriesName: '',
-          taskDataList: []
+          taskDataList: [],
+          priority: ''
         },
         isInWarehouse: true,
         produceList: [],
@@ -389,16 +396,18 @@
             name: '不带料生产委外'
           }
         ],
-        pleaseList: [
+
+        options: [
           {
-            id: 4,
-            name: '带料生产请托'
+            name: '一般',
+            value: 1
           },
           {
-            id: 5,
-            name: '不带料生产请托'
+            name: '紧急',
+            value: 2
           }
         ],
+
         rules: {
           name: [
             { required: true, message: '请输入委外名称', trigger: 'blur' }
@@ -424,7 +433,7 @@
         loading: false,
         operationType: null,
         workListIds: [],
-        activeName: '1',
+        activeName: this.chooseType,
         textarea2: '',
         gysList: [],
         factoryList: [],
@@ -439,6 +448,10 @@
       taskName: {
         type: String,
         default: ''
+      },
+      chooseType: {
+        type: String,
+        default: '1'
       }
     },
 
@@ -483,11 +496,12 @@
     mounted() {
       this.getContactList();
       this.getFactoryList();
-      if (this.activeName == '1') {
-        this.attributeData.name = this.outsourceFormVal.name + '委托';
+      console.log(this.chooseType, '委托');
+      if (this.chooseType == '1') {
+        this.attributeData.name = this.taskName + '委托';
         // this.$set(this.outsourceFormVal, 'name', this.taskName + '委托');
-      } else if (this.activeName == '2') {
-        this.attributeData.name = this.outsourceFormVal.name + '请托';
+      } else if (this.chooseType == '2') {
+        this.attributeData.name = this.taskName + '请托';
         // this.$set(this.outsourceFormVal, 'name', this.taskName + '请托');
       }
     },
@@ -539,16 +553,16 @@
         console.log(this.gysList, '供应商数据');
       },
 
-      handleClick(tab, event) {
-        this.activeName = tab._props.name;
-        if (this.activeName == '1') {
-          this.resetData();
-          this.attributeData.name = this.taskName + '委托';
-        } else if (this.activeName == '2') {
-          this.resetData();
-          this.attributeData.name = this.taskName + '请托';
-        }
-      },
+      // handleClick(tab, event) {
+      //   this.activeName = tab._props.name;
+      //   if (this.activeName == '1') {
+      //     this.resetData();
+      //     this.attributeData.name = this.taskName + '委托';
+      //   } else if (this.activeName == '2') {
+      //     this.resetData();
+      //     this.attributeData.name = this.taskName + '请托';
+      //   }
+      // },
 
       // 仓库
       getWarehouseFn() {
@@ -621,6 +635,7 @@
         this.attributeData.taskIdes = [];
         this.attributeData.factoriesId = '';
         this.attributeData.taskDataList = [];
+        this.attributeData.priority = '';
       },
 
       //跳转
@@ -645,10 +660,6 @@
               });
               this.attributeData.taskIds =
                 this.attributeData.taskIdes.join(',');
-              console.log(
-                this.attributeData.taskDataList,
-                'this.attributeData.taskDataList1'
-              );
               this.$emit('changePlugIn', this.attributeData, this.activeName);
             } else if (this.activeName == '2') {
               const obj = this.factoryList.find(
@@ -664,11 +675,6 @@
               });
               this.attributeData.taskIds =
                 this.attributeData.taskIdes.join(',');
-              console.log(
-                this.attributeData.taskDataList,
-                'this.attributeData.taskDataList2'
-              );
-              console.log(this.attributeData);
               this.$emit('changePlugIn', this.attributeData, this.activeName);
             }
           } else {
@@ -678,7 +684,7 @@
         });
       },
       cancel() {
-        this.$emit('changeCancel');
+        this.$emit('changeCancel', this.activeName);
       }
     },
     created() {
@@ -730,4 +736,8 @@
   ::v-deep .el-select__tags::-webkit-scrollbar {
     height: 2px !important;
   }
+
+  ::v-deep .el-form-item {
+    margin-bottom: 13px !important;
+  }
 </style>

+ 1 - 1
src/views/produce/components/outsourcing/outsourceList.vue

@@ -10,7 +10,7 @@
           outObj.name
         }}</el-descriptions-item>
         <el-descriptions-item label="委外类型">{{
-          outObj.type == 4 ? '带料委外' : '料委外'
+          outObj.type == 4 ? '带料委外' : '不带料委外'
         }}</el-descriptions-item>
         <!-- <el-descriptions-item label="直接入库">{{ outObj.isInWarehouse == 1 ? '是' : '否' }}</el-descriptions-item> -->
         <el-descriptions-item label="直接入库">{{ '是' }}</el-descriptions-item>

+ 13 - 10
src/views/produce/components/outsourcing/pleaseEntrust.vue

@@ -9,14 +9,17 @@
         <el-descriptions-item label="请托名称">{{
           outObj.name
         }}</el-descriptions-item>
-        <el-descriptions-item label="请托类型">
-          <template>
-            <DictSelection
-              dictName="请托类型"
-              v-model="attributeData.type"
-            ></DictSelection>
-          </template>
-        </el-descriptions-item>
+        <el-descriptions-item label="请托类型">{{
+          outObj.type == '1'
+            ? '加工'
+            : outObj.type == '2'
+            ? '检测'
+            : outObj.type == '3'
+            ? '检验'
+            : outObj.type == '3'
+            ? '装配'
+            : ''
+        }}</el-descriptions-item>
         <!-- <el-descriptions-item label="直接入库">{{ outObj.isInWarehouse == 1 ? '是' : '否' }}</el-descriptions-item> -->
         <el-descriptions-item label="直接入库">{{ '是' }}</el-descriptions-item>
       </el-descriptions>
@@ -368,7 +371,7 @@
       </el-tab-pane>
       <el-tab-pane label="产出清单" name="2">
         <div class="materialList">
-          <div class="u-reset">
+          <!-- <div class="u-reset">
             <el-button
               type="primary"
               size="small"
@@ -377,7 +380,7 @@
             >
               添加
             </el-button>
-          </div>
+          </div> -->
           <div v-for="(item, index) in standardOutputList" :key="index">
             <label class="listBox rx-bs">
               <div class="listBox-con">

+ 7 - 1
src/views/produce/components/picking/index.vue

@@ -444,7 +444,13 @@
 
             arr[0].pickList.forEach((it) => {
               it.warehouseIdList = [];
-              it.warehouseIdList.push(it.warehouseId);
+              if (it.warehouseId) {
+                it.warehouseIdList.push(it.warehouseId);
+              } else {
+                if (it.warehouseList.length != 0) {
+                  it.warehouseIdList.push(it.warehouseList[0].id);
+                }
+              }
 
               it.warehouseList.forEach((i) => {
                 i.warehouse_name = i.name;

+ 64 - 14
src/views/produce/components/warehousing/components/newJobDdBom.vue

@@ -222,7 +222,7 @@
         handler(newVal) {
           console.log(newVal, '996633');
 
-          if (newVal.semiProductList.length) {
+          if (newVal.semiProductList.length != 0) {
             let formedNum = 0;
             let noFormingNum = 0;
             let formedWeight = 0;
@@ -234,17 +234,31 @@
                 item.extInfo.isQualified == 1 ||
                 item.extInfo.isQualified == 3
               ) {
-                formedNum = formedNum + Number(item.feedQuantity);
-                formedWeight = formedWeight + Number(item.extInfo.reportWeight);
+                formedNum = this.add(formedNum, Number(item.feedQuantity));
+                formedWeight = this.add(
+                  formedWeight,
+                  Number(item.extInfo.reportWeight)
+                );
+                // formedNum = formedNum + Number(item.feedQuantity);
+                // formedWeight = formedWeight + Number(item.extInfo.reportWeight);
               } else {
                 if (item.extInfo.notType == 5 || item.extInfo.notType == 8) {
-                  formedNum = formedNum + Number(item.feedQuantity);
+                  // formedNum = formedNum + Number(item.feedQuantity);
+                  formedNum = this.add(formedNum, Number(item.feedQuantity));
                 } else {
-                  noFormingNum = noFormingNum + Number(item.feedQuantity);
+                  // noFormingNum = noFormingNum + Number(item.feedQuantity);
+                  noFormingNum = this.add(
+                    noFormingNum,
+                    Number(item.feedQuantity)
+                  );
                 }
                 // noFormingNum = noFormingNum + Number(item.feedQuantity);
-                notFormedWeight =
-                  notFormedWeight + Number(item.extInfo.reportWeight);
+                // notFormedWeight =
+                //   notFormedWeight + Number(item.extInfo.reportWeight);
+                notFormedWeight = this.add(
+                  notFormedWeight,
+                  Number(item.extInfo.reportWeight)
+                );
               }
             });
 
@@ -259,7 +273,7 @@
             this.$forceUpdate();
           }
 
-          if (newVal.product.length) {
+          if (newVal.product.length != 0) {
             let formedNum = 0;
             let noFormingNum = 0;
             let formedWeight = 0;
@@ -271,17 +285,31 @@
                 item.extInfo.isQualified == 1 ||
                 item.extInfo.isQualified == 3
               ) {
-                formedNum = formedNum + Number(item.feedQuantity);
-                formedWeight = formedWeight + Number(item.extInfo.reportWeight);
+                formedNum = this.add(formedNum, Number(item.feedQuantity));
+                formedWeight = this.add(
+                  formedWeight,
+                  Number(item.extInfo.reportWeight)
+                );
+                // formedNum = formedNum + Number(item.feedQuantity);
+                // formedWeight = formedWeight + Number(item.extInfo.reportWeight);
               } else {
                 if (item.extInfo.notType == 5 || item.extInfo.notType == 8) {
-                  formedNum = formedNum + Number(item.feedQuantity);
+                  // formedNum = formedNum + Number(item.feedQuantity);
+                  formedNum = this.add(formedNum, Number(item.feedQuantity));
                 } else {
-                  noFormingNum = noFormingNum + Number(item.feedQuantity);
+                  // noFormingNum = noFormingNum + Number(item.feedQuantity);
+                  noFormingNum = this.add(
+                    noFormingNum,
+                    Number(item.feedQuantity)
+                  );
                 }
                 // noFormingNum = noFormingNum + Number(item.feedQuantity);
-                notFormedWeight =
-                  notFormedWeight + Number(item.extInfo.reportWeight);
+                // notFormedWeight =
+                //   notFormedWeight + Number(item.extInfo.reportWeight);
+                notFormedWeight = this.add(
+                  notFormedWeight,
+                  Number(item.extInfo.reportWeight)
+                );
               }
             });
 
@@ -450,6 +478,28 @@
         }
       },
 
+      toInteger(num) {
+        const len = this.getDecimalLength(num);
+        return {
+          int: Math.round(num * Math.pow(10, len)),
+          factor: Math.pow(10, len)
+        };
+      },
+
+      add(a, b) {
+        const { int: aInt, factor: aFactor } = this.toInteger(a);
+        const { int: bInt, factor: bFactor } = this.toInteger(b);
+        const maxFactor = Math.max(aFactor, bFactor);
+        return (
+          (aInt * (maxFactor / aFactor) + bInt * (maxFactor / bFactor)) /
+          maxFactor
+        );
+      },
+
+      getDecimalLength(num) {
+        return (num.toString().split('.')[1] || '').length;
+      },
+
       singleQuery() {
         console.log(this.item.workReportInfo);
 

+ 119 - 22
src/views/produce/index.vue

@@ -21,29 +21,41 @@
       <!-- <Search></Search> -->
       <div class="content_box_tab">
         <el-input
-          style="width: 180px"
+          style="width: 160px"
           clearable
           v-model="name"
           placeholder="请输入筛选项"
           @input="seekInput"
         />
+        <el-button type="text" @click="updataTaskList">刷新</el-button>
         <el-tabs
           v-model="activeName"
           type="card"
           stretch
           @tab-click="tabClickValue"
         >
+          <!-- :render-content="renderContent"-->
           <el-tab-pane label="工序" name="0">
-            <el-tree
-              :data="produceTaskList"
-              :props="defaultProps"
-              node-key="id"
-              :highlight-current="true"
-              @node-click="handleNodeClick"
-              ref="taskListRef"
-            >
-            </el-tree>
-
+            <div class="custom-tree-node">
+              <el-tree
+                :data="produceTaskList"
+                :props="defaultProps"
+                node-key="id"
+                :highlight-current="true"
+                @node-click="handleNodeClick"
+                ref="taskListRef"
+                :key="treeKey"
+              >
+                <span class="custom-tree-node" slot-scope="{ node, data }">
+                  <span>{{ node.label }}</span>
+                  <span
+                    style="color: red"
+                    v-if="data.number != '0' && data.number"
+                    >({{ data.number >= 100 ? '99+' : data.number }})</span
+                  >
+                </span>
+              </el-tree>
+            </div>
             <!--
               v-loading="treeLoading"
               :node-key="nodeKey"
@@ -54,6 +66,7 @@
               v-bind="$attrs"
               :default-expand-all="defaultExpandAll" -->
           </el-tab-pane>
+
           <!-- <el-tab-pane label="工位" name="second"> -->
           <!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
               ref="treeList" eqDevice="sb" /> -->
@@ -145,6 +158,7 @@
             <div class="top">
               <!-- /工单列表 -->
               <produceOrder
+                v-if="produceTaskList.length != 0"
                 @workSelect="workSelect"
                 @rowClick="rowClick"
                 ref="produceOrder"
@@ -237,12 +251,14 @@
                   ref="outsourcingListRef"
                   @outsourcingAdd="outsourcingAdd"
                   v-if="!isStep && !isOutsource && !isPleaseEntrust"
+                  :chooseType="chooseType"
                 ></outsourcingDetails>
                 <outsourcing
                   :outsourceFormVal="outsourceForm"
                   :taskName="taskObj.name"
                   @changePlugIn="changePlugIn"
                   @changeCancel="changeCancel"
+                  :chooseType="chooseType"
                   v-if="isStep"
                 ></outsourcing>
 
@@ -376,6 +392,7 @@
     checkPleaseEntrust
   } from '@/api/produce/index';
   import prenatalExamination from './components/prenatalExamination/index.vue';
+  import { workorderPage2 } from '@/api/produce/workOrder.js';
 
   export default {
     components: {
@@ -421,6 +438,7 @@
         arr: [],
         arrTow: [],
         produceTaskList: [],
+        taskDataList: [],
         produceTaskInfo: null,
         isType: '',
         isStep: false,
@@ -468,7 +486,10 @@
           { label: '过程检测', action: 'Edit' },
           { label: '产后检查', action: 'Favorite' }
         ],
-        isPreProductionResult: true
+        isPreProductionResult: true,
+        chooseType: '1',
+        isUpdataTask: false,
+        treeKey: '1'
       };
     },
 
@@ -654,6 +675,7 @@
               v.newName = `${v.workCenterName}-${v.name}`;
             });
             this.produceTaskList = res;
+            this.taskDataList = res;
             this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
             //默认选择第一个工序
             if (this.produceTaskList?.length) {
@@ -665,10 +687,27 @@
               });
               this.produceTaskInfo = this.produceTaskList[0];
             }
+            this.getTaskWorkNumber();
           });
         }
       },
 
+      //获取工序下所有的工单集合
+      async getTaskWorkNumber() {
+        for (const [index, item] of this.taskDataList.entries()) {
+          await workorderPage2({
+            pageNum: 1,
+            size: 5000,
+            taskId: item.id
+          }).then((res) => {
+            this.taskDataList[index].number = res.count;
+          });
+        }
+
+        this.produceTaskList = this.taskDataList;
+        this.treeKey = Date.now();
+      },
+
       // 获取工位
       getFactoryworkstationPageList() {
         factoryworkstationPage({ pageNum: 1, size: 99999999 }).then((res) => {
@@ -680,16 +719,30 @@
         });
       },
 
-      changeCancel() {
+      changeCancel(activeType) {
         this.isStep = false;
-        this.$nextTick(() => {
-          this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
-        });
+        this.chooseType = activeType;
+        // this.$nextTick(() => {
+        //   this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
+        // });
+        if (this.chooseType == '1') {
+          this.$nextTick(() => {
+            this.$refs.outsourcingListRef.getDataList(
+              this.workData.list[0].code
+            );
+          });
+        } else if (this.chooseType == '2') {
+          this.$nextTick(() => {
+            this.$refs.outsourcingListRef.getPleaseData(
+              this.workData.list[0].code
+            );
+          });
+        }
       },
 
       closeForm() {
         this.isOutsource = false;
-        // this.isPleaseEntrust = false;
+        this.isPleaseEntrust = false;
         this.$nextTick(() => {
           this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
         });
@@ -697,12 +750,17 @@
       outScucc() {
         // this.operationType = null;
         this.isOutsource = false;
-        // this.isPleaseEntrust = false;
+        this.isPleaseEntrust = false;
         this.$nextTick(() => {
           this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
         });
       },
 
+      updataTaskList() {
+        this.isUpdataTask = true;
+        this.getTaskList();
+      },
+
       // 切换组件
       async changePlugIn(e, index) {
         if (index == '1') {
@@ -713,7 +771,11 @@
             workOrderId: e.workOrderId,
             quantity: e.formedNumLast
           };
-          const res = await checkOutsourceMaterial(req);
+
+          const URL =
+            index == '1' ? checkOutsourceMaterial : checkPleaseEntrust;
+
+          const res = await URL(req);
 
           this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
 
@@ -740,6 +802,24 @@
         }
       },
 
+      renderContent(h, { node, data, store }) {
+        // Use createElement syntax instead of JSX
+        return h('span', { class: 'custom-tree-node' }, [
+          // h('span', node.label),
+          h(
+            'el-badge',
+            {
+              props: {
+                value: data.number != '0' ? data.number : '',
+                max: 99
+              },
+              class: 'item'
+            },
+            [h('span', node.label)]
+          )
+        ]);
+      },
+
       workSelect(data) {
         this.workTaskId = data.list.length > 0 ? data.list[0].taskId : null;
         this.workStepQueryParam.taskId =
@@ -1005,8 +1085,9 @@
         }
       },
 
-      outsourcingAdd() {
+      outsourcingAdd(type, activeName) {
         this.getTaskInstanceByIdFn(this.workListIds[0]);
+        this.chooseType = activeName;
         this.isStep = true;
       },
 
@@ -1021,14 +1102,15 @@
           this.outsourceForm = {
             ...res.data
           };
-          this.outsourceForm.name = this.taskObj.name + '委外';
+          // this.outsourceForm.name = this.taskObj.name + '委外';
           this.isStep = false;
           this.isOutsource = false;
+          this.isPleaseEntrust = false;
 
           if (res.data.outsource) {
             this.isType = '3';
             console.log(this.workData, 'this.workData');
-            if (!this.isStep && !this.isOutsource) {
+            if (!this.isStep && !this.isOutsource && !this.isPleaseEntrust) {
               this.$nextTick(() => {
                 this.$refs.outsourcingListRef.getDataList(
                   this.workData.list[0].code
@@ -1437,4 +1519,19 @@
     max-width: 500px;
     backdrop-filter: blur(5px);
   }
+
+  .custom-tree-node {
+    // position: absolute;
+    // flex: 1;
+    // display: flex;
+    // align-items: center;
+    // justify-content: space-between;
+    font-size: 14px;
+    padding-right: 8px;
+  }
+
+  .item {
+    margin-top: 10px;
+    margin-right: 40px;
+  }
 </style>

+ 18 - 1
src/views/produceOrder/components/details/index.vue

@@ -62,6 +62,19 @@
             ></jobDetails>
           </el-tab-pane>
 
+          <el-tab-pane label="领料详情">
+            <pickDetails
+              :isDetails="true"
+              :workOrderInfo="workOrderInfo"
+            ></pickDetails>
+          </el-tab-pane>
+
+          <el-tab-pane label="生产明细">
+            <productionDetails
+              :workOrderInfo="workOrderInfo"
+            ></productionDetails>
+          </el-tab-pane>
+
           <!-- <el-tab-pane label="退料详情">
           </el-tab-pane> -->
         </el-tabs>
@@ -76,12 +89,16 @@
   import feedDetails from '@/views/produce/components/feeding/details.vue';
   import jobDetails from '@/views/produce/components/jobBooking/details.vue';
   import { getTaskInstanceList } from '@/api/produce/job';
+  import productionDetails from '@/views//workOrderList/components/productionDetails.vue';
+  import pickDetails from '../../details.vue';
 
   export default {
     components: {
       Info,
       feedDetails,
-      jobDetails
+      jobDetails,
+      productionDetails,
+      pickDetails
     },
     data() {
       return {

+ 286 - 0
src/views/produceOrder/details.vue

@@ -0,0 +1,286 @@
+<template>
+  <div>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      max-height="68vh"
+      :datasource="dataList"
+      cache-key="pickingDetails"
+      highlight-current-row
+      @row-click="rowClick"
+      :need-page="false"
+      @refresh="refresh"
+    >
+      <template v-slot:type="{ row }">
+        <!-- <el-button type="text" size="mini" @click="handDetailed(row)"
+          >详情</el-button
+        > -->
+        <el-tag v-if="row.type == 1">自建领料</el-tag>
+        <el-tag v-if="row.type == 2">工单领料</el-tag>
+        <el-tag v-if="row.type == 3">委外领料</el-tag>
+      </template>
+
+      <template v-slot:action="{ row }">
+        <el-button type="text" size="mini" @click="handDetailed(row)"
+          >详情</el-button
+        >
+      </template>
+
+      <template v-slot:status="{ row }">
+        <el-tag
+          :type="['danger', 'success', 'warning', 'danger'][row.status]"
+          effect="dark"
+          style="margin: 3px 0"
+          >{{ statusList[row.status] }}</el-tag
+        >
+      </template>
+    </ele-pro-table>
+
+    <detailed
+      @detailedClose="detailedClose"
+      v-if="detailedShow"
+      :detailedObj="detailedObj"
+    ></detailed>
+
+    <!-- <outsourcingPickingList
+      v-if="outsourcingPickingShow"
+      ref="outsourcingPickingListRef"
+      :workTaskId="workListIds[0]"
+      :taskId="taskId"
+      :workList="workList"
+      @closeOutsourcingPicking="closeOutsourcingPicking"
+    ></outsourcingPickingList> -->
+
+    <!-- <picking
+      v-if="pickingShow"
+      @close="pickingClose"
+      :workListIds="workListIds"
+    ></picking> -->
+  </div>
+</template>
+
+<script>
+  import { pickDetails } from '@/api/produce/picking';
+  import { workorderList } from '@/api/produce/workOrder';
+  import detailed from '@/views/produce/components/picking/detailed.vue';
+  // import outsourcingPickingList from './outsourcingPickingList.vue';
+  import { getTaskInstanceById } from '@/api/produce/index';
+  import { checkOutsource, listOutsource } from '@/api/produce/picking';
+  // import picking from './outsourceIndex.vue';
+
+  import { boolean } from 'mathjs';
+  export default {
+    name: 'picking-details',
+    components: { detailed },
+    props: {
+      isDetails: {
+        type: Boolean,
+        default: false
+      },
+      workTaskId: {},
+      taskId: {},
+      workOrderInfo: {
+        type: Object,
+        default: {}
+      }
+    },
+    data() {
+      return {
+        dataList: [],
+        detailedShow: false,
+        detailedObj: null,
+
+        statusList: ['未领料', '领料中', '已出库', '已驳回'],
+        outsourcingPickingShow: false,
+        workList: [],
+        pickingShow: false
+      };
+    },
+
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   label: '工序',
+          //   prop: 'taskName',
+          //   width: 120,
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
+          {
+            prop: 'createTime',
+            label: '领料时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '领料单编号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'name',
+            label: '领料单名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'type',
+            label: '领料类型',
+            align: 'center',
+            slot: 'type',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'executorName',
+            label: '领料人',
+            align: 'center'
+          },
+
+          {
+            prop: 'status',
+            slot: 'status',
+            label: '状态',
+            align: 'center'
+          },
+
+          {
+            prop: '',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action'
+          }
+        ];
+      },
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+
+    mounted() {
+      const ids = [];
+      ids.push(this.workOrderInfo.id);
+      this.getList(ids);
+    },
+
+    methods: {
+      getList(workListIds) {
+        this.workListIds = workListIds || [];
+        pickDetails(workListIds).then((res) => {
+          this.dataList = res || [];
+          this.$forceUpdate();
+        });
+      },
+
+      rowClick(row) {},
+
+      handleAdd() {
+        this.$emit('pickAdd', 'pick');
+      },
+
+      refresh() {
+        this.getList(this.workListIds);
+      },
+
+      handDetailed(row) {
+        this.detailedObj = JSON.stringify(row);
+        this.detailedShow = true;
+      },
+
+      detailedClose() {
+        this.detailedShow = false;
+      },
+      openOutsourcingPicking() {
+        if (this.workListIds) {
+          this.getTaskInstanceByIdFn();
+          // this.outsourcingPickingShow=true
+        } else {
+          this.$message.warning('请选择工单');
+        }
+      },
+      closeOutsourcingPicking() {
+        this.outsourcingPickingShow = false;
+      },
+
+      pickingClose() {
+        this.pickingShow = false;
+        this.getList(this.workListIds);
+      },
+
+      //获取工单列表
+      getTaskInstanceByIdFn() {
+        if (this.workListIds.length == 1) {
+          this.pickingShow = true;
+        } else {
+          this.$message.warning('只能选择一个工单进行委外领料');
+        }
+
+        // let param = {
+        //   ids: [this.workListIds[0]],
+        //   taskId: this.taskId
+        // };
+        // workorderList(param)
+        //   .then((res) => {
+        //     let _arr = res.map((e) => {
+        //       e.pickList = [...e.bomDetailDTOS];
+        //       e.bomDetailDTOS = [];
+        //       return e;
+        //     });
+
+        //     this.workList = JSON.parse(JSON.stringify(_arr));
+
+        //     console.log(this.workList, 'this.workList');
+        //     this.outsourcingPickingShow = true;
+
+        // this.getOutsourcingDataList(
+        //   this.workList[0].currentTaskDiagram.taskId
+        // );
+
+        // this.$forceUpdate();
+        // })
+        // .finally(() => {});
+        // checkOutsource({
+        //   ids: [this.workListIds[0]],
+        //   taskId: this.workTaskId
+        // }).then((res) => {
+        //   console.log(res);
+        // });
+        // getTaskInstanceById(this.workListIds[0]).then((res) => {
+        //   // console.log(res,this.workTaskId, 'res2345678');
+        //   let { data } = res;
+        //   if (data.length) {
+        //     let arr = data.filter((item) => item.taskId == this.workTaskId);
+        //     console.log(arr, 'arr');
+        //     console.log(arr, this.workTaskId, 'res2345678');
+        //     if (arr[0].existOutsource) {
+        //     } else {
+        //       this.$message.warning('当前工序不能委外领料');
+        //     }
+        //   }
+        // });
+      }
+    },
+    created() {}
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 16 - 1
src/views/produceOrder/index.vue

@@ -554,6 +554,21 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'productName',
             label: '名称',
@@ -1109,7 +1124,7 @@
       },
 
       handleQRcode(row) {
-        console.log('clientEnvironmentId', this.clientEnvironmentId)
+        console.log('clientEnvironmentId', this.clientEnvironmentId);
         if (this.clientEnvironmentId == 2) {
           this.$refs.printSrRef.open([row.id]);
         } else if (this.clientEnvironmentId == 3) {

+ 95 - 24
src/views/produceOrder/workReport.vue

@@ -203,12 +203,15 @@
                       <outsourcingDetails
                         ref="outsourcingListRef"
                         @outsourcingAdd="outsourcingAdd"
-                        v-if="!isStep && !isOutsource"
+                        v-if="!isStep && !isOutsource && !isPleaseEntrust"
+                        :chooseType="chooseType"
                       ></outsourcingDetails>
                       <outsourcing
                         :outsourceFormVal="outsourceForm"
+                        :taskName="taskObj.name"
                         @changePlugIn="changePlugIn"
                         @changeCancel="changeCancel"
+                        :chooseType="chooseType"
                         v-if="isStep"
                       ></outsourcing>
 
@@ -219,6 +222,13 @@
                         @outScucc="outScucc"
                         v-if="isOutsource"
                       ></outsourceList>
+
+                      <pleaseEntrust
+                        :outsourceFormVal="outObj"
+                        @closeForm="closeForm"
+                        @outScucc="outScucc"
+                        v-if="isPleaseEntrust"
+                      ></pleaseEntrust>
                     </div>
                   </div>
                 </template>
@@ -307,6 +317,7 @@
   // import workes from './components/workPlan/components/work.vue';
   import warehousing from '@/views/produce/components/warehousing/index.vue';
   import outsourceList from '@/views/produce/components/outsourcing/outsourceList.vue';
+  import pleaseEntrust from '@/views/produce/components/outsourcing/pleaseEntrust.vue';
   import workStep from '@/views/produce/components/workStep/index.vue';
   import createError from '@/views/produce/components/createError.vue';
   import productionDetails from '../workOrderList/components/productionDetails.vue';
@@ -318,7 +329,8 @@
     checkOutsourceMaterial,
     listTask,
     factoryworkstationPage,
-    nextTask
+    nextTask,
+    checkPleaseEntrust
   } from '@/api/produce/index';
   import { getTaskInstanceList } from '@/api/produce/job';
   import { workorderInfo } from '@/api/produceOrder/index.js';
@@ -349,7 +361,8 @@
       feedDetails,
       jobDetails,
       productionDetails,
-      outsourcingDetails
+      outsourcingDetails,
+      pleaseEntrust
     },
     data() {
       return {
@@ -384,6 +397,7 @@
         workData: {},
         isFullscreen: false,
         isOutsource: false,
+        chooseType: '1',
         routeObj: {
           id: null
         },
@@ -409,7 +423,8 @@
         newId: '',
         curTaskObj: null,
         produceList: [],
-        workPlanType: ''
+        workPlanType: '',
+        isPleaseEntrust: false
       };
     },
 
@@ -550,15 +565,23 @@
         });
       },
 
-      changeCancel() {
+      changeCancel(activeType) {
         this.isStep = false;
-        this.$nextTick(() => {
-          this.$refs.outsourcingListRef.getDataList(this.workData.code);
-        });
+        this.chooseType = activeType;
+        if (this.chooseType == '1') {
+          this.$nextTick(() => {
+            this.$refs.outsourcingListRef.getDataList(this.workData.code);
+          });
+        } else if (this.chooseType == '2') {
+          this.$nextTick(() => {
+            this.$refs.outsourcingListRef.getPleaseData(this.workData.code);
+          });
+        }
       },
 
       closeForm() {
         this.isOutsource = false;
+        this.isPleaseEntrust = false;
         this.$nextTick(() => {
           this.$refs.outsourcingListRef.getDataList(this.workData.code);
         });
@@ -566,27 +589,65 @@
       outScucc() {
         // this.operationType = null;
         this.isOutsource = false;
+        this.isPleaseEntrust = false;
         this.$nextTick(() => {
           this.$refs.outsourcingListRef.getDataList(this.workData.code);
         });
       },
 
       // 切换组件
-      async changePlugIn(e) {
-        this.outObj = e;
-
-        let req = {
-          taskId: e.taskId,
-          taskIds: e.taskIds,
-          workOrderId: e.workOrderId,
-          quantity: e.formedNumLast
-        };
-        const res = await checkOutsourceMaterial(req);
+      // async changePlugIn(e) {
+      //   this.outObj = e;
+
+      //   let req = {
+      //     taskId: e.taskId,
+      //     taskIds: e.taskIds,
+      //     workOrderId: e.workOrderId,
+      //     quantity: e.formedNumLast
+      //   };
+      //   const res = await checkOutsourceMaterial(req);
 
-        this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
+      //   this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
 
-        this.isStep = false;
-        this.isOutsource = true;
+      //   this.isStep = false;
+      //   this.isOutsource = true;
+      // },
+
+      async changePlugIn(e, index) {
+        if (index == '1') {
+          this.outObj = e;
+          let req = {
+            taskId: e.taskId,
+            taskIds: e.taskIds,
+            workOrderId: e.workOrderId,
+            quantity: e.formedNumLast
+          };
+
+          const URL =
+            index == '1' ? checkOutsourceMaterial : checkPleaseEntrust;
+
+          const res = await URL(req);
+
+          this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
+
+          this.isStep = false;
+          this.isOutsource = true;
+        } else if (index == '2') {
+          this.outObj = e;
+          let req = {
+            taskId: e.taskId,
+            taskIds: e.taskIds,
+            workOrderId: e.workOrderId,
+            quantity: e.formedNumLast
+          };
+
+          const res = await checkPleaseEntrust(req);
+
+          this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
+
+          this.isStep = false;
+          this.isPleaseEntrust = true;
+        }
       },
 
       pickingWokeClose() {
@@ -839,8 +900,14 @@
         }
       },
 
-      outsourcingAdd() {
+      // outsourcingAdd() {
+      //   this.getTaskInstanceByIdFn(this.workListIds[0]);
+      //   this.isStep = true;
+      // },
+
+      outsourcingAdd(type, activeName) {
         this.getTaskInstanceByIdFn(this.workListIds[0]);
+        this.chooseType = activeName;
         this.isStep = true;
       },
 
@@ -855,12 +922,16 @@
           this.outsourceForm = {
             ...res.data
           };
-          this.outsourceForm.name = this.taskObj.taskTypeName + '委外';
+
+          this.isStep = false;
+          this.isOutsource = false;
+          this.isPleaseEntrust = false;
+          // this.outsourceForm.name = this.taskObj.taskTypeName + '委外';
 
           if (res.data.outsource) {
             this.isType = '3';
             // this.getTaskInstanceByIdFn(workOrderId);
-            if (!this.isStep && !this.isOutsource) {
+            if (!this.isStep && !this.isOutsource && !this.isPleaseEntrust) {
               this.$nextTick(() => {
                 this.$refs.outsourcingListRef.getDataList(this.workData.code);
               });

+ 15 - 0
src/views/produceWord/index.vue

@@ -186,6 +186,21 @@ r++<template>
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'specification',
             label: '规格',