695593266@qq.com 10 ماه پیش
والد
کامیت
c8184baba6

+ 1 - 1
qiankun_config/store.js

@@ -19,6 +19,6 @@ export default function (state) {
     store.commit('user/setUserInfo', state.user.info);
   }
   if (state.user?.authorityDept) {
-    store.dispatch('user/getCurrentUserAuthorityDept');
+    // store.dispatch('user/getCurrentUserAuthorityDept');
   }
 }

+ 1 - 1
src/views/login/index.vue

@@ -191,7 +191,7 @@
               this.$store.commit('user/setUserInfo', res.data);
               this.loading = false;
               this.$message.success(res.message);
-              this.$store.dispatch('user/getCurrentUserAuthorityDept');
+              // this.$store.dispatch('user/getCurrentUserAuthorityDept');
               this.goHome();
             })
             .catch((e) => {

+ 3 - 1
src/views/outsourcing/components/details.vue

@@ -47,7 +47,9 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="状态:" prop="status">
-            <el-tag>{{ row.status == 1 ? '已发布' : '未发布' }}</el-tag>
+            <el-tag>{{
+              row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
+            }}</el-tag>
           </el-form-item>
         </el-col>
       </el-row>

+ 3 - 1
src/views/outsourcing/index.vue

@@ -47,7 +47,9 @@
         </template>
 
         <template v-slot:status="{ row }">
-          <el-tag>{{ row.status == 1 ? '已发布' : '未发布' }}</el-tag>
+          <el-tag>{{
+            row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
+          }}</el-tag>
         </template>
 
         <template v-slot:outsourceScene="{ row }">

+ 6 - 4
src/views/produce/components/jobBooking/components/batchPackagingGrouping.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div v-if="item.isUnpack == '1'">
     <div class="col userInp" style="display: flex; align-items: center">
       <div class="label lable150 rx-cc" style="width: 100px !important"
         >规格选择:</div
@@ -275,7 +275,9 @@
             this.formedNumLast = 0;
           }
           console.log(newVal);
-          this.packageDispositionFn();
+          if (this.item.isUnpack == '1') {
+            this.packageDispositionFn();
+          }
         },
         deep: true,
         immediate: true
@@ -907,9 +909,9 @@
         this.objData.packInfo = packInfo;
         this.objData.taskType = this.objData.currentTaskDiagram.type;
 
-        console.log(this.objData.packInfo, 'this.objData.packInfo')
+        console.log(this.objData.packInfo, 'this.objData.packInfo');
 
-        return
+        return;
       },
 
       calculation() {

+ 2 - 3
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -690,8 +690,7 @@
         return this.$store.state.user.taskObj;
       },
       columns() {
-       
-        let  columnsVersion=this.columnsVersion;
+        let columnsVersion = this.columnsVersion;
         let areaCodeColumns = {
           show: false
         };
@@ -984,7 +983,7 @@
         cacheKeyUrl: 'mes_produce_jobBooking_BatchSemiProductJobBom',
         weight: 0,
         reportWeight: 0,
-        columnsVersion:0,
+        columnsVersion: 0,
         paramList: [],
 
         resultObj: {},

+ 25 - 9
src/views/produce/components/jobBooking/index.vue

@@ -81,13 +81,29 @@
           <div class="title_box rx-bc">
             <div class="name">报工时间</div>
           </div>
+          报工时间:
           <el-date-picker
             v-model="item.workReportInfo.executorTime"
             type="datetime"
             value-format="yyyy-MM-dd HH:mm:ss"
             placeholder="选择日期"
+            style="margin-right: 50px"
           >
           </el-date-picker>
+
+          <!-- 执行人:<el-select
+            v-model="form.warehouseId"
+            placeholder="请选择执行人"
+            filterable
+          >
+            <el-option
+              v-for="item in warehouseList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            >
+            </el-option>
+          </el-select> -->
         </div>
 
         <paramBom
@@ -972,15 +988,15 @@
           return this.$message.warning('请选择执行时间');
         }
 
