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

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

lucw 8 месяцев назад
Родитель
Сommit
81aa7d8157

+ 3 - 2
src/views/material/BOMmanage/components/attribute.vue

@@ -124,7 +124,7 @@
         <el-col :span="8" label-width="100px">
           <el-form-item label="生产类型:" prop="produceType">
             <el-select
-              v-model="attributeData?.category.produceType"
+              v-model="attributeData.produceType"
               disabled
               filterable
               multiple
@@ -143,8 +143,9 @@
         <el-col :span="8" label-width="100px">
           <el-form-item label="存货类型:" prop="attributeType">
             <el-select
-              v-model="attributeData.category.attributeType"
+              v-model="attributeData.attributeType"
               disabled
+              filterable
               class="ele-block"
             >
               <el-option

+ 1 - 1
src/views/material/product/detail.vue

@@ -92,7 +92,7 @@
                 prop="produceType"
                 :rules="{
                   required:
-                    form.categoryLevelPathId == 9 ||
+                    form.categoryLevelPathId.substring(0, 1) == 9 ||
                     form.componentAttribute.includes(1) == 1
                       ? true
                       : false,

+ 417 - 405
src/views/workforceManagement/schedule/detail.vue

@@ -4,6 +4,13 @@
       <el-card shadow="never">
         <template v-slot:header>
           <div class="top-search-group">
+            <el-button
+              type="primary"
+              icon="el-icon-back"
+              style="margin-right: 30px"
+              @click="goBack"
+              >返回</el-button
+            >
             <el-input
               placeholder="搜索班次"
               v-model="form.bc"
@@ -21,8 +28,8 @@
               :style="`background-color:${classesColor[item.id]}`"
               v-for="item in showClassesList"
               :key="item.id"
-              >{{ item.name }} </div
-            >
+              >{{ item.name }}
+            </div>
             <div
               class="item"
               @click="handlselected(item)"
@@ -62,445 +69,450 @@
   </div>
 </template>
 <script>
