695593266@qq.com před 7 měsíci
rodič
revize
7d761b69bf

+ 10 - 1
src/api/produceOrder/index.js

@@ -256,4 +256,13 @@ export async function queryPrintV2(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+
+//获取用户的工厂,所属工作中中心,班组等信息
+export async function getUserInfo(id) {
+  const res = await request.get(`/main/user/getUserWindow/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 6 - 14
src/api/produceWord/index.js

@@ -24,39 +24,31 @@ export async function releaseWorkOrder({ id, teamId }) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
-
 // 列表
 export async function getteampage(data) {
   const res = await request.get(`/main/team/page`, {
-      params: data
+    params: data
   });
-  console.log(res.data.code == 0)
+  console.log(res.data.code == 0);
   if (res.data.code == 0) {
-      return res.data.data;
+    return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 // 修改优先级
 export async function updatePriority(data) {
-  const res = await request.post(`/aps/workorder/updatePriority`,  data);
+  const res = await request.post(`/aps/workorder/updatePriority`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
-
-
-
-
 // 动态表头
 export async function fieldModel(params) {
-  const res = await request.get(
-    `/main/fieldmodel/list`, { params }
-  );
+  const res = await request.get(`/main/fieldmodel/list`, { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 2 - 2
src/views/byProduct/components/addByProduct.vue

@@ -94,7 +94,7 @@
             >
               <el-table-column label="序号" type="index" width="60">
                 <template slot-scope="{ row, $index }">
-                  {{ $index }}
+                  {{ $index + 1 }}
                 </template>
               </el-table-column>
 
@@ -201,7 +201,7 @@
           categoryId: this.materialList[0].id,
           quantity: this.productWeight
         };
-        console.log(param,'1111111111111111');
+        console.log(param, '1111111111111111');
 
         disposeSave(param).then((res) => {
           this.$emit('close', true);

+ 9 - 2
src/views/materialReturn/index.vue

@@ -23,6 +23,12 @@
           >
         </template>
 
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="handDetailed(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+
         <template v-slot:scene="{ row }">
           {{ sceneListFn(row.scene) }}
         </template>
@@ -34,9 +40,9 @@
         </template>
 
         <template v-slot:action="{ row }">
-          <el-button type="text" size="mini" @click="handDetailed(row)"
+          <!-- <el-button type="text" size="mini" @click="handDetailed(row)"
             >详情</el-button
-          >
+          > -->
           <el-button type="text" size="mini" @click="checkProcess(row)"
             >流程</el-button
           >
@@ -86,6 +92,7 @@
         return [
           {
             prop: 'code',
+            slot: 'code',
             label: '退料单编号',
             align: 'center'
           },

+ 26 - 3
src/views/pick/pickApply/index.vue

@@ -35,6 +35,12 @@
           >
         </template>
 
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="handDetailed(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+
         <template v-slot:joinWorkOrderCode="{ row }">
           <el-tag type="warning" v-if="row.type == 1">自建领料单</el-tag>
           <div v-else>{{ row.joinWorkOrderCode }}</div>
@@ -55,8 +61,12 @@
         </template>
 
         <template v-slot:action="{ row }">
-          <el-button type="text" size="mini" @click="handDetailed(row)"
-            >详情</el-button  
+          <!-- <el-button type="text" size="mini" @click="handDetailed(row)"
+            >详情</el-button
+          > -->
+
+          <el-button type="text" size="mini" @click="checkProcess(row)"
+            >流程</el-button
           >
         </template>
       </ele-pro-table>
@@ -76,6 +86,8 @@
       v-if="selfDetailedShow"
       :detailedObj="detailedObj"
     ></selfDetailed>
+
+    <flow ref="flowRef"></flow>
   </div>
 </template>
 
@@ -83,6 +95,7 @@
   import { getAllPage, returnPage, getPage } from '@/api/pick/pickApply';
 
   import pickSearch from './components/pick-search.vue';
+  import flow from '@/views/materialReturn/components/flow.vue';
 
   import addPick from './components/addPick.vue';
   import selfBuildPick from './components/selfBuildPick.vue';
@@ -96,7 +109,8 @@
       addPick,
       selfBuildPick,
       detailed,
-      selfDetailed
+      selfDetailed,
+      flow
     },
 
     props: {
@@ -138,6 +152,7 @@
           },
           {
             prop: 'code',
+            slot: 'code',
             label: '领料单编号',
             align: 'center',
             align: 'left'
@@ -280,6 +295,14 @@
         this.$refs.table.reload({ page: 1, where });
       },
 
+      //查看流程
+      checkProcess(row) {
+        if (!row.processInstanceId) {
+          return this.$message.warning('暂无流程图');
+        }
+        this.$refs.flowRef.open(row.processInstanceId);
+      },
+
       fullscreenChange(fullscreen) {
         if (fullscreen) {
           this.tableHeight = 'calc(100vh - 120px)';

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

@@ -25,7 +25,6 @@
               size="small"
               class="u-reset-button"
               @click="openPicking(2, 'goods')"
-              v-if="clientEnvironmentId == 3"
             >
               添加
             </el-button>
@@ -343,7 +342,7 @@
                     {{ item.measuringUnit }}
                   </div>
 
-                  <div v-if="clientEnvironmentId == 3">
+                  <div>
                     <el-button type="text" @click="convertList(item, index)"
                       >转物品清单</el-button
                     >

+ 19 - 8
src/views/produce/components/picking/pickingList.vue

@@ -10,7 +10,7 @@
     width="75%"
   >
     <el-card shadow="never">
-      <pickingListSearch @search="reload" ref="searchRef" />
+      <pickingListSearch @search="reload" ref="searchRef" :isType="isType" />
 
       <!-- <pickingSearch v-else @search="reload" ref="pickingRef" /> -->
 
@@ -519,12 +519,22 @@
             showOverflowTooltip: true,
             width: 100
           },
-          {
-            prop: 'pathName',
-            width: 230,
-            label: '仓库',
-            showOverflowTooltip: true
-          },
+          ...(this.isType != 'feed'
+            ? [
+                {
+                  prop: 'pathName',
+                  width: 230,
+                  label: '仓库',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+          // {
+          //   prop: 'pathName',
+          //   width: 230,
+          //   label: '仓库',
+          //   showOverflowTooltip: true
+          // },
 
           ...(this.rootCategoryLevelId == '4'
             ? [
@@ -1041,7 +1051,8 @@
           '9, 23, 2, 1, 4, 14, 5, 8, 16, 13, 15, 6, 10, 22, 1777158952502956034';
         // this.treeIds = '9, 1, 14, 5, 8, 13, 15, 6, 10, 22';
       } else if (this.isType == 'feed') {
-        this.treeIds = '1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 26, 9, 23,28';
+        // this.treeIds = '1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 26, 9, 23,28';
+        this.treeIds = '4, 5, 7, 8, 11, 14, 26';
       } else if (this.isType == 'job') {
         this.treeIds = '4, 7';
       }

+ 15 - 2
src/views/produce/components/picking/pickingListSearch.vue

@@ -7,7 +7,10 @@
     @submit.native.prevent
   >
     <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col
+        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
+        v-if="isType != 'feed'"
+      >
         <el-form-item label="仓库:" prop="warehouseId">
           <template>
             <el-select
@@ -66,7 +69,10 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col
+        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
+        v-if="isType != 'feed'"
+      >
         <el-form-item label="批次号:" prop="batchNo">
           <el-input
             clearable
@@ -131,6 +137,13 @@
 <script>
   import { getWarehouseList } from '@/api/produce/index.js';
   export default {
+    props: {
+      isType: {
+        type: String,
+        default: ''
+      }
+    },
+
     data() {
       // 默认表单数据
       const defaultWhere = {

+ 75 - 25
src/views/produceOrder/components/releaseDialog/index.vue

@@ -49,9 +49,9 @@
               >
                 <el-option
                   v-for="item in workCenterList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
+                  :key="item.centerId"
+                  :label="item.centerName"
+                  :value="item.centerId"
                 >
                 </el-option>
               </el-select>
@@ -67,9 +67,9 @@
               >
                 <el-option
                   v-for="item in teamList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
+                  :key="item.teamId"
+                  :label="item.teamName"
+                  :value="item.teamId"
                 >
                 </el-option>
               </el-select>
@@ -112,6 +112,7 @@
                     :loading="toolbarLoading"
                     type="primary"
                     @click="dispatch(item, 1)"
+                    :disabled="!item.isDisable"
                   >
                     派单
                   </el-button>
@@ -119,6 +120,7 @@
                     :loading="toolbarLoading"
                     type="primary"
                     @click="dispatch(item, 2)"
+                    :disabled="!item.isDisable"
                   >
                     撤回
                   </el-button>
@@ -126,6 +128,7 @@
                     :loading="toolbarLoading"
                     type="primary"
                     @click="dispatch(item, 3)"
+                    :disabled="!item.isDisable"
                   >
                     保存
                   </el-button>
@@ -281,6 +284,7 @@
     taskSave,
     listByFactoryId
   } from '@/api/mainData/index.js';
+  import { getUserInfo } from '@/api/produceOrder/index.js';
 
   export default {
     components: {},
@@ -339,7 +343,8 @@
         factoriesId: '', // 工厂id
         dispatchType: 1,
         time_calc_code: '0', // 是否进行时间赋值 0 否 1 是
-        validDate
+        validDate,
+        userTeamList: []
       };
     },
     computed: {
@@ -532,21 +537,44 @@
         return `${year}-${month}-${date}`;
       },
       // 查询工作中心
+      // async workCenterData() {
+      //   const res = await listWorkCenter(this.current.taskInstanceId);
+      //   this.workCenterList = res;
+      //   if (res.length > 0) {
+      //     console.log(res, '工作中心');
+      //     this.form.factoryName = res[0].factoryName;
+      //     const userData = await getUserInfo(
+      //       this.$store.state.user.info.userId
+      //     );
+      //     console.log(userData, '用户的数据111111111');
+      //     this.form.workCenterId = res[0].id;
+      //     this.factoriesId = res[0].factoryId;
+      //     // 查首工序
+      //     this.changeWork(res[0].id); // 选择工作中心
+      //     this.getProductionData(res[0].id); // 查询产线
+      //     this.FirstTaskIdFn(); // 查询工位数据
+      //     this.getClassesData();
+      //   }
+      // },
+
       async workCenterData() {
-        const res = await listWorkCenter(this.current.taskInstanceId);
-        this.workCenterList = res;
-        if (res.length > 0) {
-          console.log(res, '工作中心');
-          this.form.factoryName = res[0].factoryName;
-          this.form.workCenterId = res[0].id;
-          this.factoriesId = res[0].factoryId;
-          // 查首工序
-          this.changeWork(res[0].id); // 选择工作中心
-          this.getProductionData(res[0].id); // 查询产线
+        const userData = await getUserInfo(this.$store.state.user.info.userId);
+        this.factoriesId = userData.factoryId ? userData.factoryId : '';
+        this.form.factoryName = userData.factoryName
+          ? userData.factoryName
+          : '';
+
+        if (userData.centerList.length != 0) {
+          this.form.workCenterId = userData.centerList[0].centerId;
+          this.workCenterList = userData.centerList;
+          this.userTeamList = userData.teamList;
+          this.changeWork(userData.centerList[0].centerId);
+          this.getProductionData(userData.centerList[0].centerId);
           this.FirstTaskIdFn(); // 查询工位数据
           this.getClassesData();
         }
       },
+
       // 查询工序列表数据
       async changeDispatch(e) {
         this.tabsLoading = true;
@@ -668,16 +696,38 @@
         } catch (err) {}
       },
 
+      // // 选择工作中心
+      // async changeWork(e) {
+      //   this.form.workCenterId = e;
+      //   // this.changeDispatch(); // 查询工序列表
+      //   let data = this.workCenterList.find((item) => item.id == e);
+      //   this.form.workCenterName = data.name;
+      //   this.teamList = data.teamList || [];
+      //   if (this.teamList.length > 0) {
+      //     this.form.teamId = this.teamList[0].id;
+      //     await this.changeGroups(this.teamList[0].id);
+      //   } else {
+      //     // 如果没有 班组数据 将人员数据清空 并且判断
+      //     this.crewList = [];
+      //     this.form.teamId = '';
+      //     let data = this.processList.find((item) => item.id == this.processId);
+      //     if (data.assignType == 2) {
+      //       this.$set(data, 'list', []);
+      //     }
+      //   }
+      // },
       // 选择工作中心
       async changeWork(e) {
         this.form.workCenterId = e;
-        // this.changeDispatch(); // 查询工序列表
-        let data = this.workCenterList.find((item) => item.id == e);
-        this.form.workCenterName = data.name;
-        this.teamList = data.teamList || [];
-        if (this.teamList.length > 0) {
-          this.form.teamId = this.teamList[0].id;
-          await this.changeGroups(this.teamList[0].id);
+
+        let data = this.userTeamList.filter((item) =>
+          item.workCenterIds.includes(e)
+        );
+
+        this.teamList = data || [];
+        if (this.teamList.length != 0) {
+          this.form.teamId = this.teamList[0].teamId;
+          await this.changeGroups(this.teamList[0].teamId);
         } else {
           // 如果没有 班组数据 将人员数据清空 并且判断
           this.crewList = [];
@@ -690,7 +740,7 @@
       },
       // 选择班组 查询人员的数据
       async changeGroups(e) {
-        let data = this.teamList.find((item) => item.id == e);
+        let data = this.teamList.find((item) => item.teamId == e);
         this.form.teamName = data.name;
         try {
           const res = await listUserByIds([e]);

+ 9 - 2
src/views/warehousing/index.vue

@@ -13,6 +13,12 @@
         :height="tableHeight"
         @fullscreen-change="fullscreenChange"
       >
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="details(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+
         <template v-slot:totalCount="{ row }">
           {{ row.totalCount }} {{ row.measuringUnit }}
         </template>
@@ -43,9 +49,9 @@
           >
             入库
           </el-link>
-          <el-link type="primary" :underline="false" @click="details(row)">
+          <!-- <el-link type="primary" :underline="false" @click="details(row)">
             详情
-          </el-link>
+          </el-link> -->
         </template>
       </ele-pro-table>
     </el-card>
@@ -95,6 +101,7 @@
           },
           {
             prop: 'code',
+            slot: 'code',
             label: '编码',
             align: 'center',
             minWidth: 110,