-        for (let i = 0; i < this.List.length; i++) {
-          if (
-            this.List[i].packInfo &&
-            Object.keys(this.List[i].packInfo).length === 0
-          ) {
-            this.loading.close();
-            return this.$message.warning('请到主数据配置包装规格');
-          }
-        }
+        // for (let i = 0; i < this.List.length; i++) {
+        //   if (
+        //     this.List[i].packInfo &&
+        //     Object.keys(this.List[i].packInfo).length === 0
+        //   ) {
+        //     this.loading.close();
+        //     return this.$message.warning('请到主数据配置包装规格');
+        //   }
+        // }
 
         // if(this.taskObj.type !=6){
         //   if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){

+ 403 - 0
src/views/produce/components/outsourcing/details.vue

@@ -0,0 +1,403 @@
+<template>
+  <div>
+    <!-- <el-card shadow="never" v-loading="loading"> -->
+    <!-- <search @search="reload" ref="searchRef"> </search> -->
+
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="dataList"
+      cache-key="workOrderTable"
+      max-height="68vh"
+      :need-page="false"
+    >
+      <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:code="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="handleDetails(row)"
+            >{{ row.code }}</el-link
+          >
+        </template> -->
+
+      <template v-slot:totalWeight="{ row }">
+        <div v-if="row.totalWeight">{{ row.totalWeight }}</div>
+        <div v-else>无</div>
+      </template>
+
+      <template v-slot:requireDeliveryTime="{ row }">
+        <span v-if="row.deliveryMethod == 1">{{
+          row.requireDeliveryTime
+        }}</span>
+
+        <el-link
+          v-if="row.deliveryMethod == 2"
+          type="primary"
+          :underline="false"
+          @click.native="handleMethod(row)"
+          >分批时间</el-link
+        >
+      </template>
+
+      <template v-slot:type="{ row }">
+        <div v-if="row.type == 1">采购委外</div>
+        <div v-if="row.type == 2">直接发货委外</div>
+        <div v-if="row.type == 3">无采购委外</div>
+        <div v-if="row.type == 4">有料委外</div>
+        <div v-if="row.type == 5">无料委外</div>
+      </template>
+
+      <template v-slot:status="{ row }">
+        <el-tag>{{
+          row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
+        }}</el-tag>
+      </template>
+
+      <template v-slot:outsourceScene="{ row }">
+        <span>{{ row.outsourceScene | outsourceSceneText }}</span>
+      </template>
+
+      <template v-slot:technicalDrawings="{ row }">
+        <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+          <el-link
+            v-for="link in row.technicalDrawings"
+            :key="link.id"
+            type="primary"
+            :underline="false"
+            @click="downloadFile(link)"
+          >
+            {{ link.name }}</el-link
+          >
+        </div>
+      </template>
+
+      <template v-slot:files="{ row }">
+        <div v-if="row.files && row.files?.length">
+          <el-link
+            v-for="link in row.files"
+            :key="link.id"
+            type="primary"
+            :underline="false"
+            @click="downloadFile(link)"
+          >
+            {{ link.name }}</el-link
+          >
+        </div>
+      </template>
+
+      <template v-slot:action="{ row }">
+        <el-link type="primary" :underline="false" @click="handleDetails(row)">
+          详情
+        </el-link>
+
+        <!-- <el-link
+            type="primary"
+            v-if="row.status == 1"
+            :underline="false"
+            @click="handleFlow(row)"
+          >
+            流程
+          </el-link> -->
+        <!--
+          <el-link
+            type="primary"
+            v-if="row.status != 1"
+            :underline="false"
+            @click="handleRelease(row)"
+          >
+            提交
+          </el-link> -->
+      </template>
+    </ele-pro-table>
+    <!-- </el-card> -->
+    <flow ref="flowRef"></flow>
+
+    <release ref="releaseRef" @refresh="releaseRefresh"></release>
+    <detail ref="detailsRef"></detail>
+
+    <timeDialog ref="timeDialogRef"></timeDialog>
+  </div>
+</template>
+
+<script>
+  import { getList } from '@/api/outsourcing/index.js';
+  import flow from '../../../outsourcing/components/flow.vue';
+  import search from '../../../outsourcing/components/search.vue';
+  import release from '../../../outsourcing/components/release.vue';
+  import Detail from '../../../outsourcing/components/details.vue';
+  import timeDialog from '../../../outsourcing/components/timeDialog.vue';
+  import { getFile } from '@/api/system/file';
+  export default {
+    components: {
+      search,
+      flow,
+      release,
+      Detail,
+      timeDialog
+    },
+    data() {
+      return {
+        loading: false,
+        code: '',
+        dataList: [],
+        workOrderCode: ''
+      };
+    },
+    filters: {
+      outsourceSceneText(text) {
+        switch (text) {
+          case 1:
+            return '首工序委外';
+          case 2:
+            return '单工序';
+          case 3:
+            return '多工序';
+          case 4:
+            return '首工序及多工序';
+          default:
+            return '';
+        }
+      }
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            slot: 'code',
+            prop: 'code',
+            label: '委外单编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '委外单名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'workOrderCode',
+            label: '工单编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'taskName',
+            label: '工序',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'totalCount',
+            label: '委外数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'totalWeight',
+            slot: 'totalWeight',
+            label: '委外重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'type',
+            label: '委外类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'outsourceScene',
+            slot: 'outsourceScene',
+            label: '委外场景',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'requireDeliveryTime',
+            label: '预计到货日期',
+            align: 'center',
+            width: 100,
+            showOverflowTooltip: true
+          },
+
+          // {
+          //   prop: 'produceRoutingName',
+          //   label: '工艺路线',
+          //   align: 'center'
+          // },
+
+          {
+            prop: 'warehouseName',
+            label: '仓库',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            width: 100,
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            label: '图片附件',
+            slot: 'technicalDrawings',
+            action: 'technicalDrawings',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+
+          {
+            label: '附件',
+            slot: 'files',
+            action: 'files',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 140,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {},
+
+    methods: {
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      },
+      /* 表格数据源 */
+      // datasource() {
+      //   return getList({
+      //     pageNum: 1,
+      //     size: -1,
+      //     workOrderCode: this.code
+      //   });
+      // },
+
+      getDataList(code) {
+        this.workOrderCode = code;
+        getList({
+          pageNum: 1,
+          size: -1,
+          workOrderCode: this.workOrderCode
+        }).then((res) => {
+          console.log(res);
+          this.dataList = res.list || [];
+          // this.$forceUpdate();
+        });
+      },
+
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+
+      handleFlow(row) {
+        if (!row.processInstanceId) {
+          return this.$message.warning('暂无流程图');
+        }
+        this.$refs.flowRef.open(row.processInstanceId);
+      },
+
+      handleDetails(row) {
+        this.$refs.detailsRef.open(row);
+      },
+
+      handleMethod(row) {
+        this.$refs.timeDialogRef.open(row, 'details');
+      },
+
+      handleRelease(row) {
+        this.$refs.releaseRef.open(row);
+      },
+
+      /* 刷新表格 */
+      reload() {
+        this.$nextTick(() => {
+          this.getList(this.workListIds);
+        });
+      },
+      refresh() {
+        this.getList(this.workListIds);
+      },
+
+      handleAdd() {
+        // this.$refs.releaseRef.open();
+        this.$emit('outsourcingAdd', 'pick');
+      },
+
+      releaseRefresh() {
+        this.$refs.table.reload();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 14 - 3
src/views/produce/components/outsourcing/index.vue

@@ -102,7 +102,7 @@
           </div>
         </el-form-item>
 
-        <el-form-item label="委外单位:">
+        <!-- <el-form-item label="委外单位:">
           <el-select
             v-model="attributeData.taskIds"
             placeholder="请选择"
@@ -116,7 +116,7 @@
               :label="item.name"
             ></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
 
         <el-form-item
           label="工艺路线:"
@@ -170,6 +170,7 @@
 
       <div class="btn-box">
         <el-button type="primary" @click="confirm">确认</el-button>
+        <el-button type="primary" @click="cancel">取消</el-button>
       </div>
     </div>
 
@@ -425,7 +426,14 @@
         handler(val) {
           console.log(val, 'outsourceForm');
           Object.assign(this.attributeData, val);
-          this.newStepsList = this.attributeData.newStepsList;
+
+          console.log(this.attributeData.newStepsList, 'attributeData');
+
+          this.newStepsList = this.attributeData.newStepsList.filter(
+            (item) => item.type != 2 && item.type != 3 && item.type != 6
+          );
+
+          // this.newStepsList = this.attributeData.newStepsList;
           this.getWarehouseFn();
           this.produceFn();
         },
@@ -559,6 +567,9 @@
             return false;
           }
         });
+      },
+      cancel() {
+        this.$emit('changeCancel');
       }
     },
     created() {

+ 19 - 7
src/views/produce/components/outsourcing/outsourceList.vue

@@ -440,6 +440,7 @@
         standardOutputList: [],
 
         isFirstTask: null,
+        isLoading: null,
 
         // clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
         // 	.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
@@ -690,14 +691,25 @@
           standardOutputList: this.standardOutputList
         };
 