-import {
-  getpullDown,
-  teamqueuedetailSave,
-  getByIdteamqueue,
-  teamqueuedetailupdate
-} from '@/api/workforceManagement/schedule';
-import ManagementTable from './components/ManagementTable.vue';
-import { finishPageTab } from '@/utils/page-tab-util';
-import { debounce } from 'throttle-debounce';
-export default {
-  components: {
-    ManagementTable
-  },
-  data() {
-    const defaultForm = {
-      bc: '',
-      checked_bc: ''
-    };
-    return {
-      defaultForm,
-      // 表单数据
-      form: { ...defaultForm },
-      // 表单验证规则
-      rules: {},
-      type: '', // add/edit
-      loading: false,
-      colorList: [],
-      showClassesList: [],
-      classesList: [],
-      defaultbtn: [
-        {
-          name: '休息',
-          id: '1'
-        },
-        {
-          name: '清除单元格',
-          id: 'clear'
-        }
-      ],
-      selectedClasses: [],
-      classesColor: {
-        1: '#979d9d',
-        clear: '#979d9d'
-      },
-      addInfo: ''
-    };
-  },
-  computed: {
-    title() {
-      switch (this.type) {
-        case 'add':
-          return '排班';
-          break;
-        case 'edit':
-          return '排班';
-          break;
-        default:
-          break;
-      }
-    }
-  },
-  async created() {
-    this.search = debounce(500, this.search);
-    this.init();
-    await this.getBc();
-    
-  },
-  methods: {
-    // 初始化数据
-    init() {
-      if (this.$route.query.type) {
-        this.type = this.$route.query.type;
-        if (this.type == 'add') {
-          this.addInfo = this.$store.state.team.addInfo;
-          this.setAddinfo();
-        } else if (this.type == 'edit') {
-          // 按班排班
-          let isSchedule = this.$route.query.isSchedule;
-          if (isSchedule == '1') {
-            this.$nextTick(() => {
-              this.$refs.ManagementTable.changanbp();
-            });
+  import {
+    getpullDown,
+    teamqueuedetailSave,
+    getByIdteamqueue,
+    teamqueuedetailupdate
+  } from '@/api/workforceManagement/schedule';
+  import ManagementTable from './components/ManagementTable.vue';
+  import { finishPageTab } from '@/utils/page-tab-util';
+  import { debounce } from 'throttle-debounce';
+  export default {
+    components: {
+      ManagementTable
+    },
+    data() {
+      const defaultForm = {
+        bc: '',
+        checked_bc: ''
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {},
+        type: '', // add/edit
+        loading: false,
+        colorList: [],
+        showClassesList: [],
+        classesList: [],
+        defaultbtn: [
+          {
+            name: '休息',
+            id: '1'
+          },
+          {
+            name: '清除单元格',
+            id: 'clear'
           }
-          this.getByIdteamqueue(this.$route.query.id);
+        ],
+        selectedClasses: [],
+        classesColor: {
+          1: '#979d9d',
+          clear: '#979d9d'
+        },
+        addInfo: ''
+      };
+    },
+    computed: {
+      title() {
+        switch (this.type) {
+          case 'add':
+            return '排班';
+            break;
+          case 'edit':
+            return '排班';
+            break;
+          default:
+            break;
         }
       }
     },
-    /* 保存 */
-    save() {
-      switch (this.type) {
-        case 'add':
-          this.add();
-          break;
-        case 'edit':
-          this.update();
-          break;
-        default:
-          break;
-      }
+    async created() {
+      this.search = debounce(500, this.search);
+      this.init();
+      await this.getBc();
     },
-    // 修改
-    update() {
-      // 源数据
-      let personData = this.$refs.ManagementTable.personData;
-      let teamData = this.$refs.ManagementTable.teamData;
-
-      let personDetails = [];
-      let teamDetails = [];
-      // 处理人员数据
-      personData.forEach((n) => {
-        // 时间数据
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-            teamQueueTime.push({
-              date: key != 'null' ? key : null ,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
+    methods: {
+      // 初始化数据
+      init() {
+        if (this.$route.query.type) {
+          this.type = this.$route.query.type;
+          if (this.type == 'add') {
+            this.addInfo = this.$store.state.team.addInfo;
+            this.setAddinfo();
+          } else if (this.type == 'edit') {
+            // 按班排班
+            let isSchedule = this.$route.query.isSchedule;
+            if (isSchedule == '1') {
+              this.$nextTick(() => {
+                this.$refs.ManagementTable.changanbp();
+              });
+            }
+            this.getByIdteamqueue(this.$route.query.id);
           }
         }
-
-        personDetails.push({
-          id: n.item.id,
-          userId: n.item.userId,
-          type: n.item.type,
-          teamId: n.item.teamId,
-          teamQueueTime
-        });
-      });
-      // 处理班组数据
-      teamData.forEach((n) => {
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-            teamQueueTime.push({
-              date: key,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
-          }
+      },
+      /* 保存 */
+      save() {
+        switch (this.type) {
+          case 'add':
+            this.add();
+            break;
+          case 'edit':
+            this.update();
+            break;
+          default:
+            break;
         }
-        teamDetails.push({
-          id: n.item.id,
-          type: n.item.type,
-          teamId: n.item.teamId,
-          teamQueueTime
-        });
-      });
-      let par = {
-        id: this.$route.query.id,
-        personDetails,
-        teamDetails
-      };
-      const loading = this.$messageLoading('正在请求中..');
-      teamqueuedetailupdate(par).then((msg) => {
-        this.$message.success(msg);
-        this.rest();
-      }).finally(() => {
-        loading.close();
-      })
-    },
-    // 处理新增信息
-    setAddinfo() {
-      if (this.addInfo) {
-        let addInfo = this.addInfo;
-        // 人员数据
-        let personDetails = addInfo.personDetails.map((n) => {
-          return {
-            item: {
-              name: n.userName,
-              ...n
+      },
+      // 修改
+      update() {
+        // 源数据
+        let personData = this.$refs.ManagementTable.personData;
+        let teamData = this.$refs.ManagementTable.teamData;
+
+        let personDetails = [];
+        let teamDetails = [];
+        // 处理人员数据
+        personData.forEach((n) => {
+          // 时间数据
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key != 'null' ? key : null,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
             }
-          };
+          }
+
+          personDetails.push({
+            id: n.item.id,
+            userId: n.item.userId,
+            type: n.item.type,
+            teamId: n.item.teamId,
+            teamQueueTime
+          });
         });
-        // 班组数据
-        let teamDetails = addInfo.teamDetails.map((n) => {
-          return {
-            item: {
-              name: n.teamName,
-              ...n
+        // 处理班组数据
+        teamData.forEach((n) => {
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
             }
-          };
-        });
-        this.$nextTick(() => {
-          this.$refs.ManagementTable.setData(personDetails, teamDetails);
-        });
-      }
-    },
-    // 新增
-    add() {
-      let addInfo = this.$store.state.team.addInfo;
-      // 源数据
-      let personData = this.$refs.ManagementTable.personData;
-      let teamData = this.$refs.ManagementTable.teamData;
-
-      let personDetails = [];
-      let teamDetails = [];
-      // 处理人员数据
-      personData.forEach((n) => {
-        // 时间数据
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-            teamQueueTime.push({
-              date: key,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
           }
+          teamDetails.push({
+            id: n.item.id,
+            type: n.item.type,
+            teamId: n.item.teamId,
+            teamQueueTime
+          });
+        });
+        let par = {
+          id: this.$route.query.id,
+          personDetails,
+          teamDetails
+        };
+        const loading = this.$messageLoading('正在请求中..');
+        teamqueuedetailupdate(par)
+          .then((msg) => {
+            this.$message.success(msg);
+            this.rest();
+          })
+          .finally(() => {
+            loading.close();
+          });
+      },
+      // 处理新增信息
+      setAddinfo() {
+        if (this.addInfo) {
+          let addInfo = this.addInfo;
+          // 人员数据
+          let personDetails = addInfo.personDetails.map((n) => {
+            return {
+              item: {
+                name: n.userName,
+                ...n
+              }
+            };
+          });
+          // 班组数据
+          let teamDetails = addInfo.teamDetails.map((n) => {
+            return {
+              item: {
+                name: n.teamName,
+                ...n
+              }
+            };
+          });
+          this.$nextTick(() => {
+            this.$refs.ManagementTable.setData(personDetails, teamDetails);
+          });
         }
+      },
+      // 新增
+      add() {
+        let addInfo = this.$store.state.team.addInfo;
+        // 源数据
+        let personData = this.$refs.ManagementTable.personData;
+        let teamData = this.$refs.ManagementTable.teamData;
 
-        personDetails.push({
-          userId: n.item.userId,
-          type: n.item.type,
-          teamId: n.item.teamId,
-          teamQueueTime
-        });
-      });
-      // 处理班组数据
-      teamData.forEach((n) => {
-        let teamQueueTime = [];
-        for (const [key, value] of Object.entries(n)) {
-          if (key !== 'item') {
-          
-            teamQueueTime.push({
-              date: key,
-              teamTimeSimple: value.map((el) => {
-                return {
-                  id: el.id
-                };
-              })
-            });
+        let personDetails = [];
+        let teamDetails = [];
+        // 处理人员数据
+        personData.forEach((n) => {
+          // 时间数据
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
+            }
           }
-        }
-        teamDetails.push({
-          type: n.item.type,
-          teamId: n.item.teamId,
-          
 
+          personDetails.push({
+            userId: n.item.userId,
+            type: n.item.type,
+            teamId: n.item.teamId,
+            teamQueueTime
+          });
         });
-      });
-      let par = {
-        name: addInfo.name,
-        totalPersonNumber: addInfo.totalPersonNumber,
-        personDetails,
-        teamDetails
-      };
-      const loading = this.$messageLoading('正在请求中..');
-      teamqueuedetailSave(par).then((msg) => {
-        this.$message.success(msg);
-        finishPageTab();
-      }).finally(() => {
-        loading.close();
-      })
-    },
-    // 重置
-    rest() {
-      if (this.type == 'add') {
-        this.setAddinfo();
-      } else if (this.type == 'edit') {
-        this.getByIdteamqueue(this.$route.query.id);
-      }
-    },
-    // 配置颜色
-    configColor() {
-      this.classesList.forEach((element, index) => {
-        console.log(element.id)
-        this.$set(this.classesColor, element.id, this.colorList[index]);
-      });
-    },
-    handleClose() {
-      this.visible = false;
-    },
-    handlselected(val) {
-      if (val.id == '1' || val.id == 'clear') {
-        this.selectedClasses = [val];
-      } else {
-        let result = this.selectedClasses.find((n) => {
-          return ['1', 'clear'].includes(n.id);
+        // 处理班组数据
+        teamData.forEach((n) => {
+          let teamQueueTime = [];
+          for (const [key, value] of Object.entries(n)) {
+            if (key !== 'item') {
+              teamQueueTime.push({
+                date: key,
+                teamTimeSimple: value.map((el) => {
+                  return {
+                    id: el.id
+                  };
+                })
+              });
+            }
+          }
+          teamDetails.push({
+            type: n.item.type,
+            teamId: n.item.teamId
+          });
         });
-        if (result) {
-          this.selectedClasses = [];
+        let par = {
+          name: addInfo.name,
+          totalPersonNumber: addInfo.totalPersonNumber,
+          personDetails,
+          teamDetails
+        };
+        const loading = this.$messageLoading('正在请求中..');
+        teamqueuedetailSave(par)
+          .then((msg) => {
+            this.$message.success(msg);
+            finishPageTab();
+          })
+          .finally(() => {
+            loading.close();
+          });
+      },
+      // 重置
+      rest() {
+        if (this.type == 'add') {
+          this.setAddinfo();
+        } else if (this.type == 'edit') {
+          this.getByIdteamqueue(this.$route.query.id);
         }
-        this.selectedClasses.push(val);
-      }
-      // 去重
-      this.selectedClasses = Array.from(new Set(this.selectedClasses));
-    },
-    // 删除标签
-    handleClose(tag) {
-      this.selectedClasses.splice(this.selectedClasses.indexOf(tag), 1);
-    },
-    // 获取班次
-    getBc() {
-      return getpullDown().then((res) => {
-        this.classesList = res.map((n) => {
-          return {
-            id: n.id,
-            name: `${n.name}(${n.startTime.slice(0, 5)}-${n.endTime.slice(
-              0,
-              5
-            )})`
-          };
+      },
+      // 配置颜色
+      configColor() {
+        this.classesList.forEach((element, index) => {
+          console.log(element.id);
+          this.$set(this.classesColor, element.id, this.colorList[index]);
         });
-     
-        let len = Math.round(this.classesList.length/5)
-        len == 0 ? len = 1 : len
-    
-        const color = [
+      },
+      handleClose() {
+        this.visible = false;
+      },
+      handlselected(val) {
+        if (val.id == '1' || val.id == 'clear') {
+          this.selectedClasses = [val];
+        } else {
+          let result = this.selectedClasses.find((n) => {
+            return ['1', 'clear'].includes(n.id);
+          });
+          if (result) {
+            this.selectedClasses = [];
+          }
+          this.selectedClasses.push(val);
+        }
+        // 去重
+        this.selectedClasses = Array.from(new Set(this.selectedClasses));
+      },
+      // 删除标签
+      handleClose(tag) {
+        this.selectedClasses.splice(this.selectedClasses.indexOf(tag), 1);
+      },
+      // 获取班次
+      getBc() {
+        return getpullDown().then((res) => {
+          this.classesList = res.map((n) => {
+            return {
+              id: n.id,
+              name: `${n.name}(${n.startTime.slice(0, 5)}-${n.endTime.slice(
+                0,
+                5
+              )})`
+            };
+          });
+
+          let len = Math.round(this.classesList.length / 5);
+          len == 0 ? (len = 1) : len;
+
+          const color = [
             '#fb6f7b',
             '#f59a23',
             '#4672ca',
             '#2196f3',
             '#00bcd4',
-            '#009688',
-        ]
-        for(var i = 0;i<len;i++){
-            this.colorList = this.colorList.concat(color)
-        }
-        this.showClassesList = this.classesList;
-
-        this.configColor();
-      });
-    },
-    // 搜索
-    search(val) {
-      if (val !== '') {
-        this.showClassesList = this.classesList.filter((n) => {
-          return n.name.toLowerCase().indexOf(val.toLowerCase()) > -1;
-        });
-      } else {
-        this.showClassesList = this.classesList;
-      }
-    },
-    // 获取排班详情
-    getByIdteamqueue(id) {
-      getByIdteamqueue(id).then((res) => {
-        // 回显数据
-        //人员数据
-        let personDetails = res.personDetails.map((n) => {
-          let item = {
-            name: n.userName,
-            ...n
-          };
-          delete item.teamQueueTime;
-          let teamQueueTime = {};
-          if (n.teamQueueTime) {
-            n.teamQueueTime.forEach((el) => {
-              teamQueueTime[el.date] = el.teamTimeSimple;
-            });
+            '#009688'
+          ];
+          for (var i = 0; i < len; i++) {
+            this.colorList = this.colorList.concat(color);
           }
+          this.showClassesList = this.classesList;
 
-          return {
-            item,
-            ...teamQueueTime
-          };
+          this.configColor();
         });
-        // 班组数据
-        let teamDetails = res.teamDetails.map((n) => {
-          let item = {
-            name: n.teamName,
-            ...n
-          };
-          delete item.teamQueueTime;
-          let teamQueueTime = {};
-          if (n.teamQueueTime) {
-            n.teamQueueTime.forEach((el) => {
-              teamQueueTime[el.date] = el.teamTimeSimple;
-            });
-          }
+      },
 
-          return {
-            item,
-            ...teamQueueTime
-          };
-        });
-        this.$nextTick(() => {
-          this.$refs.ManagementTable.setData(personDetails, teamDetails);
+      goBack() {
+        this.$router.go(-1);
+      },
+
+      // 搜索
+      search(val) {
+        if (val !== '') {
+          this.showClassesList = this.classesList.filter((n) => {
+            return n.name.toLowerCase().indexOf(val.toLowerCase()) > -1;
+          });
+        } else {
+          this.showClassesList = this.classesList;
+        }
+      },
+      // 获取排班详情
+      getByIdteamqueue(id) {
+        getByIdteamqueue(id).then((res) => {
+          // 回显数据
+          //人员数据
+          let personDetails = res.personDetails.map((n) => {
+            let item = {
+              name: n.userName,
+              ...n
+            };
+            delete item.teamQueueTime;
+            let teamQueueTime = {};
+            if (n.teamQueueTime) {
+              n.teamQueueTime.forEach((el) => {
+                teamQueueTime[el.date] = el.teamTimeSimple;
+              });
+            }
+
+            return {
+              item,
+              ...teamQueueTime
+            };
+          });
+          // 班组数据
+          let teamDetails = res.teamDetails.map((n) => {
+            let item = {
+              name: n.teamName,
+              ...n
+            };
+            delete item.teamQueueTime;
+            let teamQueueTime = {};
+            if (n.teamQueueTime) {
+              n.teamQueueTime.forEach((el) => {
+                teamQueueTime[el.date] = el.teamTimeSimple;
+              });
+            }
+
+            return {
+              item,
+              ...teamQueueTime
+            };
+          });
+          this.$nextTick(() => {
+            this.$refs.ManagementTable.setData(personDetails, teamDetails);
+          });
         });
-      });
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.location-warp {
-  display: flex;
-  .detail {
-    margin-left: 10px;
-  }
-}
-.top-search-group {
-  max-width: 400px;
-  display: flex;
-  :deep(.el-input input) {
-    border-top-right-radius: 0;
-    border-bottom-right-radius: 0;
-    border-right-width: 0;
-  }
-  .el-button {
-    border-top-left-radius: 0;
-    border-bottom-left-radius: 0;
-  }
-}
-.bc-warp {
-  display: flex;
-  flex-wrap:wrap;
-  .item {
-    height: 34px;
-    padding: 0 10px;
-    color: #fff;
-    border-radius: 4px;
-    cursor: pointer;
-    margin-right: 10px;
-    margin-bottom:10px;
+  .location-warp {
+    display: flex;
+    .detail {
+      margin-left: 10px;
+    }
   }
-  .item + .item {
-    margin-right: 10px;
-    margin-bottom:10px;
+  .top-search-group {
+    max-width: 400px;
+    display: flex;
+    :deep(.el-input input) {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+      border-right-width: 0;
+    }
+    .el-button {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
   }
-  .tag {
-    color: #fff;
-    height: 34px;
-    border: none;
-    line-height: 34px;
-    margin:0 10px 10px 0;
-    :deep(.el-tag__close) {
+  .bc-warp {
+    display: flex;
+    flex-wrap: wrap;
+    .item {
+      height: 34px;
+      padding: 0 10px;
+      color: #fff;
+      border-radius: 4px;
+      cursor: pointer;
+      margin-right: 10px;
+      margin-bottom: 10px;
+    }
+    .item + .item {
+      margin-right: 10px;
+      margin-bottom: 10px;
+    }
+    .tag {
       color: #fff;
+      height: 34px;
+      border: none;
+      line-height: 34px;
+      margin: 0 10px 10px 0;
+      :deep(.el-tag__close) {
+        color: #fff;
+      }
     }
   }
-}
 </style>

+ 2 - 2
vue.config.js

@@ -35,14 +35,14 @@ module.exports = {
         // target: 'http://192.168.1.105:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.251:18086',
 
         // target: 'http://192.168.1.251:18086', // 开发
-        target: 'http://192.168.1.116:18086', // 赵沙金
+        // target: 'http://192.168.1.116:18086', // 赵沙金
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {