Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-aps into dengfei

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

+ 9 - 0
src/api/workOrder/index.js

@@ -58,3 +58,12 @@ export async function getUserInfo(id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//校验当前用户是否是对应班组班组长
+export async function getcheckLoginUserIsTeamLeader(teamId) {
+  const res = await request.get(`/main/team/checkLoginUserIsTeamLeader/${teamId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 27 - 0
src/views/productionPlan/components/factoryAdd/index.vue

@@ -937,6 +937,20 @@
             console.log(this.form.productInfoList);
 
             this.form.productInfoList.forEach((item, index) => {
+              if (item.colorKey && typeof item.colorKey == 'string') {
+                this.$set(
+                  this.form.productInfoList[index],
+                  'colorKey',
+                  item.colorKey.split(',')
+                );
+              }
+              if (item.modelKey && typeof item.modelKey == 'string') {
+                this.$set(
+                  this.form.productInfoList[index],
+                  'modelKey',
+                  item.modelKey.split(',')
+                );
+              }
               if (resAll[index]) {
                 let list = [];
                 let listMap = {};
@@ -1348,6 +1362,19 @@
           // 必填参数校验
           if (!flag) return;
 
+          this.form.productInfoList.forEach((item, index) => {
+            this.$set(
+              this.form.productInfoList[index],
+              'colorKey',
+              item.colorKey.toString()
+            );
+            this.$set(
+              this.form.productInfoList[index],
+              'modelKey',
+              item.modelKey.toString()
+            );
+          });
+
           // this.
           if (!this.form.id) {
             if (this.form.productInfoList.length) {

+ 0 - 12
src/views/productionPlan/index.vue

@@ -654,12 +654,6 @@
             align: 'center',
             minWidth: 120,
             showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.modelKey) {
-                return row.modelKey.toString();
-              }
-              return '';
-            }
           },
           {
             prop: 'colorKey',
@@ -667,12 +661,6 @@
             align: 'center',
             minWidth: 120,
             showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.colorKey) {
-                return row.colorKey.toString();
-              }
-              return '';
-            }
           },
           {
             prop: 'productNum',

+ 24 - 5
src/views/saleOrder/components/create-order.vue

@@ -649,8 +649,8 @@
         loading: false,
         disabledList: [], //已保存数据不做删除
         form: {
-          salesman:'',
-          salesmanId:'',
+          salesman: '',
+          salesmanId: '',
           productInfoList: [],
           deliveryRequirements: 1,
           saleType: 1,
@@ -868,7 +868,21 @@
             }
           }
           if (res.productInfoList && res.productInfoList.length != 0) {
-            res.productInfoList.forEach((item) => {
+            res.productInfoList.forEach((item, index) => {
+              if (item.colorKey && typeof item.colorKey == 'string') {
+                this.$set(
+                  res.productInfoList[index],
+                  'colorKey',
+                  item.colorKey.split(',')
+                );
+              }
+              if (item.modelKey && typeof item.modelKey == 'string') {
+                this.$set(
+                  res.productInfoList[index],
+                  'modelKey',
+                  item.modelKey.split(',')
+                );
+              }
               item.lackNum = null;
             });
           }
@@ -926,8 +940,8 @@
 
       cancel() {
         this.form = {
-          salesmanId:'',
-          salesman:'',
+          salesmanId: '',
+          salesman: '',
           productInfoList: [],
           deliveryRequirements: 1,
           saleType: 1,
@@ -1067,6 +1081,11 @@
             params.sourceSalesOrderId = this.sourceSalesOrderId;
             params.productInfoList.forEach((el) => delete el.id);
           }
+          params.productInfoList.forEach((item) => {
+            item.colorKey = item.colorKey.toString();
+            item.modelKey = item.modelKey.toString();
+          });
+
           createOrUpdate(params)
             .then((res) => {
               this.loading = false;

+ 14 - 12
src/views/saleOrder/components/printTemplateSaleOrder.vue

@@ -81,7 +81,7 @@
               {{ item.specification }}
             </td>
             <td style="padding: 5px"> {{ item.model }}</td>
-            <td style="padding: 5px"> {{ item.colorKey.join(',') }}</td>
+            <td style="padding: 5px"> {{ item.colorKey }}</td>
             <td style="padding: 5px"> {{ item.measuringUnit }}</td>
             <td style="padding: 5px"> {{ item.contractNum }}</td>
             <!-- <td style="padding: 5px"> {{ item.totalCount }}</td>
@@ -116,16 +116,18 @@
 </template>
 
 <script>
-  import { getOrderDetail, getSalesDetail, enterprisePage } from '@/api/saleOrder';
+  import {
+    getOrderDetail,
+    getSalesDetail,
+    enterprisePage
+  } from '@/api/saleOrder';
   import { mapGetters } from 'vuex';
   export default {
     name: 'print',
     computed: {
       ...mapGetters(['user'])
     },
-    props: {
-      
-    },
+    props: {},
     data() {
       return {
         checked: '',
@@ -141,13 +143,13 @@
       async open(row) {
         this.row = row;
         enterprisePage({
-        pageNum: 1,
-        size: 200
-      }).then((res) => {
-        if (res.list?.length > 0) {
-          this.groupName = res.list[0].name;
-        }
-      });
+          pageNum: 1,
+          size: 200
+        }).then((res) => {
+          if (res.list?.length > 0) {
+            this.groupName = res.list[0].name;
+          }
+        });
         this.formData = await getOrderDetail(row.code);
         this.detail = await getSalesDetail(row.id);
         console.log('formData~~~', this.formData, this.detail);

+ 12 - 12
src/views/saleOrder/index.vue

@@ -299,12 +299,12 @@
             align: 'center',
             minWidth: 120,
             showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.modelKey) {
-                return row.modelKey.toString();
-              }
-              return '';
-            }
+            // formatter: (row) => {
+            //   if (row.modelKey) {
+            //     return row.modelKey.toString();
+            //   }
+            //   return '';
+            // }
           },
           {
             prop: 'colorKey',
@@ -312,12 +312,12 @@
             align: 'center',
             minWidth: 120,
             showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.colorKey) {
-                return row.colorKey.toString();
-              }
-              return '';
-            }
+            // formatter: (row) => {
+            //   if (row.colorKey) {
+            //     return row.colorKey.toString();
+            //   }
+            //   return '';
+            // }
           },
           {
             prop: 'specification',

+ 19 - 0
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -1308,6 +1308,20 @@
             item.priority = index + 1;
 
             item.reqMoldTime = item.deliveryTime;
+            if (item.colorKey && typeof item.colorKey == 'string') {
+              this.$set(
+                this.form.salesOrders[index],
+                'colorKey',
+                item.colorKey.split(',')
+              );
+            }
+            if (item.modelKey && typeof item.modelKey == 'string') {
+              this.$set(
+                this.form.salesOrders[index],
+                'modelKey',
+                item.modelKey.split(',')
+              );
+            }
             // dayjs(
             //     new Date(item.deliveryTime).getTime() - 3600 * 1000 * 24 * 10
             // ).format('YYYY-MM-DD');
@@ -1701,6 +1715,11 @@
         if (this.$route.query.type != 'edit') {
           delete params.id;
         }
+        console.log(params, 'params');
+        params.salesOrders.forEach((item) => {
+          item.colorKey = item.colorKey.toString();
+          item.modelKey = item.modelKey.toString();
+        });
 
         if (type === 2) {
           this.$confirm('发布工单后不可撤回,确定发布吗?', '发布确认').then(

+ 3 - 3
src/views/workOrder/components/details.vue

@@ -432,9 +432,9 @@
       fieldValue() {
         return (field) => {
           let value = this.current[field];
-          if (field == 'modelKey' || field == 'colorKey') {
-            return value.toString();
-          }
+          // if (field == 'modelKey' || field == 'colorKey') {
+          //   return value;
+          // }
           if (field == 'produceType') {
             if (value == 1) {
               return 'PBOM';

+ 3 - 15
src/views/workOrder/index.vue

@@ -291,7 +291,7 @@
       }
     },
     created() {
-      this.setColumns()
+      this.setColumns();
       this.getFieldModel();
     },
     methods: {
@@ -412,26 +412,14 @@
             label: '机型',
             align: 'center',
             minWidth: 120,
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.modelKey) {
-                return row.modelKey.toString();
-              }
-              return '';
-            }
+            showOverflowTooltip: true
           },
           {
             prop: 'colorKey',
             label: '颜色',
             align: 'center',
             minWidth: 120,
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.colorKey) {
-                return row.colorKey.toString();
-              }
-              return '';
-            }
+            showOverflowTooltip: true
           },
           {
             prop: 'productCode',

+ 22 - 2
src/views/workOrder/mixins/release.js

@@ -14,7 +14,10 @@ import {
   listByFactoryId,
   checkExists
 } from '@/api/mainData/index.js';
-import { releaseWorkOrder } from '@/api/workOrder/index.js';
+import {
+  releaseWorkOrder,
+  getcheckLoginUserIsTeamLeader
+} from '@/api/workOrder/index.js';
 export default {
   data() {
     return {};
@@ -465,6 +468,21 @@ export default {
         this.$message.warning('请先选择班组');
         return;
       }
+
+      try {
+        const isTeamLeader = await getcheckLoginUserIsTeamLeader(this.form.teamId);
+
+        if (!isTeamLeader) {
+          this.toolbarLoading = false;
+          this.$message.warning('当前班组不是对应组长');
+          return;
+        }
+      } catch (err) {
+        this.toolbarLoading = false;
+        this.$message.error('校验组长身份失败:' + err.message);
+        return;
+      }
+
       if (this.form.taskAss == 1) {
         this.issue();
         // 按原来的逻辑
@@ -504,12 +522,14 @@ export default {
         this.handleClick({ name: data.id });
         return;
       }
+
+      this.toolbarLoading = true;
+
       let params = {
         teamId: this.form.teamId,
         workCenterId: this.form.workCenterId,
         workOrderId: this.current.id
       };
-      this.toolbarLoading = true;
       try {
         const res = await checkAssignConfirm(params);
         if (!res) {