-        applyoutsourceSave(param).then((res) => {
-          this.$emit('outScucc');
-          return this.$message({
-            message: '提交成功',
-            type: 'scuccess'
-          });
-          this.checkListLen = 0;
+        this.isLoading = this.$loading({
+          lock: true,
+          text: '加载中',
+          background: 'rgba(0, 0, 0, 0.7)'
         });
+
+        applyoutsourceSave(param)
+          .then((res) => {
+            this.$emit('outScucc');
+            this.isLoading.close();
+            return this.$message({
+              message: '提交成功',
+              type: 'scuccess'
+            });
+            this.checkListLen = 0;
+          })
+          .catch(() => {
+            this.isLoading.close();
+          });
       }
     }
   };

+ 26 - 11
src/views/produce/components/workPlan/components/baseInfo.vue

@@ -119,14 +119,15 @@
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item label="质检人" prop="qualityId">
+          <el-form-item label="质检人" prop="qualityIdList">
             <el-select
               :disabled="btnType == 'detail'"
-              v-model="form.qualityId"
+              v-model="form.qualityIdList"
               @change="changeExecutor"
               size="small"
               style="width: 100%"
               filterable
+              multiple
             >
               <el-option
                 v-for="item in executorList"
@@ -139,14 +140,23 @@
         </el-col>
         <el-col :span="6">
           <el-form-item label="质检时间:" prop="qualityTime">
-            <el-date-picker
+            <!-- <el-date-picker
               class="w100"
               v-model="form.qualityTime"
               type="date"
               value-format="yyyy-MM-dd"
               :disabled="btnType == 'detail'"
               placeholder="请选择"
-            ></el-date-picker>
+            ></el-date-picker> -->
+            <el-date-picker
+              v-model="form.qualityTime"
+              type="datetime"
+              style="width: 100%"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="btnType == 'detail'"
+              placeholder="选择日期"
+            >
+            </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :span="6">
@@ -507,7 +517,7 @@
           groupId: [
             { required: true, message: '请选择质检部门', trigger: 'change' }
           ],
-          qualityId: [
+          qualityIdList: [
             { required: true, message: '请选择质检人', trigger: 'change' }
           ],
           qualityResults: [
@@ -525,6 +535,8 @@
       };
     },
     created() {
+      // this.form.qualityIdList = this.form.qualityId.splice(',');
+      // this.$set(this.form, 'qualityIdList', this.form.qualityId.splice(','));
       this.getDictListIqoCode('measurement_type');
       this.getQualityModeList('quality_method_code');
       // 是否展示合格不合格
@@ -646,6 +658,7 @@
         if (info) {
           const params = { groupId: info };
           this.getUserList(params);
+          console.log(row.name, 'row.name');
           this.form.groupName = row.name;
         } else {
           this.form.executeGroupId = null;
@@ -665,12 +678,14 @@
       },
       // 人员选择
       changeExecutor(val) {
-        if (val) {
-          this.form.qualityId = val;
-          this.form.qualityName = this.executorList.filter(
-            (item) => item.id === val
-          )[0].name;
-        }
+        this.$set(this.form, 'qualityIdList', val);
+        this.$forceUpdate();
+        // if (val) {
+        //   this.form.qualityId = val;
+        //   this.form.qualityName = this.executorList.filter(
+        //     (item) => item.id === val
+        //   )[0].name;
+        // }
       },
       inputTotal(val) {
         if (val) {

+ 21 - 0
src/views/produce/components/workPlan/components/sampleListDialog.vue

@@ -68,6 +68,9 @@
                     v-model="scope.row.qualityResultContent"
                     placeholder="请输入内容"
                     :disabled="type == 'detail'"
+                    @input="
+                      handleInput(scope.row, scope.row.qualityResultContent)
+                    "
                   ></el-input>
                 </template>
               </el-table-column>
@@ -273,6 +276,24 @@
         return getQualityValue;
       },
 
+      handleInput(item, value) {
+        if (item.defaultValue) {
+          const number = Number(item.defaultValue);
+
+          if (isNaN(number)) return;
+
+          const valueNumber = Number(value);
+
+          if (isNaN(valueNumber)) return;
+
+          if (valueNumber > number) {
+            item.qualityResults = 2;
+          } else {
+            item.qualityResults = 1;
+          }
+        }
+      },
+
       handleClose() {
         this.visible = false;
       },

+ 28 - 0
src/views/produce/components/workPlan/details.vue

@@ -177,6 +177,7 @@
   import { getDetailById, planDetails } from '@/api/produce/workPlan';
   import detailMixins from './mixins/detailMixins';
   import { parameterGetByCode, getByCode } from '@/api/system/dictionary-data';
+  import { getUserPage } from '@/api/system/organization';
   export default {
     mixins: [detailMixins],
     data() {
@@ -233,6 +234,19 @@
         this.visible = true;
       },
 
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          // 如果传了参数就是获取巡点检人员数据
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          console.log(res, 'resres');
+          this.executorList = res.list;
+        } catch (error) {}
+      },
+
       async getData() {
         // let id = this.$route.query.id;
         // let name = this.$route.query.name;
@@ -243,6 +257,20 @@
           const result = await api(id);
           console.log(result, 'result');
           const res = result.data;
+          await this.getUserList({ groupId: res.groupId });
+          const qualityName = [];
+          if (res.qualityId && this.executorList.length != 0) {
+            res.qualityId.split(',').forEach((item) => {
+              this.executorList.forEach((el) => {
+                if (el.id == item) {
+                  qualityName.push(el.name);
+                }
+              });
+            });
+          }
+          if (qualityName.length != 0) {
+            res.qualityName = qualityName.join(',');
+          }
           let obj = {};
           this.infoList.map((item) => {
             obj[item.prop] = res[item.prop];

+ 8 - 1
src/views/produce/components/workPlan/edit.vue

@@ -226,7 +226,8 @@
           qualityTimeEnd: '',
           templateList: [],
           sampleMeasureUnit: '',
-          conditionType: null
+          conditionType: null,
+          qualityIdList: []
         };
       };
       return {
@@ -745,6 +746,10 @@
       async getDetail(id) {
         getById(id).then((res) => {
           this.form = res.data;
+
+          this.form.qualityIdList = this.form.qualityId
+            ? this.form.qualityId.split(',')
+            : [];
           this.productId = res.data.productId || '';
           this.statusType = this.form.status == 1 ? true : false;
 
@@ -1267,6 +1272,8 @@
           this.form.qualityTimeEnd = this.getNowTime();
           this.form.qualityTimeStart = this.qualityTimeStart;
 
+          this.form.qualityId = this.form.qualityIdList.join(',');
+
           // if (this.form.qualityMode == 1) {
           //   this.form.qualityResults = '';
           // }

+ 53 - 9
src/views/produce/index.vue

@@ -216,9 +216,15 @@
                 v-if="operationType == 'Outsourcing' && isType == '3'"
                 class="right_main_box"
               >
+                <outsourcingDetails
+                  ref="outsourcingListRef"
+                  @outsourcingAdd="outsourcingAdd"
+                  v-if="!isStep && !isOutsource"
+                ></outsourcingDetails>
                 <outsourcing
                   :outsourceFormVal="outsourceForm"
                   @changePlugIn="changePlugIn"
+                  @changeCancel="changeCancel"
                   v-if="isStep"
                 ></outsourcing>
 
@@ -227,7 +233,7 @@
                   :outsourceFormVal="outObj"
                   @closeForm="closeForm"
                   @outScucc="outScucc"
-                  v-else
+                  v-if="isOutsource"
                 ></outsourceList>
               </div>
             </div>
@@ -300,6 +306,7 @@
   import createError from './components/createError.vue';
   import device from './components/device/index.vue';
   import turnover from './components/turnover/index.vue';
+  import outsourcingDetails from './components/outsourcing/details.vue';
   import { parameterGetByCode } from '@/api/system/dictionary-data';
   import {
     getByTaskId,
@@ -332,7 +339,8 @@
       TaskDialog,
       createError,
       device,
-      turnover
+      turnover,
+      outsourcingDetails
     },
     data() {
       return {
@@ -352,13 +360,13 @@
         arrTow: [],
         produceTaskList: [],
         isType: '',
-        isStep: true,
+        isStep: false,
         outsourceForm: {},
         outObj: {},
         pickingShow: false,
         wokePopup: false,
         workPlanType: '',
-
+        isOutsource: false,
         BomObj: {},
         defaultProps: {
           children: 'children',
@@ -517,11 +525,25 @@
         });
       },
 
+      changeCancel() {
+        this.isStep = false;
+        this.$nextTick(() => {
+          this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
+        });
+      },
+
       closeForm() {
-        this.isStep = true;
+        this.isOutsource = false;
+        this.$nextTick(() => {
+          this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
+        });
       },
       outScucc() {
-        this.operationType = null;
+        // this.operationType = null;
+        this.isOutsource = false;
+        this.$nextTick(() => {
+          this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
+        });
       },
 
       // 切换组件
@@ -539,6 +561,7 @@
         this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
 
         this.isStep = false;
+        this.isOutsource = true;
       },
 
       workSelect(data) {
@@ -551,7 +574,7 @@
           data.list.length > 0 ? data.list[0].bomCategoryId : null;
         this.singleReportInspection =
           data.list.length > 0 ? data.list[0].singleReport : null; //获取选中的工单是单个还是批量
-        this.isStep = true;
+        this.isStep = false;
         this.operationType = null;
         this.workListIds = data.ids;
         this.workData = data;
@@ -712,7 +735,13 @@
         }
       },
 
+      outsourcingAdd() {
+        this.getTaskInstanceByIdFn(this.workListIds[0]);
+        this.isStep = true;
+      },
+
       handOutsource(workOrderId) {
+        this.isType = '';
         // return
         let param = {
           taskId: this.taskObj.id,
@@ -722,11 +751,21 @@
           this.outsourceForm = {
             ...res.data
           };
-          this.outsourceForm.name = this.taskObj.name;
+          this.outsourceForm.name = this.taskObj.name + '委外';
 
           if (res.data.outsource) {
             this.isType = '3';
-            this.getTaskInstanceByIdFn(workOrderId);
+            console.log(this.workData, 'this.workData');
+            if (!this.isStep && !this.isOutsource) {
+              this.$nextTick(() => {
+                this.$refs.outsourcingListRef.getDataList(
+                  this.workData.list[0].code
+                );
+              });
+            }
+            // this.getTaskInstanceByIdFn(workOrderId);
+            // this.$refs.outsourceListRef.getList(workOrderId);
+            // console.log(this.workData[0].list, 'this.workData.list');
           } else {
             return this.$message.warning('此工序不能委外');
           }
@@ -746,12 +785,17 @@
               data.splice(0, arr + 1);
             }
 
+            console.log(this.outsourceForm, 'this.outsourceForm');
+
             this.$set(this.outsourceForm, 'newStepsList', data);
           }
         });
       },
 
       pickAdd() {
+        if (this.workListIds.length > 1) {
+          return this.$message.warning('领料只能选择一个工单!');
+        }
         this.pickingShow = true;
       },
 

+ 51 - 9
src/views/produceOrder/workReport.vue

@@ -200,9 +200,15 @@
                       v-if="operationType == 'Outsourcing' && isType == '3'"
                       class="right_main_box"
                     >
+                      <outsourcingDetails
+                        ref="outsourcingListRef"
+                        @outsourcingAdd="outsourcingAdd"
+                        v-if="!isStep && !isOutsource"
+                      ></outsourcingDetails>
                       <outsourcing
                         :outsourceFormVal="outsourceForm"
                         @changePlugIn="changePlugIn"
+                        @changeCancel="changeCancel"
                         v-if="isStep"
                       ></outsourcing>
 
@@ -211,7 +217,7 @@
                         :outsourceFormVal="outObj"
                         @closeForm="closeForm"
                         @outScucc="outScucc"
-                        v-else
+                        v-if="isOutsource"
                       ></outsourceList>
                     </div>
                   </div>
@@ -294,6 +300,7 @@
   import pickDetails from '@/views/produce/components/picking/details.vue';
   import AssetTree from '@/components/AssetTree/joobIndex.vue';
   import feeding from '@/views/produce/components/feeding/index.vue';
+  import outsourcingDetails from '@/views/produce/components/outsourcing/details.vue';
 
   import jobBooking from '@/views/produce/components/jobBooking/index.vue';
   import workPlan from '@/views/produce/components/workPlan/index.vue';
@@ -341,7 +348,8 @@
       Info,
       feedDetails,
       jobDetails,
-      productionDetails
+      productionDetails,
+      outsourcingDetails
     },
     data() {
       return {
@@ -352,6 +360,7 @@
         title: '',
         type: '',
         loading: false,
+        isLoading: null,
         operationType: null,
         popupType: '', // 弹窗
         workListIds: [],
@@ -361,7 +370,7 @@
         arrTow: [],
         produceTaskList: [],
         isType: '',
-        isStep: true,
+        isStep: false,
         outsourceForm: {},
         outObj: {},
         pickingShow: false,
@@ -374,6 +383,7 @@
         drawer: false,
         workData: {},
         isFullscreen: false,
+        isOutsource: false,
         routeObj: {
           id: null
         },
@@ -540,11 +550,25 @@
         });
       },
 
+      changeCancel() {
+        this.isStep = false;
+        this.$nextTick(() => {
+          this.$refs.outsourcingListRef.getDataList(this.workData.code);
+        });
+      },
+
       closeForm() {
-        this.isStep = true;
+        this.isOutsource = false;
+        this.$nextTick(() => {
+          this.$refs.outsourcingListRef.getDataList(this.workData.code);
+        });
       },
       outScucc() {
-        this.operationType = null;
+        // this.operationType = null;
+        this.isOutsource = false;
+        this.$nextTick(() => {
+          this.$refs.outsourcingListRef.getDataList(this.workData.code);
+        });
       },
 
       // 切换组件
@@ -562,6 +586,7 @@
         this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
 
         this.isStep = false;
+        this.isOutsource = true;
       },
 
       pickingWokeClose() {
@@ -814,21 +839,38 @@
         }
       },
 
-      handOutsource(workOrderId) {
+      outsourcingAdd() {
+        this.getTaskInstanceByIdFn(this.workListIds[0]);
+        this.isStep = true;
+      },
+
+      async handOutsource(workOrderId) {
+        this.isType = '';
         // return
         let param = {
           taskId: this.taskObj.id,
           workOrderId: workOrderId
         };
-        pcCheckOutsource(param).then((res) => {
+        await pcCheckOutsource(param).then((res) => {
           this.outsourceForm = {
             ...res.data
           };
-          this.outsourceForm.name = this.taskObj.taskTypeName;
+          this.outsourceForm.name = this.taskObj.taskTypeName + '委外';
 
           if (res.data.outsource) {
             this.isType = '3';
-            this.getTaskInstanceByIdFn(workOrderId);
+            // this.getTaskInstanceByIdFn(workOrderId);
+            if (!this.isStep && !this.isOutsource) {
+              this.$nextTick(() => {
+                this.$refs.outsourcingListRef.getDataList(this.workData.code);
+              });
+            }
+
+            // console.log(
+            //   this.$refs.outsourcingListRef,
+            //   'this.$refs.outsourcingListRef'
+            // );
+            // this.$refs.outsourcingListRef.getDataList(this.workData.code);
           } else {
             return this.$message.warning('此工序不能委外');
           }

+ 1 - 1
src/views/singleLogin/index.vue

@@ -229,7 +229,7 @@
               this.$store.commit('user/setUserInfo', res.data);
               this.loading = false;
               this.$message.success(res.message);
-              this.$store.dispatch('user/getCurrentUserAuthorityDept');
+              // this.$store.dispatch('user/getCurrentUserAuthorityDept');
               this.goHome();
             })
             .catch((e) => {